MZ@ !L!This program cannot be run in DOS mode. $CQ000h000m0i0j0o0Rich0PEdDR"  n,`nn`P98@(Pxm0PnP@8.text `.data @.pdata0 @@.idata2@ @@.rsrcxmPm@@.relocPnn@B0DR) RSDS+μMI/AF12Resources.pdbH(u .H(H\$ UHH e3H2-+EHHtH;tHHuHM ~.HE HE`.H1E\.H1E`.HH1EP.HMH3EH3HMHE.EH HH3EH3EH#HEH HH H\$HH ]B  4 2P$CRxF12Resources.dll] f2-+,J4P'<@@@@A@`@$A@@@@@A@DisableThreadLibraryCalls0QueryPerformanceCounterGetCurrentProcessIdGetCurrentThreadIdGetSystemTimeAsFileTimeGetTickCountKERNEL32.dllآ(@X  J> > > ?0 2?H V?` z?x ? ? @ A *B ZB B B8 CP 4Ch jC C C D BD D vD D( >E@ 8@X f@p @ @ E E @F @F A0TAHA`AxAFF GG"HhH H8HPIhXIIIJyyn o8oPph|ppqrrzz<{({@{X^|pWW|}`}}}P0H~H~`~xH L N8PĀhЁ*`҃(R@X pzQƄPR…0\H `xJJPJJK0KbK K8MPMhHNNNOPFOrOO(LP@PXOpKKKL4L^L L L0 LH M` p(v(((j((2))0)H)`)ȉx))4)f) ) ) ) * * (* 8* H* X* h* x* * * * * * * * * + + (+ 8+ H+ X+ h+ x+ + + + + + + + + , , (, 8, H, X, h, x, , , , , , , , , - - (- 8- H- X- h- x- - - - - - - - - . . (. 8. H. X. h. x. . . . . . . . . / / (/ 8/ H/ X/ h/ x/ / / / / / / / / 0 0 (0 80 H0 X0 h0 x0 0 0 0 0 0 0 0 0 1 1 (1 81 H1 X1 h1 x1 1 1 1 1 1 1 1 1 2 2 (2 82 H2 X2 h2 x2 2 2 2 2 2 2 2 2 3 3 (3 83 H3 X3 h3 x3 3 3 3 3 3 3 3 3 4 4 (4 84 H4 X4 h4 x4 4 4 4 4 4 4 4 4 5 5 (5 85 H5 X5 h5 x5 5 5 5 5 5 5 5 5 6 6 (6 86 H6 X6 h6 x6 6 6 6 6 6 6 6 6 7 7 (7 87 H7 X7 h7 x7 7 7 7 7 7 7 7 7 8 8 (8 88 H8 X8 h8 x8 8 8 8 8 8 8 8 8 9 9 (9 89 H9 X9 h9 x9 9 9 9 9 9 9 9 9 : : (: 8: H: X: h: x: : : : : : : : : ; ; (; 8; H; X; h; x; ; ; ; ; ; ; ; ; < < (< 8< H< X< h< x< < < < < < < < < = = (= 8= H= X= h= x= = = = = = = = = > > (> 8> H> X> h> x> >Hnp x 8,X>}@(i BR ghl ~%0 m  w( 2 z H X H T\ a n(f xl 0g E0o t # E0  bX + 4N 8 + ` uؿ pH & !@ +G  _{M؀\88pUءR0bHBdH$r#tP-U#(.J - x. -8 p.;.HK.b -. -f X.i./ ]. u.}1!J{!u ! P.;K(d/e/e/f/pg/@h/h/i/Q/>S/!X/ c/0c/5.Q/8b8>8 j/G8/ͅ(8#,8HG8=؄::w.c ::):.: :-@:2x::7Ȫ:<:[#h:+:0:":/ :4:<;7;<(;/X;<;A;8;E`;JX:/:<:A;@;;0;@'=+$ LHCXLHHLH; UHVHWHn aHaH`bH8kHkHp;J7P;7P;<8Q;85<H7<H9<u#=%=lHPH)H.H ЍH-H2P.YK/8H3(H3C`II)I >0I pL K^xLXL& LLWpWM[M؝M M"MopNz"N .N :N6?N @N8n X-n P#TؒUMSNs%yNtSSS TTg!TZ*TUpUb>U JU hVU/ cU oU 8{Us(X[7VX`YX5k^Pm^}^78^k ^V ^G H^^ (XHX' Yo Y *5Y'0^94pH^ # X fm fخf6ffPHf f+ f$H gHgH'g 2gxHgyIgcg0^=H^O _;hG_hM_*w_xsg1GmJm 8VmAnm Hm|A(+n-(zm8m[7Gn:n MMmMEnMG@uMCHOOSER/CHOOSER.CSSCHOOSER/CHOOSER.HTMLCHOOSER/CHOOSER.JSCOMMON/ASSERT.JSCOMMON/BUTTON.CSSCOMMON/COMMON.CSSCOMMON/COMMONMERGED.JSCOMMON/COMMONMINIMAL.JSCOMMON/DATATREEVIEW.CSSCOMMON/HTMLTREEVIEW.CSSCOMMON/ISDEBUGBUILD.JSCOMMON/ITEMCOLLAPSEDICON.PNGCOMMON/ITEMEXPANDEDICON.PNGCOMMON/LISTBOX.CSSCOMMON/PLUGIN.JSCOMMON/REMOTEEDITSTACK.JSCOMMON/REMOTEHELPERS.JSCOMMON/TOOLBAR.CSSCOMMON/TOOLWINDOW.CSSCOMMON/TRACE.JSCOMMON/IMAGES/ADD_ROW.PNGCOMMON/IMAGES/CLOSE.PNGCOMMON/IMAGES/COLUMNMOVE.PNGCOMMON/IMAGES/COMMON_ICONS.PNGCOMMON/IMAGES/F12LOGO.PNGCOMMON/IMAGES/HELP.PNGCOMMON/IMAGES/MAXIMIZE.PNGCOMMON/IMAGES/MINIMIZE.PNGCOMMON/IMAGES/MISC_ICONS.PNGCOMMON/IMAGES/OPTIONS.PNGCOMMON/IMAGES/REFRESH.PNGCOMMON/IMAGES/RESTORE.PNGCOMMON/IMAGES/TREE_ICONS.PNGCOMMON/IMAGES/TABCLOSE.PNG+COMMON/INTELLISENSE/INTELLISENSELISTBOX.CSS0COMMON/INTELLISENSE/INTELLISENSEREMOTEHELPERS.JS$COMMON/OBJECTVIEW/OBJECTTREEVIEW.CSS*COMMON/OBJECTVIEW/TREEVIEWREMOTEHELPERS.JS&COMMON/OBJECTVIEW/TREEVIEWUTILITIES.JSCOMMON/REMOTE/RPC.JSCONSOLE/CONSOLE.CSSCONSOLE/CONSOLE.HTMLCONSOLE/CONSOLEMERGED.JSCONSOLE/MANIFEST.JSONCONSOLE/REMOTE.JSCONSOLE/REMOTEMAIN.JSCONSOLE/TABICON.PNG CONSOLE/IMAGES/I_CLEAR-INPUT.PNG"CONSOLE/IMAGES/I_CONSOLE-INPUT.PNG#CONSOLE/IMAGES/I_CONSOLE-OUTPUT.PNGCONSOLE/IMAGES/I_DELETE.PNGCONSOLE/IMAGES/I_ERROR.PNGCONSOLE/IMAGES/I_EXECUTE.PNGCONSOLE/IMAGES/I_INFO.PNG!CONSOLE/IMAGES/I_TOGGLE-MULTI.PNG"CONSOLE/IMAGES/I_TOGGLE-SINGLE.PNGCONSOLE/IMAGES/I_WARNING.PNGDOM/CSSINFORMATIONEXTRACTOR.JSDOM/COMPUTEDSTYLES.CSSDOM/COMPUTEDSTYLEVIEW.JS DOM/DOM.HTMLDOM/DOMEXPLORER.CSSDOM/DOMEXPLORERMERGED.JSDOM/EVENTS.CSSDOM/EXPANDINGLISTVIEW.CSSDOM/INSPECT.HTMLDOM/LAYOUT.CSSDOM/MANIFEST.JSON DOM/REMOTE.JSDOM/REMOTECHUNKER.JSDOM/REMOTEEDIT.JSDOM/REMOTEELEMENTCOPIER.JSDOM/REMOTEMAIN.JSDOM/REMOTEMUTATIONMANAGER.JSDOM/REMOTESTYLE.JSDOM/STYLEVIEW.CSSDOM/TABICON.PNGDOM/TRACESTYLEVIEW.CSS#DOM/IMAGES/BREADCRUMBSCROLLLEFT.PNG(DOM/IMAGES/BREADCRUMBSCROLLLEFTHOVER.PNG$DOM/IMAGES/BREADCRUMBSCROLLRIGHT.PNG)DOM/IMAGES/BREADCRUMBSCROLLRIGHTHOVER.PNGDOM/IMAGES/I_ERROR.PNGDOM/IMAGES/I_INSPECT.PNGDOM/IMAGES/I_NEXT.PNGDOM/IMAGES/I_PREVIOUS.PNGDOM/IMAGES/RED_SQUIGGLY.PNGDOM/IMAGES/I_REFRESH.PNGDOM/IMAGES/I_JUST_MY_CODE.PNGDOM/IMAGES/I_SHOW-LAYOUT.PNGDOM/IMAGES/I_WARNING.PNGDEBUGGER/GRIDCONTROL.CSSDEBUGGER/DEBUGGER.CSSDEBUGGER/DEBUGGER.HTMLDEBUGGER/DEBUGGERMERGED.JSDEBUGGER/MANIFEST.JSON$DEBUGGER/BREAKPOINTS/BREAKPOINTS.CSS/DEBUGGER/BREAKPOINTS/IMAGES/BREAKPOINTGLYPH.PNG5DEBUGGER/BREAKPOINTS/IMAGES/CONDITIONALBREAKPOINT.PNG4DEBUGGER/BREAKPOINTS/IMAGES/TRACEPOINTBREAKPOINT.PNG2DEBUGGER/BREAKPOINTS/IMAGES/BREAKPOINTDISABLED.PNG1DEBUGGER/BREAKPOINTS/IMAGES/BREAKPOINTUNBOUND.PNG4DEBUGGER/BREAKPOINTS/IMAGES/DELETEALLBREAKPOINTS.PNG4DEBUGGER/BREAKPOINTS/IMAGES/SELECTALLBREAKPOINTS.PNG7DEBUGGER/BREAKPOINTS/IMAGES/DELETECURRENTBREAKPOINT.PNG5DEBUGGER/BREAKPOINTS/IMAGES/EDITCURRENTBREAKPOINT.PNG DEBUGGER/CALLSTACK/CALLSTACK.CSS5DEBUGGER/CALLSTACK/IMAGES/INSTRUCTIONPOINTERGLYPH.PNG.DEBUGGER/CALLSTACK/IMAGES/ACTIVEFRAMEGLYPH.PNG)DEBUGGER/CALLSTACK/IMAGES/PAUSEWORKER.PNGDEBUGGER/EDITOR/EDITOR.CSSDEBUGGER/EDITOR/VS/CSS.JS'DEBUGGER/EDITOR/VS/EDITORDEFINITIONS.JSDEBUGGER/EDITOR/VS/LOADER.JSDEBUGGER/EDITOR/VS/NLS.JS,DEBUGGER/EDITOR/VS/BASE/WORKER/WORKERMAIN.JS;DEBUGGER/EDITOR/VS/BASE/WORKER/WORKERMAINCOMPATIBILITY.HTML.DEBUGGER/EDITOR/VS/BASE/WORKER/WORKERSERVER.JS2DEBUGGER/EDITOR/VS/BASE/WORKER/WORKERSERVER.NLS.JS7DEBUGGER/EDITOR/VS/BASE/WORKER/WORKERSERVER.NLS.KEYS.JS8DEBUGGER/EDITOR/VS/BASE/UI/SCROLLBAR/ARROW-DOWN-DARK.PNG3DEBUGGER/EDITOR/VS/BASE/UI/SCROLLBAR/ARROW-DOWN.PNG8DEBUGGER/EDITOR/VS/BASE/UI/SCROLLBAR/ARROW-LEFT-DARK.PNG3DEBUGGER/EDITOR/VS/BASE/UI/SCROLLBAR/ARROW-LEFT.PNG9DEBUGGER/EDITOR/VS/BASE/UI/SCROLLBAR/ARROW-RIGHT-DARK.PNG4DEBUGGER/EDITOR/VS/BASE/UI/SCROLLBAR/ARROW-RIGHT.PNG6DEBUGGER/EDITOR/VS/BASE/UI/SCROLLBAR/ARROW-UP-DARK.PNG1DEBUGGER/EDITOR/VS/BASE/UI/SCROLLBAR/ARROW-UP.PNG)DEBUGGER/EDITOR/VS/EDITOR/EDITOR.MAIN.CSS(DEBUGGER/EDITOR/VS/EDITOR/EDITOR.MAIN.JS,DEBUGGER/EDITOR/VS/EDITOR/EDITOR.MAIN.NLS.JS1DEBUGGER/EDITOR/VS/EDITOR/EDITOR.MAIN.NLS.KEYS.JS0DEBUGGER/EDITOR/VS/EDITOR/CSS/DEFAULT\-THEME.CSS+DEBUGGER/EDITOR/VS/EDITOR/CSS/VS\-THEME.CSS6DEBUGGER/EDITOR/VS/EDITOR/WORKER/EDITORWORKERSERVER.JS:DEBUGGER/EDITOR/VS/EDITOR/WORKER/EDITORWORKERSERVER.NLS.JS?DEBUGGER/EDITOR/VS/EDITOR/WORKER/EDITORWORKERSERVER.NLS.KEYS.JS'DEBUGGER/EDITOR/VS/LANGUAGES/CSS/CSS.JS+DEBUGGER/EDITOR/VS/LANGUAGES/CSS/CSS.NLS.JS0DEBUGGER/EDITOR/VS/LANGUAGES/CSS/CSS.NLS.KEYS.JS-DEBUGGER/EDITOR/VS/LANGUAGES/CSS/CSSWORKER.JS1DEBUGGER/EDITOR/VS/LANGUAGES/CSS/CSSWORKER.NLS.JS6DEBUGGER/EDITOR/VS/LANGUAGES/CSS/CSSWORKER.NLS.KEYS.JS5DEBUGGER/EDITOR/VS/LANGUAGES/CSS/MONACOPARTICIPANT.JS9DEBUGGER/EDITOR/VS/LANGUAGES/CSS/MONACOPARTICIPANT.NLS.JS>DEBUGGER/EDITOR/VS/LANGUAGES/CSS/MONACOPARTICIPANT.NLS.KEYS.JS)DEBUGGER/EDITOR/VS/LANGUAGES/HTML/HTML.JS-DEBUGGER/EDITOR/VS/LANGUAGES/HTML/HTML.NLS.JS2DEBUGGER/EDITOR/VS/LANGUAGES/HTML/HTML.NLS.KEYS.JS/DEBUGGER/EDITOR/VS/LANGUAGES/HTML/HTMLWORKER.JS3DEBUGGER/EDITOR/VS/LANGUAGES/HTML/HTMLWORKER.NLS.JS8DEBUGGER/EDITOR/VS/LANGUAGES/HTML/HTMLWORKER.NLS.KEYS.JS=DEBUGGER/EDITOR/VS/LANGUAGES/JAVASCRIPT/JAVASCRIPT\-WORKER.JSADEBUGGER/EDITOR/VS/LANGUAGES/JAVASCRIPT/JAVASCRIPT\-WORKER.NLS.JSFDEBUGGER/EDITOR/VS/LANGUAGES/JAVASCRIPT/JAVASCRIPT\-WORKER.NLS.KEYS.JS5DEBUGGER/EDITOR/VS/LANGUAGES/JAVASCRIPT/JAVASCRIPT.JS9DEBUGGER/EDITOR/VS/LANGUAGES/JAVASCRIPT/JAVASCRIPT.NLS.JS>DEBUGGER/EDITOR/VS/LANGUAGES/JAVASCRIPT/JAVASCRIPT.NLS.KEYS.JS<DEBUGGER/EDITOR/VS/LANGUAGES/JAVASCRIPT/JAVASCRIPTWORKER2.JS@DEBUGGER/EDITOR/VS/LANGUAGES/JAVASCRIPT/JAVASCRIPTWORKER2.NLS.JSEDEBUGGER/EDITOR/VS/LANGUAGES/JAVASCRIPT/JAVASCRIPTWORKER2.NLS.KEYS.JSEDEBUGGER/EDITOR/VS/LANGUAGES/JAVASCRIPT/JAVASCRIPTWORKER2MONITORED.JSIDEBUGGER/EDITOR/VS/LANGUAGES/JAVASCRIPT/JAVASCRIPTWORKER2MONITORED.NLS.JSNDEBUGGER/EDITOR/VS/LANGUAGES/JAVASCRIPT/JAVASCRIPTWORKER2MONITORED.NLS.KEYS.JS9DEBUGGER/EDITOR/VS/LANGUAGES/PLAINTEXT/PLAINTEXTWORKER.JS=DEBUGGER/EDITOR/VS/LANGUAGES/PLAINTEXT/PLAINTEXTWORKER.NLS.JSBDEBUGGER/EDITOR/VS/LANGUAGES/PLAINTEXT/PLAINTEXTWORKER.NLS.KEYS.JS5DEBUGGER/EDITOR/VS/LANGUAGES/TYPESCRIPT/TYPESCRIPT.JS9DEBUGGER/EDITOR/VS/LANGUAGES/TYPESCRIPT/TYPESCRIPT.NLS.JS>DEBUGGER/EDITOR/VS/LANGUAGES/TYPESCRIPT/TYPESCRIPT.NLS.KEYS.JS<DEBUGGER/EDITOR/VS/LANGUAGES/TYPESCRIPT/TYPESCRIPTWORKER2.JS@DEBUGGER/EDITOR/VS/LANGUAGES/TYPESCRIPT/TYPESCRIPTWORKER2.NLS.JSEDEBUGGER/EDITOR/VS/LANGUAGES/TYPESCRIPT/TYPESCRIPTWORKER2.NLS.KEYS.JSDDEBUGGER/EDITOR/VS/LANGUAGES/TYPESCRIPT/TYPESCRIPTWORKERMONITORED.JSHDEBUGGER/EDITOR/VS/LANGUAGES/TYPESCRIPT/TYPESCRIPTWORKERMONITORED.NLS.JSMDEBUGGER/EDITOR/VS/LANGUAGES/TYPESCRIPT/TYPESCRIPTWORKERMONITORED.NLS.KEYS.JSADEBUGGER/EDITOR/VS/LANGUAGES/TYPESCRIPT/LIB/TYPESCRIPTSERVICES.JSEDEBUGGER/EDITOR/VS/LANGUAGES/TYPESCRIPT/LIB/TYPESCRIPTSERVICES.NLS.JSJDEBUGGER/EDITOR/VS/LANGUAGES/TYPESCRIPT/LIB/TYPESCRIPTSERVICES.NLS.KEYS.JSNDEBUGGER/EDITOR/VS/LANGUAGES/TYPESCRIPT/PARTICIPANTS/MONACOSTYLEPARTICIPANT.JSRDEBUGGER/EDITOR/VS/LANGUAGES/TYPESCRIPT/PARTICIPANTS/MONACOSTYLEPARTICIPANT.NLS.JSWDEBUGGER/EDITOR/VS/LANGUAGES/TYPESCRIPT/PARTICIPANTS/MONACOSTYLEPARTICIPANT.NLS.KEYS.JSFDEBUGGER/EDITOR/VS/LANGUAGES/TYPESCRIPT/PARTICIPANTS/NLSPARTICIPANT.JSJDEBUGGER/EDITOR/VS/LANGUAGES/TYPESCRIPT/PARTICIPANTS/NLSPARTICIPANT.NLS.JSODEBUGGER/EDITOR/VS/LANGUAGES/TYPESCRIPT/PARTICIPANTS/NLSPARTICIPANT.NLS.KEYS.JSNDEBUGGER/EDITOR/VS/LANGUAGES/TYPESCRIPT/PARTICIPANTS/SYMBOLUSAGEPARTICIPANT.JSRDEBUGGER/EDITOR/VS/LANGUAGES/TYPESCRIPT/PARTICIPANTS/SYMBOLUSAGEPARTICIPANT.NLS.JSWDEBUGGER/EDITOR/VS/LANGUAGES/TYPESCRIPT/PARTICIPANTS/SYMBOLUSAGEPARTICIPANT.NLS.KEYS.JS'DEBUGGER/EDITOR/VS/LANGUAGES/XML/XML.JS+DEBUGGER/EDITOR/VS/LANGUAGES/XML/XML.NLS.JS0DEBUGGER/EDITOR/VS/LANGUAGES/XML/XML.NLS.KEYS.JS-DEBUGGER/EDITOR/VS/LANGUAGES/XML/XMLWORKER.JS1DEBUGGER/EDITOR/VS/LANGUAGES/XML/XMLWORKER.NLS.JS6DEBUGGER/EDITOR/VS/LANGUAGES/XML/XMLWORKER.NLS.KEYS.JS"DEBUGGER/FORMATTER/FORMATWORKER.JS&DEBUGGER/FORMATTER/HTMLSCRIPTFINDER.JS%DEBUGGER/FORMATTER/SOURCEMAPPARSER.JS'DEBUGGER/FORMATTER/SOURCESPANBUILDER.JS%DEBUGGER/FORMATTER/WORKERMESSAGING.JSDEBUGGER/IMAGES/BREAKALL.PNG%DEBUGGER/IMAGES/BREAKONEXCEPTIONS.PNGDEBUGGER/IMAGES/BREAKWORKER.PNGDEBUGGER/IMAGES/CONTINUE.PNGDEBUGGER/IMAGES/CSSFILEICON.PNGDEBUGGER/IMAGES/FILEPICKER.PNG!DEBUGGER/IMAGES/FILESNODEICON.PNG DEBUGGER/IMAGES/FUNCTIONICON.PNG DEBUGGER/IMAGES/HTMLFILEICON.PNGDEBUGGER/IMAGES/I_NEXT.PNGDEBUGGER/IMAGES/I_PREVIOUS.PNG%DEBUGGER/IMAGES/ITEMCOLLAPSEDICON.PNG$DEBUGGER/IMAGES/ITEMEXPANDEDICON.PNGDEBUGGER/IMAGES/NEXTTAB.PNG$DEBUGGER/IMAGES/NOTAFUNCTIONICON.PNGDEBUGGER/IMAGES/PREVTAB.PNG%DEBUGGER/IMAGES/TOGGLEPRETTYPRINT.PNG"DEBUGGER/IMAGES/TOGGLEWORDWRAP.PNG"DEBUGGER/IMAGES/SCRIPTFILEICON.PNGDEBUGGER/IMAGES/SEARCH.PNGDEBUGGER/IMAGES/STEPINTO.PNGDEBUGGER/IMAGES/STEPOUT.PNGDEBUGGER/IMAGES/STEPOVER.PNG!DEBUGGER/MANAGER/COMMONSTRUCTS.JSDEBUGGER/REMOTE/REMOTE.JS DEBUGGER/REMOTE/DEBUGPROVIDER.JS(DEBUGGER/REMOTE/DIAGNOSTICSOMPROVIDER.JSDEBUGGER/REMOTE/JITREMOTE.JS"DEBUGGER/TABCONTROL/TABCONTROL.CSSDEBUGGER/TABICON.PNG$DEBUGGER/WATCHES/IMAGES/ADDWATCH.PNG'DEBUGGER/WATCHES/IMAGES/DELETEWATCH.PNG%DEBUGGER/WATCHES/IMAGES/DELETEALL.PNGDEBUGGER/WATCHES/WATCHES.CSSEMULATION/DELETEUASTRING.PNGEMULATION/EMULATION.CSSEMULATION/EMULATION.HTMLEMULATION/EMULATIONMERGED.JSEMULATION/EMULATION.JSONEMULATION/FIELD-ERROR.PNGEMULATION/INFOBUTTON.PNGEMULATION/MANIFEST.JSONEMULATION/REMOTE.JSEMULATION/REMOTEMAIN.JSEMULATION/TABICON.PNGRESOURCES/RESOURCES.CSSRESOURCES/RESOURCES.HTMLRESOURCES/RESOURCESMERGED.JSRESOURCES/REMOTE.JSRESOURCES/REMOTEMAIN.JSHEADER/HEADER.CSSHEADER/HEADER.HTMLHEADER/HEADERMERGED.JSHEADER/IMAGES/F12LOGO.PNGHEADER/IMAGES/NEXTTAB.PNGHEADER/IMAGES/PREVTAB.PNGHEADER/IMAGES/TABICON.PNGHEADER/MANIFEST.JSONHEADER/REMOTE/REMOTE.JS)PERFTOOLS/COMMON/CONTROLS/GRIDCONTROL.CSS(PERFTOOLS/COMMON/CONTROLS/HUBCONTROLS.JS,PERFTOOLS/COMMON/CONTROLS/MULTILINEGRAPH.CSS&PERFTOOLS/COMMON/CONTROLS/RENDERER.CSS#PERFTOOLS/COMMON/CONTROLS/RULER.CSS'PERFTOOLS/COMMON/CONTROLS/SCROLLBAR.CSS&PERFTOOLS/COMMON/CONTROLS/SWIMLANE.CSS%PERFTOOLS/COMMON/CONTROLS/TOOLBAR.CSSPERFTOOLS/COMMON/COMMON.F12.CSS"PERFTOOLS/COMMON/DIAGNOSTICSHUB.JS'PERFTOOLS/COMMON/IMAGES/I_SORT_DOWN.PNG%PERFTOOLS/COMMON/IMAGES/I_SORT_UP.PNG#PERFTOOLS/COMMON/IMAGES/I_START.PNG"PERFTOOLS/COMMON/IMAGES/I_STOP.PNG&PERFTOOLS/COMMON/IMAGES/I_USERMARK.PNG%PERFTOOLS/COMMON/IMAGES/I_WARNING.PNG-PERFTOOLS/COMMON/IMAGES/ITEMCOLLAPSEDICON.PNG,PERFTOOLS/COMMON/IMAGES/ITEMEXPANDEDICON.PNG PERFTOOLS/COMMON/COMMONMERGED.JSPERFTOOLS/COMMON/PLUGIN.CSSPERFTOOLS/COMMON/PLUGIN.JS!PERFTOOLS/COMMON/REMOTEHELPERS.JSPERFTOOLS/MEMORY/MANIFEST.JSONPERFTOOLS/MEMORY/TABICON.PNG#PERFTOOLS/MEMORY/MEMORYANALYZER.CSS'PERFTOOLS/MEMORY/MEMORYANALYZER.F12.CSS$PERFTOOLS/MEMORY/MEMORYANALYZER.HTML(PERFTOOLS/MEMORY/MEMORYANALYZERMERGED.JSPERFTOOLS/MEMORY/REMOTE.JS%PERFTOOLS/MEMORY/SNAPSHOTTILEVIEW.CSS%PERFTOOLS/MEMORY/IMAGES/CHECKMARK.PNG"PERFTOOLS/MEMORY/IMAGES/I_INFO.PNG&PERFTOOLS/MEMORY/IMAGES/I_SNAPSHOT.PNG+PERFTOOLS/MEMORY/IMAGES/I_TABLE_OPTIONS.PNG0PERFTOOLS/MEMORY/IMAGES/STATUS_HEAP_DECREASE.PNG0PERFTOOLS/MEMORY/IMAGES/STATUS_HEAP_INCREASE.PNG(PERFTOOLS/MEMORY/IMAGES/TAKESNAPSHOT.PNG+PERFTOOLS/MEMORY/JS/CONTROLS/TABCONTROL.CSS&PERFTOOLS/VISUALPROFILER/MANIFEST.JSON$PERFTOOLS/VISUALPROFILER/TABICON.PNG+PERFTOOLS/VISUALPROFILER/VISUALPROFILER.CSS/PERFTOOLS/VISUALPROFILER/VISUALPROFILER.F12.CSS,PERFTOOLS/VISUALPROFILER/VISUALPROFILER.HTML0PERFTOOLS/VISUALPROFILER/VISUALPROFILERMERGED.JS.PERFTOOLS/VISUALPROFILER/IMAGES/I_APPEVENT.PNG>PERFTOOLS/VISUALPROFILER/IMAGES/I_F12_CHARTSELECTION_CLEAR.PNG6PERFTOOLS/VISUALPROFILER/IMAGES/I_F12_CHARTZOOM_IN.PNG9PERFTOOLS/VISUALPROFILER/IMAGES/I_F12_CHARTZOOM_RESET.PNGFPERFTOOLS/VISUALPROFILER/IMAGES/I_F12_CONTEXT_CHARTSELECTION_CLEAR.PNGOPERFTOOLS/VISUALPROFILER/IMAGES/I_F12_CONTEXT_CHARTSELECTION_CLEAR_DISABLED.PNG>PERFTOOLS/VISUALPROFILER/IMAGES/I_F12_CONTEXT_CHARTZOOM_IN.PNGGPERFTOOLS/VISUALPROFILER/IMAGES/I_F12_CONTEXT_CHARTZOOM_IN_DISABLED.PNGAPERFTOOLS/VISUALPROFILER/IMAGES/I_F12_CONTEXT_CHARTZOOM_RESET.PNGJPERFTOOLS/VISUALPROFILER/IMAGES/I_F12_CONTEXT_CHARTZOOM_RESET_DISABLED.PNG.PERFTOOLS/VISUALPROFILER/IMAGES/I_USERMARK.PNG<PERFTOOLS/VISUALPROFILER/JS/CONTROLS/ANIMATIONFRAMEGRAPH.CSS0PERFTOOLS/VISUALPROFILER/JS/CONTROLS/DIVIDER.CSS.PERFTOOLS/VISUALPROFILER/JS/CONTROLS/RULER.CSS8PERFTOOLS/VISUALPROFILER/JS/CONTROLS/STACKEDBARCHART.CSSPLUGINHOST/PLUGIN.F12.JSPLUGINHOST/POPUPWINDOW.HTML"PLUGINHOST/THEME/CLOSEERRORBOX.PNGPLUGINHOST/THEME/F12.CSS!PLUGINHOST/THEME/HELPERRORBOX.PNGPLUGINHOST/THEME/LIGHT.JSON"PLUGINHOST/THEME/HIGHCONTRAST.JSONPLUGINHOST/THEME/PLUGIN.CSS!PLUGINHOST/THEME/I_ALERTERROR.PNGNETWORK/TABICON.PNGNETWORK/MANIFEST.JSONPROFILER/TABICON.PNGPROFILER/MANIFEST.JSONMUI4VS_VERSION_INFO @% @%?StringFileInfo040904B0LCompanyNameMicrosoft CorporationdFileDescriptionF12 Developer Tools Resourcesv+FileVersion11.00.9600.16412 (winblue_gdr.130925-1958)BInternalNameF12Resources.dll.LegalCopyright Microsoft Corporation. All rights reserved.JOriginalFilenameF12Resources.dllDProductNameInternet ExplorerFProductVersion11.00.9600.16412DVarFileInfo$Translation * { box-sizing: border-box; } body { background-color: #FFFFFF; font-family: Segoe UI Light; font-size: small; color: #000000; margin: 0; padding: 0; line-height: 1.1em; } button{ text-transform: uppercase; cursor: pointer; padding: 4px 8px 4px 8px; border: solid 1px #BFBFBF; font-size: x-small; color: #000000; background-color: #FFFFFF; } button:hover{ border-color: #000000; } dt{ font-weight: bold; } dd{ } /* Disable "x" in input boxes. */ ::-ms-clear { display: none; } body { background-color: #FFFFFF; overflow: hidden; -ms-user-select: none; user-select: none; } #chooser { width: 100%; height: 400px; } #headerContainer { position: absolute; top: 0; left: 0; display: -ms-grid; -ms-grid-columns: 16px 32px 586px 16px 16px 16px; -ms-grid-rows: auto auto; } .headerImg { background-position: 0 0; width: 16px; height: 16px; } .headerImg:hover { background-position: 16px 0; cursor: pointer; } #optionsCmd { display: none; background-image: url('../common/images/options.png'); -ms-grid-column: 1; -ms-grid-row: 1; } #helpCmd { display: none; background-image: url('../common/images/help.png'); -ms-grid-column: 1; -ms-grid-row: 2; } #f12Logo { border: 0; margin: 0 4px 0 4px; padding: 0; width: 32px; -ms-grid-column: 2; -ms-grid-row: 1; -ms-grid-row-span: 2; } #headerTitle { font-size: large; margin-left: 8px; margin-top: 3px; cursor: default; user-select: none; -ms-grid-column: 3; -ms-grid-row: 1; -ms-grid-row-span: 2; } #minimizeCmd { background-image: url('../common/images/minimize.png'); -ms-grid-column: 4; -ms-grid-row: 1; display: none; } #refreshCmd { background-image: url('../common/images/refresh.png'); -ms-grid-column: 4; -ms-grid-row: 1; } #closeCmd { background-image: url('../common/images/close.png'); background-size: 32px 16px; -ms-grid-column: 5; -ms-grid-row: 1; } #header { width: 400px; height: 64px; border: none; position: absolute; top: 0; left: 0; } #targets { margin-top: 40px; margin-left: 4px; margin-right: 4px; height: 430px; overflow: scroll; } .target { margin: 4px; display: inline-block; width: 192px; cursor: pointer; position: relative; } .preview { height: 108px; width: 192px; background-color: #606060; } .title { background-color: #1E1E1E; position: absolute; bottom: 0; left: 0; color: #FFFFFF; padding-left: 2px; height: 20px; width: 190px; transition: height 0.3s ease; } F12 Chooser
F12
Choose a target to debug
var pluginAPI = window.external; var chooser = { animateTitleStart: function (titleNode) { titleNode.style.height = "60px"; titleNode.style.whiteSpace = "normal" }, animateTitleEnd: function (titleNode) { titleNode.style.height = "20px"; titleNode.style.whiteSpace = "nowrap"; }, addTarget: function chooser_addTargetfunction(id, url, title, screenshot, processExeName, packageName, pid) { if(id == null || isNaN(id)){ throw new Error("id is not optional number") } if(!url){ throw new Error("url is not optional") } if(!title){ title = chooser.createShortenedUrlText(url); } if (screenshot) { screenshot = "data:image/png;base64," + screenshot; } if (!processExeName) { processExeName = "unknown"; } if(pid == null || isNaN(pid)){ pid = "unknown"; } var targetEl = document.createElement("div"); targetEl.className = "target" targetEl.setAttribute("data-id", id); // all this to avoid a capture on attachEl targetEl.addEventListener("click", function targetClick(e) { var id = e.currentTarget.getAttribute("data-id"); chooser.selectTarget(id); }); targetEl.addEventListener("mouseover", function titleEl_mouseover(e) { var nodeList = e.currentTarget.querySelectorAll(".title"); if (nodeList && nodeList[0]) { chooser.animateTitleStart(nodeList[0]);; } }); targetEl.addEventListener("mouseout", function titleEl_mouseover(e) { var nodeList = e.currentTarget.querySelectorAll(".title"); if (nodeList && nodeList[0]) { chooser.animateTitleEnd(nodeList[0]); } }); var imgEl = document.createElement("div"); imgEl.className = "preview"; imgEl.style.backgroundRepeat = "no-repeat"; var titleEl = document.createElement("div"); titleEl.className = "title cutText"; titleEl.appendChild(document.createTextNode(title)); targetEl.appendChild(imgEl); targetEl.appendChild(titleEl); var targetsEl = document.getElementById("targets"); targetsEl.appendChild(targetEl); }, removeTargets: function chooser_removeTargets() { var targetsEl = document.getElementById("targets"); targetsEl.innerHTML = ""; }, removeTarget: function chooser_removeTarget(){ }, selectTarget: function chooser_targetSelected(id) { pluginAPI.selectInstanceByIndex(id); }, createShortenedUrlText: function (url) { var shortenedText = url; // Remove a query string if any var indexOfHash = shortenedText.indexOf("#"); var indexOfQuestionMark = shortenedText.indexOf("?"); var index = -1; if (indexOfHash > -1 && indexOfQuestionMark > -1) { index = Math.min(indexOfHash, indexOfQuestionMark); } else if (indexOfHash > -1) { index = indexOfHash; } else if (indexOfQuestionMark > -1) { index = indexOfQuestionMark; } if (index > -1) { shortenedText = shortenedText.substring(0, index); } index = shortenedText.lastIndexOf("/"); // While the last character is '/', truncate it and find the next / or the start of the string while (index !== -1 && index === (shortenedText.length - 1)) { // Remove last '/' shortenedText = shortenedText.substring(0, shortenedText.length - 1); index = shortenedText.lastIndexOf("/"); } if (index > -1) { shortenedText = shortenedText.substring(index + 1); } return shortenedText; } } document.addEventListener("DOMContentLoaded", function chooserDOMContentLoaed(){ function loadInstances() { chooser.removeTargets(); var instancesArray = pluginAPI.getWebInstances(); for (var i = 0; i < instancesArray.length; i++) { var instance = instancesArray[i]; var id = i; var url = ""; try { url = instance.document.location.toString(); } catch (e) { try{ if (instance.document.URLUnencoded) { url = instance.document.URLUnencoded; } else if (instance.document.url) { url = instance.document.url; } } catch (e) { url = "unknown"; } } var title= ""; try{ title = instance.document.title.toString(); } catch(e){ title = "unknown"; } var image = instance.base64Image; var processExeName = instance.processExeName; var packageName = instance.packageName; var pid = instance.processId; chooser.addTarget( i, url, title, image, processExeName, packageName, pid); } } loadInstances(); document.getElementById("closeCmd").addEventListener("click", function () { window.external.cancel(); }); document.getElementById("refreshCmd").addEventListener("click", function () { loadInstances(); }); window.setInterval(function () { var titles = document.querySelectorAll(".title"); if (titles) { var randIndex = Math.round(Math.random() * titles.length); var title = titles[randIndex]; if (title) { chooser.animateTitleStart(title); window.setTimeout(function () { if (title) { chooser.animateTitleEnd(title); } }, 2600); } } }, 3000); }); var F12; (function (F12) { (function (Tools) { (function (Utility) { var Assert = (function () { function Assert() { } Assert.IsTrue = function IsTrue(condition, message) { if(!condition) { message = message ? "Internal error. " + message : "Internal error. Unexpectedly false."; Assert.Fail(message); } }; Assert.IsFalse = function IsFalse(condition, message) { if(condition) { message = message ? "Internal error. " + message : "Internal error. Unexpectedly true."; Assert.Fail(message); } }; Assert.IsNull = function IsNull(value, message) { if(value !== null) { message = message ? "Internal error. " + message : "Internal error. Unexpectedly not null."; message += " '" + value + "'"; Assert.Fail(message); } }; Assert.IsUndefined = function IsUndefined(value, message) { if(value !== undefined) { message = message ? "Internal error. " + message : "Internal error. Unexpectedly not undefined."; message += " '" + value + "'"; Assert.Fail(message); } }; Assert.HasValue = function HasValue(value, message) { if(value === null || value === undefined) { message = message ? "Internal error. " + message : "Internal error. Unexpectedly null or undefined."; Assert.Fail(message); } }; Assert.AreEqual = function AreEqual(value1, value2, message) { if(value1 !== value2) { message = message ? "Internal error. " + message : "Internal error. Unexpectedly not equal."; message += " '" + value1 + "' !== '" + value2 + "'."; Assert.Fail(message); } }; Assert.AreNotEqual = function AreNotEqual(value1, value2, message) { if(value1 === value2) { message = message ? "Internal error. " + message : "Internal error. Unexpectedly equal."; message += " '" + value1 + "' === '" + value2 + "'."; Assert.Fail(message); } }; Assert.Fail = function Fail(message) { var error = new Error(message + "\n"); try { throw error; } catch (e) { if(Common && Common.ErrorHandling) { Common.ErrorHandling.ReportErrorGivenStack(e); } throw e; } }; return Assert; })(); Utility.Assert = Assert; })(Tools.Utility || (Tools.Utility = {})); var Utility = Tools.Utility; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=assert.js.map /* Button control. */ button, input[type=button], input[type=reset], input[type=submit] { min-width: 90px; padding: 4px 8px; border-width: 2px; border-style: solid; background-clip: padding-box; font-size: 11pt; font-weight: 600; } button ::selection, input[type=button] ::selection, input[type=reset] ::selection, input[type=submit] ::selection { background: transparent; } /* Button control colors. */ button, input[type=button], input[type=submit], input[type=reset], input[type=file]::-ms-browse { background-color: transparent; color: rgb(0, 0, 0); border: 1px solid #FFFFFF; } button[type=submit], input[type=submit] { background-clip: padding-box; background-color: rgb(70, 23, 180); } button:hover, input[type=button]:hover, input[type=reset]:hover, input[type=file]::-ms-browse:hover { background-color: rgba(255, 255, 255, 0.13); border-color: rgb(255, 255, 255); } button[type=submit]:hover, input[type=submit]:hover { background-clip: padding-box; background-color: rgb(95, 55, 190); border-color: rgb(255, 255, 255); } button:hover:active, button[type=submit]:hover:active, input[type=button]:hover:active, input[type=reset]:hover:active, input[type=submit]:hover:active, input[type=file]::-ms-browse:hover:active { background-clip: border-box; background-color: rgb(255, 255, 255); border-color: transparent; color: rgb(0, 0, 0); } button:disabled, button[type=submit]:disabled, input[type=button]:disabled, input[type=reset]:disabled, input[type=submit]:disabled, input[type=file]:disabled::-ms-browse, button:disabled:active, button[type=submit]:disabled:active, input[type=button]:disabled:active, input[type=reset]:disabled:active, input[type=submit]:disabled:active, input[type=file]:disabled::-ms-browse:active { background-color: transparent; border-color: rgba(255, 255, 255, 0.4); color: rgba(255, 255, 255, 0.4); } button[selected=true], input[type=button][selected=true], input[type=reset][selected=true], input[type=file][selected=true] { color: #333333; /*[{plugin-filetab-hot-color}]*/ background-color: #FFF3CD; /* [{plugin-contextmenu-hover-color}]*/ border: 1px solid #E5C365; /* [1px solid {host-command-bar-selected-border-color}]*/ } /* Toolbar Button control. */ .toolbar button, .toolbar input[type=button], .toolbar input[type=reset], .toolbar input[type=submit] { cursor: default; padding: 0 5px 0 5px; display: inline-block; border: 1px solid transparent; vertical-align: middle; background-clip: padding-box; font-size: 9pt; font-weight: normal; } .toolbar button img, .toolbar input[type=button] img, .toolbar input[type=reset] img, .toolbar input[type=submit] img { margin: 2px 4px 0 -2px; vertical-align: middle; } /* Button control colors. */ .toolbar button, .toolbar input[type=button], .toolbar input[type=submit], .toolbar input[type=reset], .toolbar input[type=file]::-ms-browse { background-color: transparent; border-color: rgb(255, 255, 255); color: #BFBFBF; padding-right: 4px; } .toolbar button:hover, .toolbar input[type=button]:hover, .toolbar input[type=reset]:hover, .toolbar input[type=file]::-ms-browse:hover { color: #333333; /*[{plugin-filetab-hot-color}]*/ } .toolbar button:hover:active, .toolbar button[type=submit]:hover:active, .toolbar input[type=button]:hover:active, .toolbar input[type=reset]:hover:active, .toolbar input[type=submit]:hover:active, .toolbar input[type=file]::-ms-browse:hover:active { color: #333333; /*[{plugin-filetab-hot-color}]*/ } .toolbar button:disabled, .toolbar button[type=submit]:disabled, .toolbar input[type=button]:disabled, .toolbar input[type=reset]:disabled, .toolbar input[type=submit]:disabled, .toolbar input[type=file]:disabled::-ms-browse, .toolbar button:disabled:active, .toolbar button[type=submit]:disabled:active, .toolbar input[type=button]:disabled:active, .toolbar input[type=reset]:disabled:active, .toolbar input[type=submit]:disabled:active, .toolbar input[type=file]:disabled::-ms-browse:active { background-color: transparent; border: 1px solid transparent; color: #808080; /*[{plugin-inactive-color}]*/ } .toolbar button[selected=true], .toolbar input[type=button][selected=true], .toolbar input[type=reset][selected=true], .toolbar input[type=file][selected=true] { color: #333333; /*[{plugin-filetab-hot-color}]*/ } body { background-color: #FFFFFF; font-family: "Segoe UI", Arial, sans-serif; /*[{plugin-font-family} , Arial, sans-serif]*/ font-size: small; color: #000000; margin: 0; padding: 0; line-height: 1.1em; } button{ text-transform: uppercase; cursor: pointer; padding: 4px 8px 4px 8px; border: solid 1px #BFBFBF; font-size: x-small; color: #000000; background-color: #FFFFFF; } button:hover{ border-color: #000000; } dt{ font-weight: bold; } dd{ } .cutText{ overflow: hidden; text-overflow: ellipsis; white-space:nowrap; }// // Copyright (C) Microsoft. All rights reserved. // // isDebugBuild.ts var isDebugBuild = false; //@ sourceMappingURL=isDebugBuild.js.map // assert.ts var F12; (function (F12) { (function (Tools) { (function (Utility) { var Assert = (function () { function Assert() { } Assert.IsTrue = function IsTrue(condition, message) { if(!condition) { message = message ? "Internal error. " + message : "Internal error. Unexpectedly false."; Assert.Fail(message); } }; Assert.IsFalse = function IsFalse(condition, message) { if(condition) { message = message ? "Internal error. " + message : "Internal error. Unexpectedly true."; Assert.Fail(message); } }; Assert.IsNull = function IsNull(value, message) { if(value !== null) { message = message ? "Internal error. " + message : "Internal error. Unexpectedly not null."; message += " '" + value + "'"; Assert.Fail(message); } }; Assert.IsUndefined = function IsUndefined(value, message) { if(value !== undefined) { message = message ? "Internal error. " + message : "Internal error. Unexpectedly not undefined."; message += " '" + value + "'"; Assert.Fail(message); } }; Assert.HasValue = function HasValue(value, message) { if(value === null || value === undefined) { message = message ? "Internal error. " + message : "Internal error. Unexpectedly null or undefined."; Assert.Fail(message); } }; Assert.AreEqual = function AreEqual(value1, value2, message) { if(value1 !== value2) { message = message ? "Internal error. " + message : "Internal error. Unexpectedly not equal."; message += " '" + value1 + "' !== '" + value2 + "'."; Assert.Fail(message); } }; Assert.AreNotEqual = function AreNotEqual(value1, value2, message) { if(value1 === value2) { message = message ? "Internal error. " + message : "Internal error. Unexpectedly equal."; message += " '" + value1 + "' === '" + value2 + "'."; Assert.Fail(message); } }; Assert.Fail = function Fail(message) { var error = new Error(message + "\n"); try { throw error; } catch (e) { if(Common && Common.ErrorHandling) { Common.ErrorHandling.ReportErrorGivenStack(e); } throw e; } }; return Assert; })(); Utility.Assert = Assert; })(Tools.Utility || (Tools.Utility = {})); var Utility = Tools.Utility; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=assert.js.map // errorHandling.ts var Common; (function (Common) { "use strict"; var ErrorHandling = (function () { function ErrorHandling() { } ErrorHandling.stackRegex = new RegExp(".* at ([^(]+) \(.*/23/([^:]+):([0-9]+):([0-9]+)\)", "gim"); ErrorHandling.ReportErrorGivenStack = function ReportErrorGivenStack(error) { var message = error.message; var stack = (error).stack; var firstCloseParen = stack.indexOf(")"); if(firstCloseParen > 0) { stack = stack.substr(0, firstCloseParen + 1); } var result = ErrorHandling.stackRegex.exec(stack); if(result) { var file = result[3]; var line = parseInt(result[4], 10); var column = parseInt(result[5], 10); window.reportError(message, file, line, (error).stack, column); } }; return ErrorHandling; })(); Common.ErrorHandling = ErrorHandling; })(Common || (Common = {})); window.reportError = function (message, file, line, additionalInfo, column) { message = message || ""; file = file || ""; line = line || 0; additionalInfo = additionalInfo || ""; column = column || 0; if(isDebugBuild) { var externalObj; if(window.parent.getExternalObj) { externalObj = window.parent.getExternalObj(); } else if(window.external) { externalObj = window.external; } if(externalObj) { var component = (window.errorComponent ? window.errorComponent : "Common"); console.error(([ component, message, file, line, column ]).join("\r\n")); if(window.errorDisplayHandler) { window.errorDisplayHandler(message, file, line, additionalInfo, column); } } } if(Plugin && Plugin.Diagnostics && Plugin.Diagnostics.reportError) { Plugin.Diagnostics.reportError(message, file, line, additionalInfo, column); } }; window.onerror = function (message, file, line) { var column = 0; if(arguments && arguments[3] && typeof arguments[3] === 'number') { column = arguments[3]; } window.reportError(message, file, line, "", column); return true; }; //@ sourceMappingURL=errorHandling.js.map // KeyCodes.ts var Common; (function (Common) { "use strict"; var Keys = (function () { function Keys() { } Keys.c = "c"; Keys.DEL = "Del"; Keys.DOWN = "Down"; Keys.END = "End"; Keys.ENTER = "Enter"; Keys.F10 = "F10"; Keys.HOME = "Home"; Keys.LEFT = "Left"; Keys.RIGHT = "Right"; Keys.SPACEBAR = "Spacebar"; Keys.UP = "Up"; return Keys; })(); Common.Keys = Keys; (function (KeyCodes) { KeyCodes._map = []; KeyCodes.BACKSPACE = 8; KeyCodes.TAB = 9; KeyCodes.ENTER = 13; KeyCodes.SHIFT = 16; KeyCodes.CONTROL = 17; KeyCodes.ALT = 18; KeyCodes.CAPS_LOCK = 20; KeyCodes.ESCAPE = 27; KeyCodes.SPACE = 32; KeyCodes.PAGE_UP = 33; KeyCodes.PAGE_DOWN = 34; KeyCodes.END = 35; KeyCodes.HOME = 36; KeyCodes.ARROW_LEFT = 37; KeyCodes.ARROW_FIRST = 37; KeyCodes.ARROW_UP = 38; KeyCodes.ARROW_RIGHT = 39; KeyCodes.ARROW_DOWN = 40; KeyCodes.ARROW_LAST = 40; KeyCodes.INSERT = 45; KeyCodes.DELETE = 46; KeyCodes.A = 65; KeyCodes.B = 66; KeyCodes.C = 67; KeyCodes.D = 68; KeyCodes.E = 69; KeyCodes.F = 70; KeyCodes.G = 71; KeyCodes.H = 72; KeyCodes.I = 73; KeyCodes.J = 74; KeyCodes.K = 75; KeyCodes.L = 76; KeyCodes.M = 77; KeyCodes.N = 78; KeyCodes.O = 79; KeyCodes.P = 80; KeyCodes.Q = 81; KeyCodes.R = 82; KeyCodes.S = 83; KeyCodes.T = 84; KeyCodes.U = 85; KeyCodes.V = 86; KeyCodes.W = 87; KeyCodes.X = 88; KeyCodes.Y = 89; KeyCodes.Z = 90; KeyCodes.CONTEXTMENU = 93; KeyCodes.MULTIPLY = 106; KeyCodes.PLUS = 107; KeyCodes.MINUS = 109; KeyCodes.F1 = 112; KeyCodes.F2 = 113; KeyCodes.F3 = 114; KeyCodes.F4 = 115; KeyCodes.F5 = 116; KeyCodes.F6 = 117; KeyCodes.F7 = 118; KeyCodes.F8 = 119; KeyCodes.F9 = 120; KeyCodes.F10 = 121; KeyCodes.F11 = 122; KeyCodes.F12 = 123; KeyCodes.COMMA = 188; KeyCodes.PERIOD = 190; })(Common.KeyCodes || (Common.KeyCodes = {})); var KeyCodes = Common.KeyCodes; (function (MouseButtons) { MouseButtons._map = []; MouseButtons.LEFT_BUTTON = 0; MouseButtons.MIDDLE_BUTTON = 1; MouseButtons.RIGHT_BUTTON = 2; })(Common.MouseButtons || (Common.MouseButtons = {})); var MouseButtons = Common.MouseButtons; (function (KeyFlags) { KeyFlags._map = []; KeyFlags.KeyFlags_None = 0x0; KeyFlags.KeyFlags_Shift = 0x1; KeyFlags.KeyFlags_Ctrl = 0x2; KeyFlags.KeyFlags_Alt = 0x4; })(Common.KeyFlags || (Common.KeyFlags = {})); var KeyFlags = Common.KeyFlags; function blockBrowserAccelerators() { document.addEventListener("keydown", function (e) { return preventIEKeys(e); }); document.addEventListener("contextmenu", function (e) { e.preventDefault(); e.stopPropagation(); return false; }); window.addEventListener("mousewheel", function (e) { if(e.ctrlKey) { e.preventDefault(); e.stopPropagation(); return false; } }); } Common.blockBrowserAccelerators = blockBrowserAccelerators; function HasAnyOfAltCtrlShiftKeyFlags(e) { return e.shiftKey || e.ctrlKey || e.altKey; } Common.HasAnyOfAltCtrlShiftKeyFlags = HasAnyOfAltCtrlShiftKeyFlags; function preventIEKeys(e) { if(e.keyCode === Common.KeyCodes.F5 || e.keyCode === Common.KeyCodes.F6 || (e.keyCode === Common.KeyCodes.F10 && e.shiftKey) || (e.keyCode === Common.KeyCodes.F && e.ctrlKey)) { e.preventDefault(); e.stopPropagation(); return false; } return true; } Common.preventIEKeys = preventIEKeys; })(Common || (Common = {})); //@ sourceMappingURL=KeyCodes.js.map // HostBridge.ts var Common; (function (Common) { (function (ResourceLocation) { ResourceLocation._map = []; ResourceLocation.Local = 2; ResourceLocation.Host = 3; })(Common.ResourceLocation || (Common.ResourceLocation = {})); var ResourceLocation = Common.ResourceLocation; var IEHostBridge = (function () { function IEHostBridge(externalObj) { this._externalObj = externalObj; } IEHostBridge.prototype.start = function () { }; IEHostBridge.prototype.loadCssFile = function (fileName, isCommonFile) { throw "Not supported."; }; IEHostBridge.prototype.loadString = function (resourceId) { return Plugin.Resources.getString("/Common/" + resourceId); }; IEHostBridge.prototype.loadFormattedString = function (resourceId, parameters) { return Plugin.Resources.getString("/Common/" + resourceId, parameters); }; IEHostBridge.prototype.getIsToolWindowActive = function () { return new SynchronousPromise(function () { return false; }); }; IEHostBridge.prototype.getAreCodeMarkersEnabled = function () { return new SynchronousPromise(function () { return true; }); }; IEHostBridge.prototype.getIsAtBreakpoint = function () { return new SynchronousPromise(function () { return (Plugin).F12.Debugger.getIsAtBreakpoint(); }); }; IEHostBridge.prototype.getIsAtBreakpointInWorker = function () { return new SynchronousPromise(function () { return (Plugin).F12.Debugger.getIsAtBreakpointInWorker(); }); }; IEHostBridge.prototype.addEventListener = function (eventName, callback) { (Plugin).F12.addEventListener(eventName, callback); }; IEHostBridge.prototype.removeEventListener = function (eventName, callback) { (Plugin).F12.removeEventListener(eventName, callback); }; IEHostBridge.prototype.fireCodeMarker = function (codeMarker) { Plugin.VS.Internal.CodeMarkers.fire(codeMarker); }; IEHostBridge.prototype.executeBreakModeCommand = function (id, command, isWorker, createInvoker) { if (typeof createInvoker === "undefined") { createInvoker = BridgeHelpers.createInvoker; } if(!(Plugin).F12.Debugger.getIsAtBreakpoint()) { return new SynchronousPromise(function () { return false; }); } var invoker = createInvoker(id, command, isWorker); return (Plugin).F12.Debugger.executeBreakModeCommand(invoker); }; IEHostBridge.prototype.takeForeground = function () { (Plugin).F12.takeForeground(); }; IEHostBridge.prototype.setForeground = function (hwnd) { return new SynchronousPromise(function () { return (Plugin).F12.setForeground(hwnd); }); }; IEHostBridge.prototype.allowRemoteToTakeForeground = function () { return new SynchronousPromise(function () { var pid = (Plugin).F12.getRemoteProcessId(); return (Plugin).F12.allowSetForeground(pid); }); }; IEHostBridge.prototype.notifyOnBrowserActivate = function () { }; IEHostBridge.prototype.log = function (message) { Plugin.log(message); }; IEHostBridge.prototype.notifyUnsupportedBrowser = function (documentMode) { }; IEHostBridge.prototype.openF1HelpLink = function (keyword) { var f1OnlineBaseUrl = "http://msdn.microsoft.com/query/dev12.query?appId=Dev12IDEF1&l="; var webClientF1KeywordPrefix = "VS.WebClient.Help."; var url = f1OnlineBaseUrl + Plugin.Culture.lang.toUpperCase() + "&k=k(" + webClientF1KeywordPrefix + keyword + ")"; (Plugin).F12.openBrowser(url); }; IEHostBridge.prototype.openDocumentLink = function (deployedUrl, line, col) { Plugin.Host.showDocument(deployedUrl, line || 1, col || 1); }; IEHostBridge.prototype.hookEyeDropper = function (hook) { this._externalObj.utilities.hookEyeDropper(hook); }; IEHostBridge.prototype.getEyeDropperColor = function () { return this._externalObj.utilities.getEyeDropperColor(); }; IEHostBridge.prototype.unhookEyeDropper = function () { this._externalObj.utilities.unhookEyeDropper(); }; IEHostBridge.prototype.showContextMenu = function (name, x, y, callBack, menuParams) { }; Object.defineProperty(IEHostBridge.prototype, "inspectElementId", { get: function () { return (Plugin).F12.getInspectElementId(); }, set: function (elementId) { (Plugin).F12.setInspectElementId(elementId); }, enumerable: true, configurable: true }); IEHostBridge.prototype.activateTab = function (pluginName) { if(pluginName == "Dom") { (Plugin).F12.activateTab(5); } }; IEHostBridge.prototype.openBrowser = function (url) { (Plugin).F12.openBrowser(url); }; IEHostBridge.prototype.readPluginFile = function (fileName) { return this._externalObj.storage.readResourceText(fileName, ResourceLocation.Local); }; return IEHostBridge; })(); Common.IEHostBridge = IEHostBridge; var HostBridge = (function () { function HostBridge() { this._proxy = Plugin.Utilities.JSONMarshaler.attachToPublishedObject("F12.Common.Bridge.IHostBridge", this, true); } HostBridge.prototype.start = function () { this._proxy._post("start"); }; HostBridge.prototype.loadCssFile = function (fileName, isCommonFile) { throw "Not supported."; }; HostBridge.prototype.loadString = function (resourceId) { return Plugin.Resources.getString(resourceId); }; HostBridge.prototype.loadFormattedString = function (resourceId, parameters) { return Plugin.Resources.getString(resourceId, parameters); }; HostBridge.prototype.getIsToolWindowActive = function () { return new SynchronousPromise(function () { return false; }); }; HostBridge.prototype.getAreCodeMarkersEnabled = function () { return new SynchronousPromise(function () { return true; }); }; HostBridge.prototype.getIsAtBreakpoint = function () { return this._proxy._call("getIsAtBreakpoint"); }; HostBridge.prototype.getIsAtBreakpointInWorker = function () { return this._proxy._call("getIsAtBreakpointInWorker"); }; HostBridge.prototype.takeForeground = function () { this._proxy._post("takeForeground"); }; HostBridge.prototype.setForeground = function (hwnd) { var _this = this; return this._proxy._call("getHostProcessId").then(function (pid) { Plugin.Host.allowSetForeground(pid); return _this._proxy._call("setForeground", hwnd); }); }; HostBridge.prototype.allowRemoteToTakeForeground = function () { return this._proxy._call("getRemoteProcessId").then(function (pid) { Plugin.Host.allowSetForeground(pid); }); }; HostBridge.prototype.addEventListener = function (eventName, callback) { this._proxy.addEventListener(eventName, callback); }; HostBridge.prototype.removeEventListener = function (eventName, callback) { this._proxy.removeEventListener(eventName, callback); }; HostBridge.prototype.fireCodeMarker = function (codeMarker) { Plugin.VS.Internal.CodeMarkers.fire(codeMarker); }; HostBridge.prototype.executeBreakModeCommand = function (id, command, isWorker, createInvoker) { if (typeof createInvoker === "undefined") { createInvoker = BridgeHelpers.createInvoker; } var invoker = createInvoker(id, command, isWorker); return this._proxy._call("executeBreakModeCommand", invoker); }; HostBridge.prototype.notifyOnBrowserActivate = function () { }; HostBridge.prototype.log = function (message) { Plugin.log(message); }; HostBridge.prototype.notifyUnsupportedBrowser = function (documentMode) { }; HostBridge.prototype.openF1HelpLink = function (keyword) { this._proxy._post("openF1HelpLink", keyword); }; HostBridge.prototype.openDocumentLink = function (deployedUrl, line, col) { Plugin.Host.showDocument(deployedUrl, line, col); }; HostBridge.prototype.hookEyeDropper = function (hook) { throw "not implemented."; }; HostBridge.prototype.getEyeDropperColor = function () { throw "not implemented."; }; HostBridge.prototype.unhookEyeDropper = function () { throw "not implemented."; }; Object.defineProperty(HostBridge.prototype, "inspectElementId", { get: function () { return ""; }, set: function (elementId) { }, enumerable: true, configurable: true }); HostBridge.prototype.activateTab = function (tabId) { }; HostBridge.prototype.openBrowser = function (url) { }; HostBridge.prototype.readPluginFile = function (fileName) { throw "not implemented."; }; return HostBridge; })(); Common.HostBridge = HostBridge; var SynchronousPromise = (function () { function SynchronousPromise(result, error) { this._result = result; this._error = error; } SynchronousPromise.prototype.done = function (completed, error, progress) { try { var result = this._result && this._result(); if(completed) { completed(result); } } catch (e) { if(error) { error(e); } else { throw e; } } }; SynchronousPromise.prototype.then = function (completed, error, progress) { throw "not implemented"; }; SynchronousPromise.prototype.cancel = function () { }; return SynchronousPromise; })(); Common.SynchronousPromise = SynchronousPromise; var BridgeHelpers = (function () { function BridgeHelpers() { } BridgeHelpers.createInvoker = function createInvoker(id, command, isWorker) { var invoker = "__BROWSERTOOLS_CONSOLE_BREAKMODE_FUNC('" + id + "', '" + command + "');"; if(id && isWorker) { var escapedCommand = JSON.stringify(command).slice(1, -1); invoker = " __BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER = { returnValue: { isError: false } };\n" + " try {\n" + " // Evaluate the input using the current breakpoint context \n" + " __BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.returnValue.result = eval(\"" + escapedCommand + "\");\n" + " } catch(e) {\n" + " __BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.returnValue.result = e;\n" + " __BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.returnValue.isError = true;\n" + " }\n" + "\n" + " // Call the remote side console with the result from the eval that used the current breakpoint context \n" + " __BROWSERTOOLS_CONSOLE_BREAKMODE_FUNC('" + id + "', __BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.returnValue);\n" + "\n" + " __BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER = null;\n"; } else if(id && !isWorker) { var escapedCommand = JSON.stringify(command).slice(1, -1); invoker = " window.__BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER = { inline:[], result: undefined, isError: false };\n" + " try {\n" + " if ((typeof window.cd) === 'undefined') {\n" + " window.cd = window.console.cd;\n" + " window.__BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.inline.push({ name: 'cd', func: window.console.cd });\n" + " }\n" + " if ((typeof window.dir) === 'undefined') {\n" + " window.dir = window.console.dir;\n" + " window.__BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.inline.push({ name: 'dir', func: window.console.dir });\n" + " }\n" + " if ((typeof window.select) === 'undefined') {\n" + " window.select = window.console.select;\n" + " window.__BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.inline.push({ name: 'select', func: window.console.select });\n" + " }\n" + "\n" + " if ((typeof window.$) === 'undefined') {\n" + " window.$ = window.__BROWSERTOOLS_CONSOLE.$;\n" + " window.__BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.inline.push({ name: '$', func: window.$ });\n" + " }\n" + " if ((typeof window.$$) === 'undefined') {\n" + " window.$$ = window.__BROWSERTOOLS_CONSOLE.$$;\n" + " window.__BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.inline.push({ name: '$$', func: window.$$ });\n" + " }\n" + " if (window.__BROWSERTOOLS_DOMEXPLORER_STORED_ELEMENTS) {\n" + " (function() { for (var i = 0; i <= 4; i++) {\n" + " if ((typeof window['$' + i]) === 'undefined') {\n" + " window['$' + i] = window.__BROWSERTOOLS_DOMEXPLORER_STORED_ELEMENTS[i];\n" + " window.__BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.inline.push({ name: '$' + i, func: window['$' + i] });\n" + " }\n" + " }})();\n" + " }\n" + "\n" + " // Evaluate the input using the current breakpoint context \n" + " window.__BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.result = eval(\"" + escapedCommand + "\");\n" + " } catch(e) {\n" + " window.__BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.result = e;\n" + " window.__BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.isError = true;\n" + " }\n" + "\n" + " // Call the remote side console with the result from the eval that used the current breakpoint context \n" + " __BROWSERTOOLS_CONSOLE_BREAKMODE_FUNC('" + id + "', window.__BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER);\n" + "\n" + " // Clean up the short-cut functions\n" + " (function() { for (var i = 0; i < window.__BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.inline.length; i++) {\n" + " if (window[window.__BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.inline[i].name] === window.__BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.inline[i].func) {\n" + " delete window[window.__BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.inline[i].name];\n" + " }\n" + " }})();\n" + " window.__BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER = null;"; } return invoker; }; return BridgeHelpers; })(); })(Common || (Common = {})); //@ sourceMappingURL=HostBridge.js.map // ButtonHelpers.ts var Common; (function (Common) { "use strict"; var ButtonHelpers = (function () { function ButtonHelpers() { } ButtonHelpers.changeButtonStatus = function changeButtonStatus(buttonDiv, enabled, pressed) { var wasEnabled = ButtonHelpers.isEnabled(buttonDiv); if(enabled && !wasEnabled) { buttonDiv.classList.remove("toolbarButtonStateDisabled"); buttonDiv.setAttribute("aria-disabled", "false"); } else if(!enabled && wasEnabled) { buttonDiv.classList.add("toolbarButtonStateDisabled"); buttonDiv.setAttribute("aria-disabled", "true"); } if(typeof pressed === "boolean") { ButtonHelpers._isChangingAriaPressed = true; buttonDiv.setAttribute("aria-pressed", pressed ? "true" : "false"); ButtonHelpers._isChangingAriaPressed = false; } }; ButtonHelpers.isEnabled = function isEnabled(buttonDiv) { return !buttonDiv.classList.contains("toolbarButtonStateDisabled"); }; ButtonHelpers.isValidEvent = function isValidEvent(event) { return (event.type === "click" || event.keyCode === Common.KeyCodes.ENTER || event.keyCode === Common.KeyCodes.SPACE) && ButtonHelpers.isEnabled(event.currentTarget); }; ButtonHelpers.setupButton = function setupButton(buttonDiv, tooltipResourceName, clickHandler, isEnabled) { if (typeof isEnabled === "undefined") { isEnabled = true; } if(typeof tooltipResourceName === "string") { var tooltip = Plugin.Resources.getString(tooltipResourceName); buttonDiv.setAttribute("data-plugin-vs-tooltip", tooltip); buttonDiv.setAttribute("aria-label", tooltip); buttonDiv.setAttribute("role", "button"); } if(clickHandler) { buttonDiv.addEventListener("click", function (event) { return ButtonHelpers.onButtonPress(event, clickHandler); }); buttonDiv.addEventListener("keydown", function (event) { return ButtonHelpers.onButtonPress(event, clickHandler); }); buttonDiv.addEventListener("DOMAttrModified", function (event) { if(!ButtonHelpers._isChangingAriaPressed && ButtonHelpers.isEnabled(buttonDiv) && event.attrName === "aria-pressed" && event.attrChange === event.MODIFICATION) { clickHandler(event); } }); } buttonDiv.addEventListener("mousedown", ButtonHelpers.onButtonMouseDown); buttonDiv.addEventListener("mouseenter", ButtonHelpers.onButtonMouseEnter); buttonDiv.addEventListener("mouseleave", ButtonHelpers.onButtonMouseLeave); buttonDiv.addEventListener("mouseup", ButtonHelpers.onButtonMouseUp); if(!isEnabled) { ButtonHelpers.changeButtonStatus(buttonDiv, false); } }; ButtonHelpers.onButtonMouseDown = function onButtonMouseDown(event) { var buttonDiv = event.currentTarget; if(ButtonHelpers.isEnabled(buttonDiv)) { buttonDiv.classList.add("toolbarButtonMouseDown"); } else { event.stopImmediatePropagation(); } }; ButtonHelpers.onButtonMouseEnter = function onButtonMouseEnter(event) { var buttonDiv = event.currentTarget; if(ButtonHelpers.isEnabled(buttonDiv)) { buttonDiv.classList.add("toolbarButtonMouseHover"); } else { event.preventDefault(); event.stopImmediatePropagation(); } }; ButtonHelpers.onButtonMouseLeave = function onButtonMouseLeave(event) { var buttonDiv = event.currentTarget; buttonDiv.classList.remove("toolbarButtonMouseHover"); buttonDiv.classList.remove("toolbarButtonMouseDown"); }; ButtonHelpers.onButtonMouseUp = function onButtonMouseUp(event) { var buttonDiv = event.currentTarget; buttonDiv.classList.remove("toolbarButtonMouseDown"); }; ButtonHelpers.onButtonPress = function onButtonPress(event, clickHandler) { if(ButtonHelpers.isValidEvent(event)) { clickHandler(event); event.preventDefault(); event.stopImmediatePropagation(); } }; return ButtonHelpers; })(); Common.ButtonHelpers = ButtonHelpers; })(Common || (Common = {})); //@ sourceMappingURL=ButtonHelpers.js.map // DiagnosticsBridge.ts var Common; (function (Common) { var DiagnosticsPort = (function () { function DiagnosticsPort(_proxy, _portName) { this._proxy = _proxy; this._portName = _portName; } Object.defineProperty(DiagnosticsPort.prototype, "name", { get: function () { return this._portName; }, enumerable: true, configurable: true }); DiagnosticsPort.prototype.postMessage = function (data) { this._proxy._post("sendMessage", this._portName, data); }; DiagnosticsPort.prototype.addEventListener = function (type, listener) { if(type === "message") { this._proxy.addEventListener(type, listener); } }; DiagnosticsPort.prototype.removeEventListener = function (type, listener) { if(type === "message") { this._proxy.removeEventListener(type, listener); } }; return DiagnosticsPort; })(); var IEDiagnosticsBridge = (function () { function IEDiagnosticsBridge(externalObj) { this._externalObj = externalObj; } IEDiagnosticsBridge.prototype.isAttached = function () { var _this = this; return new Common.SynchronousPromise(function () { return _this._externalObj.isAttached; }); }; IEDiagnosticsBridge.prototype.loadScriptInProc = function (fileName) { this._externalObj.loadScriptInProc(fileName); }; IEDiagnosticsBridge.prototype.createPort = function (port) { return port; }; IEDiagnosticsBridge.prototype.addEventListener = function (type, listener) { this._externalObj.addEventListener(type, listener); }; IEDiagnosticsBridge.prototype.removeEventListener = function (type, listener) { this._externalObj.removeEventListener(type, listener); }; IEDiagnosticsBridge.prototype.fireAttachedEvent = function () { this._externalObj.fireAttachedEvent(); }; IEDiagnosticsBridge.prototype.fireDetachedEvent = function () { this._externalObj.fireDetachedEvent(); }; return IEDiagnosticsBridge; })(); Common.IEDiagnosticsBridge = IEDiagnosticsBridge; var DiagnosticsBridge = (function () { function DiagnosticsBridge() { this._proxy = Plugin.Utilities.JSONMarshaler.attachToPublishedObject("F12.Common.Bridge.IDiagnosticsBridge", this, true); } DiagnosticsBridge.prototype.isAttached = function () { return this._proxy._call("isAttached"); }; DiagnosticsBridge.prototype.loadScriptInProc = function (fileName) { this._proxy._post("loadScriptInProc", fileName); }; DiagnosticsBridge.prototype.createPort = function (port) { return new DiagnosticsPort(this._proxy, port.portName); }; DiagnosticsBridge.prototype.addEventListener = function (type, listener) { this._proxy.addEventListener(type, listener); }; DiagnosticsBridge.prototype.removeEventListener = function (type, listener) { this._proxy.removeEventListener(type, listener); }; DiagnosticsBridge.prototype.fireAttachedEvent = function () { }; DiagnosticsBridge.prototype.fireDetachedEvent = function () { }; return DiagnosticsBridge; })(); Common.DiagnosticsBridge = DiagnosticsBridge; })(Common || (Common = {})); //@ sourceMappingURL=DiagnosticsBridge.js.map // toolwindow.ts var toolwindowHelpers = { codeMarkers: { perfBrowserTools_DiagnosticsToolWindowsConsoleReady: 23609, perfBrowserTools_DiagnosticsToolWindowsDomExplorerReady: 23610, perfBrowserTools_DiagnosticsToolWindowsExpandConsoleObjectBegin: 23611, perfBrowserTools_DiagnosticsToolWindowsExpandConsoleObjectEnd: 23612, perfBrowserTools_DiagnosticsToolWindowsExpandConsoleObjectInteractive: 23613, perfBrowserTools_DiagnosticsToolWindowsConsoleEvalBegin: 23614, perfBrowserTools_DiagnosticsToolWindowsConsoleEvalEnd: 23615, perfBrowserTools_DiagnosticsToolWindowsDataTreeToggleBegin: 23616, perfBrowserTools_DiagnosticsToolWindowsDataTreeToggleEnd: 23617, perfBrowserTools_DiagnosticsToolWindowsTreeViewToggleBegin: 23618, perfBrowserTools_DiagnosticsToolWindowsTreeViewToggleEnd: 23619, perfBrowserTools_DiagnosticsToolWindowsDomExplorerRefreshBegin: 23620, perfBrowserTools_DiagnosticsToolWindowsDomExplorerRefreshEnd: 23621, perfBrowserTools_DiagnosticsToolWindowsDomExplorerAttributeChanged: 23622, perfBrowserTools_DiagnosticsToolWindowsDomExplorerTabChanged: 23623, perfBrowserTools_DiagnosticsToolWindowsNetworkExplorerReady: 23624 }, _hostBridge: null, areCodeMarkersEnabled: false, initializeToolWindow: function (hostBridge, onShowCallback) { toolwindowHelpers._hostBridge = hostBridge; toolwindowHelpers.onShowCallback = onShowCallback; document.addEventListener("mousedown", function () { toolwindowHelpers._hostBridge.notifyOnBrowserActivate(); $m(document.body).removeClass("showFocus"); }, true); $m(document).bind("contextmenu", function () { return false; }); $m(document).bind("keydown", function (event) { if(event.keyCode === Common.KeyCodes.F5 || (event.keyCode === Common.KeyCodes.F10 && event.shiftKey)) { event.preventDefault(); event.stopPropagation(); return false; } else if(event.keyCode === Common.KeyCodes.TAB) { $m(document.body).addClass("showFocus"); } }); $m(".BPT-ToolbarButton").bind("mousedown", function (event) { var element = $m(this); if(!element.hasClass("BPT-ToolbarButton-StateDisabled")) { element.addClass("BPT-ToolbarButton-MouseDown"); } else { event.stopImmediatePropagation(); } }); $m(".BPT-ToolbarButton").bind("mouseup", function () { $m(this).removeClass("BPT-ToolbarButton-MouseDown"); }); $m(".BPT-ToolbarButton").bind("mouseleave", function () { $m(this).removeClass("BPT-ToolbarButton-MouseDown BPT-ToolbarButton-MouseHover"); }); $m(".BPT-ToolbarButton").bind("mouseenter", function (event) { var element = $m(this); if(!element.hasClass("BPT-ToolbarButton-StateDisabled")) { element.addClass("BPT-ToolbarButton-MouseHover"); } else { event.preventDefault(); event.stopImmediatePropagation(); } }); $m(".BPT-ToolbarButton").bind("click keydown", function (event) { if(event.type === "click" || event.keyCode === Common.KeyCodes.ENTER || event.keyCode === Common.KeyCodes.SPACE) { var element = $m(this); if(!element.hasClass("BPT-ToolbarButton-StateDisabled")) { var thisElement = element.get(0); if(document.activeElement !== thisElement) { thisElement.focus(); } } else { event.preventDefault(); event.stopImmediatePropagation(); } } }); $m(".BPT-ToolbarToggleButton").bind("click keydown", function (event) { if(event.type === "click" || event.keyCode === Common.KeyCodes.ENTER || event.keyCode === Common.KeyCodes.SPACE) { var element = $m(this); if(!element.hasClass("BPT-ToolbarButton-StateDisabled")) { var thisElement = element.get(0); if(document.activeElement !== thisElement) { thisElement.focus(); } if(element.hasClass("BPT-ToolbarToggleButton-StateOn")) { element.removeClass("BPT-ToolbarToggleButton-StateOn"); element.attr("aria-pressed", false); } else { element.addClass("BPT-ToolbarToggleButton-StateOn"); element.attr("aria-pressed", true); } } else { event.preventDefault(); event.stopImmediatePropagation(); } } }); $m(".BPT-TabCycle-Horizontal, .BPT-TabCycle-Vertical").children(".BPT-TabCycle-Item").bind("keydown", function (event) { if(($m(this).parent().hasClass("BPT-TabCycle-Horizontal") && (event.keyCode === Common.KeyCodes.ARROW_LEFT || event.keyCode === Common.KeyCodes.ARROW_RIGHT)) || ($m(this).parent().hasClass("BPT-TabCycle-Vertical") && (event.keyCode === Common.KeyCodes.ARROW_UP || event.keyCode === Common.KeyCodes.ARROW_DOWN))) { var currentElement = $m(this); var newElement = ((event.keyCode === Common.KeyCodes.ARROW_LEFT || event.keyCode === Common.KeyCodes.ARROW_UP) ? currentElement.prev(".BPT-TabCycle-Item").first() : currentElement.next(".BPT-TabCycle-Item").first()); if(newElement.length > 0) { newElement.attr("tabindex", "1"); newElement.trigger("focus"); newElement.trigger("click"); currentElement.removeAttr("tabindex"); } } }); $m(".BPT-TabCycle-Horizontal, .BPT-TabCycle-Vertical").children(".BPT-TabCycle-Item").bind("mousedown", function (event) { var oldElement = $m(this).siblings(".BPT-TabCycle-Item").matchAttr("tabindex", "1"); var newElement = $m(this); if(newElement.length > 0) { newElement.attr("tabindex", "1"); newElement.trigger("focus"); oldElement.removeAttr("tabindex"); } }); toolwindowHelpers._hostBridge.getAreCodeMarkersEnabled().done(function (data) { toolwindowHelpers.areCodeMarkersEnabled = data; }); }, onShow: function () { if(toolwindowHelpers.onShowCallback) { toolwindowHelpers.onShowCallback(); } }, registerErrorComponent: function (component, errorDisplayHandler) { window.errorComponent = component; window.errorDisplayHandler = errorDisplayHandler; }, registerThemeChange: function (hostBridge, cssFiles, ignoreTreeCssFiles) { function onThemeChange() { var cssThemeFiles = [ "toolwindow.css" ]; if(!ignoreTreeCssFiles) { cssThemeFiles = cssThemeFiles.concat([ "dataTreeView.css", "htmlTreeView.css" ]); } cssThemeFiles = cssThemeFiles.concat(cssFiles); for(var i = 0; i < cssThemeFiles.length; i++) { var id = cssThemeFiles[i]; var contents = hostBridge.loadCssFile(cssThemeFiles[i], i < (!ignoreTreeCssFiles ? 3 : 1)); var oldStyle = document.getElementById(id); if(oldStyle) { document.head.removeChild(oldStyle); } var styleNode = document.createElement("style"); styleNode.id = id; (styleNode).type = "text/css"; styleNode.innerHTML = contents; document.head.appendChild(styleNode); } var trees = $m(".BPT-HtmlTree, .BPT-DataTree, .BPT-DataTree-ScrollContainer, .BPT-Toolbar"); for(var j = 0; j < trees.length; j++) { var element = $m(trees.get(j)); var useDarkTheme = toolwindowHelpers.isDarkThemeBackground(element); if(useDarkTheme) { element.addClass("BPT-Tree-DarkTheme"); } else { element.removeClass("BPT-Tree-DarkTheme"); } } } hostBridge.addEventListener("themeChange", onThemeChange); }, loadString: function (resourceId, params) { return Plugin.Resources.getString.apply(this, [ "/Common/" + resourceId ].concat(params)); }, codeMarker: function (codeMarker) { if(toolwindowHelpers.areCodeMarkersEnabled) { toolwindowHelpers._hostBridge.fireCodeMarker(codeMarker); } }, scrollIntoView: function (element, scrollContainer) { if(element && element.getBoundingClientRect) { var elementRect = element.getBoundingClientRect(); var containerRect = scrollContainer.getBoundingClientRect(); var elementTopIsAboveViewport = elementRect.top < containerRect.top; var elementBottomIsBelowViewport = elementRect.bottom > containerRect.bottom; if(elementTopIsAboveViewport || elementBottomIsBelowViewport) { element.scrollIntoView("top"); return true; } } return false; }, getSortedObjectProperties: function (objectToSort) { var sortedPropNames = []; for(var propName in objectToSort) { sortedPropNames.push(propName); } sortedPropNames.sort(toolwindowHelpers.naturalSort); return sortedPropNames; }, getSortedArrayProperties: function (arrayToSort, key, highPriorityValue) { var i; var sortedProps = []; for(i = 0; i < arrayToSort.length; i++) { sortedProps.push({ property: arrayToSort[i][key], realIndex: i }); } sortedProps.sort(function (a, b) { if(highPriorityValue) { if(a.property === highPriorityValue && b.property === highPriorityValue) { return 0; } else if(a.property === highPriorityValue) { return -1; } else if(b.property === highPriorityValue) { return 1; } } return toolwindowHelpers.naturalSort(a.property, b.property); }); var sortedList = []; for(i = 0; i < sortedProps.length; i++) { sortedList.push(sortedProps[i].realIndex); } return sortedList; }, naturalSort: function (a, b) { var regexSortGroup = /(\d+)|(\D+)/g; var aGroups = String(a).toLowerCase().match(regexSortGroup); var bGroups = String(b).toLowerCase().match(regexSortGroup); while(aGroups.length > 0 && bGroups.length > 0) { var aFront = aGroups.shift(); var bFront = bGroups.shift(); var aAsDigit = parseInt(aFront, 10); var bAsDigit = parseInt(bFront, 10); if(isNaN(aAsDigit) && isNaN(bAsDigit)) { if(aFront !== bFront) { return (aFront > bFront ? 1 : -1); } } else if(isNaN(aAsDigit)) { return 1; } else if(isNaN(bAsDigit)) { return -1; } else { if(aAsDigit !== bAsDigit) { return (aAsDigit - bAsDigit); } } } return aGroups.length - bGroups.length; }, createShortenedUrlText: function (url) { var shortenedText = url; var javascriptPrefix = "javascript:"; if(shortenedText.toLowerCase().substr(0, javascriptPrefix.length) === javascriptPrefix) { return "javascript:"; } var indexOfHash = shortenedText.indexOf("#"); var indexOfQuestionMark = shortenedText.indexOf("?"); var index = -1; if(indexOfHash > -1 && indexOfQuestionMark > -1) { index = Math.min(indexOfHash, indexOfQuestionMark); } else if(indexOfHash > -1) { index = indexOfHash; } else if(indexOfQuestionMark > -1) { index = indexOfQuestionMark; } if(index > -1) { shortenedText = shortenedText.substring(0, index); } index = shortenedText.lastIndexOf("/"); while(index !== -1 && index === (shortenedText.length - 1)) { shortenedText = shortenedText.substring(0, shortenedText.length - 1); index = shortenedText.lastIndexOf("/"); } if(index > -1) { shortenedText = shortenedText.substring(index + 1); } return shortenedText; }, getTruncatedFileName: function (filePath) { if(!filePath) { return filePath; } var maxLength = 20; var fileName = toolwindowHelpers.createShortenedUrlText(filePath); if(fileName.length > maxLength) { var index = maxLength / 2 - 2; fileName = fileName.substr(0, index) + this.loadString("Ellipsis") + fileName.substr(fileName.length - index); } return fileName; }, createFileLinkText: function (fileUrl, line) { var linkText = this.getTruncatedFileName(fileUrl); if(line) { linkText += ":" + line; } return linkText; }, createLinkDivText: function (link, styles, dontGenerateTooltip) { var linker = ""; if(link && link.url) { var url = "\"" + link.url.replace(/\\"/g, "\"") + "\""; var linkText = toolwindowHelpers.createShortenedUrlText(link.url); var search = ""; if(link.search) { search = "\"" + link.search.replace(/\\"/g, "\"") + "\""; } linkText = linkText.replace(/&/g, "&").replace(/>/g, ">").replace(/"; } return linker; }, htmlEscape: function (htmlString) { if((typeof htmlString) !== "string") { if(htmlString === null || htmlString === undefined) { return ""; } htmlString = "" + htmlString; } return htmlString.replace(/&/g, "&").replace(/>/g, ">").replace(/ 0) { backgroundColor = element.css("background-color"); element = element.parent(); } if(backgroundColor) { var rgbParts = backgroundColor.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); if(rgbParts && rgbParts.length === 4) { var brightness = ((rgbParts[1] * 299) + (rgbParts[2] * 587) + (rgbParts[3] * 114)) / 1000; return (brightness < 127); } } } return false; }, oldShowContextMenu: function (menuId, x, y, callback, menuParams, toolContextMenus) { var menu = toolContextMenus[menuId]; for(var i = 0; i < menu.length; i++) { if(menu[i] !== "separator") { menu[i].enabled = true; } } var j = 0; for(var i = 0; i < menuParams.length && j < menu.length; i++ , j++) { while(menu[j] === "separator") { j++; } if(j >= menu.length) { break; } menu[j].enabled = menuParams[i]; } toolwindowHelpers.showContextMenu(menuId, menu, x, y, callback); }, lastDaytonaContextMenu: null, contextMenuIsUp: false, showContextMenu: function (menuName, itemsArray, x, y, callback) { toolwindowHelpers.takeDownDaytonaContextMenu(); var shimCallback = function (menuId, menuItem) { toolwindowHelpers.takeDownDaytonaContextMenu(); if(menuId && menuItem) { callback(menuId, menuItem.id); } }; toolwindowHelpers.lastDaytonaContextMenu = toolwindowHelpers.daytonaShowContextMenu(menuName, itemsArray, x, y, shimCallback); }, daytonaShowContextMenu: function toolwindowHelpers$daytonaShowContextMenu(menuName, itemsArray, x, y, callback) { var TYPE_SEPARATOR = Plugin.ContextMenu.MenuItemType.separator; var TYPE_COMMAND = Plugin.ContextMenu.MenuItemType.command; var daytonaContextMenuItems = []; var disabled_fn = function () { return true; }; var enabled_fn = function () { return false; }; for(var i = 0, length = itemsArray.length; i < length; i++) { var item = itemsArray[i]; if(item === "separator" || item.id === "separator") { daytonaContextMenuItems.push({ type: TYPE_SEPARATOR }); } else { daytonaContextMenuItems.push({ id: item.id, type: TYPE_COMMAND, label: item.text, iconEnabled: item.iconSrc, iconDisabled: item.iconSrc, disabled: item.enabled || typeof item.enabled === 'undefined' ? enabled_fn : disabled_fn, accessKey: item.accessKey }); } } var oldFocus = document.querySelector(":focus"); var daytonaContextMenu = Plugin.ContextMenu.create(daytonaContextMenuItems, menuName, null, undefined, callback); daytonaContextMenu.addEventListener("dismiss", function (e) { if(oldFocus && !toolwindowHelpers.isFocusGood() && toolwindowHelpers.nodeInDocument(oldFocus)) { oldFocus.focus(); } toolwindowHelpers.contextMenuIsUp = false; }); daytonaContextMenu.show(x, y); toolwindowHelpers.contextMenuIsUp = true; return daytonaContextMenu; }, isContextMenuUp: function () { return toolwindowHelpers.contextMenuIsUp; }, takeDownDaytonaContextMenu: function () { if(toolwindowHelpers.lastDaytonaContextMenu) { var lastContextMenu = toolwindowHelpers.lastDaytonaContextMenu; toolwindowHelpers.lastDaytonaContextMenu = null; lastContextMenu.dismiss(); lastContextMenu.dispose(); } }, nodeInDocument: function toolwindowHelpers$nodeInDocument(node) { if(node) { while(node = node.parentNode) { if(node === document) { return true; } } } return false; }, isFocusGood: function toolwindowHelpers$isFocusGood() { var nowFocus = document.querySelector(":focus"); return nowFocus && nowFocus.tagName !== "BODY"; } }; //@ sourceMappingURL=toolwindow.js.map // Proxy.ts var Proxy = (function () { function Proxy(hostBridge, diagnosticsBridge) { this._uid = 0; this._callbacks = { }; this._pendingTimeout = null; this.remotePort = null; this.atBreakpoint = false; this.atBreakpointInWorker = false; this._hostBridge = hostBridge; this._diagnosticsBridge = diagnosticsBridge; } Proxy.prototype.callRemote = function (command, args, callback, preMessageCallback) { var _this = this; var uidString = this.getUid(); if(callback) { this._callbacks[uidString] = { synced: true, callback: callback || null }; } var callbackUids = []; var newArgs = []; if(args) { for(var i = 0; i < args.length; i++) { if(typeof (args[i]) === "function") { var callbackuid = this.getUid(); callbackUids.push(callbackuid); this._callbacks[callbackuid] = { synced: false, callback: args[i] }; newArgs[i] = { uid: callbackuid, type: "callback" }; } else { newArgs[i] = args[i]; } } } var jsonObj = { uid: uidString, command: command, args: newArgs }; var sendMessageToRemote = function (message, preMessageCallback) { if(_this.remotePort) { if(preMessageCallback) { preMessageCallback(message, args[0]); } try { _this.remotePort.postMessage(message); } catch (e) { return; } } }; this._pendingMessages.push(jsonObj); if(!this._pendingTimeout) { this._pendingTimeout = setTimeout(function () { var message = JSON.stringify(_this._pendingMessages); _this._pendingMessages = []; _this._pendingTimeout = null; sendMessageToRemote(message, preMessageCallback); }, 0); } return callbackUids; }; Proxy.prototype.clearCallBacks = function (uids) { var _this = this; if(uids) { uids.forEach(function (uid) { delete _this._callbacks[uid]; }); } else { this._callbacks = { }; } }; Proxy.prototype.fireCallbacks = function (data) { var msgs = JSON.parse(data); for(var i = 0; i < msgs.length; i++) { var obj = msgs[i]; if(this._callbacks[obj.uid]) { this._callbacks[obj.uid].callback.apply(this, obj.args); if(this._callbacks[obj.uid] && this._callbacks[obj.uid].synced) { delete this._callbacks[obj.uid]; } } else if(obj.uid === "scriptError") { window.reportError(obj.args[0].message, obj.args[0].file, obj.args[0].line, obj.args[0].additionalInfo); } } }; Proxy.prototype.initializeProxy = function (onMessageCallback, onAttachCallback, onDetachCallback, onBreakCallback, onRunCallback) { var _this = this; this._pendingMessages = []; this._onMessageCallback = onMessageCallback; this._onAttachCallback = onAttachCallback; this._onDetachCallback = onDetachCallback || function () { return false; }; this._onBreakCallback = onBreakCallback || function () { return false; }; this._onRunCallback = onRunCallback || function () { return false; }; this._diagnosticsBridge.addEventListener("attach", function () { return _this.onAttach(); }); this._diagnosticsBridge.addEventListener("break", function () { return _this.onBreak(); }); this._diagnosticsBridge.addEventListener("connect", function (p) { return _this.onConnect(p); }); this._diagnosticsBridge.addEventListener("detach", function () { return _this.onDetach(); }); this._diagnosticsBridge.addEventListener("run", function () { return _this.onRun(); }); this._diagnosticsBridge.isAttached().done(function (result) { if(result) { _this.onAttach(); } else { _this.postWarning("DiagnosticsDisabled"); } }, function () { return _this.postWarning("DiagnosticsDisabled"); }); }; Proxy.prototype.executeBreakModeCommand = function (remoteFunction, id, input, callback, createInvoker) { var _this = this; var uidString = this.getUid(); this._callbacks[uidString] = { synced: true, callback: callback || function () { } }; var sendBreakCommand = function () { if(_this.atBreakpoint) { _this._hostBridge.executeBreakModeCommand(remoteFunction + ":" + id + ":" + uidString, input, _this.atBreakpointInWorker, createInvoker).done(function (result) { if(!result) { if(_this.remotePort) { var jsonObj = { uid: uidString, command: remoteFunction, args: [ id, input ] }; var message = JSON.stringify([ jsonObj ]); try { _this.remotePort.postMessage(message); } catch (e) { return; } } } }); } }; setTimeout(sendBreakCommand, 0); }; Proxy.prototype.onAttach = function () { var _this = this; this.hideWarningSection(); this._hostBridge.getIsAtBreakpoint().done(function (data) { _this.atBreakpoint = data; _this._onAttachCallback(); }); this._hostBridge.getIsAtBreakpointInWorker().done(function (data) { _this.atBreakpointInWorker = data; }); }; Proxy.prototype.onDetach = function () { if(this.remotePort) { this.remotePort.removeEventListener("message", this._onMessageCallback); this.remotePort = null; } this.atBreakpoint = false; this.atBreakpointInWorker = false; this._callbacks = { }; this._pendingMessages = []; this._pendingTimeout = null; this._onDetachCallback(); this.postWarning("DiagnosticsDisabled"); }; Proxy.prototype.onBreak = function () { var _this = this; if(this.remotePort) { this.atBreakpoint = true; this._hostBridge.getIsAtBreakpointInWorker().done(function (data) { _this.atBreakpointInWorker = data; }); } if(this._onBreakCallback) { this._onBreakCallback(); } }; Proxy.prototype.onRun = function () { if(this.remotePort) { this.atBreakpoint = false; this.atBreakpointInWorker = false; } if(this._onRunCallback) { this._onRunCallback(); } }; Proxy.prototype.onConnect = function (port) { var _this = this; this.remotePort = this._diagnosticsBridge.createPort(port); this.remotePort.addEventListener("message", this._onMessageCallback); this._hostBridge.getIsAtBreakpoint().done(function (data) { _this.atBreakpoint = data; }); this._hostBridge.getIsAtBreakpointInWorker().done(function (data) { _this.atBreakpointInWorker = data; }); }; Proxy.prototype.getUid = function () { return "uid" + (this._uid++).toString(36); }; Proxy.prototype.hideWarningSection = function () { $m("#warningSection").hide(); }; Proxy.prototype.postWarning = function (msg) { $m("#warningMessageText").text(toolwindowHelpers.loadString(msg)); $m("#warningSection").show(); }; return Proxy; })(); //@ sourceMappingURL=Proxy.js.map // trace.ts var Common; (function (Common) { (function (TraceEvents) { TraceEvents._map = []; TraceEvents.Debugger_StepOver_Start = 0x12d; TraceEvents.Debugger_StepInto_Start = 0x12e; TraceEvents.Debugger_StepOut_Start = 0x12f; TraceEvents.Debugger_OnBreak_Start = 0x130; TraceEvents.Debugger_OnBreak_Stop = 0x131; TraceEvents.Debugger_PrettyPrint_Start = 0x132; TraceEvents.Debugger_PrettyPrint_Stop = 0x133; TraceEvents.Debugger_OpenDocument_Start = 0x134; TraceEvents.Debugger_OpenDocument_Stop = 0x135; TraceEvents.Debugger_CloseDocument_Start = 0x136; TraceEvents.Debugger_CloseDocument_Stop = 0x137; TraceEvents.Debugger_SwitchDocument_Start = 0x138; TraceEvents.Debugger_SwitchDocument_Stop = 0x139; TraceEvents.Debugger_RevealRange_Start = 0x13a; TraceEvents.Debugger_RevealRange_Stop = 0x13b; TraceEvents.Debugger_CallstackController_GoTo_Start = 0x13c; TraceEvents.Debugger_CallstackController_GoTo_Stop = 0x13d; TraceEvents.Debugger_BreakpointController_SetAllEnabledStates_Start = 0x13e; TraceEvents.Debugger_BreakpointController_SetAllEnabledStates_Stop = 0x13f; TraceEvents.Debugger_EditorWindow_NavigateTo_Start = 0x140; TraceEvents.Debugger_EditorWindow_NavigateTo_Stop = 0x141; TraceEvents.Debugger_Editor_SetModel_Start = 0x142; TraceEvents.Debugger_Editor_SetModel_Stop = 0x143; TraceEvents.Debugger_Editor_CreateModel_Start = 0x144; TraceEvents.Debugger_Editor_CreateModel_Stop = 0x145; TraceEvents.Debugger_Editor_Create_Start = 0x146; TraceEvents.Debugger_Editor_Create_Stop = 0x147; TraceEvents.Debugger_Editor_Layout_Start = 0x148; TraceEvents.Debugger_Editor_Layout_Stop = 0x149; TraceEvents.Debugger_Editor_ChangeViewZones_Start = 0x14a; TraceEvents.Debugger_Editor_ChangeViewZones_Stop = 0x14b; TraceEvents.Debugger_Editor_RevealPosition_Start = 0x14c; TraceEvents.Debugger_Editor_RevealPosition_Stop = 0x14d; TraceEvents.Debugger_Editor_SaveViewState_Start = 0x14e; TraceEvents.Debugger_Editor_SaveViewState_Stop = 0x14f; TraceEvents.Debugger_Editor_RestoreViewState_Start = 0x150; TraceEvents.Debugger_Editor_RestoreViewState_Stop = 0x151; TraceEvents.Debugger_EditorWindow_CreateDataTipFromPosition_Start = 0x152; TraceEvents.Debugger_EditorWindow_CreateDataTipFromPosition_Stop = 0x153; TraceEvents.Debugger_BreakpointController_SetEnabledState_Start = 0x154; TraceEvents.Debugger_BreakpointController_SetEnabledState_Stop = 0x155; TraceEvents.Debugger_BreakpointController_BreakpointChanged_Start = 0x156; TraceEvents.Debugger_BreakpointController_BreakpointChanged_Stop = 0x157; TraceEvents.Debugger_BreakpointWindow_BreakpointChanged_Start = 0x158; TraceEvents.Debugger_BreakpointWindow_BreakpointChanged_Stop = 0x159; TraceEvents.Debugger_WatchWindowView_RefreshView_Start = 0x15a; TraceEvents.Debugger_WatchWindowView_RefreshView_Stop = 0x15b; TraceEvents.Console_Window_Create_Start = 0x191; TraceEvents.Console_Window_Create_Stop = 0x192; TraceEvents.Console_Attach_Start = 0x193; TraceEvents.Console_Attach_Stop = 0x194; TraceEvents.Console_Message_Start = 0x195; TraceEvents.Console_Message_Stop = 0x196; TraceEvents.Console_Input_Start = 0x197; TraceEvents.Console_Input_Stop = 0x198; TraceEvents.Console_Output_Start = 0x199; TraceEvents.Console_Output_Stop = 0x19a; TraceEvents.Console_Output_Render_Start = 0x19b; TraceEvents.Console_Output_Render_Stop = 0x19c; TraceEvents.Console_Item_Toggle_Start = 0x19d; TraceEvents.Console_Item_Toggle_Stop = 0x19e; TraceEvents.Console_HtmlLines_Expand_Start = 0x19f; TraceEvents.Console_HtmlLines_Expand_Stop = 0x1a0; TraceEvents.Console_Context_Menu_Loading_Start = 0x1a1; TraceEvents.Console_Context_Menu_Loading_Stop = 0x1a2; TraceEvents.Console_Scroll_Start = 0x1a3; TraceEvents.Console_Scroll_Stop = 0x1a4; TraceEvents.Console_Intellisense_ListBox_Build_Start = 0x1a5; TraceEvents.Console_Intellisense_ListBox_Build_Stop = 0x1a6; TraceEvents.Console_Intellisense_ListBox_Reset_Start = 0x1a7; TraceEvents.Console_Intellisense_ListBox_Reset_Stop = 0x1a8; TraceEvents.Console_Intellisense_Menu_Filter_Start = 0x1a9; TraceEvents.Console_Intellisense_Menu_Filter_Stop = 0x1aa; TraceEvents.Console_Intellisense_Menu_Layout_Start = 0x1ab; TraceEvents.Console_Intellisense_Menu_Layout_Stop = 0x1ac; TraceEvents.Console_Intellisense_Provider_Get_Expression_Start = 0x1ad; TraceEvents.Console_Intellisense_Provider_Get_Expression_Stop = 0x1ae; TraceEvents.Console_Intellisense_Provider_Update_Start = 0x1af; TraceEvents.Console_Intellisense_Provider_Update_Stop = 0x1b0; TraceEvents.Console_Intellisense_Provider_Get_Items_Start = 0x1b1; TraceEvents.Console_Intellisense_Provider_Get_Items_Stop = 0x1b2; TraceEvents.Dom_Window_Create_Start = 0x1f5; TraceEvents.Dom_Window_Create_Stop = 0x1f6; TraceEvents.Dom_ExpandNode_Start = 0x1f7; TraceEvents.Dom_ExpandNode_Stop = 0x1f8; TraceEvents.Dom_UndoRedo_Start = 0x1f9; TraceEvents.Dom_UndoRedo_Stop = 0x1fa; TraceEvents.Dom_DragDrop_Start = 0x1fb; TraceEvents.Dom_DragDrop_Stop = 0x1fc; TraceEvents.Dom_AddAttribute_Start = 0x1fd; TraceEvents.Dom_AddAttribute_Stop = 0x1fe; TraceEvents.Dom_Intellisense_Start = 0x1ff; TraceEvents.Dom_Intellisense_Stop = 0x200; TraceEvents.Dom_SelectElement_Start = 0x201; TraceEvents.Dom_SelectElement_Stop = 0x202; TraceEvents.Emulation_Window_Create_Start = 0x259; TraceEvents.Emulation_Window_Create_Stop = 0x25a; TraceEvents.Generic_Debug_1_Start = 0x2bd; TraceEvents.Generic_Debug_1_Stop = 0x2be; TraceEvents.Generic_Debug_2_Start = 0x2bf; TraceEvents.Generic_Debug_2_Stop = 0x2c0; TraceEvents.Generic_Debug_3_Start = 0x2c1; TraceEvents.Generic_Debug_3_Stop = 0x2c2; TraceEvents.Generic_Debug_4_Start = 0x2c3; TraceEvents.Generic_Debug_4_Stop = 0x2c4; TraceEvents.Generic_Debug_5_Start = 0x2c5; TraceEvents.Generic_Debug_5_Stop = 0x2c6; TraceEvents.Generic_Debug_6_Start = 0x2c7; TraceEvents.Generic_Debug_6_Stop = 0x2c8; TraceEvents.Generic_Debug_7_Start = 0x2c9; TraceEvents.Generic_Debug_7_Stop = 0x2ca; TraceEvents.Generic_Debug_8_Start = 0x2cb; TraceEvents.Generic_Debug_8_Stop = 0x2cc; TraceEvents.Generic_Debug_9_Start = 0x2cd; TraceEvents.Generic_Debug_9_Stop = 0x2ce; })(Common.TraceEvents || (Common.TraceEvents = {})); var TraceEvents = Common.TraceEvents; var DefaultTraceWriter = (function () { function DefaultTraceWriter() { } DefaultTraceWriter.prototype.raiseEvent = function (eventId) { }; DefaultTraceWriter.prototype.raiseEventWithMessage = function (eventId, traceMessage) { }; return DefaultTraceWriter; })(); Common.DefaultTraceWriter = DefaultTraceWriter; var TraceWriter = (function () { function TraceWriter(performanceTracer) { if(!performanceTracer && Plugin && (Plugin).F12) { performanceTracer = (Plugin).F12.Utilities.createExternalObject("PerformanceTraceExtension", "{D76A409F-7234-4B71-9BFD-DEF3DC4CCCA6}"); } this._performanceTracer = performanceTracer; } TraceWriter.prototype.raiseEventWithMessage = function (eventId, traceMessage) { if(this._performanceTracer) { this._performanceTracer.raiseEvent(eventId, traceMessage); } }; TraceWriter.prototype.raiseEvent = function (eventId) { this.raiseEventWithMessage(eventId, ""); }; return TraceWriter; })(); Common.TraceWriter = TraceWriter; })(Common || (Common = {})); //@ sourceMappingURL=trace.js.map // htmlTreeView.ts var HtmlTreeView = (function () { function HtmlTreeView() { } HtmlTreeView.initialElementLimit = 200; HtmlTreeView.init = function init(item, htmlTreeViewDragDrop, treeChangeCallBack) { HtmlTreeView._htmlTreeViewDragDrop = htmlTreeViewDragDrop; HtmlTreeView._treeChangeCallBack = treeChangeCallBack; var rootElement = $m("
").addClass("BPT-HtmlTree"); item.append(rootElement); var useDarkTheme = toolwindowHelpers.isDarkThemeBackground(rootElement); if(useDarkTheme) { rootElement.addClass("BPT-Tree-DarkTheme"); } else { rootElement.removeClass("BPT-Tree-DarkTheme"); } if(!rootElement.data("attachedHandlers")) { var container = rootElement.parent(".BPT-HtmlTree-Container"); container.bind("mousedown", function HtmlTreeView$mousedown(event) { $m(this).data("mouseActivate", true); var element = $m(event.target); if(element.hasClass("BPT-HtmlTree-ChildCollection-ShowAll")) { return; } var row = element.closest(".BPT-HtmlTreeItem"); if(row.length > 0) { row = HtmlTreeView.findChildByClickProximity(row, event); HtmlTreeView.select(row); } }); container.bind("click", function HtmlTreeView$click(event) { var element = $m(event.target); if(element.hasClass("BPT-HtmlTree-ChildCollection-ShowAll")) { return; } if(element.hasClass("BPT-HtmlTreeItem-ExpandIcon")) { var row = element.closest(".BPT-HtmlTreeItem"); if(row.length > 0) { HtmlTreeView.toggle(row); } } }); container.bind("dblclick", function HtmlTreeView$dblclick(event) { var element = $m(event.target); var item = element.closest(".BPT-HtmlTreeItem, .BPT-HTML-Attribute-Section, .BPT-HTML-Attribute, .BPT-HTML-Text, .BPT-HtmlTree-ChildCollection-Pager"); if(item.length > 0) { if(item.hasClass("BPT-HtmlTreeItem")) { if(item.hasClass("BPT-HtmlTreeItem-Collapsed") || item.hasClass("BPT-HtmlTreeItem-Expanded")) { if(!element.hasClass("BPT-HtmlTreeItem-ExpandIcon")) { HtmlTreeView.toggle(item); } } } else if(item.hasClass("BPT-HTML-Attribute-Section") || item.hasClass("BPT-HTML-Attribute") || item.hasClass("BPT-HTML-Text")) { var row = item.parents(".BPT-HtmlTreeItem").first(); if(row.length > 0) { var editCallback = row.data("editCallback"); editCallback = (editCallback ? editCallback : row.parent().data("editCallback")); if(editCallback) { editCallback(row, item); event.stopPropagation(); } } } } }); container.bind("focus", function HtmlTreeView$focus(event) { var element = $m(this); if(!element.data("mouseActivate")) { var selected = HtmlTreeView.getSelected(element.children(".BPT-HtmlTree")); if(selected.length === 0) { selected = HtmlTreeView.select(element.find(".BPT-HtmlTreeItem").not(".BPT-HtmlTreeItem-HiddenRoot").first()); } HtmlTreeView.focusSelected(); var wasScrolled = HtmlTreeView.scrollItemIntoView(selected); if(wasScrolled) { event.preventDefault(); return false; } } event.preventDefault(); element.data("mouseActivate", false); }); container.bind("keydown", function HtmlTreeView$keydown(event) { if($m("#tree").find(".BPT-EditBox").length > 0) { return true; } var noKeys = !event.shiftKey && !event.ctrlKey && !event.altKey; var shiftKey = event.shiftKey && !event.ctrlKey && !event.altKey; var ctrlKey = event.ctrlKey && !event.shiftKey && !event.altKey; if(event.keyCode >= Common.KeyCodes.ARROW_FIRST && event.keyCode <= Common.KeyCodes.ARROW_LAST && noKeys) { var activeElement = document.activeElement; if(activeElement && activeElement.type === "text") { return; } var selected = HtmlTreeView.getSelected($m(this).children().first()); var moveUp = function HtmlTreeView$keydown$moveUp(toParent) { var newElement = HtmlTreeView.findNextElementUp(selected, toParent); if(newElement && newElement.length > 0) { HtmlTreeView.select(newElement); event.preventDefault(); return false; } }; var moveDown = function HtmlTreeView$keydown$moveDown() { var newElement = HtmlTreeView.findNextElementDown(selected); if(newElement && newElement.length > 0) { HtmlTreeView.select(newElement); event.preventDefault(); return false; } }; if(selected.length > 0) { switch(event.keyCode) { case Common.KeyCodes.ARROW_LEFT: if(selected.hasClass("BPT-HtmlTreeItem-Expanded")) { HtmlTreeView.toggle(selected); } else { moveUp(true); } break; case Common.KeyCodes.ARROW_UP: moveUp(); break; case Common.KeyCodes.ARROW_RIGHT: if(selected.hasClass("BPT-HtmlTreeItem-Collapsed")) { HtmlTreeView.toggle(selected); } else if(selected.hasClass("BPT-HtmlTreeItem-Expanded")) { moveDown(); } break; case Common.KeyCodes.ARROW_DOWN: moveDown(); break; } } else { selected = $m("#tree"); moveDown(); } event.preventDefault(); return false; } else if(event.keyCode === Common.KeyCodes.SPACE && noKeys) { var selectedNode = HtmlTreeView.getSelected($m(this).children().first()); var isShowAllLink = selectedNode.hasClass("BPT-HtmlTree-ChildCollection-ShowAll"); if(isShowAllLink) { selectedNode.click(); event.stopPropagation(); return false; } if(document.activeElement && (document.activeElement).type !== "text") { event.preventDefault(); return false; } } else if(event.keyCode === Common.KeyCodes.ENTER && (noKeys || ctrlKey)) { var editAsHtml = ctrlKey; if(document.activeElement && (document.activeElement).type !== "text") { var selectedNode = HtmlTreeView.getSelected($m(this).children().first()); var isShowAllLink = selectedNode.hasClass("BPT-HtmlTree-ChildCollection-ShowAll"); if(isShowAllLink) { selectedNode.click(); event.stopPropagation(); return false; } var editCallback = selectedNode.data("editCallback"); editCallback = (editCallback ? editCallback : selectedNode.parent().data("editCallback")); if(editCallback) { editCallback(selectedNode, null, editAsHtml); event.stopPropagation(); return false; } } } else if((event.keyCode === Common.KeyCodes.HOME || event.keyCode === Common.KeyCodes.END) && (noKeys || ctrlKey)) { var newElement = event.keyCode === Common.KeyCodes.HOME ? HtmlTreeView.first : HtmlTreeView.last; if(newElement && newElement.length > 0) { HtmlTreeView.select(newElement); event.preventDefault(); return false; } } }); container = null; rootElement.data("attachedHandlers", true); } return this; }; HtmlTreeView.scrollItemIntoView = function scrollItemIntoView(item) { if(!item || !item.length) { return false; } var isShowAllLink = item.hasClass("BPT-HtmlTree-ChildCollection-ShowAll"); if(isShowAllLink) { return toolwindowHelpers.scrollIntoView(item.get(0), item.closest(".BPT-HtmlTree-ScrollContainer").get(0)); } else { return toolwindowHelpers.scrollIntoView(item.children(".BPT-HtmlTreeItem-Header").get(0), item.closest(".BPT-HtmlTree-ScrollContainer").get(0)); } }; Object.defineProperty(HtmlTreeView, "first", { get: function () { return $m("#tree").find(".BPT-HtmlTreeItem").not(".BPT-HtmlTreeItem-HiddenRoot").first(); }, enumerable: true, configurable: true }); Object.defineProperty(HtmlTreeView, "last", { get: function () { return $m("#tree").find(".BPT-HtmlTreeItem").not(".BPT-HtmlTreeItem-HiddenRoot").last(); }, enumerable: true, configurable: true }); HtmlTreeView.findNextElementUp = function findNextElementUp(item, toParent) { var newElement = null; var sibling = item.prev(".BPT-HtmlTreeItem").not(".BPT-HtmlTreeItem-HiddenRoot").last(); if(sibling.length > 0 && !toParent) { newElement = sibling.find(".BPT-HtmlTreeItem").not(".BPT-HtmlTreeItem-HiddenRoot").last(); if(newElement.length === 0) { newElement = sibling; } } else { newElement = item.parents(".BPT-HtmlTreeItem").not(".BPT-HtmlTreeItem-HiddenRoot").first(); } return newElement; }; HtmlTreeView.findNextElementDown = function findNextElementDown(item) { var newElement = item.find(".BPT-HtmlTreeItem").not(".BPT-HtmlTreeItem-HiddenRoot").first(); newElement = (newElement.length > 0 ? newElement : item.next(".BPT-HtmlTreeItem").first()); var searchedParent = item; while(newElement.length === 0) { searchedParent = searchedParent.parents(".BPT-HtmlTreeItem").not(".BPT-HtmlTreeItem-HiddenRoot").first(); if(searchedParent.length === 0) { break; } newElement = searchedParent.next(".BPT-HtmlTreeItem").not(".BPT-HtmlTreeItem-HiddenRoot").first(); } return newElement; }; HtmlTreeView.destroy = function destroy(item) { if(item.data("attachedHandlers")) { item.children(".BPT-HtmlTree-Container").unbind(".htmlTreeView"); item.data("attachedHandlers", false); } }; HtmlTreeView.addRootElement = function addRootElement(item, uid, tag, rootTagToShow, toggleCallback, editCallback, selectCallback) { if(toggleCallback) { item.data("toggleCallback", toggleCallback); } var newElements = [ { uid: uid, tag: tag, text: "", hasChildren: (toggleCallback ? true : false), attributes: null, rootTagToShow: rootTagToShow } ]; return HtmlTreeView.addElements(item, newElements, toggleCallback, editCallback, selectCallback).children().first(); }; HtmlTreeView.onDOMAttrModified = function onDOMAttrModified(evt) { if(evt.attrName === "aria-expanded") { var element = evt.target; var parent = element.parentNode; var toExpand = evt.newValue === "true"; var currentExpanded = parent.classList.contains("BPT-HtmlTreeItem-Expanded"); var currentCollapsed = parent.classList.contains("BPT-HtmlTreeItem-Collapsed"); if((toExpand && currentCollapsed) || (!toExpand && currentExpanded)) { HtmlTreeView.toggle($m(element.parentNode)); } } }; HtmlTreeView.addDOMAttrModifiedHandler = function addDOMAttrModifiedHandler(e) { e.addEventListener("DOMAttrModified", HtmlTreeView.onDOMAttrModified); }; HtmlTreeView.removeDOMAttrModifiedHandler = function removeDOMAttrModifiedHandler(e) { e.removeEventListener("DOMAttrModified", HtmlTreeView.onDOMAttrModified); }; HtmlTreeView.addElements = function addElements(item, elements, toggleCallback, editCallback, selectCallback, keepExistingElements, stopAutoScroll, virtualElementCount) { if (typeof keepExistingElements === "undefined") { keepExistingElements = false; } if (typeof stopAutoScroll === "undefined") { stopAutoScroll = false; } var childrenCollection = document.createElement("div"); childrenCollection.classList.add("BPT-HtmlTree-ChildCollection"); var isShowingAll = true; var elementCount = virtualElementCount || elements.length; if(!item.data("forceShowAll")) { if(elementCount > HtmlTreeView.initialElementLimit) { elementCount = HtmlTreeView.initialElementLimit; isShowingAll = false; } } var existingIdMap = { }; if(keepExistingElements) { var existingElements = item.children(".BPT-HtmlTree-ChildCollection").children(); for(var elementIndex = 0; elementIndex < existingElements.length; elementIndex++) { var uid = $m(existingElements.get(elementIndex)).attr("data-id"); existingIdMap[uid] = true; } } var whitespaceRegex = /^\s+|\s+$/; for(var i = 0, len = elements.length; i < len; i++) { var id = elements[i].uid; var tag = elements[i].tag; var text = elements[i].text; var isExpandable = elements[i].hasChildren; var attributes = elements[i].attributes; var rootTagToShow = elements[i].rootTagToShow; if(!tag && (!text || !text.replace(whitespaceRegex, ''))) { continue; } if(keepExistingElements && existingIdMap[id]) { var replaceMe = document.createElement("div"); replaceMe.classList.add("replaceMe"); replaceMe.setAttribute("data-id", id); childrenCollection.appendChild(replaceMe); continue; } var header = document.createElement("span"); var footer = document.createElement("span"); var collapsedFooter = document.createElement("span"); if(tag === "#document") { header.classList.add("BPT-HTML-Document"); footer.classList.add("BPT-HTML-Document"); collapsedFooter.classList.add("BPT-HTML-Document"); if(rootTagToShow) { var tagName = document.createElement("span"); tagName.classList.add("BPT-HTML-Tag"); tagName.appendChild(document.createTextNode(rootTagToShow)); header.appendChild(tagName); var endTagName = document.createElement("span"); endTagName.classList.add("BPT-HTML-Tag"); endTagName.appendChild(document.createTextNode(rootTagToShow)); footer.appendChild(endTagName); var collapsedEndTagName = document.createElement("span"); collapsedEndTagName.classList.add("BPT-HTML-Tag"); collapsedEndTagName.appendChild(document.createTextNode(rootTagToShow)); collapsedFooter.appendChild(collapsedEndTagName); } } else if(tag === "#doctype") { header.classList.add("BPT-HTML-DocType"); footer.classList.add("BPT-HTML-DocType"); collapsedFooter.classList.add("BPT-HTML-DocType"); } else if(tag === "#comment") { header.classList.add("BPT-HTML-Comment"); header.appendChild(document.createTextNode("")); collapsedFooter.classList.add("BPT-HTML-Comment"); collapsedFooter.appendChild(document.createTextNode("-->")); } else if(tag === null || tag === undefined) { footer.classList.add("BPT-HTML-Text"); collapsedFooter.classList.add("BPT-HTML-Text"); } else { var openTagName = document.createElement("span"); openTagName.classList.add("BPT-HTML-Tag"); openTagName.appendChild(document.createTextNode(tag)); header.appendChild(openTagName); var attributesElement; if(attributes && attributes.length > 0) { for(var j = 0; j < attributes.length; j++) { var attrName = attributes[j].name; var attributeSection = document.createElement("span"); attributeSection.classList.add("BPT-HTML-Attribute-Section"); attributeSection.setAttribute("data-attrName", attrName); var attributeNode = document.createElement("span"); attributeNode.classList.add("BPT-HTML-Attribute"); attributeNode.appendChild(document.createTextNode(attrName)); attributeSection.appendChild(attributeNode); var attrValue = HtmlTreeView.prepareAttributeValueForDisplay(attributes[j].value); var attributeValue = document.createElement("span"); attributeValue.classList.add("BPT-HTML-Value"); attributeValue.appendChild(document.createTextNode(attrValue)); attributeSection.appendChild(attributeValue); header.appendChild(attributeSection); } } var endTagName = document.createElement("span"); endTagName.classList.add("BPT-HTML-Tag"); endTagName.appendChild(document.createTextNode(tag)); footer.appendChild(endTagName); var collapsedEndTagName = document.createElement("span"); collapsedEndTagName.classList.add("BPT-HTML-Tag"); collapsedEndTagName.appendChild(document.createTextNode(tag)); collapsedFooter.appendChild(collapsedEndTagName); } var textContent = undefined; if(text) { textContent = document.createElement("span"); textContent.classList.add("BPT-HTML-Text"); textContent.appendChild(document.createTextNode(text)); } var collapsedFooterElement = document.createElement("span"); collapsedFooterElement.classList.add("BPT-HtmlTreeItem-CollapsedFooter"); if(isExpandable) { var ellipsesElement = document.createElement("span"); ellipsesElement.classList.add("BPT-HtmlTreeItem-Ellipsis"); ellipsesElement.appendChild(document.createTextNode("...")); collapsedFooterElement.appendChild(ellipsesElement); } var collapsedFooterContainer = document.createElement("span"); collapsedFooterContainer.classList.add("BPT-HTML"); collapsedFooterContainer.appendChild(collapsedFooter); collapsedFooterElement.appendChild(collapsedFooterContainer); var newElement = document.createElement("div"); newElement.classList.add("BPT-HtmlTreeItem"); newElement.setAttribute("data-id", id); newElement.setAttribute("data-tag", tag ? tag : "#text"); var headerElement = document.createElement("div"); headerElement.classList.add("BPT-HtmlTreeItem-Header"); if(tag === "#document" && !rootTagToShow) { textContent = undefined; collapsedFooterElement = undefined; newElement.classList.add("BPT-HtmlTreeItem-HiddenRoot"); newElement.classList.add("BPT-HtmlTreeItem-Collapsed"); } else if(isExpandable) { newElement.classList.add("BPT-HtmlTreeItem-Collapsed"); var expandIcon = document.createElement("div"); expandIcon.classList.add("BPT-HtmlTreeItem-ExpandIcon"); newElement.appendChild(expandIcon); headerElement.setAttribute("role", "group"); headerElement.setAttribute("aria-expanded", "false"); HtmlTreeView.addDOMAttrModifiedHandler(headerElement); } else { headerElement.setAttribute("role", "treeitem"); } if(item.attr("data-tag") === "NodeList" || item.attr("data-tag") === "HtmlCollection") { var textElement = document.createElement("span"); textElement.classList.add("BPT-HTML"); textElement.classList.add("BPT-HTML-Text"); textElement.classList.add("BPT-HTML-Numbering"); textElement.appendChild(document.createTextNode(i + "")); headerElement.appendChild(textElement); } var headerSub = document.createElement("span"); headerSub.classList.add("BPT-HTML"); headerSub.appendChild(header); if(textContent) { headerSub.appendChild(textContent); } headerElement.appendChild(headerSub); if(collapsedFooterElement) { headerElement.appendChild(collapsedFooterElement); } newElement.appendChild(headerElement); var footerElement = document.createElement("div"); footerElement.classList.add("BPT-HtmlTreeItem-Footer"); var footerWrapper = document.createElement("span"); footerWrapper.classList.add("BPT-HTML"); footerWrapper.appendChild(footer); footerElement.appendChild(footerWrapper); newElement.appendChild(footerElement); childrenCollection.appendChild(newElement); } var children = $m(childrenCollection); if(!isShowingAll) { var fullNumber = virtualElementCount; if(!fullNumber) { fullNumber = elements.length; } children.append($m("
").attr("role", "button").addClass("BPT-HtmlTree-ChildCollection-ShowAll").addClass("BPT-HtmlTreeItem").appendText(elementCount + " ... " + fullNumber)); } if(toggleCallback || editCallback || selectCallback) { children.data("toggleCallback", toggleCallback); children.data("editCallback", editCallback); children.data("selectCallback", selectCallback); } var isFirstRow = !(item.hasClass("BPT-HtmlTreeItem")); if(isFirstRow) { item.children(".BPT-HtmlTree").append(children); } else { if(keepExistingElements) { var existingChildrenCollection = item.children(".BPT-HtmlTree-ChildCollection"); if(existingChildrenCollection.length > 0) { var replaceableChildren = children.children(".replaceMe"); for(var index = 0; index < replaceableChildren.length; index++) { var replaceableChild = $m(replaceableChildren.get(index)); var idToReplace = replaceableChild.attr("data-id"); var existingElement = existingChildrenCollection.children(".BPT-HtmlTreeItem").matchAttr("data-id", idToReplace); replaceableChild.replaceWith(existingElement); } var selectedId = HtmlTreeView.getSelected(item).attr("data-id"); if(selectedId && existingIdMap[selectedId]) { var found = children.children().matchAttr("data-id", selectedId); if(found.length === 0) { HtmlTreeView.select(item.closest(".BPT-HtmlTreeItem")); } } existingChildrenCollection.remove(); } } item.children(".BPT-HtmlTreeItem-Header").after(children); } if(!isShowingAll) { var row = item; var showAll = children.children(".BPT-HtmlTree-ChildCollection-ShowAll"); if(showAll.length > 0) { showAll.bind("click", function HtmlTreeView$addElements$showAll$click(event) { if(event.type === "click") { row.data("forceShowAll", true); HtmlTreeView.toggle(row); HtmlTreeView.toggle(row); row = null; HtmlTreeView.focusSelected(); } }); } } if(!stopAutoScroll) { window.setTimeout(function HtmlTreeView$addElement$conditionalScroll() { var child = children.children().last(); var scrollContainer = child.closest(".BPT-HtmlTree-ScrollContainer").get(0); if(scrollContainer) { var x = scrollContainer.scrollLeft; if(toolwindowHelpers.scrollIntoView(child.children(".BPT-HtmlTreeItem-Header").get(0), scrollContainer)) { (children.parent().get(0)).scrollIntoView(true); scrollContainer.scrollLeft = x; } } }, 0); } return children; }; HtmlTreeView.prepareAttributeValueForDisplay = function prepareAttributeValueForDisplay(value) { if(value && value.length > 50) { var prefix = value.substring(0, 5).toLowerCase(); if(prefix === "data:") { var prefixEndIndex = 25; var commaIndex = value.indexOf(","); if(commaIndex > 0) { prefixEndIndex = commaIndex; } value = value.substring(0, prefixEndIndex + 2) + "..." + value.substring(value.length - 10); } } return value; }; HtmlTreeView.addAttribute = function addAttribute(item, name, value) { var attributes = $m("").addClass("BPT-HTML-Attribute-Section").attr("data-attrName", name).appendText(" "); attributes.append($m("").addClass("BPT-HTML-Attribute").appendText(name)); attributes.append($m("").addClass("BPT-HTML-Value").appendText(value)); var existingAttributes = item.find(".BPT-HtmlTreeItem-Header .BPT-HTML").children().first().children(".BPT-HTML-Attribute-Section"); if(existingAttributes.length === 0) { item.find(".BPT-HtmlTreeItem-Header .BPT-HTML-Tag").first().after(attributes); } else { $m(existingAttributes.get(existingAttributes.length - 1)).after(attributes); } return attributes; }; HtmlTreeView.showLoading = function showLoading(item, text) { if(!item.hasClass("BPT-HtmlTreeItem-ShowingLoader")) { var newRow = $m("
").addClass("BPT-HtmlTreeItem").addClass("BPT-HtmlTreeItem-Loading").appendText(text); item.children(".BPT-HtmlTreeItem-Header").append(newRow); item.addClass("BPT-HtmlTreeItem-ShowingLoader"); } return item; }; HtmlTreeView.hideLoading = function hideLoading(item) { if(item.hasClass("BPT-HtmlTreeItem-ShowingLoader")) { item.removeClass("BPT-HtmlTreeItem-ShowingLoader"); item.children(".BPT-HtmlTreeItem-Header").children(".BPT-HtmlTreeItem-Loading").remove(); } return item; }; HtmlTreeView.getChildren = function getChildren(item) { return item.children(".BPT-HtmlTree-ChildCollection").children(".BPT-HtmlTreeItem"); }; HtmlTreeView.isCollapsed = function isCollapsed(item) { return item.hasClass("BPT-HtmlTreeItem-Collapsed"); }; HtmlTreeView.isExpanded = function isExpanded(item) { return item.hasClass("BPT-HtmlTreeItem-Expanded"); }; HtmlTreeView.isExpandable = function isExpandable(item) { return item.hasClass("BPT-HtmlTreeItem-Collapsed") || item.hasClass("BPT-HtmlTreeItem-Expanded"); }; HtmlTreeView.changeExpandableState = function changeExpandableState(item, nowExpandable) { var header = item.children(".BPT-HtmlTreeItem-Header"); if(nowExpandable) { var expandIcon = $m("
").addClass("BPT-HtmlTreeItem-ExpandIcon"); item.prepend(expandIcon); item.find(".BPT-HtmlTreeItem-CollapsedFooter").prepend($m("").addClass("BPT-HtmlTreeItem-Ellipsis").appendText("...")); item.find(".BPT-HTML-Text").remove(); item.addClass("BPT-HtmlTreeItem-Collapsed"); header.attr("aria-expanded", "false"); header.attr("role", "group"); HtmlTreeView.addDOMAttrModifiedHandler(header.get(0)); } else { item.find(".BPT-HtmlTreeItem-ExpandIcon").remove(); HtmlTreeView.removeDOMAttrModifiedHandler(header.get(0)); header.removeAttr("aria-expanded"); item.find(".BPT-HtmlTreeItem-CollapsedFooter").find(".BPT-HtmlTreeItem-Ellipsis").remove(); item.removeClass("BPT-HtmlTreeItem-Collapsed"); header.attr("role", "treeitem"); } return item; }; HtmlTreeView.toggle = function toggle(item, onExpandComplete) { var toggleCallback = item.data("toggleCallback"); toggleCallback = (toggleCallback ? toggleCallback : item.parent().data("toggleCallback")); if(toggleCallback) { toolwindowHelpers.codeMarker(toolwindowHelpers.codeMarkers.perfBrowserTools_DiagnosticsToolWindowsTreeViewToggleBegin); var header = item.children(".BPT-HtmlTreeItem-Header").get(0); HtmlTreeView.removeDOMAttrModifiedHandler(header); if(item.hasClass("BPT-HtmlTreeItem-Collapsed")) { item.removeClass("BPT-HtmlTreeItem-Collapsed"); toggleCallback(true, item, item.attr("data-id"), onExpandComplete); item.addClass("BPT-HtmlTreeItem-Expanded"); header.setAttribute("aria-expanded", "true"); } else { if(item.hasClass("BPT-HtmlTreeItem-HiddenRoot")) { return item; } item.removeClass("BPT-HtmlTreeItem-Expanded"); toggleCallback(false, item, item.attr("data-id")); item.children(".BPT-HtmlTree-ChildCollection").remove(); item.addClass("BPT-HtmlTreeItem-Collapsed"); header.setAttribute("aria-expanded", "false"); toolwindowHelpers.codeMarker(toolwindowHelpers.codeMarkers.perfBrowserTools_DiagnosticsToolWindowsTreeViewToggleEnd); } HtmlTreeView.addDOMAttrModifiedHandler(header); if(HtmlTreeView._treeChangeCallBack) { HtmlTreeView._treeChangeCallBack(); } } return item; }; HtmlTreeView.expandElementChains = function expandElementChains(chains, complete) { HtmlTreeView.expandElementChain(chains[0], function () { if(chains.length > 1) { HtmlTreeView.expandElementChains(chains.slice(1, chains.length), complete); } else if(complete) { complete(); } }); }; HtmlTreeView.expandElementChain = function expandElementChain(chain, complete) { var root = $m('[data-id="' + chain[0] + '"]'); var expandNext = function () { if(chain.length > 1) { HtmlTreeView.expandElementChain(chain.slice(1, chain.length), complete); } else if(complete) { complete(); } }; if(HtmlTreeView.isCollapsed(root)) { HtmlTreeView.toggle(root, expandNext); } else { expandNext(); } }; HtmlTreeView.getSelected = function getSelected(item) { if(item.hasClass("BPT-HtmlTreeItem-Selected")) { return item; } var rootElement = item.closest(".BPT-HtmlTree"); rootElement = (rootElement.length > 0 ? rootElement : item); return rootElement.find(".BPT-HtmlTreeItem-Selected").first(); }; HtmlTreeView.isTextArea = function isTextArea(e) { if(!e) { return false; } var s = e.tagName; if(typeof s !== "string") { return false; } return s.toUpperCase() === 'TEXTAREA'; }; HtmlTreeView.isInputText = function isInputText(e) { if(!e) { return false; } var s = e.tagName; if(typeof s !== "string") { return false; } return s.toUpperCase() === 'INPUT' && e.hasAttribute("type") && e.getAttribute("type") === 'text'; }; HtmlTreeView.currentFocusOnInput = function currentFocusOnInput() { var e = document.activeElement; return HtmlTreeView.isTextArea(e) || HtmlTreeView.isInputText(e); }; HtmlTreeView.focusSelected = function focusSelected(adjustFocus) { if (typeof adjustFocus === "undefined") { adjustFocus = true; } var element; var selected = document.querySelectorAll(".BPT-HtmlTreeItem-Selected"); if(selected.length > 1) { for(var i = 1; i < selected.length; i++) { element = selected[i]; element.classList.remove("BPT-HtmlTreeItem-Selected"); } } element = HtmlTreeView.adjustTabindex(); adjustFocus = adjustFocus && !HtmlTreeView.currentFocusOnInput(); if(!adjustFocus) { return; } if(selected.length > 0 && (selected[0]).classList.contains("BPT-HtmlTree-ChildCollection-ShowAll")) { (selected[0]).focus(); toolwindowHelpers.scrollIntoView(selected[0], $m(selected[0]).closest(".BPT-HtmlTree-ScrollContainer").get(0)); } else if(element) { element.focus(); var scrollContainer = $m(element).closest(".BPT-HtmlTree-ScrollContainer").get(0); var left = scrollContainer.scrollLeft; if(left) { var negativeXOffset = ($m(element).closest(".BPT-HtmlTreeItem").get(0)).getBoundingClientRect().left; if(negativeXOffset < 0) { left = Math.max(left + negativeXOffset, 0); scrollContainer.scrollLeft = left; } } } }; HtmlTreeView.adjustTabindex = function adjustTabindex() { var tree = document.querySelector("#tree"); var element; if(!tree) { return element; } tree.removeAttribute("tabindex"); var nodeList = tree.querySelectorAll("[tabindex='1']"); for(var i = 0; i < nodeList.length; i++) { (nodeList[i]).removeAttribute("tabindex"); } element = tree.querySelector(".BPT-HtmlTreeItem-Selected > .BPT-HtmlTreeItem-Header, .BPT-HtmlTreeItem-Selected.BPT-HtmlTree-ChildCollection-ShowAll") || tree; element.setAttribute("tabindex", "1"); return element; }; HtmlTreeView.findChildByClickProximity = function findChildByClickProximity(item, event) { var children = item.find(".BPT-HtmlTreeItem"); var x = event.clientX; var y = event.clientY; for(var i = 0; i < children.length; i++) { var child = children.get(i); var offset = child.getBoundingClientRect(); if(offset.top <= y && y <= offset.bottom) { item = $m(child); } } return item; }; HtmlTreeView.select = function select(item, adjustFocus) { if (typeof adjustFocus === "undefined") { adjustFocus = true; } var rootItem = item.closest(".BPT-HtmlTree"); var containerItem = item.closest(".BPT-HtmlTree-Container"); var selectedElement = rootItem.find(".BPT-HtmlTreeItem-Selected"); HtmlTreeView._htmlTreeViewDragDrop.removeDraggable(rootItem, selectedElement); HtmlTreeView._htmlTreeViewDragDrop.removeDroppable(rootItem); selectedElement.removeClass("BPT-HtmlTreeItem-Selected"); var isShowAllLink = selectedElement.hasClass("BPT-HtmlTree-ChildCollection-ShowAll"); if(isShowAllLink) { selectedElement.removeAttr("tabindex"); } else { selectedElement.children(".BPT-HtmlTreeItem-Header").removeAttr("tabindex"); } item.addClass("BPT-HtmlTreeItem-Selected"); HtmlTreeView.focusSelected(adjustFocus); isShowAllLink = item.hasClass("BPT-HtmlTree-ChildCollection-ShowAll"); var selectCallback = item.data("selectCallback") || item.parent().data("selectCallback"); if(selectCallback) { selectCallback(item, item.attr("data-id"), item.attr("data-tag")); } if(!isShowAllLink && HtmlTreeView._htmlTreeViewDragDrop.canDrag(item.attr("data-tag"))) { HtmlTreeView._htmlTreeViewDragDrop.addDraggable(rootItem, item); } return item; }; HtmlTreeView.clear = function clear(item) { var selectedChild = item.children().find(".BPT-HtmlTreeItem-Selected"); if(selectedChild.length > 0) { HtmlTreeView.select(item); } item.children(".BPT-HtmlTree-ChildCollection").remove(); if(item.hasClass("BPT-HtmlTree-Container")) { item.removeAttr("tabindex"); } return item; }; HtmlTreeView.getTextContent = function getTextContent(element) { if(element && element.firstChild) { return element.firstChild.nodeValue; } return ""; }; return HtmlTreeView; })(); //@ sourceMappingURL=htmlTreeView.js.map // htmlTreeViewDragDrop.ts var HtmlTreeViewDragDrop = (function () { function HtmlTreeViewDragDrop() { } HtmlTreeViewDragDrop.DropAction = { Unknown: '', BeforeSibling: 'before sibling', AfterSibling: 'after sibling', FirstChild: 'first child', LastChild: 'last child' }; HtmlTreeViewDragDrop._autoCollapseOnDragStart = false; HtmlTreeViewDragDrop._collapsedClass = 'BPT-HtmlTreeItem-Collapsed'; HtmlTreeViewDragDrop._dragClass = 'BPT-HtmlTreeItem-Drag'; HtmlTreeViewDragDrop._draggableClass = 'BPT-HtmlTreeItem-Draggable'; HtmlTreeViewDragDrop._dropAfterClass = 'BPT-HtmlTreeItem-DropAfter'; HtmlTreeViewDragDrop._dropBeforeClass = 'BPT-HtmlTreeItem-DropBefore'; HtmlTreeViewDragDrop._dropHereAfterClass = 'BPT-HtmlTreeItem-DoDropHereAfter'; HtmlTreeViewDragDrop._dropHereBeforeClass = 'BPT-HtmlTreeItem-DoDropHereBefore'; HtmlTreeViewDragDrop._expandedClass = 'BPT-HtmlTreeItem-Expanded'; HtmlTreeViewDragDrop._expandIconClass = 'BPT-HtmlTreeItem-ExpandIcon'; HtmlTreeViewDragDrop._footerClass = 'BPT-HtmlTreeItem-Footer'; HtmlTreeViewDragDrop._headerClass = 'BPT-HtmlTreeItem-Header'; HtmlTreeViewDragDrop._hiddenRootClass = 'BPT-HtmlTreeItem-HiddenRoot'; HtmlTreeViewDragDrop._hoverClass = 'BPT-HtmlTreeItem-Hover'; HtmlTreeViewDragDrop._dragSelector = '.BPT-HtmlTreeItem-Drag'; HtmlTreeViewDragDrop._dropAfterSelector = '.BPT-HtmlTreeItem-DropAfter'; HtmlTreeViewDragDrop._dropBeforeSelector = '.BPT-HtmlTreeItem-DropBefore'; HtmlTreeViewDragDrop._dropHereAfterSelector = '.BPT-HtmlTreeItem-DoDropHereAfter'; HtmlTreeViewDragDrop._dropHereBeforeSelector = '.BPT-HtmlTreeItem-DoDropHereBefore'; HtmlTreeViewDragDrop._footerSelector = '.BPT-HtmlTreeItem-Footer'; HtmlTreeViewDragDrop._headerFooterSelector = '.BPT-HtmlTreeItem-Footer,.BPT-HtmlTreeItem-Header'; HtmlTreeViewDragDrop._headerSelector = '.BPT-HtmlTreeItem-Header'; HtmlTreeViewDragDrop._hiddenRootSelector = '.BPT-HtmlTreeItem-HiddenRoot'; HtmlTreeViewDragDrop._hoverSelector = '.BPT-HtmlTreeItem-Hover'; HtmlTreeViewDragDrop._itemSelector = '.BPT-HtmlTreeItem'; HtmlTreeViewDragDrop._scrollContainerSelector = '.BPT-HtmlTree-ScrollContainer'; HtmlTreeViewDragDrop._treeSelector = '.BPT-HtmlTree'; HtmlTreeViewDragDrop._autoscrollPixelsPerSecond = 30; HtmlTreeViewDragDrop._autoscrollAcceleration = 5; HtmlTreeViewDragDrop._lastTimeStamp = 0; HtmlTreeViewDragDrop._autoexpandDisclosureTriangleMillisecondDelay = 500; HtmlTreeViewDragDrop._autoexpandNonExpandableMillisecondDelay = 1000; HtmlTreeViewDragDrop._autoexpandPixelDrift = 2; HtmlTreeViewDragDrop._lastExpandIcon = undefined; HtmlTreeViewDragDrop.init = function init(proxy, doc, htmlTreeView, supportsMutation, traceWriter) { HtmlTreeViewDragDrop._proxy = proxy; HtmlTreeViewDragDrop._document = doc; HtmlTreeViewDragDrop._htmlTreeView = htmlTreeView; HtmlTreeViewDragDrop._supportsMutation = supportsMutation; HtmlTreeViewDragDrop._traceWriter = traceWriter; }; HtmlTreeViewDragDrop.doDragStart = function doDragStart(event) { event.stopPropagation(); if(event.srcElement.tagName === 'TEXTAREA' || event.srcElement.tagName === 'INPUT') { event.preventDefault(); return; } event.dataTransfer.effectAllowed = 'move'; event.dataTransfer.setData('Text', ''); var item = $m(this); if(HtmlTreeViewDragDrop._autoCollapseOnDragStart) { if(HtmlTreeViewDragDrop._htmlTreeView.isExpanded(item)) { HtmlTreeViewDragDrop._htmlTreeView.toggle(item); } } var rootItem = item.closest(HtmlTreeViewDragDrop._treeSelector); HtmlTreeViewDragDrop.addDroppable(rootItem, item); var dragItem = rootItem.find(HtmlTreeViewDragDrop._dragSelector); if(dragItem.get(0) !== item.get(0)) { throw 'Bad invariance in doDragStart: dragItem.get(0) !== item.get(0)'; } HtmlTreeViewDragDrop._lastTimeStamp = event.timeStamp; }; HtmlTreeViewDragDrop.doDrag = function doDrag(event) { var scrollContainerItem = $m(this).closest(HtmlTreeViewDragDrop._scrollContainerSelector); if(scrollContainerItem.length !== 1) { return; } var millisecondDelta = event.timeStamp - HtmlTreeViewDragDrop._lastTimeStamp; var scrollContainer = scrollContainerItem.get(0); var above = HtmlTreeViewDragDrop.calcAbove(event, scrollContainer); var below = HtmlTreeViewDragDrop.calcBelow(event, scrollContainer); var step = HtmlTreeViewDragDrop._autoscrollPixelsPerSecond; var landing = 10; if(above) { if(above > landing) { step += (above - landing) * HtmlTreeViewDragDrop._autoscrollAcceleration; } step = Math.ceil(step * millisecondDelta / 1000); if(step > scrollContainer.scrollTop) { step = scrollContainer.scrollTop; } if(step) { scrollContainer.scrollTop -= step; } } else if(below) { if(below > landing) { step += (below - landing) * HtmlTreeViewDragDrop._autoscrollAcceleration; } step = Math.ceil(step * millisecondDelta / 1000); if((step + scrollContainer.scrollTop + scrollContainer.offsetHeight) > scrollContainer.scrollHeight) { step = scrollContainer.scrollHeight - scrollContainer.scrollTop - scrollContainer.offsetHeight; } if(step) { scrollContainer.scrollTop += step; } } HtmlTreeViewDragDrop._lastTimeStamp = event.timeStamp; }; HtmlTreeViewDragDrop.calcAbove = function calcAbove(event, element) { if(!event || !element) { return NaN; } var delta = element.offsetTop - event.clientY; if(delta < 0) { delta = 0; } return delta; }; HtmlTreeViewDragDrop.calcBelow = function calcBelow(event, element) { if(!event || !element) { return NaN; } var delta = event.clientY - element.offsetHeight; if(delta < 0) { delta = 0; } return delta; }; HtmlTreeViewDragDrop.proxyReparent = function proxyReparent(dragFromDataId, dropTargetDataId, dropAction, postOpCallback) { HtmlTreeViewDragDrop._proxy.callRemote("reparent", [ dragFromDataId, dropTargetDataId, dropAction ], postOpCallback); }; HtmlTreeViewDragDrop._eventCallback = { }; HtmlTreeViewDragDrop.registerEventCallback = function registerEventCallback(event, callback, mark) { if(!HtmlTreeViewDragDrop._eventCallback.hasOwnProperty(event)) { HtmlTreeViewDragDrop._eventCallback[event] = []; } HtmlTreeViewDragDrop._eventCallback[event].push({ callback: callback, mark: mark }); return true; }; HtmlTreeViewDragDrop.unregisterEventCallback = function unregisterEventCallback(event, callback) { if(!HtmlTreeViewDragDrop._eventCallback.hasOwnProperty(event)) { return false; } var arr = HtmlTreeViewDragDrop._eventCallback[event]; var len = arr.length; for(var i = 0; i < len; i++) { if(arr[i].callback === callback) { arr.splice(i, 1); if(HtmlTreeViewDragDrop._eventCallback[event].length === 0) { delete HtmlTreeViewDragDrop._eventCallback[event]; } return true; } } return false; }; HtmlTreeViewDragDrop.raise = function raise(event, arg) { var count = 0; if(!HtmlTreeViewDragDrop._eventCallback.hasOwnProperty(event)) { return count; } var arr = HtmlTreeViewDragDrop._eventCallback[event].slice(0); var len = arr.length; for(var i = 0; i < len; i++) { arr[i].callback(event, arr[i].mark, arg); } return count; }; HtmlTreeViewDragDrop.doDragEnd = function doDragEnd(event) { var dragFromItem = $m(this); var rootItem = dragFromItem.closest(HtmlTreeViewDragDrop._treeSelector); if(event.dataTransfer.dropEffect === 'none') { HtmlTreeViewDragDrop.raise('drag', 'cancel'); HtmlTreeViewDragDrop.removeDroppable(rootItem); return; } if(HtmlTreeViewDragDrop._traceWriter) { HtmlTreeViewDragDrop._traceWriter.raiseEvent(Common.TraceEvents.Dom_DragDrop_Start); } var before = rootItem.find(HtmlTreeViewDragDrop._dropHereBeforeSelector); var after = rootItem.find(HtmlTreeViewDragDrop._dropHereAfterSelector); var dropTargetItem; var dropAction = HtmlTreeViewDragDrop.DropAction.Unknown; if(before.length === 1) { dropTargetItem = before.parent(); if(before.hasClass(HtmlTreeViewDragDrop._headerClass)) { dropAction = HtmlTreeViewDragDrop.DropAction.BeforeSibling; } else { if(HtmlTreeViewDragDrop._htmlTreeView.isExpanded(dropTargetItem)) { dropAction = HtmlTreeViewDragDrop.DropAction.LastChild; } else { dropAction = HtmlTreeViewDragDrop.DropAction.BeforeSibling; } } } else if(after.length === 1) { dropTargetItem = after.parent(); if(after.hasClass(HtmlTreeViewDragDrop._footerClass)) { dropAction = HtmlTreeViewDragDrop.DropAction.AfterSibling; } else if(HtmlTreeViewDragDrop._htmlTreeView.isExpanded(dropTargetItem)) { dropAction = HtmlTreeViewDragDrop.DropAction.FirstChild; } else { dropAction = HtmlTreeViewDragDrop.DropAction.AfterSibling; } } else { HtmlTreeViewDragDrop.raise('drag', 'cancel'); HtmlTreeViewDragDrop.removeDroppable(rootItem); return; } HtmlTreeViewDragDrop.removeDroppable(rootItem); if(dropAction && dropTargetItem && dropTargetItem.length === 1) { var dragFromId = dragFromItem.attr('data-id'); var dropTargetId = dropTargetItem.attr('data-id'); if(dragFromId && dropTargetId) { if(HtmlTreeViewDragDrop._htmlTreeView.isExpanded(dragFromItem)) { HtmlTreeViewDragDrop._htmlTreeView.toggle(dragFromItem); } HtmlTreeViewDragDrop.proxyReparent(dragFromId, dropTargetId, dropAction, function () { if(HtmlTreeViewDragDrop._supportsMutation()) { var millisecondDelay = 1000 / 4; window.setTimeout(function () { HtmlTreeViewDragDrop.selectBy(dropTargetId, dropAction); }, millisecondDelay); } else { var targetParents = dropTargetItem.parents(HtmlTreeViewDragDrop._itemSelector).not(HtmlTreeViewDragDrop._hiddenRootSelector); var fromParents = dragFromItem.parents(HtmlTreeViewDragDrop._itemSelector).not(HtmlTreeViewDragDrop._hiddenRootSelector); var targetParentChain = []; var fromParentChain = []; targetParents.each(function (i, e) { targetParentChain[(targetParents.length - 1) - i] = e.getAttribute('data-id'); }); fromParents.each(function (i, e) { fromParentChain[(fromParents.length - 1) - i] = e.getAttribute('data-id'); }); if(dropAction !== HtmlTreeViewDragDrop.DropAction.BeforeSibling && dropAction !== HtmlTreeViewDragDrop.DropAction.AfterSibling) { targetParentChain.push(dropTargetItem.attr('data-id')); } var closestCommonAncestor; for(var i = 0; i < targetParentChain.length && i < fromParentChain.length; i++) { if(targetParentChain[i] !== fromParentChain[i]) { break; } closestCommonAncestor = targetParentChain[i]; } var root = $m('[data-id=' + closestCommonAncestor + ']'); HtmlTreeView.toggle(root); HtmlTreeView.expandElementChains([ targetParentChain, fromParentChain ], function () { HtmlTreeViewDragDrop.selectBy(dropTargetId, dropAction); }); } }); } } HtmlTreeViewDragDrop._lastExpandIcon = undefined; HtmlTreeViewDragDrop.raise('drag', 'complete'); if(HtmlTreeViewDragDrop._traceWriter) { HtmlTreeViewDragDrop._traceWriter.raiseEvent(Common.TraceEvents.Dom_DragDrop_Stop); } }; HtmlTreeViewDragDrop.selectBy = function selectBy(nearId, dropAction) { var item; if(dropAction === HtmlTreeViewDragDrop.DropAction.FirstChild) { item = $m('div.BPT-HtmlTreeItem[data-id="' + nearId + '"] > div.BPT-HtmlTree-ChildCollection > div.BPT-HtmlTreeItem:first-child'); } else if(dropAction === HtmlTreeViewDragDrop.DropAction.LastChild) { item = $m('div.BPT-HtmlTreeItem[data-id="' + nearId + '"] > div.BPT-HtmlTree-ChildCollection > div.BPT-HtmlTreeItem:last-child'); } else if(dropAction === HtmlTreeViewDragDrop.DropAction.BeforeSibling) { var nearElement = $m(HtmlTreeViewDragDrop._itemSelector + '[data-id="' + nearId + '"]').get(0); if(nearElement && nearElement.previousSibling) { item = $m(nearElement.previousSibling); } } else if(dropAction === HtmlTreeViewDragDrop.DropAction.AfterSibling) { item = $m(HtmlTreeViewDragDrop._itemSelector + '[data-id="' + nearId + '"] + div.BPT-HtmlTreeItem'); } if(item && item.length === 1) { HtmlTreeViewDragDrop._htmlTreeView.select(item); } }; HtmlTreeViewDragDrop.canDrag = function canDrag(tagLowerCase) { return [ "html", "head", "body", "script", "noscript", "#doctype" ].indexOf(tagLowerCase) < 0; }; HtmlTreeViewDragDrop.addDraggable = function addDraggable(rootItem, item) { var children = item.children('.BPT-HtmlTreeItem-Header'); children.attr('draggable', 'true'); for(var i = 0, len = item.length; i < len; i++) { var element = item.get(i); if(element) { if(element.classList) { element.classList.add(HtmlTreeViewDragDrop._draggableClass); } if(element.addEventListener) { element.addEventListener('dragstart', HtmlTreeViewDragDrop.doDragStart, false); element.addEventListener('drag', HtmlTreeViewDragDrop.doDrag, false); element.addEventListener('dragend', HtmlTreeViewDragDrop.doDragEnd, false); } } } var rootTarget = rootItem.get(0); if(rootTarget) { rootTarget.addEventListener('dragenter', HtmlTreeViewDragDrop.doDropTargetEnter, false); rootTarget.addEventListener('dragover', HtmlTreeViewDragDrop.doDropTargetOver, false); rootTarget.addEventListener('dragleave', HtmlTreeViewDragDrop.doDropTargetLeave, false); rootTarget.addEventListener('drop', HtmlTreeViewDragDrop.doDropTargetDrop, false); } }; HtmlTreeViewDragDrop.removeDraggable = function removeDraggable(rootItem, item) { var children = item.children('.BPT-HtmlTreeItem-Header'); children.attr('draggable', 'false'); for(var i = 0, len = item.length; i < len; i++) { var element = item.get(i); if(element) { if(element.classList) { element.classList.remove(HtmlTreeViewDragDrop._draggableClass); } if(element.removeEventListener) { element.removeEventListener('dragstart', HtmlTreeViewDragDrop.doDragStart, false); element.removeEventListener('drag', HtmlTreeViewDragDrop.doDrag, false); element.removeEventListener('dragend', HtmlTreeViewDragDrop.doDragEnd, false); } } } if(rootItem.length > 0) { var rootTarget = rootItem.get(0); rootTarget.removeEventListener('dragenter', HtmlTreeViewDragDrop.doDropTargetEnter, false); rootTarget.removeEventListener('dragover', HtmlTreeViewDragDrop.doDropTargetOver, false); rootTarget.removeEventListener('dragleave', HtmlTreeViewDragDrop.doDropTargetLeave, false); rootTarget.removeEventListener('drop', HtmlTreeViewDragDrop.doDropTargetDrop, false); } }; HtmlTreeViewDragDrop.getHoverElement = function getHoverElement(x, y) { if(typeof x === 'number' && typeof y === 'number') { return (HtmlTreeViewDragDrop._document.elementFromPoint(x, y)); } return undefined; }; HtmlTreeViewDragDrop.getHoverHeaderFooterElement = function getHoverHeaderFooterElement(x, y) { if(typeof x === 'number' && typeof y === 'number') { var headerFooter = $m(HtmlTreeViewDragDrop._document.elementFromPoint(x, y)).closest(HtmlTreeViewDragDrop._headerFooterSelector); var element = headerFooter.get(0); if(element) { var parent = element.parentNode; if(parent && !parent.classList.contains(HtmlTreeViewDragDrop._hiddenRootClass)) { return element; } } } return undefined; }; HtmlTreeViewDragDrop.markHover = function markHover(lastHoverItem, currentHoverElement) { if(currentHoverElement) { currentHoverElement.classList.add(HtmlTreeViewDragDrop._hoverClass); } for(var i = 0, len = lastHoverItem.length; i < len; i++) { var hoverElement = lastHoverItem.get(i); if(hoverElement !== currentHoverElement) { hoverElement.classList.remove(HtmlTreeViewDragDrop._hoverClass); } } return currentHoverElement ? true : false; }; HtmlTreeViewDragDrop.nearby = function nearby(a, b, drift) { if(b + drift < a || b - drift > a) { return false; } return true; }; HtmlTreeViewDragDrop.autoExpand = function autoExpand(event) { HtmlTreeViewDragDrop.autoExpandUpdate(event) || HtmlTreeViewDragDrop.autoExpandIcon(event) || HtmlTreeViewDragDrop.autoExpandNonExpandable(event); }; HtmlTreeViewDragDrop.autoExpandUpdate = function autoExpandUpdate(event) { var nearby = HtmlTreeViewDragDrop.nearby; var element = HtmlTreeViewDragDrop.getHoverElement(event.clientX, event.clientY); if(!HtmlTreeViewDragDrop._lastExpandIcon || HtmlTreeViewDragDrop._lastExpandIcon.element !== element) { HtmlTreeViewDragDrop._lastExpandIcon = { element: element, timeStamp: event.timeStamp, clientX: event.clientX, clientY: event.clientY }; return true; } if(!nearby(event.clientX, HtmlTreeViewDragDrop._lastExpandIcon.clientX, HtmlTreeViewDragDrop._autoexpandPixelDrift) || !nearby(event.clientY, HtmlTreeViewDragDrop._lastExpandIcon.clientY, HtmlTreeViewDragDrop._autoexpandPixelDrift)) { HtmlTreeViewDragDrop._lastExpandIcon = { element: element, timeStamp: event.timeStamp, clientX: event.clientX, clientY: event.clientY }; return true; } return false; }; HtmlTreeViewDragDrop.autoExpandIcon = function autoExpandIcon(event) { if((event.timeStamp - HtmlTreeViewDragDrop._lastExpandIcon.timeStamp) < HtmlTreeViewDragDrop._autoexpandDisclosureTriangleMillisecondDelay) { return false; } var element = HtmlTreeViewDragDrop.getHoverElement(event.clientX, event.clientY); if(!element || !element.classList.contains(HtmlTreeViewDragDrop._expandIconClass)) { return false; } var htmlTreeElement = element.parentNode; if(htmlTreeElement && htmlTreeElement.classList.contains(HtmlTreeViewDragDrop._collapsedClass) && ($m(htmlTreeElement).children(HtmlTreeViewDragDrop._headerSelector).hasClass(HtmlTreeViewDragDrop._dropBeforeClass) || $m(htmlTreeElement).children(HtmlTreeViewDragDrop._headerSelector).hasClass(HtmlTreeViewDragDrop._dropAfterClass))) { HtmlTreeViewDragDrop._lastExpandIcon = undefined; var rootItem = $m(htmlTreeElement).closest(HtmlTreeViewDragDrop._treeSelector); var dragItem = rootItem.find(HtmlTreeViewDragDrop._dragSelector); HtmlTreeViewDragDrop.removeDroppable(rootItem); HtmlTreeViewDragDrop._htmlTreeView.toggle($m(htmlTreeElement), function () { HtmlTreeViewDragDrop.addDroppable(rootItem, dragItem); }); return true; } return false; }; HtmlTreeViewDragDrop.autoExpandNonExpandable = function autoExpandNonExpandable(event) { if((event.timeStamp - HtmlTreeViewDragDrop._lastExpandIcon.timeStamp) < HtmlTreeViewDragDrop._autoexpandNonExpandableMillisecondDelay) { return false; } var element = HtmlTreeViewDragDrop.getHoverElement(event.clientX, event.clientY); if(!element) { return false; } var htmlTreeItem = $m(element).closest(HtmlTreeViewDragDrop._itemSelector); if(htmlTreeItem.length !== 1 || htmlTreeItem.hasClass(HtmlTreeViewDragDrop._collapsedClass) || htmlTreeItem.hasClass(HtmlTreeViewDragDrop._expandedClass) || !htmlTreeItem.attr('data-tag')) { return false; } if(htmlTreeItem.children(HtmlTreeViewDragDrop._headerSelector).hasClass(HtmlTreeViewDragDrop._dropBeforeClass) || htmlTreeItem.children(HtmlTreeViewDragDrop._headerSelector).hasClass(HtmlTreeViewDragDrop._dropAfterClass)) { HtmlTreeViewDragDrop._lastExpandIcon = undefined; var rootItem = htmlTreeItem.closest(HtmlTreeViewDragDrop._treeSelector); var dragItem = rootItem.find(HtmlTreeViewDragDrop._dragSelector); HtmlTreeViewDragDrop.removeDroppable(rootItem); HtmlTreeViewDragDrop._htmlTreeView.changeExpandableState(htmlTreeItem, true); HtmlTreeViewDragDrop._htmlTreeView.toggle(htmlTreeItem, function () { HtmlTreeViewDragDrop.addDroppable(rootItem, dragItem); }); return true; } return false; }; HtmlTreeViewDragDrop.doDropTargetEnter = function doDropTargetEnter(event) { var rootElement = event.currentTarget; var rootItem = $m(rootElement); var lastHoverItem = rootItem.find(HtmlTreeViewDragDrop._hoverSelector); var nowHoverItem = HtmlTreeViewDragDrop.getHoverHeaderFooterElement(event.clientX, event.clientY); HtmlTreeViewDragDrop.markHover(lastHoverItem, nowHoverItem); event.dataTransfer.dropEffect = 'move'; event.preventDefault(); event.stopPropagation(); }; HtmlTreeViewDragDrop.doDropTargetOver = function doDropTargetOver(event) { var rootElement = event.currentTarget; var lastHoverItem = $m(rootElement).find(HtmlTreeViewDragDrop._hoverSelector); var nowHoverItem = HtmlTreeViewDragDrop.getHoverHeaderFooterElement(event.clientX, event.clientY); HtmlTreeViewDragDrop.markHover(lastHoverItem, nowHoverItem); event.dataTransfer.dropEffect = 'move'; HtmlTreeViewDragDrop.autoExpand(event); event.preventDefault(); event.stopPropagation(); return false; }; HtmlTreeViewDragDrop.doDropTargetLeave = function doDropTargetLeave(event) { var rootElement = event.currentTarget; var lastHoverItem = $m(rootElement).find(HtmlTreeViewDragDrop._hoverSelector); HtmlTreeViewDragDrop.markHover(lastHoverItem); event.preventDefault(); event.stopPropagation(); }; HtmlTreeViewDragDrop.doDropTargetDrop = function doDropTargetDrop(event) { var rootElement = event.currentTarget; var hoverElement = $m(rootElement).find(HtmlTreeViewDragDrop._hoverSelector); if(hoverElement.hasClass(HtmlTreeViewDragDrop._dropAfterClass)) { hoverElement.addClass(HtmlTreeViewDragDrop._dropHereAfterClass); } else if(hoverElement.hasClass(HtmlTreeViewDragDrop._dropBeforeClass)) { hoverElement.addClass(HtmlTreeViewDragDrop._dropHereBeforeClass); } event.preventDefault(); event.stopPropagation(); }; HtmlTreeViewDragDrop.isParent = function isParent(parent, child) { if(!child) { return false; } var node = child.parentNode; while(node) { if(node === parent) { return true; } node = node.parentNode; } return false; }; HtmlTreeViewDragDrop.isScopeItem = function isScopeItem(element) { var tagLowerCase = element.getAttribute('data-tag'); return [ "html", "head", "body", "frame", "iframe", "script", "noscript" ].indexOf(tagLowerCase) >= 0; }; HtmlTreeViewDragDrop.findDragScope = function findDragScope(chain) { for(var i = 0; i < chain.length; i++) { var element = chain.get(i); if(HtmlTreeViewDragDrop.isScopeItem(element)) { return $m(element); } } return null; }; HtmlTreeViewDragDrop.filterSubDragScope = function filterSubDragScope(dropTargets, dragItem) { var result = []; if(dropTargets.length > 0) { result.push({ element: dropTargets.get(0), open: false }); } var i = 1; var len = dropTargets.length; while(i < len) { var element = dropTargets.get(i); if(HtmlTreeViewDragDrop.isScopeItem(element)) { result.push({ element: element, open: false }); i++; var skipChildren = $m(element).find(HtmlTreeViewDragDrop._itemSelector); var j = 0; while(j < skipChildren.length && skipChildren.get(j) === dropTargets.get(i)) { j++; i++; } } else { result.push({ element: element, open: true }); i++; } } return result; }; HtmlTreeViewDragDrop.addDroppable = function addDroppable(rootItem, dragItem) { if(!rootItem) { throw "Bad parameter in addDroppable: !rootItem"; } if(!dragItem) { throw "Bad parameter in addDroppable: !dragItem"; } if(dragItem.length !== 1) { throw "Bad parameter in addDroppable: dragItem.length !== 1"; } var dragParentChain = dragItem.parents(HtmlTreeViewDragDrop._itemSelector).not(HtmlTreeViewDragDrop._hiddenRootSelector); var dragScopeItem = HtmlTreeViewDragDrop.findDragScope(dragParentChain); var potentialDropTargets = dragScopeItem ? dragScopeItem.find(HtmlTreeViewDragDrop._itemSelector).not(HtmlTreeViewDragDrop._hiddenRootSelector) : rootItem.find(HtmlTreeViewDragDrop._itemSelector).not(HtmlTreeViewDragDrop._hiddenRootSelector); var dropTargets = HtmlTreeViewDragDrop.filterSubDragScope(potentialDropTargets, dragItem); var dropBefore = true; var dragElement = dragItem.get(0); for(var i = 0, len = dropTargets.length; i < len; i++) { var possibleDropTarget = dropTargets[i].element; var isOpen = dropTargets[i].open; var isParentOfDrag = HtmlTreeViewDragDrop.isParent(possibleDropTarget, dragElement); var isChildOfDrag = HtmlTreeViewDragDrop.isParent(dragElement, possibleDropTarget); var possibleDropTargetItem = $m(possibleDropTarget); if(possibleDropTarget === dragElement) { dropBefore = false; possibleDropTargetItem.addClass(HtmlTreeViewDragDrop._dragClass); } else if(isChildOfDrag) { } else if(!possibleDropTargetItem.attr('data-id')) { } else if(dropBefore) { possibleDropTargetItem.children(HtmlTreeViewDragDrop._headerSelector).addClass(HtmlTreeViewDragDrop._dropBeforeClass); if(isParentOfDrag) { possibleDropTargetItem.children(HtmlTreeViewDragDrop._footerSelector).addClass(HtmlTreeViewDragDrop._dropAfterClass); } else if(isOpen) { possibleDropTargetItem.children(HtmlTreeViewDragDrop._footerSelector).addClass(HtmlTreeViewDragDrop._dropBeforeClass); } } else { if(isOpen || possibleDropTargetItem.hasClass(HtmlTreeViewDragDrop._collapsedClass)) { possibleDropTargetItem.children(HtmlTreeViewDragDrop._headerSelector).addClass(HtmlTreeViewDragDrop._dropAfterClass); } possibleDropTargetItem.children(HtmlTreeViewDragDrop._footerSelector).addClass(HtmlTreeViewDragDrop._dropAfterClass); } } }; HtmlTreeViewDragDrop.removeDroppable = function removeDroppable(rootItem) { if(!rootItem) { throw "Bad parameter in removeDroppable: !rootItem"; } rootItem.find(HtmlTreeViewDragDrop._dragSelector).removeClass(HtmlTreeViewDragDrop._dragClass); rootItem.find(HtmlTreeViewDragDrop._dropBeforeSelector).removeClass(HtmlTreeViewDragDrop._dropBeforeClass); rootItem.find(HtmlTreeViewDragDrop._dropAfterSelector).removeClass(HtmlTreeViewDragDrop._dropAfterClass); rootItem.find(HtmlTreeViewDragDrop._dropHereBeforeSelector).removeClass(HtmlTreeViewDragDrop._dropHereBeforeClass); rootItem.find(HtmlTreeViewDragDrop._dropHereAfterSelector).removeClass(HtmlTreeViewDragDrop._dropHereAfterClass); rootItem.find(HtmlTreeViewDragDrop._hoverSelector).removeClass(HtmlTreeViewDragDrop._hoverClass); }; return HtmlTreeViewDragDrop; })(); //@ sourceMappingURL=htmlTreeViewDragDrop.js.map // m.ts function $m(arg) { if(typeof arg === "string") { var matches = arg.match(/<(\w+?)>/); if(matches) { return new $mList("", document.createElement(matches[1])); } else { var list; list = document.querySelectorAll(arg); return new $mList(arg, list); } } return new $mList("", arg); } //@ sourceMappingURL=m.js.map // mList.ts "use strict"; var $mList = (function () { function $mList(selector, nodeListOrNode) { this.selector = selector; if(nodeListOrNode === null) { this._array = []; } else if(nodeListOrNode.length !== undefined) { this._array = []; var nodeList = nodeListOrNode; var len = nodeList.length; for(var i = 0; i < len; i++) { this._array.push(new $mNode(nodeList[i])); } } else { this._array = [ new $mNode(nodeListOrNode) ]; } } Object.defineProperty($mList.prototype, "length", { get: function () { return this._array.length; }, enumerable: true, configurable: true }); $mList.domEvents = [ "click", "dblclick", "mousedown", "mouseup", "mousemove", "mouseover", "mouseout", "contextmenu", "focus", "blur", "focusin", "focusout", "keydown", "keyup", "keypress", "change", "reset", "select", "submit" ]; $mList.prototype.push = function (mNode) { this._array.push(mNode); }; $mList.isClassSelector = function isClassSelector(selector) { if(selector[0] !== ".") { return false; } if(selector.indexOf(",") !== -1) { return false; } if(selector.indexOf("#") !== -1) { return false; } if(selector.indexOf(">") !== -1) { return false; } if(selector.indexOf(" ") !== -1) { return false; } if(selector.indexOf("[") !== -1) { return false; } return true; }; $mList.prototype.is = function (s) { if(s === ":hidden") { for(var i = 0; i < this.length; i++) { if(!this._array[i].is(":hidden")) { return false; } } return true; } if(s === ":visible") { return !this.is(":hidden"); } throw "$mNode.is(s: string) : bool - can only be called with :hidden or :visible"; }; $mList.prototype.scrollTop = function (value) { if(this.length === 0) { return undefined; } return this._array[0].scrollTop(); }; $mList.prototype.scrollLeft = function (value) { if(this.length === 0) { return undefined; } return this._array[0].scrollLeft(); }; $mList.prototype.data = function (key, value) { if(this.length === 0) { return undefined; } return this._array[0].data(key, value); }; $mList.prototype.attr = function (attributeName, setValue) { if(this.length === 0) { return undefined; } if(setValue !== undefined) { for(var i = 0; i < this.length; i++) { this._array[i].setAttr(attributeName, setValue); } return this; } else { return this._array[0].attr(attributeName); } }; $mList.prototype.removeAttr = function (attributeName) { for(var i = 0; i < this.length; i++) { this._array[i].removeAttr(attributeName); } return this; }; $mList.prototype.matchAttr = function (attributeName, value) { var result = new $mList(this.selector + " → matchAttr", null); var len = this.length; for(var i = 0; i < len; i++) { var node = this._array[i]; if(node.matchAttr(attributeName, value)) { result.push(node); } } return result; }; $mList.prototype.addClass = function (className) { for(var i = 0; i < this.length; i++) { this._array[i].addClass(className); } return this; }; $mList.prototype.removeClass = function (s) { var len = this.length; for(var i = 0; i < len; i++) { this._array[i].removeClass(s); } return this; }; $mList.prototype.hasClass = function (className) { for(var i = 0; i < this.length; i++) { if(this._array[i].hasClass(className)) { return true; } } return false; }; $mList.prototype.hide = function () { var len = this.length; for(var i = 0; i < len; i++) { this._array[i].hide(); } return this; }; $mList.prototype.show = function () { var len = this.length; for(var i = 0; i < len; i++) { this._array[i].show(); } return this; }; $mList.prototype.placeholder = function (s) { var len = this.length; for(var i = 0; i < len; i++) { this._array[i].placeholder(s); } return this; }; $mList.prototype.focus = function () { if(this.length >= 1) { this._array[0].focus(); } return this; }; $mList.prototype.tooltip = function (s) { var len = this.length; for(var i = 0; i < len; i++) { this._array[i].tooltip(s); } return this; }; $mList.prototype.text = function (s) { if(s === undefined) { if(this.length > 0) { return this._array[0].text(); } return undefined; } var len = this.length; for(var i = 0; i < len; i++) { this._array[i].text(s); } return this; }; $mList.prototype.html = function (htmlString) { if(htmlString === undefined) { if(this.length > 0) { return this._array[0].html(); } return undefined; } var len = this.length; for(var i = 0; i < len; i++) { this._array[i].html(htmlString); } return this; }; $mList.prototype.each = function (fn) { var len = this.length; for(var i = 0; i < len; i++) { fn.call(this._array[i].get(), i, this._array[i].get()); } }; $mList.prototype.parent = function (s) { if(s !== undefined) { if(!$mList.isClassSelector(s)) { return undefined; } s = s.substr(1); } var result = new $mList(this.selector + " → parent", null); var len = this.length; for(var i = 0; i < len; i++) { var parent = this._array[i].parent(s); if(parent) { result.push(parent); } } return result; }; $mList.prototype.parents = function (s) { if(!$mList.isClassSelector(s)) { return undefined; } s = s.substr(1); var result = new $mList(this.selector + " → parents", null); var len = this.length; for(var i = 0; i < len; i++) { var subResult = this._array[i].parents(s); if(subResult && subResult.length) { for(var j = 0; j < subResult.length; j++) { result.push(subResult[j]); } } } return result; }; $mList.prototype.children = function (s) { if(s !== undefined) { if(!$mList.isClassSelector(s)) { return undefined; } s = s.substr(1); } var result = new $mList(this.selector + " → children", null); var len = this.length; for(var i = 0; i < len; i++) { var element = this._array[i].get(); var sibling = element.firstChild; while(sibling) { if(sibling.nodeType === 1) { var node = new $mNode(sibling); if(s === undefined || node.hasClass(s)) { result.push(node); } } sibling = sibling.nextSibling; } } return result; }; $mList.prototype.siblings = function (s) { if(s !== undefined) { if(!$mList.isClassSelector(s)) { return undefined; } s = s.substr(1); } var result = new $mList(this.selector + " → siblings", null); var len = this.length; for(var i = 0; i < len; i++) { var thisChild = this._array[i].get(); var element = this._array[i].get().parentNode; var sibling = element.firstChild; while(sibling) { if(sibling.nodeType === 1 && sibling != thisChild) { var node = new $mNode(sibling); if(s === undefined || node.hasClass(s)) { result.push(node); } } sibling = sibling.nextSibling; } } return result; }; $mList.prototype.next = function (s) { if(s !== undefined) { if(!$mList.isClassSelector(s)) { return undefined; } s = s.substr(1); } var result = new $mList(this.selector + " → next", null); var len = this.length; for(var i = 0; i < len; i++) { var child = this._array[i].get().nextSibling; while(child) { var node = new $mNode(child); if(s === undefined || node.hasClass(s)) { result.push(node); return result; } child = child.nextSibling; } } return result; }; $mList.prototype.prev = function (s) { if(s !== undefined) { if(!$mList.isClassSelector(s)) { return undefined; } s = s.substr(1); } var result = new $mList(this.selector + " → prev", null); var len = this.length; for(var i = 0; i < len; i++) { var child = this._array[i].get().previousSibling; while(child) { var node = new $mNode(child); if(s === undefined || node.hasClass(s)) { result.push(node); return result; } child = child.previousSibling; } } return result; }; $mList.prototype.appendTo = function (item) { if(item.length == 1) { var len = this.length; var parent = item.get(0); for(var i = 0; i < len; i++) { parent.appendChild(this.get(i)); } } return this; }; $mList.prototype.after = function (item) { if(item.length > 0) { var len = this.length; for(var i = 0; i < len; i++) { var child = this.get(i); var parent = child.parentNode; if(child.nextSibling) { for(var j = 0; j < item.length; j++) { parent.insertBefore(item.get(j), child.nextSibling); } } else { for(var j = 0; j < item.length; j++) { parent.appendChild(item.get(j)); } } } } return this; }; $mList.prototype.not = function (s) { if(!$mList.isClassSelector(s)) { return undefined; } s = s.substr(1); var result = new $mList(this.selector + " → not", null); var len = this.length; for(var i = 0; i < len; i++) { var node = this._array[i]; if(!node.hasClass(s)) { result.push(node); } } return result; }; $mList.prototype.slice = function (start, end) { var result = new $mList(this.selector + " → slice", null); var len = this.length; if(end == undefined || end > len) { end = len; } for(var i = start; i < end; i++) { var node = this._array[i]; result.push(node); } return result; }; $mList.prototype.closest = function (s) { var classes = s.split(/[ ,]+/); for(var classIndex = 0; classIndex < classes.length; classIndex++) { if(!$mList.isClassSelector(classes[classIndex])) { return undefined; } classes[classIndex] = classes[classIndex].substr(1); } var result = new $mList(this.selector + " → closest", null); var len = this.length; for(var i = 0; i < len; i++) { var element = this._array[i].closest(classes); if(element) { result.push(element); } } return result; }; $mList.prototype.find = function (subselector) { var result = new $mList(this.selector + " → find", null); var len = this.length; for(var i = 0; i < len; i++) { var element = this._array[i].get(); var nodeList = element.querySelectorAll(subselector); if(nodeList) { for(var j = 0, nodeListLen = nodeList.length; j < nodeListLen; j++) { result.push(new $mNode(nodeList[j])); } } } return result; }; $mList.prototype.remove = function () { var result = new $mList(this.selector + " → remove", null); var len = this.length; for(var i = 0; i < len; i++) { this._array[i].remove(); } return result; }; $mList.prototype.prepend = function (item) { if(item.length > 0) { var len = this.length; for(var i = 0; i < len; i++) { for(var j = item.length - 1; j >= 0; j--) { this._array[i].prepend((item)._array[j].get()); } } } return this; }; $mList.prototype.append = function (item) { if(item.length > 0) { var len = this.length; for(var i = 0; i < len; i++) { for(var j = 0; j < item.length; j++) { this._array[i].append((item)._array[j].get()); } } } return this; }; $mList.prototype.appendText = function (s) { var len = this.length; for(var i = 0; i < len; i++) { var child = (this)._array[i]; child.append(document.createTextNode(s)); } return this; }; $mList.prototype.replaceWith = function (item) { var len = this.length; if(len > 0 && item.length == 1) { for(var i = 0; i < len; i++) { this._array[i].replaceWith((item)._array[0]); } } return this; }; $mList.prototype.select = function () { var len = this.length; for(var i = 0; i < len; i++) { this._array[i].select(); } return this; }; $mList.prototype.val = function (s) { var len = this.length; if(s !== undefined) { for(var i = 0; i < len; i++) { this._array[i].val(s); } return this; } if(len == 0) { return undefined; } return this._array[0].val(s); }; $mList.prototype.css = function (keyOrMap, value) { var len = this.length; if(value !== undefined) { for(var i = 0; i < len; i++) { this._array[i].css(keyOrMap, value); } return this; } if(len == 0) { return undefined; } return this._array[0].css(keyOrMap); }; $mList.prototype.click = function () { var len = this.length; for(var i = 0; i < len; i++) { this._array[i].click(); } return this; }; $mList.prototype.dblclick = function () { var len = this.length; for(var i = 0; i < len; i++) { this._array[i].dblclick(); } return this; }; $mList.prototype.changeBinding = function (target, isBind, events, fn, arg) { var eventList = events.split(" "); var len = this.length; for(var i = 0; i < len; i++) { for(var j = 0; j < eventList.length; j++) { var event = eventList[j]; if($mList.domEvents.indexOf(event) >= 0) { this._array[i].changeEventBinding(isBind, target, event, fn, arg); } else { this._array[i].changeSpecialBinding(isBind, target, event, fn, arg); } } } return this; }; $mList.prototype.bindTarget = function (target, events, fn, arg) { return this.changeBinding(target, true, events, fn, arg); }; $mList.prototype.bind = function (events, fn, arg) { return this.changeBinding(undefined, true, events, fn, arg); }; $mList.prototype.unbind = function (events, fn) { return this.changeBinding(undefined, false, events, fn); }; $mList.prototype.trigger = function (events, extra) { var eventList = events.split(" "); var len = this.length; for(var i = 0; i < len; i++) { for(var j = 0; j < eventList.length; j++) { var event = eventList[j]; if($mList.domEvents.indexOf(event) >= 0) { this._array[i].triggerEvent(event, extra); } else { this._array[i].triggerSpecial(event, extra); } } } return this; }; $mList.prototype.get = function (n) { if(n < 0) { n = n + this.length; } if(n >= this.length || n < 0) { return null; } return this._array[n].get(); }; $mList.prototype.first = function () { var result = new $mList(this.selector + " → first", null); if(this.length > 0) { result.push(this._array[0]); } return result; }; $mList.prototype.last = function () { var result = new $mList(this.selector + " → last", null); if(this.length > 0) { result.push(this._array[this.length - 1]); } return result; }; $mList.prototype.position = function () { var len = this.length; if(len > 0) { return this._array[0].position(); } return undefined; }; $mList.prototype.height = function () { var len = this.length; if(len > 0) { return this._array[0].height(); } return undefined; }; $mList.prototype.outerHeight = function (includeMargin) { var len = this.length; if(len > 0) { return this._array[0].outerHeight(includeMargin); } return undefined; }; $mList.prototype.width = function () { var len = this.length; if(len > 0) { return this._array[0].width(); } return undefined; }; $mList.prototype.outerWidth = function (includeMargin) { var len = this.length; if(len > 0) { return this._array[0].outerWidth(includeMargin); } return undefined; }; return $mList; })(); //@ sourceMappingURL=mList.js.map // mNode.ts var $mNode = (function () { function $mNode(node) { this.length = 1; this._node = node; } $mNode.bindingKey = "$BPT$Binding$"; $mNode.dataKey = "$BPT$QueryData$"; $mNode.prototype.get = function () { return this._node; }; $mNode.prototype.is = function (s) { if(!(this._node instanceof HTMLElement)) { throw "$mNode.is(s: string) : bool - can only be called on HTML elements"; } var element = this._node; if(s === ":hidden") { return element.style.display === "none"; } else if(s === ":visible") { return element.style.display !== "none"; } throw "$mNode.is(s: string) : bool - can only be called with :hidden or :visible"; }; $mNode.prototype.hide = function () { if(!(this._node instanceof HTMLElement) && !(this._node instanceof SVGElement)) { throw "$mNode.hide(): IQueryNode - can only be called on HTML or SVG elements"; } var element = this._node; element.style.display = "none"; return this; }; $mNode.prototype.show = function () { if(!(this._node instanceof HTMLElement) && !(this._node instanceof SVGElement)) { throw "$mNode.show(): IQueryNode - can only be called on HTML or SVG elements"; } var element = this._node; element.style.display = ""; var style = element.ownerDocument.parentWindow.getComputedStyle(element); var display = style.display; if(display == "none") { element.style.display = "block"; } return this; }; $mNode.prototype.tooltip = function (s) { if(!(this._node instanceof HTMLElement)) { throw "$mNode.tooltip(s: string): IQueryNode - can only be called on HTML elements"; } var element = this._node; element.title = s; return this; }; $mNode.prototype.placeholder = function (s) { if(!(this._node instanceof HTMLInputElement)) { throw "$mNode.placeholder(s: string): IQueryNode - can only be called on HTMLInput elements"; } var element = this._node; element.placeholder = s; return this; }; $mNode.prototype.focus = function () { var element = this._node; element.focus(); return this; }; $mNode.prototype.scrollTop = function (value) { if(!(this._node instanceof HTMLElement)) { throw "$mNode.scrollTop(value?: number): number - can only be called on HTML elements"; } var element = this._node; if(value !== undefined) { return element.scrollTop; } element.scrollTop = value; return value; }; $mNode.prototype.addClass = function (className) { if(!(this._node instanceof HTMLElement)) { throw "$mNode.addClass(className: string) - can only be called on HTML elements"; } var element = this._node; if(!element.classList.contains(className)) { element.classList.add(className); } }; $mNode.prototype.removeClass = function (className) { if(!(this._node instanceof HTMLElement)) { throw "$mNode.removeClass(className: string) - can only be called on HTML elements"; } var element = this._node; if(element.classList.contains(className)) { element.classList.remove(className); } }; $mNode.prototype.hasClass = function (className) { if(!(this._node instanceof HTMLElement)) { return false; } var element = this._node; return element.classList && element.classList.contains(className); }; $mNode.prototype.scrollLeft = function (value) { if(!(this._node instanceof Element)) { throw "$mNode.scrollLeft(value?: number): number - can only be called on Elements"; } var element = this._node; if(value !== undefined) { return element.scrollLeft; } element.scrollLeft = value; return value; }; $mNode.prototype.data = function (key, value) { var data = this._node[$mNode.dataKey]; if(!data) { this._node[$mNode.dataKey] = data = { }; } if(key === undefined) { return data; } if(value !== undefined) { data[key] = value; } else { return data[key]; } return data; }; $mNode.prototype.attr = function (attributeName) { if(!(this._node instanceof Element)) { throw "$mNode.attr(attributeName: string): string - can only be called on Elements"; } var element = this._node; var result = element[attributeName]; if(result == undefined) { result = element.getAttribute(attributeName); } return result === null ? undefined : result; }; $mNode.prototype.removeAttr = function (attributeName) { if(!(this._node instanceof Element)) { throw "$mNode.removeAttr(attributeName: string): string - can only be called on Elements"; } var element = this._node; element.removeAttribute(attributeName); }; $mNode.prototype.matchAttr = function (attributeName, value) { if(!(this._node instanceof Element)) { throw "$mNode.matchAttr(attributeName: string, value: string) - can only be called on Elements"; } var element = this._node; return element.getAttribute(attributeName) == value; }; $mNode.prototype.setAttr = function (attributeName, setValue) { if(!(this._node instanceof Element)) { throw "$mNode.setAttr(attributeName: string, setValue: any): void - can only be called on Elements"; } var element = this._node; element.setAttribute(attributeName, setValue); }; $mNode.prototype.parent = function (s) { if(!(this._node instanceof HTMLElement)) { return undefined; } var parentNode = this._node.parentNode; return s === undefined || parentNode.classList.contains(s) ? new $mNode(parentNode) : undefined; }; $mNode.prototype.parents = function (s) { if(!(this._node instanceof HTMLElement)) { throw "$mNode.parents(s: string): IQueryNode - can only be called on HTML elements"; } var node = this._node; var results = []; while(node.parentNode instanceof HTMLElement) { var node = node.parentNode; if(node.classList.contains(s)) { results.push(new $mNode(node)); } } return results; }; $mNode.prototype.text = function (s) { if(!(this._node instanceof HTMLElement)) { throw "$mNode.text(s?: string): string - can only be called on HTML elements"; } var element = this._node; if(s === undefined) { return element.innerText; } element.innerText = s; return s; }; $mNode.prototype.html = function (htmlString) { if(!(this._node instanceof HTMLElement)) { throw "$mNode.html(htmlString?: string): string - can only be called on HTML elements"; } var element = this._node; if(htmlString === undefined) { return element.innerHTML; } element.innerHTML = htmlString; return htmlString; }; $mNode.prototype.remove = function () { if(this._node.parentNode) { this._node.parentNode.removeChild(this._node); } }; $mNode.prototype.prepend = function (node) { this._node.insertBefore(node, this._node.firstChild); }; $mNode.prototype.append = function (node) { this._node.appendChild(node); }; $mNode.prototype.replaceWith = function (node) { var parent = this._node.parentNode; if(parent) { var nextSibling = this._node.nextSibling; parent.removeChild(this._node); var replacement = (node)._node; if(nextSibling) { parent.insertBefore(replacement, nextSibling); } else { parent.appendChild(replacement); } } }; $mNode.prototype.select = function () { if(!(this._node instanceof HTMLElement)) { throw "$mNode.select() - can only be called on HTML elements"; } var element = this._node; element.select(); }; $mNode.prototype.val = function (s) { if(!(this._node instanceof HTMLInputElement)) { throw "$mNode.val(): string - can only be called on HTMLInput elements"; } var element = this._node; if(s === undefined) { var value = element.value; if(typeof value === "string") { return value.replace(/\r/g, ""); } if(value === undefined || value === null) { return ""; } return value; } element.value = s; }; $mNode.prototype.closest = function (classes) { var element = this._node; while(element) { if(element.classList) { for(var i = 0; i < classes.length; i++) { if(element.classList.contains(classes[i])) { return new $mNode(element); } } } element = element.parentNode; } return undefined; }; $mNode.prototype.css = function (keyOrMap, value) { if(keyOrMap && typeof keyOrMap === "object") { var map = keyOrMap; for(var key in map) { this.css(key, map[key]); } } else { var key = keyOrMap; var element = this._node; if(value !== undefined) { element.style[key] = value; } return element.style ? element.style[key] : undefined; } }; $mNode.prototype.click = function () { if(!(this._node instanceof HTMLElement)) { throw "$mNode.click(): IQueryNode - can only be called on HTML elements"; } var element = this._node; element.click(); return this; }; $mNode.prototype.dblclick = function () { if(!(this._node instanceof HTMLElement)) { throw "$mNode.dblclick(): IQueryNode - can only be called on HTML elements"; } var element = this._node; element.fireEvent("ondblclick"); }; $mNode.prototype.changeEventBinding = function (isBind, target, event, fn, arg) { var element = this._node; var name = "on" + event; var oldBinding = element[name]; var newBinding; var currentFuncs = oldBinding && oldBinding.boundFuncList ? oldBinding.boundFuncList : []; var index; if(isBind) { currentFuncs.push(fn); } else if(fn) { index = currentFuncs.indexOf(fn); if(index >= 0) { currentFuncs.splice(index, 1); } } else { currentFuncs = []; } if(currentFuncs.length) { if(target === undefined) { target = element; } newBinding = function (e) { var i; var bubble = true; e.target = target; for(i = 0; i < currentFuncs.length; i++) { if(currentFuncs[i].call(target, e, arg) == false) { e.preventDefault(); e.stopPropagation(); bubble = false; } } return bubble; }; newBinding.boundFuncList = currentFuncs; } element[name] = newBinding; return this; }; $mNode.prototype.triggerEvent = function (event, extra) { var element = this._node; var trigger = element[event]; if(trigger) { trigger.call(element, { }, extra); } return this; }; $mNode.prototype.changeSpecialBinding = function (isBind, target, event, fn, arg) { var element = this._node; var key = $mNode.bindingKey + event; element[key] = isBind ? fn : undefined; return this; }; $mNode.prototype.triggerSpecial = function (event, extra) { var element = this._node; var key = $mNode.bindingKey + event; var trigger = element[key]; if(trigger) { trigger.call(element, { }, extra); } return this; }; $mNode.prototype.position = function () { var element = this._node; var position = { top: element.offsetTop, left: element.offsetLeft }; return position; }; $mNode.prototype.height = function () { var element = this._node; var height = element.getBoundingClientRect().height; var compStyle = window.getComputedStyle(element, null); height -= parseInt(compStyle.paddingTop, 10); height -= parseInt(compStyle.paddingBottom, 10); height -= parseInt(compStyle.borderTopWidth, 10); height -= parseInt(compStyle.borderBottomWidth, 10); return height; }; $mNode.prototype.outerHeight = function (includeMargin) { var element = this._node; var outerHeight = element.getBoundingClientRect().height; if(includeMargin) { var compStyle = window.getComputedStyle(element, null); outerHeight += parseInt(compStyle.marginTop, 10); outerHeight += parseInt(compStyle.marginBottom, 10); } return outerHeight; }; $mNode.prototype.width = function () { var element = this._node; var width = element.getBoundingClientRect().width; var compStyle = window.getComputedStyle(element, null); width -= parseInt(compStyle.paddingLeft, 10); width -= parseInt(compStyle.paddingRight, 10); width -= parseInt(compStyle.borderLeftWidth, 10); width -= parseInt(compStyle.borderRightWidth, 10); return width; }; $mNode.prototype.outerWidth = function (includeMargin) { var element = this._node; var outerWidth = element.getBoundingClientRect().width; if(includeMargin) { var compStyle = window.getComputedStyle(element, null); outerWidth += parseInt(compStyle.marginLeft, 10); outerWidth += parseInt(compStyle.marginRight, 10); } return outerWidth; }; return $mNode; })(); //@ sourceMappingURL=mNode.js.map // dataTreeView.ts var DataTreeView = (function () { function DataTreeView() { } DataTreeView.dataTreeIndent = 10; DataTreeView.dataTreeInitialWidth = 170; DataTreeView.dataTreeMinWidth = 80; DataTreeView.init = function init(item, initialWidth) { if (typeof initialWidth === "undefined") { initialWidth = DataTreeView.dataTreeInitialWidth; } var rootElement = $m("
").addClass("BPT-DataTree"); rootElement.attr("data-treeWidth", initialWidth); item.append(rootElement); var useDarkTheme = toolwindowHelpers.isDarkThemeBackground(rootElement); if(useDarkTheme) { rootElement.addClass("BPT-Tree-DarkTheme"); } else { rootElement.removeClass("BPT-Tree-DarkTheme"); } if(!rootElement.data("attachedHandlers")) { var container = rootElement.parent(".BPT-DataTree-Container"); container.bind("mousedown", function (event) { $m(this).data("mouseActivate", true); }); container.bind("click", function (event) { var element = $m(event.target); if(!element.hasClass("BPT-DataTreeItem-ChildCollection")) { var row = element.closest(".BPT-DataTreeItem"); if(row.length > 0) { if(element.hasClass("BPT-DataTreeItem-ExpandIcon")) { DataTreeView.toggle(row); } DataTreeView.select(row); } } }); container.bind("dblclick", function (event) { var element = $m(event.target); var item = element.closest(".BPT-DataTreeItem, .BPT-DataTreeItem-EditableSection"); if(item.length > 0) { if(item.hasClass("BPT-DataTreeItem")) { if(item.hasClass("BPT-DataTreeItem-Collapsed") || item.hasClass("BPT-DataTreeItem-Expanded")) { if(!element.hasClass("BPT-DataTreeItem-ExpandIcon")) { DataTreeView.toggle(item); } } } else if(item.hasClass("BPT-DataTreeItem-EditableSection")) { var row = item.parents(".BPT-DataTreeItem").first(); if(row.length > 0) { var editCallback = row.data("editCallback"); editCallback = (editCallback ? editCallback : row.parent().data("editCallback")); if(editCallback) { editCallback(row, item); event.stopPropagation(); } } } } }); container.bind("focus", function (event) { if(!$m(this).data("mouseActivate")) { var element = $m(this); var selected = DataTreeView.getSelected(element.children(".BPT-DataTree")); if(selected && selected.length === 0) { selected = DataTreeView.select(element.find(".BPT-DataTreeItem").first()); } if(selected && selected.length > 0) { var wasScrolled = toolwindowHelpers.scrollIntoView(selected.children(".BPT-DataTreeItem-Header").get(0), selected.closest(".BPT-DataTree-ScrollContainer").get(0)); if(wasScrolled) { event.preventDefault(); return false; } } } event.preventDefault(); $m(this).data("mouseActivate", false); }); container.bind("focusin", function (event) { $m(this).addClass("BPT-DataTree-Container-CurrentFocus"); }); container.bind("focusout", function (event) { $m(this).removeClass("BPT-DataTree-Container-CurrentFocus"); }); container.bind("keydown", function (event) { var selected; if(event.keyCode >= Common.KeyCodes.ARROW_FIRST && event.keyCode <= Common.KeyCodes.ARROW_LAST) { if(document.activeElement instanceof HTMLInputElement) { return; } selected = DataTreeView.getSelected($m(this).children().first()); var moveUp = function (toParent) { var newElement = null; var sibling = selected.prev(".BPT-DataTreeItem").last(); if(sibling.length > 0 && !toParent) { newElement = sibling.find(".BPT-DataTreeItem").last(); if(newElement.length === 0) { newElement = sibling; } } else { newElement = selected.parents(".BPT-DataTreeItem").first(); } if(newElement.length > 0) { DataTreeView.select(newElement); toolwindowHelpers.scrollIntoView(newElement.children(".BPT-DataTreeItem-Header").get(0), newElement.closest(".BPT-DataTree-ScrollContainer").get(0)); event.preventDefault(); return false; } }; var moveDown = function () { var newElement = selected.find(".BPT-DataTreeItem").first(); newElement = (newElement && newElement.length > 0 ? newElement : selected.next(".BPT-DataTreeItem").first()); var searchedParent = selected; while(newElement.length === 0) { searchedParent = searchedParent.parents(".BPT-DataTreeItem"); if(searchedParent.length === 0) { break; } newElement = searchedParent.next(".BPT-DataTreeItem").first(); } if(newElement.length > 0) { DataTreeView.select(newElement); toolwindowHelpers.scrollIntoView(newElement.children(".BPT-DataTreeItem-Header").get(0), newElement.closest(".BPT-DataTree-ScrollContainer").get(0)); event.preventDefault(); return false; } }; if(selected.length > 0) { switch(event.keyCode) { case Common.KeyCodes.ARROW_LEFT: if(selected.hasClass("BPT-DataTreeItem-Expanded")) { DataTreeView.toggle(selected); } else { moveUp(true); } break; case Common.KeyCodes.ARROW_UP: moveUp(); break; case Common.KeyCodes.ARROW_RIGHT: if(selected.hasClass("BPT-DataTreeItem-Collapsed")) { DataTreeView.toggle(selected); } else if(selected.hasClass("BPT-DataTreeItem-Expanded")) { moveDown(); } break; case Common.KeyCodes.ARROW_DOWN: moveDown(); break; } } event.preventDefault(); return false; } else if(event.keyCode === Common.KeyCodes.ENTER || event.keyCode === Common.KeyCodes.SPACE) { var element = $m(this).children(".BPT-DataTree"); selected = DataTreeView.getSelected(element).children(".BPT-DataTreeItem-Header"); if(selected.length > 0) { var activeElement = document.activeElement; if(activeElement && (activeElement).type !== "text" && (activeElement.className && activeElement.className.indexOf("BPT-FileLink") === -1)) { if(event.keyCode === Common.KeyCodes.ENTER) { var valueNode = selected.find(".BPT-DataTreeItem-Value"); var eventData = valueNode.data("events"); if(eventData && eventData.dblclick) { valueNode.triggerHandler("dblclick"); return false; } } var clickable = selected.find("input[type='checkbox']"); clickable = (clickable.length > 0 ? clickable : selected.find("a")); if(clickable.length === 0) { var src = $m(event.srcElement); if(src.hasClass("BPT-FileLink")) { clickable = src; } else { clickable = selected.find(".BPT-FileLink"); if(clickable.length === 0) { clickable = DataTreeView.getSelected(element).children(".BPT-FileLink"); } } } if(clickable.length > 0) { clickable.get(0).click(); return false; } else if(event.keyCode === Common.KeyCodes.SPACE) { return false; } } } } else if(event.keyCode === Common.KeyCodes.TAB && !event.shiftKey) { var tree = $m(this).children(".BPT-DataTree"); var link = DataTreeView.getSelected(tree).children(".BPT-DataTreeItem-Header").find(".BPT-FileLink"); if(link.length > 0 && document.activeElement !== link.get(0)) { $m(document.body).addClass("showFocus"); (link.get(0)).setActive(); link.focus(); return false; } } }); container = null; rootElement.data("attachedHandlers", true); } var divider = $m("
").addClass("BPT-DataTree-Divider").css("left", initialWidth + "px"); divider.bind("mousedown", function (e) { var prevCursor = document.body.style.cursor; document.body.style.cursor = "w-resize"; var offsetX = (divider.get(0)).getBoundingClientRect().left; var startX = divider.css("pixelLeft"); divider.addClass("BPT-DataTree-DividerVisible"); var mouseMoveHandler, mouseUpHandler; mouseMoveHandler = function (e) { var newWidth = startX + (e.pageX - offsetX); if(newWidth < DataTreeView.dataTreeMinWidth) { newWidth = DataTreeView.dataTreeMinWidth; } divider.css("left", newWidth + "px"); }; mouseUpHandler = function () { $m(document).unbind("mousemove", mouseMoveHandler); $m(document).unbind("mouseup", mouseUpHandler); document.body.style.cursor = prevCursor; divider.removeClass("BPT-DataTree-DividerVisible"); var rootElement = divider.parent(); var treeWidth = parseInt(rootElement.children().first().css("left"), 10); rootElement.find(".BPT-DataTreeItem").not(".BPT-DataTreeItem-CollapsibleBlock").each(function () { var element = $m(this); var indent = parseInt(element.attr("data-indent"), 10); element.find(".BPT-DataTreeItem-Header:first-child .BPT-DataTreeItem-Name").css("width", (treeWidth - indent) + "px"); }); rootElement.attr("data-treeWidth", treeWidth); }; $m(document).bind("mousemove", mouseMoveHandler); $m(document).bind("mouseup", mouseUpHandler); e.stopImmediatePropagation(); e.preventDefault(); }); rootElement.append(divider); return item; }; DataTreeView.destroy = function destroy(item) { if(item.data("attachedHandlers")) { item.parent(".BPT-DataTree-Container").unbind(".dataTreeView"); item.data("attachedHandlers", false); } }; DataTreeView.addSingleItem = function addSingleItem(item, id, preName, name, value) { var data = { uid: id, preName: preName, name: name, value: value, hasChildren: false }; var childrenCollection = DataTreeView.addItems(item, [ data ]); return childrenCollection.children().last(); }; DataTreeView.addItems = function addItems(item, items, toggleCallback, editCallback, selectCallback, stopAutoScroll) { var childrenCollection = $m("").addClass("BPT-DataTreeItem-ChildCollection"); var isDataTree = !(item.hasClass("BPT-DataTreeItem")); var indent = isDataTree ? 0 : (item.parents(".BPT-DataTreeItem").length + 1) * DataTreeView.dataTreeIndent; var initialWidth = ((isDataTree ? item.children(".BPT-DataTree").attr("data-treeWidth") : item.closest(".BPT-DataTree").attr("data-treeWidth")) - indent) + "px"; for(var i = 0; i < items.length; i++) { var id = items[i].uid; var preName = items[i].preName; var name = items[i].name; var preValue = items[i].preValue; var value = items[i].value; var isExpandable = items[i].hasChildren; var link = items[i].link; var blockOpenText = items[i].blockOpenText; var blockCloseText = items[i].blockCloseText; var blockIsInline = items[i].blockIsInline; var tooltip = items[i].alreadyEncodedTooltip; var showValue = items[i].showValue !== undefined ? items[i].showValue : true; var removeChildOnCollapse = items[i].removeChildOnCollapse !== undefined ? items[i].removeChildOnCollapse : true; var collapsibleBlockFooter; var collapsibleBlockHeader; var nameElement = $m("").addClass("BPT-DataTreeItem-Name"); if(preName) { nameElement.append(preName); } nameElement.append(name); var valueElement; if(!blockIsInline || showValue) { valueElement = $m("").addClass("BPT-DataTreeItem-Value"); } if(blockIsInline) { if(!showValue) { initialWidth = "100%"; } nameElement.css("width", initialWidth); if(blockOpenText) { nameElement.append($m("").appendText(blockOpenText)); } if(showValue) { if(preValue) { valueElement.append(preValue); } if(typeof value == "string") { valueElement.appendText(value); } else { valueElement.append(value); } if(blockCloseText) { valueElement.append($m("").appendText(blockCloseText)); } } } else { if(blockOpenText && blockCloseText) { collapsibleBlockHeader = $m("").addClass("BPT-DataTreeItem-CollapsedBlockFooter").appendText("..." + blockCloseText); collapsibleBlockFooter = $m("").addClass("BPT-DataTreeItem-BlockFooter").appendText(blockCloseText); } else { initialWidth = showValue ? initialWidth : "100%"; nameElement.css("width", initialWidth); } if(collapsibleBlockHeader) { nameElement.append($m("").appendText(blockOpenText)); nameElement.append(collapsibleBlockHeader); } if(preValue) { valueElement.append(preValue); } if(typeof value == "string") { valueElement.appendText(value); } else { valueElement.append(value); } } var expandIcon; if(isExpandable) { expandIcon = $m("
").addClass("BPT-DataTreeItem-ExpandIcon"); } var linkElement = DataTreeView.createLinkDiv(link, "BPT-DataTreeItem-FileLink-Right", false); var divElement = $m("
").addClass("BPT-DataTreeItem").attr("data-id", id).attr("data-indent", indent); if(tooltip) { divElement.attr("title", tooltip.replace(/\r\n/g, " ")); } if(isExpandable) { divElement.addClass("BPT-DataTreeItem-Collapsed"); } if(collapsibleBlockFooter) { divElement.addClass("BPT-DataTreeItem-CollapsibleBlock"); } if(removeChildOnCollapse) { divElement.addClass("BPT-DataTreeItem-RemoveChildOnCollapse"); } if(expandIcon) { divElement.append(expandIcon); } if(linkElement && collapsibleBlockFooter) { divElement.append(linkElement); } var subDivElement = $m("
").addClass("BPT-DataTreeItem-Header").append(nameElement); if(valueElement) { subDivElement.append(valueElement); } if(linkElement && !collapsibleBlockFooter) { subDivElement.append(linkElement); } divElement.append(subDivElement); if(collapsibleBlockFooter) { divElement.append(collapsibleBlockFooter); } childrenCollection.append(divElement); } if(toggleCallback || editCallback || selectCallback) { childrenCollection.data("toggleCallback", toggleCallback); childrenCollection.data("editCallback", editCallback); childrenCollection.data("selectCallback", selectCallback); } var header = (isDataTree ? item.children(".BPT-DataTree") : item.children(".BPT-DataTreeItem-Header")); var childHolder = (isDataTree ? header.children(".BPT-DataTreeItem-ChildCollection") : header.siblings(".BPT-DataTreeItem-ChildCollection")); if(childHolder.length > 0) { if(toggleCallback || editCallback || selectCallback) { childrenCollection.children().data(childrenCollection.data()); } childrenCollection.children().appendTo(childHolder); childrenCollection = childHolder; } else { if(isDataTree) { header.append(childrenCollection); } else { header.after(childrenCollection); } } var links = childrenCollection.find(".BPT-DataTreeItem-FileLink-Right"); for(var linkIndex = 0; linkIndex < links.length; linkIndex++) { var link = links.get(linkIndex); var width = link.clientWidth + 10; if(link.parentNode.className.indexOf("BPT-DataTreeItem-CollapsibleBlock") >= 0) { link.nextSibling.style.maxWidth = "calc(100% - " + width + "px)"; } else { link.parentNode.style.minWidth = "calc(100% - 10px)"; } } if(!stopAutoScroll) { window.setTimeout(function () { var child = childrenCollection.children().last(); var scrollContainer = child.closest(".BPT-DataTree-ScrollContainer").first(); if(scrollContainer.length > 0) { var x = scrollContainer.scrollLeft; if(toolwindowHelpers.scrollIntoView(child.children(".BPT-DataTreeItem-Header").get(0), scrollContainer.get(0))) { (childrenCollection.get(0)).scrollIntoView(true); scrollContainer.scrollLeft = x; } } }, 0); } return childrenCollection; }; DataTreeView.showLoading = function showLoading(item, text) { if(!item.hasClass("BPT-DataTreeItem-ShowingLoader")) { item.append($m("
").addClass("BPT-DataTreeItem BPT-DataTreeItem-Loading").appendText(text)); item.addClass("BPT-DataTreeItem-ShowingLoader"); } return item; }; DataTreeView.hideLoading = function hideLoading(item) { if(item.hasClass("BPT-DataTreeItem-ShowingLoader")) { item.removeClass("BPT-DataTreeItem-ShowingLoader"); item.children(".BPT-DataTreeItem-Loading").remove(); } return item; }; DataTreeView.getChildren = function getChildren(item) { if(item.hasClass("BPT-DataTree-Container")) { return item.children().first().children(".BPT-DataTreeItem-ChildCollection").children(".BPT-DataTreeItem"); } return item.children(".BPT-DataTreeItem-ChildCollection").children(".BPT-DataTreeItem"); }; DataTreeView.getName = function getName(item) { var nameNode = item.find("span.BPT-DataTreeItem-Name").first(); var cssName = nameNode.children(".BPT-HTML-CSS-Name"); return (cssName.length === 1 ? cssName : nameNode); }; DataTreeView.getValue = function getValue(item) { var valueNode = item.find("span.BPT-DataTreeItem-Value").first(); var cssValue = valueNode.children(".BPT-HTML-CSS-Value"); return (cssValue.length === 1 ? cssValue : valueNode); }; DataTreeView.isCollapsed = function isCollapsed(item) { return item.hasClass("BPT-DataTreeItem-Collapsed"); }; DataTreeView.isExpanded = function isExpanded(item) { return item.hasClass("BPT-DataTreeItem-Expanded"); }; DataTreeView.toggle = function toggle(item, onExpandComplete) { var toggleCallback = item.data("toggleCallback"); toggleCallback = (toggleCallback ? toggleCallback : item.parent().data("toggleCallback")); if(toggleCallback) { toolwindowHelpers.codeMarker(toolwindowHelpers.codeMarkers.perfBrowserTools_DiagnosticsToolWindowsDataTreeToggleBegin); if(item.hasClass("BPT-DataTreeItem-Collapsed")) { item.removeClass("BPT-DataTreeItem-Collapsed"); toggleCallback(true, item, item.attr("data-id"), onExpandComplete); item.addClass("BPT-DataTreeItem-Expanded"); } else { item.removeClass("BPT-DataTreeItem-Expanded"); item.addClass("BPT-DataTreeItem-Collapsed"); toggleCallback(false, item, item.attr("data-id")); if(item.hasClass("BPT-DataTreeItem-RemoveChildOnCollapse")) { item.children(".BPT-DataTreeItem-ChildCollection").remove(); } toolwindowHelpers.codeMarker(toolwindowHelpers.codeMarkers.perfBrowserTools_DiagnosticsToolWindowsDataTreeToggleEnd); } } return item; }; DataTreeView.getSelected = function getSelected(item) { if(item.hasClass("BPT-DataTreeItem-Selected")) { return item; } var rootElement = item.closest(".BPT-DataTree"); rootElement = (rootElement.length > 0 ? rootElement : item); return rootElement.find(".BPT-DataTreeItem-Selected").first(); }; DataTreeView.select = function select(item) { var rootElement = item.closest(".BPT-DataTree"); rootElement.find(".BPT-DataTreeItem-Selected").removeClass("BPT-DataTreeItem-Selected"); item.addClass("BPT-DataTreeItem-Selected"); var activeElement = document.activeElement; if(activeElement && activeElement.className && activeElement.className.indexOf("BPT-FileLink") >= 0) { var container = rootElement.parent(".BPT-DataTree-Container"); container.focus(); } var selectCallback = item.data("selectCallback"); selectCallback = (selectCallback ? selectCallback : item.parent().data("selectCallback")); if(selectCallback) { selectCallback(item, item.attr("data-id"), item.attr("data-tag")); } item.trigger("itemSelected"); return item; }; DataTreeView.clear = function clear(item) { item.children(".BPT-DataTreeItem-ChildCollection").remove(); if(item.hasClass("BPT-DataTree-Container")) { item.children().first().children(".BPT-DataTreeItem-ChildCollection").remove(); } return item; }; DataTreeView.removeAndSelect = function removeAndSelect(item) { var select = item.prev(".BPT-DataTreeItem"); select = (select.length > 0 ? select : item.next(".BPT-DataTreeItem")); item.remove(); if(select.length > 0) { DataTreeView.select(select); } }; DataTreeView.createLinkDiv = function createLinkDiv(link, styles, dontGenerateTooltip) { var linkElement; if(link && link.url) { var url = link.url.replace(/\\"/g, "\""); var linkText = toolwindowHelpers.createFileLinkText(link.url, link.line); var search = ""; if(link.search) { search = "\"" + link.search.replace(/\\"/g, "\"") + "\""; } linkText = linkText.replace(/&/g, "&").replace(/>/g, ">").replace(/= textToSearch.length) { return results; } indexEndsWith = textToSearch.indexOf(endsWith, minimumIndex); if(indexEndsWith === -1) { return results; } content = textToSearch.substring(indexStartsWith + startsWith.length, indexEndsWith); lastIndex = indexEndsWith + endsWith.length - 1; } else { lastIndex = indexStartsWith + startsWith.length - 1; } results.push(new Templating.Range(indexStartsWith, lastIndex, content, true, isStart, rangeType)); minimumIndex = results[results.length - 1].lastIndex + 1; } return results; }; RangeFinder.prototype.findRemainingRanges = function (text, rangesFound) { var result = []; if(rangesFound.length === 0) { result.push(new Templating.Range(0, text.length - 1, text, false, false, "text")); return result; } var startIndex = 0; var precedingGapLength; for(var i = 0; i < rangesFound.length; i++) { precedingGapLength = rangesFound[i].firstIndex - startIndex; if(precedingGapLength > 0) { result.push(new Templating.Range(startIndex, startIndex + precedingGapLength - 1, text.substring(startIndex, startIndex + precedingGapLength), false, false, "text")); } startIndex = rangesFound[i].lastIndex + 1; } if(startIndex < text.length - 1) { result.push(new Templating.Range(startIndex, text.length - 1, text.substring(startIndex, text.length), false, false, "text")); } return result; }; return RangeFinder; })(); Templating.RangeFinder = RangeFinder; })(Common.Templating || (Common.Templating = {})); var Templating = Common.Templating; })(Common || (Common = {})); //@ sourceMappingURL=rangeFinder.js.map // block.ts var Common; (function (Common) { (function (Templating) { var Block = (function () { function Block() { this.blocks = []; } Block.prototype.addBlock = function (block) { this.blocks.push(block); }; Block.prototype.process = function (obj) { return ""; }; return Block; })(); Templating.Block = Block; })(Common.Templating || (Common.Templating = {})); var Templating = Common.Templating; })(Common || (Common = {})); //@ sourceMappingURL=block.js.map // ifBlock.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var Common; (function (Common) { (function (Templating) { var IfBlock = (function (_super) { __extends(IfBlock, _super); function IfBlock(range, text) { _super.call(this); this._negate = false; this._decisionVariable = range.content; if(this._decisionVariable[0] == '!') { this._negate = true; this._decisionVariable = this._decisionVariable.substr(1); } this.containerType = "if"; } IfBlock.prototype.process = function (obj) { var result = ""; var decisionValue = obj[this._decisionVariable]; if(typeof decisionValue === "function") { var decisionFunction = decisionValue; decisionValue = decisionFunction.call(obj); } if(this._negate) { decisionValue = !decisionValue; } if(decisionValue) { for(var i = 0; i < this.blocks.length; i++) { result = result + this.blocks[i].process(obj); } } return result; }; return IfBlock; })(Templating.Block); Templating.IfBlock = IfBlock; })(Common.Templating || (Common.Templating = {})); var Templating = Common.Templating; })(Common || (Common = {})); //@ sourceMappingURL=ifBlock.js.map // forEachBlock.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var Common; (function (Common) { (function (Templating) { var ForEachBlock = (function (_super) { __extends(ForEachBlock, _super); function ForEachBlock(range, text) { _super.call(this); this._iterationVariable = range.content; this.containerType = "forEach"; } ForEachBlock.prototype.process = function (obj) { var result = ""; var collection = obj[this._iterationVariable]; var i, j; for(i = 0; i < collection.length; i++) { var item = collection[i]; for(j = 0; j < this.blocks.length; j++) { result = result + this.blocks[j].process(item); } } return result; }; return ForEachBlock; })(Templating.Block); Templating.ForEachBlock = ForEachBlock; })(Common.Templating || (Common.Templating = {})); var Templating = Common.Templating; })(Common || (Common = {})); //@ sourceMappingURL=forEachBlock.js.map // textBlock.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var Common; (function (Common) { (function (Templating) { var TextBlock = (function (_super) { __extends(TextBlock, _super); function TextBlock(range) { _super.call(this); this._text = range.content; this.containerType = "text"; } TextBlock._delimiterRegex = /%%[$a-zA-Z_][$a-zA-Z0-9_]*(\.[$a-zA-Z_][$a-zA-Z0-9_]*)*%%/; TextBlock._gtRegex = />/g; TextBlock._ltRegex = /= newList.length) { this._deleteCallback(oldList[oldIndex++]); } else if(oldIndex >= oldList.length) { this._insertBeforeCallback(newList[newIndex++], oldIndex < oldList.length ? oldList[oldIndex] : null); } else if(newList[newIndex][this._idPropertyName] === oldList[oldIndex][this._idPropertyName]) { if(this._isChanged(newList[newIndex], oldList[oldIndex])) { this._updateCallback(newList[newIndex], oldList[oldIndex]); if(this._clearDirtyFlag) { this._clearDirtyFlag(newList[newIndex]); } } newIndex++; oldIndex++; } else if(newList[newIndex][this._sortPropertyName] > oldList[oldIndex][this._sortPropertyName]) { this._deleteCallback(oldList[oldIndex++]); } else { this._insertBeforeCallback(newList[newIndex++], oldList[oldIndex]); } } }; return ListReconciler; })(); ModelView.ListReconciler = ListReconciler; })(Common.ModelView || (Common.ModelView = {})); var ModelView = Common.ModelView; })(Common || (Common = {})); //@ sourceMappingURL=listReconciler.js.map // reconcilingListView.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var Common; (function (Common) { (function (ModelView) { var ReconcilingListView = (function (_super) { __extends(ReconcilingListView, _super); function ReconcilingListView(htmlElementSource, listViewDivId, defaultItemTemplateId, model, alternateTemplates, localizer, _idPropertyName, _sortPropertyName, isChanged, clearDirtyFlag) { _super.call(this, htmlElementSource, listViewDivId, defaultItemTemplateId, model, alternateTemplates, localizer); this.htmlElementSource = htmlElementSource; this.listViewDivId = listViewDivId; this._idPropertyName = _idPropertyName; this._sortPropertyName = _sortPropertyName; this.objectsPreviouslyRendered = []; if(this._idPropertyName && this._sortPropertyName) { this.listReconciler = new ModelView.ListReconciler(_idPropertyName, _sortPropertyName, this.insertBefore.bind(this), this.update.bind(this), this.deleteItem.bind(this), isChanged, clearDirtyFlag); } } ReconcilingListView._listItemClassName = "BPT-List-Item"; ReconcilingListView.prototype.renderView = function () { if(!this.listReconciler) { _super.prototype.renderView.call(this); return; } this.preViewProcessing(); this.listReconciler.reconcile(this.objectsPreviouslyRendered, this.model.cache); this.objectsPreviouslyRendered = this.model.cache; this.postViewProcessing(); if(this.renderViewCallback) { this.renderViewCallback(); } }; ReconcilingListView.prototype.insertBefore = function (newThing, insertBefore) { var newElement = this.renderItem(newThing, ReconcilingListView._listItemClassName); if(!insertBefore) { this.listRoot.appendChild(newElement); return; } var insertBeforeElement = this.listRoot.querySelector("#" + insertBefore[this._idPropertyName]); if(insertBeforeElement) { this.listRoot.insertBefore(newElement, insertBeforeElement); } else { this.listRoot.appendChild(newElement); } }; ReconcilingListView.prototype.update = function (newThing, oldThing) { var oldElement = this.listRoot.querySelector("#" + oldThing[this._idPropertyName]); var newElementText = this.renderItemText(newThing); oldElement.outerHTML = newElementText; oldElement.classList.add(ReconcilingListView._listItemClassName); }; ReconcilingListView.prototype.deleteItem = function (thingToDelete) { var oldElement = this.listRoot.querySelector("#" + thingToDelete[this._idPropertyName]); oldElement.removeNode(true); }; ReconcilingListView.prototype.clearView = function () { _super.prototype.clearView.call(this); this.objectsPreviouslyRendered = []; }; return ReconcilingListView; })(ModelView.ListView); ModelView.ReconcilingListView = ReconcilingListView; })(Common.ModelView || (Common.ModelView = {})); var ModelView = Common.ModelView; })(Common || (Common = {})); //@ sourceMappingURL=reconcilingListView.js.map // control.ts var Common; (function (Common) { (function (Controls) { var Control = (function () { function Control(root) { this._rootElement = root; if(typeof this._rootElement === "undefined") { this._rootElement = document.createElement("div"); this._rootElement.style.width = this._rootElement.style.height = "100%"; } else if(this._rootElement === null) { throw new Error("Invalid root element for Control."); } } Control.prototype.appendChild = function (child) { this._rootElement.appendChild(child.rootElement); child.parent = this; }; Control.prototype.removeChild = function (child) { if(child.rootElement.parentElement) { this._rootElement.removeChild(child.rootElement); child.parent = null; } }; Object.defineProperty(Control.prototype, "rootElement", { get: function () { return this._rootElement; }, set: function (newRoot) { if(!newRoot) { throw new Error("Invalid root"); } var oldRoot = this._rootElement; this._rootElement = newRoot; if(oldRoot && oldRoot.parentNode) { oldRoot.parentNode.replaceChild(newRoot, oldRoot); } }, enumerable: true, configurable: true }); Object.defineProperty(Control.prototype, "parent", { get: function () { return this._parent; }, set: function (newParent) { if(this._parent !== newParent) { this._parent = newParent; if(this._parent && !this._parent.rootElement.contains(this._rootElement)) { this._parent.appendChild(this); } this.onParentChanged(); } }, enumerable: true, configurable: true }); Control.prototype.onParentChanged = function () { }; return Control; })(); Controls.Control = Control; })(Common.Controls || (Common.Controls = {})); var Controls = Common.Controls; })(Common || (Common = {})); //@ sourceMappingURL=control.js.map // templateControl.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var Common; (function (Common) { (function (Controls) { var TemplateControl = (function (_super) { __extends(TemplateControl, _super); function TemplateControl(templateName) { _super.call(this); this._idPostfix = TemplateControl._globalIdPostfix++; if(templateName) { this.setTemplateFromName(templateName); } } TemplateControl._globalIdPostfix = 1; TemplateControl.prototype.setTemplateFromName = function (templateName) { var root = this.getTemplateElementCopy(templateName); this.adjustElementIds(root); this.rootElement = root; }; TemplateControl.prototype.setTemplateFromHTML = function (htmlContent) { var root = this.getTemplateElementFromHTML(htmlContent); this.adjustElementIds(root); this.rootElement = root; }; TemplateControl.prototype.findElement = function (id) { var fullId = id + this._idPostfix; return this.forAllSelfAndDescendants(this.rootElement, function (elem) { if(elem.id && elem.id === fullId) { return false; } return true; }); }; TemplateControl.prototype.getTemplateElementCopy = function (templateName) { var templateElement = document.getElementById(templateName); if(!templateElement) { throw new Error("Couldn't find the template with name: " + templateName); } if(templateElement.tagName.toLowerCase() !== "script") { throw new Error("Expecting the template container to be a script element."); } return this.getTemplateElementFromHTML(templateElement.innerHTML); }; TemplateControl.prototype.getTemplateElementFromHTML = function (htmlContent) { var root = this.getTemplateRootElement(); root.innerHTML = htmlContent; if(root.childElementCount === 1) { root = root.firstElementChild; } return root; }; TemplateControl.prototype.getTemplateRootElement = function () { var div = document.createElement("div"); div.style.width = div.style.height = "100%"; return div; }; TemplateControl.prototype.adjustElementIds = function (root) { var idPostfix = this._idPostfix; this.forAllSelfAndDescendants(root, function (elem) { if(elem.id) { elem.id = elem.id + idPostfix; } return true; }); }; TemplateControl.prototype.forAllSelfAndDescendants = function (root, func) { var brokeAtElement = null; if(!func(root)) { brokeAtElement = root; } else { if(root.children) { var children = root.children; var childrenLength = children.length; for(var i = 0; i < childrenLength; i++) { brokeAtElement = this.forAllSelfAndDescendants(children[i], func); if(brokeAtElement) { break; } } } } return brokeAtElement; }; return TemplateControl; })(Controls.Control); Controls.TemplateControl = TemplateControl; })(Common.Controls || (Common.Controls = {})); var Controls = Common.Controls; })(Common || (Common = {})); //@ sourceMappingURL=templateControl.js.map // listBox.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var Common; (function (Common) { (function (Controls) { var ListBoxItem = (function () { function ListBoxItem(value, text, info, itemClass) { this.index = -1; this.value = value; this.text = text; this.info = info || ""; this.itemClass = itemClass || ""; } return ListBoxItem; })(); Controls.ListBoxItem = ListBoxItem; var ListBox = (function (_super) { __extends(ListBox, _super); function ListBox(templateName, listItemElementType) { var _this = this; _super.call(this, templateName); if(!templateName) { this.setTemplateFromHTML("
    "); } this.rootElement.setAttribute("tabindex", "0"); this.rootElement.setAttribute("role", "listbox"); this.rootElement.onkeydown = function (e) { return _this.onKeyDown(e); }; this._listItemElementType = listItemElementType || "li"; this._listItemContainers = []; this._selectedIndex = -1; if(!this.rootElement.id) { this.rootElement.id = this.rootElement.uniqueID; } } Object.defineProperty(ListBox.prototype, "selectedItemChanged", { get: function () { return this._onSelectedItemChanged; }, set: function (value) { this._onSelectedItemChanged = value; }, enumerable: true, configurable: true }); Object.defineProperty(ListBox.prototype, "selectedIndexChanged", { get: function () { return this._onSelectedIndexChanged; }, set: function (value) { this._onSelectedIndexChanged = value; }, enumerable: true, configurable: true }); Object.defineProperty(ListBox.prototype, "itemDoubleClicked", { get: function () { return this._onItemDoubleClicked; }, set: function (value) { this._onItemDoubleClicked = value; }, enumerable: true, configurable: true }); Object.defineProperty(ListBox.prototype, "listItems", { get: function () { return this._listItems; }, set: function (value) { this.fireBuildListBoxStartEvent(); this.resetItems(); if(value) { for(var i = 0; i < value.length; ++i) { var item = value[i]; item.index = i; this._listItems.push(item); if(i < this._listItemContainers.length) { this._listItemContainers[i].item = item; this._listItemContainers[i].rootElement.style.display = "list-item"; this._listItemContainers[i].rootElement.removeAttribute("aria-hidden"); } else { var itemContainer = this.createListItemContainer(item); this._listItemContainers.push(itemContainer); this.appendChild(itemContainer); } } } this.fireBuildListBoxEndEvent(); }, enumerable: true, configurable: true }); Object.defineProperty(ListBox.prototype, "itemContainers", { get: function () { return this._listItemContainers; }, enumerable: true, configurable: true }); Object.defineProperty(ListBox.prototype, "selectedIndex", { get: function () { return this._selectedIndex; }, set: function (value) { if(this._selectedIndex !== value) { var oldIdx = this._selectedIndex; this._selectedIndex = value; if(oldIdx >= 0) { var oldItem = this._listItemContainers[oldIdx]; oldItem.selected = false; } if(value >= 0 && value < this._listItemContainers.length) { var newItem = this._listItemContainers[value]; newItem.selected = true; if(value != oldIdx) { if(this._onSelectedIndexChanged) { this._onSelectedIndexChanged(value); } if(this._onSelectedItemChanged) { this._onSelectedItemChanged(this._listItems[value]); } } } } }, enumerable: true, configurable: true }); Object.defineProperty(ListBox.prototype, "selectedItem", { get: function () { var i = this.selectedIndex; if(i >= 0) { return this._listItems[i]; } return null; }, set: function (value) { var oldIdx = this.selectedIndex; var newIdx = this._listItems.indexOf(value); this.selectedIndex = newIdx; }, enumerable: true, configurable: true }); ListBox.prototype.scrollIntoView = function (item, alignToTop) { var index = this._listItems.indexOf(item); if(index >= 0) { var itemElement = this._listItemContainers[index].rootElement; var rect = itemElement.getBoundingClientRect(); var topLeftCornerElement = document.elementFromPoint(rect.left + 1, rect.top + 1); var bottomRightCornerElement = document.elementFromPoint(rect.right - 1, rect.bottom - 1); if(topLeftCornerElement != itemElement || bottomRightCornerElement != itemElement) { this._listItemContainers[index].rootElement.scrollIntoView(alignToTop); } } }; ListBox.prototype.createListItemContainer = function (item) { return new ListBoxItemContainer(this, item, this._listItemElementType); }; ListBox.prototype.fireBuildListBoxStartEvent = function () { }; ListBox.prototype.fireBuildListBoxEndEvent = function () { }; ListBox.prototype.fireResetListBoxStartEvent = function () { }; ListBox.prototype.fireResetListBoxEndEvent = function () { }; ListBox.prototype.resetItems = function () { this.fireResetListBoxStartEvent(); this.selectedIndex = -1; for(var i = 0; i < this._listItemContainers.length; ++i) { this._listItemContainers[i].item = null; this._listItemContainers[i].rootElement.style.display = "none"; this._listItemContainers[i].rootElement.setAttribute("aria-hidden", "true"); } this._listItems = []; this.fireResetListBoxEndEvent(); }; ListBox.prototype.onKeyDown = function (e) { var noKeys = !event.shiftKey && !event.ctrlKey && !event.altKey; if(e.keyCode === Common.KeyCodes.ARROW_UP && noKeys) { if(this.selectedIndex > 0) { this.selectedIndex--; this.scrollIntoView(this.selectedItem, true); } } else if(e.keyCode === Common.KeyCodes.ARROW_DOWN && noKeys) { if(this.selectedIndex < (this._listItemContainers.length - 1)) { this.selectedIndex++; this.scrollIntoView(this.selectedItem, false); } } }; return ListBox; })(Controls.TemplateControl); Controls.ListBox = ListBox; var ListBoxItemContainer = (function (_super) { __extends(ListBoxItemContainer, _super); function ListBoxItemContainer(owner, item, elementType) { var _this = this; _super.call(this, document.createElement(elementType)); this._owner = owner; this._item = item; this.rootElement.innerText = item.text; (this.rootElement).value = item.value; if(item.itemClass && item.itemClass.length > 0) { this.rootElement.classList.add(item.itemClass); } this.rootElement.title = item.info; this.rootElement.setAttribute("role", "option"); this.rootElement.onmousedown = function (e) { return _this.onMouseDown(e); }; this.rootElement.onclick = function (e) { return _this.onMouseDown(e); }; this.rootElement.ondblclick = function (e) { return _this.onDoubleClicked(e); }; if(!this.rootElement.getAttribute("id")) { this.rootElement.setAttribute("id", this.rootElement.uniqueID); } } ListBoxItemContainer.CONTENT_ELEMENT_ID = "content"; Object.defineProperty(ListBoxItemContainer.prototype, "selectedChanged", { get: function () { return this._onSelectChanged; }, set: function (value) { this._onSelectChanged = value; }, enumerable: true, configurable: true }); Object.defineProperty(ListBoxItemContainer.prototype, "selected", { get: function () { return this._selected; }, set: function (value) { var selectedChanged = value !== this._selected; this._selected = value; if(selectedChanged) { if(value) { this.rootElement.setAttribute("selected", "selected"); this.rootElement.setAttribute("aria-selected", "true"); this._owner.selectedItem = this._item; } else { this.rootElement.removeAttribute("selected"); this.rootElement.removeAttribute("aria-selected"); } } if(this._onSelectChanged && selectedChanged) { this._onSelectChanged(value); } }, enumerable: true, configurable: true }); Object.defineProperty(ListBoxItemContainer.prototype, "item", { get: function () { return this._item; }, set: function (value) { if(value) { this._item = value; this.rootElement.innerText = this._item.text; this.rootElement.title = this._item.info; this.rootElement.setAttribute("aria-label", this._item.text); } else { this._item = null; this.rootElement.innerText = ""; this.rootElement.title = ""; this.rootElement.removeAttribute("aria-label"); } }, enumerable: true, configurable: true }); ListBoxItemContainer.prototype.onMouseDown = function (e) { this.selected = true; this._owner.rootElement.focus(); }; ListBoxItemContainer.prototype.onDoubleClicked = function (e) { this.selected = true; this._owner.rootElement.focus(); if(this._owner.itemDoubleClicked) { this._owner.itemDoubleClicked(this._item); } }; return ListBoxItemContainer; })(Controls.Control); Controls.ListBoxItemContainer = ListBoxItemContainer; })(Common.Controls || (Common.Controls = {})); var Controls = Common.Controls; })(Common || (Common = {})); //@ sourceMappingURL=listBox.js.map // choiceCommitSource.ts var Common; (function (Common) { (function (Intellisense) { (function (ChoiceCommitSource) { ChoiceCommitSource._map = []; ChoiceCommitSource._map[0] = "Tab"; ChoiceCommitSource.Tab = 0; ChoiceCommitSource._map[1] = "Enter"; ChoiceCommitSource.Enter = 1; ChoiceCommitSource._map[2] = "DoubleClick"; ChoiceCommitSource.DoubleClick = 2; })(Intellisense.ChoiceCommitSource || (Intellisense.ChoiceCommitSource = {})); var ChoiceCommitSource = Intellisense.ChoiceCommitSource; })(Common.Intellisense || (Common.Intellisense = {})); var Intellisense = Common.Intellisense; })(Common || (Common = {})); //@ sourceMappingURL=choiceCommitSource.js.map // intellisenseListBox.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var Common; (function (Common) { (function (Intellisense) { var IntellisenseChoice = (function (_super) { __extends(IntellisenseChoice, _super); function IntellisenseChoice(optionName, info) { _super.call(this, optionName, optionName, info); } Object.defineProperty(IntellisenseChoice.prototype, "optionName", { get: function () { return this.text; }, enumerable: true, configurable: true }); return IntellisenseChoice; })(Common.Controls.ListBoxItem); Intellisense.IntellisenseChoice = IntellisenseChoice; var IntellisenseListBox = (function (_super) { __extends(IntellisenseListBox, _super); function IntellisenseListBox(templateName, listItemTemplateName, traceProvider) { var _this = this; _super.call(this, templateName, listItemTemplateName); this.itemDoubleClicked = function (item) { return _this.optionDoubleClicked(item); }; this._traceProvider = traceProvider; } Object.defineProperty(IntellisenseListBox.prototype, "intellisenseChoiceSelected", { get: function () { return this._intellisenseChoiceSelected; }, set: function (value) { this._intellisenseChoiceSelected = value; }, enumerable: true, configurable: true }); IntellisenseListBox.prototype.optionDoubleClicked = function (intellisenseChoice) { if(this._intellisenseChoiceSelected) { this._intellisenseChoiceSelected(intellisenseChoice, Intellisense.ChoiceCommitSource.DoubleClick); } }; IntellisenseListBox.prototype.fireBuildListBoxStartEvent = function () { if(this._traceProvider) { this._traceProvider.fireBuildListBoxStartEvent(); } }; IntellisenseListBox.prototype.fireBuildListBoxEndEvent = function () { if(this._traceProvider) { this._traceProvider.fireBuildListBoxEndEvent(); } }; IntellisenseListBox.prototype.fireResetListBoxStartEvent = function () { if(this._traceProvider) { this._traceProvider.fireResetListBoxStartEvent(); } }; IntellisenseListBox.prototype.fireResetListBoxEndEvent = function () { if(this._traceProvider) { this._traceProvider.fireResetListBoxEndEvent(); } }; return IntellisenseListBox; })(Common.Controls.ListBox); Intellisense.IntellisenseListBox = IntellisenseListBox; })(Common.Intellisense || (Common.Intellisense = {})); var Intellisense = Common.Intellisense; })(Common || (Common = {})); //@ sourceMappingURL=intellisenseListBox.js.map // IntellisenseContext.ts var Common; (function (Common) { (function (Intellisense) { var IntellisenseContext = (function () { function IntellisenseContext(textEditorBridge, intellisenseMenu, intellisenseProvider, events) { this._textEditorBridge = textEditorBridge; this._intellisenseMenu = intellisenseMenu; this._intellisenseProvider = intellisenseProvider; this._isInitialized = false; this._deactivationHandler = this.uninitialize.bind(this); this._events = events; if(this._events) { this._events.addEventListener("deactivated", this._deactivationHandler); } } Object.defineProperty(IntellisenseContext.prototype, "textEditorBridge", { get: function () { return this._textEditorBridge; }, enumerable: true, configurable: true }); Object.defineProperty(IntellisenseContext.prototype, "intellisenseMenu", { get: function () { return this._intellisenseMenu; }, enumerable: true, configurable: true }); Object.defineProperty(IntellisenseContext.prototype, "intellisenseProvider", { get: function () { return this._intellisenseProvider; }, enumerable: true, configurable: true }); IntellisenseContext.prototype.initialize = function (target) { if(this._isInitialized) { return; } this.textEditorBridge.attach(target); this.intellisenseMenu.attach(this.textEditorBridge); this.intellisenseProvider.attach(this); this._isInitialized = true; }; IntellisenseContext.prototype.uninitialize = function () { if(!this._isInitialized) { return; } this._isInitialized = false; if(this._events) { this._events.removeEventListener("deactivated", this._deactivationHandler); } this.intellisenseProvider.detach(); this.intellisenseMenu.detach(); this.textEditorBridge.detach(); }; return IntellisenseContext; })(); Intellisense.IntellisenseContext = IntellisenseContext; })(Common.Intellisense || (Common.Intellisense = {})); var Intellisense = Common.Intellisense; })(Common || (Common = {})); //@ sourceMappingURL=IntellisenseContext.js.map // inputElementTextEditorBridge.ts var Common; (function (Common) { (function (Intellisense) { var InputElementTextEditorBridge = (function () { function InputElementTextEditorBridge() { var _this = this; this._lastSelectionLength = -1; this._lastCaretPosition = -1; this._timerFunction = function () { return _this.timer_elapsed(); }; } InputElementTextEditorBridge.TIMER_INTERVAL = 100; Object.defineProperty(InputElementTextEditorBridge.prototype, "onTextChanged", { get: function () { return this._onTextChanged; }, set: function (value) { this._onTextChanged = value; }, enumerable: true, configurable: true }); Object.defineProperty(InputElementTextEditorBridge.prototype, "onCaptureKeyDown", { get: function () { return this._onCaptureKeyDown; }, set: function (value) { this._onCaptureKeyDown = value; }, enumerable: true, configurable: true }); Object.defineProperty(InputElementTextEditorBridge.prototype, "onBlur", { get: function () { return this._onBlur; }, set: function (value) { this._onBlur = value; }, enumerable: true, configurable: true }); Object.defineProperty(InputElementTextEditorBridge.prototype, "onCaretPositionChanged", { get: function () { return this._onCaretPositionChanged; }, set: function (value) { this._onCaretPositionChanged = value; }, enumerable: true, configurable: true }); Object.defineProperty(InputElementTextEditorBridge.prototype, "onSelectionLengthChanged", { get: function () { return this._onSelectionLengthChanged; }, set: function (value) { this._onSelectionLengthChanged = value; }, enumerable: true, configurable: true }); Object.defineProperty(InputElementTextEditorBridge.prototype, "onMenuRequested", { get: function () { return this._onMenuRequested; }, set: function (value) { this._onMenuRequested = value; }, enumerable: true, configurable: true }); Object.defineProperty(InputElementTextEditorBridge.prototype, "caretPosition", { get: function () { if(this._editor) { return this._editor.selectionEnd; } return -1; }, set: function (value) { if(this._editor) { var valueChanged = this.caretPosition != value; this._editor.setSelectionRange(value, value); if(valueChanged) { this.fireCaretPositionChanged(); } } }, enumerable: true, configurable: true }); Object.defineProperty(InputElementTextEditorBridge.prototype, "selectionLength", { get: function () { if(this._editor) { return this._editor.selectionEnd - this._editor.selectionStart; } return -1; }, set: function (value) { if(this._editor) { this._editor.setSelectionRange(this._editor.selectionStart, this._editor.selectionStart + value); var valueChanged = this._lastSelectionLength != this.selectionLength; this._lastSelectionLength = this.selectionLength; if(valueChanged) { this.fireSelectionLengthChanged(); } } }, enumerable: true, configurable: true }); Object.defineProperty(InputElementTextEditorBridge.prototype, "text", { get: function () { if(this._editor) { return this._editor.value; } return null; }, set: function (value) { if(this._editor) { this._editor.value = value; } }, enumerable: true, configurable: true }); InputElementTextEditorBridge.prototype.attach = function (textEditor) { var _this = this; this._editor = InputElementTextEditorBridge.validateTextEditorElement(textEditor); if(this._editor) { this._isAttached = true; this._inputHandler = function (event) { _this.editor_input(event); }; this._editor.addEventListener("input", this._inputHandler); this._blurHandler = function (focusEvent) { _this.editor_blur(focusEvent); }; this._editor.addEventListener("blur", this._blurHandler); this._focusHandler = function (focusEvent) { _this.editor_focus(focusEvent); }; this._editor.addEventListener("focus", this._focusHandler); this._captureKeyDownHandler = function (e) { _this.editor_captureKeyDown(e); }; this._editor.addEventListener("keydown", this._captureKeyDownHandler, true); this._editor.setAttribute("aria-autocomplete", "list"); this._editor.setAttribute("aria-haspopup", "true"); if(document.activeElement === this._editor) { this.startTimer(); } return true; } return false; }; InputElementTextEditorBridge.prototype.detach = function () { if(!this._isAttached) { return; } this._isAttached = false; if(this._editor) { this._editor.onselect = null; this._editor.removeEventListener("input", this._inputHandler); this._editor.removeEventListener("blur", this._blurHandler); this._editor.removeEventListener("focus", this._focusHandler); this._editor.removeEventListener("keydown", this._captureKeyDownHandler, true); this._inputHandler = null; this._blurHandler = null; this._focusHandler = null; this._captureKeyDownHandler = null; this._editor.removeAttribute("aria-autocomplete"); this._editor.removeAttribute("aria-haspopup"); this._editor = null; } this.fireOnBlur(); }; InputElementTextEditorBridge.prototype.insertText = function (startPos, endPos, text) { var range = this._editor.createTextRange(); var useUndo = range.queryCommandSupported("ms-beginUndoUnit"); if(useUndo) { range.execCommand("ms-beginUndoUnit"); } range.move("character", startPos); range.moveEnd("character", endPos - startPos); range.text = text; if(useUndo) { range.execCommand("ms-endUndoUnit"); } }; InputElementTextEditorBridge.prototype.setActiveDescendant = function (id) { if(id) { this._editor.setAttribute("aria-activedescendant", id); } else { this._editor.removeAttribute("aria-activedescendant"); } }; InputElementTextEditorBridge.prototype.setListBox = function (id) { if(id) { this._editor.setAttribute("aria-controls", id); } else { this._editor.removeAttribute("aria-controls"); } }; Object.defineProperty(InputElementTextEditorBridge.prototype, "placementTarget", { get: function () { if(this._editor) { var range = this._editor.createTextRange(); range.move("textedit", -1); range.move("character", this.caretPosition); return range.getBoundingClientRect(); } return null; }, enumerable: true, configurable: true }); InputElementTextEditorBridge.prototype.focusEditor = function () { this._editor.focus(); }; InputElementTextEditorBridge.validateTextEditorElement = function validateTextEditorElement(textEditor) { var textEditorElement = textEditor; var textEditorInterface = textEditorElement; if(typeof (textEditorInterface.createTextRange) === "undefined" || typeof (textEditorInterface.selectionStart) === "undefined" || typeof (textEditorInterface.selectionEnd) === "undefined" || typeof (textEditorInterface.setSelectionRange) === "undefined" || typeof (textEditorInterface.value) === "undefined") { return null; } return textEditorElement; }; InputElementTextEditorBridge.prototype.startTimer = function () { if(!this._timerActivated) { this._timerId = window.setInterval(this._timerFunction, InputElementTextEditorBridge.TIMER_INTERVAL); this._timerActivated = true; } }; InputElementTextEditorBridge.prototype.resetTimer = function () { if(this._timerActivated) { this.stopTimer(); this.startTimer(); } }; InputElementTextEditorBridge.prototype.stopTimer = function () { if(this._timerActivated) { this._timerActivated = false; window.clearInterval(this._timerId); } }; InputElementTextEditorBridge.prototype.timer_elapsed = function () { if(this._lastCaretPosition != this.caretPosition || this._lastSelectionLength != this.selectionLength) { this.stopTimer(); if(this._isAttached) { if(this._lastCaretPosition != this.caretPosition) { this.fireCaretPositionChanged(); this._lastCaretPosition = this.caretPosition; } if(this._lastSelectionLength != this.selectionLength) { this.fireSelectionLengthChanged(); this._lastSelectionLength = this.selectionLength; } } this.startTimer(); } }; InputElementTextEditorBridge.prototype.editor_input = function (event) { this.fireTextChanged(); }; InputElementTextEditorBridge.prototype.editor_captureKeyDown = function (keyEvent) { if(keyEvent.keyCode === Common.KeyCodes.SPACE && keyEvent.ctrlKey) { this.fireMenuRequested(); keyEvent.preventDefault(); return; } if(this._onCaptureKeyDown) { this._onCaptureKeyDown(keyEvent); } }; InputElementTextEditorBridge.prototype.editor_blur = function (focusEvent) { this.fireOnBlur(); }; InputElementTextEditorBridge.prototype.editor_focus = function (focusEvent) { this.startTimer(); }; InputElementTextEditorBridge.prototype.fireOnBlur = function () { this.stopTimer(); if(this._onBlur) { this._onBlur(); } }; InputElementTextEditorBridge.prototype.fireTextChanged = function () { this._lastCaretPosition = this.caretPosition; if(this._onTextChanged) { this._onTextChanged(this._editor.value); } this.resetTimer(); }; InputElementTextEditorBridge.prototype.fireCaretPositionChanged = function () { if(this._onCaretPositionChanged) { this._onCaretPositionChanged(this.caretPosition); } }; InputElementTextEditorBridge.prototype.fireSelectionLengthChanged = function () { if(this._onSelectionLengthChanged) { this._onSelectionLengthChanged(this.selectionLength); } }; InputElementTextEditorBridge.prototype.fireMenuRequested = function () { if(this._onMenuRequested) { this._onMenuRequested(); } }; return InputElementTextEditorBridge; })(); Intellisense.InputElementTextEditorBridge = InputElementTextEditorBridge; })(Common.Intellisense || (Common.Intellisense = {})); var Intellisense = Common.Intellisense; })(Common || (Common = {})); //@ sourceMappingURL=inputElementTextEditorBridge.js.map // intellisenseMenu.ts var Common; (function (Common) { (function (Intellisense) { var IntellisenseMenu = (function () { function IntellisenseMenu(listBoxTemplateName, listItemElementType, maxMenuItems, autoSuppressMenu, menuTraceProvider, listBoxTraceProvider) { this._listBox = new Intellisense.IntellisenseListBox(listBoxTemplateName, listItemElementType, listBoxTraceProvider); this._listBox.rootElement.style.display = "none"; this._isAttached = false; this._isDeferringLayout = false; this._suppressMenu = false; this._alreadyForcedOpen = false; this._ignoreCommit = false; this._willMenuBeOpen = false; if(maxMenuItems) { this._maxMenuItems = maxMenuItems; } else { this._maxMenuItems = IntellisenseMenu.MAX_MENU_ITEMS; } this._autoSuppressMenuEnabled = autoSuppressMenu ? true : false; this._traceProvider = menuTraceProvider; } IntellisenseMenu.MAX_MENU_HEIGHT = 300; IntellisenseMenu.MIN_MENU_WIDTH = 200; IntellisenseMenu.MAX_MENU_ITEMS = 50; IntellisenseMenu.DEFERRED_RENDER_TIMER_INTERVAL = 200; Object.defineProperty(IntellisenseMenu.prototype, "isOpen", { get: function () { return this._isAttached; }, set: function (value) { if(value !== this.isOpen) { if(value && !this.suppressMenu) { this._willMenuBeOpen = true; this.show(); } else { this._willMenuBeOpen = false; this.hide(); this._alreadyForcedOpen = false; } } }, enumerable: true, configurable: true }); IntellisenseMenu.prototype.forceOpen = function () { if(this._filteredOptions && this._filteredOptions.length > 0) { this.suppressMenu = false; this.isOpen = true; this._listBox.listItems = this._filteredOptions; this.isDeferringLayout = false; this.updateLayout(!this._alreadyForcedOpen); this.updateListBoxSelection(); this._alreadyForcedOpen = true; } }; Object.defineProperty(IntellisenseMenu.prototype, "hasSelection", { get: function () { return this.isOpen && !this.isDeferringLayout && !this._ignoreCommit && this._selectedOption != null; }, enumerable: true, configurable: true }); Object.defineProperty(IntellisenseMenu.prototype, "currentSelection", { get: function () { return this._selectedOption; }, enumerable: true, configurable: true }); Object.defineProperty(IntellisenseMenu.prototype, "intellisenseChoices", { get: function () { if(this._listBox) { return this._options; } return []; }, set: function (value) { this._options = value; this._filteredOptions = value; this._selectedOption = null; this._listBox.listItems = null; }, enumerable: true, configurable: true }); Object.defineProperty(IntellisenseMenu.prototype, "filteredIntellisenseChoices", { get: function () { return this._filteredOptions; }, enumerable: true, configurable: true }); Object.defineProperty(IntellisenseMenu.prototype, "willIntellisenseMenuBeOpen", { get: function () { return this._willMenuBeOpen; }, enumerable: true, configurable: true }); Object.defineProperty(IntellisenseMenu.prototype, "menuListBox", { get: function () { return this._listBox; }, enumerable: true, configurable: true }); Object.defineProperty(IntellisenseMenu.prototype, "onClosing", { get: function () { return this._onClosing; }, set: function (value) { this._onClosing = value; }, enumerable: true, configurable: true }); Object.defineProperty(IntellisenseMenu.prototype, "onOpened", { get: function () { return this._onOpened; }, set: function (value) { this._onOpened = value; }, enumerable: true, configurable: true }); Object.defineProperty(IntellisenseMenu.prototype, "onChoiceCommitted", { get: function () { return this._onChoiceCommitted; }, set: function (value) { this._onChoiceCommitted = value; }, enumerable: true, configurable: true }); Object.defineProperty(IntellisenseMenu.prototype, "onSelectionChanged", { get: function () { return this._onSelectionChanged; }, set: function (value) { this._onSelectionChanged = value; }, enumerable: true, configurable: true }); IntellisenseMenu.prototype.attach = function (textEditorBridge) { var _this = this; if(!this._textEditorBridge) { document.body.appendChild(this._listBox.rootElement); this._textEditorBridge = textEditorBridge; this._textEditorBridge.onBlur = function () { return _this.textEditorBridge_blur(); }; } this._textEditorBridge.setListBox(this._listBox.rootElement.id); }; IntellisenseMenu.prototype.detach = function () { if(this._textEditorBridge) { this.isOpen = false; this._textEditorBridge.onBlur = null; this._textEditorBridge.setListBox(null); this._textEditorBridge = null; document.body.removeChild(this._listBox.rootElement); } }; IntellisenseMenu.prototype.setFilter = function (filter) { var _this = this; this.fireSetFilterStartEvent(); this._selectedOption = this.setFilterInternal(filter); this.fireSetFilterEndEvent(); if(this._filteredOptions.length > this._maxMenuItems) { this._willMenuBeOpen = true; this.isDeferringLayout = true; return; } else if(this._filteredOptions.length == 1 && this._selectedOption && this._selectedOption.text == filter) { this._willMenuBeOpen = false; window.setImmediate(function () { return _this.isOpen = false; }); return; } this._willMenuBeOpen = true; this._listBox.listItems = this._filteredOptions; this.updateLayout(this.isDeferringLayout); this.isDeferringLayout = false; this.updateListBoxSelection(); }; Object.defineProperty(IntellisenseMenu.prototype, "suppressMenu", { get: function () { return this._suppressMenu && this._autoSuppressMenuEnabled; }, set: function (value) { this._suppressMenu = value; }, enumerable: true, configurable: true }); Object.defineProperty(IntellisenseMenu.prototype, "isDeferringLayout", { get: function () { return this._isDeferringLayout; }, set: function (value) { if(value) { this.stopDeferredRenderTimer(); this.startDeferredRenderTimer(); } else { this.stopDeferredRenderTimer(); } }, enumerable: true, configurable: true }); IntellisenseMenu.prototype.startDeferredRenderTimer = function () { var _this = this; if(!this._isDeferringLayout) { this._deferredRenderTimerId = window.setTimeout(function () { return _this.deferredRenderTimer_elapsed(); }, IntellisenseMenu.DEFERRED_RENDER_TIMER_INTERVAL); this._ignoreCommit = true; this._isDeferringLayout = true; } }; IntellisenseMenu.prototype.stopDeferredRenderTimer = function () { if(this._isDeferringLayout) { this._ignoreCommit = false; this._isDeferringLayout = false; window.clearTimeout(this._deferredRenderTimerId); } }; IntellisenseMenu.prototype.deferredRenderTimer_elapsed = function () { var _this = this; this._isDeferringLayout = false; if(this.isOpen) { this.forceOpen(); window.setTimeout(function () { return _this._ignoreCommit = false; }, IntellisenseMenu.DEFERRED_RENDER_TIMER_INTERVAL); } }; IntellisenseMenu.prototype.updateListBoxSelection = function () { if(this._selectedOption) { this._listBox.selectedItem = this._selectedOption; this._listBox.scrollIntoView(this._selectedOption, false); } else if(this._listBox.listItems.length > 0) { this._listBox.selectedIndex = -1; this._listBox.scrollIntoView(this._listBox.listItems[0], false); } }; IntellisenseMenu.prototype.setFilterInternal = function (filter) { if(filter && filter.length > 0 && this._options) { var upperCaseFilter = filter.toUpperCase(); var filteredItems = this._options.filter(function (value, index, array) { return value.optionName.toUpperCase().indexOf(upperCaseFilter) !== -1; }, this); if(filteredItems.length === 0) { filteredItems = this._options.filter(function (value, index, array) { var upperCaseOption = value.optionName.toUpperCase(); return upperCaseOption.indexOf(upperCaseFilter) !== -1 || upperCaseFilter.indexOf(upperCaseOption) === 0; }, this); } if(filteredItems.length > 0) { this._filteredOptions = filteredItems; var matchingOptionIndex = this.getMatchingOption(filteredItems, filter, true); if(matchingOptionIndex < 0) { matchingOptionIndex = this.getMatchingOption(filteredItems, filter, false); if(matchingOptionIndex < 0) { return null; } } return this._filteredOptions[matchingOptionIndex]; } } else { this._filteredOptions = this._options; } return null; }; IntellisenseMenu.prototype.getMatchingOption = function (items, filter, caseSensitive) { var testString = caseSensitive ? filter : filter.toUpperCase(); for(var i = 0; i < items.length; ++i) { var optionName = caseSensitive ? items[i].optionName : items[i].optionName.toUpperCase(); if(optionName.indexOf(testString) == 0) { return i; } } return -1; }; IntellisenseMenu.prototype.textEditorBridge_blur = function () { if(document.activeElement !== this._listBox.rootElement) { this.hide(); } else if(document.activeElement === this._listBox.rootElement) { this._textEditorBridge.focusEditor(); } }; IntellisenseMenu.prototype.updateLayout = function (setHorizontal) { if(!this.isOpen || !this._listBox.listItems || this._listBox.listItems.length == 0) { return; } this.fireUpdateLayoutStartEvent(); var oldLeft = this._listBox.rootElement.style.left; var target = this._textEditorBridge.placementTarget; var x = target.right; var y = target.bottom; this._listBox.rootElement.style.position = "absolute"; this._listBox.rootElement.style.display = "block"; this._listBox.rootElement.style.top = "0"; this._listBox.rootElement.style.left = "0"; this._listBox.rootElement.style.width = ""; this._listBox.rootElement.style.minWidth = IntellisenseMenu.MIN_MENU_WIDTH + "px"; this._listBox.rootElement.style.maxHeight = IntellisenseMenu.MAX_MENU_HEIGHT + "px"; var offsetHeight = this._listBox.rootElement.offsetHeight; var offsetWidth = this._listBox.rootElement.offsetWidth; if(y + IntellisenseMenu.MAX_MENU_HEIGHT < window.innerHeight) { this._listBox.rootElement.style.top = y + "px"; } else { y = target.top - offsetHeight; if(y < 0) { var top = Math.max(target.top - IntellisenseMenu.MAX_MENU_HEIGHT, 0); var maxHeight = target.top - top; this._listBox.rootElement.style.top = top + "px"; this._listBox.rootElement.style.maxHeight = maxHeight + "px"; } else { this._listBox.rootElement.style.top = y + "px"; } } if(x + offsetWidth < window.innerWidth) { this._listBox.rootElement.style.left = x + "px"; } else if(x - offsetWidth > 0) { this._listBox.rootElement.style.left = (x - offsetWidth) + "px"; } else { var left = Math.max(window.innerWidth - offsetWidth, 0); var right = Math.min(left + offsetWidth, window.innerWidth - left); this._listBox.rootElement.style.left = left + "px"; this._listBox.rootElement.style.width = (right - left) + "px"; this._listBox.rootElement.style.minWidth = ""; } if(!setHorizontal) { this._listBox.rootElement.style.left = oldLeft; } if(this._listBox.selectedItem) { this._listBox.scrollIntoView(this._listBox.selectedItem, false); } this.fireUpdateLayoutEndEvent(); }; IntellisenseMenu.prototype.show = function () { var _this = this; if(this._isAttached) { return; } this._isAttached = true; this.suppressMenu = false; this.updateLayout(true); this._listBox.intellisenseChoiceSelected = function (intellisenseChoice, choiceCommitSource) { return _this.listBox_intellisenseChoiceSelected(intellisenseChoice, choiceCommitSource); }; this._listBox.selectedItemChanged = function (newItem) { return _this.listBox_selectedItemChanged(newItem); }; this._textEditorBridge.onCaptureKeyDown = function (keyEvent) { return _this.editor_captureKeyDown(keyEvent); }; this._listBox.rootElement.setAttribute("aria-expanded", "true"); if(this._listBox.selectedItem) { this.listBox_selectedItemChanged(this._listBox.selectedItem); } if(this._onOpened) { this._onOpened(); } }; IntellisenseMenu.prototype.hide = function () { if(!this._isAttached) { return; } this._isAttached = false; if(this._onClosing) { this._onClosing(); } this._textEditorBridge.setActiveDescendant(null); this._listBox.intellisenseChoiceSelected = null; this._listBox.selectedItemChanged = null; this._textEditorBridge.onCaptureKeyDown = null; this._listBox.rootElement.style.display = "none"; this._listBox.rootElement.removeAttribute("aria-expanded"); }; IntellisenseMenu.prototype.listBox_intellisenseChoiceSelected = function (intellisenseChoice, commitSource) { this.fireValueCommitted(intellisenseChoice, commitSource); }; IntellisenseMenu.prototype.listBox_selectedItemChanged = function (newItem) { this._selectedOption = newItem; this._textEditorBridge.setActiveDescendant(this._listBox.itemContainers[newItem.index].rootElement.id); if(this._onSelectionChanged) { this._onSelectionChanged(newItem); } }; IntellisenseMenu.prototype.editor_captureKeyDown = function (keyEvent) { if(this.isDeferringLayout) { return; } if(keyEvent.keyCode == Common.KeyCodes.ARROW_UP) { this._listBox.selectedIndex = this._listBox.selectedIndex <= 0 ? 0 : this._listBox.selectedIndex - 1; this._listBox.scrollIntoView(this._listBox.selectedItem, true); keyEvent.preventDefault(); return; } else if(keyEvent.keyCode == Common.KeyCodes.ARROW_DOWN) { this._listBox.selectedIndex = this._listBox.selectedIndex == this._listBox.listItems.length - 1 ? this._listBox.listItems.length - 1 : this._listBox.selectedIndex + 1; this._listBox.scrollIntoView(this._listBox.selectedItem, false); keyEvent.preventDefault(); return; } else if(keyEvent.keyCode == Common.KeyCodes.ENTER) { if(this.fireSelectedValueCommitted(Intellisense.ChoiceCommitSource.Enter)) { keyEvent.preventDefault(); } return; } else if(keyEvent.keyCode == Common.KeyCodes.TAB) { if(this.fireSelectedValueCommitted(Intellisense.ChoiceCommitSource.Tab)) { keyEvent.preventDefault(); } return; } else if(keyEvent.keyCode == Common.KeyCodes.SPACE) { this.hide(); return; } else if(keyEvent.keyCode == Common.KeyCodes.ESCAPE) { this.hide(); keyEvent.preventDefault(); keyEvent.stopImmediatePropagation(); this.suppressMenu = true; return; } }; IntellisenseMenu.prototype.fireValueCommitted = function (intellisenseChoice, commitSource) { if(this._onChoiceCommitted && intellisenseChoice) { this._onChoiceCommitted(intellisenseChoice, commitSource); return true; } return false; }; IntellisenseMenu.prototype.fireSelectedValueCommitted = function (commitSource) { if(this._listBox && this._listBox.selectedItem !== null) { return this.fireValueCommitted(this._listBox.selectedItem, commitSource); } return false; }; IntellisenseMenu.prototype.fireSetFilterStartEvent = function () { if(this._traceProvider) { this._traceProvider.fireSetFilterStartEvent(); } }; IntellisenseMenu.prototype.fireSetFilterEndEvent = function () { if(this._traceProvider) { this._traceProvider.fireSetFilterEndEvent(); } }; IntellisenseMenu.prototype.fireUpdateLayoutStartEvent = function () { if(this._traceProvider) { this._traceProvider.fireUpdateLayoutStartEvent(); } }; IntellisenseMenu.prototype.fireUpdateLayoutEndEvent = function () { if(this._traceProvider) { this._traceProvider.fireUpdateLayoutEndEvent(); } }; return IntellisenseMenu; })(); Intellisense.IntellisenseMenu = IntellisenseMenu; })(Common.Intellisense || (Common.Intellisense = {})); var Intellisense = Common.Intellisense; })(Common || (Common = {})); //@ sourceMappingURL=intellisenseMenu.js.map // intellisenseProviderBase.ts var Common; (function (Common) { (function (Intellisense) { var GetIntellisenseChoicesCancelToken = (function () { function GetIntellisenseChoicesCancelToken() { this._isCanceled = false; } Object.defineProperty(GetIntellisenseChoicesCancelToken.prototype, "isCanceled", { get: function () { return this._isCanceled; }, enumerable: true, configurable: true }); GetIntellisenseChoicesCancelToken.prototype.cancel = function () { }; return GetIntellisenseChoicesCancelToken; })(); Intellisense.GetIntellisenseChoicesCancelToken = GetIntellisenseChoicesCancelToken; var IntellisenseProviderBase = (function () { function IntellisenseProviderBase() { this._lastTextValue = ""; this._lastSearchExpression = ""; this._searchExpressionUpdated = false; this._currentSearchToken = ""; this._currentSearchTokenStart = -1; this._currentSearchTokenEnd = -1; this._currentIntellisenseChoicesPromise = null; this._currentIntellisenseChoices = null; this._performingCommit = false; } Object.defineProperty(IntellisenseProviderBase.prototype, "textEditorBridge", { get: function () { return this._intellisenseContext.textEditorBridge; }, enumerable: true, configurable: true }); Object.defineProperty(IntellisenseProviderBase.prototype, "intellisenseMenu", { get: function () { return this._intellisenseContext.intellisenseMenu; }, enumerable: true, configurable: true }); Object.defineProperty(IntellisenseProviderBase.prototype, "currentSearchToken", { get: function () { return this._currentSearchToken; }, enumerable: true, configurable: true }); Object.defineProperty(IntellisenseProviderBase.prototype, "currentSearchTokenStart", { get: function () { return this._currentSearchTokenStart; }, enumerable: true, configurable: true }); Object.defineProperty(IntellisenseProviderBase.prototype, "currentSearchTokenEnd", { get: function () { return this._currentSearchTokenEnd; }, enumerable: true, configurable: true }); IntellisenseProviderBase.prototype.attach = function (intellisenseContext) { var _this = this; this._intellisenseContext = intellisenseContext; this.textEditorBridge.onTextChanged = function (text) { return _this.textEditorBridge_textChanged(text); }; this.textEditorBridge.onCaretPositionChanged = function (caretPosition) { return _this.textEditorBridge_caretPositionChanged(caretPosition); }; this.textEditorBridge.onSelectionLengthChanged = function (selectionLength) { return _this.textEditorBridge_selectionLengthChanged(selectionLength); }; this.textEditorBridge.onMenuRequested = function () { return _this.textEditorBridge_menuRequested(); }; this.intellisenseMenu.onSelectionChanged = function (selection) { return _this.intellisenseMenu_selectionChanged(selection); }; this.intellisenseMenu.onChoiceCommitted = function (choice, commitSource) { return _this.intellisenseMenu_choiceCommitted(choice, commitSource); }; this.intellisenseMenu.onClosing = function () { return _this.intellisenseMenu_closing(); }; this._lastTextValue = this.textEditorBridge.text; }; IntellisenseProviderBase.prototype.detach = function () { if(this._currentIntellisenseChoicesPromise) { this._currentIntellisenseChoicesPromise.cancel(); this._currentIntellisenseChoicesPromise = null; } this._currentSearchToken = ""; this._currentSearchTokenStart = -1; this._currentSearchTokenEnd = -1; this._currentIntellisenseChoices = null; this._lastTextValue = ""; this.textEditorBridge.onTextChanged = null; this.textEditorBridge.onCaretPositionChanged = null; this.textEditorBridge.onSelectionLengthChanged = null; this.textEditorBridge.onMenuRequested = null; this.intellisenseMenu.onSelectionChanged = null; this.intellisenseMenu.onChoiceCommitted = null; this.intellisenseMenu.onClosing = null; this._intellisenseContext = null; }; Object.defineProperty(IntellisenseProviderBase.prototype, "onIntellisenseResultsAvailable", { get: function () { return this._onIntellisenseResultsAvailable; }, set: function (value) { this._onIntellisenseResultsAvailable = value; }, enumerable: true, configurable: true }); IntellisenseProviderBase.prototype.getCurrentFilteredIntellisenseCompletionList = function () { if(this._currentIntellisenseChoices && this._currentIntellisenseChoices.length > 0) { return this.intellisenseMenu.filteredIntellisenseChoices; } return []; }; IntellisenseProviderBase.prototype.clearLastValues = function () { this._currentSearchToken = ""; this._currentSearchTokenStart = -1; this._currentSearchTokenEnd = -1; this._currentIntellisenseChoices = null; this._lastTextValue = ""; }; IntellisenseProviderBase.prototype.getDefaultExpression = function (caretPosition) { return { text: "", offset: caretPosition }; }; IntellisenseProviderBase.prototype.getCurrentExpression = function (text, caretPosition) { this.fireGetCurrentExpressionStartEvent(); var startSubStr = text.substr(0, caretPosition); var endSubStr = text.substr(caretPosition); var nonResult = { text: "", offset: caretPosition }; var currentLineStartMatch = startSubStr.match(/.+$/); var nextCharIsInsideSingleQuoteString = false; var nextCharIsInsideDoubleQuoteString = false; var nextCharIsEscaped = false; if(currentLineStartMatch && currentLineStartMatch.length > 0) { var currentLineStart = currentLineStartMatch[0]; for(var i = 0; i < currentLineStart.length; ++i) { var nextCharIsInsideString = nextCharIsInsideSingleQuoteString || nextCharIsInsideDoubleQuoteString; if(currentLineStart[i] === "\\" && nextCharIsInsideString) { nextCharIsEscaped = true; } else { if(currentLineStart[i] === "'" && !nextCharIsEscaped) { nextCharIsInsideSingleQuoteString = !nextCharIsInsideSingleQuoteString && !nextCharIsInsideDoubleQuoteString; } else if(currentLineStart[i] === "\"" && !nextCharIsEscaped) { nextCharIsInsideDoubleQuoteString = !nextCharIsInsideSingleQuoteString && !nextCharIsInsideDoubleQuoteString; } nextCharIsEscaped = false; } } if(nextCharIsInsideSingleQuoteString || nextCharIsInsideDoubleQuoteString) { this.fireGetCurrentExpressionEndEvent(); return nonResult; } } var varMatch = startSubStr.match(/var\s+\S+$/); if(varMatch && varMatch.length > 0) { this.fireGetCurrentExpressionEndEvent(); return nonResult; } var startMatch = startSubStr.match(/[\w\.$]+$/); var expressionStart = ""; if(startMatch) { expressionStart = startMatch[0]; } var endMatch = endSubStr.match(/^[\w$]+/); var expressionEnd = ""; if(endMatch) { expressionEnd = endMatch[0]; } var resultText = expressionStart + expressionEnd; if(resultText.match(/^\d/)) { this.fireGetCurrentExpressionEndEvent(); return nonResult; } this.fireGetCurrentExpressionEndEvent(); return { text: expressionStart + expressionEnd, offset: startSubStr.length - expressionStart.length }; }; IntellisenseProviderBase.prototype.getSearchTokenFromFullExpression = function (expression) { var result = { text: "", offset: expression.length }; var match = expression.match(/[\w$]+$/); if(match && match.length > 0) { result.text = match[0]; result.offset = expression.length - result.text.length; return result; } return result; }; IntellisenseProviderBase.prototype.getIntellisenseChoices = function (searchExpression, completeCallback, cancelToken) { completeCallback(null); }; IntellisenseProviderBase.prototype.onMenuSelectionChanged = function (value) { }; IntellisenseProviderBase.prototype.onMenuChoiceCommitted = function (value, commitSource) { this.textEditorBridge.insertText(this.currentSearchTokenStart, this.currentSearchTokenEnd, value.text); }; IntellisenseProviderBase.prototype.onMenuClosing = function () { }; IntellisenseProviderBase.prototype.fireGetCurrentExpressionStartEvent = function () { }; IntellisenseProviderBase.prototype.fireGetCurrentExpressionEndEvent = function () { }; IntellisenseProviderBase.prototype.fireUpdateIntellisenseStartEvent = function () { }; IntellisenseProviderBase.prototype.fireUpdateIntellisenseEndEvent = function () { }; IntellisenseProviderBase.prototype.getIntellisenseChoicesAsync = function (searchExpression) { var _this = this; var cancelToken = new GetIntellisenseChoicesCancelToken(); return new Plugin.Promise(function (complete) { _this.getIntellisenseChoices(searchExpression, complete, cancelToken); }, function () { cancelToken.cancel(); }); }; IntellisenseProviderBase.prototype.updateIntellisense = function (text, caretPosition, forceMenuOpen) { var _this = this; if(this._performingCommit) { return; } var expression = this.getCurrentExpression(text, caretPosition); if(expression.text.length == 0 && forceMenuOpen === true) { expression = this.getDefaultExpression(caretPosition); } if(expression.text.length > 0) { this.fireUpdateIntellisenseStartEvent(); var newSearchToken = this.getSearchTokenFromFullExpression(expression.text); var searchTokenUpdated = newSearchToken.text != this._currentSearchToken || forceMenuOpen === true; var searchTokenIsFresh = (!newSearchToken.text.match("^" + this._currentSearchToken) && !this._currentSearchToken.match("^" + newSearchToken.text)) || newSearchToken.text.length === 1; this._currentSearchToken = newSearchToken.text; this._currentSearchTokenEnd = expression.offset + expression.text.length; this._currentSearchTokenStart = this._currentSearchTokenEnd - this._currentSearchToken.length; var searchExpression = expression.text.substr(0, newSearchToken.offset - 1); var searchRequiresNewPromise = (searchTokenUpdated && searchTokenIsFresh) || this._lastSearchExpression !== searchExpression; var newSearchExpression = this._searchExpressionUpdated; this._searchExpressionUpdated = false; if(searchRequiresNewPromise || !this._currentIntellisenseChoices) { if(this._currentIntellisenseChoicesPromise) { this._currentIntellisenseChoicesPromise.cancel(); this._currentIntellisenseChoicesPromise = null; } this.intellisenseMenu.isOpen = false; if(expression.text.indexOf(".") != 0 && expression.text.indexOf("..") < 0) { this._currentIntellisenseChoicesPromise = this.getIntellisenseChoicesAsync(searchExpression); this._lastSearchExpression = searchExpression; newSearchExpression = true; } } var newCharWasWhitespace = false; if(caretPosition > 0 && text.length >= caretPosition) { var lastChar = text[caretPosition - 1]; newCharWasWhitespace = !!lastChar.match(/\s/); } var menuWillBeOpen = this.intellisenseMenu.isOpen || forceMenuOpen === true; if(this._lastTextValue.length == (text.length - 1) && !newCharWasWhitespace && (this._currentSearchToken.length == 1 || newSearchExpression)) { menuWillBeOpen = true; } else { this._searchExpressionUpdated = newSearchExpression; } if(this._currentIntellisenseChoicesPromise) { this._currentIntellisenseChoicesPromise.done(function (result) { _this._currentIntellisenseChoices = result; _this._currentIntellisenseChoicesPromise = null; _this.updateMenu(text, searchTokenUpdated, menuWillBeOpen, forceMenuOpen); }); } else { this.updateMenu(text, searchTokenUpdated, menuWillBeOpen, forceMenuOpen); } } else { this.intellisenseMenu.isOpen = false; this.intellisenseMenu.intellisenseChoices = null; this._currentSearchToken = ""; this._currentSearchTokenStart = -1; this._currentSearchTokenEnd = -1; this._currentIntellisenseChoices = null; this.fireOnIntellisenseResultsAvailable(); } this._lastTextValue = text; }; IntellisenseProviderBase.prototype.updateMenu = function (text, searchTokenUpdated, menuWillBeOpen, forceMenuOpen) { if(this._currentIntellisenseChoices && this._currentIntellisenseChoices.length > 0) { if(menuWillBeOpen) { if(this.intellisenseMenu.intellisenseChoices != this._currentIntellisenseChoices) { this.intellisenseMenu.intellisenseChoices = this._currentIntellisenseChoices; searchTokenUpdated = true; } if(searchTokenUpdated) { this.intellisenseMenu.setFilter(this._currentSearchToken); } this.fireOnIntellisenseResultsAvailable(); } if(forceMenuOpen) { this.intellisenseMenu.forceOpen(); } else { this.intellisenseMenu.isOpen = menuWillBeOpen; } } else { this.fireOnIntellisenseResultsAvailable(); } }; IntellisenseProviderBase.prototype.fireOnIntellisenseResultsAvailable = function () { if(this._onIntellisenseResultsAvailable) { this._onIntellisenseResultsAvailable(); } }; IntellisenseProviderBase.prototype.textEditorBridge_textChanged = function (text) { this.updateIntellisense(text, this.textEditorBridge.caretPosition); }; IntellisenseProviderBase.prototype.textEditorBridge_caretPositionChanged = function (caretPosition) { if(this.textEditorBridge.selectionLength == 0) { this.updateIntellisense(this.textEditorBridge.text, caretPosition); } }; IntellisenseProviderBase.prototype.textEditorBridge_selectionLengthChanged = function (selectionLength) { if(selectionLength > 0) { this.intellisenseMenu.isOpen = false; } }; IntellisenseProviderBase.prototype.textEditorBridge_menuRequested = function () { this.updateIntellisense(this.textEditorBridge.text, this.textEditorBridge.caretPosition, true); }; IntellisenseProviderBase.prototype.intellisenseMenu_selectionChanged = function (value) { this.onMenuSelectionChanged(value); }; IntellisenseProviderBase.prototype.intellisenseMenu_choiceCommitted = function (value, commitSource) { this._performingCommit = true; this.onMenuChoiceCommitted(value, commitSource); this.intellisenseMenu.isOpen = false; this._lastTextValue = this.textEditorBridge.text; this.textEditorBridge.focusEditor(); this._performingCommit = false; }; IntellisenseProviderBase.prototype.intellisenseMenu_closing = function () { this.onMenuClosing(); }; return IntellisenseProviderBase; })(); Intellisense.IntellisenseProviderBase = IntellisenseProviderBase; })(Common.Intellisense || (Common.Intellisense = {})); var Intellisense = Common.Intellisense; })(Common || (Common = {})); //@ sourceMappingURL=intellisenseProviderBase.js.map // staticContentProvider.ts var Common; (function (Common) { (function (Intellisense) { var StaticContentProvider = (function () { function StaticContentProvider(_breakUpFilterTextByWhitespace) { if (typeof _breakUpFilterTextByWhitespace === "undefined") { _breakUpFilterTextByWhitespace = true; } this._breakUpFilterTextByWhitespace = _breakUpFilterTextByWhitespace; } StaticContentProvider.prototype.attach = function (intellisenseContext) { var _this = this; this._intellisenseContext = intellisenseContext; this._intellisenseContext.textEditorBridge.onTextChanged = function (text) { return _this.textEditorBridge_textChanged(text); }; this._intellisenseContext.textEditorBridge.onCaretPositionChanged = function (caretPosition) { return _this.textEditorBridge_caretPositionChanged(caretPosition); }; this._intellisenseContext.textEditorBridge.onSelectionLengthChanged = function (selectionLength) { return _this.textEditorBridge_selectionLengthChanged(selectionLength); }; this._intellisenseContext.textEditorBridge.onMenuRequested = function () { return _this.textEditorBridge_menuRequested(); }; this._intellisenseContext.intellisenseMenu.onChoiceCommitted = function (choice, commitSource) { return _this.intellisenseMenu_choiceCommitted(choice, commitSource); }; this._intellisenseContext.intellisenseMenu.intellisenseChoices = this._choices; }; StaticContentProvider.prototype.detach = function () { this._intellisenseContext.textEditorBridge.onTextChanged = null; this._intellisenseContext.textEditorBridge.onCaretPositionChanged = null; this._intellisenseContext.textEditorBridge.onSelectionLengthChanged = null; this._intellisenseContext.textEditorBridge.onMenuRequested = null; this._intellisenseContext.intellisenseMenu.onSelectionChanged = null; this._intellisenseContext.intellisenseMenu.onChoiceCommitted = null; this._intellisenseContext.intellisenseMenu.onClosing = null; this._intellisenseContext = null; }; Object.defineProperty(StaticContentProvider.prototype, "choices", { get: function () { return this._choices; }, set: function (theChoices) { this._choices = theChoices; if(this._onIntellisenseResultsAvailable) { this._onIntellisenseResultsAvailable(); } if(this._intellisenseContext) { this._intellisenseContext.intellisenseMenu.intellisenseChoices = theChoices; } }, enumerable: true, configurable: true }); Object.defineProperty(StaticContentProvider.prototype, "onIntellisenseResultsAvailable", { get: function () { return this._onIntellisenseResultsAvailable; }, set: function (value) { this._onIntellisenseResultsAvailable = value; }, enumerable: true, configurable: true }); Object.defineProperty(StaticContentProvider.prototype, "onShouldOpenOnTextChange", { get: function () { return this._onShouldOpenOnTextChange; }, set: function (value) { this._onShouldOpenOnTextChange = value; }, enumerable: true, configurable: true }); StaticContentProvider.prototype.getCurrentFilteredIntellisenseCompletionList = function () { return this._intellisenseContext.intellisenseMenu.filteredIntellisenseChoices; }; StaticContentProvider.prototype.clearLastValues = function () { }; StaticContentProvider.prototype.onMenuChoiceCommitted = function (value, commitSource) { this.closeMenu(); this.insertText(this._token.leftIndex, this._token.rightIndex, value.text); }; StaticContentProvider.prototype.insertText = function (leftIndex, rightIndex, text) { this._intellisenseContext.textEditorBridge.insertText(leftIndex, rightIndex, text); }; StaticContentProvider.prototype.updateIntellisense = function (text, caretPosition, forceMenuOpen) { this._token = this.findTokenWhereCaretResides(text, caretPosition); this.setFilter(this._token.text); if(forceMenuOpen || (this._choices && this._choices.length > 0 && this._token.text && this._token.text.length > 0) && (!this._onShouldOpenOnTextChange || this._onShouldOpenOnTextChange(text))) { this.openMenu(forceMenuOpen); } else { this.closeMenu(); } }; StaticContentProvider.prototype.setFilter = function (filterText) { this._intellisenseContext.intellisenseMenu.setFilter(filterText); }; StaticContentProvider.prototype.openMenu = function (forceMenuOpen) { if(forceMenuOpen) { this._intellisenseContext.intellisenseMenu.forceOpen(); } else { this._intellisenseContext.intellisenseMenu.isOpen = true; } }; StaticContentProvider.prototype.closeMenu = function () { this._intellisenseContext.intellisenseMenu.isOpen = false; }; StaticContentProvider.prototype.findTokenWhereCaretResides = function (text, caretPosition) { if(!this._breakUpFilterTextByWhitespace) { return { leftIndex: 0, rightIndex: text.length, text: text }; } var left = caretPosition; while(!StaticContentProvider.isAtLeftEndOrHasWhiteSpaceToTheLeft(text, left - 1)) { left--; } var right = caretPosition; while(!StaticContentProvider.isAtRightEndOrHasWhiteSpaceToTheRight(text, right)) { right++; } return { leftIndex: left, rightIndex: (right), text: text.substring(left, right) }; }; StaticContentProvider.isAtLeftEndOrHasWhiteSpaceToTheLeft = function isAtLeftEndOrHasWhiteSpaceToTheLeft(text, position) { if(position < 0) { return true; } var ch = text.charAt(position); return ch === " " || ch === "\t"; }; StaticContentProvider.isAtRightEndOrHasWhiteSpaceToTheRight = function isAtRightEndOrHasWhiteSpaceToTheRight(text, position) { if(position >= text.length) { return true; } var ch = text.charAt(position); return ch === " " || ch === "\t"; }; StaticContentProvider.prototype.textEditorBridge_textChanged = function (text) { this.updateIntellisense(text, this._intellisenseContext.textEditorBridge.caretPosition); }; StaticContentProvider.prototype.textEditorBridge_caretPositionChanged = function (caretPosition) { if(this._intellisenseContext.textEditorBridge.selectionLength == 0) { this.updateIntellisense(this._intellisenseContext.textEditorBridge.text, caretPosition); } }; StaticContentProvider.prototype.textEditorBridge_selectionLengthChanged = function (selectionLength) { if(selectionLength > 0) { this._intellisenseContext.intellisenseMenu.isOpen = false; } }; StaticContentProvider.prototype.textEditorBridge_menuRequested = function () { this.updateIntellisense(this._intellisenseContext.textEditorBridge.text, this._intellisenseContext.textEditorBridge.caretPosition, true); }; StaticContentProvider.prototype.intellisenseMenu_choiceCommitted = function (value, commitSource) { this.onMenuChoiceCommitted(value, commitSource); }; return StaticContentProvider; })(); Intellisense.StaticContentProvider = StaticContentProvider; })(Common.Intellisense || (Common.Intellisense = {})); var Intellisense = Common.Intellisense; })(Common || (Common = {})); //@ sourceMappingURL=staticContentProvider.js.map // intellisenseRemoteHelpers.ts var Common; (function (Common) { (function (Intellisense) { var IntellisenseRemoteHelpers = (function () { function IntellisenseRemoteHelpers(context) { this._context = context; } IntellisenseRemoteHelpers.jsKeywords = [ "break", "case", "catch", "const", "continue", "debugger", "default", "delete", "do", "else", "finally", "for", "function", "if", "in", "instanceof", "let", "new", "return", "switch", "this", "throw", "try", "var", "void", "while", "with", "typeof", "false", "true", "cd", "dir", "select" ]; IntellisenseRemoteHelpers.prototype.getIntellisenseItemsForExpression = function (expression) { return this.getIntellisenseItemsForExpressionUsingWindowContext(expression, this._context.currentWindowContext); }; IntellisenseRemoteHelpers.prototype.getIntellisenseItemsForExpressionUsingWindowContext = function (expression, windowContext) { var current = this.getObjectContextForExpressionUsingEvaluator(expression, windowContext, IntellisenseRemoteHelpers.evaluateProperty); var includeKeywords = expression.length === 0; return this.getIntellisenseItemsForObjectContext(current, IntellisenseRemoteHelpers.getObjectContextPropertiesNames, includeKeywords); }; IntellisenseRemoteHelpers.evaluateProperty = function evaluateProperty(object, propertyName, currentWindowContext, retrieveProperty) { var getPropertyDescriptor = function (object, propertyName) { if(object) { try { var descriptor = currentWindowContext.Object.getOwnPropertyDescriptor(object, propertyName); if(descriptor) { return descriptor; } else { return getPropertyDescriptor(currentWindowContext.Object.getPrototypeOf(object), propertyName); } } catch (e) { if(e.name === "TypeError") { return { }; } else { return; } } } return object; }; var getValueProperty = function (object, propertyName, descriptor) { if(descriptor) { if(typeof descriptor.value !== "undefined" && descriptor.value !== null) { return descriptor.value; } else if(descriptor.get && /\[native code\]/.test(descriptor.get.toString())) { return retrieveProperty(object, propertyName); } else if(typeof descriptor.get === "undefined") { return retrieveProperty(object, propertyName); } } return undefined; }; return object && getValueProperty(object, propertyName, getPropertyDescriptor(object, propertyName)); }; IntellisenseRemoteHelpers.getObjectContextPropertiesNames = function getObjectContextPropertiesNames(context, isCrossSiteWindow) { var propertyNames = []; if(context.object) { var currentType = typeof context.object; if(currentType === "string") { context.object = new context.windowContext.String(); } else if((context.object).constructor === context.windowContext.Array) { context.object = new context.windowContext.Array(); } else if(currentType !== "object" || currentType !== "function") { context.object = new context.windowContext.Object(context.object); } if(isCrossSiteWindow(context.windowContext, context.object)) { context.object = context.windowContext = dom.getCrossSiteWindow(context.windowContext, context.object); } var currentPropertyNames = context.windowContext.Object.getOwnPropertyNames(context.object); if(currentPropertyNames) { propertyNames = currentPropertyNames; } var prototype = context.windowContext.Object.getPrototypeOf(context.object); while(prototype) { var prototypeProperties = context.windowContext.Object.getOwnPropertyNames(prototype); propertyNames = Array.prototype.concat.call(propertyNames, prototypeProperties); prototype = context.windowContext.Object.getPrototypeOf(prototype); } } return propertyNames; }; IntellisenseRemoteHelpers.prototype.getObjectContextForExpressionUsingEvaluator = function (expression, currentWindowContext, evaluator) { var items = expression.split("."); var current = currentWindowContext; for(var i = 0; i < items.length && items[i].length > 0; ++i) { var retrievePropertyFunc = Common.PropertyEvaluationIgnoreList.propertyEvaluationFunction(currentWindowContext, current); current = evaluator(current, items[i], currentWindowContext, retrievePropertyFunc); if(Common.RemoteHelpers.isCrossSiteWindow(currentWindowContext, current)) { current = currentWindowContext = dom.getCrossSiteWindow(currentWindowContext, current); } } return { object: current, windowContext: currentWindowContext }; }; IntellisenseRemoteHelpers.prototype.getIntellisenseItemsForObjectContext = function (context, propertyNameCallback, includeKeywords) { var propertyNames = propertyNameCallback(context, Common.RemoteHelpers.isCrossSiteWindow); if(includeKeywords) { for(var keyIdx = 0; keyIdx < IntellisenseRemoteHelpers.jsKeywords.length; ++keyIdx) { Array.prototype.push.call(propertyNames, IntellisenseRemoteHelpers.jsKeywords[keyIdx]); } } propertyNames = Array.prototype.sort.call(propertyNames, function (a, b) { var simpleCompare = function (a, b) { if(a < b) { return -1; } else if(a > b) { return 1; } else { return 0; } }; var result = simpleCompare(a.toLowerCase(), b.toLowerCase()); if(result === 0) { return simpleCompare(b, a); } else { return result; } }); for(var i = 0; i < propertyNames.length; ) { if(String.prototype.match.call(propertyNames[i], /^\d/)) { Array.prototype.splice.call(propertyNames, i, 1); } else if(i > 0 && propertyNames[i - 1] === propertyNames[i]) { Array.prototype.splice.call(propertyNames, i, 1); } else { i++; } } var choices = []; for(var i = 0; i < propertyNames.length; ++i) { choices.push({ name: propertyNames[i], info: "" }); } return { choices: choices }; }; return IntellisenseRemoteHelpers; })(); Intellisense.IntellisenseRemoteHelpers = IntellisenseRemoteHelpers; })(Common.Intellisense || (Common.Intellisense = {})); var Intellisense = Common.Intellisense; })(Common || (Common = {})); //@ sourceMappingURL=intellisenseRemoteHelpers.js.map // objectTreeView.ts var Common; (function (Common) { (function (ObjectView) { "use strict"; var Measurements = (function () { function Measurements() { this._cellOffset = 0; this._rowHeight = 0; this._unitEx = 0; } Object.defineProperty(Measurements.prototype, "cellOffset", { get: function () { return this._cellOffset; }, enumerable: true, configurable: true }); Object.defineProperty(Measurements.prototype, "rowHeight", { get: function () { return this._rowHeight; }, enumerable: true, configurable: true }); Object.defineProperty(Measurements.prototype, "unitEx", { get: function () { return this._unitEx; }, enumerable: true, configurable: true }); Measurements.prototype.update = function (container) { var measurementContainer = DomHelpers.createElement("div", "listview-grid"); measurementContainer.style.display = "block"; measurementContainer.style.position = "absolute"; measurementContainer.style.left = "-5000px"; measurementContainer.style.top = "-5000px"; measurementContainer.style.width = "1000px"; measurementContainer.style.height = "500px"; (container || document.body).appendChild(measurementContainer); var row = DomHelpers.createElement("div", "listview-grid-row grid-row-normal"); row.tabIndex = -1; row.setAttribute("role", "listitem"); measurementContainer.appendChild(row); var cell = DomHelpers.createElement("div", "listview-grid-cell"); cell.style.width = "100px"; cell.innerText = "1"; row.appendChild(cell); this._rowHeight = row.offsetHeight; this._cellOffset = cell.offsetWidth - 100; var textUnit = DomHelpers.createElement("div"); textUnit.style.overflow = "hidden"; textUnit.style.width = "1em"; textUnit.style.height = "1ex"; cell.appendChild(textUnit); this._unitEx = textUnit.offsetHeight; (container || document.body).removeChild(measurementContainer); }; return Measurements; })(); ObjectView.Measurements = Measurements; (function (DomHelpers) { function createElement(type, className) { var element = document.createElement(type); if(className) { element.className = className; } return element; } DomHelpers.createElement = createElement; function findClosestElement(element, selector, within) { var stop = within || document.body; var closest = element; while(closest && closest !== stop) { if(closest.msMatchesSelector(selector)) { return closest; } closest = closest.parentElement; } return null; } DomHelpers.findClosestElement = findClosestElement; })(ObjectView.DomHelpers || (ObjectView.DomHelpers = {})); var DomHelpers = ObjectView.DomHelpers; var ObjectTreeView = (function () { function ObjectTreeView(container, toggleCallback, selectCallback, editCallback, clickCallback, renderFunction) { this._isTabbingOut = false; this._delayedRenderRequestCount = 0; this._containerElement = container; this._toggleCallback = toggleCallback; this._selectCallback = selectCallback; this._editCallback = editCallback; this._clickCallback = clickCallback; this._nameColumnWidth = ObjectTreeView._defaultColumnSize; this._isInitialResize = true; this._autoScrollEnabled = true; this._scrollPadding = 5; this._hasIndent = true; this._renderFunction = renderFunction; if(!this._renderFunction) { this._renderFunction = function (expression, msec, language) { return window.setTimeout(expression, msec, language); }; } this.initialize(); } ObjectTreeView._defaultColumnSize = 170; ObjectTreeView._indentWidth = 16; ObjectTreeView._maxSpacerSize = 1500000; ObjectTreeView._minColumnSize = 50; ObjectTreeView._separatorOffset = 8; ObjectTreeView._maxDelayedRenderRequestCount = 500; ObjectTreeView._delayedRenderInterval = 50; ObjectTreeView.EXPAND_ROW = 1; ObjectTreeView.COLLAPSE_ROW = -1; Object.defineProperty(ObjectTreeView.prototype, "onUpdated", { get: function () { return this._onUpdated; }, set: function (callback) { this._onUpdated = callback; }, enumerable: true, configurable: true }); Object.defineProperty(ObjectTreeView.prototype, "postRenderCallback", { set: function (callback) { this._postRenderCallback = callback; }, enumerable: true, configurable: true }); Object.defineProperty(ObjectTreeView.prototype, "notifyToggleCallback", { set: function (callback) { this._notifyToggleCallback = callback; }, enumerable: true, configurable: true }); Object.defineProperty(ObjectTreeView.prototype, "scrollPadding", { set: function (value) { this._scrollPadding = value; }, enumerable: true, configurable: true }); Object.defineProperty(ObjectTreeView.prototype, "hasIndent", { get: function () { return this._hasIndent; }, set: function (value) { this._hasIndent = value; }, enumerable: true, configurable: true }); Object.defineProperty(ObjectTreeView.prototype, "onBeforeRendering", { set: function (callback) { this._onBeforeRendering = callback; }, enumerable: true, configurable: true }); Object.defineProperty(ObjectTreeView.prototype, "onRendered", { set: function (callback) { this._onRendered = callback; }, enumerable: true, configurable: true }); Object.defineProperty(ObjectTreeView.prototype, "onBeforeItemToggle", { set: function (callback) { this._onBeforeItemToggle = callback; }, enumerable: true, configurable: true }); Object.defineProperty(ObjectTreeView.prototype, "onItemToggled", { set: function (callback) { this._onItemToggled = callback; }, enumerable: true, configurable: true }); Object.defineProperty(ObjectTreeView.prototype, "onBeforeScroll", { set: function (callback) { this._onBeforeScroll = callback; }, enumerable: true, configurable: true }); Object.defineProperty(ObjectTreeView.prototype, "onScrollCompleted", { set: function (callback) { this._onScrollCompleted = callback; }, enumerable: true, configurable: true }); ObjectTreeView.prototype.initialize = function () { var _this = this; this._rootElement = DomHelpers.createElement("div", "listview"); this._rootElement.setAttribute("tabindex", "1"); this._rootElement.setAttribute("role", "tree"); this._containerElement.appendChild(this._rootElement); this._spacerTopElement = DomHelpers.createElement("span", "listview-grid-content-spacer"); this._rootElement.appendChild(this._spacerTopElement); this._rootElement.appendChild(DomHelpers.createElement("div", "")); this._gridElement = DomHelpers.createElement("div", "listview-grid"); this._rootElement.appendChild(this._gridElement); this._groupLineElement = DomHelpers.createElement("div", "listview-grid-groupline"); this._rootElement.appendChild(this._groupLineElement); this._separatorElement = DomHelpers.createElement("div", "listview-grid-separator"); this._separatorElement.style.left = (ObjectTreeView._separatorOffset + this._nameColumnWidth) + "px"; this._rootElement.appendChild(this._separatorElement); this._rootElement.appendChild(DomHelpers.createElement("div", "")); this._spacerBottomElement = DomHelpers.createElement("span", "listview-grid-content-spacer"); this._rootElement.appendChild(this._spacerBottomElement); window.addEventListener("resize", function (e) { return _this.onResize(e); }); this._rootElement.addEventListener("scroll", function (e) { return _this.onScroll(e); }); this._rootElement.addEventListener("mousedown", function (e) { return _this.onMouseDown(e); }); this._rootElement.addEventListener("dblclick", function (e) { return _this.onMouseDblClick(e); }); this._rootElement.addEventListener("keydown", function (e) { return _this.onKeyDown(e); }); this._rootElement.addEventListener("copy", function (e) { return _this.onCopy(e); }); this._rootElement.addEventListener("focus", function (e) { return _this.onFocus(e); }, true); this._rootElement.addEventListener("blur", function (e) { return _this.onBlur(e); }, true); this._measurements = new Measurements(); window.setTimeout(function () { _this._measurements.update(_this._containerElement); }, 10); this.resetViewport(); this._scrollHeight = 0; this._scrollBottom = this._rootElement.clientHeight + this._rootElement.scrollTop; this._dataContextMap = { }; this._unfilteredList = []; this._filteredList = []; this._linesMap = { }; this._errorLabel = toolwindowHelpers.loadString("SingleError", ""); this._infoLabel = toolwindowHelpers.loadString("SingleMessage", ""); this._warningLabel = toolwindowHelpers.loadString("SingleWarning", ""); }; ObjectTreeView.prototype.resetViewport = function () { this._currentViewport = { first: Number.MAX_VALUE, last: -1, scrollTop: 0, spaceTop: 0, spaceBottom: 0, unboundFirst: Number.MAX_VALUE, unboundLast: -1 }; }; ObjectTreeView.prototype.getViewportRowInfo = function () { var maxCount = Math.max(0, this._filteredList.length - 1); var rh = this._measurements.rowHeight; var maxTop = (maxCount + 2) * rh - this._rootElement.clientHeight; if(this._rootElement.scrollTop > maxTop) { this._rootElement.scrollTop = maxTop; } var top = this._rootElement.scrollTop; var bottom = top + this._rootElement.clientHeight; var unboundFirst = Math.floor(top / rh) - this._scrollPadding; var unboundLast = Math.ceil(bottom / rh) + this._scrollPadding; var first = Math.min(maxCount, Math.max(0, unboundFirst)); var last = Math.max(0, Math.min(maxCount, unboundLast)); var spaceTop = Math.max(0, first * rh); var spaceBottom = Math.max(0, (maxCount - last) * rh); return { first: first, last: last, scrollTop: top, spaceTop: spaceTop, spaceBottom: spaceBottom, unboundFirst: unboundFirst, unboundLast: unboundLast }; }; ObjectTreeView.prototype.sizeSpacer = function (spacerElement, height) { if(spacerElement.firstChild) { spacerElement.removeChild(spacerElement.firstChild); } if(height < ObjectTreeView._maxSpacerSize) { spacerElement.style.height = height + "px"; spacerElement.style.display = "block"; } else { var fragment = document.createDocumentFragment(); spacerElement.style.height = "auto"; spacerElement.style.display = "inline"; var div = document.createElement("div"); div.style.height = (height % ObjectTreeView._maxSpacerSize) + "px"; fragment.appendChild(div); var count = Math.floor(height / ObjectTreeView._maxSpacerSize); for(var i = 0; i < count; i++) { div = document.createElement("div"); div.style.height = ObjectTreeView._maxSpacerSize + "px"; fragment.appendChild(div); } var span = document.createElement("span"); span.style.display = "inline-block"; span.appendChild(fragment); spacerElement.appendChild(span); } }; ObjectTreeView.prototype.requestRender = function (forceRedraw, selectNewIndex) { var _this = this; if(!this._delayedRenderCookie) { this._delayedRenderCookie = this._renderFunction(function () { return _this.executePendingRenderRequest(forceRedraw, selectNewIndex); }, ObjectTreeView._delayedRenderInterval); } else { this._delayedRenderRequestCount++; } if(this._delayedRenderRequestCount > ObjectTreeView._maxDelayedRenderRequestCount) { if(this._delayedRenderCookie) { window.clearTimeout(this._delayedRenderCookie); } this.executePendingRenderRequest(forceRedraw, selectNewIndex); } }; ObjectTreeView.prototype.executePendingRenderRequest = function (forceRedraw, selectNewIndex) { if(this._onBeforeRendering) { this._onBeforeRendering(); } this._delayedRenderCookie = null; this._delayedRenderRequestCount = 0; this.performRender(forceRedraw, selectNewIndex); if(this._delayedScrollFunction) { this._delayedScrollFunction(); this._delayedScrollFunction = null; } if(this._delayedSelectFunction) { this._delayedSelectFunction(); this._delayedSelectFunction = null; } }; ObjectTreeView.prototype.getLabelForAddedClasses = function (classes) { if(!classes) { return ""; } if(classes.lastIndexOf("consoleItemError") >= 0) { return this._errorLabel; } if(classes.lastIndexOf("consoleItemInfo") >= 0) { return this._infoLabel; } if(classes.lastIndexOf("consoleItemWarn") >= 0) { return this._warningLabel; } return ""; }; ObjectTreeView.prototype.performRender = function (forceRedraw, selectNewIndex) { var _this = this; this._ignoreScroll = true; var newViewport = this.getViewportRowInfo(); this._gridElement.style.height = this._gridElement.clientHeight + "px"; this.sizeSpacer(this._spacerTopElement, newViewport.spaceTop); this.sizeSpacer(this._spacerBottomElement, newViewport.spaceBottom); this._separatorElement.style.top = newViewport.scrollTop + "px"; if(forceRedraw) { while(this._gridElement.hasChildNodes()) { var rowToRemove = this._gridElement.lastChild; if(this._selectedRow === rowToRemove) { if(this.isFocusWithin()) { var scrollY = this._rootElement.scrollTop; this._rootElement.focus(); this._rootElement.scrollTop = scrollY; } this._selectedRow = null; } this._gridElement.removeChild(rowToRemove); } this.resetViewport(); } var newRows = []; var fragmentTop = document.createDocumentFragment(); var fragmentBottom = document.createDocumentFragment(); for(var i = newViewport.first; i <= newViewport.last && i < this._filteredList.length; i++) { if(i < this._currentViewport.first || i > this._currentViewport.last) { var item = this.getItem(i); var context = this._dataContextMap[item.id]; var indent = this.getIndent(context); var isSingleCell = (item.name === null || item.name === undefined); var lineIndex = (item.htmlLines && item.htmlLines.length > 0 ? this.getLineIndex(this._filteredList[i]) : -1); var isExpanded = (context.descendantCount > (item.htmlLines ? item.htmlLines.length - 1 : 0)); var isSelected = (this.getSelectedItem() === item); var ariaLabel = ""; var row = DomHelpers.createElement("div", "listview-grid-row" + (item.additionalClass ? " " + item.additionalClass : "")); row.tabIndex = -1; row.id = "row_" + i; row.setAttribute("data-index", "" + i); row.setAttribute("role", "treeitem"); row.style.height = (this._measurements.rowHeight) + "px"; if(isSelected) { row.classList.add("listview-grid-row-selected"); } var fragment = (i < this._currentViewport.first ? fragmentTop : fragmentBottom); fragment.appendChild(row); if(!isSingleCell) { if(item.hasIcon) { var iconCell = DomHelpers.createElement("div", "listview-grid-cell " + (lineIndex <= 0 ? "listview-grid-cell-icon" : "listview-grid-cell-icon-space")); iconCell.style.position = "absolute"; iconCell.style.left = ((indent - 1) * ObjectTreeView._indentWidth) + "px"; row.appendChild(iconCell); if(lineIndex <= 0 && item.additionalClass) { ariaLabel = this.getLabelForAddedClasses(item.additionalClass) + " "; } } var nameCell = DomHelpers.createElement("div", "listview-grid-cell listview-grid-cell-resize"); nameCell.innerText = (lineIndex <= 0 ? item.name : ""); if(lineIndex <= 0 && item.name) { ariaLabel = ariaLabel + item.name + " "; } nameCell.style.textIndent = ((indent + 1) * ObjectTreeView._indentWidth) + "px"; nameCell.style.width = this._nameColumnWidth + "px"; row.appendChild(nameCell); if(item.hasChildren && (lineIndex === -1 || lineIndex === 0)) { var treeIcon = DomHelpers.createElement("div", "listview-icon-tree"); treeIcon.classList.add(isExpanded ? "listview-icon-tree-expanded" : "listview-icon-tree-collapsed"); row.setAttribute("aria-expanded", isExpanded ? "true" : "false"); this.addDOMAttrModifiedHandler(row); treeIcon.style.left = (indent * ObjectTreeView._indentWidth + 3) + "px"; row.appendChild(treeIcon); } var valueCell = DomHelpers.createElement("div", "listview-grid-cell listview-grid-cell-value"); if(lineIndex === -1) { valueCell.innerText = item.value; ariaLabel = ariaLabel + item.value; } else { valueCell.innerHTML = item.htmlLines[lineIndex]; if(lineIndex == 0) { for(var labelLine = 0; labelLine < item.htmlLines.length; labelLine++) { ariaLabel = ariaLabel + (item.htmlLines[labelLine]).replace(/<[^>]*>/g, "") + " "; } } } row.appendChild(valueCell); } else { var cellIndent = this._hasIndent ? (indent + (item.hasIcon ? -1 : 1)) : 0; var indentCell = DomHelpers.createElement("div", "listview-grid-cell listview-grid-cell-indent"); indentCell.style.width = (cellIndent * ObjectTreeView._indentWidth) + "px"; row.appendChild(indentCell); if(item.hasIcon) { var iconCell = DomHelpers.createElement("div", "listview-grid-cell " + (lineIndex <= 0 ? "listview-grid-cell-icon" : "listview-grid-cell-icon-space")); if(lineIndex <= 0 && item.additionalClass) { ariaLabel = this.getLabelForAddedClasses(item.additionalClass) + " "; } row.appendChild(iconCell); } if(item.hasChildren) { if(item.hasIcon) { iconCell.style.marginRight = "16px"; cellIndent += 2; } if(lineIndex === -1 || lineIndex === 0) { var treeIcon = DomHelpers.createElement("div", "listview-icon-tree"); treeIcon.classList.add(isExpanded ? "listview-icon-tree-expanded" : "listview-icon-tree-collapsed"); row.setAttribute("aria-expanded", isExpanded ? "true" : "false"); this.addDOMAttrModifiedHandler(row); treeIcon.style.left = (cellIndent * ObjectTreeView._indentWidth - 13) + "px"; row.appendChild(treeIcon); } } var valueCell = DomHelpers.createElement("div", "listview-grid-cell listview-grid-cell-full listview-grid-cell-value"); if(lineIndex === -1) { valueCell.innerText = item.value; ariaLabel = ariaLabel + item.value; } else { valueCell.innerHTML = item.htmlLines[lineIndex]; if(lineIndex == 0) { for(var labelLine = 0; labelLine < item.htmlLines.length; labelLine++) { ariaLabel = ariaLabel + (item.htmlLines[labelLine]).replace(/<[^>]*>/g, "") + " "; } } if(isSelected) { row.classList.add("listview-grid-row-selected"); } } row.appendChild(valueCell); } if(item.hasChildren) { row.classList.add(isExpanded ? "listview-grid-row-expanded" : "listview-grid-row-collapsed"); } if((lineIndex === -1 || lineIndex === item.htmlLines.length - 1)) { var currentContext = context; var drawLine = item.hasSeparator; if(!drawLine && context.parentContext) { currentContext = context.parentContext; while(currentContext && i === this.getIndexOfItem(this._filteredList, currentContext.item) + currentContext.expandedCount) { if(currentContext.item.hasSeparator) { drawLine = true; break; } currentContext = currentContext.parentContext; } } if(drawLine) { var lineIndent = this.getIndent(currentContext); var underline = DomHelpers.createElement("div", "listview-grid-underline"); underline.style.left = ((lineIndent - 1) * ObjectTreeView._indentWidth) + "px"; row.appendChild(underline); } } row.setAttribute("aria-label", ariaLabel); } else if(i == this._currentViewport.first) { i = this._currentViewport.last; } } for(var i = this._currentViewport.first; i <= this._currentViewport.last; i++) { if(i < newViewport.first || i > newViewport.last) { var row = document.getElementById("row_" + i); if(row) { if(this._selectedRow === row) { if(this.isFocusWithin()) { var scrollY = this._rootElement.scrollTop; this._rootElement.focus(); this._rootElement.scrollTop = scrollY; } this._selectedRow = null; } row.parentElement.removeChild(row); } } else if(i === newViewport.first) { i = newViewport.last; } } this._gridElement.insertBefore(fragmentTop, this._gridElement.firstChild); this._gridElement.appendChild(fragmentBottom); this._gridElement.style.height = "auto"; if(!isNaN(selectNewIndex)) { this._selectedIndex = selectNewIndex; this._selectedRow = null; } var scrolledSelectedOutOfView = (this._selectedIndex >= 0) && (this._selectedIndex < newViewport.unboundFirst || this._selectedIndex > newViewport.unboundLast) && (this._selectedIndex >= this._currentViewport.unboundFirst && this._selectedIndex <= this._currentViewport.unboundLast); if(this._selectedIndex >= 0 && !this._selectedRow && !scrolledSelectedOutOfView) { var toSelect = document.getElementById("row_" + this._selectedIndex); if(toSelect) { this._selectedRow = toSelect; } this.updateGroupLine(); } else if(forceRedraw) { this.updateGroupLine(); } this._currentViewport = newViewport; this._ignoreScroll = false; setTimeout(function () { if(_this._postRenderCallback) { _this._postRenderCallback(); _this._postRenderCallback = null; } }); if(this._onRendered) { this._onRendered(); } this._rootElement.setAttribute("tabindex", this._filteredList.length > 0 ? "1" : "-1"); }; ObjectTreeView.prototype.getItemId = function (fullId) { var indexStart = fullId.lastIndexOf("::"); if(indexStart > -1) { fullId = fullId.substring(0, indexStart); } return fullId; }; ObjectTreeView.prototype.getLineIndex = function (fullId) { var lineIndex = -1; if(fullId) { var indexStart = fullId.lastIndexOf("::"); if(indexStart > -1) { lineIndex = parseInt(fullId.substring(indexStart + 2), 10); } } return lineIndex; }; ObjectTreeView.prototype.getIndexOfItem = function (list, item, lastLineOfInput) { if (typeof lastLineOfInput === "undefined") { lastLineOfInput = true; } var rootLineId = this.getItemId(item.id); if(item.additionalClass === "consoleItemInput" && lastLineOfInput) { rootLineId = rootLineId + (item.htmlLines && item.htmlLines.length > 0 ? ("::" + (item.htmlLines.length - 1).toString()) : ""); } else { rootLineId = rootLineId + (item.htmlLines && item.htmlLines.length > 0 ? "::0" : ""); } return list.indexOf(rootLineId); }; ObjectTreeView.prototype.getItem = function (index) { if(index >= 0 && index < this._filteredList.length) { var id = this.getItemId(this._filteredList[index]); if(this._dataContextMap[id]) { return this._dataContextMap[id].item; } } return null; }; ObjectTreeView.prototype.isFocusWithin = function () { return (this._rootElement.querySelectorAll(":focus").length > 0); }; ObjectTreeView.prototype.scrollIndexIntoView = function (index, alignToTop) { if(document.getElementById("row_" + index) === null || alignToTop || index < this._currentViewport.unboundFirst + this._scrollPadding || index >= this._currentViewport.unboundLast - this._scrollPadding - 1) { if(alignToTop) { this._rootElement.scrollTop = Math.min((this._filteredList.length * this._measurements.rowHeight) - this._rootElement.clientHeight, index * this._measurements.rowHeight); } else { var item = this.getItem(index); var htmlLinesCount = 1; if(item && item.htmlLines) { htmlLinesCount = item.htmlLines.length; } this._rootElement.scrollTop = ((index + htmlLinesCount + 1) * this._measurements.rowHeight) - this._rootElement.clientHeight; } this.performRender(); } }; ObjectTreeView.prototype.getIndent = function (context) { if(!this._hasIndent) { return 0; } var indent = (context.item.hasIcon ? 1 : 0); while(context && context.parentContext != null) { context = context.parentContext; indent += (context.item.hasIcon ? 2 : 1); } return indent; }; ObjectTreeView.prototype.updateGroupLine = function () { var setLineHeight = false; if(this._selectedIndex >= 0 && this._selectedIndex < this._filteredList.length) { var item = this.getItem(this._selectedIndex); var context = this._dataContextMap[item.id]; if(context && context.expandedCount > (item.htmlLines ? item.htmlLines.length - 1 : 0)) { this._groupLineElement.style.display = "inline-block"; this._groupLineElement.style.top = (this._selectedIndex * this._measurements.rowHeight + this._measurements.rowHeight) + "px"; this._groupLineElement.style.left = ((this.getIndent(context) + 1) * ObjectTreeView._indentWidth - 4) + "px"; this._groupLineElement.style.height = (context.expandedCount * this._measurements.rowHeight + 1) + "px"; setLineHeight = true; } } if(!setLineHeight) { this._groupLineElement.style.display = "none"; } }; ObjectTreeView.prototype.updateContextCounts = function (context, descentantCountChange, expandedCountChange) { var currentContext = context; while(currentContext) { currentContext.descendantCount += descentantCountChange; currentContext.expandedCount += expandedCountChange; currentContext = currentContext.parentContext; } }; ObjectTreeView.prototype.spliceArray = function (array, toAdd, insertAt) { var args; var limit = 200000; var parts = ~~(toAdd.length / limit); for(var i = 0; i < parts; i++) { var start = (i * limit); args = [ insertAt + start, 0 ].concat(toAdd.slice(start, limit)); Array.prototype.splice.apply(array, args); } var mod = toAdd.length % limit; if(mod > 0) { args = [ insertAt + (toAdd.length - mod), 0 ].concat(toAdd.slice((toAdd.length - mod), toAdd.length)); Array.prototype.splice.apply(array, args); } }; ObjectTreeView.prototype.moveSelectionUp = function (toParent) { if(toParent) { var index = parseInt(this._selectedRow.getAttribute("data-index"), 10); var item = this.getItem(index); var context = this._dataContextMap[item.id]; if(context.parentContext) { this.selectItem(context.parentContext.item); } } else { var up = this._selectedIndex - 1; if(up >= 0 && up < this._filteredList.length) { this.selectItem(this.getItem(up)); } } }; ObjectTreeView.prototype.moveSelectionDown = function () { var item = this.getSelectedItem(); var down = this._selectedIndex + (item.htmlLines && item.htmlLines.length > 0 ? item.htmlLines.length : 1); if(down >= 0 && down < this._filteredList.length) { this.selectItem(this.getItem(down)); } }; ObjectTreeView.prototype.onDocumentMouseMove = function (e) { var diff = e.clientX - this._separatorStartX; this._nameColumnWidth = Math.max(ObjectTreeView._minColumnSize, this._nameColumnWidth + diff); this._separatorElement.style.left = (ObjectTreeView._separatorOffset + this._nameColumnWidth) + "px"; this._separatorStartX = Math.max(ObjectTreeView._minColumnSize, e.clientX); return true; }; ObjectTreeView.prototype.onDocumentMouseUp = function (e) { this._separatorElement.classList.remove("listview-grid-separator-visible"); var nameCells = this._gridElement.querySelectorAll(".listview-grid-cell-resize"); for(var i = 0; i < nameCells.length; i++) { (nameCells.item(i)).style.width = this._nameColumnWidth + "px"; } var fullSpanningCells = this._gridElement.querySelectorAll(".listview-grid-cell-full-content"); for(var i = 0; i < fullSpanningCells.length; i++) { (fullSpanningCells.item(i)).style.left = -this._nameColumnWidth + "px"; } document.removeEventListener("mousemove", this._boundDocMouseMoveCallback); document.removeEventListener("mouseup", this._boundDocMouseUpCallback); return true; }; ObjectTreeView.prototype.onMouseDown = function (e) { var _this = this; var target = e.target; var clicked = DomHelpers.findClosestElement(target, ".listview-grid-row, .listview-grid-separator"); if(clicked) { if(clicked.classList.contains("listview-grid-row")) { this.selectRow(clicked, true); if(target.classList.contains("listview-grid-cell-clicksection") && this._clickCallback) { var index = parseInt(clicked.getAttribute("data-index"), 10); var item = this.getItem(index); if(item) { this._clickCallback(item, clicked, target); } } if(target.classList.contains("listview-icon-tree") && e.which === 1) { clicked.focus(); this.toggleRow(clicked); } } else { this._separatorStartX = e.clientX; this._separatorElement.classList.add("listview-grid-separator-visible"); this._boundDocMouseMoveCallback = function (e) { return _this.onDocumentMouseMove(e); }; this._boundDocMouseUpCallback = function (e) { return _this.onDocumentMouseUp(e); }; document.addEventListener("mousemove", this._boundDocMouseMoveCallback); document.addEventListener("mouseup", this._boundDocMouseUpCallback); } } }; ObjectTreeView.prototype.onMouseDblClick = function (e) { var target = e.target; var row = DomHelpers.findClosestElement(target, ".listview-grid-row"); if(row && e.which === 1) { if(target.classList.contains("listview-grid-cell-editsection") && this._editCallback) { var index = parseInt(row.getAttribute("data-index"), 10); var item = this.getItem(index); this._editCallback(item, row, target); } else if(!target.classList.contains("listview-icon-tree")) { this.toggleRow(row); } } }; ObjectTreeView.prototype.onKeyDown = function (e) { if((e.keyCode >= Common.KeyCodes.ARROW_FIRST && e.keyCode <= Common.KeyCodes.ARROW_LAST) || e.keyCode === Common.KeyCodes.MINUS || e.keyCode === Common.KeyCodes.PLUS) { if(this._selectedIndex >= 0) { if(!this._selectedRow) { this.scrollIndexIntoView(this._selectedIndex, true); var row = document.getElementById("row_" + this._selectedIndex); if(row) { this.selectRow(row); } } var index = parseInt(this._selectedRow.getAttribute("data-index"), 10); var item = this.getItem(index); var context = this._dataContextMap[item.id]; var isExpanded = (context.descendantCount > (item.htmlLines ? item.htmlLines.length - 1 : 0)); switch(event.keyCode) { case Common.KeyCodes.MINUS: case Common.KeyCodes.ARROW_LEFT: if(this._hasIndent) { if(isExpanded) { this.toggleRow(this._selectedRow); } else { var parent = context.parentContext; if(parent && parent.item && this.getIndex(parent.item) >= 0) { this.selectItem(parent.item); } } } break; case Common.KeyCodes.ARROW_UP: this.moveSelectionUp(); break; case Common.KeyCodes.PLUS: case Common.KeyCodes.ARROW_RIGHT: if(!isExpanded) { this.toggleRow(this._selectedRow); } break; case Common.KeyCodes.ARROW_DOWN: this.moveSelectionDown(); break; } } e.preventDefault(); return false; } else if(e.keyCode === Common.KeyCodes.A && e.ctrlKey) { e.preventDefault(); return false; } else if(e.keyCode === Common.KeyCodes.SPACE) { e.preventDefault(); return false; } else if(e.keyCode === Common.KeyCodes.TAB) { this._isTabbingOut = true; this._rootElement.focus(); } }; ObjectTreeView.prototype.onFocus = function (e) { var _this = this; this._rootElement.classList.add("listview-grid-focus-within"); if(e.target === this._rootElement && this._selectedRow && !this._isTabbingOut) { if(!this._delayedFocusCookie) { this._delayedFocusCookie = window.setTimeout(function () { var scrollLeftPosition = _this._rootElement.scrollLeft; var scrollTop = _this._rootElement.scrollTop; if(_this._selectedRow) { _this._selectedRow.focus(); } _this._rootElement.scrollLeft = scrollLeftPosition; _this._rootElement.scrollTop = scrollTop; clearTimeout(_this._delayedFocusCookie); _this._delayedFocusCookie = null; }, ObjectTreeView._delayedRenderInterval); } } this._isTabbingOut = false; }; ObjectTreeView.prototype.onBlur = function (e) { this._rootElement.classList.remove("listview-grid-focus-within"); }; ObjectTreeView.prototype.onResize = function (e) { this.requestRender(this._isInitialResize); this._isInitialResize = false; this._rootElement.scrollTop = this._scrollBottom - this._rootElement.clientHeight; }; ObjectTreeView.prototype.onScroll = function (e) { if(!this._ignoreScroll) { if(this._onBeforeScroll) { this._onBeforeScroll(); } var newScrollBottom = this._rootElement.clientHeight + this._rootElement.scrollTop; if(this._filteredList.length > 0 && newScrollBottom > (this._filteredList.length - 1) * this._measurements.rowHeight) { newScrollBottom = this._filteredList.length * this._measurements.rowHeight; } if(newScrollBottom < this._scrollBottom) { this._autoScrollEnabled = false; } else if(!this._autoScrollEnabled) { this._autoScrollEnabled = newScrollBottom >= this._measurements.rowHeight * this._filteredList.length; } if(newScrollBottom !== this._scrollBottom) { this._scrollBottom = newScrollBottom; this.requestRender(); } if(this._onScrollCompleted) { this._onScrollCompleted(); } } }; ObjectTreeView.prototype.onCopy = function (e) { var selectedText = toolwindowHelpers.getSelectedText(); if(selectedText) { var compactText = selectedText.replace(/[\r\n]+/g, "\r\n"); clipboardData.setData("Text", compactText); } e.preventDefault(); e.stopImmediatePropagation(); return false; }; ObjectTreeView.prototype.expandDescendants = function (item, filter) { if(filter && filter(item)) { if(this.isItemExpanded(item)) { this.toggleRowAt(this.getIndexOfItem(this._filteredList, item)); } return; } if(!this.isItemExpanded(item)) { this._toggleCallback(item); } if(item.hasChildren) { var children = this.getItemChildren(item); for(var i = 0; i < children.length; i++) { this.expandDescendants(children[i], filter); } } }; ObjectTreeView.prototype.resize = function () { this.onResize(null); }; ObjectTreeView.prototype.addItems = function (items, linkedTo, linkAsSiblings, preventScrollToItem) { var _this = this; var parentContext = null; var linkedContext = null; var scrollInfo = null; var unfilteredIndexStart = 0; var filteredIndexStart = 0; var unfilteredItems = []; var filteredItems = []; for(var i = 0; i < items.length; i++) { if(items[i].additionalClass === "consoleItemInput") { this._autoScrollEnabled = true; } var isIncluded = (!this._filter || this._filter(items[i])); var id = items[i].id; if(items[i].htmlLines && items[i].htmlLines.length > 0) { for(var j = 0; j < items[i].htmlLines.length; j++) { unfilteredItems.push(id + "::" + j); if(isIncluded) { filteredItems.push(id + "::" + j); } } } else { unfilteredItems.push(id); if(isIncluded) { filteredItems.push(id); } } } if(linkedTo) { parentContext = this._dataContextMap[linkedTo.id]; linkedContext = parentContext; if(linkAsSiblings) { parentContext = linkedContext.parentContext; } } if(parentContext || linkedContext) { var attachTo = linkedContext.item; unfilteredIndexStart = this.getIndexOfItem(this._unfilteredList, attachTo) + 1; filteredIndexStart = this.getIndexOfItem(this._filteredList, attachTo) + 1; if(!linkAsSiblings) { unfilteredIndexStart += (parentContext ? parentContext.descendantCount : 0); filteredIndexStart += (parentContext ? parentContext.expandedCount : 0); } if(parentContext) { parentContext.children = (parentContext.children || []).concat(items); this.updateContextCounts(parentContext, unfilteredItems.length, filteredItems.length); } var index = filteredIndexStart - 1; if(index + filteredItems.length >= this._currentViewport.last - this._scrollPadding - 1) { if(filteredItems.length + 1 < this._currentViewport.unboundLast - this._currentViewport.unboundFirst - this._scrollPadding * 2) { scrollInfo = { index: index + filteredItems.length, top: false }; } else { scrollInfo = { index: index, top: true }; } } } else { unfilteredIndexStart = this._unfilteredList.length; filteredIndexStart = this._filteredList.length; } for(var i = 0; i < items.length; i++) { var htmlLinesCount = items[i].htmlLines && items[i].htmlLines.length > 0 ? items[i].htmlLines.length - 1 : 0; this._dataContextMap[items[i].id] = { item: items[i], children: [], parentContext: parentContext, descendantCount: htmlLinesCount, expandedCount: htmlLinesCount }; } if(this._unfilteredList.length === 0 || unfilteredIndexStart === this._unfilteredList.length) { this._unfilteredList = this._unfilteredList.concat(unfilteredItems); } else { this.spliceArray(this._unfilteredList, unfilteredItems, unfilteredIndexStart); } if(this._filteredList.length === 0 || filteredIndexStart === this._filteredList.length) { this._filteredList = this._filteredList.concat(filteredItems); } else { this.spliceArray(this._filteredList, filteredItems, filteredIndexStart); } this.requestRender(true); if(!preventScrollToItem && scrollInfo) { this._delayedScrollFunction = function () { _this.scrollIndexIntoView(scrollInfo.index, scrollInfo.top); }; } }; ObjectTreeView.prototype.updateItemLines = function (item, oldLineCount) { var id = item.id; var unfilteredIndexStart = this.getIndexOfItem(this._unfilteredList, item); var filteredIndexStart = this.getIndexOfItem(this._filteredList, item); if(unfilteredIndexStart >= 0) { var unfilteredItems = []; var filteredItems = []; for(var i = 0; i < item.htmlLines.length; i++) { unfilteredItems.push(id + "::" + i); if(filteredIndexStart >= 0) { filteredItems.push(id + "::" + i); } } var args = [ unfilteredIndexStart, oldLineCount ].concat(unfilteredItems); Array.prototype.splice.apply(this._unfilteredList, args); if(filteredIndexStart >= 0) { args = [ filteredIndexStart, oldLineCount ].concat(filteredItems); Array.prototype.splice.apply(this._filteredList, args); } this.updateContextCounts(this._dataContextMap[item.id], unfilteredItems.length - oldLineCount, filteredItems.length - oldLineCount); } this.requestRender(true); }; ObjectTreeView.prototype.selectItem = function (item, forceFocus) { if (typeof forceFocus === "undefined") { forceFocus = true; } var _this = this; if(this._delayedRenderCookie) { this._delayedSelectFunction = function () { return _this.selectItem(item, forceFocus); }; return false; } var rows = this._gridElement.querySelectorAll(".listview-grid-row"); for(var i = 0; i < rows.length; i++) { var row = rows.item(i); var index = parseInt(row.getAttribute("data-index"), 10); if(this.getItem(index) === item && (!item.htmlLines || this.getLineIndex(this._filteredList[index]) === 0)) { this.selectRow(row, forceFocus, false); return true; } } var index = this.getIndexOfItem(this._filteredList, item, false); if(index > -1) { this.scrollIndexIntoView(index, true); var row = document.getElementById("row_" + index); if(row) { this.selectRow(row, forceFocus, false); return true; } } return false; }; ObjectTreeView.prototype.selectRow = function (row, forceFocus, selectItem) { if (typeof selectItem === "undefined") { selectItem = true; } var _this = this; if(row && row.classList.contains("listview-grid-row")) { var newIndex = parseInt(row.getAttribute("data-index"), 10); if(newIndex !== this._selectedIndex || forceFocus) { this._selectedIndex = newIndex; this._selectedRow = row; var lineIndex = this.getLineIndex(this._filteredList[this._selectedIndex]); if(lineIndex >= 1 && selectItem) { var newIndex = this._selectedIndex - lineIndex; this.selectItem(this.getItem(newIndex)); return; } if(this._delayedSelectCookie) { window.clearTimeout(this._delayedSelectCookie); } this._delayedSelectCookie = window.setTimeout(function () { if(_this._selectedRow) { var rows = _this._gridElement.querySelectorAll(".listview-grid-row-selected"); for(var i = 0; i < rows.length; i++) { (rows.item(i)).classList.remove("listview-grid-row-selected"); } var item = _this.getItem(_this._selectedIndex); if(!item) { _this._delayedSelectCookie = null; return; } var row = _this._selectedRow; var lineCount = 0; while(lineCount < (item.htmlLines ? item.htmlLines.length : 1) && row) { row.classList.add("listview-grid-row-selected"); row = row.nextSibling; lineCount++; } if(forceFocus || _this.isFocusWithin()) { _this._selectedRow.focus(); } else { _this.scrollIndexIntoView(_this._selectedIndex); } _this.updateGroupLine(); if(_this._selectCallback) { _this._selectCallback(item); } } _this._delayedSelectCookie = null; }, 10); } } }; ObjectTreeView.prototype.toggleRow = function (row) { var index = parseInt(row.getAttribute("data-index"), 10); if(!isNaN(index)) { var treeIcon = row.querySelector(".listview-icon-tree"); if(treeIcon) { this.toggleRowAt(index); } } }; ObjectTreeView.prototype.setRowState = function (index, newState) { var item = this.getItem(index); if(!item) { return; } var context = this._dataContextMap[item.id]; var isCollapsed = context.descendantCount <= (item.htmlLines ? item.htmlLines.length - 1 : 0); if((newState === ObjectTreeView.EXPAND_ROW && isCollapsed) || (newState === ObjectTreeView.COLLAPSE_ROW && !isCollapsed)) { this.toggleRowAt(index); } }; ObjectTreeView.prototype.toggleRowAt = function (index) { var _this = this; var item = this.getItem(index); if(!item) { return; } if(this._onBeforeItemToggle) { this._onBeforeItemToggle(); } var context = this._dataContextMap[item.id]; if(context.descendantCount <= (item.htmlLines ? item.htmlLines.length - 1 : 0)) { if(this._toggleCallback) { this._toggleCallback(context.item); } } else { var lineCount = (item.htmlLines ? item.htmlLines.length - 1 : 0); var unfilteredRemoveCount = (context.descendantCount - lineCount); var filteredRemoveCount = (context.expandedCount - lineCount); var start = this.getIndexOfItem(this._unfilteredList, item); var removed = this._unfilteredList.splice(start + 1 + lineCount, unfilteredRemoveCount); for(var i = 0; i < removed.length; i++) { var id = this.getItemId(removed[i]); this._dataContextMap[id] = null; } this._filteredList.splice(index + 1 + lineCount, filteredRemoveCount); this.updateContextCounts(context, -unfilteredRemoveCount, -filteredRemoveCount); this.requestRender(true, index); if(this._onUpdated) { this._onUpdated([ item ]); } } setTimeout(function () { if(_this._notifyToggleCallback) { _this._notifyToggleCallback(); } }); if(this._onItemToggled) { this._onItemToggled(); } }; ObjectTreeView.prototype.setFilter = function (filter) { this._filter = filter; var map = { }; for(var i = 0; i < this._filteredList.length; i++) { map[this._filteredList[i]] = true; } var newList = []; for(var i = 0; i < this._unfilteredList.length; i++) { var fullId = this._unfilteredList[i]; var context = this._dataContextMap[this.getItemId(fullId)]; var expandChange = 0; var wasInOldView = !!map[fullId]; if(filter(context.item)) { newList.push(fullId); if(!wasInOldView) { expandChange = 1; } } else if(wasInOldView) { expandChange = -1; } if(expandChange) { var currentContext = context.parentContext; if(currentContext) { while(currentContext) { currentContext.expandedCount += expandChange; currentContext = currentContext.parentContext; } } } } var selectedItem = this.getSelectedItem(); if(!selectedItem) { selectedItem = this._previousSelectedItem; } this._filteredList = newList; this.requestRender(true); if(selectedItem) { if(!this.selectItem(selectedItem, false)) { this._previousSelectedItem = selectedItem; } } }; ObjectTreeView.prototype.sortFilteredList = function (getSortString) { var _this = this; this._filteredList.sort(function (a, b) { var a = getSortString(_this._dataContextMap[_this.getItemId(a)].item); var b = getSortString(_this._dataContextMap[_this.getItemId(b)].item); var result = toolwindowHelpers.naturalSort(a.toLowerCase(), b.toLowerCase()); if(result === 0) { return toolwindowHelpers.naturalSort(b, a); } else { return result; } }); }; ObjectTreeView.prototype.getItemCount = function () { return this._filteredList.length; }; ObjectTreeView.prototype.getUnfilteredItemCount = function () { return this._unfilteredList.length; }; ObjectTreeView.prototype.getItemAt = function (index) { if(index >= 0 && index < this._filteredList.length) { return this.getItem(index); } return null; }; ObjectTreeView.prototype.getSelectedItem = function () { if(this._selectedIndex >= 0 && this._selectedIndex < this._filteredList.length) { return this.getItem(this._selectedIndex); } return null; }; ObjectTreeView.prototype.getSelectedRow = function () { if(this._selectedRow) { return this._selectedRow; } else if(this._selectedIndex >= 0 && this._selectedIndex < this._filteredList.length) { this.scrollIndexIntoView(this._selectedIndex); return document.getElementById("row_" + this._selectedIndex); } return null; }; ObjectTreeView.prototype.getItemChildren = function (item) { if(this._dataContextMap[item.id]) { return this._dataContextMap[item.id].children; } return null; }; ObjectTreeView.prototype.isItemExpanded = function (item) { return (this._dataContextMap[item.id] && this._dataContextMap[item.id].descendantCount > (item.htmlLines ? item.htmlLines.length - 1 : 0)); }; ObjectTreeView.prototype.isItemCollapsed = function (item) { return (this._dataContextMap[item.id] && this._dataContextMap[item.id].descendantCount <= (item.htmlLines ? item.htmlLines.length - 1 : 0)); }; ObjectTreeView.prototype.removeItem = function (item, preventRedraw) { if(!item) { return; } var context = this._dataContextMap[item.id]; if(context) { var index = this.getIndexOfItem(this._filteredList, item); if(index !== -1) { this._filteredList.splice(index, context.expandedCount + 1); } var removed = this._unfilteredList.splice(index, context.descendantCount + 1); for(var i = 0; i < removed.length; i++) { var id = this.getItemId(removed[i]); this._dataContextMap[id] = null; } var currentContext = context.parentContext; if(currentContext && currentContext.children) { var i = currentContext.children.indexOf(item); if(i > -1) { currentContext.children.splice(i, 1); } this.updateContextCounts(context, -(context.descendantCount + 1), -(context.expandedCount + 1)); } var itemToSelect; if(this._selectedIndex === index) { itemToSelect = this.getItem(Math.min(index, this._filteredList.length - 1)); } else if(this._selectedIndex > index) { itemToSelect = this.getItem(Math.min(this._selectedIndex - context.expandedCount, this._filteredList.length - 1)); } if(itemToSelect) { this.selectItem(itemToSelect); } this.requestRender(!preventRedraw); } }; ObjectTreeView.prototype.scrollToBottom = function () { var _this = this; if(!this._delayedRenderCookie) { this._rootElement.scrollTop = this._rootElement.scrollHeight; } else { this._delayedScrollFunction = function () { _this.scrollToBottom(); }; } }; ObjectTreeView.prototype.remeasure = function () { this._measurements.update(); this.requestRender(true); }; ObjectTreeView.prototype.refresh = function () { this.requestRender(true); }; ObjectTreeView.prototype.clear = function () { if(this._delayedSelectCookie) { clearTimeout(this._delayedSelectCookie); this._delayedSelectCookie = null; } if(this._delayedFocusCookie) { clearTimeout(this._delayedFocusCookie); this._delayedFocusCookie = null; } this._dataContextMap = { }; this._filteredList = []; this._unfilteredList = []; this._selectedIndex = -1; this._selectedRow = null; this._groupLineElement.style.display = "none"; if(this._onUpdated) { this._onUpdated(null); } this.executePendingRenderRequest(true); }; ObjectTreeView.prototype.expandAllItems = function (rootIndex, filter) { var item = this.getItem(rootIndex); if(!item) { return; } var rootContext = this._dataContextMap[item.id]; if(rootContext) { this.expandDescendants(rootContext.item, filter); } }; ObjectTreeView.prototype.collapseAllItems = function (rootIndex) { var item = this.getItem(rootIndex); if(!item) { return; } var rootContext = this._dataContextMap[item.id]; if(rootContext) { var item = rootContext.item; if(this.isItemExpanded(item)) { this.toggleRowAt(this.getIndexOfItem(this._filteredList, item)); } } }; ObjectTreeView.prototype.getTreeViewItemIndent = function (index) { var indent = (-1); var item = this.getItem(index); if(item) { indent = 0; if(this._dataContextMap) { var context = this._dataContextMap[item.id]; if(context) { indent = this.getIndent(context); } } } return indent; }; ObjectTreeView.prototype.getIndex = function (item) { return this.getIndexOfItem(this._filteredList, item); }; ObjectTreeView.prototype.isAutoScrollToItemEnabled = function (item) { var isLastItem = false; var htmlLinesCount = 1; if(item && item.htmlLines) { htmlLinesCount = item.htmlLines.length; } isLastItem = this.getIndex(item) === (this.getItemCount() - htmlLinesCount); if(this._scrollBottom >= this._measurements.rowHeight * Math.max(0, this._filteredList.length - htmlLinesCount)) { this._autoScrollEnabled = true; } return this._autoScrollEnabled && isLastItem; }; ObjectTreeView.prototype.onDOMAttrModified = function (evt) { if(evt.attrName === "aria-expanded") { var element = evt.target; var toExpand = evt.newValue === "true"; var currentExpanded = element.classList.contains("listview-grid-row-expanded"); var currentCollapsed = element.classList.contains("listview-grid-row-collapsed"); if((toExpand && currentCollapsed) || (!toExpand && currentExpanded)) { this.toggleRow(element); } } }; ObjectTreeView.prototype.addDOMAttrModifiedHandler = function (e) { e.addEventListener("DOMAttrModified", this.onDOMAttrModified.bind(this)); }; return ObjectTreeView; })(); ObjectView.ObjectTreeView = ObjectTreeView; })(Common.ObjectView || (Common.ObjectView = {})); var ObjectView = Common.ObjectView; })(Common || (Common = {})); //@ sourceMappingURL=objectTreeView.js.map // treeViewUtilities.ts var Common; (function (Common) { (function (ObjectView) { "use strict"; var TreeViewUtils = (function () { function TreeViewUtils() { } TreeViewUtils.jsonIndentCount = 12; TreeViewUtils.consoleNotifyType = { assert: "consoleItemError", error: "consoleItemError", info: "consoleItemInfo", log: "consoleItemLog", warn: "consoleItemWarn", internalMessage: "internalMessage" }; TreeViewUtils.consoleInternalMessage = { startGroup: "startGroup", startGroupCollapsed: "startGroupCollapsed", endGroup: "endGroup", displayTraceStyles: "displayTraceStyles" }; TreeViewUtils.consoleUITypeStrings = { functionName: "[function]", objectName: "[object]", arrayName: "[array]", emptyArray: " [ ]", emptyObject: " { }", expandableArray: " [...]", expandableObject: " {...}" }; TreeViewUtils.consoleFilterId = { all: -1, error: 0, warning: 1, message: 2, log: 3 }; TreeViewUtils.getDetailedTypeOf = function getDetailedTypeOf(value, constructors) { if(value === undefined) { return "undefined"; } var type = (typeof value); if(type === "object" && constructors) { if(value) { for(var i = 0; i < constructors.length; i++) { var arrayCon = (constructors[i] && constructors[i].array ? constructors[i].array : (new Array()).constructor); var dateCon = (constructors[i] && constructors[i].date ? constructors[i].date : (new Date()).constructor); var regexCon = (constructors[i] && constructors[i].regex ? constructors[i].regex : (new RegExp("")).constructor); try { if(value.constructor === arrayCon) { return "array"; } else if(value.constructor === dateCon) { return "date"; } else if(value.constructor === regexCon) { return "regex"; } } catch (e) { } } } else { return "null"; } return "object"; } return type; }; TreeViewUtils.wrapInQuotes = function wrapInQuotes(stringToWrap) { return "\"" + stringToWrap.replace(/\\"/g, "\"") + "\""; }; TreeViewUtils.getVisibleHtmlElementText = function getVisibleHtmlElementText(element) { if($m(element).is(":visible")) { if(element.nodeType === 3) { return element.nodeValue; } var visibleText = "", i = 0; while(element.childNodes[i]) { visibleText += TreeViewUtils.getVisibleHtmlElementText(element.childNodes[i]); i++; } return visibleText; } return ""; }; TreeViewUtils.createPadding = function createPadding(levels, singleLevelPadding) { if(levels === 0) { return ""; } var padding = ""; for(var i = 0; i < levels; i++) { padding += singleLevelPadding; } return padding; }; TreeViewUtils.getIndentedObjectString = function getIndentedObjectString(obj, detailedType, stringPadding, indentString, newLineString, useEncodeHtml, useTrim) { var text = ""; var objectString = "" + obj; if((/\S/).test(objectString)) { var indentCount = 0; var finalLines = []; if(detailedType === "string") { if(useEncodeHtml) { objectString = toolwindowHelpers.htmlEscape(objectString); } text = objectString.replace(/(\r\n|\n\r|\r|\n)/g, newLineString); } else { var lines = objectString.replace(/^\s+|\s+$/g, "").split(/[\r\n]+/); for(var lineIndex = 0; lineIndex < lines.length; lineIndex++) { if(lines[lineIndex] !== "") { var indent = ""; var lineText = lines[lineIndex]; if(useEncodeHtml) { lineText = toolwindowHelpers.htmlEscape(lineText); } lineText = lineText.replace(/^\s+|\s+$/g, ""); if(detailedType === "function") { if((/^\}/).test(lineText)) { indentCount--; } for(var i = 0; i < indentCount; i++) { indent += indentString; } if((/\{$/).test(lineText)) { indentCount++; } } finalLines.push(indent + lineText); } } var lineBreaks = newLineString; if(detailedType === "function" && finalLines.length === 3) { finalLines[1] = finalLines[1].replace(/^( )+/, "").replace(/^\s+|\s+$/g, ""); finalLines[2] = finalLines[2].replace(/^\s+|\s+$/g, ""); lineBreaks = " "; } text = finalLines.join(lineBreaks); } } return text; }; TreeViewUtils.propertyNameCompare = function propertyNameCompare(a, b) { var aValue; var bValue; if(!isNaN(aValue = parseInt(a, 10)) && !isNaN(bValue = parseInt(b, 10))) { return aValue - bValue; } else { var al = a.toLowerCase(); var bl = b.toLowerCase(); if(al === bl) { return TreeViewUtils.stringValueCompare(a, b); } else { return TreeViewUtils.stringValueCompare(al, bl); } } }; TreeViewUtils.stringValueCompare = function stringValueCompare(a, b) { if(a < b) { return -1; } else if(a > b) { return 1; } else { return 0; } }; return TreeViewUtils; })(); ObjectView.TreeViewUtils = TreeViewUtils; var TreeViewValueStringBuilder = (function () { function TreeViewValueStringBuilder() { } TreeViewValueStringBuilder.createValueString = function createValueString(properties, detailedType, incomplete) { if (typeof incomplete === "undefined") { incomplete = false; } if(!properties || typeof (properties) !== "object") { return; } var valueString; var isFirstProperty = true; var headToken = ""; var appendPropertyName; var tailToken = ""; switch(detailedType) { case "object": headToken = headToken + "{"; appendPropertyName = true; tailToken = "}" + tailToken; break; case "array": headToken = headToken + "["; appendPropertyName = false; tailToken = "]" + tailToken; properties = properties.filter(function (element, index, array) { return !isNaN(parseInt(element.propertyName, 10)); }); break; default: return; } valueString = headToken; for(var i = 0; i < properties.length; i++) { if(properties[i].propertyName.substr(0, 2) === "__" || properties[i].propertyName === "[functions]") { continue; } if(!isFirstProperty) { valueString += ", "; } isFirstProperty = false; if(appendPropertyName) { valueString += TreeViewValueStringBuilder.createPropertyNameToken(properties[i]); valueString += ": "; } valueString += TreeViewValueStringBuilder.createPropertyValueToken(properties[i]); if(i > 20) { incomplete = true; break; } } if(incomplete) { tailToken = " ..." + tailToken; } valueString = valueString + tailToken; return valueString; }; TreeViewValueStringBuilder.createPropertyValueToken = function createPropertyValueToken(property) { var className; switch(property.propertyValue.detailedType) { case "undefined": className = "valueStringToken-Undefined"; break; case "null": className = "valueStringToken-Null"; break; case "boolean": className = "valueStringToken-Bool"; break; case "number": className = "valueStringToken-Number"; break; case "string": className = "valueStringToken-String"; break; case "function": className = "valueStringToken-Function"; break; case "array": className = "valueStringToken-Array"; break; case "object": className = "valueStringToken-Object"; break; default: className = "valueStringToken-Default"; } return "" + property.propertyValue.valueString + ""; }; TreeViewValueStringBuilder.createPropertyNameToken = function createPropertyNameToken(property) { var className = "valueStringToken-PropertyName"; var escapedPropertyName = Common.RemoteHelpers.htmlEscapeRemote(property.propertyName); return "" + escapedPropertyName + ""; }; TreeViewValueStringBuilder.createPropertyValueString = function createPropertyValueString(propertyValue, obj) { try { switch(propertyValue.detailedType) { case "array": var delimiterIndex = (propertyValue.value).indexOf(":"); if(delimiterIndex !== -1) { return "Array[" + obj.length + "]"; break; } case "object": var delimiterIndex = propertyValue.name.indexOf(" "); if(delimiterIndex !== -1) { return (propertyValue.name.substr(delimiterIndex + 1, propertyValue.name.length - delimiterIndex - 2)) + " {...}"; break; } } } catch (ex) { } return propertyValue.detailedType; }; TreeViewValueStringBuilder.formatPropertyValueString = function formatPropertyValueString(valueString) { if(valueString && typeof (valueString) === "string") { var newValueString = valueString.length > 15 ? valueString.substr(0, 12) + "...\"" : valueString; newValueString = String.prototype.replace.call(newValueString, /(\r\n|\n\r|\r|\n)/g, " "); newValueString = Common.RemoteHelpers.htmlEscapeRemote(newValueString); return newValueString; } return valueString; }; return TreeViewValueStringBuilder; })(); ObjectView.TreeViewValueStringBuilder = TreeViewValueStringBuilder; })(Common.ObjectView || (Common.ObjectView = {})); var ObjectView = Common.ObjectView; })(Common || (Common = {})); //@ sourceMappingURL=treeViewUtilities.js.map // treeViewItems.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var Common; (function (Common) { (function (ObjectView) { "use strict"; (function (TreeViewNotifyType) { TreeViewNotifyType._map = []; TreeViewNotifyType._map[0] = "assert"; TreeViewNotifyType.assert = 0; TreeViewNotifyType._map[1] = "error"; TreeViewNotifyType.error = 1; TreeViewNotifyType._map[2] = "info"; TreeViewNotifyType.info = 2; TreeViewNotifyType._map[3] = "log"; TreeViewNotifyType.log = 3; TreeViewNotifyType._map[4] = "warn"; TreeViewNotifyType.warn = 4; })(ObjectView.TreeViewNotifyType || (ObjectView.TreeViewNotifyType = {})); var TreeViewNotifyType = ObjectView.TreeViewNotifyType; (function (ViewableTypeFlags) { ViewableTypeFlags._map = []; ViewableTypeFlags.object = 1; ViewableTypeFlags.html = 2; })(ObjectView.ViewableTypeFlags || (ObjectView.ViewableTypeFlags = {})); var ViewableTypeFlags = ObjectView.ViewableTypeFlags; var TreeViewItem = (function () { function TreeViewItem(value, hasChildren, hasIcon, hasSeparator, name, additionalClass, htmlLines, fullHtmlLines) { this._id = TreeViewItem.idCounter++; this._name = name; this._value = value; this._hasChildren = hasChildren; this._hasIcon = hasIcon; this._hasSeparator = hasSeparator; this._additionalClass = additionalClass; this._htmlLines = htmlLines; this._fullHtmlLines = fullHtmlLines; } TreeViewItem.idCounter = -1; Object.defineProperty(TreeViewItem.prototype, "id", { get: function () { return "" + this._id; }, enumerable: true, configurable: true }); Object.defineProperty(TreeViewItem.prototype, "name", { get: function () { return this._name; }, enumerable: true, configurable: true }); Object.defineProperty(TreeViewItem.prototype, "value", { get: function () { return this._value; }, set: function (val) { this._value = val; }, enumerable: true, configurable: true }); Object.defineProperty(TreeViewItem.prototype, "hasChildren", { get: function () { return this._hasChildren; }, set: function (value) { this._hasChildren = value; }, enumerable: true, configurable: true }); Object.defineProperty(TreeViewItem.prototype, "hasIcon", { get: function () { return this._hasIcon; }, enumerable: true, configurable: true }); Object.defineProperty(TreeViewItem.prototype, "hasSeparator", { get: function () { return this._hasSeparator; }, enumerable: true, configurable: true }); Object.defineProperty(TreeViewItem.prototype, "additionalClass", { get: function () { return this._additionalClass; }, set: function (value) { this._additionalClass = value; }, enumerable: true, configurable: true }); Object.defineProperty(TreeViewItem.prototype, "htmlLines", { get: function () { return this._htmlLines; }, set: function (lines) { if(this._htmlLines) { if(this._htmlLines.length !== lines.length) { throw new Error("The number of lines cannot be changed for a TreeView item after initialization"); } } this._htmlLines = lines; }, enumerable: true, configurable: true }); Object.defineProperty(TreeViewItem.prototype, "consoleItemId", { get: function () { return this._id; }, enumerable: true, configurable: true }); TreeViewItem.prototype.getCopyText = function (indent) { if (typeof indent === "undefined") { indent = ""; } return this._value; }; TreeViewItem.prototype.getWatchExpression = function () { return undefined; }; TreeViewItem.prototype.expandLines = function () { if(this._fullHtmlLines && this._fullHtmlLines.length > 0) { this._htmlLines = this._fullHtmlLines.slice(1); return true; } return false; }; TreeViewItem.encodeValueForListItem = function encodeValueForListItem(value, detailedType, isExpandable, limitToSingleLine, appendEllipses) { if (typeof appendEllipses === "undefined") { appendEllipses = true; } var text = ""; var htmlLines = null; if(!detailedType) { detailedType = Common.ObjectView.TreeViewUtils.getDetailedTypeOf(value); } switch(detailedType) { case "array": text = (value || Common.ObjectView.TreeViewUtils.consoleUITypeStrings.arrayName); if(appendEllipses) { text += (isExpandable ? Common.ObjectView.TreeViewUtils.consoleUITypeStrings.expandableArray : Common.ObjectView.TreeViewUtils.consoleUITypeStrings.emptyArray); } break; case "object": text = (value || Common.ObjectView.TreeViewUtils.consoleUITypeStrings.objectName); if(appendEllipses) { text += (isExpandable ? Common.ObjectView.TreeViewUtils.consoleUITypeStrings.expandableObject : Common.ObjectView.TreeViewUtils.consoleUITypeStrings.emptyObject); } break; case "null": text = "null"; break; case "undefined": text = "undefined"; break; default: text = "" + value; htmlLines = TreeViewItem.getHtmlTextLines(text, detailedType); if(detailedType !== "string" && htmlLines.length === 1) { text = htmlLines[0].replace(/&/g, "&").replace(/>/g, ">").replace(/</g, "<").replace(/"/g, '"').replace(/'/g, "'"); htmlLines = null; } else if(limitToSingleLine && htmlLines.length > 1) { text = TreeViewItem.getFirstLine(value); htmlLines.splice(0, 0, "" + htmlLines[0].replace("
    ", "").replace("
    ", "") + " ...
    "); text += " ..."; } break; } return { value: text, htmlLines: htmlLines }; }; TreeViewItem.getHtmlTextLines = function getHtmlTextLines(objectString, detailedType) { var finalLines = null; if(typeof objectString === "string") { objectString = objectString.replace(/(\r\n|\n\r|\r|\n)/g, "\r\n"); var lines = objectString.split('\r\n'); if(lines.length > 0) { var indentCount = 0; finalLines = []; for(var lineIndex = 0; lineIndex < lines.length; lineIndex++) { if(detailedType === "string" || lines[lineIndex] !== "") { var indent = ""; var lineText = lines[lineIndex]; lineText = toolwindowHelpers.htmlEscape(lineText); if(detailedType === "string") { lineText = "
    " + lineText + "
    "; } else { lineText = lineText.replace(/^\s+|\s+$/g, ""); } if(detailedType === "function") { if((/^\}/).test(lineText)) { indentCount--; } for(var i = 0; i < indentCount; i++) { indent += "   "; } if((/\{$/).test(lineText)) { indentCount++; } } finalLines.push(indent + lineText); } } if(detailedType === "function" && finalLines.length === 3) { finalLines[1] = finalLines[1].replace(/^( )+/, ""); finalLines[2] = finalLines[2]; finalLines = [ finalLines.join(" ") ]; } } } return finalLines; }; TreeViewItem.getHtmlTreeLines = function getHtmlTreeLines(elementObject, nodeIndex) { var id = elementObject.uid; var tag = elementObject.tag; var safeTag = toolwindowHelpers.htmlEscape(tag); var text = elementObject.text; var isExpandable = elementObject.hasChildren; var attributes = elementObject.attributes; var rootTagToShow = elementObject.rootTagToShow; var header, headerText = ""; var footer, footerText = ""; if(tag === "#document") { var rootHeader = ""; var rootFooter = ""; if(rootTagToShow) { var safeRootTag = toolwindowHelpers.htmlEscape(rootTagToShow); rootHeader = "<" + safeRootTag + ">"; rootFooter = "</" + safeRootTag + ">"; headerText = "<" + safeRootTag + ">"; footerText = ""; } header = "" + rootHeader + ""; footer = "" + rootFooter + ""; } else if(tag === "#doctype") { header = ""; footer = ""; } else if(tag === "#comment") { header = "<!--"; footer = "-->"; headerText = ""; } else if(tag === null || tag === undefined) { header = ""; footer = ""; } else { var attributesHtml = ""; var attributesText = ""; if(attributes && attributes.length > 0) { for(var j = 0; j < attributes.length; j++) { attributesHtml += " " + toolwindowHelpers.htmlEscape(attributes[j].name) + "=\"" + "" + toolwindowHelpers.htmlEscape(attributes[j].value) + "\""; attributesText += " " + toolwindowHelpers.htmlEscape(attributes[j].name) + "=\"" + toolwindowHelpers.htmlEscape(attributes[j].value) + "\""; } } header = "<" + safeTag + "" + attributesHtml + ">"; headerText = "<" + safeTag + attributesText + ">"; footer = "</" + safeTag + ">"; footerText = ""; } var elipsis = (isExpandable ? "..." : ""); var collapsedFooter = (isExpandable ? "" + elipsis + footer + "" : footer); var nodeNumber = ""; if(nodeIndex !== null && !isNaN(nodeIndex)) { nodeNumber = "" + nodeIndex + ""; } var containerStart = ""; var containerEnd = ""; var lines = []; if(!text) { lines.push(containerStart + nodeNumber + header + collapsedFooter + containerEnd); } else { var textLines = TreeViewItem.getHtmlTextLines(text, "string"); if(textLines.length <= 1) { headerText += text; var inlineText = "" + textLines[0] + ""; lines.push(containerStart + nodeNumber + header + inlineText + collapsedFooter + containerEnd); } else { headerText += text; footerText = ""; for(var i = 0; i < textLines.length; i++) { lines.push(containerStart + "" + textLines[i] + "" + containerEnd); } } } if(isExpandable) { lines.push(containerStart + "" + footer + "" + containerEnd); } return { headerText: headerText, footerText: footerText, htmlLines: lines }; }; TreeViewItem.getFirstLine = function getFirstLine(value) { var firstLine = value; if(firstLine) { var fullText = firstLine.replace(/(\r\n|\n\r|\r|\n)/g, "\r\n"); var lines = fullText.split('\r\n'); if(lines.length > 0) { for(var lineIndex = 0; lineIndex < lines.length; lineIndex++) { var lineText = lines[lineIndex].replace(/^\s+|\s+$/g, ""); if(lineText.length > 0) { firstLine = lineText; break; } } } } return firstLine; }; return TreeViewItem; })(); ObjectView.TreeViewItem = TreeViewItem; var TreeViewInputItem = (function (_super) { __extends(TreeViewInputItem, _super); function TreeViewInputItem(command, onCompleteCallback) { var listValue = TreeViewItem.encodeValueForListItem(command, "string"); _super.call(this, listValue.value, false, true, true, null, "consoleItemInput", listValue.htmlLines); this._inputCommand = command; this._onCompleteCallback = onCompleteCallback; this._outputItem = null; } TreeViewInputItem.prototype.getCopyText = function (indent) { if (typeof indent === "undefined") { indent = ""; } return indent + this._inputCommand; }; TreeViewInputItem.prototype.getWatchExpression = function () { return this._inputCommand; }; TreeViewInputItem.prototype.executeCallback = function (outputItem) { if(this._onCompleteCallback) { this._onCompleteCallback(this.consoleItemId, outputItem.consoleItemId, (outputItem.additionalClass || ""), (outputItem.value || "")); } }; return TreeViewInputItem; })(TreeViewItem); ObjectView.TreeViewInputItem = TreeViewInputItem; var TreeViewOutputItem = (function (_super) { __extends(TreeViewOutputItem, _super); function TreeViewOutputItem(inputId, value, hasChildren, hasIcon, hasSeparator, name, additionalClass, htmlLines, fullHtmlLines) { if(!inputId || parseInt(inputId, 10) === -1) { additionalClass = (additionalClass || "") + " consoleItemOutput-Async"; } _super.call(this, value, hasChildren, hasIcon, hasSeparator, name, additionalClass, htmlLines, fullHtmlLines); this._matchingInputId = (typeof inputId !== "undefined" && typeof inputId !== "null" ? inputId : "-1"); } Object.defineProperty(TreeViewOutputItem.prototype, "matchingInputId", { get: function () { return this._matchingInputId; }, enumerable: true, configurable: true }); Object.defineProperty(TreeViewOutputItem.prototype, "viewableTypeFlags", { get: function () { return 0; }, enumerable: true, configurable: true }); Object.defineProperty(TreeViewOutputItem.prototype, "typeEvaluationId", { get: function () { return null; }, enumerable: true, configurable: true }); TreeViewOutputItem.prototype.evaluateAsType = function (proxy, viewType, onOutput) { if((this.viewableTypeFlags & viewType) === viewType) { switch(viewType) { case ViewableTypeFlags.html: proxy.callRemote("getObjectItemAsHtml", [ this.typeEvaluationId ], onOutput); break; case ViewableTypeFlags.object: proxy.callRemote("getHtmlItemAsObject", [ this.typeEvaluationId ], onOutput); break; default: return false; } return true; } return false; }; return TreeViewOutputItem; })(TreeViewItem); ObjectView.TreeViewOutputItem = TreeViewOutputItem; var TreeViewObjectItem = (function (_super) { __extends(TreeViewObjectItem, _super); function TreeViewObjectItem(outputObject, nameOverride, watchExpression) { if(watchExpression) { this._watchExpression = watchExpression; } var className = "consoleItemOutput"; var useValueString = false; switch(outputObject.detailedType) { case "exception": className += " consoleItemOutput-Exception"; break; case "undefined": className += " consoleItemOutput-Undefined"; break; case "null": className += " consoleItemOutput-Null"; break; case "boolean": className += " consoleItemOutput-Bool"; break; case "number": className += " consoleItemOutput-Number"; break; case "string": className += " consoleItemOutput-String"; break; case "function": className += " consoleItemOutput-Function"; break; case "array": className += " consoleItemOutput-Array"; useValueString = true; break; case "object": className += " consoleItemOutput-Object"; useValueString = true; break; case "internal": className += " consoleItemOutput-Internal"; break; } var isChild = (!!nameOverride); useValueString = useValueString && !isChild; var hasIcon = (!isChild); var limitToSingleLine = (isChild || (outputObject.detailedType === "function" && outputObject.isExpandable)); var listValue = TreeViewItem.encodeValueForListItem(outputObject.value, outputObject.detailedType, outputObject.isExpandable, limitToSingleLine); var fullHtmlLines = null; if(limitToSingleLine && listValue.htmlLines && listValue.htmlLines.length > 1) { fullHtmlLines = listValue.htmlLines.slice(0); listValue.htmlLines = [ listValue.htmlLines.shift() ]; } var name = TreeViewItem.getFirstLine(nameOverride || outputObject.name); if(outputObject.isExpandable) { var displayValue; if(useValueString) { var valueString = outputObject.valueString; displayValue = valueString || outputObject.name; } else { displayValue = outputObject.name; } var listValue = TreeViewItem.encodeValueForListItem(displayValue, outputObject.detailedType, true, true, !useValueString); if((!listValue.htmlLines) && useValueString) { listValue.htmlLines = [ listValue.value ]; } if(limitToSingleLine && listValue.htmlLines && listValue.htmlLines.length > 1) { fullHtmlLines = listValue.htmlLines.slice(0); listValue.htmlLines = [ listValue.htmlLines.shift() ]; } switch(outputObject.detailedType) { case "function": if(!isChild) { name = null; } else { name = (name || Common.ObjectView.TreeViewUtils.consoleUITypeStrings.functionName); } break; case "array": name = (name || Common.ObjectView.TreeViewUtils.consoleUITypeStrings.arrayName); break; default: name = (name || Common.ObjectView.TreeViewUtils.consoleUITypeStrings.objectName); break; } } _super.call(this, outputObject.inputId, listValue.value, outputObject.isExpandable, hasIcon, !isChild, name, className, listValue.htmlLines, fullHtmlLines); this._originalObject = outputObject; if(Array.isArray(outputObject.value)) { this._children = this.createChildren(); this._hasLoadedChildren = true; } else { this._remoteExpansionId = outputObject.value; this._hasLoadedChildren = false; } } TreeViewObjectItem.prototype.getWatchExpression = function () { if(this.name === "[functions]" || !this.name || this.name.indexOf("...") >= 0) { return undefined; } return this._watchExpression; }; TreeViewObjectItem.prototype.buildWatchExpressionForChild = function (childConsoleItemName, parentWatchExpression) { var watchExpression; if(!parentWatchExpression) { } else if(childConsoleItemName === "[functions]" || childConsoleItemName.indexOf("...") >= 0) { watchExpression = parentWatchExpression; } else if(!isNaN(parseInt(childConsoleItemName))) { watchExpression = parentWatchExpression + "[" + childConsoleItemName + "]"; } else { watchExpression = parentWatchExpression + "." + childConsoleItemName; } return watchExpression; }; TreeViewObjectItem.prototype.createChildren = function () { var obj = this._originalObject; if(!this._sortedPropertyNames) { this._sortedPropertyNames = toolwindowHelpers.getSortedArrayProperties(obj.value, "propertyName"); } var functions, prototype; var children = []; for(var i = 0; i < this._sortedPropertyNames.length; i++) { var propIndex = this._sortedPropertyNames[i]; var propName = obj.value[propIndex].propertyName; var childObject = obj.value[propIndex].propertyValue; var childWatchExpression = this.buildWatchExpressionForChild(propName, this._watchExpression); if(propName === "[functions]" && childObject.isInternalProperty === true) { functions = new TreeViewObjectItem(childObject, propName, childWatchExpression); } else { var child = new TreeViewObjectItem(childObject, propName, childWatchExpression); children.push(child); } } if(functions) { children.unshift(functions); } return children; }; TreeViewObjectItem.prototype.loadChildren = function (proxy, onExpansionComplete) { var _this = this; proxy.callRemote("getObjectChildren", [ this._remoteExpansionId ], function (expandedObj) { if(!expandedObj) { _this._originalObject.value = [ { propertyName: "undefined", propertyValue: { detailedType: "undefined" } } ]; } else if(!expandedObj.isExpandable) { _this._originalObject.value = [ { propertyName: "undefined", propertyValue: { detailedType: "undefined" } } ]; } else { _this._originalObject.value = expandedObj.value; } _this._children = _this.createChildren(); _this._hasLoadedChildren = true; onExpansionComplete(); }); }; TreeViewObjectItem.prototype.createOnExpansionCompleteWrapper = function (onComplete) { var _this = this; return function () { onComplete(_this._children); toolwindowHelpers.codeMarker(toolwindowHelpers.codeMarkers.perfBrowserTools_DiagnosticsToolWindowsExpandConsoleObjectEnd); }; }; Object.defineProperty(TreeViewObjectItem.prototype, "viewableTypeFlags", { get: function () { return (this._originalObject.isHtmlViewableType ? ViewableTypeFlags.html : 0); }, enumerable: true, configurable: true }); Object.defineProperty(TreeViewObjectItem.prototype, "typeEvaluationId", { get: function () { return (this._remoteExpansionId || this._originalObject.uid); }, enumerable: true, configurable: true }); Object.defineProperty(TreeViewObjectItem.prototype, "isExpandable", { get: function () { return this._originalObject.isExpandable; }, enumerable: true, configurable: true }); TreeViewObjectItem.prototype.getChildren = function (proxy, onComplete) { if(this.isExpandable) { toolwindowHelpers.codeMarker(toolwindowHelpers.codeMarkers.perfBrowserTools_DiagnosticsToolWindowsExpandConsoleObjectBegin); var onExpansionComplete = this.createOnExpansionCompleteWrapper(onComplete); if(this._hasLoadedChildren) { onExpansionComplete(); } else { this.loadChildren(proxy, onExpansionComplete); } } }; TreeViewObjectItem.prototype.getCopyText = function (indent) { if (typeof indent === "undefined") { indent = ""; } var text = indent; switch(this._originalObject.detailedType) { case "array": case "object": var openSymbol = "{"; var closeSymbol = "}"; if(this._originalObject.detailedType === "array") { openSymbol = "["; closeSymbol = "]"; } if(!this._children || this._children.length === 0) { text += openSymbol + " " + closeSymbol; } else { text += openSymbol + "\r\n"; var nextIndent = indent + (indent || " "); for(var i = 0; i < this._children.length; i++) { var child = this._children[i]; if(i !== 0) { text += ",\r\n"; } text += nextIndent + child.name + ": " + child.getCopyText(nextIndent).trim(); } text += "\r\n" + indent + closeSymbol; } break; case "string": if(this._originalObject && this._originalObject.value) { text += this._originalObject.value; } else { text += this.value; } break; default: text += this.value; break; } return text; }; return TreeViewObjectItem; })(TreeViewOutputItem); ObjectView.TreeViewObjectItem = TreeViewObjectItem; var TreeViewHtmlItem = (function (_super) { __extends(TreeViewHtmlItem, _super); function TreeViewHtmlItem(outputObject, htmlValue, nodeIndex) { var inputId; var remoteId; var isExpandable; var value; var hasSeparator; if(htmlValue && htmlValue.localizeId) { try { htmlValue.text = toolwindowHelpers.loadString(htmlValue.localizeId); } catch (e) { } } if(outputObject) { inputId = outputObject.inputId; remoteId = outputObject.value.uid; isExpandable = outputObject.value.hasChildren; value = outputObject.value; hasSeparator = true; } else { inputId = "-1"; remoteId = htmlValue.uid; isExpandable = htmlValue.hasChildren; value = htmlValue; hasSeparator = false; } var listValue = TreeViewItem.getHtmlTreeLines(value, nodeIndex); if(isExpandable) { this._footerLine = listValue.htmlLines.pop(); } this._headerText = listValue.headerText; this._footerText = listValue.footerText; _super.call(this, inputId, listValue.headerText + listValue.footerText, isExpandable, hasSeparator, hasSeparator, null, "consoleItemOutput", listValue.htmlLines); this._originalObject = (outputObject || htmlValue); this._remoteExpansionId = remoteId; this._isExpandable = isExpandable; } TreeViewHtmlItem.prototype.createChildren = function (childValues) { var htmlItem = (this._originalObject.value ? this._originalObject.value : this._originalObject); var useNodeNumbers = (htmlItem.tag === "NodeList" || htmlItem.tag === "HtmlCollection"); var children = []; for(var i = 0; i < childValues.length; i++) { var htmlValue = childValues[i]; if(!htmlValue.tag && (!htmlValue.text || !(/\S/).test(htmlValue.text))) { continue; } var child = new TreeViewHtmlItem(null, htmlValue, (useNodeNumbers ? i : undefined)); children.push(child); } var footer = new TreeViewItem(this._footerText, false, false, false, null, "consoleItemOutput", [ this._footerLine ]); children.push(footer); return children; }; TreeViewHtmlItem.prototype.loadChildren = function (proxy, onExpansionComplete) { var _this = this; proxy.callRemote("getHtmlChildren", [ this._remoteExpansionId ], function (childValues) { if(!childValues) { childValues = []; } _this._children = _this.createChildren(childValues); _this._hasLoadedChildren = true; onExpansionComplete(); }); }; TreeViewHtmlItem.prototype.createOnExpansionCompleteWrapper = function (onComplete) { var _this = this; return function () { onComplete(_this._children); toolwindowHelpers.codeMarker(toolwindowHelpers.codeMarkers.perfBrowserTools_DiagnosticsToolWindowsExpandConsoleObjectEnd); }; }; Object.defineProperty(TreeViewHtmlItem.prototype, "viewableTypeFlags", { get: function () { return ViewableTypeFlags.object; }, enumerable: true, configurable: true }); Object.defineProperty(TreeViewHtmlItem.prototype, "typeEvaluationId", { get: function () { return (this._originalObject.value ? this._originalObject.value.uid : this._originalObject.uid); }, enumerable: true, configurable: true }); Object.defineProperty(TreeViewHtmlItem.prototype, "isExpandable", { get: function () { return this._isExpandable; }, enumerable: true, configurable: true }); TreeViewHtmlItem.prototype.getChildren = function (proxy, onComplete) { if(this.isExpandable) { toolwindowHelpers.codeMarker(toolwindowHelpers.codeMarkers.perfBrowserTools_DiagnosticsToolWindowsExpandConsoleObjectBegin); var onExpansionComplete = this.createOnExpansionCompleteWrapper(onComplete); if(this._hasLoadedChildren) { onExpansionComplete(); } else { this.loadChildren(proxy, onExpansionComplete); } } }; TreeViewHtmlItem.prototype.getCopyText = function (indent) { if (typeof indent === "undefined") { indent = ""; } var text = indent; text += this._headerText; if(!this._children || this._children.length === 0) { text += this._footerText; } else { var nextIndent = indent + (indent || " "); for(var i = 0; i < this._children.length; i++) { var child = this._children[i]; text += "\r\n" + nextIndent + child.getCopyText(nextIndent); } text += "\r\n" + indent + this._footerText; } return text; }; return TreeViewHtmlItem; })(TreeViewOutputItem); ObjectView.TreeViewHtmlItem = TreeViewHtmlItem; var TreeViewTraceStylesItem = (function (_super) { __extends(TreeViewTraceStylesItem, _super); function TreeViewTraceStylesItem(outputObject) { this._originalObject = outputObject; var styleRows = { }; var styleGroups = { inherited: { }, declared: { } }; var allStyles = outputObject.value; var allStylesLength = allStyles.length; for(var index = 0; index < allStylesLength; index++) { var currentStyle = allStyles[index]; var currentStrikeKey = currentStyle.strikeKey = TreeViewTraceStylesItem.getStrikeKey(currentStyle); if(!styleRows[currentStrikeKey]) { styleRows[currentStrikeKey] = []; styleRows[currentStrikeKey].activeUid = null; } styleRows[currentStrikeKey].push({ index: index, uid: currentStyle.uid, style: currentStyle }); } for(var property in styleRows) { styleRows[property] = styleRows[property].sort(function (a, b) { return a.index > b.index; }); var styleRowsLength = styleRows[property].length; for(var index = 0; index < styleRowsLength; index++) { var group = styleRows[property]; if(group[index].style.enabled) { group.activeUid = group[0].uid; break; } } } var styleKeys = []; for(var styleNames in styleRows) { styleKeys.push({ key: styleNames }); } var sortedStyleKeys = toolwindowHelpers.getSortedArrayProperties(styleKeys, "key"); var children = []; var sortedStyleKeysLength = sortedStyleKeys.length; for(var keyIndex = 0; keyIndex < sortedStyleKeysLength; keyIndex++) { var styleName = styleKeys[sortedStyleKeys[keyIndex]].key; var styleRules = styleRows[styleName]; var activeUid = styleRules.activeUid; var rules = []; var activeStyleHtml; var activeStyleValue; var styleRulesLength = styleRules.length; for(var index = 0; index < styleRulesLength; index++) { var cssRuleApplied = styleRules[index]; if(cssRuleApplied && cssRuleApplied.style) { var style = cssRuleApplied.style; var rule = new TreeViewStyleItem(style, activeUid === style.uid); if(activeUid === style.uid) { activeStyleHtml = rule.getHtmlContent(); activeStyleValue = style.value; } rules.push(rule); } } var propGroup = new TreeViewCssStyleGroup(styleName, activeStyleHtml, activeStyleValue, false); var rulesLength = rules.length; for(var i = 0; i < rulesLength; i++) { propGroup.addChild(rules[i]); } children.push(propGroup); } this._children = children; var groupName = toolwindowHelpers.loadString("CSSTraceStyles"); _super.call(this, outputObject.inputId, groupName, outputObject.isExpandable, false); } TreeViewTraceStylesItem.prototype.getChildren = function (proxy, onComplete) { onComplete(this._children); }; Object.defineProperty(TreeViewTraceStylesItem.prototype, "isExpandable", { get: function () { return this._originalObject.isExpandable; }, enumerable: true, configurable: true }); TreeViewTraceStylesItem.prototype.getCopyText = function (indent) { if (typeof indent === "undefined") { indent = ""; } var text = indent; var nextIndent = indent + (indent || " "); for(var i = 0; i < this._children.length; i++) { var child = this._children[i]; text += "\r\n" + child.getCopyText(nextIndent); } text += "\r\n"; return text; }; TreeViewTraceStylesItem.getStrikeKey = function getStrikeKey(style) { if(style.selector && style.selector.indexOf("::") >= 0) { var pseudoElement = style.selector.match(/::[\w\-]+/); if(pseudoElement && pseudoElement.length === 1) { return pseudoElement[0] + " " + style.property; } } return style.property; }; TreeViewTraceStylesItem.isColorProperty = function isColorProperty(propertyName) { if(!propertyName || propertyName.indexOf("color") === -1) { return false; } switch(propertyName.toLowerCase()) { case "background-color": case "border-bottom-color": case "border-left-color": case "border-right-color": case "border-top-color": case "color": case "column-rule-color": case "layout-border-bottom-color": case "layout-border-left-color": case "layout-border-right-color": case "layout-border-top-color": case "outline-color": case "stop-color": case "flood-color": case "lighting-color": case "scrollbar-3dlight-color": case "scrollbar-arrow-color": case "scrollbar-base-color": case "scrollbar-darkshadow-color": case "scrollbar-face-color": case "scrollbar-highlight-color": case "scrollbar-shadow-color": case "scrollbar-track-color": return true; } return false; }; return TreeViewTraceStylesItem; })(TreeViewOutputItem); ObjectView.TreeViewTraceStylesItem = TreeViewTraceStylesItem; var TreeViewNotifyItem = (function (_super) { __extends(TreeViewNotifyItem, _super); function TreeViewNotifyItem(notifyObject) { var type = notifyObject.notifyType; var messageObj; if(typeof notifyObject.message === "object") { messageObj = notifyObject.message; } else { var messageString = "undefined"; if(notifyObject.message && notifyObject.message.toString) { messageString = notifyObject.message.toString(); } messageObj = { message: messageString }; } if(notifyObject.notifyType === "consoleItemCDContext") { type = TreeViewNotifyItem.getNotifyTypeString(TreeViewNotifyType.info); try { messageObj.message = toolwindowHelpers.loadString("CDContextChanged", notifyObject.message); } catch (ex) { } } if(notifyObject.message && notifyObject.message.localizeId) { try { messageObj.message = toolwindowHelpers.loadString(notifyObject.message.localizeId, notifyObject.message.args || undefined); } catch (e) { } } var listValue = TreeViewItem.encodeValueForListItem(messageObj.message, "string"); var fileInfo = ""; if(typeof notifyObject.message === "object" && (messageObj.messageId || messageObj.fileUrl || messageObj.lineNumber || messageObj.columnNumber)) { listValue.htmlLines = []; if(messageObj.messageId) { var messageId = messageObj.messageId; var startText = messageObj.message.substring(0, messageId.length); if(startText === messageId) { var helpLink = "" + messageId + ""; listValue.htmlLines.push(helpLink + toolwindowHelpers.htmlEscape(messageObj.message.substring(messageId.length))); } } if(messageObj.fileUrl) { var url = Common.ObjectView.TreeViewUtils.wrapInQuotes(toolwindowHelpers.htmlEscape(messageObj.fileUrl)); var line = ""; var col = ""; var useLineAndColumn = false; if(messageObj.lineNumber !== null && !isNaN(messageObj.lineNumber)) { if(messageObj.columnNumber === null || isNaN(messageObj.columnNumber)) { messageObj.columnNumber = 1; } line = " data-linkLine='" + messageObj.lineNumber + "'"; col = " data-linkCol='" + messageObj.columnNumber + "'"; useLineAndColumn = true; } var shortUrl = toolwindowHelpers.createShortenedUrlText(messageObj.fileUrl); var tooltip = Common.ObjectView.TreeViewUtils.wrapInQuotes(toolwindowHelpers.htmlEscape(messageObj.fileUrl)); var fileLabel; if(useLineAndColumn) { fileLabel = toolwindowHelpers.htmlEscape(toolwindowHelpers.loadString("EventFullScriptPositionText", [ shortUrl, messageObj.lineNumber, messageObj.columnNumber ])); } else { fileLabel = toolwindowHelpers.htmlEscape(toolwindowHelpers.loadString("ScriptErrorFile", shortUrl)); } listValue.htmlLines.push("" + fileLabel + ""); fileInfo = fileLabel; } else { var useLine = false; var useColumn = false; if(messageObj.lineNumber !== null && !isNaN(messageObj.lineNumber)) { useLine = true; if(messageObj.columnNumber !== null && !isNaN(messageObj.columnNumber)) { useColumn = true; } } var lineLabel = null; if(useLine && useColumn) { lineLabel = toolwindowHelpers.htmlEscape(toolwindowHelpers.loadString("EventScriptPositionText", [ messageObj.lineNumber, messageObj.columnNumber ])); } else if(useLine) { lineLabel = toolwindowHelpers.htmlEscape(toolwindowHelpers.loadString("ScriptErrorLine", messageObj.lineNumber)); } if(lineLabel) { listValue.htmlLines[0] += " " + lineLabel; fileInfo = lineLabel; } } } _super.call(this, notifyObject.inputId, listValue.value, false, true, true, null, type, listValue.htmlLines); this._originalObject = notifyObject; this._notifyType = TreeViewNotifyItem.parseNotifyTypeString(notifyObject.notifyType); this._message = listValue.value; this._fileInfo = fileInfo; } Object.defineProperty(TreeViewNotifyItem.prototype, "notifyType", { get: function () { return this._notifyType; }, enumerable: true, configurable: true }); TreeViewNotifyItem.prototype.getCopyText = function (indent) { if (typeof indent === "undefined") { indent = ""; } var text = indent; text += this._message; if(this._fileInfo) { text += "\r\n" + indent + this._fileInfo; } return text; }; TreeViewNotifyItem.getNotifyTypeString = function getNotifyTypeString(notifyType) { switch(notifyType) { case TreeViewNotifyType.assert: return "consoleItemError"; case TreeViewNotifyType.error: return "consoleItemError"; case TreeViewNotifyType.info: return "consoleItemInfo"; case TreeViewNotifyType.log: return "consoleItemLog"; case TreeViewNotifyType.warn: return "consoleItemWarn"; default: return null; } }; TreeViewNotifyItem.parseNotifyTypeString = function parseNotifyTypeString(notifyType) { switch(notifyType) { case "consoleItemError": return TreeViewNotifyType.error; case "consoleItemInfo": return TreeViewNotifyType.info; case "consoleItemLog": return TreeViewNotifyType.log; case "consoleItemWarn": return TreeViewNotifyType.warn; default: return null; } }; return TreeViewNotifyItem; })(TreeViewOutputItem); ObjectView.TreeViewNotifyItem = TreeViewNotifyItem; var TreeViewGroupItem = (function (_super) { __extends(TreeViewGroupItem, _super); function TreeViewGroupItem(title, isCollapsed, name, html) { if (typeof title === "undefined") { title = ""; } if (typeof name === "undefined") { name = null; } var listValue = TreeViewItem.encodeValueForListItem(title, "string", false, true); var listName = name ? TreeViewItem.encodeValueForListItem(name, "string", false, true).value : null; _super.call(this, listValue.value, true, false, true, listName, "consoleOutputInput", html || listValue.htmlLines); this._title = title; this._isInitialCollapsed = !!isCollapsed; this._children = []; } Object.defineProperty(TreeViewGroupItem.prototype, "isExpandable", { get: function () { return true; }, enumerable: true, configurable: true }); TreeViewGroupItem.prototype.getChildren = function (proxy, onComplete) { onComplete(this._children); }; TreeViewGroupItem.prototype.addChild = function (item, afterSibling) { if(!afterSibling) { this._children.push(item); } else { var index = this._children.indexOf(afterSibling); if(index > -1) { this._children.splice(index + 1, 0, item); } else { this._children.push(item); } } }; TreeViewGroupItem.prototype.getCopyText = function (indent, filter) { if (typeof indent === "undefined") { indent = ""; } var text = indent; var nextIndent = indent + (indent || " "); for(var i = 0; i < this._children.length; i++) { var child = this._children[i]; if(!filter) { filter = function (item) { return true; }; } if(filter(child)) { text += "\r\n" + child.getCopyText(nextIndent); } } text += "\r\n"; return text; }; TreeViewGroupItem.prototype.isItemInGroup = function (item) { return (this._children.indexOf(item) > -1); }; TreeViewGroupItem.prototype.isFirstUIChildNeeded = function () { return (this._children.length === 0 && !this._isInitialCollapsed); }; return TreeViewGroupItem; })(TreeViewItem); ObjectView.TreeViewGroupItem = TreeViewGroupItem; var TreeViewCssStyleGroup = (function (_super) { __extends(TreeViewCssStyleGroup, _super); function TreeViewCssStyleGroup(propertyName, propertyValueHtml, propertyValue, isCollapsed) { _super.call(this, null, isCollapsed, propertyName, propertyValueHtml); this._propertyName = propertyName; this._propertyValueHtml = propertyValueHtml.length > 0 ? propertyValueHtml[0] : ""; this._propertyValue = propertyValue; } TreeViewCssStyleGroup.prototype.getCopyText = function (indent) { if (typeof indent === "undefined") { indent = ""; } return indent + this._propertyName + ": " + this._propertyValue + ";\r\n"; }; return TreeViewCssStyleGroup; })(TreeViewGroupItem); ObjectView.TreeViewCssStyleGroup = TreeViewCssStyleGroup; var TreeViewStyleItem = (function (_super) { __extends(TreeViewStyleItem, _super); function TreeViewStyleItem(style, isActive) { var colorThumbnail = (TreeViewTraceStylesItem.isColorProperty(style.property) ? "" : ""); var nameColumn = (style.inherited ? "<" + style.inherited.toLowerCase() + "> " : "") + style.selector; var html = [ colorThumbnail + "" + style.value + "" ]; var additionalClass = (isActive ? "" : " Console-Style-Disabled ") + "Console-Html-CSS-Selector"; _super.call(this, null, false, false, false, nameColumn, additionalClass, html); this._html = html; this._styleObject = style; } TreeViewStyleItem.prototype.getHtmlContent = function () { return this._html; }; TreeViewStyleItem.prototype.getCopyText = function (indent) { if (typeof indent === "undefined") { indent = ""; } return indent + this._styleObject.selector + " {\r\n" + " " + this._styleObject.property.toLowerCase() + ": " + this._styleObject.value + "\r\n" + "}\r\n"; }; return TreeViewStyleItem; })(TreeViewItem); ObjectView.TreeViewStyleItem = TreeViewStyleItem; var TreeViewCountItem = (function (_super) { __extends(TreeViewCountItem, _super); function TreeViewCountItem(notifyObject) { var name = notifyObject.message.name; if(name === undefined || name === null) { name = ""; } _super.call(this, notifyObject.inputId, notifyObject.message.message, false, false, false, name + ":", null, null); } return TreeViewCountItem; })(TreeViewOutputItem); ObjectView.TreeViewCountItem = TreeViewCountItem; })(Common.ObjectView || (Common.ObjectView = {})); var ObjectView = Common.ObjectView; })(Common || (Common = {})); //@ sourceMappingURL=treeViewItems.js.map // button.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var Common; (function (Common) { (function (Controls) { var Button = (function (_super) { __extends(Button, _super); function Button(element) { var _this = this; _super.call(this, element); this.rootElement.addEventListener("click", function (e) { return _this.onClick(e); }); this.rootElement.addEventListener("keydown", function (e) { return _this.onKeydown(e); }); this.rootElement.addEventListener("mousedown", function (e) { return _this.onMouseDown(e); }); this.rootElement.addEventListener("mouseup", function (e) { return _this.onMouseUpLeave(e); }); this.rootElement.addEventListener("mouseleave", function (e) { return _this.onMouseUpLeave(e); }); } Button.prototype.onMouseDown = function (ev) { if(!this.disabled) { this.rootElement.classList.add("BPT-ToolbarButton-MouseDown"); } }; Button.prototype.onMouseUpLeave = function (ev) { this.rootElement.classList.remove("BPT-ToolbarButton-MouseDown"); }; Object.defineProperty(Button.prototype, "click", { get: function () { return this._onClick; }, set: function (value) { this._onClick = value; }, enumerable: true, configurable: true }); Object.defineProperty(Button.prototype, "content", { get: function () { return this.rootElement.innerHTML; }, set: function (value) { this.rootElement.innerHTML = value; }, enumerable: true, configurable: true }); Object.defineProperty(Button.prototype, "tooltip", { get: function () { return this.rootElement.getAttribute("title"); }, set: function (value) { this.rootElement.setAttribute("title", value); }, enumerable: true, configurable: true }); Object.defineProperty(Button.prototype, "disabled", { get: function () { return this.rootElement.disabled; }, set: function (value) { this.rootElement.disabled = value; }, enumerable: true, configurable: true }); Button.prototype.onClick = function (ev) { this.rootElement.focus(); if(this._onClick) { this._onClick(); } }; Button.prototype.onKeydown = function (ev) { if(ev.keyCode === Common.KeyCodes.SPACE || ev.keyCode === Common.KeyCodes.ENTER) { if(this._onClick) { this._onClick(); } ev.preventDefault(); } }; return Button; })(Controls.Control); Controls.Button = Button; })(Common.Controls || (Common.Controls = {})); var Controls = Common.Controls; })(Common || (Common = {})); //@ sourceMappingURL=button.js.map // radioButton.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var Common; (function (Common) { (function (Controls) { var RadioButton = (function (_super) { __extends(RadioButton, _super); function RadioButton(element) { var _this = this; _super.call(this, element); this._radioButtonElement = this.rootElement; RadioButton._radioButtons.push(this); this.rootElement.addEventListener("click", function (e) { return _this.onCheck(e); }); this.updateAriaProperties(); } RadioButton._radioButtons = []; Object.defineProperty(RadioButton.prototype, "check", { get: function () { return this._onCheck; }, set: function (value) { this._onCheck = value; }, enumerable: true, configurable: true }); Object.defineProperty(RadioButton.prototype, "checked", { get: function () { return this._radioButtonElement.checked; }, set: function (value) { this._radioButtonElement.checked = value; this.updateAriaProperties(); }, enumerable: true, configurable: true }); Object.defineProperty(RadioButton.prototype, "disabled", { get: function () { return this.rootElement.disabled; }, set: function (value) { this.rootElement.disabled = value; }, enumerable: true, configurable: true }); Object.defineProperty(RadioButton.prototype, "groupName", { get: function () { return this._radioButtonElement.name; }, enumerable: true, configurable: true }); Object.defineProperty(RadioButton.prototype, "focusableElement", { get: function () { return this._radioButtonElement; }, enumerable: true, configurable: true }); RadioButton.prototype.onCheck = function (ev) { if(this.checked) { this.rootElement.focus(); if(this._onCheck) { this._onCheck(); } for(var i = 0; i < RadioButton._radioButtons.length; ++i) { var otherButton = RadioButton._radioButtons[i]; if(otherButton !== this && otherButton.groupName === this.groupName) { otherButton.updateAriaProperties(); } } } this.updateAriaProperties(); }; RadioButton.prototype.updateAriaProperties = function () { this.rootElement.setAttribute("aria-checked", "" + this.checked); }; return RadioButton; })(Controls.Control); Controls.RadioButton = RadioButton; })(Common.Controls || (Common.Controls = {})); var Controls = Common.Controls; })(Common || (Common = {})); //@ sourceMappingURL=radioButton.js.map // toggleButton.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var Common; (function (Common) { (function (Controls) { var ToggleButton = (function (_super) { __extends(ToggleButton, _super); function ToggleButton(element) { var _this = this; _super.call(this, element); F12.Tools.Utility.Assert.AreEqual(this.rootElement.getAttribute("role"), "button", "Missing button role"); this.rootElement.addEventListener("DOMAttrModified", function (evt) { if(evt.attrName === "aria-pressed") { var isSelected = evt.newValue === "true"; _this.rootElement.setAttribute("selected", "" + isSelected); if(_this._onSelectChanged && evt.newValue != evt.prevValue) { _this._onSelectChanged(isSelected); } } }); this.selected = this.selected; } Object.defineProperty(ToggleButton.prototype, "selectedChanged", { get: function () { return this._onSelectChanged; }, set: function (value) { this._onSelectChanged = value; }, enumerable: true, configurable: true }); Object.defineProperty(ToggleButton.prototype, "selected", { get: function () { return this.rootElement.getAttribute("aria-pressed") === "true"; }, set: function (value) { this.rootElement.setAttribute("aria-pressed", "" + value); }, enumerable: true, configurable: true }); ToggleButton.prototype.onClick = function (ev) { _super.prototype.onClick.call(this, ev); this.selected = !this.selected; }; ToggleButton.prototype.onKeydown = function (ev) { if(ev.keyCode === Common.KeyCodes.SPACE || ev.keyCode === Common.KeyCodes.ENTER) { _super.prototype.onKeydown.call(this, ev); this.selected = !this.selected; ev.preventDefault(); } }; return ToggleButton; })(Controls.Button); Controls.ToggleButton = ToggleButton; })(Common.Controls || (Common.Controls = {})); var Controls = Common.Controls; })(Common || (Common = {})); //@ sourceMappingURL=toggleButton.js.map // toolbar.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var Common; (function (Common) { (function (Controls) { var Toolbar = (function (_super) { __extends(Toolbar, _super); function Toolbar(root, container) { if(typeof root === "undefined") { root = document.createElement("div"); } _super.call(this, root); this.rootElement.className = "toolbar"; this._toolbarContainer = container; if(typeof this._toolbarContainer === "undefined") { this._toolbarContainer = new ToolbarContainer(); } this.appendChild(this._toolbarContainer); this._toolbarChildren = new Array(); } Toolbar.prototype.appendToolbarControl = function (control) { this._toolbarContainer.appendChild(control); this._toolbarChildren.push(control); }; return Toolbar; })(Controls.Control); Controls.Toolbar = Toolbar; var ToolbarContainer = (function (_super) { __extends(ToolbarContainer, _super); function ToolbarContainer(root) { if(typeof root === "undefined") { root = document.createElement("div"); } _super.call(this, root); this.rootElement.className = "toolbarContainer"; } return ToolbarContainer; })(Controls.Control); Controls.ToolbarContainer = ToolbarContainer; var ToolbarSeparator = (function (_super) { __extends(ToolbarSeparator, _super); function ToolbarSeparator(root) { if(typeof root === "undefined") { root = document.createElement("div"); } _super.call(this, root); this.rootElement.innerHTML = "
     
    "; this.rootElement.className = "separator"; } return ToolbarSeparator; })(Controls.Control); Controls.ToolbarSeparator = ToolbarSeparator; })(Common.Controls || (Common.Controls = {})); var Controls = Common.Controls; })(Common || (Common = {})); //@ sourceMappingURL=toolbar.js.map // comboBox.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var Common; (function (Common) { (function (Controls) { var ComboBox = (function (_super) { __extends(ComboBox, _super); function ComboBox(root) { var _this = this; _super.call(this, root); this._selectElement = document.createElement("select"); this._selectElement.addEventListener("change", function (ev) { return _this.onChanged(ev); }); this._optionElements = null; this.rootElement.appendChild(this._selectElement); } Object.defineProperty(ComboBox.prototype, "disabled", { get: function () { return this._selectElement.disabled; }, set: function (value) { this._selectElement.disabled = value; }, enumerable: true, configurable: true }); Object.defineProperty(ComboBox.prototype, "items", { set: function (value) { this.clearItems(); this._optionElements = []; for(var i = 0; i < value.length; ++i) { var option = document.createElement("option"); option.value = value[i].value; option.text = value[i].text; this._optionElements.push(option); this._selectElement.appendChild(option); } }, enumerable: true, configurable: true }); Object.defineProperty(ComboBox.prototype, "value", { get: function () { return this._selectElement.value; }, set: function (value) { var fireEvent = this._selectElement.value !== value; this._selectElement.value = value; if(fireEvent) { this.fireValueChangedEvent(); } }, enumerable: true, configurable: true }); Object.defineProperty(ComboBox.prototype, "valueChanged", { get: function () { return this._valueChanged; }, set: function (handler) { this._valueChanged = handler; }, enumerable: true, configurable: true }); Object.defineProperty(ComboBox.prototype, "focusableElement", { get: function () { return this._selectElement; }, enumerable: true, configurable: true }); ComboBox.prototype.clearItems = function () { if(this._optionElements) { for(var i = 0; i < this._optionElements.length; ++i) { this._selectElement.removeChild(this._optionElements[i]); } this._optionElements = null; } }; ComboBox.prototype.onChanged = function (ev) { this.fireValueChangedEvent(); }; ComboBox.prototype.fireValueChangedEvent = function () { if(this.valueChanged) { this.valueChanged(this.value); } }; return ComboBox; })(Controls.Control); Controls.ComboBox = ComboBox; })(Common.Controls || (Common.Controls = {})); var Controls = Common.Controls; })(Common || (Common = {})); //@ sourceMappingURL=comboBox.js.map // dataListTextBox.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var Common; (function (Common) { (function (Controls) { var DataListTextBox = (function (_super) { __extends(DataListTextBox, _super); function DataListTextBox(root) { var _this = this; _super.call(this, root); this._idPostfix = DataListTextBox._globalIdPostfix++; var dataListId = "textBoxDataList" + this._idPostfix; this._inputElement = document.createElement("input"); this._inputElement.type = "text"; this._inputElement.setAttribute("list", dataListId); this._inputElement.addEventListener("input", function (ev) { return _this.onInput(ev); }); this._inputElement.addEventListener("keydown", function (ev) { return _this.onKeydown(ev); }); this._inputElement.addEventListener("change", function (ev) { return _this.onChange(ev); }); this._dataListElement = document.createElement("datalist"); this._dataListElement.id = dataListId; this._optionElements = null; this.rootElement.appendChild(this._inputElement); this.rootElement.appendChild(this._dataListElement); } DataListTextBox._globalIdPostfix = 1; Object.defineProperty(DataListTextBox.prototype, "items", { set: function (value) { this.clearItems(); this._optionElements = []; for(var i = 0; i < value.length; ++i) { var option = document.createElement("option"); option.text = value[i].text; this._optionElements.push(option); this._dataListElement.appendChild(option); } }, enumerable: true, configurable: true }); Object.defineProperty(DataListTextBox.prototype, "text", { get: function () { return this._inputElement.value; }, set: function (value) { this._inputElement.value = value; }, enumerable: true, configurable: true }); Object.defineProperty(DataListTextBox.prototype, "textChanged", { get: function () { return this._valueChanged; }, set: function (handler) { this._valueChanged = handler; }, enumerable: true, configurable: true }); Object.defineProperty(DataListTextBox.prototype, "textCommitted", { get: function () { return this._valueCommitted; }, set: function (handler) { this._valueCommitted = handler; }, enumerable: true, configurable: true }); Object.defineProperty(DataListTextBox.prototype, "focusableElement", { get: function () { return this._inputElement; }, enumerable: true, configurable: true }); DataListTextBox.prototype.clearItems = function () { if(this._optionElements) { for(var i = 0; i < this._optionElements.length; ++i) { this._dataListElement.removeChild(this._optionElements[i]); } this._optionElements = null; } }; DataListTextBox.prototype.onInput = function (ev) { if(this.textChanged) { this.textChanged(this.text); } }; DataListTextBox.prototype.onKeydown = function (ev) { var _this = this; if(ev.keyCode === Common.KeyCodes.ENTER) { window.setImmediate(function () { if(_this.textCommitted) { _this.textCommitted(_this.text); } }); } }; DataListTextBox.prototype.onChange = function (ev) { if(this.textCommitted) { this.textCommitted(this.text); } }; return DataListTextBox; })(Controls.Control); Controls.DataListTextBox = DataListTextBox; })(Common.Controls || (Common.Controls = {})); var Controls = Common.Controls; })(Common || (Common = {})); //@ sourceMappingURL=dataListTextBox.js.map // rpc.ts var F12; (function (F12) { (function (Tools) { (function (RPC) { var JsonRPCEndpoint = (function () { function JsonRPCEndpoint(identifier, jsonRpcMethodReceive, jsonRpcNotificationReceive, postMessage, onMessageCapture) { var _this = this; this._ourIdentifier = identifier; this._nextId = 0; this._promiseTable = { }; this._jsonRpcMethodReceive = jsonRpcMethodReceive; this._jsonRpcNotificationReceive = jsonRpcNotificationReceive; this._postMessage = postMessage; if(!Date.now) { Date.now = function now() { return +(new Date()); }; } this._startTime = Date.now(); onMessageCapture(function (data) { _this.onMessage(data); }); } JsonRPCEndpoint.prototype.jsonRpcMethodCall = function (method, params, completed, error, identification) { var id = this._ourIdentifier + "|" + this._nextId; this._nextId++; this._promiseTable[id] = { completed: completed, error: error }; var message = JSON.stringify({ id: id, method: method, params: params }); this.logTraffic(message); return this._postMessage(message, identification); }; JsonRPCEndpoint.prototype.jsonRpcNotification = function (method, params, identification) { var id = this._ourIdentifier + "|" + "NULL"; var message = JSON.stringify({ id: id, method: method, params: params }); this.logTraffic(message); this._postMessage(message, identification); }; JsonRPCEndpoint.prototype.logTraffic = function (data) { if(isDebugBuild) { var paddedTimestamp = (" " + (Date.now() - this._startTime) / 1000).slice(-9); __rpcLog.push(paddedTimestamp + " | " + data); if(__rpcLog.length > 100) { __rpcLog.shift(); } } }; JsonRPCEndpoint.prototype.onMessage = function (data) { var _this = this; this.logTraffic(data.data); var result = JSON.parse(data.data); var idSplit = (result.id).split("|"); Tools.Utility.Assert.AreEqual(idSplit.length, 2); if(idSplit[1] === "NULL") { Tools.Utility.Assert.AreNotEqual(idSplit[0], this._ourIdentifier, "Can't notify ourselves"); this._jsonRpcNotificationReceive(result.method, result.params); } else if(idSplit[0] === this._ourIdentifier) { Tools.Utility.Assert.HasValue(this._promiseTable[result.id]); if(result.error) { Tools.Utility.Assert.IsUndefined(result.data, "Can't have both data and error"); this._promiseTable[result.id].error(result.error); } else { this._promiseTable[result.id].completed(result.data); } delete this._promiseTable[result.id]; } else { this._jsonRpcMethodReceive(result.method, result.params, function (data, error) { var message; if(data !== null && data !== undefined) { Tools.Utility.Assert.IsUndefined(error, "Can't have both data and error"); message = JSON.stringify({ id: result.id, data: data }); } else { Tools.Utility.Assert.HasValue(error, "RPC call returned no value, but no error object either"); message = JSON.stringify({ id: result.id, error: error }); } _this._postMessage(message); }); } }; return JsonRPCEndpoint; })(); RPC.JsonRPCEndpoint = JsonRPCEndpoint; })(Tools.RPC || (Tools.RPC = {})); var RPC = Tools.RPC; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); if(isDebugBuild) { var __rpcLog = []; } //@ sourceMappingURL=rpc.js.map // // Copyright (C) Microsoft. All rights reserved. // // isDebugBuild.ts var isDebugBuild = false; //@ sourceMappingURL=isDebugBuild.js.map // assert.ts var F12; (function (F12) { (function (Tools) { (function (Utility) { var Assert = (function () { function Assert() { } Assert.IsTrue = function IsTrue(condition, message) { if(!condition) { message = message ? "Internal error. " + message : "Internal error. Unexpectedly false."; Assert.Fail(message); } }; Assert.IsFalse = function IsFalse(condition, message) { if(condition) { message = message ? "Internal error. " + message : "Internal error. Unexpectedly true."; Assert.Fail(message); } }; Assert.IsNull = function IsNull(value, message) { if(value !== null) { message = message ? "Internal error. " + message : "Internal error. Unexpectedly not null."; message += " '" + value + "'"; Assert.Fail(message); } }; Assert.IsUndefined = function IsUndefined(value, message) { if(value !== undefined) { message = message ? "Internal error. " + message : "Internal error. Unexpectedly not undefined."; message += " '" + value + "'"; Assert.Fail(message); } }; Assert.HasValue = function HasValue(value, message) { if(value === null || value === undefined) { message = message ? "Internal error. " + message : "Internal error. Unexpectedly null or undefined."; Assert.Fail(message); } }; Assert.AreEqual = function AreEqual(value1, value2, message) { if(value1 !== value2) { message = message ? "Internal error. " + message : "Internal error. Unexpectedly not equal."; message += " '" + value1 + "' !== '" + value2 + "'."; Assert.Fail(message); } }; Assert.AreNotEqual = function AreNotEqual(value1, value2, message) { if(value1 === value2) { message = message ? "Internal error. " + message : "Internal error. Unexpectedly equal."; message += " '" + value1 + "' === '" + value2 + "'."; Assert.Fail(message); } }; Assert.Fail = function Fail(message) { var error = new Error(message + "\n"); try { throw error; } catch (e) { if(Common && Common.ErrorHandling) { Common.ErrorHandling.ReportErrorGivenStack(e); } throw e; } }; return Assert; })(); Utility.Assert = Assert; })(Tools.Utility || (Tools.Utility = {})); var Utility = Tools.Utility; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=assert.js.map // KeyCodes.ts var Common; (function (Common) { "use strict"; var Keys = (function () { function Keys() { } Keys.c = "c"; Keys.DEL = "Del"; Keys.DOWN = "Down"; Keys.END = "End"; Keys.ENTER = "Enter"; Keys.F10 = "F10"; Keys.HOME = "Home"; Keys.LEFT = "Left"; Keys.RIGHT = "Right"; Keys.SPACEBAR = "Spacebar"; Keys.UP = "Up"; return Keys; })(); Common.Keys = Keys; (function (KeyCodes) { KeyCodes._map = []; KeyCodes.BACKSPACE = 8; KeyCodes.TAB = 9; KeyCodes.ENTER = 13; KeyCodes.SHIFT = 16; KeyCodes.CONTROL = 17; KeyCodes.ALT = 18; KeyCodes.CAPS_LOCK = 20; KeyCodes.ESCAPE = 27; KeyCodes.SPACE = 32; KeyCodes.PAGE_UP = 33; KeyCodes.PAGE_DOWN = 34; KeyCodes.END = 35; KeyCodes.HOME = 36; KeyCodes.ARROW_LEFT = 37; KeyCodes.ARROW_FIRST = 37; KeyCodes.ARROW_UP = 38; KeyCodes.ARROW_RIGHT = 39; KeyCodes.ARROW_DOWN = 40; KeyCodes.ARROW_LAST = 40; KeyCodes.INSERT = 45; KeyCodes.DELETE = 46; KeyCodes.A = 65; KeyCodes.B = 66; KeyCodes.C = 67; KeyCodes.D = 68; KeyCodes.E = 69; KeyCodes.F = 70; KeyCodes.G = 71; KeyCodes.H = 72; KeyCodes.I = 73; KeyCodes.J = 74; KeyCodes.K = 75; KeyCodes.L = 76; KeyCodes.M = 77; KeyCodes.N = 78; KeyCodes.O = 79; KeyCodes.P = 80; KeyCodes.Q = 81; KeyCodes.R = 82; KeyCodes.S = 83; KeyCodes.T = 84; KeyCodes.U = 85; KeyCodes.V = 86; KeyCodes.W = 87; KeyCodes.X = 88; KeyCodes.Y = 89; KeyCodes.Z = 90; KeyCodes.CONTEXTMENU = 93; KeyCodes.MULTIPLY = 106; KeyCodes.PLUS = 107; KeyCodes.MINUS = 109; KeyCodes.F1 = 112; KeyCodes.F2 = 113; KeyCodes.F3 = 114; KeyCodes.F4 = 115; KeyCodes.F5 = 116; KeyCodes.F6 = 117; KeyCodes.F7 = 118; KeyCodes.F8 = 119; KeyCodes.F9 = 120; KeyCodes.F10 = 121; KeyCodes.F11 = 122; KeyCodes.F12 = 123; KeyCodes.COMMA = 188; KeyCodes.PERIOD = 190; })(Common.KeyCodes || (Common.KeyCodes = {})); var KeyCodes = Common.KeyCodes; (function (MouseButtons) { MouseButtons._map = []; MouseButtons.LEFT_BUTTON = 0; MouseButtons.MIDDLE_BUTTON = 1; MouseButtons.RIGHT_BUTTON = 2; })(Common.MouseButtons || (Common.MouseButtons = {})); var MouseButtons = Common.MouseButtons; (function (KeyFlags) { KeyFlags._map = []; KeyFlags.KeyFlags_None = 0x0; KeyFlags.KeyFlags_Shift = 0x1; KeyFlags.KeyFlags_Ctrl = 0x2; KeyFlags.KeyFlags_Alt = 0x4; })(Common.KeyFlags || (Common.KeyFlags = {})); var KeyFlags = Common.KeyFlags; function blockBrowserAccelerators() { document.addEventListener("keydown", function (e) { return preventIEKeys(e); }); document.addEventListener("contextmenu", function (e) { e.preventDefault(); e.stopPropagation(); return false; }); window.addEventListener("mousewheel", function (e) { if(e.ctrlKey) { e.preventDefault(); e.stopPropagation(); return false; } }); } Common.blockBrowserAccelerators = blockBrowserAccelerators; function HasAnyOfAltCtrlShiftKeyFlags(e) { return e.shiftKey || e.ctrlKey || e.altKey; } Common.HasAnyOfAltCtrlShiftKeyFlags = HasAnyOfAltCtrlShiftKeyFlags; function preventIEKeys(e) { if(e.keyCode === Common.KeyCodes.F5 || e.keyCode === Common.KeyCodes.F6 || (e.keyCode === Common.KeyCodes.F10 && e.shiftKey) || (e.keyCode === Common.KeyCodes.F && e.ctrlKey)) { e.preventDefault(); e.stopPropagation(); return false; } return true; } Common.preventIEKeys = preventIEKeys; })(Common || (Common = {})); //@ sourceMappingURL=KeyCodes.js.map // HostBridge.ts var Common; (function (Common) { (function (ResourceLocation) { ResourceLocation._map = []; ResourceLocation.Local = 2; ResourceLocation.Host = 3; })(Common.ResourceLocation || (Common.ResourceLocation = {})); var ResourceLocation = Common.ResourceLocation; var IEHostBridge = (function () { function IEHostBridge(externalObj) { this._externalObj = externalObj; } IEHostBridge.prototype.start = function () { }; IEHostBridge.prototype.loadCssFile = function (fileName, isCommonFile) { throw "Not supported."; }; IEHostBridge.prototype.loadString = function (resourceId) { return Plugin.Resources.getString("/Common/" + resourceId); }; IEHostBridge.prototype.loadFormattedString = function (resourceId, parameters) { return Plugin.Resources.getString("/Common/" + resourceId, parameters); }; IEHostBridge.prototype.getIsToolWindowActive = function () { return new SynchronousPromise(function () { return false; }); }; IEHostBridge.prototype.getAreCodeMarkersEnabled = function () { return new SynchronousPromise(function () { return true; }); }; IEHostBridge.prototype.getIsAtBreakpoint = function () { return new SynchronousPromise(function () { return (Plugin).F12.Debugger.getIsAtBreakpoint(); }); }; IEHostBridge.prototype.getIsAtBreakpointInWorker = function () { return new SynchronousPromise(function () { return (Plugin).F12.Debugger.getIsAtBreakpointInWorker(); }); }; IEHostBridge.prototype.addEventListener = function (eventName, callback) { (Plugin).F12.addEventListener(eventName, callback); }; IEHostBridge.prototype.removeEventListener = function (eventName, callback) { (Plugin).F12.removeEventListener(eventName, callback); }; IEHostBridge.prototype.fireCodeMarker = function (codeMarker) { Plugin.VS.Internal.CodeMarkers.fire(codeMarker); }; IEHostBridge.prototype.executeBreakModeCommand = function (id, command, isWorker, createInvoker) { if (typeof createInvoker === "undefined") { createInvoker = BridgeHelpers.createInvoker; } if(!(Plugin).F12.Debugger.getIsAtBreakpoint()) { return new SynchronousPromise(function () { return false; }); } var invoker = createInvoker(id, command, isWorker); return (Plugin).F12.Debugger.executeBreakModeCommand(invoker); }; IEHostBridge.prototype.takeForeground = function () { (Plugin).F12.takeForeground(); }; IEHostBridge.prototype.setForeground = function (hwnd) { return new SynchronousPromise(function () { return (Plugin).F12.setForeground(hwnd); }); }; IEHostBridge.prototype.allowRemoteToTakeForeground = function () { return new SynchronousPromise(function () { var pid = (Plugin).F12.getRemoteProcessId(); return (Plugin).F12.allowSetForeground(pid); }); }; IEHostBridge.prototype.notifyOnBrowserActivate = function () { }; IEHostBridge.prototype.log = function (message) { Plugin.log(message); }; IEHostBridge.prototype.notifyUnsupportedBrowser = function (documentMode) { }; IEHostBridge.prototype.openF1HelpLink = function (keyword) { var f1OnlineBaseUrl = "http://msdn.microsoft.com/query/dev12.query?appId=Dev12IDEF1&l="; var webClientF1KeywordPrefix = "VS.WebClient.Help."; var url = f1OnlineBaseUrl + Plugin.Culture.lang.toUpperCase() + "&k=k(" + webClientF1KeywordPrefix + keyword + ")"; (Plugin).F12.openBrowser(url); }; IEHostBridge.prototype.openDocumentLink = function (deployedUrl, line, col) { Plugin.Host.showDocument(deployedUrl, line || 1, col || 1); }; IEHostBridge.prototype.hookEyeDropper = function (hook) { this._externalObj.utilities.hookEyeDropper(hook); }; IEHostBridge.prototype.getEyeDropperColor = function () { return this._externalObj.utilities.getEyeDropperColor(); }; IEHostBridge.prototype.unhookEyeDropper = function () { this._externalObj.utilities.unhookEyeDropper(); }; IEHostBridge.prototype.showContextMenu = function (name, x, y, callBack, menuParams) { }; Object.defineProperty(IEHostBridge.prototype, "inspectElementId", { get: function () { return (Plugin).F12.getInspectElementId(); }, set: function (elementId) { (Plugin).F12.setInspectElementId(elementId); }, enumerable: true, configurable: true }); IEHostBridge.prototype.activateTab = function (pluginName) { if(pluginName == "Dom") { (Plugin).F12.activateTab(5); } }; IEHostBridge.prototype.openBrowser = function (url) { (Plugin).F12.openBrowser(url); }; IEHostBridge.prototype.readPluginFile = function (fileName) { return this._externalObj.storage.readResourceText(fileName, ResourceLocation.Local); }; return IEHostBridge; })(); Common.IEHostBridge = IEHostBridge; var HostBridge = (function () { function HostBridge() { this._proxy = Plugin.Utilities.JSONMarshaler.attachToPublishedObject("F12.Common.Bridge.IHostBridge", this, true); } HostBridge.prototype.start = function () { this._proxy._post("start"); }; HostBridge.prototype.loadCssFile = function (fileName, isCommonFile) { throw "Not supported."; }; HostBridge.prototype.loadString = function (resourceId) { return Plugin.Resources.getString(resourceId); }; HostBridge.prototype.loadFormattedString = function (resourceId, parameters) { return Plugin.Resources.getString(resourceId, parameters); }; HostBridge.prototype.getIsToolWindowActive = function () { return new SynchronousPromise(function () { return false; }); }; HostBridge.prototype.getAreCodeMarkersEnabled = function () { return new SynchronousPromise(function () { return true; }); }; HostBridge.prototype.getIsAtBreakpoint = function () { return this._proxy._call("getIsAtBreakpoint"); }; HostBridge.prototype.getIsAtBreakpointInWorker = function () { return this._proxy._call("getIsAtBreakpointInWorker"); }; HostBridge.prototype.takeForeground = function () { this._proxy._post("takeForeground"); }; HostBridge.prototype.setForeground = function (hwnd) { var _this = this; return this._proxy._call("getHostProcessId").then(function (pid) { Plugin.Host.allowSetForeground(pid); return _this._proxy._call("setForeground", hwnd); }); }; HostBridge.prototype.allowRemoteToTakeForeground = function () { return this._proxy._call("getRemoteProcessId").then(function (pid) { Plugin.Host.allowSetForeground(pid); }); }; HostBridge.prototype.addEventListener = function (eventName, callback) { this._proxy.addEventListener(eventName, callback); }; HostBridge.prototype.removeEventListener = function (eventName, callback) { this._proxy.removeEventListener(eventName, callback); }; HostBridge.prototype.fireCodeMarker = function (codeMarker) { Plugin.VS.Internal.CodeMarkers.fire(codeMarker); }; HostBridge.prototype.executeBreakModeCommand = function (id, command, isWorker, createInvoker) { if (typeof createInvoker === "undefined") { createInvoker = BridgeHelpers.createInvoker; } var invoker = createInvoker(id, command, isWorker); return this._proxy._call("executeBreakModeCommand", invoker); }; HostBridge.prototype.notifyOnBrowserActivate = function () { }; HostBridge.prototype.log = function (message) { Plugin.log(message); }; HostBridge.prototype.notifyUnsupportedBrowser = function (documentMode) { }; HostBridge.prototype.openF1HelpLink = function (keyword) { this._proxy._post("openF1HelpLink", keyword); }; HostBridge.prototype.openDocumentLink = function (deployedUrl, line, col) { Plugin.Host.showDocument(deployedUrl, line, col); }; HostBridge.prototype.hookEyeDropper = function (hook) { throw "not implemented."; }; HostBridge.prototype.getEyeDropperColor = function () { throw "not implemented."; }; HostBridge.prototype.unhookEyeDropper = function () { throw "not implemented."; }; Object.defineProperty(HostBridge.prototype, "inspectElementId", { get: function () { return ""; }, set: function (elementId) { }, enumerable: true, configurable: true }); HostBridge.prototype.activateTab = function (tabId) { }; HostBridge.prototype.openBrowser = function (url) { }; HostBridge.prototype.readPluginFile = function (fileName) { throw "not implemented."; }; return HostBridge; })(); Common.HostBridge = HostBridge; var SynchronousPromise = (function () { function SynchronousPromise(result, error) { this._result = result; this._error = error; } SynchronousPromise.prototype.done = function (completed, error, progress) { try { var result = this._result && this._result(); if(completed) { completed(result); } } catch (e) { if(error) { error(e); } else { throw e; } } }; SynchronousPromise.prototype.then = function (completed, error, progress) { throw "not implemented"; }; SynchronousPromise.prototype.cancel = function () { }; return SynchronousPromise; })(); Common.SynchronousPromise = SynchronousPromise; var BridgeHelpers = (function () { function BridgeHelpers() { } BridgeHelpers.createInvoker = function createInvoker(id, command, isWorker) { var invoker = "__BROWSERTOOLS_CONSOLE_BREAKMODE_FUNC('" + id + "', '" + command + "');"; if(id && isWorker) { var escapedCommand = JSON.stringify(command).slice(1, -1); invoker = " __BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER = { returnValue: { isError: false } };\n" + " try {\n" + " // Evaluate the input using the current breakpoint context \n" + " __BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.returnValue.result = eval(\"" + escapedCommand + "\");\n" + " } catch(e) {\n" + " __BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.returnValue.result = e;\n" + " __BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.returnValue.isError = true;\n" + " }\n" + "\n" + " // Call the remote side console with the result from the eval that used the current breakpoint context \n" + " __BROWSERTOOLS_CONSOLE_BREAKMODE_FUNC('" + id + "', __BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.returnValue);\n" + "\n" + " __BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER = null;\n"; } else if(id && !isWorker) { var escapedCommand = JSON.stringify(command).slice(1, -1); invoker = " window.__BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER = { inline:[], result: undefined, isError: false };\n" + " try {\n" + " if ((typeof window.cd) === 'undefined') {\n" + " window.cd = window.console.cd;\n" + " window.__BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.inline.push({ name: 'cd', func: window.console.cd });\n" + " }\n" + " if ((typeof window.dir) === 'undefined') {\n" + " window.dir = window.console.dir;\n" + " window.__BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.inline.push({ name: 'dir', func: window.console.dir });\n" + " }\n" + " if ((typeof window.select) === 'undefined') {\n" + " window.select = window.console.select;\n" + " window.__BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.inline.push({ name: 'select', func: window.console.select });\n" + " }\n" + "\n" + " if ((typeof window.$) === 'undefined') {\n" + " window.$ = window.__BROWSERTOOLS_CONSOLE.$;\n" + " window.__BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.inline.push({ name: '$', func: window.$ });\n" + " }\n" + " if ((typeof window.$$) === 'undefined') {\n" + " window.$$ = window.__BROWSERTOOLS_CONSOLE.$$;\n" + " window.__BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.inline.push({ name: '$$', func: window.$$ });\n" + " }\n" + " if (window.__BROWSERTOOLS_DOMEXPLORER_STORED_ELEMENTS) {\n" + " (function() { for (var i = 0; i <= 4; i++) {\n" + " if ((typeof window['$' + i]) === 'undefined') {\n" + " window['$' + i] = window.__BROWSERTOOLS_DOMEXPLORER_STORED_ELEMENTS[i];\n" + " window.__BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.inline.push({ name: '$' + i, func: window['$' + i] });\n" + " }\n" + " }})();\n" + " }\n" + "\n" + " // Evaluate the input using the current breakpoint context \n" + " window.__BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.result = eval(\"" + escapedCommand + "\");\n" + " } catch(e) {\n" + " window.__BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.result = e;\n" + " window.__BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.isError = true;\n" + " }\n" + "\n" + " // Call the remote side console with the result from the eval that used the current breakpoint context \n" + " __BROWSERTOOLS_CONSOLE_BREAKMODE_FUNC('" + id + "', window.__BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER);\n" + "\n" + " // Clean up the short-cut functions\n" + " (function() { for (var i = 0; i < window.__BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.inline.length; i++) {\n" + " if (window[window.__BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.inline[i].name] === window.__BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.inline[i].func) {\n" + " delete window[window.__BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER.inline[i].name];\n" + " }\n" + " }})();\n" + " window.__BROWSERTOOLS_CONSOLE_BREAKMODE_INVOKER = null;"; } return invoker; }; return BridgeHelpers; })(); })(Common || (Common = {})); //@ sourceMappingURL=HostBridge.js.map // toolwindow.ts var toolwindowHelpers = { codeMarkers: { perfBrowserTools_DiagnosticsToolWindowsConsoleReady: 23609, perfBrowserTools_DiagnosticsToolWindowsDomExplorerReady: 23610, perfBrowserTools_DiagnosticsToolWindowsExpandConsoleObjectBegin: 23611, perfBrowserTools_DiagnosticsToolWindowsExpandConsoleObjectEnd: 23612, perfBrowserTools_DiagnosticsToolWindowsExpandConsoleObjectInteractive: 23613, perfBrowserTools_DiagnosticsToolWindowsConsoleEvalBegin: 23614, perfBrowserTools_DiagnosticsToolWindowsConsoleEvalEnd: 23615, perfBrowserTools_DiagnosticsToolWindowsDataTreeToggleBegin: 23616, perfBrowserTools_DiagnosticsToolWindowsDataTreeToggleEnd: 23617, perfBrowserTools_DiagnosticsToolWindowsTreeViewToggleBegin: 23618, perfBrowserTools_DiagnosticsToolWindowsTreeViewToggleEnd: 23619, perfBrowserTools_DiagnosticsToolWindowsDomExplorerRefreshBegin: 23620, perfBrowserTools_DiagnosticsToolWindowsDomExplorerRefreshEnd: 23621, perfBrowserTools_DiagnosticsToolWindowsDomExplorerAttributeChanged: 23622, perfBrowserTools_DiagnosticsToolWindowsDomExplorerTabChanged: 23623, perfBrowserTools_DiagnosticsToolWindowsNetworkExplorerReady: 23624 }, _hostBridge: null, areCodeMarkersEnabled: false, initializeToolWindow: function (hostBridge, onShowCallback) { toolwindowHelpers._hostBridge = hostBridge; toolwindowHelpers.onShowCallback = onShowCallback; document.addEventListener("mousedown", function () { toolwindowHelpers._hostBridge.notifyOnBrowserActivate(); $m(document.body).removeClass("showFocus"); }, true); $m(document).bind("contextmenu", function () { return false; }); $m(document).bind("keydown", function (event) { if(event.keyCode === Common.KeyCodes.F5 || (event.keyCode === Common.KeyCodes.F10 && event.shiftKey)) { event.preventDefault(); event.stopPropagation(); return false; } else if(event.keyCode === Common.KeyCodes.TAB) { $m(document.body).addClass("showFocus"); } }); $m(".BPT-ToolbarButton").bind("mousedown", function (event) { var element = $m(this); if(!element.hasClass("BPT-ToolbarButton-StateDisabled")) { element.addClass("BPT-ToolbarButton-MouseDown"); } else { event.stopImmediatePropagation(); } }); $m(".BPT-ToolbarButton").bind("mouseup", function () { $m(this).removeClass("BPT-ToolbarButton-MouseDown"); }); $m(".BPT-ToolbarButton").bind("mouseleave", function () { $m(this).removeClass("BPT-ToolbarButton-MouseDown BPT-ToolbarButton-MouseHover"); }); $m(".BPT-ToolbarButton").bind("mouseenter", function (event) { var element = $m(this); if(!element.hasClass("BPT-ToolbarButton-StateDisabled")) { element.addClass("BPT-ToolbarButton-MouseHover"); } else { event.preventDefault(); event.stopImmediatePropagation(); } }); $m(".BPT-ToolbarButton").bind("click keydown", function (event) { if(event.type === "click" || event.keyCode === Common.KeyCodes.ENTER || event.keyCode === Common.KeyCodes.SPACE) { var element = $m(this); if(!element.hasClass("BPT-ToolbarButton-StateDisabled")) { var thisElement = element.get(0); if(document.activeElement !== thisElement) { thisElement.focus(); } } else { event.preventDefault(); event.stopImmediatePropagation(); } } }); $m(".BPT-ToolbarToggleButton").bind("click keydown", function (event) { if(event.type === "click" || event.keyCode === Common.KeyCodes.ENTER || event.keyCode === Common.KeyCodes.SPACE) { var element = $m(this); if(!element.hasClass("BPT-ToolbarButton-StateDisabled")) { var thisElement = element.get(0); if(document.activeElement !== thisElement) { thisElement.focus(); } if(element.hasClass("BPT-ToolbarToggleButton-StateOn")) { element.removeClass("BPT-ToolbarToggleButton-StateOn"); element.attr("aria-pressed", false); } else { element.addClass("BPT-ToolbarToggleButton-StateOn"); element.attr("aria-pressed", true); } } else { event.preventDefault(); event.stopImmediatePropagation(); } } }); $m(".BPT-TabCycle-Horizontal, .BPT-TabCycle-Vertical").children(".BPT-TabCycle-Item").bind("keydown", function (event) { if(($m(this).parent().hasClass("BPT-TabCycle-Horizontal") && (event.keyCode === Common.KeyCodes.ARROW_LEFT || event.keyCode === Common.KeyCodes.ARROW_RIGHT)) || ($m(this).parent().hasClass("BPT-TabCycle-Vertical") && (event.keyCode === Common.KeyCodes.ARROW_UP || event.keyCode === Common.KeyCodes.ARROW_DOWN))) { var currentElement = $m(this); var newElement = ((event.keyCode === Common.KeyCodes.ARROW_LEFT || event.keyCode === Common.KeyCodes.ARROW_UP) ? currentElement.prev(".BPT-TabCycle-Item").first() : currentElement.next(".BPT-TabCycle-Item").first()); if(newElement.length > 0) { newElement.attr("tabindex", "1"); newElement.trigger("focus"); newElement.trigger("click"); currentElement.removeAttr("tabindex"); } } }); $m(".BPT-TabCycle-Horizontal, .BPT-TabCycle-Vertical").children(".BPT-TabCycle-Item").bind("mousedown", function (event) { var oldElement = $m(this).siblings(".BPT-TabCycle-Item").matchAttr("tabindex", "1"); var newElement = $m(this); if(newElement.length > 0) { newElement.attr("tabindex", "1"); newElement.trigger("focus"); oldElement.removeAttr("tabindex"); } }); toolwindowHelpers._hostBridge.getAreCodeMarkersEnabled().done(function (data) { toolwindowHelpers.areCodeMarkersEnabled = data; }); }, onShow: function () { if(toolwindowHelpers.onShowCallback) { toolwindowHelpers.onShowCallback(); } }, registerErrorComponent: function (component, errorDisplayHandler) { window.errorComponent = component; window.errorDisplayHandler = errorDisplayHandler; }, registerThemeChange: function (hostBridge, cssFiles, ignoreTreeCssFiles) { function onThemeChange() { var cssThemeFiles = [ "toolwindow.css" ]; if(!ignoreTreeCssFiles) { cssThemeFiles = cssThemeFiles.concat([ "dataTreeView.css", "htmlTreeView.css" ]); } cssThemeFiles = cssThemeFiles.concat(cssFiles); for(var i = 0; i < cssThemeFiles.length; i++) { var id = cssThemeFiles[i]; var contents = hostBridge.loadCssFile(cssThemeFiles[i], i < (!ignoreTreeCssFiles ? 3 : 1)); var oldStyle = document.getElementById(id); if(oldStyle) { document.head.removeChild(oldStyle); } var styleNode = document.createElement("style"); styleNode.id = id; (styleNode).type = "text/css"; styleNode.innerHTML = contents; document.head.appendChild(styleNode); } var trees = $m(".BPT-HtmlTree, .BPT-DataTree, .BPT-DataTree-ScrollContainer, .BPT-Toolbar"); for(var j = 0; j < trees.length; j++) { var element = $m(trees.get(j)); var useDarkTheme = toolwindowHelpers.isDarkThemeBackground(element); if(useDarkTheme) { element.addClass("BPT-Tree-DarkTheme"); } else { element.removeClass("BPT-Tree-DarkTheme"); } } } hostBridge.addEventListener("themeChange", onThemeChange); }, loadString: function (resourceId, params) { return Plugin.Resources.getString.apply(this, [ "/Common/" + resourceId ].concat(params)); }, codeMarker: function (codeMarker) { if(toolwindowHelpers.areCodeMarkersEnabled) { toolwindowHelpers._hostBridge.fireCodeMarker(codeMarker); } }, scrollIntoView: function (element, scrollContainer) { if(element && element.getBoundingClientRect) { var elementRect = element.getBoundingClientRect(); var containerRect = scrollContainer.getBoundingClientRect(); var elementTopIsAboveViewport = elementRect.top < containerRect.top; var elementBottomIsBelowViewport = elementRect.bottom > containerRect.bottom; if(elementTopIsAboveViewport || elementBottomIsBelowViewport) { element.scrollIntoView("top"); return true; } } return false; }, getSortedObjectProperties: function (objectToSort) { var sortedPropNames = []; for(var propName in objectToSort) { sortedPropNames.push(propName); } sortedPropNames.sort(toolwindowHelpers.naturalSort); return sortedPropNames; }, getSortedArrayProperties: function (arrayToSort, key, highPriorityValue) { var i; var sortedProps = []; for(i = 0; i < arrayToSort.length; i++) { sortedProps.push({ property: arrayToSort[i][key], realIndex: i }); } sortedProps.sort(function (a, b) { if(highPriorityValue) { if(a.property === highPriorityValue && b.property === highPriorityValue) { return 0; } else if(a.property === highPriorityValue) { return -1; } else if(b.property === highPriorityValue) { return 1; } } return toolwindowHelpers.naturalSort(a.property, b.property); }); var sortedList = []; for(i = 0; i < sortedProps.length; i++) { sortedList.push(sortedProps[i].realIndex); } return sortedList; }, naturalSort: function (a, b) { var regexSortGroup = /(\d+)|(\D+)/g; var aGroups = String(a).toLowerCase().match(regexSortGroup); var bGroups = String(b).toLowerCase().match(regexSortGroup); while(aGroups.length > 0 && bGroups.length > 0) { var aFront = aGroups.shift(); var bFront = bGroups.shift(); var aAsDigit = parseInt(aFront, 10); var bAsDigit = parseInt(bFront, 10); if(isNaN(aAsDigit) && isNaN(bAsDigit)) { if(aFront !== bFront) { return (aFront > bFront ? 1 : -1); } } else if(isNaN(aAsDigit)) { return 1; } else if(isNaN(bAsDigit)) { return -1; } else { if(aAsDigit !== bAsDigit) { return (aAsDigit - bAsDigit); } } } return aGroups.length - bGroups.length; }, createShortenedUrlText: function (url) { var shortenedText = url; var javascriptPrefix = "javascript:"; if(shortenedText.toLowerCase().substr(0, javascriptPrefix.length) === javascriptPrefix) { return "javascript:"; } var indexOfHash = shortenedText.indexOf("#"); var indexOfQuestionMark = shortenedText.indexOf("?"); var index = -1; if(indexOfHash > -1 && indexOfQuestionMark > -1) { index = Math.min(indexOfHash, indexOfQuestionMark); } else if(indexOfHash > -1) { index = indexOfHash; } else if(indexOfQuestionMark > -1) { index = indexOfQuestionMark; } if(index > -1) { shortenedText = shortenedText.substring(0, index); } index = shortenedText.lastIndexOf("/"); while(index !== -1 && index === (shortenedText.length - 1)) { shortenedText = shortenedText.substring(0, shortenedText.length - 1); index = shortenedText.lastIndexOf("/"); } if(index > -1) { shortenedText = shortenedText.substring(index + 1); } return shortenedText; }, getTruncatedFileName: function (filePath) { if(!filePath) { return filePath; } var maxLength = 20; var fileName = toolwindowHelpers.createShortenedUrlText(filePath); if(fileName.length > maxLength) { var index = maxLength / 2 - 2; fileName = fileName.substr(0, index) + this.loadString("Ellipsis") + fileName.substr(fileName.length - index); } return fileName; }, createFileLinkText: function (fileUrl, line) { var linkText = this.getTruncatedFileName(fileUrl); if(line) { linkText += ":" + line; } return linkText; }, createLinkDivText: function (link, styles, dontGenerateTooltip) { var linker = ""; if(link && link.url) { var url = "\"" + link.url.replace(/\\"/g, "\"") + "\""; var linkText = toolwindowHelpers.createShortenedUrlText(link.url); var search = ""; if(link.search) { search = "\"" + link.search.replace(/\\"/g, "\"") + "\""; } linkText = linkText.replace(/&/g, "&").replace(/>/g, ">").replace(/"; } return linker; }, htmlEscape: function (htmlString) { if((typeof htmlString) !== "string") { if(htmlString === null || htmlString === undefined) { return ""; } htmlString = "" + htmlString; } return htmlString.replace(/&/g, "&").replace(/>/g, ">").replace(/ 0) { backgroundColor = element.css("background-color"); element = element.parent(); } if(backgroundColor) { var rgbParts = backgroundColor.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); if(rgbParts && rgbParts.length === 4) { var brightness = ((rgbParts[1] * 299) + (rgbParts[2] * 587) + (rgbParts[3] * 114)) / 1000; return (brightness < 127); } } } return false; }, oldShowContextMenu: function (menuId, x, y, callback, menuParams, toolContextMenus) { var menu = toolContextMenus[menuId]; for(var i = 0; i < menu.length; i++) { if(menu[i] !== "separator") { menu[i].enabled = true; } } var j = 0; for(var i = 0; i < menuParams.length && j < menu.length; i++ , j++) { while(menu[j] === "separator") { j++; } if(j >= menu.length) { break; } menu[j].enabled = menuParams[i]; } toolwindowHelpers.showContextMenu(menuId, menu, x, y, callback); }, lastDaytonaContextMenu: null, contextMenuIsUp: false, showContextMenu: function (menuName, itemsArray, x, y, callback) { toolwindowHelpers.takeDownDaytonaContextMenu(); var shimCallback = function (menuId, menuItem) { toolwindowHelpers.takeDownDaytonaContextMenu(); if(menuId && menuItem) { callback(menuId, menuItem.id); } }; toolwindowHelpers.lastDaytonaContextMenu = toolwindowHelpers.daytonaShowContextMenu(menuName, itemsArray, x, y, shimCallback); }, daytonaShowContextMenu: function toolwindowHelpers$daytonaShowContextMenu(menuName, itemsArray, x, y, callback) { var TYPE_SEPARATOR = Plugin.ContextMenu.MenuItemType.separator; var TYPE_COMMAND = Plugin.ContextMenu.MenuItemType.command; var daytonaContextMenuItems = []; var disabled_fn = function () { return true; }; var enabled_fn = function () { return false; }; for(var i = 0, length = itemsArray.length; i < length; i++) { var item = itemsArray[i]; if(item === "separator" || item.id === "separator") { daytonaContextMenuItems.push({ type: TYPE_SEPARATOR }); } else { daytonaContextMenuItems.push({ id: item.id, type: TYPE_COMMAND, label: item.text, iconEnabled: item.iconSrc, iconDisabled: item.iconSrc, disabled: item.enabled || typeof item.enabled === 'undefined' ? enabled_fn : disabled_fn, accessKey: item.accessKey }); } } var oldFocus = document.querySelector(":focus"); var daytonaContextMenu = Plugin.ContextMenu.create(daytonaContextMenuItems, menuName, null, undefined, callback); daytonaContextMenu.addEventListener("dismiss", function (e) { if(oldFocus && !toolwindowHelpers.isFocusGood() && toolwindowHelpers.nodeInDocument(oldFocus)) { oldFocus.focus(); } toolwindowHelpers.contextMenuIsUp = false; }); daytonaContextMenu.show(x, y); toolwindowHelpers.contextMenuIsUp = true; return daytonaContextMenu; }, isContextMenuUp: function () { return toolwindowHelpers.contextMenuIsUp; }, takeDownDaytonaContextMenu: function () { if(toolwindowHelpers.lastDaytonaContextMenu) { var lastContextMenu = toolwindowHelpers.lastDaytonaContextMenu; toolwindowHelpers.lastDaytonaContextMenu = null; lastContextMenu.dismiss(); lastContextMenu.dispose(); } }, nodeInDocument: function toolwindowHelpers$nodeInDocument(node) { if(node) { while(node = node.parentNode) { if(node === document) { return true; } } } return false; }, isFocusGood: function toolwindowHelpers$isFocusGood() { var nowFocus = document.querySelector(":focus"); return nowFocus && nowFocus.tagName !== "BODY"; } }; //@ sourceMappingURL=toolwindow.js.map // Proxy.ts var Proxy = (function () { function Proxy(hostBridge, diagnosticsBridge) { this._uid = 0; this._callbacks = { }; this._pendingTimeout = null; this.remotePort = null; this.atBreakpoint = false; this.atBreakpointInWorker = false; this._hostBridge = hostBridge; this._diagnosticsBridge = diagnosticsBridge; } Proxy.prototype.callRemote = function (command, args, callback, preMessageCallback) { var _this = this; var uidString = this.getUid(); if(callback) { this._callbacks[uidString] = { synced: true, callback: callback || null }; } var callbackUids = []; var newArgs = []; if(args) { for(var i = 0; i < args.length; i++) { if(typeof (args[i]) === "function") { var callbackuid = this.getUid(); callbackUids.push(callbackuid); this._callbacks[callbackuid] = { synced: false, callback: args[i] }; newArgs[i] = { uid: callbackuid, type: "callback" }; } else { newArgs[i] = args[i]; } } } var jsonObj = { uid: uidString, command: command, args: newArgs }; var sendMessageToRemote = function (message, preMessageCallback) { if(_this.remotePort) { if(preMessageCallback) { preMessageCallback(message, args[0]); } try { _this.remotePort.postMessage(message); } catch (e) { return; } } }; this._pendingMessages.push(jsonObj); if(!this._pendingTimeout) { this._pendingTimeout = setTimeout(function () { var message = JSON.stringify(_this._pendingMessages); _this._pendingMessages = []; _this._pendingTimeout = null; sendMessageToRemote(message, preMessageCallback); }, 0); } return callbackUids; }; Proxy.prototype.clearCallBacks = function (uids) { var _this = this; if(uids) { uids.forEach(function (uid) { delete _this._callbacks[uid]; }); } else { this._callbacks = { }; } }; Proxy.prototype.fireCallbacks = function (data) { var msgs = JSON.parse(data); for(var i = 0; i < msgs.length; i++) { var obj = msgs[i]; if(this._callbacks[obj.uid]) { this._callbacks[obj.uid].callback.apply(this, obj.args); if(this._callbacks[obj.uid] && this._callbacks[obj.uid].synced) { delete this._callbacks[obj.uid]; } } else if(obj.uid === "scriptError") { window.reportError(obj.args[0].message, obj.args[0].file, obj.args[0].line, obj.args[0].additionalInfo); } } }; Proxy.prototype.initializeProxy = function (onMessageCallback, onAttachCallback, onDetachCallback, onBreakCallback, onRunCallback) { var _this = this; this._pendingMessages = []; this._onMessageCallback = onMessageCallback; this._onAttachCallback = onAttachCallback; this._onDetachCallback = onDetachCallback || function () { return false; }; this._onBreakCallback = onBreakCallback || function () { return false; }; this._onRunCallback = onRunCallback || function () { return false; }; this._diagnosticsBridge.addEventListener("attach", function () { return _this.onAttach(); }); this._diagnosticsBridge.addEventListener("break", function () { return _this.onBreak(); }); this._diagnosticsBridge.addEventListener("connect", function (p) { return _this.onConnect(p); }); this._diagnosticsBridge.addEventListener("detach", function () { return _this.onDetach(); }); this._diagnosticsBridge.addEventListener("run", function () { return _this.onRun(); }); this._diagnosticsBridge.isAttached().done(function (result) { if(result) { _this.onAttach(); } else { _this.postWarning("DiagnosticsDisabled"); } }, function () { return _this.postWarning("DiagnosticsDisabled"); }); }; Proxy.prototype.executeBreakModeCommand = function (remoteFunction, id, input, callback, createInvoker) { var _this = this; var uidString = this.getUid(); this._callbacks[uidString] = { synced: true, callback: callback || function () { } }; var sendBreakCommand = function () { if(_this.atBreakpoint) { _this._hostBridge.executeBreakModeCommand(remoteFunction + ":" + id + ":" + uidString, input, _this.atBreakpointInWorker, createInvoker).done(function (result) { if(!result) { if(_this.remotePort) { var jsonObj = { uid: uidString, command: remoteFunction, args: [ id, input ] }; var message = JSON.stringify([ jsonObj ]); try { _this.remotePort.postMessage(message); } catch (e) { return; } } } }); } }; setTimeout(sendBreakCommand, 0); }; Proxy.prototype.onAttach = function () { var _this = this; this.hideWarningSection(); this._hostBridge.getIsAtBreakpoint().done(function (data) { _this.atBreakpoint = data; _this._onAttachCallback(); }); this._hostBridge.getIsAtBreakpointInWorker().done(function (data) { _this.atBreakpointInWorker = data; }); }; Proxy.prototype.onDetach = function () { if(this.remotePort) { this.remotePort.removeEventListener("message", this._onMessageCallback); this.remotePort = null; } this.atBreakpoint = false; this.atBreakpointInWorker = false; this._callbacks = { }; this._pendingMessages = []; this._pendingTimeout = null; this._onDetachCallback(); this.postWarning("DiagnosticsDisabled"); }; Proxy.prototype.onBreak = function () { var _this = this; if(this.remotePort) { this.atBreakpoint = true; this._hostBridge.getIsAtBreakpointInWorker().done(function (data) { _this.atBreakpointInWorker = data; }); } if(this._onBreakCallback) { this._onBreakCallback(); } }; Proxy.prototype.onRun = function () { if(this.remotePort) { this.atBreakpoint = false; this.atBreakpointInWorker = false; } if(this._onRunCallback) { this._onRunCallback(); } }; Proxy.prototype.onConnect = function (port) { var _this = this; this.remotePort = this._diagnosticsBridge.createPort(port); this.remotePort.addEventListener("message", this._onMessageCallback); this._hostBridge.getIsAtBreakpoint().done(function (data) { _this.atBreakpoint = data; }); this._hostBridge.getIsAtBreakpointInWorker().done(function (data) { _this.atBreakpointInWorker = data; }); }; Proxy.prototype.getUid = function () { return "uid" + (this._uid++).toString(36); }; Proxy.prototype.hideWarningSection = function () { $m("#warningSection").hide(); }; Proxy.prototype.postWarning = function (msg) { $m("#warningMessageText").text(toolwindowHelpers.loadString(msg)); $m("#warningSection").show(); }; return Proxy; })(); //@ sourceMappingURL=Proxy.js.map // rpc.ts var F12; (function (F12) { (function (Tools) { (function (RPC) { var JsonRPCEndpoint = (function () { function JsonRPCEndpoint(identifier, jsonRpcMethodReceive, jsonRpcNotificationReceive, postMessage, onMessageCapture) { var _this = this; this._ourIdentifier = identifier; this._nextId = 0; this._promiseTable = { }; this._jsonRpcMethodReceive = jsonRpcMethodReceive; this._jsonRpcNotificationReceive = jsonRpcNotificationReceive; this._postMessage = postMessage; if(!Date.now) { Date.now = function now() { return +(new Date()); }; } this._startTime = Date.now(); onMessageCapture(function (data) { _this.onMessage(data); }); } JsonRPCEndpoint.prototype.jsonRpcMethodCall = function (method, params, completed, error, identification) { var id = this._ourIdentifier + "|" + this._nextId; this._nextId++; this._promiseTable[id] = { completed: completed, error: error }; var message = JSON.stringify({ id: id, method: method, params: params }); this.logTraffic(message); return this._postMessage(message, identification); }; JsonRPCEndpoint.prototype.jsonRpcNotification = function (method, params, identification) { var id = this._ourIdentifier + "|" + "NULL"; var message = JSON.stringify({ id: id, method: method, params: params }); this.logTraffic(message); this._postMessage(message, identification); }; JsonRPCEndpoint.prototype.logTraffic = function (data) { if(isDebugBuild) { var paddedTimestamp = (" " + (Date.now() - this._startTime) / 1000).slice(-9); __rpcLog.push(paddedTimestamp + " | " + data); if(__rpcLog.length > 100) { __rpcLog.shift(); } } }; JsonRPCEndpoint.prototype.onMessage = function (data) { var _this = this; this.logTraffic(data.data); var result = JSON.parse(data.data); var idSplit = (result.id).split("|"); Tools.Utility.Assert.AreEqual(idSplit.length, 2); if(idSplit[1] === "NULL") { Tools.Utility.Assert.AreNotEqual(idSplit[0], this._ourIdentifier, "Can't notify ourselves"); this._jsonRpcNotificationReceive(result.method, result.params); } else if(idSplit[0] === this._ourIdentifier) { Tools.Utility.Assert.HasValue(this._promiseTable[result.id]); if(result.error) { Tools.Utility.Assert.IsUndefined(result.data, "Can't have both data and error"); this._promiseTable[result.id].error(result.error); } else { this._promiseTable[result.id].completed(result.data); } delete this._promiseTable[result.id]; } else { this._jsonRpcMethodReceive(result.method, result.params, function (data, error) { var message; if(data !== null && data !== undefined) { Tools.Utility.Assert.IsUndefined(error, "Can't have both data and error"); message = JSON.stringify({ id: result.id, data: data }); } else { Tools.Utility.Assert.HasValue(error, "RPC call returned no value, but no error object either"); message = JSON.stringify({ id: result.id, error: error }); } _this._postMessage(message); }); } }; return JsonRPCEndpoint; })(); RPC.JsonRPCEndpoint = JsonRPCEndpoint; })(Tools.RPC || (Tools.RPC = {})); var RPC = Tools.RPC; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); if(isDebugBuild) { var __rpcLog = []; } //@ sourceMappingURL=rpc.js.map .BPT-DataTree-Container { white-space: nowrap; padding: 3px 6px 6px 6px; } .BPT-DataTree-Container:focus { outline:0; } .BPT-DataTree { position: relative; } .BPT-DataTree-Divider { position: absolute; top: 0px; left: 170px; bottom: 0px; z-index: 100; width: 4px; background-color: transparent; cursor: w-resize; margin-left: 14px; } .BPT-DataTree-DividerVisible { background-color: #222222; /*[{plugin-vertical-resize-grip-middle-color}]*/ } .BPT-DataTreeItem { position: relative; margin: 0 3px 0 3px; padding-left: 7px; border-left: 1px solid transparent; cursor: default; min-width: 200px; } .BPT-DataTreeItem-Loading { margin: 1px 0px 5px 0px; } .BPT-DataTreeItem-Expanded { background-repeat: no-repeat; background-position: 3px 5px; } .BPT-DataTreeItem-Collapsed { background-repeat: no-repeat; background-position: 3px 5px; } .BPT-DataTreeItem-Expanded .BPT-DataTreeItem { display: block; } .BPT-DataTreeItem-Collapsed .BPT-DataTreeItem { display: none; } .BPT-DataTreeItem-ExpandIcon { left: 3px; top: 5px; position: absolute; width: 10px; height: 10px; } .BPT-DataTree .BPT-DataTreeItem-Collapsed > .BPT-DataTreeItem-ExpandIcon { background-image: url(''); /*[url({plugin-image-icon-item-collapsed})]*/ background-size: 10px 10px; } .BPT-DataTree .BPT-DataTreeItem-Expanded > .BPT-DataTreeItem-ExpandIcon { background-image: url(''); /*[url({plugin-image-icon-item-expanded})]*/ background-size: 10px 10px; } .BPT-DataTreeItem-ChildCollection { } .BPT-DataTreeItem-Header { display:inline-block; left: 0; right: 0; border: 1px solid transparent; border-radius: 3px; margin-left: 8px; margin-bottom: 0; padding: 1px 0; } .BPT-DataTreeItem-CollapsedBlockFooter { display: inline; } .BPT-DataTreeItem-BlockFooter { display: none; margin-left: 10px; } .BPT-DataTreeItem-Expanded.BPT-DataTreeItem-CollapsibleBlock > .BPT-DataTreeItem-Header > .BPT-DataTreeItem-Name > .BPT-DataTreeItem-CollapsedBlockFooter { display: none; } .BPT-DataTreeItem-Expanded > .BPT-DataTreeItem-BlockFooter { display: block; } .BPT-DataTreeItem-FileLink-Right { display: block; float: right; max-width: 100px; overflow: hidden; text-overflow: ellipsis; padding: 2px; } .BPT-DataTreeItem-Header > .BPT-DataTreeItem-FileLink-Right { padding: 0; } .BPT-DataTreeItem-FileLink-Value { max-width: 12em; text-overflow: ellipsis; overflow: hidden; color: #007acc; /*[{plugin-link-color}]*/ } .BPT-DataTreeItem-Name { display: inline-block; width: 150px; min-height: 1.3em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: top; } .BPT-DataTreeItem-Name input[type="checkbox"]{ position: relative; top: -1px; padding: 0; margin: 0 2px 0 3px; vertical-align: middle; } .BPT-DataTreeItem-Value { display: inline-block; overflow: auto; vertical-align: top; min-height: 1.3em; min-width: 50px; } .BPT-DataTreeItem-CollapsibleBlock > .BPT-DataTreeItem-Header > .BPT-DataTreeItem-Name { overflow: hidden; width: auto; white-space: normal; max-width: 100%; margin-right: 0; word-wrap: break-word; } .BPT-DataTreeItem-CollapsibleBlock > .BPT-DataTreeItem-Header > .BPT-DataTreeItem-Value { min-width: 0; } .BPT-DataTreeItem-Selected { border-left: 1px solid transparent; } .BPT-DataTreeItem-Selected > .BPT-DataTreeItem-Header { background-color: transparent; border-color: transparent; } body.showFocus .BPT-DataTree-Container-CurrentFocus .BPT-DataTreeItem-Selected > .BPT-FileLink { border: 1px dotted #3399FF; /*[1px dotted {plugin-font-editor-selected-background-color}]*/ } .BPT-DataTreeItem-Selected > .BPT-DataTreeItem-Header .BPT-HTML, .BPT-DataTreeItem-Selected > .BPT-DataTreeItem-Header .BPT-HTML-Tag, .BPT-DataTreeItem-Selected > .BPT-DataTreeItem-Header .BPT-HTML-Attribute, .BPT-DataTreeItem-Selected > .BPT-DataTreeItem-Header .BPT-HTML-Value, .BPT-DataTreeItem-Selected > .BPT-DataTreeItem-Header .BPT-HTML-Operator, .BPT-DataTreeItem-Selected > .BPT-DataTreeItem-Header .BPT-HTML-Text, .BPT-DataTreeItem-Selected > .BPT-DataTreeItem-Header .BPT-HTML-Comment, .BPT-DataTreeItem-Selected > .BPT-DataTreeItem-Header .BPT-HTML-Comment + .BPT-HTML-Text, .BPT-DataTreeItem-Selected > .BPT-DataTreeItem-Header .BPT-HTML-DocType + .BPT-HTML-Text, .BPT-DataTreeItem-Selected > .BPT-DataTreeItem-Header .BPT-HTML-CSS-Name, .BPT-DataTreeItem-Selected > .BPT-DataTreeItem-Header .BPT-HTML-CSS-Value, .BPT-DataTreeItem-Selected > .BPT-DataTreeItem-Header .BPT-HTML-CSS-Selector, .BPT-DataTreeItem-Selected > .BPT-DataTreeItem-Header .BPT-HTML-CSS-Text { background: transparent; } body .BPT-DataTree-Container:focus .BPT-DataTreeItem-Selected, body .BPT-DataTree-Container-CurrentFocus .BPT-DataTreeItem-Selected, body .BPT-DataTree-Container-KeepSelection .BPT-DataTreeItem-Selected { border-color: #3399FF; /*[{plugin-font-editor-selected-background-color}]*/ } body .BPT-DataTree-Container:focus .BPT-DataTreeItem-Selected > .BPT-DataTreeItem-Header, body .BPT-DataTree-Container-CurrentFocus .BPT-DataTreeItem-Selected > .BPT-DataTreeItem-Header, body .BPT-DataTree-Container-KeepSelection .BPT-DataTreeItem-Selected > .BPT-DataTreeItem-Header { background: rgba(51, 153, 255, 0.25); /*[{plugin-font-editor-selected-background-color rgba(0.25)}]*/ border-color: #3399FF; /*[{plugin-font-editor-selected-background-color}]*/ } body.BPT-ToolWindow-NoFocus .BPT-DataTree-Container:focus .BPT-DataTreeItem-Selected, body.BPT-ToolWindow-NoFocus .BPT-DataTree-Container-CurrentFocus .BPT-DataTreeItem-Selected, body.BPT-ToolWindow-NoFocus .BPT-DataTree-Container-KeepSelection .BPT-DataTreeItem-Selected { border-color: transparent; } body.BPT-ToolWindow-NoFocus .BPT-DataTree-Container:focus .BPT-DataTreeItem-Selected > .BPT-DataTreeItem-Header, body.BPT-ToolWindow-NoFocus .BPT-DataTree-Container-CurrentFocus .BPT-DataTreeItem-Selected > .BPT-DataTreeItem-Header, body.BPT-ToolWindow-NoFocus .BPT-DataTree-Container-KeepSelection .BPT-DataTreeItem-Selected > .BPT-DataTreeItem-Header { background: rgba(191, 205, 219, 0.25); /*[{plugin-font-editor-inactive-selected-background-color rgba(0.25)}]*/ border-color: #BFCDDB; /*[{plugin-font-editor-inactive-selected-background-color}]*/ } .BPT-HtmlTree-Container:focus { outline: 0; } .BPT-HTML { font-family: "Consolas", Lucida Console, monospace; /*[{plugin-font-editor} , Lucida Console, monospace]*/ font-size: 9pt; /*[{plugin-font-editor-size}]*/ font-weight: normal; /*[{plugin-font-editor-weight}]*/ color: TRANSPARENT; /*[{plugin-font-editor-html-tag-color}]*/ } .BPT-HTML-Tag { color: TRANSPARENT; /*[{plugin-font-editor-html-element-color}]*/ font-weight: normal; /*[{plugin-font-editor-html-element-weight}]*/ } .BPT-HTML-DocType, .BPT-HTML-DocType + .BPT-HTML-Text { color: TRANSPARENT; /*[{plugin-font-editor-html-comment-color}]*/ font-weight: normal; /*[{plugin-font-editor-html-comment-weight}]*/ cursor: default; } .BPT-HTML-Comment, .BPT-HTML-Comment + .BPT-HTML-Text { color: TRANSPARENT; /*[{plugin-font-editor-html-comment-color}]*/ font-weight: normal; /*[{plugin-font-editor-html-comment-weight}]*/ cursor: default; } .BPT-HTML-Attribute { color: TRANSPARENT; /*[{plugin-font-editor-html-attribute-name-color}]*/ font-weight: normal; /*[{plugin-font-editor-html-attribute-name-weight}]*/ } .BPT-HTML-Value { color: TRANSPARENT; /*[{plugin-font-editor-html-attribute-value-color}]*/ font-weight: normal; /*[{plugin-font-editor-html-attribute-value-weight}]*/ } .BPT-HTML-Text { color: TRANSPARENT; /*[{plugin-font-editor-color}]*/ font-weight: normal; /*[{plugin-font-editor-html-operator-weight}]*/ white-space: pre-wrap; } .BPT-HTML-CSS-Name { color: TRANSPARENT; /*[{plugin-font-editor-css-name-color}]*/ font-weight: normal; /*[{plugin-font-editor-css-name-weight}]*/ } .BPT-HTML-CSS-Value { color: TRANSPARENT; /*[{plugin-font-editor-css-value-color}]*/ font-weight: normal; /*[{plugin-font-editor-css-value-weight}]*/ } .BPT-HTML-CSS-Selector { color: TRANSPARENT; /*[{plugin-font-editor-css-selector-color}]*/ font-weight: normal; /*[{plugin-font-editor-css-selector-weight}]*/ } .BPT-HTML-CSS-ParentRule { color: TRANSPARENT; /*[{plugin-font-editor-css-selector-color}]*/ font-weight: normal; } .BPT-HTML-CSS-Text { color: TRANSPARENT; /*[{plugin-font-editor-color}]*/ font-weight: normal; /*[{plugin-font-editor-weight}]*/ } .BPT-HTML-CSS-SelectorTag { font-style:italic; } .BPT-HTML-CSS-InlinedSelector { font-style:italic; } .BPT-HTML-Numbering { display: inline-block; min-width: 25px; } .BPT-HTML-Tag > input { vertical-align: -2px } .BPT-Style-Disabled span { text-decoration: line-through; } .BPT-HtmlTreeItem { padding-left: 10px; border-left: 1px solid transparent; cursor: default; position: relative; margin: -2px 5px; word-wrap: break-word; min-width: 400px; } .BPT-HtmlTreeItem-HiddenRoot { padding-left: 0px; } .BPT-HtmlTreeItem-Expanded { background-repeat: no-repeat; background-position: 3px 5px; } .BPT-HtmlTreeItem-Collapsed { background-repeat: no-repeat; background-position: 3px 5px; } .BPT-HtmlTreeItem-Expanded .BPT-HtmlTreeItem { display: block; } .BPT-HtmlTreeItem-Collapsed .BPT-HtmlTreeItem { display: none; } .BPT-HtmlTreeItem-ExpandIcon { left: 3px; top: 6px; position: absolute; width: 10px; height: 10px; } .BPT-HtmlTree .BPT-HtmlTreeItem-Collapsed > .BPT-HtmlTreeItem-ExpandIcon { background-image: url(''); /*[url({plugin-image-icon-item-collapsed})]*/ background-size: 10px 10px; } .BPT-HtmlTree .BPT-HtmlTreeItem-Expanded > .BPT-HtmlTreeItem-ExpandIcon { background-image: url(''); /*[url({plugin-image-icon-item-expanded})]*/ background-size: 10px 10px; } .BPT-HtmlTreeItem-Header { left: 0px; right: 0px; font-size: 12px; line-height: 1.5em; border: 1px solid transparent; margin-left: 8px; padding: 0px; } .BPT-HtmlTreeItem-Footer { left: 0px; right: 0px; font-size: 12px; line-height: 1.3em; border: 1px solid transparent; margin-left: 8px; padding: 0px 0px 1px 0px; display: none; } .BPT-HtmlTreeItem-Expanded > .BPT-HtmlTreeItem-Footer { display: block; } .BPT-HtmlTreeItem-Expanded > .BPT-HtmlTreeItem-Header > .BPT-HtmlTreeItem-CollapsedFooter { display: none; } .BPT-HtmlTreeItem-Header:hover { background-color: transparent; border-color: TRANSPARENT; /*[{plugin-treeview-content-mouseover-color rgba(0.25)}]*/ } body.BPT-ToolWindow-NoFocus .BPT-HtmlTreeItem-Header:hover { border-color: TRANSPARENT; /*[{plugin-font-editor-selected-background-color rgba(0.25)}]*/ } .BPT-HtmlTreeItem-HiddenRoot > .BPT-HtmlTreeItem-Header:hover { background-color: transparent; border-color: transparent; } .BPT-HtmlTreeItem-Selected { border-left: 1px solid transparent; } .BPT-HtmlTreeItem-Selected > .BPT-HtmlTreeItem-Header { background-color: transparent; border-color: transparent; } body .BPT-HtmlTree-Container:focus .BPT-HtmlTreeItem-Selected, body .BPT-HtmlTree-Container-KeepSelection .BPT-HtmlTreeItem-Selected { border-left-color: TRANSPARENT; /*[{plugin-font-editor-selected-border-color}]*/ } body .BPT-HtmlTree-Container:focus .BPT-HtmlTreeItem-Selected > .BPT-HtmlTreeItem-Header, body .BPT-HtmlTree-Container-KeepSelection .BPT-HtmlTreeItem-Selected > .BPT-HtmlTreeItem-Header { background: rgba(51, 153, 255, 0.25); /*[{plugin-font-editor-selected-background-color rgba(0.2)}]*/ border-color: transparent; } body.BPT-ToolWindow-NoFocus .BPT-HtmlTree-Container:focus .BPT-HtmlTreeItem-Selected, body.BPT-ToolWindow-NoFocus .BPT-HtmlTree-Container-KeepSelection .BPT-HtmlTreeItem-Selected { border-left-color: transparent; } body.BPT-ToolWindow-NoFocus .BPT-HtmlTree-Container:focus .BPT-HtmlTreeItem-Selected > .BPT-HtmlTreeItem-Header, body.BPT-ToolWindow-NoFocus .BPT-HtmlTree-Container-KeepSelection .BPT-HtmlTreeItem-Selected > .BPT-HtmlTreeItem-Header { background: transparent; border-color: transparent; } .BPT-HtmlTreeItem-Selected > .BPT-HtmlTreeItem-Header .BPT-HTML-Attribute-Changed, .BPT-HTML-Attribute-Changed { background-color: TRANSPARENT; /*[{plugin-highlight-background-color rgba(0.35)}]*/ color:TRANSPARENT; /*[{plugin-highlight-color}]*/ } .BPT-HtmlTree-ChildCollection-ShowAll { color: TRANSPARENT; /*[{plugin-font-editor-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-editor-background-color}]*/ font-weight: normal; /*[{plugin-font-editor-weight}]*/ white-space: pre-wrap; display: inline-block; position: relative; margin-left: 10px; margin-bottom: 1px; } .BPT-HtmlTree-ChildCollection-ShowAll:hover, .BPT-HtmlTree-ChildCollection-ShowAll.BPT-HtmlTreeItem-Selected { text-decoration: underline; } .BPT-HtmlTreeItem-Hover.BPT-HtmlTreeItem-DropBefore { border-top: 1px solid blue; } .BPT-HtmlTreeItem-Hover.BPT-HtmlTreeItem-DropAfter { border-bottom: 1px solid blue; } /* adds angle bracket before opening HTML tags */ div.BPT-HtmlTree > div.BPT-HtmlTree-ChildCollection > .BPT-HtmlTreeItem .BPT-HtmlTreeItem-Header .BPT-HTML-Tag::before { content: "<"; color: TRANSPARENT; /*[{plugin-font-editor-color}]*/ } /* adds angle slash before closing HTML tags */ div.BPT-HtmlTree > div.BPT-HtmlTree-ChildCollection > .BPT-HtmlTreeItem .BPT-HtmlTreeItem-CollapsedFooter .BPT-HTML-Tag::before, div.BPT-HtmlTree > div.BPT-HtmlTree-ChildCollection > .BPT-HtmlTreeItem .BPT-HtmlTreeItem-Footer .BPT-HTML-Tag::before { content: " span:first-child > span:first-child::after, /* closes the opening tag of a tag pair */ .BPT-HtmlTreeItem-Header > .BPT-HtmlTreeItem-CollapsedFooter::after, /* closes the closing tag of a collapsed tag pair */ .BPT-HtmlTreeItem-Footer::after /* closes the closing tag of an expanded tag pair */ { content: ">"; color: TRANSPARENT; /*[{plugin-font-editor-color}]*/ } /* ... but not to special tags */ div[data-tag^="#"] > .BPT-HtmlTreeItem-Header > span:first-child > span:first-child::after, /* closes the opening tag of a tag pair */ div[data-tag^="#"] > .BPT-HtmlTreeItem-Header > .BPT-HtmlTreeItem-CollapsedFooter::after, /* closes the closing tag of a collapsed tag pair */ div[data-tag^="#"] > .BPT-HtmlTreeItem-Footer::after /* closes the closing tag of an expanded tag pair */ { content: ""; } /* Add space before attribute name, = after the attribute name, and " before-and-after attribute value. */ div.BPT-HtmlTree > div.BPT-HtmlTree-ChildCollection > .BPT-HtmlTreeItem .BPT-HTML-Attribute-Section .BPT-HTML-Attribute::before { content:" "; } div.BPT-HtmlTree > div.BPT-HtmlTree-ChildCollection > .BPT-HtmlTreeItem .BPT-HTML-Attribute-Section .BPT-HTML-Attribute::after { content:"="; color: TRANSPARENT; /*[{plugin-font-editor-color}]*/ } div.BPT-HtmlTree > div.BPT-HtmlTree-ChildCollection > .BPT-HtmlTreeItem .BPT-HTML-Attribute-Section .BPT-HTML-Value::before, div.BPT-HtmlTree > div.BPT-HtmlTree-ChildCollection > .BPT-HtmlTreeItem .BPT-HTML-Attribute-Section .BPT-HTML-Value::after { content:"\""; color: TRANSPARENT; /*[{plugin-font-editor-color}]*/ } var isDebugBuild = false; //@ sourceMappingURL=isDebugBuild.js.map PNG  IHDR tEXtSoftwareAdobe ImageReadyqe<fiTXtXML:com.adobe.xmp #/IDATxb?5.@L,A ȂWƮ[&",{ @ u Ȇ&PlC~~>;x~ Z^^ Y cccdC d l `H3ٳ 0.("%$0G!@FFFͰP}y"aȆ%B 8/mQ.(QbOYVIwps&BDIENDB`PNG  IHDR tEXtSoftwareAdobe ImageReadyqe<fiTXtXML:com.adobe.xmp {:IDATxڬAP{`۸6 7ca^&SJ Y0ìl1cĔR/P`lle=HV")X9~Oƴ,@zkĺ WD`7 !X v)rD:" \4YIENDB`.listBox { padding: 0px; cursor: default; border: 1px solid black; font-family: "Segoe UI", Arial, sans-serif; /*[{plugin-font-family} , Arial, sans-serif]*/ font-size: 12px; list-style-type: none; overflow-y: scroll; overflow-x: hidden; -ms-user-select: none; } .listBox ::selection{ background-color: transparent; } .listBox li { -ms-user-select: none; } .listBox li:hover{ background-color: #DBFFFC; } .listBox li[selected=selected] { background-color: blue; color: white; } (function () { var cookie, pluginUrl = window.external.pluginUrl || (cookie = document.cookie.match(/(?:^|;)\s?pluginUrl=(.*?)(?:;|$)/)) && unescape(cookie[1]) || "plugin.b.js", scripts = document.getElementsByTagName('script'); if (scripts && pluginUrl) { for (var i = 0; i < scripts.length; i++) { var script = scripts[i]; var src = script.src; if (/(^|\\|\/)plugin.js$/.test(src)) { var newScript = document.createElement("script"); newScript.src = pluginUrl; script.parentElement.insertBefore(newScript, script.nextSibling); break; } } } })(); var Common; (function (Common) { var EditStack = (function () { function EditStack() { this._UNDO_LIMIT = 100; this._singleEdit = false; this._undoActions = 0; this._doActions = 0; this.reset(); } EditStack.prototype._pushEdit = function (edit) { edit.chainingUid = this._chainingUid; this._undoStack.push(edit); this._doStack = []; this._doActions = 0; if(!this._chainingUid) { this._undoActions++; this._checkIfOverLimit(); } }; EditStack.prototype._checkIfOverLimit = function () { while(this._doActions + this._undoActions > this._UNDO_LIMIT) { var edit = this._undoStack[0]; if(!edit.chainingUid) { this._undoStack.shift(); } else { while((this._undoStack.length > 0) && (this._undoStack[0].chainingUid === edit.chainingUid)) { this._undoStack.shift(); } } this._undoActions--; } }; EditStack.prototype._peek = function (stack) { var edit = stack.pop(); stack.push(edit); return edit; }; EditStack.prototype.setTestEditCallbacks = function (testEditCallback, testUndoCallback) { this._testEditCallback = testEditCallback; this._testUndoCallback = testUndoCallback; }; EditStack.prototype.setLimit = function (newLimit) { this._UNDO_LIMIT = newLimit; }; EditStack.prototype.getLimit = function () { return this._UNDO_LIMIT; }; EditStack.prototype.reset = function () { this._undoStack = new Array(); this._doStack = new Array(); this._chainingUid = null; this._chainingLevel = 0; }; EditStack.prototype.performEdit = function (edit) { var editWorked = false; try { editWorked = edit.performEdit(); } catch (e) { editWorked = false; } if(editWorked) { if(this._singleEdit) { var singleEdit = edit; if(!singleEdit.getOldValue || !singleEdit.setOldValue) { return false; } if(!this._singleEditFirstEdit) { this._singleEditFirstEdit = singleEdit; } this._singleEditLastEdit = singleEdit; } else { this._pushEdit(edit); } } if(this._testEditCallback) { this._testEditCallback(editWorked); } return editWorked; }; EditStack.prototype.startSingleEdit = function () { this._singleEdit = true; }; EditStack.prototype.endSingleEdit = function () { this._singleEdit = false; if(this._singleEditFirstEdit) { var firstValue = this._singleEditFirstEdit.getOldValue(); this._singleEditLastEdit.setOldValue(firstValue); if(this._singleEditLastEdit.hasValueChanged()) { this._pushEdit(this._singleEditLastEdit); } } this._singleEditFirstEdit = undefined; this._singleEditLastEdit = undefined; }; EditStack.prototype.enableChaining = function () { this._chainingLevel++; if(this._chainingLevel > 1) { return; } this._chainingUid = remoteHelpers.getUid(); }; EditStack.prototype.disableChaining = function () { if(this._chainingLevel > 0) { this._chainingLevel--; if(this._chainingLevel === 0) { var edit = this._peek(this._undoStack); var aChainedEditWasAdded = edit && edit.chainingUid === this._chainingUid; this._chainingUid = null; if(aChainedEditWasAdded) { this._undoActions++; this._checkIfOverLimit(); } } } else { } }; EditStack.prototype.undo = function () { var retValue = true; try { if(this.somethingToUndo()) { var edit = this._undoStack.pop(); if(!edit.performUndo()) { this.reset(); retValue = false; } else { this._doStack.push(edit); while(this.somethingToUndo() && edit.chainingUid) { var nextItemToUndo = this._undoStack.pop(); if(nextItemToUndo.chainingUid !== edit.chainingUid) { this._undoStack.push(nextItemToUndo); break; } edit = nextItemToUndo; if(!edit.performUndo()) { this.reset(); retValue = false; break; } else { this._doStack.push(edit); } } } this._undoActions--; this._doActions++; } } catch (e) { retValue = false; } if(this._testUndoCallback) { this._testUndoCallback(retValue); } return retValue; }; EditStack.prototype.performNextEdit = function () { var retValue = true; try { if(this.somethingToDo()) { var edit = this._doStack.pop(); if(!edit.performEdit(true)) { this.reset(); retValue = false; } else { this._undoStack.push(edit); while(this.somethingToDo() && edit.chainingUid) { var nextitemtodo = this._doStack.pop(); if(nextitemtodo.chainingUid !== edit.chainingUid) { this._doStack.push(nextitemtodo); break; } edit = nextitemtodo; if(!edit.performEdit(true)) { this.reset(); retValue = false; break; } else { this._undoStack.push(edit); } } } this._undoActions++; this._doActions--; } } catch (e) { retValue = false; } if(this._testEditCallback) { this._testEditCallback(retValue); } return retValue; }; EditStack.prototype.somethingToUndo = function () { return (this._undoStack.length > 0); }; EditStack.prototype.somethingToDo = function () { return (this._doStack.length > 0); }; return EditStack; })(); Common.EditStack = EditStack; })(Common || (Common = {})); //@ sourceMappingURL=remoteEditStack.js.map var errorHandler; var Common; (function (Common) { var RemoteHelpers = (function () { function RemoteHelpers(_messageHandlers) { this._messageHandlers = _messageHandlers; this.pendingMessages = []; this.pendingMessagesMap = { }; this.pendingTimeout = false; this.port = null; this.portId = 0; this.portReady = false; this.onDetachCallback = null; this.initializeDocumentMaxTries = 15; this.initializeDocumentTries = 0; this.childrenElementLimit = 200; this.uid = 0; this.isEvalModified = false; this.isExecScriptModified = false; } RemoteHelpers.failedEventAddCount = 0; RemoteHelpers.failedEvents = { }; RemoteHelpers.eventsWhereWeWantToProcessOnCapture = { }; RemoteHelpers.computedPropertiesInIE8 = [ 'accelerator', 'animation', 'animationDelay', 'animationDirection', 'animationDuration', 'animationFillMode', 'animationIterationCount', 'animationName', 'animationPlayState', 'animationTimingFunction', 'backfaceVisibility', 'background', 'backgroundAttachment', 'backgroundClip', 'backgroundColor', 'backgroundImage', 'backgroundOrigin', 'backgroundPosition', 'backgroundPositionX', 'backgroundPositionY', 'backgroundRepeat', 'backgroundSize', 'baselineShift', 'behavior', 'blockDirection', 'border', 'borderBottom', 'borderBottomColor', 'borderBottomLeftRadius', 'borderBottomRightRadius', 'borderBottomStyle', 'borderBottomWidth', 'borderCollapse', 'borderColor', 'borderLeft', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', 'borderRadius', 'borderRight', 'borderRightColor', 'borderRightStyle', 'borderRightWidth', 'borderSpacing', 'borderStyle', 'borderTop', 'borderTopColor', 'borderTopLeftRadius', 'borderTopRightRadius', 'borderTopStyle', 'borderTopWidth', 'borderWidth', 'bottom', 'boxShadow', 'boxSizing', 'breakAfter', 'breakBefore', 'breakInside', 'captionSide', 'clear', 'clip', 'clipBottom', 'clipLeft', 'clipPath', 'clipRight', 'clipTop', 'color', 'columnCount', 'columnFill', 'columnGap', 'columnRule', 'columnRuleColor', 'columnRuleStyle', 'columnRuleWidth', 'columnSpan', 'columnWidth', 'constructor', 'content', 'counterIncrement', 'counterReset', 'cssFloat', 'cssText', 'cursor', 'direction', 'display', 'dominantBaseline', 'emptyCells', 'fill', 'fillOpacity', 'fillRule', 'filter', 'font', 'fontFamily', 'fontSize', 'fontSizeAdjust', 'fontStretch', 'fontStyle', 'fontVariant', 'fontWeight', 'fontWeight', 'glyphOrientationHorizontal', 'glyphOrientationVertical', 'hasLayout', 'height', 'imeMode', 'kerning', 'layoutFlow', 'layoutGrid', 'layoutGridChar', 'layoutGridLine', 'layoutGridMode', 'layoutGridType', 'left', 'length', 'letterSpacing', 'lineBreak', 'lineHeight', 'listStyle', 'listStyleImage', 'listStylePosition', 'listStyleType', 'margin', 'marginBottom', 'marginLeft', 'marginRight', 'marginTop', 'marker', 'markerEnd', 'markerMid', 'markerStart', 'mask', 'maxHeight', 'maxWidth', 'minHeight', 'minWidth', 'msBlockProgression', 'msGridColumn', 'msGridColumnAlign', 'msGridColumns', 'msGridColumnSpan', 'msGridRow', 'msGridRowAlign', 'msGridRows', 'msGridRowSpan', 'msInterpolationMode', 'msProgressAppearance', 'opacity', 'orphans', 'outline', 'outlineColor', 'outlineStyle', 'outlineWidth', 'overflow', 'overflowX', 'overflowY', 'padding', 'paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop', 'pageBreakAfter', 'pageBreakBefore', 'pageBreakInside', 'parentRule', 'perspective', 'perspectiveOrigin', 'pointerEvents', 'position', 'quotes', 'right', 'rubyAlign', 'rubyOverhang', 'rubyPosition', 'scrollbar3dLightColor', 'scrollbarArrowColor', 'scrollbarBaseColor', 'scrollbarDarkShadowColor', 'scrollbarFaceColor', 'scrollbarHighlightColor', 'scrollbarShadowColor', 'scrollbarTrackColor', 'stopColor', 'stopOpacity', 'stroke', 'strokeDasharray', 'strokeDashoffset', 'strokeLinecap', 'strokeLinejoin', 'strokeMiterlimit', 'strokeOpacity', 'strokeWidth', 'styleFloat', 'tableLayout', 'textAlign', 'textAlignLast', 'textAutospace', 'textDecoration', 'textIndent', 'textJustify', 'textKashidaSpace', 'textOverflow', 'textTransform', 'textUnderlinePosition', 'top', 'transform', 'transformOrigin', 'transformStyle', 'transition', 'transitionDelay', 'transitionDuration', 'transitionProperty', 'transitionTimingFunction', 'unicodeBidi', 'verticalAlign', 'visibility', 'whiteSpace', 'widows', 'width', 'wordBreak', 'wordSpacing', 'wordWrap', 'writingMode', 'zIndex', 'zoom' ]; RemoteHelpers.prototype.useTimeout = function () { return (toolUI.getBreakFlags() === 0); }; RemoteHelpers.encounteredException = function encounteredException(e) { }; RemoteHelpers.addListener = function addListener(source, name, fn, useCapture) { if(RemoteHelpers.getDocumentMode() >= 9) { if(useCapture) { source.addEventListener(name, fn, useCapture); } else { source.addEventListener(name, fn); } } else if(typeof source.addEventListener === 'function') { source.addEventListener(name, fn); } else { source.attachEvent("on" + name, fn); } }; RemoteHelpers.addSafeListener = function addSafeListener(context, source, name, fn, useCapture) { var safeFunction = remoteHelpers.createSafeFunction(context, fn); Common.RemoteHelpers.addListener(source, name, safeFunction, useCapture); return safeFunction; }; RemoteHelpers.removeListener = function removeListener(source, name, fn, useCapture) { if(RemoteHelpers.getDocumentMode() >= 9) { if(useCapture) { source.removeEventListener(name, fn, useCapture); } else { source.removeEventListener(name, fn); } } else if(typeof source.removeEventListener === 'function') { source.removeEventListener(name, fn); } else { source.detachEvent("on" + name, fn); } }; RemoteHelpers.getDefaultView = function getDefaultView(doc) { if(RemoteHelpers.getDocumentMode() >= 9) { return doc.defaultView; } else { return doc.parentWindow; } }; RemoteHelpers.isElement = function isElement(view, obj) { if(view && obj) { return (typeof view.Element === "object" ? obj instanceof view.Element : typeof obj === "object" && obj.nodeType === 1 && typeof obj.nodeName === "string"); } return false; }; RemoteHelpers.getEventTarget = function getEventTarget(e) { if(RemoteHelpers.getDocumentMode() >= 9) { return e.target; } else { return e.srcElement; } }; RemoteHelpers.getComputedStyle = function getComputedStyle(win, element) { var _this = this; if(RemoteHelpers.getDocumentMode() >= 9) { var computedStyles = win.getComputedStyle(element); var result = { }; var propertyName, propertyValue; for(var i = 0; i < computedStyles.length; i++) { propertyName = computedStyles[i]; propertyValue = computedStyles.getPropertyValue(propertyName); result[propertyName] = propertyValue; } return result; } else { var curStyle = element.currentStyle; var computedStyle = { }; for(var i = 0; i < RemoteHelpers.computedPropertiesInIE8.length; i++) { var value = curStyle.getAttribute(RemoteHelpers.computedPropertiesInIE8[i]); if(!value) { continue; } computedStyle[RemoteHelpers.javascriptToCssName(RemoteHelpers.computedPropertiesInIE8[i])] = value; } computedStyle["getPropertyValue"] = function (name) { return _this[name]; }; return computedStyle; } }; RemoteHelpers.getPageOffset = function getPageOffset(doc) { var view = RemoteHelpers.getDefaultView(doc); if(RemoteHelpers.getDocumentMode() >= 9) { return { x: view.pageXOffset, y: view.pageYOffset }; } else { return { x: view.document.body.scrollLeft, y: view.document.body.scrollTop }; } }; RemoteHelpers.getRuleForStyleObject = function getRuleForStyleObject(style, element) { return RemoteHelpers.searchStyleSheetForStyleObject(element.ownerDocument.styleSheets, style); }; RemoteHelpers.getDocumentMode = function getDocumentMode() { var documentMode = browser.documentMode; if(browser.documentMode === 0) { try { documentMode = browser.defaultDocumentMode; } catch (ex) { documentMode = 80000; } } return documentMode / 10000.0; }; RemoteHelpers.searchStyleSheetForStyleObject = function searchStyleSheetForStyleObject(sheets, style) { for(var i = 0; i < sheets.length; i++) { var sheet = sheets[i]; try { var rules = sheet.rules; var rule; if(rules) { for(var j = 0; j < rules.length; j++) { rule = rules[j]; if(rule.style === style) { return rule; } } } if(sheet.imports && sheet.imports.length) { rule = RemoteHelpers.searchStyleSheetForStyleObject(sheet.imports, style); if(rule) { return rule; } } } catch (ex) { Common.RemoteHelpers.encounteredException(ex); } } }; RemoteHelpers.getIsLeftMouseButton = function getIsLeftMouseButton(button) { if(RemoteHelpers.getDocumentMode() >= 9) { return button === 0; } else { return button === 1; } }; RemoteHelpers.eventHandled = function eventHandled(event) { if(RemoteHelpers.getDocumentMode() >= 9) { event.stopPropagation(); event.preventDefault(); return false; } else { event.cancelBubble = true; return false; } }; RemoteHelpers.javascriptToCssName = function javascriptToCssName(javascriptName) { if(javascriptName === "styleFloat") { return "float"; } var cssName = javascriptName.replace(/[A-Z]/g, function (match) { return "-" + match.substring(0).toLowerCase(); }); if(cssName.indexOf("ms-") === 0) { cssName = "-ms-" + cssName.substr(3); } return cssName; }; RemoteHelpers.getTextContent = function getTextContent(ele) { if(RemoteHelpers.getDocumentMode() >= 9) { return ele.textContent; } else if((ele).innerText) { return (ele).innerText; } else if(typeof (ele).data === 'string') { return (ele).data; } }; RemoteHelpers.getDocumentTypeNodeText = function getDocumentTypeNodeText(documentType) { var result = ""; if(documentType.nodeType !== documentType.DOCUMENT_TYPE_NODE) { return result; } result = ""; return result; }; RemoteHelpers.htmlEscapeRemote = function htmlEscapeRemote(htmlString) { if((typeof htmlString) !== "string") { if(htmlString === null || htmlString === undefined) { return ""; } htmlString = "" + htmlString; } htmlString = String.prototype.replace.call(htmlString, /&/g, "&"); htmlString = String.prototype.replace.call(htmlString, />/g, ">"); htmlString = String.prototype.replace.call(htmlString, / 0) { var messageString = ""; try { messageString = JSON.stringify(remoteHelpers.pendingMessages); } catch (e) { errorHandler.onErrorHandler(e.toString(), "remoteHelpers.js", undefined); } remoteHelpers.pendingMessages = []; remoteHelpers.pendingMessagesMap = { }; remoteHelpers.pendingTimeout = false; if(messageString.length > 0) { try { remoteHelpers.port.postMessage(messageString); } catch (e) { } } } }; RemoteHelpers.prototype.createSafeFunction = function (win, func) { if(RemoteHelpers.getDocumentMode() < 9) { return browser.createSafeFunction(win, func); } if(!win.__BROWSERTOOLS_CONSOLE_SAFEFUNC) { var browserToolsWrapper = function (fn) { var returnFn = function () { return fn(arguments); }; return returnFn; }; var scriptForWrapper = "window.__BROWSERTOOLS_CONSOLE_SAFEFUNC = " + browserToolsWrapper.toString(); scriptForWrapper = JSON.stringify(scriptForWrapper).slice(1, -1); browser.executeScript(scriptForWrapper, win); } return win.__BROWSERTOOLS_CONSOLE_SAFEFUNC(browser.createSafeFunction(win, function (a) { return func.apply(win, a); })); }; RemoteHelpers.prototype.getAppliedStyles = function (element) { var ret = []; styles.calculateTracedStyles(); var tracedStyles = styles.getTracedStyles(element); var inheritanceChain = tracedStyles.getInheritanceChain(); for(var i = 0; i < inheritanceChain.length; i++) { var traceElement = inheritanceChain[i]; var rule = { element: traceElement, inlineStyles: traceElement.style, appliedRules: [] }; var appliedStyles = styles.getTracedStyles(traceElement).getAppliedStyles(); for(var j = 0; j < appliedStyles.length; j++) { var style = appliedStyles[j]; var appliedRule; if(style.parentRule) { appliedRule = { parentRule: style.parentRule.parentRule, selectorText: (style.parentRule).selectorText, parentStyleSheet: style.parentRule.parentStyleSheet, style: style }; } else { appliedRule = { parentRule: undefined, selectorText: undefined, parentStyleSheet: undefined, style: style }; } rule.appliedRules.push(appliedRule); } ret.push(rule); } return ret; }; return RemoteHelpers; })(); Common.RemoteHelpers = RemoteHelpers; var HtmlTreeHelpers = (function () { function HtmlTreeHelpers() { this.maxInlineLength = 70; this.mapping = { }; } HtmlTreeHelpers.DOCUMENT_NODE = 9; HtmlTreeHelpers.DOCUMENT_FRAGMENT_NODE = 11; HtmlTreeHelpers.prototype.reset = function () { for(var uid in htmlTreeHelpers.mapping) { htmlTreeHelpers.deleteMappedNode(uid); } htmlTreeHelpers.mapping = { }; }; HtmlTreeHelpers.getAssignedUid = function getAssignedUid(element) { if(!element) { return undefined; } var uidString = element['uniqueID']; if(uidString) { return uidString; } uidString = element['bpt-uid']; if(uidString) { return uidString; } if(RemoteHelpers.getDocumentMode() < 9) { for(var uid in htmlTreeHelpers.mapping) { var m = htmlTreeHelpers.mapping[uid]; if(m.ele === element) { return uid; } } } uidString = remoteHelpers.getUid(); if(RemoteHelpers.getDocumentMode() >= 9) { Object.defineProperty(element, "bpt-uid", { value: uidString, enumerable: false }); } return uidString; }; HtmlTreeHelpers.prototype.isEmptyTextElement = function (element, textContent) { return !element.tagName && (typeof textContent === "string") && !/\S/.test(textContent); }; HtmlTreeHelpers.prototype.createMappedNode = function (element, showEmptyTextElements, dontAddToMap) { var textContent = Common.RemoteHelpers.getTextContent(element); if(this.isEmptyTextElement(element, textContent) && !showEmptyTextElements) { return null; } var uidString = HtmlTreeHelpers.getAssignedUid(element); var entry = { uid: uidString }; var isIframeElement; if(element.nodeType === HtmlTreeHelpers.DOCUMENT_NODE || element.nodeType === HtmlTreeHelpers.DOCUMENT_FRAGMENT_NODE) { entry.tag = "#document"; entry.hasChildren = true; entry.text = null; entry.rootTag = element.nodeName; } else { if(element.tagName) { var textContent = null; var tagName = element.tagName.toLowerCase(); var hasChildren = (element.childNodes.length > 0); if(element.nodeName === "STYLE") { hasChildren = true; var text = (element.styleSheet ? element.styleSheet.cssText : Common.RemoteHelpers.getTextContent(element)); if(!(text && text.trim())) { hasChildren = false; } else if(!String.prototype.match.call(text, /\n/g) && text.length < htmlTreeHelpers.maxInlineLength) { hasChildren = false; textContent = text; } } else if(element.nodeName === "SCRIPT" && RemoteHelpers.getDocumentMode() < 9) { hasChildren = true; } else if(element.tagName === "!" && element.nodeName === "#comment" && RemoteHelpers.getDocumentMode() < 9) { tagName = element.nodeName; textContent = Common.RemoteHelpers.getTextContent(element); } else if(element.tagName === "COMMENT" && RemoteHelpers.getDocumentMode() < 9) { textContent = Common.RemoteHelpers.getTextContent(element); } else if(element.childNodes.length === 1) { var child = element.childNodes[0]; var childTextContent = Common.RemoteHelpers.getTextContent(child); if(!child.tagName && childTextContent) { if(!(childTextContent && childTextContent.trim())) { hasChildren = false; } else if(!String.prototype.match.call(childTextContent, /\n/g) && childTextContent.length < htmlTreeHelpers.maxInlineLength) { hasChildren = false; textContent = childTextContent; } } } if(element.tagName === "IFRAME" || element.tagName === "FRAME") { isIframeElement = true; hasChildren = true; } var attributes = []; if(element.attributes) { for(var i = 0; i < element.attributes.length; i++) { var attribute = element.attributes[i]; if(attribute) { attributes.push({ name: attribute.name, value: attribute.value }); } } } entry.tag = tagName; entry.hasChildren = hasChildren; entry.text = textContent; entry.attributes = attributes; } else if(element.nodeType) { var tagName = null; var elementText = Common.RemoteHelpers.getTextContent(element); if(element.nodeType === element.DOCUMENT_TYPE_NODE) { tagName = "#doctype"; elementText = Common.RemoteHelpers.getDocumentTypeNodeText(element); } else if(element.nodeType === element.COMMENT_NODE) { tagName = "#comment"; } else if(element.nodeType === element.TEXT_NODE) { var nonEmptyText = elementText.trim(); var localizeId; if(nonEmptyText.length === 0) { localizeId = elementText = "EmptyTextNode"; } else { elementText = nonEmptyText; } } entry.tag = tagName; entry.localizeId = localizeId; entry.hasChildren = false; entry.text = elementText; entry.parentUid = HtmlTreeHelpers.getAssignedUid(element.parentNode); } else { entry.tag = null; entry.text = null; entry.hasChildren = (element.length && element.length > 0); entry.parentUid = HtmlTreeHelpers.getAssignedUid(element.parentNode); } } if(!dontAddToMap) { htmlTreeHelpers.mapping[uidString] = { ele: element, isIframeElement: isIframeElement, mapped: entry }; if(htmlTreeHelpers.hasSpecialValueAttribute(element)) { htmlTreeHelpers.mapping[uidString].hasValueAttribute = element.hasAttribute("value"); } } return entry; }; HtmlTreeHelpers.prototype.getChildrenForMappedNode = function (uid, showEmptyTextElements, showAll) { var mappedNode = htmlTreeHelpers.mapping[uid]; if(!mappedNode || !htmlTreeHelpers.isElementAccessible(mappedNode.ele)) { return; } if(mappedNode.ele.nodeName === "STYLE") { return [ { uid: "style" + uid, parentUid: uid, tag: null, hasChildren: false, text: (mappedNode.ele.styleSheet ? mappedNode.ele.styleSheet.cssText : Common.RemoteHelpers.getTextContent(mappedNode.ele)) } ]; } else if(mappedNode.ele.nodeName === "SCRIPT") { return [ { uid: "script" + uid, parentUid: uid, tag: null, hasChildren: false, text: mappedNode.ele.innerHTML } ]; } var element = (mappedNode.isIframeElement ? htmlTreeHelpers.getIframeRootForMappedNode(uid) : mappedNode.ele); var childNodes = (mappedNode.listType ? element : element.childNodes); var newlyMappedChildren = []; var uidToNewChildMap = { }; for(var i = 0; i < childNodes.length && (showAll || newlyMappedChildren.length < remoteHelpers.childrenElementLimit); i++) { var mappedChild = htmlTreeHelpers.createMappedNode(childNodes[i], showEmptyTextElements); if(mappedChild) { newlyMappedChildren.push(mappedChild); uidToNewChildMap[mappedChild.uid] = mappedChild; } } mappedNode.isLimited = (childNodes.length > remoteHelpers.childrenElementLimit); if(mappedNode.childrenNodes) { for(var j = 0; j < mappedNode.childrenNodes.length; j++) { var uid = mappedNode.childrenNodes[j].uid; if(!uidToNewChildMap[uid]) { htmlTreeHelpers.deleteMappedNode(uid); } } } mappedNode.childrenNodes = newlyMappedChildren; mappedNode.isExpanded = true; return newlyMappedChildren; }; HtmlTreeHelpers.prototype.deleteMappedNode = function (uid, onlyChildren) { var mappedNode = htmlTreeHelpers.mapping[uid]; if(mappedNode) { if(mappedNode.childrenNodes) { for(var i = 0; i < mappedNode.childrenNodes.length; i++) { htmlTreeHelpers.deleteMappedNode(mappedNode.childrenNodes[i].uid, false); } mappedNode.childrenNodes = null; } if(!onlyChildren) { try { if(mappedNode.onValueModified) { Common.RemoteHelpers.removeListener(mappedNode.ele, "propertychange", mappedNode.onValueModified); } } catch (ex) { } delete htmlTreeHelpers.mapping[uid]; } else { mappedNode.isExpanded = false; } } }; HtmlTreeHelpers.prototype.getIframeRootForMappedNode = function (uid) { var mappedNode = htmlTreeHelpers.mapping[uid]; if(!mappedNode || !htmlTreeHelpers.isElementAccessible(mappedNode.ele)) { return null; } if(mappedNode.iframeRoot) { return mappedNode.iframeRoot; } if(mappedNode.ele.tagName === "IFRAME" || mappedNode.ele.tagName === "FRAME") { var element = mappedNode.ele; var currentWindow = element.parentNode.ownerDocument.parentWindow; var iframe = dom.getCrossSiteWindow(currentWindow, element.contentWindow); mappedNode.iframeRoot = iframe.document; return mappedNode.iframeRoot; } return null; }; HtmlTreeHelpers.prototype.hasSpecialValueAttribute = function (element) { switch(element.nodeName) { case "INPUT": case "FORM": case "SELECT": case "OPTION": case "TEXTAREA": return true; } return false; }; HtmlTreeHelpers.prototype.isElementAccessible = function (element) { var elementType = null; var elementName = null; try { elementName = element.nodeName; elementType = (typeof element); } catch (ex) { return false; } return (elementType === "object"); }; HtmlTreeHelpers.prototype.createStringForElement = function (element) { if((!element.tagName && element.parentNode && element.parentNode.tagName === "STYLE")) { return element.parentNode.styleSheet ? element.parentNode.styleSheet.cssText : element.parentNode.textContent; } else { var mappedNode = htmlTreeHelpers.createMappedNode(element, false, true); if(mappedNode) { if(mappedNode.tag === "#comment") { return mappedNode.text ? "" : null; } else if(mappedNode.tag === "#document" || mappedNode.tag === "#doctype" || mappedNode.tag === "#script") { return mappedNode.text || null; } else { var stringifiedNode = "<" + mappedNode.tag; if(mappedNode.attributes) { for(var index = 0; index < mappedNode.attributes.length; index++) { var attr = mappedNode.attributes[index]; stringifiedNode = stringifiedNode + " " + attr["name"] + "=\"" + attr["value"] + "\""; } } stringifiedNode = stringifiedNode + ">"; if(mappedNode.text) { stringifiedNode = stringifiedNode + mappedNode.text; } stringifiedNode = stringifiedNode + ""; return stringifiedNode; } } } return null; }; return HtmlTreeHelpers; })(); Common.HtmlTreeHelpers = HtmlTreeHelpers; var ErrorHandlers = (function () { function ErrorHandlers() { } ErrorHandlers.prototype.initializeListeners = function () { Common.RemoteHelpers.addListener(toolUI, "scripterror", errorHandler.onErrorHandler); Common.RemoteHelpers.addListener(toolUI, "detach", function remoteHelpers$toolUI$detachHandler() { Common.RemoteHelpers.removeListener(toolUI, "scripterror", errorHandler.onErrorHandler); }); if(mainBrowser && mainBrowser.document && mainBrowser.document.parentWindow) { remoteHelpers.initializeScriptEngines(mainBrowser.document.parentWindow); } }; ErrorHandlers.prototype.onErrorHandler = function (message, file, line) { if(remoteHelpers && remoteHelpers.port) { var maxStackSize = 10; var getArgumentString = function (argument) { var type = (typeof argument); if(argument === undefined) { type = "undefined"; } else { if(type === "object") { if(argument) { if(typeof argument.length === "number" && typeof argument.propertyIsEnumerable === "function" && !(argument.propertyIsEnumerable("length")) && typeof argument.splice === "function") { type = "array"; } try { if(argument.constructor === Array) { type = "array"; } else if(argument.constructor === Date) { type = "date"; } else if(argument.constructor === RegExp) { type = "regex"; } } catch (e) { } } else { type = "null"; } type = "object"; } } switch(type) { case "boolean": return argument; case "date": return "[date] " + argument; case "function": return "" + argument; case "null": return "null"; case "number": return argument; case "regex": return "[regex] " + argument; case "string": return "\"" + argument + "\""; case "undefined": return "undefined"; case "htmlElement": case "array": case "object": return JSON.stringify(argument); } }; var callstack = []; try { var currentFunction = arguments.callee; var functionText, functionName, match, args, stringifiedArgs; while(currentFunction && callstack.length < maxStackSize) { functionName = "unknown"; stringifiedArgs = []; try { functionText = currentFunction.toString() || ""; match = String.prototype.match.call(functionText, /function\s*([\w$]+)?\s*\(/i); functionName = (match.length >= 2 ? match[1] || "anonymous" : "anonymous"); if(currentFunction["arguments"]) { args = currentFunction["arguments"]; for(var i = 0; i < args.length; i++) { stringifiedArgs.push(getArgumentString(args[i])); } } } catch (ex) { } callstack.push(functionName + " (" + stringifiedArgs.join(", ") + ")"); currentFunction = currentFunction["caller"]; } } catch (ex2) { } var info = []; try { info.push("Callstack:\r\n" + callstack.join("\r\n")); info.push("BreakFlags: " + toolUI.getBreakFlags()); info.push("TicksSinceLastRefresh: " + toolUI.getTicksSinceLastRefresh()); info.push("IsEvalModified: " + remoteHelpers.isEvalModified); info.push("IsExecScriptModified: " + remoteHelpers.isExecScriptModified); info.push("Url: " + mainBrowser.document.parentWindow.location.href); } catch (ex3) { } var errorObject = [ { uid: "scriptError", args: [ { message: message, file: file, line: line, additionalInfo: info.join("\r\n\r\n") } ] } ]; var messageString = JSON.stringify(errorObject); try { remoteHelpers.port.postMessage(messageString); } catch (e) { return; } return true; } return false; }; return ErrorHandlers; })(); Common.ErrorHandlers = ErrorHandlers; var PropertyEvaluationIgnoreList = (function () { function PropertyEvaluationIgnoreList() { } PropertyEvaluationIgnoreList._objectWatchList = [ "[object Window]" ]; PropertyEvaluationIgnoreList._propertyIgnorelist = [ [ "indexedDB", "msIndexedDB" ] ]; PropertyEvaluationIgnoreList.propertyEvaluationFunction = function propertyEvaluationFunction(windowContext, parentObject) { var listIndex = PropertyEvaluationIgnoreList._objectWatchList.lastIndexOf(Object.prototype.toString.call(parentObject)); var ignoreList = PropertyEvaluationIgnoreList._propertyIgnorelist[listIndex]; if(windowContext.location.protocol.indexOf("file") < 0 || !ignoreList) { return function (obj, propertyName) { return obj[propertyName]; }; } else { return function (obj, propertyName) { if(ignoreList.lastIndexOf(propertyName) >= 0) { return; } else { return obj[propertyName]; } }; } }; return PropertyEvaluationIgnoreList; })(); Common.PropertyEvaluationIgnoreList = PropertyEvaluationIgnoreList; })(Common || (Common = {})); //@ sourceMappingURL=remoteHelpers.js.map  .BPT-Toolbar { width: 100%; color: TRANSPARENT; /*[{plugin-color}]*/ background-color: TRANSPARENT; /*[{f12-toolbar-background-color}]*/ border-bottom: 1px solid TRANSPARENT; /*[1px solid {plugin-treeview-content-inactive-selected-background-color}]*/ display: -ms-grid; min-height: 29px; padding-top: 1px; padding-bottom: 2px; -ms-grid-rows: auto; -ms-grid-columns: 1fr auto; cursor: default; } .BPT-Toolbar > .BPT-ToolbarContents { -ms-grid-column: 1; margin-top: 1px; padding-left: 14px; } .BPT-Toolbar > .BPT-ToolbarContents > .buttons { display: inline-block; margin-right: 10px; white-space: nowrap; } .BPT-Toolbar > .BPT-ToolbarContents > .BPT-ToolTitle { font-family: "Segoe UI", Arial, sans-serif; /*[{plugin-font-family} , Arial, sans-serif]*/ font-size: 20px; font-weight: 200; padding-right: 42px; line-height: 29px; } .BPT-Toolbar > .BPT-ToolbarContents > .shellButtonSpacer { display: inline-block; float: right; height: 29px; width: 0; /* 0 is replaced during 'hostinfochanged' events */ } /* Hide the tool title in VS but not in F12 */ .BPT-ToolTitle { display: none; } html.hostedF12 .BPT-ToolTitle { display: inline-block; white-space: nowrap; } .iconShell_18x18 { background-color: transparent; border: 1px solid transparent; height: 18px; width: 18px; margin-left: 8px; } .iconShell_24x24 { background-color: transparent; border: 1px solid transparent; height: 24px; width: 24px; } .iconShell_33x24 { background-color: transparent; border: 1px solid transparent; height: 24px; width: 33px; } .icon_14x14 { background-position: 0px 0px; background-repeat: no-repeat; background-size: 16px 48px; height: 16px; width: 16px; } .icon_16x16 { background-position: 0px 0px; background-repeat: no-repeat; background-size: 18px 54px; height: 18px; margin: 3px 0px 0px 3px; width: 18px; } .icon_25x16 { background-position: 0px 0px; background-repeat: no-repeat; background-size: 27px 90px; height: 18px; margin: 3px 0px 0px 3px; width: 27px; } html, body { height: 100%; margin: 0px; -ms-high-contrast-adjust: none; } *:focus { outline: none; } body.showFocus *:focus { outline: invert dotted thin; } body { font-family: "Segoe UI", Arial, sans-serif; /*[{plugin-font-family} , Arial, sans-serif]*/ font-size: 9pt; /*[{plugin-font-size}]*/ font-weight: normal; /*[{plugin-font-weight}]*/ color: TRANSPARENT; /*[{plugin-color}]*/ } #mainContainer { width: 100%; height: 100%; } .ScrollContainer { overflow: auto; } .BPT-ToolbarSeparator { color: TRANSPARENT; /*[{plugin-contextmenu-separator-color}]*/ display: inline-block; vertical-align: middle; border-right: 1px solid TRANSPARENT; /*[1px solid {plugin-contextmenu-separator-color}]*/ margin-right: 2.166em; } .BPT-ToolbarSeparator div { float: left; } .BPT-ToolbarSpace { display: inline-block; margin-right: 1em; cursor: default; } .BPT-ToolbarToggleSeparator { margin: 0 3px 0 0; } .BPT-ToolbarButton, .Toolbar-ControlsButton { display: inline-block; border: 1px solid transparent; vertical-align: top; padding: 2px; margin-top: 2px; cursor: default; } .BPT-ToolbarButton .buttonText, .Toolbar-ControlsButton .buttonText { display: inline-block; float: right; min-width: 8px; margin: 0px 5px 0px 5px; text-align: right; cursor: default; } .BPT-ToolbarButton .buttonIcon, .Toolbar-ControlsButton .buttonIcon { background-color: transparent; display: inline-block; width: 18px; height: 18px; vertical-align: middle; background-repeat: no-repeat; } .BPT-ToolbarButton:hover .buttonIcon, .Toolbar-ControlsButton:hover .buttonIcon { background-position-y: -18px; } .BPT-ToolbarButton img, .Toolbar-ControlsButton img { margin: 2px 4px 0 -2px; vertical-align: middle; } .BPT-ToolbarButton-StateHidden { display: none; } .BPT-ToolbarButton-StateDisabled, .Toolbar-ControlsButton[disabled] { background-color: transparent; border: 1px solid transparent; color: TRANSPARENT; /*[{plugin-inactive-color}]*/ } .BPT-ToolbarToggleButton-StateOn img, .ToolbarControlsToggleButton[selected=true] img, .BPT-ToolbarToggleButton-StateOn .buttonIcon, .ToolbarControlsToggleButton[selected=true] .buttonIcon { background-position-y: -18px; } .BPT-ToolbarButton-StateDisabled img, .Toolbar-ControlsButton[disabled] img, .BPT-ToolbarButton-StateDisabled .buttonIcon, .Toolbar-ControlsButton[disabled] .buttonIcon { background-position-y: -36px; } .BPT-ToolbarToggleButton, .ToolbarControlsToggleButton { color: TRANSPARENT; /*[{plugin-color}]*/ } .Toolbar-ControlsButton.FilterToggleButton:hover { color: TRANSPARENT; /*[{f12-toolbar-button-hover-text-color}]*/ background-color: TRANSPARENT; /*[{f12-toolbar-button-hover-color}] */ } html:not(.hostedF12) .Toolbar-ControlsButton.FilterToggleButton:not([selected=true]):hover { border: 1px solid TRANSPARENT; /*[1px solid {f12-toolbar-button-border-hover-color}]*/ } .BPT-ToolbarButton:not([disabled]):hover, .Toolbar-ControlsButton:not([disabled]):hover { background-color: TRANSPARENT; /*[{f12-toolbar-button-hover-color}] */ background-position-y: -18px; } html:not(.hostedF12) .BPT-ToolbarButton:not([disabled]):not(.BPT-ToolbarToggleButton-StateOn):hover, html:not(.hostedF12) .Toolbar-ControlsButton:not([disabled]):not([selected=true]):hover { border: 1px solid TRANSPARENT; /*[1px solid {f12-toolbar-button-border-hover-color}]*/ } .BPT-ToolbarToggleButton-StateOn, .ToolbarControlsToggleButton[selected=true] { color: TRANSPARENT; /*[{f12-toolbar-button-selected-text-color}]*/ background-color: TRANSPARENT; /*[{f12-toolbar-button-selected-color}]*/ border: 1px solid TRANSPARENT; /*[1px solid {f12-toolbar-button-selected-border-color}]*/ } .ToolbarControlsToggleButton.FilterToggleButton[selected=false] .buttonIcon { background-position-y: 0px; } .ToolbarControlsToggleButton.FilterToggleButton[selected=true] .buttonIcon { background-position-y: -18px; } .ToolbarControlsToggleButton.FilterToggleButton:hover[selected=false] .buttonIcon { background-position-y: -18px; } .BPT-ToolbarButton-MouseDown:not([disabled]) { background-color: TRANSPARENT !important; /*[{f12-toolbar-button-pressed-color} !important]*/ } .BPT-FileLink, .BPT-HelpLink { border: 1px solid transparent; color: TRANSPARENT; /*[{plugin-link-color}]*/ /*EnvironmentColors.CommandBarMenuLinkTextColorKey*/ cursor: pointer; } .BPT-FileLink:hover, .BPT-HelpLink:hover { color: TRANSPARENT; /*[{plugin-link-hover-color}]*/ /*EnvironmentColors.CommandBarMenuLinkTextHoverColorKey*/ text-decoration: underline; } .BPT-ContextMenu { background-color: TRANSPARENT; /*[{plugin-contextmenu-background-color}]*/ color: TRANSPARENT; /*[{plugin-contextmenu-color}]*/ position: fixed; border: solid; border-width: 1px; border-color: TRANSPARENT; /*[{plugin-contextmenu-border-color}]*/ box-sizing: border-box; z-index: 1000; } .BPT-ContextMenuItem { background-color: TRANSPARENT; /*[{plugin-contextmenu-background-color}]*/ padding-left: 6px; padding-right: 6px; padding-top: 3px; padding-bottom: 3px; } .BPT-ContextMenuItem:hover { background-color: TRANSPARENT; /*[{plugin-contextmenu-hover-color}]*/ } .BPT-ContextMenuItemDisabled { color: TRANSPARENT; /*[{plugin-inactive-color}]*/ } var Common; (function (Common) { (function (TraceEvents) { TraceEvents._map = []; TraceEvents.Debugger_StepOver_Start = 0x12d; TraceEvents.Debugger_StepInto_Start = 0x12e; TraceEvents.Debugger_StepOut_Start = 0x12f; TraceEvents.Debugger_OnBreak_Start = 0x130; TraceEvents.Debugger_OnBreak_Stop = 0x131; TraceEvents.Debugger_PrettyPrint_Start = 0x132; TraceEvents.Debugger_PrettyPrint_Stop = 0x133; TraceEvents.Debugger_OpenDocument_Start = 0x134; TraceEvents.Debugger_OpenDocument_Stop = 0x135; TraceEvents.Debugger_CloseDocument_Start = 0x136; TraceEvents.Debugger_CloseDocument_Stop = 0x137; TraceEvents.Debugger_SwitchDocument_Start = 0x138; TraceEvents.Debugger_SwitchDocument_Stop = 0x139; TraceEvents.Debugger_RevealRange_Start = 0x13a; TraceEvents.Debugger_RevealRange_Stop = 0x13b; TraceEvents.Debugger_CallstackController_GoTo_Start = 0x13c; TraceEvents.Debugger_CallstackController_GoTo_Stop = 0x13d; TraceEvents.Debugger_BreakpointController_SetAllEnabledStates_Start = 0x13e; TraceEvents.Debugger_BreakpointController_SetAllEnabledStates_Stop = 0x13f; TraceEvents.Debugger_EditorWindow_NavigateTo_Start = 0x140; TraceEvents.Debugger_EditorWindow_NavigateTo_Stop = 0x141; TraceEvents.Debugger_Editor_SetModel_Start = 0x142; TraceEvents.Debugger_Editor_SetModel_Stop = 0x143; TraceEvents.Debugger_Editor_CreateModel_Start = 0x144; TraceEvents.Debugger_Editor_CreateModel_Stop = 0x145; TraceEvents.Debugger_Editor_Create_Start = 0x146; TraceEvents.Debugger_Editor_Create_Stop = 0x147; TraceEvents.Debugger_Editor_Layout_Start = 0x148; TraceEvents.Debugger_Editor_Layout_Stop = 0x149; TraceEvents.Debugger_Editor_ChangeViewZones_Start = 0x14a; TraceEvents.Debugger_Editor_ChangeViewZones_Stop = 0x14b; TraceEvents.Debugger_Editor_RevealPosition_Start = 0x14c; TraceEvents.Debugger_Editor_RevealPosition_Stop = 0x14d; TraceEvents.Debugger_Editor_SaveViewState_Start = 0x14e; TraceEvents.Debugger_Editor_SaveViewState_Stop = 0x14f; TraceEvents.Debugger_Editor_RestoreViewState_Start = 0x150; TraceEvents.Debugger_Editor_RestoreViewState_Stop = 0x151; TraceEvents.Debugger_EditorWindow_CreateDataTipFromPosition_Start = 0x152; TraceEvents.Debugger_EditorWindow_CreateDataTipFromPosition_Stop = 0x153; TraceEvents.Debugger_BreakpointController_SetEnabledState_Start = 0x154; TraceEvents.Debugger_BreakpointController_SetEnabledState_Stop = 0x155; TraceEvents.Debugger_BreakpointController_BreakpointChanged_Start = 0x156; TraceEvents.Debugger_BreakpointController_BreakpointChanged_Stop = 0x157; TraceEvents.Debugger_BreakpointWindow_BreakpointChanged_Start = 0x158; TraceEvents.Debugger_BreakpointWindow_BreakpointChanged_Stop = 0x159; TraceEvents.Debugger_WatchWindowView_RefreshView_Start = 0x15a; TraceEvents.Debugger_WatchWindowView_RefreshView_Stop = 0x15b; TraceEvents.Console_Window_Create_Start = 0x191; TraceEvents.Console_Window_Create_Stop = 0x192; TraceEvents.Console_Attach_Start = 0x193; TraceEvents.Console_Attach_Stop = 0x194; TraceEvents.Console_Message_Start = 0x195; TraceEvents.Console_Message_Stop = 0x196; TraceEvents.Console_Input_Start = 0x197; TraceEvents.Console_Input_Stop = 0x198; TraceEvents.Console_Output_Start = 0x199; TraceEvents.Console_Output_Stop = 0x19a; TraceEvents.Console_Output_Render_Start = 0x19b; TraceEvents.Console_Output_Render_Stop = 0x19c; TraceEvents.Console_Item_Toggle_Start = 0x19d; TraceEvents.Console_Item_Toggle_Stop = 0x19e; TraceEvents.Console_HtmlLines_Expand_Start = 0x19f; TraceEvents.Console_HtmlLines_Expand_Stop = 0x1a0; TraceEvents.Console_Context_Menu_Loading_Start = 0x1a1; TraceEvents.Console_Context_Menu_Loading_Stop = 0x1a2; TraceEvents.Console_Scroll_Start = 0x1a3; TraceEvents.Console_Scroll_Stop = 0x1a4; TraceEvents.Console_Intellisense_ListBox_Build_Start = 0x1a5; TraceEvents.Console_Intellisense_ListBox_Build_Stop = 0x1a6; TraceEvents.Console_Intellisense_ListBox_Reset_Start = 0x1a7; TraceEvents.Console_Intellisense_ListBox_Reset_Stop = 0x1a8; TraceEvents.Console_Intellisense_Menu_Filter_Start = 0x1a9; TraceEvents.Console_Intellisense_Menu_Filter_Stop = 0x1aa; TraceEvents.Console_Intellisense_Menu_Layout_Start = 0x1ab; TraceEvents.Console_Intellisense_Menu_Layout_Stop = 0x1ac; TraceEvents.Console_Intellisense_Provider_Get_Expression_Start = 0x1ad; TraceEvents.Console_Intellisense_Provider_Get_Expression_Stop = 0x1ae; TraceEvents.Console_Intellisense_Provider_Update_Start = 0x1af; TraceEvents.Console_Intellisense_Provider_Update_Stop = 0x1b0; TraceEvents.Console_Intellisense_Provider_Get_Items_Start = 0x1b1; TraceEvents.Console_Intellisense_Provider_Get_Items_Stop = 0x1b2; TraceEvents.Dom_Window_Create_Start = 0x1f5; TraceEvents.Dom_Window_Create_Stop = 0x1f6; TraceEvents.Dom_ExpandNode_Start = 0x1f7; TraceEvents.Dom_ExpandNode_Stop = 0x1f8; TraceEvents.Dom_UndoRedo_Start = 0x1f9; TraceEvents.Dom_UndoRedo_Stop = 0x1fa; TraceEvents.Dom_DragDrop_Start = 0x1fb; TraceEvents.Dom_DragDrop_Stop = 0x1fc; TraceEvents.Dom_AddAttribute_Start = 0x1fd; TraceEvents.Dom_AddAttribute_Stop = 0x1fe; TraceEvents.Dom_Intellisense_Start = 0x1ff; TraceEvents.Dom_Intellisense_Stop = 0x200; TraceEvents.Dom_SelectElement_Start = 0x201; TraceEvents.Dom_SelectElement_Stop = 0x202; TraceEvents.Emulation_Window_Create_Start = 0x259; TraceEvents.Emulation_Window_Create_Stop = 0x25a; TraceEvents.Generic_Debug_1_Start = 0x2bd; TraceEvents.Generic_Debug_1_Stop = 0x2be; TraceEvents.Generic_Debug_2_Start = 0x2bf; TraceEvents.Generic_Debug_2_Stop = 0x2c0; TraceEvents.Generic_Debug_3_Start = 0x2c1; TraceEvents.Generic_Debug_3_Stop = 0x2c2; TraceEvents.Generic_Debug_4_Start = 0x2c3; TraceEvents.Generic_Debug_4_Stop = 0x2c4; TraceEvents.Generic_Debug_5_Start = 0x2c5; TraceEvents.Generic_Debug_5_Stop = 0x2c6; TraceEvents.Generic_Debug_6_Start = 0x2c7; TraceEvents.Generic_Debug_6_Stop = 0x2c8; TraceEvents.Generic_Debug_7_Start = 0x2c9; TraceEvents.Generic_Debug_7_Stop = 0x2ca; TraceEvents.Generic_Debug_8_Start = 0x2cb; TraceEvents.Generic_Debug_8_Stop = 0x2cc; TraceEvents.Generic_Debug_9_Start = 0x2cd; TraceEvents.Generic_Debug_9_Stop = 0x2ce; })(Common.TraceEvents || (Common.TraceEvents = {})); var TraceEvents = Common.TraceEvents; var DefaultTraceWriter = (function () { function DefaultTraceWriter() { } DefaultTraceWriter.prototype.raiseEvent = function (eventId) { }; DefaultTraceWriter.prototype.raiseEventWithMessage = function (eventId, traceMessage) { }; return DefaultTraceWriter; })(); Common.DefaultTraceWriter = DefaultTraceWriter; var TraceWriter = (function () { function TraceWriter(performanceTracer) { if(!performanceTracer && Plugin && (Plugin).F12) { performanceTracer = (Plugin).F12.Utilities.createExternalObject("PerformanceTraceExtension", "{D76A409F-7234-4B71-9BFD-DEF3DC4CCCA6}"); } this._performanceTracer = performanceTracer; } TraceWriter.prototype.raiseEventWithMessage = function (eventId, traceMessage) { if(this._performanceTracer) { this._performanceTracer.raiseEvent(eventId, traceMessage); } }; TraceWriter.prototype.raiseEvent = function (eventId) { this.raiseEventWithMessage(eventId, ""); }; return TraceWriter; })(); Common.TraceWriter = TraceWriter; })(Common || (Common = {})); //@ sourceMappingURL=trace.js.map PNG  IHDRa pHYs+-tEXtSoftwareCreated by fCoder Graphics Processor_IDATxڍS  Ih xʷɞA8Zx"ޔקi*f .(uu`P}ۇ~&BI?RaTiH@WmQX;HFuUNC-h.J ̳4\:$z=%3)SQv!Am frJ1[m`SnIENDB`PNG  IHDR@ ~gAMA a pHYsktEXtSoftwareAdobe Fireworks CS6輲IDAThCm0^3BC^ :#t#d;t,LϦj-)(P \_ۛS[oַSsy~E_DMݳ<_~sTmGݳ#Q`IR !ug<(,k<1uhײ,_O{ PJ<9KJR3}U=Ȣx*y !<(jKutyf*]{rtJr|&WAoY5_5G[/Gp,pA,=GB@fՃ<!|X= VTz% a!309#Xg !Tb< ] (ɲ;ԍh9rIENDB`PNG  IHDR lΤPLTEgH]tRNS@fIDATx^M! 4B5c?9h= IENDB`PNG  IHDR 0 gAMA a pHYsjA[tEXtSoftwarePaint.NET v3.5.100r2ZIDATx^ Uՙk֬5'I:D ;3vq9tU31 >'OP )QAPEFC,myCx[Qh|w:>{~Z{[uo55A @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @e%pik(kD5jW7`~|5 C^2t>#G\յk!'|1u"bmZwJ& _{^c-E/R#Gl8x`K! qoKl*+BHe=-mOOG#G_V;rePHFEy;hH z*?07nie{?~voW[[.E5A9kN$.{{uAoƟ=D((,L˻./Xl:w6nݺ2_{DM_sBmIYVgY̓cWuYϭٶ✚-+ϭٲuۺܚם_s\V|e[>^~9ih~Z.GD-TJ5V+Uw~*Cs}&|csVO9u-s?y`KQ|IWd⌷d촅_(Xtﵟ{hmyF{Sj']St;l1q__"_g[=A_Nꄑ+Y *4}Y?}t0g2eʮ:khd_QDo_3fL׼ҷo+iYj.'1zzٽu;8h!|Ʀ%s↜ Y,g,;J IpyȞOEvi#DN|(BɰO ,*Ck/n%[+aRgvSn]>0mQS+ebõߢeڔ~w==4۷oӰicc\imy"jĵL9~g1!~˗6?MIs,ޅۜҽbo%q񭯯$).]Y&4n!˖wAJ+}~/~咉c)^rsǻJx"޷ྊXZsux:ylʫ2˳/Tlb&B"Kj߭:(קڏT xD2 z<'B<-^ {x[?7;A`UͫuO=[ZP66%B3x^< . ,EGĦ'?oFo}vPzJ4hЁ;nFgoW޴Wr%5Q:0|DPm +ŭUVᄓnFZ,z (4OLCyiBD^<ېo+5N N['"ѡ#i=!rӢ'lQa u>%< zs"ĆR~=uϵA/b$ODwܥE߁=ʂz^۞ $>@:4s8O=g^\$ $+}JNbO{nhpvV'RaaRlxd:!~:O_'BRxI~cnZ'^d}Q~붜ф'mg "D+e#9ڝY˿!cJ˻Ib7ioϥ-3|yOǜU|Ͽ綖=!ZɿKrx]jN&A>/B`?Yq(X{:/>gL5w%59h}/>֭[C2/?0)6?'B,kz8~|ޯhJ!PqÏ͓G87e^y?tD^Cl/awċ77v1yгunLvqz[KdgpzH(@t"I~[48bjv~sεƍ;sω;vw߽'4o޼/_W?Bn)~P'\#ZW[l}ˡU+eyY7QIFN E 0dj9pH⠞Dao"[<C䲟\xMfxs<$F(*~I4"D~%@^&Qtdf? IPŇ.}_6o)}UOZWC㓧 BRkۈitk|ZrU8q;wXyCQF>J>Dɸ_ n^[ҕ~h b 6N|n' mCCO>CFCm[3?CYˉҎYj|ggqF?g|ԩ2sLydĉ?߿c9fztŸL|1X */E^zAԠk/ۂY:/j-zCtrĞ<=uD;wnݺXGb:y 5$y>{ +uW9.[Dm] ƝщcX1G-olJZքc"wt F f+Ȟ{rj8 m;a> Ȭ~ɯ4χI޾'D"B:9[R4{hH'=/WPmG=xKm"ZI懐SxMU@OSv6Ҡb7~FX;_΃olo?PsGRuv㗏nR%1yM9wb§z=Y1m~W:Fq#F龰mfeQvsP< yeF/T;U6X6OE>ټ,8=tr$@`Y= Ux*DtBEǞ^;H.qD|qdG^YaY4`tʿe=g6O\@LNY93ఓh]WX/Z_j|u+sI>,64zl1=8rnf/SRauD-\:_~9>/Y.-=^(7? yx:_- Of,ZQ&m[Z9]rJSe2׋23ԓ*B^3ˑbڞnJ_Zxel\{˖K{몚#A?ƶg*|W(dY"Duֹoqq^뮓:[_ʥLB & Z~4[ɮ,TΎ\CǷ+ҫ%K zhUwl~ϖN3`e TaX|nds`䅿LWVy˖e㶧/@bvܒْ1'I,X-ɶ=)T9 I 6NLJH ׁs@c6xP&t%m,IOm+wJG qQe!e 0CŇ.p 4z6hZyW8ߍBFؿoha>Ds+ |77'?),O'~0p;R]߇3]Pu@s\yT;vuk;NhZ}WO=MB>cCҴ">T{lx#7A JJO i[3_?Bж%JPƝOZ_1+.|/:~Bj?\zݛY2eƪ LǷi'@L~D/B)r-wVkzBx/$Up6 f6w}8~:벐/[ҫĂ1זL`R]E8Ǝ;oޢk6g[ni:/27XQ'A-0ݞ:+{>bUK[·Ӝ!Z vZ ițc =Z:ωjd7 8<%g߫e~D2vC z^[mj}oLiyyaܝIH+dK(@q]3W$XK:JF'`gA7X\XܓIފ[* &@&*| I|>Kޱ6~u-iYAXhÿԶw>/',?o=#5 meeSN҇t.Zmղo[fU$@yi_ǵ?̓Oϖk{@?Av{(~ ל//'F|"D \y&-ĿxDZ^V-j\YނY;/n ΉnCi?~ Q7ˈ?YozR|oCP\?=&Rl' 1YޜӶRJ% -zAl `lο8EG"}tmO>㟐ٚz~_wfP`~g4i#C 9bkFn6ׯ_,>Kc!AFҗtl)K( ]M zufZ5W(sR۞+߬\g=J!">tVaHCo< rsevC F{mK{?eqZ tχ-e>d8o~y}H ҟz:঵%XNdVg#ߦ)e¨GE{}xe+|5' S&]|a1"D+6<7Djf,4D/1)b?n}xRUiSh fYEHK<&Btɬ]YS;@'^~ӎ]BꀠYw~_R8YiN vHvheeϽɾaߒm/k#^W"k S|\}Yôϭx|k>ՖRW+&MqXde뎦r\8B&}T͗>񓿿GĢCkDj/~T:oM:C Mr?g1IYDk^ -R~:[$SjN|ߚdȈzqSQ}^F=>d]11M|}oNvh0{Q\3 u (싶c^ \uU\|P׮]G|_ \l'_oNӄ\FlF]N[7˒ja.n󭄷湢ؼtYΉƯxYLK;[$*2fyqM6ؒWZ脰hF|XŖ~z56|Ll|v]N;_cͫm5Sj;BOIWD =ڇhbٕrt[h:fm'JޖqN VlI!Q4c r'nV-+e|ڰpf#q"Dͷݍ<ǓG?.@̚tON$%߬|x[XLj@$8m\~p`xQ6Z<:/5Y||yQc4LsFIjN/;f;!O}BwdScXOХUZ=ȻM[Phh3}?X šȕ{s!FyR)sV"D'?m73Ph]eS/:`a2-Ȧhr;O3"a_w~&/YǭSUvYGr)/|_ 8pݾg?\xҧOCc4t @މSf99,͍:Xu&ES:Pv5n\kOHG?qhM#mlzKxM"onY}_-׊̉<^%2syk3hK+o}y3wv :ψN{ ɴS[9K_o7Mxi>sGǯػu$h8)~ANL7;\*}]D]QRu$bhG>fq?PָkdYn(KOXr--ͪoBx=sd曫Ak$@|m (;B=mLnΜ۴m嫤ݥqG pYo.آIJ&L@o}# ]1meRG'>;-Ti_!juiϮoVK ڇQφIaZ1:]!0a#M?4\vwm\U91Va E=~ԨQ;x޽{Kvis|k_;+xo߾ bΝ׿ _T190Wh 0u\'Uha BT|V*6Tܬ_L;&c}'N7~\MPC!?ynU#_icZ}].>PEۯYC[fx%UĮ_юnmiۂ5=2[:eǬ4VI,e|u˷3z~Uֶ`V tssWrׅ6VuQZ< YTlvPV_[qvOVYޯBȷ^۹"~ZKOgYuwU<`]<,Cr[̹jaHy]rCBD]m\2ъIbhw:֬%Oի\~n|b僳knMq;OȾ!dʶ(;\,{~WdÐ_Ɋ_uBX!C+~,i_,y 7;^bއbR|WD>< +`Lw͹+Uh&>o}?:"7fu?FX,Z>Q\dZ$>|#+m3r :,oWO7 ¤0N|dAuPEK[[a ,UOڙ_߃M+.0- }O!>q] oW.@t Ӷ[ć4L[Tj.B ]X_쓜y7n?=4mHd.ZŴ,Qɍϋ>~YXȎrҕuĿrֆ#YB6|5ұ✚w >^v =Qvn,>3|ܷlI6I_uuU:AV[v5ZoSn^ּls_"D'>tżC+הbKժye|Qćj!bQaa?VW'}+o[Ee ;a-/V@JCA:,O=;]_~3?=1kk&VZ!x49묳>nϙg(zօQgFsO2dȡO?}ItQr[X?P\sgCx>a:խrx)y_ 8ⲕ+ei4xVˢU2jmkk⭗U|Q߉6ⴌ̅C~O tkm]sNg-}N $'>T.]rf&`\CoN-5{նLLYHΝ[p"rLrwuPL*{.WʗJυm=+~j?Ew;wqw;G-z"^a=+ eA\KRϕ\}H-u2Ws}bgu]jbφCtc%x[nob.QR/< n޶3b#D.7\QV9g+!sO:{Xצz3,$8L{,m֗u%YyvY~ NFBdЄd R7j9bwG :J[ts9N:$N)* IDATx왍m0qX 0!@G#ttz YQ`NzB·V8&1K6 % .IW`W23$Q)-N\!xUi,@\H,J.{ [?Osv\>I5Ljm7K%߮Hڇ~bkQ9Ojn9 h]Vfy)}pD%t4LHO9|g9|d*)+ Y$&W|O#hHɗ.[ܣ 'g!U6C֜;(T?+`w>l"_7ǻIENDB`PNG  IHDR w}YsBIT|d pHYs  ~tEXtCreation Time06/16/12[tEXtSoftwareAdobe Fireworks CS6輲IDATHŕ͋PÒ.L)FHwC*7Q[ŝ C qP$b4?6,}rn=pDϊeYZ"@V.ZgmGF.\4M#Q!IR1 PT"V6M(8lb1b6$ vV xR (rfÞx̟5?ʅ3>Ѐaeh4fHRp'aw3?&| 1(H&FQba1{'89CdYm6vfn7Z,nx<BM_ _m뺐$ yX1x(p 躎bua'>~=k ??? p8 NtdB ؾ p#o}:0Mƫ96l1|>r 4c /_G`\yzpt ??UplCIENDB`PNG  IHDR w}YsBIT|d pHYs  ~tEXtCreation Time06/16/12[tEXtSoftwareAdobe Fireworks CS6輲eIDATH 0Ct[Or#|#B#B*u,}ifwK~ >i.@4@9/Y2}cIU\e Z!=IENDB`PNG  IHDR w}YsBIT|d pHYs  ~tEXtCreation Time06/16/12[tEXtSoftwareAdobe Fireworks CS6輲AIDATHc?@}uF0dάY{yy۶mp< RIENDB`PNG  IHDR0gAMA a pHYsrItEXtSoftwarePaint.NET v3.5.87;]TIDATx^}^UyYXWYi):fCvFV[jFuRF,C(f4@ <%F$$$$`Aqtggs?Zg=˹:_}kA @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ 0s=B`~߳>{}RWuך+KƩ,λt=\<f{L.]c޽{kEyzzU_Rq8.%zAӓ2຦|~W?_R6ȹΪkl0CYRUy:$3㷦/v"^꺦s֏d*}9" zMMp._Lig}Y%/;4~]aS?xl?6rfBO@%hX9>1њLCӾ^>vl0^,~̖Ǹ>XgK.= |9jc {zYk#$ǚB_pQ^Cb?vN󿓿%ZPa--y|Æ 5=/y<J率(WΩI<{&q^'9N%?D6c+Iԯ>\(|Qr}ʔfAa:kq&֖(VX}y̻꾂rи%^ǞsH+1K>̦$ڏ-gAzz gU-k] JMrvRgOߣʑw,}ǥ\GSE|n8 {-=&a,4(ϝmiYB|wdKHt [oPؾZGy$|ӟclzrPY*ﵺ+q`bW7zScXv/*~kSckLzu5cKd|'.L9CJhM;k_Z^{:{ikC=7}}BJ3AznOL zijkJw`lȞLsf(?;j:꨺`מֆכo߹ܸF9G[&I _p [n wqGX~} &>WݛL%~֋mm_y"v$Uȟy-SZab _Ň\zxxܣ +ŰJ;'O>Mt̟f撴o᠃EºujQ?~ k-;śfO:Jpxb \e}ql.sSKSO5*v,^f.؝aVjIZ*Km,1V,븷8zVVRzEp̓zʖ/+-*m{s3W=[SMsKpy7+c)7Oq5y{mt뮫p-Wy|z}l1|({ߛcxR}zK0n`Usnb@mڒQ4mۀ{4 H\<;KLJꧬ"XϨxmWq}lώ7Ye.U7،Mz^ohVϻ&a+CSj[+7v:Zp}#LPg"E@l"RM=O ԇ)&dX3/=J(ײs O%| at7ǞkO(r &ywz,qPzk2%vXX-.Ǟ-#o@Lhca՞mesĜOV9>zc9og9[P-XMduJ릛nNÅ^2֖J]#*Nk᝿~W?߆6[֙G7C ?#E`-%o h+qWrxxKN._R}Tv,_O56S:dsa%矤q Һ1ukͱ_#4QkW4͓J {gety}AVo1>y~8窤0sWͣV*|@k<-Ƽ*KzMNJt{S<\C_[=r/ܕD !չy[o(@)X'Rˈ@ \[eD_=d _<^&/rXu|~T[2o'+k= 0Jzk yHKDt^(oFCr `5[d.?{A j'審f PumD)cӯ`rvO Xt%YY?Wg2oIIۯ%VziזRD+;< uİ'I(niRܵڟ_>iYk^^TvMYS38?1^~CNt^=9'K ^K^ʿ{,x8O0 /HĮNa/cf7"XnOΟd%KxJB kV_GJzb9mEv<L`5]Ƿ@鿦LjqD-|ā{qf-bhbY{OqbeyFwU|7ok< ʝ&]7}ڇ+֞z[ichSxx~_\mK9c时o>mYXIS;fT@nq G.CYfQIwK+M$475^-dg2-Ac"-0CM<&>.ӉѵY+[o⤚GtJEOڽkֳZc~6Tᙝ\ 8KgU+n7KnɵVEK^ǣT_,w_ O 8hA>\*} >hϙ0qT~so} z&/&5R+,Ʀ{v?/B:*o9#nd8KZ~JKzHڪ몓=kK\}n|mzDє#>nsvh%įlǾ6+a(C_rlr[K%{;&~e%] O=H?=K_jV"N:q^]"1}+W `Y߮>:Nik$uTul'+ q>|׋ `w G;GJVIxt/esqC7{7Lt sHv+i4ƍZ>Pmʼʺ6м›VGMtAUxP?r9vlVAHyrdRoƐ3ms&|!/z̴͝C3L}*+ 6lO|vy\y*?-窱kswƕΡz?{œoQaſAN^ b_{-++S= y_*5؇Yc[=\"d}>}',LlS[cʕ4ms<۟?恽Ų5KӑˉVrl%,y]Sd^8Vx?%_j圸A{#Q175)WNy'tksT ߾vt `yexb#flN!unGcZ7*c%`I븾y`yP9oO?3W^,Ԟ=awֻ{!~qӖOZuAK܆NΖ`C=;-`|R[x)+.#,ƒ'_%(`(۴sVu=S$to;k|}o;=bhD0m,q0z yy(q.&kxE|<r ~7}t&eƗs%,^H믉<o M<֤ R&iaZ1U{>F?xt&dі&7 kT"ڮgvp$/N?'W^7%h͖8)\t54,٫8OP!Nh㠶H)?+G՞^l `k#>uI{/q1x4ۃ-5K(9%=W2MM1^}-`Ҏʎ'b}X;)g{.vT *%ߚwzP5,yfC] ;oaxhC`O _ _i^[~:;5CG=~w8N~daX#a{#E!.=,pA!7֖@5kK?7JZ9HS=ĹqxVZR_k˓|"8OFu@]C&wW=5 ˪'gx7=oǣ}{{j{G>y|ؼg^Ssb'cEWfw\m5`"&eBX^r46-'ʑ;we)Wv9OP{$}y F'8 ʽ/[k.]/[<c5^f ߇rQ .܃DZ86jދ`s3]o`C{gٔ18/8`jӼMKJXf.,*x{οr1lyP9m{br͙^oذՋ;(ֳtKeSq͜^L}6~/Q 1'5zͻh,!k?^z8ܯ;w38nno`D v:M2rPϹPOY[L) JRB'c!_6/Ubv%0y?b'?]߫8Qѣ7vmV1~oeGcy_]6myn_3;wկy)CqĻz͞*pbvG~?%]u Uį_JqoVmтLP}njs&p6^W|M% %Mz8^94fOwNO/++]xWQO eNHƈkg4ۓglL}J:E|8ڜ//%#z,vEdKqچz>zx|tl Y2һ+_>pm/b8:>7$~l*#ou?\CSs ="pY ԯݣ:k/Ģ9 9`|Ob))⼤RQ)ԯm^O`N{-/^bѺ7mqW=[hk,`eQ}fšuuOIXbH{R\꿞+/6lͬWљ\uDOxPU[ޕfyqpa37j;QC~inį{3gXT1D$x?zVq{5^:Xċ`ʰ(η8Ph3Q4wx+ |KwžMʼuI@*?ܓ6`qV7k4F0èmK:ɍ=9.U64߻۠Tڡ%KPO"ʼnZ0T^I$o ַ`<_ᷮz.Κo]bxݵ/_+繰eU+_F|/z8~S=o霪-&J~~T-~uz| [nwIM2jy@־|(|&<:K4Jfݥ$mqm]푇'wm#>8mbt}'a.{=|> xͼ6Fn]% ` knrt-IOG<.o+~ft?~yZWGeo[UXX~)ձ[__Cbkbq)6Xbv$qEc>3h0Ot}9lKsn-Fhru z|xaˍrK渒,1˯3%&U6* *GA__vɟ }D\X˄g<$.BJRԎI^K?.?s֖p.HtQm l_uT.I!-[̬%z#/Ca]Cն\/ұYc ]/K(8h92Rb{JWZXie7`#U5޹>'%P}rخ*ۯD[@V'm\;|Wv)Dv_}dtRƓqONjsA>ĉfǦ་_ ֳ+;w<3#|&Q+^9AxBf.>2 =(NƖm~ |qUvUƧ1]KTSoDngSmy쳥}8Y~n$d|9b!e/,RkYyۣͱxU[tٷ:ە$ay{HǾ&&v?~=ؿ=&ħ׽%QZ?,VesyTyIX{o;裏֢W_% uoUVڍŻ;W /|͋V(_Q7Y;r%~~ÿ8m]xÊX|w? |~p֏բWw '?0ko›o8E!,=(*S—Y=DUXg~{!| O.m^CO#_C~sgIB2/B;-u< ،m Cx=WvCʵ^.@6H1ڇO͜ݯټ;tE\k&/I}sעXj[XadzX0R:XNۯ2]ZFnz_n\=o^篛8_~{gjc/$ Hͼ6MP_lzεP7{'7L[m]Of6$z%+~=ϩwjٟ^KW~45+akh{]* `IւAµqѹSP'K*c:ߛLīO2\ӟew>$`ˑ؃2)~cf5z", 5c.ĉKm*~o;1}4%]>AD =PشiSغukؾm[زuKؼM}p|'r-uʕ+ X<]Dxut !k_os obK8>w?n7;1,EO.𵧗Kpυ~*|nӇ§wX8n;z7q$p'BS!\gT!|:.K ܣË_<"o ;+'N"58OcmɈjjuDyӓ'7,q/@cxCvQ3Kv=aGxw]^'{{?l߮\ψgʗD4׮]L@3?++;q3Տïx8C/7|z{(wHxW0yT綍syrC{_ƻYH;r[~aA}Ǿ x+f{.S78ؕRA=_<̟e? Ѥ16vڼ;]WR7RHm"Xz]qUf=w͓*))ce(ܛL߱i{)QKCYꓕWe})fk2ܵX*j|ɿUubm>bobtބ{O~W/:zO\}=%snZ5גkPoc=2XOC1_.?ixUyOW*?5ึ4:SϪ~팦̬=֭[W\8’_z܁df:iwi4Z>}uQ .:TNb_+7}#%nhR VMc[IKInJp{3 XY76AV=o66+AO H:le$'`<4SaZR!9q*M\<+|Ȳo},_-q+qӧ/9GmB(ɯ`mϠVDWAqω_4XSvԊAIڒ[v"!XBD .a뫞ⷞO]OngSmkGQKI&R RoŽ*כOfɶMKAo9v>;dqeOHʄd`j|b]ZdD96aV_2pm"XmXcg\1ٶfmj<_Y_Eį$z{5Lbj6*ke]\rzʨ|PPDhp$nS'3ХKbV8aS?t\W6,8[a7W$Rv,mmY?׼e!=~MyWx氶N>#~|&=ٙn%~c@8LP^rJ?)5_ySsͯzi{1{ Ҡ 77ٟok-ůb,Qlě}RrM"4G&|io[ӯXwc~:+?ūL7)*ƻb9_kPMEͬbt{{[6!eW& `\ohcc{Kay{R_٤ch[0]saФ0wmJjDTM4J'/eTWqů*-Hů޹4 Թ Lt7i]s^wiY\7VNH6(^uh7oAOrVmn6h,555U%M籇dW /^R'c';ce-ӤYg*įt @\=C Bx{mB HL|Um7Ns-,4q7 PžO?޵HvBR¨t\ԃaںQ;(ڶS#.1"dƨ\|T6M\ 阷dӲo@ca?IA[C҉~?Nq7݃O6_󑽄D `}ʓöo2N[$v%a{7r-?z'~OW9I?]}q'q9cݯO?V!/fGCÏOyJ_JM+O(xPhmRR< `UGVnĬcYI?7MrT˕&6 wbMLt^&H֤G\wDO-,Py׋i:GN̴n?Xnr}W{Z|鋽_(&{mcm|V_K?ϒ7lR9w/~kȯ3!󍹸j`ٵ"Rz=~r \]W݋OIB*ӧV^Y_}w-rQǫVw>v{PSWb_V{^ R_- Iu݇~cAO姭׎w*GM6DMTyo\ec̦@ y( c.`X6 kkmWoW A fsɖÔQK@,7\xBz?Ɠ&OZrXTwlύЩK.d<q:b/#R@sY63c֔#w r׬d&ŨrfYy** ^"XmX'a8ESX.[?+JLkPsب{R'nܗvnTue}?8lTwOa?/;V1"eغa6mk,{j0AM7lذ_}ꤓNGtAff˽ K=k)~+nns8ʸ=ӹ}_Xscn{-jm\m#9VW{ۙ`vu]T~TN,~Qc,OWq2bd*Wxn7LIf\/=*ݮ9I鶱K8̃?ƴ)fA84߯g[zOx>Am,m> c;X+e33RTNdK֒l펩pҳMxANIeL"~^.?:SѤʐ&_K1#]I%݃\f%,D }OXeSٿRoj۵Np\L}Rmw7"XZ qfųVxA,+e6[G*5g$06Ci*oN _2-+(~eg?xi7m߾"bF%璘䏚w>M (= c̽kEM4IJ]^6P[i"Ryס< m<.\#a_ZrD?[M>OiqG)mvi܎ӸXOZ-F֨k( {om󅼌smj|Lɶ }'`xP7 P<켅G}i10r֭[W_}+_C:m+ / +N ů [Rң^aj fX‹>KvB~ZpbŊx-s}NpvJ}ƛXu~t$0(i^@qAוC֦zOn^ i" r<l.1ӧx`M5*9BkuҶۆ_xܻmd`z逸U=fHO sAN<%+˟bk*&R N8q~uǭY,_E0f a8Y6\Ie~+=b99?suѓc盲RBX-*)v]KOk]❧Ņ&߻Z8߃f!{PӤi;oRvǿDtotG=W[~5I[y<_yQC@7_tc,o队/m"^K#Ѯkň&n|f)}W&|J 1*/JV\{*}!f3eʍٝMy&Q-]GTimӠ2Q=>M;k%qX~2KJˌׅv]Jז+K]>+z oX[ob}$l7!Eo{S¼XkxnymO,2|#2-ќ#ss;Í7:X{x =޹Z~Kx o ]['8< ;?sxQXsZ^ŬY8'g8on4"XWZLZ|Es-iIS_*xSiFv'b%./~g9%nei>ۘtKnاeD]OWbUnkh6)~+13._~{!ⱯbnU1%_ݳO~ZK&]~5nu4}I؞;s6@ "0C+ C-2tK+/tC{J,(:F|_}s @|^9߫²q[~mWW೏!Yl] =EٟwJBO WR{~V}SiWviU9*33FM=/ʾ3Q?^'T(zsAf,.v+ʔ6:ZJ-?^yt?urX1Bs˘o @/OJT+%x%X趵 >vKWvB~_Cb[Z꟎W_Z9~]1[/Z'!7yMsX+ͻζ=x6lOmĮLy\y 0,v@Yɶr佞n$ݾvk} o]JοSK>ښ1h3zSK 7zt#}iz/5c\@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ U@% $IENDB`PNG  IHDR w}YsBIT|d pHYs  ~tEXtCreation Time06/16/12[tEXtSoftwareAdobe Fireworks CS6輲+IDATHOSW-uc"r[ZtC-孡 1PeKde%C"5(FJ~(<9Gzdh1;7\nWK|C;fnMdDBGK#ĆNV0&yZji<Ѡ8xkB5(v-oM#w㹬,$}:-h2qmo'pVF?/]: %c|ڼt 7InPA)rh&`80A<$_.$- =.om[xͻ+Nͩ>Q^]Ow:S9pW{),`ZM+X] qD1,fkͪ xe/wGZM`b,G1yt "vl 1d=̔Y`bO ]A>k66w^`$$gq9ݙ*BƅVngϷLhǩz3I8=7qԍ_W/{Iw$a*~k0 Kh4hr2eh6[z!BVlV=5}~q݋ͪĘ{zbͪ[O0>h U|_M A=i g1 X$y1,(wpׂ ,<\LOg+$rYM"W dJ [WOYFy6[37{ǟEWd:ptM3ԸV_13NUIENDB`PNG  IHDR w}YsRGBgAMA a pHYsodtEXtSoftwarePaint.NET v3.5.100rIDATHKTIH[QmTtSJW+ "4b "FQPq"8u6pPC6*Q Fnl)]{}Gҟ Y@ DcW ~cZJ!~  |kk+꭭-6tt޾WÀ!##Q\VUWWǷv? ?U_]]ٖPXY|qq` {@T=88h+,,8Bab5x{/@TKA---&''igg}'bbbBkZ)11t:EEE *++2LT__ ZR$]^^1 ܘ|>!Efy"EEEd4);;  2UTT|IKKWʗ433;??/,,qLzl̀l&''SffǞglj|Eţ \]A! G|tvvTሽq.WfmP||G|^ZZ4++Vሽw1r 'gF', ZOOO-^XHOO;O ZqbWn ///?0?hsog܏aL$%%SRRL뽽=7: o.ng__:d0ٯ`fUUUbAx Dn׺@ d`o;@ Itvvˀӆzt N 4@Kݠ;|I!wwwoONNx~?+ȶ$Fp=eh-gۯWfd[`;<<s"PZa+07 *1&m!w%5IENDB`PNG  IHDR w}YsRGBgAMA a pHYs  ~IDATHKa ]t9=w҃x9 'iH*w T)4f# UX^J5&@ty@+jZ Q[[*0tr泒=i.w1u4'SgzɼL($@\3O tjjjsܕ3CCCsO}4[P]=Uw&mpM}yNj*P?sf,Ѥ6VM{6)W\V FGG[ڧ)C@]j+_:|i@ܺ}7}^2w,벖y@f*XΕnK Ԟued=Xe-@P~xn:f^Uw ԫ\:@u&ҡ6[d=>BC;Y @@@@@@@@@@@@@@@@@@@@ G &IENDB`PNG  IHDR@ ~gAMA a pHYsktEXtSoftwareAdobe ImageReadyqe<0IDAThC1NA9G #{ @caWrM<ƎBJ0?0};d`?}3:8r N.]5S-ɜm9hMmAk2hYM/?luu=_ǵzӶig Č; ː(~sN~zLѶ?dRƒA'w WshۍcԦ\+<КAmC8sU],Zoڐ: 'jS6bɄ֤ea뗍5hkG]0aI ?fɌ֤pZm!Ё[Z0ϯL@m#> &5! :m/m,'5S8o6&ڦ!~?}5^ ^Ex~ (8?r~,0e R@[rnʃ)hM:AH3? KrY={{ƭ:9^CК35 .6ڶ HdF[2I (aO2-]5S-ɜm9hMmAk2h{ MHcIENDB`.intellisenseListBox { color: TRANSPARENT; /*[{plugin-select-option-color}]*/ background-color: TRANSPARENT; /*[{plugin-select-option-background-color}]*/ padding: 0; margin: 0; max-width: 500px; cursor: default; border: 1px solid TRANSPARENT; /*[1px solid {plugin-textbox-border-color}]*/ font-family: "Consolas", Lucida Console, monospace; /*[{plugin-font-family} , Lucida Console, monospace]*/ font-size: 9pt; /*[{plugin-font-size}]*/ list-style-type: none; overflow-y: auto; overflow-x: hidden; -ms-user-select: none; z-index: 1000; } .intellisenseListBox ::selection{ background-color: transparent; } .intellisenseListBox li { padding-bottom: 1px; padding-left: 2px; padding-right: 2px; padding-top: 1px; -ms-user-select: none; } .intellisenseListBox li:hover{ background-color: TRANSPARENT; /*[{f12-intellisense-hover-background-color}]*/ color: TRANSPARENT; /*[{f12-intellisense-hover-color}]*/ } .intellisenseListBox li[selected=selected] { background-color: TRANSPARENT; /*[{f12-intellisense-checked-background-color}]*/ color: TRANSPARENT; /*[{f12-intellisense-checked-color}]*/ } var Common; (function (Common) { (function (Intellisense) { var IntellisenseRemoteHelpers = (function () { function IntellisenseRemoteHelpers(context) { this._context = context; } IntellisenseRemoteHelpers.jsKeywords = [ "break", "case", "catch", "const", "continue", "debugger", "default", "delete", "do", "else", "finally", "for", "function", "if", "in", "instanceof", "let", "new", "return", "switch", "this", "throw", "try", "var", "void", "while", "with", "typeof", "false", "true", "cd", "dir", "select" ]; IntellisenseRemoteHelpers.prototype.getIntellisenseItemsForExpression = function (expression) { return this.getIntellisenseItemsForExpressionUsingWindowContext(expression, this._context.currentWindowContext); }; IntellisenseRemoteHelpers.prototype.getIntellisenseItemsForExpressionUsingWindowContext = function (expression, windowContext) { var current = this.getObjectContextForExpressionUsingEvaluator(expression, windowContext, IntellisenseRemoteHelpers.evaluateProperty); var includeKeywords = expression.length === 0; return this.getIntellisenseItemsForObjectContext(current, IntellisenseRemoteHelpers.getObjectContextPropertiesNames, includeKeywords); }; IntellisenseRemoteHelpers.evaluateProperty = function evaluateProperty(object, propertyName, currentWindowContext, retrieveProperty) { var getPropertyDescriptor = function (object, propertyName) { if(object) { try { var descriptor = currentWindowContext.Object.getOwnPropertyDescriptor(object, propertyName); if(descriptor) { return descriptor; } else { return getPropertyDescriptor(currentWindowContext.Object.getPrototypeOf(object), propertyName); } } catch (e) { if(e.name === "TypeError") { return { }; } else { return; } } } return object; }; var getValueProperty = function (object, propertyName, descriptor) { if(descriptor) { if(typeof descriptor.value !== "undefined" && descriptor.value !== null) { return descriptor.value; } else if(descriptor.get && /\[native code\]/.test(descriptor.get.toString())) { return retrieveProperty(object, propertyName); } else if(typeof descriptor.get === "undefined") { return retrieveProperty(object, propertyName); } } return undefined; }; return object && getValueProperty(object, propertyName, getPropertyDescriptor(object, propertyName)); }; IntellisenseRemoteHelpers.getObjectContextPropertiesNames = function getObjectContextPropertiesNames(context, isCrossSiteWindow) { var propertyNames = []; if(context.object) { var currentType = typeof context.object; if(currentType === "string") { context.object = new context.windowContext.String(); } else if((context.object).constructor === context.windowContext.Array) { context.object = new context.windowContext.Array(); } else if(currentType !== "object" || currentType !== "function") { context.object = new context.windowContext.Object(context.object); } if(isCrossSiteWindow(context.windowContext, context.object)) { context.object = context.windowContext = dom.getCrossSiteWindow(context.windowContext, context.object); } var currentPropertyNames = context.windowContext.Object.getOwnPropertyNames(context.object); if(currentPropertyNames) { propertyNames = currentPropertyNames; } var prototype = context.windowContext.Object.getPrototypeOf(context.object); while(prototype) { var prototypeProperties = context.windowContext.Object.getOwnPropertyNames(prototype); propertyNames = Array.prototype.concat.call(propertyNames, prototypeProperties); prototype = context.windowContext.Object.getPrototypeOf(prototype); } } return propertyNames; }; IntellisenseRemoteHelpers.prototype.getObjectContextForExpressionUsingEvaluator = function (expression, currentWindowContext, evaluator) { var items = expression.split("."); var current = currentWindowContext; for(var i = 0; i < items.length && items[i].length > 0; ++i) { var retrievePropertyFunc = Common.PropertyEvaluationIgnoreList.propertyEvaluationFunction(currentWindowContext, current); current = evaluator(current, items[i], currentWindowContext, retrievePropertyFunc); if(Common.RemoteHelpers.isCrossSiteWindow(currentWindowContext, current)) { current = currentWindowContext = dom.getCrossSiteWindow(currentWindowContext, current); } } return { object: current, windowContext: currentWindowContext }; }; IntellisenseRemoteHelpers.prototype.getIntellisenseItemsForObjectContext = function (context, propertyNameCallback, includeKeywords) { var propertyNames = propertyNameCallback(context, Common.RemoteHelpers.isCrossSiteWindow); if(includeKeywords) { for(var keyIdx = 0; keyIdx < IntellisenseRemoteHelpers.jsKeywords.length; ++keyIdx) { Array.prototype.push.call(propertyNames, IntellisenseRemoteHelpers.jsKeywords[keyIdx]); } } propertyNames = Array.prototype.sort.call(propertyNames, function (a, b) { var simpleCompare = function (a, b) { if(a < b) { return -1; } else if(a > b) { return 1; } else { return 0; } }; var result = simpleCompare(a.toLowerCase(), b.toLowerCase()); if(result === 0) { return simpleCompare(b, a); } else { return result; } }); for(var i = 0; i < propertyNames.length; ) { if(String.prototype.match.call(propertyNames[i], /^\d/)) { Array.prototype.splice.call(propertyNames, i, 1); } else if(i > 0 && propertyNames[i - 1] === propertyNames[i]) { Array.prototype.splice.call(propertyNames, i, 1); } else { i++; } } var choices = []; for(var i = 0; i < propertyNames.length; ++i) { choices.push({ name: propertyNames[i], info: "" }); } return { choices: choices }; }; return IntellisenseRemoteHelpers; })(); Intellisense.IntellisenseRemoteHelpers = IntellisenseRemoteHelpers; })(Common.Intellisense || (Common.Intellisense = {})); var Intellisense = Common.Intellisense; })(Common || (Common = {})); //@ sourceMappingURL=intellisenseRemoteHelpers.js.map .listview { position: relative; border: 1px solid transparent; overflow: auto; box-sizing: border-box; width: 100%; height: 100%; -ms-user-select: none; } .listview:focus { outline: none; } .listview-grid { display: inline-block; box-sizing: border-box; min-width: 100%; } .listview-grid-row { position: relative; display: block; float: left; box-sizing: border-box; min-width: 100%; padding: 0; margin: 0; overflow: visible; white-space: nowrap; -ms-text-overflow: ellipsis; border: solid 1px transparent; word-spacing: 0; -ms-user-select: element; } .listview-grid-row:focus { outline: none !important; } .listview-grid-focus-within .listview-grid-row-selected, .grid-row-selected:hover { background-color: rgba(51, 153, 255, 0.25); /*[{plugin-font-editor-selected-background-color rgba(0.25)}]*/ } .listview-grid-row-selected { background-color: rgba(191, 205, 219, 0.25); /*[{plugin-font-editor-inactive-selected-background-color rgba(0.05)}]*/ } .listview-grid-row-filtered { color: TRANSPARENT; /*[{plugin-font-console-info-color}]*/ height: 5px; } .listview-grid-cell { position: relative; display: inline-block; padding: 1px 4px 2px 4px; text-align: left; text-indent: 2px; vertical-align: middle; white-space: nowrap; } .listview-grid-cell pre { display: inline; font: inherit; } .listview-grid-cell-indent { padding-left: 0; padding-right: 0; } .listview-grid-cell-resize { display: inline-block; overflow: hidden; -ms-text-overflow: ellipsis; } .listview-grid-cell-full { box-sizing: border-box; padding-left: 1px; } .listview-grid-cell-icon, .listview-grid-cell-icon-space { box-sizing: border-box; width: 18px; height: 18px; padding: 0 2px 0 2px; background: none no-repeat no-repeat center top; background-position-y: -18px; background-color: transparent; } .listview-grid-cell-editsection { cursor: pointer; } .listview-grid-cell-clicksection { cursor: pointer; } .listview-grid-underline { position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background-color: transparent; } .listview-icon-tree { position: absolute; width: 16px; height: 16px; top: 1px; left: 2px; } .listview-icon-tree-collapsed { background: url('') no-repeat center center; /*[url({plugin-image-icon-item-collapsed}) no-repeat center center]*/ background-size: 10px 10px; } .listview-icon-tree-expanded { background: url('') no-repeat center center; /*[url({plugin-image-icon-item-expanded}) no-repeat center center]*/ background-size: 10px 10px; } .listview-grid-groupline { position: absolute; width: 4px; margin-top: -5px; box-sizing: border-box; border: solid 1px TRANSPARENT; /*[solid 1px {plugin-font-editor-selected-border-color}]*/ border-top-color: transparent; border-right-color: transparent; } .listview-grid-separator { position: absolute; width: 3px; height: 100%; background-color: transparent; cursor: ew-resize; z-index: 100; } .listview-grid-separator-visible { background-color: TRANSPARENT; /*[{plugin-perftools-grid-column-sizer}]*/ } var Common; (function (Common) { (function (ObjectView) { var TreeViewRemoteObjectExplorer = (function () { function TreeViewRemoteObjectExplorer(context) { this._context = context; } TreeViewRemoteObjectExplorer.prototype.getAllPropertyNames = function (obj) { var propertyNames = []; if(obj) { var currentPropertyNames = this._context.currentWindowContext.Object.getOwnPropertyNames(obj); if(currentPropertyNames) { propertyNames = this._context.currentWindowContext.Object.getOwnPropertyNames(obj); } var prototype = this._context.currentWindowContext.Object.getPrototypeOf(obj); while(prototype) { var prototypeProperties = this._context.currentWindowContext.Object.getOwnPropertyNames(prototype); propertyNames = propertyNames.concat(prototypeProperties); prototype = this._context.currentWindowContext.Object.getPrototypeOf(prototype); } } propertyNames = Array.prototype.sort.call(propertyNames, ObjectView.TreeViewUtils.propertyNameCompare); return propertyNames; }; TreeViewRemoteObjectExplorer.prototype.hasMembers = function (obj) { var objectToCheck = obj; while(objectToCheck && objectToCheck !== "undefined") { var currentPropertyNames = this._context.currentWindowContext.Object.getOwnPropertyNames(objectToCheck); if(currentPropertyNames && currentPropertyNames !== "undefined" && currentPropertyNames.length > 0) { return true; } objectToCheck = this._context.currentWindowContext.Object.getPrototypeOf(objectToCheck); } return false; }; return TreeViewRemoteObjectExplorer; })(); ObjectView.TreeViewRemoteObjectExplorer = TreeViewRemoteObjectExplorer; var TreeViewDirectObjectExplorer = (function () { function TreeViewDirectObjectExplorer() { } TreeViewDirectObjectExplorer.prototype.getAllPropertyNames = function (obj) { var propertyNames = []; for(var prop in obj) { propertyNames.push(prop.toString()); } propertyNames = propertyNames.sort(ObjectView.TreeViewUtils.propertyNameCompare); return propertyNames; }; TreeViewDirectObjectExplorer.prototype.hasMembers = function (obj) { var objectToCheck = obj; for(var prop in obj) { return true; } return false; }; return TreeViewDirectObjectExplorer; })(); ObjectView.TreeViewDirectObjectExplorer = TreeViewDirectObjectExplorer; var TreeViewRemoteHelpers = (function () { function TreeViewRemoteHelpers(context, treeViewObjectExplorer) { this._maxItemTraverseCount = 500; this._maxUngroupArraySize = 50; this._arrayGroupSize = 10; this._context = context; this._treeViewObjectExplorer = treeViewObjectExplorer; } TreeViewRemoteHelpers.prototype.createOutputObject = function (inputId, obj, propertyName, isInternal) { var detailedType = Common.ObjectView.TreeViewUtils.getDetailedTypeOf(obj, this._context.constructors); var name; if(propertyName !== undefined && !isInternal) { obj = obj[propertyName]; if(obj) { detailedType = Common.ObjectView.TreeViewUtils.getDetailedTypeOf(obj, this._context.constructors); } else { return null; } } var isExpandable = !this.isEmpty(obj); var value; var uid; if(isExpandable) { name = this.createName(obj, detailedType); if(name === "[object Window]" && Common.RemoteHelpers.isCrossSiteWindow(this._context.currentWindowContext, obj)) { try { var iframe = dom.getCrossSiteWindow(this._context.currentWindowContext, obj); if(iframe) { obj = iframe; } } catch (e) { value = { 0: this.createExceptionValue(e) }; } } if(!value) { uid = remoteHelpers.getUid(); this._context.resultMap[uid] = obj; if(detailedType === "array") { value = this.createArrayObject(uid, obj, propertyName, isInternal); } else { value = this.createValue(obj, uid, isInternal); } } } else { name = null; value = this.createValue(obj); } var htmlTypeName = this._context.getHtmlViewableTypeName(obj); var isHtmlViewableType = (htmlTypeName !== null && htmlTypeName !== "AttributeNode"); var valueString; if(obj) { var hasToString = false; try { hasToString = obj.toString && obj.toString() !== "[object]" && obj.toString.toString().indexOf("[native code]") === -1; } catch (e) { } if(hasToString) { valueString = Common.RemoteHelpers.htmlEscapeRemote(obj.toString()); } else { if(detailedType === "array" && obj.length > this._maxUngroupArraySize) { var reducedArray = []; for(var i = 0; i < this._maxUngroupArraySize; i++) { reducedArray[i] = obj[i]; } var reducedValue = this.createArrayObject("fakeId", reducedArray, propertyName); valueString = ObjectView.TreeViewValueStringBuilder.createValueString(reducedValue, detailedType, true); } else { valueString = ObjectView.TreeViewValueStringBuilder.createValueString(value, detailedType); } } } return { inputId: inputId, consoleType: "consoleItemOutput", detailedType: detailedType, isExpandable: isExpandable, isHtmlViewableType: isHtmlViewableType, name: name, value: value, valueString: valueString, uid: uid }; }; TreeViewRemoteHelpers.prototype.createArrayObject = function (inputId, obj, range, hasValidRange) { var reassignIndices = false; var arrayLength, outputObject, startRange, endRange; if(hasValidRange && range && range.indexOf(":") !== -1) { var rangeArray = range.split(":", 2); startRange = parseInt(rangeArray[0], 10); endRange = parseInt(rangeArray[1], 10) + 1; arrayLength = endRange - startRange; reassignIndices = true; } else { arrayLength = obj.length; startRange = 0; endRange = arrayLength; range = null; } if(arrayLength <= this._maxUngroupArraySize) { outputObject = this.createValue(obj.slice(startRange, endRange), inputId, false); outputObject = outputObject.filter(function (element, index, array) { return !isNaN(parseInt(element.propertyName, 10)); }); if(reassignIndices || (endRange - startRange) !== outputObject.length) { var index = 0; while(startRange < endRange) { var arrayElementType = typeof obj[startRange]; if(arrayElementType === "object") { outputObject[index].propertyValue.value = inputId + ":" + startRange.toString(); } else if(arrayElementType === "undefined") { outputObject.splice(index, 0, { propertyName: String(index), propertyValue: { detailedType: "undefined", isExpandable: false, isHtmlViewableType: false, name: String(index), value: undefined } }); } outputObject[index++].propertyName = String(startRange++); } } } else { var groupSize = this._arrayGroupSize; while((groupSize * groupSize) < arrayLength) { groupSize *= groupSize; } outputObject = []; var groupStart = startRange, groupEnd = startRange; while(groupEnd < endRange) { groupEnd += groupSize; groupEnd = groupEnd < endRange ? groupEnd : endRange; outputObject.push({ propertyName: "[" + groupStart + "..." + (groupEnd - 1) + "]", propertyValue: { detailedType: "array", isExpandable: true, isHtmlViewableType: false, name: null, value: inputId + "#internal:" + groupStart + ":" + (groupEnd - 1) } }); groupStart = groupEnd; } } if(!range) { outputObject.push({ propertyName: "length", propertyValue: { detailedType: "string", isExpandable: false, isHtmlViewableType: false, name: "length", value: String(obj.length) } }); } return outputObject; }; TreeViewRemoteHelpers.prototype.createValue = function (obj, parentUid, onlyFunctions) { if(obj === null) { return null; } var detailedType = Common.ObjectView.TreeViewUtils.getDetailedTypeOf(obj, this._context.constructors); var isEmpty = this.isEmpty(obj); if(isEmpty) { return this.createName(obj, detailedType); } var outputObj = []; var hasFunctions = false; try { var methods = this._treeViewObjectExplorer.getAllPropertyNames(obj); var methodName; var methodsLength = methods.length; var methodEvaluationFunction = Common.PropertyEvaluationIgnoreList.propertyEvaluationFunction(this._context.currentWindowContext, obj); for(var i = 0; i < methodsLength; i++) { try { if(i > 0 && methods[i] === methods[i - 1]) { continue; } methodName = methods[i]; var child = methodEvaluationFunction(obj, methods[i]); var childDetailedType = Common.ObjectView.TreeViewUtils.getDetailedTypeOf(child, this._context.constructors); var childName = null; hasFunctions = hasFunctions || (childDetailedType === "function"); var childIsExpandable = !this.isEmpty(child); if(childIsExpandable) { childName = this.createName(obj[methodName], childDetailedType); if(childName === "null") { childIsExpandable = false; } } var htmlTypeName = this._context.getHtmlViewableTypeName(child); var isHtmlViewableType = (htmlTypeName !== null && htmlTypeName !== "AttributeNode"); var addToList = (onlyFunctions && childDetailedType === "function") || (!onlyFunctions && childDetailedType !== "function") || (detailedType === "array"); if(addToList) { var propertyValue; propertyValue = { detailedType: childDetailedType, isExpandable: childIsExpandable, isHtmlViewableType: isHtmlViewableType, name: childName, value: (!childIsExpandable ? this.createValue(child, undefined, false) : parentUid + ":" + methodName), valueString: null }; propertyValue.valueString = propertyValue.isExpandable ? ObjectView.TreeViewValueStringBuilder.createPropertyValueString(propertyValue, child) : ObjectView.TreeViewValueStringBuilder.formatPropertyValueString(propertyValue.value); outputObj.push({ propertyName: methodName, propertyValue: propertyValue }); } } catch (childAccessEx) { outputObj.push({ propertyName: methodName, propertyValue: this.createExceptionValue(childAccessEx) }); continue; } } if(!onlyFunctions && hasFunctions) { outputObj.push({ propertyName: "[functions]", propertyValue: { detailedType: "internal", isExpandable: true, isHtmlViewableType: false, name: " ", isInternalProperty: true, value: parentUid + "#internal" + ":" + "[functions]" } }); } } catch (objectAccessEx) { outputObj.push({ propertyName: "0", propertyValue: this.createExceptionValue(objectAccessEx) }); } return outputObj; }; TreeViewRemoteHelpers.prototype.isEmpty = function (obj) { if(obj === null) { return true; } var pageTypeOf = typeof obj; if(pageTypeOf === "object" || pageTypeOf === "function") { try { if(this._treeViewObjectExplorer.hasMembers(obj)) { return false; } } catch (e) { return false; } } return true; }; TreeViewRemoteHelpers.prototype.createName = function (obj, detailedType) { if(!detailedType) { detailedType = Common.ObjectView.TreeViewUtils.getDetailedTypeOf(obj, this._context.constructors); } switch(detailedType) { case "boolean": return "" + obj; case "date": return "[date] " + obj; case "function": return "" + obj; case "null": return "null"; case "number": return "" + obj; case "regex": return "[regex] " + obj; case "string": return "\"" + obj + "\""; case "undefined": return "undefined"; case "array": if(this.isEmpty(obj)) { return Common.ObjectView.TreeViewUtils.consoleUITypeStrings.arrayName; } return this.getPrototypeName(obj); case "object": case "htmlElement": if(this.isEmpty(obj)) { return Common.ObjectView.TreeViewUtils.consoleUITypeStrings.objectName; } return this.getPrototypeName(obj); default: return "" + obj; } }; TreeViewRemoteHelpers.prototype.getPrototypeName = function (obj) { var prototypeName; try { prototypeName = Object.prototype.toString.call(obj); } catch (ex) { prototypeName = null; } return prototypeName; }; TreeViewRemoteHelpers.prototype.createExceptionValue = function (exception) { var information = (exception.message || exception.description); var msg = "<" + information.trim() + ">"; if(msg === "<>") { msg = ""; } return { detailedType: "exception", isExpandable: false, value: msg }; }; return TreeViewRemoteHelpers; })(); ObjectView.TreeViewRemoteHelpers = TreeViewRemoteHelpers; })(Common.ObjectView || (Common.ObjectView = {})); var ObjectView = Common.ObjectView; })(Common || (Common = {})); //@ sourceMappingURL=treeViewRemoteHelpers.js.map var Common; (function (Common) { (function (ObjectView) { "use strict"; var TreeViewUtils = (function () { function TreeViewUtils() { } TreeViewUtils.jsonIndentCount = 12; TreeViewUtils.consoleNotifyType = { assert: "consoleItemError", error: "consoleItemError", info: "consoleItemInfo", log: "consoleItemLog", warn: "consoleItemWarn", internalMessage: "internalMessage" }; TreeViewUtils.consoleInternalMessage = { startGroup: "startGroup", startGroupCollapsed: "startGroupCollapsed", endGroup: "endGroup", displayTraceStyles: "displayTraceStyles" }; TreeViewUtils.consoleUITypeStrings = { functionName: "[function]", objectName: "[object]", arrayName: "[array]", emptyArray: " [ ]", emptyObject: " { }", expandableArray: " [...]", expandableObject: " {...}" }; TreeViewUtils.consoleFilterId = { all: -1, error: 0, warning: 1, message: 2, log: 3 }; TreeViewUtils.getDetailedTypeOf = function getDetailedTypeOf(value, constructors) { if(value === undefined) { return "undefined"; } var type = (typeof value); if(type === "object" && constructors) { if(value) { for(var i = 0; i < constructors.length; i++) { var arrayCon = (constructors[i] && constructors[i].array ? constructors[i].array : (new Array()).constructor); var dateCon = (constructors[i] && constructors[i].date ? constructors[i].date : (new Date()).constructor); var regexCon = (constructors[i] && constructors[i].regex ? constructors[i].regex : (new RegExp("")).constructor); try { if(value.constructor === arrayCon) { return "array"; } else if(value.constructor === dateCon) { return "date"; } else if(value.constructor === regexCon) { return "regex"; } } catch (e) { } } } else { return "null"; } return "object"; } return type; }; TreeViewUtils.wrapInQuotes = function wrapInQuotes(stringToWrap) { return "\"" + stringToWrap.replace(/\\"/g, "\"") + "\""; }; TreeViewUtils.getVisibleHtmlElementText = function getVisibleHtmlElementText(element) { if($m(element).is(":visible")) { if(element.nodeType === 3) { return element.nodeValue; } var visibleText = "", i = 0; while(element.childNodes[i]) { visibleText += TreeViewUtils.getVisibleHtmlElementText(element.childNodes[i]); i++; } return visibleText; } return ""; }; TreeViewUtils.createPadding = function createPadding(levels, singleLevelPadding) { if(levels === 0) { return ""; } var padding = ""; for(var i = 0; i < levels; i++) { padding += singleLevelPadding; } return padding; }; TreeViewUtils.getIndentedObjectString = function getIndentedObjectString(obj, detailedType, stringPadding, indentString, newLineString, useEncodeHtml, useTrim) { var text = ""; var objectString = "" + obj; if((/\S/).test(objectString)) { var indentCount = 0; var finalLines = []; if(detailedType === "string") { if(useEncodeHtml) { objectString = toolwindowHelpers.htmlEscape(objectString); } text = objectString.replace(/(\r\n|\n\r|\r|\n)/g, newLineString); } else { var lines = objectString.replace(/^\s+|\s+$/g, "").split(/[\r\n]+/); for(var lineIndex = 0; lineIndex < lines.length; lineIndex++) { if(lines[lineIndex] !== "") { var indent = ""; var lineText = lines[lineIndex]; if(useEncodeHtml) { lineText = toolwindowHelpers.htmlEscape(lineText); } lineText = lineText.replace(/^\s+|\s+$/g, ""); if(detailedType === "function") { if((/^\}/).test(lineText)) { indentCount--; } for(var i = 0; i < indentCount; i++) { indent += indentString; } if((/\{$/).test(lineText)) { indentCount++; } } finalLines.push(indent + lineText); } } var lineBreaks = newLineString; if(detailedType === "function" && finalLines.length === 3) { finalLines[1] = finalLines[1].replace(/^( )+/, "").replace(/^\s+|\s+$/g, ""); finalLines[2] = finalLines[2].replace(/^\s+|\s+$/g, ""); lineBreaks = " "; } text = finalLines.join(lineBreaks); } } return text; }; TreeViewUtils.propertyNameCompare = function propertyNameCompare(a, b) { var aValue; var bValue; if(!isNaN(aValue = parseInt(a, 10)) && !isNaN(bValue = parseInt(b, 10))) { return aValue - bValue; } else { var al = a.toLowerCase(); var bl = b.toLowerCase(); if(al === bl) { return TreeViewUtils.stringValueCompare(a, b); } else { return TreeViewUtils.stringValueCompare(al, bl); } } }; TreeViewUtils.stringValueCompare = function stringValueCompare(a, b) { if(a < b) { return -1; } else if(a > b) { return 1; } else { return 0; } }; return TreeViewUtils; })(); ObjectView.TreeViewUtils = TreeViewUtils; var TreeViewValueStringBuilder = (function () { function TreeViewValueStringBuilder() { } TreeViewValueStringBuilder.createValueString = function createValueString(properties, detailedType, incomplete) { if (typeof incomplete === "undefined") { incomplete = false; } if(!properties || typeof (properties) !== "object") { return; } var valueString; var isFirstProperty = true; var headToken = ""; var appendPropertyName; var tailToken = ""; switch(detailedType) { case "object": headToken = headToken + "{"; appendPropertyName = true; tailToken = "}" + tailToken; break; case "array": headToken = headToken + "["; appendPropertyName = false; tailToken = "]" + tailToken; properties = properties.filter(function (element, index, array) { return !isNaN(parseInt(element.propertyName, 10)); }); break; default: return; } valueString = headToken; for(var i = 0; i < properties.length; i++) { if(properties[i].propertyName.substr(0, 2) === "__" || properties[i].propertyName === "[functions]") { continue; } if(!isFirstProperty) { valueString += ", "; } isFirstProperty = false; if(appendPropertyName) { valueString += TreeViewValueStringBuilder.createPropertyNameToken(properties[i]); valueString += ": "; } valueString += TreeViewValueStringBuilder.createPropertyValueToken(properties[i]); if(i > 20) { incomplete = true; break; } } if(incomplete) { tailToken = " ..." + tailToken; } valueString = valueString + tailToken; return valueString; }; TreeViewValueStringBuilder.createPropertyValueToken = function createPropertyValueToken(property) { var className; switch(property.propertyValue.detailedType) { case "undefined": className = "valueStringToken-Undefined"; break; case "null": className = "valueStringToken-Null"; break; case "boolean": className = "valueStringToken-Bool"; break; case "number": className = "valueStringToken-Number"; break; case "string": className = "valueStringToken-String"; break; case "function": className = "valueStringToken-Function"; break; case "array": className = "valueStringToken-Array"; break; case "object": className = "valueStringToken-Object"; break; default: className = "valueStringToken-Default"; } return "" + property.propertyValue.valueString + ""; }; TreeViewValueStringBuilder.createPropertyNameToken = function createPropertyNameToken(property) { var className = "valueStringToken-PropertyName"; var escapedPropertyName = Common.RemoteHelpers.htmlEscapeRemote(property.propertyName); return "" + escapedPropertyName + ""; }; TreeViewValueStringBuilder.createPropertyValueString = function createPropertyValueString(propertyValue, obj) { try { switch(propertyValue.detailedType) { case "array": var delimiterIndex = (propertyValue.value).indexOf(":"); if(delimiterIndex !== -1) { return "Array[" + obj.length + "]"; break; } case "object": var delimiterIndex = propertyValue.name.indexOf(" "); if(delimiterIndex !== -1) { return (propertyValue.name.substr(delimiterIndex + 1, propertyValue.name.length - delimiterIndex - 2)) + " {...}"; break; } } } catch (ex) { } return propertyValue.detailedType; }; TreeViewValueStringBuilder.formatPropertyValueString = function formatPropertyValueString(valueString) { if(valueString && typeof (valueString) === "string") { var newValueString = valueString.length > 15 ? valueString.substr(0, 12) + "...\"" : valueString; newValueString = String.prototype.replace.call(newValueString, /(\r\n|\n\r|\r|\n)/g, " "); newValueString = Common.RemoteHelpers.htmlEscapeRemote(newValueString); return newValueString; } return valueString; }; return TreeViewValueStringBuilder; })(); ObjectView.TreeViewValueStringBuilder = TreeViewValueStringBuilder; })(Common.ObjectView || (Common.ObjectView = {})); var ObjectView = Common.ObjectView; })(Common || (Common = {})); //@ sourceMappingURL=treeViewUtilities.js.map var F12; (function (F12) { (function (Tools) { (function (RPC) { var JsonRPCEndpoint = (function () { function JsonRPCEndpoint(identifier, jsonRpcMethodReceive, jsonRpcNotificationReceive, postMessage, onMessageCapture) { var _this = this; this._ourIdentifier = identifier; this._nextId = 0; this._promiseTable = { }; this._jsonRpcMethodReceive = jsonRpcMethodReceive; this._jsonRpcNotificationReceive = jsonRpcNotificationReceive; this._postMessage = postMessage; if(!Date.now) { Date.now = function now() { return +(new Date()); }; } this._startTime = Date.now(); onMessageCapture(function (data) { _this.onMessage(data); }); } JsonRPCEndpoint.prototype.jsonRpcMethodCall = function (method, params, completed, error, identification) { var id = this._ourIdentifier + "|" + this._nextId; this._nextId++; this._promiseTable[id] = { completed: completed, error: error }; var message = JSON.stringify({ id: id, method: method, params: params }); this.logTraffic(message); return this._postMessage(message, identification); }; JsonRPCEndpoint.prototype.jsonRpcNotification = function (method, params, identification) { var id = this._ourIdentifier + "|" + "NULL"; var message = JSON.stringify({ id: id, method: method, params: params }); this.logTraffic(message); this._postMessage(message, identification); }; JsonRPCEndpoint.prototype.logTraffic = function (data) { if(isDebugBuild) { var paddedTimestamp = (" " + (Date.now() - this._startTime) / 1000).slice(-9); __rpcLog.push(paddedTimestamp + " | " + data); if(__rpcLog.length > 100) { __rpcLog.shift(); } } }; JsonRPCEndpoint.prototype.onMessage = function (data) { var _this = this; this.logTraffic(data.data); var result = JSON.parse(data.data); var idSplit = (result.id).split("|"); Tools.Utility.Assert.AreEqual(idSplit.length, 2); if(idSplit[1] === "NULL") { Tools.Utility.Assert.AreNotEqual(idSplit[0], this._ourIdentifier, "Can't notify ourselves"); this._jsonRpcNotificationReceive(result.method, result.params); } else if(idSplit[0] === this._ourIdentifier) { Tools.Utility.Assert.HasValue(this._promiseTable[result.id]); if(result.error) { Tools.Utility.Assert.IsUndefined(result.data, "Can't have both data and error"); this._promiseTable[result.id].error(result.error); } else { this._promiseTable[result.id].completed(result.data); } delete this._promiseTable[result.id]; } else { this._jsonRpcMethodReceive(result.method, result.params, function (data, error) { var message; if(data !== null && data !== undefined) { Tools.Utility.Assert.IsUndefined(error, "Can't have both data and error"); message = JSON.stringify({ id: result.id, data: data }); } else { Tools.Utility.Assert.HasValue(error, "RPC call returned no value, but no error object either"); message = JSON.stringify({ id: result.id, error: error }); } _this._postMessage(message); }); } }; return JsonRPCEndpoint; })(); RPC.JsonRPCEndpoint = JsonRPCEndpoint; })(Tools.RPC || (Tools.RPC = {})); var RPC = Tools.RPC; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); if(isDebugBuild) { var __rpcLog = []; } //@ sourceMappingURL=rpc.js.map html, body { overflow: hidden; } #mainContainer { display: -ms-grid; -ms-grid-rows: auto 1fr auto; -ms-grid-columns: 100%; height: 100%; width: 100%; position: relative; } #outputArea { -ms-grid-row: 2; white-space: nowrap; background-color: TRANSPARENT; /*[{plugin-font-console-background-color}]*/ } #outputList { width: 100%; height: 100%; overflow: hidden; font-family: "Consolas", Lucida Console, monospace; /*[{plugin-font-console} , Lucida Console, monospace]*/ font-size: 9pt; /*[{plugin-font-console-size}]*/ color: TRANSPARENT; /*[{plugin-font-console-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-console-background-color}]*/ } #warningSection { margin-left: 2px; } /* Object visualization */ #outputList .listview-grid-row:not(.listview-grid-row-expanded) .listview-grid-underline { background-color: rgba(0, 0, 0, 0.05); /*[{plugin-font-console-output-color rgba(0.07)}]*/ } #outputList .consoleItemInput .listview-grid-cell-value { color: TRANSPARENT; /*[{plugin-font-console-input-color}]*/ background-color: transparent; /*[{plugin-font-console-input-background-color}]*/ font-weight: normal; /*[{plugin-font-console-input-weight}]*/ } #outputList .consoleItemInput > .listview-grid-cell-icon { background-image: url('images/i_console-input.png'); /*[url({plugin-console-image-icon-input})]*/ background-size: 12px 12px; background-repeat: no-repeat; background-origin: content-box; padding: 2px; } #outputList .consoleItemOutput .listview-grid-cell-value { color: TRANSPARENT; /*[{plugin-font-console-output-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-console-output-background-color}]*/ font-weight: normal; /*[{plugin-font-console-output-weight}]*/ } #outputList .consoleItemOutput > .listview-grid-cell-icon { } #outputList .consoleItemOutput-Async > .listview-grid-cell-icon { background-image: none; } #outputList .consoleItemLog .listview-grid-cell-value { color: TRANSPARENT; /*[{plugin-font-console-output-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-console-output-background-color}]*/ font-weight: normal; /*[{plugin-font-console-output-weight}]*/ } #outputList .consoleItemLog > .listview-grid-cell-icon { background-image: none; } #outputList .consoleItemAssert .listview-grid-cell-value { color: TRANSPARENT; /*[{plugin-font-console-error-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-console-error-background-color}]*/ font-weight: normal; /*[{plugin-font-console-error-weight}]*/ } #outputList .consoleItemAssert > .listview-grid-cell-icon { background-image: url('images/i_error.png'); /*[url({plugin-console-image-icon-error})]*/ background-size: 18px 54px; } #outputList .consoleItemError .listview-grid-cell-value { color: TRANSPARENT; /*[{plugin-font-console-error-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-console-error-background-color}]*/ font-weight: normal; /*[{plugin-font-console-error-weight}]*/ } #outputList .consoleItemError > .listview-grid-cell-icon { background-image: url('images/i_error.png'); /*[url({plugin-console-image-icon-error})]*/ background-size: 18px 54px; } #outputList .consoleItemInfo .listview-grid-cell-value { color: TRANSPARENT; /*[{plugin-font-console-info-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-console-info-background-color}]*/ font-weight: normal; /*[{plugin-font-console-info-weight}]*/ } #outputList .consoleItemInfo > .listview-grid-cell-icon { background-image: url('images/i_info.png'); /*[url({plugin-console-image-icon-info})]*/ background-size: 18px 54px; } #outputList .consoleItemWarn .listview-grid-cell-value { color: TRANSPARENT; /*[{plugin-font-console-warning-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-console-warning-background-color}]*/ font-weight: normal; /*[{plugin-font-console-warning-weight}]*/ } #outputList .consoleItemWarn > .listview-grid-cell-icon { background-image: url('images/i_warning.png'); /*[url({plugin-console-image-icon-warning})]*/ background-size: 18px 54px; } #outputList .consoleItemScriptError .listview-grid-cell-value { color: TRANSPARENT; /*[{plugin-font-console-error-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-console-error-background-color}]*/ font-weight: normal; /*[{plugin-font-console-error-weight}]*/ } #outputList .consoleItemScriptError > .listview-grid-cell-icon { background-image: url('images/i_error.png'); /*[url({plugin-console-image-icon-error})]*/ background-size: 18px 54px; } #outputList .consoleItemOutput-Undefined .listview-grid-cell-value { color: TRANSPARENT; /*[{plugin-font-console-info-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-console-info-background-color}]*/ } #outputList .consoleItemOutput-Exception .listview-grid-cell-value { color: TRANSPARENT; /*[{plugin-font-console-info-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-console-info-background-color}]*/ } #outputList .consoleItemOutput-Null .listview-grid-cell-value { color: TRANSPARENT; /*[{plugin-font-editor-keyword-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-console-background-color}]*/ } #outputList .consoleItemOutput-String .listview-grid-cell-value { color: TRANSPARENT; /*[{plugin-font-editor-string-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-console-background-color}]*/ } #outputList .consoleItemOutput-Bool .listview-grid-cell-value { color: TRANSPARENT; /*[{plugin-font-editor-keyword-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-console-background-color}]*/ } #outputList .consoleItemOutput-Number .listview-grid-cell-value { color: TRANSPARENT; /*[{plugin-font-editor-number-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-console-background-color}]*/ } #outputList .consoleItemOutput-Array .listview-grid-cell-value { color: TRANSPARENT; /*[{plugin-font-editor-symbol-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-console-background-color}]*/ } #outputList .consoleItemOutput-Object .listview-grid-cell-value { color: TRANSPARENT; /*[{plugin-font-editor-symbol-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-console-background-color}]*/ } .consoleItemOutput-Internal { color: TRANSPARENT; /*[{plugin-font-editor-keyword-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-console-background-color}]*/ } #outputList .consoleItemOutput-Internal .listview-grid-cell-value { color: TRANSPARENT; /*[{plugin-font-editor-symbol-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-console-background-color}]*/ } #outputList .listview-grid-row-selected .listview-grid-cell { background-color: transparent !important; } /* HTML visualization */ .Console-Html { font-family: "Consolas", Lucida Console, monospace; /*[{plugin-font-editor} , Lucida Console, monospace]*/ font-size: 9pt; /*[{plugin-font-editor-size}]*/ font-weight: normal; /*[{plugin-font-editor-html-tag-weight}]*/ color: TRANSPARENT; /*[{plugin-font-editor-html-tag-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-console-background-color}]*/ } .Console-Html-Tag { color: TRANSPARENT; /*[{plugin-font-editor-html-element-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-console-background-color}]*/ font-weight: normal; /*[{plugin-font-editor-html-element-weight}]*/ } .Console-Html-DocType, .Console-Html-DocType + .Console-Html-Text { color: TRANSPARENT; /*[{plugin-font-editor-html-comment-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-console-background-color}]*/ font-weight: normal; /*[{plugin-font-editor-html-comment-weight}]*/ } .Console-Html-Comment, .Console-Html-Comment + .Console-Html-Text { color: TRANSPARENT; /*[{plugin-font-editor-html-comment-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-console-background-color}]*/ font-weight: normal; /*[{plugin-font-editor-html-comment-weight}]*/ } .Console-Html-Attribute { color: TRANSPARENT; /*[{plugin-font-editor-html-attribute-name-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-console-background-color}]*/ font-weight: normal; /*[{plugin-font-editor-html-attribute-name-weight}]*/ } .Console-Html-Value { color: TRANSPARENT; /*[{plugin-font-editor-html-attribute-value-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-console-background-color}]*/ font-weight: normal; /*[{plugin-font-editor-html-attribute-value-weight}]*/ } .Console-Html-Operator { color: TRANSPARENT; /*[{plugin-font-editor-html-operator-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-console-background-color}]*/ font-weight: normal; /*[{plugin-font-editor-html-operator-weight}]*/ } .Console-Html-Text { color: TRANSPARENT; /*[{plugin-font-editor-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-console-background-color}]*/ font-weight: normal; /*[{plugin-font-editor-weight}]*/ } .Console-Html-CSS-Name { color: TRANSPARENT; /*[{plugin-font-editor-css-name-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-console-background-color}]*/ font-weight: normal; /*[{plugin-font-editor-css-name-weight}]*/ } .Console-Html-CSS-Value { color: TRANSPARENT; /*[{plugin-font-editor-css-value-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-console-background-color}]*/ font-weight: normal; /*[{plugin-font-editor-css-value-weight}]*/ } .Console-Html-CSS-Selector, .Console-Html-CSS-Selector div { color: TRANSPARENT; /*[{plugin-font-editor-css-selector-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-console-background-color}]*/ font-weight: normal; /*[{plugin-font-editor-css-selector-weight}]*/ } .Console-Html-CSS-Text { background-color: TRANSPARENT; /*[{plugin-font-console-background-color}]*/ font-weight: normal; /*[{plugin-font-editor-weight}]*/ } .listview-grid-row-selected .Console-HtmlItem .Console-Html, .listview-grid-row-selected .Console-HtmlItem .Console-Html-Tag, .listview-grid-row-selected .Console-HtmlItem .Console-Html-Attribute, .listview-grid-row-selected .Console-HtmlItem .Console-Html-Value, .listview-grid-row-selected .Console-HtmlItem .Console-Html-Operator, .listview-grid-row-selected .Console-HtmlItem .Console-Html-Text, .listview-grid-row-selected .Console-HtmlItem .Console-Html-Comment, .listview-grid-row-selected .Console-HtmlItem .Console-Html-Comment + .Console-Html-Text, .listview-grid-row-selected .Console-HtmlItem .Console-Html-DocType + .Console-Html-Text, .listview-grid-row-selected .Console-HtmlItem .Console-Html-CSS-Name, .listview-grid-row-selected .Console-HtmlItem .Console-Html-CSS-Value, .listview-grid-row-selected .Console-StyleItem-Value.Console-Html-CSS-Value, .listview-grid-row-selected .Console-HtmlItem .Console-Html-CSS-Selector, .listview-grid-row-selected .Console-HtmlItem .Console-Html-CSS-Text, .listview-grid-row-selected .listview-grid-cell { background-color: transparent !important; } .listview-icon-tree-expanded + .listview-grid-cell .Console-Html-CollapsedFooter { display: none; } .Console-Html-Footer { margin-left: -16px; } .Console-Html-Numbering { display: inline-block; min-width: 24px; margin-right: 4px; } .Console-ExpandableLines { color: TRANSPARENT; /*[{plugin-font-console-info-color}]*/ } .Console-ExpandableString { color: TRANSPARENT; /*[{plugin-font-editor-string-color}]*/ } /* Toolbar and status */ .BPT-WarnMessage { color: TRANSPARENT; /*[{plugin-font-console-warning-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-console-warning-background-color}]*/ font-weight: normal; /*[{plugin-font-console-warning-weight}]*/ padding-left: 21px; padding-top: 3px; padding-bottom: 3px; } .BPT-WarnMessageIcon { background-image: url('images/i_warning.png'); /*[url({plugin-console-image-icon-warning})]*/ background-size: 18px 54px; background-repeat: no-repeat; width: 18px; height: 18px; display: inline-block; float: left; vertical-align: middle; } .BPT-Toolbar .errorButton { background-image: url('images/i_error.png'); /*[url({plugin-console-image-icon-button-error})]*/ background-size: 18px 54px; } .BPT-Toolbar .warnButton { background-image: url('images/i_warning.png'); /*[url({plugin-console-image-icon-button-warn})]*/ background-size: 18px 54px; } .BPT-Toolbar .infoButton { background-image: url('images/i_info.png'); /*[url({plugin-console-image-icon-button-info})]*/ background-size: 18px 54px; } .BPT-Toolbar .clearButton { background-image: url('images/i_delete.png'); /*[url({plugin-console-image-icon-button-clear})]*/ background-size: 18px 54px; } /* Console input control */ #inputArea { -ms-grid-row: 3; position: relative; font-family: "Consolas", Lucida Console, monospace; /*[{plugin-font-console} , Lucida Console, monospace]*/ font-size: 9pt; /*[{plugin-font-console-size}]*/ color: TRANSPARENT; /*[{plugin-font-console-color}]*/ background-color: TRANSPARENT; /*[{plugin-textbox-disabled-background-color}]*/ /* redline has #e8eef6 */ } #inputSplitter { cursor: n-resize; height: 3px; width: 100%; background-color: TRANSPARENT; /*[{vs-horizontal-resize-grip-color}]*/ margin-bottom: 1px; } #inputLabel { top: 0; display: table-cell; width: auto; vertical-align: top; } #inputLabel > div { box-sizing: border-box; width: 16px; margin: 0 2px 0 2px; background-image: url('images/i_console-input.png'); /*[url({plugin-console-image-icon-input})]*/ background-size: 12px 12px; background-repeat: no-repeat; background-origin: content-box; padding: 2px; } #inputBoxContainer { top: 0; margin-left: 0.5em; display: table-cell; width: 100%; } #inputBoxContainer > * { display: none; border: none; width: 100%; height: inherit; } #inputMultilineContainer { display: none; width: inherit; height: inherit; } #input-singleLine { font: inherit; background-color: TRANSPARENT; /*[{plugin-textbox-disabled-background-color}]*/ /* redline has #e8eef6 */ } #input-singleLine::-ms-clear { display:none; } #input-multiLine { border: none; height: inherit; display: inline-block; font: inherit; background-color: TRANSPARENT; /*[{plugin-textbox-disabled-background-color}]*/ /* redline has #e8eef6 */ width: inherit; } #inputButtonContainer { top: 0; display: table-cell; padding-left: 0.5em; padding-right: 0.5em; width: auto; vertical-align: bottom; } .BPT-ConsoleButton { top: 0; display: table-cell; padding-left: 0.5em; padding-right: 0.5em; width: auto; vertical-align: bottom; } .BPT-ConsoleInput:focus { outline-color: transparent !important; outline-style: hidden !important; } #executeButton { background-position: 0 0; background-repeat: no-repeat; background-image: url('images/i_execute.png'); /*[url({plugin-console-image-icon-button-execute})]*/ background-size: 12px 36px; width: 12px; height: 12px; margin: 2px; } #executeButton:hover { background-position: 0px -12px; } #clearInputButton { background-position: 0 0; background-repeat: no-repeat; background-image: url('images/i_clear-input.png'); /*[url({plugin-console-image-icon-button-clear-input})]*/ background-size: 12px 36px; width: 12px; height: 12px; margin: 2px; } #clearInputButton:hover { background-position: 0px -12px; } #toggleButton { background-position: 0 0; background-repeat: no-repeat; background-size: 12px 12px; width: 12px; height: 12px; margin: 2px; } .BPT-Toggle-MultiIcon { background-image: url('images/i_toggle-multi.png'); /*[url({plugin-console-image-icon-button-multi})]*/ } .BPT-Toggle-SingleIcon { background-image: url('images/i_toggle-single.png'); /*[url({plugin-console-image-icon-button-single})]*/ } .Console-ColorThumbnail { display: inline-block; vertical-align: middle; width: 12px; height: 12px; margin: 0 2px 0 2px; border: 1px solid black; /*[1px solid {plugin-font-editor-color}]*/ } .Console-Style-Disabled .listview-grid-cell { text-decoration: line-through; } .Console-Style-Disabled .listview-grid-cell span.Console-Html-CSS-Value { text-decoration: line-through; text-decoration-color: TRANSPARENT; /*[{plugin-font-editor-css-value-color}]*/ } .valueStringToken-Null { color: TRANSPARENT; /*[{plugin-font-editor-keyword-color}]*/ } .valueStringToken-Undefined { color: TRANSPARENT; /*[{plugin-font-editor-keyword-color}]*/ } .valueStringToken-String { color: TRANSPARENT; /*[{plugin-font-editor-string-color}]*/ } .valueStringToken-Bool { color: TRANSPARENT; /*[{plugin-font-editor-keyword-color}]*/ } .valueStringToken-Number { color: TRANSPARENT; /*[{plugin-font-editor-number-color}]*/ } .valueStringToken-Array { color: TRANSPARENT; /*[{plugin-font-editor-symbol-color}]*/ } .valueStringToken-Object { color: TRANSPARENT; /*[{plugin-font-editor-symbol-color}]*/ } .valueStringToken-Function { color: TRANSPARENT; /*[{plugin-font-console-output-color}]*/ } .valueStringToken-PropertyName { color: TRANSPARENT; /*[{plugin-font-console-output-color}]*/ } .valueStringToken-Default { color: TRANSPARENT; /*[{plugin-font-console-output-color}]*/ } Console
    Console
    0
    0
    0
     
    // // Copyright (C) Microsoft. All rights reserved. // // consoleIntellisenseProvider.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var F12; (function (F12) { "use strict"; (function (Tools) { (function (Console) { var ConsoleIntellisenseProvider = (function (_super) { __extends(ConsoleIntellisenseProvider, _super); function ConsoleIntellisenseProvider(proxy, toolTraceWriter) { _super.call(this); this._proxy = proxy; this._traceWriter = toolTraceWriter.traceWriter; } ConsoleIntellisenseProvider._nextId = 0; Object.defineProperty(ConsoleIntellisenseProvider.prototype, "traceWriter", { get: function () { return this._traceWriter; }, enumerable: true, configurable: true }); ConsoleIntellisenseProvider.prototype.getDefaultExpression = function (caretPosition) { return { text: "window.", offset: caretPosition }; }; ConsoleIntellisenseProvider.prototype.getIntellisenseChoices = function (searchExpression, completeCallback, cancelToken) { var _this = this; if(!this._proxy.atBreakpointInWorker) { var remoteCallback = function (results) { _this.fireGetIntellisenseItemsEndEvent(); if(!cancelToken.isCanceled) { var choices = []; if(results && results.choices) { for(var i = 0; i < results.choices.length; ++i) { choices.push(new Common.Intellisense.IntellisenseChoice(results.choices[i].name, results.choices[i].info)); } } completeCallback(choices); } }; this.fireGetIntellisenseItemsStartEvent(); if(this._proxy.atBreakpoint) { this._proxy.executeBreakModeCommand("performBreakmodeIntellisense", ConsoleIntellisenseProvider.getNextId(), searchExpression, remoteCallback, ConsoleIntellisenseProvider.createInvoker); } else { this._proxy.callRemote("getIntellisenseItemsForExpression", [ searchExpression ], remoteCallback); } } }; ConsoleIntellisenseProvider.createInvoker = function createInvoker(id, searchExpression, isWorker) { var invoker = '__BROWSERTOOLS_CONSOLE.performBreakmodeIntellisense("' + id + '", "' + searchExpression + '", window)'; return invoker; }; ConsoleIntellisenseProvider.getNextId = function getNextId() { return ConsoleIntellisenseProvider._nextId++; }; ConsoleIntellisenseProvider.prototype.fireGetCurrentExpressionStartEvent = function () { this.traceWriter.raiseEvent(Common.TraceEvents.Console_Intellisense_Provider_Get_Expression_Start); }; ConsoleIntellisenseProvider.prototype.fireGetCurrentExpressionEndEvent = function () { this.traceWriter.raiseEvent(Common.TraceEvents.Console_Intellisense_Provider_Get_Expression_Stop); }; ConsoleIntellisenseProvider.prototype.fireUpdateIntellisenseStartEvent = function () { this.traceWriter.raiseEvent(Common.TraceEvents.Console_Intellisense_Provider_Update_Start); }; ConsoleIntellisenseProvider.prototype.fireUpdateIntellisenseEndEvent = function () { this.traceWriter.raiseEvent(Common.TraceEvents.Console_Intellisense_Provider_Update_Stop); }; ConsoleIntellisenseProvider.prototype.fireGetIntellisenseItemsStartEvent = function () { this.traceWriter.raiseEvent(Common.TraceEvents.Console_Intellisense_Provider_Get_Items_Start); }; ConsoleIntellisenseProvider.prototype.fireGetIntellisenseItemsEndEvent = function () { this.traceWriter.raiseEvent(Common.TraceEvents.Console_Intellisense_Provider_Get_Items_Stop); }; return ConsoleIntellisenseProvider; })(Common.Intellisense.IntellisenseProviderBase); Console.ConsoleIntellisenseProvider = ConsoleIntellisenseProvider; })(Tools.Console || (Tools.Console = {})); var Console = Tools.Console; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=consoleIntellisenseProvider.js.map // inputcontrol.ts var F12; (function (F12) { "use strict"; (function (Tools) { (function (Console) { (function (Controls) { var InputControl = (function () { function InputControl(executeCallback, intellisenseContext, resizeListViewCommand) { this._executeCallback = executeCallback; this._intellisenseContext = intellisenseContext; this._resizeListView = resizeListViewCommand; this._commandItems = []; this._commandIndex = -1; this._isSingleLineMode = true; this._savedSelectionValid = false; this.initialize(); } InputControl._minMultiLineConsolePaneSize = 30; InputControl._defaultMultiLineConsolePaneSize = 80; InputControl._minPaneSize = 25; InputControl._consoleAreaOffset = 10; InputControl.prototype.initialize = function () { var _this = this; this._mainContainer = document.getElementById("mainContainer"); this._toolbar = document.getElementById("toolbar"); this._outputPanelElement = document.getElementById("outputArea"); this._inputPanelElement = document.getElementById("inputArea"); this._dividerElement = document.getElementById("inputSplitter"); this._singleInputElement = document.getElementById("input-singleLine"); this._multiInputElement = document.getElementById("input-multiLine"); this._multiInputContainerElement = document.getElementById("inputMultilineContainer"); this._executeButton = document.getElementById("executeButton"); this._toggleButton = document.getElementById("toggleButton"); this._clearInputButton = document.getElementById("clearInputButton"); this.attachButtonEvents(this._executeButton, function () { return _this.executeButtonPressed(); }); this.attachButtonEvents(this._toggleButton, function () { return _this.toggleLineMode(); }); this.attachButtonEvents(this._clearInputButton, function () { return _this.clearInput(); }); this._singleInputElement.addEventListener("keydown", function (e) { return _this.onInputKeyDown(e); }); this._multiInputElement.addEventListener("keydown", function (e) { return _this.onInputKeyDown(e); }); this._multiInputElement.addEventListener("blur", function (e) { return _this.multiOnBlur(e); }); this._multiInputElement.addEventListener("focus", function (e) { return _this.multiOnFocus(e); }); this._dividerElement.addEventListener("mousedown", function (e) { return _this.onDividerMouseDown(e); }); this._clearInputButton.title = toolwindowHelpers.loadString("ConsoleClearInputButtonTooltip"); this._singleInputElement.title = toolwindowHelpers.loadString("ConsoleInputTooltip"); this._multiInputElement.title = toolwindowHelpers.loadString("ConsoleInputTooltip"); this._isSingleLineMode = !this._isSingleLineMode; this.toggleLineMode(); this._multiInputElement.addEventListener("contextmenu", function (e) { return _this.handleContextMenu(e); }); this._singleInputElement.addEventListener("contextmenu", function (e) { return _this.handleContextMenu(e); }); if(Plugin.F12) { Plugin.F12.addEventListener("keydown", function (e) { if(e.keyCode === Common.KeyCodes.I && e.ctrlKey && e.altKey && !e.shiftKey) { if(_this._isSingleLineMode) { _this._singleInputElement.focus(); } else { _this._multiInputElement.focus(); } } }); } }; InputControl.prototype.enable = function () { this._inputPanelElement.style.display = 'block'; }; InputControl.prototype.disable = function () { this._inputPanelElement.style.display = 'none'; }; InputControl.prototype.attachButtonEvents = function (button, callback) { button.addEventListener("click", function (e) { callback(); }); button.addEventListener("keydown", function (e) { if(e.keyCode === Common.KeyCodes.ENTER || e.keyCode === Common.KeyCodes.SPACE) { callback(); e.preventDefault(); } }); }; InputControl.prototype.onDividerMouseDown = function (e) { var _this = this; var startY = e.clientY; var startHeight = this._inputPanelElement.clientHeight; var maxHeight = this._mainContainer.clientHeight - this._toolbar.clientHeight; var mouseMoveHandler, mouseUpHandler; mouseMoveHandler = function (e) { _this.setPaneHeight(Math.min(maxHeight, startHeight + startY - e.clientY)); }; mouseUpHandler = function (e) { document.removeEventListener("mousemove", mouseMoveHandler); document.removeEventListener("mouseup", mouseUpHandler); }; document.addEventListener("mousemove", mouseMoveHandler); document.addEventListener("mouseup", mouseUpHandler); }; InputControl.prototype.onInputKeyDown = function (e) { if(this._intellisenseContext.intellisenseMenu.isOpen && (this._intellisenseContext.intellisenseMenu.hasSelection || e.keyCode !== Common.KeyCodes.ENTER)) { return true; } var shiftKey = event.shiftKey && !event.ctrlKey && !event.altKey; if(event.keyCode === Common.KeyCodes.F10 && shiftKey) { this.showContextMenu(0, 0); e.stopImmediatePropagation(); e.preventDefault(); return false; } if(e.target === this._singleInputElement) { var inputText = this._singleInputElement.value; if(this._commandItems.length > 0 && e.keyCode === Common.KeyCodes.ARROW_UP) { this._commandIndex = this._commandIndex < (this._commandItems.length - 1) ? this._commandIndex : this._commandItems.length - 1; while(this._commandIndex >= 0 && this._commandItems[this._commandIndex] === inputText) { this._commandIndex--; } this._intellisenseContext.uninitialize(); this.setSingleLineInputElementText(this._commandItems[this._commandIndex >= 0 ? this._commandIndex : 0]); this._singleInputElement.focus(); if(this._commandIndex < 0) { this._singleInputElement.setSelectionRange(0, 0); } this._intellisenseContext.initialize(this._singleInputElement); } else if(this._commandItems.length > 0 && e.keyCode === Common.KeyCodes.ARROW_DOWN) { var navigateToNextCommand = this._commandIndex >= 0; this._commandIndex = this._commandIndex < 0 ? 0 : this._commandIndex; while(this._commandIndex < this._commandItems.length && this._commandItems[this._commandIndex] === inputText && navigateToNextCommand) { this._commandIndex++; } this._intellisenseContext.uninitialize(); inputText = this._commandIndex < this._commandItems.length ? this._commandItems[this._commandIndex] : ""; this.setSingleLineInputElementText(inputText); this._singleInputElement.focus(); this._intellisenseContext.initialize(this._singleInputElement); } else if(e.keyCode === Common.KeyCodes.M && e.ctrlKey && e.altKey) { this.toggleLineMode(); e.preventDefault(); return false; } else if(e.keyCode === Common.KeyCodes.ENTER && !e.shiftKey) { this._intellisenseContext.uninitialize(); this.executeCommand(); this._intellisenseContext.initialize(this._singleInputElement); } else if(e.keyCode === Common.KeyCodes.ENTER && e.shiftKey) { var start = this._singleInputElement.selectionStart; var end = this._singleInputElement.selectionEnd; this.toggleLineMode(); this._multiInputElement.setSelectionRange(start, end); } else if(!this._intellisenseContext.intellisenseMenu.isOpen && e.keyCode === Common.KeyCodes.ESCAPE) { this.setSingleLineInputElementText(""); e.preventDefault(); e.stopPropagation(); return false; } else if(e.keyCode === Common.KeyCodes.V && e.ctrlKey && !e.shiftKey && !e.altKey) { var pasteText = clipboardData.getData("Text"); if(pasteText && pasteText.indexOf("\n") >= 0) { var start = this._singleInputElement.selectionStart; var end = this._singleInputElement.selectionEnd; this.switchToMultiLineConsole(); this._intellisenseContext.uninitialize(); this.updateInputElementTextRange(start, end, pasteText); this._intellisenseContext.initialize(this._multiInputElement); e.preventDefault(); e.stopPropagation(); return false; } return true; } } else { var inputText = this._multiInputElement.value; if(e.keyCode === Common.KeyCodes.TAB && !e.shiftKey && !e.altKey && !e.ctrlKey) { this._intellisenseContext.uninitialize(); var start = this._multiInputElement.selectionStart; var end = this._multiInputElement.selectionEnd; this.updateInputElementTextRange(start, end, "\t"); this._multiInputElement.setSelectionRange(start + 1, start + 1); this._intellisenseContext.initialize(this._multiInputElement); e.preventDefault(); return false; } else if(e.keyCode === Common.KeyCodes.ENTER && e.ctrlKey) { this._intellisenseContext.intellisenseMenu.isOpen = false; this.executeCommand(); } else if(e.keyCode === Common.KeyCodes.M && e.ctrlKey && e.altKey) { this.toggleLineMode(); e.preventDefault(); return false; } else if(!this._intellisenseContext.intellisenseMenu.isOpen && e.keyCode === Common.KeyCodes.ESCAPE) { this.setMultiLineInputElementText(""); e.preventDefault(); e.stopPropagation(); return false; } } return true; }; InputControl.prototype.multiOnBlur = function (e) { this._savedSelectionEnd = this._multiInputElement.selectionEnd; this._savedSelectionValid = true; return true; }; InputControl.prototype.multiOnFocus = function (e) { if(this._savedSelectionValid && this._multiInputElement.selectionEnd >= this._multiInputElement.value.length) { this._multiInputElement.setSelectionRange(this._savedSelectionEnd, this._savedSelectionEnd); } return true; }; InputControl.prototype.setPaneHeight = function (newHeight) { newHeight = Math.round(newHeight); if(newHeight < InputControl._minPaneSize) { return; } this._inputPanelElement.style.height = newHeight + "px"; var inputHeight = (newHeight - InputControl._consoleAreaOffset); this._singleInputElement.style.height = inputHeight + "px"; this._multiInputElement.style.height = inputHeight + "px"; this._outputPanelElement.style.bottom = (newHeight - this._dividerElement.offsetTop) + "px"; this._resizeListView(); if(newHeight < InputControl._minMultiLineConsolePaneSize) { this.switchToSingleLineConsole(newHeight); } else if(this._isSingleLineMode && newHeight >= InputControl._minMultiLineConsolePaneSize) { this.switchToMultiLineConsole(newHeight); } }; InputControl.prototype.switchToSingleLineConsole = function (paneHeight) { if(!this._isSingleLineMode) { this._isSingleLineMode = true; var text = this._multiInputElement.value; text = (text ? text.replace(/[\r\n]/g, " ") : ""); this._multiInputContainerElement.style.display = "none"; this._singleInputElement.style.display = "inline-block"; this.setSingleLineInputElementText(text); this._toggleButton.classList.remove("BPT-Toggle-SingleIcon"); this._toggleButton.classList.add("BPT-Toggle-MultiIcon"); this._toggleButton.title = toolwindowHelpers.loadString("ToggleToMultiLineTooltip"); this._executeButton.title = toolwindowHelpers.loadString("RunScriptButtonText"); this._intellisenseContext.uninitialize(); this._intellisenseContext.initialize(this._singleInputElement); this.setPaneHeight(paneHeight || InputControl._minPaneSize); this._singleInputElement.focus(); } }; InputControl.prototype.switchToMultiLineConsole = function (paneHeight) { if(this._isSingleLineMode) { this._isSingleLineMode = false; var text = this._singleInputElement.value; this._multiInputContainerElement.style.display = "inline-block"; this._singleInputElement.style.display = "none"; this.setMultiLineInputElementText(text); this._toggleButton.classList.remove("BPT-Toggle-MultiIcon"); this._toggleButton.classList.add("BPT-Toggle-SingleIcon"); this._toggleButton.title = toolwindowHelpers.loadString("ToggleToSingleLineTooltip"); this._executeButton.title = toolwindowHelpers.loadString("RunScriptButtonTextMultiLine"); this._intellisenseContext.uninitialize(); this._intellisenseContext.initialize(this._multiInputElement); var inputContainer = document.getElementById("inputBoxContainer"); if(inputContainer.clientHeight < InputControl._minMultiLineConsolePaneSize) { this.setPaneHeight(paneHeight || InputControl._defaultMultiLineConsolePaneSize); } this._multiInputElement.focus(); } }; InputControl.prototype.executeButtonPressed = function () { this.executeCommand(); if(this._isSingleLineMode) { this._singleInputElement.focus(); } else { this._multiInputElement.focus(); } }; InputControl.prototype.executeCommand = function () { var inputText = ""; if(this._isSingleLineMode) { inputText = this._singleInputElement.value; this._singleInputElement.value = ""; } else { inputText = this._multiInputElement.value; } inputText = inputText.trim(); var inputId = this._executeCallback(inputText); this._inputId = inputId; if(inputId >= 0 && this._isSingleLineMode) { if(this._commandItems[this._commandItems.length - 1] !== inputText) { this._commandItems.push(inputText); } this._commandIndex = this._commandItems.length - 1; } }; InputControl.prototype.toggleLineMode = function () { if(this._isSingleLineMode) { this.switchToMultiLineConsole(); } else { this.switchToSingleLineConsole(); } }; InputControl.prototype.clearInput = function () { if(this._isSingleLineMode) { this.setSingleLineInputElementText(""); this._singleInputElement.focus(); } else { this.setMultiLineInputElementText(""); this._multiInputElement.focus(); } }; InputControl.prototype.setSingleLineInputElementText = function (text) { var range = this._singleInputElement.createTextRange(); var useUndo = range.queryCommandSupported("ms-beginUndoUnit"); if(useUndo) { range.execCommand("ms-beginUndoUnit"); } range.text = text; if(useUndo) { range.execCommand("ms-endUndoUnit"); } }; InputControl.prototype.setMultiLineInputElementText = function (text) { var range = this._multiInputElement.createTextRange(); var useUndo = range.queryCommandSupported("ms-beginUndoUnit"); if(useUndo) { range.execCommand("ms-beginUndoUnit"); } range.text = text; if(useUndo) { range.execCommand("ms-endUndoUnit"); } this._savedSelectionValid = false; }; InputControl.prototype.updateInputElementTextRange = function (start, end, text) { var element; if(this._isSingleLineMode) { element = this._singleInputElement; } else { element = this._multiInputElement; } var range = element.createTextRange(); var useUndo = range.queryCommandSupported("ms-beginUndoUnit"); if(useUndo) { range.execCommand("ms-beginUndoUnit"); } range.move("character", start); range.moveEnd("character", end - start); range.text = text; if(useUndo) { range.execCommand("ms-endUndoUnit"); } }; InputControl.prototype.executeCommandApi = function (command) { if(this._isSingleLineMode) { this._singleInputElement.value = command; } else { this._multiInputElement.value = command; } this.executeCommand(); return this._inputId; }; InputControl.prototype.onInputKeyDownApi = function (e) { if(this._isSingleLineMode) { e.target = this._singleInputElement; } else { e.target = this._multiInputElement; } return this.onInputKeyDown(e); }; Object.defineProperty(InputControl.prototype, "commandItems", { get: function () { return this._commandItems; }, enumerable: true, configurable: true }); Object.defineProperty(InputControl.prototype, "isSingleLineMode", { get: function () { return this._isSingleLineMode; }, set: function (value) { if(value) { this.switchToSingleLineConsole(); } else { this.switchToMultiLineConsole(); } }, enumerable: true, configurable: true }); InputControl.prototype.focusOnInput = function () { if(this._isSingleLineMode) { this._singleInputElement.focus(); } else { this._multiInputElement.focus(); } }; InputControl.prototype.setInputText = function (text) { if(this._isSingleLineMode) { this._singleInputElement.value = text; } else { this._multiInputElement.value = text; } }; InputControl.prototype.setSelectionRange = function (start, end) { if(this._isSingleLineMode) { this._singleInputElement.setSelectionRange(start, end); } else { this._multiInputElement.setSelectionRange(start, end); } }; InputControl.prototype.showContextMenu = function (clientX, clientY) { var _this = this; var x = clientX; var y = clientY; var element; if(this.isSingleLineMode) { element = this._singleInputElement; } else { element = this._multiInputElement; } if(clientX <= 0 || clientY <= 0) { var offset = element.getBoundingClientRect(); x = offset.left; y = offset.top; } this._copyStart = element.selectionStart; this._copyEnd = element.selectionEnd; var _menuItems = [ { id: "menuConsoleInputCut", type: Plugin.ContextMenu.MenuItemType.command, label: Plugin.Resources.getString("/Common/CutMenuText"), accessKey: Plugin.Resources.getString("AccessKeyCtrlX") }, { id: "menuConsoleInputCopy", type: Plugin.ContextMenu.MenuItemType.command, label: Plugin.Resources.getString("/Common/CopyMenuText"), accessKey: Plugin.Resources.getString("AccessKeyCtrlC") }, { id: "menuConsoleInputPaste", type: Plugin.ContextMenu.MenuItemType.command, label: Plugin.Resources.getString("/Common/PasteMenuText"), accessKey: Plugin.Resources.getString("AccessKeyCtrlV") } ]; var contextMenu = Plugin.ContextMenu.create(_menuItems, null, null, null, function (menuId, menuItem) { return _this.invokeContextMenu(menuId, menuItem); }); contextMenu.addEventListener("dismiss", function () { contextMenu.dispose(); }); contextMenu.attach(element); contextMenu.show(parseInt(x.toFixed(0)), parseInt(y.toFixed(0))); }; InputControl.prototype.handleContextMenu = function (e) { this.showContextMenu(e.clientX, e.clientY); e.stopImmediatePropagation(); e.preventDefault(); return false; }; InputControl.prototype.invokeContextMenu = function (menuId, menuItem) { var element; if(this.isSingleLineMode) { element = this._singleInputElement; } else { element = this._multiInputElement; } var selectedText = element.value.substring(this._copyStart, this._copyEnd); var pasteText = clipboardData.getData("Text"); switch(menuItem.id) { case "menuConsoleInputCut": clipboardData.setData("Text", selectedText); this.updateInputElementTextRange(this._copyStart, this._copyEnd, ""); element.focus(); break; case "menuConsoleInputCopy": clipboardData.setData("Text", selectedText); element.focus(); element.setSelectionRange(this._copyStart, this._copyEnd); break; case "menuConsoleInputPaste": if(pasteText) { if(pasteText.indexOf("\n") >= 0) { this.switchToMultiLineConsole(); element = this._multiInputElement; } this._intellisenseContext.uninitialize(); this.updateInputElementTextRange(this._copyStart, this._copyEnd, pasteText); element.focus(); this._intellisenseContext.initialize(element); } break; } }; return InputControl; })(); Controls.InputControl = InputControl; })(Console.Controls || (Console.Controls = {})); var Controls = Console.Controls; })(Tools.Console || (Tools.Console = {})); var Console = Tools.Console; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=inputcontrol.js.map // menus.ts var F12; (function (F12) { "use strict"; (function (Tools) { (function (Console) { var menuOutputAreaItems; (function (menuOutputAreaItems) { menuOutputAreaItems._map = []; menuOutputAreaItems.menuConsoleViewAsHtml = 0; menuOutputAreaItems.menuConsoleViewAsObject = 1; menuOutputAreaItems.menuConsoleAddToWatch = 2; menuOutputAreaItems.menuConsoleCopy = 4; menuOutputAreaItems.menuConsoleCopyItem = 5; menuOutputAreaItems.menuConsoleCopyAll = 6; menuOutputAreaItems.menuConsoleClear = 8; menuOutputAreaItems.menuConsoleFilterErrors = 10; menuOutputAreaItems.menuConsoleFilterWarnings = 11; menuOutputAreaItems.menuConsoleFilterMessages = 12; menuOutputAreaItems.menuConsoleFilterLog = 13; menuOutputAreaItems.menuConsoleFilterAll = 14; })(menuOutputAreaItems || (menuOutputAreaItems = {})); var ContextMenuController = (function () { function ContextMenuController(console, listview) { this._menuId = "ConsoleOutputContextMenu"; this._selectedItem = null; this._menuItems = [ { id: "menuConsoleViewAsHtml", type: Plugin.ContextMenu.MenuItemType.command, label: Plugin.Resources.getString("/Common/ViewAsHtmlMenuText") }, { id: "menuConsoleViewAsObject", type: Plugin.ContextMenu.MenuItemType.command, label: Plugin.Resources.getString("/Common/ViewAsObjectMenuText") }, { id: "menuConsoleAddToWatch", type: Plugin.ContextMenu.MenuItemType.command, label: Plugin.Resources.getString("/Common/AddToWatch") }, { id: "separator", type: Plugin.ContextMenu.MenuItemType.separator }, { id: "menuConsoleCopy", type: Plugin.ContextMenu.MenuItemType.command, label: Plugin.Resources.getString("/Common/CopyMenuText") }, { id: "menuConsoleCopyItem", type: Plugin.ContextMenu.MenuItemType.command, label: Plugin.Resources.getString("/Common/CopyItemMenuText") }, { id: "menuConsoleCopyAll", type: Plugin.ContextMenu.MenuItemType.command, label: Plugin.Resources.getString("/Common/CopyAllMenuText") }, { id: "separator", type: Plugin.ContextMenu.MenuItemType.separator }, { id: "menuConsoleClear", type: Plugin.ContextMenu.MenuItemType.command, label: Plugin.Resources.getString("/Common/ClearMenuText") }, { id: "separator", type: Plugin.ContextMenu.MenuItemType.separator }, { id: "menuConsoleFilterErrors", type: Plugin.ContextMenu.MenuItemType.checkbox, label: Plugin.Resources.getString("/Common/FilterErrorsMenuText") }, { id: "menuConsoleFilterWarnings", type: Plugin.ContextMenu.MenuItemType.checkbox, label: Plugin.Resources.getString("/Common/FilterWarningsMenuText") }, { id: "menuConsoleFilterMessages", type: Plugin.ContextMenu.MenuItemType.checkbox, label: Plugin.Resources.getString("/Common/FilterMessagesMenuText") }, { id: "menuConsoleFilterLog", type: Plugin.ContextMenu.MenuItemType.checkbox, label: Plugin.Resources.getString("/Common/FilterLogMenuText") }, { id: "menuConsoleFilterAll", type: Plugin.ContextMenu.MenuItemType.checkbox, label: Plugin.Resources.getString("/Common/FilterDisplayAllMenuText") } ]; this._console = console; this._listview = listview; this.initialize(); } ContextMenuController.prototype.initialize = function () { var _this = this; this._outputArea = document.getElementById("outputArea"); this._outputArea.addEventListener("contextmenu", function (e) { return _this.onOutputAreaContextMenu(e); }); this._outputArea.addEventListener("keydown", function (e) { return _this.onOutputAreaContextMenuByKey(e); }); }; ContextMenuController.prototype.onOutputAreaContextMenuByKey = function (event) { this._console.onConsoleBeforeMenuLoaded(); var shiftKey = event.shiftKey && !event.ctrlKey && !event.altKey; if(event.keyCode === Common.KeyCodes.F10 && shiftKey) { this.showContextMenu(0, 0); event.preventDefault(); event.stopImmediatePropagation(); } this._console.onConsoleMenuLoaded(); return true; }; ContextMenuController.prototype.onOutputAreaContextMenu = function (e) { this._console.onConsoleBeforeMenuLoaded(); this.showContextMenu(e.clientX, e.clientY); e.preventDefault(); e.stopImmediatePropagation(); this._console.onConsoleMenuLoaded(); return false; }; ContextMenuController.prototype.showContextMenu = function (x, y) { var _this = this; var selectedRow = null; this._selectedItem = null; this._selectedText = toolwindowHelpers.getSelectedText(); if(x <= 0 || y <= 0) { x = 0; y = 0; if(document.activeElement) { this._selectedItem = this._listview.getSelectedItem(); if(this._selectedItem) { selectedRow = this._listview.getSelectedRow(); if(selectedRow) { var rect = selectedRow.getBoundingClientRect(); x = rect.left + 20; y = rect.top + rect.height / 2; } } } } else { this._selectedItem = this._listview.getSelectedItem(); selectedRow = this._listview.getSelectedRow(); } if(!this._contextMenu) { this._menuItems[menuOutputAreaItems.menuConsoleViewAsHtml].disabled = function () { return !_this.CanViewAsHtml(); }; this._menuItems[menuOutputAreaItems.menuConsoleViewAsObject].disabled = function () { return !_this.CanViewAsObject(); }; this._menuItems[menuOutputAreaItems.menuConsoleAddToWatch].disabled = function () { return !_this.CanAddToWatch(); }; this._menuItems[menuOutputAreaItems.menuConsoleAddToWatch].hidden = function () { return !_this.HasAddToWatch(); }; this._menuItems[menuOutputAreaItems.menuConsoleCopy].disabled = function () { return !(_this._selectedText); }; this._menuItems[menuOutputAreaItems.menuConsoleCopyItem].disabled = function () { return !(_this._selectedItem !== null); }; this._menuItems[menuOutputAreaItems.menuConsoleCopyAll].disabled = function () { return !(_this._listview.getItemCount() > 0); }; this._menuItems[menuOutputAreaItems.menuConsoleClear].disabled = function () { return !(_this._listview.getUnfilteredItemCount() > 0); }; this._menuItems[menuOutputAreaItems.menuConsoleFilterErrors].checked = function () { return _this._console.notificationFilters.errors; }; this._menuItems[menuOutputAreaItems.menuConsoleFilterWarnings].checked = function () { return _this._console.notificationFilters.warnings; }; this._menuItems[menuOutputAreaItems.menuConsoleFilterMessages].checked = function () { return _this._console.notificationFilters.messages; }; this._menuItems[menuOutputAreaItems.menuConsoleFilterLog].checked = function () { return _this._console.notificationFilters.log; }; this._menuItems[menuOutputAreaItems.menuConsoleFilterAll].checked = function () { return (_this._console.notificationFilters.errors && _this._console.notificationFilters.warnings && _this._console.notificationFilters.messages && _this._console.notificationFilters.log); }; this._contextMenu = Plugin.ContextMenu.create(this._menuItems, this._menuId, null, null, function (menuId, menuItem) { return _this.onMenuItemClicked(menuId, menuItem.id, _this._selectedItem, selectedRow, _this._selectedText); }); } if(selectedRow) { this._contextMenu.attach(selectedRow); } this._contextMenu.show(parseInt(x.toFixed(0)), parseInt(y.toFixed(0))); }; ContextMenuController.prototype.CanViewAsHtml = function () { if(this._selectedItem && this._selectedItem instanceof Common.ObjectView.TreeViewOutputItem) { var item = (this._selectedItem); return (item.viewableTypeFlags & Common.ObjectView.ViewableTypeFlags.html) === Common.ObjectView.ViewableTypeFlags.html; } return false; }; ContextMenuController.prototype.CanViewAsObject = function () { if(this._selectedItem && this._selectedItem instanceof Common.ObjectView.TreeViewOutputItem) { var item = (this._selectedItem); return (item.viewableTypeFlags & Common.ObjectView.ViewableTypeFlags.object) === Common.ObjectView.ViewableTypeFlags.object; } return false; }; ContextMenuController.prototype.CanAddToWatch = function () { return this._selectedItem && this._selectedItem.getWatchExpression() != undefined; }; ContextMenuController.prototype.HasAddToWatch = function () { return this._console.hasAddToWatch(); }; ContextMenuController.prototype.onMenuItemClicked = function (menuId, itemId, selectedItem, selectedRow, selectedText) { if(menuId === this._menuId) { var menuItems = this._menuItems; switch(itemId) { case menuItems[menuOutputAreaItems.menuConsoleViewAsHtml].id: if(selectedItem && selectedItem instanceof Common.ObjectView.TreeViewOutputItem) { this._console.evaluateItemAsType(selectedItem, Common.ObjectView.ViewableTypeFlags.html); } break; case menuItems[menuOutputAreaItems.menuConsoleViewAsObject].id: if(selectedItem && selectedItem instanceof Common.ObjectView.TreeViewOutputItem) { this._console.evaluateItemAsType(selectedItem, Common.ObjectView.ViewableTypeFlags.object); } break; case menuItems[menuOutputAreaItems.menuConsoleAddToWatch].id: if(selectedItem) { var watchExpression = selectedItem.getWatchExpression(); if(watchExpression != undefined) { this._console.addToWatch(watchExpression); } } break; case menuItems[menuOutputAreaItems.menuConsoleCopy].id: this._console.copySelectionToClipboard(selectedText); break; case menuItems[menuOutputAreaItems.menuConsoleCopyItem].id: this._console.copyItemToClipboard(selectedItem); break; case menuItems[menuOutputAreaItems.menuConsoleCopyAll].id: this._console.copyAll(); break; case menuItems[menuOutputAreaItems.menuConsoleClear].id: this._console.clear(); break; case menuItems[menuOutputAreaItems.menuConsoleFilterErrors].id: this._console.toggleFilter(Common.ObjectView.TreeViewUtils.consoleFilterId.error); break; case menuItems[menuOutputAreaItems.menuConsoleFilterWarnings].id: this._console.toggleFilter(Common.ObjectView.TreeViewUtils.consoleFilterId.warning); break; case menuItems[menuOutputAreaItems.menuConsoleFilterMessages].id: this._console.toggleFilter(Common.ObjectView.TreeViewUtils.consoleFilterId.message); break; case menuItems[menuOutputAreaItems.menuConsoleFilterLog].id: this._console.toggleFilter(Common.ObjectView.TreeViewUtils.consoleFilterId.log); break; case menuItems[menuOutputAreaItems.menuConsoleFilterAll].id: this._console.toggleFilter(Common.ObjectView.TreeViewUtils.consoleFilterId.all, true); break; default: break; } } }; return ContextMenuController; })(); Console.ContextMenuController = ContextMenuController; })(Tools.Console || (Tools.Console = {})); var Console = Tools.Console; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=menus.js.map // console.ts var F12; (function (F12) { "use strict"; (function (Tools) { (function (Console) { var ConsoleWindow = (function () { function ConsoleWindow(hostBridge, diagnosticsBridge) { var _this = this; this._traceWriter = new Common.TraceWriter(); this.traceWriter.raiseEvent(Common.TraceEvents.Console_Window_Create_Start); toolwindowHelpers.registerErrorComponent("Console", this.onError.bind(this)); this._proxy = new Proxy(hostBridge, diagnosticsBridge); this._hostBridge = hostBridge; this._diagnosticsBridge = diagnosticsBridge; this._intellisenseContext = new Common.Intellisense.IntellisenseContext(new Common.Intellisense.InputElementTextEditorBridge(), new Common.Intellisense.IntellisenseMenu("intellisenseListBox", null, null, null, this, this), new Console.ConsoleIntellisenseProvider(this._proxy, this)); this._outputList = document.getElementById("outputList"); this._listview = new Common.ObjectView.ObjectTreeView(this._outputList, function (item) { return _this.onListViewToggle(item); }, null, null, function (item, row, cell) { return _this.onListViewClick(item, row, cell); }); this._inputControl = new Console.Controls.InputControl(function (command) { return _this.processInput(command); }, this._intellisenseContext, function () { return _this._listview.resize(); }); this._contextMenuController = new Console.ContextMenuController(this, this._listview); this._isInitialHandshake = true; this._contextInfo = null; this._notificationCounts = { errors: 0, warnings: 0, messages: 0 }; this._notificationFilters = { errors: true, warnings: true, messages: true, log: true }; this._isShowingLog = this._notificationFilters.log; this._inputItems = []; this._inputItemsMap = { }; this._countItemsMap = { }; this._outputItems = []; this._groupStack = [ new Common.ObjectView.TreeViewGroupItem() ]; this._consoleOutputCallback = function (outputObj) { return _this.onConsoleOutput(outputObj); }; this.initialize(); if(Plugin.F12) { Plugin.F12.Communications.addEventListener("onUnhandledException", function (e) { var info = e[0]; _this.writeError(info.messageId, info.messageText, info.fileName, info.lineNumber, info.columnNumber); }); } else { this._hostBridge.addEventListener("scriptError", function (e) { _this.writeError(e.messageId, e.messageText, e.fileName, e.lineNumber, e.columnNumber); }); } this._hostBridge.addEventListener("toggleFilter", function (e) { return _this.toggleFilter(e.filterIndex); }); this._proxy.initializeProxy(function (msg) { return _this.onMessage(msg); }, function () { return _this.onAttach(); }, function () { return _this.onDetach(); }, function () { return _this.onBreak(); }); toolwindowHelpers.initializeToolWindow(this._hostBridge); this.traceWriter.raiseEvent(Common.TraceEvents.Console_Window_Create_Stop); } Object.defineProperty(ConsoleWindow.prototype, "onConsoleUpdated", { get: function () { return this._onConsoleUpdated; }, set: function (callback) { this._onConsoleUpdated = callback; this._listview.onUpdated = callback; }, enumerable: true, configurable: true }); Object.defineProperty(ConsoleWindow.prototype, "onConsoleBeforeRendering", { get: function () { return this._onConsoleBeforeRendering; }, set: function (callback) { this._onConsoleBeforeRendering = callback; }, enumerable: true, configurable: true }); Object.defineProperty(ConsoleWindow.prototype, "onConsoleRendered", { get: function () { return this._onConsoleRendered; }, set: function (callback) { this._onConsoleRendered = callback; }, enumerable: true, configurable: true }); Object.defineProperty(ConsoleWindow.prototype, "onConsoleReady", { get: function () { return this._onConsoleReady; }, set: function (callback) { this._onConsoleReady = callback; }, enumerable: true, configurable: true }); Object.defineProperty(ConsoleWindow.prototype, "onConsoleBreak", { get: function () { return this._onConsoleBreak; }, set: function (callback) { this._onConsoleBreak = callback; }, enumerable: true, configurable: true }); Object.defineProperty(ConsoleWindow.prototype, "traceWriter", { get: function () { return this._traceWriter; }, enumerable: true, configurable: true }); ConsoleWindow.prototype.initialize = function () { var _this = this; this._warningSection = document.getElementById("warningSection"); this._clearButton = new Common.Controls.Button(document.getElementById("clearButton")); this._errorsButton = new Common.Controls.ToggleButton(document.getElementById("errorsButton")); this._errorsButton.selected = this._notificationFilters.errors; this._warningsButton = new Common.Controls.ToggleButton(document.getElementById("warningsButton")); this._warningsButton.selected = this._notificationFilters.warnings; this._messagesButton = new Common.Controls.ToggleButton(document.getElementById("messagesButton")); this._messagesButton.selected = this._notificationFilters.messages; this._clearButton.click = function () { return _this.clear(); }; this._errorsButton.selectedChanged = function (selected) { return _this.updateNotificationFilter(); }; this._warningsButton.selectedChanged = function (selected) { return _this.updateNotificationFilter(); }; this._messagesButton.selectedChanged = function (selected) { return _this.updateNotificationFilter(); }; this._inputControl.disable(); if(!Plugin.F12) { var toggleButton = document.getElementById("toggleButton"); toggleButton.addEventListener("keydown", function (e) { if(e.keyCode === Common.KeyCodes.TAB && !e.altKey && !e.ctrlKey && !e.shiftKey) { _this._errorsButton.rootElement.focus(); e.preventDefault(); return false; } }); this._errorsButton.rootElement.addEventListener("keydown", function (e) { if(e.keyCode === Common.KeyCodes.TAB && !e.altKey && !e.ctrlKey && e.shiftKey) { toggleButton.focus(); e.preventDefault(); return false; } }); } document.addEventListener("click", function (e) { if(e.target instanceof HTMLElement) { var target = (e.target); if(target.classList.contains("BPT-FileLink")) { _this.openTargetElementFileLink(target); } else if(target.classList.contains("BPT-HelpLink")) { _this.openTargetElementHelpLink(target); } } }, true); document.addEventListener("keydown", function (e) { var handled = false; var target = document.activeElement; if(target) { if(e.keyCode === Common.KeyCodes.F1) { var helpLink = target.querySelector(".BPT-HelpLink"); if(helpLink) { _this.openTargetElementHelpLink(helpLink); e.preventDefault(); } handled = true; } else if(e.keyCode === Common.KeyCodes.ENTER) { var fileLink = target.querySelector(".BPT-FileLink"); if(!fileLink && target.nextElementSibling) { fileLink = target.nextElementSibling.querySelector(".BPT-FileLink"); } if(fileLink) { _this.openTargetElementFileLink(fileLink); e.preventDefault(); } handled = true; } } if(!handled && Plugin.F12) { _this.notifyOnKeydown(e); } }, true); if(Plugin.F12) { var hostInfoChanged = function (info) { var spacer = document.querySelector(".shellButtonSpacer"); var scaledControlAreaWidth = info.controlAreaWidth * (screen.logicalXDPI / screen.deviceXDPI); spacer.style.width = scaledControlAreaWidth + "px"; }; Plugin.F12.addEventListener("hostinfochanged", function (e) { return hostInfoChanged(e); }); hostInfoChanged(Plugin.F12.getHostInfo()); Plugin.F12.addEventListener("browsershortcut", function (e) { if((e.ctrlKey && !e.altKey && !e.shiftKey && e.keyCode === Common.KeyCodes.O) || (e.ctrlKey && e.shiftKey && !e.altKey && e.keyCode === Common.KeyCodes.P)) { _this.notifyOnKeydown(e); } }); } var clearLabel = toolwindowHelpers.loadString("ClearButtonText"); this._clearButton.rootElement.setAttribute("title", clearLabel); var toolLabelText = toolwindowHelpers.loadString("ConsoleToolLabelText"); (document.getElementById("toolLabel")).innerText = toolLabelText; (document.getElementById("warningMessageText")).innerText = toolLabelText; this.updateAllNotificationCounts(); this.resetFilter(); this._listview.onBeforeRendering = function () { _this.onConsoleBeforeRenderingHandler(); }; this._listview.onRendered = function () { _this.onConsoleRenderedHandler(); }; this._listview.onBeforeItemToggle = function () { _this.onConsoleBeforeItemToggled(); }; this._listview.onItemToggled = function () { _this.onConsoleItemToggled(); }; this._listview.onBeforeScroll = function () { _this.onConsoleBeforeScroll(); }; this._listview.onScrollCompleted = function () { _this.onConsoleScrolled(); }; }; ConsoleWindow.prototype.notifyOnKeydown = function (e) { if(Plugin.F12) { Plugin.F12.notifyOnKeydown(e.keyCode, (e.altKey ? Common.KeyFlags.KeyFlags_Alt : Common.KeyFlags.KeyFlags_None) | (e.ctrlKey ? Common.KeyFlags.KeyFlags_Ctrl : Common.KeyFlags.KeyFlags_None) | (e.shiftKey ? Common.KeyFlags.KeyFlags_Shift : Common.KeyFlags.KeyFlags_None)); } }; ConsoleWindow.prototype.openTargetElementFileLink = function (target) { var url = target.getAttribute("data-linkUrl"); var line = target.getAttribute("data-linkLine"); var col = target.getAttribute("data-linkCol"); var lineNumber = 0; if(line) { lineNumber = parseInt(line, 10); } var colNumber = 0; if(col) { colNumber = parseInt(col, 10); } try { url = decodeURI(url); this._hostBridge.openDocumentLink(url, lineNumber, colNumber); } catch (ex) { } }; ConsoleWindow.prototype.openTargetElementHelpLink = function (target) { var keyword = target.getAttribute("data-linkKeyword"); this._hostBridge.openF1HelpLink(keyword); }; ConsoleWindow.prototype.attachButtonEvents = function (button, callback) { button.addEventListener("click", function (e) { callback(e); }); button.addEventListener("keydown", function (e) { if(e.keyCode === Common.KeyCodes.ENTER || e.keyCode === Common.KeyCodes.SPACE) { callback(e); e.preventDefault(); } }); }; ConsoleWindow.prototype.onAttach = function () { this.traceWriter.raiseEvent(Common.TraceEvents.Console_Attach_Start); this.onClearHost(); this._isInitialHandshake = true; try { this._hostBridge.start(); this._diagnosticsBridge.loadScriptInProc("../Common/remoteHelpers.js"); this._diagnosticsBridge.loadScriptInProc("../Common/ObjectView/treeViewUtilities.js"); this._diagnosticsBridge.loadScriptInProc("../Common/ObjectView/treeViewRemoteHelpers.js"); this._diagnosticsBridge.loadScriptInProc("../Common/Intellisense/intellisenseRemoteHelpers.js"); this._diagnosticsBridge.loadScriptInProc("remote.js"); this._diagnosticsBridge.loadScriptInProc("remoteMain.js"); } catch (e) { } this.traceWriter.raiseEvent(Common.TraceEvents.Console_Attach_Stop); }; ConsoleWindow.prototype.onDetach = function () { this.showNotification(Common.ObjectView.TreeViewNotifyType.info, toolwindowHelpers.loadString("OnDetach")); }; ConsoleWindow.prototype.onBreak = function () { if(this.onConsoleBreak) { this.onConsoleBreak(); } }; ConsoleWindow.prototype.onMessage = function (msg) { var _this = this; this.traceWriter.raiseEvent(Common.TraceEvents.Console_Message_Start); window.msWriteProfilerMark("ConsoleWindow:BeginOnMessage"); if(msg.data === "DocumentNotYetReady") { window.setTimeout(function () { try { _this._proxy.remotePort.postMessage("InitializeDocument"); } catch (e) { return; } }, 100); } else if(msg.data.substr(0, 10) === "Handshake:") { var connectionInfo = JSON.parse(msg.data.substring(10)); this.onHandshake(connectionInfo); toolwindowHelpers.codeMarker(toolwindowHelpers.codeMarkers.perfBrowserTools_DiagnosticsToolWindowsConsoleReady); if(this._onConsoleReady) { this._onConsoleReady(); } } else { this._proxy.fireCallbacks(msg.data); } window.msWriteProfilerMark("ConsoleWindow:EndOnMessage"); this.traceWriter.raiseEvent(Common.TraceEvents.Console_Message_Stop); }; ConsoleWindow.prototype.onError = function (message, file, line, additionalInfo) { try { if(file) { var parts = file.split("/"); if(parts.length > 0) { file = parts[parts.length - 1]; } } var errorMessage = toolwindowHelpers.loadString("ConsoleScriptError") + "\r\n" + toolwindowHelpers.loadString("ScriptErrorMessage", [ message ]) + "\r\n" + toolwindowHelpers.loadString("ScriptErrorFile", [ file ]) + "\r\n" + toolwindowHelpers.loadString("ScriptErrorLine", [ line ]) + "\r\n" + additionalInfo; this.showNotification(Common.ObjectView.TreeViewNotifyType.error, errorMessage); } catch (ex) { } }; ConsoleWindow.prototype.onHandshake = function (connectionInfo) { var _this = this; if(this._isInitialHandshake) { this._isInitialHandshake = false; this.showNotification(Common.ObjectView.TreeViewNotifyType.info, toolwindowHelpers.loadString("OnAttach")); this._proxy.callRemote("registerConsoleCallbacks", [ function (outputObj) { return _this.onConsoleOutput(outputObj); }, function (notifyObject) { return _this.onConsoleNotification(notifyObject); }, function () { return _this.onRemoteCleared(); } ]); } this._inputControl.enable(); this._warningSection.style.display = "none"; this._outputList.style.height = "100%"; if(connectionInfo.docMode < 9) { (document.getElementById("warningMessageText")).innerText = toolwindowHelpers.loadString("ConsoleUnsupportedDocumentModeError", connectionInfo.docMode); this._warningSection.style.display = "block"; this._outputList.style.height = "calc(100% - " + this._warningSection.clientHeight + "px)"; } this._contextInfo = connectionInfo.contextInfo; this._countItemsMap = { }; }; ConsoleWindow.prototype.addItemToListView = function (item, linkedTo, linkAsSibling) { var currentGroup = this._groupStack[this._groupStack.length - 1]; if(this._groupStack.length === 1 || this._listview.isItemExpanded(currentGroup) || currentGroup.isFirstUIChildNeeded()) { if(linkedTo && currentGroup.isItemInGroup(linkedTo)) { this._listview.addItems([ item ], linkedTo, linkAsSibling); } else { this._listview.addItems([ item ], currentGroup, false, true); } if(this._listview.isAutoScrollToItemEnabled(item)) { this._listview.selectItem(item, false); this._listview.scrollToBottom(); } } currentGroup.addChild(item); if(this._onConsoleUpdated) { this._onConsoleUpdated([ item ], linkedTo); } }; ConsoleWindow.prototype.onInput = function (command, onCompleteCallback) { if(!this._proxy.remotePort) { this.showNotification(Common.ObjectView.TreeViewNotifyType.warn, toolwindowHelpers.loadString("NotAttached")); return -1; } if((typeof command) !== "string") { return -1; } if(command && (/\S/).test(command)) { if(command === "console.test_exception") { throw ("Test Exception"); } this.traceWriter.raiseEvent(Common.TraceEvents.Console_Input_Start); var inputItem = new Common.ObjectView.TreeViewInputItem(command, onCompleteCallback); this._inputItemsMap[inputItem.id] = inputItem; this.addItemToListView(inputItem); window.msWriteProfilerMark("ConsoleWindow:BeginPostInput"); if(this._proxy.atBreakpoint) { this._proxy.executeBreakModeCommand("processInput", inputItem.consoleItemId, command, this._consoleOutputCallback); } else { this._proxy.callRemote("processInput", [ inputItem.id, command ], this._consoleOutputCallback); } window.msWriteProfilerMark("ConsoleWindow:EndPostInput"); this.traceWriter.raiseEvent(Common.TraceEvents.Console_Input_Stop); this._clearButton.disabled = false; return inputItem.consoleItemId; } return -1; }; ConsoleWindow.prototype.onOutput = function (item) { if(!item) { return; } this.traceWriter.raiseEvent(Common.TraceEvents.Console_Output_Start); var matchingInputItem = null; if(this._inputItemsMap.hasOwnProperty(item.matchingInputId)) { matchingInputItem = this._inputItemsMap[item.matchingInputId]; } this.addItemToListView(item, matchingInputItem, true); if(item instanceof Common.ObjectView.TreeViewNotifyItem) { var notifyItem = item; switch(notifyItem.notifyType) { case Common.ObjectView.TreeViewNotifyType.assert: case Common.ObjectView.TreeViewNotifyType.error: this._notificationCounts.errors++; break; case Common.ObjectView.TreeViewNotifyType.info: this._notificationCounts.messages++; break; case Common.ObjectView.TreeViewNotifyType.warn: this._notificationCounts.warnings++; break; } this.updateNotificationCounts(notifyItem.notifyType); } this._clearButton.disabled = false; if(matchingInputItem) { matchingInputItem.executeCallback(item); } toolwindowHelpers.codeMarker(toolwindowHelpers.codeMarkers.perfBrowserTools_DiagnosticsToolWindowsConsoleEvalEnd); this.traceWriter.raiseEvent(Common.TraceEvents.Console_Output_Stop); }; ConsoleWindow.prototype.onConsoleOutput = function (outputObject) { if(!outputObject) { this.showNotification(Common.ObjectView.TreeViewNotifyType.error, toolwindowHelpers.loadString("ConsoleObjectNotFoundError")); return; } if(Plugin.F12) { Plugin.F12.Communications.fireEvent("consoleOutput", (F12).Host.Impl.PluginId.Debugger); } var outputItem; if(outputObject.detailedType !== "htmlElement") { var matchingInputItem; var watchExpression; if(outputObject.inputId && this._inputItemsMap.hasOwnProperty(outputObject.inputId)) { matchingInputItem = this._inputItemsMap[outputObject.inputId]; watchExpression = "(" + matchingInputItem.getWatchExpression() + ")"; } outputItem = new Common.ObjectView.TreeViewObjectItem(outputObject, null, watchExpression); } else { outputItem = new Common.ObjectView.TreeViewHtmlItem(outputObject); } this.onOutput(outputItem); }; ConsoleWindow.prototype.onConsoleNotification = function (notifyObject) { if(notifyObject.notifyType === Common.ObjectView.TreeViewUtils.consoleNotifyType.internalMessage) { switch(notifyObject.message.key) { case Common.ObjectView.TreeViewUtils.consoleInternalMessage.startGroup: this.startGroup(notifyObject.message.name); break; case Common.ObjectView.TreeViewUtils.consoleInternalMessage.startGroupCollapsed: this.startGroup(notifyObject.message.name, true); break; case Common.ObjectView.TreeViewUtils.consoleInternalMessage.endGroup: this.endGroup(); break; case Common.ObjectView.TreeViewUtils.consoleInternalMessage.displayTraceStyles: this.displayTraceStyles(notifyObject.message.viewableObject); break; } } else if(notifyObject.notifyType === "count") { this.addOrUpdateCountItem(notifyObject); } else { var notifyItem = new Common.ObjectView.TreeViewNotifyItem(notifyObject); this.onOutput(notifyItem); } }; ConsoleWindow.prototype.addOrUpdateCountItem = function (notifyObject) { var newCountItem = new Common.ObjectView.TreeViewCountItem(notifyObject); var name = notifyObject.message.name; if(name === undefined || name === null) { name = "__DefaultCounterIndex__"; } if(this._countItemsMap.hasOwnProperty(name)) { this._countItemsMap[name].value = newCountItem.value; this._listview.refresh(); if(this._onConsoleUpdated) { this._onConsoleUpdated([ this._countItemsMap[name] ]); } } else { this._countItemsMap[name] = newCountItem; this.onOutput(newCountItem); } }; ConsoleWindow.prototype.onClearHost = function () { this._listview.clear(); this._inputItems = []; this._inputItemsMap = { }; this._outputItems = []; this._groupStack = [ new Common.ObjectView.TreeViewGroupItem() ]; this._countItemsMap = { }; this._proxy.callRemote("clearConsoleData"); this._clearButton.disabled = true; this._notificationCounts = { errors: 0, warnings: 0, messages: 0 }; this.updateAllNotificationCounts(); }; ConsoleWindow.prototype.onRemoteCleared = function () { this.onClearHost(); }; ConsoleWindow.prototype.onListViewClick = function (item, row, cell) { if(cell.classList.contains("Console-ExpandableLines") || cell.classList.contains("Console-ExpandableString")) { this.traceWriter.raiseEvent(Common.TraceEvents.Console_HtmlLines_Expand_Start); if(item instanceof Common.ObjectView.TreeViewItem) { var expanded = (item).expandLines(); if(expanded) { this._listview.updateItemLines(item, 1); } } this.traceWriter.raiseEvent(Common.TraceEvents.Console_HtmlLines_Expand_Stop); } }; ConsoleWindow.prototype.startGroup = function (title, isCollapsed) { var currentGroup = this._groupStack[this._groupStack.length - 1]; if(this._groupStack.length > 1 && !this._listview.isItemExpanded(currentGroup)) { isCollapsed = true; } var newGroup = new Common.ObjectView.TreeViewGroupItem(title, isCollapsed); this.addItemToListView(newGroup, currentGroup); this._groupStack.push(newGroup); }; ConsoleWindow.prototype.endGroup = function () { if(this._groupStack.length > 1) { this._groupStack.pop(); } }; ConsoleWindow.prototype.displayTraceStyles = function (styles) { var outputItem = new Common.ObjectView.TreeViewTraceStylesItem({ inputId: "-1", isExpandable: (styles && styles.length > 0), consoleType: "consoleItemOutput", detailedType: "object", isHtmlViewableType: false, name: "", value: styles, uid: "0" }); this.onOutput(outputItem); }; ConsoleWindow.prototype.showNotification = function (type, message) { var notifyObject = { inputId: "-1", notifyType: Common.ObjectView.TreeViewNotifyItem.getNotifyTypeString(type), message: message }; this.onConsoleNotification(notifyObject); }; ConsoleWindow.prototype.updateAllNotificationCounts = function () { this.updateNotificationCounts(Common.ObjectView.TreeViewNotifyType.error); this.updateNotificationCounts(Common.ObjectView.TreeViewNotifyType.info); this.updateNotificationCounts(Common.ObjectView.TreeViewNotifyType.warn); }; ConsoleWindow.prototype.updateNotificationCounts = function (type) { var label; switch(type) { case Common.ObjectView.TreeViewNotifyType.assert: case Common.ObjectView.TreeViewNotifyType.error: (this._errorsButton.rootElement.lastElementChild).innerText = this._notificationCounts.errors.toString(); label = toolwindowHelpers.loadString((this._notificationCounts.errors === 1 ? "SingleError" : "MultiError"), this._notificationCounts.errors); this._errorsButton.tooltip = label; break; case Common.ObjectView.TreeViewNotifyType.info: (this._messagesButton.rootElement.lastElementChild).innerText = this._notificationCounts.messages.toString(); label = toolwindowHelpers.loadString((this._notificationCounts.messages === 1 ? "SingleMessage" : "MultiMessage"), this._notificationCounts.messages); this._messagesButton.tooltip = label; break; case Common.ObjectView.TreeViewNotifyType.warn: (this._warningsButton.rootElement.lastElementChild).innerText = this._notificationCounts.warnings.toString(); label = toolwindowHelpers.loadString((this._notificationCounts.warnings === 1 ? "SingleWarning" : "MultiWarning"), this._notificationCounts.warnings); this._warningsButton.tooltip = label; break; default: break; } }; ConsoleWindow.prototype.updateNotificationFilter = function () { var resetFilter = false; var showingErrors = this._errorsButton.selected; if(this._notificationFilters.errors !== showingErrors) { this._notificationFilters.errors = showingErrors; resetFilter = true; } var showingWarnings = this._warningsButton.selected; if(this._notificationFilters.warnings !== showingWarnings) { this._notificationFilters.warnings = showingWarnings; resetFilter = true; } var showingMessages = this._messagesButton.selected; if(this._notificationFilters.messages !== showingMessages) { this._notificationFilters.messages = showingMessages; resetFilter = true; } var showingLog = this._isShowingLog; if(this._notificationFilters.log !== showingLog) { this._notificationFilters.log = showingLog; resetFilter = true; } if(resetFilter) { this.resetFilter(); } }; ConsoleWindow.prototype.resetFilter = function () { var _this = this; this._listview.setFilter(function (item) { return _this.notificationFilter(item); }); }; ConsoleWindow.prototype.onListViewToggle = function (item) { var _this = this; var objectItem = item; if(objectItem.isExpandable) { objectItem.getChildren(this._proxy, function (children) { _this._listview.addItems(children, item); if(_this._onConsoleUpdated) { _this._onConsoleUpdated(children, item); } }); } }; ConsoleWindow.prototype.copySelectionToClipboard = function (selectedText) { var selectedText = selectedText || toolwindowHelpers.getSelectedText(); if(selectedText) { var compactText = selectedText.replace(/[\r\n]+/g, "\r\n"); clipboardData.setData("Text", compactText); } }; ConsoleWindow.prototype.copyItemToClipboard = function (item) { var text = item.getCopyText(); clipboardData.setData("Text", text); }; ConsoleWindow.prototype.notificationFilter = function (item) { if(item instanceof Common.ObjectView.TreeViewNotifyItem) { var consoleItem = item; if((consoleItem.notifyType === Common.ObjectView.TreeViewNotifyType.error && !this._notificationFilters.errors) || (consoleItem.notifyType === Common.ObjectView.TreeViewNotifyType.assert && !this._notificationFilters.errors) || (consoleItem.notifyType === Common.ObjectView.TreeViewNotifyType.warn && !this._notificationFilters.warnings) || (consoleItem.notifyType === Common.ObjectView.TreeViewNotifyType.info && !this._notificationFilters.messages) || (consoleItem.notifyType === Common.ObjectView.TreeViewNotifyType.log && !this._notificationFilters.log)) { return false; } } return true; }; ConsoleWindow.prototype.copyAll = function () { var _this = this; var text = this._groupStack[0].getCopyText("", function (item) { return _this.notificationFilter(item); }); clipboardData.setData("Text", text); }; ConsoleWindow.prototype.evaluateItemAsType = function (item, viewType) { var _this = this; return item.evaluateAsType(this._proxy, viewType, function (outputObj) { return _this.onConsoleOutput(outputObj); }); }; ConsoleWindow.prototype.addToWatch = function (name) { (Plugin).F12.Debugger.addToWatch(name); }; ConsoleWindow.prototype.hasAddToWatch = function () { return (typeof ((Plugin).F12) != "undefined" && typeof ((Plugin).F12.Debugger) != "undefined" && typeof ((Plugin).F12.Debugger.addToWatch) != "undefined"); }; ConsoleWindow.prototype.processInput = function (command, onCompleteCallback) { toolwindowHelpers.codeMarker(toolwindowHelpers.codeMarkers.perfBrowserTools_DiagnosticsToolWindowsConsoleEvalBegin); return this.onInput(command, onCompleteCallback); }; ConsoleWindow.prototype.writeError = function (messageId, messageText, fileUrl, lineNumber, columnNumber) { lineNumber += 1; columnNumber += 1; if(messageId) { messageText = messageId + ": " + messageText; } var notifyObject = { inputId: "-1", notifyType: Common.ObjectView.TreeViewNotifyItem.getNotifyTypeString(Common.ObjectView.TreeViewNotifyType.error), message: { messageId: messageId, message: messageText, fileUrl: fileUrl, lineNumber: lineNumber, columnNumber: columnNumber } }; this.onConsoleNotification(notifyObject); }; ConsoleWindow.prototype.toggleFilter = function (filterIndex, displayAllShouldDefaultToOn) { if((typeof displayAllShouldDefaultToOn) !== "boolean") { displayAllShouldDefaultToOn = false; } if(filterIndex === Common.ObjectView.TreeViewUtils.consoleFilterId.all) { var onCount = (this._notificationFilters.errors ? 1 : 0) + (this._notificationFilters.warnings ? 1 : 0) + (this._notificationFilters.messages ? 1 : 0) + (this._notificationFilters.log ? 1 : 0); if(onCount === 4 || (onCount > 0 && !displayAllShouldDefaultToOn)) { this._errorsButton.selected = false; this._warningsButton.selected = false; this._messagesButton.selected = false; this._isShowingLog = false; this._notificationFilters = { errors: false, warnings: false, messages: false, log: false }; } else { this._errorsButton.selected = true; this._warningsButton.selected = true; this._messagesButton.selected = true; this._isShowingLog = true; this._notificationFilters = { errors: true, warnings: true, messages: true, log: true }; } this.resetFilter(); } else { switch(filterIndex) { case Common.ObjectView.TreeViewUtils.consoleFilterId.error: this._errorsButton.selected = !this._errorsButton.selected; break; case Common.ObjectView.TreeViewUtils.consoleFilterId.warning: this._warningsButton.selected = !this._warningsButton.selected; break; case Common.ObjectView.TreeViewUtils.consoleFilterId.message: this._messagesButton.selected = !this._messagesButton.selected; break; case Common.ObjectView.TreeViewUtils.consoleFilterId.log: this._isShowingLog = !this._isShowingLog; break; default: return; } this.updateNotificationFilter(); } }; ConsoleWindow.prototype.clear = function () { this.onClearHost(); this._inputControl.focusOnInput(); }; Object.defineProperty(ConsoleWindow.prototype, "notificationFilters", { get: function () { return this._notificationFilters; }, enumerable: true, configurable: true }); Object.defineProperty(ConsoleWindow.prototype, "listView", { get: function () { return this._listview; }, enumerable: true, configurable: true }); Object.defineProperty(ConsoleWindow.prototype, "inputControl", { get: function () { return this._inputControl; }, enumerable: true, configurable: true }); Object.defineProperty(ConsoleWindow.prototype, "intellisenseContext", { get: function () { return this._intellisenseContext; }, enumerable: true, configurable: true }); Object.defineProperty(ConsoleWindow.prototype, "atBreakpoint", { get: function () { return this._proxy.atBreakpoint; }, enumerable: true, configurable: true }); ConsoleWindow.prototype.onConsoleBeforeMenuLoaded = function () { this.traceWriter.raiseEvent(Common.TraceEvents.Console_Context_Menu_Loading_Start); }; ConsoleWindow.prototype.onConsoleMenuLoaded = function () { this.traceWriter.raiseEvent(Common.TraceEvents.Console_Context_Menu_Loading_Stop); }; ConsoleWindow.prototype.onConsoleBeforeRenderingHandler = function () { this.traceWriter.raiseEvent(Common.TraceEvents.Console_Output_Render_Start); if(this._onConsoleBeforeRendering) { this._onConsoleBeforeRendering(); } }; ConsoleWindow.prototype.onConsoleRenderedHandler = function () { this.traceWriter.raiseEvent(Common.TraceEvents.Console_Output_Render_Stop); if(this._onConsoleRendered) { this._onConsoleRendered(); } }; ConsoleWindow.prototype.onConsoleBeforeItemToggled = function () { this.traceWriter.raiseEvent(Common.TraceEvents.Console_Item_Toggle_Start); }; ConsoleWindow.prototype.onConsoleItemToggled = function () { this.traceWriter.raiseEvent(Common.TraceEvents.Console_Item_Toggle_Stop); }; ConsoleWindow.prototype.onConsoleBeforeScroll = function () { this.traceWriter.raiseEvent(Common.TraceEvents.Console_Scroll_Start); }; ConsoleWindow.prototype.onConsoleScrolled = function () { this.traceWriter.raiseEvent(Common.TraceEvents.Console_Scroll_Stop); }; ConsoleWindow.prototype.fireBuildListBoxStartEvent = function () { this.traceWriter.raiseEvent(Common.TraceEvents.Console_Intellisense_ListBox_Build_Start); }; ConsoleWindow.prototype.fireBuildListBoxEndEvent = function () { this.traceWriter.raiseEvent(Common.TraceEvents.Console_Intellisense_ListBox_Build_Stop); }; ConsoleWindow.prototype.fireResetListBoxStartEvent = function () { this.traceWriter.raiseEvent(Common.TraceEvents.Console_Intellisense_ListBox_Reset_Start); }; ConsoleWindow.prototype.fireResetListBoxEndEvent = function () { this.traceWriter.raiseEvent(Common.TraceEvents.Console_Intellisense_ListBox_Reset_Stop); }; ConsoleWindow.prototype.fireSetFilterStartEvent = function () { this.traceWriter.raiseEvent(Common.TraceEvents.Console_Intellisense_Menu_Filter_Start); }; ConsoleWindow.prototype.fireSetFilterEndEvent = function () { this.traceWriter.raiseEvent(Common.TraceEvents.Console_Intellisense_Menu_Filter_Stop); }; ConsoleWindow.prototype.fireUpdateLayoutStartEvent = function () { this.traceWriter.raiseEvent(Common.TraceEvents.Console_Intellisense_Menu_Layout_Start); }; ConsoleWindow.prototype.fireUpdateLayoutEndEvent = function () { this.traceWriter.raiseEvent(Common.TraceEvents.Console_Intellisense_Menu_Layout_Stop); }; return ConsoleWindow; })(); Console.ConsoleWindow = ConsoleWindow; })(Tools.Console || (Tools.Console = {})); var Console = Tools.Console; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=console.js.map // app.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var F12; (function (F12) { "use strict"; (function (Tools) { (function (Console) { var ConsoleApp = (function (_super) { __extends(ConsoleApp, _super); function ConsoleApp() { _super.apply(this, arguments); } ConsoleApp.prototype.onStartup = function () { var _this = this; window.setImmediate(function () { toolwindowHelpers.registerThemeChange(_this.hostBridge, [ "console.css", "../common/ObjectView/objectTreeView.css" ], true); }); Plugin.addEventListener("pluginready", function () { _this.console = new Console.ConsoleWindow(_this.hostBridge, _this.diagnosticsBridge); if(_this.onConsoleAppLoaded) { _this.onConsoleAppLoaded(); } }); }; return ConsoleApp; })(Common.App); Console.App = new ConsoleApp(); })(Tools.Console || (Tools.Console = {})); var Console = Tools.Console; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=app.js.map { "start_url": "Console\\console.html", "domain": "http://microsoft.com", "name":"Console", "version":"1.0", "f12": { "start_url": "console.html", "localized_tab_resource": "ConsoleToolLabelText", "localized_tooltip_id": 813, "tab_image": "tabIcon.png", "resource_aliases" : { "Common": { "is_default" : true } }, "themed_images": { "plugin-console-image-icon-input": { "bitmap_source": "images\\i_console-input.png", "background_color": "plugin-font-console-background-color" }, "plugin-console-image-icon-output": { "bitmap_source": "images\\i_console-output.png", "background_color": "plugin-font-console-background-color" }, "plugin-console-image-icon-error": { "bitmap_source": "images\\i_error.png", "background_color": "plugin-font-console-background-color" }, "plugin-console-image-icon-info": { "bitmap_source": "images\\i_info.png", "background_color": "plugin-font-console-background-color" }, "plugin-console-image-icon-warning": { "bitmap_source": "images\\i_warning.png", "background_color": "plugin-font-console-background-color" }, "plugin-console-image-icon-button-multi": { "bitmap_source": "images\\i_toggle-multi.png", "background_color": "plugin-font-console-background-color" }, "plugin-console-image-icon-button-single": { "bitmap_source": "images\\i_toggle-single.png", "background_color": "plugin-font-console-background-color" }, "plugin-console-image-icon-button-clear": { "bitmap_source": "images\\i_delete.png", "background_color": "plugin-font-console-background-color" }, "plugin-console-image-icon-button-info": { "bitmap_source": "images\\i_info.png", "background_color": "plugin-font-console-background-color" }, "plugin-console-image-icon-button-warn": { "bitmap_source": "images\\i_warning.png", "background_color": "plugin-font-console-background-color" }, "plugin-console-image-icon-button-error": { "bitmap_source": "images\\i_error.png", "background_color": "plugin-font-console-background-color" }, "plugin-console-image-icon-button-execute": { "bitmap_source": "images\\i_execute.png", "background_color": "plugin-font-console-background-color" }, "plugin-console-image-icon-button-clear-input": { "bitmap_source": "images\\i_clear-input.png", "background_color": "plugin-font-console-background-color" }, "plugin-image-icon-item-collapsed": { "bitmap_source": "..\\Common\\itemCollapsedIcon.png", "background_color": "plugin-font-console-background-color" }, "plugin-image-icon-item-expanded": { "bitmap_source": "..\\Common\\itemExpandedIcon.png", "background_color": "plugin-font-console-background-color" } } }, "vs": { "resource_aliases" : { "Common": { "type" : "Embedded", "name" : "Microsoft.VisualStudio.WebClient.Diagnostics.HtmlToolHost", "path" : "Microsoft.VisualStudio.WebClient.Diagnostics.HtmlToolHost.Resources", "is_default" : true } }, "theme_token_aliases": { "plugin-font-console-color": { "category": "2AA714AE-53BE-4393-84E0-DC95B57A1891", "key_type": "ForegroundColor", "name": "Plain Text" }, "plugin-font-console-background-color": { "category": "2AA714AE-53BE-4393-84E0-DC95B57A1891", "key_type": "BackgroundColor", "name": "Plain Text" }, "plugin-font-console-input-color": { "category": "2AA714AE-53BE-4393-84E0-DC95B57A1891", "key_type": "ForegroundColor", "name": "Console Input Text" }, "plugin-font-console-input-background-color": { "category": "2AA714AE-53BE-4393-84E0-DC95B57A1891", "key_type": "BackgroundColor", "name": "Console Input Text" }, "plugin-font-console-output-color": { "category": "2AA714AE-53BE-4393-84E0-DC95B57A1891", "key_type": "ForegroundColor", "name": "Console Output Text" }, "plugin-font-console-output-background-color": { "category": "2AA714AE-53BE-4393-84E0-DC95B57A1891", "key_type": "BackgroundColor", "name": "Console Output Text" }, "plugin-font-console-error-color": { "category": "2AA714AE-53BE-4393-84E0-DC95B57A1891", "key_type": "ForegroundColor", "name": "Console Error Text" }, "plugin-font-console-error-background-color": { "category": "2AA714AE-53BE-4393-84E0-DC95B57A1891", "key_type": "BackgroundColor", "name": "Console Error Text" }, "plugin-font-console-info-color": { "category": "2AA714AE-53BE-4393-84E0-DC95B57A1891", "key_type": "ForegroundColor", "name": "Console Info Text" }, "plugin-font-console-info-background-color": { "category": "2AA714AE-53BE-4393-84E0-DC95B57A1891", "key_type": "BackgroundColor", "name": "Console Info Text" }, "plugin-font-console-warning-color": { "category": "2AA714AE-53BE-4393-84E0-DC95B57A1891", "key_type": "ForegroundColor", "name": "Console Warning Text" }, "plugin-font-console-warning-background-color": { "category": "2AA714AE-53BE-4393-84E0-DC95B57A1891", "key_type": "BackgroundColor", "name": "Console Warning Text" }, "plugin-font-editor-color": { "category": "2AA714AE-53BE-4393-84E0-DC95B57A1891", "key_type": "ForegroundColor", "name": "Plain Text" }, "plugin-font-editor-background-color": { "category": "2AA714AE-53BE-4393-84E0-DC95B57A1891", "key_type": "BackgroundColor", "name": "Plain Text" }, "plugin-font-editor-keyword-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "ForegroundColor", "name": "Keyword" }, "plugin-font-editor-keyword-background-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "BackgroundColor", "name": "Keyword" }, "plugin-font-editor-string-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "ForegroundColor", "name": "String" }, "plugin-font-editor-string-background-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "BackgroundColor", "name": "String" }, "plugin-font-editor-number-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "ForegroundColor", "name": "Number" }, "plugin-font-editor-number-background-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "BackgroundColor", "name": "Number" }, "plugin-font-editor-symbol-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "ForegroundColor", "name": "SymbolDefinitionClassificationFormat" }, "plugin-font-editor-symbol-background-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "BackgroundColor", "name": "SymbolDefinitionClassificationFormat" }, "plugin-font-editor-html-tag-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "ForegroundColor", "name": "HTML Tag Delimiter" }, "plugin-font-editor-html-tag-background-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "BackgroundColor", "name": "HTML Tag Delimiter" }, "plugin-font-editor-html-element-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "ForegroundColor", "name": "HTML Element Name" }, "plugin-font-editor-html-element-background-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "BackgroundColor", "name": "HTML Element Name" }, "plugin-font-editor-html-comment-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "ForegroundColor", "name": "HTML Comment" }, "plugin-font-editor-html-comment-background-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "BackgroundColor", "name": "HTML Comment" }, "plugin-font-editor-html-attribute-name-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "ForegroundColor", "name": "HTML Attribute" }, "plugin-font-editor-html-attribute-name-background-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "BackgroundColor", "name": "HTML Attribute" }, "plugin-font-editor-html-attribute-value-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "ForegroundColor", "name": "HTML Attribute Value" }, "plugin-font-editor-html-attribute-value-background-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "BackgroundColor", "name": "HTML Attribute Value" }, "plugin-font-editor-html-operator-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "ForegroundColor", "name": "HTML Operator" }, "plugin-font-editor-html-operator-background-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "BackgroundColor", "name": "HTML Operator" }, "plugin-font-editor-css-name-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "ForegroundColor", "name": "CSS Property Name" }, "plugin-font-editor-css-name-background-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "BackgroundColor", "name": "CSS Property Name" }, "plugin-font-editor-css-value-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "ForegroundColor", "name": "CSS Property Value" }, "plugin-font-editor-css-value-background-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "BackgroundColor", "name": "CSS Property Value" }, "plugin-font-editor-css-selector-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "ForegroundColor", "name": "CSS Selector" }, "plugin-font-editor-css-selector-background-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "BackgroundColor", "name": "CSS Selector" }, "plugin-font-editor-inactive-selected-background-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "BackgroundColor", "name": "Inactive Selected Text" }, "plugin-font-editor-selected-background-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "BackgroundColor", "name": "Selected Text" }, "plugin-font-editor-selected-border-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "ForegroundColor", "name": "outlining.collapsehintadornment" }, "plugin-environment-background-gradient-begin": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "EnvironmentBackgroundGradientBegin" }, "plugin-filetab-hot-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "FileTabHotText" }, "plugin-filetab-inactive-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "FileTabInactiveText" }, "plugin-filetab-inactive-gradient-top-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "FileTabInactiveGradientTop" }, "plugin-filetab-hot-gradient-top-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "FileTabHotGradientTop" }, "plugin-filetab-selected-gradient-top-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "FileTabSelectedGradientTop" }, "plugin-filetab-selected-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "FileTabSelectedText" }, "plugin-commandbar-gradient-begin-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "CommandBarGradientBegin" }, "plugin-vertical-resize-grip-middle-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "VerticalResizeGripMiddle" }, "plugin-font-current-line-active-format-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "ForegroundColor", "name": "CurrentLineActiveFormat" }, "plugin-font-current-line-inactive-format-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "ForegroundColor", "name": "CurrentLineInactiveFormat" }, "plugin-font-editor-current-statement-background-color": { "category": "ff349800-ea43-46c1-8c98-878e78f46501", "key_type": "BackgroundColor", "name": "Current Statement" }, "plugin-font-editor-current-statement-color": { "category": "ff349800-ea43-46c1-8c98-878e78f46501", "key_type": "ForegroundColor", "name": "Current Statement" }, "f12-intellisense-hover-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "MenuText" }, "f12-intellisense-hover-background-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "Menu" }, "f12-intellisense-checked-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "HighlightText" }, "f12-intellisense-checked-background-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "Highlight" }, "vs-horizontal-resize-grip-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "HorizontalResizeGrip" }, "f12-toolbar-background-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "CommandBarGradientBegin" }, "f12-toolbar-button-selected-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "CommandBarSelected" }, "f12-toolbar-button-selected-border-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "CommandBarSelectedBorder" }, "f12-toolbar-button-selected-text-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "CommandBarTextSelected" }, "f12-toolbar-button-hover-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "CommandBarMouseOverBackgroundBegin" }, "f12-toolbar-button-hover-text-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "CommandBarTextHover" }, "f12-toolbar-button-border-hover-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "CommandBarBorder" }, "f12-toolbar-button-pressed-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "CommandBarMouseDownBackgroundBegin" } }, "themed_images": { "plugin-console-image-icon-input": { "bitmap_source": "Console\\images\\i_console-input.png", "background_color": "plugin-font-console-background-color" }, "plugin-console-image-icon-output": { "bitmap_source": "Console\\images\\i_console-output.png", "background_color": "plugin-font-console-background-color" }, "plugin-console-image-icon-error": { "bitmap_source": "Console\\images\\i_error.png", "background_color": "plugin-font-console-background-color" }, "plugin-console-image-icon-info": { "bitmap_source": "Console\\images\\i_info.png", "background_color": "plugin-font-console-background-color" }, "plugin-console-image-icon-warning": { "bitmap_source": "Console\\images\\i_warning.png", "background_color": "plugin-font-console-background-color" }, "plugin-console-image-icon-button-multi": { "bitmap_source": "Console\\images\\i_toggle-multi.png", "background_color": "plugin-font-console-background-color" }, "plugin-console-image-icon-button-single": { "bitmap_source": "Console\\images\\i_toggle-single.png", "background_color": "plugin-font-console-background-color" }, "plugin-console-image-icon-button-clear": { "bitmap_source": "Console\\images\\i_delete.png", "background_color": "plugin-font-console-background-color" }, "plugin-console-image-icon-button-info": { "bitmap_source": "Console\\images\\i_info.png", "background_color": "plugin-font-console-background-color" }, "plugin-console-image-icon-button-warn": { "bitmap_source": "Console\\images\\i_warning.png", "background_color": "plugin-font-console-background-color" }, "plugin-console-image-icon-button-error": { "bitmap_source": "Console\\images\\i_error.png", "background_color": "plugin-font-console-background-color" }, "plugin-image-icon-item-collapsed": { "bitmap_source": "Common\\itemCollapsedIcon.png", "background_color": "plugin-background-color" }, "plugin-image-icon-item-expanded": { "bitmap_source": "Common\\itemExpandedIcon.png", "background_color": "plugin-background-color" }, "plugin-console-image-icon-button-execute": { "bitmap_source": "Console\\images\\i_execute.png", "background_color": "plugin-font-console-background-color" }, "plugin-console-image-icon-button-clear-input": { "bitmap_source": "Console\\images\\i_clear-input.png", "background_color": "plugin-font-console-background-color" } } }, "file_aliases": { "PerformanceTraceExtension": { "path": "PerformanceTrace.dll", "optional": true } } } var F12; (function (F12) { "use strict"; (function (Tools) { (function (Console) { var RemoteCode = (function () { function RemoteCode() { this.maxItemTraverseCount = 500; this.defaultTimerName = "default"; this.consoleNotificationQueue = []; this.currentWindowContext = null; this.resultMap = { }; this.consoleTimers = { }; this.consoleCounters = { }; this.consoleDefaultCounter = 0; } RemoteCode.prototype.initialize = function () { if(typeof browser !== 'undefined') { Common.RemoteHelpers.addListener(browser, 'beforeScriptExecute', remoteCode.onBeforeScriptExecute); Common.RemoteHelpers.addListener(browser, "consoleMessage", function (e) { remoteCode.onConsoleMessage(e.source, e.level, e.messageId, e.messageText, e.fileUrl, e.line, e.column); }); } remoteHelpers.initialize("ConsolePort", remoteCode.initializePage, "__BROWSERTOOLS_CONSOLE_BREAKMODE_FUNC"); this.initializeWebWorkers(); }; RemoteCode.prototype.addNodeRemovedEventListener = function (documentWindow) { if(Common.RemoteHelpers.getDocumentMode() > 8) { if(Common.RemoteHelpers.getDefaultView(mainBrowser.document) === documentWindow) { var safeRemover = Common.RemoteHelpers.addSafeListener(documentWindow, mainBrowser.document, "DOMNodeRemoved", remoteCode.onDomNodeRemoved, true); remoteCode.removeNodeRemovedEventListener(); remoteCode.onMainWindowNodeRemovedSafeEventListener = safeRemover; } } }; RemoteCode.prototype.removeNodeRemovedEventListener = function () { if(remoteCode.onMainWindowNodeRemovedSafeEventListener) { Common.RemoteHelpers.removeListener(mainBrowser.document, "DOMNodeRemoved", remoteCode.onMainWindowNodeRemovedSafeEventListener, true); remoteCode.onMainWindowNodeRemovedSafeEventListener = null; } }; RemoteCode.prototype.onDomNodeRemoved = function (e) { if(e && e.target && e.target.nodeName === "IFRAME") { if(e.target.contentWindow === remoteCode.currentWindowContext) { remoteCode.onConsoleFunc("cd", { argsCount: 0 }, true); } remoteCode.constructors = null; } }; RemoteCode.getInstance = function getInstance() { return remoteCode; }; Object.defineProperty(RemoteCode.prototype, "suppressPostCode", { get: function () { return "suppressOutput-{9724EC8B-E0A8-4B3B-94CB-AB1F31CB47DB}"; }, enumerable: true, configurable: true }); RemoteCode.prototype.initializePage = function () { var defaultView = remoteCode.currentWindowContext = Common.RemoteHelpers.getDefaultView(mainBrowser.document); try { browser.executeScript("(function () { })();", defaultView); } catch (e) { remoteCode.onDocumentNotReady(); return; } try { remoteCode.initializeConsoles(defaultView); var connectionInfo = { docMode: Common.RemoteHelpers.getDocumentMode(), contextInfo: defaultView.location.href }; remoteHelpers.port.postMessage("Handshake:" + JSON.stringify(connectionInfo)); remoteHelpers.initializeDocumentTries = 0; remoteCode.consoleCounters = { }; remoteCode.consoleDefaultCounter = 0; } catch (e) { } }; RemoteCode.prototype.onDocumentNotReady = function () { try { setTimeout(function () { remoteHelpers.port.postMessage("DocumentNotYetReady"); remoteHelpers.initializeDocumentTries = Math.min(100, remoteHelpers.initializeDocumentTries + 1); }, remoteHelpers.initializeDocumentMaxTries * 100); } catch (e) { } }; RemoteCode.prototype.initializeConsoles = function (realWindow) { try { remoteCode.initializeConsole(realWindow); } catch (e) { } remoteCode.addNodeRemovedEventListener(realWindow); if(realWindow.frames) { for(var i = 0, len = realWindow.frames.length; i < len; i++) { var frame = realWindow.frames[i]; if(frame && Common.RemoteHelpers.isWindow(frame)) { var iframe = dom.getCrossSiteWindow(realWindow, frame); if(iframe) { remoteCode.initializeConsoles(iframe); } } } } }; RemoteCode.prototype.defineInjectedConsoleObjFunction = function (injectedConsole, consoleObj, realWindow, functionName, func) { consoleObj[functionName] = remoteHelpers.createSafeFunction(realWindow, func); injectedConsole[functionName] = consoleObj[functionName]; }; RemoteCode.prototype.initializeConsole = function (realWindow) { var consoleObj = realWindow.console; var injectedConsole = { }; var unloadHandler = function () { Common.RemoteHelpers.removeListener(toolUI, "detach", detachHandler); }; var detachHandler = function () { remoteCode.onDetach(realWindow, injectedConsole); Common.RemoteHelpers.removeListener(toolUI, "detach", detachHandler); }; Common.RemoteHelpers.addListener(toolUI, "detach", detachHandler); if(!remoteCode.unloadSafe) { remoteCode.unloadSafe = Common.RemoteHelpers.addSafeListener(realWindow, realWindow, "unload", unloadHandler); } realWindow.__BROWSERTOOLS_CONSOLE_BREAKMODE_FUNC = remoteHelpers.createSafeFunction(realWindow, function (id, data) { remoteCode.onBreakModeFunc(id, data); }); var $func = function () { return window.document.getElementById.apply(window.document, arguments); }; var $$func = function () { return window.document.querySelectorAll.apply(window.document, arguments); }; var scriptFor$ = "window.__BROWSERTOOLS_CONSOLE = {};" + "window.__BROWSERTOOLS_CONSOLE.$ = " + $func.toString() + ";" + "window.__BROWSERTOOLS_CONSOLE.$$ = " + $$func.toString() + ";"; scriptFor$ = JSON.stringify(scriptFor$).slice(1, -1); browser.executeScript(scriptFor$, realWindow); realWindow.__BROWSERTOOLS_CONSOLE.performBreakmodeIntellisense = browser.createSafeFunction(realWindow, function (id, expression, windowContext) { remoteCode.performBreakmodeIntellisense(id, expression, windowContext); }); if(!consoleObj && typeof (console) !== "undefined") { consoleObj = realWindow.console = console; } else if((!realWindow.console) && (typeof (console) === "undefined")) { if(realWindow["eval"]) { realWindow["eval"]("{ document.parentWindow['console'] = {};}"); } else { realWindow["execScript"]("{ document.parentWindow['console'] = {};}"); } consoleObj = realWindow.console; } if(consoleObj.log === undefined) { this.defineInjectedConsoleObjFunction(injectedConsole, consoleObj, realWindow, "log", function (msg) { remoteCode.onConsoleFunc(Common.ObjectView.TreeViewUtils.consoleNotifyType.log, msg); }); } if(consoleObj.info === undefined) { this.defineInjectedConsoleObjFunction(injectedConsole, consoleObj, realWindow, "info", function (msg) { remoteCode.onConsoleFunc(Common.ObjectView.TreeViewUtils.consoleNotifyType.info, msg); }); } if(consoleObj.warn === undefined) { this.defineInjectedConsoleObjFunction(injectedConsole, consoleObj, realWindow, "warn", function (msg) { remoteCode.onConsoleFunc(Common.ObjectView.TreeViewUtils.consoleNotifyType.warn, msg); }); } if(consoleObj.error === undefined) { this.defineInjectedConsoleObjFunction(injectedConsole, consoleObj, realWindow, "error", function (msg) { remoteCode.onConsoleFunc(Common.ObjectView.TreeViewUtils.consoleNotifyType.error, msg); }); } if(consoleObj.assert === undefined) { this.defineInjectedConsoleObjFunction(injectedConsole, consoleObj, realWindow, "assert", function (test, msg) { if(!test) { remoteCode.onConsoleFunc(Common.ObjectView.TreeViewUtils.consoleNotifyType.assert, msg); } }); } this.defineInjectedConsoleObjFunction(injectedConsole, consoleObj, realWindow, "time", function (name) { remoteCode.createConsoleTimer(name); }); this.defineInjectedConsoleObjFunction(injectedConsole, consoleObj, realWindow, "timeEnd", function (name) { remoteCode.endConsoleTimer(name); }); this.defineInjectedConsoleObjFunction(injectedConsole, consoleObj, realWindow, "group", function (name) { remoteCode.startGroup(name, false); }); this.defineInjectedConsoleObjFunction(injectedConsole, consoleObj, realWindow, "groupCollapsed", function (name) { remoteCode.startGroup(name, true); }); this.defineInjectedConsoleObjFunction(injectedConsole, consoleObj, realWindow, "groupEnd", function () { remoteCode.endGroup(); }); if(Common.RemoteHelpers.getDocumentMode() >= 10) { var trace = function () { var stackTrace = (function () { try { throw new Error(""); } catch (ex) { return ex.stack; } })(); var messages = stackTrace ? stackTrace.split("\n") : ""; messages.splice(0, 3); console.log("console.trace()\n" + messages.join("\n")); }; var scriptForTrace = "console.trace = " + trace.toString(); scriptForTrace = JSON.stringify(scriptForTrace).slice(1, -1); browser.executeScript(scriptForTrace, realWindow); injectedConsole["trace"] = consoleObj["trace"]; } else { this.defineInjectedConsoleObjFunction(injectedConsole, consoleObj, realWindow, "trace", function () { remoteCode.onConsoleFunc(Common.ObjectView.TreeViewUtils.consoleNotifyType.warn, { localizeId: "ConsoleUnsupportedDocumentModeAPIError", args: [ String(Common.RemoteHelpers.getDocumentMode()), String("console.trace") ] }); }); } this.defineInjectedConsoleObjFunction(injectedConsole, consoleObj, realWindow, "clear", function () { remoteCode.onConsoleFunc("clear"); return remoteCode.suppressPostCode; }); this.defineInjectedConsoleObjFunction(injectedConsole, consoleObj, realWindow, "dir", function (obj) { remoteCode.onConsoleFunc("dir", obj); }); this.defineInjectedConsoleObjFunction(injectedConsole, consoleObj, realWindow, "dirxml", function (obj) { remoteCode.onConsoleFunc("dirxml", obj); }); this.defineInjectedConsoleObjFunction(injectedConsole, consoleObj, realWindow, "debug", function (msg) { try { remoteCode.onConsoleFunc(Common.ObjectView.TreeViewUtils.consoleNotifyType.log, msg.toString()); } catch (e) { remoteCode.onConsoleFunc(Common.ObjectView.TreeViewUtils.consoleNotifyType.error, e); } }); this.defineInjectedConsoleObjFunction(injectedConsole, consoleObj, realWindow, "count", function (obj) { remoteCode.count(obj); }); this.defineInjectedConsoleObjFunction(injectedConsole, consoleObj, realWindow, "countReset", function (obj) { remoteCode.countReset(obj); }); this.defineInjectedConsoleObjFunction(injectedConsole, consoleObj, realWindow, "cd", function (obj) { remoteCode.onConsoleFunc("cd", { obj: obj, argsCount: arguments.length }); }); if(consoleObj.select === undefined || (consoleObj.select && consoleObj.select.toString && consoleObj.select.toString() === "\nfunction select() {\n [native code]\n}\n")) { this.defineInjectedConsoleObjFunction(injectedConsole, consoleObj, realWindow, "select", function (obj) { remoteCode.consoleSelectNotInitialized(); }); } }; RemoteCode.prototype.initializeWebWorkers = function () { Common.RemoteHelpers.addListener(browser, "webWorkerCreated", remoteCode.onWebWorkerCreated); var workerBreakmodeFunc = function (id, data) { try { if(!data.isError) { if(data.result) { if(typeof data.result === 'object') { data.result = data.result.toString(); } else { data.result = data.result; } } } (diagnostics).postMessage('breakmode_func', JSON.stringify({ id: id, data: data })); } catch (e) { (diagnostics).postMessage('breakmode_func', JSON.stringify({ id: id, data: { isError: true, result: e } })); } }; var breakModeFunction = "worker.worker.__BROWSERTOOLS_CONSOLE_BREAKMODE_FUNC = worker.createSafeFunction(worker.worker, " + workerBreakmodeFunc.toString() + ");"; browser.workerStartupScript = breakModeFunction; var workers = browser.workers; for(var id in workers) { workers[id].addEventListener("message", this.onWorkerMessage); workers[id].executeScriptAsync(breakModeFunction, "breakmode_func"); } }; RemoteCode.prototype.onWorkerMessage = function (e) { if(e.type && e.type === "breakmode_func" && e.message) { var message = JSON.parse(e.message); remoteCode.onBreakModeFunc(message.id, message.data); } }; RemoteCode.prototype.onWebWorkerCreated = function (e) { var workers = browser.workers; if(e.id && workers[e.id]) { workers[e.id].addEventListener("message", remoteCode.onWorkerMessage); } }; RemoteCode.prototype.onBeforeScriptExecute = function (dispatchWindow) { if(dispatchWindow && dispatchWindow.browserOrWindow) { dispatchWindow = dispatchWindow.browserOrWindow; } var realWindow; try { realWindow = dispatchWindow.document.parentWindow; } catch (ex) { return; } if(realWindow === mainBrowser.document.parentWindow) { remoteCode.currentWindowContext = realWindow; if(remoteHelpers.port) { remoteHelpers.postAllMessages(); remoteCode.initializePage(); } } else { try { var currentWindow = remoteCode.currentWindowContext.document.parentWindow; } catch (e) { remoteCode.currentWindowContext = realWindow; } remoteCode.initializeConsoles(realWindow); } remoteCode.ensureConstructorsAreAvailable(true); }; RemoteCode.prototype.onDetach = function (realWindow, injectedConsole) { remoteHelpers.initializeDocumentTries = 0; Common.RemoteHelpers.removeListener(browser, 'beforeScriptExecute', remoteCode.onBeforeScriptExecute); remoteCode.removeNodeRemovedEventListener(); try { if(realWindow.console) { var functionsNotRemoved = 0; for(var prop in injectedConsole) { if(realWindow.console[prop] === injectedConsole[prop]) { if(Common.RemoteHelpers.getDocumentMode() < 9) { realWindow.console[prop] = null; } else { delete realWindow.console[prop]; } } else { functionsNotRemoved++; } } if(functionsNotRemoved === 0) { var deleteConsole = true; for(var i in realWindow.console) { if(realWindow.console[i]) { deleteConsole = false; break; } } if(deleteConsole) { delete realWindow.console; } } } if(realWindow.__BROWSERTOOLS_CONSOLE_BREAKMODE_FUNC) { delete realWindow.__BROWSERTOOLS_CONSOLE_BREAKMODE_FUNC; } if(remoteCode.unloadSafe) { Common.RemoteHelpers.removeListener(realWindow, "unload", remoteCode.unloadSafe); remoteCode.unloadSafe = null; } } catch (ex) { } injectedConsole = null; }; RemoteCode.prototype.callInvoker = function (win, input) { if(!win.execScript) { var evalString = win.eval.toString(); if(evalString !== "\nfunction eval() {\n [native code]\n}\n" && remoteCode.notifyCallback) { remoteCode.onConsoleFunc(Common.ObjectView.TreeViewUtils.consoleNotifyType.error, { localizeId: "ModifiedEvalFunction" }); remoteHelpers.isEvalModified = true; } } var returnValue = { result: undefined, isError: false }; var inlineConsole = []; try { if((typeof win.cd) === 'undefined') { win.cd = win.console.cd; inlineConsole.push({ name: 'cd', func: win.console.cd }); } if((typeof win.dir) === 'undefined') { win.dir = win.console.dir; inlineConsole.push({ name: 'dir', func: win.console.dir }); } if((typeof win.select) === 'undefined') { win.select = win.console.select; inlineConsole.push({ name: 'select', func: win.console.select }); } if((typeof win.$) === 'undefined') { win.$ = win.__BROWSERTOOLS_CONSOLE.$; inlineConsole.push({ name: '$', func: win.$ }); } if((typeof win.$$) === 'undefined') { win.$$ = win.__BROWSERTOOLS_CONSOLE.$$; inlineConsole.push({ name: '$$', func: win.$$ }); } if(win.__BROWSERTOOLS_DOMEXPLORER_STORED_ELEMENTS) { for(var i = 0; i <= 4; i++) { if((typeof win["$" + i]) === 'undefined') { win["$" + i] = win.__BROWSERTOOLS_DOMEXPLORER_STORED_ELEMENTS[i]; inlineConsole.push({ name: "$" + i, func: win["$" + i] }); } } } var escapedInput = JSON.stringify(input).slice(1, -1); try { returnValue.result = browser.executeScript(escapedInput, win); } catch (e) { returnValue.result = win.document.__IE_DEVTOOLBAR_CONSOLE_EVAL_RESULT; returnValue.isError = true; } } catch (invokerEx) { returnValue = { result: undefined, isError: false }; } for(var i = 0; i < inlineConsole.length; i++) { if(win[inlineConsole[i].name] === inlineConsole[i].func) { if(Common.RemoteHelpers.getDocumentMode() < 9) { win[inlineConsole[i].name] = undefined; } else { delete win[inlineConsole[i].name]; } } } return returnValue; }; RemoteCode.prototype.onConsoleMessage = function (source, level, messageId, messageText, fileUrl, lineNumber, columnNumber) { if(source === "HTML" && messageId === 1300) { if(remoteCode.clearCallback) { remoteCode.reset(); remoteCode.clearCallback(); } } if(source === "CONSOLE") { switch(messageId) { case 6000: remoteCode.onConsoleFunc(Common.ObjectView.TreeViewUtils.consoleNotifyType.log, messageText, true); return; case 6001: remoteCode.onConsoleFunc(Common.ObjectView.TreeViewUtils.consoleNotifyType.warn, messageText, true); return; case 6002: if(messageText === "ConsoleSelectError") { remoteCode.onConsoleFunc(Common.ObjectView.TreeViewUtils.consoleNotifyType.error, { localizeId: messageText }); } else { remoteCode.onConsoleFunc(Common.ObjectView.TreeViewUtils.consoleNotifyType.error, messageText, true); } return; case 6003: remoteCode.onConsoleFunc(Common.ObjectView.TreeViewUtils.consoleNotifyType.assert, messageText, true); return; case 6004: remoteCode.onConsoleFunc(Common.ObjectView.TreeViewUtils.consoleNotifyType.info, messageText, true); return; } } var messageIdentifier = source + messageId; var data = { messageId: messageIdentifier, message: messageIdentifier + ": " + messageText, fileUrl: fileUrl, lineNumber: lineNumber, columnNumber: columnNumber }; switch(level) { case 0: remoteCode.onConsoleFunc(Common.ObjectView.TreeViewUtils.consoleNotifyType.info, data); break; case 1: remoteCode.onConsoleFunc(Common.ObjectView.TreeViewUtils.consoleNotifyType.warn, data); break; case 2: remoteCode.onConsoleFunc(Common.ObjectView.TreeViewUtils.consoleNotifyType.error, data); break; } }; RemoteCode.prototype.onConsoleFunc = function (functionId, data, postMessageImmediately) { switch(functionId) { case "cd": if(remoteCode.notifyCallback) { try { var iframe; if(data.argsCount === 0) { iframe = mainBrowser.document.parentWindow; } else { iframe = dom.getCrossSiteWindow(remoteCode.currentWindowContext, data.obj); } remoteCode.currentWindowContext = iframe; var newWindowContext = iframe.location.href; var newWindowText = iframe.location.hostname + iframe.location.pathname; newWindowText = String.prototype.replace.call(newWindowText, /\/$/, ""); remoteCode.notifyCallback({ notifyType: "consoleItemCDContext", message: newWindowText, contextInfo: newWindowContext }); } catch (e) { remoteCode.notifyCallback({ notifyType: Common.ObjectView.TreeViewUtils.consoleNotifyType.error, message: (e.message || e.description) }); } } break; case "clear": if(remoteCode.clearCallback) { remoteCode.reset(); remoteCode.clearCallback(); } break; case "dir": if(remoteCode.outputCallback) { var returnObj = remoteCode.createOutputObject(-1, data); if(returnObj.detailedType !== "undefined") { remoteCode.outputCallback(returnObj); } } break; case "dirxml": if(remoteCode.outputCallback) { var htmlTypeName = remoteCode.getHtmlViewableTypeName(data); if(htmlTypeName !== null) { var returnObj = remoteCode.createOutputHtmlElement(-1, data, htmlTypeName); } else { var returnObj = remoteCode.createOutputObject(-1, data); } if(returnObj.detailedType !== "undefined") { remoteCode.outputCallback(returnObj); } } break; default: if(!remoteCode.notifyCallback) { remoteCode.consoleNotificationQueue.push({ functionId: functionId, data: data }); } else { remoteCode.notifyCallback({ notifyType: functionId, message: data }, null, postMessageImmediately); } break; } }; RemoteCode.prototype.onBreakModeFunc = function (id, data) { if(id === "") { remoteHelpers.processMessages({ data: data }); } else { var parts = id.split(":"); if(parts.length === 3) { var funcName = parts[0]; var inputId = parseInt(parts[1], 10); var uid = parts[2]; var returnValue; if(funcName === "processInput") { returnValue = remoteCode.createConsoleResult(inputId, data); } if(returnValue && returnValue.suppressPostObject) { return; } if(returnValue !== undefined) { remoteHelpers.postObject({ uid: uid, args: [ returnValue ] }); } } } }; RemoteCode.prototype.ensureConstructorsAreAvailable = function (forceCreate) { if(!remoteCode.constructors || forceCreate) { var mainWindow = Common.RemoteHelpers.getDefaultView(browser.document); remoteCode.constructors = remoteCode.getAllConstructors(mainWindow); } }; RemoteCode.prototype.getAllConstructors = function (root) { var constructors = []; constructors.push(remoteCode.getWindowConstructors(root)); if(root.frames && root.frames.length > 0) { for(var i = 0; i < root.frames.length; i++) { if(Common.RemoteHelpers.isWindow(root.frames[i])) { constructors = constructors.concat(remoteCode.getAllConstructors(dom.getCrossSiteWindow(root, root.frames[i]))); } } } return constructors; }; RemoteCode.prototype.getWindowConstructors = function (win) { var windowConstructors = { }; try { windowConstructors.array = (new win.Array()).constructor; windowConstructors.date = (new win.Date()).constructor; windowConstructors.regex = (new win.RegExp()).constructor; windowConstructors.htmlElement = win.HTMLElement; windowConstructors.htmlNode = win.Node; windowConstructors.nodeList = win.NodeList; windowConstructors.htmlCollection = win.HTMLCollection; } catch (e) { } return windowConstructors; }; RemoteCode.prototype.getHtmlViewableTypeName = function (obj) { remoteCode.ensureConstructorsAreAvailable(); if(remoteCode.constructors && Common.RemoteHelpers.getDocumentMode() >= 9) { for(var i = 0; i < remoteCode.constructors.length; i++) { if(remoteCode.constructors[i].htmlElement && (obj instanceof remoteCode.constructors[i].htmlElement)) { return "HtmlElement"; } else if(remoteCode.constructors[i].htmlNode && (obj instanceof remoteCode.constructors[i].htmlNode)) { var nodeType; try { nodeType = obj.nodeType; } catch (e) { return null; } if(nodeType === obj.DOCUMENT_NODE) { return "DocumentNode"; } else if(nodeType === obj.ATTRIBUTE_NODE) { return "AttributeNode"; } else { return "HtmlNode"; } } else if(remoteCode.constructors[i].nodeList && (obj instanceof remoteCode.constructors[i].nodeList)) { return "NodeList"; } else if(remoteCode.constructors[i].htmlCollection && (obj instanceof remoteCode.constructors[i].htmlCollection)) { return "HtmlCollection"; } } } return null; }; RemoteCode.prototype.createConsoleResult = function (inputId, evaluatedReturnValue) { var consoleObject; if(evaluatedReturnValue.isError) { if(remoteCode.notifyCallback) { consoleObject = { inputId: inputId, notifyType: Common.ObjectView.TreeViewUtils.consoleNotifyType.error }; if(evaluatedReturnValue.result) { if(evaluatedReturnValue.result.message && evaluatedReturnValue.result.name) { consoleObject.message = { message: evaluatedReturnValue.result.message, localizeId: evaluatedReturnValue.result.name }; } else { consoleObject.message = evaluatedReturnValue.result.message || evaluatedReturnValue.result.description || evaluatedReturnValue.result.toString(); } remoteCode.notifyCallback(consoleObject); } else { consoleObject["suppressPostObject"] = true; } } } else { mainBrowser.document.parentWindow.msWriteProfilerMark("ConsoleRemote:BeginCreateResultObject"); var htmlTypeName = remoteCode.getHtmlViewableTypeName(evaluatedReturnValue.result); if(htmlTypeName !== null && htmlTypeName !== "DocumentNode") { consoleObject = remoteCode.createOutputHtmlElement(inputId, evaluatedReturnValue.result, htmlTypeName); } else { consoleObject = remoteCode.createOutputObject(inputId, evaluatedReturnValue.result); if(htmlTypeName === "DocumentNode") { consoleObject.isHtmlViewableType = true; } } mainBrowser.document.parentWindow.msWriteProfilerMark("ConsoleRemote:EndCreateResultObject"); } if(evaluatedReturnValue && (evaluatedReturnValue.isError || evaluatedReturnValue.result === remoteCode.suppressPostCode)) { consoleObject["suppressPostObject"] = true; } return consoleObject; }; RemoteCode.prototype.createOutputHtmlElement = function (inputId, element, htmlTypeName) { var name; try { name = Object.prototype.toString.call(element); } catch (e) { name = null; } var value = htmlTreeHelpers.createMappedNode(element, true); if(htmlTypeName === "NodeList" || htmlTypeName === "HtmlCollection") { value.tag = htmlTypeName; htmlTreeHelpers.mapping[value.uid].listType = htmlTypeName; value.attributes = [ { name: "length", value: element.length } ]; } return { inputId: inputId, consoleType: "consoleItemOutput", detailedType: "htmlElement", isExpandable: true, isHtmlViewableType: true, name: name, value: value, uid: 0 }; }; RemoteCode.prototype.createOutputObject = function (inputID, obj, propertyName, isInternal) { var treeViewObjectExplorer; if(Common.RemoteHelpers.getDocumentMode() >= 9) { treeViewObjectExplorer = new Common.ObjectView.TreeViewRemoteObjectExplorer(this); } else { treeViewObjectExplorer = new Common.ObjectView.TreeViewDirectObjectExplorer(); } var treeViewRemoteHelper = new Common.ObjectView.TreeViewRemoteHelpers(this, treeViewObjectExplorer); remoteCode.ensureConstructorsAreAvailable(); return treeViewRemoteHelper.createOutputObject(inputID, obj, propertyName, isInternal); }; RemoteCode.prototype.getTimeStamp = function () { var timeStamp; if(mainBrowser.document.parentWindow.performance.now) { timeStamp = mainBrowser.document.parentWindow.performance.now(); } else { timeStamp = new Date(); } return timeStamp; }; RemoteCode.prototype.createConsoleTimer = function (name) { if(!name) { name = remoteCode.defaultTimerName; } if(remoteCode.consoleTimers.hasOwnProperty(name) && remoteCode.consoleTimers[name]) { remoteCode.onConsoleFunc(Common.ObjectView.TreeViewUtils.consoleNotifyType.warn, { localizeId: "ConsoleTimerWarning", args: [ String(name) ] }); } else { remoteCode.consoleTimers[name] = this.getTimeStamp(); } }; RemoteCode.prototype.endConsoleTimer = function (name) { var time = this.getTimeStamp(); if(!name) { name = remoteCode.defaultTimerName; } if(remoteCode.consoleTimers.hasOwnProperty(name) && remoteCode.consoleTimers[name]) { time = time - remoteCode.consoleTimers[name]; delete remoteCode.consoleTimers[name]; remoteCode.onConsoleFunc(Common.ObjectView.TreeViewUtils.consoleNotifyType.log, { localizeId: "ConsoleTimerDisplay", args: [ String(name), time.toFixed(4) ] }); } else { remoteCode.onConsoleFunc(Common.ObjectView.TreeViewUtils.consoleNotifyType.warn, { localizeId: "NonExistentConsoleTimerWarning", args: [ String(name) ] }); } }; RemoteCode.prototype.count = function (name) { if(name === undefined || name === null) { remoteCode.consoleDefaultCounter = remoteCode.consoleDefaultCounter + 1; remoteCode.onConsoleFunc("count", { name: null, message: remoteCode.consoleDefaultCounter.toString() }); } else { var newCount = 1; if(remoteCode.consoleCounters.hasOwnProperty(name) && remoteCode.consoleCounters[name] !== null) { newCount = remoteCode.consoleCounters[name] + 1; } remoteCode.consoleCounters[name] = newCount; remoteCode.onConsoleFunc("count", { name: String(name), message: newCount.toString() }); } }; RemoteCode.prototype.countReset = function (name) { if(name === undefined || name === null) { remoteCode.consoleDefaultCounter = 0; remoteCode.onConsoleFunc("count", { name: null, message: remoteCode.consoleDefaultCounter.toString() }); } else { remoteCode.consoleCounters[name] = 0; remoteCode.onConsoleFunc("count", { name: String(name), message: remoteCode.consoleCounters[name].toString() }); } }; RemoteCode.prototype.endGroup = function () { remoteCode.onConsoleFunc(Common.ObjectView.TreeViewUtils.consoleNotifyType.internalMessage, { key: Common.ObjectView.TreeViewUtils.consoleInternalMessage.endGroup }); }; RemoteCode.prototype.startGroup = function (groupName, isCollapsed) { groupName = groupName ? String(groupName) : ""; var groupType = isCollapsed ? Common.ObjectView.TreeViewUtils.consoleInternalMessage.startGroupCollapsed : Common.ObjectView.TreeViewUtils.consoleInternalMessage.startGroup; remoteCode.onConsoleFunc(Common.ObjectView.TreeViewUtils.consoleNotifyType.internalMessage, { key: groupType, name: groupName }); }; RemoteCode.prototype.consoleSelectNotInitialized = function () { remoteCode.onConsoleFunc(Common.ObjectView.TreeViewUtils.consoleNotifyType.error, { localizeId: "ConsoleSelectNotInitializedError" }); }; RemoteCode.prototype.reset = function () { remoteHelpers.uid = 0; remoteCode.resultMap = { }; htmlTreeHelpers.reset(); }; RemoteCode.prototype.performBreakmodeIntellisense = function (id, expression, windowContext) { if(typeof id !== "string" || typeof expression !== "string") { return; } var parts = id.split(":"); if(parts.length === 3) { var funcName = parts[0]; var inputId = parseInt(parts[1], 10); var uid = parts[2]; var results = remoteCode.getIntellisenseItemsForExpression(expression, windowContext); remoteHelpers.postObject({ uid: uid, args: [ results ] }); } }; RemoteCode.prototype.getIntellisenseItemsForExpression = function (expression, windowContext) { var intellisenseSupported = (Common.RemoteHelpers.getDocumentMode() >= 9); if(intellisenseSupported) { var intellisenseRemoteHelper = new Common.Intellisense.IntellisenseRemoteHelpers(remoteCode); var result; if(windowContext) { result = intellisenseRemoteHelper.getIntellisenseItemsForExpressionUsingWindowContext(expression, windowContext); } else { result = intellisenseRemoteHelper.getIntellisenseItemsForExpression(expression); } return result; } else { return { choices: [] }; } }; return RemoteCode; })(); Console.RemoteCode = RemoteCode; var StyleUtilities = (function () { function StyleUtilities() { this.styleMapping = { }; } StyleUtilities.prototype.getAppliedStyles = function (element) { if(element.msGetRulesApplied) { return element.msGetRulesApplied(); } var ret; if(remoteHelpers.isDiagnosticsOM()) { ret = remoteHelpers.getAppliedStyles(element); return remoteHelpers.getAppliedStyles(element); } else { ret = styleHelper.GetAppliedStyles(element); } return ret; }; StyleUtilities.prototype.getPropertyEnabled = function (curStyle, property) { if(curStyle.msGetPropertyEnabled) { return curStyle.msGetPropertyEnabled(property); } if(remoteHelpers.isDiagnosticsOM()) { return true; } return styleHelper.GetPropertyEnabled(curStyle, property); }; StyleUtilities.prototype.setPropertyEnabled = function (curStyle, propertyName, enable) { if(curStyle.msPutPropertyEnabled) { curStyle.msPutPropertyEnabled(propertyName, enable); } else { if(remoteHelpers.isDiagnosticsOM()) { } else { styleHelper.SetPropertyEnabled(curStyle, propertyName, enable); } } }; return StyleUtilities; })(); Console.StyleUtilities = StyleUtilities; var MessageHandlers = (function () { function MessageHandlers() { } MessageHandlers.prototype.clearConsoleData = function () { remoteCode.reset(); }; MessageHandlers.prototype.registerConsoleCallbacks = function (outputCallback, notifyCallback, clearCallback) { remoteCode.outputCallback = outputCallback; remoteCode.notifyCallback = notifyCallback; remoteCode.clearCallback = clearCallback; for(var i = 0; i < remoteCode.consoleNotificationQueue.length; i++) { var notification = remoteCode.consoleNotificationQueue[i]; remoteCode.onConsoleFunc(notification.functionId, notification.data); } }; MessageHandlers.prototype.processInput = function (inputId, input) { if(!remoteCode.currentWindowContext) { return; } try { mainBrowser.document.parentWindow.msWriteProfilerMark("ConsoleRemote:BeginConsoleInvoke"); } catch (ex) { return; } var returnValue = remoteCode.callInvoker(remoteCode.currentWindowContext, input); mainBrowser.document.parentWindow.msWriteProfilerMark("ConsoleRemote:EndConsoleInvoke"); return remoteCode.createConsoleResult(inputId, returnValue); }; MessageHandlers.prototype.getObjectChildren = function (identifier) { var delimiterIndex = identifier.indexOf(":"); if(delimiterIndex !== -1) { var parts = []; parts.push(identifier.substr(0, delimiterIndex)); parts.push(identifier.substr(delimiterIndex + 1)); var uid = parts[0].split("#"); var mappedResult = remoteCode.resultMap[uid[0]]; if(mappedResult) { return remoteCode.createOutputObject(-1, mappedResult, parts[1], uid.length === 2); } } return null; }; MessageHandlers.prototype.getHtmlChildren = function (uid) { var mappedNode = htmlTreeHelpers.mapping[uid]; if(!mappedNode || !htmlTreeHelpers.isElementAccessible(mappedNode.ele)) { return; } var htmlTypeName = remoteCode.getHtmlViewableTypeName(mappedNode.ele); var showEmptyTextNodes = (htmlTypeName === "NodeList"); return htmlTreeHelpers.getChildrenForMappedNode(uid, showEmptyTextNodes); }; MessageHandlers.prototype.getHtmlAttributes = function (uid) { var mappedNode = htmlTreeHelpers.mapping[uid]; if(!mappedNode || !htmlTreeHelpers.isElementAccessible(mappedNode.ele)) { return; } var allAttributes = []; var element = mappedNode.ele; if(element.attributes) { for(var i = 0; i < element.attributes.length; i++) { allAttributes.push({ name: element.attributes[i].name, value: element.attributes[i].value }); } } return allAttributes; }; MessageHandlers.prototype.getObjectItemAsHtml = function (identifier) { var mappedItem = null; var parts = identifier.split(":", 2); if(parts.length === 2) { var mappedParent = remoteCode.resultMap[parts[0]]; if(mappedParent) { mappedItem = mappedParent[parts[1]]; } } else if(parts.length === 1) { mappedItem = remoteCode.resultMap[identifier]; } if(mappedItem) { return remoteCode.createOutputHtmlElement(-1, mappedItem, remoteCode.getHtmlViewableTypeName(mappedItem)); } return null; }; MessageHandlers.prototype.getHtmlItemAsObject = function (uid) { var mappedNode = htmlTreeHelpers.mapping[uid]; if(!mappedNode || !htmlTreeHelpers.isElementAccessible(mappedNode.ele)) { return null; } return remoteCode.createOutputObject(-1, mappedNode.ele); }; MessageHandlers.prototype.getIntellisenseItemsForExpression = function (expression) { return remoteCode.getIntellisenseItemsForExpression(expression); }; return MessageHandlers; })(); Console.MessageHandlers = MessageHandlers; var styleUtilities = new StyleUtilities(); })(Tools.Console || (Tools.Console = {})); var Console = Tools.Console; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=remote.js.map var remoteHelpers; var remoteCode; (function () { "use strict"; remoteHelpers = new Common.RemoteHelpers(new F12.Tools.Console.MessageHandlers()); remoteCode = new F12.Tools.Console.RemoteCode(); remoteCode.initialize(); })(); //@ sourceMappingURL=remoteMain.js.map PNG  IHDR@] cHRMz%u0`:o_F pHYsod5IDATx^=F bcG l;8-|c7qQ*=~ n-?$}H$I$I$I$I$I$I$I$I$Iʼ2s 5///lCM/L6`mAblCMof s`j0CS6 Gwf 7T3P9S 5azXPm)؆԰ =aPX(oZ/ff0](oZ7~yc3TAyXh@Yr.7~k<,Y9Lk卵_|X UP,Pփ 卵_گu>ob*( m(AӅگ@yc:7~1C6 Byczkk BzBAP^%(y4P>!!P ee5At HQ/J)zBY }Ezp& xF/tjϗ3TAyO/G(A "4~6[/A\P_G`uCYr\(<ԾGƋ@%hXAy\zV; ݅6h|5ZƇ?\@`xPЇ9 0Kxp?•Go+Pg#Vߡ9Z(4O9j MSpW7G`CYrt/?fr]~aCYr% UP~^/Vݡ9.!_h=PV#Ct Ї~~1C+ Zy主PІY~AY 1( 3B@t H,Vߡ9n.Z~BY 1(/yϗ3TAyC-:ء9n.je52DǠ硆_hxC-ء9n.~$(i %tƏGC_XPփw r| -(i ؖ |3TAo(AӅگ@yc:7~1C6 Byczkk Bztk=PX獵_Pae=aPX(oZ/ff0](oZ7~yc3TAyXh@Yr.7~k<,Y9Lk卵_|X UP,PփBlCM;PP9S 5azXPm)؆԰ =]Ym L6rlC fhj؆.,6j`jz9g 345l#I$I$I$I$I$I$I$I$I$I uwIENDB`PNG  IHDRH5gAMA a pHYsktEXtSoftwareAdobe ImageReadyqe<OIDATXGXۑ0$8~~ *^!!\< B$[|#{dُ53=t xZ ֍tڝf^e(wZBd7JHWr{$" -;D ']A2 Jpɬ_o›xU2x`rC_Fm'Y1+Y~ZtIENDB`PNG  IHDRagAMA a pHYs(JtEXtSoftwarePaint.NET v3.5.100rIDAT8O͒1 0tPDܝKxoo"x;v̐cб[F!~4E yy//m6 Ն>SXEqS4Xy?4uK M"kX67u]N)blXvY9,\/@ly[߲Ω~$-*۔w}]@D+xQ #E07E0!y (zY50 IENDB`PNG  IHDR$l gAMA|Q cHRMR@}y<s,٩<9SbL!GĈ 3,F0+7T3IlpX"61"H _qW,d ėrIKst.ښAdp&+g]RәY2EE44432PuoJEzg`̉j- -b8o׿M]9La.+-%Mȧg3YះuAxEK i<:ŹPcu*@~(  ]o0 ~y*s7g%9%(3H*@C`-pn VH@ A1 jPA3hA'8΃Kn`Lg` a!2D!H҇ dAP B Byf*z: @]h ~L CUp΅ p%;56< ?" GxG iE>&2 oQEGlQP UFFuzQ7QcYG4G۠t]nB/o'Я1 xb"1I>Lf3bX} *QYvGĩp( &q x)&gsF|7:~@&h!$&B%pH$D.q#xx8F|K!\H$!i.%L";r3EHK-AFCbH$^RSIrdd 3Rx)-))zR#RsiSiT#Wd2Z2n2l2d)EBaQ6S))T UEMSPgeedɆfȞ!4--VJ;N g%K-sɵݖ{'OwO%)P_RRۥEK/+))U<د8䡔TtAiF쨜\|FyZbU)W9.Kw+YUEUOUjꂚZZZCu:C=^\G}VCEO#OE&^WOs^K[+\kV֔vv[]n>z^^u}XROm`m3h01$:fь|:kG23hbabhrT4ߴw3=3Y-s.q_vǂbgբ⃥%߲rJ*֪jAe0JOY6rvvtXLǎl&I']$NϝM.6.\ι"En2nnn[g=,=t٪E2}4\j5loDŽǞ~q=''Z^utv&vvEv >mяN9-{ LOgsΝK?7s>xOL n\x }N}g/]>uɫ,u[dS@u]7ot.<30tKn]p;;SwSyoEV Ob+Cnooo 385|3`g 15el+Ϸe'7"FWT,(3 lq\E-1cEbb6fi"$K<< Vu(Zܦwek`Q("a >1 hQ3/rX3!e?Cb(ks^ FQ}1ƕx܁YSJ<5xR!_y (& xѕΒ%Osj[~#7YPb朗ngWT,qTE FTJ&j_M=n!Jfh!̬(o;(F jUhCp"6#Ç?E*z1PZ1:SʬʃcbڶLAzKi%6:I$cU.lj<:]VTTTTu4MsDS3K?2!oD cb(>!Lw1y~:K4?Fط3 O"poeK &,kFȱwE̛-Y`*O:IPDSA\Xl+O˫ ڠZL~E˜^RMQo>`K Ws!eW}%7;|oEq,ZdF bObA٫VA;Bhfӛ~-j|!H18)ʃsֵE~5NC$Q[Vybr0]eb_aѱQ!r*i,N61JC rvryƳyAȵa1;2l|Qޕt[%pnSlx]q.IOh%e(٘.[Bh4gJzferrCvWR`hrU0'ki'WYEb9R~]tw`8#P}}ttEQpB0bv7NA awA[P ` F *a F J9U  dj`âq) F BJ#¨J#.&>c >@|ux`.3%˕EU`ɑikrGX֤*4 4>USnNdžX|?9;*"޶@M+tckH91qMsѽ>`2lVRCInj:#zSdtAȵaX6|%KcHWnSlx]q.IOgggh%eD(.[Bh4gJzferꛛ=dg|Ko4*Uo݄L;*èa<Ȼ*nőb( ᡾\mk FAw?bv7NA awA[P ` F *a F J9U  dj`âq) F BJ#¨J#.&>c >@u7ԫ2`MrxcU`ɑiXI9²&uWѠ|d񡨒Ƨt[p?6] cA#IENDB`PNG  IHDRH5tEXtSoftwareAdobe ImageReadyqe<fiTXtXML:com.adobe.xmp ~#IDATxAj0Dv#7Ⱥ`k4#G0mzYw#J/)* F+~،b{M;pu{xJcok2otI mB|.EdsQ5.En?EeYry\V"_j.ZJE1(6E\:EMs`|IENDB`PNG  IHDR$l  cHRMz%u0`:o_F pHYskIDAThC;n#GE-f 'd@Df p Z>QP 8w ۊdky~C8Ⱦ걪>-nkhcj;еņͼdT'_T-jT`='Z%SK[LY2,^,B>X0=lȞLV gI=钶.JRo]ݻ_^vΗoُ_!vnN j\+Mi2Xb;FFe?O T*]Xky )@u2|Dt wAk6˫f`>-$]Wr{V;C]Xm\C"_{JHi,sL)SYJR /%$)bxȔ|!4!{$s BnOQ:&H agOQO"_i|n#/W۟D.43] I/v"h1O>V{IV^]R"(Z I=Z3i]h|/y3{9 !}ŁZMjz?Xx׻J{WWW1@zeWf;N҂Z#7YJ*h_ֲJATb=$n1eƬ;tww^ or3d- ufxlQ:^?C֎4rހGaɲ誶aup) bxKYn)bx*KYBdJDRfuDHi47/I =FDV7bJ"_^\% /@x;k4u vB"̜u$9yעGr* fbT,BG>X@V ;!H #a\D镰&! I nzJ ה>""SkfSaSaϩx^b#'kXF{MoדIENDB`PNG  IHDRw= pHYs+ cHRMz%u0`:o_FIDATxԕ 0 Q`V`=CBFaHPPdgmJ)L_!/̼X)#<x͢E"T V9QYK"p 9hD2²\3MGQn503φ]*jM[ֻ#"m4KCD{: n#mńEN)/99 m9p<+BbŹ5N dRҨ,O0IENDB`PNG  IHDR$l  cHRMz%u0`:o_F pHYskIDAThCm0D];-!b-v*I+p )!%ȇ7Z;Hx!}JR؃/>R;www0e'777(1X_ӭ>A؎^m--1;FK);F3KxǎQג׎Q^߯f {fb{f6OGLlc)u8jfd3KxXQ33Y|w8jXm I~9j(*s̜bKX,]|\s)+/); for(var l = 0; l < selectorParts.length; l++) { var selectorPart = selectorParts[l]; var dotIndex = selectorPart.indexOf("."); while(dotIndex !== -1) { var endOfClassIndex = CssInformationExtractor.findEndOfClass(selectorPart, dotIndex); if(endOfClassIndex === -1) { newCssClass = selectorPart.substring(dotIndex + 1); if(newCssClass !== "") { cssClassSet[newCssClass] = true; } dotIndex = -1; } else { newCssClass = selectorPart.substring(dotIndex + 1, endOfClassIndex + 1); if(newCssClass) { cssClassSet[newCssClass] = true; } dotIndex = selectorPart.indexOf(".", dotIndex + 1); } } } } }; CssInformationExtractor.extractClassNamesFromClassAttributes = function extractClassNamesFromClassAttributes(elementSource, cssClassSet) { var nodes = elementSource.querySelectorAll("[class]"); for(var i = 0; i < nodes.length; i++) { var htmlElement = nodes.item(i); var classList = htmlElement.classList; if(!classList) { var className = htmlElement.className; if(className) { var view = Common.RemoteHelpers.getDefaultView(mainBrowser.document); if(view && view.SVGAnimatedString && className instanceof view.SVGAnimatedString) { var animatedValue = className; className = animatedValue.baseVal; if(animatedValue.baseVal != animatedValue.animVal) { className += " " + animatedValue.animVal; } } if(className && className.split) { var classNames = String.prototype.split.call(className, /\s+/); for(var classNameIndex = 0; classNameIndex < classNames.length; classNameIndex++) { var className = classNames[classNameIndex]; cssClassSet[className] = true; } } } } else { for(var j = 0; j < classList.length; j++) { var cssClass = classList.item(j); cssClassSet[cssClass] = true; } } } }; CssInformationExtractor.findEndOfClass = function findEndOfClass(selectorPart, dotIndex) { var sub = selectorPart.substring(dotIndex + 1); var endIndex = String.prototype.search.call(sub, /[\.#\[:>\~]/); if(endIndex === -1) { return -1; } return endIndex + dotIndex; }; return CssInformationExtractor; })(); DomExplorer.CssInformationExtractor = CssInformationExtractor; })(F12.DomExplorer || (F12.DomExplorer = {})); var DomExplorer = F12.DomExplorer; })(F12 || (F12 = {})); //@ sourceMappingURL=cssInformationExtractor.js.map #allStylesButton { float: right; border: 1px solid transparent; margin: 0px; padding: 0px; } #allStylesButton.BPT-ToolbarToggleButton-StateOn { border-color: TRANSPARENT; /*[{f12-toolbar-button-selected-border-color}]*/ } #allStylesButton.BPT-ToolbarToggleButton-StateOn .allStylesButton { background-position-y: -18px; } .allStylesButton { background-image: url('images/i_just_my_code.png'); /*[url({plugin-image-icon-dom-explorer-show-all-styles})]*/ background-size: 18px 54px; background-repeat: no-repeat; } .BPT-ComputedStyle-PropertyName { color:TRANSPARENT; /* [{plugin-font-editor-html-attribute-name-color}] */ -ms-grid-column: 2; } .BPT-ComputedStyle-HeaderColon { -ms-grid-column: 3; } .BPT-ComputedStyle-Color { border: solid black 1px; margin: 2px; padding:0px; width:11px; height: 11px; -ms-grid-column: 4; } .BPT-ComputedStyle-PropertyValue { -ms-grid-column: 5; } .BPT-ComputedStyle-FileReference { float: right; } .BPT-ComputedStyle-Filter { float: left; } .BPT-ComputedStyle-Filter-InputText { margin: 2px; font-size: 9pt; font-family: "Segoe UI", Arial, sans-serif; /*[{plugin-font-family} , Arial, sans-serif]*/ } .BPT-ComputedStyle-AllStyles { float: right; margin-top: 3px; } .BPT-ComputedStyle-AllStyles-Text { float: right; margin-top: 1px; font-family: "Segoe UI", Arial, sans-serif; /*[{plugin-font-family} , Arial, sans-serif]*/ } .BPT-ComputedStyle-AllStyles-CheckBox { float: right; } .BPT-ComputedStyle-NotWinning { text-decoration: line-through; } #computedStylesNoResultsMessage { clear: both; margin-left: 6px; } #computedStylesView .BPT-ExpandingList-Header { display: -ms-grid; -ms-grid-columns: 17px auto 8px auto 1fr; } #computedStylesView .BPT-HTML-Tag { color: TRANSPARENT; /*[{plugin-font-editor-css-selector-color}]*/ }var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var Dom; (function (Dom) { var ComputedStyleView = (function (_super) { __extends(ComputedStyleView, _super); function ComputedStyleView(_domExplorer, htmlElementSource, computedStyleViewDivId, defaultItemTemplateId, model, alternateTemplates) { _super.call(this, htmlElementSource, computedStyleViewDivId, defaultItemTemplateId, model, function (uniqueId, expanded) { model.setExpansionState(uniqueId, expanded); }, alternateTemplates, null, "uniqueId", "propertyName"); this._domExplorer = _domExplorer; } ComputedStyleView._propertyNameClass = "BPT-ComputedStyle-PropertyName"; ComputedStyleView._propertyValueClass = "BPT-ComputedStyle-PropertyValue"; ComputedStyleView._filterTextBoxId = "computedStylesFilterTextBox"; ComputedStyleView.allStylesButtonId = "allStylesButton"; ComputedStyleView.bptToolbarToggleButtonStateOn = "BPT-ToolbarToggleButton-StateOn"; ComputedStyleView.noResultsMessageId = "computedStylesNoResultsMessage"; ComputedStyleView.prototype.postViewProcessing = function () { _super.prototype.postViewProcessing.call(this); }; ComputedStyleView.prototype.preViewProcessing = function () { _super.prototype.preViewProcessing.call(this); this.initializeAllStylesButton(); this.addNameFilterHandlers(); this.synchronizeViewAndModel(); }; ComputedStyleView.prototype.synchronizeViewAndModel = function () { (this.model).showAllStyles = this.getAllStylesButtonState(); (this.model).nameFilter = (this.htmlElementSource.getElementById(ComputedStyleView._filterTextBoxId)).value; this.ifThereAreResultsDisableTheNoResultsMessage(); }; ComputedStyleView.prototype.ifThereAreResultsDisableTheNoResultsMessage = function () { var noResultsMessageDiv = this.htmlElementSource.getElementById(ComputedStyleView.noResultsMessageId); if(this.model.length === 0) { noResultsMessageDiv.style.display = "block"; } else { noResultsMessageDiv.style.display = "none"; } }; ComputedStyleView.prototype.showContextMenu = function (selectedElement, x, y) { var _this = this; var contextMenu = [ { id: "copyProperty", text: toolwindowHelpers.loadString("CopyPropertyMenuText"), enabled: true } ]; toolwindowHelpers.showContextMenu("traceStyleMenu", contextMenu, x, y, function (id, menuItem) { if(id === "traceStyleMenu") { var model = _this.model; switch(menuItem) { case "copyProperty": var header = F12.DomExplorer.DomExplorerWindow.findAncestorByClass(selectedElement, Dom.ExpandingListView._headerClass); var name = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(header, ComputedStyleView._propertyNameClass).textContent.replace(/:$/, ""); var value = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(header, ComputedStyleView._propertyValueClass).textContent; clipboardData.setData("Text", name + ": " + value + ";"); break; } } }); }; ComputedStyleView.prototype.initializeAllStylesButton = function () { var _this = this; this._allStylesButton = this.htmlElementSource.getElementById(ComputedStyleView.allStylesButtonId); if(!this._allStylesButton) { return; } if(!this._allStylesButtonInitialized) { this._allStylesButton.classList.add(ComputedStyleView.bptToolbarToggleButtonStateOn); this._allStylesButton.title = Plugin.Resources.getString("UserStylesDomExplorerButtonTooltipOn"); this._allStylesButtonInitialized = true; } this.addHandler(this._allStylesButton, "click", function (mouseEvent) { _this.synchronizeAllStylesModelStateWithButtonState(); return false; }); this.addHandler(this._allStylesButton, "keydown", function (keyEvent) { if((keyEvent.keyCode === Common.KeyCodes.ENTER || keyEvent.keyCode === Common.KeyCodes.SPACE) && !keyEvent.ctrlKey && !keyEvent.shiftKey && !keyEvent.altKey) { _this.synchronizeAllStylesModelStateWithButtonState(); return false; } return true; }); }; ComputedStyleView.prototype.synchronizeAllStylesModelStateWithButtonState = function () { this.setAllStylesState(this.getAllStylesButtonState()); }; ComputedStyleView.prototype.getAllStylesButtonState = function () { if(!this._allStylesButton) { this._allStylesButton = this.htmlElementSource.getElementById(ComputedStyleView.allStylesButtonId); } return !this._allStylesButton.classList.contains(ComputedStyleView.bptToolbarToggleButtonStateOn); }; ComputedStyleView.prototype.setAllStylesState = function (allStyles) { var computedStyleModel = this.model; computedStyleModel.showAllStyles = allStyles; if(computedStyleModel.showAllStyles) { this._allStylesButton.title = Plugin.Resources.getString("UserStylesDomExplorerButtonTooltipOff"); } else { this._allStylesButton.title = Plugin.Resources.getString("UserStylesDomExplorerButtonTooltipOn"); } this.renderViewWithoutChangingEvents(); }; ComputedStyleView.prototype.renderViewWithoutChangingEvents = function () { this.synchronizeViewAndModel(); this.listReconciler.reconcile(this.objectsPreviouslyRendered, this.model.cache); this.objectsPreviouslyRendered = this.model.cache; if(this.renderViewCallback) { this.renderViewCallback(); } }; ComputedStyleView.prototype.addNameFilterHandlers = function () { var _this = this; var filterTextBox = this.htmlElementSource.getElementById(ComputedStyleView._filterTextBoxId); if(filterTextBox) { this.addHandler(filterTextBox, "input", function (evt) { var el = evt.target; var computedStyleModel = _this.model; if(computedStyleModel.nameFilter !== el.value) { computedStyleModel.nameFilter = el.value; _this.renderViewWithoutChangingEvents(); } return true; }); this.addHandler(filterTextBox, "contextmenu", function (evt) { var element = evt.target; _this._domExplorer.handleContextMenuForTextbox(element, evt.clientX, evt.clientY); return false; }); this.addHandler(filterTextBox, "keydown", function (evt) { if(event.keyCode === Common.KeyCodes.F10 && event.shiftKey && !event.ctrlKey && !event.altKey) { var element = evt.target; _this._domExplorer.handleContextMenuForTextbox(element, 0, 0); return false; } return true; }); } }; return ComputedStyleView; })(Dom.ExpandingListView); Dom.ComputedStyleView = ComputedStyleView; })(Dom || (Dom = {})); //@ sourceMappingURL=computedStyleView.js.map  DOM Explorer
    DOM Explorer
    Styles
    Trace Styles
    Computed Styles
    Layout
    Events
    [No properties found.]
    Offset
    Margin
    Border
    Padding
    ×
    body, div, span { cursor: default; } .BPT-ScriptErrorMessage { color: TRANSPARENT; /*[{plugin-font-console-error-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-console-error-background-color}]*/ font-weight: normal; /*[{plugin-font-console-error-weight}]*/ padding-left: 21px; padding-top: 6px; } .BPT-ScriptErrorMessageIcon { background-image: url('images/i_error.png'); /*[url({plugin-image-icon-dom-explorer-error})]*/ background-repeat: no-repeat; background-size: 18px 54px; width: 18px; height: 18px; display: inline-block; float: left; vertical-align: middle; margin-top: 6px; } .BPT-Toolbar { -ms-grid-row: 1; } .BPT-Toolbar .selectElementButton { background-image: url('images/i_inspect.png'); /*[url({plugin-image-icon-dom-explorer-inspect})]*/ background-size: 18px 54px; } .BPT-Toolbar .showLayoutButton { background-image: url('images/i_show-layout.png'); /*[url({plugin-image-icon-dom-explorer-show-layout})]*/ background-size: 18px 54px; } .BPT-Toolbar .refreshButton { background-image: url('images/i_refresh.png'); /*[url({plugin-image-icon-dom-explorer-refresh})]*/ background-size: 18px 54px; } .BPT-Toolbar .refreshButton { background-image: url('images/i_refresh.png'); /*[url({plugin-image-icon-dom-explorer-refresh})]*/ } .BPT-Toolbar .BPT-Search-Button { display: inline-block; position: absolute; } .BPT-Toolbar .BPT-Search-Button:not([disabled]):hover div { background-position-x: -16px; } .BPT-Toolbar .BPT-Search-Button[disabled] div { visibility: hidden; } .BPT-Toolbar .BPT-Search-Button .BPT-Search-Next { background-image: url("images/i_next.png"); /*[url({plugin-image-icon-dom-explorer-next})]*/ background-repeat: no-repeat; background-position: 0px 0px; background-size: 32px 16px; display: inline-block; width: 16px; height: 16px; } .BPT-Toolbar .BPT-Search-Button .BPT-Search-Previous { background-image: url("images/i_previous.png"); /*[url({plugin-image-icon-dom-explorer-previous})]*/ background-repeat: no-repeat; background-position: 0px 0px; background-size: 32px 16px; display: inline-block; width: 19px; height: 16px; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ /* Css styling for the tree view and html elements */ #tree { margin-top: 5px; } /* Css styling for panes */ #mainContainer { display: -ms-grid; -ms-grid-rows: auto 1fr; -ms-grid-columns: 100%; height: 100%; width: 100%; position: relative; } .BPT-HorizontalPane { -ms-grid-row: 2; height: 100%; background-color: TRANSPARENT; /*[{plugin-font-editor-background-color}]*/ color: TRANSPARENT; /*[{plugin-font-editor-color}]*/ } .BPT-HorizontalPane .BPT-Pane { float: left; position: relative; } .BPT-HorizontalPane-Left { width: 100%; height: calc(100% - 25px); overflow-x: auto; box-sizing: border-box; padding-bottom: 25px; } .BPT-HorizontalPane-Right { position: relative; height: 100%; box-sizing: border-box; overflow: hidden; } .BPT-HorizontalPane-Right-Content { position: relative; width: 100%; height: calc(100% - 1.8em); overflow: auto; overflow-x: hidden; } .BPT-HorizontalPane-Right-Content > div > *:not(.BPT-Toolbar) { font-family: "Segoe UI", Arial, sans-serif; /*[{plugin-font-family} , Arial, sans-serif]*/ font-size: 12px; /*[{plugin-font-size}]*/ /* Changes to line-height here also require changes in styleView.css (see references to line-height there). */ line-height: 1.3em; margin: 0px; padding: 0px; } .BPT-HorizontalPane-Right-Tab-ToolbarContainer { position: relative; width: 100%; height: calc(100% - 2.666em - 4px); overflow: auto; } .BPT-HorizontalPane-Right-Tab { display: none; padding: 3px 6px 6px 4px; } .BPT-DataTree-Container { margin-top: 5px; } .BPT-HTML-InlinedTag { font-style: italic; } .BPT-Pane-Divider { position: relative; float: left; z-index: 100; height: 100%; width: 3px; background-color: TRANSPARENT; /*[{plugin-perftools-grid-column-sizer}]*/ cursor: w-resize; } .BPT-HorizontalPane-Right .BPT-Toolbar { font-family: "Segoe UI", Arial, Sans-Serif; /*[{plugin-font-family} , Arial, Sans-Serif]*/ font-size: 9pt; /*[{plugin-font-size}]*/ font-weight: normal; /*[{plugin-font-weight}]*/ color: TRANSPARENT; /*[{plugin-color}]*/ } /* CSS styling for the tab and resizable pane controls */ .BPT-Tabbar { position: relative; width: 100%; height: 25px; border-left: 4px solid TRANSPARENT; /*[4px solid {plugin-tab-header-background-color}]*/ white-space: nowrap; background-color: TRANSPARENT; /*[{plugin-tab-header-background-color}]*/ padding: 2px 0 0 2px; } .BPT-Tabbar .BPT-Tab-Item { height: 25px; padding-left: 14px; padding-right: 14px; display: table-cell; cursor: default; vertical-align: middle; background-color: TRANSPARENT; /*[{plugin-tab-header-background-color}]*/ } .BPT-Tabbar ::selection { background: transparent; } .BPT-Tab-Item[aria-selected='true'] { font-family: "Segoe UI", Arial, sans-serif; /*[{plugin-font-family} , Arial, sans-serif]*/ font-weight: 600; background-color: TRANSPARENT; /*[{plugin-tab-header-active-background-color}]*/ color: TRANSPARENT; /*[{plugin-tab-header-active-color}]*/ } .BPT-ToolWindow-NoFocus .BPT-Tab-Item[aria-selected='true'] { font-family: "Segoe UI", Arial, sans-serif; /*[{plugin-font-family} , Arial, sans-serif]*/ font-weight: normal; background-color: TRANSPARENT; /*[{plugin-tab-header-background-color}]*/ color: TRANSPARENT; /*[{plugin-tab-header-color}]*/ } .BPT-Tab-Item[aria-selected='false'] { font-family: "Segoe UI", Arial, sans-serif; /*[{plugin-font-family} , Arial, sans-serif]*/ font-weight: normal; background-color: TRANSPARENT; /*[{plugin-tab-header-background-color}]*/ color: TRANSPARENT; /*[{plugin-tab-header-color}]*/ } .BPT-Tab-Item[aria-selected='false']:hover { background-color: TRANSPARENT; /*[{plugin-tab-header-hover-background-color}]*/ color: TRANSPARENT; /*[{plugin-tab-header-hover-color}]*/ } .BPT-Tab-Item:focus { outline: 0; } .BPT-DataTreeItem-ChildCollection { display: block; } body.BPT-ToolWindow-NoFocus .BPT-HtmlTree-Container:focus .BPT-HtmlTreeItem-Selected, body.BPT-ToolWindow-NoFocus .BPT-HtmlTree-Container-KeepSelection .BPT-HtmlTreeItem-Selected { border-left-color: TRANSPARENT; /*[{plugin-font-editor-inactive-selected-background-color}]*/ } body.BPT-ToolWindow-NoFocus .BPT-HtmlTree-Container:focus .BPT-HtmlTreeItem-Selected > .BPT-HtmlTreeItem-Header, body.BPT-ToolWindow-NoFocus .BPT-HtmlTree-Container-KeepSelection .BPT-HtmlTreeItem-Selected > .BPT-HtmlTreeItem-Header { background: rgba(191, 205, 219, 0.25); /*[{plugin-font-editor-inactive-selected-background-color rgba(0.25)}]*/ border-color: TRANSPARENT; /*[{plugin-font-editor-inactive-selected-background-color}]*/ } .BPT-ColorThumbnail { display: inline-block; vertical-align: middle; width: 12px; height: 12px; margin: 0 2px 0 2px; border: 1px solid black; /*[1px solid {plugin-font-editor-color}]*/ } .BPT-Style-FileReference { color: TRANSPARENT; /*[{plugin-link-color}]*/ }| .BPT-ToolbarLabel .BPT-FileLink { margin-top: -1px; margin-left: 4px; max-width: 12em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* Css styling for the editing box */ .BPT-EditBox { border: 1px solid TRANSPARENT; /*[1px solid {plugin-textbox-border-color}]*/ box-shadow: 2px 2px 2px rgba(0, 0, 255, 0.25); /*[2px 2px 2px {plugin-textbox-border-color rgba(0.5)}]*/ background-color: TRANSPARENT; /*[{plugin-textbox-background-color}]*/ color: TRANSPARENT; /*[{plugin-font-editor-color}]*/ } textarea.BPT-EditBox { margin: 0; padding-left: 0px; padding-right: 0px; overflow: auto; min-height: 16px; } input.BPT-EditBox { margin: -2px 0 -2px 0; } /* Disable "x" in input boxes. */ ::-ms-clear { display: none; } .BPT-SearchBox::-ms-clear { display: normal; } .BPT-SearchBox:-ms-input-placeholder { color:TRANSPARENT; /*[{plugin-searchcontrol-unfocused-watermark-text-color}]*/ background-color: TRANSPARENT; /*[{plugin-searchcontrol-unfocused-background-color}]*/ } .BPT-SearchBox-Border:hover .BPT-SearchBox:-ms-input-placeholder { background-color: TRANSPARENT; /*[{plugin-searchcontrol-mouseover-background-background-color}]*/ color: TRANSPARENT; /*[{plugin-searchcontrol-mouseover-watermark-text-color}]*/ } .BPT-SearchBox-Border { float: right; background-color: TRANSPARENT; /*[{plugin-searchcontrol-mouseover-background-background-color}]*/ border: 1px solid TRANSPARENT; /*[1px solid {plugin-searchcontrol-unfocused-border-color}]*/ margin-top: 3px; padding: 1px; display: inline-block; position: relative; } .BPT-SearchBox { color: TRANSPARENT; /*[{plugin-searchcontrol-mouseover-background-foreground-color}]*/ background-color: transparent; border: none; height: 16px; width: 141px; padding: 1px 2px; } .BPT-SearchBox::selection { background-color: TRANSPARENT; /*[{plugin-searchcontrol-selection-color}]*/ } .BPT-SearchBox-Border:hover { background-color: TRANSPARENT; /*[{plugin-searchcontrol-mouseover-background-background-color}]*/ border: 1px solid TRANSPARENT; /*[1px solid {plugin-searchcontrol-mouseover-border-color}]*/ } .BPT-SearchBox-NoResult, .BPT-SearchBox-NoResult:hover { border: 1px solid TRANSPARENT; /*[1px solid {plugin-font-console-error-color}]*/ } /* Css styling for editable text sections */ .BPT-DataTreeItem-Value > .BPT-HTML-CSS-Value[data-uid], .BPT-DataTreeItem-Value > .BPT-HTML-Value[data-uid], .BPT-HTML-Value[data-attrName], .BPT-HTML-Text { cursor: text; } ::selection { background-color: rgba(0, 0, 255, 0.5); /*[{plugin-highlight-background-color rgba(0.5)}]*/ } #breadcrumbRightArrow { background-image: url('images/BreadcrumbScrollRight.png'); /*[url({plugin-image-icon-dom-explorer-breadcrumb-right})]*/ float: right; } #breadcrumbRightArrow:hover { background-image: url('images/BreadcrumbScrollRightHover.png'); /*[url({plugin-image-icon-dom-explorer-breadcrumb-right-hover})]*/ } #breadcrumbLeftArrow { background-image: url('images/BreadcrumbScrollLeft.png'); /*[url({plugin-image-icon-dom-explorer-breadcrumb-left})]*/ margin-right: 12px; float: left; } #breadcrumbLeftArrow:hover { background-image: url('images/BreadcrumbScrollLeftHover.png'); /*[url({plugin-image-icon-dom-explorer-breadcrumb-left-hover})]*/ } .BPT-HorizontalPane-BreadcrumbBar-Arrow { background-size: 5px 9px; background-repeat: no-repeat; background-position: center center; width: 12px; height: 24px; display: inline-block; } .BPT-HorizontalPane-BreadcrumbChevron { z-index: 2; position: relative; } .BPT-BreadcrumbChevron-Edge { stroke-width: 1; stroke: TRANSPARENT; /*[{plugin-breadcrumb-border-color}]*/ fill-opacity: 0.0; } .BPT-BreadcrumbChevron { fill: TRANSPARENT; /*[{plugin-breadcrumb-background-color}]*/ stroke-width: 0px; } .BPT-BreadcrumbChevron-Hover { fill: TRANSPARENT; /*[{plugin-breadcrumb-hover-background-color}]*/ } .BPT-BreadcrumbChevron-Selected { fill: TRANSPARENT; /*[{plugin-breadcrumb-selected-background-color}]*/ } .BPT-Breadcrumb-Container { margin-left: -8px; float: left; position: relative; } .BPT-HorizontalPane-BreadcrumbBar-Item { float: left; vertical-align: middle; line-height: 24px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; max-width: 8em; padding-left: 16px; /* chevron width + 8 */ padding-right: 8px; } .BPT-Breadcrumb-Selected { background-color: TRANSPARENT; /*[{plugin-breadcrumb-selected-background-color}]*/ color: TRANSPARENT; /*[{plugin-breadcrumb-selected-color}]*/ overflow-x: hidden; } .BPT-Breadcrumb-Hover { background-color: TRANSPARENT; /*[{plugin-breadcrumb-hover-background-color}]*/ color: TRANSPARENT; /*[{plugin-breadcrumb-hover-color}]*/ } .BPT-HorizontalPane-BreadcrumbBar { font-family: "Segoe UI", Arial, Sans-Serif; /*[{plugin-font-family}, "Segoe UI", Arial, Sans-Serif]*/ position: absolute; bottom: 0; left: 0; display: table-row; border-top: 1px solid TRANSPARENT; /*[1px solid {plugin-breadcrumb-border-color}]*/ background-color: TRANSPARENT; /*[{plugin-breadcrumb-background-color}]*/ width: 100%; height: 24px; padding: 0; margin: 0; position: fixed; z-index: 1; resize: horizontal; cursor: default; } .BPT-Breadcrumb-Tooltip { position: absolute; float: none; z-index: 2; padding: 6px; display: table; font-family: "Segoe UI", Arial, Helvetica, sans-serif; /*[{plugin-font-family}, "Segoe UI", Arial, Sans-Serif]*/ font-size: 12px; /*[{plugin-font-size}]*/ color: TRANSPARENT; /*[{plugin-breadcrumb-tooltip-color}]*/ background-color: TRANSPARENT; /*[{plugin-breadcrumb-tooltip-background-color}]*/ box-shadow: 2px 2px 2px TRANSPARENT; /*[2px 2px 2px {plugin-textbox-border-color rgba(0.5)}]*/ border: 1px solid TRANSPARENT; /*[1px solid {plugin-breadcrumb-tooltip-border-color}]*/ line-height: 1.3em; max-width: 400px; word-wrap: break-word; table-layout: fixed; overflow: hidden; } .BPT-Breadcrumb-TooltipTableCell { max-width: 380px; display: table-cell; padding-left: 5px; padding-right: 5px; text-align: right; } .BPT-Breadcrumb-TooltipTableRow { display: table-row; padding-top: 5px; padding-bottom: 5px; } .BPT-Breadcrumb-Tooltip-Data { text-align: left; } .BPT-Breadcrumb-Tooltip-ClassNames { text-align: left; } #searchNextResult { right: 0px; top: 2px; } #searchPreviousResult { right: 11px; top: 2px; } // // Copyright (C) Microsoft. All rights reserved. // // cssPropertyMetadata.ts var F12; (function (F12) { (function (DomExplorer) { DomExplorer.cssPropertyMetadata = { "animation": { "name": "animation", "enumValueListName": "", "shorthand": true }, "animation-direction": { "name": "animation-direction", "enumValueListName": "AnimationDirection" }, "animation-iteration-count": { "name": "animation-iteration-count", "enumValueListName": "Infinite" }, "animation-play-state": { "name": "animation-play-state", "enumValueListName": "PlayState" }, "animation-timing-function": { "name": "animation-timing-function", "enumValueListName": "TimingFunctionKeyword" }, "animation-fill-mode": { "name": "animation-fill-mode", "enumValueListName": "AnimationFillMode" }, "background-repeat": { "name": "background-repeat", "enumValueListName": "BackgroundRepeatStyle" }, "background-position-x": { "name": "background-position-x", "enumValueListName": "HorizontalAlignment" }, "background-position-y": { "name": "background-position-y", "enumValueListName": "VerticalAlignment" }, "background-attachment": { "name": "background-attachment", "enumValueListName": "BackgroundAttachment" }, "background-clip": { "name": "background-clip", "enumValueListName": "Box" }, "background-size": { "name": "background-size", "enumValueListName": "BackgroundSizeScaling" }, "border-radius": { "name": "border-radius", "enumValueListName": "", "shorthand": true }, "border-top-width": { "name": "border-top-width", "enumValueListName": "BorderWidthType" }, "border-top-style": { "name": "border-top-style", "enumValueListName": "BorderStyle" }, "border-right-width": { "name": "border-right-width", "enumValueListName": "BorderWidthType" }, "border-right-style": { "name": "border-right-style", "enumValueListName": "BorderStyle" }, "border-bottom-width": { "name": "border-bottom-width", "enumValueListName": "BorderWidthType" }, "border-bottom-style": { "name": "border-bottom-style", "enumValueListName": "BorderStyle" }, "border-left-width": { "name": "border-left-width", "enumValueListName": "BorderWidthType" }, "border-left-style": { "name": "border-left-style", "enumValueListName": "BorderStyle" }, "border-collapse": { "name": "border-collapse", "enumValueListName": "BorderCollapse" }, "flex": { "name": "flex", "enumValueListName": "", "shorthand": true }, "-ms-flex": { "name": "-ms-flex", "enumValueListName": "", "shorthand": true }, "flex-direction": { "name": "flex-direction", "enumValueListName": "FlexDirection" }, "flex-wrap": { "name": "flex-wrap", "enumValueListName": "FlexWrap" }, "justify-content": { "name": "justify-content", "enumValueListName": "JustifyContent" }, "align-items": { "name": "align-items", "enumValueListName": "AlignItems" }, "align-self": { "name": "align-self", "enumValueListName": "AlignSelf" }, "align-content": { "name": "align-content", "enumValueListName": "AlignContent" }, "-ms-flex-preferred-size": { "name": "-ms-flex-preferred-size", "enumValueListName": "Auto" }, "font": { "name": "font", "enumValueListName": "", "shorthand": true }, "font-size": { "name": "font-size", "enumValueListName": "FontSizes" }, "font-style": { "name": "font-style", "enumValueListName": "FontStyle" }, "font-variant": { "name": "font-variant", "enumValueListName": "FontVariant" }, "font-weight": { "name": "font-weight", "enumValueListName": "FontWeight" }, "line-height": { "name": "line-height", "enumValueListName": "Normal" }, "font-stretch": { "name": "font-stretch", "enumValueListName": "FontStretch" }, "font-size-adjust": { "name": "font-size-adjust", "enumValueListName": "None" }, "text-transform": { "name": "text-transform", "enumValueListName": "TextTransform" }, "text-underline-position": { "name": "text-underline-position", "enumValueListName": "TextUnderlinePosition" }, "-ms-grid-column-align": { "name": "-ms-grid-column-align", "enumValueListName": "GridAlign" }, "-ms-grid-row-align": { "name": "-ms-grid-row-align", "enumValueListName": "GridAlign" }, "display": { "name": "display", "enumValueListName": "Display" }, "position": { "name": "position", "enumValueListName": "Position" }, "top": { "name": "top", "enumValueListName": "Auto" }, "right": { "name": "right", "enumValueListName": "Auto" }, "bottom": { "name": "bottom", "enumValueListName": "Auto" }, "left": { "name": "left", "enumValueListName": "Auto" }, "float": { "name": "float", "enumValueListName": "FloatPosition" }, "clear": { "name": "clear", "enumValueListName": "Clear" }, "margin": { "name": "margin", "enumValueListName": "", "shorthand": true }, "margin-top": { "name": "margin-top", "enumValueListName": "Auto" }, "margin-right": { "name": "margin-right", "enumValueListName": "Auto" }, "margin-bottom": { "name": "margin-bottom", "enumValueListName": "Auto" }, "margin-left": { "name": "margin-left", "enumValueListName": "Auto" }, "padding": { "name": "padding", "enumValueListName": "", "shorthand": true }, "padding-top": { "name": "padding-top", "enumValueListName": "Empty" }, "padding-right": { "name": "padding-right", "enumValueListName": "Empty" }, "padding-bottom": { "name": "padding-bottom", "enumValueListName": "Empty" }, "padding-left": { "name": "padding-left", "enumValueListName": "Empty" }, "visibility": { "name": "visibility", "enumValueListName": "Visibility" }, "z-index": { "name": "z-index", "enumValueListName": "Auto" }, "layout-flow": { "name": "layout-flow", "enumValueListName": "LayoutFlow" }, "layout-grid-char": { "name": "layout-grid-char", "enumValueListName": "AutoNone" }, "layout-grid-line": { "name": "layout-grid-line", "enumValueListName": "AutoNone" }, "layout-grid-mode": { "name": "layout-grid-mode", "enumValueListName": "LayoutGridMode" }, "layout-grid-type": { "name": "layout-grid-type", "enumValueListName": "LayoutGridType" }, "-ms-wrap-flow": { "name": "-ms-wrap-flow", "enumValueListName": "WrapFlow" }, "-ms-wrap-margin": { "name": "-ms-wrap-margin", "enumValueListName": "Empty" }, "-ms-wrap-through": { "name": "-ms-wrap-through", "enumValueListName": "WrapThrough" }, "list-style": { "name": "list-style", "enumValueListName": "", "shorthand": true }, "list-style-type": { "name": "list-style-type", "enumValueListName": "ListStyleType" }, "list-style-position": { "name": "list-style-position", "enumValueListName": "ListStylePosition" }, "zoom": { "name": "zoom", "enumValueListName": "Normal" }, "-ms-ime-align": { "name": "-ms-ime-align", "enumValueListName": "MsImeAlign" }, "ime-mode": { "name": "ime-mode", "enumValueListName": "ImeMode" }, "page-break-before": { "name": "page-break-before", "enumValueListName": "PageBreak" }, "page-break-after": { "name": "page-break-after", "enumValueListName": "PageBreak" }, "page-break-inside": { "name": "page-break-inside", "enumValueListName": "PageBreakInside" }, "table-layout": { "name": "table-layout", "enumValueListName": "TableLayout" }, "caption-side": { "name": "caption-side", "enumValueListName": "CaptionSide" }, "empty-cells": { "name": "empty-cells", "enumValueListName": "EmptyCells" }, "column-count": { "name": "column-count", "enumValueListName": "Auto" }, "column-width": { "name": "column-width", "enumValueListName": "Auto" }, "column-gap": { "name": "column-gap", "enumValueListName": "Normal" }, "column-rule-width": { "name": "column-rule-width", "enumValueListName": "BorderWidthType" }, "column-rule-style": { "name": "column-rule-style", "enumValueListName": "BorderStyle" }, "break-before": { "name": "break-before", "enumValueListName": "Break" }, "break-after": { "name": "break-after", "enumValueListName": "Break" }, "break-inside": { "name": "break-inside", "enumValueListName": "BreakInside" }, "column-span": { "name": "column-span", "enumValueListName": "ColumnSpan" }, "column-fill": { "name": "column-fill", "enumValueListName": "ColumnFill" }, "width": { "name": "width", "enumValueListName": "Auto" }, "height": { "name": "height", "enumValueListName": "Auto" }, "min-width": { "name": "min-width", "enumValueListName": "Auto" }, "max-width": { "name": "max-width", "enumValueListName": "None" }, "min-height": { "name": "min-height", "enumValueListName": "Auto" }, "max-height": { "name": "max-height", "enumValueListName": "None" }, "box-sizing": { "name": "box-sizing", "enumValueListName": "BoxSizing" }, "overflow": { "name": "overflow", "enumValueListName": "Overflow" }, "overflow-x": { "name": "overflow-x", "enumValueListName": "Overflow" }, "overflow-y": { "name": "overflow-y", "enumValueListName": "Overflow" }, "-ms-overflow-style": { "name": "-ms-overflow-style", "enumValueListName": "OverflowStyle" }, "clip-rule": { "name": "clip-rule", "enumValueListName": "ClipRule" }, "color-interpolation-filters": { "name": "color-interpolation-filters", "enumValueListName": "ColorInterpolationFilters" }, "fill-rule": { "name": "fill-rule", "enumValueListName": "ClipRule" }, "stroke-dashoffset": { "name": "stroke-dashoffset", "enumValueListName": "Empty" }, "stroke-linecap": { "name": "stroke-linecap", "enumValueListName": "StrokeLineCap" }, "stroke-linejoin": { "name": "stroke-linejoin", "enumValueListName": "StrokeLineJoin" }, "stroke-width": { "name": "stroke-width", "enumValueListName": "Empty" }, "enable-background": { "name": "enable-background", "enumValueListName": "EnableBackground" }, "glyph-orientation-horizontal": { "name": "glyph-orientation-horizontal", "enumValueListName": "Empty" }, "glyph-orientation-vertical": { "name": "glyph-orientation-vertical", "enumValueListName": "Auto" }, "kerning": { "name": "kerning", "enumValueListName": "Auto" }, "pointer-events": { "name": "pointer-events", "enumValueListName": "PointerEvents" }, "white-space": { "name": "white-space", "enumValueListName": "WhiteSpace" }, "text-indent": { "name": "text-indent", "enumValueListName": "Empty" }, "vertical-align": { "name": "vertical-align", "enumValueListName": "VerticalAlign" }, "text-align": { "name": "text-align", "enumValueListName": "TextAlign" }, "text-align-last": { "name": "text-align-last", "enumValueListName": "TextAlignLast" }, "text-justify": { "name": "text-justify", "enumValueListName": "TextJustify" }, "direction": { "name": "direction", "enumValueListName": "Direction" }, "alignment-baseline": { "name": "alignment-baseline", "enumValueListName": "AlignmentBaseline" }, "baseline-shift": { "name": "baseline-shift", "enumValueListName": "BaselineShiftType" }, "-ms-block-progression": { "name": "-ms-block-progression", "enumValueListName": "BlockProgression" }, "dominant-baseline": { "name": "dominant-baseline", "enumValueListName": "DominantBaseline" }, "-ms-hyphenate-limit-lines": { "name": "-ms-hyphenate-limit-lines", "enumValueListName": "NoLimit" }, "-ms-hyphenate-limit-zone": { "name": "-ms-hyphenate-limit-zone", "enumValueListName": "Empty" }, "-ms-hyphens": { "name": "-ms-hyphens", "enumValueListName": "Hyphens" }, "line-break": { "name": "line-break", "enumValueListName": "LineBreak" }, "ruby-align": { "name": "ruby-align", "enumValueListName": "RubyAlign" }, "ruby-overhang": { "name": "ruby-overhang", "enumValueListName": "RubyOverhang" }, "ruby-position": { "name": "ruby-position", "enumValueListName": "RubyPosition" }, "text-anchor": { "name": "text-anchor", "enumValueListName": "TextAnchor" }, "text-justify-trim": { "name": "text-justify-trim", "enumValueListName": "TextJustifyTrim" }, "text-kashida": { "name": "text-kashida", "enumValueListName": "Empty" }, "text-kashida-space": { "name": "text-kashida-space", "enumValueListName": "Empty" }, "text-overflow": { "name": "text-overflow", "enumValueListName": "TextOverflow" }, "unicode-bidi": { "name": "unicode-bidi", "enumValueListName": "UnicodeBidi" }, "word-break": { "name": "word-break", "enumValueListName": "WordBreak" }, "letter-spacing": { "name": "letter-spacing", "enumValueListName": "Normal" }, "word-spacing": { "name": "word-spacing", "enumValueListName": "Normal" }, "word-wrap": { "name": "word-wrap", "enumValueListName": "WordWrap" }, "writing-mode": { "name": "writing-mode", "enumValueListName": "WritingMode" }, "-ms-text-combine-horizontal": { "name": "-ms-text-combine-horizontal", "enumValueListName": "MsTextCombineHorizontal" }, "-ms-text-size-adjust": { "name": "-ms-text-size-adjust", "enumValueListName": "AutoNone" }, "-ms-scroll-rails": { "name": "-ms-scroll-rails", "enumValueListName": "ScrollRailed" }, "-ms-scroll-snap-type": { "name": "-ms-scroll-snap-type", "enumValueListName": "SnapType" }, "-ms-scroll-chaining": { "name": "-ms-scroll-chaining", "enumValueListName": "ScrollChained" }, "-ms-scroll-limit": { "name": "-ms-scroll-limit", "enumValueListName": "", "shorthand": true }, "-ms-scroll-limit-x-min": { "name": "-ms-scroll-limit-x-min", "enumValueListName": "Empty" }, "-ms-scroll-limit-y-min": { "name": "-ms-scroll-limit-y-min", "enumValueListName": "Auto" }, "-ms-scroll-limit-x-max": { "name": "-ms-scroll-limit-x-max", "enumValueListName": "Auto" }, "-ms-scroll-limit-y-max": { "name": "-ms-scroll-limit-y-max", "enumValueListName": "Empty" }, "-ms-scroll-translation": { "name": "-ms-scroll-translation", "enumValueListName": "ScrollTranslation" }, "-ms-content-zooming": { "name": "-ms-content-zooming", "enumValueListName": "ContentZooming" }, "-ms-content-zoom-limit-min": { "name": "-ms-content-zoom-limit-min", "enumValueListName": "Empty" }, "-ms-content-zoom-limit-max": { "name": "-ms-content-zoom-limit-max", "enumValueListName": "Empty" }, "-ms-content-zoom-snap-type": { "name": "-ms-content-zoom-snap-type", "enumValueListName": "SnapType" }, "-ms-content-zoom-chaining": { "name": "-ms-content-zoom-chaining", "enumValueListName": "ScrollChained" }, "-ms-touch-action": { "name": "-ms-touch-action", "enumValueListName": "TouchAction" }, "touch-action": { "name": "touch-action", "enumValueListName": "TouchAction" }, "-ms-touch-select": { "name": "-ms-touch-select", "enumValueListName": "Grippers" }, "transform-style": { "name": "transform-style", "enumValueListName": "TransformStyle" }, "backface-visibility": { "name": "backface-visibility", "enumValueListName": "BackfaceVisibility" }, "-ms-interpolation-mode": { "name": "-ms-interpolation-mode", "enumValueListName": "InterpolationMode" }, "cursor": { "name": "cursor", "enumValueListName": "Cursor" }, "outline": { "name": "outline", "enumValueListName": "", "shorthand": true }, "outline-width": { "name": "outline-width", "enumValueListName": "BorderWidthType" }, "outline-style": { "name": "outline-style", "enumValueListName": "OutlineStyle" }, "-ms-user-select": { "name": "-ms-user-select", "enumValueListName": "UserSelect" }, "-ms-high-contrast-adjust": { "name": "-ms-high-contrast-adjust", "enumValueListName": "AutoNone" }, "background": { "name": "background", "enumValueListName": "", "shorthand": true }, "background-color": { "name": "background-color", "enumValueListName": "ColorName" }, "border": { "name": "border", "enumValueListName": "", "shorthand": true }, "border-image-repeat": { "name": "border-image-repeat", "enumValueListName": "BorderImageRepeat" }, "border-width": { "name": "border-width", "enumValueListName": "", "shorthand": true }, "border-style": { "name": "border-style", "enumValueListName": "", "shorthand": true }, "border-color": { "name": "border-color", "enumValueListName": "", "shorthand": true }, "border-bottom-color": { "name": "border-bottom-color", "enumValueListName": "ColorName" }, "border-left-color": { "name": "border-left-color", "enumValueListName": "ColorName" }, "border-right-color": { "name": "border-right-color", "enumValueListName": "ColorName" }, "border-top-color": { "name": "border-top-color", "enumValueListName": "ColorName" }, "color": { "name": "color", "enumValueListName": "ColorName" }, "column-rule": { "name": "column-rule", "enumValueListName": "", "shorthand": true }, "column-rule-color": { "name": "column-rule-color", "enumValueListName": "ColorName" }, "flood-color": { "name": "flood-color", "enumValueListName": "ColorName" }, "lighting-color": { "name": "lighting-color", "enumValueListName": "ColorName" }, "outline-color": { "name": "outline-color", "enumValueListName": "ColorName" }, "scrollbar-3dlight-color": { "name": "scrollbar-3dlight-color", "enumValueListName": "ColorName" }, "scrollbar-arrow-color": { "name": "scrollbar-arrow-color", "enumValueListName": "ColorName" }, "scrollbar-base-color": { "name": "scrollbar-base-color", "enumValueListName": "ColorName" }, "scrollbar-darkshadow-color": { "name": "scrollbar-darkshadow-color", "enumValueListName": "ColorName" }, "scrollbar-face-color": { "name": "scrollbar-face-color", "enumValueListName": "ColorName" }, "scrollbar-highlight-color": { "name": "scrollbar-highlight-color", "enumValueListName": "ColorName" }, "scrollbar-shadow-color": { "name": "scrollbar-shadow-color", "enumValueListName": "ColorName" }, "scrollbar-track-color": { "name": "scrollbar-track-color", "enumValueListName": "ColorName" }, "transition": { "name": "transition", "enumValueListName": "", "shorthand": true }, "stop-color": { "name": "stop-color", "enumValueListName": "ColorName" } }; })(F12.DomExplorer || (F12.DomExplorer = {})); var DomExplorer = F12.DomExplorer; })(F12 || (F12 = {})); //@ sourceMappingURL=cssPropertyMetadata.js.map // enumMetadata.ts var F12; (function (F12) { (function (DomExplorer) { DomExplorer.enumMetadata = { "AlignmentBaseline": { "name": "AlignmentBaseline", "values": [ "baseline", "before-edge", "text-before-edge", "after-edge", "text-after-edge", "central", "middle", "ideographic", "alphabetic", "hanging", "mathematical", "auto" ] }, "AllNone": { "name": "AllNone", "values": [ "all", "none" ] }, "AnimationDirection": { "name": "AnimationDirection", "values": [ "normal", "alternate", "reverse", "alternate-reverse" ] }, "AnimationFillMode": { "name": "AnimationFillMode", "values": [ "none", "forwards", "backwards", "both" ] }, "Any": { "name": "Any", "values": [ "any" ] }, "Auto": { "name": "Auto", "values": [ "auto" ] }, "AutoNone": { "name": "AutoNone", "values": [ "auto", "none" ] }, "BackfaceVisibility": { "name": "BackfaceVisibility", "values": [ "visible", "hidden" ] }, "BackgroundAttachment": { "name": "BackgroundAttachment", "values": [ "scroll", "fixed", "local" ] }, "BackgroundRepeatStyle": { "name": "BackgroundRepeatStyle", "values": [ "repeat-x", "repeat-y", "repeat", "space", "round", "no-repeat" ] }, "BackgroundSizeScaling": { "name": "BackgroundSizeScaling", "values": [ "contain", "cover" ] }, "BaselineShiftType": { "name": "BaselineShiftType", "values": [ "baseline", "sub", "super" ] }, "BlockProgression": { "name": "BlockProgression", "values": [ "tb", "rl", "bt", "lr" ] }, "BorderCollapse": { "name": "BorderCollapse", "values": [ "collapse", "separate" ] }, "BorderImageRepeat": { "name": "BorderImageRepeat", "values": [ "stretch", "repeat", "round", "space" ] }, "BorderStyle": { "name": "BorderStyle", "values": [ "none", "solid", "dashed", "dotted", "double", "groove", "hidden", "inset", "outset", "ridge", "window-inset" ] }, "BorderWidthType": { "name": "BorderWidthType", "values": [ "thin", "medium", "thick" ] }, "Box": { "name": "Box", "values": [ "border-box", "padding-box", "content-box" ] }, "AlignItems": { "name": "AlignItems", "values": [ "flex-start", "center", "flex-end", "baseline", "stretch" ] }, "FlexDirection": { "name": "FlexDirection", "values": [ "row", "row-reverse", "column", "column-reverse" ] }, "AlignSelf": { "name": "AlignSelf", "values": [ "auto", "flex-start", "center", "flex-end", "baseline", "stretch" ] }, "AlignContent": { "name": "AlignContent", "values": [ "flex-start", "center", "flex-end", "space-between", "space-around", "stretch" ] }, "FlexWrap": { "name": "FlexWrap", "values": [ "nowrap", "wrap", "wrap-reverse" ] }, "JustifyContent": { "name": "JustifyContent", "values": [ "flex-start", "center", "flex-end", "space-between", "space-around" ] }, "BoxSizing": { "name": "BoxSizing", "values": [ "content-box", "border-box" ] }, "Break": { "name": "Break", "values": [ "auto", "always", "avoid", "left", "right", "page", "column", "avoid-page", "avoid-column" ] }, "BreakInside": { "name": "BreakInside", "values": [ "auto", "avoid", "avoid-page", "avoid-column" ] }, "Buffering": { "name": "Buffering", "values": [ "none", "metadata", "auto" ] }, "Button": { "name": "Button", "values": [ "submit", "reset", "button" ] }, "CaptionSide": { "name": "CaptionSide", "values": [ "top", "bottom", "left", "right" ] }, "Clear": { "name": "Clear", "values": [ "none", "left", "right", "both" ] }, "ClipRule": { "name": "ClipRule", "values": [ "nonzero", "evenodd" ] }, "ColorInterpolationFilters": { "name": "ColorInterpolationFilters", "values": [ "auto", "sRGB", "linearRGB" ] }, "ColumnFill": { "name": "ColumnFill", "values": [ "auto", "balance" ] }, "ColumnSpan": { "name": "ColumnSpan", "values": [ "1", "all" ] }, "Command": { "name": "Command", "values": [ "command", "checkbox", "radio" ] }, "ContentZooming": { "name": "ContentZooming", "values": [ "none", "zoom" ] }, "ContentZoomStyle": { "name": "ContentZoomStyle", "values": [ "immutable", "mutable" ] }, "ContentZoomSnapStyle": { "name": "ContentZoomSnapStyle", "values": [ "flat", "well" ] }, "Cursor": { "name": "Cursor", "values": [ "auto", "pointer", "default", "context-menu", "help", "none", "progress", "wait", "cell", "crosshair", "text", "vertical-text", "alias", "copy", "move", "no-drop", "not-allowed", "e-resize", "n-resize", "ne-resize", "nw-resize", "s-resize", "se-resize", "sw-resize", "w-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "col-resize", "row-resize", "all-scroll" ] }, "Direction": { "name": "Direction", "values": [ "ltr", "rtl" ] }, "Display": { "name": "Display", "values": [ "inline", "block", "none", "inline-block", "table", "inline-table", "table-row-group", "table-header-group", "table-footer-group", "table-row", "table-column-group", "table-column", "table-cell", "table-caption", "-ms-flexbox", "-ms-grid", "-ms-inline-grid", "-ms-inline-flexbox", "run-in", "ruby", "ruby-base", "ruby-text", "list-item", "ruby-base-container", "ruby-text-container", "flex", "inline-flex", ] }, "DominantBaseline": { "name": "DominantBaseline", "values": [ "auto", "use-script", "no-change", "reset-size", "alphabetic", "hanging", "ideographic", "mathematical", "central", "middle", "text-after-edge", "text-before-edge" ] }, "Empty": { "name": "Empty", "values": [ "empty" ] }, "EmptyCells": { "name": "EmptyCells", "values": [ "show", "hide" ] }, "EnableBackground": { "name": "EnableBackground", "values": [ "accumulate", "new" ] }, "Enctype": { "name": "Enctype", "values": [ "application/x-www-form-urlencoded", "multipart/form-data", "text/plain" ] }, "Fit": { "name": "Fit", "values": [ "fill", "hidden", "meet", "slice" ] }, "FloatPosition": { "name": "FloatPosition", "values": [ "none", "left", "right" ] }, "FontFamilyGenericType": { "name": "FontFamilyGenericType", "values": [ "serif", "sans-serif", "cursive", "fantasy", "monospace" ] }, "FontSizes": { "name": "FontSizes", "values": [ "xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "larger", "smaller" ] }, "FontStretch": { "name": "FontStretch", "values": [ "normal", "ultra-condensed", "extra-condensed", "condensed", "semi-condensed", "semi-expanded", "expanded", "extra-expanded", "ultra-expanded", "wider", "narrower" ] }, "FontStyle": { "name": "FontStyle", "values": [ "normal", "italic", "oblique" ] }, "FontType": { "name": "FontType", "values": [ "caption", "icon", "menu", "message-box", "small-caption", "status-bar" ] }, "FontVariant": { "name": "FontVariant", "values": [ "normal", "small-caps" ] }, "FontWeight": { "name": "FontWeight", "values": [ "normal", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900" ] }, "FormMethod": { "name": "FormMethod", "values": [ "get", "post" ] }, "GridAlign": { "name": "GridAlign", "values": [ "start", "center", "end", "stretch" ] }, "GridLength": { "name": "GridLength", "values": [ "auto", "none", "min-content", "max-content" ] }, "Grippers": { "name": "Grippers", "values": [ "none", "grippers" ] }, "HorizontalAlignment": { "name": "HorizontalAlignment", "values": [ "left", "center", "right" ] }, "HyphenateLimitLast": { "name": "HyphenateLimitLast", "values": [ "none", "always", "column", "page", "spread" ] }, "Hyphens": { "name": "Hyphens", "values": [ "none", "manual", "auto" ] }, "MsImeAlign": { "name": "MsImeAlign", "values": [ "auto", "after" ] }, "ImeMode": { "name": "ImeMode", "values": [ "auto", "active", "inactive", "disabled" ] }, "Infinite": { "name": "Infinite", "values": [ "infinite" ] }, "Input": { "name": "Input", "values": [ "hidden", "text", "search", "tel", "url", "email", "password", "datetime", "date", "month", "week", "time", "datetime-local", "number", "range", "color", "checkbox", "radio", "file", "submit", "image", "reset", "button" ] }, "Inset": { "name": "Inset", "values": [ "inset" ] }, "InteractionChaining": { "name": "InteractionChaining", "values": [ "none", "parent" ] }, "InterpolationMode": { "name": "InterpolationMode", "values": [ "nearest-neighbor", "bicubic" ] }, "LayoutFlow": { "name": "LayoutFlow", "values": [ "horizontal", "vertical-ideographic" ] }, "LayoutGridMode": { "name": "LayoutGridMode", "values": [ "both", "none", "line", "char" ] }, "LayoutGridType": { "name": "LayoutGridType", "values": [ "loose", "strict", "fixed" ] }, "LinearGradientHorizontalAlignment": { "name": "LinearGradientHorizontalAlignment", "values": [ "left", "right" ] }, "LinearGradientVerticalAlignment": { "name": "LinearGradientVerticalAlignment", "values": [ "top", "bottom" ] }, "LineBreak": { "name": "LineBreak", "values": [ "normal", "strict" ] }, "ListStylePosition": { "name": "ListStylePosition", "values": [ "inside", "outside" ] }, "ListStyleType": { "name": "ListStyleType", "values": [ "disc", "none", "decimal", "square", "decimal-leading-zero", "lower-roman", "upper-roman", "lower-greek", "lower-latin", "upper-latin", "armenian", "georgian", "lower-alpha", "upper-alpha", "circle", "upper-greek" ] }, "Marks": { "name": "Marks", "values": [ "crop", "cross", "none" ] }, "Menu": { "name": "Menu", "values": [ "context", "toolbar" ] }, "MsTextCombineHorizontal": { "name": "MsTextCombineHorizontal", "values": [ "none", "all", "digits" ] }, "NoLimit": { "name": "NoLimit", "values": [ "no-limit" ] }, "None": { "name": "None", "values": [ "none" ] }, "NoneNormal": { "name": "NoneNormal", "values": [ "none", "normal" ] }, "Normal": { "name": "Normal", "values": [ "normal" ] }, "OnOff": { "name": "OnOff", "values": [ "on", "off" ] }, "OpenQuote": { "name": "OpenQuote", "values": [ "open-quote", "close-quote", "no-open-quote", "no-close-quote" ] }, "OutlineStyle": { "name": "OutlineStyle", "values": [ "none", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset", "window-inset" ] }, "Overflow": { "name": "Overflow", "values": [ "visible", "hidden", "scroll", "auto" ] }, "OverflowStyle": { "name": "OverflowStyle", "values": [ "scrollbar", "-ms-autohiding-scrollbar", "none", "auto" ] }, "PageBreak": { "name": "PageBreak", "values": [ "auto", "always", "avoid", "left", "right" ] }, "PageBreakInside": { "name": "PageBreakInside", "values": [ "auto", "avoid" ] }, "PlayState": { "name": "PlayState", "values": [ "running", "paused" ] }, "PointerEvents": { "name": "PointerEvents", "values": [ "visiblePainted", "visibleFill", "visibleStroke", "visible", "painted", "fill", "stroke", "all", "none", "auto" ] }, "Position": { "name": "Position", "values": [ "static", "relative", "absolute", "fixed", "-ms-page", "-ms-device-fixed" ] }, "RadialGradientExtent": { "name": "RadialGradientExtent", "values": [ "closest-side", "closest-corner", "farthest-side", "farthest-corner" ] }, "RadialGradientShape": { "name": "RadialGradientShape", "values": [ "circle", "ellipse" ] }, "RubyAlign": { "name": "RubyAlign", "values": [ "auto", "left", "center", "right", "distribute-letter", "distribute-space", "line-edge" ] }, "RubyOverhang": { "name": "RubyOverhang", "values": [ "auto", "whitespace", "none" ] }, "RubyPosition": { "name": "RubyPosition", "values": [ "above", "inline" ] }, "Sandbox": { "name": "Sandbox", "values": [ "allow-same-origin", "allow-forms", "allow-scripts" ] }, "Scope": { "name": "Scope", "values": [ "row", "col", "rowgroup", "colgroup" ] }, "ScrollChained": { "name": "ScrollChained", "values": [ "none", "chained" ] }, "ScrollTranslation": { "name": "ScrollTranslation", "values": [ "vertical-to-horizontal", "none", "inherit" ] }, "ScrollRailed": { "name": "ScrollRailed", "values": [ "none", "railed" ] }, "Shape": { "name": "Shape", "values": [ "circle", "default", "poly", "rect" ] }, "SnapType": { "name": "SnapType", "values": [ "none", "proximity", "mandatory" ] }, "StartEnd": { "name": "StartEnd", "values": [ "start", "end" ] }, "StrokeLineCap": { "name": "StrokeLineCap", "values": [ "butt", "round", "square" ] }, "StrokeLineJoin": { "name": "StrokeLineJoin", "values": [ "miter", "round", "bevel" ] }, "TableLayout": { "name": "TableLayout", "values": [ "auto", "fixed" ] }, "TextAlign": { "name": "TextAlign", "values": [ "left", "right", "center", "justify" ] }, "TextAlignLast": { "name": "TextAlignLast", "values": [ "auto", "left", "right", "center", "justify" ] }, "TextAnchor": { "name": "TextAnchor", "values": [ "start", "middle", "end" ] }, "TextAutoSpace": { "name": "TextAutoSpace", "values": [ "ideograph-alpha", "ideograph-numeric", "ideograph-parenthesis", "ideograph-space" ] }, "TextDecoration": { "name": "TextDecoration", "values": [ "none", "underline", "overline", "line-through", "blink" ] }, "TextJustify": { "name": "TextJustify", "values": [ "auto", "distribute", "distribute-all-lines", "inter-cluster", "inter-ideograph", "inter-word", "kashida", "newspaper" ] }, "TextJustifyTrim": { "name": "TextJustifyTrim", "values": [ "none", "punctuation", "punct-and-kana" ] }, "TextOverflow": { "name": "TextOverflow", "values": [ "ellipsis", "clip" ] }, "TextTransform": { "name": "TextTransform", "values": [ "capitalize", "uppercase", "lowercase", "none" ] }, "TextUnderlinePosition": { "name": "TextUnderlinePosition", "values": [ "above", "below", "auto" ] }, "TimingFunctionKeyword": { "name": "TimingFunctionKeyword", "values": [ "ease", "linear", "ease-in", "ease-out", "ease-in-out", "step-start", "step-end" ] }, "TouchAction": { "name": "TouchAction", "values": [ "pan-x", "pan-y", "pinch-zoom", "manipulation", "double-tap-zoom", "none", "auto", "cross-slide-x", "cross-slide-y" ] }, "TransformStyle": { "name": "TransformStyle", "values": [ "flat" ] }, "TrueFalse": { "name": "TrueFalse", "values": [ "true", "false" ] }, "UnicodeBidi": { "name": "UnicodeBidi", "values": [ "normal", "embed", "bidi-override" ] }, "UserSelect": { "name": "UserSelect", "values": [ "none", "text", "element", "auto" ] }, "VerticalAlign": { "name": "VerticalAlign", "values": [ "top", "middle", "bottom", "super", "auto", "baseline", "sub", "text-top", "text-bottom" ] }, "VerticalAlignment": { "name": "VerticalAlignment", "values": [ "top", "center", "bottom" ] }, "Visibility": { "name": "Visibility", "values": [ "visible", "hidden", "collapse" ] }, "WhiteSpace": { "name": "WhiteSpace", "values": [ "normal", "pre", "nowrap", "pre-wrap", "pre-line" ] }, "WordBreak": { "name": "WordBreak", "values": [ "normal", "break-all", "keep-all" ] }, "WordWrap": { "name": "WordWrap", "values": [ "normal", "break-word" ] }, "Wrap": { "name": "Wrap", "values": [ "soft", "hard" ] }, "WrapFlow": { "name": "WrapFlow", "values": [ "auto", "both", "start", "end", "clear", "minimum", "maximum" ] }, "WrapThrough": { "name": "WrapThrough", "values": [ "wrap", "none" ] }, "WritingMode": { "name": "WritingMode", "values": [ "lr-tb", "rl-tb", "tb-rl", "bt-rl", "tb-lr", "bt-lr", "lr-bt", "rl-bt", "lr", "rl", "tb" ] }, "YesNoAuto": { "name": "YesNoAuto", "values": [ "yes", "no", "auto" ] }, "ColorName": { "name": "ColorName", "values": [ "aliceBlue", "antiqueWhite", "aqua", "aquamarine", "azure", "beige", "bisque", "black", "blanchedAlmond", "blue", "blueViolet", "brown", "burlyWood", "cadetBlue", "chartreuse", "chocolate", "coral", "cornflowerBlue", "cornsilk", "crimson", "cyan", "darkBlue", "darkCyan", "darkGoldenrod", "darkGray", "darkGrey", "darkGreen", "darkKhaki", "darkMagenta", "darkOliveGreen", "darkOrange", "darkOrchid", "darkRed", "darkSalmon", "darkSeaGreen", "darkSlateBlue", "darkSlateGray", "darkSlateGrey", "darkTurquoise", "darkViolet", "deepPink", "deepSkyBlue", "dimGray", "dimGrey", "dodgerBlue", "fireBrick", "floralWhite", "forestGreen", "fuchsia", "gainsboro", "ghostWhite", "gold", "goldenrod", "gray", "green", "greenYellow", "grey", "honeydew", "hotPink", "indianRed", "indigo", "ivory", "khaki", "lavender", "lavenderBlush", "lawnGreen", "lemonChiffon", "lightBlue", "lightCoral", "lightCyan", "lightGoldenrodYellow", "lightGreen", "lightGray", "lightGrey", "lightPink", "lightSalmon", "lightSeaGreen", "lightSkyBlue", "lightSlateGray", "lightSlateGrey", "lightSteelBlue", "lightYellow", "lime", "limeGreen", "linen", "magenta", "maroon", "mediumAquamarine", "mediumBlue", "mediumOrchid", "mediumPurple", "mediumSeaGreen", "mediumSlateBlue", "mediumSpringGreen", "mediumTurquoise", "mediumVioletRed", "midnightBlue", "mintCream", "mistyRose", "moccasin", "navajoWhite", "navy", "oldLace", "olive", "oliveDrab", "orange", "orangeRed", "orchid", "paleGoldenrod", "paleGreen", "paleTurquoise", "paleVioletRed", "papayaWhip", "peachPuff", "peru", "pink", "plum", "powderBlue", "purple", "red", "rosyBrown", "royalBlue", "saddleBrown", "salmon", "sandyBrown", "seaGreen", "seashell", "sienna", "silver", "skyBlue", "slateBlue", "slateGray", "slateGrey", "snow", "springGreen", "steelBlue", "tan", "teal", "thistle", "tomato", "transparent", "turquoise", "violet", "wheat", "white", "whiteSmoke", "yellow", "yellowGreen" ] } }; })(F12.DomExplorer || (F12.DomExplorer = {})); var DomExplorer = F12.DomExplorer; })(F12 || (F12 = {})); //@ sourceMappingURL=enumMetadata.js.map // htmlMetadata.ts var F12; (function (F12) { (function (DomExplorer) { DomExplorer.htmlMetadata = { "a": { "tagName": "a", "attributes": { "href": { "name": "href" }, "target": { "name": "target" }, "rel": { "name": "rel" }, "media": { "name": "media" }, "hreflang": { "name": "hreflang" }, "type": { "name": "type" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "abbr": { "tagName": "abbr", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "address": { "tagName": "address", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "area": { "tagName": "area", "attributes": { "alt": { "name": "alt" }, "coords": { "name": "coords" }, "shape": { "name": "shape", "enumValueListName": "Shape" }, "href": { "name": "href" }, "target": { "name": "target" }, "rel": { "name": "rel" }, "media": { "name": "media" }, "hreflang": { "name": "hreflang" }, "type": { "name": "type" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "article": { "tagName": "article", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "aside": { "tagName": "aside", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "audio": { "tagName": "audio", "attributes": { "src": { "name": "src" }, "preload": { "name": "preload", "enumValueListName": "Buffering" }, "autoplay": { "name": "autoplay" }, "loop": { "name": "loop" }, "controls": { "name": "controls" }, "muted": { "name": "muted" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "b": { "tagName": "b", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "base": { "tagName": "base", "attributes": { "href": { "name": "href" }, "target": { "name": "target" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "basefont": { "tagName": "basefont", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "bdo": { "tagName": "bdo", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "bgsound": { "tagName": "bgsound", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "big": { "tagName": "big", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "blockquote": { "tagName": "blockquote", "attributes": { "cite": { "name": "cite" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "body": { "tagName": "body", "attributes": { "onafterprint": { "name": "onafterprint" }, "onbeforeprint": { "name": "onbeforeprint" }, "onbeforeunload": { "name": "onbeforeunload" }, "onblur": { "name": "onblur" }, "onerror": { "name": "onerror" }, "onfocus": { "name": "onfocus" }, "onhashchange": { "name": "onhashchange" }, "onload": { "name": "onload" }, "onmessage": { "name": "onmessage" }, "onoffline": { "name": "onoffline" }, "ononline": { "name": "ononline" }, "onpagehide": { "name": "onpagehide" }, "onpageshow": { "name": "onpageshow" }, "onpopstate": { "name": "onpopstate" }, "onredo": { "name": "onredo" }, "onresize": { "name": "onresize" }, "onstorage": { "name": "onstorage" }, "onundo": { "name": "onundo" }, "onunload": { "name": "onunload" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "br": { "tagName": "br", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "button": { "tagName": "button", "attributes": { "autofocus": { "name": "autofocus" }, "disabled": { "name": "disabled" }, "form": { "name": "form" }, "formaction": { "name": "formaction" }, "formenctype": { "name": "formenctype", "enumValueListName": "Enctype" }, "formmethod": { "name": "formmethod", "enumValueListName": "FormMethod" }, "formnovalidate": { "name": "formnovalidate" }, "formtarget": { "name": "formtarget" }, "name": { "name": "name" }, "type": { "name": "type", "enumValueListName": "Input" }, "value": { "name": "value" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "canvas": { "tagName": "canvas", "attributes": { "width": { "name": "width" }, "height": { "name": "height" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "caption": { "tagName": "caption", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "cite": { "tagName": "cite", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "code": { "tagName": "code", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "col": { "tagName": "col", "attributes": { "span": { "name": "span" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "colgroup": { "tagName": "colgroup", "attributes": { "span": { "name": "span" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "command": { "tagName": "command", "attributes": { "checked": { "name": "checked" }, "command": { "name": "command" }, "disabled": { "name": "disabled" }, "icon": { "name": "icon" }, "label": { "name": "label" }, "radiogroup": { "name": "radiogroup" }, "type": { "name": "type", "enumValueListName": "Command" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "datalist": { "tagName": "datalist", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "dd": { "tagName": "dd", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "del": { "tagName": "del", "attributes": { "cite": { "name": "cite" }, "datetime": { "name": "datetime" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "dfn": { "tagName": "dfn", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "dir": { "tagName": "dir", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "div": { "tagName": "div", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "dl": { "tagName": "dl", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "dt": { "tagName": "dt", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "em": { "tagName": "em", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "embed": { "tagName": "embed", "attributes": { "src": { "name": "src" }, "type": { "name": "type" }, "width": { "name": "width" }, "height": { "name": "height" }, "hidden": { "name": "hidden" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "fieldset": { "tagName": "fieldset", "attributes": { "disabled": { "name": "disabled" }, "form": { "name": "form" }, "name": { "name": "name" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "figcaption": { "tagName": "figcaption", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "figure": { "tagName": "figure", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "footer": { "tagName": "footer", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "form": { "tagName": "form", "attributes": { "accept-charset": { "name": "accept-charset" }, "action": { "name": "action" }, "autocomplete": { "name": "autocomplete", "enumValueListName": "OnOff" }, "enctype": { "name": "enctype", "enumValueListName": "Enctype" }, "method": { "name": "method", "enumValueListName": "FormMethod" }, "name": { "name": "name" }, "novalidate": { "name": "novalidate" }, "target": { "name": "target" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "h1": { "tagName": "h1", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "h2": { "tagName": "h2", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "h3": { "tagName": "h3", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "h4": { "tagName": "h4", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "h5": { "tagName": "h5", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "h6": { "tagName": "h6", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "head": { "tagName": "head", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "header": { "tagName": "header", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "hgroup": { "tagName": "hgroup", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "hr": { "tagName": "hr", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "html": { "tagName": "html", "attributes": { "manifest": { "name": "manifest" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "i": { "tagName": "i", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "iframe": { "tagName": "iframe", "attributes": { "src": { "name": "src" }, "srcdoc": { "name": "srcdoc" }, "name": { "name": "name" }, "sandbox": { "name": "sandbox", "enumValueListName": "Sandbox" }, "seamless": { "name": "seamless" }, "width": { "name": "width" }, "height": { "name": "height" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "img": { "tagName": "img", "attributes": { "alt": { "name": "alt" }, "src": { "name": "src" }, "usemap": { "name": "usemap" }, "ismap": { "name": "ismap" }, "width": { "name": "width" }, "height": { "name": "height" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "input": { "tagName": "input", "attributes": { "accept": { "name": "accept" }, "alt": { "name": "alt" }, "autocomplete": { "name": "autocomplete", "enumValueListName": "OnOff" }, "autofocus": { "name": "autofocus" }, "checked": { "name": "checked" }, "disabled": { "name": "disabled" }, "form": { "name": "form" }, "formaction": { "name": "formaction" }, "formenctype": { "name": "formenctype", "enumValueListName": "Enctype" }, "formmethod": { "name": "formmethod", "enumValueListName": "FormMethod" }, "formnovalidate": { "name": "formnovalidate" }, "formtarget": { "name": "formtarget" }, "height": { "name": "height" }, "list": { "name": "list" }, "max": { "name": "max" }, "maxlength": { "name": "maxlength" }, "min": { "name": "min" }, "multiple": { "name": "multiple" }, "name": { "name": "name" }, "pattern": { "name": "pattern" }, "placeholder": { "name": "placeholder" }, "readonly": { "name": "readonly" }, "required": { "name": "required" }, "size": { "name": "size" }, "src": { "name": "src" }, "step": { "name": "step", "enumValueListName": "Any" }, "type": { "name": "type", "enumValueListName": "Input" }, "value": { "name": "value" }, "width": { "name": "width" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "ins": { "tagName": "ins", "attributes": { "cite": { "name": "cite" }, "datetime": { "name": "datetime" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "kbd": { "tagName": "kbd", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "keygen": { "tagName": "keygen", "attributes": { "autofocus": { "name": "autofocus" }, "challenge": { "name": "challenge" }, "disabled": { "name": "disabled" }, "form": { "name": "form" }, "keytype": { "name": "keytype" }, "name": { "name": "name" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "label": { "tagName": "label", "attributes": { "form": { "name": "form" }, "for": { "name": "for" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "legend": { "tagName": "legend", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "li": { "tagName": "li", "attributes": { "value": { "name": "value" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "link": { "tagName": "link", "attributes": { "href": { "name": "href" }, "rel": { "name": "rel" }, "media": { "name": "media" }, "hreflang": { "name": "hreflang" }, "type": { "name": "type" }, "sizes": { "name": "sizes" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "map": { "tagName": "map", "attributes": { "name": { "name": "name" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "mark": { "tagName": "mark", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "menu": { "tagName": "menu", "attributes": { "type": { "name": "type", "enumValueListName": "Menu" }, "label": { "name": "label" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "meta": { "tagName": "meta", "attributes": { "name": { "name": "name" }, "http-equiv": { "name": "http-equiv" }, "content": { "name": "content" }, "charset": { "name": "charset" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "nav": { "tagName": "nav", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "noframes": { "tagName": "noframes", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "noscript": { "tagName": "noscript", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "object": { "tagName": "object", "attributes": { "data": { "name": "data" }, "type": { "name": "type" }, "name": { "name": "name" }, "usemap": { "name": "usemap" }, "form": { "name": "form" }, "width": { "name": "width" }, "height": { "name": "height" }, "typemustmatch": { "name": "typemustmatch" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "ol": { "tagName": "ol", "attributes": { "reversed": { "name": "reversed" }, "start": { "name": "start" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "optgroup": { "tagName": "optgroup", "attributes": { "disabled": { "name": "disabled" }, "label": { "name": "label" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "option": { "tagName": "option", "attributes": { "disabled": { "name": "disabled" }, "label": { "name": "label" }, "selected": { "name": "selected" }, "value": { "name": "value" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "output": { "tagName": "output", "attributes": { "for": { "name": "for" }, "form": { "name": "form" }, "name": { "name": "name" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "p": { "tagName": "p", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "param": { "tagName": "param", "attributes": { "name": { "name": "name" }, "value": { "name": "value" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "pre": { "tagName": "pre", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "progress": { "tagName": "progress", "attributes": { "value": { "name": "value" }, "max": { "name": "max" }, "form": { "name": "form" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "q": { "tagName": "q", "attributes": { "cite": { "name": "cite" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "rp": { "tagName": "rp", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "rt": { "tagName": "rt", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "ruby": { "tagName": "ruby", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "s": { "tagName": "s", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "samp": { "tagName": "samp", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "script": { "tagName": "script", "attributes": { "src": { "name": "src" }, "async": { "name": "async" }, "defer": { "name": "defer" }, "type": { "name": "type" }, "charset": { "name": "charset" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "section": { "tagName": "section", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "select": { "tagName": "select", "attributes": { "autofocus": { "name": "autofocus" }, "disabled": { "name": "disabled" }, "form": { "name": "form" }, "multiple": { "name": "multiple" }, "name": { "name": "name" }, "required": { "name": "required" }, "size": { "name": "size" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "small": { "tagName": "small", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "source": { "tagName": "source", "attributes": { "src": { "name": "src" }, "type": { "name": "type" }, "media": { "name": "media" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "span": { "tagName": "span", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "strike": { "tagName": "strike", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "strong": { "tagName": "strong", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "style": { "tagName": "style", "attributes": { "media": { "name": "media" }, "type": { "name": "type" }, "scoped": { "name": "scoped" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "sub": { "tagName": "sub", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "sup": { "tagName": "sup", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "table": { "tagName": "table", "attributes": { "summary": { "name": "summary" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "tbody": { "tagName": "tbody", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "td": { "tagName": "td", "attributes": { "colspan": { "name": "colspan" }, "rowspan": { "name": "rowspan" }, "headers": { "name": "headers" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "textarea": { "tagName": "textarea", "attributes": { "autofocus": { "name": "autofocus" }, "cols": { "name": "cols" }, "disabled": { "name": "disabled" }, "form": { "name": "form" }, "maxlength": { "name": "maxlength" }, "name": { "name": "name" }, "placeholder": { "name": "placeholder" }, "readonly": { "name": "readonly" }, "required": { "name": "required" }, "rows": { "name": "rows" }, "wrap": { "name": "wrap", "enumValueListName": "Wrap" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "tfoot": { "tagName": "tfoot", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "th": { "tagName": "th", "attributes": { "colspan": { "name": "colspan" }, "rowspan": { "name": "rowspan" }, "headers": { "name": "headers" }, "scope": { "name": "scope", "enumValueListName": "Scope" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "thead": { "tagName": "thead", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "title": { "tagName": "title", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "tr": { "tagName": "tr", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "track": { "tagName": "track", "attributes": { "src": { "name": "src" }, "srclang": { "name": "srclang" }, "kind": { "name": "kind" }, "label": { "name": "label" }, "default": { "name": "default" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "tt": { "tagName": "tt", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "u": { "tagName": "u", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "ul": { "tagName": "ul", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "var": { "tagName": "var", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "video": { "tagName": "video", "attributes": { "src": { "name": "src" }, "poster": { "name": "poster" }, "preload": { "name": "preload", "enumValueListName": "Buffering" }, "autoplay": { "name": "autoplay" }, "loop": { "name": "loop" }, "controls": { "name": "controls" }, "width": { "name": "width" }, "height": { "name": "height" }, "muted": { "name": "muted" }, "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } }, "wbr": { "tagName": "wbr", "attributes": { "accesskey": { "name": "accesskey" }, "class": { "name": "class" }, "contenteditable": { "name": "contenteditable", "enumValueListName": "TrueFalse" }, "contextmenu": { "name": "contextmenu" }, "dir": { "name": "dir", "enumValueListName": "Direction" }, "draggable": { "name": "draggable", "enumValueListName": "TrueFalse" }, "dropzone": { "name": "dropzone" }, "hidden": { "name": "hidden" }, "id": { "name": "id" }, "inert": { "name": "inert" }, "spellcheck": { "name": "spellcheck", "enumValueListName": "TrueFalse" }, "style": { "name": "style" }, "tabindex": { "name": "tabindex" }, "title": { "name": "title" }, "translate": { "name": "translate" } } } }; })(F12.DomExplorer || (F12.DomExplorer = {})); var DomExplorer = F12.DomExplorer; })(F12 || (F12 = {})); //@ sourceMappingURL=htmlMetadata.js.map // cssAndHtmlMetadataSource.ts var F12; (function (F12) { (function (DomExplorer) { var CssAndHtmlMetadataSource = (function () { function CssAndHtmlMetadataSource() { this._cssMetadata = F12.DomExplorer.cssPropertyMetadata; this._enumValueLists = F12.DomExplorer.enumMetadata; this._htmlMetadata = F12.DomExplorer.htmlMetadata; this._htmlTagNames = []; for(var htmlTagName in this._htmlMetadata) { this._htmlTagNames.push(htmlTagName); } this.sortEnumValueListContents(); } CssAndHtmlMetadataSource.prototype.getCssShorthandList = function () { var shorthandList = []; for(var property in this._cssMetadata) { if(this._cssMetadata[property].shorthand) { shorthandList.push(this._cssMetadata[property].name); } } shorthandList.sort(); return shorthandList; }; CssAndHtmlMetadataSource.prototype.getCssValueList = function (cssPropertyName) { var propertyMetadata = this._cssMetadata[cssPropertyName]; if(!propertyMetadata || !propertyMetadata.enumValueListName) { return null; } var list = this._enumValueLists[propertyMetadata.enumValueListName].values; list.sort(); return list; }; CssAndHtmlMetadataSource.prototype.getHtmlValueList = function (htmlTagName, htmlAttributeName) { var htmlElementMetadata = this._htmlMetadata[htmlTagName]; if(!htmlElementMetadata) { return null; } var htmlAttributeMetadata = htmlElementMetadata[htmlAttributeName]; if(!htmlAttributeMetadata) { return null; } var list = this._enumValueLists[htmlAttributeMetadata.enumValueListName].values; list.sort(); return list; }; CssAndHtmlMetadataSource.prototype.getHtmlTagNames = function () { return this._htmlTagNames; }; CssAndHtmlMetadataSource.prototype.getHtmlAttributeNames = function (htmlTagName) { var htmlAttributeNamesForGivenTagName = []; var htmlElementMetadata = this._htmlMetadata[htmlTagName]; if(!htmlElementMetadata) { return null; } for(var htmlAttributeName in htmlElementMetadata) { htmlAttributeNamesForGivenTagName.push(htmlAttributeName); } htmlAttributeNamesForGivenTagName.sort(); return htmlAttributeNamesForGivenTagName; }; CssAndHtmlMetadataSource.prototype.sortEnumValueListContents = function () { for(var listName in this._enumValueLists) { var listContainer = this._enumValueLists[listName]; listContainer.values.sort(); } }; return CssAndHtmlMetadataSource; })(); DomExplorer.CssAndHtmlMetadataSource = CssAndHtmlMetadataSource; })(F12.DomExplorer || (F12.DomExplorer = {})); var DomExplorer = F12.DomExplorer; })(F12 || (F12 = {})); //@ sourceMappingURL=cssAndHtmlMetadataSource.js.map // stylePropertyValueIntellisenseProvider.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var F12; (function (F12) { (function (DomExplorer) { var StylePropertyValueIntellisenseProvider = (function (_super) { __extends(StylePropertyValueIntellisenseProvider, _super); function StylePropertyValueIntellisenseProvider(cssPropertyName, cssAndHtmlMetadataSource) { _super.call(this, false); this._metadataSource = cssAndHtmlMetadataSource; this.updateChoices(cssPropertyName); } StylePropertyValueIntellisenseProvider.prototype.updateChoices = function (cssPropertyName) { var choices = []; var stringChoices = this._metadataSource.getCssValueList(cssPropertyName); if(stringChoices) { this._hasChoices = true; for(var i = 0; i < stringChoices.length; i++) { choices.push(new Common.Intellisense.IntellisenseChoice(stringChoices[i], "")); } } else { this._hasChoices = false; } this.choices = choices; }; StylePropertyValueIntellisenseProvider.prototype.clearChoices = function () { this.choices = []; this._hasChoices = false; }; Object.defineProperty(StylePropertyValueIntellisenseProvider.prototype, "hasChoices", { get: function () { return this._hasChoices; }, enumerable: true, configurable: true }); return StylePropertyValueIntellisenseProvider; })(Common.Intellisense.StaticContentProvider); DomExplorer.StylePropertyValueIntellisenseProvider = StylePropertyValueIntellisenseProvider; })(F12.DomExplorer || (F12.DomExplorer = {})); var DomExplorer = F12.DomExplorer; })(F12 || (F12 = {})); //@ sourceMappingURL=stylePropertyValueIntellisenseProvider.js.map // styleModel.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var Dom; (function (Dom) { var StyleModel = (function (_super) { __extends(StyleModel, _super); function StyleModel(_hostBridge, _domExplorer, _proxy, _styleCache) { var _this = this; _super.call(this); this._hostBridge = _hostBridge; this._domExplorer = _domExplorer; this._proxy = _proxy; this._styleCache = _styleCache; this._collapsedProperties = { }; this._styleProperties = []; this.listSource = function (callback, args) { var uid = args[0]; _this._styleCache.updateView(uid, function (styles) { _this._styles = styles; callback(_this._styles.rules); _this._collapsedProperties = { }; _this.currentSelection = null; _this._styles.rules.forEach(function (rule) { rule.properties.forEach(function (property) { _this._collapsedProperties[property.uid] = true; }); }); }); if(_this._styleProperties.length === 0) { _this._proxy.callRemote("getComputedStyles", [ uid ], function (computedStylesResultArray) { if(!computedStylesResultArray) { return; } var computedStyle = computedStylesResultArray[0]; for(var propertyName in computedStyle) { _this._styleProperties.push(propertyName); } var shorthandList = _this.cssAndHtmlMetadataSource.getCssShorthandList(); for(var propertyName in shorthandList) { _this._styleProperties.push(shorthandList[propertyName]); } _this._styleProperties.sort(); }); } }; this.cssAndHtmlMetadataSource = new F12.DomExplorer.CssAndHtmlMetadataSource(); } StyleModel._collapsedRules = { }; StyleModel.newUidTag = "new-"; StyleModel.newUidTagLength = StyleModel.newUidTag.length; StyleModel.nextUid = 0; StyleModel.clearCollapsedRules = function clearCollapsedRules() { StyleModel._collapsedRules = { }; }; StyleModel.prototype.forEachRule = function (func) { this._styles.rules.forEach(func); }; StyleModel.prototype.addUpdateListeners = function (listener) { this._styles.addUpdateListener(listener); }; StyleModel.prototype.select = function (selection) { this.currentSelection = selection; }; StyleModel.prototype.previousSelection = function (selection, navigateRulesOnly, allowSubProperties) { if (typeof allowSubProperties === "undefined") { allowSubProperties = true; } if(navigateRulesOnly) { if(selection.container) { return selection.container.container || selection.container; } return this.previousRule(selection); } var rule; var property; if(selection.isRule) { rule = this.previousRule(selection); if(rule && this.isExpanded(rule) && !this.isEmpty(rule)) { property = this.lastProperty(rule); if(allowSubProperties && this.isExpanded(property) && !this.isEmpty(property)) { return this.lastProperty(property); } return property; } return rule; } if(selection.isProperty) { property = this.previousProperty(selection); if(!property) { return selection.container; } if(allowSubProperties && this.isExpanded(property) && !this.isEmpty(property)) { return this.lastProperty(property); } return property; } property = this.previousProperty(selection); return allowSubProperties ? (property || selection.container) : selection.container; }; StyleModel.prototype.nextSelection = function (selection, navigateRulesOnly, allowSubProperties) { if (typeof allowSubProperties === "undefined") { allowSubProperties = true; } if(navigateRulesOnly) { var rule = selection.isRule ? selection : (selection.isProperty ? selection.container : selection.container.container); return this.nextRule(rule); } if(this.isExpanded(selection) && !this.isEmpty(selection)) { if(allowSubProperties || selection.isRule) { return this.firstProperty(selection); } } if(selection.isRule) { return this.nextRule(selection); } var next = this.nextProperty(selection); if(next && (allowSubProperties || next.isProperty)) { return next; } if(selection.isSubProperty && allowSubProperties) { next = this.nextProperty(selection.container); return next || this.nextRule(selection.container.container); } return this.nextRule(selection.container); }; StyleModel.prototype.outSelection = function () { var selection = this.currentSelection; return selection.container; }; StyleModel.prototype.inSelection = function () { var selection = this.currentSelection; return this.firstProperty(selection); }; StyleModel.prototype.firstRule = function () { return this._styles.rules[0]; }; StyleModel.prototype.lastRule = function () { return this._styles.rules[this._styles.rules.length - 1]; }; StyleModel.prototype.lastSelection = function (allowSubProperties) { if (typeof allowSubProperties === "undefined") { allowSubProperties = true; } var selection = this.lastRule(); if(this.isExpanded(selection) && !this.isEmpty(selection)) { selection = this.lastProperty(selection); if(this.isExpanded(selection) && !this.isEmpty(selection)) { selection = this.lastProperty(selection); } } return selection; }; StyleModel.prototype.nextRule = function (selection) { var rules = this._styles.rules; for(var i = 0; i < rules.length; i++) { if(rules[i] === selection) { return i < rules.length - 1 ? rules[i + 1] : null; } } }; StyleModel.prototype.previousRule = function (selection) { var rules = this._styles.rules; for(var i = 0; i < rules.length; i++) { if(rules[i] === selection) { return i > 0 ? rules[i - 1] : null; } } }; StyleModel.prototype.firstProperty = function (selection) { for(var i = 0; i < selection.properties.length; i++) { var property = selection.properties[i]; if(property.isApplied) { return property; } } }; StyleModel.prototype.lastProperty = function (selection) { for(var i = selection.properties.length - 1; i >= 0; i--) { var property = selection.properties[i]; if(property.isApplied) { return property; } } }; StyleModel.prototype.nextProperty = function (selection) { var properties = selection.container.properties; var found = false; for(var i = 0; i < properties.length; i++) { var property = properties[i]; if(found && property.isApplied) { return property; } else if(property === selection) { found = true; } } }; StyleModel.prototype.previousProperty = function (selection) { var properties = selection.container.properties; var previous; for(var i = 0; i < properties.length; i++) { var property = properties[i]; if(property === selection) { return previous; } if(property.isApplied) { previous = property; } } }; StyleModel.prototype.isExpanded = function (selection) { return !selection || !(selection.isRule ? StyleModel._collapsedRules : this._collapsedProperties)[selection.uid]; }; StyleModel.prototype.isEmpty = function (selection) { for(var i = 0; i < selection.properties.length; i++) { if(selection.properties[i].isApplied) { return false; } } return true; }; StyleModel.prototype.setExpanded = function (selection, isExpanded) { if(selection.isRule || (selection.isProperty && selection.properties.length)) { var list = selection.isRule ? StyleModel._collapsedRules : this._collapsedProperties; if(isExpanded) { delete list[selection.uid]; } else { list[selection.uid] = true; } } }; StyleModel.prototype.getStyleProperties = function () { return this._styleProperties; }; StyleModel.prototype.getPropertyById = function (propertyId) { return this._styles.getPropertyById(propertyId); }; StyleModel.prototype.getRuleById = function (ruleId) { return this._styles.getRuleById(ruleId); }; StyleModel.prototype.deleteProperty = function (property, callback) { this._proxy.callRemote("removeStyleProperty", [ property.uid ], function () { property.remove(false); if(callback) { callback(); } }); }; StyleModel.prototype.deleteRule = function (rule, callback) { var doChaining = rule.properties.length > 1; if(doChaining) { this.enableEditChaining(); } for(var i = 0; i < rule.properties.length; i++) { var property = rule.properties[i]; this.deleteProperty(property); } if(doChaining) { this.disableEditChaining(); } callback(this._styles.removeRule(rule)); }; StyleModel.prototype.createNewRule = function (selector) { return this._styles.createNewRule(selector); }; StyleModel.prototype.hoverElement = function (uid, show) { if(show) { this._domExplorer.temporaryShowElementHighlight(uid); } else { this._domExplorer.restoreElementHighlight(); } }; StyleModel.prototype.enableEditChaining = function () { this._proxy.callRemote("enableEditChaining"); }; StyleModel.prototype.disableEditChaining = function () { this._proxy.callRemote("disableEditChaining"); }; StyleModel.prototype.startSingleEdit = function () { this._proxy.callRemote("startSingleEdit"); }; StyleModel.prototype.endSingleEdit = function () { this._proxy.callRemote("endSingleEdit"); }; StyleModel.prototype.handleFileLinkClick = function (originalUrl, line, column) { try { var url = decodeURI(originalUrl); this._hostBridge.openDocumentLink(url, line, column); } catch (ex) { } }; return StyleModel; })(Common.ModelView.ListModel); Dom.StyleModel = StyleModel; })(Dom || (Dom = {})); //@ sourceMappingURL=styleModel.js.map // stylePropertyIntellisenseProvider.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var F12; (function (F12) { (function (DomExplorer) { var StylePropertyIntellisenseProvider = (function (_super) { __extends(StylePropertyIntellisenseProvider, _super); function StylePropertyIntellisenseProvider(stylePropertySource) { _super.call(this, false); var choices = []; var styleProperties = stylePropertySource.getStyleProperties(); for(var i = 0; i < styleProperties.length; i++) { choices.push(new Common.Intellisense.IntellisenseChoice(styleProperties[i], "")); } this.choices = choices; } return StylePropertyIntellisenseProvider; })(Common.Intellisense.StaticContentProvider); DomExplorer.StylePropertyIntellisenseProvider = StylePropertyIntellisenseProvider; })(F12.DomExplorer || (F12.DomExplorer = {})); var DomExplorer = F12.DomExplorer; })(F12 || (F12 = {})); //@ sourceMappingURL=stylePropertyIntellisenseProvider.js.map // styleView.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var Dom; (function (Dom) { (function (StyleMoveDirection) { StyleMoveDirection._map = []; StyleMoveDirection._map[0] = "none"; StyleMoveDirection.none = 0; StyleMoveDirection._map[1] = "up"; StyleMoveDirection.up = 1; StyleMoveDirection._map[2] = "down"; StyleMoveDirection.down = 2; })(Dom.StyleMoveDirection || (Dom.StyleMoveDirection = {})); var StyleMoveDirection = Dom.StyleMoveDirection; ; (function (StyleEditMode) { StyleEditMode._map = []; StyleEditMode._map[0] = "none"; StyleEditMode.none = 0; StyleEditMode._map[1] = "name"; StyleEditMode.name = 1; StyleEditMode._map[2] = "value"; StyleEditMode.value = 2; StyleEditMode._map[3] = "add"; StyleEditMode.add = 3; StyleEditMode._map[4] = "selector"; StyleEditMode.selector = 4; })(Dom.StyleEditMode || (Dom.StyleEditMode = {})); var StyleEditMode = Dom.StyleEditMode; ; var StyleView = (function (_super) { __extends(StyleView, _super); function StyleView(domExplorer, hostBridge, htmlElementSource, styleViewDivId, defaultItemTemplateId, model, localizer, alternateTemplates) { _super.call(this, htmlElementSource, styleViewDivId, defaultItemTemplateId, model, alternateTemplates, localizer); this._domExplorer = domExplorer; this._hostBridge = hostBridge; this._stylesListElement = this.htmlElementSource.getElementById(this.listViewDivId); this._model = model; this._domExplorer.horizontalPane.addResizeListener(this); this._scrollContainer = F12.DomExplorer.DomExplorerWindow.findAncestorByClass(this._stylesListElement, StyleView._cssScrollContainer); this._hotElement = undefined; this._hotElementTimeoutToken = 0; } StyleView._cssItem = "BPT-Style-Item"; StyleView._cssRule = "BPT-Style-Rule"; StyleView._cssPropertyContainer = "BPT-Style-Property-Container"; StyleView._cssProperty = "BPT-Style-Property"; StyleView._cssSubProperty = "BPT-Style-SubProperty"; StyleView._cssPropertyName = "BPT-Style-PropertyName"; StyleView._cssSubPropertyName = "BPT-Style-SubPropertyName"; StyleView._cssPropertyNameContainer = "BPT-Style-PropertyName-Container"; StyleView._cssPropertyValue = "BPT-Style-PropertyValue"; StyleView._cssSubPropertyValue = "BPT-Style-SubPropertyValue"; StyleView._cssPropertyValueContainer = "BPT-Style-PropertyValue-Container"; StyleView._cssPropertyColor = "BPT-Style-Color"; StyleView._cssPropertyColorHidden = "BPT-Style-Color-Hidden"; StyleView._cssPropertiesCollection = "BPT-Style-Properties"; StyleView._cssPropertyLonghand = "BPT-Style-Property-LongHand"; StyleView._cssExpandRuleIcon = "BPT-Style-ExpandIcon"; StyleView._cssExpandShorthandIcon = "BPT-Style-PropertyValue-ExpandIcon"; StyleView._cssCheckbox = "BPT-Style-Property-Checkbox"; StyleView._cssBlockFooter = "BPT-Style-BlockFooter"; StyleView._cssEmptyRuleSpace = "BPT-Style-EmptyRuleSpace"; StyleView._cssInvalidProperty = "BPT-Style-InvalidProperty"; StyleView._cssInheritedFromTarget = "BPT-Style-InheritedFromTarget"; StyleView._cssSelector = "BPT-Style-Selector"; StyleView._cssSelectorContainer = "BPT-Style-Selector-Container"; StyleView._cssNotWinning = "BPT-Style-NotWinning"; StyleView._cssNotApplied = "BPT-Style-Property-NotApplied"; StyleView._cssFileLink = "BPT-FileLink"; StyleView._cssScrollContainer = "BPT-DataTree-ScrollContainer"; StyleView._cssPropertyAriaOverridden = "BPT-Style-PropertyAriaOverridden"; StyleView._cssPropertyNameAriaInvalid = "BPT-Style-PropertyNameAriaInvalid"; StyleView._cssPropertyValueAriaInvalid = "BPT-Style-PropertyValueAriaInvalid"; StyleView._maxPropertyNameRows = 2; StyleView._maxPropertyValueRows = 5; StyleView._maxSelectorRows = 10; StyleView._attrUid = "data-uid"; StyleView.prototype.onPropertyChange = function (event, property, arg) { switch(event) { case Dom.StylePropertyChangeEvent.isWinning: this.onPropertyWinningRuleChange(property, arg); break; case Dom.StylePropertyChangeEvent.isEnabled: this.onPropertyEnableChange(property, arg); break; case Dom.StylePropertyChangeEvent.isApplied: this.onPropertyAppliedChange(property, arg); break; case Dom.StylePropertyChangeEvent.status: this.onPropertyStatusChange(property, arg); break; case Dom.StylePropertyChangeEvent.uid: this.onPropertyUidChange(property, arg); break; case Dom.StylePropertyChangeEvent.name: this.onPropertyNameChange(property, arg); break; case Dom.StylePropertyChangeEvent.value: this.onPropertyValueChange(property, arg); break; case Dom.StylePropertyChangeEvent.clearSubproperties: this.onPropertyClearSubproperties(property); break; case Dom.StylePropertyChangeEvent.addSubproperty: this.onPropertyAddSubproperty(property, arg); break; case Dom.StylePropertyChangeEvent.select: this.onPropertySelectChange(property); break; case Dom.StylePropertyChangeEvent.remove: this.onPropertyRemoveChange(property, arg); break; } this.checkPropertyColorUpdate(property); }; StyleView.prototype.onRuleChange = function (event, rule, args) { switch(event) { case Dom.StyleRuleChangeEvent.uid: this.onRuleUidChange(rule, args); break; case Dom.StyleRuleChangeEvent.selector: this.onRuleSelectorChange(rule, args); break; case Dom.StyleRuleChangeEvent.addProperty: this.onRuleAddPropertyChange(rule, args); break; } }; StyleView.prototype.onPropertyWinningRuleChange = function (property, isWinning) { var propertyElement = this.findPropertyElement(property); if(propertyElement) { if(property.isStrikeThrough) { propertyElement.classList.add(StyleView._cssNotWinning); } else { propertyElement.classList.remove(StyleView._cssNotWinning); } var propertyOverriddenElement = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(propertyElement, StyleView._cssPropertyAriaOverridden); if(propertyOverriddenElement) { propertyOverriddenElement.innerText = property.ariaOverriddenString; } } }; StyleView.prototype.onPaneResize = function (leftWidth, rightWidth) { this._stylesListElement.style.maxWidth = rightWidth + "px"; }; StyleView.prototype.adjustToPaneSize = function () { var pane = this._domExplorer.horizontalPane; this.onPaneResize(pane.leftWidth, pane.rightWidth); }; StyleView.prototype.postViewProcessing = function () { var _this = this; this._model.forEachRule(function (rule) { if(!_this._model.isExpanded(rule)) { var element = _this.findElementForSelection(rule); _this.toggleExpander(element, StyleView._cssRule); } }); this._model.addUpdateListeners(this); this.addEventHandlers(this._stylesListElement); this.adjustToPaneSize(); var ruleElement = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(this._stylesListElement, StyleView._cssRule); if(ruleElement) { ruleElement.tabIndex = 1; } this._model.forEachRule(function (rule) { rule.properties.forEach(function (property) { if(property.isEnabledIndeterminate) { property.notifyPropertyChange(Dom.StylePropertyChangeEvent.isEnabled, property, undefined); } }); }); if(this._refreshCallback) { this._refreshCallback(); this._refreshCallback = null; } }; StyleView.prototype.addEventHandlers = function (element) { this.addMouseEventHandlers(element); this.addKeyboardEventHandlers(element); this.addMenuEventHandlers(element); this.addMutationEventHandlers(element); }; StyleView.prototype.validateHotElement = function () { var e = this._hotElement; while(e) { if(e === this._stylesListElement) { return true; } e = e.parentNode; } if(this._hotElementTimeoutToken) { window.clearTimeout(this._hotElementTimeoutToken); } this._hotElement = undefined; return false; }; StyleView.prototype.addMouseEventHandlers = function (element) { var _this = this; this.addHandlers(element, "mousedown", [ StyleView._cssItem ], function (evt) { if(toolwindowHelpers.isContextMenuUp()) { return true; } if(_this._hotElementTimeoutToken) { window.clearTimeout(_this._hotElementTimeoutToken); _this._hotElementTimeoutToken = 0; } _this._hotElement = evt.target; _this._hotElementTimeoutToken = window.setTimeout(function () { _this._hotElement = undefined; _this._hotElementTimeoutToken = 0; }, 250); return true; }); this.addHandlers(element, "click", [ StyleView._cssItem ], function (evt) { if(toolwindowHelpers.isContextMenuUp()) { return true; } _this.validateHotElement(); var element = _this._hotElement || evt.target; if(element.classList.contains(StyleView._cssInheritedFromTarget)) { var uid = (evt.target).getAttribute("data-id"); var selector = "div.BPT-HtmlTreeItem[data-id='" + uid + "']"; var selectedItem = _this.htmlElementSource.querySelector(selector); if(selectedItem) { HtmlTreeView.select($m(selectedItem)); } return false; } var selection = _this.findClosestItem(element); if(selection) { if(element.classList.contains(StyleView._cssExpandRuleIcon)) { _this.toggleExpander(element, StyleView._cssRule); _this.currentSelection = selection; return false; } if(element.classList.contains(StyleView._cssExpandShorthandIcon)) { _this.toggleExpander(element, StyleView._cssProperty); _this.currentSelection = selection; return false; } if(element.classList.contains(StyleView._cssCheckbox) && (selection).status === Dom.StylePropertyStatus.valid) { _this.togglePropertyCheckbox(selection); _this.currentSelection = selection; return false; } if(element.classList.contains(StyleView._cssPropertyName)) { _this.prepareEditBox(selection, StyleEditMode.name); return false; } if(element.classList.contains(StyleView._cssPropertyValue)) { _this.prepareEditBox(selection, StyleEditMode.value); return false; } if(element.classList.contains(StyleView._cssSubPropertyValue)) { _this.editSubproperty(selection); return false; } if(element.classList.contains(StyleView._cssPropertyValueContainer) || element.classList.contains(StyleView._cssEmptyRuleSpace) || element.classList.contains(StyleView._cssBlockFooter) || element.classList.contains(StyleView._cssSelectorContainer)) { if(element.classList.contains(StyleView._cssBlockFooter)) { selection = _this._model.lastProperty(selection) || selection; } _this.prepareEditBox(selection, StyleEditMode.add); return false; } if(element.classList.contains(StyleView._cssSelector)) { if(selection.isEditable) { _this.prepareEditBox(selection, StyleEditMode.selector); return false; } } if(element.classList.contains(StyleView._cssFileLink)) { _this.openTargetElementFileLink(selection); return false; } _this.currentSelection = selection; } return !selection; }); this.addHandlers(element, "mouseover", [ StyleView._cssInheritedFromTarget ], function (evt) { _this.hoverRuleTarget(evt, true); return true; }); this.addHandlers(element, "mouseout", [ StyleView._cssInheritedFromTarget ], function (evt) { _this.hoverRuleTarget(evt, false); return true; }); }; StyleView.prototype.openTargetElementFileLink = function (rule) { var url = rule.styleHref; if(!url) { url = rule.fileUrl; } this._model.handleFileLinkClick(url, rule.fileLine, rule.fileColumn); }; StyleView.prototype.addKeyboardEventHandlers = function (element) { var _this = this; this.addHandlers(element, "keydown", [ StyleView._cssItem ], function (event) { if(toolwindowHelpers.isContextMenuUp()) { return true; } if(_this.isInEditMode) { return true; } var selection = _this.currentSelection; var shiftKey = event.shiftKey && !event.ctrlKey && !event.altKey; var ctrlKey = event.ctrlKey && !event.shiftKey && !event.altKey; var noKeys = !event.shiftKey && !event.ctrlKey && !event.altKey; if(event.keyCode === Common.KeyCodes.C && ctrlKey) { return !_this.copySelectionToClipboard(selection); } if(selection) { if(event.keyCode === Common.KeyCodes.ARROW_UP && (noKeys || shiftKey)) { _this.moveSelection(_this._model.previousSelection(selection, shiftKey)); return false; } if(event.keyCode === Common.KeyCodes.ARROW_DOWN && (noKeys || shiftKey)) { _this.moveSelection(_this._model.nextSelection(selection, shiftKey)); return false; } var element = _this.findElementForSelection(selection); if(event.keyCode === Common.KeyCodes.F10 && shiftKey) { var offset = element.getBoundingClientRect(); _this.showContextMenu(element, offset.left, offset.top); return false; } if(event.keyCode === Common.KeyCodes.ARROW_LEFT && noKeys) { if(!selection.isSubProperty && _this._model.isExpanded(selection)) { _this.toggleExpander(element, selection.isRule ? StyleView._cssRule : StyleView._cssProperty); } else { _this.moveSelection(_this._model.outSelection()); } return false; } if(event.keyCode === Common.KeyCodes.ARROW_RIGHT && noKeys) { if(!selection.isSubProperty) { if(_this._model.isExpanded(selection)) { _this.moveSelection(_this._model.inSelection()); } else { _this.toggleExpander(element, selection.isRule ? StyleView._cssRule : StyleView._cssProperty); } } return false; } if(event.keyCode === Common.KeyCodes.HOME && noKeys) { _this.moveSelection(_this._model.firstRule()); return false; } if(event.keyCode === Common.KeyCodes.END && noKeys) { _this.moveSelection(_this._model.lastRule()); return false; } if(event.keyCode === Common.KeyCodes.DELETE && noKeys) { if(selection.isRule || selection.isProperty) { _this.removeRuleOrProperty(selection); } return false; } if(selection.isProperty || selection.isSubProperty) { var property = selection; if(event.keyCode === Common.KeyCodes.SPACE && noKeys && property.status === Dom.StylePropertyStatus.valid) { return !_this.togglePropertyCheckbox(property); } if(event.keyCode === Common.KeyCodes.ENTER && noKeys) { if(selection.isProperty) { _this.prepareEditBox(selection, StyleEditMode.value); } else { _this.editSubproperty(selection); } return false; } if(event.keyCode === Common.KeyCodes.F2 && noKeys && selection.isProperty) { _this.prepareEditBox(selection, StyleEditMode.name); return false; } } else { if(event.keyCode === Common.KeyCodes.ENTER && noKeys) { var rule = selection; if(rule.isEditable) { _this.prepareEditBox(selection, StyleEditMode.selector); return false; } } } if(event.keyCode === Common.KeyCodes.SPACE && (noKeys || ctrlKey)) { return false; } } return true; }); }; StyleView.prototype.addMenuEventHandlers = function (element) { var _this = this; this.addHandlers(element, "contextmenu", [ StyleView._cssItem ], function (evt) { var selectedItem = null; var x = evt.clientX; var y = evt.clientY; if(x <= 0 || y <= 0) { selectedItem = _this.currentElementSelection; if(selectedItem) { var offset = selectedItem.getBoundingClientRect(); x = offset.left; y = offset.top; } } else { selectedItem = _this.htmlElementSource.elementFromPoint(x, y); if(selectedItem) { _this.select(selectedItem); } } _this.showContextMenu(selectedItem, x, y); return true; }); }; StyleView.prototype.addMutationEventHandlers = function (element) { var _this = this; this.addHandlers(element, "DOMAttrModified", [ StyleView._cssRule, StyleView._cssProperty, StyleView._cssSubProperty ], function (evt) { var targetElement = evt.target; var selection = _this.findClosestItem(targetElement); if(selection) { if(evt.attrName === "aria-expanded") { _this._model.setExpanded(selection, evt.newValue === "true"); } if(evt.attrName === "aria-checked" && (selection.isProperty || selection.isSubProperty) && evt.newValue !== "mixed") { var property = selection; var isEnabled = evt.newValue === "true"; if(property.isEnabled !== isEnabled) { _this.togglePropertyCheckbox(property); } } } return true; }); }; StyleView.prototype.editSubproperty = function (subproperty) { var ourProperty = subproperty.container; for(var i = subproperty.rule.properties.length - 1; i >= 0; i--) { var otherProperty = subproperty.rule.properties[i]; if(otherProperty === ourProperty) { break; } if(otherProperty.name === subproperty.name) { this.prepareEditBox(otherProperty, StyleEditMode.value); return; } } this.addProperty(subproperty.rule, subproperty.container, subproperty.name); }; StyleView.prototype.enterEditMode = function (selection, editMode) { var _this = this; var run = function (func) { _this.isInEditMode = true; setTimeout(func, 0); }; if(selection.isSubProperty) { selection = selection.container; } if(selection.isProperty) { var property = selection; switch(editMode) { case StyleEditMode.name: run(function () { _this.editPropertyName(property); }); return true; case StyleEditMode.value: run(function () { _this.editPropertyValue(property); }); return true; } } var rule = (selection.isRule ? selection : selection.container); switch(editMode) { case StyleEditMode.add: run(function () { _this.addProperty(rule, selection); }); return true; case StyleEditMode.selector: run(function () { _this.editSelector(rule); }); return true; } this.isInEditMode = false; return false; }; StyleView.prototype.moveEditBox = function (selection, property, direction, editMode, deleteProperty) { var newSelection; var newEditMode = editMode; var switchEditMode = function (newMode) { if(editMode !== StyleEditMode.none) { newEditMode = newMode; } }; while(!newSelection) { var cancelledAddProperty; var nextSelection = this._model.nextSelection(selection, false, false) || this._model.firstRule(); var previousSelection = this._model.previousSelection(selection, false, false) || this._model.lastSelection(); if(deleteProperty) { this._model.deleteProperty(property); selection = previousSelection; cancelledAddProperty = property.isNew; } if(direction === StyleMoveDirection.none) { newSelection = selection; } else if(direction === StyleMoveDirection.up) { if(previousSelection !== selection.container && previousSelection.isRule && this._model.isExpanded(previousSelection)) { newSelection = previousSelection; switchEditMode(StyleEditMode.add); } else if(previousSelection.isProperty) { newSelection = previousSelection; } else if(previousSelection.isEditable) { newSelection = previousSelection; switchEditMode(StyleEditMode.selector); } else { selection = previousSelection; } } else if(nextSelection.isProperty) { newSelection = nextSelection; } else if(!cancelledAddProperty && this._model.isExpanded(selection.container)) { newSelection = selection; switchEditMode(StyleEditMode.add); } else { if(nextSelection.isEditable) { newSelection = nextSelection; switchEditMode(StyleEditMode.selector); } else { selection = nextSelection; } } cancelledAddProperty = false; deleteProperty = false; } this.prepareEditBox(newSelection, newEditMode); }; StyleView.prototype.prepareEditBox = function (selection, editMode) { if(!this.enterEditMode(selection, editMode)) { this.currentSelection = selection; } }; StyleView.prototype.hoverRuleTarget = function (evt, show) { var uid = $m(evt.target).attr("data-id"); var model = this.model; this._model.hoverElement(uid, show); }; StyleView.prototype.findPropertyElement = function (property, subClass) { var selector = "." + (property.isSubProperty ? StyleView._cssSubProperty : StyleView._cssProperty) + "[data-uid='" + property.uid + "']"; if(subClass) { selector += " ." + subClass; } return this._stylesListElement.querySelector(selector); }; StyleView.prototype.findRuleElementById = function (uid, subClass) { var selector = "." + StyleView._cssRule + "[data-uid='" + uid + "']"; if(subClass) { selector += " ." + subClass; } return this._stylesListElement.querySelector(selector); }; StyleView.prototype.moveSelection = function (selection) { if(selection) { this.currentSelection = selection; return true; } }; StyleView.prototype.toggleExpander = function (element, className) { element = F12.DomExplorer.DomExplorerWindow.findAncestorByClass(element, className); element.setAttribute("aria-expanded", element.getAttribute("aria-expanded") === "true" ? "false" : "true"); }; StyleView.prototype.onPropertyEnableChange = function (property, isEnabled) { var element = this.findPropertyElement(property, StyleView._cssCheckbox); if(element) { element.checked = isEnabled !== false; element.indeterminate = isEnabled === undefined; var propertyElement = element.parentElement; var ariaChecked = element.indeterminate ? "mixed" : ("" + isEnabled); propertyElement.setAttribute("aria-checked", ariaChecked); } if(this._propertyEnableCallback) { this._propertyEnableCallback(isEnabled); this._propertyEnableCallback = null; } }; StyleView.prototype.onPropertyAppliedChange = function (property, isApplied) { var element = this.findPropertyElement(property); if(element) { element = element.parentElement; if(isApplied && element.classList.contains(StyleView._cssNotApplied)) { element.classList.remove(StyleView._cssNotApplied); } else if(!isApplied && !element.classList.contains(StyleView._cssNotApplied)) { element.classList.add(StyleView._cssNotApplied); } } }; StyleView.prototype.togglePropertyCheckbox = function (property) { property.toggleEnable(); return true; }; StyleView.prototype.onPropertyUidChange = function (property, newUid) { var element = this.findPropertyElement(property); if(element) { element.setAttribute(StyleView._attrUid, newUid); } }; StyleView.prototype.onPropertySelectChange = function (property) { var container = property.container; if(!this._model.isExpanded(container)) { var containerProperty = property.isSubProperty ? this.findPropertyElement(container) : this.findRuleElementById(container.uid); this.toggleExpander(containerProperty, property.isSubProperty ? StyleView._cssProperty : StyleView._cssRule); } this.currentSelection = property; }; StyleView.prototype.onPropertyRemoveChange = function (property, nextSelection) { var element = this.findPropertyElement(property); if(element) { var container = F12.DomExplorer.DomExplorerWindow.findAncestorByClass(element, StyleView._cssPropertyContainer); container.parentElement.removeChild(container); } if(nextSelection) { this.currentSelection = nextSelection; } }; StyleView.prototype.onRuleUidChange = function (rule, newUid) { var element = this.findRuleElementById(rule.uid); if(element) { element.setAttribute(StyleView._attrUid, newUid); } }; StyleView.prototype.onRuleSelectorChange = function (rule, selector) { var element = this.findRuleElementById(rule.uid, StyleView._cssSelector); if(element) { element.textContent = selector; } if(this._setRuleSelectorCallback) { this._setRuleSelectorCallback(element); this._setRuleSelectorCallback = null; } }; StyleView.prototype.onRuleAddPropertyChange = function (rule, property) { var element = this.findRuleElementById(rule.uid); if(element) { this.insertNewPropertyIntoView(element, property); this._model.setExpanded(property, false); } }; StyleView.prototype.onPropertyStatusChange = function (property, status) { var element = this.findPropertyElement(property); if(element) { var nameElement = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(element, StyleView._cssPropertyName); var valueElement = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(element, StyleView._cssPropertyValue); var nameInvalidElement = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(element, StyleView._cssPropertyNameAriaInvalid); var valueInvalidElement = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(element, StyleView._cssPropertyValueAriaInvalid); nameElement && nameElement.classList.remove(StyleView._cssInvalidProperty); valueElement && valueElement.classList.remove(StyleView._cssInvalidProperty); element.setAttribute("aria-invalid", "" + (status !== Dom.StylePropertyStatus.valid)); switch(status) { case Dom.StylePropertyStatus.invalidName: nameElement && nameElement.classList.add(StyleView._cssInvalidProperty); break; case Dom.StylePropertyStatus.invalidValue: valueElement && valueElement.classList.add(StyleView._cssInvalidProperty); break; case Dom.StylePropertyStatus.unknown: nameElement && nameElement.classList.add(StyleView._cssInvalidProperty); valueElement && valueElement.classList.add(StyleView._cssInvalidProperty); break; } if(nameInvalidElement) { nameInvalidElement.innerText = property.ariaInvalidNameString; } if(valueInvalidElement) { valueInvalidElement.innerText = property.ariaInvalidValueString; } } }; StyleView.prototype.onPropertyNameChange = function (property, name) { var element = this.findPropertyElement(property, property.isSubProperty ? StyleView._cssSubPropertyName : StyleView._cssPropertyName); if(element) { element.textContent = name; } if(this._propertyNameChangeCallback) { this._propertyNameChangeCallback(element); this._propertyNameChangeCallback = null; } }; StyleView.prototype.onPropertyValueChange = function (property, value) { var element = this.findPropertyElement(property, property.isSubProperty ? StyleView._cssSubPropertyValue : StyleView._cssPropertyValue); if(element) { element.textContent = value; } if(this._propertyAddCallback) { this._propertyAddCallback(element); this._propertyAddCallback = null; } }; StyleView.prototype.onPropertyClearSubproperties = function (property) { var propertyElement = this.findPropertyElement(property); if(propertyElement) { if(!propertyElement.classList.contains(StyleView._cssPropertyLonghand)) { propertyElement.classList.add(StyleView._cssPropertyLonghand); propertyElement.setAttribute("aria-expanded", "false"); propertyElement.removeAttribute("aria-setsize"); } if(this._model.isExpanded(property)) { this.toggleExpander(propertyElement, StyleView._cssProperty); } var subListElement = propertyElement.nextElementSibling; subListElement.innerHTML = ""; } this._model.setExpanded(property, false); }; StyleView.prototype.onPropertyAddSubproperty = function (property, subproperty) { var propertyElement = this.findPropertyElement(property); if(propertyElement.classList.contains(StyleView._cssPropertyLonghand)) { propertyElement.classList.remove(StyleView._cssPropertyLonghand); propertyElement.setAttribute("aria-expanded", "false"); } var subListElement = propertyElement.nextElementSibling; var newElement = this.instantiateTemplate("styleSubPropertyTemplate", subproperty); subListElement.appendChild(newElement); propertyElement.setAttribute("aria-setsize", property.properties.length); }; StyleView.prototype.checkPropertyColorUpdate = function (property) { var element = this.findPropertyElement(property, StyleView._cssPropertyColor); if(element) { if(property.isDisplayableColor) { element.style.backgroundColor = property.colorForDisplay; element.classList.remove(StyleView._cssPropertyColorHidden); } else { element.style.backgroundColor = ""; element.classList.add(StyleView._cssPropertyColorHidden); } } if(property.isSubProperty) { this.checkPropertyColorUpdate(property.owner); } }; StyleView.prototype.instantiateTemplate = function (templateId, obj) { var template = new T.Template({ htmlElementSource: document, templateId: templateId }); var newElement = this.htmlElementSource.createElement("div"); newElement.innerHTML = template.createTemplateText(obj); return newElement.firstElementChild; }; StyleView.prototype.editPropertyName = function (property) { var _this = this; this.currentSelection = property; var element = this.findElementForSelection(property, StyleView._cssPropertyName); var colonKey = new Dom.ValueEditorKey(":", true); var propertyNameEditor; var intellisenseContext; this._domExplorer.traceWriter.raiseEvent(Common.TraceEvents.Dom_Intellisense_Start); intellisenseContext = new Common.Intellisense.IntellisenseContext(new Common.Intellisense.InputElementTextEditorBridge(), new Common.Intellisense.IntellisenseMenu("intellisenseListBox", null, 500, true), new F12.DomExplorer.StylePropertyIntellisenseProvider(this._model), this._hostBridge); this._domExplorer.traceWriter.raiseEvent(Common.TraceEvents.Dom_Intellisense_Stop); propertyNameEditor = new Dom.ValueEditor(document, this._domExplorer, this._hostBridge, window, StyleView._maxPropertyNameRows, intellisenseContext); propertyNameEditor.addExitKeys(colonKey); var isAddingNewProperty = property.isNew; propertyNameEditor.show(element, Math.max((element && element.offsetWidth || 0) + 2, 100), function (newName, oldName) { property.commitName(newName); }, function (newName, oldName, exitKey, wasCancelled) { var direction = StyleMoveDirection.none; var editMode = StyleEditMode.none; if(!wasCancelled) { var doPropertyDelete = false; if(isAddingNewProperty) { _this.addEventHandlers(F12.DomExplorer.DomExplorerWindow.findAncestorByClass(element, StyleView._cssPropertyContainer)); } if(exitKey) { editMode = StyleEditMode.value; if(isAddingNewProperty && !newName) { if(exitKey.equalTo(Dom.ValueEditorKey.TabKey) || exitKey.equalTo(colonKey)) { direction = StyleMoveDirection.down; editMode = StyleEditMode.name; } else { direction = StyleMoveDirection.up; if(exitKey.equalTo(Dom.ValueEditorKey.EnterKey)) { editMode = StyleEditMode.none; } } } else { if(exitKey.equalTo(Dom.ValueEditorKey.ShiftTabKey)) { direction = StyleMoveDirection.up; } else if(exitKey.equalTo(Dom.ValueEditorKey.EnterKey) && !isAddingNewProperty) { editMode = StyleEditMode.none; } } } if(!newName) { doPropertyDelete = true; } } else if(property.isNew) { doPropertyDelete = true; } _this.moveEditBox(property, property, direction, editMode, doPropertyDelete); }); }; StyleView.prototype.editPropertyValue = function (property) { var _this = this; this.currentSelection = property; var element = this.findElementForSelection(property, StyleView._cssPropertyValue); var propertyElement = F12.DomExplorer.DomExplorerWindow.findAncestorByClass(element, StyleView._cssProperty); var provider; var intellisenseContext; var valueEditor; this._domExplorer.traceWriter.raiseEvent(Common.TraceEvents.Dom_Intellisense_Start); provider = new F12.DomExplorer.StylePropertyValueIntellisenseProvider(property.name, this._model.cssAndHtmlMetadataSource); provider.onShouldOpenOnTextChange = function (text) { return !text.match(/^-?\d/); }; intellisenseContext = new Common.Intellisense.IntellisenseContext(new Common.Intellisense.InputElementTextEditorBridge(), new Common.Intellisense.IntellisenseMenu("intellisenseListBox", null, 500, true), provider, this._hostBridge); this._domExplorer.traceWriter.raiseEvent(Common.TraceEvents.Dom_Intellisense_Stop); var semicolonKey = new Dom.ValueEditorKey(";"); valueEditor = new Dom.ValueEditor(document, this._domExplorer, this._hostBridge, window, StyleView._maxPropertyValueRows, intellisenseContext); valueEditor.addExitKeys(semicolonKey); valueEditor.enableCommitOnChange(); valueEditor.enableNumericChanges(); var isAddingNewProperty = property.isNew; this._model.enableEditChaining(); var isSingleEditStarted = false; var width = (propertyElement && propertyElement.offsetWidth || 0) - element.offsetLeft; var colorElement = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(propertyElement, StyleView._cssPropertyColor); var expanderElement = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(propertyElement, StyleView._cssExpandShorthandIcon); var colorStyle = window.getComputedStyle(colorElement); var expanderStyle = window.getComputedStyle(expanderElement); width += (colorElement && colorElement.offsetWidth || 0) + parseInt(colorStyle.marginLeft, 10) + parseInt(colorStyle.marginRight, 10) + (expanderElement && expanderElement.offsetWidth || 0) + parseInt(expanderStyle.marginLeft, 10) + parseInt(expanderStyle.marginRight, 10); element.textContent = element.textContent.trim(); valueEditor.show(element, width, function (newValue, oldValue) { if(!property.isNew && !isSingleEditStarted) { _this._model.startSingleEdit(); isSingleEditStarted = true; } property.commitValue(newValue); }, function (newValue, oldValue, exitKey, wasCancelled) { if(isSingleEditStarted) { _this._model.endSingleEdit(); } _this._model.disableEditChaining(); var direction = StyleMoveDirection.none; var editMode = StyleEditMode.none; var doPropertyDelete = false; if(!wasCancelled) { if(exitKey) { editMode = StyleEditMode.name; if(exitKey.equalTo(Dom.ValueEditorKey.EnterKey)) { editMode = StyleEditMode.none; } else if(!exitKey.equalTo(Dom.ValueEditorKey.ShiftTabKey)) { direction = StyleMoveDirection.down; } } } else if(isAddingNewProperty) { doPropertyDelete = true; } property.refreshValueDisplay(); _this.moveEditBox(property, property, direction, editMode, doPropertyDelete); if(_this._domExplorer.documentMode < 9 && (!_this.isFocusWithinInlineStyle || editMode == StyleEditMode.none)) { var selected = HtmlTreeView.getSelected($m("#tree")); _this._domExplorer.refreshElementForLowDocModes(selected, false); } }); }; StyleView.prototype.editSelector = function (rule, completionCallback) { var _this = this; this.currentSelection = rule; var element = this.findElementForSelection(rule, StyleView._cssSelector); var ruleElement = F12.DomExplorer.DomExplorerWindow.findAncestorByClass(element, StyleView._cssRule); var editor = new Dom.ValueEditor(document, this._domExplorer, this._hostBridge, window, StyleView._maxSelectorRows); editor.addExitKeys(new Dom.ValueEditorKey("{", true), new Dom.ValueEditorKey("{")); editor.show(element, (ruleElement && ruleElement.offsetWidth || 0) - element.offsetLeft, function (newSelector, oldSelector) { if(newSelector) { rule.selectorText = newSelector; } }, function (newSelector, oldSelector, exitKey, wasCancelled) { var direction = StyleMoveDirection.none; var editMode = StyleEditMode.none; var isSuccess = newSelector && !wasCancelled; if(isSuccess) { if(exitKey) { if(exitKey.equalTo(Dom.ValueEditorKey.EnterKey)) { direction = StyleMoveDirection.none; editMode = StyleEditMode.none; } else if(exitKey.equalTo(Dom.ValueEditorKey.ShiftTabKey)) { direction = StyleMoveDirection.up; editMode = StyleEditMode.value; } else { direction = StyleMoveDirection.down; editMode = StyleEditMode.name; } } } else { element.textContent = oldSelector; } if(completionCallback) { completionCallback(isSuccess); } var property = rule.properties[0]; _this.moveEditBox(rule, property, direction, editMode, false); }); }; StyleView.prototype.showContextMenu = function (selectedItem, x, y) { var _this = this; var selection; if(selectedItem != null) { selection = this.findClosestItem(selectedItem); } var hasSelectedItem = !!selection; var isProperty = hasSelectedItem && selection.isProperty; var isSubProperty = hasSelectedItem && selection.isSubProperty; var isRule = hasSelectedItem && selection.isRule; var hasSelectedText = toolwindowHelpers.hasSelectedText(); var rule = hasSelectedItem && (isRule ? selection : (selection).rule); var canCopy = hasSelectedItem || hasSelectedText; var contextMenu = [ { id: "addRule", text: toolwindowHelpers.loadString("AddRuleMenuText"), enabled: true }, { id: "addProperty", text: toolwindowHelpers.loadString("AddPropertyMenuText"), enabled: hasSelectedItem }, "separator", { id: "remove", text: toolwindowHelpers.loadString("RemoveStyleMenuText"), enabled: hasSelectedItem && (isProperty || (isRule && !rule.isInlined)) }, "separator", { id: "copy", text: toolwindowHelpers.loadString("CopyMenuText"), enabled: canCopy }, { id: "copyRule", text: toolwindowHelpers.loadString("CopyRuleMenuText"), enabled: hasSelectedItem }, { id: "copyProperty", text: toolwindowHelpers.loadString("CopyPropertyMenuText"), enabled: isProperty || isSubProperty }, "separator", { id: "refreshStyles", text: toolwindowHelpers.loadString("RefreshStyleMenuText"), enabled: true }, { id: "viewSource", text: toolwindowHelpers.loadString("ViewSourceMenuText"), enabled: !!(rule && rule.fileUrl) } ]; toolwindowHelpers.showContextMenu("styleMenu", contextMenu, x, y, function (id, menuItem) { if(id === "styleMenu") { switch(menuItem) { case "addRule": _this.addRule(); break; case "addProperty": _this.enterEditMode(selection, StyleEditMode.add); break; case "remove": _this.removeRuleOrProperty(selection); break; case "copy": _this.copySelectionToClipboard(selection); break; case "copyRule": clipboardData.setData("Text", rule.formatForCopy); break; case "copyProperty": var property = selection; clipboardData.setData("Text", property.formatForCopy); break; case "refreshStyles": _this.refresh(); break; case "viewSource": _this.openTargetElementFileLink(rule); break; } } }); }; Object.defineProperty(StyleView.prototype, "isFocusWithinInlineStyle", { get: function () { var selectedElement = this.currentElementSelection; if(!selectedElement) { return false; } var selection = this.findClosestItem(selectedElement); if(!selection) { return false; } var rule = (selection.isRule ? selection : selection.container); return rule && rule.isInlined; }, enumerable: true, configurable: true }); StyleView.prototype.refresh = function (value) { this._refreshCallback = value; this._domExplorer.refreshCSSView(); }; StyleView.prototype.removeRuleOrProperty = function (selection, callback) { var _this = this; var nextSelection; var element = this.findElementForSelection(selection); if(selection.isProperty) { nextSelection = this._model.nextSelection(selection, false, false) || this._model.previousSelection(selection, false, false) || this._model.firstRule(); this._model.deleteProperty(selection, function () { _this.currentSelection = nextSelection; if(callback) { callback(true); } }); } else { nextSelection = this._model.nextSelection(selection, true, false) || this._model.previousSelection(selection, true, false) || this._model.firstRule(); this._model.deleteRule(selection, function (ruleDeleted) { var listItem = F12.DomExplorer.DomExplorerWindow.findAncestorByClass(element, StyleView._cssItem); if(ruleDeleted) { listItem.parentElement.removeChild(listItem); } else { var properties = listItem.querySelectorAll("." + StyleView._cssProperty); for(var i = 0; i < properties.length; i++) { var property = properties[i]; property.parentElement.removeChild(property); } } _this.currentSelection = ruleDeleted ? nextSelection : selection; if(callback) { callback(ruleDeleted); } }); } }; StyleView.prototype.insertNewPropertyIntoView = function (ruleElement, property) { var newElement = this.instantiateTemplate("stylePropertyTemplate", property); var itemElement = F12.DomExplorer.DomExplorerWindow.findAncestorByClass(ruleElement, StyleView._cssItem); var propertyList = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(itemElement, StyleView._cssPropertiesCollection); var nextProperty = this._model.nextProperty(property); var nextElement; if(nextProperty) { nextElement = this.findElementForSelection(nextProperty).parentElement; } else { var blockFooter = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(propertyList, StyleView._cssBlockFooter); nextElement = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(propertyList, StyleView._cssBlockFooter); } propertyList.insertBefore(newElement, blockFooter); propertyList.insertBefore(newElement, nextElement); return newElement; }; StyleView.prototype.addProperty = function (rule, after, propertyName, propertyValue) { var ruleElement = this.findElementForSelection(rule); var itemElement = F12.DomExplorer.DomExplorerWindow.findAncestorByClass(ruleElement, StyleView._cssItem); if(!this._model.isExpanded(rule)) { this.toggleExpander(ruleElement, StyleView._cssRule); } var before = this._model.nextSelection(after, false, false); var property = rule.addProperty(null, false, !before || before.isRule ? null : before); this._model.setExpanded(property, false); if(propertyName) { property.commitName(propertyName); } var newElement = this.insertNewPropertyIntoView(ruleElement, property); toolwindowHelpers.scrollIntoView(newElement, this._scrollContainer); if(propertyName && propertyValue !== undefined) { property.commitValue(propertyValue); } else { this.prepareEditBox(property, propertyName ? StyleEditMode.value : StyleEditMode.name); } }; StyleView.prototype.addRule = function (selector, propertyName, propertyValue) { var _this = this; var defaultSelector = ""; var selected = HtmlTreeView.getSelected($m("#tree")); if(selected.length > 0) { var header = selected.children(".BPT-HtmlTreeItem-Header"); defaultSelector = header.find(".BPT-HTML-Attribute-Section[data-attrName='id'] .BPT-HTML-Value").text(); if(defaultSelector) { defaultSelector = "#" + defaultSelector.trim(); } else { defaultSelector = header.find(".BPT-HTML-Attribute-Section[data-attrName='class'] .BPT-HTML-Value").text(); if(defaultSelector) { defaultSelector = "." + defaultSelector.trim().split(" ")[0]; } else { defaultSelector = selected.attr("data-tag"); } } } var template = new T.Template({ htmlElementSource: document, templateId: "styleRuleTemplate" }, null, Plugin.Resources); var rule = this._model.createNewRule(selector || defaultSelector); var newElement = this.instantiateTemplate("styleRuleTemplate", rule); var nextRule = this._model.nextRule(rule); if(nextRule) { this._stylesListElement.insertBefore(newElement, this.findElementForSelection(nextRule).parentElement); } else { this._stylesListElement.appendChild(newElement); } this.adjustToPaneSize(); toolwindowHelpers.scrollIntoView(newElement, this._scrollContainer); if(selector) { this.addProperty(rule, rule, propertyName, propertyValue); } else { var selectorElement = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(newElement, StyleView._cssSelector); this.editSelector(rule, function (isSuccess) { if(isSuccess) { rule.selectorText = selectorElement.textContent; _this.addEventHandlers(newElement); } else { _this._model.deleteRule(rule, function (ruleDeleted) { _this._stylesListElement.removeChild(newElement); }); } }); } }; StyleView.prototype.findClosestItem = function (element) { var selection; var selectedElement = F12.DomExplorer.DomExplorerWindow.findAncestorByClass(element, StyleView._cssSubProperty); if(selectedElement) { selection = this._model.getPropertyById(StyleView.getSubpropertyId(selectedElement)); } if(!selection) { selectedElement = F12.DomExplorer.DomExplorerWindow.findAncestorByClass(element, StyleView._cssProperty); if(selectedElement) { selection = this._model.getPropertyById(StyleView.getPropertyId(selectedElement)); } } if(!selection) { var selectedElement = F12.DomExplorer.DomExplorerWindow.findAncestorByClass(element, StyleView._cssRule); if(selectedElement) { selection = this._model.getRuleById(StyleView.getRuleId(selectedElement)); } } if(!selection) { var selectedElement = F12.DomExplorer.DomExplorerWindow.findAncestorByClass(element, StyleView._cssItem); if(selectedElement) { selectedElement = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(selectedElement, StyleView._cssRule); if(selectedElement) { selection = this._model.getRuleById(StyleView.getRuleId(selectedElement)); } } } return selection; }; StyleView.prototype.findElementForSelection = function (selection, className) { return this._stylesListElement.querySelector("[data-uid='" + selection.uid + "']" + (className ? " ." + className : "")); }; Object.defineProperty(StyleView.prototype, "currentSelection", { get: function () { var selection = this._model.currentSelection; if(!selection) { var selectedElement = this.currentElementSelection; if(selectedElement) { selection = this.findClosestItem(selectedElement); this._model.select(selection); } } return selection; }, set: function (selection) { this._model.currentSelection = selection; var element = this.findElementForSelection(selection); if(element) { this.setFocus(element); } }, enumerable: true, configurable: true }); StyleView.prototype.select = function (selectedElement) { var selection = this.findClosestItem(selectedElement); if(selection) { this.currentSelection = selection; return true; } return false; }; Object.defineProperty(StyleView.prototype, "currentElementSelection", { get: function () { return this._stylesListElement.querySelector(":focus"); }, enumerable: true, configurable: true }); StyleView.isRuleExpanded = function isRuleExpanded(element) { element = F12.DomExplorer.DomExplorerWindow.findAncestorByClass(element, StyleView._cssRule); return element.getAttribute("aria-expanded") === "true"; }; StyleView.isPropertyExpanded = function isPropertyExpanded(element) { element = F12.DomExplorer.DomExplorerWindow.findAncestorByClass(element, StyleView._cssProperty); return element.getAttribute("aria-expanded") === "true"; }; StyleView.isSubProperty = function isSubProperty(element) { return element.classList.contains(StyleView._cssSubProperty); }; StyleView.isProperty = function isProperty(element) { return element.classList.contains(StyleView._cssProperty); }; StyleView.isRule = function isRule(element) { return element.classList.contains(StyleView._cssRule); }; StyleView.getSubpropertyId = function getSubpropertyId(element) { element = F12.DomExplorer.DomExplorerWindow.findAncestorByClass(element, StyleView._cssSubProperty); return element ? element.getAttribute(StyleView._attrUid) : null; }; StyleView.getPropertyId = function getPropertyId(element) { element = F12.DomExplorer.DomExplorerWindow.findAncestorByClass(element, StyleView._cssProperty); return element.getAttribute(StyleView._attrUid); }; StyleView.getRuleId = function getRuleId(element) { element = F12.DomExplorer.DomExplorerWindow.findAncestorByClass(element, StyleView._cssRule); return element.getAttribute(StyleView._attrUid); }; StyleView.getRuleFileLinkElement = function getRuleFileLinkElement(ruleElement) { var fileLinkElement; if(ruleElement && StyleView.isRule(ruleElement)) { fileLinkElement = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(ruleElement, StyleView._cssFileLink); } return fileLinkElement; }; StyleView.findAncestorRuleOrProperty = function findAncestorRuleOrProperty(element) { var subpropertyElement = F12.DomExplorer.DomExplorerWindow.findAncestorByClass(element, StyleView._cssSubProperty); if(subpropertyElement) { return subpropertyElement; } var propertyElement = F12.DomExplorer.DomExplorerWindow.findAncestorByClass(element, StyleView._cssProperty); if(propertyElement) { return propertyElement; } var ruleElement = F12.DomExplorer.DomExplorerWindow.findAncestorByClass(element, StyleView._cssRule); if(ruleElement) { return ruleElement; } return null; }; StyleView.prototype.copySelectionToClipboard = function (selection) { if(toolwindowHelpers.hasSelectedText()) { return toolwindowHelpers.copySelectedTextToClipboard(); } if(selection) { var text = null; if(selection.isProperty || selection.isSubProperty) { var property = selection; text = property.formatForCopy; } else { var rule = selection; text = rule.formatForCopy; } if(text) { clipboardData.setData("Text", text); return true; } } return false; }; Object.defineProperty(StyleView.prototype, "propertyAddCallback", { set: function (value) { this._propertyAddCallback = value; }, enumerable: true, configurable: true }); Object.defineProperty(StyleView.prototype, "propertyNameChangeCallback", { set: function (value) { this._propertyNameChangeCallback = value; }, enumerable: true, configurable: true }); Object.defineProperty(StyleView.prototype, "propertyEnableCallback", { set: function (value) { this._propertyEnableCallback = value; }, enumerable: true, configurable: true }); Object.defineProperty(StyleView.prototype, "setRuleSelectorCallback", { set: function (value) { this._setRuleSelectorCallback = value; }, enumerable: true, configurable: true }); Object.defineProperty(StyleView.prototype, "ruleCount", { get: function () { return this._stylesListElement.children.length; }, enumerable: true, configurable: true }); StyleView.prototype.findRuleElement = function (index) { if(index >= 0 && index < this._stylesListElement.children.length) { return this._stylesListElement.children[index]; } return null; }; StyleView.prototype.findPropertyElementForRule = function (ruleElement, name) { var nameElements = F12.DomExplorer.DomExplorerWindow.findAllDescendentsByClass(ruleElement, StyleView._cssPropertyName); for(var i = 0; i < nameElements.length; i++) { var nameElement = nameElements[i]; if(nameElement.textContent === name) { return F12.DomExplorer.DomExplorerWindow.findAncestorByClass(nameElement, StyleView._cssProperty); } } return null; }; StyleView.prototype.findSubPropertyElementForRule = function (ruleElement, name) { var nameElements = F12.DomExplorer.DomExplorerWindow.findAllDescendentsByClass(ruleElement, StyleView._cssSubPropertyName); for(var i = 0; i < nameElements.length; i++) { var nameElement = nameElements[i]; if(nameElement.textContent === name) { return F12.DomExplorer.DomExplorerWindow.findAncestorByClass(nameElement, StyleView._cssSubProperty); } } return null; }; StyleView.prototype.setPropertyValue = function (propertyElement, value) { var propertyId = StyleView.getPropertyId(propertyElement); var property = this._model.getPropertyById(propertyId); property.commitValue(value); }; StyleView.prototype.setPropertyName = function (propertyElement, name) { var propertyId = StyleView.getPropertyId(propertyElement); var property = this._model.getPropertyById(propertyId); property.commitName(name); }; StyleView.prototype.setRuleSelector = function (ruleElement, selector) { var ruleId = StyleView.getRuleId(ruleElement); var rule = this._model.getRuleById(ruleId); rule.selectorText = selector; }; return StyleView; })(Common.ModelView.ListView); Dom.StyleView = StyleView; })(Dom || (Dom = {})); //@ sourceMappingURL=styleView.js.map // traceStyleModel.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var Dom; (function (Dom) { var TraceStyle = (function () { function TraceStyle(name, propertyId, value, colorForDisplay, startExpanded) { this.name = name; this.propertyId = propertyId; this.value = value; this.colorForDisplay = colorForDisplay; this.startExpanded = startExpanded; this.sources = []; this.enabledCount = 0; } Object.defineProperty(TraceStyle.prototype, "isDisplayableColor", { get: function () { return !!this.colorForDisplay; }, enumerable: true, configurable: true }); Object.defineProperty(TraceStyle.prototype, "isEnabled", { get: function () { return this.enabledCount > 0; }, enumerable: true, configurable: true }); Object.defineProperty(TraceStyle.prototype, "isEnabledIndeterminate", { get: function () { return this.enabledCount > 0 && this.enabledCount < this.sources.length; }, enumerable: true, configurable: true }); TraceStyle.prototype.addSource = function (selector, name, value, propertyId, ruleId, fileUrl, fileName, isWinning, isEnabled, colorForDisplay) { this.sources.push(new TraceStyleSource(selector, name, value, propertyId, ruleId, fileUrl, fileName, isWinning, isEnabled, colorForDisplay)); if(isEnabled) { this.enabledCount++; } }; return TraceStyle; })(); Dom.TraceStyle = TraceStyle; var TraceStyleSource = (function () { function TraceStyleSource(selector, name, value, propertyId, ruleId, fileUrl, fileName, isWinning, isEnabled, colorForDisplay) { this.selector = selector; this.name = name; this.value = value; this.propertyId = propertyId; this.ruleId = ruleId; this.fileUrl = fileUrl; this.fileName = fileName; this.isWinning = isWinning; this.isEnabled = isEnabled; this.colorForDisplay = colorForDisplay; } TraceStyleSource.prototype.isDisplayableColor = function () { return !!this.colorForDisplay; }; return TraceStyleSource; })(); Dom.TraceStyleSource = TraceStyleSource; var TraceStyleModel = (function (_super) { __extends(TraceStyleModel, _super); function TraceStyleModel(_proxy, _styleCache) { var _this = this; _super.call(this); this._proxy = _proxy; this._styleCache = _styleCache; this.listSource = function (callback, args) { _this._uid = args[0]; _this._styleCache.updateView(_this._uid, function (styles) { _this._styles = styles; _this._traceStyles = _this.assembleTraceStyles(styles.rules); callback(_this._traceStyles); }); }; } TraceStyleModel._expandedProperties = { }; TraceStyleModel.prototype.forEachProperty = function (func) { this._traceStyles.forEach(func); }; TraceStyleModel.prototype.registerUpdateListeners = function (listener) { this._styles.addUpdateListener(listener); }; TraceStyleModel.prototype.assembleTraceStyles = function (rules) { var sources = { }; var propertyNames = []; for(var i = 0; i < rules.length; i++) { var rule = rules[i]; for(var j = 0; j < rule.properties.length; j++) { var property = rule.properties[j]; if(property.isApplied && property.status === Dom.StylePropertyStatus.valid) { var addProperty = function (property) { if(!sources[property.name]) { sources[property.name] = []; propertyNames.push(property.name); } sources[property.name].push({ rule: rule, property: property }); if(property.isWinning) { sources[property.name].winning = property; } }; if(property.isShorthand) { property.properties.forEach(addProperty); } else { addProperty(property); } } } } propertyNames.sort(); var traceStyles = []; for(i = 0; i < propertyNames.length; i++) { var propertyName = propertyNames[i]; var source = sources[propertyName]; var winning = sources[propertyName].winning; if(!winning) { winning = sources[propertyName][0]; } var traceStyle = new TraceStyle(propertyName, winning.uid, winning.value, winning.colorForDisplay, TraceStyleModel._expandedProperties[propertyName]); var url; var linkText; if(source) { for(var j = 0; j < source.length; j++) { var rule = source[j].rule; var property = source[j].property; traceStyle.addSource(rule.selectorText, propertyName, property.valueForDisplay, property.uid, rule.uid, rule.styleHref, linkText, property.isWinning, property.isEnabled, property.colorForDisplay); } } traceStyles.push(traceStyle); } return traceStyles; }; TraceStyleModel.prototype.toggleEnabled = function (propertyId, isEnabled) { var property = this._styles.getPropertyById(propertyId); if(property) { if(isEnabled === undefined || isEnabled !== property.isEnabled) { property.toggleEnable(); } } }; TraceStyleModel.prototype.createPropertyCopyText = function (propertyId) { var property = this._styles.getPropertyById(propertyId); return property ? property.formatForCopy : ""; }; TraceStyleModel.prototype.markExpandState = function (propertyName, isExpanded) { if(isExpanded) { TraceStyleModel._expandedProperties[propertyName] = true; } else { delete TraceStyleModel._expandedProperties[propertyName]; } }; TraceStyleModel.clearExpandedProperties = function clearExpandedProperties() { TraceStyleModel._expandedProperties = { }; }; TraceStyleModel.prototype.findTraceStyleByName = function (name) { for(var i = 0; i < this._traceStyles.length; i++) { var property = this._traceStyles[i]; if(property.name === name) { return property; } } }; TraceStyleModel.prototype.findPropertyById = function (uid) { return this._styles.getPropertyById(uid); }; return TraceStyleModel; })(Common.ModelView.ListModel); Dom.TraceStyleModel = TraceStyleModel; })(Dom || (Dom = {})); //@ sourceMappingURL=traceStyleModel.js.map // traceStyleView.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var Dom; (function (Dom) { var TraceStyleView = (function (_super) { __extends(TraceStyleView, _super); function TraceStyleView(htmlElementSource, TraceStyleViewDivId, defaultItemTemplateId, model, alternateTemplates) { _super.call(this, htmlElementSource, TraceStyleViewDivId, defaultItemTemplateId, model, alternateTemplates); this._listElement = this.htmlElementSource.getElementById(this.listViewDivId); this._model = model; } TraceStyleView._cssItem = "BPT-TraceStyle-Item"; TraceStyleView._cssHeader = "BPT-TraceStyle-Header"; TraceStyleView._cssHeaderName = "BPT-TraceStyle-HeaderName"; TraceStyleView._cssHeaderValue = "BPT-TraceStyle-HeaderValue"; TraceStyleView._cssHeaderColor = "BPT-TraceStyle-HeaderColor"; TraceStyleView._cssSource = "BPT-TraceStyle-Source"; TraceStyleView._cssExpandIcon = "BPT-TraceStyle-ExpandIcon"; TraceStyleView._cssCollapsedSection = "BPT-TraceStyle-Collapsed-Section"; TraceStyleView._cssHeaderCheckbox = "BPT-TraceStyle-HeaderCheckbox"; TraceStyleView._cssSourceCheckbox = "BPT-TraceStyle-SourceCheckbox"; TraceStyleView._cssSourceValue = "BPT-TraceStyle-SourceValue"; TraceStyleView._cssSourceColor = "BPT-TraceStyle-SourceColor"; TraceStyleView._cssNotWinning = "BPT-TraceStyle-NotWinning"; TraceStyleView.prototype.onPropertyChange = function (event, property, args) { switch(event) { case Dom.StylePropertyChangeEvent.isWinning: this.onPropertyWinningRuleChange(property.uid, args); break; case Dom.StylePropertyChangeEvent.isEnabled: this.onPropertyEnableChange(property, args); break; case Dom.StylePropertyChangeEvent.value: this.onPropertyValueChange(property, args); break; } var headerElement = this._listElement.querySelector("." + TraceStyleView._cssHeader + "[data-name='" + property.name + "']"); if(headerElement) { var valueElement = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(headerElement, TraceStyleView._cssHeaderValue); var colorElement = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(headerElement, TraceStyleView._cssHeaderColor); if(property.isWinning) { headerElement.setAttribute("data-uid", property.uid); valueElement.textContent = property.value; if(property.isDisplayableColor) { colorElement.style.backgroundColor = property.colorForDisplay; colorElement.style.display = "block"; } else { colorElement.style.display = "none"; } } else if(headerElement.getAttribute("data-uid") === property.uid) { headerElement.setAttribute("data-uid", ""); valueElement.textContent = ""; colorElement.style.display = "none"; } var traceStyle = this._model.findTraceStyleByName(property.name); this.setCheckboxState(traceStyle); } }; TraceStyleView.prototype.onRuleChange = function (event, rule, args) { }; TraceStyleView.prototype.onPropertyWinningRuleChange = function (uid, isWinning) { var sourceElement = this._listElement.querySelector("." + TraceStyleView._cssSource + "[data-uid='" + uid + "']"); if(sourceElement) { if(isWinning) { sourceElement.classList.remove(TraceStyleView._cssNotWinning); } else { sourceElement.classList.add(TraceStyleView._cssNotWinning); } } }; TraceStyleView.prototype.setCheckboxState = function (traceStyle) { var checkboxElement = this._listElement.querySelector("." + TraceStyleView._cssHeader + "[data-name='" + traceStyle.name + "'] > ." + TraceStyleView._cssHeaderCheckbox); if(checkboxElement) { checkboxElement.checked = traceStyle.isEnabled; checkboxElement.indeterminate = traceStyle.isEnabledIndeterminate; checkboxElement.parentElement.setAttribute("aria-checked", traceStyle.isEnabled); } }; TraceStyleView.prototype.postViewProcessing = function () { var _this = this; this._model.forEachProperty(function (traceProperty) { _this.setCheckboxState(traceProperty); }); this._model.registerUpdateListeners(this); this.addHandlers(this._listElement, "click", [ TraceStyleView._cssItem ], function (evt) { if(toolwindowHelpers.isContextMenuUp()) { return true; } var element = evt.target; if(element.classList.contains(TraceStyleView._cssExpandIcon)) { return !_this.toggleExpander(element); } if(element.classList.contains(TraceStyleView._cssSourceCheckbox)) { _this.togglePropertyCheckbox(element); return !_this.select(element.parentElement); } if(element.classList.contains(TraceStyleView._cssHeaderCheckbox)) { _this.toggleHeaderCheckbox(element); return !_this.select(element.parentElement); } element = TraceStyleView.findHeaderOrSource(element); return !_this.select(element); }); this.addHandlers(this._listElement, "keydown", [ TraceStyleView._cssItem ], function (event) { if(document.activeElement && document.activeElement["type"] == "text") { return true; } var shiftKey = event.shiftKey && !event.ctrlKey && !event.altKey; var ctrlKey = event.ctrlKey && !event.shiftKey && !event.altKey; var noKeys = !event.shiftKey && !event.ctrlKey && !event.altKey; if(event.keyCode === Common.KeyCodes.C && ctrlKey) { return !_this.copySelectionToClipboard(_this.currentSelection); } var element = TraceStyleView.findHeaderOrSource(event.target); if(element) { if(event.keyCode === Common.KeyCodes.F10 && shiftKey) { var offset = element.getBoundingClientRect(); _this.showContextMenu(element, offset.left, offset.top); return false; } if(event.keyCode === Common.KeyCodes.ARROW_UP && noKeys) { _this.moveSelectionUp(element); return false; } if(event.keyCode === Common.KeyCodes.ARROW_DOWN && noKeys) { _this.moveSelectionDown(element); return false; } if(event.keyCode === Common.KeyCodes.ARROW_LEFT && noKeys) { _this.moveSelectionOut(element); return false; } if(event.keyCode === Common.KeyCodes.ARROW_RIGHT && noKeys) { _this.moveSelectionIn(element); return false; } if(event.keyCode === Common.KeyCodes.HOME && noKeys) { _this.moveSelectionToFirst(element); return false; } if(event.keyCode === Common.KeyCodes.END && noKeys) { _this.moveSelectionToLast(element); return false; } if(event.keyCode === Common.KeyCodes.SPACE && noKeys) { var checkbox = element.firstElementChild; if(TraceStyleView.isSource(element)) { _this.togglePropertyCheckbox(checkbox); } else { _this.toggleHeaderCheckbox(checkbox); } _this.select(element); return false; } } return true; }); this.addHandlers(this._listElement, "contextmenu", [ TraceStyleView._cssItem ], function (evt) { var selectedItem = null; var x = evt.clientX; var y = evt.clientY; if(x <= 0 || y <= 0) { selectedItem = _this.currentSelection; if(selectedItem) { var offset = selectedItem.getBoundingClientRect(); x = offset.left; y = offset.top; } } else { selectedItem = TraceStyleView.findHeaderOrSource(document.elementFromPoint(x, y)); if(selectedItem) { _this.select(selectedItem); } } _this.showContextMenu(selectedItem, x, y); return true; }); this.addHandlers(this._listElement, "DOMAttrModified", [ TraceStyleView._cssItem ], function (evt) { var element = TraceStyleView.findHeaderOrSource(evt.target); if(element) { if(evt.attrName === "aria-expanded" && TraceStyleView.isHeader(element)) { var propertyName = element.getAttribute("data-name"); _this._model.markExpandState(propertyName, evt.newValue === "true"); } if(evt.attrName === "aria-checked") { var isEnabled = evt.newValue === "true"; var checkbox = element.firstElementChild; if(TraceStyleView.isHeader(element)) { _this.toggleHeaderCheckbox(checkbox, isEnabled); } else { _this.togglePropertyCheckbox(checkbox, isEnabled); } } } return true; }); var headerElement = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(this._listElement, TraceStyleView._cssHeader); if(headerElement) { headerElement.tabIndex = 1; } }; TraceStyleView.prototype.findPreviousSelection = function (element) { var moveTo = null; if(TraceStyleView.isSource(element)) { moveTo = element.previousElementSibling || element.parentElement.previousElementSibling; } else { moveTo = TraceStyleView.findPreviousHeader(element); if(moveTo && TraceStyleView.isExpanded(moveTo)) { moveTo = moveTo.nextElementSibling.lastElementChild; } } return moveTo; }; TraceStyleView.prototype.moveSelectionUp = function (element) { var moveTo = this.findPreviousSelection(element); if(moveTo) { this.select(moveTo); } }; TraceStyleView.prototype.findNextSelection = function (element) { var moveTo = null; if(TraceStyleView.isSource(element)) { moveTo = element.nextElementSibling || TraceStyleView.findNextHeader(element); } else if(TraceStyleView.isExpanded(element)) { moveTo = element.nextElementSibling.firstElementChild; } else { moveTo = TraceStyleView.findNextHeader(element); } return moveTo; }; TraceStyleView.prototype.moveSelectionDown = function (element) { var moveTo = this.findNextSelection(element); if(moveTo) { this.select(moveTo); } }; TraceStyleView.prototype.moveSelectionToFirst = function (element) { var moveTo = element; var prev; while(prev = this.findPreviousSelection(moveTo)) { moveTo = prev; } if(moveTo) { this.select(moveTo); } }; TraceStyleView.prototype.moveSelectionToLast = function (element) { var moveTo = element; var next; while(next = this.findNextSelection(moveTo)) { moveTo = next; } if(moveTo) { this.select(moveTo); } }; TraceStyleView.prototype.moveSelectionOut = function (element) { if(TraceStyleView.isSource(element)) { this.select(element.parentElement.previousElementSibling); } else { if(TraceStyleView.isExpanded(element)) { this.toggleExpander(element); } } }; TraceStyleView.prototype.moveSelectionIn = function (element) { if(!TraceStyleView.isSource(element)) { if(TraceStyleView.isExpanded(element)) { this.select(element.nextElementSibling.firstElementChild); } else { this.toggleExpander(element); } } }; TraceStyleView.prototype.toggleExpander = function (element) { element = TraceStyleView.getItem(element); if(element) { var element = element.firstElementChild; element.setAttribute("aria-expanded", TraceStyleView.isExpanded(element) ? "false" : "true"); this.select(element); return true; } return false; }; TraceStyleView.prototype.onPropertyEnableChange = function (property, isEnabled) { var checkboxElement = this._listElement.querySelector("." + TraceStyleView._cssSource + "[data-uid='" + property.uid + "'] > ." + TraceStyleView._cssSourceCheckbox); if(checkboxElement) { checkboxElement.checked = isEnabled; var traceStyle = this._model.findTraceStyleByName(property.name); traceStyle.enabledCount += isEnabled ? 1 : -1; checkboxElement.parentElement.setAttribute("aria-checked", isEnabled); } if(this._propertyEnableCallback) { this._propertyEnableCallback(isEnabled); this._propertyEnableCallback = null; } }; TraceStyleView.prototype.onPropertyValueChange = function (property, newValue) { var sourceElement = this._listElement.querySelector("." + TraceStyleView._cssSource + "[data-uid='" + property.uid + "']"); if(sourceElement) { var valueElement = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(sourceElement, TraceStyleView._cssSourceValue); var colorElement = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(sourceElement, TraceStyleView._cssSourceColor); valueElement.textContent = property.value; if(property.isDisplayableColor) { colorElement.style.backgroundColor = property.colorForDisplay; colorElement.style.display = "block"; } else { colorElement.style.display = "none"; } } }; TraceStyleView.prototype.togglePropertyCheckbox = function (element, isEnabled) { this._model.toggleEnabled(TraceStyleView.getPropertyId(element), isEnabled); }; TraceStyleView.prototype.toggleHeaderCheckbox = function (element, isEnabled) { var _this = this; var headerElement = element.parentElement; var propertyName = headerElement.getAttribute("data-name"); var traceStyle = this._model.findTraceStyleByName(propertyName); if(traceStyle) { if(isEnabled === undefined || isEnabled !== traceStyle.isEnabled) { var newIsEnabled = !traceStyle.isEnabled; traceStyle.sources.forEach(function (source) { var property = _this._model.findPropertyById(source.propertyId); if(property.isEnabled !== newIsEnabled) { property.toggleEnable(); } }); } } }; TraceStyleView.prototype.showContextMenu = function (selectedItem, x, y) { var _this = this; var contextMenu = [ { id: "copyProperty", text: toolwindowHelpers.loadString("CopyPropertyMenuText"), enabled: true } ]; var source; if(TraceStyleView.isSource(selectedItem)) { source = selectedItem; } else { var item = TraceStyleView.getItem(selectedItem); source = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(item, TraceStyleView._cssSource); } toolwindowHelpers.showContextMenu("traceStyleMenu", contextMenu, x, y, function (id, menuItem) { if(id === "traceStyleMenu") { switch(menuItem) { case "copyProperty": clipboardData.setData("Text", _this._model.createPropertyCopyText(TraceStyleView.getPropertyId(source))); break; } } }); }; TraceStyleView.prototype.select = function (element) { if(element) { this.setFocus(element); return true; } return false; }; Object.defineProperty(TraceStyleView.prototype, "currentSelection", { get: function () { return document.querySelector("#" + this.listViewDivId + " :focus"); }, enumerable: true, configurable: true }); TraceStyleView.isExpanded = function isExpanded(element) { return element.getAttribute("aria-expanded") === "true"; }; TraceStyleView.isSource = function isSource(element) { return element.classList.contains(TraceStyleView._cssSource); }; TraceStyleView.isHeader = function isHeader(element) { return element.classList.contains(TraceStyleView._cssHeader); }; TraceStyleView.getPropertyId = function getPropertyId(element) { element = F12.DomExplorer.DomExplorerWindow.findAncestorByClass(element, TraceStyleView._cssSource); return element.getAttribute("data-uid"); }; TraceStyleView.getItem = function getItem(element) { return F12.DomExplorer.DomExplorerWindow.findAncestorByClass(element, TraceStyleView._cssItem); }; TraceStyleView.findHeaderOrSource = function findHeaderOrSource(element) { while(element) { if(TraceStyleView.isHeader(element) || TraceStyleView.isSource(element)) { return element; } element = element.parentElement; } return null; }; TraceStyleView.findPreviousHeader = function findPreviousHeader(element) { element = this.getItem(element).previousElementSibling; return element ? F12.DomExplorer.DomExplorerWindow.findDescendentByClass(element, TraceStyleView._cssHeader) : null; }; TraceStyleView.findNextHeader = function findNextHeader(element) { element = this.getItem(element).nextElementSibling; return element ? F12.DomExplorer.DomExplorerWindow.findDescendentByClass(element, TraceStyleView._cssHeader) : null; }; TraceStyleView.prototype.copySelectionToClipboard = function (selectedItem) { if(toolwindowHelpers.hasSelectedText()) { return toolwindowHelpers.copySelectedTextToClipboard(); } if(selectedItem) { var text = null; if(TraceStyleView.isSource(selectedItem)) { text = this._model.createPropertyCopyText(TraceStyleView.getPropertyId(selectedItem)); if(text) { clipboardData.setData("Text", text); return true; } } } return false; }; Object.defineProperty(TraceStyleView.prototype, "propertyEnableCallback", { set: function (value) { this._propertyEnableCallback = value; }, enumerable: true, configurable: true }); return TraceStyleView; })(Common.ModelView.ListView); Dom.TraceStyleView = TraceStyleView; })(Dom || (Dom = {})); //@ sourceMappingURL=traceStyleView.js.map // breadcrumbItem.ts var Dom; (function (Dom) { var BreadcrumbItem = (function () { function BreadcrumbItem(_element, _uid) { this._element = _element; this._uid = _uid; } BreadcrumbItem.prototype.getAttribute = function (attrName) { var htmlElement = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(this._element, "BPT-HTML"); if(htmlElement) { var attrElements = F12.DomExplorer.DomExplorerWindow.findAllDescendentsByClass(htmlElement, "BPT-HTML-Attribute-Section"); for(var i = 0; (i < attrElements.length); i++) { var node = attrElements.item(i); if(node.nodeType === Node.ELEMENT_NODE) { var attrElement = node; var attrNameElement = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(attrElement, "BPT-HTML-Attribute"); if(attrNameElement && HtmlTreeView.getTextContent(attrNameElement) === attrName) { var attrValueElement = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(attrElement, "BPT-HTML-Value"); if(attrValueElement) { return HtmlTreeView.getTextContent(attrValueElement); } } } } } return null; }; Object.defineProperty(BreadcrumbItem.prototype, "elementName", { get: function () { var tagElement = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(this._element, "BPT-HTML-Tag"); if(tagElement) { return HtmlTreeView.getTextContent(tagElement); } var docElement = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(this._element, "BPT-HTML-DocType"); if(docElement) { return "(DOCTYPE)"; } var commentElement = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(this._element, "BPT-HTML-Comment"); if(commentElement) { return toolwindowHelpers.loadString("CommentElement"); } var textElement = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(this._element, "BPT-HTML-Text"); if(textElement) { return toolwindowHelpers.loadString("TextElement"); } if(this._element.classList.contains("BPT-HtmlTree-ChildCollection-ShowAll")) { return toolwindowHelpers.loadString("ShowAll"); } return null; }, enumerable: true, configurable: true }); Object.defineProperty(BreadcrumbItem.prototype, "breadcrumbName", { get: function () { var name = this.elementName; if(name) { if(this.id) { name += "#" + this.id; } else if(this.classNames) { var classNames = this.classNames.trim().split(" "); if(classNames.length > 0) { name += "." + classNames[0]; } } } return name; }, enumerable: true, configurable: true }); Object.defineProperty(BreadcrumbItem.prototype, "selected", { get: function () { return this._element.classList.contains("BPT-HtmlTreeItem-Selected"); }, enumerable: true, configurable: true }); Object.defineProperty(BreadcrumbItem.prototype, "elementUID", { get: function () { return this._uid; }, enumerable: true, configurable: true }); Object.defineProperty(BreadcrumbItem.prototype, "element", { get: function () { return this._element; }, enumerable: true, configurable: true }); Object.defineProperty(BreadcrumbItem.prototype, "id", { get: function () { return this.getAttribute("id"); }, enumerable: true, configurable: true }); Object.defineProperty(BreadcrumbItem.prototype, "classNames", { get: function () { var retStr = this.getAttribute("class"); if(retStr) { return retStr; } return ""; }, enumerable: true, configurable: true }); return BreadcrumbItem; })(); Dom.BreadcrumbItem = BreadcrumbItem; })(Dom || (Dom = {})); //@ sourceMappingURL=breadcrumbItem.js.map // breadcrumbsModel.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var Dom; (function (Dom) { var BreadcrumbsModel = (function (_super) { __extends(BreadcrumbsModel, _super); function BreadcrumbsModel(_selectedElement) { var _this = this; _super.call(this); this._selectedElement = _selectedElement; this.skipNextLoad = false; this.listSource = function (callback, args) { if(!_this.skipNextLoad) { _this.buildBreadcrumbs(); } else { _this.verifyTrail(); } _this.skipNextLoad = false; callback(_this._breadcrumbs); }; } BreadcrumbsModel.prototype.verifyTrail = function () { var bcIndex = this.numberOfBreadcrumbs - 1; while(bcIndex >= 0) { var bc = this.breadcrumb(bcIndex); var uid = bc.elementUID; var elementInTree = $m("#tree").find(".BPT-HtmlTreeItem[data-id='" + uid + "']"); if(elementInTree.length === 0) { this._breadcrumbs.splice(bcIndex, this.numberOfBreadcrumbs - bcIndex); } bcIndex--; if(bcIndex >= this.numberOfBreadcrumbs) { bcIndex = this.numberOfBreadcrumbs - 1; } } }; BreadcrumbsModel.prototype.buildBreadcrumbs = function () { this._breadcrumbs = []; var currentElement = this._selectedElement; while(currentElement && currentElement instanceof HTMLElement) { if(!currentElement.classList.contains("BPT-HtmlTreeItem-HiddenRoot")) { var bc = new Dom.BreadcrumbItem(currentElement, currentElement.getAttribute("data-id")); this._breadcrumbs.unshift(bc); } currentElement = F12.DomExplorer.DomExplorerWindow.findAncestorByClass(currentElement.parentElement, "BPT-HtmlTreeItem"); } this.newBreadcrumbs = true; return this._breadcrumbs; }; BreadcrumbsModel.prototype.findBreadcrumbByTagName = function (tagName, nodeIndex) { for(var i = 0; i < this.numberOfBreadcrumbs; i++) { var bci = this.breadcrumb(i); if(tagName === bci.elementName) { if(nodeIndex === 0) { return bci; } nodeIndex--; } } return null; }; BreadcrumbsModel.prototype.findBreadcrumbByClass = function (className, nodeIndex) { for(var i = 0; i < this.numberOfBreadcrumbs; i++) { var bci = this.breadcrumb(i); var classNames = bci.classNames.split(' '); for(var j = 0; j < classNames.length; j++) { if(classNames[j] === className) { if(nodeIndex === 0) { return bci; } nodeIndex--; } } } return null; }; BreadcrumbsModel.prototype.findBreadcrumbById = function (id) { for(var i = 0; i < this.numberOfBreadcrumbs; i++) { var bci = this.breadcrumb(i); if(id === bci.id) { return bci; } } return null; }; Object.defineProperty(BreadcrumbsModel.prototype, "numberOfBreadcrumbs", { get: function () { return this._breadcrumbs.length; }, enumerable: true, configurable: true }); BreadcrumbsModel.prototype.breadcrumb = function (index) { return this._breadcrumbs[index]; }; BreadcrumbsModel.prototype.clearSelection = function () { this._selectedElement = undefined; }; BreadcrumbsModel.prototype.setSelectedElement = function (element) { var elementUid = (element.get(0)).getAttribute("data-id"); for(var i = 0; i < this._breadcrumbs.length; i++) { if(this._breadcrumbs[i].elementUID === elementUid) { this.skipNextLoad = true; } } if(element.get(0) instanceof HTMLElement) { this._selectedElement = element.get(0); } }; BreadcrumbsModel.prototype.findPreviousBreadcrumb = function (uid) { for(var i = 0; i < this.numberOfBreadcrumbs; i++) { var bc = this._breadcrumbs[i]; if(bc.elementUID === uid) { if(i > 0) { return this._breadcrumbs[i - 1]; } return null; } } return null; }; BreadcrumbsModel.prototype.findNextBreadcrumb = function (uid) { for(var i = 0; i < this.numberOfBreadcrumbs; i++) { var bc = this._breadcrumbs[i]; if(bc.elementUID === uid) { if(i < this.numberOfBreadcrumbs - 1) { return this._breadcrumbs[i + 1]; } return null; } } return null; }; return BreadcrumbsModel; })(Common.ModelView.ListModel); Dom.BreadcrumbsModel = BreadcrumbsModel; })(Dom || (Dom = {})); //@ sourceMappingURL=breadcrumbsModel.js.map // breadcrumbsView.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var Dom; (function (Dom) { var BreadcrumbsView = (function (_super) { __extends(BreadcrumbsView, _super); function BreadcrumbsView(_domExplorerWindow, _proxy, model, _htmlElementSource, BreadcrumbsViewDivId, defaultItemTemplateId, alternateTemplates) { _super.call(this, _htmlElementSource, BreadcrumbsViewDivId, defaultItemTemplateId, model, alternateTemplates); this._domExplorerWindow = _domExplorerWindow; this._proxy = _proxy; this.model = model; this._htmlElementSource = _htmlElementSource; this._forceSelectedIntoView = true; this._grabKeyFocus = false; this._disableKeyBoardTooltip = false; this._listElement = this._htmlElementSource.getElementById(this.listViewDivId); this._tooltipTemplate = new T.Template({ htmlElementSource: this._htmlElementSource, templateId: "breadcrumbTooltip" }); this.init($m("#BreadcrumbsView")); _domExplorerWindow.horizontalPane.addResizeListener(this); this.setWidth(_domExplorerWindow.horizontalPane.leftWidth); this.updateView(); } BreadcrumbsView.ARROW_WIDTH = 16; BreadcrumbsView.prototype.lastKey = function (key) { this._lastKey = key; }; BreadcrumbsView.prototype.updateView = function () { if(!this._grabKeyFocus && document.activeElement && (F12.DomExplorer.DomExplorerWindow.findAncestorByClass(document.activeElement, "BPT-HorizontalPane-BreadcrumbBar") != null)) { this._grabKeyFocus = true; } if(!this._breadcrumbModel) { this._breadcrumbModel = this.model; } _super.prototype.updateView.call(this); }; BreadcrumbsView.prototype.onPaneResize = function (leftWidth, rightWidth) { this.setWidth(leftWidth); this.skipNextLoad(); this.updateView(); }; BreadcrumbsView.prototype.setWidth = function (width) { $m("#BreadcrumbsView").parent(".BPT-HorizontalPane-BreadcrumbBar").css("width", width + "px"); }; BreadcrumbsView.prototype.calculateFirstOrLastElementToDisplay = function (bar, breadcrumbElements) { var _this = this; var barRect = (bar.get(0)).getBoundingClientRect(); var spaceLeft = barRect.width - BreadcrumbsView.ARROW_WIDTH * 2 - 40; var selectedIndex = -1; if(this._lastBreadcrumbToShow === undefined) { breadcrumbElements.each(function (index, element) { if(element.getAttribute("class").indexOf("BPT-Breadcrumb-Selected") >= 0) { selectedIndex = index; } if(index >= _this._firstBreadcrumbToShow && (spaceLeft > 0)) { var elementRect = element.getBoundingClientRect(); if(spaceLeft > elementRect.width) { spaceLeft -= elementRect.width; _this._lastBreadcrumbToShow = index; } else { spaceLeft = 0; } } }); } else { var indexArray = []; breadcrumbElements.each(function (index, element) { if(element.getAttribute("class").indexOf("BPT-Breadcrumb-Selected") >= 0) { selectedIndex = index; } indexArray[index] = element; }); for(var index = indexArray.length - 1; (index >= 0) && (spaceLeft > 0); index--) { if(index <= this._lastBreadcrumbToShow) { var element = indexArray[index]; var elementRect = element.getBoundingClientRect(); if(spaceLeft > elementRect.width) { spaceLeft -= elementRect.width; this._firstBreadcrumbToShow = index; } else { spaceLeft = 0; } } } } return selectedIndex; }; BreadcrumbsView.prototype.selectBreadcrumb = function (element) { this._selectedElement = element; var uid = element.getAttribute("bc-data-uid"); this.selectElementByUid(uid); }; BreadcrumbsView.prototype.selectElementByUid = function (uid) { var elementInTree = $m("#tree").find(".BPT-HtmlTreeItem[data-id='" + uid + "']"); this.skipNextLoad(); HtmlTreeView.select(elementInTree); var scrollContainer = elementInTree.closest(".BPT-HtmlTree-ScrollContainer").get(0); var elementHeader = elementInTree.find(".BPT-HtmlTreeItem-Header"); toolwindowHelpers.scrollIntoView(elementHeader.get(0), scrollContainer); }; BreadcrumbsView.prototype.takeDownContextMenu = function () { toolwindowHelpers.takeDownDaytonaContextMenu(); }; BreadcrumbsView.prototype.isContextMenuUp = function () { return toolwindowHelpers.isContextMenuUp(); }; BreadcrumbsView.prototype.popupTooltip = function (element, x, y, now, focus) { var _this = this; if(this.isContextMenuUp()) { return; } if(!now) { if(this._tooltipComingId) { window.clearTimeout(this._tooltipComingId); } this._tooltipComingId = window.setTimeout(function () { _this._tooltipComingId = null; _this.popupTooltip(element, x, y, true, focus); }, 500); return; } var bcRect = element.getBoundingClientRect(); var bcIndex = element.getAttribute("bcIndex"); if(bcIndex) { var index = parseInt(bcIndex); var obj = this._breadcrumbModel.breadcrumb(index); this._tooltip = this._tooltipTemplate.createTemplateElement(obj); $m("#BreadcrumbsView").get(0).appendChild(this._tooltip); var ttRect = this._tooltip.getBoundingClientRect(); this._tooltip.style.left = Math.max(1, x - (ttRect.width / 2)) + "px"; this._tooltip.style.top = (0 - (ttRect.height + 2)) + "px"; this._tooltip.style.display = "grid"; if(focus) { this._tooltip.focus(); } } this._tooltipComingId = undefined; }; BreadcrumbsView.prototype.closeTooltip = function () { if(this._tooltipComingId) { window.clearTimeout(this._tooltipComingId); this._tooltipComingId = undefined; return; } if(this._tooltip) { var doFocus = document.activeElement === this._tooltip; if(this._tooltip.parentElement) { this._tooltip.parentElement.removeChild(this._tooltip); } this._tooltip.style.display = "none"; this._tooltip = undefined; var bar = $m(".BPT-HorizontalPane-BreadcrumbBar"); var selectedElement = bar.find(".BPT-Breadcrumb-Selected"); if(selectedElement && doFocus) { selectedElement.focus(); } } }; BreadcrumbsView.prototype.handleKeyPress = function (event) { if(event.ctrlKey || event.shiftKey || event.altKey) { return true; } var selected = $m(".BPT-Breadcrumb-Selected"); var uid = selected.attr("bc-data-uid"); var keyEvent = event; this.lastKey(keyEvent.keyCode); switch(keyEvent.keyCode) { case Common.KeyCodes.ARROW_LEFT: case Common.KeyCodes.ARROW_UP: var bc = this._breadcrumbModel.findPreviousBreadcrumb(uid); if(bc) { this.closeTooltip(); var selectUid = bc.elementUID; this.selectElementByUid(selectUid); this._grabKeyFocus = true; this.updateView(); } return false; break; case Common.KeyCodes.ARROW_RIGHT: case Common.KeyCodes.ARROW_DOWN: var bc = this._breadcrumbModel.findNextBreadcrumb(uid); if(bc) { this.closeTooltip(); var selectUid = bc.elementUID; this.selectElementByUid(selectUid); this._grabKeyFocus = true; this.updateView(); } return false; break; case Common.KeyCodes.PAGE_DOWN: this.shiftPage(true); return false; break; case Common.KeyCodes.PAGE_UP: this.shiftPage(false); return false; break; case Common.KeyCodes.ESCAPE: this.closeTooltip(); return false; case Common.KeyCodes.TAB: this.closeTooltip(); return true; } return true; }; BreadcrumbsView.prototype.init = function (item) { var _this = this; $m(".BPT-HorizontalPane-BreadcrumbBar").bind("contextmenu", function (ev) { _this.takeDownContextMenu(); _this.closeTooltip(); var element = ev.target; var x = ev.clientX; var y = ev.clientY; if((x <= 0) || (y <= 0) || (_this._lastKey == Common.KeyCodes.CONTEXTMENU)) { if(_this._lastKey != Common.KeyCodes.CONTEXTMENU) { _this.selectBreadcrumb(element); } _this._lastKey = undefined; var offset = (_this._selectedElement).getBoundingClientRect(); x = offset.left; y = offset.top; element = _this._selectedElement; _this._grabKeyFocus = false; } else { _this._grabKeyFocus = true; _this.selectBreadcrumb(element); } var uid = element.getAttribute("bc-data-uid"); var elementInTree = $m("#tree").find(".BPT-HtmlTreeItem[data-id='" + uid + "']"); window.setTimeout(function () { _this._domExplorerWindow.htmlContextMenu(true, elementInTree, x, y); _this.skipNextLoad(); _this.updateView(); }, 1); }); item.get(0).addEventListener("keydown", function (event) { _this.takeDownContextMenu(); if(!(_this.handleKeyPress(event))) { event.preventDefault(); return false; } return true; }, true); $m(".BPT-HorizontalPane-BreadcrumbBar-Arrow").bind("click", function (evt) { var element = evt.target; _this.shiftPage((element.getAttribute("id") === "breadcrumbRightArrow")); return false; }); }; BreadcrumbsView.prototype.shiftPage = function (right) { this.takeDownContextMenu(); if(right) { if(this._lastBreadcrumbToShow < this._breadcrumbModel.numberOfBreadcrumbs - 1) { this._lastBreadcrumbToShow++; this._firstBreadcrumbToShow = undefined; } else { return; } } else { if(this._firstBreadcrumbToShow > 0) { this._firstBreadcrumbToShow--; this._lastBreadcrumbToShow = undefined; } else { return; } } this.skipNextLoad(); this._forceSelectedIntoView = false; this._grabKeyFocus = true; this.updateView(); }; BreadcrumbsView.prototype.skipNextLoad = function () { this._breadcrumbModel.skipNextLoad = true; }; BreadcrumbsView.prototype.preViewProcessing = function () { $m("#BreadcrumbsView").show(); }; BreadcrumbsView.prototype.checkToPullDownTooltip = function () { var _this = this; window.setTimeout(function () { if(document.activeElement && (F12.DomExplorer.DomExplorerWindow.findAncestorByClass(document.activeElement, "BPT-HorizontalPane-BreadcrumbBar") == null)) { _this.closeTooltip(); } }, 0); }; BreadcrumbsView.prototype.postViewProcessing = function () { var _this = this; this._disableKeyBoardTooltip = false; if(((this._firstBreadcrumbToShow === undefined) && (this._lastBreadcrumbToShow === undefined)) || this._breadcrumbModel.newBreadcrumbs) { this._firstBreadcrumbToShow = 0; this._lastBreadcrumbToShow = undefined; this._breadcrumbModel.newBreadcrumbs = false; } else { if(this._lastBreadcrumbToShow && this._lastBreadcrumbToShow >= this._breadcrumbModel.numberOfBreadcrumbs) { this._lastBreadcrumbToShow = this._breadcrumbModel.numberOfBreadcrumbs - 1; } if(this._firstBreadcrumbToShow && this._firstBreadcrumbToShow >= this._breadcrumbModel.numberOfBreadcrumbs) { this._firstBreadcrumbToShow = 0; this._lastBreadcrumbToShow = undefined; this._breadcrumbModel.newBreadcrumbs = false; } } this.addHandlers(this._listElement, "click", [ "BPT-Breadcrumb", "BPT-Breadcrumb-Selected" ], function (evt) { _this.takeDownContextMenu(); _this._grabKeyFocus = true; var element = evt.target; _this.selectBreadcrumb(element); _this.updateView(); }); this._htmlElementSource.addEventListener("mousedown", function (evt) { _this.checkToPullDownTooltip(); }); var bar = $m(".BPT-HorizontalPane-BreadcrumbBar"); var breadcrumbElements = bar.find(".BPT-Breadcrumb, .BPT-Breadcrumb-Selected"); var chevronElements = bar.find(".BPT-HorizontalPane-BreadcrumbChevron"); var positoningLastElement = (this._lastBreadcrumbToShow === undefined); var selectedIndex; do { var doItAgain = false; var selectedIndex = this.calculateFirstOrLastElementToDisplay(bar, breadcrumbElements); if(this._forceSelectedIntoView && ((selectedIndex < this._firstBreadcrumbToShow) || (selectedIndex > this._lastBreadcrumbToShow))) { doItAgain = true; if(positoningLastElement) { if(selectedIndex < this._firstBreadcrumbToShow) { this._firstBreadcrumbToShow--; } else { this._firstBreadcrumbToShow++; } this._lastBreadcrumbToShow = undefined; } else { if(selectedIndex > this._lastBreadcrumbToShow) { this._lastBreadcrumbToShow++; } else { this._lastBreadcrumbToShow--; } this._firstBreadcrumbToShow = undefined; } } else if((this._firstBreadcrumbToShow !== 0) || (this._lastBreadcrumbToShow !== this._breadcrumbModel.numberOfBreadcrumbs - 1)) { if(!positoningLastElement && this._firstBreadcrumbToShow === 0) { doItAgain = true; positoningLastElement = true; this._lastBreadcrumbToShow = undefined; } else if(positoningLastElement && this._lastBreadcrumbToShow === this._breadcrumbModel.numberOfBreadcrumbs - 1) { doItAgain = true; positoningLastElement = false; this._firstBreadcrumbToShow = undefined; } } }while(doItAgain); for(var i = 0; i < this._breadcrumbModel.numberOfBreadcrumbs; i++) { if(i == selectedIndex) { this._selectedElement = $m(breadcrumbElements.get(i)).get(0); } if(i >= this._firstBreadcrumbToShow && i <= this._lastBreadcrumbToShow) { $m(breadcrumbElements.get(i)).show(); $m(chevronElements.get(i)).show(); var parentElement = breadcrumbElements.get(i).parentNode; parentElement.setAttribute("bcIndex", i); var self = this; parentElement.onmouseenter = function (ev) { if(_this.isContextMenuUp()) { return; } var element = ev.target; var span = element.children[0]; var svg = element.children[1]; var path = svg.querySelector("path"); var uid = span.getAttribute("bc-data-uid"); _this._domExplorerWindow.temporaryShowElementHighlight(uid); element["savebackgroundColor"] = path.className.baseVal; span.classList.add("BPT-Breadcrumb-Hover"); path.className.baseVal = "BPT-BreadcrumbChevron-Hover"; if(!_this._tooltipComingId) { _this.closeTooltip(); _this.showTooltipOnBreadcrumb(false, element); } _this._disableKeyBoardTooltip = true; }; parentElement.onmouseleave = function (ev) { var element = ev.target; var span = element.children[0]; var svg = element.children[1]; var path = svg.querySelector("path"); _this._domExplorerWindow.restoreElementHighlight(); _this.closeTooltip(); if(element["savebackgroundColor"] !== undefined) { _this._disableKeyBoardTooltip = false; span.classList.remove("BPT-Breadcrumb-Hover"); path.className.baseVal = element["savebackgroundColor"]; element["savebackgroundColor"] = undefined; } }; } else { $m(breadcrumbElements.get(i)).hide(); $m(chevronElements.get(i)).hide(); } } if(this._firstBreadcrumbToShow > 0) { $m("#breadcrumbLeftArrow").show(); } else { $m("#breadcrumbLeftArrow").hide(); } if(this._lastBreadcrumbToShow < this._breadcrumbModel.numberOfBreadcrumbs - 1) { $m("#breadcrumbRightArrow").show(); } else { $m("#breadcrumbRightArrow").hide(); } if(this._grabKeyFocus) { var selectedElement = bar.find(".BPT-Breadcrumb-Selected"); if(selectedElement) { selectedElement.focus(); } this._grabKeyFocus = false; if(!this._disableKeyBoardTooltip) { this.showTooltipOnBreadcrumb(true); } } this._forceSelectedIntoView = true; }; BreadcrumbsView.prototype.selectBreadcrumbNodeByTagName = function (tagName, nodeIndex) { if(!nodeIndex) { nodeIndex = 0; } var bci = this._breadcrumbModel.findBreadcrumbByTagName(tagName, nodeIndex); this.selectElementByUid(bci.elementUID); }; BreadcrumbsView.prototype.selectBreadcrumbNodeByClass = function (className, nodeIndex) { if(!nodeIndex) { nodeIndex = 0; } var bci = this._breadcrumbModel.findBreadcrumbByClass(className, nodeIndex); this.selectElementByUid(bci.elementUID); }; BreadcrumbsView.prototype.selectBreadcrumbNodeById = function (id) { var bci = this._breadcrumbModel.findBreadcrumbById(id); this.selectElementByUid(bci.elementUID); }; BreadcrumbsView.prototype.showTooltipOnBreadcrumb = function (focus, elementOverWhichToDisplay) { if(!elementOverWhichToDisplay) { var bar = $m(".BPT-HorizontalPane-BreadcrumbBar"); var selectedElement = bar.find(".BPT-Breadcrumb-Selected").get(0); if(!selectedElement) { return; } var element = selectedElement.parentNode; var spanRect = selectedElement.getBoundingClientRect(); var imgRect = selectedElement.nextElementSibling.getBoundingClientRect(); } else { var spanRect = elementOverWhichToDisplay.children[0].getBoundingClientRect(); var imgRect = elementOverWhichToDisplay.children[1].getBoundingClientRect(); var element = elementOverWhichToDisplay; } var displayRect = spanRect; var width = displayRect.width; var left = displayRect.left; var rightArrow = $m("#breadcrumbLeftArrow").get(0); if(rightArrow.style.display !== "none") { var rightArrowRect = rightArrow.getBoundingClientRect(); left -= rightArrowRect.width; } this.popupTooltip(element, left + width / 2, displayRect.top + displayRect.height / 2, false, focus); }; return BreadcrumbsView; })(Common.ModelView.ListView); Dom.BreadcrumbsView = BreadcrumbsView; })(Dom || (Dom = {})); //@ sourceMappingURL=breadcrumbsView.js.map // computedStyleModel.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var Dom; (function (Dom) { var ComputedStyle = (function () { function ComputedStyle(_model, propertyName, propertyValue) { this._model = _model; this.propertyName = propertyName; this.propertyValue = propertyValue; this.sources = []; } ComputedStyle.prototype.isColor = function () { return this.propertyName.indexOf("color") > -1 ? true : false; }; ComputedStyle.prototype.hasChildren = function () { return !!this.sources && this.sources.length > 0; }; ComputedStyle.prototype.addSource = function (selector, value, fileUrl, fileName, isWinning) { this.sources.unshift(new ComputedStyleSource(selector, value, fileUrl, fileName, isWinning)); }; Object.defineProperty(ComputedStyle.prototype, "children", { get: function () { return this.sources; }, enumerable: true, configurable: true }); Object.defineProperty(ComputedStyle.prototype, "uniqueId", { get: function () { return "ComputedStyle" + this.propertyName; }, enumerable: true, configurable: true }); Object.defineProperty(ComputedStyle.prototype, "expanded", { get: function () { return this._model.isExpanded(this.uniqueId); }, set: function (expanded) { this._model.setExpansionState(this.uniqueId, expanded); }, enumerable: true, configurable: true }); return ComputedStyle; })(); Dom.ComputedStyle = ComputedStyle; var ComputedStyleSource = (function () { function ComputedStyleSource(selector, value, fileUrl, fileName, isWinning) { this.selector = selector; this.value = value; this.fileUrl = fileUrl; this.fileName = fileName; this.isWinning = isWinning; } return ComputedStyleSource; })(); Dom.ComputedStyleSource = ComputedStyleSource; var ComputedStyleModel = (function (_super) { __extends(ComputedStyleModel, _super); function ComputedStyleModel(proxy, styleCache, createShortenedUrlText) { var _this = this; _super.call(this); this._showAllStyles = false; this._uniqueIdsOfExpandedStyles = { }; this.listSource = function (callback, args) { var computedStyles; styleCache.updateView(args[0], function (styles) { _this._getStylesResults = styles.rules; }); proxy.callRemote("getComputedStyles", args, function (computedStylesResultArray) { if(!computedStylesResultArray) { return; } _this._getComputedStylesResults = computedStylesResultArray[0]; var computedStyles = _this.determineComputedStyles(_this._getComputedStylesResults, _this._getStylesResults); callback(computedStyles); }); }; this._createShortenedUrlText = function (s) { if(!s) { return undefined; } var shortened = createShortenedUrlText(s); return shortened.replace(/\\"/g, "\""); }; } ComputedStyleModel.prototype.isExpanded = function (uniqueId) { return this._uniqueIdsOfExpandedStyles[uniqueId] === true; }; ComputedStyleModel.prototype.setExpansionState = function (uniqueId, expanded) { if(this.isExpanded(uniqueId) === expanded) { return; } if(expanded) { this._uniqueIdsOfExpandedStyles[uniqueId] = true; } else { delete this._uniqueIdsOfExpandedStyles[uniqueId]; } }; Object.defineProperty(ComputedStyleModel.prototype, "showAllStyles", { get: function () { return this._showAllStyles; }, set: function (value) { if(this._showAllStyles !== value) { this._showAllStyles = value; if(this._getComputedStylesResults , this._getStylesResults) { this.cache = this.determineComputedStyles(this._getComputedStylesResults, this._getStylesResults); } } }, enumerable: true, configurable: true }); Object.defineProperty(ComputedStyleModel.prototype, "nameFilter", { get: function () { return this._nameFilter; }, set: function (value) { if(this._nameFilter !== value) { this._nameFilter = value; if(this._getComputedStylesResults , this._getStylesResults) { this.cache = this.determineComputedStyles(this._getComputedStylesResults, this._getStylesResults); } } }, enumerable: true, configurable: true }); ComputedStyleModel.prototype.determineComputedStyles = function (getComputedStylesResults, getStylesResults) { var computedStyles = []; var propertyName; var styleGroups = { }; var propertyNames = []; for(var i = 0; i < getStylesResults.length; i++) { var currentStyle = getStylesResults[i]; for(var j = 0; j < currentStyle.properties.length; j++) { var property = currentStyle.properties[j]; if(property.status === Dom.StylePropertyStatus.valid) { var addProperty = function (property) { if(!styleGroups[property.name]) { styleGroups[property.name] = []; propertyNames.push(property.name); } styleGroups[property.name].unshift(property); }; if(property.isShorthand) { property.properties.forEach(addProperty); } else { addProperty(property); } } } } if(this.showAllStyles) { propertyNames = []; for(propertyName in getComputedStylesResults) { propertyNames.push(propertyName); } } var tempPropertyNames = []; if(this._nameFilter && this._nameFilter.length > 0) { tempPropertyNames = propertyNames; propertyNames = []; for(i = 0; i < tempPropertyNames.length; i++) { propertyName = tempPropertyNames[i]; if(propertyName.indexOf(this._nameFilter) > -1) { propertyNames.push(propertyName); } } } propertyNames.sort(); for(i = 0; i < propertyNames.length; i++) { propertyName = propertyNames[i]; var styleGroup = styleGroups[propertyName]; var computedStyle = new ComputedStyle(this, propertyName, getComputedStylesResults[propertyName]); var url; var linkText; if(styleGroup) { for(var j = 0; j < styleGroup.length; j++) { var styleGroupItem = styleGroup[j]; if(styleGroupItem.rule.styleHref) { linkText = this._createShortenedUrlText(styleGroupItem.rule.styleHref.replace(/\\/g, "/")); } else { linkText = undefined; } computedStyle.addSource(styleGroupItem.rule.selectorText, styleGroupItem.value, styleGroupItem.rule.styleHref, linkText, styleGroupItem.isWinning); } } computedStyles.push(computedStyle); } return computedStyles; }; return ComputedStyleModel; })(Common.ModelView.ListModel); Dom.ComputedStyleModel = ComputedStyleModel; })(Dom || (Dom = {})); //@ sourceMappingURL=computedStyleModel.js.map // eventsModel.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var Dom; (function (Dom) { var EventHandler = (function () { function EventHandler(column, cookie, documentUrl, functionName, line, text, tooltip) { this.column = column; this.cookie = cookie; this.documentUrl = documentUrl; this.functionName = functionName; this.line = line; this.text = text; this.tooltip = tooltip; } return EventHandler; })(); Dom.EventHandler = EventHandler; var EventAndHandlers = (function () { function EventAndHandlers(_model, eventName, children) { this._model = _model; this.eventName = eventName; this.children = children; this.isDirty = false; } EventAndHandlers.prototype.hasChildren = function () { return !!this.children && this.children.length > 0; }; Object.defineProperty(EventAndHandlers.prototype, "uniqueId", { get: function () { return this.eventName; }, enumerable: true, configurable: true }); Object.defineProperty(EventAndHandlers.prototype, "expanded", { get: function () { return !this._model.isCollapsed(this.uniqueId); }, set: function (expanded) { this._model.setCollapsedState(this.uniqueId, !expanded); }, enumerable: true, configurable: true }); return EventAndHandlers; })(); Dom.EventAndHandlers = EventAndHandlers; var EventsModel = (function (_super) { __extends(EventsModel, _super); function EventsModel(proxy, styleCache, createShortenedUrlText) { var _this = this; _super.call(this); this._uniqueIdsOfCollapsedStyles = { }; this.listSource = function (callback, args) { proxy.callRemote("collectEvents", [ args[0], function (e) { _this.onEventHandlersRetrieved(e, callback); }, function (e) { _this.onEventHandlerAdded(e); }, function (e) { _this.onEventHandlerRemoved(e); } ]); }; } EventsModel.prototype.isCollapsed = function (uniqueId) { return this._uniqueIdsOfCollapsedStyles[uniqueId] === true; }; EventsModel.prototype.setCollapsedState = function (uniqueId, collapsed) { if(this.isCollapsed(uniqueId) === collapsed) { return; } if(collapsed) { this._uniqueIdsOfCollapsedStyles[uniqueId] = true; } else { delete this._uniqueIdsOfCollapsedStyles[uniqueId]; } }; Object.defineProperty(EventsModel.prototype, "updateCallback", { set: function (callback) { this._updateCallback = callback; }, enumerable: true, configurable: true }); EventsModel.prototype.onEventHandlerAdded = function (handler) { if(!handler) { return; } this.processAddedEventHandler(this.cache, handler); if(this._updateCallback) { this._updateCallback(); } }; EventsModel.prototype.onEventHandlerRemoved = function (handler) { if(!handler) { return; } this.processRemovedEventHandler(this.cache, handler); if(this._updateCallback) { this._updateCallback(); } }; EventsModel.prototype.onEventHandlersRetrieved = function (events, callback) { var eventList = []; for(var i = 0; i < events.length; i++) { this.processAddedEventHandler(eventList, events[i]); } callback(eventList); }; EventsModel.prototype.processAddedEventHandler = function (eventList, e) { var match = this.findMatchingEventAndHandlers(e.eventName, eventList); if(!match) { match = new EventAndHandlers(this, e.eventName, []); eventList.push(match); } else { for(var i = 0; i < match.children.length; i++) { if(match.children[i].cookie === e.cookie) { return; } } } var line = e.line + 1; var column = e.column + 1; var text = null; var tooltip = null; text = toolwindowHelpers.createFileLinkText(e.document, line); if(e.document !== undefined) { if(e.document.indexOf("eval code") === 0) { tooltip = toolwindowHelpers.loadString("EvalCodeEventHandlerToolTip"); } else if(e.document.indexOf("Function code") === 0) { tooltip = toolwindowHelpers.loadString("FunctionCodeEventHandlerToolTip"); } else if(e.document.indexOf("script block") === 0) { tooltip = toolwindowHelpers.loadString("DynamicScriptBlockEventHandlerToolTip"); } else { tooltip = toolwindowHelpers.loadString("EventHandlerTooltip", [ toolwindowHelpers.htmlEscape(e.eventName), e.usesCapture, toolwindowHelpers.htmlEscape(e.document), line, column ]); } } else { text = e.document; tooltip = toolwindowHelpers.loadString("ExternalEventHandlerTooltip", [ toolwindowHelpers.htmlEscape(e.eventName), e.usesCapture ]); } match.children.push(new EventHandler(column, e.cookie, toolwindowHelpers.htmlEscape(e.document), e.functionName, line, text, tooltip)); match.isDirty = true; return; }; EventsModel.prototype.processRemovedEventHandler = function (eventList, e) { var match = this.findMatchingEventAndHandlers(e.eventName, eventList); if(!match) { return; } for(var i = 0; i < match.children.length; i++) { if(match.children[i].cookie === e.cookie) { match.children.splice(i, 1); return; } } }; EventsModel.prototype.findMatchingEventAndHandlers = function (eventName, eventList) { var match = null; for(var i = 0; i < eventList.length; i++) { if(eventList[i].eventName === eventName) { return eventList[i]; } } return null; }; return EventsModel; })(Common.ModelView.ListModel); Dom.EventsModel = EventsModel; })(Dom || (Dom = {})); //@ sourceMappingURL=eventsModel.js.map // expandingListView.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var Dom; (function (Dom) { var ExpandingListView = (function (_super) { __extends(ExpandingListView, _super); function ExpandingListView(htmlElementSource, viewDivId, defaultItemTemplateId, model, _expansionChangeCallback, alternateTemplates, localizer, idPropertyName, sortPropertyName, isChanged, clearDirtyFlag) { _super.call(this, htmlElementSource, viewDivId, defaultItemTemplateId, model, alternateTemplates, localizer, idPropertyName, sortPropertyName, isChanged, clearDirtyFlag); this._expansionChangeCallback = _expansionChangeCallback; } ExpandingListView._expandIconClass = "BPT-ExpandingList-ExpandIcon"; ExpandingListView._headerClass = "BPT-ExpandingList-Header"; ExpandingListView._childValueContainerClass = "BPT-ExpandingList-Child-Value-Container"; ExpandingListView.prototype.preViewProcessing = function () { this.removeAllHandlers(); }; ExpandingListView.prototype.postViewProcessing = function () { this.addClickHandlerThatExpandsAndCollapsesChildren(); this.addKeyboardNavigationHandlers(); this.addFocusSettingDivClickHandler(); this.addContextMenuHandler(); var headerElement = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(this.listRoot, ExpandingListView._headerClass); if(headerElement) { headerElement.tabIndex = 1; } }; ExpandingListView.prototype.addClickHandlerThatExpandsAndCollapsesChildren = function () { var _this = this; this.addHandler(this.listRoot, "click", function (evt) { var el = evt.target; if(!el.classList.contains(ExpandingListView._expandIconClass)) { return false; } var collapsibleSection = el.parentElement; var wasExpanded = collapsibleSection.getAttribute("aria-expanded") === "true"; collapsibleSection.setAttribute("aria-expanded", wasExpanded ? "false" : "true"); if(_this._expansionChangeCallback) { _this._expansionChangeCallback((el.parentNode.parentNode).getAttribute("id"), !wasExpanded); } }); }; ExpandingListView.prototype.addKeyboardNavigationHandlers = function () { var _this = this; var listViewDiv = this.htmlElementSource.getElementById(this.listViewDivId); this.addHandler(listViewDiv, "keydown", function (keyDownEvent) { if(keyDownEvent.ctrlKey || keyDownEvent.shiftKey || keyDownEvent.altKey) { return true; } if(toolwindowHelpers.isContextMenuUp()) { return true; } var element = keyDownEvent.target; if(keyDownEvent.key === Common.Keys.DOWN) { _this.moveFocusDown(keyDownEvent.srcElement); } else if(keyDownEvent.key === Common.Keys.UP) { _this.moveFocusUp(keyDownEvent.srcElement); } else if(keyDownEvent.key === Common.Keys.LEFT) { _this.focusParentOrCollapse(keyDownEvent.srcElement); } else if(keyDownEvent.key === Common.Keys.RIGHT) { _this.expandOrFocusChild(keyDownEvent.srcElement); } else if(keyDownEvent.key === Common.Keys.HOME) { _this.moveFocusToFirst(keyDownEvent.srcElement); } else if(keyDownEvent.key === Common.Keys.END) { _this.moveFocusToLast(keyDownEvent.srcElement); } else { return true; } return false; }); }; ExpandingListView.prototype.focusParentOrCollapse = function (htmlElement) { var listItemDiv; if(this.isChild(htmlElement)) { listItemDiv = htmlElement.parentElement.parentElement; var computedValueDiv = listItemDiv.children[0]; this.setFocus(computedValueDiv); return; } htmlElement.setAttribute("aria-expanded", "false"); }; ExpandingListView.prototype.expandOrFocusChild = function (htmlElement) { if(this.isChild(htmlElement)) { return; } if(htmlElement.getAttribute("aria-expanded") === "false") { htmlElement.setAttribute("aria-expanded", "true"); return; } var collapsedSectionDiv = htmlElement.nextElementSibling; if(collapsedSectionDiv && collapsedSectionDiv.children && collapsedSectionDiv.children.length) { var valueContainer = collapsedSectionDiv.children[0]; this.setFocus(valueContainer); } }; ExpandingListView.prototype.findFocusableUp = function (htmlElement) { var previousHtmlElement = htmlElement.previousElementSibling; if(previousHtmlElement) { return previousHtmlElement; } var listItemDiv; if(this.isChild(htmlElement)) { listItemDiv = htmlElement.parentElement.parentElement; return F12.DomExplorer.DomExplorerWindow.findDescendentByClass(listItemDiv, ExpandingListView._headerClass); } listItemDiv = htmlElement.parentElement; var previousListItemDiv = listItemDiv.previousElementSibling; if(!previousListItemDiv) { return null; } var previousListItemDivsHeader = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(previousListItemDiv, ExpandingListView._headerClass); if(previousListItemDivsHeader.getAttribute("aria-expanded") === "true") { if(previousListItemDiv.children && previousListItemDiv.children.length > 2) { var previousCollapsedSectionDiv = previousListItemDiv.children[1]; return previousCollapsedSectionDiv.lastElementChild; } } return previousListItemDivsHeader; }; ExpandingListView.prototype.moveFocusUp = function (htmlElement) { var elementToFocus = this.findFocusableUp(htmlElement); if(elementToFocus) { this.setFocus(elementToFocus); } }; ExpandingListView.prototype.moveFocusToFirst = function (element) { var moveTo = element; var prev; while(prev = this.findFocusableUp(moveTo)) { moveTo = prev; } if(moveTo) { this.setFocus(moveTo); } }; ExpandingListView.prototype.findFocusableDown = function (htmlElement) { var nextHtmlElement = htmlElement.nextElementSibling; if(nextHtmlElement && this.isChild(htmlElement)) { return nextHtmlElement; } var listItemDiv; if(this.isChild(htmlElement)) { listItemDiv = htmlElement.parentElement.parentElement; } else { if(htmlElement.getAttribute("aria-expanded") === "true") { var collapsedSectionDiv = htmlElement.nextElementSibling; if(collapsedSectionDiv && collapsedSectionDiv.children.length) { var valueContainer = collapsedSectionDiv.children[0]; return valueContainer; } } listItemDiv = htmlElement.parentElement; } var nextListItemDiv = listItemDiv.nextElementSibling; if(nextListItemDiv) { return F12.DomExplorer.DomExplorerWindow.findDescendentByClass(nextListItemDiv, ExpandingListView._headerClass); } return null; }; ExpandingListView.prototype.moveFocusDown = function (htmlElement) { var elementToFocus = this.findFocusableDown(htmlElement); if(elementToFocus) { this.setFocus(elementToFocus); } }; ExpandingListView.prototype.moveFocusToLast = function (element) { var moveTo = element; var next; while(next = this.findFocusableDown(moveTo)) { moveTo = next; } if(moveTo) { this.setFocus(moveTo); } }; ExpandingListView.prototype.isChild = function (htmlElement) { return htmlElement.classList.contains(ExpandingListView._childValueContainerClass); }; ExpandingListView.prototype.addFocusSettingDivClickHandler = function () { var _this = this; var listViewDiv = this.htmlElementSource.getElementById(this.listViewDivId); this.addHandler(listViewDiv, "click", function (evt) { var element = _this.findHeaderOrChild(evt.target); if(element.focus) { _this.setFocus(element); } return true; }); }; ExpandingListView.prototype.findHeaderOrChild = function (element) { while(element.parentElement && !(element.classList.contains(ExpandingListView._headerClass) || element.classList.contains(ExpandingListView._childValueContainerClass))) { element = element.parentElement; } return element; }; ExpandingListView.prototype.addContextMenuHandler = function () { var _this = this; this.addHandler(this.listRoot, "contextmenu", function (evt) { var selectedItem = null; var x = evt.clientX; var y = evt.clientY; if(x <= 0 || y <= 0) { selectedItem = document.querySelector("#" + _this.listViewDivId + " :focus"); if(selectedItem) { var offset = selectedItem.getBoundingClientRect(); x = offset.left; y = offset.top; } } else { selectedItem = _this.findHeaderOrChild(document.elementFromPoint(x, y)); if(selectedItem) { _this.setFocus(selectedItem); } } _this.showContextMenu(selectedItem, x, y); return false; }); }; ExpandingListView.prototype.showContextMenu = function (selectedElement, x, y) { }; return ExpandingListView; })(Common.ModelView.ReconcilingListView); Dom.ExpandingListView = ExpandingListView; })(Dom || (Dom = {})); //@ sourceMappingURL=expandingListView.js.map // computedStyleView.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var Dom; (function (Dom) { var ComputedStyleView = (function (_super) { __extends(ComputedStyleView, _super); function ComputedStyleView(_domExplorer, htmlElementSource, computedStyleViewDivId, defaultItemTemplateId, model, alternateTemplates) { _super.call(this, htmlElementSource, computedStyleViewDivId, defaultItemTemplateId, model, function (uniqueId, expanded) { model.setExpansionState(uniqueId, expanded); }, alternateTemplates, null, "uniqueId", "propertyName"); this._domExplorer = _domExplorer; } ComputedStyleView._propertyNameClass = "BPT-ComputedStyle-PropertyName"; ComputedStyleView._propertyValueClass = "BPT-ComputedStyle-PropertyValue"; ComputedStyleView._filterTextBoxId = "computedStylesFilterTextBox"; ComputedStyleView.allStylesButtonId = "allStylesButton"; ComputedStyleView.bptToolbarToggleButtonStateOn = "BPT-ToolbarToggleButton-StateOn"; ComputedStyleView.noResultsMessageId = "computedStylesNoResultsMessage"; ComputedStyleView.prototype.postViewProcessing = function () { _super.prototype.postViewProcessing.call(this); }; ComputedStyleView.prototype.preViewProcessing = function () { _super.prototype.preViewProcessing.call(this); this.initializeAllStylesButton(); this.addNameFilterHandlers(); this.synchronizeViewAndModel(); }; ComputedStyleView.prototype.synchronizeViewAndModel = function () { (this.model).showAllStyles = this.getAllStylesButtonState(); (this.model).nameFilter = (this.htmlElementSource.getElementById(ComputedStyleView._filterTextBoxId)).value; this.ifThereAreResultsDisableTheNoResultsMessage(); }; ComputedStyleView.prototype.ifThereAreResultsDisableTheNoResultsMessage = function () { var noResultsMessageDiv = this.htmlElementSource.getElementById(ComputedStyleView.noResultsMessageId); if(this.model.length === 0) { noResultsMessageDiv.style.display = "block"; } else { noResultsMessageDiv.style.display = "none"; } }; ComputedStyleView.prototype.showContextMenu = function (selectedElement, x, y) { var _this = this; var contextMenu = [ { id: "copyProperty", text: toolwindowHelpers.loadString("CopyPropertyMenuText"), enabled: true } ]; toolwindowHelpers.showContextMenu("traceStyleMenu", contextMenu, x, y, function (id, menuItem) { if(id === "traceStyleMenu") { var model = _this.model; switch(menuItem) { case "copyProperty": var header = F12.DomExplorer.DomExplorerWindow.findAncestorByClass(selectedElement, Dom.ExpandingListView._headerClass); var name = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(header, ComputedStyleView._propertyNameClass).textContent.replace(/:$/, ""); var value = F12.DomExplorer.DomExplorerWindow.findDescendentByClass(header, ComputedStyleView._propertyValueClass).textContent; clipboardData.setData("Text", name + ": " + value + ";"); break; } } }); }; ComputedStyleView.prototype.initializeAllStylesButton = function () { var _this = this; this._allStylesButton = this.htmlElementSource.getElementById(ComputedStyleView.allStylesButtonId); if(!this._allStylesButton) { return; } if(!this._allStylesButtonInitialized) { this._allStylesButton.classList.add(ComputedStyleView.bptToolbarToggleButtonStateOn); this._allStylesButton.title = Plugin.Resources.getString("UserStylesDomExplorerButtonTooltipOn"); this._allStylesButtonInitialized = true; } this.addHandler(this._allStylesButton, "click", function (mouseEvent) { _this.synchronizeAllStylesModelStateWithButtonState(); return false; }); this.addHandler(this._allStylesButton, "keydown", function (keyEvent) { if((keyEvent.keyCode === Common.KeyCodes.ENTER || keyEvent.keyCode === Common.KeyCodes.SPACE) && !keyEvent.ctrlKey && !keyEvent.shiftKey && !keyEvent.altKey) { _this.synchronizeAllStylesModelStateWithButtonState(); return false; } return true; }); }; ComputedStyleView.prototype.synchronizeAllStylesModelStateWithButtonState = function () { this.setAllStylesState(this.getAllStylesButtonState()); }; ComputedStyleView.prototype.getAllStylesButtonState = function () { if(!this._allStylesButton) { this._allStylesButton = this.htmlElementSource.getElementById(ComputedStyleView.allStylesButtonId); } return !this._allStylesButton.classList.contains(ComputedStyleView.bptToolbarToggleButtonStateOn); }; ComputedStyleView.prototype.setAllStylesState = function (allStyles) { var computedStyleModel = this.model; computedStyleModel.showAllStyles = allStyles; if(computedStyleModel.showAllStyles) { this._allStylesButton.title = Plugin.Resources.getString("UserStylesDomExplorerButtonTooltipOff"); } else { this._allStylesButton.title = Plugin.Resources.getString("UserStylesDomExplorerButtonTooltipOn"); } this.renderViewWithoutChangingEvents(); }; ComputedStyleView.prototype.renderViewWithoutChangingEvents = function () { this.synchronizeViewAndModel(); this.listReconciler.reconcile(this.objectsPreviouslyRendered, this.model.cache); this.objectsPreviouslyRendered = this.model.cache; if(this.renderViewCallback) { this.renderViewCallback(); } }; ComputedStyleView.prototype.addNameFilterHandlers = function () { var _this = this; var filterTextBox = this.htmlElementSource.getElementById(ComputedStyleView._filterTextBoxId); if(filterTextBox) { this.addHandler(filterTextBox, "input", function (evt) { var el = evt.target; var computedStyleModel = _this.model; if(computedStyleModel.nameFilter !== el.value) { computedStyleModel.nameFilter = el.value; _this.renderViewWithoutChangingEvents(); } return true; }); this.addHandler(filterTextBox, "contextmenu", function (evt) { var element = evt.target; _this._domExplorer.handleContextMenuForTextbox(element, evt.clientX, evt.clientY); return false; }); this.addHandler(filterTextBox, "keydown", function (evt) { if(event.keyCode === Common.KeyCodes.F10 && event.shiftKey && !event.ctrlKey && !event.altKey) { var element = evt.target; _this._domExplorer.handleContextMenuForTextbox(element, 0, 0); return false; } return true; }); } }; return ComputedStyleView; })(Dom.ExpandingListView); Dom.ComputedStyleView = ComputedStyleView; })(Dom || (Dom = {})); //@ sourceMappingURL=computedStyleView.js.map // eventsView.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var Dom; (function (Dom) { var EventsView = (function (_super) { __extends(EventsView, _super); function EventsView(htmlElementSource, eventsViewDivId, defaultItemTemplateId, model, _documentOpener, alternateTemplates) { _super.call(this, htmlElementSource, eventsViewDivId, defaultItemTemplateId, model, function (uniqueId, expanded) { model.setCollapsedState(uniqueId, !expanded); }, alternateTemplates, null, "uniqueId", "eventName", function (newThing, oldThing) { return newThing.isDirty; }, function (newThing) { newThing.isDirty = false; }); this._documentOpener = _documentOpener; this._focusSettingDivClickHandlerApplied = false; this._addKeyboardNavigationHandlersApplied = false; } EventsView._expandIconClass = ".BPT-ComputedStyle-ExpandIcon"; EventsView._headerClass = "BPT-ExpandingList-Header"; EventsView._propertyNameClass = "BPT-ComputedStyle-PropertyName"; EventsView._propertyValueClass = "BPT-ComputedStyle-PropertyValue"; EventsView._sourceValueContainerClass = "BPT-ComputedStyle-Source-Value-Container"; EventsView.noResultsMessageId = "computedStylesNoResultsMessage"; EventsView.prototype.collapseChange = function (uniqueId, expanded) { (this.model).setCollapsedState(uniqueId, expanded); }; EventsView.prototype.postViewProcessing = function () { var _this = this; _super.prototype.postViewProcessing.call(this); this.addHandlers(this.listRoot, "click", [ "BPT-Events-Handler-Link" ], function (e) { return _this._documentOpener.openDocumentLinkFromEvent(e); }); var listViewDiv = this.htmlElementSource.getElementById(this.listViewDivId); this.addHandler(listViewDiv, "keydown", function (keyDownEvent) { if(toolwindowHelpers.isContextMenuUp()) { return true; } var element = keyDownEvent.target; if((keyDownEvent.key === "Enter" || keyDownEvent.key == "Spacebar") && !keyDownEvent.ctrlKey && !keyDownEvent.shiftKey && !keyDownEvent.altKey) { _this.openDocument(keyDownEvent); return false; } return true; }); }; EventsView.prototype.openDocument = function (keyDownEvent) { if(keyDownEvent.target) { var linkElement = $m(keyDownEvent.target).children(".BPT-FileLink").get(0); this._documentOpener.openDocumentLinkFromElement(linkElement); } }; return EventsView; })(Dom.ExpandingListView); Dom.EventsView = EventsView; })(Dom || (Dom = {})); //@ sourceMappingURL=eventsView.js.map // tabItem.ts var TabItem = (function () { function TabItem() { } TabItem.init = function init(item, selectedCallback) { item.addClass("BPT-Tab-Item"); item.bind("click focus", function () { var currentElement = item.parent().find(".BPT-Tab-Item[aria-selected='true']"); if(currentElement.length > 0) { currentElement.removeAttr("tabindex"); currentElement.attr("aria-selected", false); item.attr("tabindex", "1"); item.attr("aria-selected", true); selectedCallback(); } }); }; TabItem.isActive = function isActive(query) { return query.attr("aria-selected") === "true"; }; return TabItem; })(); //@ sourceMappingURL=tabItem.js.map // horizontalPane.ts var Dom; (function (Dom) { var HorizontalPane = (function () { function HorizontalPane(container) { var _this = this; this._listeners = []; this._minPaneSize = 240; this._container = container; this._leftPane = this._container.children(".BPT-HorizontalPane-Left"); this._rightPane = this._container.children(".BPT-HorizontalPane-Right"); this._leftPane.addClass("BPT-Pane"); this._rightPane.addClass("BPT-Pane"); var windowWidth = window.outerWidth; this._curWidth = (windowWidth > 0 ? Math.max(300, (windowWidth / 100) * 30) : 300); this._divider = $m("
    "); this._divider.addClass("BPT-Pane-Divider"); this._rightPane.parent().get(0).insertBefore(this._divider.get(0), this._rightPane.get(0)); window.onresize = function () { _this.refreshPaneWidth(); }; this.refreshPaneWidth(); this._divider.bind("mousedown", function (evt) { var prevCursor = document.body.style.cursor; document.body.style.cursor = "w-resize"; var mouseMoveHandler, mouseUpHandler; mouseMoveHandler = function (evt) { var dividerLoc = (_this._divider.get(0)).getBoundingClientRect().left; _this.setPaneWidth(_this._rightPane.width() - evt.pageX + dividerLoc); }; mouseUpHandler = function () { $m(document).unbind("mousemove", mouseMoveHandler); $m(document).unbind("mouseup", mouseUpHandler); document.body.style.cursor = prevCursor; }; $m(document).bind("mousemove", mouseMoveHandler); $m(document).bind("mouseup", mouseUpHandler); evt.stopImmediatePropagation(); evt.preventDefault(); }); } Object.defineProperty(HorizontalPane.prototype, "leftWidth", { get: function () { return this._leftWidth; }, enumerable: true, configurable: true }); Object.defineProperty(HorizontalPane.prototype, "rightWidth", { get: function () { return this._rightWidth; }, enumerable: true, configurable: true }); HorizontalPane.prototype.addResizeListener = function (listener) { if(this._listeners.indexOf(listener) < 0) { this._listeners.push(listener); } }; HorizontalPane.prototype.refreshPaneWidth = function () { this.setPaneWidth(this._curWidth); }; HorizontalPane.prototype.removeResizeListener = function (listener) { var index = this._listeners.indexOf(listener); if(index >= 0) { this._listeners.splice(index, 1); } }; HorizontalPane.prototype.setPaneWidth = function (newWidth) { var _this = this; if(newWidth <= 0) { return; } this._curWidth = newWidth = Math.max(this._minPaneSize, newWidth); this._curWidth = newWidth = Math.round(this._curWidth); var paneSize = this._container.outerWidth(true); if(paneSize < this._minPaneSize * 2) { newWidth = paneSize >> 1; } else if(paneSize - newWidth < this._minPaneSize) { newWidth = paneSize - this._minPaneSize; } if(newWidth < this._curWidth) { $m(document.getElementsByClassName("BPT-Tabbar")[0]).css("width", "calc(100% + 32px)"); } else { $m(document.getElementsByClassName("BPT-Tabbar")[0]).css("width", "100%"); $m(document.getElementById("pane-right")).css("left", "0px"); } this._leftPane.css("width", "calc(100% - " + (newWidth + this._divider.width()) + "px)"); this._rightPane.css("width", newWidth + "px"); this._leftWidth = this._leftPane.outerWidth(false); this._rightWidth = this._rightPane.outerWidth(false); this._listeners.forEach(function (listener) { listener.onPaneResize(_this._leftWidth, _this._rightWidth); }); }; return HorizontalPane; })(); Dom.HorizontalPane = HorizontalPane; })(Dom || (Dom = {})); //@ sourceMappingURL=horizontalPane.js.map // valueEditor.ts var Dom; (function (Dom) { var ValueEditorKey = (function () { function ValueEditorKey(key, shiftKey, ctrlKey, altKey, metaKey) { if (typeof shiftKey === "undefined") { shiftKey = false; } if (typeof ctrlKey === "undefined") { ctrlKey = false; } if (typeof altKey === "undefined") { altKey = false; } if (typeof metaKey === "undefined") { metaKey = false; } this.key = key; this.shiftKey = shiftKey; this.ctrlKey = ctrlKey; this.altKey = altKey; this.metaKey = metaKey; } ValueEditorKey.EnterKey = new ValueEditorKey("Enter"); ValueEditorKey.CtrlEnterKey = new ValueEditorKey("Enter", false, true); ValueEditorKey.TabKey = new ValueEditorKey("Tab"); ValueEditorKey.ShiftTabKey = new ValueEditorKey("Tab", true); ValueEditorKey.EscapeKey = new ValueEditorKey("Esc"); ValueEditorKey.UpKey = new ValueEditorKey("Up"); ValueEditorKey.DownKey = new ValueEditorKey("Down"); ValueEditorKey.ShiftUpKey = new ValueEditorKey("Up", true); ValueEditorKey.ShiftDownKey = new ValueEditorKey("Down", true); ValueEditorKey.ShiftF10Key = new ValueEditorKey("F10", true); ValueEditorKey.prototype.equalTo = function (other) { return this.key === other.key && this.shiftKey === other.shiftKey && this.ctrlKey === other.ctrlKey && this.altKey === other.altKey && this.metaKey === other.metaKey; }; return ValueEditorKey; })(); Dom.ValueEditorKey = ValueEditorKey; var ValueEditor = (function () { function ValueEditor(_htmlElementSource, _domExplorer, _hostBridge, _view, _maxRows, _intellisenseContext, _oldValue) { if (typeof _maxRows === "undefined") { _maxRows = 1; } this._htmlElementSource = _htmlElementSource; this._domExplorer = _domExplorer; this._hostBridge = _hostBridge; this._view = _view; this._maxRows = _maxRows; this._intellisenseContext = _intellisenseContext; this._oldValue = _oldValue; this.doTrim = true; this._exitKeys = [ ValueEditorKey.EnterKey, ValueEditorKey.TabKey, ValueEditorKey.ShiftTabKey ]; this._cancelKey = ValueEditorKey.EscapeKey; this._arrowKeys = [ ValueEditorKey.UpKey, ValueEditorKey.DownKey, ValueEditorKey.ShiftUpKey, ValueEditorKey.ShiftDownKey ]; } ValueEditor.prototype.addExitKeys = function () { var exitKeys = []; for (var _i = 0; _i < (arguments.length - 0); _i++) { exitKeys[_i] = arguments[_i + 0]; } this._exitKeys = this._exitKeys.concat(exitKeys); }; ValueEditor.prototype.removeExitKeys = function () { var _this = this; var exitKeys = []; for (var _i = 0; _i < (arguments.length - 0); _i++) { exitKeys[_i] = arguments[_i + 0]; } exitKeys.forEach(function (key, index, exitKeys) { for(var i = 0; i < _this._exitKeys.length; i++) { if(_this._exitKeys[i] === key) { _this._exitKeys.splice(i, 1); break; } } }); }; ValueEditor.prototype.enableNumericChanges = function () { this._isNumericArrowsEnabled = true; }; ValueEditor.prototype.enableTabsInData = function () { this.removeExitKeys(Dom.ValueEditorKey.TabKey, Dom.ValueEditorKey.ShiftTabKey); this._allowTabs = true; }; ValueEditor.prototype.enableCommitOnChange = function () { this._isCommitOnChangeEnabled = true; }; ValueEditor.prototype.show = function (element, width, onCommit, onExit) { var _this = this; this._element = element; this._onCommit = onCommit; this._onExit = onExit; this._dragElements = []; this._textBox = this._htmlElementSource.createElement("textarea"); this._textBox.type = "text"; this._textBox.classList.add("BPT-EditBox"); this._textBox.setAttribute("role", "textbox"); if(this._maxRows === 1) { this._textBox.rows = 1; } var parent = element.parentNode; while(parent) { if(parent.draggable) { this._dragElements.push(parent); parent.draggable = false; } parent = parent.parentNode; } var style = this._view.getComputedStyle(element); this._textBox.style.fontFamily = style.fontFamily; this._textBox.style.fontSize = style.fontSize; this._textBox.style.fontWeight = style.fontWeight; this._textBox.style.fontStyle = style.fontStyle; this._textBox.style.lineHeight = style.lineHeight; this._textBox.style.width = (width || element.offsetWidth + 10) + "px"; this._textBox.style.overflowX = "hidden"; this._markActiveElement = F12.DomExplorer.DomExplorerWindow.findAncestorByClass(element, "BPT-EditBox-MarkActive"); if(this._markActiveElement) { this._markActiveElement.classList.add("BPT-EditBox-Active"); } var parent = this._element.parentElement; this._originalOverflow = parent.style.overflow; parent.style.overflow = "visible"; this._originalMaxHeight = parent.style.maxHeight; this._textBox.rows = 1; ValueEditor.replace(this._element, this._textBox); var range = this._textBox.createTextRange(); var lineHeight = range.boundingHeight; this._textBox.value = this._lastCommitValue = this._originalValue = this._oldValue || this._element.textContent; this._updateHandler = function (evt) { if(_this._maxRows > 1) { _this._textBox.rows = Math.max(Math.min(Math.ceil(_this._textBox.scrollHeight / lineHeight), _this._maxRows), 1); } _this._textBox.style.height = _this._textBox.rows * lineHeight + "px"; if(_this._isCommitOnChangeEnabled) { _this.checkForValueCommit(false); } }; this._updateHandler(); if(parent.classList.contains("BPT-EditBox-MaxHeightOverride")) { parent.style.maxHeight = this._maxRows * lineHeight + "px"; } this._textBox.addEventListener("input", this._updateHandler); if(this._intellisenseContext) { this._intellisenseContext.initialize(this._textBox); } this._keyDownHandler = function (evt) { if(!_this.onKeyPress(evt)) { evt.preventDefault(); evt.stopPropagation(); } }; this._textBox.addEventListener("keydown", this._keyDownHandler); this._textBox.addEventListener("mousedown", this.stopPropagationHandler); this._textBox.addEventListener("mouseup", this.stopPropagationHandler); this._textBox.addEventListener("click", this.stopPropagationHandler); this._textBox.addEventListener("dblclick", this.stopPropagationHandler); this._hostBridge.addEventListener("deactivated", (this._deactivatedHandler = this.deactivated.bind(this))); this._contentMenuHandler = function (evt) { _this._domExplorer.handleContextMenuForTextbox(_this._textBox, evt.clientX, evt.clientY); evt.preventDefault(); evt.stopPropagation(); }; this._textBox.addEventListener("contextmenu", this._contentMenuHandler); this._mouseWheelHandler = function (evt) { if(_this._isNumericArrowsEnabled) { var changeAmount = evt.wheelDelta / 120; if(evt.shiftKey) { changeAmount *= 10; } _this.numericValueChange(changeAmount); evt.preventDefault(); evt.stopPropagation(); } }; this._textBox.addEventListener("mousewheel", this._mouseWheelHandler); if(this._intellisenseContext && this._isCommitOnChangeEnabled) { this._intellisenseContext.intellisenseMenu.onSelectionChanged = function (value) { _this.checkForValueCommit(false, value.text); }; this._intellisenseContext.intellisenseMenu.onClosing = function () { _this.checkForValueCommit(false); }; } this._mouseDownHandler = function (evt) { if(evt.target !== _this._textBox) { if(toolwindowHelpers.isContextMenuUp()) { return; } var htmlElementTarget = evt.target; var htmlElementTargetParent = htmlElementTarget.parentElement; if(htmlElementTarget.className === "intellisenseListBox" || (htmlElementTargetParent && htmlElementTargetParent.className === "intellisenseListBox")) { return; } if(_this.shouldContinueEdit && _this.shouldContinueEdit(evt.target)) { return; } _this.completeEdit(false); evt.preventDefault(); evt.stopPropagation(); } }; this._htmlElementSource.addEventListener("mousedown", this._mouseDownHandler); this._doubleClickHandler = function (evt) { var htmlElementTarget = evt.target; _this.completeEdit(false, ValueEditorKey.TabKey); }; this._htmlElementSource.addEventListener("dblclick", this._doubleClickHandler); this._textBox.select(); this._textBox.focus(); }; ValueEditor.prototype.stopPropagationHandler = function (evt) { evt.stopPropagation(); Plugin.ContextMenu.dismissAll(); }; ValueEditor.prototype.setValue = function (text, start, end) { var range = this._textBox.createTextRange(); var useUndo = range.queryCommandSupported("ms-beginUndoUnit"); if(useUndo) { range.execCommand("ms-beginUndoUnit"); } range.moveStart("character", start); range.moveEnd("character", end - this._textBox.value.length); range.text = text; if(useUndo) { range.execCommand("ms-endUndoUnit"); } }; ValueEditor.prototype.checkForValueCommit = function (isCancel, newValue) { if(newValue === undefined) { newValue = isCancel ? this._originalValue : this._textBox.value; if(this.doTrim) { newValue = newValue.trim(); } } if(this._lastCommitValue !== newValue) { this._lastCommitValue = newValue; if(this._onCommit) { this._onCommit(newValue, this._originalValue); } if(!this._oldValue) { this._element.textContent = newValue; } } }; ValueEditor.prototype.deactivated = function () { this.completeEdit(true); }; ValueEditor.prototype.completeEdit = function (isCancel, exitKey) { if(this._element) { this.checkForValueCommit(isCancel); if(this._intellisenseContext) { this._intellisenseContext.uninitialize(); } var parent = this._textBox.parentElement; if(parent && parent.style) { parent.style.overflow = this._originalOverflow; if(parent.classList.contains("BPT-EditBox-MaxHeightOverride")) { parent.style.maxHeight = this._originalMaxHeight; } } ValueEditor.replace(this._textBox, this._element); this._element = null; if(this._markActiveElement) { this._markActiveElement.classList.remove("BPT-EditBox-Active"); this._markActiveElement = null; } this._textBox.removeEventListener("keydown", this._keyDownHandler); this._textBox.removeEventListener("input", this._updateHandler); this._textBox.removeEventListener("mousedown", this.stopPropagationHandler); this._textBox.removeEventListener("mouseup", this.stopPropagationHandler); this._textBox.removeEventListener("click", this.stopPropagationHandler); this._textBox.removeEventListener("dblclick", this.stopPropagationHandler); this._textBox.removeEventListener("contextmenu", this._contentMenuHandler); this._textBox.removeEventListener("mousewheel", this._mouseWheelHandler); this._htmlElementSource.removeEventListener("mousedown", this._mouseDownHandler); this._htmlElementSource.removeEventListener("dblclick", this._doubleClickHandler); this._hostBridge.removeEventListener("deactivated", this._deactivatedHandler); var dragElements = this._dragElements; this._dragElements = []; for(var i = 0, end = dragElements.length; i < end; i++) { dragElements[i].draggable = true; } if(this._onExit) { this._onExit(this._lastCommitValue, this._originalValue, exitKey, isCancel); } } }; ValueEditor.prototype.onKeyPress = function (evt) { if(this._element) { var key = new ValueEditorKey(evt.key, evt.shiftKey, evt.ctrlKey, evt.altKey, evt.metaKey); if(key.equalTo(ValueEditorKey.EscapeKey)) { this.completeEdit(true, key); return false; } if(key.equalTo(ValueEditorKey.ShiftF10Key)) { var offset = this._textBox.getBoundingClientRect(); this._domExplorer.handleContextMenuForTextbox(this._textBox, offset.left, offset.top); return false; } for(var i = 0; i < this._exitKeys.length; i++) { if(key.equalTo(this._exitKeys[i])) { this.completeEdit(false, key); return false; } } if(this._allowTabs && (key.equalTo(Dom.ValueEditorKey.TabKey) || key.equalTo(Dom.ValueEditorKey.ShiftTabKey))) { if(key.equalTo(Dom.ValueEditorKey.TabKey)) { var start = this._textBox.selectionStart; var end = this._textBox.selectionEnd; this.setValue("\t", start, end); } return false; } if(this._isNumericArrowsEnabled && (!this._intellisenseContext || !this._intellisenseContext.intellisenseMenu.isOpen)) { for(var i = 0; i < this._arrowKeys.length; i++) { if(key.equalTo(this._arrowKeys[i])) { var changeAmount = (key.shiftKey ? 10 : 1) * (key.key === "Up" ? 1 : -1); if(this.numericValueChange(changeAmount)) { return false; } break; } } } } return true; }; ValueEditor.prototype.numericValueChange = function (changeAmount) { var caret = this._textBox.selectionStart; var match = this.findNumberAtCaret(); if(match) { var length = match.length - match.extraLength; var num = length ? parseInt(this._textBox.value.substr(match.start, length)) : 0; var newNum = (num + changeAmount).toString(); this.setValue(newNum, match.start, match.start + length); this._textBox.selectionStart = match.start; this._textBox.selectionEnd = match.start + newNum.length + match.extraLength; this.checkForValueCommit(false); } return !!match; }; ValueEditor.prototype.findNumberAtCaret = function () { var start = this._textBox.selectionStart; var value = this._textBox.value; var match; var matchStart; var matchLength; var extraLength; var matched; var numberRegex = /^-?\d*(\.?\d*(%|[a-zA-Z]+)?)/; var digitRegex = /\d/; do { match = value.substr(start).match(numberRegex); matched = match && digitRegex.test(value.substr(start, match[0].length)); if(matched) { matchStart = start; matchLength = match[0].length; extraLength = match[1].length; } start--; }while(start >= 0 && (match && match[0].length || start === this._textBox.selectionStart - 1)); if(matchLength) { return { start: matchStart, length: matchLength, extraLength: extraLength }; } ; }; ValueEditor.replace = function replace(element, replaceWith) { var parent = element.parentElement; var nextSibling = element.nextSibling; parent.removeChild(element); if(nextSibling) { parent.insertBefore(replaceWith, nextSibling); } else { parent.appendChild(replaceWith); } }; return ValueEditor; })(); Dom.ValueEditor = ValueEditor; })(Dom || (Dom = {})); //@ sourceMappingURL=valueEditor.js.map // toolContextMenus.ts var ToolContextMenus = (function () { function ToolContextMenus() { this.menuTreeView = [ { id: "menuTreeViewAddAttribute", text: Plugin.Resources.getString("/Common/AddAttributeMenuText") }, { id: "menuTreeViewDelete", text: Plugin.Resources.getString("/Common/DeleteElement"), accessKey: Plugin.Resources.getString("AccessKeyDel") }, "separator", { id: "menuTreeEditAsHtml", text: Plugin.Resources.getString("/Common/EditAsHtmlMenuText") }, { id: "menuTreeViewCut", text: Plugin.Resources.getString("/Common/CutMenuText"), accessKey: Plugin.Resources.getString("AccessKeyCtrlX") }, { id: "menuTreeViewCopy", text: Plugin.Resources.getString("/Common/CopyMenuText"), accessKey: Plugin.Resources.getString("AccessKeyCtrlC") }, { id: "menuTreeViewPasteAsChild", text: Plugin.Resources.getString("/Common/PasteAsChildMenuText"), accessKey: Plugin.Resources.getString("AccessKeyCtrlV") }, { id: "menuTreeViewPasteBefore", text: Plugin.Resources.getString("/Common/PasteBeforeMenuText") }, { id: "menuTreeCopyElementWithStyles", text: Plugin.Resources.getString("/Common/CopyElementWithStylesMenuText") } ]; this.menuTextControl = [ { id: "menuTextControlCut", text: Plugin.Resources.getString("/Common/CutMenuText"), accessKey: Plugin.Resources.getString("AccessKeyCtrlX") }, { id: "menuTextControlCopy", text: Plugin.Resources.getString("/Common/CopyMenuText"), accessKey: Plugin.Resources.getString("AccessKeyCtrlC") }, { id: "menuTextControlPaste", text: Plugin.Resources.getString("/Common/PasteMenuText"), accessKey: Plugin.Resources.getString("AccessKeyCtrlV") } ]; this.menuAttributes = [ { id: "menuAttributesCopy", text: Plugin.Resources.getString("/Common/CopyMenuText"), accessKey: Plugin.Resources.getString("AccessKeyCtrlC") } ]; } return ToolContextMenus; })(); //@ sourceMappingURL=toolContextMenus.js.map // tabPanes.ts var TabPanes = (function () { function TabPanes(_hostBridge, _proxy, _styleCache, _domExplorer) { this._hostBridge = _hostBridge; this._proxy = _proxy; this._styleCache = _styleCache; this._domExplorer = _domExplorer; this.activeTab = null; this._scrollPositions = { }; } TabPanes._styleListId = "styleList"; TabPanes._styleRuleTemplateId = "styleRuleTemplate"; TabPanes._traceStyleListId = "traceStyleList"; TabPanes._traceStyleTemplateId = "traceStyleTemplate"; TabPanes._computedStyleListId = "computedStylesList"; TabPanes._computedStyleItemTemplateId = "computedStylesItemTemplate"; TabPanes._eventsTemplateId = "eventsTemplate"; TabPanes._eventsListId = "eventsList"; TabPanes._eventsItemTemplateId = "eventsTemplate"; TabPanes.prototype.executeCleanup = function () { this.storeScrollPosition(); $m(".BPT-HorizontalPane-Right-Tab").hide().addClass("BPT-Tab-Inactive"); if(this._cleanup) { this._cleanup(); this._cleanup = null; } }; TabPanes.prototype.clearLayoutAndStylesAndTraceStylesState = function () { $m(".BPT-HorizontalPane-Right-Content > .BPT-DataTree-Container").data("previousUid", ""); this._styleCache.clearState(); this._styleView && this._styleView.clearView(); this._traceStyleView && this._traceStyleView.clearView(); this.clearLayoutView(); }; TabPanes.prototype.clearState = function () { this.clearLayoutAndStylesAndTraceStylesState(); this._computedStyleView && this._computedStyleView.clearView(); }; TabPanes.prototype.storeScrollPosition = function () { var scrollContainer = $m("#pane-right"); this._scrollPositions[this.activeTab] = { left: scrollContainer.scrollLeft(), top: scrollContainer.scrollTop() }; }; TabPanes.prototype.restoreScrollPosition = function () { var scrollPosition = this._scrollPositions[this.activeTab]; if(!scrollPosition) { scrollPosition = { left: 0, top: 0 }; this._scrollPositions[this.activeTab] = scrollPosition; } var scrollContainer = $m("#pane-right"); scrollContainer.scrollLeft(scrollPosition.left); scrollContainer.scrollTop(scrollPosition.top); }; TabPanes.prototype.setPaneLeftJustification = function () { var containerLeftEdge = (document.getElementsByClassName("BPT-Tabbar")[0]).getBoundingClientRect().left; var dividerLocation = (document.getElementsByClassName("BPT-Pane-Divider")[0]).getBoundingClientRect().left; var offset = dividerLocation - containerLeftEdge + 3; $m(document.getElementById("pane-right")).css("left", offset + "px"); }; TabPanes.prototype.showStyles = function (uid, tagName) { this.executeCleanup(); this.activeTab = "stylesView"; $m("#stylesView").show().removeClass("BPT-Tab-Inactive"); this.restoreScrollPosition(); this.setPaneLeftJustification(); this._cleanup = function () { if(this._styleView) { this._styleView.clearView(); } }; if(!uid || !tagName || (/^#/).test(tagName)) { if(this._styleView) { this._styleView.clearView(); } TabPanes.fireTabLoadedCodeMarker(); return; } if(!this._styleModel) { this._styleModel = new Dom.StyleModel(this._hostBridge, this._domExplorer, this._proxy, this._styleCache); this._styleModel.setLoadArgs([ uid ]); this._styleView = new Dom.StyleView(this._domExplorer, this._hostBridge, document, TabPanes._styleListId, TabPanes._styleRuleTemplateId, this._styleModel, Plugin.Resources); this._styleView.renderViewCallback = TabPanes.fireTabLoadedCodeMarker; } else { this._styleModel.setLoadArgs([ uid ]); } this._styleView.updateView(); }; TabPanes.prototype.getStyleView = function () { return this._styleView; }; TabPanes.prototype.getTraceView = function () { return this._traceStyleView; }; TabPanes.prototype.showTraceStyles = function (uid, tagName) { this.executeCleanup(); this.activeTab = "traceStylesView"; $m("#traceStylesView").show().removeClass("BPT-Tab-Inactive"); this.restoreScrollPosition(); this.setPaneLeftJustification(); this._cleanup = function () { if(this._traceStyleView) { this._traceStyleView.clearView(); } }; if(!uid || !tagName || (/^#/).test(tagName)) { if(this._traceStyleView) { this._traceStyleView.clearView(); } TabPanes.fireTabLoadedCodeMarker(); return; } if(!this._traceStyleModel) { this._traceStyleModel = new Dom.TraceStyleModel(this._proxy, this._styleCache); this._traceStyleModel.setLoadArgs([ uid ]); this._traceStyleView = new Dom.TraceStyleView(document, TabPanes._traceStyleListId, TabPanes._traceStyleTemplateId, this._traceStyleModel); this._traceStyleView.renderViewCallback = TabPanes.fireTabLoadedCodeMarker; } else { this._traceStyleModel.setLoadArgs([ uid ]); } this._traceStyleView.updateView(); }; TabPanes.prototype.showComputedStyles = function (uid, tagName) { this.executeCleanup(); this.activeTab = "computedStylesView"; $m("#computedStylesView").show().removeClass("BPT-Tab-Inactive"); this.restoreScrollPosition(); this.setPaneLeftJustification(); this._cleanup = function () { if(this._computedStyleView) { this._computedStyleView.clearView(); } }; if(!uid || !tagName || (/^#/).test(tagName)) { if(this._computedStyleView) { this._computedStyleView.clearView(); } TabPanes.fireTabLoadedCodeMarker(); return; } if(!this._computedStyleModel) { this._computedStyleModel = new Dom.ComputedStyleModel(this._proxy, this._styleCache, toolwindowHelpers.createShortenedUrlText); this._computedStyleModel.setLoadArgs([ uid ]); this._computedStyleView = new Dom.ComputedStyleView(this._domExplorer, document, TabPanes._computedStyleListId, TabPanes._computedStyleItemTemplateId, this._computedStyleModel); this._computedStyleView.renderViewCallback = TabPanes.fireTabLoadedCodeMarker; } else { this._computedStyleModel.setLoadArgs([ uid ]); } this._computedStyleView.updateView(); }; TabPanes.prototype.getComputedStyleModel = function () { return this._computedStyleModel; }; TabPanes.prototype.getComputedStyleView = function () { return this._computedStyleView; }; TabPanes.prototype.showLayout = function (uid, tagName) { var previousUid = $m("#layoutView").attr("data-uid"); this.executeCleanup(); this.activeTab = "layoutView"; var layoutView = $m("#layoutView"); layoutView.show().removeClass("BPT-Tab-Inactive"); this.restoreScrollPosition(); this.setPaneLeftJustification(); this._cleanup = function () { layoutView.attr("data-uid", ""); layoutView.attr("data-tag", ""); }; if(!uid || !tagName || (/^#/).test(tagName)) { this.clearLayoutView(); return; } $m("#layout-offset-layer").show(); var gleamRequired = uid === previousUid; layoutView.attr("data-uid", uid); layoutView.attr("data-tag", tagName); var gleamLayoutChange = F12.DomExplorer.gleamChange; this._proxy.callRemote("getComputedBox", [ uid ], function (obj) { if(obj) { layoutView.find("[data-layoutProperty]").each(function (index) { var element = $m(this); var prop = element.attr("data-layoutProperty"); var value = obj[prop] == undefined ? "" : obj[prop] + ""; value = value.replace(/px$/, ""); if(gleamRequired && element.text() !== value) { gleamLayoutChange(element); } element.text(value); }); } TabPanes.fireTabLoadedCodeMarker(); }); }; TabPanes.prototype.showEvents = function (uid, tagName) { var _this = this; this.executeCleanup(); this.activeTab = "eventsView"; var container = $m("#eventsView").show().removeClass("BPT-Tab-Inactive"); this.setPaneLeftJustification(); this._cleanup = function () { if(_this._eventsView) { _this._eventsView.clearView(); } _this._proxy.callRemote("clearCurrentEventProxy", []); }; if(!uid || !tagName || (/^#/).test(tagName)) { if(this._eventsView) { this._eventsView.clearView(); } TabPanes.fireTabLoadedCodeMarker(); return; } if(!this._eventsModel) { this._eventsModel = new Dom.EventsModel(this._proxy, this._styleCache, toolwindowHelpers.createShortenedUrlText); this._eventsModel.setLoadArgs([ uid ]); this._eventsView = new Dom.EventsView(document, TabPanes._eventsListId, TabPanes._eventsTemplateId, this._eventsModel, this._domExplorer); this._eventsModel.updateCallback = this._eventsView.renderView.bind(this._eventsView); this._eventsView.renderViewCallback = TabPanes.fireTabLoadedCodeMarker; } else { this._eventsModel.setLoadArgs([ uid ]); } this._eventsView.updateView(); TabPanes.fireTabLoadedCodeMarker(); }; TabPanes.prototype.clearLayoutView = function () { var layoutView = $m("#layoutView"); layoutView.find("[data-layoutProperty]").text(""); $m("#layout-offset-layer").hide(); }; TabPanes.fireTabLoadedCodeMarker = function fireTabLoadedCodeMarker() { toolwindowHelpers.codeMarker(toolwindowHelpers.codeMarkers.perfBrowserTools_DiagnosticsToolWindowsDomExplorerTabChanged); if(TabPanes._tabLoadedCallback) { TabPanes._tabLoadedCallback(); TabPanes._tabLoadedCallback = null; } }; Object.defineProperty(TabPanes, "tabLoadedCallback", { set: function (callback) { TabPanes._tabLoadedCallback = callback; }, enumerable: true, configurable: true }); return TabPanes; })(); //@ sourceMappingURL=tabPanes.js.map // domTree.ts var Dom; (function (Dom) { (function (EditMode) { EditMode._map = []; EditMode._map[0] = "none"; EditMode.none = 0; EditMode._map[1] = "name"; EditMode.name = 1; EditMode._map[2] = "value"; EditMode.value = 2; EditMode._map[3] = "add"; EditMode.add = 3; })(Dom.EditMode || (Dom.EditMode = {})); var EditMode = Dom.EditMode; ; var DomTree = (function () { function DomTree(_domExplorer, _hostBridge, _proxy) { this._domExplorer = _domExplorer; this._hostBridge = _hostBridge; this._proxy = _proxy; this._forceRefreshAttributes = [ "style", "class", "id", "checked", "color", "type", "align", "valign" ]; } DomTree.prototype.expandToRemoteSelectedElement = function () { var _this = this; this._proxy.callRemote("getParentChainForSelectedElement", [], function (chain) { _this.expandElementChain(chain); }); }; DomTree.prototype.createHtmlTreeItems = function (parentElement, children, skipHandlers, virtualElementCount) { var _this = this; if(!children) { return; } var existingIdMap = { }; var existingElements = parentElement.children(".BPT-HtmlTree-ChildCollection").children(); for(var elementIndex = 0; elementIndex < existingElements.length; elementIndex++) { var uid = $m(existingElements.get(elementIndex)).attr("data-id"); existingIdMap[uid] = true; } this.initializeIntellisenseProvider(); for(var i = 0; i < children.length; i++) { children[i].text = children[i].text || ""; if(!skipHandlers) { this.addEventHandlers(parentElement, children[i].uid); } var id = children[i].uid; if(existingIdMap[id]) { existingIdMap[id] = false; } } for(var removed in existingIdMap) { if(existingIdMap[removed]) { this._proxy.callRemote("removeChildMappings", [ removed ]); } } if(skipHandlers) { parentElement.data("forceShowAll", true); } return HtmlTreeView.addElements(parentElement, children, function (a, b, c, d) { return _this.expandCallback(a, b, c, d); }, function (a, b, c) { return _this.valueEditCallback(a, b, c); }, function (a, b, c) { return _this.selectCallback(a, b, c); }, true, true, virtualElementCount); }; DomTree.prototype.initializeIntellisenseProvider = function () { this._classIntellisenseProvider = new Common.Intellisense.StaticContentProvider(); this.updateClassIntellisenseProvider(); }; DomTree.prototype.updateClassIntellisenseProvider = function () { var _this = this; this._domExplorer.traceWriter.raiseEvent(Common.TraceEvents.Dom_Intellisense_Start); this.getCssClassesUsedInCurrentDocument(function (choices) { _this._classIntellisenseProvider.choices = choices; _this._domExplorer.traceWriter.raiseEvent(Common.TraceEvents.Dom_Intellisense_Stop); }); }; DomTree.prototype.addEventHandlers = function (parentElement, childUid) { this._proxy.callRemote("addTreeModifiedEvent", [ childUid ]); this._proxy.callRemote("addAttrModifiedEvent", [ childUid ]); }; DomTree.prototype.initializeAttributeModifiedEvent = function () { var _this = this; var treeRoot = $m("#tree"); this._proxy.callRemote("setupAttributeModifiedEvent", [ function (modifications) { var selected = HtmlTreeView.getSelected(treeRoot); var parents = selected.parents(".BPT-HtmlTreeItem").not(".BPT-HtmlTreeItem-HiddenRoot"); var doRefresh = false; var attrForcingRefresh; modifications.forEach(function (attributeModification) { var gleamAttributeChange = F12.DomExplorer.gleamChange; var directParentElement = document.querySelector("div[data-id='" + attributeModification.uid + "']"); doRefresh = doRefresh || selected.attr("data-id") === attributeModification.uid; if(!doRefresh) { for(var i = 0; i < parents.length; i++) { if((parents.get(i)).getAttribute("data-id") === attributeModification.uid) { doRefresh = true; break; } } } if(!attrForcingRefresh && doRefresh) { if(_this._forceRefreshAttributes.indexOf(attributeModification.attrName) >= 0) { attrForcingRefresh = attributeModification.attrName; } } if(directParentElement) { var directParent = $m(directParentElement); var header = directParent.children(".BPT-HtmlTreeItem-Header"); var editbox = header.find(".BPT-EditBox[data-attrName='" + attributeModification.attrName + "']"); var attrNode; if(attributeModification.attrChange === 3) { if(editbox.length > 0) { editbox.trigger("valueRemoved"); } else { attrNode = header.find(".BPT-HTML-Attribute-Section[data-attrName='" + attributeModification.attrName + "']"); attrNode.remove(); } } else { if(editbox.length > 0) { editbox.trigger("valueChanged", attributeModification.newValue); } else { attrNode = header.find(".BPT-HTML-Attribute-Section[data-attrName='" + attributeModification.attrName + "']"); var gleamChange = false; if(attrNode.length > 0) { attrNode = attrNode.find(".BPT-HTML-Value"); if(attrNode.length) { var oldValue = attrNode.text(); if(oldValue !== attributeModification.newValue) { attrNode.text(attributeModification.newValue); gleamChange = true; } } } else { var newAttribute = HtmlTreeView.addAttribute(directParent, attributeModification.attrName, attributeModification.newValue); attrNode = newAttribute.find(".BPT-HTML-Value"); gleamChange = true; } if(gleamChange) { gleamAttributeChange(attrNode); } } if(TabItem.isActive($m("#layoutTabButton"))) { var activeElement = document.activeElement; if(activeElement && activeElement.classList && activeElement.classList.contains("BPT-EditBox")) { if($m("#layoutView .BPT-EditBox").length > 0) { doRefresh = false; } } } } } }); if(doRefresh) { _this.refreshAfterAttributeChange(attrForcingRefresh || "", null); } toolwindowHelpers.codeMarker(toolwindowHelpers.codeMarkers.perfBrowserTools_DiagnosticsToolWindowsDomExplorerAttributeChanged); } ]); }; DomTree.prototype.initializeTreeModifiedEvent = function () { var _this = this; var treeRoot = $m("#tree"); this._proxy.callRemote("setupTreeModifiedEvent", [ function (modifiedNodes) { modifiedNodes.forEach(function (obj) { var treeHadFocus = !!document.querySelector("#tree :focus") && document.hasFocus(); var focusInTreeInput = treeHadFocus && HtmlTreeView.currentFocusOnInput() && document.activeElement; var gleamTextChange = F12.DomExplorer.gleamChange; var directParent = treeRoot.find(".BPT-HtmlTreeItem[data-id='" + obj.uid + "']"); function appendChildElement(newText) { newText = newText || ""; var headerTextElement = directParent.find(".BPT-HTML-Text"); if(headerTextElement.length === 1) { headerTextElement.text(newText); } else { headerTextElement.remove(); headerTextElement = $m("").addClass("BPT-HTML-Text").text(newText); directParent.find(".BPT-HtmlTreeItem-Header").children().first().append(headerTextElement); } gleamTextChange(headerTextElement); } var newText; if(directParent.length > 0) { if(HtmlTreeView.isExpanded(directParent)) { if(obj.children) { var selectedParentOrChild = directParent.find(".BPT-HtmlTreeItem-Selected").length > 0; if(obj.children.length === 1 && !obj.children[0].tag && obj.children[0].text && obj.children[0].text.length < _this._domExplorer.maxInlineLength && !obj.children[0].text.match(/\n/g)) { newText = obj.children[0].text; obj.children = null; appendChildElement(newText); HtmlTreeView.toggle(directParent); HtmlTreeView.changeExpandableState(directParent, false); if(selectedParentOrChild) { HtmlTreeView.select(directParent); } } else { directParent.data("forceShowAll", false); _this.createHtmlTreeItems(directParent, obj.children, null, obj.childCount); } } else { HtmlTreeView.toggle(directParent); HtmlTreeView.changeExpandableState(directParent, false); if(selectedParentOrChild) { HtmlTreeView.select(directParent); } } } else if(HtmlTreeView.isCollapsed(directParent)) { if(!obj.children || obj.children.length === 0) { HtmlTreeView.changeExpandableState(directParent, false); } } else { newText = obj.text; var autoexpand = false; if(obj.children && obj.children.length === 1 && !obj.children[0].tag && obj.children[0].text) { if(obj.children[0].text.length < _this._domExplorer.maxInlineLength && !obj.children[0].text.match(/\n/g)) { newText = obj.children[0].text; obj.children = null; } else { autoexpand = true; } } if(obj.children && obj.children.length === 0) { obj.children = null; } appendChildElement(newText); HtmlTreeView.changeExpandableState(directParent, !!obj.children); if(autoexpand) { HtmlTreeView.toggle(directParent); } } _this._domExplorer.updateBreadcrumbs(); } if(focusInTreeInput) { HtmlTreeView.adjustTabindex(); (focusInTreeInput).focus(); } else if(treeHadFocus) { HtmlTreeView.focusSelected(); } else { HtmlTreeView.adjustTabindex(); } }); } ]); }; DomTree.prototype.findFirstAttribute = function (element) { return element.children(".BPT-HtmlTreeItem-Header").find(".BPT-HTML-Attribute-Section").first(); }; DomTree.prototype.findEmbeddedText = function (element) { return element.children(".BPT-HtmlTreeItem-Header").find(".BPT-HTML > .BPT-HTML-Text"); }; DomTree.prototype.findNextAttribute = function (element) { return element.next(".BPT-HTML-Attribute-Section"); }; DomTree.prototype.findPreviousAttribute = function (element) { return element.prev(".BPT-HTML-Attribute-Section"); }; DomTree.prototype.isUnderEditableItem = function (element) { var badTags = [ "#doctype", "script", "noscript", "style" ]; if(this._domExplorer.documentMode < 9) { badTags.push("#comment"); } if(badTags.indexOf(element.attr("data-tag")) >= 0) { return false; } var parents = element.parents(".BPT-HtmlTreeItem"); for(var i = 0; i < parents.length; i++) { var parentElement = parents.get(0); if(badTags.indexOf(parentElement.getAttribute("data-tag")) >= 0) { return false; } } return true; }; DomTree.prototype.findNextEditableElement = function (element, onlyAttributes) { var newElement = this.findNextAttribute(element); if(!onlyAttributes && !newElement.length) { var emptyElement = newElement; newElement = element; var startElement = this.findOwnerItem(element).get(0); do { if(!newElement.hasClass("BPT-HTML-Text") && this.isUnderEditableItem(newElement)) { var textElement = this.findEmbeddedText(this.findOwnerItem(newElement)); if(textElement.length) { return textElement; } } newElement = HtmlTreeView.findNextElementDown(newElement.closest(".BPT-HtmlTreeItem")); if(newElement.length && newElement.get(0) === startElement) { return emptyElement; } if(!newElement.length) { newElement = HtmlTreeView.first; } }while(newElement.length && !this.isUnderEditableItem(newElement)); } return newElement; }; DomTree.prototype.findPreviousEditableElement = function (element) { var newElement = this.findPreviousAttribute(element); if(!newElement.length) { var emptyElement = newElement; var owner = this.findOwnerItem(element); newElement = owner.attr("data-tag") === "#text" ? owner : element; var startElement = this.findOwnerItem(element).get(0); do { if(newElement.hasClass("BPT-HTML-Text")) { newElement = this.findOwnerItem(element); } else { newElement = HtmlTreeView.findNextElementUp(newElement.closest(".BPT-HtmlTreeItem")); if(newElement.length && newElement.get(0) === startElement) { return emptyElement; } if(newElement.length && this.isUnderEditableItem(newElement)) { var textElement = this.findEmbeddedText(newElement); if(textElement.length) { return textElement; } } } if(!newElement.length) { newElement = HtmlTreeView.last; } }while(newElement.length && !this.isUnderEditableItem(newElement)); } return newElement; }; DomTree.prototype.findOwnerAttributeSection = function (element) { return element.closest(".BPT-HTML-Attribute-Section"); }; DomTree.prototype.findOwnerItem = function (element) { return element.closest(".BPT-HtmlTreeItem"); }; DomTree.prototype.findNameForAttribute = function (element) { return element.find(".BPT-HTML-Attribute"); }; DomTree.prototype.findValueForAttribute = function (element) { return element.find(".BPT-HTML-Value"); }; DomTree.prototype.moveEditor = function (element, mode) { var _this = this; window.setTimeout(function () { var item = _this.findOwnerItem(element); HtmlTreeView.select(item); var uid = item.attr("data-id"); if(element.hasClass("BPT-HTML-Attribute-Section")) { if(mode === EditMode.value) { _this.editAttributeValue(uid, element); } else if(mode === EditMode.add) { _this.editNewAttribute(uid, _this.findOwnerItem(element)); } else { _this.editAttributeName(uid, _this.findNameForAttribute(element)); } } else if(element.hasClass("BPT-HTML-Text")) { _this.editText(uid, element); } else { var tag = element.attr("data-tag"); if(tag === "#text") { _this.editText(uid, element.find(".BPT-HTML-Text")); } else if(mode === EditMode.name) { _this.editFirstAttribute(uid, element); } else { _this.editNewAttribute(uid, element); } } }, 0); }; DomTree.prototype.editAttribute = function (uid, name, value, callback) { this._proxy.callRemote("editAttribute", [ uid, name, value ], callback); }; DomTree.prototype.removeAttribute = function (uid, name, callback) { this._proxy.callRemote("removeAttribute", [ uid, name ], callback); }; DomTree.prototype.editTextRemote = function (uid, newText, callback) { this._proxy.callRemote("editText", [ uid, newText ], callback); }; DomTree.prototype.findWidthForTreeItem = function (element) { var item = element.closest(".BPT-HtmlTreeItem-Header"); var compStyle = window.getComputedStyle(item.get(0), null); var borderWidth = parseInt(compStyle.borderLeftWidth, 10) + parseInt(compStyle.borderRightWidth, 10); return item.width() - borderWidth; }; DomTree.prototype.refreshAfterAttributeChange = function (oldName, newName) { if(this._forceRefreshAttributes.indexOf(newName) >= 0 || this._forceRefreshAttributes.indexOf(oldName) >= 0) { this._domExplorer.refreshCSSView(newName === "style" || oldName === "style"); } else { if((oldName && oldName.indexOf("on") === 0) || (newName && newName.indexOf("on") === 0)) { this._domExplorer.refreshEventsView(); } this._domExplorer.updateBreadcrumbs(true); } }; DomTree.prototype.editAttributeName = function (uid, nameElement, newAttributeElement) { var _this = this; var attributeSectionElement = this.findOwnerAttributeSection(nameElement); var parentElement = attributeSectionElement.closest(".BPT-HTML"); var nextEditable = this.findNextEditableElement(attributeSectionElement, false); var previousEditable = this.findPreviousEditableElement(attributeSectionElement); var valueElement = nameElement.next(".BPT-HTML-Value"); var value = valueElement.text(); var valueEditor = new Dom.ValueEditor(document, this._domExplorer, this._hostBridge, window); valueEditor.shouldContinueEdit = this.shouldContinueEdit; var equalsKey = new Dom.ValueEditorKey("="); valueEditor.addExitKeys(equalsKey); var width = Math.min(Math.max(nameElement.width() + 30, 70), this.findWidthForTreeItem(nameElement)); var editElement = $m("").text(nameElement.text()); nameElement.text(""); nameElement.append(editElement); valueEditor.show(editElement.get(0), width, null, function (newName, oldName, exitKey, wasCancelled) { nameElement.text(wasCancelled ? oldName : newName); var isAttributeRemoved; if(!wasCancelled && !newName && !newAttributeElement) { isAttributeRemoved = true; _this.removeAttribute(uid, oldName, function (succeeded) { if(succeeded || !value) { attributeSectionElement.remove(); _this.refreshAfterAttributeChange(oldName, newName); } }); } else if(!wasCancelled && newName.toLowerCase() !== oldName.toLowerCase()) { newName = newName.toLowerCase(); var currentAttributes = attributeSectionElement.closest(".BPT-HTML").find(".BPT-HTML-Attribute"); var editValueElement = valueElement; for(var i = 0; i < currentAttributes.length; i++) { var otherElement = $m(currentAttributes.get(i)); if(otherElement.get(0) !== nameElement.get(0) && otherElement.text().toLowerCase() === newName) { nameElement.text(oldName); if(newAttributeElement) { newAttributeElement.remove(); } _this.editAttributeValue(uid, _this.findOwnerAttributeSection(otherElement)); return; } } attributeSectionElement.attr("data-attrName", newName); nameElement.text(newName); _this._proxy.callRemote("enableEditChaining"); _this.editAttribute(uid, newName, value, function (succeeded) { if(succeeded) { if(!newAttributeElement) { _this.removeAttribute(uid, oldName); } _this.refreshAfterAttributeChange(oldName, newName); } else { if(oldName) { attributeSectionElement.attr("data-attrName", oldName); nameElement.text(oldName); } } _this._proxy.callRemote("disableEditChaining"); }); } else if(newAttributeElement) { isAttributeRemoved = true; newAttributeElement.remove(); } else { nameElement.text(oldName); } var moveTo; var mode = EditMode.none; if(!wasCancelled && exitKey && !exitKey.equalTo(Dom.ValueEditorKey.EnterKey)) { if(exitKey.equalTo(Dom.ValueEditorKey.ShiftTabKey)) { moveTo = previousEditable; mode = EditMode.value; } else if(isAttributeRemoved) { moveTo = nextEditable; mode = EditMode.name; } else { moveTo = attributeSectionElement; mode = EditMode.value; } } if(moveTo && moveTo.length) { _this.moveEditor(moveTo, mode); } else if(parentElement.closest(".BPT-HtmlTreeItem").hasClass("BPT-HtmlTreeItem-Selected")) { _this.resetFocusToContainerItem(parentElement); } }); }; DomTree.prototype.shouldContinueEdit = function (htmlElementTarget) { var htmlElementTargetParent = htmlElementTarget.parentElement; if(((htmlElementTarget.className.indexOf("BPT-HorizontalPane-Left") > -1) && (htmlElementTarget.className.indexOf("BPT-HtmlTree-ScrollContainer") > -1)) || (htmlElementTargetParent && (htmlElementTargetParent.className.indexOf("BPT-HorizontalPane-Left") > -1) && (htmlElementTargetParent.className.indexOf("BPT-HtmlTree-ScrollContainer") > -1))) { return true; } return false; }; DomTree.prototype.getCssClassesUsedInCurrentDocument = function (callback) { this._proxy.callRemote("getCssClassesUsedInCurrentDocument", [], function (args) { var cssClasses = args; var choices = []; for(var i = 0; i < cssClasses.length; i++) { var cssClass = cssClasses[i]; choices.push(new Common.Intellisense.IntellisenseChoice(cssClass, cssClass)); } callback(choices); }); }; DomTree.prototype.getEditAsHtmlText = function (uid, callback) { this._proxy.callRemote("getHTMLString", [ uid, false ], callback); }; DomTree.prototype.setEditAsHtmlText = function (uid, text, callback) { this._proxy.callRemote("replaceElement", [ uid, text ], callback); }; DomTree.prototype.editAsHtml = function (uid, editingElement, width) { var _this = this; this.getEditAsHtmlText(uid, function (textToEdit) { var valueEditor = new Dom.ValueEditor(document, _this._domExplorer, _this._hostBridge, window, Number.MAX_VALUE, null, textToEdit); var extraExitKey = new Dom.ValueEditorKey("Enter", false, true); valueEditor.addExitKeys(extraExitKey); valueEditor.enableTabsInData(); valueEditor.removeExitKeys(Dom.ValueEditorKey.EnterKey); valueEditor.shouldContinueEdit = _this.shouldContinueEdit; var element = editingElement.get(0); valueEditor.show(element, width, null, function (newValue, oldValue, exitKey, wasCancelled) { if(!wasCancelled && (oldValue !== newValue)) { _this.resetFocusToContainerItem(editingElement.parent()); _this.setEditAsHtmlText(uid, newValue); } else { _this.resetFocusToContainerItem(editingElement); } }); }); }; DomTree.prototype.editAttributeValue = function (uid, attributeSection) { var _this = this; var valueContext = attributeSection.children(".BPT-HTML-Value"); var attrName = attributeSection.attr("data-attrName"); if(attrName === "class") { this.updateClassIntellisenseProvider(); var intellisenseContext = new Common.Intellisense.IntellisenseContext(new Common.Intellisense.InputElementTextEditorBridge(), new Common.Intellisense.IntellisenseMenu("intellisenseListBox", null, 500, true), this._classIntellisenseProvider, this._hostBridge); } var itemWidth = this.findWidthForTreeItem(valueContext); var width = Math.min(Math.max(valueContext.width() + 30, 120), itemWidth); var valueEditor = new Dom.ValueEditor(document, this._domExplorer, this._hostBridge, window, width === itemWidth ? 3 : 1, intellisenseContext); valueEditor.shouldContinueEdit = this.shouldContinueEdit; var editElement = $m("").text(valueContext.text()); valueContext.text(""); valueContext.append(editElement); valueEditor.show(editElement.get(0), width, function (newValue, oldValue) { _this.editAttribute(uid, attrName, newValue, function (succeeded) { if(succeeded) { _this.refreshAfterAttributeChange(_this.findNameForAttribute(attributeSection).text(), null); } }); }, function (newValue, oldValue, exitKey, wasCancelled) { valueContext.text(wasCancelled ? oldValue : newValue); var moveTo; var mode = EditMode.name; if(!wasCancelled && exitKey && !exitKey.equalTo(Dom.ValueEditorKey.EnterKey)) { if(exitKey.equalTo(Dom.ValueEditorKey.TabKey)) { moveTo = _this.findNextEditableElement(attributeSection, true); if(!moveTo.length) { moveTo = attributeSection; mode = EditMode.add; } } else { moveTo = attributeSection; } } if(moveTo && moveTo.length) { _this.moveEditor(moveTo, mode); } else if(valueContext.closest(".BPT-HtmlTreeItem").hasClass("BPT-HtmlTreeItem-Selected")) { _this.resetFocusToContainerItem(valueContext); } }); }; DomTree.prototype.editNewAttribute = function (uid, element) { this._domExplorer.traceWriter.raiseEvent(Common.TraceEvents.Dom_AddAttribute_Start); var newAttribute = HtmlTreeView.addAttribute(element, "", ""); this.editAttributeName(uid, this.findNameForAttribute(newAttribute), newAttribute); this._domExplorer.traceWriter.raiseEvent(Common.TraceEvents.Dom_AddAttribute_Stop); }; DomTree.prototype.editFirstAttribute = function (uid, element) { var firstAttribute = this.findFirstAttribute(element); if(firstAttribute.length) { this.editAttributeName(uid, this.findNameForAttribute(firstAttribute)); } else { this.editNewAttribute(uid, element); } }; DomTree.prototype.resetFocusToContainerItem = function (element) { var elementInQuestion = element.get(0); var scrollContainer = F12.DomExplorer.DomExplorerWindow.findAncestorByClass(elementInQuestion, "BPT-HtmlTree-ScrollContainer"); if(scrollContainer != null) { var saveScrollTop = scrollContainer.scrollTop; HtmlTreeView.select(element.closest(".BPT-HtmlTreeItem")); element.closest(".BPT-HtmlTree-Container").focus(); scrollContainer.scrollTop = saveScrollTop; HtmlTreeView.focusSelected(); } }; DomTree.prototype.editText = function (uid, editingElement) { var _this = this; if(this.isUnderEditableItem(editingElement)) { var editor = new Dom.ValueEditor(document, this._domExplorer, this._hostBridge, window, 20); editor.shouldContinueEdit = this.shouldContinueEdit; editor.doTrim = false; editor.show(editingElement.get(0), this.findWidthForTreeItem(editingElement), function (newText, oldText) { _this.editTextRemote(uid, newText); }, function (newText, oldText, exitKey, wasCancelled) { var moveTo; var mode = EditMode.none; if(!wasCancelled && exitKey && !exitKey.equalTo(Dom.ValueEditorKey.EnterKey)) { if(exitKey.equalTo(Dom.ValueEditorKey.TabKey)) { moveTo = _this.findNextEditableElement(editingElement, false); mode = EditMode.name; } else { moveTo = _this.findPreviousEditableElement(editingElement); mode = EditMode.value; } } if(moveTo && moveTo.length) { _this.moveEditor(moveTo, mode); } else { _this.resetFocusToContainerItem(editingElement); } }); } else { this.resetFocusToContainerItem(editingElement); } }; DomTree.prototype.valueEditCallback = function (parentElement, editingElement, ctrl) { var valueContext = null; var uid = parentElement.attr("data-id"); if(ctrl) { var element = editingElement || parentElement; if(this._domExplorer.canDeleteItem(element)) { var uid = parentElement.attr("data-id"); this.editAsHtml(uid, element, this._domExplorer.horizontalPane.leftWidth * .80); } } else { if(this.isUnderEditableItem(parentElement)) { if(editingElement) { if(editingElement.hasClass("BPT-HTML-Attribute")) { this.editAttributeName(uid, editingElement); } else if(editingElement.hasClass("BPT-HTML-Attribute-Section")) { this.editAttributeValue(uid, editingElement); } else if(editingElement.hasClass("BPT-HTML-Text")) { this.editText(uid, editingElement); } } else { var tag = parentElement.attr("data-tag"); if(tag === "#text") { this.editText(uid, parentElement.find(".BPT-HTML-Text")); } else if(tag !== "#comment" && tag !== "#doctype") { this.editFirstAttribute(uid, parentElement); } } } } }; DomTree.prototype.selectCallback = function (parentElement, id, tag) { var _this = this; if(this._domExplorer.currentSelectedId !== id) { if(this.tabRefreshTimeout) { window.clearTimeout(this.tabRefreshTimeout); } var refreshTab = function () { _this._domExplorer.traceWriter.raiseEvent(Common.TraceEvents.Dom_SelectElement_Start); _this._domExplorer.tabPanes.clearState(); var parentId; if(TabItem.isActive($m("#stylesTabButton"))) { var doShowStyles = true; if(tag === '#text') { var selected = $m("div[data-id=" + id + "]"); var parentOfSelected = selected.parents(".BPT-HtmlTreeItem").not(".BPT-HtmlTreeItem-HiddenRoot").first(); if(parentOfSelected.length) { parentId = parentOfSelected.attr("data-id"); _this._domExplorer.tabPanes.showStyles(parentId, parentOfSelected.attr("data-tag")); doShowStyles = false; } } if(doShowStyles) { _this._domExplorer.tabPanes.showStyles(id, tag); } } else if(TabItem.isActive($m("#traceStylesTabButton"))) { _this._domExplorer.tabPanes.showTraceStyles(id, tag); } else if(TabItem.isActive($m("#computedStylesTabButton"))) { _this._domExplorer.tabPanes.showComputedStyles(id, tag); } else if(TabItem.isActive($m("#layoutTabButton"))) { _this._domExplorer.tabPanes.showLayout(id, tag); } else if(TabItem.isActive($m("#eventsTabButton"))) { _this._domExplorer.tabPanes.showEvents(id, tag); } _this._domExplorer.updateBreadcrumbs(); _this._domExplorer.showElementHighlight(parentId || id); _this._proxy.callRemote("storeElementForConsole", [ id ]); _this._domExplorer.traceWriter.raiseEvent(Common.TraceEvents.Dom_SelectElement_Stop); }; this._domExplorer.currentSelectedId = id; if(!this.immediateTabRefresh) { this.tabRefreshTimeout = window.setTimeout(refreshTab, 100); } else { refreshTab(); this.immediateTabRefresh = false; } } }; DomTree.prototype.expandElementChain = function (chain) { var elements = []; this._domExplorer.traceWriter.raiseEvent(Common.TraceEvents.Dom_ExpandNode_Start); for(var i = 0; i < chain.length; i++) { if(chain[i].children) { var element = $m("div[data-id=" + chain[i].uid + "]"); this.createHtmlTreeItems(element, chain[i].children, true); element.removeClass("BPT-HtmlTreeItem-Collapsed").addClass("BPT-HtmlTreeItem-Expanded"); element.attr("aria-expanded", "true"); elements.push({ element: element, children: chain[i].children }); } } for(var index = 0; index < elements.length; index++) { for(var j = 0; j < elements[index].children.length; j++) { this.addEventHandlers(elements[index].element, elements[index].children[j].uid); } } this.immediateTabRefresh = true; var selectUID = chain.pop().uid; var selectedElement = null; if(selectUID === "uid-selectchild") { selectUID = chain.pop().uid; selectedElement = $m("div[data-id=" + selectUID + "]"); selectedElement = selectedElement.find(".BPT-HtmlTreeItem").not(".BPT-HtmlTreeItem-HiddenRoot").first(); } else { selectedElement = $m("div[data-id='" + selectUID + "']"); } HtmlTreeView.select(selectedElement.closest(".BPT-HtmlTreeItem"), false); toolwindowHelpers.scrollIntoView(selectedElement.get(0), selectedElement.closest(".BPT-HtmlTree-ScrollContainer").get(0)); this._domExplorer.traceWriter.raiseEvent(Common.TraceEvents.Dom_ExpandNode_Stop); }; DomTree.prototype.expandCallback = function (isExpanding, parentElement, id, onExpandComplete) { var _this = this; if(isExpanding) { var showAll = parentElement.data("forceShowAll"); var result = []; if(showAll) { var loadingDiv = $m("").addClass("BPT-HtmlTree-ChildCollection-ShowAll").addClass("BPT-HtmlTreeItem"); loadingDiv.text(toolwindowHelpers.loadString("LoadingText", null)); parentElement.children(".BPT-HtmlTreeItem-Footer").prepend(loadingDiv); } this._proxy.callRemote("getChildren", [ id, showAll, function (chunk) { result.push.apply(result, chunk.children); if(chunk.chunkNumber + 1 === chunk.chunkCount) { _this.renderChildren(result, chunk.totalChildCount, parentElement, onExpandComplete); result = []; if(loadingDiv) { loadingDiv.remove(); } } } ]); } else { this._proxy.callRemote("removeChildMappings", [ id ], function () { if(_this._domExplorer.expandCallback) { _this._domExplorer.expandCallback(parentElement.get(0), false); } }); } }; DomTree.prototype.renderChildren = function (children, totalCount, parentElement, onExpandComplete) { if(!children) { return; } var childGroup = this.createHtmlTreeItems(parentElement, children, false, totalCount); toolwindowHelpers.codeMarker(toolwindowHelpers.codeMarkers.perfBrowserTools_DiagnosticsToolWindowsTreeViewToggleEnd); if(onExpandComplete) { onExpandComplete(childGroup); } if(this._domExplorer.expandCallback) { this._domExplorer.expandCallback(parentElement.get(0), true); } }; return DomTree; })(); Dom.DomTree = DomTree; ; })(Dom || (Dom = {})); //@ sourceMappingURL=domTree.js.map // styleRule.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var Dom; (function (Dom) { (function (StyleRuleChangeEvent) { StyleRuleChangeEvent._map = []; StyleRuleChangeEvent._map[0] = "uid"; StyleRuleChangeEvent.uid = 0; StyleRuleChangeEvent._map[1] = "selector"; StyleRuleChangeEvent.selector = 1; StyleRuleChangeEvent._map[2] = "addProperty"; StyleRuleChangeEvent.addProperty = 2; })(Dom.StyleRuleChangeEvent || (Dom.StyleRuleChangeEvent = {})); var StyleRuleChangeEvent = Dom.StyleRuleChangeEvent; (function (StylePropertyChangeEvent) { StylePropertyChangeEvent._map = []; StylePropertyChangeEvent._map[0] = "uid"; StylePropertyChangeEvent.uid = 0; StylePropertyChangeEvent._map[1] = "name"; StylePropertyChangeEvent.name = 1; StylePropertyChangeEvent._map[2] = "value"; StylePropertyChangeEvent.value = 2; StylePropertyChangeEvent._map[3] = "isWinning"; StylePropertyChangeEvent.isWinning = 3; StylePropertyChangeEvent._map[4] = "isEnabled"; StylePropertyChangeEvent.isEnabled = 4; StylePropertyChangeEvent._map[5] = "isApplied"; StylePropertyChangeEvent.isApplied = 5; StylePropertyChangeEvent._map[6] = "status"; StylePropertyChangeEvent.status = 6; StylePropertyChangeEvent._map[7] = "clearSubproperties"; StylePropertyChangeEvent.clearSubproperties = 7; StylePropertyChangeEvent._map[8] = "addSubproperty"; StylePropertyChangeEvent.addSubproperty = 8; StylePropertyChangeEvent._map[9] = "select"; StylePropertyChangeEvent.select = 9; StylePropertyChangeEvent._map[10] = "remove"; StylePropertyChangeEvent.remove = 10; })(Dom.StylePropertyChangeEvent || (Dom.StylePropertyChangeEvent = {})); var StylePropertyChangeEvent = Dom.StylePropertyChangeEvent; (function (StylePropertyStatus) { StylePropertyStatus._map = []; StylePropertyStatus._map[0] = "unknown"; StylePropertyStatus.unknown = 0; StylePropertyStatus._map[1] = "valid"; StylePropertyStatus.valid = 1; StylePropertyStatus._map[2] = "invalidName"; StylePropertyStatus.invalidName = 2; StylePropertyStatus._map[3] = "invalidValue"; StylePropertyStatus.invalidValue = 3; })(Dom.StylePropertyStatus || (Dom.StylePropertyStatus = {})); var StylePropertyStatus = Dom.StylePropertyStatus; var ElementStyleModel = (function () { function ElementStyleModel(_proxy) { this._proxy = _proxy; this.rules = []; this._ruleMap = { }; this._propertyMap = { }; this._inheritedTargets = { }; this._inlinedStyleName = toolwindowHelpers.loadString("InlineStyleSelector"); this._listeners = []; } ElementStyleModel.newUidTag = "new-"; ElementStyleModel.newUidTagLength = ElementStyleModel.newUidTag.length; ElementStyleModel.nextUid = 0; ElementStyleModel.create = function create(proxy, elementUid, callback) { var model = new ElementStyleModel(proxy); proxy.callRemote("getStyles", [ elementUid ], function (allStyles) { if(allStyles) { for(var i = 0; i < allStyles.length; i++) { model.processRawStyle(allStyles[i], i); } callback(model); } }); }; ElementStyleModel.createNewId = function createNewId() { return ElementStyleModel.newUidTag + ElementStyleModel.nextUid++; }; ElementStyleModel.isNew = function isNew(id) { return id.substr(0, ElementStyleModel.newUidTagLength) === ElementStyleModel.newUidTag; }; ElementStyleModel.prototype.addUpdateListener = function (listener) { if(this._listeners.indexOf(listener) < 0) { this._listeners.push(listener); } }; ElementStyleModel.prototype.removeUpdateListener = function (listener) { var index = this._listeners.indexOf(listener); if(index >= 0) { this._listeners.splice(index, 1); } }; ElementStyleModel.prototype.updateWinningRule = function (propertyName) { var _this = this; this._proxy.callRemote("getWinningProperty", [ propertyName ], function (winningPropertyId) { _this.rules.forEach(function (rule) { rule.updateWinningProperty(propertyName, winningPropertyId); }); }); }; ElementStyleModel.prototype.togglePropertyEnable = function (property, isEnabled, callback) { this._proxy.callRemote("EditStylePropertyEnable", [ property.uid, isEnabled ], callback); }; ElementStyleModel.prototype.editRuleSelector = function (ruleId, newSelector, callback) { this._proxy.callRemote("EditStyleRuleSelector", [ ruleId, newSelector ], callback); }; ElementStyleModel.prototype.addRule = function (selector, name, value, isImportant, callback) { this._proxy.callRemote("editStyleRuleAdd", [ selector, name, value, isImportant ], callback); }; ElementStyleModel.prototype.addProperty = function (uid, name, value, isImportant, beforeUid, callback) { this._proxy.callRemote("editStylePropertyAdd", [ uid, name, value, isImportant, beforeUid ], callback); }; ElementStyleModel.prototype.editPropertyName = function (uid, name, callback) { this._proxy.callRemote("editStylePropertyName", [ uid, name ], callback); }; ElementStyleModel.prototype.editPropertyValue = function (uid, value, isImportant, callback) { this._proxy.callRemote("editStylePropertyValue", [ uid, value, isImportant ], callback); }; ElementStyleModel.prototype.applyChanges = function (changes) { var _this = this; changes.forEach(function (change) { switch(change.event) { case "updateProperty": var property = _this.getPropertyById(change.uid); if(property) { property.updateFromRemote(change.obj); if(change.select) { property.select(); } } break; case "removeProperty": var property = _this.getPropertyById(change.uid); if(property) { property.remove(change.select); } break; case "addProperty": var rule = _this.getRuleById(change.uid); if(rule) { var property = rule.addProperty(change.obj, true, _this.getPropertyById(change.beforeUid)); property.recalculateWinning(); if(change.select) { property.select(); } } break; } }); }; ElementStyleModel.prototype.processRawStyle = function (remoteRule, index) { var uid = remoteRule.uid; var rule = new StyleRule(this, this._listeners, uid, remoteRule.isInlined ? this._inlinedStyleName : remoteRule.selector); if(remoteRule.declarationLocation) { rule.fileUrl = remoteRule.declarationLocation.uri; rule.fileLine = remoteRule.declarationLocation.line + 1; rule.fileColumn = remoteRule.declarationLocation.column + 1; } else { rule.fileUrl = remoteRule.styleHref; } if(rule.fileUrl) { rule.fileLinkText = toolwindowHelpers.createFileLinkText(rule.fileUrl, rule.fileLine); rule.tooltip = toolwindowHelpers.loadString("StyleRuleFileTooltip", [ toolwindowHelpers.htmlEscape(rule.fileUrl), rule.fileLine, rule.fileColumn ]); } rule.styleHref = remoteRule.styleHref; rule.target = remoteRule.target; rule.isInherited = remoteRule.isInherited; rule.isInlined = remoteRule.isInlined; rule.parent = remoteRule.parent; rule.isFirstRuleInTargetGroup = remoteRule.isInherited && remoteRule.target && !this._inheritedTargets[remoteRule.target.uid]; this.rules.push(rule); this._ruleMap[uid] = rule; if(remoteRule.properties) { for(var i = 0; i < remoteRule.properties.length; i++) { var property = rule.addProperty(remoteRule.properties[i]); } } if(rule.isFirstRuleInTargetGroup && rule.target) { this._inheritedTargets[rule.target.uid] = rule.target; } }; ElementStyleModel.prototype.getRuleById = function (ruleUid) { return this._ruleMap[ruleUid]; }; ElementStyleModel.prototype.getPropertyById = function (uid) { return this._propertyMap[uid]; }; ElementStyleModel.prototype.remapPropertyId = function (property, oldUid, newUid) { if(oldUid) { delete this._propertyMap[oldUid]; } if(newUid) { this._propertyMap[newUid] = property; } }; ElementStyleModel.prototype.remapRuleId = function (rule, oldUid, newUid) { delete this._ruleMap[oldUid]; this._ruleMap[newUid] = rule; }; ElementStyleModel.prototype.removeProperty = function (property) { delete this._propertyMap[property.uid]; }; ElementStyleModel.prototype.createNewRule = function (selector) { var rule = new StyleRule(this, this._listeners, ElementStyleModel.createNewId(), selector); this._ruleMap[rule.uid] = rule; this.rules.splice(1, 0, rule); return rule; }; ElementStyleModel.prototype.removeRule = function (rule) { if(rule.isInlined) { return false; } delete this._ruleMap[rule.uid]; var rules = this.rules; for(var i = 0; i < rules.length; i++) { if(rules[i] == rule) { rules.splice(i, 1); return true; } } return false; }; ElementStyleModel.prototype.setInlineProperty = function (propertyName, value, isImportant) { for(var i = 0; i < this.rules.length; i++) { var rule = this.rules[i]; if(rule.isInlined && !rule.isInherited) { rule.setExistingOrAddNewProperty(propertyName, value, isImportant); return true; } } return false; }; return ElementStyleModel; })(); Dom.ElementStyleModel = ElementStyleModel; var StyleChangeNotifier = (function () { function StyleChangeNotifier(_listeners) { this._listeners = _listeners; } StyleChangeNotifier.prototype.notifyRuleChange = function (event, rule, arg) { this._listeners.forEach(function (listener) { listener.onRuleChange(event, rule, arg); }); }; StyleChangeNotifier.prototype.notifyPropertyChange = function (event, property, arg) { this._listeners.forEach(function (listener) { listener.onPropertyChange(event, property, arg); }); }; return StyleChangeNotifier; })(); Dom.StyleChangeNotifier = StyleChangeNotifier; var StyleRule = (function (_super) { __extends(StyleRule, _super); function StyleRule(_model, _listeners, _uid, _selectorText) { _super.call(this, _listeners); this._model = _model; this._listeners = _listeners; this._uid = _uid; this._selectorText = _selectorText; this.properties = []; if(!StyleRule._inheritedFromString) { StyleRule._inheritedFromString = typeof (Plugin) != "undefined" && typeof (Plugin.Resources) != "undefined" ? toolwindowHelpers.loadString("DOMExplorerInheritedFromText", "") : ""; } } Object.defineProperty(StyleRule.prototype, "ariaLabel", { get: function () { var result = ""; if(this.isInherited) { result += StyleRule._inheritedFromString + " "; result += this.displayInheritedFrom + " : "; } if(this.parent) { result += this.parent + " : "; } if(this.selectorText) { result += this.selectorText + " "; } if(this.fileLinkText) { result += " : " + this.fileLinkText; } return result; }, enumerable: true, configurable: true }); Object.defineProperty(StyleRule.prototype, "isRule", { get: function () { return true; }, enumerable: true, configurable: true }); Object.defineProperty(StyleRule.prototype, "isProperty", { get: function () { return false; }, enumerable: true, configurable: true }); Object.defineProperty(StyleRule.prototype, "isSubProperty", { get: function () { return false; }, enumerable: true, configurable: true }); Object.defineProperty(StyleRule.prototype, "container", { get: function () { return null; }, enumerable: true, configurable: true }); StyleRule.prototype.addProperty = function (remoteProperty, doNotify, before) { if (typeof doNotify === "undefined") { doNotify = false; } var _this = this; var property; if(remoteProperty) { property = new StyleProperty(this._model, this._listeners, remoteProperty.name, remoteProperty.value, remoteProperty.isImportant, remoteProperty.isApplied, remoteProperty.isEnabled, remoteProperty.isWinning, remoteProperty.status, remoteProperty.uid, this); } else { property = new StyleProperty(this._model, this._listeners, "", "", false, true, false, true, "Valid", ElementStyleModel.createNewId(), this); } this._model.remapPropertyId(property, null, property.uid); var position = this.properties.length; if(before) { for(var i = 0; i < this.properties.length; i++) { if(this.properties[i].uid === before.uid) { position = i; break; } } } this.properties.splice(position, 0, property); if(doNotify) { this.notifyRuleChange(StyleRuleChangeEvent.addProperty, this, property); } if(remoteProperty) { remoteProperty.longhand.forEach(function (longhand) { var subProperty = new StyleProperty(_this._model, _this._listeners, longhand.name, longhand.value, longhand.isImportant, longhand.isApplied, longhand.isEnabled, longhand.isWinning, longhand.status, longhand.uid, _this); property.addSubproperty(subProperty, doNotify); }); } return property; }; Object.defineProperty(StyleRule.prototype, "uid", { get: function () { return this._uid; }, set: function (value) { if(value != this._uid) { var oldUid = this._uid; this._model.remapRuleId(this, oldUid, value); this.notifyRuleChange(StyleRuleChangeEvent.uid, this, value); this._uid = value; } }, enumerable: true, configurable: true }); Object.defineProperty(StyleRule.prototype, "selectorText", { get: function () { return this._selectorText; }, set: function (value) { var _this = this; if(value != this._selectorText) { var self = this; if(this.isNew) { this._selectorText = value; } else { this._model.editRuleSelector(this._uid, value, function (remoteRule) { if(remoteRule) { self.uid = remoteRule.uid; self._selectorText = remoteRule.selector; self.notifyRuleChange(StyleRuleChangeEvent.selector, _this, value); for(var i = 0; i < _this.properties.length; i++) { _this.properties[i].updateFromRemote(remoteRule.properties[i]); } } else { self.notifyRuleChange(StyleRuleChangeEvent.selector, _this, _this._selectorText); } }); } } }, enumerable: true, configurable: true }); StyleRule.prototype.removeProperty = function (property) { var properties = this.properties; property.clearSubproperties(); for(var i = 0; i < properties.length; i++) { if(properties[i] == property) { properties.splice(i, 1); this._model.removeProperty(property); return i; } } return -1; }; Object.defineProperty(StyleRule.prototype, "formatForCopy", { get: function () { var text = (!this.isInlined ? this._selectorText + " " : "") + "{\r\n"; if(this.parent) { text = this.parent + "\r\n" + text; } for(var i = 0; i < this.properties.length; i++) { var property = this.properties[i]; text += " " + property.formatForCopy + "\r\n"; } return text + "}"; }, enumerable: true, configurable: true }); Object.defineProperty(StyleRule.prototype, "isNew", { get: function () { return ElementStyleModel.isNew(this._uid); }, enumerable: true, configurable: true }); Object.defineProperty(StyleRule.prototype, "isEditable", { get: function () { return !this.isInlined; }, enumerable: true, configurable: true }); StyleRule.prototype.updateWinningProperty = function (propertyName, winningPropertyId) { this.properties.forEach(function (property) { property.updateWinning(propertyName, winningPropertyId); }); }; Object.defineProperty(StyleRule.prototype, "displayInheritedFrom", { get: function () { if(this.target.tagName) { var from = this.target.tagName; var tree = document.getElementById("tree"); var headerElement = tree.querySelector(".BPT-HtmlTreeItem[data-id='" + this.target.uid + "'] > .BPT-HtmlTreeItem-Header"); if(headerElement) { var idElement = headerElement.querySelector(".BPT-HTML-Attribute-Section[data-attrName='id'] .BPT-HTML-Value"); if(idElement) { from += "#" + HtmlTreeView.getTextContent(idElement).trim(); } var classElement = headerElement.querySelector(".BPT-HTML-Attribute-Section[data-attrName='class'] .BPT-HTML-Value"); if(classElement) { from += "." + HtmlTreeView.getTextContent(classElement).trim().split(" ")[0]; } } return from; } }, enumerable: true, configurable: true }); StyleRule.prototype.commitNewRule = function (property) { var _this = this; this._model.addRule(this._selectorText, property.name, property.value, property.isImportant, function (result) { if(result) { _this.uid = result.uid; _this.selectorText = result.selector; property.updateFromRemote(result.properties[0]); } }); }; StyleRule.prototype.addRemoteProperty = function (name, value, isImportant) { var _this = this; this._model.addProperty(this.uid, name, value, isImportant, null, function (result) { if(result) { var property = _this.addProperty(result, true); property.recalculateWinning(); } }); }; StyleRule.prototype.setExistingOrAddNewProperty = function (name, value, isImportant) { var property; for(var i = this.properties.length - 1; i >= 0; i--) { if(this.properties[i].name === name) { property = this.properties[i]; break; } } if(property) { property.commitValue(value + (isImportant ? " !important" : "")); } else { this.addRemoteProperty(name, value, isImportant); } }; return StyleRule; })(StyleChangeNotifier); Dom.StyleRule = StyleRule; var StyleProperty = (function (_super) { __extends(StyleProperty, _super); function StyleProperty(_model, _listeners, _name, _value, _isImportant, _isApplied, _isEnabled, _isWinning, status, _uid, rule) { _super.call(this, _listeners); this._model = _model; this._listeners = _listeners; this._name = _name; this._value = _value; this._isImportant = _isImportant; this._isApplied = _isApplied; this._isEnabled = _isEnabled; this._isWinning = _isWinning; this._uid = _uid; this.rule = rule; this.properties = []; this._status = StyleProperty.convertStatusStringToStatus(status); this.owner = this; if(!StyleProperty._ariaOverriddenString) { StyleProperty._ariaOverriddenString = typeof (Plugin) != "undefined" && typeof (Plugin.Resources) != "undefined" ? toolwindowHelpers.loadString("AriaOverridden") : ""; } if(!StyleProperty._ariaInvalidString) { StyleProperty._ariaInvalidString = typeof (Plugin) != "undefined" && typeof (Plugin.Resources) != "undefined" ? toolwindowHelpers.loadString("SingleError", "") + ":" : ""; } } StyleProperty.convertStatusStringToStatus = function convertStatusStringToStatus(status) { switch(status) { case "Valid": return StylePropertyStatus.valid; case "UnrecognizedProperty": return StylePropertyStatus.invalidName; case "InvalidValue": return StylePropertyStatus.invalidValue; } return StylePropertyStatus.unknown; }; StyleProperty.prototype.addSubproperty = function (subproperty, doNotify) { this.properties.push(subproperty); subproperty.owner = this; this._model.remapPropertyId(subproperty, null, subproperty.uid); if(doNotify) { this.notifyPropertyChange(StylePropertyChangeEvent.addSubproperty, this, subproperty); } }; StyleProperty.prototype.clearSubproperties = function () { var _this = this; this.properties.forEach(function (subproperty) { _this._model.remapPropertyId(subproperty, subproperty.uid, null); }); this.properties = []; this.notifyPropertyChange(StylePropertyChangeEvent.clearSubproperties, this); }; StyleProperty.prototype.select = function () { this.notifyPropertyChange(StylePropertyChangeEvent.select, this); }; StyleProperty.prototype.updateWinning = function (propertyName, winningPropertyId) { var foundInSubproperty = false; var winningCount = 0; this.properties.forEach(function (subproperty) { if(subproperty.uid === winningPropertyId) { subproperty.isWinning = true; foundInSubproperty = true; } else if(subproperty.name === propertyName) { subproperty.isWinning = false; foundInSubproperty = true; } if(subproperty._isWinning) { winningCount++; } }); if(foundInSubproperty) { this.isWinning = winningCount > 0; } else if(this.uid === winningPropertyId) { this.isWinning = true; } else if(this.name === propertyName && !this.isShorthand) { this.isWinning = false; } }; StyleProperty.prototype.recalculateWinning = function () { var _this = this; if(this.isShorthand) { this.properties.forEach(function (subproperty) { _this._model.updateWinningRule(subproperty.name); }); } else { this._model.updateWinningRule(this.name); } }; StyleProperty.prototype.toggleEnable = function () { var _this = this; var value = !this._isEnabled; this._model.togglePropertyEnable(this, value, function () { _this.isEnabled = value; _this.recalculateWinning(); }); }; StyleProperty.prototype.commitNewProperty = function () { var _this = this; if(this.rule.isNew) { this.rule.commitNewRule(this); } else { var position = -1; for(var i = 0; i < this.rule.properties.length; i++) { if(this.rule.properties[i] === this) { position = i; break; } } var nextUid = position < this.rule.properties.length - 1 ? this.rule.properties[position + 1].uid : null; this._model.addProperty(this.rule.uid, this._name, this._value, this._isImportant, nextUid, function (result) { if(result) { _this.updateFromRemote(result); } }); } }; StyleProperty.prototype.commitName = function (newName) { var _this = this; if(this._name !== newName) { var oldName = this._name; this._name = newName; if(this.isNew) { this.commitNewProperty(); } else { this._model.editPropertyName(this._uid, this._name, function (result) { if(result) { _this.updateFromRemote(result); } else { _this._name = oldName; _this.refreshNameDisplay(); } }); } } }; StyleProperty.prototype.commitValue = function (newValue) { var _this = this; var newImportant = false; if(newValue.match(/!important$/)) { newValue = newValue.substring(0, newValue.length - 10).trim(); newImportant = true; } if(this._value !== newValue || this._isImportant !== newImportant) { var oldValue = this._value; var oldImportant = this._isImportant; this._value = newValue; this._isImportant = newImportant; if(this.isNew) { this.commitNewProperty(); } else { this._model.editPropertyValue(this._uid, this._value, this._isImportant, function (result) { if(result) { _this.updateFromRemote(result); } else { _this._value = oldValue; _this._isImportant = oldImportant; _this.refreshValueDisplay(); } }); } } }; StyleProperty.prototype.remoteUpdateProperty = function (remoteProperty) { this.uid = remoteProperty.uid; this.name = remoteProperty.name; this.status = StyleProperty.convertStatusStringToStatus(remoteProperty.status); this.isEnabled = remoteProperty.isEnabled; this.isApplied = remoteProperty.isApplied; this.setValue(remoteProperty.value, remoteProperty.isImportant); }; StyleProperty.prototype.updateFromRemote = function (remoteProperty) { var _this = this; this.remoteUpdateProperty(remoteProperty); var i; if(this.properties.length == remoteProperty.longhand.length) { for(i = 0; i < this.properties.length; i++) { this.properties[i].remoteUpdateProperty(remoteProperty.longhand[i]); } } else { this.clearSubproperties(); remoteProperty.longhand.forEach(function (longhand) { _this.addSubproperty(new StyleProperty(_this._model, _this._listeners, longhand.name, longhand.value, longhand.isImportant, longhand.isApplied, longhand.isEnabled, true, longhand.status, longhand.uid, _this.rule), true); }); } this.recalculateWinning(); }; StyleProperty.prototype.remove = function (changeSelection) { this.recalculateWinning(); var index = this.rule.removeProperty(this); var nextSelection; if(changeSelection) { nextSelection = index < this.rule.properties.length ? this.rule.properties[index] : (index > 0 ? this.rule.properties[index - 1] : this.rule); } this.notifyPropertyChange(StylePropertyChangeEvent.remove, this, nextSelection); }; Object.defineProperty(StyleProperty.prototype, "isApplied", { get: function () { return this._isApplied; }, set: function (value) { if(value !== this._isApplied) { this._isApplied = value; this.notifyPropertyChange(StylePropertyChangeEvent.isApplied, this, value); } }, enumerable: true, configurable: true }); Object.defineProperty(StyleProperty.prototype, "isEnabled", { get: function () { return this._isEnabled; }, set: function (value) { var _this = this; if(value !== this._isEnabled) { this._isEnabled = value; this.notifyPropertyChange(StylePropertyChangeEvent.isEnabled, this, value); if(this.isSubProperty) { var notifyValue = this.isEnabledIndeterminate ? undefined : this._isEnabled; this.notifyPropertyChange(StylePropertyChangeEvent.isEnabled, this.owner, notifyValue); } else if(this.isShorthand) { this.properties.forEach(function (subproperty) { subproperty._isEnabled = value; _this.notifyPropertyChange(StylePropertyChangeEvent.isEnabled, subproperty, value); }); } } }, enumerable: true, configurable: true }); Object.defineProperty(StyleProperty.prototype, "isWinning", { get: function () { return this._isWinning; }, set: function (value) { this._isWinning = value; this.notifyPropertyChange(StylePropertyChangeEvent.isWinning, this, value); }, enumerable: true, configurable: true }); Object.defineProperty(StyleProperty.prototype, "name", { get: function () { return this._name; }, set: function (value) { if(value !== this._name) { this._name = value; this.notifyPropertyChange(StylePropertyChangeEvent.name, this, value); } }, enumerable: true, configurable: true }); StyleProperty.prototype.refreshNameDisplay = function () { this.notifyPropertyChange(StylePropertyChangeEvent.name, this, this._name); this.notifyPropertyChange(StylePropertyChangeEvent.status, this, this._status); }; Object.defineProperty(StyleProperty.prototype, "value", { get: function () { return this._value; }, enumerable: true, configurable: true }); Object.defineProperty(StyleProperty.prototype, "isImportant", { get: function () { return this._isImportant; }, enumerable: true, configurable: true }); StyleProperty.prototype.setValue = function (value, isImportant) { this._value = value; this._isImportant = isImportant; this.notifyPropertyChange(StylePropertyChangeEvent.value, this, this.valueForDisplay); }; StyleProperty.prototype.refreshValueDisplay = function () { this.notifyPropertyChange(StylePropertyChangeEvent.value, this, this.valueForDisplay); this.notifyPropertyChange(StylePropertyChangeEvent.status, this, this._status); }; Object.defineProperty(StyleProperty.prototype, "uid", { get: function () { return this._uid; }, set: function (value) { if(value !== this._uid) { var ownerUid = this.owner._uid; var oldUid = this._uid; this._model.remapPropertyId(this, oldUid, value); this.notifyPropertyChange(StylePropertyChangeEvent.uid, this, value); this._uid = value; } }, enumerable: true, configurable: true }); Object.defineProperty(StyleProperty.prototype, "status", { get: function () { return this._status; }, set: function (value) { if(value !== this._status) { this._status = value; this.notifyPropertyChange(StylePropertyChangeEvent.status, this, value); } }, enumerable: true, configurable: true }); Object.defineProperty(StyleProperty.prototype, "isRule", { get: function () { return false; }, enumerable: true, configurable: true }); Object.defineProperty(StyleProperty.prototype, "isProperty", { get: function () { return this.owner === this; }, enumerable: true, configurable: true }); Object.defineProperty(StyleProperty.prototype, "isSubProperty", { get: function () { return this.owner !== this; }, enumerable: true, configurable: true }); Object.defineProperty(StyleProperty.prototype, "isEditable", { get: function () { return this.isProperty; }, enumerable: true, configurable: true }); Object.defineProperty(StyleProperty.prototype, "container", { get: function () { return this.owner === this ? this.rule : this.owner; }, enumerable: true, configurable: true }); Object.defineProperty(StyleProperty.prototype, "isNew", { get: function () { return ElementStyleModel.isNew(this._uid); }, enumerable: true, configurable: true }); Object.defineProperty(StyleProperty.prototype, "isColor", { get: function () { return this.name.indexOf("color") > -1; }, enumerable: true, configurable: true }); StyleProperty.isNonDisplayableColorValue = function isNonDisplayableColorValue(value) { return value === "" || value === "inherit" || value === "currentColor" || value === "flavor" || value === "invert" || value === "transparent"; }; Object.defineProperty(StyleProperty.prototype, "isDisplayableColor", { get: function () { return (this.isColor && this._status === StylePropertyStatus.valid && !StyleProperty.isNonDisplayableColorValue(this._value)) || this.isSupPropertyDisplayableColor; }, enumerable: true, configurable: true }); Object.defineProperty(StyleProperty.prototype, "isSupPropertyDisplayableColor", { get: function () { if(this.isShorthand) { for(var i = 0; i < this.properties.length; i++) { var subproperty = this.properties[i]; if(subproperty.isDisplayableColor) { return true; } } } return false; }, enumerable: true, configurable: true }); Object.defineProperty(StyleProperty.prototype, "colorForDisplay", { get: function () { if(this.isDisplayableColor) { if(this.isShorthand) { for(var i = 0; i < this.properties.length; i++) { var subproperty = this.properties[i]; if(subproperty.isDisplayableColor) { return subproperty._value; } } } else { return this._value; } return ""; } }, enumerable: true, configurable: true }); Object.defineProperty(StyleProperty.prototype, "valueForDisplay", { get: function () { var value = this.valueWithPriority; return value.length ? value : "\u2003"; }, enumerable: true, configurable: true }); Object.defineProperty(StyleProperty.prototype, "valueWithPriority", { get: function () { return this._value + (this._isImportant ? " !important" : ""); }, enumerable: true, configurable: true }); Object.defineProperty(StyleProperty.prototype, "isEnabledIndeterminate", { get: function () { var subproperties = this.isSubProperty ? this.owner.properties : this.properties; var countEnabled = 0; for(var i = 0; i < subproperties.length; i++) { var subproperty = subproperties[i]; if(subproperty._isEnabled) { countEnabled++; } } return !!countEnabled && countEnabled !== subproperties.length; }, enumerable: true, configurable: true }); Object.defineProperty(StyleProperty.prototype, "enabledMixedState", { get: function () { return this.isEnabledIndeterminate ? "mixed" : ("" + this._isEnabled); }, enumerable: true, configurable: true }); Object.defineProperty(StyleProperty.prototype, "isShorthand", { get: function () { return this.properties.length > 0; }, enumerable: true, configurable: true }); Object.defineProperty(StyleProperty.prototype, "isValidName", { get: function () { return this._status === StylePropertyStatus.valid || this._status === StylePropertyStatus.invalidValue; }, enumerable: true, configurable: true }); Object.defineProperty(StyleProperty.prototype, "isValidValue", { get: function () { return this._status === StylePropertyStatus.valid || this._status === StylePropertyStatus.invalidName; }, enumerable: true, configurable: true }); Object.defineProperty(StyleProperty.prototype, "isInvalid", { get: function () { return this._status !== StylePropertyStatus.valid; }, enumerable: true, configurable: true }); Object.defineProperty(StyleProperty.prototype, "isStrikeThrough", { get: function () { return !this._isWinning && this._status === StylePropertyStatus.valid; }, enumerable: true, configurable: true }); Object.defineProperty(StyleProperty.prototype, "formatForCopy", { get: function () { return this.name + ": " + this.valueWithPriority + ";"; }, enumerable: true, configurable: true }); Object.defineProperty(StyleProperty.prototype, "ariaOverriddenString", { get: function () { return this.isStrikeThrough ? StyleProperty._ariaOverriddenString : ""; }, enumerable: true, configurable: true }); Object.defineProperty(StyleProperty.prototype, "ariaInvalidNameString", { get: function () { return !this.isValidName ? StyleProperty._ariaInvalidString : ""; }, enumerable: true, configurable: true }); Object.defineProperty(StyleProperty.prototype, "ariaInvalidValueString", { get: function () { return !this.isValidValue ? StyleProperty._ariaInvalidString : ""; }, enumerable: true, configurable: true }); return StyleProperty; })(StyleChangeNotifier); Dom.StyleProperty = StyleProperty; })(Dom || (Dom = {})); //@ sourceMappingURL=styleRule.js.map // styleCache.ts var Dom; (function (Dom) { var StyleCache = (function () { function StyleCache(_proxy) { this._proxy = _proxy; } StyleCache.prototype.clearState = function () { this._cache = null; }; StyleCache.prototype.updateView = function (uid, updateTabCallback) { var _this = this; if(!this._cache) { Dom.ElementStyleModel.create(this._proxy, uid, function (result) { _this._cache = result; updateTabCallback(result); }); } else { updateTabCallback(this._cache); } }; StyleCache.prototype.applyChanges = function (changes) { if(this._cache) { this._cache.applyChanges(changes); } }; return StyleCache; })(); Dom.StyleCache = StyleCache; })(Dom || (Dom = {})); //@ sourceMappingURL=styleCache.js.map // app.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var F12; (function (F12) { (function (DomExplorer) { var DomExplorerApp = (function (_super) { __extends(DomExplorerApp, _super); function DomExplorerApp() { _super.apply(this, arguments); } DomExplorerApp.prototype.onStartup = function () { var _this = this; Plugin.addEventListener("pluginready", function () { try { var proxy = new Proxy(_this.hostBridge, _this.diagnosticsBridge); var domExplorer = _this.domExplorer = new DomExplorer.DomExplorerWindow(proxy, _this.hostBridge, _this.diagnosticsBridge); domExplorer.initialize(); if(_this.onDomExplorerAppLoaded) { _this.onDomExplorerAppLoaded(); } } catch (ex) { diagnosticOutput("Exception in window.onload: " + ex.toString(), ex.stack); } }); }; return DomExplorerApp; })(Common.App); DomExplorer.App = new DomExplorerApp(); })(F12.DomExplorer || (F12.DomExplorer = {})); var DomExplorer = F12.DomExplorer; })(F12 || (F12 = {})); function selectElementFromConsole() { F12.DomExplorer.App.domExplorer.selectElementFromConsole(function (succeeded) { if(succeeded) { F12.DomExplorer.App.domExplorer.domTree.expandToRemoteSelectedElement(); } }); } //@ sourceMappingURL=app.js.map // domExplorer.ts function diagnosticOutput(s, stackTrace) { try { var element = document.querySelector("#diagnostic-output"); if(!element) { element = document.createElement("div"); element.setAttribute("id", "diagnostic-output"); element.innerHTML = "Diagnostic:"; document.body.insertBefore(element, document.body.firstChild); element = document.querySelector("#diagnostic-output"); } if(element) { var br = document.createElement("br"); element.appendChild(br); var text = document.createTextNode(s); element.appendChild(text); } if(stackTrace) { var traceElement = document.querySelector("#diagnostic-trace"); if(!traceElement) { traceElement = document.createElement("div"); traceElement.setAttribute("id", "diagnostic-trace"); traceElement.innerHTML = "StackTrace:"; element.appendChild(traceElement); traceElement = document.querySelector("#diagnostic-trace"); } if(traceElement) { element.innerHTML += "
    " + stackTrace; } } } catch (ex) { } } var F12; (function (F12) { (function (DomExplorer) { var Assert = F12.Tools.Utility.Assert; (function (SearchDirection) { SearchDirection._map = []; SearchDirection.next = 1; SearchDirection.previous = -1; })(DomExplorer.SearchDirection || (DomExplorer.SearchDirection = {})); var SearchDirection = DomExplorer.SearchDirection; var DomExplorerWindow = (function () { function DomExplorerWindow(proxy, hostBridge, diagnosticsBridge) { var _this = this; this._activatedFocusToken = Number.NaN; this._initializationErrorMessage = null; this.maxInlineLength = 70; this.currentSelectedId = ""; this._currentElementHighlightUid = ""; this._temporaryElementHighlightUid = ""; this._traceWriter = new Common.TraceWriter(); this.traceWriter.raiseEvent(Common.TraceEvents.Dom_Window_Create_Start); this._proxy = proxy; this._hostBridge = hostBridge; this._diagnosticsBridge = diagnosticsBridge; this.domTree = new Dom.DomTree(this, hostBridge, this._proxy); this._toolContextMenus = new ToolContextMenus(); this._styleCache = new Dom.StyleCache(this._proxy); this.tabPanes = new TabPanes(hostBridge, this._proxy, this._styleCache, this); this._hostBridge.addEventListener("switchTab", function (e) { return _this.switchTab(e.tabIndex); }); if(Plugin.F12) { var hostInfoChanged = function (info) { var controls = (document.querySelector(".BPT-SearchBox-Border")); var scaledControlAreaWidth = info.controlAreaWidth * (screen.logicalXDPI / screen.deviceXDPI); controls.style.marginRight = scaledControlAreaWidth + "px"; }; Plugin.F12.addEventListener("hostinfochanged", function (e) { return hostInfoChanged(e); }); hostInfoChanged(Plugin.F12.getHostInfo()); } } DomExplorerWindow._breadcrumbsListId = "BreadcrumbsView"; DomExplorerWindow._breadcrumbsTemplateId = "breadcrumbsTemplate"; DomExplorerWindow._hiddenRootSelector = '.BPT-HtmlTreeItem-HiddenRoot'; DomExplorerWindow._itemSelector = '.BPT-HtmlTreeItem'; DomExplorerWindow.prototype.temporaryShowElementHighlight = function (uid) { if(!uid) { return; } this._temporaryElementHighlightUid = uid === this._currentElementHighlightUid ? "" : uid; this._proxy.callRemote("hoverItem", [ uid ]); }; DomExplorerWindow.prototype.showElementHighlight = function (uid) { if(!uid) { return; } this._currentElementHighlightUid = uid; this._temporaryElementHighlightUid = ""; if(this._showlayoutButton.selected) { this._proxy.callRemote("hoverItem", [ uid ]); } }; DomExplorerWindow.prototype.hideElementHighlight = function () { this._temporaryElementHighlightUid = ""; this._proxy.callRemote("hideHoverItem", []); }; DomExplorerWindow.prototype.refreshElementHighlight = function () { if(this._currentElementHighlightUid && !this._temporaryElementHighlightUid) { this.restoreElementHighlight(); } }; DomExplorerWindow.prototype.restoreElementHighlight = function () { this._temporaryElementHighlightUid = ""; this._proxy.callRemote("hideHoverItem", []); this.showElementHighlight(this._currentElementHighlightUid); }; Object.defineProperty(DomExplorerWindow.prototype, "traceWriter", { get: function () { return this._traceWriter; }, enumerable: true, configurable: true }); Object.defineProperty(DomExplorerWindow.prototype, "documentMode", { get: function () { return this._currentDocMode; }, enumerable: true, configurable: true }); DomExplorerWindow.prototype.initialize = function () { var _this = this; this._initializationErrorMessage = ""; var loc = function (resourceId, params) { return toolwindowHelpers.loadString(resourceId, params); }; var logFn = function (x) { diagnosticOutput("Issue in DomExplorer.initialize with selector: " + x.selector); }; try { this._proxy.initializeProxy(function (msg) { _this.onMessage(msg); }, function () { _this.onAttach(); }, function () { _this.onDetach(); }, function () { _this.onBreak(); }, function () { _this.onRun(); }); toolwindowHelpers.registerErrorComponent("DomExplorerWindow", this.onError); toolwindowHelpers.initializeToolWindow(this._hostBridge, function () { _this.onShow(); }); this.initializeTabs(); this.initializeToolbarButtons(); this.initializeGlobalCommands(); this.initializeLayoutButtons(); this.initializeContextMenus(); $m("#domToolLabel").text(loc("DomToolLabelText")); $m("#selectElementByClick").tooltip(loc("SelectElementButtonTooltip")); $m("#showlayoutButton").tooltip(loc("ShowLayoutBoxesButtonTooltipWithShortcut")); $m("#refreshButton").tooltip(loc("RefreshDomExplorerButtonTooltipWithShortcut")); $m("#allStylesButton").tooltip(loc("UserStylesDomExplorerButtonTooltipOff")); $m("#addAttributeButton > div:last-child").text(loc("AddAttributeButton")); $m("#addAttributeButton").tooltip(loc("AddAttributeButtonTooltip")); $m("#removeAttributeButton > div:last-child").text(loc("RemoveAttributeButton")); $m("#removeAttributeButton").tooltip(loc("RemoveAttributeButtonTooltip")); $m("#attributeNodeLabel > div > span:first-child").text(loc("AttributeNodeLabel")); $m("#attributeNodeLabel").tooltip(loc("AttributeNodeLabelTooltip")); $m("#stylesTabButton").text(loc("StylesTabButtonText")).tooltip(loc("StylesTabButtonTooltip")); $m("#traceStylesTabButton").text(loc("TraceStylesTabButtonText")).tooltip(loc("TraceStylesTabButtonTooltip")); $m("#layoutTabButton").text(loc("LayoutTabButtonText")).tooltip(loc("LayoutTabButtonTooltip")); $m("#attributesTabButton").text(loc("AttributesTabButtonText")).tooltip(loc("AttributesTabButtonTooltip")); $m("#eventsTabButton").text(loc("EventsTabButtonText")).tooltip(loc("EventsTabButtonTooltip")); $m("#findbox").placeholder(loc("DOMExplorerFindBoxHinting")).tooltip(loc("DOMSearchBoxToolTip")); $m("#searchNextResult").tooltip(loc("DOMSearchNextButtonToolTip")); $m("#searchPreviousResult").tooltip(loc("DOMSearchPreviousButtonToolTip")); $m("#computedStylesTabButton").text(loc("ComputedStylesTabButtonText")).tooltip(loc("ComputedStylesTabButtonTooltip")); $m("#computedStylesFilterTextBox").placeholder(loc("DOMExplorerComputedStylesFilterTextBoxPlaceholder")); $m("#computedStylesFilterTextBox").attr("title", loc("DOMExplorerComputedStylesFilterTextBoxPlaceholder")); $m("#computedStylesNoResultsMessage").text(loc("DOMExplorerComputedStylesNoResultsMessage")); $m("*.BPT-HorizontalPane-Right-Tab").hide(); $m("#breadcrumbRightArrow").hide(); $m("#breadcrumbLeftArrow").hide(); $m("#searchPreviousResult").attr("disabled", ""); $m("#searchNextResult").attr("disabled", ""); if(window["lastScriptError"]) { this.onError(window["lastScriptError"].message, window["lastScriptError"].file, window["lastScriptError"].line, window["lastScriptError"].additionalInfo); } this.traceWriter.raiseEvent(Common.TraceEvents.Dom_Window_Create_Stop); this._hostBridge.addEventListener("activated", function () { return _this.onActivated(); }); this._hostBridge.addEventListener("deactivated", function () { return _this.onDeactivated(); }); if(Plugin.F12) { Plugin.F12.addEventListener("profilingstarted", function (e) { _this.onProfilingStateChange(true); }); Plugin.F12.addEventListener("profilingstopped", function (e) { _this.onProfilingStateChange(false); }); } } catch (ex) { diagnosticOutput("Exception during DomExplorer.initialize: " + ex.toString(), ex.stack); } }; DomExplorerWindow.prototype.onActivated = function () { var _this = this; this.restoreElementHighlight(); if(this._activatedFocusToken) { window.clearTimeout(this._activatedFocusToken); this._activatedFocusToken = Number.NaN; } this._activatedFocusToken = window.setTimeout(function () { document.getElementById('tree').focus(); HtmlTreeView.focusSelected(true); _this._activatedFocusToken = Number.NaN; }, 0); }; DomExplorerWindow.prototype.onDeactivated = function () { if(this._activatedFocusToken) { window.clearTimeout(this._activatedFocusToken); this._activatedFocusToken = Number.NaN; } if(this._selectElementByClick.selected) { this._selectElementByClick.selected = false; } this.hideElementHighlight(); }; DomExplorerWindow.prototype.onAttach = function () { if(Plugin.F12 && Plugin.F12.Profiler.getIsProfiling()) { this.onProfilingStateChange(true); return; } try { this._diagnosticsBridge.loadScriptInProc("../Common/assert.js"); this._diagnosticsBridge.loadScriptInProc("../Common/remoteHelpers.js"); this._diagnosticsBridge.loadScriptInProc("../Common/remoteEditStack.js"); this._diagnosticsBridge.loadScriptInProc("remoteChunker.js"); this._diagnosticsBridge.loadScriptInProc("cssInformationExtractor.js"); this._diagnosticsBridge.loadScriptInProc("remoteMutationManager.js"); this._diagnosticsBridge.loadScriptInProc("remoteEdit.js"); this._diagnosticsBridge.loadScriptInProc("remoteElementCopier.js"); this._diagnosticsBridge.loadScriptInProc("remoteStyle.js"); this._diagnosticsBridge.loadScriptInProc("remote.js"); this._diagnosticsBridge.loadScriptInProc("remoteMain.js"); } catch (ex) { return; } }; DomExplorerWindow.prototype.onDetach = function () { this._currentDocMode = undefined; $m("#tree > :first-child > *").remove(); $m(".BPT-DataTree-Container").each(function (index, item) { DataTreeView.clear($m(item)); }); $m("#pane").hide(); this.tabPanes.executeCleanup(); $m("#layoutView[data-layoutProperty]").text(""); $m(".BPT-ToolbarToggleButton:not(#allStylesButton)").removeClass("BPT-ToolbarToggleButton-StateOn"); this._selectElementByClick.selected = false; $m(".BPT-ToolbarButton").addClass("BPT-ToolbarButton-StateDisabled"); this._showlayoutButton.disabled = true; this._selectElementByClick.disabled = true; }; DomExplorerWindow.prototype.onShow = function () { var _this = this; this._proxy.callRemote("getDocumentMode", [], function (docMode) { toolwindowHelpers.codeMarker(toolwindowHelpers.codeMarkers.perfBrowserTools_DiagnosticsToolWindowsDomExplorerRefreshBegin); _this.populateTree(docMode); }); }; DomExplorerWindow.prototype.onBreak = function () { this.stopSelectElementByClick(); $m(".BPT-ToolbarButton").addClass("BPT-ToolbarButton-StateDisabled"); this._showlayoutButton.disabled = true; this._selectElementByClick.disabled = true; }; DomExplorerWindow.prototype.onRun = function () { if(this._currentDocMode >= 9) { $m(".BPT-ToolbarButton").removeClass("BPT-ToolbarButton-StateDisabled"); this._showlayoutButton.disabled = false; this._selectElementByClick.disabled = false; } }; DomExplorerWindow.prototype.onMessage = function (msg) { var documentNotReadyMessage = "DocumentNotYetReady"; var refreshTreeMessage = "RefreshTree:"; var initializeDocumentMessage = "InitializeDocument"; if(msg.data === documentNotReadyMessage) { window.setTimeout(function () { try { toolwindowHelpers.remotePort.postMessage(initializeDocumentMessage); } catch (ex) { return; } }, 100); } else if(msg.data.substr(0, refreshTreeMessage.length) === refreshTreeMessage) { var docMode = parseFloat(msg.data.substring(refreshTreeMessage.length)); this.populateTree(docMode); toolwindowHelpers.codeMarker(toolwindowHelpers.codeMarkers.perfBrowserTools_DiagnosticsToolWindowsDomExplorerReady); } else { this._proxy.fireCallbacks(msg.data); } }; DomExplorerWindow.prototype.onError = function (message, file, line, additionalInfo) { try { if(file) { var parts = file.split("/"); if(parts.length > 0) { file = parts[parts.length - 1]; } } var errorMessage = toolwindowHelpers.htmlEscape(toolwindowHelpers.loadString("DomExplorerScriptError")) + "
    " + toolwindowHelpers.htmlEscape(toolwindowHelpers.loadString("ScriptErrorMessage", [ message ])) + "
    " + toolwindowHelpers.htmlEscape(toolwindowHelpers.loadString("ScriptErrorFile", [ file ])) + "
    " + toolwindowHelpers.htmlEscape(toolwindowHelpers.loadString("ScriptErrorLine", [ line ])) + "\r\n" + additionalInfo; $m("#scriptErrorMessageText").html(errorMessage); $m("#scriptErrorSection").show(); if(typeof this._initializationErrorMessage === "string") { this._initializationErrorMessage += errorMessage; } } catch (ex) { } }; DomExplorerWindow.prototype.onProfilingStateChange = function (started) { if(started) { Plugin.F12.ErrorDisplay.show(Plugin.Resources.getString("DOMExplorerDisabledWhileProfiling")); this._diagnosticsBridge.fireDetachedEvent(); } else { Plugin.F12.ErrorDisplay.close(); this._diagnosticsBridge.fireAttachedEvent(); } }; DomExplorerWindow.prototype.populateTree = function (docMode) { var refreshButton = $m("#refreshButton"); this._currentDocMode = docMode; var eventsTabButton = document.getElementById("eventsTabButton"); if(docMode < 9) { refreshButton.removeClass("BPT-ToolbarButton-StateHidden"); eventsTabButton.style.display = "none"; if(eventsTabButton.classList.contains("BPT-TabCycle-Item")) { eventsTabButton.classList.remove("BPT-TabCycle-Item"); } document.getElementById("eventsView").style.display = "none"; } else { refreshButton.addClass("BPT-ToolbarButton-StateHidden"); eventsTabButton.style.display = ""; if(!eventsTabButton.classList.contains("BPT-TabCycle-Item")) { eventsTabButton.classList.add("BPT-TabCycle-Item"); } document.getElementById("eventsView").style.display = ""; } this.refreshTree(this.domExplorerLoaded.bind(this)); }; DomExplorerWindow.prototype.refreshElementForLowDocModes = function (selectedElement, selectParent, refreshAll) { if (typeof refreshAll === "undefined") { refreshAll = false; } if(this._currentDocMode < 9) { var targetParents = selectedElement.parents(DomExplorerWindow._itemSelector).not(DomExplorerWindow._hiddenRootSelector); var targetParentChain = []; targetParents.each(function (i, e) { targetParentChain[(targetParents.length - 1) - i] = e.getAttribute('data-id'); }); var isTextNode = selectedElement.attr("data-tag") == "#text"; var parentUid = targetParentChain[targetParentChain.length - 1]; var toggleUid = isTextNode ? targetParentChain[targetParentChain.length - 2] : parentUid; if(refreshAll) { toggleUid = targetParentChain[0]; } var toggle = $m('[data-id=' + toggleUid + ']'); HtmlTreeView.toggle(toggle); selectParent = selectParent || isTextNode; HtmlTreeView.expandElementChains([ targetParentChain ], function () { var reselect = selectParent ? $m('[data-id=' + parentUid + ']') : $m('[data-id=' + selectedElement.attr('data-id') + ']'); if(reselect && reselect.length) { HtmlTreeView.select(reselect); } }); } }; DomExplorerWindow.prototype.refreshTree = function (complete) { var _this = this; if(this._initializationErrorMessage) { $m("#scriptErrorMessageText").html(this._initializationErrorMessage); $m("#scriptErrorSection").show(); } else { $m("#scriptErrorMessagetext").html(""); $m("#scriptErrorSection").hide(); } this._initializationErrorMessage = null; var tree = $m("#tree"); $m("#tree > :first-child > *").remove(); tree.attr("tabindex", "1"); this.currentSelectedId = ""; this._currentElementHighlightUid = ""; this._temporaryElementHighlightUid = ""; this.hideElementHighlight(); this._proxy.clearCallBacks(); $m("*.BPT-HorizontalPane").show(); $m("*.BPT-Toolbar").show(); $m("#pane").show(); this.horizontalPane.refreshPaneWidth(); this._proxy.callRemote("clearStyleCache"); $m(".BPT-DataTree-Container").each(function (index, item) { DataTreeView.clear($m(item)); }); this.tabPanes.clearState(); this.tabPanes.executeCleanup(); Dom.StyleModel.clearCollapsedRules(); Dom.TraceStyleModel.clearExpandedProperties(); $m("#layoutView[data-layoutProperty]").text(""); $m(".BPT-ToolbarToggleButton:not(#allStylesButton)").removeClass("BPT-ToolbarToggleButton-StateOn"); this._selectElementByClick.selected = false; $m(".BPT-ToolbarButton").addClass("BPT-ToolbarButton-StateDisabled"); $m(".BPT-ToolbarButton").removeClass("BPT-ToolbarButton-StateDisabled"); this._showlayoutButton.disabled = false; this._selectElementByClick.disabled = false; var hostId = typeof Plugin['F12'] === 'undefined' ? "vs" : "f12"; this._proxy.callRemote("initializeHost", [ hostId ]); this._proxy.callRemote("setKeyBindCallbacks", [ function () { _this.giveHostForeground(); }, function () { _this.startSelectElementByClick(); }, function () { _this.stopSelectElementByClick(); }, function () { _this.domTree.expandToRemoteSelectedElement(); } ]); this._proxy.callRemote("getRootElement", [], function (domObj) { if(domObj) { _this.createExpandableHtmlTree(tree, domObj, complete); } }); if(this.tabPanes.activeTab) { $m("#" + this.tabPanes.activeTab).show(); } }; DomExplorerWindow.prototype.giveHostForeground = function () { var _this = this; this._proxy.callRemote("allowProcessToTakeForeground", [], function () { return _this._hostBridge.takeForeground(); }); }; DomExplorerWindow.prototype.initializeTabs = function () { var _this = this; HtmlTreeView.init($m("#tree"), HtmlTreeViewDragDrop, function () { _this.updateBreadcrumbs(); }); HtmlTreeViewDragDrop.init(this._proxy, document, HtmlTreeView, function () { return _this._currentDocMode >= 9; }, this.traceWriter); this.horizontalPane = new Dom.HorizontalPane($m("#pane")); TabItem.init($m("#stylesTabButton"), function () { var selected = HtmlTreeView.getSelected($m("#tree")); var doClearStyles = true; if(selected.length > 0) { var tag = selected.attr("data-tag"); if(tag === '#text') { var parentOfSelected = selected.parents(".BPT-HtmlTreeItem").not(".BPT-HtmlTreeItem-HiddenRoot").first(); if(parentOfSelected.length) { _this.tabPanes.showStyles(parentOfSelected.attr("data-id"), parentOfSelected.attr("data-tag")); doClearStyles = false; } } else { _this.tabPanes.showStyles(selected.attr("data-id"), selected.attr("data-tag")); doClearStyles = false; } } if(doClearStyles) { _this.tabPanes.showStyles(); } }); TabItem.init($m("#traceStylesTabButton"), function () { var selected = HtmlTreeView.getSelected($m("#tree")); if(selected.length > 0) { _this.tabPanes.showTraceStyles(selected.attr("data-id"), selected.attr("data-tag")); } else { _this.tabPanes.showTraceStyles(); } }); TabItem.init($m("#computedStylesTabButton"), function () { var selected = HtmlTreeView.getSelected($m("#tree")); if(selected.length > 0) { _this.tabPanes.showComputedStyles(selected.attr("data-id"), selected.attr("data-tag")); } else { _this.tabPanes.showComputedStyles(); } }); TabItem.init($m("#layoutTabButton"), function () { var selected = HtmlTreeView.getSelected($m("#tree")); if(selected.length > 0) { _this.tabPanes.showLayout(selected.attr("data-id"), selected.attr("data-tag")); } else { _this.tabPanes.showLayout(); } }); TabItem.init($m("#eventsTabButton"), function () { var selected = HtmlTreeView.getSelected($m("#tree")); if(selected.length > 0) { _this.tabPanes.showEvents(selected.attr("data-id"), selected.attr("data-tag")); } else { _this.tabPanes.showEvents(); } }); }; DomExplorerWindow.prototype.searchDomTree = function (searchDirection) { var _this = this; var searchterm = $m("#findbox").val(); if(searchterm) { this._proxy.callRemote("findTerm", [ this.currentSelectedId, searchterm, searchDirection ], function (chain) { if(chain.length !== 0) { $m("#searchBoxBorder").removeClass("BPT-SearchBox-NoResult"); $m("#searchPreviousResult").removeAttr("disabled"); $m("#searchNextResult").removeAttr("disabled"); _this.domTree.expandElementChain(chain); } else { $m("#searchBoxBorder").addClass("BPT-SearchBox-NoResult"); $m("#searchPreviousResult").attr("disabled", ""); $m("#searchNextResult").attr("disabled", ""); } }); } }; DomExplorerWindow.prototype.initializeGlobalCommands = function () { var _this = this; if(Plugin.F12) { var onKeyDown = function (keyEvent) { var ctrlShiftKey = keyEvent.shiftKey && keyEvent.ctrlKey && !keyEvent.altKey; var shiftKey = keyEvent.shiftKey && !keyEvent.ctrlKey && !keyEvent.altKey; var ctrlKey = keyEvent.ctrlKey && !keyEvent.shiftKey && !keyEvent.altKey; var noKeys = !keyEvent.shiftKey && !keyEvent.ctrlKey && !keyEvent.altKey; if(keyEvent.keyCode === Common.KeyCodes.B && ctrlKey) { _this._selectElementByClick.selected = !_this._selectElementByClick.selected; return false; } else if(keyEvent.keyCode === Common.KeyCodes.I && ctrlShiftKey) { _this._showlayoutButton.selected = !_this._showlayoutButton.selected; return false; } else if(keyEvent.keyCode === Common.KeyCodes.F && ctrlKey) { document.getElementById("findbox").focus(); return false; } else if(keyEvent.keyCode === Common.KeyCodes.F3 && noKeys) { _this.searchDomTree(SearchDirection.next); return false; } else if(keyEvent.keyCode === Common.KeyCodes.F5 && noKeys && _this._currentDocMode < 9) { var selected = HtmlTreeView.getSelected($m("#tree")); _this.refreshElementForLowDocModes(selected, false, true); return false; } else if(keyEvent.keyCode === Common.KeyCodes.F3 && shiftKey) { _this.searchDomTree(SearchDirection.previous); return false; } else if(keyEvent.keyCode === Common.KeyCodes.Z && ctrlKey && !_this.isInTextControl()) { _this.performUndo(); return false; } else if(keyEvent.keyCode === Common.KeyCodes.Y && ctrlKey && !_this.isInTextControl()) { _this.performNextEdit(); return false; } return true; }; document.addEventListener("keydown", function (e) { return onKeyDown(e); }); Plugin.F12.addEventListener("keydown", function (e) { return onKeyDown(e); }); } else { this._findCommandBinding = Plugin.VS.Commands.bindCommand({ name: "find", onexecute: function () { document.getElementById("findbox").focus(); } }); this._findNextCommandBinding = Plugin.VS.Commands.bindCommand({ name: "findnext", onexecute: function () { _this.searchDomTree(SearchDirection.next); } }); this._findPrevCommandBinding = Plugin.VS.Commands.bindCommand({ name: "findprev", onexecute: function () { _this.searchDomTree(SearchDirection.previous); } }); this._redoCommandBinding = Plugin.VS.Commands.bindCommand({ name: "redo", onexecute: function () { if(!_this.isInTextControl()) { _this.performNextEdit(); } } }); this._refreshCommandBinding = Plugin.VS.Commands.bindCommand({ name: "refresh", onexecute: function () { if(_this._currentDocMode < 9) { var selected = HtmlTreeView.getSelected($m("#tree")); _this.refreshElementForLowDocModes(selected, false, true); } } }); this._selectElementCommandBinding = Plugin.VS.Commands.bindCommand({ name: "selectelement", onexecute: function () { _this._selectElementByClick.selected = !_this._selectElementByClick.selected; } }); this._showLayoutCommandBinding = Plugin.VS.Commands.bindCommand({ name: "showlayout", onexecute: function () { _this._showlayoutButton.selected = !_this._showlayoutButton.selected; } }); this._undoCommandBinding = Plugin.VS.Commands.bindCommand({ name: "undo", onexecute: function () { if(!_this.isInTextControl()) { _this.performUndo(); } } }); } }; DomExplorerWindow.prototype.initializeToolbarButtons = function () { var _this = this; this._selectElementByClick = new Common.Controls.ToggleButton(document.getElementById("selectElementByClick")); this._selectElementByClick.selectedChanged = function (newSelectValue) { if(newSelectValue) { _this._hostBridge.allowRemoteToTakeForeground().done(function () { _this._proxy.callRemote("takeForeground", [], function (result) { if(!result) { _this._proxy.callRemote("getHWND", [], function (hwnd) { _this._hostBridge.setForeground(hwnd).done(); }); } }); }); _this._proxy.callRemote("selectElementByClick", [ function () { _this._selectElementByClick.selected = false; _this.giveHostForeground(); _this.domTree.expandToRemoteSelectedElement(); _this.focusToTree(); } ]); } else { _this._proxy.callRemote("cancelSelectElementByClick"); } }; this._showlayoutButton = new Common.Controls.ToggleButton(document.getElementById("showlayoutButton")); this._showlayoutButton.selectedChanged = function (newSelectValue) { if(newSelectValue) { _this.restoreElementHighlight(); } else { _this.hideElementHighlight(); } }; $m("#refreshButton").bind("click keydown", function (event) { if(event.type === "click" || event.keyCode === Common.KeyCodes.ENTER || event.keyCode === Common.KeyCodes.SPACE) { var selected = HtmlTreeView.getSelected($m("#tree")); _this.refreshElementForLowDocModes(selected, false, true); return false; } return true; }); $m("#findbox").bind("keydown", function (event) { var shiftKey = event.shiftKey && !event.ctrlKey && !event.altKey; var noKeys = !event.shiftKey && !event.ctrlKey && !event.altKey; if(event.keyCode === Common.KeyCodes.ENTER && noKeys) { _this.searchDomTree(SearchDirection.next); return false; } else if(event.keyCode === Common.KeyCodes.F10 && shiftKey) { var element = event.target; var offset = element.getBoundingClientRect(); _this.handleContextMenuForTextbox(element, offset.left, offset.top); return false; } return true; }); document.getElementById("findbox").addEventListener("input", function (event) { $m("#searchBoxBorder").removeClass("BPT-SearchBox-NoResult"); $m("#searchPreviousResult").attr("disabled", ""); $m("#searchNextResult").attr("disabled", ""); }); $m("#findbox").bind("click keydown", function (event) { $m("#findbox").focus(); return true; }); $m("#searchNextResult").bind("click keydown", function (event) { if(event.type === "click" || event.keyCode === Common.KeyCodes.ENTER || event.keyCode === Common.KeyCodes.SPACE) { _this.searchDomTree(SearchDirection.next); return false; } return true; }); $m("#searchPreviousResult").bind("click keydown", function (event) { var keyEvent = event; if(event.type === "click" || keyEvent.keyCode === Common.KeyCodes.ENTER || keyEvent.keyCode === Common.KeyCodes.SPACE) { _this.searchDomTree(SearchDirection.previous); return false; } return true; }); if(Plugin.F12) { document.getElementById("tabStartMarker").setAttribute("tabindex", "-1"); document.getElementById("tabEndMarker").setAttribute("tabindex", "-1"); } else { $m("#tabStartMarker,#tabEndMarker").bind("focus", function (event) { var tabstops = $m("[tabindex='1']"); if(tabstops.length > 2) { var validStops = []; for(var i = 1; i < tabstops.length - 1; i++) { var element = tabstops.get(i); var inactiveTab = $m(element).closest(".BPT-Tab-Inactive"); if(!inactiveTab.length) { validStops.push(element); } } var selectElement = (event.target).id === "tabStartMarker" ? validStops[validStops.length - 1] : validStops[0]; selectElement.focus(); } }); } }; DomExplorerWindow.prototype.isInTextControl = function () { return ((document.activeElement instanceof HTMLTextAreaElement) || (document.activeElement instanceof HTMLInputElement && (document.activeElement).type.toLowerCase() === "text")); }; DomExplorerWindow.prototype.performUndo = function () { var _this = this; this.traceWriter.raiseEvent(Common.TraceEvents.Dom_UndoRedo_Start); this._proxy.callRemote("undoLastEdit", [], function () { return _this.traceWriter.raiseEvent(Common.TraceEvents.Dom_UndoRedo_Stop); }); }; DomExplorerWindow.prototype.performNextEdit = function () { var _this = this; this.traceWriter.raiseEvent(Common.TraceEvents.Dom_UndoRedo_Start); this._proxy.callRemote("performNextEdit", [], function () { return _this.traceWriter.raiseEvent(Common.TraceEvents.Dom_UndoRedo_Stop); }); }; DomExplorerWindow.prototype.editLayoutValue = function (uid, propertyName, newValue) { if(propertyName === "offsetLeft") { propertyName = "left"; } else if(propertyName === "offsetTop") { propertyName = "top"; } else if(propertyName === "clientWidth") { propertyName = "width"; } else if(propertyName === "clientHeight") { propertyName = "height"; } this._styleCache.updateView(uid, function (styles) { styles.setInlineProperty(propertyName, newValue, false); }); }; DomExplorerWindow.prototype.initializeLayoutButtons = function () { var _this = this; var layoutView = $m("#layoutView"); var layoutEditContainer = document.getElementById("Layout-EditContainer"); var editElement = layoutEditContainer.firstElementChild; var valueEditHandler = function (event) { if(document.activeElement && document.activeElement["type"] !== "text") { if(event.type === "click" || (event.type === "keydown" && (event.keyCode === Common.KeyCodes.ENTER || event.keyCode === Common.KeyCodes.SPACE) && !event.ctrlKey && !event.shiftKey && !event.altKey)) { var valueContext = event.target; var uid = layoutView.attr("data-uid"); var tagName = layoutView.attr("data-tag"); var prop = valueContext.getAttribute("data-layoutProperty"); if(uid && tagName) { var contextRect = valueContext.getBoundingClientRect(); var viewRect = (layoutView.get(0)).getBoundingClientRect(); var offsetRect = document.getElementById("layout-offset-layer").getBoundingClientRect(); var style = window.getComputedStyle(valueContext); var height = style.transform === "none" ? contextRect.height : contextRect.width; var width = 60; var top = contextRect.top + contextRect.height / 2 - height / 2 - viewRect.top; var left = offsetRect.left - viewRect.left - viewRect.left; if(prop === "height" || valueContext.classList.contains("BPT-Layout-Left")) { left += contextRect.left; } else if(prop === "width" || valueContext.classList.contains("BPT-Layout-Right")) { left += contextRect.right - width; } else { left += contextRect.left + contextRect.width / 2 - width / 2; } layoutEditContainer.style.left = left + "px"; layoutEditContainer.style.top = top + "px"; layoutEditContainer.style.display = "block"; editElement.textContent = valueContext.textContent; var contextColor = valueContext.style.color; valueContext.style.color = "transparent"; var valueEditor = new Dom.ValueEditor(document, _this, _this._hostBridge, window); valueEditor.enableCommitOnChange(); valueEditor.enableNumericChanges(); _this._proxy.callRemote("enableEditChaining"); valueEditor.show(editElement, width, function (newValue, oldValue) { if(newValue) { if(/^\d*(\.\d+)?$/.test(newValue)) { newValue += "px"; } _this.editLayoutValue(uid, prop, newValue); } }, function (newValue, oldValue, exitKey, wasCancelled) { _this._proxy.callRemote("disableEditChaining"); layoutEditContainer.style.display = "none"; valueContext.style.color = contextColor; if(!wasCancelled) { valueContext.textContent = newValue; _this.tabPanes.showLayout(uid, tagName); } }); } return false; } } }; layoutView.find("[data-layoutProperty]").bind("click keydown", valueEditHandler); }; DomExplorerWindow.prototype.setTestEditCallbacks = function (testEditCallback, testUndoCallback) { this._proxy.callRemote("setTestEditCallbacks", [ testEditCallback, testUndoCallback ]); }; DomExplorerWindow.prototype.deleteElement = function (uid, selectedItem, callback) { var _this = this; this._proxy.callRemote("deleteElement", [ uid ], function (success) { _this.refreshElementForLowDocModes(selectedItem, true); _this.updateBreadcrumbs(); if(callback) { callback(success); } }); }; DomExplorerWindow.prototype.addElements = function (parentUid, beforeUid, htmlText, callback) { var _this = this; this._proxy.callRemote("addElement", [ parentUid, beforeUid, htmlText ], function (success) { if(success) { var selected = HtmlTreeView.getSelected($m("#tree")); _this.refreshElementForLowDocModes(selected, false); _this.updateBreadcrumbs(); if(callback) { callback(success); } } }); }; DomExplorerWindow.prototype.replaceElements = function (parentUid, htmlText) { var _this = this; this._proxy.callRemote("replaceElement", [ parentUid, htmlText ], function (success) { if(success) { var selected = HtmlTreeView.getSelected($m("#tree")); _this.refreshElementForLowDocModes(selected, false); _this.updateBreadcrumbs(); } }); }; DomExplorerWindow.prototype.isEditableElement = function (tagName) { if(typeof tagName !== "string") { return false; } return [ "html", "head", "body", "script", "#doctype" ].indexOf(tagName.toLowerCase()) < 0; }; DomExplorerWindow.prototype.isPasteAsChildCapableElement = function (tagNameLowerCase) { return [ "html", "script", "noscript", "style", "#doctype", "#comment", "iframe", "frame", "#text" ].indexOf(tagNameLowerCase) < 0; }; DomExplorerWindow.prototype.canPasteAsChild = function (selectedItem) { var hasItemSelected = selectedItem != null && selectedItem.length > 0; var dataTag = hasItemSelected ? selectedItem.attr("data-tag") : null; dataTag = dataTag || ""; var tagName = dataTag.toLowerCase(); var canPasteAsChildOfSelected = hasItemSelected && !!tagName && this.isPasteAsChildCapableElement(tagName); var clipboardText = clipboardData.getData("Text"); var parentOfSelected = selectedItem ? selectedItem.parents(".BPT-HtmlTreeItem").not(".BPT-HtmlTreeItem-HiddenRoot").first() : null; var hasParent = parentOfSelected != null && parentOfSelected.length > 0; var isChildOfEditableItem = hasParent && this.domTree.isUnderEditableItem(selectedItem); var canPaste = hasItemSelected && isChildOfEditableItem && canPasteAsChildOfSelected && clipboardText != ""; return canPaste; }; DomExplorerWindow.prototype.initializeContextMenus = function () { var _this = this; var self = this; var getContextMenuTarget = function (e, isDataTree) { var treeItem, offset; var treeClass = (isDataTree ? ".BPT-DataTreeItem" : ".BPT-HtmlTreeItem"); var selectedItem = null; var x = e.clientX; var y = e.clientY; if(e.clientX <= 0 || e.clientY <= 0) { if(e.eventPhase === e.BUBBLING_PHASE && e.srcElement) { treeItem = $m(e.srcElement).closest(treeClass).not(treeClass + "-HiddenRoot").first(); } else { treeItem = $m(e.currentTarget).find(treeClass + "-Selected").first(); } if(treeItem.length > 0) { selectedItem = treeItem; offset = (treeItem.get(0)).getBoundingClientRect(); x = offset.left; y = offset.top; } } else { selectedItem = $m(document.elementFromPoint(x, y)).closest(treeClass); selectedItem = (selectedItem.length > 0 ? selectedItem : null); } if(selectedItem !== null && selectedItem.length > 0) { selectedItem.trigger("click"); } return { target: selectedItem, x: x, y: y }; }; $m("#tree").bind("contextmenu", function (e) { var element = $m(e.target); if(element.hasClass("BPT-HtmlTree-ChildCollection-ShowAll")) { return; } var targetInfo = getContextMenuTarget(e, false); var selectedItem = targetInfo.target; return _this.htmlContextMenu(false, selectedItem, targetInfo.x, targetInfo.y); }); $m("#tree").bind("keydown", function (event) { var wasHandled = false; var htmlTree = $m("#tree"); var element = $m(event.target); if(element.hasClass("BPT-HtmlTree-ChildCollection-ShowAll")) { return; } if(self.isInTextControl()) { return true; } if(!toolwindowHelpers.hasSelectedText()) { var selectedElement = HtmlTreeView.getSelected(htmlTree); if(selectedElement.length > 0) { var uid = selectedElement.attr("data-id"); var canDelete = self.canDeleteItem(selectedElement); var shiftKey = event.shiftKey && !event.ctrlKey && !event.altKey; var ctrlKey = event.ctrlKey && !event.shiftKey && !event.altKey; var noKeys = !event.shiftKey && !event.ctrlKey && !event.altKey; if((event.keyCode === Common.KeyCodes.C || (event.keyCode === Common.KeyCodes.X && canDelete)) && ctrlKey) { wasHandled = true; var element = selectedElement; var dataTag = element.attr("data-tag") || ""; if(dataTag === '#text') { element = element.parents(".BPT-HtmlTreeItem").not(".BPT-HtmlTreeItem-HiddenRoot").first(); if(element && element.length) { self.copyOuterHtmlToClipboard(element); } } else { self.copyOuterHtmlToClipboard(element); } } if(canDelete && ((event.keyCode === Common.KeyCodes.X && ctrlKey) || (event.keyCode === Common.KeyCodes.DELETE && noKeys))) { var tagName = selectedElement.attr("data-tag"); if(self.canDeleteItem(selectedElement)) { var focusToTreeCallback = function (success) { self.focusToTree(); }; self.deleteElement(uid, selectedElement, focusToTreeCallback); wasHandled = true; } } else if(event.keyCode === Common.KeyCodes.V && ctrlKey) { wasHandled = true; if(self.canPasteAsChild(selectedElement)) { self.pasteClipboardToHtml(selectedElement, null); } } else if(event.keyCode === Common.KeyCodes.F10 && shiftKey) { var offset = (selectedElement.get(0)).getBoundingClientRect(); wasHandled = true; _this.htmlContextMenu(false, selectedElement, offset.left, offset.top); } } } return !wasHandled; }); $m(document).bind("copy", function (e) { toolwindowHelpers.copySelectedTextToClipboard(); e.stopImmediatePropagation(); return false; }, true); $m("#findbox").bind("contextmenu", function (e) { _this.handleContextMenuForTextbox(e.target, e.clientX, e.clientY); return false; }); }; DomExplorerWindow.prototype.copyOuterHtmlToClipboard = function (selectedElement) { var uid = selectedElement.attr("data-id"); this._proxy.callRemote("getHTMLString", [ uid, false ], function (textToCopy) { if(textToCopy) { clipboardData.setData("Text", textToCopy); } }); }; DomExplorerWindow.prototype.pasteClipboardToHtml = function (parentElement, beforeChild) { var text = clipboardData.getData("Text"); if(text) { var parentUid = parentElement.attr("data-id"); var beforeChildUid = beforeChild && beforeChild.length > 0 ? beforeChild.attr("data-id") : null; this.addElements(parentUid, beforeChildUid, text, function (success) { if(!HtmlTreeView.isExpandable(parentElement)) { HtmlTreeView.changeExpandableState(parentElement, true); } if(HtmlTreeView.isCollapsed(parentElement)) { HtmlTreeView.toggle(parentElement); } }); } }; DomExplorerWindow.prototype.focusToTree = function () { HtmlTreeView.focusSelected(); }; DomExplorerWindow.prototype.canDeleteItem = function (selectedItem) { var hasItemSelected = selectedItem != null && selectedItem.length > 0; var parentOfSelected = hasItemSelected ? selectedItem.parents(".BPT-HtmlTreeItem").not(".BPT-HtmlTreeItem-HiddenRoot").first() : null; var hasParent = parentOfSelected != null && parentOfSelected.length > 0; var isChildOfEditableItem = hasParent && this.domTree.isUnderEditableItem(selectedItem); var tagName = hasItemSelected ? selectedItem.attr("data-tag") : null; tagName = tagName || ""; var isTextNode = hasItemSelected && (tagName === "#text"); return hasItemSelected && (isTextNode || this.isEditableElement(tagName)) && isChildOfEditableItem; }; DomExplorerWindow.prototype.htmlContextMenu = function (extendForBreadcrumbs, selectedItem, x, y) { var _this = this; var hasItemSelected = selectedItem != null && selectedItem.length > 0; var dataTag = hasItemSelected ? selectedItem.attr("data-tag") : null; dataTag = dataTag || ""; var tagName = dataTag.toLowerCase(); var isTextNode = tagName === "#text"; var isComment = tagName === "#comment"; var isDocType = tagName === "#doctype"; var isHtmlType = tagName === "html"; var hasSelectedText = toolwindowHelpers.hasSelectedText(); var clipboardText = clipboardData.getData("Text"); var parentOfSelected = selectedItem ? selectedItem.parents(".BPT-HtmlTreeItem").not(".BPT-HtmlTreeItem-HiddenRoot").first() : null; var hasParent = parentOfSelected != null && parentOfSelected.length > 0; var isChildOfEditableItem = hasParent && this.domTree.isUnderEditableItem(selectedItem); var canAddAttribute = hasItemSelected && !isTextNode && !isComment && !isDocType; var canDelete = this.canDeleteItem(selectedItem); var canEditAsHtml = canDelete; var canCut = canDelete; var canCopy = hasSelectedText || hasItemSelected; var canCopyWithStyles = hasItemSelected && !isTextNode && !isComment && !isDocType && !isHtmlType; var canPaste = hasItemSelected && isChildOfEditableItem && clipboardText != "" && this.canPasteAsChild(selectedItem); var canPasteBefore = hasItemSelected && isChildOfEditableItem && clipboardText != "" && (isTextNode || this.isEditableElement(tagName)) && !isDocType; var menuParams = [ canAddAttribute, canDelete, canEditAsHtml, canCut, canCopy, canPaste, canPasteBefore, canCopyWithStyles ]; var callback = function (id, selectedMenuItem) { if(id === "menuTreeView") { var uid; var textToCopy; var focusToTreeCallback = function (success) { _this.focusToTree(); }; switch(selectedMenuItem) { case "menuTreeViewAddAttribute": uid = selectedItem.attr("data-id"); _this.domTree.editNewAttribute(uid, selectedItem); break; case "menuTreeViewDelete": uid = selectedItem.attr("data-id"); _this.deleteElement(uid, selectedItem, focusToTreeCallback); break; case "menuTreeViewCut": _this.copyOuterHtmlToClipboard(selectedItem); uid = selectedItem.attr("data-id"); _this.deleteElement(uid, selectedItem, focusToTreeCallback); break; case "menuTreeViewCopy": if(hasSelectedText) { toolwindowHelpers.copySelectedTextToClipboard(); } else if(isTextNode) { _this.copyOuterHtmlToClipboard(parentOfSelected); } else { _this.copyOuterHtmlToClipboard(selectedItem); } _this.focusToTree(); break; case "menuTreeEditAsHtml": uid = selectedItem.attr("data-id"); _this.domTree.editAsHtml(uid, selectedItem, _this.horizontalPane.leftWidth * .80); _this.focusToTree(); break; case "menuTreeViewPasteAsChild": _this.pasteClipboardToHtml(selectedItem, null); _this.focusToTree(); break; case "menuTreeViewPasteBefore": _this.pasteClipboardToHtml(parentOfSelected, selectedItem); _this.focusToTree(); break; case "menuTreeCopyElementWithStyles": uid = selectedItem.attr("data-id"); _this.copySelectedElementWithStyles(uid); break; default: _this.focusToTree(); break; } } else { _this.focusToTree(); } }; toolwindowHelpers.oldShowContextMenu("menuTreeView", x, y, callback, menuParams, this._toolContextMenus); return false; }; DomExplorerWindow.prototype.copySelectedElementWithStyles = function (uid) { this._proxy.callRemote("copyElementWithStyle", [ uid ], function (copy) { if(copy) { clipboardData.setData("Text", copy); } }); }; DomExplorerWindow.findAncestorByClass = function findAncestorByClass(element, className) { while(element) { if(element.classList.contains(className)) { return element; } element = element.parentElement; } return null; }; DomExplorerWindow.findDescendentByClass = function findDescendentByClass(element, className) { return element ? element.querySelector("." + className) : null; }; DomExplorerWindow.findAllDescendentsByClass = function findAllDescendentsByClass(element, className) { return element ? element.querySelectorAll("." + className) : null; }; DomExplorerWindow.getRuleFileLinkElement = function getRuleFileLinkElement(container) { return container.find(".BPT-DataTreeItem-Selected .BPT-DataTreeItem-FileLink-Value").get(0); }; DomExplorerWindow.prototype.openDocumentLinkFromEvent = function (event) { if(event.type === "click" || event.keyCode === Common.KeyCodes.ENTER || event.keyCode === Common.KeyCodes.SPACE) { var query = $m(event.target); var element = query.get(0); this.openDocumentLinkFromElement(element); } }; DomExplorerWindow.prototype.openDocumentLinkFromElement = function (element) { if(!element) { return; } var url = element.getAttribute("data-linkUrl"); var line = element.getAttribute("data-linkLine"); var col = element.getAttribute("data-linkCol"); var lineNumber = 0; if(line) { lineNumber = parseInt(line, 10); } var colNumber = 0; if(col) { colNumber = parseInt(col, 10); } try { url = decodeURI(url); this._hostBridge.openDocumentLink(url, lineNumber, colNumber); } catch (ex) { } }; DomExplorerWindow.prototype.startSelectElementByClick = function () { this._selectElementByClick.selected = true; }; DomExplorerWindow.prototype.stopSelectElementByClick = function () { this._selectElementByClick.selected = false; }; DomExplorerWindow.prototype.getAttributeCopyText = function (selectedItem) { if(selectedItem.length === 1) { var name = DataTreeView.getName(selectedItem).text(); var value = DataTreeView.getValue(selectedItem).text(); return name + "=\"" + value + "\""; } return ""; }; DomExplorerWindow.detabify = function detabify(text, spacesPerTab) { if(spacesPerTab === undefined) { spacesPerTab = 8; } var buffer = ""; var nonTabChars = 0; var originalCharCount = text.length; for(var i = 0; i < originalCharCount; i++) { var c = text.charAt(i); if(c == '\t') { buffer += Array(spacesPerTab - nonTabChars + 1).join(" "); } else { buffer += c; } nonTabChars = (c == '\n' || c == '\t') ? 0 : (nonTabChars + 1) % spacesPerTab; } return buffer; }; DomExplorerWindow.prototype.getEventCopyText = function (selectedItem) { var textToCopy = ""; if(selectedItem.length === 1) { textToCopy = DataTreeView.getName(selectedItem).text(); var children = DataTreeView.getChildren(selectedItem); if(children.length > 0) { textToCopy += "\r\n"; for(var i = 0; i < children.length; i++) { var childRow = $m(children.get(i)); textToCopy += DataTreeView.getName(childRow).text() + " " + DataTreeView.getValue(childRow).text() + "\r\n" + DomExplorerWindow.detabify(childRow.attr("title")) + (i < children.length - 2 ? "\r\n\r\n" : ""); } } else { textToCopy += " " + DataTreeView.getValue(selectedItem).text().replace(/\t+/g, "\t") + "\r\n" + DomExplorerWindow.detabify(selectedItem.attr("title")); } } return textToCopy; }; DomExplorerWindow.prototype.domExplorerLoaded = function () { var inspectElementId = this._hostBridge.inspectElementId; if(inspectElementId) { this._proxy.callRemote("inspectElementById", [ inspectElementId ]); } }; DomExplorerWindow.prototype.createExpandableHtmlTree = function (htmlTree, domObject, complete) { var _this = this; this._proxy.callRemote("attachMediaQueryEvents", [ function (changes) { if(changes) { _this._styleCache.applyChanges(changes); } else { _this.refreshCSSView(); } } ]); this.domTree.initializeTreeModifiedEvent(); this.domTree.initializeAttributeModifiedEvent(); htmlTree.children().first().children().remove(); var root = HtmlTreeView.addRootElement(htmlTree, domObject.uid, domObject.tag, null, function (a, b, c, d) { return _this.domTree.expandCallback(a, b, c, d); }); var autoOpenCount = 0; var autoExpand = function (childGroup) { if(autoOpenCount === 0) { HtmlTreeView.toggle(childGroup.children(".BPT-HtmlTreeItem").matchAttr("data-tag", "html"), autoExpand); autoOpenCount++; } else if(autoOpenCount === 1) { var body = childGroup.children(".BPT-HtmlTreeItem").matchAttr("data-tag", "body"); if(body.length === 0) { var htmlUid = childGroup.parent().attr("data-id"); _this._proxy.callRemote("attachDOMContentLoadedEvent", [ htmlUid, function (elementInfo) { _this.onDOMContentLoaded(elementInfo); } ]); } else { HtmlTreeView.toggle(body, function () { window.setTimeout(function () { (htmlTree.closest(".BPT-HtmlTree-ScrollContainer").get(0)).scrollTop = 0; }, 0); toolwindowHelpers.codeMarker(toolwindowHelpers.codeMarkers.perfBrowserTools_DiagnosticsToolWindowsDomExplorerRefreshEnd); if(complete) { complete(); } }); } } else { if(complete) { complete(); } } }; HtmlTreeView.toggle(root, autoExpand); root.bind("mouseover", function (event) { if(!toolwindowHelpers.atBreakpoint) { var element = $m(event.target).closest(".BPT-HtmlTreeItem-Header"); if(element.length > 0) { var element = element.parent(); if(!element.hasClass("BPT-HtmlTreeItem-HiddenRoot")) { var uid = element.attr("data-id"); var tag = element.attr("data-tag"); var parentUid; if(tag === '#text' || tag === '') { var parentOfElement = element.parents(".BPT-HtmlTreeItem").not(".BPT-HtmlTreeItem-HiddenRoot").first(); if(parentOfElement.length) { parentUid = parentOfElement.attr("data-id"); } } _this.temporaryShowElementHighlight(parentUid || uid); } } } return false; }); root.bind("mouseout", function (event) { if(!toolwindowHelpers.atBreakpoint) { var element = $m(event.target).closest(".BPT-HtmlTreeItem-Header"); if(element.length > 0 && !element.parent().hasClass("BPT-HtmlTreeItem-HiddenRoot")) { _this.restoreElementHighlight(); } } return false; }); root = null; }; DomExplorerWindow.prototype.onDOMContentLoaded = function (elementInfo) { if(elementInfo && elementInfo.uid && elementInfo.children) { var element = $m("#tree").find(".BPT-HtmlTreeItem[data-id='" + elementInfo.uid + "']"); this.domTree.createHtmlTreeItems(element, elementInfo.children); DomExplorer.App.domExplorer.updateBreadcrumbs(); } }; DomExplorerWindow.prototype.encodeTextForHtmlEditing = function (input) { if(typeof input !== "string") { return ""; } var htmlEscaped = $m("
    ").text(input).html(); var unicodeHex = ""; for(var i = 0; i < htmlEscaped.length; i++) { var character = htmlEscaped.charAt(i); if(character < " " || character > "~") { unicodeHex += "&#x" + character.charCodeAt(0).toString(16).toUpperCase() + ";"; } else { unicodeHex += htmlEscaped[i]; } } return unicodeHex; }; DomExplorerWindow.prototype.decodeTextFromHtmlEditing = function (input) { if(typeof input !== "string") { return ""; } var safeValue = input.replace(/\'/g, "'").replace(/\"/g, """).replace(//g, ">"); var decoded = $m("
    ").html(safeValue).text(); return decoded; }; DomExplorerWindow.prototype.updateBreadcrumbs = function (skipLoad) { var selected = HtmlTreeView.getSelected($m("#tree")); if(selected.get(0) instanceof HTMLElement) { var element = selected.get(0); if(!this._breadcrumbsModel) { this._breadcrumbsModel = new Dom.BreadcrumbsModel(element); this.breadcrumbsView = new Dom.BreadcrumbsView(this, this._proxy, this._breadcrumbsModel, document, DomExplorerWindow._breadcrumbsListId, DomExplorerWindow._breadcrumbsTemplateId); } else { this._breadcrumbsModel.setSelectedElement(selected); } if(skipLoad) { this.breadcrumbsView.skipNextLoad(); } this.breadcrumbsView.updateView(); this.refreshElementHighlight(); } else { if(this._breadcrumbsModel) { this._breadcrumbsModel.clearSelection(); this.breadcrumbsView.updateView(); } } }; DomExplorerWindow.prototype.selectBreadcrumbNodeByTagName = function (tagName, nodeIndex) { this.breadcrumbsView.selectBreadcrumbNodeByTagName(tagName, nodeIndex); }; DomExplorerWindow.prototype.selectBreadcrumbNodeByClass = function (className, nodeIndex) { this.breadcrumbsView.selectBreadcrumbNodeByClass(className, nodeIndex); }; DomExplorerWindow.prototype.selectBreadcrumbNodeById = function (id, callback) { this.breadcrumbsView.selectBreadcrumbNodeById(id); }; DomExplorerWindow.prototype.showTooltipOnSelectedBreadcrumb = function () { this.breadcrumbsView.showTooltipOnBreadcrumb(true); }; DomExplorerWindow.prototype.registerExpandCallback = function (callback) { this.expandCallback = callback; }; DomExplorerWindow.prototype.refreshCSSView = function (isInlineStyleUpdate) { if (typeof isInlineStyleUpdate === "undefined") { isInlineStyleUpdate = false; } var isStylesActive = TabItem.isActive($m("#stylesTabButton")); var isTraceActive = TabItem.isActive($m("#traceStylesTabButton")); var isComputedActive = TabItem.isActive($m("#computedStylesTabButton")); var isLayoutActive = TabItem.isActive($m("#layoutTabButton")); var selected = HtmlTreeView.getSelected($m("#tree")); var uid = selected.attr("data-id"); var tag = selected.attr("data-tag"); if(isComputedActive) { if(selected.length > 0) { this.tabPanes.clearLayoutAndStylesAndTraceStylesState(); this.tabPanes.getComputedStyleView().updateView(); } else { this.tabPanes.clearState(); } } else if((isStylesActive || isTraceActive) && !isInlineStyleUpdate) { this.tabPanes.clearState(); if(selected.length > 0) { if(isStylesActive) { var doClearStyles = true; if(tag === '#text') { var parentOfSelected = selected.parents(".BPT-HtmlTreeItem").not(".BPT-HtmlTreeItem-HiddenRoot").first(); if(parentOfSelected.length) { this.tabPanes.showStyles(parentOfSelected.attr("data-id"), parentOfSelected.attr("data-tag")); doClearStyles = false; } } else { this.tabPanes.showStyles(uid, tag); doClearStyles = false; } if(doClearStyles) { this.tabPanes.showStyles(); } } else if(isTraceActive) { this.tabPanes.showTraceStyles(uid, tag); } } } else if(isLayoutActive) { this.tabPanes.showLayout(uid, tag); } this.updateBreadcrumbs(); }; DomExplorerWindow.prototype.refreshEventsView = function () { var isEventsActive = TabItem.isActive($m("#eventsTabButton")); if(!isEventsActive) { return; } var selected = HtmlTreeView.getSelected($m("#tree")); var uid = selected.attr("data-id"); var tag = selected.attr("data-tag"); this.tabPanes.clearState(); if(selected.length > 0) { this.tabPanes.showEvents(uid, tag); } else { this.tabPanes.showEvents(); } }; DomExplorerWindow.prototype.isColorProperty = function (propertyName) { switch(propertyName.toLowerCase()) { case "background-color": case "border-bottom-color": case "border-left-color": case "border-right-color": case "border-top-color": case "color": case "column-rule-color": case "layout-border-bottom-color": case "layout-border-left-color": case "layout-border-right-color": case "layout-border-top-color": case "outline-color": case "stop-color": case "flood-color": case "lighting-color": case "scrollbar-3dlight-color": case "scrollbar-arrow-color": case "scrollbar-base-color": case "scrollbar-darkshadow-color": case "scrollbar-face-color": case "scrollbar-highlight-color": case "scrollbar-shadow-color": case "scrollbar-track-color": return true; } return false; }; DomExplorerWindow.prototype.handleContextMenuForTextbox = function (textarea, x, y) { if(x <= 0 || y <= 0) { var offset = textarea.getBoundingClientRect(); x = offset.left; y = offset.top; } if(!textarea || (textarea.tagName !== 'TEXTAREA' && (textarea.tagName !== 'INPUT' || !textarea.hasAttribute("type") || textarea.getAttribute("type") !== 'text'))) { return true; } var start = textarea.selectionStart; var end = textarea.selectionEnd; var selectedText = textarea.value.substring(start, end); var pasteText = clipboardData.getData("Text"); var canCut = (selectedText !== ""); var canCopy = (selectedText !== ""); var canPaste = !!pasteText; this._toolContextMenus.menuTextControl[0].enabled = canCut; this._toolContextMenus.menuTextControl[1].enabled = canCopy; this._toolContextMenus.menuTextControl[2].enabled = canPaste; var replaceText = function (newText) { var range = textarea.createTextRange(); var useUndo = range.queryCommandSupported("ms-beginUndoUnit"); if(useUndo) { range.execCommand("ms-beginUndoUnit"); } range.moveStart("character", start); range.moveEnd("character", end - textarea.value.length); range.text = newText; if(useUndo) { range.execCommand("ms-endUndoUnit"); } }; var callback = function (id, selectedMenuItem) { if(id === "menuTextControl") { switch(selectedMenuItem) { case "menuTextControlCut": clipboardData.setData("Text", selectedText); replaceText(""); break; case "menuTextControlCopy": clipboardData.setData("Text", selectedText); break; case "menuTextControlPaste": replaceText(pasteText); break; } } textarea.focus(); }; toolwindowHelpers.showContextMenu("menuTextControl", this._toolContextMenus.menuTextControl, x, y, callback); return false; }; DomExplorerWindow.prototype.selectElementFromConsole = function (completed) { this._proxy.callRemote("selectElementFromConsole", [], completed); }; DomExplorerWindow.prototype.switchTab = function (tabIndex) { switch(tabIndex) { case 0: $m("#stylesTabButton").click(); break; case 1: $m("#traceStylesTabButton").click(); break; case 2: $m("#computedStylesTabButton").click(); break; case 3: $m("#layoutTabButton").click(); break; case 4: $m("#eventsTabButton").click(); break; } }; return DomExplorerWindow; })(); DomExplorer.DomExplorerWindow = DomExplorerWindow; function gleamChange(node) { var n = node && node.get && node.get(0); if(!n) { return; } if(n['gleamToken']) { window.clearTimeout(n['gleamToken']); delete n['gleamToken']; } else { node.addClass("BPT-HTML-Attribute-Changed"); } n['gleamToken'] = window.setTimeout(function () { node.removeClass("BPT-HTML-Attribute-Changed"); delete n['gleamToken']; }, 1000); } DomExplorer.gleamChange = gleamChange; })(F12.DomExplorer || (F12.DomExplorer = {})); var DomExplorer = F12.DomExplorer; })(F12 || (F12 = {})); //@ sourceMappingURL=domExplorer.js.map .BPT-Events-EventName { color:#FF0000; /* [{plugin-font-editor-html-attribute-name-color}] */ -ms-grid-column: 2; } .BPT-Events-Function-Name { float: left; width: 160px; } .BPT-Events-Location { float: left; margin-left: 10px; } .BPT-ExpandingList-Header[aria-expanded='false'] > .BPT-ExpandingList-ExpandIcon { background-image: url('../common/itemCollapsedIcon.png'); /*[url({plugin-image-icon-item-collapsed})]*/ background-size: 10px 10px; } .BPT-ExpandingList-Header[aria-expanded='false'] + .BPT-ExpandingList-Collapsed-Section { display: none; } .BPT-ExpandingList-Header[aria-expanded='true'] > .BPT-ExpandingList-ExpandIcon { background-image: url(''); /*[url({plugin-image-icon-item-expanded})]*/ background-size: 10px 10px; } .BPT-ExpandingList-Header { display: -ms-grid; -ms-grid-columns: 17px auto auto 25px; } .BPT-ExpandingList-ExpandIcon { width: 10px; height: 10px; margin-top: 3px; -ms-grid-column: 1; background-repeat: no-repeat; } .BPT-ExpandingList-Child-Value-Container { margin-left: 26px; overflow: auto; } .BPT-ExpandingList-Header { padding: 1px; width: calc(100% - 2px); overflow: auto; overflow-x: hidden; white-space: normal; } .BPT-ExpandingList-Child-Value-Container { padding: 1px; width: calc(100% - 28px); /* margin left plus 1px for padding-left and 1px for padding-right */ white-space: normal; } .BPT-ExpandingList-Header:focus, .BPT-ExpandingList-Child-Value-Container:focus { background: rgba(51, 153, 255, 0.25); /*[{plugin-font-editor-selected-background-color rgba(0.2)}]*/ border-color: transparent; border-style: solid; border-width: 1px; padding: 0px; }  #layoutView { margin: 4px auto auto 5px; } #layoutViewTable { font-family: Consolas, monospace; display: table; overflow: hidden; } /* Need to explicitly override the CSS selector from domExplorer.css ** .BPT-HorizontalPane-Right-Content > div > *:not(.BPT-Toolbar) ** in our special #layout-offset-layer selector case. */ #layout-offset-layer { font-family: inherit; } div.BPT-Layout-Layer { display: table-cell; padding: .1em 1px; text-align: center; border-top: 1px solid #84ACDD; border-left: 1px solid #84ACDD; border-bottom: 1px solid #84ACDD; border-right: 1px solid #84ACDD; white-space: nowrap; } div.BPT-Layout-Top, div.BPT-Layout-Bottom { font-family: inherit; text-align: center; padding: 0.2em; height: 1em; } div.BPT-Layout-Left-Outer-Cell { display: table-cell; font-family: inherit; height: 1.4em; max-width: 1.4em; min-width: 1.4em; position: relative; vertical-align: middle; white-space: nowrap; width: 1.4em; } div.BPT-Layout-Left-Coord { font-family: inherit; height: 1.4em; left: -3.3em; position: relative; width: 1px; } div.BPT-Layout-Left { display: inline-block; font-family: inherit; height: 1.4em; line-height: 1.4em; position: relative; text-align: center; transform: rotate(-90deg); width: 8em; } div.BPT-Layout-Right-Outer-Cell { display: table-cell; font-family: inherit; height: 1.4em; max-width: 1.4em; min-width: 1.4em; position: relative; vertical-align: middle; white-space: nowrap; width: 1.4em; } div.BPT-Layout-Right-Coord { font-family: inherit; height: 1.4em; left: -3.3em; position: relative; width: 0; } div.BPT-Layout-Right { display: inline-block; font-family: inherit; height: 1.4em; line-height: 1.4em; position: relative; text-align: center; transform: rotate(-90deg); width: 8em; } div.BPT-Layout-Label { font-family: inherit; display: block; font-size: .85em; padding: 0px 5px; width: 0px; height: 0px; overflow: visible; color: gray; } #layout-offset-layer { background-color: #FFFFFF; border-color: #999999; color: black; } #layout-margin-layer { background-color: #FFEFC7; border-color: #FAD05B; color: black; } #layout-border-layer { background-color: #D3E7BC; border-color: #9BCD61; color: black; } #layout-padding-layer { background-color: #FBD4C7; border-color: #F7A387; color: black; } #layout-size-layer { background-color: #E2F3FB; border-color: #A8DDF6; color: black; height: 2em; line-height: 2em; min-width: 10em; vertical-align: middle; } { "start_url": "DomExplorer\\dom.html", "domain": "http://microsoft.com", "name":"Dom", "version":"1.0", "f12": { "start_url": "dom.html", "localized_tab_resource": "DomToolLabelText", "localized_tooltip_id": 814, "tab_image": "tabIcon.png", "resource_aliases" : { "Common": { "is_default" : true } }, "themed_images": { "plugin-image-icon-dom-explorer-show-all-styles": { "bitmap_source": "images\\i_just_my_code.png", "background_color": "plugin-background-color" }, "plugin-image-icon-dom-explorer-error": { "bitmap_source": "images\\i_error.png", "background_color": "plugin-background-color" }, "plugin-image-icon-dom-explorer-inspect": { "bitmap_source": "images\\i_inspect.png", "background_color": "f12-toolbar-background-color" }, "plugin-image-icon-dom-explorer-show-layout": { "bitmap_source": "images\\i_show-layout.png", "background_color": "f12-toolbar-background-color" }, "plugin-image-icon-dom-explorer-refresh": { "bitmap_source": "images\\i_refresh.png", "background_color": "f12-toolbar-background-color" }, "plugin-image-icon-dom-explorer-next": { "bitmap_source": "images\\i_next.png", "background_color": "plugin-background-color" }, "plugin-image-icon-dom-explorer-previous": { "bitmap_source": "images\\i_previous.png", "background_color": "plugin-background-color" }, "plugin-image-icon-dom-explorer-breadcrumb-right": { "bitmap_source": "images\\BreadcrumbScrollRight.png", "background_color": "plugin-breadcrumb-background-color" }, "plugin-image-icon-dom-explorer-breadcrumb-right-hover": { "bitmap_source": "images\\BreadcrumbScrollRightHover.png", "background_color": "plugin-breadcrumb-background-color" }, "plugin-image-icon-dom-explorer-breadcrumb-left": { "bitmap_source": "images\\BreadcrumbScrollLeft.png", "background_color": "plugin-breadcrumb-background-color" }, "plugin-image-icon-dom-explorer-breadcrumb-left-hover": { "bitmap_source": "images\\BreadcrumbScrollLeftHover.png", "background_color": "plugin-breadcrumb-background-color" }, "plugin-image-icon-item-collapsed": { "bitmap_source": "..\\Common\\itemCollapsedIcon.png", "background_color": "plugin-background-color" }, "plugin-image-icon-item-expanded": { "bitmap_source": "..\\Common\\itemExpandedIcon.png", "background_color": "plugin-background-color" }, "plugin-image-icon-red-underline": { "bitmap_source": "images\\red_squiggly.png", "background_color": "plugin-background-color" } } }, "vs": { "resource_aliases" : { "Common": { "type" : "Embedded", "name" : "Microsoft.VisualStudio.WebClient.Diagnostics.HtmlToolHost", "path" : "Microsoft.VisualStudio.WebClient.Diagnostics.HtmlToolHost.Resources", "is_default" : true } }, "guid_symbols": { "guidShellStandardSet": "5efc7975-14bc-11cf-9b2b-00aa00573819", "guidHtmlToolHostCmdSet": "a654f3df-4bdb-4863-a750-75cdb50a03bc" }, "command_aliases": { "find": { "guid": "guidShellStandardSet", "id": 97, "focus": true }, "findnext": { "guid": "guidShellStandardSet", "id": 370, "focus": true }, "findprev": { "guid": "guidShellStandardSet", "id": 371, "focus": true }, "redo": { "guid": "guidShellStandardSet", "id": 29, "focus": true }, "refresh": { "guid": "guidHtmlToolHostCmdSet", "id": 261, "focus": true }, "selectelement": { "guid": "guidHtmlToolHostCmdSet", "id": 262, "focus": true }, "showlayout": { "guid": "guidHtmlToolHostCmdSet", "id": 263, "focus": true }, "undo": { "guid": "guidShellStandardSet", "id": 43, "focus": true } }, "theme_token_aliases": { "plugin-font-console-color": { "category": "2AA714AE-53BE-4393-84E0-DC95B57A1891", "key_type": "ForegroundColor", "name": "Plain Text" }, "plugin-font-console-background-color": { "category": "2AA714AE-53BE-4393-84E0-DC95B57A1891", "key_type": "BackgroundColor", "name": "Plain Text" }, "plugin-font-console-input-color": { "category": "2AA714AE-53BE-4393-84E0-DC95B57A1891", "key_type": "ForegroundColor", "name": "Console Input Text" }, "plugin-font-console-input-background-color": { "category": "2AA714AE-53BE-4393-84E0-DC95B57A1891", "key_type": "BackgroundColor", "name": "Console Input Text" }, "plugin-font-console-output-color": { "category": "2AA714AE-53BE-4393-84E0-DC95B57A1891", "key_type": "ForegroundColor", "name": "Console Output Text" }, "plugin-font-console-output-background-color": { "category": "2AA714AE-53BE-4393-84E0-DC95B57A1891", "key_type": "BackgroundColor", "name": "Console Output Text" }, "plugin-font-console-error-color": { "category": "2AA714AE-53BE-4393-84E0-DC95B57A1891", "key_type": "ForegroundColor", "name": "Console Error Text" }, "plugin-font-console-error-background-color": { "category": "2AA714AE-53BE-4393-84E0-DC95B57A1891", "key_type": "BackgroundColor", "name": "Console Error Text" }, "plugin-font-console-info-color": { "category": "2AA714AE-53BE-4393-84E0-DC95B57A1891", "key_type": "ForegroundColor", "name": "Console Info Text" }, "plugin-font-console-info-background-color": { "category": "2AA714AE-53BE-4393-84E0-DC95B57A1891", "key_type": "BackgroundColor", "name": "Console Info Text" }, "plugin-font-console-warning-color": { "category": "2AA714AE-53BE-4393-84E0-DC95B57A1891", "key_type": "ForegroundColor", "name": "Console Warning Text" }, "plugin-font-console-warning-background-color": { "category": "2AA714AE-53BE-4393-84E0-DC95B57A1891", "key_type": "BackgroundColor", "name": "Console Warning Text" }, "plugin-font-editor-color": { "category": "58e96763-1d3b-4e05-b6ba-ff7115fd0b7b", "key_type": "ForegroundColor", "name": "Plain Text" }, "plugin-font-editor-background-color": { "category": "58e96763-1d3b-4e05-b6ba-ff7115fd0b7b", "key_type": "BackgroundColor", "name": "Plain Text" }, "plugin-font-editor-keyword-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "ForegroundColor", "name": "Keyword" }, "plugin-font-editor-keyword-background-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "BackgroundColor", "name": "Keyword" }, "plugin-font-editor-string-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "ForegroundColor", "name": "String" }, "plugin-font-editor-string-background-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "BackgroundColor", "name": "String" }, "plugin-font-editor-number-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "ForegroundColor", "name": "Number" }, "plugin-font-editor-number-background-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "BackgroundColor", "name": "Number" }, "plugin-font-editor-symbol-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "ForegroundColor", "name": "SymbolDefinitionClassificationFormat" }, "plugin-font-editor-symbol-background-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "BackgroundColor", "name": "SymbolDefinitionClassificationFormat" }, "plugin-font-editor-html-tag-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "ForegroundColor", "name": "HTML Tag Delimiter" }, "plugin-font-editor-html-tag-background-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "BackgroundColor", "name": "HTML Tag Delimiter" }, "plugin-font-editor-html-element-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "ForegroundColor", "name": "HTML Element Name" }, "plugin-font-editor-html-element-background-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "BackgroundColor", "name": "HTML Element Name" }, "plugin-font-editor-html-comment-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "ForegroundColor", "name": "HTML Comment" }, "plugin-font-editor-html-comment-background-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "BackgroundColor", "name": "HTML Comment" }, "plugin-font-editor-html-attribute-name-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "ForegroundColor", "name": "HTML Attribute" }, "plugin-font-editor-html-attribute-name-background-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "BackgroundColor", "name": "HTML Attribute" }, "plugin-font-editor-html-attribute-value-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "ForegroundColor", "name": "HTML Attribute Value" }, "plugin-font-editor-html-attribute-value-background-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "BackgroundColor", "name": "HTML Attribute Value" }, "plugin-font-editor-html-operator-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "ForegroundColor", "name": "HTML Operator" }, "plugin-font-editor-html-operator-background-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "BackgroundColor", "name": "HTML Operator" }, "plugin-font-editor-css-name-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "ForegroundColor", "name": "CSS Property Name" }, "plugin-font-editor-css-name-background-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "BackgroundColor", "name": "CSS Property Name" }, "plugin-font-editor-css-value-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "ForegroundColor", "name": "CSS Property Value" }, "plugin-font-editor-css-value-background-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "BackgroundColor", "name": "CSS Property Value" }, "plugin-font-editor-css-selector-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "ForegroundColor", "name": "CSS Selector" }, "plugin-font-editor-css-selector-background-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "BackgroundColor", "name": "CSS Selector" }, "plugin-font-editor-inactive-selected-background-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "BackgroundColor", "name": "Inactive Selected Text" }, "plugin-font-editor-selected-background-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "BackgroundColor", "name": "Selected Text" }, "plugin-font-editor-selected-border-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "ForegroundColor", "name": "outlining.collapsehintadornment" }, "plugin-environment-background-gradient-begin": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "EnvironmentBackgroundGradientBegin" }, "plugin-filetab-hot-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "FileTabHotText" }, "plugin-filetab-inactive-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "FileTabInactiveText" }, "plugin-filetab-inactive-gradient-top-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "FileTabInactiveGradientTop" }, "plugin-filetab-hot-gradient-top-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "FileTabHotGradientTop" }, "plugin-filetab-selected-gradient-top-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "FileTabSelectedGradientTop" }, "plugin-filetab-selected-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "FileTabSelectedText" }, "plugin-searchcontrol-selection-color": { "category": "f1095fad-881f-45f1-8580-589e10325eb8", "key_type": "BackgroundColor", "name": "Selection" }, "plugin-searchcontrol-unfocused-watermark-text-color": { "category": "f1095fad-881f-45f1-8580-589e10325eb8", "key_type": "BackgroundColor", "name": "UnfocusedWatermarkText" }, "plugin-searchcontrol-unfocused-background-color": { "category": "f1095fad-881f-45f1-8580-589e10325eb8", "key_type": "BackgroundColor", "name": "Unfocused" }, "plugin-searchcontrol-unfocused-border-color": { "category": "f1095fad-881f-45f1-8580-589e10325eb8", "key_type": "BackgroundColor", "name": "UnfocusedBorder" }, "plugin-searchcontrol-mouseover-watermark-text-color": { "category": "f1095fad-881f-45f1-8580-589e10325eb8", "key_type": "BackgroundColor", "name": "MouseOverWatermarkText" }, "plugin-searchcontrol-mouseover-background-background-color": { "category": "f1095fad-881f-45f1-8580-589e10325eb8", "key_type": "BackgroundColor", "name": "MouseOverBackground" }, "plugin-searchcontrol-mouseover-background-foreground-color": { "category": "f1095fad-881f-45f1-8580-589e10325eb8", "key_type": "ForegroundColor", "name": "MouseOverBackground" }, "plugin-searchcontrol-mouseover-border-color": { "category": "f1095fad-881f-45f1-8580-589e10325eb8", "key_type": "BackgroundColor", "name": "MouseOverBorder" }, "plugin-commandbar-gradient-begin-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "CommandBarGradientBegin" }, "plugin-vertical-resize-grip-middle-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "VerticalResizeGripMiddle" }, "plugin-font-current-line-active-format-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "ForegroundColor", "name": "CurrentLineActiveFormat" }, "plugin-font-current-line-inactive-format-color": { "category": "75a05685-00a8-4ded-bae5-e7a50bfa929a", "key_type": "ForegroundColor", "name": "CurrentLineInactiveFormat" }, "plugin-font-editor-current-statement-background-color": { "category": "ff349800-ea43-46c1-8c98-878e78f46501", "key_type": "BackgroundColor", "name": "Current Statement" }, "plugin-font-editor-current-statement-color": { "category": "ff349800-ea43-46c1-8c98-878e78f46501", "key_type": "ForegroundColor", "name": "Current Statement" }, "plugin-tab-header-background-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "ToolWindowTabGradientEnd" }, "plugin-tab-header-active-background-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "ToolWindowTabSelectedTab" }, "plugin-tab-header-hover-background-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "ToolWindowTabMouseOverBackgroundBegin" }, "plugin-tab-header-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "ToolWindowTabText" }, "plugin-tab-header-active-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "ToolWindowTabSelectedText" }, "plugin-tab-header-hover-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "ToolWindowTabMouseOverText" }, "plugin-breadcrumb-background-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "ToolWindowBackground" }, "plugin-breadcrumb-border-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "ActiveBorder" }, "plugin-breadcrumb-hover-color": { "category": "92ecf08e-8b13-4cf4-99e9-ae2692382185", "key_type": "ForegroundColor", "name": "SelectedItemInactive" }, "plugin-breadcrumb-hover-background-color": { "category": "92ecf08e-8b13-4cf4-99e9-ae2692382185", "key_type": "BackgroundColor", "name": "SelectedItemInactive" }, "plugin-breadcrumb-selected-color": { "category": "92ecf08e-8b13-4cf4-99e9-ae2692382185", "key_type": "ForegroundColor", "name": "SelectedItemActive" }, "plugin-breadcrumb-selected-background-color": { "category": "92ecf08e-8b13-4cf4-99e9-ae2692382185", "key_type": "BackgroundColor", "name": "SelectedItemActive" }, "plugin-breadcrumb-tooltip-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "ForegroundColor", "name": "ToolTip" }, "plugin-breadcrumb-tooltip-background-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "ToolTip" }, "plugin-breadcrumb-tooltip-border-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "ToolTipBorder" }, "plugin-perftools-grid-column-sizer": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "VerticalResizeGripMiddle" }, "f12-intellisense-hover-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "MenuText" }, "f12-intellisense-hover-background-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "Menu" }, "f12-intellisense-checked-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "HighlightText" }, "f12-intellisense-checked-background-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "Highlight" }, "f12-toolbar-background-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "CommandBarGradientBegin" }, "f12-toolbar-button-selected-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "CommandBarSelected" }, "f12-toolbar-button-selected-border-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "CommandBarSelectedBorder" }, "f12-toolbar-button-selected-text-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "CommandBarTextSelected" }, "f12-toolbar-button-hover-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "CommandBarMouseOverBackgroundBegin" }, "f12-toolbar-button-hover-text-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "CommandBarTextHover" }, "f12-toolbar-button-border-hover-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "CommandBarBorder" }, "f12-toolbar-button-pressed-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "CommandBarMouseDownBackgroundBegin" } }, "themed_images": { "plugin-image-icon-item-collapsed": { "bitmap_source": "Common\\itemCollapsedIcon.png", "background_color": "plugin-background-color" }, "plugin-image-icon-item-expanded": { "bitmap_source": "Common\\itemExpandedIcon.png", "background_color": "plugin-background-color" }, "plugin-image-icon-red-underline": { "bitmap_source": "DomExplorer\\images\\red_squiggly.png", "background_color": "plugin-background-color" }, "plugin-image-icon-dom-explorer-show-all-styles": { "bitmap_source": "DomExplorer\\images\\i_just_my_code.png", "background_color": "plugin-background-color" }, "plugin-image-icon-dom-explorer-error": { "bitmap_source": "DomExplorer\\images\\i_error.png", "background_color": "plugin-background-color" }, "plugin-image-icon-dom-explorer-inspect": { "bitmap_source": "DomExplorer\\images\\i_inspect.png", "background_color": "f12-toolbar-background-color" }, "plugin-image-icon-dom-explorer-show-layout": { "bitmap_source": "DomExplorer\\images\\i_show-layout.png", "background_color": "f12-toolbar-background-color" }, "plugin-image-icon-dom-explorer-refresh": { "bitmap_source": "DomExplorer\\images\\i_refresh.png", "background_color": "f12-toolbar-background-color" }, "plugin-image-icon-dom-explorer-next": { "bitmap_source": "DomExplorer\\images\\i_next.png", "background_color": "plugin-background-color" }, "plugin-image-icon-dom-explorer-previous": { "bitmap_source": "DomExplorer\\images\\i_previous.png", "background_color": "plugin-background-color" }, "plugin-image-icon-dom-explorer-breadcrumb-right": { "bitmap_source": "DomExplorer\\images\\BreadcrumbScrollRight.png", "background_color": "plugin-breadcrumb-background-color" }, "plugin-image-icon-dom-explorer-breadcrumb-right-hover": { "bitmap_source": "DomExplorer\\images\\BreadcrumbScrollRightHover.png", "background_color": "plugin-breadcrumb-background-color" }, "plugin-image-icon-dom-explorer-breadcrumb-left": { "bitmap_source": "DomExplorer\\images\\BreadcrumbScrollLeft.png", "background_color": "plugin-breadcrumb-background-color" }, "plugin-image-icon-dom-explorer-breadcrumb-left-hover": { "bitmap_source": "DomExplorer\\images\\BreadcrumbScrollLeftHover.png", "background_color": "plugin-breadcrumb-background-color" } } }, "file_aliases": { "PerformanceTraceExtension": { "path": "PerformanceTrace.dll", "optional": true } } } var F12; (function (F12) { (function (RemoteDom) { var Assert = F12.Tools.Utility.Assert; var CSSRule; var domUtilities, dom$messageHandlers; var inspectElementHandler; RemoteDom.remoteCode = { editStack: null, hostId: null, onKeyDownSafe: null, unloadSafe: null, scriptExecutionSupported: null, getUidOrNull: function domeExplorer$remoteCode$getUidOrNull(element) { if(!element) { return null; } return element['uniqueID'] || element['bpt-uid'] || null; }, initialize: function domExplorer$remoteCode$initialize() { RemoteDom.remoteCode.editStack = new Common.EditStack(); if(typeof browser !== 'undefined') { Common.RemoteHelpers.addListener(browser, 'beforeScriptExecute', RemoteDom.remoteCode.onBeforeScriptExecute); Common.RemoteHelpers.addListener(browser, 'inspectElement', (inspectElementHandler = function (e) { RemoteDom.dom$messageHandlers.inspectElement(e.target); })); } remoteHelpers.initialize("DomExplorer", RemoteDom.remoteCode.initializePage, "__BROWSERTOOLS_DOMEXPLORER_ADDED", RemoteDom.remoteCode.onDetach); }, initializePage: function domExplorer$remoteCode$initializePage() { try { browser.executeScript("(function(){})();"); RemoteDom.remoteCode.scriptExecutionSupported = true; remoteHelpers.initializeDocumentTries = 0; } catch (e) { RemoteDom.remoteCode.scriptExecutionSupported = false; RemoteDom.remoteCode.onDocumentNotReady(); } try { RemoteDom.remoteCode.addRemotePageFunctions(Common.RemoteHelpers.getDefaultView(mainBrowser.document)); remoteHelpers.port.postMessage("RefreshTree:" + Common.RemoteHelpers.getDocumentMode()); } catch (ex) { return; } }, onDocumentNotReady: function domExplorer$remoteCode$onDocumentNotReady() { if(remoteHelpers.initializeDocumentTries < remoteHelpers.initializeDocumentMaxTries) { remoteHelpers.initializeDocumentTries++; try { remoteHelpers.port.postMessage("DocumentNotYetReady"); } catch (ex) { return; } } else { errorHandler.onErrorHandler("Document timed out", "remote.js", 0); } }, onDetach: function domExplorer$remoteCode$onDetach() { RemoteDom.dom$messageHandlers.cancelSelectElementByClick(); remoteHelpers.initializeDocumentTries = 0; RemoteDom.remoteCode.editStack = undefined; RemoteDom.domUtilities.reset(); Common.RemoteHelpers.removeListener(browser, 'beforeScriptExecute', RemoteDom.remoteCode.onBeforeScriptExecute); Common.RemoteHelpers.removeListener(browser, 'inspectElement', inspectElementHandler); try { if(Common.RemoteHelpers.getDefaultView(mainBrowser.document)['__BROWSERTOOLS_DOMEXPLORER_ADDED']) { Common.RemoteHelpers.getDefaultView(mainBrowser.document)['__BROWSERTOOLS_DOMEXPLORER_ADDED'] = null; } if(Common.RemoteHelpers.getDefaultView(mainBrowser.document)['__BROWSERTOOLS_DOMEXPLORER_STORED_ELEMENTS']) { Common.RemoteHelpers.getDefaultView(mainBrowser.document)['__BROWSERTOOLS_DOMEXPLORER_STORED_ELEMENTS'] = null; } if(RemoteDom.remoteCode.onKeyDownSafe) { Common.RemoteHelpers.removeListener(mainBrowser.document, "keydown", RemoteDom.remoteCode.onKeyDownSafe, true); } if(RemoteDom.remoteCode.unloadSafe) { Common.RemoteHelpers.removeListener(Common.RemoteHelpers.getDefaultView(mainBrowser.document), "unload", RemoteDom.remoteCode.unloadSafe, true); RemoteDom.remoteCode.unloadSafe = null; } } catch (ex) { } }, onBeforeScriptExecute: function domExplorer$remoteCode$onBeforeScriptExecute(dispatchWindow) { if(dispatchWindow && dispatchWindow.browserOrWindow) { dispatchWindow = dispatchWindow.browserOrWindow; } var realWindow = null; try { realWindow = Common.RemoteHelpers.getDefaultView(dispatchWindow.document); } catch (ex) { return; } RemoteDom.domUtilities.removeHighlight(); if(realWindow === Common.RemoteHelpers.getDefaultView(mainBrowser.document)) { if(remoteHelpers.port) { remoteHelpers.postAllMessages(); } RemoteDom.remoteCode.initializePage(); } else { RemoteDom.domUtilities.reloadFrame(realWindow); } }, addRemotePageFunctions: function domExplorer$remoteCode$addRemotePageFunctions(realWindow) { if(RemoteDom.remoteCode.scriptExecutionSupported) { if(!RemoteDom.remoteCode.onKeyDownSafe) { RemoteDom.remoteCode.onKeyDownSafe = Common.RemoteHelpers.addSafeListener(realWindow, mainBrowser.document, "keydown", RemoteDom.remoteCode.onKeyDown, true); } realWindow.console = realWindow.console || new realWindow.Object(); realWindow.console.select = remoteHelpers.createSafeFunction(realWindow, RemoteDom.dom$messageHandlers.selectElementFromConsole); realWindow.__BROWSERTOOLS_DOMEXPLORER_ADDED = true; } }, onKeyDown: function domExplorer$remoteCode$onKeyDown(e) { if(e.keyCode === 123 && RemoteDom.remoteCode.hostId === "vs") { RemoteDom.remoteCode.vsFocusCallback(); return Common.RemoteHelpers.eventHandled(e); } else if(e.keyCode === 66 && e.ctrlKey && !e.shiftKey && !e.altKey) { if(!RemoteDom.domUtilities.isSelectingElement && RemoteDom.remoteCode.startSelectElementByClickCallback) { RemoteDom.remoteCode.startSelectElementByClickCallback(); return Common.RemoteHelpers.eventHandled(e); } else if(RemoteDom.domUtilities.isSelectingElement && RemoteDom.remoteCode.stopSelectElementByClickCallback) { RemoteDom.remoteCode.stopSelectElementByClickCallback(); return Common.RemoteHelpers.eventHandled(e); } } } }; RemoteDom.domUtilities = { isSelectingElement: false, selectElementLastSelected: null, selectElementClickCallback: null, mediaStyleChangeCallback: null, currentEventProxy: null, attachedDomModifiedDocs: [], attachedAttrModifiedDocs: [], getMutationManager: function () { if(!RemoteDom.domUtilities.mutationManager) { RemoteDom.domUtilities.mutationManager = new F12.RemoteDom.MutationManager(diagnostics, remoteHelpers); } return RemoteDom.domUtilities.mutationManager; }, getChunker: function () { if(!RemoteDom.domUtilities.chunker) { RemoteDom.domUtilities.chunker = new F12.RemoteDom.Chunker(); } return RemoteDom.domUtilities.chunker; }, currentEventProxyListeners: [], removeAllCurrentEventProxyListeners: function () { if(RemoteDom.domUtilities.currentEventProxy) { if(RemoteDom.domUtilities.currentEventProxyListeners) { for(var i = 0; i < RemoteDom.domUtilities.currentEventProxyListeners.length; i++) { var listener = RemoteDom.domUtilities.currentEventProxyListeners[i]; RemoteDom.domUtilities.currentEventProxy.removeEventListener(listener.name, listener.callback); } } RemoteDom.domUtilities.currentEventProxyListeners = []; } }, reset: function domExplorer$domUtilities$reset() { remoteHelpers.uid = 0; RemoteDom.domUtilities.removeHighlight(); RemoteDom.domUtilities.isSelectingElement = false; RemoteDom.domUtilities.selectElementLastSelected = null; RemoteDom.domUtilities.selectElementClickCallback = null; for(var j = 0; j < RemoteDom.domUtilities.attachedDomModifiedDocs.length; j++) { try { var treeModified = RemoteDom.domUtilities.attachedDomModifiedDocs[j]; if(treeModified.doc && treeModified.handler) { Common.RemoteHelpers.removeListener(treeModified.doc, "DOMNodeInserted", treeModified.handler, true); Common.RemoteHelpers.removeListener(treeModified.doc, "DOMNodeRemoved", treeModified.handler, true); Common.RemoteHelpers.removeListener(treeModified.doc, "DOMCharacterDataModified", treeModified.handler, true); } } catch (ex) { } } RemoteDom.domUtilities.attachedDomModifiedDocs = []; for(var k = 0; k < RemoteDom.domUtilities.attachedAttrModifiedDocs.length; k++) { try { var attrModified = RemoteDom.domUtilities.attachedAttrModifiedDocs[k]; if(attrModified.doc && attrModified.handler) { Common.RemoteHelpers.removeListener(attrModified.doc, "DOMAttrModified", attrModified.handler, true); } } catch (ex) { } } RemoteDom.domUtilities.attachedAttrModifiedDocs = []; if(RemoteDom.domUtilities.currentEventProxy) { RemoteDom.domUtilities.removeAllCurrentEventProxyListeners(); RemoteDom.domUtilities.currentEventProxy = null; } if(Common.RemoteHelpers.getDefaultView(mainBrowser.document)['__BROWSERTOOLS_DOMEXPLORER_STORED_ELEMENTS']) { Common.RemoteHelpers.getDefaultView(mainBrowser.document)['__BROWSERTOOLS_DOMEXPLORER_STORED_ELEMENTS'] = new (mainBrowser.document.parentWindow).Array(); } htmlTreeHelpers.reset(); }, basicHighlightColor: { margin: 'rgba(250, 212, 107, 0.75)', border: 'rgba(120, 181, 51, 0.75)', padding: 'rgba(247, 163, 135, 0.75)', content: 'rgba(168, 221, 246, 0.75)' }, selectElementColor: { margin: 'rgba(250, 212, 107, 0.50)', border: 'rgba(120, 181, 51, 0.50)', padding: 'rgba(247, 163, 135, 0.50)', content: 'rgba(168, 221, 246, 0.50)' }, hoverElementColor: { margin: 'rgba(250, 212, 107, 0.50)', border: 'rgba(120, 181, 51, 0.50)', padding: 'rgba(247, 163, 135, 0.50)', content: 'rgba(168, 221, 246, 0.50)' }, highlightElement: function domExplorer$domUtilities$highlightElement(element, color) { if(!element || !element.tagName || !color) { return; } if(typeof browser !== 'undefined' && typeof browser.highlightElement === 'function') { try { browser.highlightElement(element, color.margin, color.border, color.padding, color.content); } catch (ex) { Common.RemoteHelpers.encounteredException(ex); } } }, removeHighlight: function domExplorer$domUtilities$removeHighlight() { if(typeof browser !== 'undefined' && typeof browser.highlightElement === 'function') { try { browser.highlightElement(null, '', '', '', ''); } catch (ex) { Common.RemoteHelpers.encounteredException(ex); } } }, selectElementInLiveDomEnable: function domExplorer$domUtilities$selectElementInLiveDomEnable() { if(!RemoteDom.domUtilities.isSelectingElement) { return; } if(typeof browser !== 'undefined' && typeof browser.elementSelectionEventsEnabled !== 'undefined') { browser.elementSelectionEventsEnabled = true; browser.addEventListener('selectElement', RemoteDom.domUtilities.selectElementHandler); browser.addEventListener('hoverElement', RemoteDom.domUtilities.hoverElementHandler); } }, selectElementInLiveDomDisable: function domExplorer$domUtilities$selectElementInLiveDomDisable() { if(!RemoteDom.domUtilities.isSelectingElement) { return; } if(typeof browser !== 'undefined' && typeof browser.elementSelectionEventsEnabled !== 'undefined') { browser.elementSelectionEventsEnabled = false; browser.removeEventListener('selectElement', RemoteDom.domUtilities.selectElementHandler); browser.removeEventListener('hoverElement', RemoteDom.domUtilities.hoverElementHandler); } }, selectElementHandler: function domExplorer$domUtilities$selectElementHandler(event) { if(event.target) { RemoteDom.domUtilities.highlightElement(event.target, RemoteDom.domUtilities.selectElementColor); } RemoteDom.domUtilities.selectElementLastSelected = event.target; if(RemoteDom.domUtilities.selectElementClickCallback) { RemoteDom.domUtilities.selectElementClickCallback(); } }, hoverElementHandler: function domExplorer$domUtilities$hoverElementHandler(event) { if(event.target) { RemoteDom.domUtilities.highlightElement(event.target, RemoteDom.domUtilities.hoverElementColor); } }, getElementAtCoords: function domExplorer$domUtilities$getElementAtCoords(doc, x, y) { var checkForValidElement = function (element) { if(typeof element.className !== "string" || element.className.indexOf("win-appbarclickeater") === -1) { if(element.tagName === "IFRAME" || element.tagName === "FRAME") { var rect = RemoteDom.domUtilities.getClientRect(element); var currentWindow = Common.RemoteHelpers.getDefaultView(element.ownerDocument); var iframe = dom.getCrossSiteWindow(currentWindow, element.contentWindow); var offset = Common.RemoteHelpers.getPageOffset(doc); return RemoteDom.domUtilities.getElementAtCoords(iframe.document, x - rect.left + offset.x, y - rect.top + offset.y); } else { return element; } } return false; }; var validElement; if((typeof doc.msElementsFromPoint) === "function") { var elements = doc.msElementsFromPoint(x, y); for(var i = 0; i < elements.length; i++) { validElement = checkForValidElement(elements[i]); if(typeof validElement !== "boolean") { var win = Common.RemoteHelpers.getDefaultView(doc); var computedStyle = Common.RemoteHelpers.getComputedStyle(win, validElement); if(computedStyle.visibility !== "hidden") { return validElement; } } } } else { var element = doc.elementFromPoint(x, y); if(element) { validElement = checkForValidElement(element); if(typeof validElement !== "boolean") { return validElement; } else { var previousVisibility = element.style.visibility; element.style.visibility = "hidden"; var realElement = RemoteDom.domUtilities.getElementAtCoords(doc, x, y); element.style.visibility = previousVisibility; return realElement; } } } return null; }, getClientRect: function domExplorer$domUtilities$getClientRect(element) { if(element && element.getBoundingClientRect) { var rect = element.getBoundingClientRect(); if(rect.top !== undefined && rect.left !== undefined && rect.width !== undefined && rect.height !== undefined) { var offset = Common.RemoteHelpers.getPageOffset(element.ownerDocument); return { left: rect.left + offset.x, top: rect.top + offset.y, width: rect.width, height: rect.height }; } } var top = 0; var left = 0; var curEle = element; while(curEle && curEle !== mainBrowser.document.body && curEle !== mainBrowser.document) { top += curEle.offsetTop; left += curEle.offsetLeft; curEle = curEle.offsetParent; } return { left: left, top: top, width: element.offsetWidth, height: element.offsetHeight }; }, reloadFrame: function domExplorer$domUtilities$reloadFrame(realWindow) { if(!mainBrowser || !realWindow || !mainBrowser.document || !realWindow.document) { RemoteDom.remoteCode.initializePage(); return; } var iframeChain = RemoteDom.dom$messageHandlers.getIFrameChain(mainBrowser.document, realWindow.document); if(iframeChain.length > 0) { var targetElement = iframeChain[0]; var uid = ""; var mappedNode = null; try { uid = RemoteDom.remoteCode.getUidOrNull(targetElement); if(uid) { if(htmlTreeHelpers.mapping[uid] && htmlTreeHelpers.mapping[uid].ele === targetElement) { mappedNode = htmlTreeHelpers.mapping[uid]; } } else { for(uid in htmlTreeHelpers.mapping) { if(htmlTreeHelpers.mapping[uid] && htmlTreeHelpers.mapping[uid].ele === targetElement) { mappedNode = htmlTreeHelpers.mapping[uid]; break; } } } } catch (ex) { if((ex.number & 0xFFFFFFFF) === (0x800A0046 & 0xFFFFFFFF)) { htmlTreeHelpers.deleteMappedNode(uid); RemoteDom.remoteCode.initializePage(); return; } else { throw ex; } } if(!mappedNode) { var targetParent = targetElement.parentNode; mappedNode = null; uid = RemoteDom.remoteCode.getUidOrNull(targetParent); if(uid) { if(htmlTreeHelpers.mapping[uid] && htmlTreeHelpers.mapping[uid].ele === targetParent) { mappedNode = htmlTreeHelpers.mapping[uid]; } } else { for(uid in htmlTreeHelpers.mapping) { if(htmlTreeHelpers.mapping[uid].ele === targetParent) { mappedNode = htmlTreeHelpers.mapping[uid]; break; } } } if(mappedNode) { var root = targetParent.ownerDocument; for(var docIndex = 0; docIndex < RemoteDom.domUtilities.attachedDomModifiedDocs.length; docIndex++) { if(RemoteDom.domUtilities.attachedDomModifiedDocs[docIndex].doc === root) { var domMutationEvent = { type: "DOMNodeInserted", target: targetElement }; RemoteDom.domUtilities.attachedDomModifiedDocs[docIndex].handler(domMutationEvent); break; } } } } } Common.RemoteHelpers.getDefaultView(mainBrowser.document)['__BROWSERTOOLS_DOMEXPLORER_STORED_ELEMENTS'] = new (mainBrowser.document.parentWindow).Array(); }, getRootElementOfNode: function domExplorer$domUtilities$getRootElementOfNode(element) { if(element && element.parentNode) { var currentParent = element.parentNode; while(currentParent.parentNode) { currentParent = currentParent.parentNode; } return currentParent; } else { return element; } }, isWhiteSpaceOnlyTextNode: function domExplorer$domUtilities$isWhiteSpaceOnlyTextNode(element) { function containsOnlyWhiteSpace(element) { var content = Common.RemoteHelpers.getTextContent(element); if(typeof content === "string") { return (/^\s*$/).test(content); } } return (element !== null && element.nodeType === 3 && containsOnlyWhiteSpace(element)); }, getSubsequentNonTextNodeSibling: function domExplorer$domUtilities$getNextNonTextNodeSiblingElement(element, direction) { if(element) { var ele = (direction === RemoteDom.searchUtilities.Direction.next) ? element.nextSibling : element.previousSibling; while(RemoteDom.domUtilities.isWhiteSpaceOnlyTextNode(ele)) { ele = (direction === RemoteDom.searchUtilities.Direction.next) ? ele.nextSibling : ele.previousSibling; } return ele; } return null; }, lastElementInsideIframe: function domExplorer$domUtilities$lastElementInsideIframe(iframe) { var iframeContent = dom.getCrossSiteWindow(Common.RemoteHelpers.getDefaultView(iframe.ownerDocument), iframe.contentWindow); var element; var childElement = iframeContent.document; do { element = childElement; childElement = RemoteDom.searchUtilities.getSubsequentNonWhiteSpacedChild(element, RemoteDom.searchUtilities.Direction.previous); }while(childElement); return element.tagName === "IFRAME" || element.tagName === "FRAME" ? RemoteDom.domUtilities.lastElementInsideIframe(element) : element; }, getSubsequentElementAfterIframe: function domExplorer$domUtilities$getSubsequentElementAfterIframe(parentFrame, currentFrame, searchDirection) { if(parentFrame) { var tags = parentFrame.querySelectorAll("iframe, frame"); for(var i = 0, n = tags.length; i < n; i++) { if(currentFrame === tags[i]) { var ele = RemoteDom.domUtilities.getSubsequentNonTextNodeSibling(currentFrame, searchDirection); if(searchDirection === RemoteDom.searchUtilities.Direction.previous) { if(ele) { if(ele.tagName === "IFRAME" || ele.tagName === "FRAME") { return RemoteDom.domUtilities.lastElementInsideIframe(ele); } else if(ele.childNodes && ele.childNodes.length > 0 && RemoteDom.searchUtilities.getSubsequentNonWhiteSpacedChild(ele, searchDirection)) { return RemoteDom.searchUtilities.getDeepestRightChild(ele); } else { return ele; } } else { return currentFrame.parentNode; } } else { if(ele) { return ele; } else { var element = currentFrame; while(element.parentNode) { var nextElement = RemoteDom.domUtilities.getSubsequentNonTextNodeSibling(element.parentNode, RemoteDom.searchUtilities.Direction.next); if(nextElement) { return nextElement; } else { element = element.parentNode; } } } } } } } return null; }, findParentChainForElement: function domExplorer$domUtilities$findParentChainForElement(currentNode) { var parentChain = []; var staleNodes = false; try { var iframeChain = null; var iframePosition = 0; var startNode = currentNode; while(currentNode) { parentChain.splice(0, 0, currentNode); if(currentNode.parentNode) { currentNode = currentNode.parentNode; } else { if(Common.RemoteHelpers.getDefaultView(currentNode) === Common.RemoteHelpers.getDefaultView(mainBrowser.document)) { break; } else { if(!iframeChain) { iframeChain = RemoteDom.dom$messageHandlers.getIFrameChain(mainBrowser.document, currentNode); } if(iframeChain) { currentNode = iframeChain[iframePosition]; iframePosition++; } else { break; } } } } RemoteDom.domUtilities.expandChain = []; var parentUidChain = [ { uid: "uid0", children: null } ]; var children; var lastNotFoundIndex = -1; for(var i = 1; i < parentChain.length; i++) { var parentElement = parentChain[i]; var found = false; var uid = RemoteDom.remoteCode.getUidOrNull(parentElement); if(uid) { var mappedNode = htmlTreeHelpers.mapping[uid]; if(mappedNode && mappedNode.ele === parentElement) { parentUidChain.push({ uid: uid, children: null }); if(mappedNode.isLimited) { parentUidChain[i].children = mappedNode.childrenNodes; } found = true; } } if(!found) { for(uid in htmlTreeHelpers.mapping) { var mappedNode = htmlTreeHelpers.mapping[uid]; if(mappedNode.ele === parentElement || (mappedNode.isIframeElement && htmlTreeHelpers.getIframeRootForMappedNode(uid) === parentElement)) { parentUidChain.push({ uid: uid, children: null }); if(mappedNode.isLimited) { parentUidChain[i].children = mappedNode.childrenNodes; } found = true; break; } } } if(!found) { if(lastNotFoundIndex === i) { if(startNode.parentNode && (startNode.parentNode.tagName === "STYLE" || startNode.parentNode.tagName === "SCRIPT")) { parentUidChain.push({ uid: "uid-selectchild", children: null }); } break; } lastNotFoundIndex = i; children = htmlTreeHelpers.getChildrenForMappedNode(parentUidChain[i - 1].uid, false, true); parentUidChain[i - 1].children = children; i--; } else { children = htmlTreeHelpers.getChildrenForMappedNode(parentUidChain[i - 1].uid, false, true); parentUidChain[i - 1].children = children; } } } catch (ex) { if((ex.number & 0xFFFFFFFF) === (0x800A0046 & 0xFFFFFFFF)) { staleNodes = true; } else { throw ex; } } if(staleNodes) { RemoteDom.remoteCode.initializePage(); } return parentUidChain; } }; RemoteDom.searchUtilities = { previousDFSElement: null, iframeStack: null, skipTraversal: false, querySelectorResults: [], Direction: { next: 1, previous: -1 }, getSubsequentNonWhiteSpacedChild: function domExplorer$searchUtilities$getSubsequentNonWhiteSpacedChild(element, searchDirection) { if(element && element.childNodes && element.childNodes.length > 0) { if(element.childNodes.length === 1) { var child = element.childNodes[0]; if(element.tagName === "STYLE" && element.styleSheet) { return child; } else if(!child.tagName) { var textContent = Common.RemoteHelpers.getTextContent(child); if(textContent && !String.prototype.match.call(textContent, /\n/g) && textContent.length < htmlTreeHelpers.maxInlineLength) { return null; } } } if(searchDirection === RemoteDom.searchUtilities.Direction.next) { for(var index = 0; index < element.childNodes.length; index++) { if(!RemoteDom.domUtilities.isWhiteSpaceOnlyTextNode(element.childNodes[index])) { return element.childNodes[index]; } } } else { for(index = element.childNodes.length - 1; index >= 0; index--) { if(!RemoteDom.domUtilities.isWhiteSpaceOnlyTextNode(element.childNodes[index])) { return element.childNodes[index]; } } } } return null; }, getDeepestRightChild: function domExplorer$searchUtilities$getDeepestRightChild(element) { var childElement = element; while(childElement) { element = childElement; childElement = RemoteDom.searchUtilities.getSubsequentNonWhiteSpacedChild(element, RemoteDom.searchUtilities.Direction.previous); } if(element.tagName === "IFRAME" || element.tagName === "FRAME") { var child = RemoteDom.domUtilities.lastElementInsideIframe(element); RemoteDom.searchUtilities.initializeIframeStack(child, RemoteDom.searchUtilities.Direction.previous); return child; } return element; }, obtainNextDFSElement: function domExplorer$searchUtilities$obtainNextDFSElement(element, checkChild) { if(element) { if(element.tagName === "IFRAME" || element.tagName === "FRAME") { var iframe = dom.getCrossSiteWindow(Common.RemoteHelpers.getDefaultView(element.ownerDocument), element.contentWindow); RemoteDom.searchUtilities.iframeStack.push(RemoteDom.domUtilities.getSubsequentElementAfterIframe(RemoteDom.domUtilities.getRootElementOfNode(element), element, RemoteDom.searchUtilities.Direction.next)); return iframe.document; } var firstChild = RemoteDom.searchUtilities.getSubsequentNonWhiteSpacedChild(element, RemoteDom.searchUtilities.Direction.next); if(checkChild && firstChild) { return firstChild; } else { var nextSibling = RemoteDom.domUtilities.getSubsequentNonTextNodeSibling(element, RemoteDom.searchUtilities.Direction.next); if(nextSibling) { return nextSibling; } else { while(element.parentNode) { var nextElement = RemoteDom.domUtilities.getSubsequentNonTextNodeSibling(element.parentNode, RemoteDom.searchUtilities.Direction.next); if(nextElement) { return nextElement; } else { element = element.parentNode; } } } } } return null; }, obtainPreviousDFSElement: function domExplorer$searchUtilities$obtainPreviousDFSElement(element, checkChild) { function getSubsequentDFSNode(element) { RemoteDom.searchUtilities.previousDFSElement = element; var prevSibling = RemoteDom.domUtilities.getSubsequentNonTextNodeSibling(element, RemoteDom.searchUtilities.Direction.previous); if(prevSibling) { var deepestChild = RemoteDom.searchUtilities.getDeepestRightChild(prevSibling); return deepestChild ? deepestChild : element.parentNode; } return element.parentNode; } if(element.tagName === "IFRAME" || element.tagName === "FRAME") { RemoteDom.searchUtilities.previousDFSElement = element; var previousElement = RemoteDom.domUtilities.getSubsequentElementAfterIframe(RemoteDom.domUtilities.getRootElementOfNode(element), element, RemoteDom.searchUtilities.Direction.previous); RemoteDom.searchUtilities.initializeIframeStack(previousElement, RemoteDom.searchUtilities.Direction.previous); return previousElement; } var firstChild = RemoteDom.searchUtilities.getSubsequentNonWhiteSpacedChild(element, RemoteDom.searchUtilities.Direction.next); if(checkChild && firstChild) { if(RemoteDom.searchUtilities.previousDFSElement === firstChild) { return getSubsequentDFSNode(element); } else if(firstChild && (firstChild.tagName === "IFRAME" || firstChild.tagName === "FRAME")) { var childIframe = dom.getCrossSiteWindow(Common.RemoteHelpers.getDefaultView(firstChild.ownerDocument), firstChild.contentWindow); if(RemoteDom.searchUtilities.previousDFSElement === childIframe.document) { return getSubsequentDFSNode(element); } } else { return RemoteDom.searchUtilities.getDeepestRightChild(element); } } else { return getSubsequentDFSNode(element); } }, initializeIframeStack: function domExplorer$searchUtilities$initializeIframeStack(startElement, searchDirection) { var iframeChain = RemoteDom.dom$messageHandlers.getIFrameChain(mainBrowser.document, RemoteDom.domUtilities.getRootElementOfNode(startElement)); RemoteDom.searchUtilities.iframeStack = []; RemoteDom.searchUtilities.iframeStack.push(mainBrowser.document); if(iframeChain && iframeChain.length > 0) { for(var index = iframeChain.length; index > 0; index--) { var parentDocument = mainBrowser.document; if(index !== iframeChain.length) { var parentWindow = Common.RemoteHelpers.getDefaultView(iframeChain[index].ownerDocument); parentDocument = dom.getCrossSiteWindow(parentWindow, iframeChain[index].contentWindow).document; } if(searchDirection === RemoteDom.searchUtilities.Direction.next) { RemoteDom.searchUtilities.iframeStack.push(RemoteDom.domUtilities.getSubsequentElementAfterIframe(parentDocument, iframeChain[index - 1], RemoteDom.searchUtilities.Direction.next)); } else { RemoteDom.searchUtilities.iframeStack.push(iframeChain[index - 1]); } } } if(startElement.parentNode && startElement !== mainBrowser.document.documentElement) { if(startElement.children && startElement.children.length > 0) { RemoteDom.searchUtilities.previousDFSElement = startElement.children[0]; } } }, listContainsElement: function domExplorer$searchUtilities$listContainsElement(elementList, element) { if(elementList && elementList.length > 0) { for(var index = 0; index < elementList.length; index++) { if(element === elementList[index]) { return index; } } } return -1; }, obtainSubsequentDFSElement: function domExplorer$searchUtilities$obtainSubsequentDFSElement(element, searchDirection, startElement) { var checkChild = (element === startElement && element !== mainBrowser.document && searchDirection === RemoteDom.searchUtilities.Direction.previous) ? false : true; if(searchDirection === RemoteDom.searchUtilities.Direction.next) { return RemoteDom.searchUtilities.obtainNextDFSElement(element, checkChild); } else { return RemoteDom.searchUtilities.obtainPreviousDFSElement(element, checkChild); } }, popOutOfIframe: function domExplorer$searchUtilities$popOutOfIframe() { var element = RemoteDom.searchUtilities.iframeStack.pop(); if(RemoteDom.searchUtilities.iframeStack.length === 0) { RemoteDom.searchUtilities.iframeStack.push(mainBrowser.document); RemoteDom.searchUtilities.previousDFSElement = null; } return element; }, queryFrameUsingQuerySelector: function queryframeUsingQuerySelector(element, userQuerySelector) { var ownerDocument = mainBrowser.document['__unitTest'] ? mainBrowser.document : element.ownerDocument || element; for(var resultIndex = 0; resultIndex < RemoteDom.searchUtilities.querySelectorResults.length; resultIndex++) { if(RemoteDom.searchUtilities.querySelectorResults[resultIndex].doc === ownerDocument) { return RemoteDom.searchUtilities.querySelectorResults[resultIndex].result; } } var resultsArray = []; try { if(ownerDocument.querySelectorAll) { var results = ownerDocument.querySelectorAll(userQuerySelector); if(results && results.length > 0) { for(var index = 0; index < results.length; index++) { resultsArray.push(results[index]); } } RemoteDom.searchUtilities.querySelectorResults.push({ doc: ownerDocument, result: resultsArray }); } } catch (ex) { Common.RemoteHelpers.encounteredException(ex); } return resultsArray; }, getSearchResult: function domExplorer$searchUtilities$getSearchResult(startElement, userTextTerm, searchDirection, startFromCurrentElement) { RemoteDom.searchUtilities.querySelectorResults = []; RemoteDom.searchUtilities.initializeIframeStack(startElement, searchDirection); var element = startElement; var docTraversalComplete = false; var searchProgress = false; while(!docTraversalComplete) { if(!startFromCurrentElement) { searchProgress = true; element = RemoteDom.searchUtilities.obtainSubsequentDFSElement(element, searchDirection, startElement); } else { startFromCurrentElement = false; } if(element) { var results = RemoteDom.searchUtilities.queryFrameUsingQuerySelector(element, userTextTerm); if(results && RemoteDom.searchUtilities.listContainsElement(results, element) !== -1) { return element; } var stringifiedNode = htmlTreeHelpers.createStringForElement(element); if(stringifiedNode && stringifiedNode.toLowerCase().indexOf(userTextTerm.toLowerCase()) !== -1) { return element; } } if(element === startElement && searchProgress) { docTraversalComplete = true; } while(!element) { element = RemoteDom.searchUtilities.popOutOfIframe(); startFromCurrentElement = true; } } return null; } }; RemoteDom.dom$messageHandlers = { initializeHost: function domExplorer$messageHandlers$initializeHost(hostId) { RemoteDom.remoteCode.hostId = hostId; }, startSingleEdit: function domExplorer$messageHandlers$startSingleEdit() { RemoteDom.remoteCode.editStack.startSingleEdit(); }, endSingleEdit: function domExplorer$messageHandlers$endSingleEdit() { RemoteDom.remoteCode.editStack.endSingleEdit(); }, enableEditChaining: function domExplorer$messageHandlers$enableEditChaining() { RemoteDom.remoteCode.editStack.enableChaining(); }, disableEditChaining: function domExplorer$messageHandlers$disableEditChaining() { RemoteDom.remoteCode.editStack.disableChaining(); }, undoLastEdit: function domExplorer$messageHandlers$performUndo() { return RemoteDom.remoteCode.editStack.undo(); }, performNextEdit: function domExplorer$messageHandlers$performEdit() { return RemoteDom.remoteCode.editStack.performNextEdit(); }, setTestEditCallbacks: function domExplorer$messageHandlers$performEdit(testEditCallback, testUndoCallback) { RemoteDom.remoteCode.editStack.setTestEditCallbacks(testEditCallback, testUndoCallback); }, somethingToUndo: function domExplorer$messageHandlers$somethingToUndo() { return RemoteDom.remoteCode.editStack.somethingToUndo(); }, somethingToDo: function domExplorer$messageHandlers$somethingToDo() { return RemoteDom.remoteCode.editStack.somethingToDo(); }, getRootElement: function domExplorer$messageHandlers$getRootElement() { RemoteDom.domUtilities.reset(); if((typeof mainBrowser.document) === "object") { var readyState = mainBrowser.document.readyState; if(readyState === "interactive" || readyState === "complete") { var rootElement = mainBrowser.document; return htmlTreeHelpers.createMappedNode(rootElement, false, false); } else if(RemoteDom.remoteCode.scriptExecutionSupported) { var defaultView = Common.RemoteHelpers.getDefaultView(mainBrowser.document); Common.RemoteHelpers.addSafeListener(defaultView, mainBrowser.document, "DOMContentLoaded", RemoteDom.remoteCode.initializePage, true); } } }, getChildren: function domExplorer$messageHandlers$getChildren(uid, showAll, callback) { var ret = htmlTreeHelpers.getChildrenForMappedNode(uid, false, showAll); if(!ret) { RemoteDom.remoteCode.onBeforeScriptExecute(Common.RemoteHelpers.getDefaultView(mainBrowser.document)); } else { RemoteDom.domUtilities.getChunker().sendChildren(htmlTreeHelpers.mapping[uid], ret, showAll, callback); } }, attachDOMContentLoadedEvent: function domExplorer$messageHandlers$attachDOMContentLoadedEvent(uid, callback) { if(!mainBrowser.document.addEventListener || !RemoteDom.remoteCode.scriptExecutionSupported) { return; } var defaultView = Common.RemoteHelpers.getDefaultView(mainBrowser.document); Common.RemoteHelpers.addSafeListener(defaultView, mainBrowser.document, "DOMContentLoaded", function () { var newChildren = RemoteDom.dom$messageHandlers.getChildren(uid); callback({ uid: uid, children: newChildren }); callback = null; }, true); }, removeChildMappings: function domExplorer$messageHandlers$removeChildMappings(uid) { htmlTreeHelpers.deleteMappedNode(uid, true); }, editAttribute: function domExplorer$messageHandlers$editAttribute(uid, name, value) { var mappedNode = htmlTreeHelpers.mapping[uid]; if(!mappedNode || !htmlTreeHelpers.isElementAccessible(mappedNode.ele)) { return; } var edit = new F12.RemoteDom.EditAttribute(styleUtilities, htmlTreeHelpers, mappedNode.ele, name, value); return RemoteDom.remoteCode.editStack.performEdit(edit); }, removeAttribute: function domExplorer$messageHandlers$removeAttribute(uid, name) { var mappedNode = htmlTreeHelpers.mapping[uid]; if(!mappedNode || !htmlTreeHelpers.isElementAccessible(mappedNode.ele)) { return; } var edit = new F12.RemoteDom.RemoveAttribute(styleUtilities, htmlTreeHelpers, uid, name); return RemoteDom.remoteCode.editStack.performEdit(edit); }, editText: function domExplorer$messageHandlers$editText(uid, newText) { var mappedNode = htmlTreeHelpers.mapping[uid]; if(!mappedNode || !htmlTreeHelpers.isElementAccessible(mappedNode.ele)) { return; } var element = mappedNode.ele; if(Common.RemoteHelpers.getTextContent(element) !== newText) { var edit = new F12.RemoteDom.EditText(element, newText); RemoteDom.remoteCode.editStack.performEdit(edit); } return false; }, hoverItem: function domExplorer$messageHandlers$hoverItem(uid) { var mappedNode = htmlTreeHelpers.mapping[uid]; if(!mappedNode || !htmlTreeHelpers.isElementAccessible(mappedNode.ele)) { RemoteDom.domUtilities.currentHoverItemUid = null; RemoteDom.domUtilities.removeHighlight(); return; } RemoteDom.domUtilities.currentHoverItemUid = uid; var element = mappedNode.ele; RemoteDom.domUtilities.highlightElement(element, RemoteDom.domUtilities.basicHighlightColor); }, hideHoverItem: function domExplorer$messageHandlers$hideHoverItem() { RemoteDom.domUtilities.removeHighlight(); }, attachMediaQueryEvents: function domExplorer$messageHandlers$attachMediaQueryEvents(mediaChangeCallback) { RemoteDom.domUtilities.mediaStyleChangeCallback = mediaChangeCallback; if(Common.RemoteHelpers.getDocumentMode() <= 9) { return; } var defaultView = Common.RemoteHelpers.getDefaultView(mainBrowser.document); if(!defaultView) { return; } if(RemoteDom.remoteCode.scriptExecutionSupported) { var mqlListener = remoteHelpers.createSafeFunction(defaultView, function (mql) { styleUtilities.stylechange(); }); var numStyleSheets = mainBrowser.document.styleSheets.length; for(var i = 0; i < numStyleSheets; i++) { var styleSheet = mainBrowser.document.styleSheets[i]; if(styleSheet.media) { var mediaQueryList = defaultView.matchMedia(styleSheet.media.mediaText); mediaQueryList.addListener(mqlListener); } var cssStyleSheet = styleSheet; try { var numRules = cssStyleSheet.cssRules.length; for(var j = 0; j < numRules; j++) { var rule = (styleSheet).cssRules[j]; if(rule.type === defaultView.CSSRule.MEDIA_RULE || rule.type === defaultView.CSSRule.IMPORT_RULE) { var importRule = rule; mediaQueryList = defaultView.matchMedia(importRule.media.mediaText); mediaQueryList.addListener(mqlListener); } } } catch (ex) { Common.RemoteHelpers.encounteredException(ex); } } } }, selectElementByClick: function domExplorer$messageHandlers$selectElementByClick(selectCallback) { if(RemoteDom.domUtilities.isSelectingElement || !mainBrowser.document.body) { return; } RemoteDom.domUtilities.isSelectingElement = true; RemoteDom.domUtilities.selectElementInLiveDomEnable(); RemoteDom.domUtilities.selectElementClickCallback = selectCallback; }, cancelSelectElementByClick: function domExplorer$messageHandlers$cancelSelectElementByClick() { if(RemoteDom.domUtilities.isSelectingElement) { RemoteDom.domUtilities.removeHighlight(); RemoteDom.domUtilities.selectElementInLiveDomDisable(); RemoteDom.domUtilities.isSelectingElement = false; RemoteDom.domUtilities.selectElementClickCallback = null; } }, getIFrameChain: function domExplorer$messageHandlers$getIFrameChain(rootDocument, findDocument) { var tags = rootDocument.querySelectorAll("iframe, frame"); for(var i = 0, n = tags.length; i < n; i++) { var iframe = dom.getCrossSiteWindow(Common.RemoteHelpers.getDefaultView(rootDocument), tags[i].contentWindow); if(iframe.document === findDocument) { return [ tags[i] ]; } var chain = RemoteDom.dom$messageHandlers.getIFrameChain(iframe.document, findDocument); if(chain && chain.length > 0) { chain.push(tags[i]); return chain; } } return []; }, getParentChainForSelectedElement: function domExplorer$messageHandlers$getParentChainForSelectedElement() { return RemoteDom.domUtilities.findParentChainForElement(RemoteDom.domUtilities.selectElementLastSelected); }, inspectElement: function domExplorer$messageHandlers$inspectElement(element) { if(!element || !htmlTreeHelpers.isElementAccessible(element)) { return; } RemoteDom.dom$messageHandlers.selectElementFromConsole(element); RemoteDom.remoteCode.vsFocusCallback(true); }, inspectElementById: function domExplorer$messageHandlers$inspectElementById(inspectElementId) { try { var element = dom.getElementByUniqueId(inspectElementId); RemoteDom.dom$messageHandlers.inspectElement(element); } catch (ex) { } }, findTerm: function domExplorer$messageHandlers$findTerm(currentSelectedUID, searchTerm, searchDirection, isQuerySelectorSearch) { RemoteDom.searchUtilities.previousDFSElement = null; RemoteDom.searchUtilities.iframeStack = null; var startFromCurrent = false; var element = null; var mappedNode; var matches = currentSelectedUID.match(/^(style|script)/); if(matches) { mappedNode = htmlTreeHelpers.mapping[currentSelectedUID.replace(matches[0], "")]; if(!mappedNode || !htmlTreeHelpers.isElementAccessible(mappedNode.ele)) { element = mainBrowser.document; } else { if(searchDirection === RemoteDom.searchUtilities.Direction.next) { element = RemoteDom.searchUtilities.obtainNextDFSElement(mappedNode.ele, false); startFromCurrent = true; if(!element) { RemoteDom.searchUtilities.initializeIframeStack(mappedNode.ele, RemoteDom.searchUtilities.Direction.next); if(RemoteDom.searchUtilities.iframeStack && RemoteDom.searchUtilities.iframeStack.length) { element = RemoteDom.searchUtilities.iframeStack[RemoteDom.searchUtilities.iframeStack.length - 1]; RemoteDom.searchUtilities.iframeStack = null; } else { element = mainBrowser.document; } } } else { element = mappedNode.ele; } } } else { mappedNode = htmlTreeHelpers.mapping[currentSelectedUID]; if(!mappedNode || !htmlTreeHelpers.isElementAccessible(mappedNode.ele)) { element = mainBrowser.document; } else { element = mappedNode.ele; } } var result = RemoteDom.searchUtilities.getSearchResult(element, searchTerm, searchDirection, startFromCurrent); return result ? RemoteDom.domUtilities.findParentChainForElement(result) : []; }, getComputedBox: function domExplorer$messageHandlers$getComputedBox(uid) { var mappedNode = htmlTreeHelpers.mapping[uid]; if(!mappedNode || !htmlTreeHelpers.isElementAccessible(mappedNode.ele)) { return; } var element = mappedNode.ele; if(!element.tagName) { return; } var computedBox = { offsetTop: 0, offsetLeft: 0, clientWidth: 0, clientHeight: 0 }; var win = Common.RemoteHelpers.getDefaultView(mainBrowser.document); var compStyle = Common.RemoteHelpers.getComputedStyle(win, element); var i; var styleProperties = styleUtilities.styleProperties; for(i = 0; i < styleProperties.length; i++) { computedBox[styleProperties[i]] = compStyle[styleProperties[i]]; } var elementProperties = styleUtilities.elementProperties; for(i = 0; i < elementProperties.length; i++) { computedBox[elementProperties[i]] = element[elementProperties[i]]; } if(Common.RemoteHelpers.getDocumentMode() >= 9 && typeof computedBox.offsetTop === 'undefined' && typeof computedBox.offsetLeft == 'undefined') { if(element && element.getBoundingClientRect) { var rect = element.getBoundingClientRect(); if(rect.top !== undefined && rect.left !== undefined && rect.width !== undefined && rect.height !== undefined) { var body = mainBrowser.document.body; var docElem = mainBrowser.document.documentElement; var scrollTop = win.pageYOffset || docElem.scrollTop || body.scrollTop; var scrollLeft = win.pageXOffset || docElem.scrollLeft || body.scrollLeft; var clientTop = docElem.clientTop || body.clientTop || 0; var clientLeft = docElem.clientLeft || body.clientLeft || 0; computedBox.offsetTop = Math.round(rect.top + scrollTop - clientTop); computedBox.offsetLeft = Math.round(rect.left + scrollLeft - clientLeft); computedBox.clientWidth = rect.width; computedBox.clientHeight = rect.height; } } } for(var prop in computedBox) { if(computedBox[prop]) { computedBox[prop] = styleUtilities.standardizeLayoutUnits(computedBox[prop]); } } return computedBox; }, getComputedBoxValueByElement: function domExplorer$messageHandlers$getComputedBoxValueByElement(element, property) { var value; var i; var styleProperties = styleUtilities.styleProperties; for(i = 0; i < styleProperties.length; i++) { if(styleProperties[i] === property) { var win = Common.RemoteHelpers.getDefaultView(mainBrowser.document); var compStyle = Common.RemoteHelpers.getComputedStyle(win, element); value = compStyle[property]; break; } } var elementProperties = styleUtilities.elementProperties; for(i = 0; i < elementProperties.length; i++) { if(elementProperties[i] === property) { value = element[property]; break; } } return styleUtilities.standardizeLayoutUnits(value); }, addAttrModifiedEvent: function domExplorer$messageHandlers$addAttrModifiedEvent(uid) { var nodeToAddCallbackTo = htmlTreeHelpers.mapping[uid]; if(!nodeToAddCallbackTo || !htmlTreeHelpers.isElementAccessible(nodeToAddCallbackTo.ele)) { return false; } var defaultView = Common.RemoteHelpers.getDefaultView(nodeToAddCallbackTo.ele.ownerDocument); if(nodeToAddCallbackTo.pendingAttrModified) { RemoteDom.domUtilities.getMutationManager().fireAttributeModified(nodeToAddCallbackTo); } if(htmlTreeHelpers.hasSpecialValueAttribute(nodeToAddCallbackTo.ele) && nodeToAddCallbackTo.ele.attachEvent && RemoteDom.remoteCode.scriptExecutionSupported) { if(nodeToAddCallbackTo.onValueModified) { Common.RemoteHelpers.removeListener(nodeToAddCallbackTo.ele, "propertychange", nodeToAddCallbackTo.onValueModified); } var onPropertyChanged = function (e) { if(e.propertyName === "value") { RemoteDom.domUtilities.getMutationManager().fireAttributeModified(e.srcElement, "value", e.srcElement.value, 0); } }; nodeToAddCallbackTo.onValueModified = Common.RemoteHelpers.addSafeListener(defaultView, nodeToAddCallbackTo.ele, "propertychange", onPropertyChanged); } if(!htmlTreeHelpers.isElementAccessible(nodeToAddCallbackTo.ele.ownerDocument)) { return false; } var root = nodeToAddCallbackTo.ele.ownerDocument; for(var docIndex = 0; docIndex < RemoteDom.domUtilities.attachedAttrModifiedDocs.length; docIndex++) { var docInfo = RemoteDom.domUtilities.attachedAttrModifiedDocs[docIndex]; if(docInfo.doc === root) { nodeToAddCallbackTo.onAttributeModified = docInfo.callback; return false; } } if(RemoteDom.remoteCode.scriptExecutionSupported) { var onModified = function (e) { var parentElement = e.target.parentNode; if(!parentElement) { return; } RemoteDom.domUtilities.getMutationManager().fireAttributeModified(e.target, e.attrName, e.newValue, e.attrChange, e.attrName === "style" ? styleUtilities.styleAttrModified.bind(styleUtilities) : null); }; var onModifiedSafe = Common.RemoteHelpers.addSafeListener(defaultView, root, "DOMAttrModified", onModified, true); RemoteDom.domUtilities.attachedAttrModifiedDocs.push({ doc: root, handler: onModifiedSafe }); } return true; }, setupTreeModifiedEvent: function domExplorer$messageHandlers$setupTreeModifiedEvent(callback) { RemoteDom.domUtilities.getMutationManager().treeModifiedCallback = callback; }, setupAttributeModifiedEvent: function domExplorer$messageHandlers$setupAttributeModifiedEvent(callback) { RemoteDom.domUtilities.getMutationManager().attributeModifiedCallback = callback; }, addTreeModifiedEvent: function domExplorer$messageHandlers$addTreeModifiedEvent(uid) { var nodeToAddCallbackTo = htmlTreeHelpers.mapping[uid]; if(!nodeToAddCallbackTo || !htmlTreeHelpers.isElementAccessible(nodeToAddCallbackTo.ele)) { return false; } nodeToAddCallbackTo.listenForTreeModified = true; if(!htmlTreeHelpers.isElementAccessible(nodeToAddCallbackTo.ele.ownerDocument)) { return false; } var root = nodeToAddCallbackTo.ele.ownerDocument; for(var docIndex = 0; docIndex < RemoteDom.domUtilities.attachedDomModifiedDocs.length; docIndex++) { var docInfo = RemoteDom.domUtilities.attachedDomModifiedDocs[docIndex]; if(docInfo.doc === root) { return false; } } var deferModifiedList = []; var deferModifiedTimeoutFlag = false; var onModified = function domExplorer$messageHandlers$addTreeModifiedEvent$onModified(e) { function addFirstChild(mappedNode, mappedChild) { mappedNode.childrenNodes = [ mappedChild ]; var mapping = htmlTreeHelpers.mapping; var entry = mapping[mappedChild.uid]; if(entry && entry.ele && entry.ele.nodeName === "#text") { var textContent = Common.RemoteHelpers.getTextContent(entry.ele); if(!String.prototype.match.call(textContent, /\n/g) && textContent.length < htmlTreeHelpers.maxInlineLength) { mappedNode.mapped.hasChildren = false; mappedNode.mapped.text = textContent; } else { mappedNode.mapped.hasChildren = true; } } } function findMappedNodeByElement(element) { var uidString = RemoteDom.remoteCode.getUidOrNull(element); return uidString && htmlTreeHelpers.mapping[uidString]; } function removeElementFromMappedNode(mappedNode, element) { if(mappedNode.mapped && mappedNode.mapped.hasChildren && !mappedNode.childrenNodes) { mappedNode.childrenNodes = [ { uid: "expandMe" } ]; } if(mappedNode.childrenNodes) { if(mappedNode.childrenNodes.length === 1 && mappedNode.childrenNodes[0].uid === "expandMe") { if(mappedNode.ele.childNodes.length === 0 || mappedNode.ele.children && mappedNode.ele.children.length === 1 && (mappedNode.ele.children[0]).uniqueID === (element).uniqueID) { mappedNode.childrenNodes = []; } } else { var mapping = htmlTreeHelpers.mapping; for(var i = 0; i < mappedNode.childrenNodes.length; i++) { var childUid = mappedNode.childrenNodes[i].uid; var childNode = mapping[childUid]; if(childNode && mapping[childUid].ele === element) { htmlTreeHelpers.deleteMappedNode(childUid); mappedNode.childrenNodes.splice(i, 1); break; } } } mappedNode.mapped.hasChildren = (mappedNode.childrenNodes && mappedNode.childrenNodes.length > 0); } else if(element.nodeName === "#text") { delete mappedNode.mapped.text; } } function synchronizeMappedNodeChildren(mappedNode) { var e = mappedNode.ele; var children = e.childNodes; var i; var end; var mappedNodeChildrenMap = { }; if(mappedNode.childrenNodes) { for(i = 0 , end = mappedNode.childrenNodes.length; i < end; i++) { var uid = mappedNode.childrenNodes[i].uid; mappedNodeChildrenMap[uid] = true; } } var newChildren = []; for(i = 0 , end = children.length; i < end; i++) { var child = children[i]; var childUid = RemoteDom.remoteCode.getUidOrNull(child); var found = childUid && mappedNodeChildrenMap[childUid]; if(!found) { newChildren.push(child); } } for(i = 0 , end = newChildren.length; i < end; i++) { if(mappedNode.isExpanded) { addElementToMappedNode(mappedNode, newChildren[i]); } else { addElementToNonExpandedMappedNode(mappedNode, newChildren[i]); } } return newChildren.length > 0; } function synchronizeMappedNodeChildrenFn() { deferModifiedTimeoutFlag = false; for(var i = 0, end = deferModifiedList.length; i < end; i++) { var mappedNode = deferModifiedList[i].mappedNode; if(synchronizeMappedNodeChildren(mappedNode)) { var uid = deferModifiedList[i].uid; RemoteDom.domUtilities.getMutationManager().fireTreeModified(mappedNode, uid); } } deferModifiedList = []; } function deferSynchronizeMappedNodeChildren(mappedNode, uid) { deferModifiedList.push({ mappedNode: mappedNode, uid: uid }); if(!deferModifiedTimeoutFlag) { try { deferModifiedTimeoutFlag = true; diagnostics.setTimeout(synchronizeMappedNodeChildrenFn, 0); } catch (ex) { Common.RemoteHelpers.encounteredException(ex); } } } function removeMappedNodeAndDescendants(node) { if(node.hasChildNodes) { for(var i = 0; i < node.childNodes.length; i++) { var childNode = node.childNodes[i]; removeMappedNodeAndDescendants(childNode); } } var uid = RemoteDom.remoteCode.getUidOrNull(node); if(uid) { var map = htmlTreeHelpers.mapping; delete map[uid]; } } function addElementToMappedNode(mappedNode, element) { var mappedChild = htmlTreeHelpers.createMappedNode(element, false); if(mappedChild) { if(!mappedNode.childrenNodes || mappedNode.childrenNodes.length === 0) { addFirstChild(mappedNode, mappedChild); } else { var found = false; var existingChildren = mappedNode.ele.childNodes; var insertIndex = 0; for(var nodeIndex = 0; nodeIndex < existingChildren.length; nodeIndex++ , insertIndex++) { var existingChild = existingChildren[nodeIndex]; if(existingChild === element) { mappedNode.childrenNodes.splice(insertIndex, 0, mappedChild); found = true; break; } else if(existingChild.nodeName === "#text" && (typeof Common.RemoteHelpers.getTextContent(existingChild) === "string") && /^\s*$/.test(Common.RemoteHelpers.getTextContent(existingChild))) { insertIndex--; } } if(!found) { mappedNode.childrenNodes.push(mappedChild); } } } } function addElementToNonExpandedMappedNode(mappedNode, element) { var mappedChild = htmlTreeHelpers.createMappedNode(element, false); if(mappedChild && (!mappedNode.childrenNodes || mappedNode.childrenNodes.length === 0) && !mappedNode.mapped.hasChildren) { addFirstChild(mappedNode, mappedChild); } else { mappedNode.mapped.hasChildren = true; mappedNode.childrenNodes = [ { uid: "expandMe" } ]; } } function removeTextElementIfAlreadyExistsInMapping(element) { if(!element) { return; } if(element.nodeName !== '#text') { return; } var mappedNode = findMappedNodeByElement(element); var parentUid = mappedNode && mappedNode.mapped && mappedNode.mapped.parentUid; if(!parentUid) { return; } var parentMappedNode = htmlTreeHelpers.mapping[parentUid]; if(!parentMappedNode) { return; } removeElementFromMappedNode(parentMappedNode, element); RemoteDom.domUtilities.getMutationManager().fireTreeModified(parentMappedNode, parentUid); } function workaroundReconciliation(element) { if(!element || !element.childNodes || element.childNodes.length !== 1 || element.firstChild.nodeType !== element.firstChild.TEXT_NODE) { return; } var mappedNode = findMappedNodeByElement(element); if(!mappedNode.childrenNodes) { return; } var children = mappedNode.childrenNodes.slice(0); for(var i = 0, end = children.length; i < end; i++) { var childUid = children[i].uid; if(typeof childUid !== "string" || !childUid) { continue; } var childMappedNode = htmlTreeHelpers.mapping[childUid]; if(childMappedNode && childMappedNode.ele !== element.firstChild) { removeElementFromMappedNode(mappedNode, childMappedNode.ele); } } } var element = e.target; if(!element) { return; } var parentElement = e.target.parentNode; if(!parentElement) { var uid = RemoteDom.remoteCode.getUidOrNull(element); if(uid && htmlTreeHelpers.mapping[uid]) { htmlTreeHelpers.deleteMappedNode(uid); } return; } var parentMappedNode = findMappedNodeByElement(parentElement); if(parentMappedNode) { var parentUid = RemoteDom.remoteCode.getUidOrNull(parentElement); if(e.type === "DOMNodeInserted" || e.type === "DOMCharacterDataModified") { if(e.type === "DOMCharacterDataModified") { workaroundReconciliation(e.target.parentNode); } if(e.target.nodeName === '#text') { removeTextElementIfAlreadyExistsInMapping(e.target); } if(parentMappedNode.isExpanded) { addElementToMappedNode(parentMappedNode, element); } else { addElementToNonExpandedMappedNode(parentMappedNode, element); } } else if(e.type === "DOMNodeRemoved") { removeElementFromMappedNode(parentMappedNode, element); removeMappedNodeAndDescendants(element); deferSynchronizeMappedNodeChildren(parentMappedNode, parentUid); } RemoteDom.domUtilities.getMutationManager().fireTreeModified(parentMappedNode, parentUid); } }; var onUnload = function domExplorer$messageHandlers$addTreeModifiedEvent$onUnload(e) { RemoteDom.remoteCode.editStack.reset(); var target = Common.RemoteHelpers.getEventTarget(e); if(!target) { return; } var iframeChain = RemoteDom.dom$messageHandlers.getIFrameChain(mainBrowser.document, target.document); if(iframeChain.length > 0) { var targetElement = iframeChain[0]; var mappedNode = null; var uid = RemoteDom.remoteCode.getUidOrNull(targetElement); if(uid) { if(htmlTreeHelpers.mapping[uid] && htmlTreeHelpers.mapping[uid].ele === targetElement) { mappedNode = htmlTreeHelpers.mapping[uid]; } } else { for(uid in htmlTreeHelpers.mapping) { if(htmlTreeHelpers.mapping[uid].ele === targetElement) { mappedNode = htmlTreeHelpers.mapping[uid]; break; } } } if(mappedNode) { var removeEvent = { type: "DOMNodeRemoved", target: mappedNode.ele }; onModified(removeEvent); } } }; if(RemoteDom.remoteCode.scriptExecutionSupported) { var root = nodeToAddCallbackTo.ele.ownerDocument; var defaultView = Common.RemoteHelpers.getDefaultView(root); var onModifiedSafe = Common.RemoteHelpers.addSafeListener(defaultView, root, "DOMNodeInserted", onModified, true); Common.RemoteHelpers.addListener(root, "DOMNodeRemoved", onModifiedSafe, true); Common.RemoteHelpers.addListener(root, "DOMCharacterDataModified", onModifiedSafe, true); if(!RemoteDom.remoteCode.unloadSafe) { RemoteDom.remoteCode.unloadSafe = Common.RemoteHelpers.addSafeListener(defaultView, defaultView, "unload", onUnload, true); } RemoteDom.domUtilities.attachedDomModifiedDocs.push({ doc: root, handler: onModifiedSafe }); } return true; }, getElementUid: function domExplorer$messageHandlers$getElementUid(element) { if(element) { var uid = element['uniqueID']; if(uid && htmlTreeHelpers.mapping[uid]) { return uid; } uid = element['bpt-uid']; if(uid && htmlTreeHelpers.mapping[uid]) { return uid; } } return null; }, getWinningProperty: function domExplorer$messageHandlers$getWinningRule(propertyName) { var mappedProperty = styleUtilities.getWinningProperty(propertyName); return mappedProperty ? mappedProperty.appliedProperty.uid : ""; }, getCssClassesUsedInCurrentDocument: function domExplorer$messageHandlers$getCssClassesUsedInCurrentDocument() { return F12.DomExplorer.CssInformationExtractor.getCssClassesUsedInCurrentDocument(mainBrowser.document); }, getComputedStyles: function domExplorer$messageHandlers$getComputedStyles(uid) { var mappedNode = htmlTreeHelpers.mapping[uid]; if(!mappedNode || !htmlTreeHelpers.isElementAccessible(mappedNode.ele)) { return; } if(mappedNode.parentUid) { mappedNode = htmlTreeHelpers.mapping[mappedNode.parentUid]; if(!mappedNode) { return; } } var element = mappedNode.ele; var computedStyles = styleUtilities.getComputedStyle(element); return [ computedStyles ]; }, arrayContains: function domExplorer$messageHandlers$arrayContains(array, value) { for(var i = 0; i < array.length; i++) { if(array[i] === value) { return true; } } return false; }, clearStyleCache: function domExplorer$messageHandlers$clearStyleCache() { styleUtilities.clearCache(); RemoteDom.remoteCode.editStack.reset(); }, getStyles: function domExplorer$messageHandlers$getStyles(uid) { var mappedNode = htmlTreeHelpers.mapping[uid]; if(!mappedNode || !htmlTreeHelpers.isElementAccessible(mappedNode.ele)) { return; } if(mappedNode.parentUid) { mappedNode = htmlTreeHelpers.mapping[mappedNode.parentUid]; if(!mappedNode) { return; } } return styleUtilities.refreshCurrentRules(mappedNode.ele); }, EditStylePropertyEnable: function domExplorer$messageHandlers$EditStylePropertyEnable(propertyUid, enable) { var mappedProperty = styleUtilities.lookupMappedProperty(propertyUid); if(mappedProperty) { var edit = new F12.RemoteDom.EditStylePropertyEnable(styleUtilities, mappedProperty, enable); RemoteDom.remoteCode.editStack.performEdit(edit); } }, deleteElement: function domExplorer$messageHandlers$deleteElement(uid) { var isStyle = false; if(uid.substr(0, 5) === "style") { uid = uid.substr(5); isStyle = true; } var mappedNode = htmlTreeHelpers.mapping[uid]; if(!mappedNode || !htmlTreeHelpers.isElementAccessible(mappedNode.ele)) { return false; } var edit = new F12.RemoteDom.DeleteElement(mappedNode.ele, isStyle); return RemoteDom.remoteCode.editStack.performEdit(edit); }, addElement: function domExplorer$messageHandlers$addElement(parentUid, beforeUid, htmlText) { var parentNode = htmlTreeHelpers.mapping[parentUid]; if(!parentNode || !htmlTreeHelpers.isElementAccessible(parentNode.ele)) { return false; } var parentElement = parentNode.ele; var beforeElement = null; if(beforeUid) { var beforeNode = htmlTreeHelpers.mapping[beforeUid]; if(!beforeNode || !htmlTreeHelpers.isElementAccessible(beforeNode.ele)) { return false; } beforeElement = beforeNode.ele; } var edit = new F12.RemoteDom.AddElement(parentElement, beforeElement, htmlText); return RemoteDom.remoteCode.editStack.performEdit(edit); }, replaceElement: function domExplorer$messageHandlers$replaceElement(parentUid, htmlText) { var parentNode = htmlTreeHelpers.mapping[parentUid]; if(!parentNode || !htmlTreeHelpers.isElementAccessible(parentNode.ele)) { return false; } var edit = new F12.RemoteDom.ReplaceElement(parentNode.ele, htmlText); return RemoteDom.remoteCode.editStack.performEdit(edit); }, editStylePropertyValue: function domExplorer$messageHandlers$editStylePropertyValue(propertyUid, newValue, isImportant) { var mappedProperty = styleUtilities.lookupMappedProperty(propertyUid); if(mappedProperty) { var edit = new F12.RemoteDom.EditStylePropertyValue(styleUtilities, mappedProperty, newValue, isImportant); RemoteDom.remoteCode.editStack.performEdit(edit); return edit.result; } }, editStylePropertyName: function domExplorer$messageHandlers$editStylePropertyValue(propertyUid, newName) { var mappedProperty = styleUtilities.lookupMappedProperty(propertyUid); if(mappedProperty) { var edit = new F12.RemoteDom.EditStylePropertyName(styleUtilities, mappedProperty, newName); RemoteDom.remoteCode.editStack.performEdit(edit); return edit.result; } }, removeStyleProperty: function domExplorer$messageHandlers$removeStyleProperty(propertyUid) { var mappedProperty = styleUtilities.lookupMappedProperty(propertyUid); if(mappedProperty) { var edit = new F12.RemoteDom.EditStylePropertyRemove(styleUtilities, mappedProperty); return RemoteDom.remoteCode.editStack.performEdit(edit); } }, clearCurrentEventProxy: function domExplorer$messageHandlers$clearCurrentEventProxy() { RemoteDom.domUtilities.removeAllCurrentEventProxyListeners(); RemoteDom.domUtilities.currentEventProxy = null; }, collectEvents: function domExplorer$messageHandlers$collectEvents(uid, handlersRetrievedCallback, handlerAddedCallback, handlerRemovedCallback) { var mappedNode = htmlTreeHelpers.mapping[uid]; if(!mappedNode || !htmlTreeHelpers.isElementAccessible(mappedNode.ele)) { return; } var mappedElement = mappedNode.ele; RemoteDom.domUtilities.removeAllCurrentEventProxyListeners(); RemoteDom.domUtilities.currentEventProxy = dom.getElementEventHelper(mappedElement); if(!RemoteDom.domUtilities.currentEventProxy) { return; } RemoteDom.domUtilities.currentEventProxy = dom.getElementEventHelper(mappedElement); var addedCallback = function (a) { RemoteDom.dom$messageHandlers.onAdded(handlerAddedCallback, a); }; var removedCallback = function (a) { RemoteDom.dom$messageHandlers.onRemoved(handlerRemovedCallback, a); }; Common.RemoteHelpers.addListener(RemoteDom.domUtilities.currentEventProxy, "listenerAdded", addedCallback); Common.RemoteHelpers.addListener(RemoteDom.domUtilities.currentEventProxy, "listenerRemoved", removedCallback); if(!RemoteDom.domUtilities.currentEventProxyListeners) { RemoteDom.domUtilities.currentEventProxyListeners = []; } RemoteDom.domUtilities.currentEventProxyListeners.push({ name: "listenerAdded", callback: addedCallback }); RemoteDom.domUtilities.currentEventProxyListeners.push({ name: "listenerRemoved", callback: removedCallback }); var listeners = RemoteDom.domUtilities.currentEventProxy.getEventHandlers(); handlersRetrievedCallback(listeners); }, onAdded: function (handlerAddedCallback, a) { handlerAddedCallback(a.listener); }, onRemoved: function (handlerRemovedCallback, a) { handlerRemovedCallback(a.listener); }, getDocumentMode: function domExplorer$messageHandlers$getDocumentMode() { return Common.RemoteHelpers.getDocumentMode(); }, getHTMLString: function domExplorer$messageHandlers$getHTMLString(uid, getInnerHTML) { var style = false; if(uid.substr(0, 5) === "style") { uid = uid.substr(5); style = true; } var mappedNode = htmlTreeHelpers.mapping[uid]; if(!mappedNode || !htmlTreeHelpers.isElementAccessible(mappedNode.ele)) { return; } if(style) { if(mappedNode.ele.nodeName === "STYLE") { return mappedNode.ele.styleSheet ? mappedNode.ele.styleSheet.cssText : Common.RemoteHelpers.getTextContent(mappedNode.ele); } } var element = mappedNode.ele; if(!element.tagName) { if(element.nodeType === element.DOCUMENT_TYPE_NODE) { return Common.RemoteHelpers.getDocumentTypeNodeText(element); } if(element.text) { return element.text; } var textContent = Common.RemoteHelpers.getTextContent(element); if(textContent) { return textContent; } return; } var resultHtml; if(getInnerHTML) { resultHtml = dom.getElementInnerHTML(mappedNode.ele); } else { resultHtml = dom.getElementOuterHTML(mappedNode.ele); } return resultHtml; }, setKeyBindCallbacks: function domExplorer$messageHandlers$setKeyBindCallbacks(onVSFocusCallback, startSelectElementByClickCallback, stopSelectElementByClickCallback, expandToSelectedItemCallback) { RemoteDom.remoteCode.vsFocusCallback = onVSFocusCallback; RemoteDom.remoteCode.startSelectElementByClickCallback = startSelectElementByClickCallback; RemoteDom.remoteCode.stopSelectElementByClickCallback = stopSelectElementByClickCallback; RemoteDom.remoteCode.expandToSelectedItemCallback = expandToSelectedItemCallback; }, allowProcessToTakeForeground: function domExplorer$messageHandlers$allowProcessToTakeForeground() { try { (external).allowProcessToTakeForeground(); } catch (e) { } }, getHWND: function domExplorer$messageHandlers$getHWND() { return toolUI.getHWND(); }, takeForeground: function domExplorer$messageHandlers$takeForeground() { try { (external).takeForeground(); return true; } catch (e) { return false; } }, editStyleRuleAdd: function domExplorer$messageHandlers$editStyleRuleAdd(selectorText, propertyName, propertyValue, isImportant) { var edit = new F12.RemoteDom.EditStyleRuleAdd(styleUtilities, selectorText, propertyName, propertyValue, isImportant); RemoteDom.remoteCode.editStack.performEdit(edit); return edit.result; }, editStylePropertyAdd: function domExplorer$messageHandlers$editStylePropertyAdd(ruleUid, propertyName, propertyValue, isImportant, beforeUid) { var mappedRule = styleUtilities.lookupMappedRule(ruleUid); if(mappedRule) { var edit = new F12.RemoteDom.EditStylePropertyAdd(styleUtilities, mappedRule, propertyName, propertyValue, isImportant, beforeUid); if(RemoteDom.remoteCode.editStack.performEdit(edit)) { return edit.result; } } }, EditStyleRuleSelector: function domExplorer$messageHandler$editRuleSelector(ruleUid, selector) { var mappedRule = styleUtilities.lookupMappedRule(ruleUid); if(mappedRule) { var edit = new F12.RemoteDom.EditStyleRuleSelector(styleUtilities, mappedRule, selector); if(RemoteDom.remoteCode.editStack.performEdit(edit)) { return edit.result; } } }, storeElementForConsole: function domExplorer$messageHandlers$storeElementForConsole(uid) { var mappedNode = htmlTreeHelpers.mapping[uid]; if(!mappedNode || !htmlTreeHelpers.isElementAccessible(mappedNode.ele)) { return; } if(mappedNode.ele.ownerDocument === mainBrowser.document) { var elements = Common.RemoteHelpers.getDefaultView(mainBrowser.document)['__BROWSERTOOLS_DOMEXPLORER_STORED_ELEMENTS']; if(!elements) { elements = Common.RemoteHelpers.getDefaultView(mainBrowser.document)['__BROWSERTOOLS_DOMEXPLORER_STORED_ELEMENTS'] = new (mainBrowser.document.parentWindow).Array(); } elements.splice(0, 0, mappedNode.ele); if(elements.length > 5) { elements.pop(); } } }, selectElementFromConsole: function domExplorer$messageHandlers$selectElementFromConsole(element) { if(element && element.ownerDocument) { var view = Common.RemoteHelpers.getDefaultView(element.ownerDocument); if(view && Common.RemoteHelpers.isElement(view, element)) { RemoteDom.domUtilities.selectElementLastSelected = element; RemoteDom.remoteCode.expandToSelectedItemCallback(); return; } } var win = Common.RemoteHelpers.getDefaultView(mainBrowser.document); win.console.error("ConsoleSelectError"); }, reparent: function domExplorer$messageHandlers$reparent(moveThisUid, byThisUid, reparentAction) { var mappedMoveThisNode = htmlTreeHelpers.mapping[moveThisUid]; if(!mappedMoveThisNode || !htmlTreeHelpers.isElementAccessible(mappedMoveThisNode.ele)) { return; } var mappedByThisNode = htmlTreeHelpers.mapping[byThisUid]; if(!mappedByThisNode || !htmlTreeHelpers.isElementAccessible(mappedByThisNode.ele)) { return; } var moveThisElement = mappedMoveThisNode.ele; var byThisElement = mappedByThisNode.ele; var edit = new F12.RemoteDom.ReparentEdit(moveThisElement, byThisElement, reparentAction); return RemoteDom.remoteCode.editStack.performEdit(edit); }, copyElementWithStyle: function domExplorer$copyElementWithStyle(uid) { var mappedNode = htmlTreeHelpers.mapping[uid]; if(!mappedNode || !htmlTreeHelpers.isElementAccessible(mappedNode.ele)) { return; } var elementThatMightBeTheBody = mappedNode.ele; while(elementThatMightBeTheBody) { if(elementThatMightBeTheBody.tagName === "BODY") { return styleUtilities.copyElementWithStyle(mappedNode.ele); } elementThatMightBeTheBody = elementThatMightBeTheBody.parentElement; } return; } }; var styleUtilities = new RemoteDom.StyleUtilities(RemoteDom.dom$messageHandlers, F12.RemoteDom.domUtilities); })(F12.RemoteDom || (F12.RemoteDom = {})); var RemoteDom = F12.RemoteDom; })(F12 || (F12 = {})); //@ sourceMappingURL=remote.js.map var F12; (function (F12) { (function (RemoteDom) { "use strict"; var Chunker = (function () { function Chunker() { } Chunker.prototype.sendChildren = function (mappedNode, children, showAll, callback) { var count = children.length; if(mappedNode.isLimited && mappedNode.ele.childNodes) { count = 0; var childNodes = mappedNode.ele.childNodes; for(var index = 0; index < childNodes.length; index++) { var element = childNodes.item(index); var textContent = Common.RemoteHelpers.getTextContent(element); if(!htmlTreeHelpers.isEmptyTextElement(element, textContent)) { count++; } } } if(count <= remoteHelpers.childrenElementLimit) { callback({ children: children, chunkNumber: 0, chunkCount: 1, totalChildCount: count }); } else if(!showAll) { children = children.slice(0, remoteHelpers.childrenElementLimit); callback({ children: children, chunkNumber: 0, chunkCount: 1, totalChildCount: count }); } else { if(mappedNode.isLimited) { htmlTreeHelpers.getChildrenForMappedNode(mappedNode.ele.uniqueID, false, true); } var chunkNumber = 0; var chunkCount = Math.ceil(count / remoteHelpers.childrenElementLimit); while(chunkNumber * remoteHelpers.childrenElementLimit < count) { var chunk = children.slice(chunkNumber * remoteHelpers.childrenElementLimit, (chunkNumber + 1) * remoteHelpers.childrenElementLimit); callback({ children: chunk, chunkNumber: chunkNumber++, chunkCount: chunkCount, totalChildCount: count }); } } }; return Chunker; })(); RemoteDom.Chunker = Chunker; })(F12.RemoteDom || (F12.RemoteDom = {})); var RemoteDom = F12.RemoteDom; })(F12 || (F12 = {})); //@ sourceMappingURL=remoteChunker.js.map var F12; (function (F12) { (function (RemoteDom) { var EditStylePropertyEnable = (function () { function EditStylePropertyEnable(_styleUtilities, _mappedProperty, _newValue) { this._styleUtilities = _styleUtilities; this._mappedProperty = _mappedProperty; this._newValue = _newValue; this._oldValue = this._mappedProperty.appliedProperty.isEnabled; this.type = "EditStylePropertyEnable"; } EditStylePropertyEnable.prototype.description = function () { return this.type; }; EditStylePropertyEnable.prototype.performUndo = function () { if(this._newValue !== this._oldValue) { this._mappedProperty.setEnabled(this._oldValue); this._styleUtilities.stylechange([ { event: "updateProperty", uid: this._mappedProperty.appliedProperty.uid, obj: this._mappedProperty.appliedProperty, "select": true } ]); return true; } return false; }; EditStylePropertyEnable.prototype.performEdit = function (isRedo) { if(this._newValue !== this._oldValue) { this._mappedProperty.setEnabled(this._newValue); if(isRedo) { this._styleUtilities.stylechange([ { event: "updateProperty", uid: this._mappedProperty.appliedProperty.uid, obj: this._mappedProperty.appliedProperty, "select": true } ]); } return true; } return false; }; return EditStylePropertyEnable; })(); RemoteDom.EditStylePropertyEnable = EditStylePropertyEnable; var RemoveAttribute = (function () { function RemoveAttribute(_styleUtilities, htmlTreeHelpers, uid, _name) { this._styleUtilities = _styleUtilities; this._name = _name; this.type = "RemoveAttribute"; var mappedNode = htmlTreeHelpers.mapping[uid]; if(!mappedNode || !htmlTreeHelpers.isElementAccessible(mappedNode.ele)) { return; } this._element = mappedNode.ele; if(this._name === "value" && htmlTreeHelpers.hasSpecialValueAttribute(this._element)) { this._oldValue = this._element.value; this._valueSpecialCase = true; } else { this._oldValue = this._element.getAttribute(this._name); this._valueSpecialCase = false; } } RemoveAttribute.prototype.description = function () { return this.type; }; RemoveAttribute.prototype.performUndo = function () { if(this._valueSpecialCase) { this._element.value = this._oldValue; return true; } else { this._element.setAttribute(this._name, this._oldValue); if(this._name === "style" && Common.RemoteHelpers.getDocumentMode() < 9) { this._styleUtilities.styleAttrModified(this._element); } return true; } }; RemoveAttribute.prototype.performEdit = function () { if(this._valueSpecialCase) { this._element.value = ""; return true; } else { if(this._name === "style") { this._element.setAttribute(this._name, "color:inherit"); if(Common.RemoteHelpers.getDocumentMode() < 9) { this._styleUtilities.styleAttrModified(this._element); } } this._element.removeAttribute(this._name); return true; } }; return RemoveAttribute; })(); RemoteDom.RemoveAttribute = RemoveAttribute; var EditAttribute = (function () { function EditAttribute(_styleUtilities, htmlTreeHelpers, _element, _name, _newValue) { this._styleUtilities = _styleUtilities; this._element = _element; this._name = _name; this._newValue = _newValue; this._htmlTreeHelpers = htmlTreeHelpers; this.type = "EditAttribute"; this._specialCaseValue = this._name === "value" && htmlTreeHelpers.hasSpecialValueAttribute(this._element); if(this._specialCaseValue) { this._oldValue = this._element.value; } else { this._oldValue = this._element.getAttribute(this._name); } } EditAttribute.prototype.description = function () { return this.type; }; EditAttribute.prototype.performUndo = function () { if(this._specialCaseValue) { this._element.value = this._oldValue; return true; } else { if(!this._oldValue) { if(this._name === "style") { this._element.setAttribute(this._name, "color:inherit"); if(Common.RemoteHelpers.getDocumentMode() < 9) { this._styleUtilities.styleAttrModified(this._element); } } this._element.removeAttribute(this._name); } else { this._element.setAttribute(this._name, this._oldValue); } return true; } }; EditAttribute.prototype.performEdit = function () { if(this._specialCaseValue) { this._element.value = this._newValue; RemoteDom.domUtilities.getMutationManager().fireAttributeModified(this._element, this._name, this._newValue, 1); return true; } else { try { this._element.setAttribute(this._name, this._newValue); if(this._name === "style" && Common.RemoteHelpers.getDocumentMode() < 9) { this._styleUtilities.styleAttrModified(this._element); } } catch (ex) { return false; } return true; } }; return EditAttribute; })(); RemoteDom.EditAttribute = EditAttribute; var EditText = (function () { function EditText(_element, _newValue) { this._element = _element; this._newValue = _newValue; this.type = "EditText"; this._oldValue = this._element.textContent; this._textNodeCase = (this._element.nodeName === "#text"); this._parentNode = this._element.parentNode; } EditText.prototype.description = function () { return this.type; }; EditText.prototype.performUndo = function () { if(this._textNodeCase) { this._parentNode.replaceChild(this._element, this._newElement); } this._element.textContent = this._oldValue; return true; }; EditText.prototype.performEdit = function () { if(this._textNodeCase) { var doc = this._element.ownerDocument; if(!this._newElement) { this._newElement = doc.createTextNode(""); ; } this._parentNode.replaceChild(this._newElement, this._element); if(Common.RemoteHelpers.getDocumentMode() < 9) { this._newElement.nodeValue = this._newValue; } else { this._newElement.textContent = this._newValue; } return true; } else { this._element.textContent = this._newValue; return true; } }; return EditText; })(); RemoteDom.EditText = EditText; ; var EditStylePropertyValue = (function () { function EditStylePropertyValue(_styleUtilities, _mappedProperty, _newValue, _newIsImportant) { this._styleUtilities = _styleUtilities; this._mappedProperty = _mappedProperty; this._newValue = _newValue; this._newIsImportant = _newIsImportant; this.type = "EditStylePropertyValue"; this._oldValue = this._mappedProperty.appliedProperty.value; this._oldIsImportant = this._mappedProperty.appliedProperty.isImportant; this._oldIsEnabled = this._mappedProperty.appliedProperty.isEnabled; try { this._oldIsInvalid = !this._mappedProperty.diagProperty.isValid; } catch (ex) { Common.RemoteHelpers.encounteredException(ex); this._oldIsInvalid = true; } } EditStylePropertyValue.prototype.getOldValue = function () { return { value: this._oldValue, isImportant: this._oldIsImportant, isEnabled: this._oldIsEnabled, isInvalid: this._oldIsInvalid }; }; EditStylePropertyValue.prototype.setOldValue = function (newOldValue) { this._oldValue = newOldValue.value; this._oldIsImportant = newOldValue.isImportant; this._oldIsEnabled = newOldValue.isEnabled; this._oldIsInvalid = newOldValue.isInvalid; }; EditStylePropertyValue.prototype.hasValueChanged = function () { return this._oldValue != this._newValue || this._oldIsImportant != this._newIsImportant; }; EditStylePropertyValue.prototype.description = function () { return this.type + " " + this._mappedProperty.appliedProperty.name + "=" + this._newValue + " oldValue =" + this._oldValue + " chainingid=" + this.chainingUid; }; EditStylePropertyValue.prototype.performUndo = function () { this._mappedProperty.setValue(this._oldValue, this._oldIsImportant, this._oldIsEnabled); this._styleUtilities.stylechange([ { event: "updateProperty", uid: this._mappedProperty.appliedProperty.uid, obj: this._mappedProperty.appliedProperty, "select": true } ]); return true; }; EditStylePropertyValue.prototype.performEdit = function (isRedo) { var isSuccess = this._mappedProperty.setValue(this._newValue, this._newIsImportant, isRedo ? this._newIsEnabled : this._oldIsEnabled || this._oldIsInvalid); if(isSuccess) { this._newIsEnabled = this._mappedProperty.appliedProperty.isEnabled; this.result = this._mappedProperty.appliedProperty; if(isRedo) { this._styleUtilities.stylechange([ { event: "updateProperty", uid: this._mappedProperty.appliedProperty.uid, obj: this._mappedProperty.appliedProperty, "select": true } ]); } } return isSuccess; }; return EditStylePropertyValue; })(); RemoteDom.EditStylePropertyValue = EditStylePropertyValue; var EditStylePropertyName = (function () { function EditStylePropertyName(_styleUtilities, _mappedProperty, _newName) { this._styleUtilities = _styleUtilities; this._mappedProperty = _mappedProperty; this._newName = _newName; this.type = "EditStylePropertyName"; this._oldName = this._mappedProperty.appliedProperty.name; } EditStylePropertyName.prototype.description = function () { return this.type + " " + this._oldName + "=" + this._newName + " chainingid=" + this.chainingUid; }; EditStylePropertyName.prototype.performUndo = function () { this._mappedProperty.setName(this._oldName); this._styleUtilities.stylechange([ { event: "updateProperty", uid: this._mappedProperty.appliedProperty.uid, obj: this._mappedProperty.appliedProperty, "select": true } ]); return true; }; EditStylePropertyName.prototype.performEdit = function (isRedo) { var isSuccess = this._mappedProperty.setName(this._newName); if(isSuccess) { this.result = this._mappedProperty.appliedProperty; if(isRedo) { this._styleUtilities.stylechange([ { event: "updateProperty", uid: this._mappedProperty.appliedProperty.uid, obj: this._mappedProperty.appliedProperty, "select": true } ]); } } return isSuccess; }; return EditStylePropertyName; })(); RemoteDom.EditStylePropertyName = EditStylePropertyName; var EditStylePropertyRemove = (function () { function EditStylePropertyRemove(_styleUtilities, _mappedProperty) { this._styleUtilities = _styleUtilities; this._mappedProperty = _mappedProperty; this.type = "EditStylePropertyRemove"; this._mappedRule = this._mappedProperty.mappedRule; var appliedProperty = this._mappedProperty.appliedProperty; this._oldName = appliedProperty.name; this._oldValue = appliedProperty.value; this._oldIsImportant = appliedProperty.isImportant; this._oldEnabled = appliedProperty.isEnabled; } EditStylePropertyRemove.prototype.description = function () { return this.type + " " + this._oldName + " chainingid=" + this.chainingUid; }; EditStylePropertyRemove.prototype.performUndo = function () { this._mappedRule.propertyAdd(this._oldName, this._oldValue, this._oldIsImportant, this._oldEnabled, this._mappedProperty, this._oldBeforeUid); this._styleUtilities.stylechange([ { event: "addProperty", uid: this._mappedRule.appliedRule.uid, obj: this._mappedProperty.appliedProperty, beforeUid: this._oldBeforeUid, "select": true } ]); return true; }; EditStylePropertyRemove.prototype.performEdit = function (isRedo) { var _this = this; if(!isRedo) { var found = false; this._mappedRule.forEachProperty(function (mappedProperty) { if(found) { _this._oldBeforeUid = mappedProperty.appliedProperty.uid; return true; } else if(mappedProperty === _this._mappedProperty) { found = true; } }); } var isSuccess = this._mappedRule.propertyRemove(this._mappedProperty); if(isSuccess && isRedo) { this._styleUtilities.stylechange([ { event: "removeProperty", uid: this._mappedProperty.appliedProperty.uid, "select": true } ]); } return isSuccess; }; return EditStylePropertyRemove; })(); RemoteDom.EditStylePropertyRemove = EditStylePropertyRemove; var EditStyleRuleAdd = (function () { function EditStyleRuleAdd(_styleUtilities, _selector, _newName, _newValue, _newIsImportant) { this._styleUtilities = _styleUtilities; this._selector = _selector; this._newName = _newName; this._newValue = _newValue; this._newIsImportant = _newIsImportant; this.type = "EditStyleRuleAdd"; } EditStyleRuleAdd.prototype.description = function () { return this.type; }; EditStyleRuleAdd.prototype.performEdit = function (isRedo) { if(!isRedo) { this._mappedRule = this._styleUtilities.addNewRule(this._selector); } if(this._mappedRule) { this._mappedProperty = this._mappedRule.propertyAdd(this._newName, this._newValue, this._newIsImportant, true, this._mappedProperty); if(isRedo) { this._styleUtilities.stylechange(); } this.result = this._mappedRule.appliedRule; return true; } return false; }; EditStyleRuleAdd.prototype.performUndo = function () { this._mappedRule.RemoveAllProperties(); this._styleUtilities.stylechange(); return true; }; return EditStyleRuleAdd; })(); RemoteDom.EditStyleRuleAdd = EditStyleRuleAdd; var EditStyleRuleSelector = (function () { function EditStyleRuleSelector(_styleUtilities, _oldMappedRule, _newSelector) { this._styleUtilities = _styleUtilities; this._oldMappedRule = _oldMappedRule; this._newSelector = _newSelector; var _this = this; this.type = "EditStyleRuleSelector"; this._oldSelector = this._oldMappedRule.appliedRule.selector; this._oldProperties = []; this._oldMappedRule.forEachProperty(function (mappedProperty) { _this._oldProperties.push(mappedProperty); }); } EditStyleRuleSelector.prototype.description = function () { return this.type; }; EditStyleRuleSelector.prototype.performEdit = function (isRedo) { if(!isRedo) { this._newMappedRule = this._styleUtilities.addNewRule(this._newSelector); } if(this._newMappedRule && this._newMappedRule.movePropertiesFromRule(this._oldMappedRule)) { if(isRedo) { this._styleUtilities.stylechange(); } this.result = this._newMappedRule.appliedRule; return true; } return false; }; EditStyleRuleSelector.prototype.performUndo = function () { if(this._oldMappedRule.movePropertiesFromRule(this._newMappedRule)) { this._styleUtilities.stylechange(); return true; } return false; }; return EditStyleRuleSelector; })(); RemoteDom.EditStyleRuleSelector = EditStyleRuleSelector; var EditStylePropertyAdd = (function () { function EditStylePropertyAdd(_styleUtilities, _mappedRule, _newName, _newValue, _newIsImportant, _beforeUid) { this._styleUtilities = _styleUtilities; this._mappedRule = _mappedRule; this._newName = _newName; this._newValue = _newValue; this._newIsImportant = _newIsImportant; this._beforeUid = _beforeUid; this.type = "EditStylePropertyAdd"; } EditStylePropertyAdd.prototype.description = function () { return this.type; }; EditStylePropertyAdd.prototype.performEdit = function (isRedo) { this._mappedProperty = this._mappedRule.propertyAdd(this._newName, this._newValue, this._newIsImportant, true, this._mappedProperty, this._beforeUid); if(isRedo) { this._styleUtilities.stylechange([ { event: "addProperty", uid: this._mappedRule.appliedRule.uid, obj: this._mappedProperty.appliedProperty, "select": true } ]); } else { this._mappedProperty.appliedProperty.isApplied = true; } this.result = this._mappedProperty.appliedProperty; return true; }; EditStylePropertyAdd.prototype.performUndo = function () { this._mappedRule.propertyRemove(this._mappedProperty); this._styleUtilities.stylechange([ { event: "removeProperty", uid: this._mappedProperty.appliedProperty.uid, "select": true } ]); return true; }; return EditStylePropertyAdd; })(); RemoteDom.EditStylePropertyAdd = EditStylePropertyAdd; var ReparentEdit = (function () { function ReparentEdit(_moveThisNode, _byThisNode, _reparentAction) { this._moveThisNode = _moveThisNode; this._byThisNode = _byThisNode; this._reparentAction = _reparentAction; this.type = "reparent"; this._originalParent = this._moveThisNode.parentNode; this._originalNextSibling = this._moveThisNode.nextSibling; } ReparentEdit.prototype.description = function () { return this.type; }; ReparentEdit.prototype.performEdit = function () { if(!this._moveThisNode || !this._moveThisNode.parentNode || !this._byThisNode || !this._byThisNode.parentNode) { return false; } if(!this._moveThisNode.ownerDocument || !this._byThisNode.ownerDocument || this._moveThisNode.ownerDocument !== this._byThisNode.ownerDocument) { return false; } if(this._reparentAction === 'first child') { this._byThisNode.insertBefore(this._moveThisNode, this._byThisNode.firstChild); } else if(this._reparentAction === 'last child') { this._byThisNode.appendChild(this._moveThisNode); } else if(this._reparentAction === 'before sibling') { this._byThisNode.parentNode.insertBefore(this._moveThisNode, this._byThisNode); } else if(this._reparentAction === 'after sibling') { this._byThisNode.parentNode.insertBefore(this._moveThisNode, this._byThisNode.nextSibling); } return true; }; ReparentEdit.prototype.performUndo = function () { if(!this._moveThisNode || !this._moveThisNode.parentNode || !this._originalParent) { return false; } if(!this._moveThisNode.ownerDocument || !this._originalParent.ownerDocument || this._moveThisNode.ownerDocument !== this._originalParent.ownerDocument) { return false; } if(this._originalNextSibling) { this._originalParent.insertBefore(this._moveThisNode, this._originalNextSibling); } else { this._originalParent.appendChild(this._moveThisNode); } return true; }; return ReparentEdit; })(); RemoteDom.ReparentEdit = ReparentEdit; var DeleteElement = (function () { function DeleteElement(_element, _isStyle) { this._element = _element; this._isStyle = _isStyle; this.type = "DeleteElement"; } DeleteElement.prototype.description = function () { return this.type; }; DeleteElement.prototype.performUndo = function () { if(this._isStyle) { this._element.innerHTML = this._oldStyle; return true; } else { if(this._nextSibling) { this._oldParent.insertBefore(this._element, this._nextSibling); } else { this._oldParent.appendChild(this._element); } return true; } }; DeleteElement.prototype.performEdit = function () { if(this._isStyle) { this._oldStyle = this._element.innerHTML; this._element.innerHTML = ""; return true; } else { this._nextSibling = (this._element.nextElementSibling ? this._element.nextElementSibling : this._element.nextSibling); this._oldParent = this._element.parentNode; this._element.parentNode.removeChild(this._element); if(Common.RemoteHelpers.getDocumentMode() >= 9) { this._element.parentNode = null; } return true; } }; return DeleteElement; })(); RemoteDom.DeleteElement = DeleteElement; var AddElement = (function () { function AddElement(_element, _beforeElement, _htmlText) { this._element = _element; this._beforeElement = _beforeElement; this._htmlText = _htmlText; this._newElements = []; this.type = "AddElement"; } AddElement.prototype.description = function () { return this.type; }; AddElement.prototype.performUndo = function () { for(var i = 0; i < this._newElements.length; i++) { this._element.removeChild(this._newElements[i]); } return true; }; AddElement.prototype.performEdit = function () { this._newElements = AddElement.createElements(this._element.ownerDocument, this._htmlText); for(var i = 0; i < this._newElements.length; i++) { if(!this._beforeElement) { this._element.appendChild(this._newElements[i]); } else { this._element.insertBefore(this._newElements[i], this._beforeElement); } } return true; }; AddElement.createElements = function createElements(document, htmlText) { var div = document.createElement('div'); var view = Common.RemoteHelpers.getDefaultView(document); if(view.WinJS) { view.WinJS.Utilities.setInnerHTMLUnsafe(div, htmlText); } else { div.innerHTML = htmlText; } var newElements = []; for(var i = 0; i < div.childNodes.length; i++) { var element = div.childNodes.item(i); newElements.push(element); } return newElements; }; return AddElement; })(); RemoteDom.AddElement = AddElement; var ReplaceElement = (function () { function ReplaceElement(_element, _htmlText) { this._element = _element; this._htmlText = _htmlText; this._newElements = []; this.type = "ReplaceElement"; this._parentElement = (_element).parentElement || _element.parentNode; this._nextSibling = (this._element).nextElementSibling || this._element.nextSibling; } ReplaceElement.prototype.description = function () { return this.type; }; ReplaceElement.prototype.performUndo = function () { for(var i = 0; i < this._newElements.length; i++) { this._parentElement.removeChild(this._newElements[i]); } if(this._nextSibling) { this._parentElement.insertBefore(this._element, this._nextSibling); } else { this._parentElement.appendChild(this._element); } return true; }; ReplaceElement.prototype.performEdit = function () { this._newElements = AddElement.createElements(this._parentElement.ownerDocument, this._htmlText); var fragment = this._parentElement.ownerDocument.createDocumentFragment(); for(var i = 0; i < this._newElements.length; i++) { fragment.appendChild(this._newElements[i]); } if(this._nextSibling) { this._parentElement.insertBefore(fragment, this._nextSibling); } else { this._parentElement.appendChild(fragment); } this._parentElement.removeChild(this._element); return true; }; return ReplaceElement; })(); RemoteDom.ReplaceElement = ReplaceElement; })(F12.RemoteDom || (F12.RemoteDom = {})); var RemoteDom = F12.RemoteDom; })(F12 || (F12 = {})); //@ sourceMappingURL=remoteEdit.js.map var F12; (function (F12) { (function (RemoteDom) { var RemoteElementCopier = (function () { function RemoteElementCopier(_diagOmStyles) { this._diagOmStyles = _diagOmStyles; } RemoteElementCopier.prototype.computeHtmlForAncestorsAndDescendants = function (elementToCopy) { var root = this.copyElementPlusAncestors(elementToCopy); var doctype = RemoteElementCopier.constructDoctypeString(elementToCopy.ownerDocument.doctype); var htmlTag = this.constructHtmlTagString(elementToCopy); var elementsToSearchForStyles = this.findElementsToSearchForStyles(elementToCopy); var elementToStyleRulesMap = this.makeElementToStyleRulesMap(elementsToSearchForStyles); var orderedStyleRules = this.putRulesInTheRightOrder(elementToStyleRulesMap); var result = doctype + "\r\n" + htmlTag + "\r\n\r\n\r\n\r\n\r\n"; result += root.outerHTML; result += "\r\n\r\n"; return result; }; RemoteElementCopier.prototype.copyElementPlusAncestors = function (elementToCopy) { var ancestorElements = []; var ancestorElement = elementToCopy.parentElement; if(elementToCopy.tagName !== "BODY") { while(ancestorElement) { ancestorElements.push(ancestorElement); ancestorElement = ancestorElement.parentElement; if(ancestorElement && !ancestorElement.parentElement) { ancestorElement = null; } } } var container = null; var root = null; var styleSet = { }; for(var i = ancestorElements.length - 1; i >= 0; i--) { var createdAncestor = this.copyElementWithAttributes(ancestorElements[i]); if(container) { container.appendChild(createdAncestor); } else { root = createdAncestor; } container = createdAncestor; } var copy = this.copyElementWithAttributes(elementToCopy); copy.innerHTML = elementToCopy.innerHTML; if(container) { container.appendChild(copy); return root; } return copy; }; RemoteElementCopier.prototype.findElementsToSearchForStyles = function (element) { var ancestorsAndDescendants = []; var nextElement = element; while(nextElement) { ancestorsAndDescendants.push(nextElement); nextElement = nextElement.parentElement; } var elementsToSearchForChildren = [ element ]; while(elementsToSearchForChildren.length > 0) { var elementToProcess = elementsToSearchForChildren.pop(); var currentChildren = elementToProcess.children; if(currentChildren) { for(var i = 0; i < currentChildren.length; i++) { elementsToSearchForChildren.push(currentChildren[i]); ancestorsAndDescendants.push(currentChildren[i]); } } } return ancestorsAndDescendants; }; RemoteElementCopier.prototype.getTextForRules = function (styleRules) { var cssText = ""; styleRules.forEach(function (rule) { if(rule.parentRule && rule.parentRule) { var mediaRule = rule.parentRule; if(mediaRule.media && mediaRule.media.mediaText) { cssText += "@media " + mediaRule.media.mediaText + "\r\n"; } else if(rule.parentStyleSheet) { var linkElement = rule.parentStyleSheet.owningElement; if(linkElement.tagName === "LINK" && linkElement.media) { cssText += "media " + linkElement.media + "\r\n"; } } } cssText += (rule).selectorText; cssText += " {\r\n"; var styleProperties = (rule).style; var stylePropertyArray = styleProperties.cssText.split(";"); stylePropertyArray.forEach(function (styleProperty) { if(styleProperty) { cssText += "\t" + styleProperty.trim() + ";\r\n"; } }); cssText += "}\r\n"; }); return cssText; }; RemoteElementCopier.prototype.makeElementToStyleRulesMap = function (elements) { var result = []; for(var i = 0; i < elements.length; i++) { var element = elements[i]; var styleRules = this.getStyleRules(element); if(styleRules.length > 0) { result.push({ element: element, styleRules: styleRules }); } } return result; }; RemoteElementCopier.prototype.getStyleRules = function (element) { var styleRules = []; this._diagOmStyles.calculateTracedStyles(element); var appliedStyles = this._diagOmStyles.getTracedStyles(element).getAppliedStyles(); for(var i = appliedStyles.length - 1; i >= 0; i--) { var styleRule = appliedStyles[i].parentRule; if(styleRule) { styleRules.push(styleRule); } } return styleRules; }; RemoteElementCopier.prototype.copyElementWithAttributes = function (source) { var copy = source.ownerDocument.createElement(source.tagName); for(var i = 0; i < source.attributes.length; i++) { copy.setAttribute(source.attributes[i].name, source.attributes[i].value); } return copy; }; RemoteElementCopier.constructDoctypeString = function constructDoctypeString(node) { var doctype = ""; if(node) { doctype = "'; } return doctype; }; RemoteElementCopier.prototype.constructHtmlTagString = function (elementToCopy) { var node = elementToCopy.ownerDocument.documentElement; var htmlTag = ""; if(node && node.attributes) { htmlTag = " indexOfRule) { orderedRules.splice(indexOfPrecedingRule, 1); orderedRules.splice(indexOfRule, 0, precedingRule); } } precedingRule = rule; } } return orderedRules; }; return RemoteElementCopier; })(); RemoteDom.RemoteElementCopier = RemoteElementCopier; })(F12.RemoteDom || (F12.RemoteDom = {})); var RemoteDom = F12.RemoteDom; })(F12 || (F12 = {})); //@ sourceMappingURL=remoteElementCopier.js.map var remoteHelpers; (function () { remoteHelpers = new Common.RemoteHelpers(F12.RemoteDom.dom$messageHandlers); F12.RemoteDom.remoteCode.initialize(); })(); //@ sourceMappingURL=remoteMain.js.map var F12; (function (F12) { (function (RemoteDom) { var MutationManager = (function () { function MutationManager(_timerService, _useTimeoutCheck) { this._timerService = _timerService; this._useTimeoutCheck = _useTimeoutCheck; this._treeModifiedCallback = null; this._attributeModifiedCallback = null; this._treeModifiedMap = { }; this._attributeModifiedMap = { }; this._treeModifiedTimeoutWaiting = false; this._attributeModifiedTimeoutWaiting = false; } Object.defineProperty(MutationManager.prototype, "ignoreAttributeMutations", { set: function (ignore) { this._ignoreAttributeMutations = ignore; }, enumerable: true, configurable: true }); MutationManager.prototype.treeModificationTimeoutCallback = function () { var _this = this; var uids = Object.keys(this._treeModifiedMap); var modifications = []; uids.forEach(function (uidToAppend) { var mappedNodeToAppend = _this._treeModifiedMap[uidToAppend]; modifications.push({ uid: uidToAppend, event: "treeModified", children: mappedNodeToAppend.childrenNodes, childCount: mappedNodeToAppend.childrenNodes ? mappedNodeToAppend.childrenNodes.length : 0 }); }); MutationManager.limitChildListSize(modifications, this._treeModifiedMap); this._treeModifiedMap = { }; this._treeModifiedCallback(modifications); this._treeModifiedTimeoutWaiting = false; }; MutationManager.prototype.attributeModificationTimeoutCallback = function () { var _this = this; var attributeModificationList = []; var uids = Object.keys(this._attributeModifiedMap); uids.forEach(function (uid) { var mappedNode = _this._attributeModifiedMap[uid]; if(mappedNode.pendingAttrModified) { var attributeNames = Object.keys(mappedNode.pendingAttrModified); attributeNames.forEach(function (attributeName) { var attributeModification = mappedNode.pendingAttrModified[attributeName]; attributeModificationList.push({ uid: uid, attrName: attributeName, newValue: attributeModification.newValue, attrChange: attributeModification.attrChange }); }); } mappedNode.pendingAttrModified = { }; }); this._attributeModifiedMap = { }; this._attributeModifiedCallback(attributeModificationList); this._attributeModifiedTimeoutWaiting = false; }; MutationManager.limitChildListSize = function limitChildListSize(modifications, uidToMappedNodeMap) { modifications.forEach(function (modification) { if(modification.children && modification.children.length > remoteHelpers.childrenElementLimit) { var mappedNode = uidToMappedNodeMap[modification.uid]; modification.children = modification.children.slice(0, remoteHelpers.childrenElementLimit); } }); }; MutationManager.prototype.fireTreeModified = function (mappedNode, uid) { var _this = this; if(mappedNode.listenForTreeModified) { this._treeModifiedMap[uid] = mappedNode; if(this._useTimeoutCheck.useTimeout()) { if(!this._treeModifiedTimeoutWaiting) { this._timerService.setTimeout(function () { _this.treeModificationTimeoutCallback(); }, 200); this._treeModifiedTimeoutWaiting = true; } } else { this.treeModificationTimeoutCallback(); } } }; MutationManager.prototype.fireAttributeModified = function (element, attrName, newValue, changeType, callback) { var _this = this; if(this._ignoreAttributeMutations) { return; } var mappedNode = this.lookupMappedNode(element); if(mappedNode) { if(attrName === "value") { changeType = (mappedNode.hasValueAttribute ? 1 : 2); mappedNode.hasValueAttribute = true; } if(changeType === 1 || changeType === 3) { for(var i = 0; i < mappedNode.mapped.attributes.length; i++) { if(mappedNode.mapped.attributes[i].name === attrName) { if(changeType === 1) { mappedNode.mapped.attributes[i].value = newValue; } else { mappedNode.mapped.attributes.splice(i, 1); } break; } } } else if(changeType === 2) { mappedNode.mapped.attributes.push({ name: attrName, value: newValue }); } if(!mappedNode.pendingAttrModified) { mappedNode.pendingAttrModified = { }; } var uid = element['uniqueID'] || element['bpt-uid']; mappedNode.pendingAttrModified[attrName] = { event: "attrModified", uid: uid, attrName: attrName, newValue: newValue, attrChange: changeType }; this._attributeModifiedMap[uid] = mappedNode; if(this._useTimeoutCheck.useTimeout()) { if(!this._attributeModifiedTimeoutWaiting) { this._timerService.setTimeout(function () { _this.attributeModificationTimeoutCallback(); }, 200); this._attributeModifiedTimeoutWaiting = true; } } else { this.attributeModificationTimeoutCallback(); } if(callback) { callback(element); } } }; MutationManager.prototype.lookupMappedNode = function (element) { var mappedNode = null; var uid = element['uniqueID'] || element['bpt-uid']; if(uid) { if(htmlTreeHelpers.mapping[uid] && htmlTreeHelpers.mapping[uid].ele === element) { mappedNode = htmlTreeHelpers.mapping[uid]; } } else { for(uid in htmlTreeHelpers.mapping) { if(htmlTreeHelpers.mapping[uid].ele === element) { mappedNode = htmlTreeHelpers.mapping[uid]; break; } } } return mappedNode; }; Object.defineProperty(MutationManager.prototype, "treeModifiedCallback", { set: function (f) { this._treeModifiedCallback = f; }, enumerable: true, configurable: true }); Object.defineProperty(MutationManager.prototype, "attributeModifiedCallback", { set: function (f) { this._attributeModifiedCallback = f; }, enumerable: true, configurable: true }); return MutationManager; })(); RemoteDom.MutationManager = MutationManager; })(F12.RemoteDom || (F12.RemoteDom = {})); var RemoteDom = F12.RemoteDom; })(F12 || (F12 = {})); //@ sourceMappingURL=remoteMutationManager.js.map var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var F12; (function (F12) { (function (RemoteDom) { var AppliedStyleRule = (function () { function AppliedStyleRule(targetElement, cachedStyle) { this.properties = []; this.uid = cachedStyle.uid; this.isInlined = targetElement.style === cachedStyle.style; var cssRule = cachedStyle.rule; this.selector = cssRule ? cssRule.selectorText : undefined; this.parent = this.computeParentMediaRule(cssRule); this.declarationLocation = cachedStyle.source; if(cssRule && cssRule.parentStyleSheet) { this.styleHref = cssRule.parentStyleSheet.href; } } AppliedStyleRule.prototype.setIsInheritedAndTarget = function (isInherited, messageHandlers, targetElement) { this.isInherited = isInherited; this.target = new AppliedStyleTarget(this.isInherited ? messageHandlers.getElementUid(targetElement) : this.uid, targetElement); }; AppliedStyleRule.prototype.computeParentMediaRule = function (ruleApplied) { var parentRule = null; if(ruleApplied) { var mediaParentRule = ruleApplied.parentRule; if(mediaParentRule && mediaParentRule.media) { parentRule = "@media " + mediaParentRule.media.mediaText; } else if(ruleApplied.parentStyleSheet) { var linkElement = ruleApplied.parentStyleSheet.owningElement; if(linkElement.tagName === "LINK" && linkElement.media) { parentRule = "media " + linkElement.media; } } } return parentRule; }; AppliedStyleRule.prototype.addProperty = function (property, position) { this.properties.splice(position, 0, property); }; AppliedStyleRule.prototype.removeProperty = function (property) { for(var i = 0; i < this.properties.length; i++) { if(this.properties[i] === property) { this.properties.splice(i, 1); return; } } }; AppliedStyleRule.prototype.clearProperties = function () { this.properties = []; }; AppliedStyleRule.prototype.forEachProperty = function (func) { for(var i = 0; i < this.properties.length; i++) { func(this.properties[i]); } }; return AppliedStyleRule; })(); RemoteDom.AppliedStyleRule = AppliedStyleRule; var AppliedStyleTarget = (function () { function AppliedStyleTarget(uid, element) { this.uid = uid; this.tagName = element.tagName.toLowerCase(); } return AppliedStyleTarget; })(); RemoteDom.AppliedStyleTarget = AppliedStyleTarget; var AppliedStyleProperty = (function () { function AppliedStyleProperty(name, value, isImportant, isEnabled, status) { this.name = name; this.value = value; this.isImportant = isImportant; this.isEnabled = isEnabled; this.status = status; this.longhand = []; this.isApplied = true; this.uid = remoteHelpers.getUid(); } AppliedStyleProperty.prototype.addLonghandProperty = function (property, position) { this.longhand.splice(position, 0, property); }; AppliedStyleProperty.prototype.clearLonghandProperties = function () { this.longhand = []; }; return AppliedStyleProperty; })(); RemoteDom.AppliedStyleProperty = AppliedStyleProperty; var MappedStylePropertyCollection = (function () { function MappedStylePropertyCollection() { this._mappedProperties = []; } Object.defineProperty(MappedStylePropertyCollection.prototype, "propertyNames", { get: function () { var names = ""; this._mappedProperties.forEach(function (mappedProperty) { names += "." + mappedProperty.appliedProperty.name; }); return names; }, enumerable: true, configurable: true }); MappedStylePropertyCollection.prototype.addProperty = function (mappedProperty, position) { if (typeof position === "undefined") { position = -1; } if(position < 0 || position >= this._mappedProperties.length) { this._mappedProperties.push(mappedProperty); this._mappedProperties.length - 1; position = this._mappedProperties.length; } else { this._mappedProperties.splice(position, 0, mappedProperty); } this.addAppliedProperty(mappedProperty.appliedProperty, position); }; Object.defineProperty(MappedStylePropertyCollection.prototype, "isEmpty", { get: function () { return !this._mappedProperties.length; }, enumerable: true, configurable: true }); Object.defineProperty(MappedStylePropertyCollection.prototype, "hasAppliedProperties", { get: function () { for(var i = 0; i < this._mappedProperties.length; i++) { if(this._mappedProperties[i].appliedProperty.isApplied) { return true; } } return false; }, enumerable: true, configurable: true }); Object.defineProperty(MappedStylePropertyCollection.prototype, "length", { get: function () { return this._mappedProperties.length; }, enumerable: true, configurable: true }); MappedStylePropertyCollection.prototype.addAppliedProperty = function (appliedProperty, position) { }; MappedStylePropertyCollection.prototype.removeProperty = function (removeMappedProperty) { for(var i = 0; i < this._mappedProperties.length; i++) { var mappedProperty = this._mappedProperties[i]; if(mappedProperty === removeMappedProperty) { this._mappedProperties.splice(i, 1); this.removeAppliedProperty(mappedProperty.appliedProperty); } } }; MappedStylePropertyCollection.prototype.removeAppliedProperty = function (appliedProperty) { }; MappedStylePropertyCollection.prototype.forEachProperty = function (func) { for(var i = 0; i < this._mappedProperties.length; i++) { if(func(this._mappedProperties[i], i)) { return i; } } return -1; }; MappedStylePropertyCollection.prototype.clearProperties = function () { this._mappedProperties = []; this.clearAppliedProperties(); }; MappedStylePropertyCollection.prototype.clearAppliedProperties = function () { }; MappedStylePropertyCollection.prototype.lookupMappedProperty = function (matches) { for(var i = 0; i < this._mappedProperties.length; i++) { var mappedProperty = this._mappedProperties[i]; var matched = matches(mappedProperty); if(matched) { return matched; } } }; MappedStylePropertyCollection.prototype.lookupMappedPropertyPosition = function (mappedProperty) { for(var i = 0; i < this._mappedProperties.length; i++) { if(mappedProperty === this._mappedProperties[i]) { return i; } } return -1; }; return MappedStylePropertyCollection; })(); RemoteDom.MappedStylePropertyCollection = MappedStylePropertyCollection; var MappedStyleProperty = (function (_super) { __extends(MappedStyleProperty, _super); function MappedStyleProperty(appliedProperty, mappedRule, diagProperty) { _super.call(this); this.appliedProperty = appliedProperty; this.mappedRule = mappedRule; this.diagProperty = diagProperty; } MappedStyleProperty.prototype.setEnabled = function (isEnabled) { this.forEachProperty(function (mappedProperty) { mappedProperty.setEnabled(isEnabled); }); this.diagProperty.enabled = isEnabled; this.appliedProperty.isEnabled = isEnabled; }; MappedStyleProperty.prototype.setValue = function (value, isImportant, wasEnabledOrInvalid) { var _this = this; var oldValue = this.appliedProperty.value; var oldImportant = this.appliedProperty.isImportant; var setFunc = function () { _this.appliedProperty.value = value; _this.appliedProperty.isImportant = isImportant; }; var resetFunc = function () { _this.appliedProperty.value = oldValue; _this.appliedProperty.isImportant = oldImportant; }; var succeeded = this.mappedRule.commitChanges(setFunc, resetFunc, this.mappedRule.lookupMappedPropertyPosition(this)); if(succeeded) { this.diagProperty.enabled = !this.diagProperty.isEmptyInvalid && wasEnabledOrInvalid && this.diagProperty.isValid; this.appliedProperty.isEnabled = this.diagProperty.enabled; } return succeeded; }; MappedStyleProperty.prototype.setName = function (name) { var _this = this; var oldName = this.appliedProperty.name; var setFunc = function () { _this.appliedProperty.name = name; }; var resetFunc = function () { _this.appliedProperty.name = oldName; }; var succeeded = this.mappedRule.commitChanges(setFunc, resetFunc, this.mappedRule.lookupMappedPropertyPosition(this)); if(succeeded) { this.mappedRule.setAppliedState(this); } return succeeded; }; MappedStyleProperty.prototype.addAppliedProperty = function (appliedProperty, position) { this.appliedProperty.addLonghandProperty(appliedProperty, position); }; MappedStyleProperty.prototype.clearAppliedProperties = function () { this.appliedProperty.clearLonghandProperties(); }; return MappedStyleProperty; })(MappedStylePropertyCollection); RemoteDom.MappedStyleProperty = MappedStyleProperty; var StylePropertyMap = (function () { function StylePropertyMap() { this._properties = { }; } StylePropertyMap.prototype.add = function (uid, property) { this._properties[uid] = property; }; StylePropertyMap.prototype.remove = function (uid) { delete this._properties[uid]; }; StylePropertyMap.prototype.lookupByUid = function (uid) { return this._properties[uid]; }; StylePropertyMap.prototype.clear = function () { this._properties = { }; }; StylePropertyMap.prototype.forEach = function (func) { for(var uid in this._properties) { func(this._properties[uid]); } }; return StylePropertyMap; })(); RemoteDom.StylePropertyMap = StylePropertyMap; var MappedStyleRule = (function (_super) { __extends(MappedStyleRule, _super); function MappedStyleRule(_styleUtilities, appliedRule, cachedStyle) { _super.call(this); this._styleUtilities = _styleUtilities; this.appliedRule = appliedRule; this.cachedStyle = cachedStyle; } MappedStyleRule.prototype.addAppliedProperty = function (appliedProperty, position) { this.appliedRule.addProperty(appliedProperty, position); }; MappedStyleRule.prototype.removeAppliedProperty = function (appliedProperty) { this.appliedRule.removeProperty(appliedProperty); }; MappedStyleRule.prototype.clearAppliedProperties = function () { this.appliedRule.clearProperties(); }; MappedStyleRule.prototype.lookupActiveMappedProperty = function (propertyName) { return this.lookupMappedProperty(function (mappedProperty) { if(mappedProperty.diagProperty.enabled && mappedProperty.diagProperty.activeInBlock && mappedProperty.appliedProperty.name === propertyName) { return mappedProperty; } return mappedProperty.lookupMappedProperty(function (mappedProperty) { if(mappedProperty.diagProperty.enabled && mappedProperty.diagProperty.activeInBlock && mappedProperty.appliedProperty.name === propertyName) { return mappedProperty; } }); }); }; MappedStyleRule.prototype.setAppliedState = function (mappedProperty) { mappedProperty.appliedProperty.isApplied = this._styleUtilities.getAppliedState(mappedProperty); }; MappedStyleRule.prototype.propertyAdd = function (name, value, isImportant, isEnabled, mappedProperty, beforeUid) { var _this = this; var appliedProperty; if(mappedProperty) { appliedProperty = mappedProperty.appliedProperty; appliedProperty.name = name; appliedProperty.value = value; appliedProperty.isImportant = isImportant; appliedProperty.isEnabled = isEnabled; mappedProperty.diagProperty = null; mappedProperty.mappedRule = this; } else { appliedProperty = new AppliedStyleProperty(name, value, isImportant, isEnabled, "Valid"); mappedProperty = new MappedStyleProperty(appliedProperty, this, null); } var beforeProperty = beforeUid ? this.lookupMappedProperty(function (afterProperty) { if(afterProperty.appliedProperty.uid === beforeUid) { return afterProperty; } }) : null; var position = beforeProperty ? this.lookupMappedPropertyPosition(beforeProperty) : this.length; var setFunc = function () { _this.addProperty(mappedProperty, position); }; var resetFunc = function () { _this.removeProperty(mappedProperty); }; if(this.commitChanges(setFunc, resetFunc, position)) { this._styleUtilities.mapProperty(mappedProperty); this.setAppliedState(mappedProperty); return mappedProperty; } }; MappedStyleRule.prototype.propertyRemove = function (mappedProperty) { var _this = this; var position = this.lookupMappedPropertyPosition(mappedProperty); var setFunc = function () { _this.removeProperty(mappedProperty); }; var resetFunc = function () { _this.addProperty(mappedProperty, position); }; if(this.commitChanges(setFunc, resetFunc)) { this._styleUtilities.unmapProperty(mappedProperty); return true; } return false; }; MappedStyleRule.prototype.RemoveAllProperties = function () { var _this = this; var properties = []; this.forEachProperty(function (mappedProperty) { properties.push(mappedProperty); }); var setFunc = function () { _this.clearProperties(); }; var resetFunc = function () { properties.forEach(function (mappedProperty) { _this.addProperty(mappedProperty); }); }; return this.commitChanges(setFunc, resetFunc); }; MappedStyleRule.prototype.movePropertiesFromRule = function (otherRule) { var _this = this; var setFunc = function () { otherRule.forEachProperty(function (mappedProperty) { _this.addProperty(mappedProperty); mappedProperty.mappedRule = _this; }); }; var resetFunc = function () { otherRule.forEachProperty(function (mappedProperty) { _this.removeProperty(mappedProperty); mappedProperty.mappedRule = otherRule; }); }; return this.commitChanges(setFunc, resetFunc) && otherRule.RemoveAllProperties(); }; MappedStyleRule.prototype.reconcileProperty = function (updateApplied, mappedProperty, diagProperty) { var _this = this; var appliedProperty = mappedProperty.appliedProperty; mappedProperty.diagProperty = diagProperty; var changed = false; try { var wasEnabled = appliedProperty.isEnabled; if(diagProperty.isValid) { appliedProperty.isEnabled = diagProperty.enabled = appliedProperty.isEnabled || appliedProperty.status !== "Valid"; } else { appliedProperty.isEnabled = false; } if(wasEnabled !== appliedProperty.isEnabled) { changed = true; } if(updateApplied) { if(appliedProperty.name !== diagProperty.propertyName || appliedProperty.value !== diagProperty.value || appliedProperty.status !== diagProperty.status || appliedProperty.isImportant !== diagProperty.important) { changed = true; appliedProperty.name = diagProperty.propertyName; appliedProperty.value = diagProperty.value; appliedProperty.status = diagProperty.status; appliedProperty.isImportant = diagProperty.important; } var subPropertyNames = mappedProperty.propertyNames; if(subPropertyNames.length && subPropertyNames === diagProperty.longhandNames) { mappedProperty.forEachProperty(function (mappedLonghand, index) { var longhandDiag = diagProperty.longhands[index]; var longhandApplied = mappedLonghand.appliedProperty; mappedLonghand.diagProperty = diagProperty.longhands[index]; longhandApplied.value = longhandDiag.value; longhandApplied.isImportant = longhandDiag.important; longhandApplied.isEnabled = longhandDiag.enabled; }); } else { mappedProperty.forEachProperty(function (mappedSubProperty) { _this._styleUtilities.unmapProperty(mappedSubProperty); }); mappedProperty.clearProperties(); appliedProperty.longhand = []; if(diagProperty.isShorthand) { for(var i = 0; i < diagProperty.longhands.length; i++) { var diagLonghand = diagProperty.longhands[i]; try { var appliedLonghand = new AppliedStyleProperty(diagLonghand.propertyName, diagLonghand.value, diagLonghand.important, diagLonghand.enabled, diagLonghand.status); var mappedLonghand = new MappedStyleProperty(appliedLonghand, this, diagLonghand); mappedProperty.addProperty(mappedLonghand); this._styleUtilities.mapProperty(mappedLonghand); } catch (ex) { Common.RemoteHelpers.encounteredException(ex); } } } } } else { mappedProperty.forEachProperty(function (mappedLonghand, index) { mappedLonghand.diagProperty = diagProperty.longhands[index]; }); } } catch (ex) { Common.RemoteHelpers.encounteredException(ex); } return changed; }; Object.defineProperty(MappedStyleRule.prototype, "cssText", { get: function () { var text = ""; this.forEachProperty(function (mappedProperty) { var appliedProperty = mappedProperty.appliedProperty; text += MappedStyleRule.preparePropertyName(appliedProperty.name) + ": "; text += MappedStyleRule.preparePropertyValue(appliedProperty.value + (appliedProperty.isImportant ? " !important" : "")) + "; "; }); return text; }, enumerable: true, configurable: true }); MappedStyleRule.prototype.commitChanges = function (setFunc, resetFunc, index) { if (typeof index === "undefined") { index = -1; } var _this = this; var oldLength = this.length; setFunc(); var expectedLength = this.length; var isRemove = oldLength > expectedLength; if(!this.cachedStyle.update(this.cssText)) { resetFunc(); return false; } var propertyList = this.cachedStyle.propertyList; var updateSucceeded = propertyList.length === expectedLength; if(!updateSucceeded) { resetFunc(); this.cachedStyle.update(this.cssText); propertyList = this.cachedStyle.propertyList; } this.forEachProperty(function (mappedProperty, nextIndex) { var diagProperty = propertyList[nextIndex]; var needAppliedUpdate = updateSucceeded && !isRemove && (index < 0 || nextIndex === index); _this.reconcileProperty(needAppliedUpdate, mappedProperty, diagProperty); }); this._lastCssText = this.cachedStyle.style.cssText; this._lastPropertyNames = this.cachedStyle.propertyNames; return true; }; MappedStyleRule.prototype.refresh = function () { var _this = this; var changes = []; if(this._lastCssText !== this.cachedStyle.style.cssText) { var propertyList = this.cachedStyle.propertyList; if(this._lastPropertyNames === this.cachedStyle.propertyNames) { this.forEachProperty(function (mappedProperty, index) { if(_this.reconcileProperty(true, mappedProperty, propertyList[index])) { changes.push({ event: "updateProperty", uid: mappedProperty.appliedProperty.uid, obj: mappedProperty.appliedProperty, "select": false }); } }); } else { var listCopy = []; this.forEachProperty(function (mappedProperty, index) { listCopy.push(mappedProperty); }); propertyList.forEach(function (diagProperty) { for(var i = 0; i < listCopy.length; i++) { var mappedProperty = listCopy[i]; if(mappedProperty.diagProperty.propertyName === diagProperty.propertyName) { listCopy.splice(i, 1); if(_this.reconcileProperty(true, mappedProperty, diagProperty)) { changes.push({ event: "updateProperty", uid: mappedProperty.appliedProperty.uid, obj: mappedProperty.appliedProperty, "select": false }); } return; } } var mappedProperty = _this._styleUtilities.processPropertyFromAppliedStyle(_this, _this, _this.cachedStyle, diagProperty); if(mappedProperty) { _this.addProperty(mappedProperty); _this._styleUtilities.mapProperty(mappedProperty); mappedProperty.appliedProperty.isApplied = _this._styleUtilities.getAppliedState(mappedProperty); changes.push({ event: "addProperty", uid: mappedProperty.mappedRule.appliedRule.uid, obj: mappedProperty.appliedProperty, "select": false }); } }); listCopy.forEach(function (mappedProperty) { _this.removeProperty(mappedProperty); _this._styleUtilities.unmapProperty(mappedProperty); changes.push({ event: "removeProperty", uid: mappedProperty.appliedProperty.uid, "select": false }); }); this._lastPropertyNames = this.cachedStyle.propertyNames; } this._lastCssText = this.cachedStyle.style.cssText; } return changes; }; MappedStyleRule.prepareSelector = function prepareSelector(selector) { return selector; }; MappedStyleRule.preparePropertyName = function preparePropertyName(name) { return name; }; MappedStyleRule.preparePropertyValue = function preparePropertyValue(value) { return value; }; return MappedStyleRule; })(MappedStylePropertyCollection); RemoteDom.MappedStyleRule = MappedStyleRule; var DiagnosticProperty = (function () { function DiagnosticProperty(diagProperty, isParsed, _cachedStyle) { this.isParsed = isParsed; this._cachedStyle = _cachedStyle; this.update(diagProperty); if(this.isEmptyInvalid) { this.enabled = false; } } DiagnosticProperty.InvalidEmptyProperties = [ "background", "background-image", "background-attachment", "background-repeat", "background-position-x", "background-position-y", "background-size", "background-origin", "background-clip", "background-color", "content", "font-family", "quotes", ]; DiagnosticProperty.prototype.update = function (diagProperty) { this.isParsed = false; if(this._diagProperty && this.isParsed) { this._diagProperty.enabled = false; } this._diagProperty = diagProperty; this.longhands = []; if(diagProperty.longhands && diagProperty.longhands.length) { for(var i = 0; i < diagProperty.longhands.length; i++) { try { var longhandDiag = diagProperty.longhands[i]; if(longhandDiag.status) { this.longhands.push(new DiagnosticProperty(longhandDiag, false, this._cachedStyle)); } } catch (ex) { Common.RemoteHelpers.encounteredException(ex); } } } }; Object.defineProperty(DiagnosticProperty.prototype, "longhandNames", { get: function () { var names = ""; if(this.isShorthand) { this.longhands.forEach(function (longhandDiagProperty) { names += "." + longhandDiagProperty.propertyName; }); } return names; }, enumerable: true, configurable: true }); Object.defineProperty(DiagnosticProperty.prototype, "activeInBlock", { get: function () { return this._diagProperty.activeInBlock; }, enumerable: true, configurable: true }); Object.defineProperty(DiagnosticProperty.prototype, "enabled", { get: function () { return this._diagProperty.enabled; }, set: function (value) { var wasAllowed = this._cachedStyle.allowMutations; this._cachedStyle.allowMutations = false; this._diagProperty.enabled = value; this._cachedStyle.allowMutations = wasAllowed; }, enumerable: true, configurable: true }); Object.defineProperty(DiagnosticProperty.prototype, "important", { get: function () { return this._diagProperty.important; }, set: function (newImportant) { this._diagProperty.important = newImportant; }, enumerable: true, configurable: true }); Object.defineProperty(DiagnosticProperty.prototype, "isShorthand", { get: function () { return this.isValid && this._diagProperty.longhands.length > 0; }, enumerable: true, configurable: true }); Object.defineProperty(DiagnosticProperty.prototype, "propertyName", { get: function () { return this._diagProperty.propertyName; }, enumerable: true, configurable: true }); Object.defineProperty(DiagnosticProperty.prototype, "value", { get: function () { return this._diagProperty.value; }, set: function (newValue) { this._diagProperty.value = newValue; }, enumerable: true, configurable: true }); Object.defineProperty(DiagnosticProperty.prototype, "status", { get: function () { return this.isEmptyInvalid ? "InvalidValue" : this._diagProperty.status; }, enumerable: true, configurable: true }); Object.defineProperty(DiagnosticProperty.prototype, "isValid", { get: function () { return this.status === "Valid"; }, enumerable: true, configurable: true }); Object.defineProperty(DiagnosticProperty.prototype, "isEmptyInvalid", { get: function () { return this._diagProperty.value.length === 0 && DiagnosticProperty.InvalidEmptyProperties.indexOf(this._diagProperty.propertyName) >= 0; }, enumerable: true, configurable: true }); return DiagnosticProperty; })(); RemoteDom.DiagnosticProperty = DiagnosticProperty; var StyleRuleMap = (function () { function StyleRuleMap() { this._rules = { }; } StyleRuleMap.prototype.add = function (uid, rule) { this._rules[uid] = rule; }; StyleRuleMap.prototype.remove = function (uid) { delete this._rules[uid]; }; StyleRuleMap.prototype.lookupByUid = function (uid) { return this._rules[uid]; }; StyleRuleMap.prototype.clear = function () { this._rules = { }; }; return StyleRuleMap; })(); RemoteDom.StyleRuleMap = StyleRuleMap; var CachedStyle = (function () { function CachedStyle(style, rule) { this.style = style; this.rule = rule; this.allowMutations = true; this.uid = remoteHelpers.getUid(); if(this.rule) { try { var location = styles.getSourceLocation(this.style); if(location && location.fileURI) { this.source = { uri: location.fileURI, line: location.line, column: location.column }; } } catch (e) { Common.RemoteHelpers.encounteredException(e); } } } Object.defineProperty(CachedStyle.prototype, "propertyList", { get: function () { this.refresh(false); return this._propertyList; }, enumerable: true, configurable: true }); CachedStyle.prototype.update = function (cssText) { try { this.allowMutations = false; this.style.cssText = cssText; this.refresh(true); this.allowMutations = true; return true; } catch (e) { this.allowMutations = true; return false; } }; CachedStyle.prototype.refresh = function (force) { if(force || !this._propertyList || this._lastCssText !== this.style.cssText) { var parsedList = styles.getParsedPropertyList(this.style); var mergedList = []; this.propertyNames = ""; for(var i = 0; i < parsedList.length; i++) { this.addProperty(parsedList[i], true, mergedList); } var dynamicList = styles.getDynamicPropertyList(this.style); for(i = 0; i < dynamicList.length; i++) { var dynamicProperty = dynamicList[i]; var found = false; for(var j = mergedList.length - 1; !found && j >= 0; j--) { var parsedProperty = mergedList[j]; try { if(parsedProperty.propertyName === dynamicProperty.propertyName) { parsedProperty.update(dynamicProperty); found = true; } } catch (e) { Common.RemoteHelpers.encounteredException(e); } } if(!found) { this.addProperty(dynamicProperty, false, mergedList); } } this._propertyList = mergedList; this._lastCssText = this.style.cssText; } }; CachedStyle.prototype.addProperty = function (diagProperty, isParsed, mergedList) { var prop; try { prop = new DiagnosticProperty(diagProperty, isParsed, this); } catch (ex) { Common.RemoteHelpers.encounteredException(ex); } if(prop) { mergedList.push(prop); this.propertyNames += "." + diagProperty.propertyName; } }; return CachedStyle; })(); RemoteDom.CachedStyle = CachedStyle; var StyleCache = (function () { function StyleCache(_styleUtilities, _messageHandlers) { this._styleUtilities = _styleUtilities; this._messageHandlers = _messageHandlers; this._cache = []; } StyleCache.prototype.lookup = function (style, element) { var cachedStyle; for(var i = 0; i < this._cache.length; i++) { if(this._cache[i].style === style) { cachedStyle = this._cache[i]; break; } } if(!cachedStyle) { var rule = Common.RemoteHelpers.getRuleForStyleObject(style, element); cachedStyle = new CachedStyle(style, rule); this._cache.push(cachedStyle); } return cachedStyle; }; StyleCache.prototype.clear = function () { this._cache = []; }; return StyleCache; })(); RemoteDom.StyleCache = StyleCache; var StyleUtilities = (function () { function StyleUtilities(_messageHandlers, _domUtilities) { this._messageHandlers = _messageHandlers; this._domUtilities = _domUtilities; this._propertyMap = new StylePropertyMap(); this._ruleMap = new StyleRuleMap(); this._currentRules = []; this.styleProperties = [ "margin-top", "margin-right", "margin-left", "margin-bottom", "padding-top", "padding-right", "padding-left", "padding-bottom", "border-top-width", "border-right-width", "border-left-width", "border-bottom-width", "width", "height", "left", "top" ]; this.elementProperties = [ "clientHeight", "clientWidth", "clientTop", "clientLeft", "offsetLeft", "offsetTop" ]; this._styleCache = new StyleCache(this, this._messageHandlers); } StyleUtilities.prototype.getComputedStyle = function (element) { var doc = element.ownerDocument; var win = Common.RemoteHelpers.getDefaultView(doc); return Common.RemoteHelpers.getComputedStyle(win, element); }; StyleUtilities.prototype.getRulesApplied = function (element) { if(element["msGetRulesApplied"]) { return element["msGetRulesApplied"](); } return styleHelper.GetAppliedStyles(element); }; StyleUtilities.prototype.standardizeLayoutUnits = function (value) { if(value === undefined || value === null) { return; } var groups = String.prototype.match.call(value.toString(), /^(-?[0-9]+(?:\.[0-9]*)?)\s*([a-z]*)$/); if(groups && groups.length > 1) { if(groups[1] === 0) { value = "0"; } else { var decIndex = groups[1].indexOf("."); if(decIndex > -1 && (groups[1].length - decIndex) > 3) { value = "" + parseFloat(groups[1]).toFixed(2) + groups[2]; } if(!groups[2]) { value += "px"; } } } return value; }; StyleUtilities.prototype.stylechange = function (changes) { this._domUtilities.mediaStyleChangeCallback(changes); }; StyleUtilities.prototype.styleAttrModified = function (element) { try { for(var i = 0; i < this._currentRules.length; i++) { var mappedRule = this._currentRules[i]; if(mappedRule.cachedStyle.style === element.style) { if(mappedRule.cachedStyle.allowMutations) { var changes = mappedRule.refresh(); if(changes.length) { this.stylechange(changes); } } break; } } } catch (e) { } }; StyleUtilities.prototype.refreshCurrentRules = function (element) { this._currentElement = element; this._currentRules = this.getCurrentRules(); var retVal = []; for(var i = 0; i < this._currentRules.length; i++) { var rule = this._currentRules[i].appliedRule; retVal.push(rule); } return retVal; }; StyleUtilities.prototype.lookupMappedRule = function (ruleUid) { return this._ruleMap.lookupByUid(ruleUid); }; StyleUtilities.prototype.lookupMappedProperty = function (propertyUid) { return this._propertyMap.lookupByUid(propertyUid); }; StyleUtilities.prototype.mapRule = function (mappedRule) { var _this = this; this._ruleMap.add(mappedRule.appliedRule.uid, mappedRule); mappedRule.forEachProperty(function (mappedProperty) { _this.mapProperty(mappedProperty); mappedProperty.forEachProperty(function (mappedSubProperty) { _this.mapProperty(mappedSubProperty); }); }); }; StyleUtilities.prototype.unmapRule = function (mappedRule) { var _this = this; this._ruleMap.remove(mappedRule.appliedRule.uid); mappedRule.forEachProperty(function (mappedProperty) { _this.unmapProperty(mappedProperty); mappedProperty.forEachProperty(function (mappedSubProperty) { _this.unmapProperty(mappedSubProperty); }); }); }; StyleUtilities.prototype.mapProperty = function (mappedProperty) { this._propertyMap.add(mappedProperty.appliedProperty.uid, mappedProperty); }; StyleUtilities.prototype.unmapProperty = function (mappedProperty) { this._propertyMap.remove(mappedProperty.appliedProperty.uid); }; StyleUtilities.prototype.findStyleSheetByTitle = function (title) { for(var i = 0; i < mainBrowser.document.styleSheets.length; i++) { var sheet = mainBrowser.document.styleSheets[i]; if(sheet.title === title) { return sheet; } } }; StyleUtilities.prototype.addRule = function (selector) { var mappedRule; try { var styleElement = mainBrowser.document.createElement("style"); mainBrowser.document.getElementsByTagName("head")[0].appendChild(styleElement); styleElement.title = "__BROWSERTOOLS_DOMEXPLORER_DYNAMIC_STYLES"; var sheet = this.findStyleSheetByTitle(styleElement.title); styleElement.title = ""; if(sheet.insertRule) { sheet.insertRule(MappedStyleRule.prepareSelector(selector) + "{ }", 0); } else { sheet.addRule(selector, "cursor: inherit;", 0); } var rule = sheet.rules[0]; rule.style.cssText = ""; styles.calculateTracedStyles(this._currentElement); var tracedStyles = styles.getTracedStyles(this._currentElement); mappedRule = this.processRuleFromAppliedStyle(this._currentElement, this._styleCache.lookup(rule.style, this._currentElement), false); this.determineAppliedAndWinningState(mappedRule, tracedStyles); this._currentRules.push(mappedRule); } catch (ex) { } return mappedRule; }; StyleUtilities.prototype.addNewRule = function (selector) { var mappedRule = this.addRule(selector); if(mappedRule) { this.mapRule(mappedRule); } return mappedRule; }; StyleUtilities.prototype.getCurrentRules = function () { var _this = this; styles.calculateTracedStyles(this._currentElement); var rules = []; var haveInlineStyle; this._tracedStyles = styles.getTracedStyles(this._currentElement); var styleObjectsEncountered = []; var mappedRule; this._tracedStyles.getInheritanceChain().forEach(function (traceElement) { var isInherited = traceElement !== _this._currentElement; var appliedStyles = styles.getTracedStyles(traceElement).getAppliedStyles(); appliedStyles.forEach(function (style) { if(styleObjectsEncountered.indexOf(style) < 0) { styleObjectsEncountered.push(style); var isInline = style === traceElement.style; if(isInline && traceElement === _this._currentElement) { haveInlineStyle = true; } rules.push(_this.processRuleFromAppliedStyle(traceElement, _this._styleCache.lookup(style, traceElement), isInherited)); } }); }); if(!haveInlineStyle) { var inlineStyle = this._styleCache.lookup(this._currentElement.style, this._currentElement); mappedRule = this.processRuleFromAppliedStyle(this._currentElement, inlineStyle, false); rules.unshift(mappedRule); } var winningRuleMap = { }; var appliedRules = []; rules.forEach(function (mappedRule) { _this.determineAppliedAndWinningState(mappedRule, winningRuleMap); if((mappedRule.appliedRule.isInlined && !mappedRule.appliedRule.isInherited) || mappedRule.hasAppliedProperties) { appliedRules.push(mappedRule); } }); return appliedRules; }; StyleUtilities.prototype.determineAppliedAndWinningState = function (mappedRule, winningRuleMap) { var _this = this; mappedRule.forEachProperty(function (mappedProperty) { var isApplied = _this.getAppliedState(mappedProperty); mappedProperty.appliedProperty.isApplied = isApplied; mappedProperty.appliedProperty.isWinning = isApplied && _this.getWinningState(mappedProperty, winningRuleMap); }); }; StyleUtilities.prototype.getAppliedState = function (mappedProperty) { return !mappedProperty.mappedRule.appliedRule.isInherited || mappedProperty.diagProperty.status === "UnrecognizedProperty" || this._tracedStyles.isInheritable(mappedProperty.diagProperty.propertyName); }; StyleUtilities.prototype.getWinningState = function (mappedProperty, winningRuleMap) { var _this = this; var diagProperty = mappedProperty.diagProperty; try { var styleUid = mappedProperty.mappedRule.cachedStyle.uid; if(mappedProperty.isEmpty) { return diagProperty.activeInBlock && diagProperty.enabled && diagProperty.isValid && this.calculateWinningStyle(diagProperty.propertyName, winningRuleMap) === styleUid; } var winningCount = 0; if(diagProperty.activeInBlock) { mappedProperty.forEachProperty(function (longhandMappedProperty) { longhandMappedProperty.appliedProperty.isWinning = _this.getWinningState(longhandMappedProperty, winningRuleMap); if(longhandMappedProperty.appliedProperty.isWinning) { winningCount++; } }); } return winningCount > 0; } catch (ex) { Common.RemoteHelpers.encounteredException(ex); } return false; }; StyleUtilities.prototype.processRuleFromAppliedStyle = function (element, cachedStyle, isInherited) { var mappedRule = this.lookupMappedRule(cachedStyle.uid); if(!mappedRule) { var appliedRule = new AppliedStyleRule(element, cachedStyle); var mappedRule = new MappedStyleRule(this, appliedRule, cachedStyle); this.processPropertyListFromAppliedStyle(mappedRule, mappedRule, cachedStyle, cachedStyle.propertyList); this.mapRule(mappedRule); } mappedRule.refresh(); mappedRule.appliedRule.setIsInheritedAndTarget(isInherited, this._messageHandlers, element); return mappedRule; }; StyleUtilities.prototype.processPropertyListFromAppliedStyle = function (mappedPropertyCollection, mappedRule, cachedStyle, propertyList) { if(propertyList) { for(var propertyIndex = 0; propertyIndex < propertyList.length; propertyIndex++) { var diagProperty = propertyList[propertyIndex]; try { var mappedProperty = this.processPropertyFromAppliedStyle(mappedPropertyCollection, mappedRule, cachedStyle, diagProperty); if(mappedProperty) { mappedPropertyCollection.addProperty(mappedProperty); } } catch (e) { Common.RemoteHelpers.encounteredException(e); } } } }; StyleUtilities.prototype.processPropertyFromAppliedStyle = function (mappedPropertyCollection, mappedRule, cachedStyle, diagProperty) { var propertyName = diagProperty.propertyName; var isEnabled = diagProperty.enabled && diagProperty.isValid; var property = new AppliedStyleProperty(propertyName, diagProperty.value, diagProperty.important, isEnabled, diagProperty.status); var mappedProperty = new MappedStyleProperty(property, mappedRule, diagProperty); property.isImportant = diagProperty.important; if(diagProperty.isShorthand) { this.processPropertyListFromAppliedStyle(mappedProperty, mappedRule, cachedStyle, diagProperty.longhands); } return mappedProperty; }; StyleUtilities.prototype.checkPropertyListForWinningProperty = function (propertyName, propertyList) { if(propertyList) { for(var p = 0; p < propertyList.length; p++) { var diagProperty = propertyList[p]; try { if(diagProperty.enabled && diagProperty.activeInBlock) { if(diagProperty.longhands && diagProperty.longhands.length) { for(var l = 0; l < diagProperty.longhands.length; l++) { try { var longhand = diagProperty.longhands[l]; if(longhand.activeInBlock && longhand.enabled && longhand.propertyName === propertyName) { return true; } } catch (e) { Common.RemoteHelpers.encounteredException(e); } } } else if(diagProperty.propertyName === propertyName) { return true; } } } catch (e) { Common.RemoteHelpers.encounteredException(e); } } } }; StyleUtilities.prototype.checkInheritanceChainForWinningStyle = function (propertyName) { styles.calculateTracedStyles(this._currentElement); var tracedStyles = styles.getTracedStyles(this._currentElement); try { var inheritanceChain = tracedStyles.getInheritanceChain(propertyName); var styleObjectsEncountered = []; for(var i = 0; i < inheritanceChain.length; i++) { var traceElement = inheritanceChain[i]; var appliedStyles = styles.getTracedStyles(traceElement).getAppliedStyles(propertyName); for(var j = 0; j < appliedStyles.length; j++) { var style = this._styleCache.lookup(appliedStyles[j], traceElement); var property = this.checkPropertyListForWinningProperty(propertyName, style.propertyList); if(property) { return style.uid; } } } } catch (e) { Common.RemoteHelpers.encounteredException(e); } }; StyleUtilities.prototype.calculateWinningStyle = function (propertyName, winningRuleMap) { var winningStyle; if(winningRuleMap && winningRuleMap.hasOwnProperty(propertyName)) { winningStyle = winningRuleMap[propertyName]; } else { winningStyle = this.checkInheritanceChainForWinningStyle(propertyName); if(winningRuleMap) { winningRuleMap[propertyName] = winningStyle; } } return winningStyle; }; StyleUtilities.prototype.getWinningProperty = function (propertyName) { var winningStyleUid = this.calculateWinningStyle(propertyName); for(var i = 0; i < this._currentRules.length; i++) { var currentRule = this._currentRules[i]; if(currentRule.cachedStyle.uid === winningStyleUid) { var mappedProperty = currentRule.lookupActiveMappedProperty(propertyName); if(mappedProperty) { return mappedProperty; } } } }; StyleUtilities.prototype.copyElementWithStyle = function (element) { var elementCopier = new F12.RemoteDom.RemoteElementCopier(styles); return elementCopier.computeHtmlForAncestorsAndDescendants(element); }; StyleUtilities.prototype.clearCache = function () { this._styleCache.clear(); this._ruleMap.clear(); this._propertyMap.clear(); }; return StyleUtilities; })(); RemoteDom.StyleUtilities = StyleUtilities; })(F12.RemoteDom || (F12.RemoteDom = {})); var RemoteDom = F12.RemoteDom; })(F12 || (F12 = {})); //@ sourceMappingURL=remoteStyle.js.map .BPT-Style-Rule[aria-expanded='false'] > .BPT-Style-ExpandIcon, .BPT-Style-Property[aria-expanded='false'] > .BPT-Style-PropertyValue-ExpandIcon { background-image: url(''); /*[url({plugin-image-icon-item-collapsed})]*/ background-size: 10px 10px; } .BPT-Style-Rule[aria-expanded='true'] > .BPT-Style-ExpandIcon, .BPT-Style-Property[aria-expanded='true'] > .BPT-Style-PropertyValue-ExpandIcon { background-image: url(''); /*[url({plugin-image-icon-item-expanded})]*/ background-size: 10px 10px; } .BPT-Style-Rule[aria-expanded='false'] + .BPT-Style-Properties, .BPT-Style-Property[aria-expanded='false'] + .BPT-Style-Properties, .BPT-Style-Property-LongHand + .BPT-Style-Properties { display: none; } .BPT-Style-Rule:focus, .BPT-Style-Property:focus, .BPT-Style-SubProperty:focus { background: rgba(51, 153, 255, 0.25); /*[{plugin-font-editor-selected-background-color rgba(0.2)}]*/ border-color: transparent; } .BPT-Style-Rule { display: -ms-grid; -ms-grid-columns: 17px 1fr; border: 1px solid transparent; width: 100%; overflow: hidden; } .BPT-Style-ExpandIcon { -ms-grid-column: 1; } .BPT-Style-ExpandIcon, .BPT-Style-PropertyValue-ExpandIcon { background-repeat: no-repeat; width: 10px; height: 10px; margin-top: 4px; margin-left: 3px; } .BPT-Style-Selector-Container { margin-left: 0; -ms-grid-column: 2; overflow: hidden; text-overflow: ellipsis; white-space: normal; word-wrap: break-word; /* max-height here is based on 7 rows that match the line-height of .BPT-HorizontalPane-Right-Content in domExplorer.css. */ max-height: calc(7 * 1.3em); } .BPT-Style-FileReference { float: right; } .BPT-Style-Selector, .BPT-Style-ParentRule { color: #880000; /*[{plugin-font-editor-css-selector-color}]*/ } .BPT-Style-ParentRule { margin-left: 17px; white-space: normal; word-wrap: break-word; } .BPT-Style-BlockOpener { margin-left: 8px; } .BPT-EditBox-Active .BPT-Style-BlockOpener, .BPT-EditBox-Active .BPT-Style-FileReference { display: none; } .BPT-Style-BlockFooter { margin-left: 8px; } .BPT-Style-EmptyRuleSpace { height: 21px; display: none; } .BPT-Style-BlockFooter:only-child > .BPT-Style-EmptyRuleSpace { display: block; } .BPT-Style-Rule[aria-expanded='true'] .BPT-Style-CollapsedBlockFooter { display: none; } .BPT-Style-Property, .BPT-Style-SubProperty { display: -ms-grid; -ms-grid-columns: 32px auto auto auto auto 1fr; } .BPT-Style-SubProperty { padding-left: 15px; } .BPT-Style-Property > .BPT-Style-Property-Checkbox, .BPT-Style-SubProperty > .BPT-Style-Property-Checkbox { margin-left: 19px; margin-right: 0; margin-top: 2px; -ms-grid-column: 1; max-height: 13px; background-color: transparent; width: 10px; padding: 0; } .BPT-Style-Property[aria-invalid='true'] > .BPT-Style-Property-Checkbox { display: none; } .BPT-Style-Property-NotApplied { display: none; } .BPT-Style-PropertyName-Container { -ms-grid-column: 2; } .BPT-Style-PropertyName, .BPT-Style-SubPropertyName { color: #FF0000; /*[{plugin-font-editor-html-attribute-name-color}]*/ } .BPT-Style-PropertyName-Colon { -ms-grid-column: 3; margin-right: 6px; } .BPT-Style-PropertyValue-ExpandIcon { -ms-grid-column: 4; } .BPT-EditBox-Active .BPT-Style-PropertyValue-ExpandIcon, .BPT-Style-Property-LongHand > .BPT-Style-PropertyValue-ExpandIcon { display: none; } .BPT-Style-PropertyValue-Container { -ms-grid-column: 6; white-space: normal; word-wrap: break-word; overflow: hidden; /* max-height here is based on 3 rows that match the line-height of .BPT-HorizontalPane-Right-Content in domExplorer.css. */ max-height: calc(3 * 1.3em); } .BPT-Style-PropertyValue, .BPT-Style-SubPropertyValue { color: #0000FF; /*[{plugin-font-editor-css-value-color}]*/ } .BPT-Style-Color { border: solid black 1px; margin: 2px; width: 10px; height: 10px; -ms-grid-column: 5; } .BPT-EditBox-Active .BPT-Style-Color, .BPT-Style-Color-Hidden, .BPT-EditBox-Active .BPT-Style-Property-SemiColon { display: none; } .BPT-Style-NotWinning { text-decoration: line-through; } .BPT-Style-InvalidProperty { background-image: url('images/red_squiggly.png'); /*[url({plugin-image-icon-red-underline})]*/ background-size: 8px 4px; background-repeat: repeat-x; background-position: left bottom; } .BPT-Style-Item { width: 100%; margin-bottom: 2px; } .BPT-Style-InheritedFrom { color: rgba(0, 0, 0, 0.75); /*[{plugin-tab-header-color}]*/ background-color: #dbe0e7; /*[{plugin-tab-header-background-color}]*/ padding: 0 4px 0 8px; margin-top: 7px; width: 100%; height: 19px; } a.BPT-Style-InheritedFromTarget { color: rgba(0, 0, 0, 0.75); /*[{plugin-tab-header-color} ]*/ text-decoration: underline; } a.BPT-Style-InheritedFromTarget:visited { color: rgba(0, 0, 0, 0.75); /*[{plugin-tab-header-color}]*/ text-decoration: underline; } PNG  IHDR@] cHRMz%u0`:o_F pHYsodIDATx^?G @:u]Be+HpؑHjU驞ީ^wߺ;88888888888O>}MϰiW|֗c\vC=Q= X__݃?n}7֓ 욄wq%vWXc]jwuXie}l$`S?Tu/q: .IO`q+HZwZ"N+ŞŠ':_ V= %|V]Ȝ?O=n@hV sEY/hM$V.N~AeLE!/ |.~au0iK<1_V @1]t ~!2 %';usW]t~U0%~*uCM/X.:7`" wZ7[s_9Ԛ.1>XIiK)6AnAsvIoe1<RZ_p[3Ps J0ߧM{1:DרQ^^w\I-N.M*r>~$hte\`"MY""`$ƦH0GY?7)25u`ME 7gB&96%A4n6%c&ѾU" cumKs.јk JkuDc٪$`LY?W[{]UdA[0"/"Ъ`UI/$jά,=g1#h+.R[TK;; "ߥ( %g֏"YEE@|wmu?YE ˱"]?YIlзkάYE@Al>A[Y{cf@h>`-3 {cfЖjR1k_5"0]Wdо6`&gf`8 |X* /]=*VFhj,־6L>/`"@}Q֯ k LoI.&H’kڗ$d60l {zE3_@SՄ8ךYy0mׄ׹hLݾl5lJ6`h23 Z&VJ?Z t'h6m% uKX7բ"$jAn w)B?qZtUج%"0ED{.i'F~5_[ÚOhig5G`V▴ XkYI5ج /lJljMk6 }ֲ&AwEY {N5k,ZеԺO_?,1|Fun:{{#Ҕc'~KG!Vrr `N:vwqZWACȮ]͂{s4}IbowĚbr 2Q 싡m2Qz/ .` .BPT-TraceStyle-ExpandIcon { background-image: url(''); /*[url({plugin-image-icon-item-collapsed})]*/ background-size: 10px 10px; } .BPT-TraceStyle-Header[aria-expanded='true'] > .BPT-TraceStyle-ExpandIcon { background-image: url(''); /*[url({plugin-image-icon-item-expanded})]*/ background-size: 10px 10px; } .BPT-TraceStyle-Header[aria-expanded='false'] + .BPT-TraceStyle-Collapsed-Section { display: none; } .BPT-TraceStyle-Header:focus, .BPT-TraceStyle-Source:focus { background: TRANSPARENT; /*[{plugin-font-editor-selected-background-color rgba(0.2)}]*/ border-color: transparent; } .BPT-TraceStyle-Header { display: -ms-grid; -ms-grid-columns: 12px 16px auto auto 1fr; border: 1px solid transparent; } .BPT-TraceStyle-ExpandIcon { background-repeat: no-repeat; width: 10px; height: 10px; margin-top: 3px; -ms-grid-column: 1; } .BPT-TraceStyle-Header > .BPT-TraceStyle-HeaderCheckbox { margin: 0; -ms-grid-column: 2; max-height: 18px; background-color: transparent; width: 10px; padding: 0; margin-left: 3px; } .BPT-TraceStyle-HeaderName { -ms-grid-column: 3; } .BPT-TraceStyle-HeaderName:after { content: ":"; color: TRANSPARENT; /*[{plugin-font-editor-color}]*/ padding-right: 6px; } .BPT-TraceStyle-PropertyName { color: #FF0000; /*[{plugin-font-editor-html-attribute-name-color}]*/ white-space: normal; word-wrap: break-word; } .BPT-TraceStyle-HeaderValue { -ms-grid-column: 5; } .BPT-TraceStyle-PropertyValue { color: #0000FF; /*[{plugin-font-editor-css-value-color}]*/ white-space: normal; word-wrap: break-word; } .BPT-TraceStyle-HeaderColor { -ms-grid-column: 4; } .BPT-TraceStyle-Color { border: solid black 1px; margin: 2px; width: 10px; height: 10px; padding: 0px; } .BPT-TraceStyle-Source { display: -ms-grid; -ms-grid-columns: 42px auto auto auto auto; border: 1px solid transparent; } .BPT-TraceStyle-Source > .BPT-TraceStyle-SourceCheckbox { margin-left: 29px; margin-right: 0; margin-top: 2px; -ms-grid-column: 1; max-height: 18px; background-color: transparent; width: 10px; padding: 0; } .BPT-TraceStyle-Selector { margin-left: 0px; color: #880000; /*[{plugin-font-editor-css-selector-color}]*/ -ms-grid-column: 2; white-space: normal; word-wrap: break-word; } .BPT-TraceStyle-Separator { margin-left: 4px; margin-right: 4px; -ms-grid-column: 3; } .BPT-TraceStyle-SourceValue { -ms-grid-column: 5; } .BPT-TraceStyle-SourceColor { -ms-grid-column: 4; } .BPT-TraceStyle-FileReference { float: right; } .BPT-TraceStyle-NotWinning { text-decoration: line-through; } .BPT-TraceStyle-Item { width: calc(100% - 2px); }PNG  IHDR bOK pHYs+ cHRMz%u0`:o_FIDATxڔ 0 ?0#C3LnxFhG%P8Ey6f7q `uMRNa3Z^z\!&J ;OФ$IgyBp~Q&ZaN~)&;4De#PIENDB`PNG  IHDR bOK pHYs+ cHRMz%u0`:o_FIDATxڔA 0 d]vTK7! e_^7Q~ Hu@&ZA|Z^z!&s R*$N:39Wub/M?3jwe7n;4IENDB`PNG  IHDR bOK pHYs+ cHRMz%u0`:o_FIDATxڌб0 dP0IFH(#0i;`5Rt&Mj$HZeRaE4+#I04@'"L/3_ܧ ,k?N\wSD{4IENDB`PNG  IHDR bOK pHYs+ cHRMz%u0`:o_FIDATxڌ0ߌPClLt XJBf8hwy;Y|RaLջXɂ ?}ʂ)rQUT5 뫳Sw>bqlnLJ 5> }n W C3?n4c"6Q:OIENDB`PNG  IHDR$l gAMA|Q cHRMR@}y<s,٩<9SbL!GĈ 3,F0+7T3IlpX"61"H _qW,d ėrIKst.ښAdp&+g]RәY2EE44432PuoJEzg`̉j- -b8o׿M]9La.+-%Mȧg3YះuAxEK i<:ŹPcu*@~(  ]o0 ~y*s7g%9%(3H*@C`-pn VH@ A1 jPA3hA'8΃Kn`Lg` a!2D!H҇ dAP B Byf*z: @]h ~L CUp΅ p%;56< ?" GxG iE>&2 oQEGlQP UFFuzQ7QcYG4G۠t]nB/o'Я1 xb"1I>Lf3bX} *QYvGĩp( &q x)&gsF|7:~@&h!$&B%pH$D.q#xx8F|K!\H$!i.%L";r3EHK-AFCbH$^RSIrdd 3Rx)-))zR#RsiSiT#Wd2Z2n2l2d)EBaQ6S))T UEMSPgeedɆfȞ!4--VJ;N g%K-sɵݖ{'OwO%)P_RRۥEK/+))U<د8䡔TtAiF쨜\|FyZbU)W9.Kw+YUEUOUjꂚZZZCu:C=^\G}VCEO#OE&^WOs^K[+\kV֔vv[]n>z^^u}XROm`m3h01$:fь|:kG23hbabhrT4ߴw3=3Y-s.q_vǂbgբ⃥%߲rJ*֪jAe0JOY6rvvtXLǎl&I']$NϝM.6.\ι"En2nnn[g=,=t٪E2}4\j5loDŽǞ~q=''Z^utv&vvEv >mяN9-{ LOgsΝK?7s>xOL n\x }N}g/]>uɫ,u[dS@u]7ot.<30tKn]p;;SwSyoEVC rvryƳyAȵa1;2l|Qޕt[%pnSlx]q.IOh%e(٘.[Bh4gJzferrCvWR`hrU0'ki'WYEb9R~]tw`8#P}}ttEQpB0bv7NA awA[P ` F *a F J9U  dj`âq) F BJ#¨J#.&>c >@|ux`.3%˕EU`ɑikrGX֤*4 4>USnNdžX|?9;*"޶@M+tckH91qMsѽ>`2lVRCInj:#zSdtAȵaX6|%KcHWnSlx]q.IOgggh%eD(.[Bh4gJzferꛛ=dg|Ko4*Uo݄L;*èa<Ȼ*nőb( ᡾\mk FAw?bv7NA awA[P ` F *a F J9U  dj`âq) F BJ#¨J#.&>c >@u7ԫ2`MrxcU`ɑiXI9²&uWѠ|d񡨒Ƨt[p?6] cA#IENDB`PNG  IHDR$l gAMA|Q cHRMR@}y<s,٩<9SbL!GĈ 3,F0+7T3IlpX"61"H _qW,d ėrIKst.ښAdp&+g]RәY2EE44432PuoJEzg`̉j- -b8o׿M]9La.+-%Mȧg3YះuAxEK i<:ŹPcu*@~(  ]o0 ~y*s7g%9%(3H*@C`-pn VH@ A1 jPA3hA'8΃Kn`Lg` a!2D!H҇ dAP B Byf*z: @]h ~L CUp΅ p%;56< ?" GxG iE>&2 oQEGlQP UFFuzQ7QcYG4G۠t]nB/o'Я1 xb"1I>Lf3bX} *QYvGĩp( &q x)&gsF|7:~@&h!$&B%pH$D.q#xx8F|K!\H$!i.%L";r3EHK-AFCbH$^RSIrdd 3Rx)-))zR#RsiSiT#Wd2Z2n2l2d)EBaQ6S))T UEMSPgeedɆfȞ!4--VJ;N g%K-sɵݖ{'OwO%)P_RRۥEK/+))U<د8䡔TtAiF쨜\|FyZbU)W9.Kw+YUEUOUjꂚZZZCu:C=^\G}VCEO#OE&^WOs^K[+\kV֔vv[]n>z^^u}XROm`m3h01$:fь|:kG23hbabhrT4ߴw3=3Y-s.q_vǂbgբ⃥%߲rJ*֪jAe0JOY6rvvtXLǎl&I']$NϝM.6.\ι"En2nnn[g=,=t٪E2}4\j5loDŽǞ~q=''Z^utv&vvEv >mяN9-{ LOgsΝK?7s>xOL n\x }N}g/]>uɫ,u[dS@u]7ot.<30tKn]p;;SwSyoEV IDATx Fex=w$NzRZ~l0[B$a( mط`L7sQhs5 H1A 8D* % ^-!sH핣zY_,`6"3w9; 1B@y1@-PmGo[u (ui!x f|+ U`)H# 0&,_m&RIENDB`PNG  IHDRv pHYs+ cHRMz%u0`:o_FIDATxڤ1 PDz IJ"_`a m5rT[n?/2 3#1F`FPny8g`?L} 6W!M8nn"9<@f7pYnňQo8z?zu\0K&@8IENDB`PNG  IHDR$l gAMA|Q cHRMR@}y<s,٩<9SbL!GĈ 3,F0+7T3IlpX"61"H _qW,d ėrIKst.ښAdp&+g]RәY2EE44432PuoJEzg`̉j- -b8o׿M]9La.+-%Mȧg3YះuAxEK i<:ŹPcu*@~(  ]o0 ~y*s7g%9%(3H*@C`-pn VH@ A1 jPA3hA'8΃Kn`Lg` a!2D!H҇ dAP B Byf*z: @]h ~L CUp΅ p%;56< ?" GxG iE>&2 oQEGlQP UFFuzQ7QcYG4G۠t]nB/o'Я1 xb"1I>Lf3bX} *QYvGĩp( &q x)&gsF|7:~@&h!$&B%pH$D.q#xx8F|K!\H$!i.%L";r3EHK-AFCbH$^RSIrdd 3Rx)-))zR#RsiSiT#Wd2Z2n2l2d)EBaQ6S))T UEMSPgeedɆfȞ!4--VJ;N g%K-sɵݖ{'OwO%)P_RRۥEK/+))U<د8䡔TtAiF쨜\|FyZbU)W9.Kw+YUEUOUjꂚZZZCu:C=^\G}VCEO#OE&^WOs^K[+\kV֔vv[]n>z^^u}XROm`m3h01$:fь|:kG23hbabhrT4ߴw3=3Y-s.q_vǂbgբ⃥%߲rJ*֪jAe0JOY6rvvtXLǎl&I']$NϝM.6.\ι"En2nnn[g=,=t٪E2}4\j5loDŽǞ~q=''Z^utv&vvEv >mяN9-{ LOgsΝK?7s>xOL n\x }N}g/]>uɫ,u[dS@u]7ot.<30tKn]p;;SwSyoEV5\6&T́1JHeL}hV'pGB-{3o(]I5{2Zmi*8B3:#{Z3`s #aJ r"6FGRTr"~mZdH ^.9:Ol]󉎊׿9}d}TDz`#l@ЈƸtܥosy/C*yJjSs"prҤDno/muSS+ ^1'aEn;boN[$'2ujOHr?HJ%¥KVp*)uA.8 IVd2 prZ ^'7N^ڒoG SZԤFhrqk( 1'8GI5* !Atp Fw[ WjBM0]A<9K`sg9>7elQB,5 a nd>j*9 j.V eeCj5wTHq\o`z0GgZ|̪zXo{2:L w)fLjQǪ/2$.8bɼ\r"KtMT"GNLꁯ L.Y!,#6yc kT gOOOD낉KD.I%O\ÔP9U+:9ۆr9U"@HKbR޹$I'Pb̲RrR_g傲]P u%}lRLlAZnRx# )IX[mHRu +IAʿ9 }e:H_$ [|e/rɀ\u=66x`d.ղG1Z/~A@hS{ c?1I9SCxBsu9F @L}hSο% i8A?ANn{G聱]jS<.bΜ#@ 98s6+%U9 mY]2yC7Lj~, }{H $oKw-22ZH6pr )!58[$pǤV4wURwl6ڒ*IENDB`PNG  IHDR$l gAMA|Q cHRMR@}y<s,٩<9SbL!GĈ 3,F0+7T3IlpX"61"H _qW,d ėrIKst.ښAdp&+g]RәY2EE44432PuoJEzg`̉j- -b8o׿M]9La.+-%Mȧg3YះuAxEK i<:ŹPcu*@~(  ]o0 ~y*s7g%9%(3H*@C`-pn VH@ A1 jPA3hA'8΃Kn`Lg` a!2D!H҇ dAP B Byf*z: @]h ~L CUp΅ p%;56< ?" GxG iE>&2 oQEGlQP UFFuzQ7QcYG4G۠t]nB/o'Я1 xb"1I>Lf3bX} *QYvGĩp( &q x)&gsF|7:~@&h!$&B%pH$D.q#xx8F|K!\H$!i.%L";r3EHK-AFCbH$^RSIrdd 3Rx)-))zR#RsiSiT#Wd2Z2n2l2d)EBaQ6S))T UEMSPgeedɆfȞ!4--VJ;N g%K-sɵݖ{'OwO%)P_RRۥEK/+))U<د8䡔TtAiF쨜\|FyZbU)W9.Kw+YUEUOUjꂚZZZCu:C=^\G}VCEO#OE&^WOs^K[+\kV֔vv[]n>z^^u}XROm`m3h01$:fь|:kG23hbabhrT4ߴw3=3Y-s.q_vǂbgբ⃥%߲rJ*֪jAe0JOY6rvvtXLǎl&I']$NϝM.6.\ι"En2nnn[g=,=t٪E2}4\j5loDŽǞ~q=''Z^utv&vvEv >mяN9-{ LOgsΝK?7s>xOL n\x }N}g/]>uɫ,u[dS@u]7ot.<30tKn]p;;SwSyoEV߂r11'}F^KuaaWry}8s1Lqwa_?. I쇝yyirUx̓ 9f8?-_Ksy-~/ZfJީ6/E}L)9en"7wROӛi%~H,;c<9g˕ b.'w1K> + I| )U/GYXxfbBԚ Qk++^,DYXx{6X-(aq"o^'A0^QߟDEKttA }{-$+ћyy\"rUxc\6<ƩrhaZK 0N$%CsU(w0O.hacgشޢ+mh`t=*ϕ,1E(#V$|1\ O)]!mejh05XcJAԃ912$^\*A0g>lA)bO̓3`\ԐXg\$q1X,L r˕$C>Ou0C1jzrŋ5/֬W,WXZ^\b!jzrŋػoA#Ee h?]IENDB`PNG  IHDR$l gAMA|Q cHRMR@}y<s,٩<9SbL!GĈ 3,F0+7T3IlpX"61"H _qW,d ėrIKst.ښAdp&+g]RәY2EE44432PuoJEzg`̉j- -b8o׿M]9La.+-%Mȧg3YះuAxEK i<:ŹPcu*@~(  ]o0 ~y*s7g%9%(3H*@C`-pn VH@ A1 jPA3hA'8΃Kn`Lg` a!2D!H҇ dAP B Byf*z: @]h ~L CUp΅ p%;56< ?" GxG iE>&2 oQEGlQP UFFuzQ7QcYG4G۠t]nB/o'Я1 xb"1I>Lf3bX} *QYvGĩp( &q x)&gsF|7:~@&h!$&B%pH$D.q#xx8F|K!\H$!i.%L";r3EHK-AFCbH$^RSIrdd 3Rx)-))zR#RsiSiT#Wd2Z2n2l2d)EBaQ6S))T UEMSPgeedɆfȞ!4--VJ;N g%K-sɵݖ{'OwO%)P_RRۥEK/+))U<د8䡔TtAiF쨜\|FyZbU)W9.Kw+YUEUOUjꂚZZZCu:C=^\G}VCEO#OE&^WOs^K[+\kV֔vv[]n>z^^u}XROm`m3h01$:fь|:kG23hbabhrT4ߴw3=3Y-s.q_vǂbgբ⃥%߲rJ*֪jAe0JOY6rvvtXLǎl&I']$NϝM.6.\ι"En2nnn[g=,=t٪E2}4\j5loDŽǞ~q=''Z^utv&vvEv >mяN9-{ LOgsΝK?7s>xOL n\x }N}g/]>uɫ,u[dS@u]7ot.<30tKn]p;;SwSyoEVZ MGzE@{u^]WE@{u^]WE@{u^]W-ڄ#mBӑީx5A]{:31(zebFcČFz8D 9Mh:h&4]E@{u^]WE@{u^]WE@{u^]wh>Z MGzQ tUbFcČxk21tfbF#=L "jA&4}h"h.ګ"h.ګ"h.;Z MGz-ڄ#S(jQ *1tfboe8W96ԉ IENDB`PNG  IHDR$l gAMA|Q cHRMR@}y<s,٩<9SbL!GĈ 3,F0+7T3IlpX"61"H _qW,d ėrIKst.ښAdp&+g]RәY2EE44432PuoJEzg`̉j- -b8o׿M]9La.+-%Mȧg3YះuAxEK i<:ŹPcu*@~(  ]o0 ~y*s7g%9%(3H*@C`-pn VH@ A1 jPA3hA'8΃Kn`Lg` a!2D!H҇ dAP B Byf*z: @]h ~L CUp΅ p%;56< ?" GxG iE>&2 oQEGlQP UFFuzQ7QcYG4G۠t]nB/o'Я1 xb"1I>Lf3bX} *QYvGĩp( &q x)&gsF|7:~@&h!$&B%pH$D.q#xx8F|K!\H$!i.%L";r3EHK-AFCbH$^RSIrdd 3Rx)-))zR#RsiSiT#Wd2Z2n2l2d)EBaQ6S))T UEMSPgeedɆfȞ!4--VJ;N g%K-sɵݖ{'OwO%)P_RRۥEK/+))U<د8䡔TtAiF쨜\|FyZbU)W9.Kw+YUEUOUjꂚZZZCu:C=^\G}VCEO#OE&^WOs^K[+\kV֔vv[]n>z^^u}XROm`m3h01$:fь|:kG23hbabhrT4ߴw3=3Y-s.q_vǂbgբ⃥%߲rJ*֪jAe0JOY6rvvtXLǎl&I']$NϝM.6.\ι"En2nnn[g=,=t٪E2}4\j5loDŽǞ~q=''Z^utv&vvEv >mяN9-{ LOgsΝK?7s>xOL n\x }N}g/]>uɫ,u[dS@u]7ot.<30tKn]p;;SwSyoEVR;www0e'777(1X_ӭ>A؎^m--1;FK);F3KxǎQג׎Q^߯f {fb{f6OGLlc)u8jfd3KxXQ33Y|w8jXm I~9j(*s̜bKX .items { margin: 0px; padding: 0px; left: 0px; right: 0px; list-style-type: none; white-space: nowrap; position: absolute; } .scroll.virtualizing-list-view > .items { right: 18px; } .grid { border: 1px solid transparent; overflow: hidden; position: relative; box-sizing: border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; } .grid-focus { top: 5px; width: 50%; height: 3px; position: absolute; outline: none; } .grid-canvas { left: 0px; top: 0px; right: 0px; bottom: 0px; overflow: auto; position: absolute; box-sizing: border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -moz-user-select: -moz-none; } .grid-canvas .grid-row-splitter { cursor: e-resize; width: 3px; position: absolute; z-index: 10; height: 100% } .grid-canvas .grid-row-splitter.active { border-left: 3px solid #E5E6ED; /*[3px solid {plugin-debugger-grid-active-splitter-color}]*/ } .grid-canvas .grid-row-splitter.fixed { cursor: default; } .has-header.grid .grid-canvas { top: 33px; } .grid-content-spacer { left: 0px; top: 0px; width: 1px; height: 1px; position: absolute; } .grid-header { left: 0px; top: 0px; height: 2.2em; right: 0px; overflow: hidden; position: absolute; z-index: 6; box-sizing: border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; } .grid-header-canvas { left: 0px; top: 0px; width: 999999px; bottom: 0px; overflow: hidden; border-bottom-color: transparent; border-bottom-width: 1px; border-bottom-style: solid; position: absolute; box-sizing: border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; } .grid-header-column { background-color: TRANSPARENT; /*[{vs-command-bar-options-background-color}]*/ width: 20px; height: 100%; overflow: visible; border-right-color: transparent; border-right-width: 1px; border-right-style: solid; float: left; position: relative; cursor: default; box-sizing: border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; } .grid-header-column:hover { background-color: rgb(238, 238, 238); /*[{vs-command-bar-mouse-over-background-begin-color}]*/ } .grid-header-column > .separator { top: 0px; width: 12px; right: -6px; bottom: 0px; position: absolute; z-index: 6; cursor: e-resize; } .grid-header-column > .sort-handle { top: 2px; width: 7px; height: 7px; right: -5000px; overflow: hidden; position: absolute; z-index: 3; } .ascending.grid-header-column > .sort-handle { background: url("../Common/images/common_icons.png") no-repeat -2128px 50% !important; /*[url({f12-image-common-icons}) no-repeat -2128px 50% !important]*/ left: 49%; } .descending.grid-header-column > .sort-handle { background: url("../Common/images/common_icons.png") no-repeat -2171px 50% !important; /*[url({f12-image-common-icons}) no-repeat -2171px 50% !important]*/ left: 49%; } .grid-header-column > .title { padding: 4px; left: 0px; top: 3px; text-align: left; right: 0px; color: rgb(128, 128, 128); /*[{plugin-color}]*/ overflow: hidden; vertical-align: middle; white-space: nowrap; position: absolute; cursor: default; -ms-text-overflow: ellipsis; } .grid-header-column > .indented-title { text-indent: 16px; } .ascending.grid-header-column > .title { } .descending.grid-header-column > .title { } .grid-column-sizing { width: 0px; border-left-color: rgb(204, 204, 204); /*[{vs-tree-view-selected-item-inactive-color}]*/ border-left-width: 1px; border-left-style: solid; position: absolute; z-index: 5; opacity: 0.5; -moz-opacity: 0.5; } .grid-column-moving { padding: 7px 4px 4px; height: 100%; overflow: hidden; vertical-align: middle; white-space: nowrap; position: absolute; z-index: 5; cursor: pointer; -ms-text-overflow: ellipsis; opacity: 0.75; background-color: rgb(220, 230, 244) !important; /*[{vs-command-bar-mouse-down-background-begin-color} !important]*/ -moz-opacity: 0.75; } .grid-column-moving-placer { background: url("../Common/images/columnmove.png") -2px -4px; /*[url({f12-debugger-image-grid-control-column-move}) -2px -4px]*/ width: 7px; height: 4px; font-size: 1pt; position: absolute; z-index: 100; } .grid-gutter { left: 0px; top: 0px; width: 20px; height: 50px; overflow: hidden; position: absolute; z-index: 6; } .grid-gutter-canvas { left: 0px; top: 0px; width: 29px; height: 1px; position: absolute; z-index: 5; } .grid-gutter-header { left: 0px; top: 0px; width: 20px; bottom: 0px; position: absolute; z-index: 7; } .grid-gutter-row { width: 100%; height: 1em; overflow: hidden; position: absolute; } .grid-gutter-cell { border: currentColor; height: 100%; overflow: hidden; vertical-align: middle; float: left; display: table-cell; position: relative; cursor: default; } .grid-gutter-menu { margin: 0px 3px; width: 12px; } .grid-gutter-icon { width: 16px; height: 100%; } .grid-gutter-row-normal { border-width: 1px 0px 1px 1px; border-style: solid none solid solid; border-color: rgb(252, 252, 252) currentColor rgb(252, 252, 252) rgb(252, 252, 252); /*[{vs-toolbox-background-color} currentColor {vs-toolbox-background-color} {vs-toolbox-background-color}]*/ background-color: rgb(252, 252, 252); /*[{vs-toolbox-background-color}]*/ } .grid-gutter-row-selected { border-width: 1px 0px 1px 1px; border-style: solid none solid solid; border-color: rgb(252, 252, 252) currentColor rgb(252, 252, 252) rgb(252, 252, 252); /*[{vs-toolbox-background-color} currentColor {vs-toolbox-background-color} {vs-toolbox-background-color}]*/ background-color: rgb(252, 252, 252); /*[{vs-toolbox-background-color}]*/ } .grid-gutter-row-selected .grid-gutter-drop { background: url("../Common/images/common_icons.png") no-repeat -401px 50% !important; /*[url({f12-image-common-icons}) no-repeat -401px 50% !important]*/ } .grid-gutter-drop:hover { background: url("../Common/images/common_icons.png") no-repeat -401px 50% !important; /*[url({f12-image-common-icons}) no-repeat -401px 50% !important]*/ } .grid-gutter-row-selected-blur { border-width: 1px 0px 1px 1px; border-style: solid none solid solid; border-color: rgb(252, 252, 252) currentColor rgb(252, 252, 252) rgb(252, 252, 252); /*[{vs-toolbox-background-color} currentColor {vs-toolbox-background-color} {vs-toolbox-background-color}]*/ background-color: rgb(252, 252, 252); /*[{vs-toolbox-background-color}]*/ } .grid-gutter-row-selected-blur .grid-gutter-drop { background: url("../Common/images/common_icons.png") no-repeat -401px 50% !important; /*[url({f12-image-common-icons}) no-repeat -401px 50% !important]*/ } .grid-gutter-row-current { border-width: 1px 0px 1px 1px; border-style: solid none solid solid; border-color: rgb(252, 252, 252) currentColor rgb(252, 252, 252) rgb(252, 252, 252); /*[{vs-toolbox-background-color} currentColor {vs-toolbox-background-color} {vs-toolbox-background-color}]*/ background-color: rgb(252, 252, 252); /*[{vs-toolbox-background-color}]*/ } .grid-row { margin: 0px; width: 100%; color: rgb(0, 0, 0); /*[{plugin-color}]*/ overflow: hidden; position: absolute; cursor: default; box-sizing: border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; } .grid-row:hover { color: rgb(0, 0, 0); /*[{plugin-treeview-content-mouseover-color}]*/ background-color: rgb(242, 247, 253); /*[{plugin-treeview-content-mouseover-background-color}]*/ } .grid-row-normal { border: 1px solid transparent; } .grid-row-selected, .grid-row-selected:hover { color: rgb(0, 0, 0); /*[{plugin-treeview-content-selected-color}]*/ background-color: rgb(220, 235, 252); /*[{plugin-treeview-content-selected-background-color}]*/ } .grid-row-selected a { text-decoration: none; } .grid-row-selected a:hover { text-decoration: underline; } .grid-row-selected a:visited { } .grid-row-selected a:active { } .grid-row-selected-blur { color: rgb(0, 0, 0); /*[{plugin-treeview-content-inactive-selected-color}]*/ background-color: rgb(230, 230, 230); /*[{plugin-treeview-content-inactive-selected-background-color}]*/ } .grid-row-drop-active { border-top-color: blue; border-top-width: 2px; border-top-style: solid; } .grid-row-dragging { background-color: rgb(230, 230, 230); } .grid-row-group { width: 100%; color: rgb(0, 0, 0); overflow: hidden; font-weight: bold; border-bottom-color: rgb(240, 240, 240); border-bottom-width: 1px; border-bottom-style: solid; position: absolute; cursor: default; background-color: rgb(255, 255, 255); } .grid-cell { padding: 1px 4px 4px 4px; border: currentColor; width: 100px; text-align: left; text-indent: 2px; overflow: hidden; vertical-align: middle; float: left; display: table-cell; white-space: nowrap; position: relative; cursor: default; -ms-text-overflow: ellipsis; } .grid-cell input[type='checkbox'] { margin: 0px; } .grid-cell-first { width: 100%; height: 100%; text-align: left; overflow: hidden; vertical-align: middle; cursor: default; -ms-text-overflow: ellipsis; } .grid-edit-box { border: none; width: 100%; height: 100%; } .grid-tree-icon { text-indent: 0px; position: absolute; cursor: pointer; } .grid-cell-glyph { margin-top: 3px; position: absolute; overflow: hidden; vertical-align: middle; display: inline-block; width: 10px; height: 10px; } .sample-containers { display: none; } .samples-main { left: 0px; top: 0px; right: 0px; bottom: 0px; overflow: hidden; position: fixed; } .samples-main > .right { left: 200px; top: 0px; right: 0px; bottom: 0px; overflow: auto; position: absolute; } .samples-main > .right .demoview > div { height: 400px; overflow: auto; } html, body { height: 100%; width: 100%; line-height: 1.1em; background-color: TRANSPARENT; /*[{plugin-font-editor-background-color}]*/ overflow: hidden; } #root { display: -ms-grid; -ms-grid-rows: auto 1fr; -ms-grid-columns: 100%; height: 100%; width: 100%; } .BPT-Toolbar { -ms-grid-row: 1; } .BPT-Toolbar > .BPT-ToolbarContents > .buttons > div { display: inline-block; margin-right: 10px; } .BPT-Toolbar > .BPT-ToolbarContents .toggledOn { background-color: TRANSPARENT; /*[{f12-toolbar-button-selected-color}]*/ border-color: TRANSPARENT; /*[{f12-toolbar-button-selected-border-color}]*/ } .BPT-Toolbar > .BPT-ToolbarContents #continueButton > .buttonIcon { background-image: url(''); /*[url({f12-debugger-toolbar-button-image-continue})]*/ } .BPT-Toolbar > .BPT-ToolbarContents #breakButton > .buttonIcon { background-image: url(''); /*[url({f12-debugger-toolbar-button-image-break-all})]*/ } .BPT-Toolbar > .BPT-ToolbarContents #stepIntoButton > .buttonIcon { background-image: url(''); /*[url({f12-debugger-toolbar-button-image-step-into})]*/ } .BPT-Toolbar > .BPT-ToolbarContents #stepOverButton > .buttonIcon { background-image: url(''); /*[url({f12-debugger-toolbar-button-image-step-over})]*/ } .BPT-Toolbar > .BPT-ToolbarContents #stepOutButton > .buttonIcon { background-image: url(''); /*[url({f12-debugger-toolbar-button-image-step-out})]*/ } .BPT-Toolbar > .BPT-ToolbarContents #breakWorkerButton > .buttonIcon { background-image: url(''); /*[url({f12-debugger-toolbar-button-image-break-worker})]*/ } .BPT-Toolbar > .BPT-ToolbarContents #prettyPrintButton > .buttonIcon { background-image: url(''); /*[url({f12-debugger-toolbar-button-image-toggle-pretty-print})]*/ } .BPT-Toolbar > .BPT-ToolbarContents #wordWrapButton > .buttonIcon { background-image: url(''); /*[url({f12-debugger-toolbar-button-image-toggle-word-wrap})]*/ } .BPT-Toolbar > .BPT-ToolbarContents #breakOnExceptionsButton > .buttonIcon { background-image: url(''); /*[url({f12-debugger-toolbar-button-image-break-on-exceptions})]*/ } .BPT-Toolbar > .BPT-ToolbarContents #breakOnExceptionsButton.toolbarButtonMouseHover > .buttonIcon { background-position-y: -18px; } .BPT-Toolbar > .BPT-ToolbarContents #breakOnExceptionsButton.breakNone:not(.toolbarButtonMouseHover):not(.toolbarButtonStateDisabled) > .buttonIcon { background-position-y: 0px; } .BPT-Toolbar > .BPT-ToolbarContents #breakOnExceptionsButton.breakAll:not(.toolbarButtonMouseHover):not(.toolbarButtonStateDisabled) > .buttonIcon { background-position-y: -54px; } .BPT-Toolbar > .BPT-ToolbarContents #breakOnExceptionsButton.breakUnhandled:not(.toolbarButtonMouseHover):not(.toolbarButtonStateDisabled) > .buttonIcon { background-position-y: -36px; } .BPT-Toolbar > .BPT-ToolbarContents .toggledOn:not(.toolbarButtonMouseHover):not(.toolbarButtonStateDisabled) > .icon_16x16 { background-position-y: -18px; } /* Begin css styling for searchbox */ #searchNextResult { right: 0; top: 2px; } #searchPreviousResult { right: 11px; top: 2px; } .BPT-SearchBox { color: TRANSPARENT; /*[{plugin-searchcontrol-mouseover-background-foreground-color}]*/ background-color: transparent; border: none; height: 18px; width: 119px; padding: 1px 2px; margin-right: 26px; } .BPT-SearchBox::selection { background-color: TRANSPARENT; /*[{plugin-searchcontrol-selection-color}]*/ } .BPT-SearchBox:-ms-input-placeholder { color:TRANSPARENT; /*[{plugin-searchcontrol-unfocused-watermark-text-color}]*/ background-color: TRANSPARENT; /*[{plugin-searchcontrol-unfocused-background-color}]*/ } .BPT-SearchBox-Border { float: right; background-color: TRANSPARENT; /*[{plugin-searchcontrol-mouseover-background-background-color}]*/ border: 1px solid TRANSPARENT; /*[1px solid {plugin-searchcontrol-unfocused-border-color}]*/ margin-top: 3px; padding: 1px; display: inline-block; position: relative; } .BPT-SearchBox-Border:hover { background-color: TRANSPARENT; /*[{plugin-searchcontrol-mouseover-background-background-color}]*/ border: 1px solid TRANSPARENT; /*[1px solid {plugin-searchcontrol-mouseover-border-color}]*/ } .BPT-SearchBox-NoResult { border: 1px solid TRANSPARENT; /*[1px solid {plugin-font-console-error-color}]*/ } .BPT-SearchBox-NoResult:hover { border: 1px solid TRANSPARENT; /*[1px solid {plugin-font-console-error-color}]*/ } .BPT-Toolbar .BPT-Search-Button { display: inline-block; position: absolute; } .BPT-Toolbar .BPT-Search-Button:not([disabled]):hover div { background-position-x: -16px; } .BPT-Toolbar .BPT-Search-Button[disabled] div { visibility: hidden; } .BPT-Toolbar .BPT-Search-Button .BPT-Search-Next { background-image: url(""); /*[url({f12-debugger-image-find-next})]*/ background-repeat: no-repeat; background-position: 0 0; background-size: 32px 16px; display: inline-block; width: 16px; height: 16px; } .BPT-Toolbar .BPT-Search-Button .BPT-Search-Previous { background-image: url(""); /*[url({f12-debugger-image-find-previous})]*/ background-repeat: no-repeat; background-position: 0 0; background-size: 32px 16px; display: inline-block; width: 16px; height: 16px; } /* End of css styling for searchbox */ .toolbarButtonMouseHover { background-color: TRANSPARENT !important; /*[{f12-toolbar-button-hover-color} !important]*/ } .toolbarButtonMouseHover > .icon_14x14 { background-position-y: -16px; } .toolbarButtonMouseHover > .icon_16x16 { background-position-y: -18px; } .toolbarButtonMouseHover > .icon_27x16 { background-position-y: -18px; } .toolbarButtonMouseHover > .icon_25x16 { background-position-y: -18px; } .toolbarButtonStateDisabled { background-color: transparent; } .toolbarButtonStateDisabled > .icon_14x14 { background-position-y: -32px; } .toolbarButtonStateDisabled > .icon_16x16 { background-position-y: -36px; } .toolbarButtonStateDisabled > .icon_27x16 { background-position-y: -72px; } .toolbarButtonStateDisabled > .icon_25x16 { background-position-y: -72px; } .toolbarButtonMouseDown { background-color: TRANSPARENT !important; /*[{f12-toolbar-button-pressed-color} !important]*/ } .windowtoolbar { text-align: right; height: 20px; margin: 3px 20px 3px 20px; overflow: hidden; } .windowtoolbar > button { margin-left: 8px; height: 16px; width: 16px; margin: 1px; } .windowtoolbar > button:hover { background-position-y: -16px; } #debuggerContent { -ms-grid-columns: 1fr 3px 430px; -ms-grid-row: 2; -ms-grid-rows: 100%; display: -ms-grid; width: 100%; height: 100%; } #leftBlock { position: relative; -ms-grid-column: 1; display: -ms-grid; -ms-grid-rows: 24px 1fr; -ms-grid-columns: 100%; } #tabStripContainer { -ms-grid-row: 1; overflow: hidden; height: 2em; } .editorConsoleContainer { -ms-grid-row: 2; -ms-grid-columns: 1fr; -ms-grid-rows: 1fr 3px 200px; display: -ms-grid; height: 100%; width: 100%; } .editorConsoleContainer > #editor { -ms-grid-column: 1; -ms-grid-row: 1; height: 100%; overflow: hidden; width: 100%; position: relative; } .editorConsoleContainer > #hEditorConsoleSplitter { -ms-grid-column: 1; -ms-grid-row: 2; background-color: TRANSPARENT; /*[{plugin-perftools-grid-column-sizer}]*/ cursor: ns-resize; height: 3px; width: 100%; } .editorConsoleContainer > #console { -ms-grid-column: 1; -ms-grid-row: 3; height: 100%; width: 100%; } #vEditorDataWindowsSplitter { -ms-grid-column: 2; width: 3px; cursor: ew-resize; background-color: TRANSPARENT; /*[{plugin-perftools-grid-column-sizer}]*/ } .controlsSplitPane { -ms-grid-column: 3; -ms-grid-columns: 1fr; -ms-grid-rows: 1fr 3px 1fr; display: -ms-grid; height: 100%; overflow: hidden; width: 100%; } .controlsSplitPane > #topDataWindowsParent { -ms-grid-column: 1; -ms-grid-row: 1; height: 100%; overflow: hidden; width: 100%; } .controlsSplitPane > #hDataWindowsSplitter { -ms-grid-column: 1; -ms-grid-row: 2; background-color: TRANSPARENT; /*[{plugin-perftools-grid-column-sizer}]*/ cursor: ns-resize; height: 5px; width: 100%; } .controlsSplitPane > #bottomDataWindowsParent { -ms-grid-column: 1; -ms-grid-row: 3; height: 100%; overflow: hidden; width: 100%; } .controlsContainer { display: -ms-grid; -ms-grid-rows: 25px 1fr; -ms-grid-columns: 100%; padding: 0; height: 100%; width: 100%; overflow: hidden; } .controlsContainer .tabStrip { -ms-grid-row: 1; background-color: TRANSPARENT; /*[{plugin-debugger-tab-area-background-color}]*/ font-family: "Segoe UI", Arial, sans-serif; /*[{plugin-font-family} , Arial, sans-serif]*/ font-size: 12pt; /*[{plugin-font-size}]*/ height: 25px; margin: 0; padding: 0; user-select: none; white-space: nowrap; width: 100%; } .controlsContainer .tabStrip > * { vertical-align: middle; } .controlsContainer .tabStrip .tabTitle { margin-right: 18px; margin-left: 10px; padding-top: 4px; color: TRANSPARENT; /*[{plugin-debugger-tab-color}]*/ } .controlsContainer .tabStrip .tabTitle:hover { color: TRANSPARENT; /*[{plugin-link-hover-color}]*/ cursor: pointer; } .controlsContainer .tabStrip .tabTitle.selected { color: TRANSPARENT; /*[{plugin-link-active-color}]*/ font-family: "Segoe UI", Arial, sans-serif; /*[{plugin-font-family} , Arial, sans-serif]*/ font-weight: 600; cursor: initial; } .controlsContainer .contentPane { -ms-grid-row: 2; width: 100%; height: 100%; border: none; padding-left: 0px; } .controlsContainer .contentPane .controlContents { display: none; } .controlsContainer .contentPane .controlContents.controlVisible { display: block; } .controlsContainer .controlContents { height: 100%; width: 100%; display: inline-block; vertical-align: middle; padding-top: 0px; } .contextmenu { display: none; position: absolute; padding: 2px; min-width: 150px; border: 1px solid TRANSPARENT; /*[1px solid {vs-drop-down-border-color}]*/ width: 150px; background-color: TRANSPARENT; /*[{vs-drop-down-background-color}]*/ font-size: 9pt; /*[{plugin-font-size}]*/ } .contextmenu > hr { border: none; border-top: 1px solid TRANSPARENT; /*[1px solid {vs-command-bar-menu-separator-color}]*/ margin: 1px 0 2px 0; } .contextmenu button { color: TRANSPARENT; /*[{vs-drop-down-text-color}]*/ background-color: transparent; /*[{vs-drop-down-background-color}]*/ border: 1px solid transparent; /*[1px solid {vs-drop-down-border-color}]*/ width: 100%; text-align: left; padding: 1px 26px 1px 6px; } .contextmenu button.disabled { color: TRANSPARENT; /*[{vs-drop-down-disabled-text-color}]*/ } .contextmenu button.disabled:hover { color: TRANSPARENT; /*[{vs-drop-down-disabled-text-color}]*/ } .contextmenu button:not(.disabled):hover { color: TRANSPARENT; /*[{vs-drop-down-mouse-over-text-color}]*/ background-color: TRANSPARENT; /*[{vs-drop-down-button-mouse-over-background-color}]*/ border: 1px solid TRANSPARENT; /*[1px solid {vs-drop-down-mouse-over-border-color}]*/ } .filePickerMenu { z-index: -1; /* Start with the file picker behind other UI components. This gets moved forward in script. */ position: relative; left: 0; top: 22px; height: 0; width: 0; border: 1px solid TRANSPARENT; /*[1px solid {f12-toolbar-button-selected-border-color}]*/ box-shadow: 2px 2px 2px TRANSPARENT; /*[2px 2px 2px {plugin-textbox-border-color rgba(0.5)}]*/ background-color: TRANSPARENT; /*[{plugin-debugger-filepicker-background-color}]*/ overflow: visible; } .filePickerMenu .fileListContainer { position: absolute; left: 0; top: 31px; } .filePickerMenu .filterBox { background-color: TRANSPARENT; /*[{plugin-searchcontrol-mouseover-background-background-color}]*/ color: TRANSPARENT; /*[{plugin-searchcontrol-mouseover-background-foreground-color}]*/ border-color: TRANSPARENT; /*[{plugin-searchcontrol-unfocused-border-color}]*/ height: 22px; position: absolute; top: 5px; left: 7px; } .filePickerMenu .filterBox::-ms-clear { display: block; } .filePickerMenu .filterBox::-ms-clear:hover { color: TRANSPARENT; /*[{plugin-searchcontrol-clear-hover-color}]*/ } .filePickerMenu .filterBox:-ms-input-placeholder { background: transparent url("") 98% 50% no-repeat; /*[transparent url({f12-debugger-image-search}) 98% 50% no-repeat]*/ background-size: 14px; color: TRANSPARENT; /*[{plugin-searchcontrol-unfocused-watermark-text-color}]*/ } .filePickerMenu .noResults { position: absolute; top: 31px; left: 7px; } .filePickerMenu .scriptFile { float: left; width: 14px; height: 14px; background-image: url(""); /*[url({f12-debugger-image-script-file})]*/ background-repeat: no-repeat; background-size: 14px 14px; background-color: transparent; } .filePickerMenu .htmlFile { float: left; width: 14px; height: 14px; background-image: url(""); /*[url({f12-debugger-image-html-file})]*/ background-repeat: no-repeat; background-size: 14px 14px; background-color: transparent; } .filePickerMenu .cssFile { float: left; width: 14px; height: 14px; background-image: url(""); /*[url({f12-debugger-image-css-file})]*/ background-repeat: no-repeat; background-size: 14px 14px; background-color: transparent; } .filePickerMenu .filesNode { float: left; width: 14px; height: 14px; background-image: url(""); /*[url({f12-debugger-image-files-node})]*/ background-repeat: no-repeat; background-size: 14px 14px; background-color: transparent; } .filePickerMenu .fileName { float: right; } .filePickerMenu .listview-grid-row-selected, .filePickerMenu .listview-grid-row:hover { color: TRANSPARENT; /*[{plugin-treeview-content-mouseover-color}]*/ background-color: TRANSPARENT; /*[{plugin-treeview-content-mouseover-background-color}]*/ } .filePickerMenu .openedDocument .fileItem { font-weight: bold; } .filePickerMenu .flatView .listview-grid-groupline { display: none !important; } .filePickerMenu .refresh { overflow: hidden; } .filePickerMenu .refresh .listview { overflow: visible; } .filePickerMenu .flatView .listview-grid-cell { margin-left: 0; } #filePickerButton { border: 1px solid transparent; position: absolute; float: left; left: 5px; overflow: hidden; width: 32px; height: 22px; background: url("") no-repeat center center; /*[url({f12-debugger-image-file-picker}) no-repeat center center]*/ background-position: 0px 0px; background-size: 27px 54px; } #filePickerButton:hover { background-position-y: -18px; border: 1px solid TRANSPARENT; /*[1px solid {f12-toolbar-button-hover-color}]*/ background-color: TRANSPARENT; /*[{f12-toolbar-button-hover-color}]*/ } #filePickerButton.activated { background-color: TRANSPARENT; /*[{f12-toolbar-button-selected-color}]*/ background-position-y: -18px; height: 23px; border-top: 1px solid TRANSPARENT; /*[1px solid {f12-toolbar-button-selected-border-color}]*/ border-left: 1px solid TRANSPARENT; /*[1px solid {f12-toolbar-button-selected-border-color}]*/ border-right: 1px solid TRANSPARENT; /*[1px solid {f12-toolbar-button-selected-border-color}]*/ border-bottom: 1px solid TRANSPARENT; /*[1px solid {f12-toolbar-button-selected-color}]*/ z-index: 1001; } .filePickerMenu .listview-icon-tree-collapsed { background-image: url(""); /*[url({f12-debugger-images-item-collapsed})]*/ background-repeat: no-repeat; background-size: 10px 10px; } .filePickerMenu .listview-icon-tree-expanded { background-image: url(""); /*[url({f12-debugger-images-item-expanded})]*/ background-repeat: no-repeat; background-size: 10px 10px; } .filePickerMenu .flatView .listview-icon-tree-expanded, .filePickerMenu .flatView .listview-icon-tree-collapsed { background-image: none; } .filePickerMenu .listview-grid-separator { display: none; } .filePickerMenu .listview-grid-row-selected:focus { color: TRANSPARENT; /*[{plugin-treeview-content-selected-color}]*/ background-color: TRANSPARENT; /*[{plugin-treeview-content-selected-background-color}]*/ } .filePickerMenu .listview-grid-row { -ms-user-select: none; } .plugin-contextmenu .menuitem .shortcut { min-width: 20px; } Debugger
    // // Copyright (C) Microsoft. All rights reserved. // // gridControl.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var F12; (function (F12) { (function (Tools) { (function (Debugger) { (function (Grid) { var Utility; (function (Utility) { var TreeNodeSort = (function () { function TreeNodeSort() { } TreeNodeSort.stableReverse = function stableReverse(array, comparer) { var result = []; for(var index = array.length - 1; index >= 0; index--) { var firstDiffIndex = index - 1; for(; firstDiffIndex >= 0; firstDiffIndex--) { if(0 !== comparer(array[firstDiffIndex], array[index])) { break; } } for(var equalIndex = firstDiffIndex + 1; equalIndex <= index; equalIndex++) { result.push(array[equalIndex]); } index = firstDiffIndex + 1; } for(var index = 0; index < result.length; index++) { array[index] = result[index]; } }; TreeNodeSort.defaultComparer = function defaultComparer(column, order, rowA, rowB) { var v1 = rowA[column.index], v2 = rowB[column.index]; if(typeof v1 === "undefined" || v1 === null) { if(typeof v2 === "undefined" || v2 === null) { return 0; } else { return -1; } } return v1.toLocaleUpperCase().localeCompare(v2.toLocaleUpperCase()); }; TreeNodeSort.sortComparer = function sortComparer(sortOrder, sortColumns, rowA, rowB) { for(var i = 0; i < sortOrder.length; i++) { var orderInfo = sortOrder[i]; var column = sortColumns[i]; var comparer = column.comparer || Utility.TreeNodeSort.defaultComparer; var result = comparer(column, orderInfo.order, rowA, rowB); if(result === 0) { continue; } else if(orderInfo.order === "desc") { return -result; } else { return result; } } return 0; }; return TreeNodeSort; })(); Utility.TreeNodeSort = TreeNodeSort; })(Utility || (Utility = {})); var TreeInfo = (function () { function TreeInfo(gridData, expandStates, toggleFunction) { this.gridData = gridData; this.expandStates = expandStates; this.toggleFunction = toggleFunction; } return TreeInfo; })(); Grid.TreeInfo = TreeInfo; var ColumnInfo = (function () { function ColumnInfo(index, text, tooltip, width, canSortBy, getColumnValue, getCellCSSClass, comparer) { this.index = index; this.text = text; this.tooltip = tooltip; this.width = width; this.canSortBy = canSortBy; this.getColumnValue = getColumnValue; this.getCellCSSClass = getCellCSSClass; this.comparer = comparer; this.hasHTMLContent = false; this.hasMixedContent = false; } ColumnInfo.MIN_RESIZE_WIDTH = 60; return ColumnInfo; })(); Grid.ColumnInfo = ColumnInfo; var SortOrderInfo = (function () { function SortOrderInfo(index, order) { this.index = index; this.order = order; } return SortOrderInfo; })(); Grid.SortOrderInfo = SortOrderInfo; var TreeNode = (function () { function TreeNode(data, expandState) { this.data = data; this.expandState = expandState; this.children = []; } return TreeNode; })(); Grid.TreeNode = TreeNode; var GutterOptions = (function () { function GutterOptions(icon, checkbox) { this.icon = icon; this.checkbox = checkbox; } return GutterOptions; })(); Grid.GutterOptions = GutterOptions; var GridOptions = (function () { function GridOptions(childDataCallback, columns, sortOrders, preEditCellCallback, commitEditCellCallback, postEditCellCallback) { this.childDataCallback = childDataCallback; this.columns = columns; this.sortOrders = sortOrders; this.allowMultiSelect = false; this.allowSortOnMultiColumns = false; this.asyncInit = true; this.autoSort = true; this.coreCssClass = "grid"; this.cssClass = ""; this.expandStates = []; this.extendViewportBy = 3; this.gutter = new GutterOptions(); this.header = false; this.height = "100%"; this.initialSelection = false; this.keepSelection = false; this.payloadSize = 200; this.source = null; this.preEditCellCallback = preEditCellCallback; this.commitEditCellCallback = commitEditCellCallback; this.postEditCellCallback = postEditCellCallback; this.disableRightClickSelection = true; this.isGridDisabled = false; this.prerenderCallback = null; this.onRowToggleCallback = null; this.keyboardEventHandler = null; this.commitOnTab = false; } return GridOptions; })(); Grid.GridOptions = GridOptions; var RowIndexInfo = (function () { function RowIndexInfo(rowIndex, dataIndex) { this.rowIndex = rowIndex; this.dataIndex = dataIndex; } return RowIndexInfo; })(); Grid.RowIndexInfo = RowIndexInfo; var Size = (function () { function Size(width, height) { this.width = width; this.height = height; } return Size; })(); var Range = (function () { function Range(start, end) { this.start = start; this.end = end; } return Range; })(); Grid.Range = Range; var ColumnSizing = (function () { function ColumnSizing(active, index, originalWidth, origin) { this.active = active; this.index = index; this.originalWidth = originalWidth; this.origin = origin; } return ColumnSizing; })(); var GridControl = (function (_super) { __extends(GridControl, _super); function GridControl(root, options) { _super.call(this, root); this._options = options; this._canvas = null; this._contentSpacer = null; this._element = null; this._gutter = null; this._gutterHeader = null; this._header = null; this._headerCanvas = null; this._dataSource = []; this._rows = { }; this._columns = []; this._expandStates = null; this._expandedCount = 0; this._sortOrder = []; this._rowInfoMap = { }; this._commitEditCellCallback = null; this._selectedRows = null; this._selectionStart = -1; this._selectionCount = 0; this._selectedIndex = -1; this._active = false; this._activeAriaId = null; this._getChildDataCallback = null; this._canvasHeight = 300; this._canvasWidth = 300; this._contentSize = null; this._measurements = { }; this._count = 0; this._indentIndex = 0; this._indentLevels = null; this._visibleRange = []; this._columnSizing = null; this._sizingElement = null; this._copyInProgress = false; this._resetScroll = false; this._ignoreScroll = false; this._scrollTop = 0; this._scrollLeft = 0; this._cancelable = null; this._onAriaExpandedModifiedHandler = this.onAriaExpandedModified.bind(this); this.initialize(); } GridControl.TYPE_NAME = "GridControl"; GridControl.MAX_CELL_CONTENT_SIZE = 1000; GridControl.MAX_COPY_SIZE = 1000; GridControl.PAYLOAD_SIZE = 200; GridControl.EVENT_SELECTED_INDEX_CHANGED = "selectedIndexChanged"; GridControl.INDENT_WIDTH = 12; GridControl.GLYPH_WIDTH = 10; Object.defineProperty(GridControl.prototype, "isVerticalScrollbarVisible", { get: function () { return this._canvasHeight < this._canvas.scrollHeight; }, enumerable: true, configurable: true }); GridControl.prototype.initialize = function () { this._element = document.createElement("div"); this._element.className = this._options.coreCssClass; this._element.style.height = this._options.height; this.rootElement.appendChild(this._element); this._buildDom(); this._contentSize = new Size(300, 400); this._takeMeasurements(); this._getChildDataCallback = this._options.childDataCallback || null; this._commitEditCellCallback = this._options.commitEditCellCallback || null; if(this._options.asyncInit) { window.setTimeout(function () { this._attachEvents(); }.bind(this), 10); } else { this._attachEvents(); } this.initializeDataSource(); }; GridControl.prototype.findClosestElement = function (element, selector) { var stop = this._element.parentNode; var closest = element; while(closest && closest !== stop) { if(closest.msMatchesSelector(selector)) { return closest; } closest = closest.parentNode; } return closest; }; GridControl.prototype.fireCustomEvent = function (element, eventName, args) { var customEvent = document.createEvent("Event"); customEvent.initEvent(eventName, true, true); (customEvent).customData = args; element.dispatchEvent(customEvent); }; GridControl.prototype.onAriaExpandedModified = function (event) { if(event.attrName === "aria-expanded") { var rowInfo = this.getRowInfoFromEvent(event, ".grid-row"); if(rowInfo) { this.tryToggle(event.newValue === "true", false, rowInfo.dataIndex); } } }; GridControl.prototype.createElementWithClass = function (tagName, className) { var element = document.createElement(tagName); if(className) { element.className = className; } return element; }; GridControl.expand = function expand(states) { var result = []; if(states.length > 0) { var stack = []; var currState = { level: 1, origCount: states.length, remainingCount: states.length }; stack.push(currState); var i = 0; while(i < states.length) { result.push(currState.level); currState.remainingCount--; while(currState.remainingCount === 0) { stack.pop(); if(stack.length == 0) { if(i === (states.length - 1)) { break; } else { throw new Error("invalid descendant counts, nesting not possible"); } } var newState = stack[stack.length - 1]; newState.remainingCount -= currState.origCount; currState = newState; if(currState.remainingCount < 0) { throw new Error("invalid descendant counts, cannot convert to indentation levels"); } } var nextCount = Math.abs(states[i]); if(nextCount > 0) { var nextItem = { level: result[result.length - 1] + 1, origCount: nextCount, remainingCount: nextCount }; stack.push(nextItem); currState = nextItem; } i++; } if(stack.length > 0) { throw new Error("invalid descendant counts, more input expected"); } } return result; }; GridControl.addItemsToTree = function addItemsToTree(dataSource, expandStates, start, count, parentNode) { var end = Math.min(start + count, dataSource.length); for(var i = start; i < end; i++) { var node = new TreeNode(dataSource[i], expandStates[i]); var childrenCount = Math.abs(node.expandState); if(childrenCount > 0) { GridControl.addItemsToTree(dataSource, expandStates, i + 1, childrenCount, node); i += childrenCount; } parentNode.children.push(node); } }; GridControl.walkTree = function walkTree(tree, visit) { if(visit) { visit(tree); var numChildren = 0; var children = tree.children; if(children && (numChildren = children.length)) { for(var i = 0; i < numChildren; i++) { var item = children[i]; GridControl.walkTree(item, visit); } } } }; GridControl.makeElementUnselectable = function makeElementUnselectable(element) { element.setAttribute("unselectable", "on"); var elements = element.querySelectorAll("*"); for(var i = 0; i < elements.length; i++) { var e = elements[i]; switch(e.tagName) { case "FRAME": case "IFRAME": case "TEXTAREA": case "INPUT": case "SELECT": break; default: e.setAttribute("unselectable", "on"); } } }; GridControl.toDecimalLocaleString = function toDecimalLocaleString(value, includeGroupSeparators, cultureInfo) { var zeroPad = function (str, count, left) { for(var l = str.length; l < count; l++) { str = (left ? ('0' + str) : (str + '0')); } return str; }; var exponent, nf, split, numberString = value.toString(), right = ""; if(cultureInfo) { nf = cultureInfo.numberFormat; } else { nf = Sys.CultureInfo.CurrentCulture; } split = numberString.split(/e/i); numberString = split[0]; exponent = (split.length > 1 ? parseInt(split[1], 10) : 0); split = numberString.split('.'); numberString = split[0]; right = split.length > 1 ? split[1] : ""; if(exponent > 0) { right = zeroPad(right, exponent, false); numberString += right.slice(0, exponent); right = right.substr(exponent); } else if(exponent < 0) { exponent = -exponent; numberString = zeroPad(numberString, exponent + 1, true); right = numberString.slice(-exponent, numberString.length) + right; numberString = numberString.slice(0, -exponent); } if(right.length > 0) { right = nf.NumberDecimalSeparator + right; } if(includeGroupSeparators === true) { var groupSizes = nf.NumberGroupSizes, sep = nf.NumberGroupSeparator, curSize = groupSizes[0], curGroupIndex = 1, stringIndex = numberString.length - 1, ret = ""; while(stringIndex >= 0) { if(curSize === 0 || curSize > stringIndex) { if(ret.length > 0) { return numberString.slice(0, stringIndex + 1) + sep + ret + right; } else { return numberString.slice(0, stringIndex + 1) + right; } } if(ret.length > 0) { ret = numberString.slice(stringIndex - curSize + 1, stringIndex + 1) + sep + ret; } else { ret = numberString.slice(stringIndex - curSize + 1, stringIndex + 1); } stringIndex -= curSize; if(curGroupIndex < groupSizes.length) { curSize = groupSizes[curGroupIndex]; curGroupIndex++; } } return numberString.slice(0, stringIndex + 1) + sep + ret + right; } else { return numberString + right; } }; GridControl.convertValueToDisplayString = function convertValueToDisplayString(value, format) { if(value != null) { if(typeof value === "string") { return value; } else if(value instanceof Date) { return value.localeFormat(format || "G"); } else if(typeof value === "number") { if(format) { return value.localeFormat(format); } else { return GridControl.toDecimalLocaleString(value); } } else if(typeof value === "boolean") { return value ? "True" : "False"; } else { return value.toString(); } } return ""; }; GridControl.prototype._getId = function () { return GridControl.TYPE_NAME; }; GridControl.prototype.getSelectionCount = function () { return this._selectionCount; }; Object.defineProperty(GridControl.prototype, "expandedCount", { set: function (count) { this._expandedCount = count; if(this._options.expandedCountChangedCallback) { this._options.expandedCountChangedCallback(this._expandedCount); } }, enumerable: true, configurable: true }); GridControl.prototype.getExpandedCount = function () { return this._expandedCount; }; GridControl.prototype.getElement = function () { return this._element; }; GridControl.prototype._enhance = function (element) { this._buildDom(); }; GridControl.prototype._buildDom = function () { var fragment = document.createDocumentFragment(); var gutterOptions = this._options.gutter; var gutterVisible = gutterOptions && (gutterOptions.icon || gutterOptions.checkbox); this._canvas = document.createElement("div"); this._canvas.className = "grid-canvas"; this._canvas.setAttribute("aria-role", "tree"); this._contentSpacer = document.createElement("div"); this._contentSpacer.className = "grid-content-spacer"; this._canvas.appendChild(this._contentSpacer); if(this._options.header) { this._element.classList.add("has-header"); this._header = document.createElement("div"); this._header.className = "grid-header"; this._headerCanvas = document.createElement("div"); this._headerCanvas.className = "grid-header-canvas"; this._header.appendChild(this._headerCanvas); fragment.appendChild(this._header); } if(gutterVisible) { this._element.classList.add("has-gutter"); this._gutter = document.createElement("div"); this._gutter.className = "grid-gutter"; this._canvas.appendChild(this._gutter); if(this._header) { this._gutterHeader = document.createElement("div"); this._gutterHeader.className = "grid-gutter-header"; this._header.appendChild(this._gutterHeader); } } fragment.appendChild(this._canvas); this._element.appendChild(fragment); }; GridControl.prototype._attachEvents = function () { var _this = this; window.addEventListener("resize", function (e) { return _this._onContainerResize(e); }); this._element.addEventListener("mousedown", function (e) { return _this._onContainerMouseDown(e); }); this._canvas.addEventListener("keydown", function (e) { return _this._onKeyDown(e); }); this._canvas.addEventListener("mousedown", function (e) { return _this._onRowMouseDown(e); }); this._canvas.addEventListener("dblclick", function (e) { return _this.onEditCell(e); }); this._canvas.addEventListener("scroll", function (e) { return _this._onCanvasScroll(e); }); this._canvas.addEventListener("selectstart", function () { return false; }); if(this._header) { this._header.addEventListener("mousedown", function (e) { return _this._onHeaderMouseDown(e); }); this._header.addEventListener("mouseup", function (e) { return _this._onHeaderMouseUp(e); }); this._header.addEventListener("click", function (e) { return _this._onHeaderClick(e); }); this._header.addEventListener("dblclick", function (e) { return _this._onHeaderDblClick(e); }); } if(this._gutter) { this._gutter.addEventListener("click", function (e) { return _this._onGutterClick(e); }); this._gutter.addEventListener("mouseover", function (e) { var row = this.findClosestElement(e.target, ".grid-gutter-row"); if(row) { row.classList.add("grid-gutter-row-hover"); } }.bind(this)); this._gutter.addEventListener("mouseout", function (e) { var row = this.findClosestElement(e.target, ".grid-gutter-row"); if(row) { row.classList.remove("grid-gutter-row-hover"); } }.bind(this)); } }; GridControl.prototype._mergeExpandStates = function (parentIndex, oldExpandStates, newExpandStates) { var netIncreaseInExpandStates = newExpandStates.length - 1; oldExpandStates.splice(parentIndex + 1, 1); for(var i = 0; i <= netIncreaseInExpandStates; i++) { oldExpandStates.splice(parentIndex + i + 1, 0, newExpandStates[i]); } var countSinceLastParent = 0; for(var i = parentIndex; i >= 0; i--) { var origValue = oldExpandStates[i]; if(Math.abs(origValue) > countSinceLastParent) { if(origValue < 0) { oldExpandStates[i] = origValue - netIncreaseInExpandStates; } else { oldExpandStates[i] = origValue + netIncreaseInExpandStates; } countSinceLastParent = 0; } else { countSinceLastParent++; } } }; GridControl.prototype._takeMeasurements = function () { var cssClass = this._options.coreCssClass; if(this._options.cssClass) { cssClass += " " + this._options.cssClass; } var measurementContainer = this.createElementWithClass("div", cssClass); measurementContainer.style.position = "absolute"; measurementContainer.style.left = "-5000px"; measurementContainer.style.top = "-5000px"; measurementContainer.style.width = "1000px"; measurementContainer.style.height = "500px"; document.body.appendChild(measurementContainer); var row = this.createElementWithClass("div", "grid-row grid-row-normal"); measurementContainer.appendChild(row); var cell = this.createElementWithClass("div", "grid-cell"); cell.style.width = "100px"; cell.innerText = "1"; row.appendChild(cell); this._measurements.rowHeight = row.offsetHeight; this._measurements.cellOffset = cell.offsetWidth - 100; var textUnit = this.createElementWithClass("div"); textUnit.style.overflow = "hidden"; textUnit.style.width = "1em"; textUnit.style.height = "1ex"; cell.appendChild(textUnit); this._measurements.unitEx = textUnit.offsetHeight; var gutter = this.createElementWithClass("div", "grid-gutter"); gutter.appendChild(this.createElementWithClass("div", "grid-gutter-row grid-gutter-row-selected")); measurementContainer.appendChild(gutter); if(this._gutter) { this._measurements.gutterWidth = gutter.clientWidth; } else { this._measurements.gutterWidth = 0; } document.body.removeChild(measurementContainer); }; GridControl.prototype.initializeDataSource = function () { var canvas; if(this._resetScroll) { this._ignoreScroll = true; try { canvas = this._canvas; canvas.scrollTop = 0; canvas.scrollLeft = 0; this._scrollLeft = 0; this._scrollTop = 0; this._resetScroll = false; }finally { this._ignoreScroll = false; } } this.setDataSource(this._options.source, this._options.expandStates, this._options.columns, this._options.sortOrders); if(this._expandedCount > 0) { if(this._options.keepSelection && this._selectedIndex >= 0) { this._selectRow(Math.min(this._selectedIndex, this._expandedCount - 1)); } else { this._selectRow(this._options.initialSelection !== false ? 0 : -1); } } else { this.setSelectedRowIndex(-1); } }; GridControl.prototype.setDataSource = function (source, expandStates, columns, sortOrder, selectedIndex, focus, scrollToBottom) { var _this = this; var i, l, count; this._rowInfoMap = { }; this._dataSource = source || []; this._count = count = this._dataSource.length; if(expandStates) { this._expandStates = expandStates; this._indentLevels = GridControl.expand(expandStates); } else { this._indentLevels = null; this._expandStates = null; } this.expandedCount = count; this._updateRanges(); this._columns = []; if(columns) { var defaultGetCellContents = function (rowInfo, dataIndex, expandedState, level, column, indentIndex, columnOrder) { return _this._drawCell(rowInfo, dataIndex, expandedState, level, column, indentIndex, columnOrder); }; var defaultGetHeaderCellContents = function (column, columnOrder) { return _this._drawHeaderCellValue(column, columnOrder); }; var defaultGetColumnValue = function (dataIndex, columnIndex, columnOrder) { return _this.getColumnValue(dataIndex, columnIndex, columnOrder); }; for(i = 0 , l = columns.length; i < l; i++) { var column = columns[i]; column.index = typeof (column.index) !== "undefined" ? column.index : String(i); column.canSortBy = column.canSortBy !== false; column.canMove = column.canMove !== false; column.width = typeof (column.width) !== "undefined" ? column.width : 100; column.getCellContents = column.getCellContents || defaultGetCellContents; column.getHeaderCellContents = column.getHeaderCellContents || defaultGetHeaderCellContents; column.getColumnValue = column.getColumnValue || defaultGetColumnValue; this._columns.push(column); } } this._sortOrder = []; if(sortOrder) { for(i = 0 , l = sortOrder.length; i < l; i++) { var columnSortOrder = sortOrder[i]; if(columnSortOrder.order !== "desc") { columnSortOrder.order = "asc"; } this._sortOrder.push(columnSortOrder); } } this._clearSelection(); this._determineIndentIndex(); if(this._options.asyncInit) { window.setImmediate(function () { _this._layoutAfterSetDataSource(selectedIndex, focus, scrollToBottom); }); } else { this._layoutAfterSetDataSource(selectedIndex, focus, scrollToBottom); } }; GridControl.prototype.getDataSource = function () { return this._dataSource; }; GridControl.prototype._layoutAfterSetDataSource = function (selectedIndex, focus, scrollToBottom) { this.layout(); this._ensureSelectedIndex(selectedIndex); this._selectRow(selectedIndex, null, null, (focus === true)); if(scrollToBottom) { this.scrollToBottom(function () { }); } }; GridControl.prototype._adjustForDynamicData = function (newRows, newExpandStates, parentIndex) { this._dataSource.splice(parentIndex + 1, 1); for(var i = 0; i < newRows.length; i++) { this._dataSource.splice(parentIndex + i + 1, 0, newRows[i]); } this._mergeExpandStates(parentIndex, this._expandStates, newExpandStates); var count = this._dataSource.length; this._count = count; if(this._expandStates) { this._indentLevels = GridControl.expand(this._expandStates); } else { this._indentLevels = null; } this.expandedCount = count; this._updateRanges(); this._clearSelection(); this._determineIndentIndex(); this._layoutAfterSetDataSource(this._getRowIndex(parentIndex)); }; GridControl.prototype._ensureSelectedIndex = function (index) { var oldSelectedIndex = this._selectedIndex; if(typeof index === "number") { this._selectedIndex = index; } if(this._selectedIndex >= 0) { if(this._count <= this._selectedIndex) { this._selectedIndex = this._count - 1; } if(this._selectedIndex !== oldSelectedIndex) { this._addSelection(this._selectedIndex); } } }; GridControl.prototype.getRowInfo = function (dataIndex) { return this._rows[dataIndex]; }; GridControl.prototype.getRowData = function (dataIndex) { return this._dataSource[dataIndex]; }; GridControl.prototype.getColumns = function () { return this._columns || []; }; GridControl.prototype.getSortOrder = function () { return this._sortOrder || []; }; GridControl.prototype.insertAdditionalDynamicData = function (dynamicData, insertIndex) { if(dynamicData !== null) { this._adjustForDynamicData(dynamicData.itemsWithPlaceholders, dynamicData.expandStates, insertIndex - 1); } }; GridControl.prototype._determineIndentIndex = function () { var _columns = this._columns, i, l; for(i = 0 , l = _columns.length; i < l; i++) { if(_columns[i].indent) { this._indentIndex = i; return; } } this._indentIndex = 0; }; GridControl.prototype._getDataIndex = function (visibleIndex) { var i, l, lastIndex = -1; var ranges = this._visibleRange; var range; if(visibleIndex < 0) { return -1; } for(i = 0 , l = ranges.length; i < l; i++) { range = ranges[i]; lastIndex += range.end - range.start + 1; if(visibleIndex <= lastIndex) { return range.end - lastIndex + visibleIndex; } } return visibleIndex; }; GridControl.prototype._getRowIndex = function (dataIndex) { var i, l, result = 0; var ranges = this._visibleRange; var range; for(i = 0 , l = ranges.length; i < l; i++) { range = ranges[i]; if(dataIndex >= range.start) { if(dataIndex <= range.end) { return result + dataIndex - range.start; } } else { break; } result += range.end - range.start + 1; } return -Math.max(0, result - 1); }; GridControl.prototype._updateRanges = function () { var i = 0, first = 0, l = this._count, newRanges = [], count = 0; if(this._expandStates) { while(i < l) { var state = this._expandStates[i]; if(state < 0) { newRanges[newRanges.length] = new Range(first, i); count += (i - first) + 1; i += 1 - state; first = i; } else { i++; } } if(first < l) { newRanges[newRanges.length] = new Range(first, l - 1); count += (l - first); } } else { count = l; newRanges[newRanges.length] = new Range(0, count); } this.expandedCount = count; this._visibleRange = newRanges; }; GridControl.prototype.expandNode = function (dataIndex) { var _this = this; if(this._options.onRowToggleCallback) { this._options.onRowToggleCallback(this._dataSource, dataIndex, true); } if(this._dataSource[dataIndex + 1].isPlaceholder) { this._getChildDataCallback(this._dataSource[dataIndex], function (dynamicData) { if(dynamicData !== null) { _this._adjustForDynamicData(dynamicData.itemsWithPlaceholders, dynamicData.expandStates, dataIndex); } }); } if(this._expandStates) { var state = this._expandStates[dataIndex]; if(state < 0) { this._expandStates[dataIndex] = -state; this._updateRanges(); var row = this._rows[dataIndex]; if(row) { row.isDirty = true; } } } }; GridControl.prototype.collapseNode = function (dataIndex) { if(this._expandStates) { var state = this._expandStates[dataIndex]; if(state > 0) { if(this._options.onRowToggleCallback) { this._options.onRowToggleCallback(this._dataSource, dataIndex, false); } this._expandStates[dataIndex] = -state; this._updateRanges(); var row = this._rows[dataIndex]; if(row) { row.isDirty = true; } } } this.layout(); }; GridControl.prototype.expandAllNodes = function () { var i = 0, l = this._count, states = this._expandStates, result = false, rows = this._rows; if(states) { while(i < l) { var state = states[i]; if(state < 0) { states[i] = -state; result = true; var row = rows[i]; if(row) { row.isDirty = true; } } i++; } if(result) { this._updateRanges(); } } return result; }; GridControl.prototype.collapseAllNodes = function () { var i = 0, l = this._count, states = this._expandStates, result = false, rows = this._rows; if(states) { while(i < l) { var state = states[i]; if(state > 0) { states[i] = -state; result = true; var row = rows[i]; if(row) { row.isDirty = true; } } i++; } if(result) { this._updateRanges(); } } return result; }; GridControl.prototype.expandAll = function () { var _this = this; this._updateExpansionStateAndRedraw(function () { return _this.expandAllNodes; }); }; GridControl.prototype.collapseAll = function () { var _this = this; this._updateExpansionStateAndRedraw(function () { return _this.collapseAllNodes; }); }; GridControl.prototype._updateExpansionStateAndRedraw = function (action) { var dataIndex, oldSelectedIndex = this._selectedIndex; if(oldSelectedIndex >= 0) { dataIndex = this._getDataIndex(oldSelectedIndex); } action(); if(oldSelectedIndex >= 0) { this._clearSelection(); this._addSelection(Math.abs(this._getRowIndex(dataIndex))); } this._layoutContentSpacer(); this._redraw(); this._notifyForPrerender(); }; GridControl.prototype.tryToggle = function (expand, shiftKey, rowDataIndex) { var state; if(!this._expandStates || this._selectedIndex < 0 || this._expandedCount <= 0) { return false; } var dataIndex = typeof rowDataIndex !== "undefined" ? rowDataIndex : this._getDataIndex(this._selectedIndex); var row = this._rows[dataIndex]; if(!row) { return false; } { state = this._expandStates[dataIndex]; if(state !== 0) { if(expand) { if(state < 0) { this.expandNode(dataIndex); } else { return false; } } else { if(state > 0) { this.collapseNode(dataIndex); } else { return false; } } this._clearSelection(); this._addSelection(this._getRowIndex(dataIndex), null, null, true); this._layoutContentSpacer(); this._redraw(); this._notifyForPrerender(); return true; } } return false; }; GridControl.prototype.layoutOnResize = function () { this._onContainerResize(undefined); }; GridControl.prototype._getVisibleRowIndices = function () { var top = this._scrollTop, bottom = top + this._canvasHeight, count = this._expandedCount - 1, rh = this._measurements.rowHeight; return { first: Math.min(count, Math.max(0, Math.ceil(top / rh))), last: Math.min(count, Math.floor(bottom / rh) - 1) }; }; GridControl.prototype._getRowIntoView = function (rowIndex, force) { if(force) { this._canvas.scrollTop = Math.max(0, Math.min(rowIndex || 0, this._expandedCount - 1)) * this._measurements.rowHeight; return true; } var visibleIndices = this._getVisibleRowIndices(); var firstIndex = visibleIndices.first; var lastIndex = visibleIndices.last; var count = lastIndex - firstIndex; if(rowIndex < firstIndex || rowIndex > lastIndex) { if(this._selectedIndex > firstIndex) { firstIndex = Math.max(rowIndex - count, 0); } else { firstIndex = Math.max(0, Math.min(rowIndex + count, this._expandedCount - 1) - count); } this._canvas.scrollTop = firstIndex * this._measurements.rowHeight; return true; } return false; }; GridControl.prototype.getSelectedRowIntoView = function (force) { return this._getRowIntoView(this._selectedIndex, force); }; GridControl.prototype.cacheRows = function (aboveRange, visibleRange, belowRange) { }; GridControl.prototype._updateViewport = function (includeNonDirtyRows, forcePercentWidthCalculation) { var resultCount = this._count, above = [], below = [], visible = [], states = this._expandStates || [], maxIndex = this._expandedCount - 1; var range = this.getViewPortRanges(); var cachingStart = Math.max(0, range.start - this._options.payloadSize); var cachingEnd = Math.min(maxIndex, range.end + this._options.payloadSize); var dataIndex = this._getDataIndex(cachingStart); var lastVisible = range.start; for(var i = cachingStart; i <= cachingEnd && dataIndex < resultCount; i++) { if(i < range.start) { above[above.length] = new RowIndexInfo(i, dataIndex); } else if(i > range.end) { below[below.length] = new RowIndexInfo(i, dataIndex); } else { visible[visible.length] = new RowIndexInfo(i, dataIndex); lastVisible = i; this._lastRenderedDataIndex = dataIndex; } var nodeState = states[dataIndex]; if(nodeState < 0) { dataIndex += (1 - nodeState); } else { dataIndex++; } } this.measureColumnSize(forcePercentWidthCalculation); this.cacheRows(above, visible, below); this._drawRows(visible, includeNonDirtyRows); }; GridControl.prototype._cleanUpRows = function () { var rows = this._rows, hasGutter = this._gutter, dataIndex; for(dataIndex in rows) { var row = rows[dataIndex]; if(row.row.parentElement) { row.row.parentElement.removeChild(row.row); delete this._rowInfoMap[row.row.uniqueID]; } if(hasGutter && row.gutterRow.parentElement) { row.gutterRow.parentElement.removeChild(row.gutterRow); } } this._rows = { }; }; GridControl.prototype._drawRows = function (visibleRange, includeNonDirtyRows) { var states = this._expandStates, expandedState = 0, levels = this._indentLevels, level = 0, hasGutter = this._gutter, canvasDom = this._canvas, gutterCanvasDom, updateRow; var fragment = document.createDocumentFragment(); var gutterFragment = null; if(hasGutter) { gutterCanvasDom = this._gutter; gutterFragment = document.createDocumentFragment(); } var existingRows = this._rows; var newRows = { }; this._rows = newRows; var visibleRowCount = visibleRange.length; for(var i = 0; i < visibleRowCount; i++) { var range = visibleRange[i]; var rowIndex = range.rowIndex; var dataIndex = range.dataIndex; var row = existingRows[dataIndex]; if(row) { updateRow = (row.rowIndex !== rowIndex); if(updateRow) { row.rowIndex = rowIndex; } else { updateRow = row.isDirty; delete row.isDirty; } if(includeNonDirtyRows) { updateRow = true; } delete existingRows[dataIndex]; } else { updateRow = true; var rowElement = this.createElementWithClass("div", "grid-row grid-row-normal"); rowElement.id = "row_" + this._getId() + "_" + rowIndex; rowElement.setAttribute("aria-role", "treeitem"); fragment.appendChild(rowElement); var rowInfo = { rowIndex: rowIndex, dataIndex: dataIndex, row: rowElement }; if(hasGutter) { var gutterRowElement = this.createElementWithClass("div", "grid-gutter-row grid-gutter-row-normal"); gutterFragment.appendChild(gutterRowElement); this._rowInfoMap[gutterRowElement.uniqueID] = rowInfo; rowInfo.gutterRow = gutterRowElement; } this._rowInfoMap[rowElement.uniqueID] = rowInfo; row = rowInfo; } newRows[dataIndex] = row; if(updateRow) { if(states) { expandedState = states[dataIndex]; level = levels[dataIndex]; row.row.setAttribute("aria-level", "" + level); } this._updateRow(row, rowIndex, dataIndex, expandedState, level); } } for(var existingRowIdx in existingRows) { row = existingRows[existingRowIdx]; if(hasGutter) { delete this._rowInfoMap[row.gutterRow.uniqueID]; row.gutterRow.parentElement.removeChild(row.gutterRow); } delete this._rowInfoMap[row.row.uniqueID]; row.row.parentElement.removeChild(row.row); } canvasDom.appendChild(fragment); if(hasGutter) { gutterCanvasDom.appendChild(gutterFragment); } }; GridControl.prototype.updateRow = function (rowIndex, dataIndex) { var expandedState = 0, level = 0; if(typeof dataIndex === "undefined" || dataIndex < 0) { dataIndex = this._getDataIndex(rowIndex); } else if(typeof rowIndex === "undefined" || rowIndex < 0) { rowIndex = this._getRowIndex(dataIndex); } var rowInfo = this._rows[dataIndex]; if(rowInfo) { if(this._expandStates) { expandedState = this._expandStates[dataIndex]; level = this._indentLevels[dataIndex]; } this._updateRow(rowInfo, rowIndex, dataIndex, expandedState, level); } }; GridControl.prototype._updateRow = function (rowInfo, rowIndex, dataIndex, expandedState, level) { var indentIndex = this._indentIndex; if(this._gutter) { var gutterOptions = this._options.gutter; var gutterRow = rowInfo.gutterRow; var gutterRowElem = gutterRow.firstElementChild; gutterRowElem.style.top = (rowIndex * this._measurements.rowHeight) + "px"; gutterRowElem.style.left = "0px"; gutterRowElem.style.width = (this._measurements.gutterWidth) + "px"; gutterRowElem.style.height = (this._measurements.rowHeight) + "px"; if(gutterOptions.checkbox) { var gutterCheckbox = this.createElementWithClass("input", "checkbox " + (gutterOptions.checkbox.cssClass || "")); gutterCheckbox.setAttribute("type", "checkbox"); var gutterCheckboxCellElem = this.createElementWithClass("div", "grid-gutter-cell grid-gutter-checkbox"); gutterCheckboxCellElem.appendChild(gutterCheckbox[0]); gutterRowElem.appendChild(gutterCheckboxCellElem); } if(gutterOptions.icon) { var gutterIconCss = "grid-gutter-cell grid-gutter-icon "; if(typeof gutterOptions.icon.cssClass !== "undefined") { gutterIconCss += gutterOptions.icon.cssClass + " "; } if(typeof gutterOptions.icon.index !== "undefined") { gutterIconCss += (this.getColumnValue(dataIndex, gutterOptions.icon.index, -1) || "") + " "; } if(gutterOptions.icon.ownerDraw !== false) { gutterIconCss += (this._getGutterIconClass(rowIndex, dataIndex, expandedState, level) || ""); } var gutterIconElem = this.createElementWithClass("div", gutterIconCss); gutterRowElem.appendChild(gutterIconElem); } this._drawGutterCell(rowInfo, rowIndex, dataIndex, expandedState, level); } var rowElement = rowInfo.row; rowElement.innerHTML = ""; rowElement.style.top = (rowIndex * this._measurements.rowHeight) + "px"; rowElement.style.left = this._measurements.gutterWidth + "px"; rowElement.style.height = (this._measurements.rowHeight) + "px"; rowElement.style.width = isNaN(this._contentSize.width) ? "" : (this._contentSize.width + 2) + "px"; var columns = this._columns; for(var i = 0, l = columns.length; i < l; i++) { var column = columns[i]; if(column.hidden) { continue; } var cellElement = column.getCellContents(rowInfo, dataIndex, expandedState, level, column, indentIndex, i); if(cellElement) { rowElement.appendChild(cellElement); } } GridControl.makeElementUnselectable(rowElement); if(this._gutter) { GridControl.makeElementUnselectable(gutterRowElem); } this._updateRowSelectionStyle(rowInfo, this._selectedRows, this._selectedIndex); rowElement.removeEventListener("DOMAttrModified", this._onAriaExpandedModifiedHandler); if(expandedState !== 0) { rowElement.setAttribute("aria-expanded", expandedState > 0 ? "true" : "false"); rowElement.addEventListener("DOMAttrModified", this._onAriaExpandedModifiedHandler); } }; GridControl.prototype._getGutterIconClass = function (rowIndex, dataIndex, expandedState, level) { return ""; }; GridControl.prototype._drawGutterCell = function (rowInfo, rowIndex, dataIndex, expandedState, level) { }; GridControl._setTooltip = function _setTooltip(element, value, height) { var tooltip = { content: value, height: height }; element.setAttribute("data-plugin-vs-tooltip", JSON.stringify(tooltip)); }; GridControl.prototype._drawCell = function (rowInfo, dataIndex, expandedState, level, column, indentIndex, columnOrder) { var width = column.width || 20, href; var cellElement = this.createElementWithClass("div", "grid-cell"); cellElement.style.width = isNaN(width) ? String(width) : width + "px"; if(column.cellDecorator) { var dataItem = this._dataSource[dataIndex]; column.cellDecorator(cellElement, dataItem); } else { if(typeof column.hrefIndex !== "undefined") { href = this.getColumnValue(dataIndex, column.hrefIndex, -1); } var value = this.getColumnText(dataIndex, column, columnOrder); var isTruncated = false; if(value.length > GridControl.MAX_CELL_CONTENT_SIZE) { isTruncated = true; cellElement.setAttribute("grid-edit-value", value); value = value.substr(0, GridControl.MAX_CELL_CONTENT_SIZE); } if(!column.hasHTMLContent && !column.hasMixedContent) { GridControl._setTooltip(cellElement, isTruncated ? value + "..." : value, 65); } if(href) { var link = document.createElement("a"); link.setAttribute("href", href); link.innerText = value; cellElement.appendChild(link); } else { if(value) { if(column.hasHTMLContent || (column.hasMixedContent && column.getCellCSSClass && column.getCellCSSClass(dataIndex, column.index, columnOrder, this._dataSource).indexOf("grid-mixed-cell-html") !== -1)) { cellElement.innerHTML = value; } else { cellElement.innerText = value; } } else { cellElement.innerHTML = " "; } } } if(columnOrder === indentIndex && level > 0) { var indent = ((level * GridControl.INDENT_WIDTH) - 13); column.indentOffset = indent; if(expandedState !== 0) { var treeSign = this.createElementWithClass("div", "icon grid-tree-icon"); treeSign.style.left = indent + "px"; cellElement.appendChild(treeSign); if(expandedState > 0) { treeSign.classList.add("icon-tree-expanded"); } else { treeSign.classList.add("icon-tree-collapsed"); } } cellElement.style.textIndent = (level * GridControl.INDENT_WIDTH) + "px"; } if(column.hasGlyph) { var glyphMargin = 2; var glyphClass = column.getGlyphClass(dataIndex, column.index, columnOrder, this._dataSource); if(glyphClass && glyphClass !== "") { var glyphElement = this.createElementWithClass("div", glyphClass + " grid-cell-glyph"); glyphElement.style.left = (level * GridControl.INDENT_WIDTH + glyphMargin) + "px"; cellElement.appendChild(glyphElement); cellElement.style.textIndent = (level * GridControl.INDENT_WIDTH + GridControl.GLYPH_WIDTH + glyphMargin) + "px"; } } if(column.getCellCSSClass) { var cellStyle = column.getCellCSSClass(dataIndex, column.index, columnOrder, this._dataSource); if(cellStyle) { var styles = cellStyle.trim().split(" "); for(var index = 0; index < styles.length; index++) { if(styles[index]) { cellElement.classList.add(styles[index]); } } } } if(column.rowCss) { cellElement.classList.add(column.rowCss); } return cellElement; }; GridControl.prototype._drawSplitters = function () { var _this = this; if(this._options.drawRowSplitters && this._dataSource.length > 0) { var splitters = this._canvas.querySelectorAll(".grid-row-splitter"); for(var index = 0; index < splitters.length; index++) { var element = splitters[index]; element.parentElement.removeChild(element); } var rowInfo = this.getRowInfo(this._lastRenderedDataIndex); var left = 0; if(rowInfo) { var scrollHeight = (this._canvas.scrollHeight - 1) + "px"; for(var index = 0; index < this._columns.length - 1; index++) { var column = this._columns[index]; if(column.hidden) { continue; } var splitter = this.createElementWithClass("div", "grid-row-splitter"); left += parseInt((rowInfo.row.children[index]).style.width); splitter.style.left = left + "px"; splitter.style.height = scrollHeight; splitter.setAttribute("grid-splitter-index", "" + index); if(column.fixed || this._columns[index + 1].fixed) { splitter.classList.add("fixed"); } else { splitter.addEventListener("mousedown", function (e) { _this._onSplitterMouseDown(e); }); splitter.addEventListener("dblclick", function (e) { _this._onSplitterDblClick(e); }); } this._canvas.appendChild(splitter); } } } }; GridControl.prototype._drawHeader = function () { var columns = this._columns, sortOrder = this._sortOrder; if(this._header) { var fragment = document.createDocumentFragment(); for(var i = 0, l = columns.length; i < l; i++) { var column = columns[i]; if(column.hidden) { continue; } var headerElement = this.createElementWithClass("div", "grid-header-column"); GridControl._setTooltip(headerElement, column.tooltip, 65); headerElement.style.width = (column.width || 20) + "px"; (headerElement)._data = { columnIndex: i, header: true }; var seperatorElement = this.createElementWithClass("div", "separator"); if(column.fixed) { seperatorElement.style.cursor = "auto"; } (seperatorElement)._data = { columnIndex: i, separator: true }; headerElement.appendChild(seperatorElement); var headerCellElement = column.getHeaderCellContents(column, i); if(column.headerCss) { headerCellElement.classList.add(column.headerCss); } if(column.tooltip) { GridControl._setTooltip(headerCellElement, column.tooltip, 65); } headerElement.appendChild(headerCellElement); var sortElement = this.createElementWithClass("div", "sort-handle"); sortOrder.forEach(function (element, index, array) { if(element.index === column.index) { if(element.order === "asc") { headerElement.classList.add("ascending"); } else if(element.order === "desc") { headerElement.classList.add("descending"); } return false; } }); headerElement.appendChild(sortElement); fragment.appendChild(headerElement); } this._headerCanvas.innerHTML = ""; this._headerCanvas.appendChild(fragment); GridControl.makeElementUnselectable(this._header); } }; GridControl.prototype._drawHeaderCellValue = function (column, columnOrder) { var cellElement = document.createElement("div"); cellElement.classList.add("title"); cellElement.innerText = column.text || ""; if(columnOrder === this._indentIndex && !(typeof this._indentLevels === "undefined" || this._indentLevels === null)) { cellElement.classList.add("indented-title"); } return cellElement; }; GridControl.prototype._layoutContentSpacer = function () { var width = 0, columns = this._columns; for(var i = 0, l = columns.length; i < l; i++) { if(columns[i].hidden) { continue; } width += (columns[i].width || 20) + this._measurements.cellOffset; } width = width + 2; var height = Math.max(1, this._expandedCount * this._measurements.rowHeight); this._contentSpacer.style.width = width + "px"; this._contentSpacer.style.height = height + "px"; if(this._gutter) { this._gutter.style.height = height + "px"; } this._ignoreScroll = true; try { var scrollTop = Math.max(0, Math.min(this._scrollTop, height - this._canvasHeight)); if(scrollTop !== this._scrollTop) { this._scrollTop = scrollTop; this._canvas.scrollTop = scrollTop; } var scrollLeft = Math.max(0, Math.min(this._scrollLeft, width - this._canvasWidth)); if(scrollLeft !== this._scrollLeft) { this._scrollLeft = scrollLeft; this._canvas.scrollLeft = scrollLeft; } }finally { this._ignoreScroll = false; } this._contentSize.width = width; this._contentSize.height = height; }; GridControl.prototype._layoutHeader = function () { if(this._header) { this._headerCanvas.style.left = this._measurements.gutterWidth - this._scrollLeft + "px"; } if(this._gutter) { this._gutter.style.left = this._scrollLeft + "px"; } }; GridControl.prototype.layout = function (forcePercentWidthCalculation) { this._measureCanvasSize(); var focusedRow = -1; if(document.activeElement && this._canvas.contains(document.activeElement)) { focusedRow = this._selectedIndex; } this._cleanUpRows(); this._fixScrollPos(); this._layoutContentSpacer(); this._updateViewport(false, forcePercentWidthCalculation); if(!document.activeElement && focusedRow >= 0) { this._addSelection(focusedRow, null, null, true); } this._layoutHeader(); this._drawHeader(); this._drawSplitters(); }; GridControl.prototype._fixScrollPos = function () { var oldIgnoreScroll = this._ignoreScroll; this._ignoreScroll = true; try { this._canvas.scrollLeft = this._scrollLeft; this._canvas.scrollTop = this._scrollTop; }finally { this._ignoreScroll = oldIgnoreScroll; } }; GridControl.prototype.redraw = function () { this._fixScrollPos(); this._redraw(true); }; GridControl.prototype._redraw = function (includeNonDirtyRows) { this._layoutHeader(); this._updateViewport(includeNonDirtyRows); }; GridControl.prototype.getColumnValue = function (dataIndex, columnIndex, columnOrder) { return this._dataSource[dataIndex][columnIndex]; }; GridControl.prototype.getColumnText = function (dataIndex, column, columnOrder) { var text; var value = column.getColumnValue(dataIndex, column.index, columnOrder, this._dataSource); if(typeof value !== "string") { text = GridControl.convertValueToDisplayString(value, column.format); } else { text = value; } column.maxLength = Math.max(column.maxLength || 0, text.length); return text; }; GridControl.prototype._getExpandState = function (dataIndex) { var result = 0; if(this._expandStates) { if(typeof (this._expandStates[dataIndex]) === "number") { result = this._expandStates[dataIndex]; } } return result; }; GridControl.prototype.getViewPortRanges = function () { var maxIndex = this._expandedCount - 1; var visibleIndices = this._getVisibleRowIndices(); var firstIndex = visibleIndices.first; var lastIndex = visibleIndices.last; firstIndex = Math.max(0, firstIndex - this._options.extendViewportBy); lastIndex = Math.min(maxIndex, lastIndex + this._options.extendViewportBy); var startDataIndex = this._getDataIndex(firstIndex); var endDataIndex = this._getDataIndex(lastIndex); return new Range(Math.min(startDataIndex, firstIndex), Math.max(endDataIndex, lastIndex)); }; GridControl.prototype.scrollToBottom = function (callback) { this._scrollRenderComplete = callback; if((this._canvas.scrollTop + this._canvas.clientHeight) >= this._canvas.scrollHeight) { if(this._scrollRenderComplete) { this._scrollRenderComplete(); this._scrollRenderComplete = null; } } else { this._canvas.scrollTop = this._canvas.scrollHeight; } }; GridControl.prototype._selectRow = function (rowIndex, dataIndex, options, focus) { var ctrl = options && options.ctrl, shift = options && options.shift, rightClick = options && options.rightClick; if(ctrl) { this._addSelection(rowIndex, dataIndex, { toggle: true }); } else if(shift) { this._clearSelection(); this._addSelectionRange(rowIndex, dataIndex); } else if(rightClick) { if(!this._selectedRows || !(this._selectedRows.hasOwnProperty(rowIndex))) { this._clearSelection(); this._addSelection(rowIndex, dataIndex); } else { this._selectedIndex = rowIndex; this._updateAriaAttribute(); } } else { this._clearSelection(); this._addSelection(rowIndex, dataIndex, null, focus); } }; GridControl.prototype._selectAll = function () { if(this._count > 0 && this._options.allowMultiSelect !== false) { this._clearSelection(); this._selectionStart = 0; var prevIndex = Math.max(0, this._selectedIndex); this._addSelectionRange(this._count - 1, undefined, { doNotFireEvent: true }); this._selectedIndex = prevIndex; this._updateSelectionStyles(); this._selectionChanged(); } }; GridControl.prototype.getSelectedRowIndex = function () { return this._selectedIndex; }; GridControl.prototype.setSelectedRowIndex = function (selectedRowIndex) { this._clearSelection(); this._addSelection(selectedRowIndex); }; GridControl.prototype.getSelectedDataIndex = function () { return this._getDataIndex(this._selectedIndex); }; GridControl.prototype.getSelectedDataIndices = function () { var index, rows = this._selectedRows, indices = []; if(rows) { for(index in rows) { indices[indices.length] = rows[index]; } } return indices; }; GridControl.prototype.ensureDataIndexExpanded = function (dataIndex) { var rowIndex = this._getRowIndex(dataIndex); while(rowIndex < 0 || (dataIndex > 0 && rowIndex === 0)) { this.expandNode(this._getDataIndex(-rowIndex)); rowIndex = this._getRowIndex(dataIndex); } return rowIndex; }; GridControl.prototype.setSelectedDataIndex = function (dataIndex, expandNodes) { var rowIndex = expandNodes ? this.ensureDataIndexExpanded(dataIndex) : this._getRowIndex(dataIndex); this.setSelectedRowIndex(rowIndex); }; GridControl.prototype._clearSelection = function () { this._selectionCount = 0; this._selectedRows = null; }; GridControl.prototype._addSelection = function (rowIndex, dataIndex, options, focus) { var keepSelectionStart = options && options.keepSelectionStart, doNotFireEvent = options && options.doNotFireEvent, toggle = options && options.toggle; if(this._options.allowMultiSelect === false) { keepSelectionStart = false; this._clearSelection(); } if(!this._selectedRows) { this._selectedRows = { }; } if(rowIndex >= 0) { var add = true; if(!(this._selectedRows.hasOwnProperty(rowIndex))) { this._selectionCount++; } else if(toggle) { add = false; this._selectionCount = Math.max(0, this._selectionCount - 1); delete this._selectedRows[rowIndex]; } if(typeof (dataIndex) !== "number") { dataIndex = this._getDataIndex(rowIndex); } if(add) { this._selectedRows[rowIndex] = dataIndex; } this._selectedIndex = rowIndex; this._updateAriaAttribute(); if(this._selectionStart < 0 || !keepSelectionStart) { this._selectionStart = rowIndex; } } else { dataIndex = -1; this._selectedIndex = -1; } if(!doNotFireEvent) { this._updateSelectionStyles(); this._selectionChanged(); if(focus) { this.focus(); } this._selectedIndexChanged(this._selectedIndex, dataIndex); } }; GridControl.prototype._addSelectionRange = function (rowIndex, dataIndex, options) { var doNotFireEvent = options && options.doNotFireEvent, prevSelectedDataIndex = -1, selectedDataIndex; if(this._options.allowMultiSelect === false) { this._addSelection(rowIndex, dataIndex); } else { if(this._selectedRows) { prevSelectedDataIndex = this._selectedRows[this._selectedIndex]; } if(this._selectionStart < 0) { this._selectionStart = rowIndex; } var start = Math.min(this._selectionStart, rowIndex); var end = Math.max(this._selectionStart, rowIndex); if(typeof (dataIndex) !== "number" || start !== rowIndex) { dataIndex = this._getDataIndex(start); } for(var i = start; i <= end; i++) { this._addSelection(i, dataIndex, { keepSelectionStart: true, doNotFireEvent: true }); if(i === rowIndex) { selectedDataIndex = dataIndex; } var nodeState = this._getExpandState(dataIndex); if(nodeState < 0) { dataIndex += (1 - nodeState); } else { dataIndex++; } } this._selectedIndex = rowIndex; this._updateAriaAttribute(); if(!doNotFireEvent) { this._updateSelectionStyles(); this._selectionChanged(); if(prevSelectedDataIndex !== selectedDataIndex) { this._selectedIndexChanged(this._selectedIndex, selectedDataIndex); } } } }; GridControl.prototype._updateAriaAttribute = function () { if(this._active) { var dataIndex = this._getDataIndex(this._selectedIndex); if(dataIndex >= 0) { var rowInfo = this.getRowInfo(dataIndex); if(rowInfo && rowInfo.row) { var id = rowInfo.row.getAttribute("id"); if(id !== this._activeAriaId) { this._canvas.setAttribute("aria-activedescendant", id); this._activeAriaId = id; } } } } }; GridControl.prototype._updateSelectionStyles = function () { var _this = this; if(this._delayedUpdateCookie) { window.clearTimeout(this._delayedUpdateCookie); } this._delayedUpdateCookie = window.setTimeout(function () { var dataIndex, selectedRows = _this._selectedRows, focusIndex = _this._selectedIndex, rows = _this._rows; for(dataIndex in rows) { var rowInfo = rows[dataIndex]; _this._updateRowSelectionStyle(rowInfo, selectedRows, focusIndex); } }, 10); }; GridControl.prototype._selectionChanged = function () { this.selectionChanged(this._selectedIndex, this._selectionCount, this._selectedRows); this.fireCustomEvent(this._element, "selectionchanged", [ { selectedIndex: this._selectedIndex, selectedCount: this._selectionCount, selectedRows: this._selectedRows } ]); }; GridControl.prototype.selectionChanged = function (selectedIndex, selectedCount, selectedRows) { }; GridControl.prototype._selectedIndexChanged = function (selectedRowIndex, selectedDataIndex) { this.selectedIndexChanged(selectedRowIndex, selectedDataIndex); this.fireCustomEvent(this._element, GridControl.EVENT_SELECTED_INDEX_CHANGED, [ selectedRowIndex, selectedDataIndex ]); }; GridControl.prototype.selectedIndexChanged = function (selectedRowIndex, selectedDataIndex) { }; GridControl.prototype._updateRowSelectionStyle = function (rowInfo, selectedRows, focusIndex) { var rowIndex = rowInfo.rowIndex; var rowElement = rowInfo.row; var gutterElement = rowInfo.gutterRow; rowElement.classList.remove("grid-row-selected"); rowElement.classList.remove("grid-row-selected-blur"); rowElement.classList.remove("grid-row-current"); rowElement.setAttribute("tabindex", "-1"); if(gutterElement) { gutterElement.classList.remove("grid-gutter-row-selected"); gutterElement.classList.remove("grid-gutter-row-selected-blur"); gutterElement.classList.remove("grid-gutter-row-current"); gutterElement.querySelector("input.checkbox").setAttribute("checked", String(false)); } if(selectedRows && selectedRows.hasOwnProperty(rowIndex)) { if(gutterElement) { gutterElement.querySelector("input.checkbox").setAttribute("checked", String(true)); } if(this._active) { rowElement.classList.add("grid-row-selected"); rowElement.setAttribute("tabindex", "1"); if(gutterElement) { gutterElement.classList.add("grid-gutter-row-selected"); } } else { rowElement.classList.add("grid-row-selected-blur"); rowElement.setAttribute("tabindex", "1"); if(gutterElement) { gutterElement.classList.add("grid-gutter-row-selected-blur"); } } } if(rowIndex === focusIndex) { rowElement.classList.add("grid-row-current"); if(gutterElement) { gutterElement.classList.add("grid-gutter-row-current"); } } }; GridControl.prototype.focus = function (timeout) { var _this = this; var doSetFocus = function () { if(document.activeElement === _this._canvas) { return; } try { if(_this._selectedIndex > -1) { var dataIndex = _this._getDataIndex(_this._selectedIndex); var rowInfo = _this._rows[dataIndex]; if(rowInfo) { var rowElement = rowInfo.row; if(rowElement) { rowElement.focus(); } } } } catch (ex) { } }; if(!timeout) { doSetFocus(); } else { window.setTimeout(function () { doSetFocus(); }, timeout); } }; GridControl.prototype._notifyForPrerender = function () { if(this._options.prerenderCallback) { var range = this.getViewPortRanges(); this._options.prerenderCallback(range.start, range.end); } }; GridControl.prototype.measureColumnSize = function (forcePercentWidthCalculation) { var remainingWidth = this._canvas.clientWidth - (this.isVerticalScrollbarVisible ? 0 : 17); for(var index = 0; index < this._columns.length; index++) { var columnInfo = this._columns[index]; if(columnInfo.fixed) { remainingWidth -= columnInfo.width; } } if(remainingWidth > 0) { if(forcePercentWidthCalculation) { for(var index = 0; index < this._columns.length; index++) { var columnInfo = this._columns[index]; if(!columnInfo.fixed && columnInfo.percentWidth) { columnInfo.percentWidth = columnInfo.width / remainingWidth; } } } for(var index = 0; index < this._columns.length; index++) { var columnInfo = this._columns[index]; if(!columnInfo.fixed && columnInfo.percentWidth) { columnInfo.width = remainingWidth * columnInfo.percentWidth; } } } }; GridControl.prototype._onContainerMouseDown = function (e) { var targetElement = e.target; if(targetElement.classList.contains("grid-edit-box")) { return; } this.focus(10); }; GridControl.prototype._measureCanvasSize = function () { this._canvasHeight = this._canvas.clientHeight; this._canvasWidth = this._canvas.clientWidth; }; GridControl.prototype._onContainerResize = function (e) { var _this = this; if(!this._resizeLayoutTimeout) { this._resizeLayoutTimeout = window.setTimeout(function () { _this.measureColumnSize(false); _this.layout(); _this._notifyForPrerender(); _this._resizeLayoutTimeout = null; }, 200); } }; GridControl.prototype._setupMoveEvents = function () { var _this = this; document.addEventListener("mousemove", function (e) { return _this._onDocumentMouseMove(e); }); document.addEventListener("mouseup", function (e) { return _this._onDocumentMouseUp(e); }); }; GridControl.prototype._clearMoveEvents = function () { document.removeEventListener("mousemove", null, true); document.removeEventListener("mouseup", null, true); }; GridControl.prototype._onDocumentMouseMove = function (e) { var columnSizing = this._columnSizing; if(columnSizing && columnSizing.active === true) { var delta = e.pageX - columnSizing.origin; var newWidth = Math.max(15, columnSizing.originalWidth + delta); var column = this._columns[columnSizing.index]; column.width = newWidth; this._applyColumnSizing(columnSizing.index); this._moveSizingElement(columnSizing.index); } }; GridControl.prototype._onDocumentMouseUp = function (e) { var _this = this; window.setTimeout(function () { _this._tryFinishColumnSizing(false); }, 0); return false; }; GridControl.prototype._onHeaderMouseDown = function (e) { if(e.which !== 1) { return true; } var separator = this.findClosestElement(e.target, ".separator"); if(separator && (separator)._data) { var columnIndex = (separator)._data.columnIndex; var column = this._columns[columnIndex]; if(!column.fixed) { this._columnSizing = new ColumnSizing(true, columnIndex, column.width, e.pageX); this._moveSizingElement(columnIndex); this._setupMoveEvents(); e.stopImmediatePropagation(); e.preventDefault(); return false; } } }; GridControl.prototype._onHeaderMouseUp = function (e) { return false; }; GridControl.prototype._onHeaderClick = function (e) { var headerColumn = this.findClosestElement(e.target, ".grid-header-column"); if(headerColumn) { if(!this._columnSizing) { var separator = this.findClosestElement(e.target, ".separator"); if(separator && (separator)._data) { return false; } else if((headerColumn)._data) { var columnIndex = (headerColumn)._data.columnIndex; var column = this._columns[columnIndex]; if(column.canSortBy && !column.fixed) { this._sortBy(column, e.shiftKey); } } } } }; GridControl.prototype._onHeaderDblClick = function (e) { var separator = this.findClosestElement(e.target, ".separator"); if(separator && (separator)._data) { this._tryFinishColumnSizing(true); var columnIndex = (separator)._data.columnIndex; var column = this._columns[columnIndex]; var maxLength = Math.max(column.maxLength || 0, 3); var ratio = 1.1 + 0.7 * Math.exp(-maxLength / 20); var originalWidth = column.width; column.width = (column.indentOffset || 0) + Math.round(maxLength * ratio * this._measurements.unitEx); this._applyColumnSizing(columnIndex, originalWidth, true); return false; } }; GridControl.prototype.getCellContentWidth = function (cell) { if(document.createRange) { var range = document.createRange(); if(cell.firstChild && cell.firstChild.nodeType === Node.TEXT_NODE) { range.selectNodeContents(cell.firstChild); var rect = range.getBoundingClientRect(); return parseInt(cell.style.textIndent, 10) + rect.width; } } return cell.clientWidth; }; GridControl.prototype._onSplitterDblClick = function (e) { var _this = this; var maxWidth = 0; var splitter = (e.target); if(splitter) { var columnIndex = parseInt(splitter.getAttribute("grid-splitter-index"), 10); var maxWidth = 0; for(var rowIndex in this._rows) { var row = this._rows[rowIndex]; if(row) { var columnWidth = this.getCellContentWidth(row.row.children[columnIndex]); maxWidth = maxWidth > columnWidth ? maxWidth : columnWidth; } } var leftColumn = this._columns[columnIndex]; var rightColumn = this._columns[columnIndex + 1]; if(leftColumn.hasGlyph) { maxWidth += GridControl.GLYPH_WIDTH; } var currentDiff = leftColumn.width - (maxWidth + 3); var newLeftWidth = leftColumn.width - currentDiff; var newRightWidth = rightColumn.width + currentDiff; if(newLeftWidth >= ColumnInfo.MIN_RESIZE_WIDTH && newRightWidth >= ColumnInfo.MIN_RESIZE_WIDTH) { leftColumn.width -= currentDiff; rightColumn.width += currentDiff; window.setTimeout(function () { _this.layout(true); }, 0); } else if(newRightWidth < ColumnInfo.MIN_RESIZE_WIDTH) { newLeftWidth -= (ColumnInfo.MIN_RESIZE_WIDTH - newRightWidth); newRightWidth = ColumnInfo.MIN_RESIZE_WIDTH; } } }; GridControl.prototype._onSplitterMouseDown = function (e) { var _this = this; var splitterOffset, columnIndex; var leftColumn, rightColumn; var onMouseMove = function (e) { var splitter = document.querySelector(".grid-row-splitter.active"); if(splitter) { var currentDiff = e.clientX - splitterOffset; var newLeftWidth = leftColumn.width + currentDiff; var newRightWidth = rightColumn.width - currentDiff; if(newLeftWidth >= ColumnInfo.MIN_RESIZE_WIDTH && newRightWidth >= ColumnInfo.MIN_RESIZE_WIDTH) { splitter.style.left = (splitter.offsetLeft + currentDiff) + "px"; splitterOffset = e.clientX; leftColumn.width += currentDiff; rightColumn.width -= currentDiff; } } }; var onMouseUp = function (e) { var splitter = document.querySelector(".grid-row-splitter.active"); if(splitter) { splitter.classList.remove("active"); window.setTimeout(function () { _this.layout(true); }, 0); } document.removeEventListener("mousemove", onMouseMove); document.removeEventListener("mouseup", onMouseUp); }; if(e.button === Common.MouseButtons.LEFT_BUTTON) { var splitter = e.target; columnIndex = parseInt(splitter.getAttribute("grid-splitter-index"), 10); leftColumn = this._columns[columnIndex]; rightColumn = this._columns[columnIndex + 1]; if(!leftColumn.fixed && !rightColumn.fixed) { splitter.classList.add("active"); splitterOffset = e.clientX; document.addEventListener("mousemove", onMouseMove); document.addEventListener("mouseup", onMouseUp); } } }; GridControl.prototype._moveSizingElement = function (columnIndex) { var left = this._measurements.gutterWidth; if(!this._sizingElement) { if(columnIndex < 0) { return; } this._sizingElement = this.createElementWithClass("div", "grid-column-sizing"); this._canvas.appendChild(this._sizingElement); } this._sizingElement.style.height = (this._canvas.clientHeight - 1) + "px"; this._sizingElement.style.top = this._scrollTop + "px"; if(columnIndex < 0) { this._sizingElement.style.left = "-5000px"; this._sizingElement.style.top = "-5000px"; this._sizingElement.style.height = 0 + "px"; } else { var i = 0; while(i <= columnIndex) { var column = this._columns[i++]; if(!column.hidden) { left += column.width; } } this._sizingElement.style.left = (left - 1) + "px"; } }; GridControl.prototype._getVisibleColumnIndex = function (columnIndex) { var columnCounter = 0, visibleColumnIndex = 0, length = this._columns.length; if(this._columns[columnIndex].hidden) { return -1; } while(columnCounter < columnIndex) { if(!this._columns[columnCounter].hidden) { visibleColumnIndex++; } columnCounter++; } return visibleColumnIndex; }; GridControl.prototype._applyColumnSizing = function (columnIndex, initialWidth, finish) { var domColumnIndex = this._getVisibleColumnIndex(columnIndex) + 1, column = this._columns[columnIndex], columnSizeChanged = false; initialWidth = initialWidth || -1; if(column) { columnSizeChanged = column.width !== initialWidth; var columnDiv = this.rootElement.querySelector(".grid-header-canvas .grid-header-column:nth-child(" + domColumnIndex + ")"); columnDiv.style.width = column.width + "px"; } if(finish === true) { if(columnSizeChanged) { this.layout(); } this._onColumnResize(column); } }; GridControl.prototype._onColumnResize = function (column) { this.fireCustomEvent(this._element, "columnresize", [ column ]); }; GridControl.prototype._tryFinishColumnSizing = function (cancel) { var columnSizing = this._columnSizing; if(columnSizing) { if(columnSizing.active === true) { if(!cancel) { this._applyColumnSizing(columnSizing.index, columnSizing.originalWidth, true); } this._moveSizingElement(-1); } this._columnSizing = null; this._clearMoveEvents(); } }; GridControl.prototype._getSortColumns = function (sortOrder) { var columns = this._columns, sortColumns = []; for(var i = 0, l = sortOrder.length; i < l; i++) { var c; var sc = sortOrder[i]; columns.forEach(function (element, index, array) { if(element.index === sc.index) { c = element; return false; } }); sortColumns.push(c); } return sortColumns; }; GridControl.prototype._sortBy = function (column, add) { var sortOrder = this._sortOrder.slice(0), found = false; if(column) { for(var i = 0, l = sortOrder.length; i < l; i++) { var sc = sortOrder[i]; if(sc.index === column.index) { sortOrder.splice(i, 1); found = true; break; } } var sc; if(found) { sc = new SortOrderInfo(sc.index, sc.order === "asc" ? "desc" : "asc"); } else { sc = new SortOrderInfo(column.index, "asc"); } if(add && this._options.allowSortOnMultiColumns) { sortOrder.push(sc); } else { sortOrder = [ sc ]; } } var sortColumns = this._getSortColumns(sortOrder); this._onSort(sortOrder, sortColumns); }; GridControl.prototype._onSort = function (sortOrder, sortColumns) { if(this.onSort(sortOrder, sortColumns) !== false) { this.fireCustomEvent(this._element, "sort", [ { sortOrder: sortOrder, sortColumns: sortColumns } ]); } }; GridControl.prototype.onSort = function (sortOrder, sortColumns) { if(this._options.autoSort) { this._trySorting(sortOrder, sortColumns); this._sortOrder = sortOrder; this.layout(); } return true; }; GridControl.prototype._trySorting = function (sortOrder, sortColumns) { var _this = this; if(!sortColumns) { sortColumns = this._getSortColumns(sortOrder); } var selectedDatas = [], sumOfSelectedRowIndices = 0; for(var rowIndex in this._selectedRows) { var dataIndex = this._selectedRows[rowIndex]; var data = this._dataSource[dataIndex]; if(data) { selectedDatas.push(data); sumOfSelectedRowIndices += parseInt(rowIndex); } } var rootNode = new TreeNode(null, null); GridControl.addItemsToTree(this._dataSource, this._expandStates, 0, this._dataSource.length, rootNode); if(this._sortOrder && this._sortOrder.length === 1 && sortOrder.length === 1 && this._sortOrder[0] !== sortOrder[0] && this._sortOrder[0].index === sortOrder[0].index) { if(this._sortOrder[0].order !== sortOrder[0].order) { GridControl.walkTree(rootNode, function (node) { Utility.TreeNodeSort.stableReverse(node.children, function (v1, v2) { return Utility.TreeNodeSort.sortComparer(sortOrder, sortColumns, v1.data, v2.data); }); }); } } else { GridControl.walkTree(rootNode, function (node) { node.children.sort(function (v1, v2) { return Utility.TreeNodeSort.sortComparer(sortOrder, sortColumns, v1.data, v2.data); }); }); } this._dataSource = []; this._expandStates = []; for(var i = 0; i < rootNode.children.length; i++) { GridControl.walkTree(rootNode.children[i], function (node) { _this._dataSource.push(node.data); _this._expandStates.push(node.expandState); }); } this._indentLevels = GridControl.expand(this._expandStates); this._updateRanges(); if(this._selectionCount > 0) { this._clearSelection(); var sumOfNewSelectedRowIndices = 0; for(var i = 0; i < selectedDatas.length; i++) { var dataIndex = this._dataSource.indexOf(selectedDatas[i]); if(dataIndex >= 0) { var dataRowIndex = this._getRowIndex(dataIndex); this._addSelection(dataRowIndex, dataIndex); sumOfNewSelectedRowIndices += dataRowIndex; } } this._scrollTop += (sumOfNewSelectedRowIndices - sumOfSelectedRowIndices) / this._selectionCount * this._measurements.rowHeight; } }; GridControl.prototype._onCanvasScroll = function (e) { var canvas = this._canvas; this._resetScroll = true; this._scrollLeft = canvas.scrollLeft; this._scrollTop = canvas.scrollTop; if(!this._ignoreScroll) { this._notifyForPrerender(); this._redraw(); if(this._scrollRenderComplete) { this._scrollRenderComplete(); this._scrollRenderComplete = null; } } return false; }; GridControl.prototype.getRowInfoFromEvent = function (e, selector) { var element = this.findClosestElement(e.target, selector); return this._rowInfoMap[element.uniqueID]; }; GridControl.prototype._getClickedCell = function (e) { return this.findClosestElement(e.target, ".grid-cell"); }; GridControl.prototype._isCellEditing = function (cellElement) { return cellElement.querySelectorAll(".grid-edit-box").length === 1; }; GridControl.prototype._createEditCellBox = function (rowDataIndex, columnIndex, editElement, commitEditCallback) { var _this = this; if(this._options.preEditCellCallback !== null) { this._options.preEditCellCallback(rowDataIndex, columnIndex); } var postEditCellCallback = this._options.postEditCellCallback; var textValue = editElement.hasAttribute("grid-edit-value") ? editElement.getAttribute("grid-edit-value") : editElement.innerText; var previousHTML = editElement.innerHTML; var editBox = this.createElementWithClass("input", "grid-edit-box"); var ignoreCommitCallback = false; editBox.setAttribute("type", "text"); editBox.setAttribute("value", textValue); function notifyPostEdit(rowDataIndex, columnIndex) { if(postEditCellCallback !== null) { postEditCellCallback(rowDataIndex, columnIndex); } } function commitValue(e) { var data = (editBox).value; editElement.innerText = ignoreCommitCallback ? textValue : data; if(commitEditCallback && !ignoreCommitCallback) { commitEditCallback(data, rowDataIndex, columnIndex); } notifyPostEdit(rowDataIndex, columnIndex); e.stopPropagation(); e.preventDefault(); return false; } editBox.addEventListener("focusout", function (e) { commitValue(e); }); editBox.addEventListener("keydown", function (e) { var rowInfo = _this.getRowInfo(rowDataIndex); var columns = _this._columns; if(e.keyCode === Common.KeyCodes.ENTER) { commitValue(e); } else if(e.keyCode === Common.KeyCodes.ESCAPE) { editElement.innerHTML = previousHTML; _this.focus(); notifyPostEdit(rowDataIndex, columnIndex); e.stopPropagation(); e.preventDefault(); return false; } else if(e.keyCode === Common.KeyCodes.TAB) { if(_this._options.commitOnTab) { commitValue(e); } else { var cells = rowInfo.row.children; ignoreCommitCallback = true; notifyPostEdit(rowDataIndex, columnIndex); if(e.shiftKey) { while(columnIndex > 0) { columnIndex--; var cell = cells[columnIndex]; if(cell.classList.contains("grid-cell-editable")) { _this._createEditCellBox(rowDataIndex, columnIndex, cell, commitEditCallback); break; } } } else { while(columnIndex < columns.length - 1) { columnIndex++; var cell = cells[columnIndex]; if(cell.classList.contains("grid-cell-editable")) { _this._createEditCellBox(rowDataIndex, columnIndex, cell, commitEditCallback); break; } } } e.stopPropagation(); return false; } } else if(e.keyCode === Common.KeyCodes.ARROW_UP || e.keyCode === Common.KeyCodes.ARROW_DOWN || e.keyCode === Common.KeyCodes.PAGE_UP || e.keyCode === Common.KeyCodes.PAGE_DOWN) { return true; } else { e.stopPropagation(); return Common.preventIEKeys(e); } }); editElement.innerHTML = ""; editElement.appendChild(editBox); editBox.select(); editBox.focus(); }; GridControl.prototype.onEditCell = function (e) { var targetElement = e.target; if(!targetElement.classList.contains("grid-tree-icon")) { var cellElement = this._getClickedCell(e); if(this._isCellEditing(cellElement)) { return; } if(cellElement && cellElement.classList.contains("grid-cell-editable")) { var rowInfo = this.getRowInfoFromEvent(e, ".grid-row"); if(rowInfo) { var cells = rowInfo.row.children; var totalCells = cells.length; var columnIndex = -1; for(var index = 0; index < totalCells; index++) { if(cellElement === cells[index]) { columnIndex = index; } } this._createEditCellBox(rowInfo.dataIndex, columnIndex, cellElement, this._commitEditCellCallback); } } } }; GridControl.prototype.createEditBox = function (dataIndex, columnIndex, cellElement, callback) { var callback = callback || this._commitEditCellCallback; this._createEditCellBox(dataIndex, columnIndex, cellElement, callback); }; GridControl.prototype._onRowMouseDown = function (e) { var rowInfo = this.getRowInfoFromEvent(e, ".grid-row"); if(rowInfo) { var targetElement = e.target; if(e.which === 1 && targetElement.classList.contains("grid-tree-icon")) { this._onToggle(rowInfo); } else if(!(e.which === 3 && this._options && this._options.disableRightClickSelection)) { this._selectRow(rowInfo.rowIndex, rowInfo.dataIndex, { ctrl: e.ctrlKey, shift: e.shiftKey, rightClick: e.which === 3 }); } } }; GridControl.prototype._onGutterClick = function (e) { var rowInfo = this.getRowInfoFromEvent(e, ".grid-gutter-row"), target; if(rowInfo) { if(!this._selectedRows || typeof (this._selectedRows[rowInfo.rowIndex]) !== "number") { this._selectRow(rowInfo.rowIndex, rowInfo.dataIndex); } } }; GridControl.prototype._onBlur = function (e) { var targetElement = e.target; if(targetElement.classList.contains("grid-edit-box")) { e.stopPropagation(); return; } this._active = false; this._updateSelectionStyles(); }; GridControl.prototype._onFocus = function (e) { var targetElement = e.target; if(targetElement.classList.contains("grid-edit-box")) { e.stopEventPropagation(); return; } this._active = true; this._updateSelectionStyles(); this._updateAriaAttribute(); }; GridControl.prototype._onKeyDown = function (e) { var bounds = { lo: -1, hi: -1 }, keyCode = Common.KeyCodes, canvas = this._canvas; if(this._options.isGridDisabled) { return false; } if(this._copyInProgress) { if(e.keyCode === keyCode.ESCAPE) { if(this._cancelable) { this._cancelable.cancel(); } } return false; } if(this._count > 0) { bounds = { lo: 0, hi: this._expandedCount - 1 }; } if(this._selectedIndex < 0) { this._addSelection(bounds.lo); } if(this._options.keyboardEventHandler) { if(this._options.keyboardEventHandler.keys.indexOf(e.key) !== -1) { var handled = this._options.keyboardEventHandler.handler(e, this._dataSource, this._getDataIndex(this._selectedIndex)); if(handled) { e.preventDefault(); return false; } } } switch(e.keyCode) { case keyCode.ARROW_DOWN: this._clearSelection(); this._addSelection(Math.min(this._selectedIndex + 1, bounds.hi), null, null, true); break; case keyCode.ARROW_UP: this._clearSelection(); this._addSelection(Math.max(this._selectedIndex - 1, bounds.lo), null, null, true); break; case keyCode.PAGE_DOWN: this._clearSelection(); var visibleIndices = this._getVisibleRowIndices(); if(this._selectedIndex < visibleIndices.last) { this._addSelection(visibleIndices.last, null, null, true); } else { var pageCount = visibleIndices.last - visibleIndices.first + 1; this._addSelection(Math.min(this._selectedIndex + pageCount, bounds.hi), null, null, true); } break; case keyCode.PAGE_UP: this._clearSelection(); var visibleIndices = this._getVisibleRowIndices(); if(this._selectedIndex > visibleIndices.first) { this._addSelection(visibleIndices.first, null, null, true); } else { var pageCount = visibleIndices.last - visibleIndices.first + 1; this._addSelection(Math.max(this._selectedIndex - pageCount, bounds.lo), null, null, true); } break; case keyCode.ARROW_RIGHT: this.tryToggle(true, e.shiftKey); break; case keyCode.ARROW_LEFT: if(!this.tryToggle(false, e.shiftKey)) { var dataIndex = this._getDataIndex(this._selectedIndex); var index = dataIndex - 1; while(index >= 0) { if(dataIndex - index <= Math.abs(this._expandStates[index])) { this._selectRow(this._getRowIndex(index), null, null, true); break; } index--; } } break; case keyCode.HOME: this._clearSelection(); this._addSelection(bounds.lo, null, null, true); break; case keyCode.END: this._clearSelection(); this._addSelection(bounds.hi, null, null, true); break; case keyCode.F2: var rowInfo = this.getRowInfo(this._getDataIndex(this._selectedIndex)); var firstEditableIndex = this._getFirstEditableCellIndex(rowInfo.row.children); if(firstEditableIndex >= 0) { this.createEditBox(rowInfo.dataIndex, firstEditableIndex, rowInfo.row.children[firstEditableIndex]); } break; case keyCode.TAB: return true; } this.getSelectedRowIntoView(); e.preventDefault(); return false; }; GridControl.prototype._getFirstEditableCellIndex = function (cells) { for(var index = 0; index < cells.length; index++) { if((cells[index]).classList.contains("grid-cell-editable")) { return index; } } return -1; }; GridControl.prototype._onToggle = function (rowInfo) { if(this._expandStates) { var state = this._expandStates[rowInfo.dataIndex]; if(state !== 0) { if(state > 0) { this.collapseNode(rowInfo.dataIndex); } else if(state < 0) { this.expandNode(rowInfo.dataIndex); } this._clearSelection(); this._addSelection(Math.min(rowInfo.rowIndex, this._expandedCount - 1), rowInfo.dataIndex, null, true); this._layoutContentSpacer(); this._redraw(); this._notifyForPrerender(); } } }; GridControl.prototype.getExpandStates = function () { return this._expandStates; }; return GridControl; })(Common.Controls.Control); Grid.GridControl = GridControl; })(Debugger.Grid || (Debugger.Grid = {})); var Grid = Debugger.Grid; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=gridControl.js.map // control.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var Control = (function () { function Control(root) { this._rootElement = root; if(typeof this._rootElement === "undefined") { this._rootElement = document.createElement("div"); this._rootElement.style.width = this._rootElement.style.height = "100%"; } } Control.prototype.appendChild = function (child) { this._rootElement.appendChild(child.rootElement); child.parent = this; }; Control.prototype.removeChild = function (child) { this._rootElement.removeChild(child.rootElement); child.parent = null; }; Object.defineProperty(Control.prototype, "rootElement", { get: function () { return this._rootElement; }, set: function (newRoot) { var oldRoot = this._rootElement; this._rootElement = newRoot; if(oldRoot && oldRoot.parentNode) { oldRoot.parentNode.replaceChild(newRoot, oldRoot); } }, enumerable: true, configurable: true }); Object.defineProperty(Control.prototype, "parent", { get: function () { return this._parent; }, set: function (newParent) { if(this._parent !== newParent) { this._parent = newParent; if(this._parent && !this._parent.rootElement.contains(this._rootElement)) { this._parent.appendChild(this); } this.onParentChanged(); } }, enumerable: true, configurable: true }); Control.prototype.onParentChanged = function () { }; return Control; })(); Debugger.Control = Control; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=control.js.map // templateControl.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var TemplateControl = (function (_super) { __extends(TemplateControl, _super); function TemplateControl(templateName) { _super.call(this); this._idPostfix = TemplateControl._globalIdPostfix++; if(templateName) { this.setTemplateFromName(templateName); } } TemplateControl._globalIdPostfix = 1; TemplateControl.prototype.setTemplateFromName = function (templateName) { var root = this.getTemplateElementCopy(templateName); this.adjustElementIds(root); this.rootElement = root; }; TemplateControl.prototype.setTemplateFromHTML = function (htmlContent) { var root = this.getTemplateElementFromHTML(htmlContent); this.adjustElementIds(root); this.rootElement = root; }; TemplateControl.prototype.findElement = function (id) { var fullId = id + this._idPostfix; return this.forAllSelfAndDescendants(this.rootElement, function (elem) { if(elem.id && elem.id === fullId) { return false; } return true; }); }; TemplateControl.prototype.getTemplateElementCopy = function (templateName) { var templateElement = document.getElementById(templateName); return this.getTemplateElementFromHTML(templateElement.innerHTML); }; TemplateControl.prototype.getTemplateElementFromHTML = function (htmlContent) { var root = this.getTemplateRootElement(); root.innerHTML = htmlContent; if(root.childElementCount === 1) { root = root.firstElementChild; } return root; }; TemplateControl.prototype.getTemplateRootElement = function () { var div = document.createElement("div"); div.style.width = div.style.height = "100%"; return div; }; TemplateControl.prototype.adjustElementIds = function (root) { var idPostfix = this._idPostfix; this.forAllSelfAndDescendants(root, function (elem) { if(elem.id) { elem.id = elem.id + idPostfix; } return true; }); }; TemplateControl.prototype.forAllSelfAndDescendants = function (root, func) { var brokeAtElement = null; if(!func(root)) { brokeAtElement = root; } else { if(root.children) { var children = root.children; var childrenLength = children.length; for(var i = 0; i < childrenLength; i++) { brokeAtElement = this.forAllSelfAndDescendants(children[i], func); if(brokeAtElement) { break; } } } } return brokeAtElement; }; return TemplateControl; })(Debugger.Control); Debugger.TemplateControl = TemplateControl; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=templateControl.js.map // contentControl.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var ContentControl = (function (_super) { __extends(ContentControl, _super); function ContentControl() { _super.call(this); } Object.defineProperty(ContentControl.prototype, "content", { get: function () { return this._content; }, set: function (newContent) { if(this._content !== newContent) { if(this._content) { this.removeChild(this._content); } this._content = newContent; this.appendChild(this._content); this.onContentChanged(); } }, enumerable: true, configurable: true }); ContentControl.prototype.appendChild = function (child) { _super.prototype.appendChild.call(this, child); }; ContentControl.prototype.onContentChanged = function () { }; return ContentControl; })(Debugger.Control); Debugger.ContentControl = ContentControl; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=contentControl.js.map // tabControl.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var TabOptions = (function () { function TabOptions(disableWrap, onAddCallback, onCloseCallback, onSelectCallback) { this._disableWrap = disableWrap; this.onCloseCallback = onCloseCallback; this.onAddCallback = onAddCallback; this.onSelectCallback = onSelectCallback; this.CLOSE_TAB_TIME = 30; this.SLIDE_TIME = 100; this.SCROLL_AMOUNT = 50; } Object.defineProperty(TabOptions.prototype, "disableWrap", { get: function () { return this._disableWrap; }, enumerable: true, configurable: true }); return TabOptions; })(); Debugger.TabOptions = TabOptions; var TabControl = (function (_super) { __extends(TabControl, _super); function TabControl(root, options, contextMenuElement) { var _this = this; _super.call(this); this._items = []; this._idToItemMap = { }; this._tabOptions = options; this.rootElement = root; if(options) { this._disableWrap = options.disableWrap; } var html = "
      "; this.rootElement.innerHTML = html; if(this._disableWrap) { var tabContainer = (document.querySelector(".tabBarContainer")); tabContainer.classList.add("disableWrap"); var tabNavigation = document.createElement("div"); tabNavigation.id = "tabNavigation"; tabNavigation.innerHTML = "
      "; tabNavigation.classList.add("tabNavigation"); tabNavigation.classList.add("hiddenButton"); tabContainer.appendChild(tabNavigation); var previousButton = document.getElementById("prevTabButton"); var nextButton = document.getElementById("nextTabButton"); previousButton.addEventListener("click", function (e) { return _this.scrollToPreviousTab(e); }); nextButton.addEventListener("click", function (e) { return _this.scrollToNextTab(e); }); previousButton.addEventListener("mousedown", function (e) { return _this.startScrollToPrevious(e); }); previousButton.addEventListener("mouseup", function (e) { return _this.stopScrollToPrevious(e); }); nextButton.addEventListener("mousedown", function (e) { return _this.startScrollToNext(e); }); nextButton.addEventListener("mouseup", function (e) { return _this.stopScrollToNext(e); }); } this._barPanel = new Debugger.Control(document.querySelector(".tabBar")); this._contentPane = new Debugger.Control(document.querySelector(".tabContentPane")); this._contextMenu = Plugin.ContextMenu.create(this.createMenuItems(), TabControl._contextMenuId, null, null, null); window.addEventListener("resize", function (e) { _this.realignControl(false); }); } TabControl._contextMenuId = "TabControlContextMenu"; TabControl.prototype.createMenuItems = function () { var _this = this; var menuItems = []; menuItems.push({ id: "menuItemCloseTabControl", callback: function (menuId, menuItem, targetId) { return _this.onCloseTab(menuId, menuItem, targetId); }, label: Plugin.Resources.getString("TabContextMenuCloseTab"), type: Plugin.ContextMenu.MenuItemType.command, accessKey: Plugin.Resources.getString("AccessKeyCtrlF4") }); menuItems.push({ id: "menuItemCloseAllTabControl", callback: function (menuId, menuItem, targetId) { return _this.onCloseAllTabs(menuId, menuItem, targetId); }, label: Plugin.Resources.getString("TabContextMenuCloseAllTabs"), type: Plugin.ContextMenu.MenuItemType.command }); menuItems.push({ id: "menuItemCloseOthersTabControl", callback: function (menuId, menuItem, targetId) { return _this.onCloseOtherTabs(menuId, menuItem, targetId); }, label: Plugin.Resources.getString("TabContextMenuCloseOtherTabs"), type: Plugin.ContextMenu.MenuItemType.command, disabled: function () { return (_this._items.length <= 1); } }); menuItems.push({ id: "menuItemSep1TabControl", type: Plugin.ContextMenu.MenuItemType.separator }); menuItems.push({ id: "menuItemCopyUrlTabControl", callback: function (menuId, menuItem, targetId) { return _this.onCopyUrl(menuId, menuItem, targetId); }, label: Plugin.Resources.getString("WatchesContextMenuCopy"), type: Plugin.ContextMenu.MenuItemType.command }); return menuItems; }; TabControl.prototype.onCloseTab = function (menuId, menuItem, targetId) { var tabItem = this.tabItemFromHtmlId(targetId); this.removeTab(tabItem); }; TabControl.prototype.onCloseAllTabs = function (menuId, menuItem, targetId) { this.closeAllTabs(); }; TabControl.prototype.onCloseOtherTabs = function (menuId, menuItem, targetId) { var tabItem = this.tabItemFromHtmlId(targetId); this.closeAllTabsButThis(tabItem); }; TabControl.prototype.onCopyUrl = function (menuId, menuItem, targetId) { var tabItem = this.tabItemFromHtmlId(targetId); clipboardData.setData("Url", tabItem.tooltipString); }; TabControl.prototype.tabItemFromHtmlId = function (targetId) { var realId = Debugger.TabItem.getTabIdFromHtmlId(targetId); var tabItem = this._idToItemMap[realId]; return tabItem; }; TabControl.prototype.realignControl = function (withAnimation) { if(this._disableWrap) { this.performOverflowCheck(); this.realignTabs(withAnimation); if(this.selectedItem) { this.setTabViewable(this.selectedItem, withAnimation); } } }; TabControl.prototype.addTab = function (tabItem) { Tools.Utility.Assert.IsUndefined(this.getTabById(tabItem.id), "Id already in use for a tab"); this._items.push(tabItem); this._idToItemMap[tabItem.id] = tabItem; tabItem.ownerTabControl = this; this._barPanel.appendChild(tabItem.header); this._contentPane.appendChild(tabItem); this.makeDescendantsUnselectable(tabItem.header.rootElement); this._contextMenu.attach(tabItem.header.rootElement); if(!this._selectedItem) { this.selectedItem = tabItem; } this.realignControl(true); if(this._tabOptions && this._tabOptions.onAddCallback) { this._tabOptions.onAddCallback(tabItem.id); } }; TabControl.prototype.removeTab = function (tabItem, fastClose) { var _this = this; var indexOfItem = this._items.indexOf(tabItem); if(indexOfItem < 0) { return Plugin.Promise.wrap(null); } if(this.selectedItem === tabItem) { this.selectedItem = null; } this._contextMenu.detach(tabItem.header.rootElement); this._items.splice(indexOfItem, 1); Tools.Utility.Assert.HasValue(this.getTabById(tabItem.id)); this._idToItemMap[tabItem.id] = undefined; if(!this.selectedItem) { var newSelectedItemIndex = Math.min(this._items.length - 1, indexOfItem); if(newSelectedItemIndex >= 0) { this.selectedItem = this._items[newSelectedItemIndex]; } } return new Plugin.Promise(function (completed, error) { if(fastClose) { _this.deleteTabItemElement(tabItem).then(function () { _this.realignControl(false); completed(); }); } else { var step = tabItem.header.rootElement.clientWidth / _this._tabOptions.CLOSE_TAB_TIME; _this.shrinkAndRemove(tabItem).then(function () { completed(); }); } }); }; TabControl.prototype.changeTabId = function (oldId, newId) { var tabItem = this.getTabById(oldId); if(tabItem) { tabItem.id = newId; delete this._idToItemMap[oldId]; this._idToItemMap[newId] = tabItem; } }; TabControl.prototype.documentUrlChanged = function (docId, url) { var tab = this.getTabById(docId); if(tab) { tab.title = url; } }; TabControl.prototype.closeAllTabs = function () { var promises = []; if(this._items.length) { this.selectedItem = this._items[0]; } var totalTabs = this._items.length; for(var index = totalTabs - 1; index >= 0; index--) { promises.push(this.removeTab(this._items[index], true)); } return Plugin.Promise.join(promises); }; TabControl.prototype.closeAllTabsButThis = function (tabItem) { var promises = []; var tabIndex = this._items.indexOf(tabItem); if(tabIndex >= 0) { var totalTabs = this._items.length; for(var index = totalTabs - 1; index >= 0; index--) { if(index != tabIndex) { promises.push(this.removeTab(this._items[index], true)); } } } return Plugin.Promise.join(promises); }; TabControl.prototype.removeTabById = function (id, fastClose) { var tab = this.getTabById(id); this.removeTab(tab, fastClose); }; TabControl.prototype.containsTab = function (tabItem) { return this._items.indexOf(tabItem) >= 0; }; TabControl.prototype.getTabByIndex = function (index) { if(index < this._items.length) { return this._items[index]; } }; Object.defineProperty(TabControl.prototype, "length", { get: function () { return this._items.length; }, enumerable: true, configurable: true }); Object.defineProperty(TabControl.prototype, "selectedItem", { get: function () { return this._selectedItem; }, set: function (tabItem) { if(this._selectedItem !== tabItem) { if(!this.containsTab(tabItem)) { this._selectedItem = null; return; } if(this._selectedItem) { this._selectedItem.active = false; this._selectedItem.header.rootElement.setAttribute("tabindex", "-1"); } this._selectedItem = tabItem; if(this._selectedItem) { this._selectedItem.active = true; this._selectedItem.header.rootElement.setAttribute("tabindex", "1"); this._selectedItem.header.rootElement.focus(); this._barPanel.rootElement.scrollLeft = 0; } if(this._disableWrap) { this.setTabViewable(tabItem, true); } if(this._tabOptions && this._tabOptions.onSelectCallback) { this._tabOptions.onSelectCallback(tabItem.id); } } }, enumerable: true, configurable: true }); TabControl.prototype.trySelectItemById = function (id) { for(var i = 0; i < this._items.length; i++) { if(this._items[i].id === id) { this.selectedItem = this._items[i]; return true; } } return false; }; Object.defineProperty(TabControl.prototype, "tabOptions", { get: function () { return this._tabOptions; }, enumerable: true, configurable: true }); TabControl.prototype.getTabById = function (id) { var item = undefined; if(this._idToItemMap.hasOwnProperty(id)) { item = this._idToItemMap[id]; } return item; }; TabControl.prototype.insertBefore = function (tabItem, before) { if(!tabItem.equals(before)) { this._barPanel.rootElement.removeChild(tabItem.header.rootElement); this._barPanel.rootElement.insertBefore(tabItem.header.rootElement, before.header.rootElement); } }; TabControl.prototype.insertAfter = function (insert, after) { if(!insert.equals(after)) { this._barPanel.rootElement.removeChild(insert.header.rootElement); after.header.rootElement.insertAdjacentElement("afterEnd", insert.header.rootElement); } }; TabControl.prototype.selectNextTab = function () { var index = this._items.indexOf(this.selectedItem); if(index >= 0) { index += 1; this.selectedItem = index >= this._items.length ? this._items[0] : this._items[index]; } }; TabControl.prototype.selectPreviousTab = function () { var index = this._items.indexOf(this.selectedItem); if(index >= 0) { index -= 1; this.selectedItem = index < 0 ? this._items[this._items.length - 1] : this._items[index]; } }; TabControl.prototype.startScrollToPrevious = function (e) { var _this = this; (e.target).setCapture(); this.clearAllScrollIntervals(); this._scrollPreviousIntervalId = setInterval(function () { _this.moveTabsByOffset(_this._tabOptions.SCROLL_AMOUNT); }, this._tabOptions.SLIDE_TIME * 2); e.stopImmediatePropagation(); return false; }; TabControl.prototype.stopScrollToPrevious = function (e) { (e.target).releaseCapture(); this.clearAllScrollIntervals(); e.stopImmediatePropagation(); return false; }; TabControl.prototype.startScrollToNext = function (e) { var _this = this; (e.target).setCapture(); this.clearAllScrollIntervals(); this._scrollNextIntervalId = setInterval(function () { _this.moveTabsByOffset(-_this._tabOptions.SCROLL_AMOUNT); }, this._tabOptions.SLIDE_TIME * 2); e.stopImmediatePropagation(); return false; }; TabControl.prototype.stopScrollToNext = function (e) { (e.target).releaseCapture(); this.clearAllScrollIntervals(); e.stopImmediatePropagation(); return false; }; TabControl.prototype.moveTabsByOffset = function (numPixels) { var tabBar = this._barPanel.rootElement; var tabs = tabBar.children; var firstTab = tabs[0]; var lastTab = tabs[tabs.length - 1]; var leftEndOfFirstTab = firstTab.offsetLeft; var rightEndOfLastTab = lastTab.offsetLeft + lastTab.offsetWidth; var leftEndofTabBar = 0; var rightEndofTabBar = tabBar.offsetLeft + tabBar.offsetWidth; var tabsOverflowedOnLeft = leftEndOfFirstTab < leftEndofTabBar; var tabsOverflowedOnRight = rightEndOfLastTab > rightEndofTabBar; if(numPixels > 0 && tabsOverflowedOnLeft) { numPixels = Math.min(leftEndofTabBar - leftEndOfFirstTab, numPixels); } else if(numPixels < 0 && tabsOverflowedOnRight) { numPixels = Math.max(rightEndofTabBar - rightEndOfLastTab, numPixels); } if((numPixels < 0 && tabsOverflowedOnRight) || (numPixels > 0 && tabsOverflowedOnLeft)) { for(var index = 0; index < tabs.length; index++) { var tabItem = (tabs[index]); tabItem.style.transitionDuration = this._tabOptions.SLIDE_TIME / (tabs.length * 1000) + "s"; tabItem.style.left = (this.getLeftPos(tabs[index]) + numPixels) + "px"; this.endTransition(tabItem); } } }; TabControl.prototype.scrollToNextTab = function (e) { var tabBar = this._barPanel.rootElement; var posBarRight = tabBar.offsetLeft + tabBar.offsetWidth; var tabs = tabBar.children; var offset; for(var index = 0; index < tabs.length; index++) { var tab = tabs[index]; var offset = posBarRight - (tab.offsetLeft + tab.offsetWidth); if(offset < 0) { this.moveTabsToNewPosition(tabs, this.getLeftPos(tab) + offset, true); break; } } e.stopPropagation(); e.preventDefault(); return false; }; TabControl.prototype.scrollToPreviousTab = function (e) { var tabBar = this._barPanel.rootElement; var posBarLeft = tabBar.offsetLeft; var tabs = tabBar.children; var offset; for(var index = tabs.length - 1; index >= 0; index--) { var tab = tabs[index]; if(posBarLeft > tab.offsetLeft) { this.moveTabsToNewPosition(tabs, this.getLeftPos(tab) + (posBarLeft - tab.offsetLeft), true); break; } } e.stopPropagation(); e.preventDefault(); return false; }; TabControl.prototype.performOverflowCheck = function () { var tabBar = this._barPanel.rootElement; var controlWidth = 0; var tabs = tabBar.children; for(var index = 0; index < tabs.length; index++) { controlWidth += tabs[index].clientWidth; } var tabNav = document.getElementById("tabNavigation"); (controlWidth > tabBar.clientWidth) ? tabNav.classList.remove("hiddenButton") : tabNav.classList.add("hiddenButton"); }; TabControl.prototype.getLeftPos = function (element) { var leftPos = parseInt(element.style.left, 10); if(String(leftPos) === "NaN") { return 0; } return leftPos; }; TabControl.prototype.setTabViewable = function (tabItem, withAnimation) { var rootElement = tabItem.header.rootElement; if(rootElement.offsetWidth > rootElement.parentElement.offsetWidth) { return; } var posTabLeft = rootElement.offsetLeft; var posTabRight = posTabLeft + rootElement.offsetWidth; var posParentLeft = rootElement.parentElement.offsetLeft; var posParentRight = posParentLeft + rootElement.parentElement.offsetWidth; var offset; if(posTabLeft < posParentLeft) { offset = posParentLeft - posTabLeft; } else if(posTabRight > posParentRight) { offset = posParentRight - posTabRight; } if(offset !== undefined) { this.moveTabsToNewPosition(rootElement.parentElement.children, this.getLeftPos(rootElement) + offset, withAnimation); } }; TabControl.prototype.moveTabsToNewPosition = function (tabs, newPosition, withAnimation) { for(var index = 0; index < tabs.length; index++) { var tabItem = (tabs[index]); tabItem.style.transitionDuration = withAnimation ? String(this._tabOptions.SLIDE_TIME / (tabs.length * 1000)) + "s" : "0s"; tabItem.style.left = newPosition + "px"; this.endTransition(tabItem); } }; TabControl.prototype.endTransition = function (tabItem) { var onTransitionEnd = function () { tabItem.style.transitionDuration = "0s"; tabItem.removeEventListener("transitionend", onTransitionEnd); }; tabItem.addEventListener("transitionend", onTransitionEnd); }; TabControl.prototype.shrinkAndRemove = function (tabItem) { var _this = this; return new Plugin.Promise(function (completed, error) { var htmlElement = tabItem.header.rootElement; htmlElement.style.transitionDuration = String(_this._tabOptions.SLIDE_TIME / 1000) + "s"; htmlElement.style.minWidth = "0"; htmlElement.style.width = "0"; var onTransitionEnd = function () { _this.deleteTabItemElement(tabItem).then(function () { completed(); }); _this.realignControl(true); htmlElement.style.transitionDuration = "0s"; htmlElement.removeEventListener("transitionend", onTransitionEnd); }; htmlElement.addEventListener("transitionend", onTransitionEnd); }); }; TabControl.prototype.deleteTabItemElement = function (tabItem) { this._barPanel.removeChild(tabItem.header); this._contentPane.removeChild(tabItem); tabItem.ownerTabControl = null; if(this._tabOptions && this._tabOptions.onCloseCallback) { return this._tabOptions.onCloseCallback(tabItem.id); } return Plugin.Promise.wrap(null); }; TabControl.prototype.clearAllScrollIntervals = function () { clearInterval(this._scrollPreviousIntervalId); clearInterval(this._scrollNextIntervalId); }; TabControl.prototype.realignTabs = function (withAnimation) { var tabBar = this._barPanel.rootElement; var tabs = tabBar.children; if(tabs.length > 0) { var newPosition; if(tabs.length == 1) { newPosition = tabBar.offsetLeft; } else { var marginRight = (tabBar.offsetLeft + tabBar.offsetWidth) - ((tabs[tabs.length - 1]).offsetLeft + (tabs[tabs.length - 1]).offsetWidth); var marginLeft = tabBar.offsetLeft - (tabs[0]).offsetLeft; if(marginRight > 0 && marginLeft > 0) { newPosition = this.getLeftPos(tabs[0]) + Math.min(marginLeft, marginRight); } } this.moveTabsToNewPosition(tabs, newPosition, withAnimation); } }; TabControl.prototype.makeDescendantsUnselectable = function (element) { var elements = element.querySelectorAll("*"); for(var i = 0; i < elements.length; i++) { (elements[i]).setAttribute("unselectable", "on"); } }; return TabControl; })(Debugger.TemplateControl); Debugger.TabControl = TabControl; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=tabControl.js.map // tabItem.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var TabItem = (function (_super) { __extends(TabItem, _super); function TabItem(id, hasCloseButton) { var _this = this; _super.call(this); this.id = id; this.header = new Debugger.Control(document.createElement("li")); this.header.rootElement.setAttribute("id", TabItem._htmlIdPrefix + id); this.header.rootElement.setAttribute("tabindex", "-1"); this.header.rootElement.setAttribute("role", "tab"); this.header.rootElement.addEventListener("mouseup", function (e) { return _this.onMouseUp(e); }); this.header.rootElement.addEventListener("click", function (e) { return _this.onHeaderClicked(e); }); this.header.rootElement.addEventListener("keydown", function (e) { return _this.onKeyDown(e); }); this.header.rootElement.addEventListener("click", function (e) { return _this.onCloseButtonClicked(e); }); this.header.rootElement.addEventListener("focus", function (e) { return _this.onHeaderClicked(); }); this.rootElement.className = "tabItemContent"; var tabItemContent = document.createElement("div"); tabItemContent.className = "tabContent"; this.header.rootElement.appendChild(tabItemContent); var titleElement = document.createElement("div"); titleElement.className = "tabTitle"; tabItemContent.appendChild(titleElement); this.header.rootElement.draggable = true; this.header.rootElement.addEventListener("dragstart", function (ev) { if(_this._ownerTabControl) { _this._ownerTabControl.dragTarget = _this; } ev.stopImmediatePropagation(); return false; }); this.header.rootElement.addEventListener("dragend", function (ev) { if(_this._ownerTabControl) { _this._ownerTabControl.dragTarget = null; } }); this.header.rootElement.addEventListener("dragover", function (ev) { ev.preventDefault(); }); this.header.rootElement.addEventListener("dragenter", function (ev) { ev.preventDefault(); }); this.header.rootElement.addEventListener("drop", function (ev) { if(_this._ownerTabControl && _this._ownerTabControl.dragTarget) { var mid = _this.header.rootElement.offsetLeft + _this.header.rootElement.offsetWidth / 2; if(ev.pageX >= mid) { _this._ownerTabControl.insertAfter(_this._ownerTabControl.dragTarget, _this); } else { _this._ownerTabControl.insertBefore(_this._ownerTabControl.dragTarget, _this); } _this._ownerTabControl.dragTarget = null; } }); if(hasCloseButton) { var closeButton = document.createElement("div"); closeButton.className = "closeButton"; closeButton.setAttribute("role", "button"); closeButton.setAttribute("data-plugin-vs-tooltip", Plugin.Resources.getString("CloseTabTooltip")); closeButton.setAttribute("aria-label", Plugin.Resources.getString("CloseTabTooltip")); tabItemContent.appendChild(closeButton); } } TabItem._htmlIdPrefix = "TabItem:"; TabItem.getTabIdFromHtmlId = function getTabIdFromHtmlId(htmlId) { return htmlId.substr(TabItem._htmlIdPrefix.length); }; Object.defineProperty(TabItem.prototype, "ownerTabControl", { get: function () { return this._ownerTabControl; }, set: function (v) { this._ownerTabControl = v; }, enumerable: true, configurable: true }); Object.defineProperty(TabItem.prototype, "active", { get: function () { return this._active; }, set: function (v) { if(this._active !== v) { this._active = v; this.header.rootElement.classList.toggle("active"); this.rootElement.classList.toggle("active"); this.onActiveChanged(); } }, enumerable: true, configurable: true }); Object.defineProperty(TabItem.prototype, "title", { get: function () { return (this.header.rootElement.getElementsByClassName("tabTitle")[0]).innerText; }, set: function (v) { v = v ? v : ""; v = toolwindowHelpers.getTruncatedFileName(v); (this.header.rootElement.getElementsByClassName("tabTitle")[0]).innerText = v; }, enumerable: true, configurable: true }); Object.defineProperty(TabItem.prototype, "tooltipString", { get: function () { return this.header.rootElement.getAttribute("data-plugin-vs-tooltip"); }, set: function (v) { this.header.rootElement.setAttribute("data-plugin-vs-tooltip", v); this.header.rootElement.setAttribute("aria-label", v); }, enumerable: true, configurable: true }); TabItem.prototype.equals = function (tab) { return this.header.rootElement === tab.header.rootElement; }; TabItem.prototype.onActiveChanged = function () { }; TabItem.prototype.onMouseUp = function (e) { if(e.button === Common.MouseButtons.MIDDLE_BUTTON) { if(this.ownerTabControl) { this.ownerTabControl.removeTab(this); } } return true; }; TabItem.prototype.onHeaderClicked = function (e) { if(e === undefined || e.button === Common.MouseButtons.LEFT_BUTTON) { if(this.ownerTabControl) { this.ownerTabControl.selectedItem = this; } } return true; }; TabItem.prototype.onCloseButtonClicked = function (e) { var targetElement = e.target; if(e.button === Common.MouseButtons.LEFT_BUTTON && targetElement.classList.contains("closeButton") && this.ownerTabControl) { this.ownerTabControl.removeTab(this); } return true; }; TabItem.prototype.onKeyDown = function (e) { if(e.keyCode === Common.KeyCodes.ENTER || e.keyCode === Common.KeyCodes.SPACE) { this.onHeaderClicked(); } else if(!e.ctrlKey && !e.shiftKey && !e.altKey && e.keyCode === Common.KeyCodes.ARROW_LEFT) { this.ownerTabControl.selectPreviousTab(); } else if(!e.ctrlKey && !e.shiftKey && !e.altKey && e.keyCode === Common.KeyCodes.ARROW_RIGHT) { this.ownerTabControl.selectNextTab(); } return true; }; return TabItem; })(Debugger.ContentControl); Debugger.TabItem = TabItem; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=tabItem.js.map // stackFrame.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var StackFrame = (function () { function StackFrame(frameId, functionName, shortFileName, rawLocation, location) { this._frameId = frameId; this._shortFileName = shortFileName; this._functionName = functionName; this._rawLocation = rawLocation; this._location = location; this._numChildren = 0; if(!this._location) { this._location = new Debugger.SourceLocation(undefined, 1, 1, 1, 1); } } Object.defineProperty(StackFrame.prototype, "frameId", { get: function () { return this._frameId; }, enumerable: true, configurable: true }); Object.defineProperty(StackFrame.prototype, "functionName", { get: function () { return this._functionName; }, enumerable: true, configurable: true }); Object.defineProperty(StackFrame.prototype, "shortFileName", { get: function () { return this._shortFileName; }, enumerable: true, configurable: true }); Object.defineProperty(StackFrame.prototype, "callStackId", { get: function () { return this._callStackId; }, set: function (stackId) { this._callStackId = stackId; }, enumerable: true, configurable: true }); Object.defineProperty(StackFrame.prototype, "rawLocation", { get: function () { return this._rawLocation; }, enumerable: true, configurable: true }); Object.defineProperty(StackFrame.prototype, "location", { get: function () { return this._location; }, set: function (value) { this._location = value; }, enumerable: true, configurable: true }); Object.defineProperty(StackFrame.prototype, "numChildren", { get: function () { return this._numChildren; }, set: function (value) { this._numChildren = value; }, enumerable: true, configurable: true }); Object.defineProperty(StackFrame.prototype, "locationString", { get: function () { if(this._location.docId) { return this.shortFileName + "; " + this._location.lineNumber; } return ""; }, enumerable: true, configurable: true }); StackFrame.prototype.getCopyText = function () { return this._functionName + " [" + Plugin.Resources.getString("CallStackLineColumn", this._location.lineNumber, this._location.column) + "], " + this._shortFileName; }; return StackFrame; })(); Debugger.StackFrame = StackFrame; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=stackFrame.js.map // callstackGroup.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var CallstackGroup = (function (_super) { __extends(CallstackGroup, _super); function CallstackGroup(id, name, location, numChildren, isWorker) { _super.call(this, "", null, "", null, location); this._id = id; this._name = name; this._numChildren = numChildren; this._isWorker = isWorker; this._waitToBreak = false; } Object.defineProperty(CallstackGroup.prototype, "isWorker", { get: function () { return this._isWorker; }, enumerable: true, configurable: true }); Object.defineProperty(CallstackGroup.prototype, "waitToBreak", { get: function () { return this._waitToBreak; }, set: function (value) { this._waitToBreak = value; }, enumerable: true, configurable: true }); Object.defineProperty(CallstackGroup.prototype, "workerId", { get: function () { return this._id; }, enumerable: true, configurable: true }); Object.defineProperty(CallstackGroup.prototype, "numChildren", { get: function () { return this._numChildren; }, set: function (value) { this._numChildren = value; }, enumerable: true, configurable: true }); Object.defineProperty(CallstackGroup.prototype, "functionName", { get: function () { return this._name || ""; }, enumerable: true, configurable: true }); return CallstackGroup; })(Debugger.StackFrame); Debugger.CallstackGroup = CallstackGroup; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=callstackGroup.js.map // callstack.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var Callstack = (function () { function Callstack(id, name, isWorker) { this._id = id; this._name = name; this._isWorker = isWorker; this._waitToBreak = false; this._rawFrames = []; this._groupedCallstack = []; this._callstackGroup = new Debugger.CallstackGroup(this._id, this._name, null, 0, this._isWorker); } Object.defineProperty(Callstack.prototype, "id", { get: function () { return this._id; }, enumerable: true, configurable: true }); Object.defineProperty(Callstack.prototype, "name", { get: function () { return this._name; }, enumerable: true, configurable: true }); Object.defineProperty(Callstack.prototype, "isWorker", { get: function () { return this._isWorker; }, enumerable: true, configurable: true }); Object.defineProperty(Callstack.prototype, "waitToBreak", { get: function () { return this._waitToBreak; }, set: function (value) { this._waitToBreak = value; this._callstackGroup.waitToBreak = value; }, enumerable: true, configurable: true }); Object.defineProperty(Callstack.prototype, "rawFrames", { get: function () { return this._rawFrames; }, enumerable: true, configurable: true }); Object.defineProperty(Callstack.prototype, "instructionPointerFrame", { get: function () { if(this._rawFrames.length > 0) { return this._rawFrames[this._rawFrames.length - 1]; } return null; }, enumerable: true, configurable: true }); Callstack.prototype.clear = function () { this._rawFrames.splice(0, this._rawFrames.length); this._groupedCallstack.splice(0, this._groupedCallstack.length); this._callstackGroup.numChildren = 0; }; Callstack.prototype.push = function (frame) { this._rawFrames.splice(0, 0, frame); this._callstackGroup.numChildren = this._rawFrames.length; }; Callstack.prototype.pop = function () { if(this._rawFrames.length > 0) { var poppedFrame = this._rawFrames.splice(0, 1)[0]; this._callstackGroup.numChildren = this._rawFrames.length; return poppedFrame; } else { return null; } }; Callstack.prototype.getGroupedCallstack = function () { this._groupedCallstack.splice(0, this._groupedCallstack.length); for(var i = 0; i < this._rawFrames.length; i++) { this._groupedCallstack.push(this._rawFrames[i]); } this._groupedCallstack.push(this._callstackGroup); return this._groupedCallstack.reverse(); }; return Callstack; })(); Debugger.Callstack = Callstack; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=callstack.js.map // callstackController.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var CallstackController = (function () { function CallstackController(debuggerManager) { this._debuggerManager = debuggerManager; this._callstacks = []; this._listeners = []; this._callstackWindow = new Debugger.CallstackWindow(this, document.querySelector(".callstackwindow")); this.registerListener(this._callstackWindow); } Object.defineProperty(CallstackController.prototype, "callstackWindow", { get: function () { return this._callstackWindow; }, enumerable: true, configurable: true }); Object.defineProperty(CallstackController.prototype, "callstacks", { get: function () { return this._callstacks; }, enumerable: true, configurable: true }); Object.defineProperty(CallstackController.prototype, "activeFrame", { get: function () { return this._activeFrame; }, enumerable: true, configurable: true }); Object.defineProperty(CallstackController.prototype, "debuggerManager", { get: function () { return this._debuggerManager; }, enumerable: true, configurable: true }); CallstackController.prototype.getCallstack = function (id) { for(var i = 0; i < this._callstacks.length; i++) { if(this._callstacks[i].id === id) { return this._callstacks[i]; } } return null; }; CallstackController.prototype.findCallstackIndexByWorkerId = function (workerId) { for(var i = 0; i < this._callstacks.length; i++) { if(this._callstacks[i].isWorker && this._callstacks[i].id === workerId) { return i; } } return -1; }; CallstackController.prototype.removeCallstackForWorkerByWorkerId = function (workerId) { var index = this.findCallstackIndexByWorkerId(workerId); if(index >= 0) { this._callstacks.splice(index, 1); } }; CallstackController.prototype.sortCallstack = function () { this._callstacks.sort(function (a, b) { return a.id - b.id; }); }; CallstackController.prototype.clearStackFrames = function () { this._callstacks.forEach(function (callstack) { callstack.clear(); }); this._activeFrame = null; this._listeners.forEach(function (listener) { listener.activeFrameChanged(); }); this._callstackWindow.callstacksChanged(); }; CallstackController.prototype.clear = function () { for(var i = 0; i < this._callstacks.length; i++) { if(!this._callstacks[i].isWorker) { this._callstacks.splice(i, 1); break; } } this.clearStackFrames(); }; CallstackController.prototype.workerAdded = function (workerDescription) { var callstack = new Debugger.Callstack(workerDescription.id, workerDescription.displayName, true); this._callstacks.push(callstack); this.sortCallstack(); this._callstackWindow.callstacksChanged(); }; CallstackController.prototype.workerRemoved = function (id) { this.removeCallstackForWorkerByWorkerId(id); this._callstackWindow.callstacksChanged(); }; CallstackController.prototype.updateCallstackOnBreak = function (threadDescription, rawFrames) { var _this = this; var promise = Plugin.Promise.wrap(null); var callstack = this.getCallstack(threadDescription.id); this.clearStackFrames(); if(!callstack) { callstack = new Debugger.Callstack(threadDescription.id, threadDescription.displayName, threadDescription.isWorker); this._callstacks.push(callstack); this.sortCallstack(); } callstack.waitToBreak = false; for(var frameIndex = 0; frameIndex < rawFrames.length; frameIndex++) { rawFrames[frameIndex].callStackId = callstack.id; callstack.push(rawFrames[frameIndex]); } var frame = callstack.instructionPointerFrame; if(frame) { this._activeFrame = frame; this._callstackWindow.callstacksChanged(); promise = this._debuggerManager.editorWindow.navigateTo(frame.location).then(function () { _this._listeners.forEach(function (listener) { listener.activeFrameChanged(frame, true); }); }); } return promise; }; CallstackController.prototype.registerListener = function (listener) { if(this._listeners.indexOf(listener) === -1) { this._listeners.push(listener); } }; CallstackController.prototype.unregisterListener = function (listener) { var index = this._listeners.indexOf(listener); if(index >= 0) { this._listeners.splice(index, 1); } }; CallstackController.prototype.showNextStatement = function () { return this.goTo(this._activeFrame); }; CallstackController.prototype.goTo = function (frame) { Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_CallstackController_GoTo_Start); if(frame) { return this._debuggerManager.editorWindow.navigateTo(frame.location); } else { return Plugin.Promise.wrap(null); } Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_CallstackController_GoTo_Stop); }; CallstackController.prototype.activate = function (frame) { if(frame && !(frame instanceof Debugger.CallstackGroup) && this._activeFrame !== frame) { this._activeFrame = frame; var isInstructionPointer = false; for(var index = 0; index < this._callstacks.length; index++) { if(frame === this._callstacks[index].instructionPointerFrame) { isInstructionPointer = true; break; } } for(var i = 0; i < this._listeners.length; i++) { this._listeners[i].activeFrameChanged(frame, isInstructionPointer); } } }; CallstackController.prototype.documentUpdated = function (docId, doc) { var _this = this; var stackIndex; var frameIndex; for(var stackIndex = 0; stackIndex < this._callstacks.length; stackIndex++) { var stack = this._callstacks[stackIndex]; for(var frameIndex = 0; frameIndex < stack.rawFrames.length; frameIndex++) { var frame = stack.rawFrames[frameIndex]; if(frame.location.docId === docId) { var zeroBasedStart = doc ? doc.getFormattedPositionFromSourceOffset(frame.rawLocation.start) : Debugger.FormatService.Position.empty; var zeroBasedEnd = doc ? doc.getFormattedPositionFromSourceOffset(frame.rawLocation.start + frame.rawLocation.length) : Debugger.FormatService.Position.empty; frame.location = new Debugger.SourceLocation(docId, zeroBasedStart.line + 1, zeroBasedStart.column + 1, zeroBasedEnd.line + 1, zeroBasedEnd.column + 1); } } } this._callstackWindow.callstacksChanged(); this._listeners.forEach(function (listener) { if(_this._callstacks.length > 0 && _this._callstacks[0].rawFrames.length > 0) { var ipFrame = _this._callstacks[0].instructionPointerFrame; listener.activeFrameChanged(_this._callstacks[0].instructionPointerFrame, true); } if(_this._activeFrame) { listener.activeFrameChanged(_this._activeFrame, false); } }); }; CallstackController.prototype.goToFrameWithGreaterIndex = function () { if(this._activeFrame) { var callStack = this.getCallstack(this._activeFrame.callStackId); if(callStack) { var indexOfActiveFrame = callStack.rawFrames.indexOf(this._activeFrame); var targetFrame = indexOfActiveFrame + 1; if(targetFrame > callStack.rawFrames.length - 1) { targetFrame = 0; } this.goToFrame(targetFrame, callStack); } } }; CallstackController.prototype.goToFrameWithLesserIndex = function () { if(this._activeFrame) { var callStack = this.getCallstack(this._activeFrame.callStackId); if(callStack) { var indexOfActiveFrame = callStack.rawFrames.indexOf(this._activeFrame); var targetFrame = indexOfActiveFrame - 1; if(targetFrame < 0) { targetFrame = callStack.rawFrames.length - 1; } this.goToFrame(targetFrame, callStack); } } }; CallstackController.prototype.goToFrame = function (frameIndex, callStack) { this.activate(callStack.rawFrames[frameIndex]); this.goTo(callStack.rawFrames[frameIndex]); }; CallstackController.prototype.layout = function () { this._callstackWindow.layout(); }; return CallstackController; })(); Debugger.CallstackController = CallstackController; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=callstackController.js.map // callstackWindow.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var CallstackWindow = (function () { function CallstackWindow(controller, rootElement) { var _this = this; this._controller = controller; this._instructionPointFrameIndex = -1; this._activeFrameIndex = -1; this._breakOnWorkerDisabled = false; this._isBroken = false; var columnsAvailableWidth = rootElement.clientWidth - CallstackWindow.DEFAULT_ICON_COLUMN_WIDTH; var functionColumn = new Debugger.Grid.ColumnInfo("functionName", Plugin.Resources.getString("StackFramesColumn"), Plugin.Resources.getString("StackFramesColumnTooltip"), columnsAvailableWidth * CallstackWindow.DEFAULT_FUNCTION_NAME_COLUMN_PERCENT_WIDTH, false); functionColumn.getCellCSSClass = function (dataIndex, columnIndex, columnOrder, dataSource) { return _this.getCellCSSClass(dataIndex, columnIndex, columnOrder, dataSource); }; functionColumn.percentWidth = CallstackWindow.DEFAULT_FUNCTION_NAME_COLUMN_PERCENT_WIDTH; var locationColumn = new Debugger.Grid.ColumnInfo("locationString", Plugin.Resources.getString("LocationColumn"), Plugin.Resources.getString("LocationColumnTooltip"), columnsAvailableWidth * CallstackWindow.DEFAULT_LOCATION_COLUMN_PERCENT_WIDTH, false); locationColumn.getCellCSSClass = function (dataIndex, columnIndex, columnOrder, dataSource) { return _this.getCellCSSClass(dataIndex, columnIndex, columnOrder, dataSource); }; locationColumn.percentWidth = CallstackWindow.DEFAULT_LOCATION_COLUMN_PERCENT_WIDTH; var actionsColumn = new Debugger.Grid.ColumnInfo(null, Plugin.Resources.getString("ActionsColumn"), Plugin.Resources.getString("ActionsColumnTooltip"), CallstackWindow.DEFAULT_ICON_COLUMN_WIDTH, false); actionsColumn.getCellCSSClass = function (dataIndex, columnIndex, columnOrder, dataSource) { return _this.getCellCSSClass(dataIndex, columnIndex, columnOrder, dataSource); }; actionsColumn.cellDecorator = this.onCellDecorate.bind(this); actionsColumn.fixed = true; this._columnInfo = [ functionColumn, locationColumn ]; var gridElement = rootElement.querySelector(".gridcontainer"); this.createGrid(gridElement); gridElement.addEventListener("contextmenu", function (e) { _this.showContextMenu(e); }); gridElement.addEventListener("dblclick", function (e) { return _this.onMouseDoubleClick(e); }); gridElement.addEventListener("keydown", function (e) { return _this.onGridElementKeyDown(e); }); document.addEventListener("keydown", function (e) { return _this.onDocumentKeyDown(e); }); if(Plugin.F12) { Plugin.F12.addEventListener("keydown", function (e) { return _this.onDocumentKeyDown(e); }); } } CallstackWindow.DEFAULT_FUNCTION_NAME_COLUMN_PERCENT_WIDTH = 0.7; CallstackWindow.DEFAULT_LOCATION_COLUMN_PERCENT_WIDTH = 0.3; CallstackWindow.DEFAULT_ICON_COLUMN_WIDTH = 30; CallstackWindow.prototype.createButton = function (className, tooltipResourceName, clickHandler) { var buttonDiv = document.createElement("div"); var buttonIconDiv = document.createElement("div"); buttonDiv.className = className + " iconShell_18x18"; buttonIconDiv.className = "buttonIcon icon_14x14"; buttonDiv.appendChild(buttonIconDiv); Common.ButtonHelpers.setupButton(buttonDiv, tooltipResourceName, clickHandler); return buttonDiv; }; CallstackWindow.prototype.onCellDecorate = function (cell, dataItem) { var callstackGroup = dataItem; if(callstackGroup.isWorker) { var buttonDiv = this.createButton("breakOnWorker", "ActionsColumnTooltip", null); buttonDiv.setAttribute("workerId", callstackGroup.workerId.toString()); buttonDiv.setAttribute("role", "button"); Common.ButtonHelpers.changeButtonStatus(buttonDiv, !callstackGroup.waitToBreak); cell.appendChild(buttonDiv); } }; CallstackWindow.prototype.onDocumentKeyDown = function (e) { if(e.ctrlKey && !e.altKey && !e.shiftKey) { if(e.keyCode === Common.KeyCodes.COMMA) { this._controller.goToFrameWithGreaterIndex(); return false; } if(e.keyCode === Common.KeyCodes.PERIOD) { this._controller.goToFrameWithLesserIndex(); return false; } } return true; }; CallstackWindow.prototype.onGridElementKeyDown = function (e) { if(e.keyCode === Common.KeyCodes.F10 && e.shiftKey && !e.ctrlKey && !e.altKey) { this.showContextMenu(e); return false; } return true; }; CallstackWindow.prototype.onMouseDoubleClick = function (e) { if(!CallstackWindow.isBreakOnWorkerButton(e.target)) { var rowInfo = this._grid.getRowInfoFromEvent(e, ".grid-row") || this._grid.getRowInfo(this._grid.getSelectedDataIndex()); if(rowInfo) { this._controller.goTo(this._groupedCallstacksCache[rowInfo.dataIndex]); } } }; CallstackWindow.prototype.createGrid = function (rootElement) { var _this = this; this._childDataCallback = function (parentTreeItem) { return null; }; var options = new Debugger.Grid.GridOptions(this._childDataCallback, this._columnInfo, null, null); options.asyncInit = false; options.keyboardEventHandler = { keys: [ Common.Keys.ENTER ], handler: function (e, dataSource, dataIndex) { return _this.keyboardEventHandler(e, dataSource, dataIndex); } }; options.drawRowSplitters = true; this._grid = new Debugger.Grid.GridControl(rootElement, options); options.prerenderCallback = function (startIndex, endIndex) { if(_this._instructionPointFrameIndex >= 0) { _this.setGridRowIcon(_this._instructionPointFrameIndex, "instructionPointerGlyph"); } if(_this._activeFrameIndex >= 0) { _this.setGridRowIcon(_this._activeFrameIndex, "activeFrameGlyph"); } }; this._grid.getElement().addEventListener("selectionchanged", function (eventArgs) { if(_this._isBroken) { var index = (eventArgs).customData[0].selectedIndex; if(index && index >= 0) { _this._controller.activate(_this._groupedCallstacksCache[index]); } } }); this.callstacksChanged(); }; CallstackWindow.prototype.setGridRowIcon = function (rowIndex, icon) { var gridRow = this._grid.getElement().querySelector("#row_GridControl_" + rowIndex); if(gridRow) { var child = gridRow.firstElementChild; if(child) { child.classList.add(icon); } } }; CallstackWindow.prototype.keyboardEventHandler = function (e, dataSource, dataIndex) { if(e.keyCode === Common.KeyCodes.ENTER && !Common.HasAnyOfAltCtrlShiftKeyFlags(e)) { this._controller.goTo(dataSource[dataIndex]); return true; } return false; }; CallstackWindow.prototype.computeExpandStates = function (groupedCallstack) { var expandStates = []; for(var i = 0; i < groupedCallstack.length; i++) { expandStates[i] = groupedCallstack[i].numChildren; } return expandStates; }; CallstackWindow.prototype.getCellCSSClass = function (dataIndex, columnIndex, columnOrder, dataSource) { var returnClass = ""; if(this._expandStates[dataIndex]) { returnClass += " externalRow"; } return returnClass; }; CallstackWindow.prototype.createMenuItems = function () { var _this = this; var menuItems = []; var frame = this._groupedCallstacksCache[this._contextMenuSelection]; menuItems.push({ id: "menuItemSwitchToFrameCallstackWindow", callback: function (menuId, menuItem) { return _this.goToSource(menuId, menuItem); }, label: Plugin.Resources.getString("CallstackContextMenuGoToSource"), type: Plugin.ContextMenu.MenuItemType.command, disabled: function () { return !frame.location.docId; } }); menuItems.push({ id: "menuItemSep1CallstackWindow", type: Plugin.ContextMenu.MenuItemType.separator }); menuItems.push({ id: "menuItemCopyFrameCallstackWindow", callback: function (menuId, menuItem) { return _this.copyFrame(menuId, menuItem); }, label: Plugin.Resources.getString("CallStackContextMenuCopyFrame"), type: Plugin.ContextMenu.MenuItemType.command, disabled: function () { return !frame.location.docId; } }); menuItems.push({ id: "menuItemCopyStackCallstackWindow", callback: function (menuId, menuItem) { return _this.copyStack(menuId, menuItem); }, label: Plugin.Resources.getString("CallStackContextMenuCopyStack"), type: Plugin.ContextMenu.MenuItemType.command }); return menuItems; }; CallstackWindow.prototype.goToSource = function (menuId, menuItem) { this._controller.goTo(this._groupedCallstacksCache[this._contextMenuSelection]); }; CallstackWindow.prototype.copyFrame = function (menuId, menuItem) { clipboardData.setData("Text", this._groupedCallstacksCache[this._contextMenuSelection].getCopyText()); }; CallstackWindow.prototype.copyStack = function (menuId, menuItem) { var stackTrace = ""; this._groupedCallstacksCache.forEach(function (frame) { if(frame.location.docId) { stackTrace += frame.getCopyText() + "\r\n"; } }); clipboardData.setData("Text", stackTrace); }; CallstackWindow.prototype.showContextMenu = function (e) { if(this._grid) { if(this._contextMenu) { this._contextMenu.dispose(); this._contextMenu = null; } var rowInfo = this._grid.getRowInfoFromEvent(e, ".grid-row") || this._grid.getRowInfo(this._grid.getSelectedDataIndex()); if(rowInfo) { this._contextMenuSelection = rowInfo.dataIndex; this._contextMenu = Plugin.ContextMenu.create(this.createMenuItems(), "callstackMenu"); var x = 0; var y = 0; if(e instanceof MouseEvent) { x = (e).pageX; y = (e).pageY; } if(x <= 0 && y <= 0) { var offset = rowInfo.row.getBoundingClientRect(); x = offset.left; y = offset.top; } this._contextMenu.show(x, y); } } e.preventDefault(); e.stopImmediatePropagation(); }; CallstackWindow.prototype.callstacksChanged = function () { this._groupedCallstacksCache = []; for(var i = 0; i < this._controller.callstacks.length; i++) { var groupedThread = this._controller.callstacks[i].getGroupedCallstack(); for(var j = 0; j < groupedThread.length; j++) { this._groupedCallstacksCache.push(groupedThread[j]); } } this._expandStates = this.computeExpandStates(this._groupedCallstacksCache); var rowIndex = this._grid.getSelectedRowIndex(); if(this._groupedCallstacksCache.length === 0 || this._groupedCallstacksCache[0].numChildren === 0) { rowIndex = -1; } else if(rowIndex === -1 && this._groupedCallstacksCache.length > 0) { rowIndex = 0; } this._grid.setDataSource(this._groupedCallstacksCache, this._expandStates, this._columnInfo, null, rowIndex); }; CallstackWindow.prototype.activeFrameChanged = function (frame, isInstructionPointer) { if(isInstructionPointer && this._instructionPointFrameIndex >= 0) { this._instructionPointFrameIndex = -1; var cell = this._grid.getElement().querySelector(".instructionPointerGlyph"); if(cell) { cell.classList.remove("instructionPointerGlyph"); } } if(this._activeFrameIndex >= 0) { this._activeFrameIndex = -1; var cell = this._grid.getElement().querySelector(".activeFrameGlyph"); if(cell) { cell.classList.remove("activeFrameGlyph"); } } if(frame) { for(var i = 0; i < this._groupedCallstacksCache.length; i++) { if(this._groupedCallstacksCache[i].frameId === frame.frameId) { if(isInstructionPointer) { this._instructionPointFrameIndex = i; this.setGridRowIcon(this._instructionPointFrameIndex, "instructionPointerGlyph"); } else if(frame.frameId !== "") { this._activeFrameIndex = i; this.setGridRowIcon(this._activeFrameIndex, "activeFrameGlyph"); } break; } } } }; CallstackWindow.prototype.navigateTo = function () { return Plugin.Promise.wrap(null); }; CallstackWindow.prototype.layout = function () { this._grid.layoutOnResize(); }; CallstackWindow.prototype.breakStateChanged = function (isBroken, isDisabled) { this._isBroken = isBroken; }; CallstackWindow.isBreakOnWorkerButton = function isBreakOnWorkerButton(element) { return element && element.classList.contains("breakOnWorker"); }; return CallstackWindow; })(); Debugger.CallstackWindow = CallstackWindow; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=callstackWindow.js.map // breakpoint.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var Breakpoint = (function () { function Breakpoint(breakpointId, rawLocation, location, url, isBound) { this._breakpointId = breakpointId; this._isEnabled = true; this._isBound = isBound; this._condition = ""; Tools.Utility.Assert.HasValue(url); Tools.Utility.Assert.HasValue(location); this._rawLocation = rawLocation; this._url = url; this._location = location; } Breakpoint.isUnresolvedId = function isUnresolvedId(breakpointId) { return (breakpointId.indexOf(":unresolved:") >= 0); }; Object.defineProperty(Breakpoint.prototype, "breakpointId", { get: function () { return this._breakpointId; }, enumerable: true, configurable: true }); Object.defineProperty(Breakpoint.prototype, "isEnabled", { get: function () { return this._isEnabled; }, set: function (enabled) { this._isEnabled = enabled; }, enumerable: true, configurable: true }); Object.defineProperty(Breakpoint.prototype, "isBound", { get: function () { return this._isBound; }, set: function (value) { this._isBound = value; }, enumerable: true, configurable: true }); Object.defineProperty(Breakpoint.prototype, "condition", { get: function () { return this._condition; }, set: function (condition) { this._condition = condition; }, enumerable: true, configurable: true }); Object.defineProperty(Breakpoint.prototype, "isTracepoint", { get: function () { return this._isTracepoint; }, set: function (isTracepoint) { this._isTracepoint = isTracepoint; }, enumerable: true, configurable: true }); Object.defineProperty(Breakpoint.prototype, "rawLocation", { get: function () { return this._rawLocation; }, enumerable: true, configurable: true }); Object.defineProperty(Breakpoint.prototype, "location", { get: function () { return this._location; }, set: function (location) { this._location = location; }, enumerable: true, configurable: true }); Breakpoint.prototype.equals = function (breakpoint) { return this._breakpointId === breakpoint.breakpointId; }; Breakpoint.prototype.toString = function () { var breakpointString = this._url + ": (" + this._location.startLineNumber + ", " + this._location.startColumn + ")"; return breakpointString; }; Breakpoint.prototype.getGlyphClassName = function () { if(this._isTracepoint) { return "tracepointimg"; } if(this._condition) { return "conditionalimg"; } return "breakpointimg"; }; Breakpoint.prototype.resolveTo = function (breakpoint) { this._breakpointId = breakpoint.breakpointId; this.isBound = breakpoint.isBound; this._location = breakpoint.location; this._rawLocation = breakpoint.rawLocation; }; return Breakpoint; })(); Debugger.Breakpoint = Breakpoint; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=breakpoint.js.map // breakpointController.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var BreakpointController = (function () { function BreakpointController(debuggerManager, breakpointWindowElement) { this._breakpoints = []; this._listeners = []; this._debuggerManager = debuggerManager; this._window = new Debugger.BreakpointWindow(debuggerManager, this, breakpointWindowElement); this.registerListener(this._window); this.testEventObject = new Tools.CustomEventObject(); } BreakpointController.prototype.getBreakpoint = function (breakpointId) { if(breakpointId === null || breakpointId === Debugger.BreakpointIdNotFound) { return null; } for(var i = 0; i < this._breakpoints.length; i++) { if(this._breakpoints[i].breakpointId === breakpointId) { return this._breakpoints[i]; } } return null; }; BreakpointController.prototype.registerListener = function (listener) { if(this._listeners.indexOf(listener) === -1) { this._listeners.push(listener); } }; BreakpointController.prototype.unregisterListener = function (listener) { var index = this._listeners.indexOf(listener); if(index >= 0) { this._listeners.splice(index, 1); } }; BreakpointController.prototype.toggleAll = function () { this._window.toggleAll(); }; BreakpointController.prototype.deleteAll = function (forceRemove) { var promises = []; for(var i = this._breakpoints.length - 1; i >= 0; i--) { promises.push(this.deleteBreakpoint(this._breakpoints[i], forceRemove)); } return Plugin.Promise.join(promises); }; BreakpointController.prototype.setEnabledState = function (breakpoint, isEnabled) { var _this = this; Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_BreakpointController_SetEnabledState_Start); if(!breakpoint.isBound) { return Plugin.Promise.wrap(false).then(function () { Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_BreakpointController_SetEnabledState_Stop); }); } return this._debuggerManager.setBreakpointEnabledState(breakpoint.breakpointId, isEnabled).then(function (success) { if(success) { breakpoint.isEnabled = isEnabled; _this.breakpointChanged(breakpoint); } Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_BreakpointController_SetEnabledState_Stop); return success; }); }; BreakpointController.prototype.setAllEnabledStates = function (isEnabled) { var _this = this; Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_BreakpointController_SetAllEnabledStates_Start); var promises = []; this._breakpoints.forEach(function (breakpoint) { promises.push(_this.setEnabledState(breakpoint, isEnabled)); }); return Plugin.Promise.join(promises).then(function () { Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_BreakpointController_SetAllEnabledStates_Stop); }); }; BreakpointController.prototype.setBreakpointCondition = function (breakpoint, condition, isTracepoint) { var _this = this; if(!condition) { condition = ""; isTracepoint = false; } return this._debuggerManager.setBreakpointCondition(breakpoint.breakpointId, condition, isTracepoint).then(function (success) { if(success) { breakpoint.condition = condition; breakpoint.isTracepoint = isTracepoint; _this.breakpointChanged(breakpoint); } return success; }); }; BreakpointController.prototype.addBreakpoint = function (location, isTracepoint) { var _this = this; return this._debuggerManager.addBreakpoint(location).then(function (breakpoint) { if(breakpoint) { if(_this.getIndex(breakpoint) === -1) { _this._breakpoints.push(breakpoint); if(isTracepoint) { breakpoint.isTracepoint = true; _this._window.setTracepointPrompt.activate(breakpoint); } for(var i = 0; i < _this._listeners.length; i++) { _this._listeners[i].breakpointAdded(breakpoint); } } return breakpoint.breakpointId; } return null; }); }; BreakpointController.prototype.deleteBreakpoint = function (breakpoint, forceRemove) { var _this = this; if(this.getIndex(breakpoint) >= 0) { var promise = (forceRemove ? Plugin.Promise.wrap(null) : this._debuggerManager.removeBreakpoint(breakpoint.breakpointId)); return promise.then(function () { var breakpointIndex = _this.getIndex(breakpoint); if(breakpointIndex >= 0) { _this._breakpoints.splice(_this.getIndex(breakpoint), 1); for(var i = 0; i < _this._listeners.length; i++) { _this._listeners[i].breakpointRemoved(breakpoint); } } }); } }; BreakpointController.prototype.resolveBreakpointById = function (existingId, newBreakpointInfo) { if(Debugger.Breakpoint.isUnresolvedId(existingId) && !Debugger.Breakpoint.isUnresolvedId(newBreakpointInfo.breakpointId) && this.hasBreakpointWithId(newBreakpointInfo.breakpointId)) { var existingBreakpoint = this.getBreakpoint(existingId); if(existingBreakpoint) { this.deleteBreakpoint(existingBreakpoint, true); } } else { for(var i = 0; i < this._breakpoints.length; i++) { var bp = this._breakpoints[i]; if(bp.breakpointId === existingId) { bp.resolveTo(newBreakpointInfo); this.breakpointChanged(bp, existingId); break; } } } }; BreakpointController.prototype.unresolveBreakpoints = function (docId) { for(var i = 0; i < this._breakpoints.length; i++) { var breakpoint = this._breakpoints[i]; if(breakpoint.location.docId == docId) { breakpoint.isBound = false; this.breakpointChanged(breakpoint); } } }; BreakpointController.prototype.unresolveAllBreakpoints = function () { for(var i = 0; i < this._breakpoints.length; i++) { var breakpoint = this._breakpoints[i]; breakpoint.isBound = false; this.breakpointChanged(breakpoint); } }; BreakpointController.prototype.navigateToBreakpoint = function (breakpoint) { return this._debuggerManager.editorWindow.navigateTo(breakpoint.location); }; BreakpointController.prototype.getBreakpointsAtLine = function (docId, lineNumber) { var breakpoints = []; for(var i = 0; i < this._breakpoints.length; i++) { var breakpoint = this._breakpoints[i]; if(breakpoint.location.docId == docId && breakpoint.location.startLineNumber === lineNumber) { breakpoints.push(breakpoint); } } return breakpoints; }; BreakpointController.prototype.getBreakpointAtLocation = function (location) { var _this = this; return this._debuggerManager.getBreakpointIdFromSourceLocation(location).then(function (breakpointId) { if(breakpointId !== null) { var breakpoint = _this.getBreakpoint(breakpointId); return Plugin.Promise.wrap(breakpoint); } else { return Plugin.Promise.wrap(null); } }); }; BreakpointController.prototype.getBreakpoints = function (docId) { if(!docId) { return this._breakpoints; } var breakpoints = []; for(var i = 0; i < this._breakpoints.length; i++) { var breakpoint = this._breakpoints[i]; if(breakpoint.location.docId == docId) { breakpoints.push(breakpoint); } } return breakpoints; }; BreakpointController.prototype.hasBreakpointWithId = function (breakpointId) { for(var i = 0; i < this._breakpoints.length; i++) { if(this._breakpoints[i].breakpointId === breakpointId) { return true; } } return false; }; BreakpointController.prototype.addOrRemoveBreakpointsAtLocation = function (location, removeAll) { var _this = this; if(!removeAll) { this.getBreakpointAtLocation(location).done(function (breakpoint) { if(breakpoint) { _this.deleteBreakpoint(breakpoint); } else { _this.addBreakpoint(location); } return; }); } else { var existingBreakpoints = this.getBreakpointsAtLine(location.docId, location.lineNumber); var foundExisting = false; if(existingBreakpoints && existingBreakpoints.length > 0) { for(var i = 0; i < existingBreakpoints.length; i++) { var bp = existingBreakpoints[i]; if(location.startColumn === location.endColumn || (location.endColumn >= bp.location.startColumn && location.startColumn <= bp.location.endColumn)) { this.deleteBreakpoint(bp); foundExisting = true; } } } if(!foundExisting) { this.addBreakpoint(location); } } }; BreakpointController.prototype.promptToSetCondition = function (breakpoint) { this._window.promptToSetCondition(breakpoint); }; BreakpointController.prototype.documentUrlChanged = function (docId) { var breakpoints = this.getBreakpoints(docId); for(var i = 0; i < breakpoints.length; i++) { this._window.breakpointChanged(breakpoints[i]); } }; BreakpointController.prototype.breakpointChanged = function (breakpoint, previousId) { Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_BreakpointController_BreakpointChanged_Start); for(var i = 0; i < this._listeners.length; i++) { this._listeners[i].breakpointChanged(breakpoint, previousId); } this.testEventObject.fireEvent("breakpointChanged"); Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_BreakpointController_BreakpointChanged_Stop); }; BreakpointController.prototype.getIndex = function (breakpoint) { for(var i = 0; i < this._breakpoints.length; i++) { if(breakpoint.equals(this._breakpoints[i])) { return i; } } return -1; }; return BreakpointController; })(); Debugger.BreakpointController = BreakpointController; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=breakpointController.js.map // breakpointWindowRow.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var BreakpointWindowRow = (function () { function BreakpointWindowRow(breakpoint, window, controller) { var _this = this; this.breakpoint = breakpoint; this._window = window; this._controller = controller; this.rootElement = document.createElement("div"); this.checkbox = document.createElement("input"); this.icon = document.createElement("span"); this.text = document.createElement("a"); this.editButton = this.createButton("bpEditButton", this.breakpoint.isTracepoint ? "BreakpointsContextMenuAddTraceMessage" : "EditButtonTooltip", function (e) { return _this.activateEditBox(); }); this.deleteButton = this.createButton("bpDeleteButton", "DeleteButtonTooltip", function (e) { return _this._window.deleteBreakpoint(_this.breakpoint); }); var linkContainer = document.createElement("span"); var controlsContainer = document.createElement("span"); this.rootElement.className = "bpRow"; this.checkbox.className = "bpCheckbox"; this.icon.className = "bpIcon"; this.text.className = "bpLink"; this.checkbox.type = "checkbox"; this.icon.textContent = " "; linkContainer.className = "bpText"; controlsContainer.className = "bpItemControls"; this.rootElement.appendChild(this.checkbox); this.rootElement.appendChild(this.icon); linkContainer.appendChild(this.text); this.rootElement.appendChild(linkContainer); controlsContainer.appendChild(this.editButton); controlsContainer.appendChild(this.deleteButton); this.rootElement.appendChild(controlsContainer); this.rootElement.tabIndex = -1; this.checkbox.tabIndex = -1; this.rootElement.addEventListener("contextmenu", function (e) { return _this.onContextMenu(e); }); this.checkbox.addEventListener("click", function (e) { return _this._controller.setEnabledState(_this.breakpoint, !_this.breakpoint.isEnabled); }); this.text.addEventListener("click", function (e) { return _this.linkClicked(e); }); this.rootElement.addEventListener("click", function (e) { _this.select(); }); this.rootElement.addEventListener("keydown", function (e) { return _this.onKeyDown(e); }); } BreakpointWindowRow.prototype.activateEditBox = function () { this._window.promptToSetCondition(this.breakpoint); return false; }; BreakpointWindowRow.prototype.refresh = function () { this.checkbox.checked = this.breakpoint.isEnabled; this.checkbox.disabled = !this.breakpoint.isBound; this.icon.className = this.breakpoint.getGlyphClassName() + (this.breakpoint.isBound ? "" : " bpUnbound") + (this.breakpoint.isEnabled ? "" : " bpDisabled") + " bpIcon"; this.text.textContent = this.breakpoint.toString(); this.editButton.setAttribute("data-plugin-vs-tooltip", Plugin.Resources.getString(this.breakpoint.isTracepoint ? "BreakpointsContextMenuAddTraceMessage" : "EditButtonTooltip")); var ariaLabel = Plugin.Resources.getString("BreakpointLabel"); if(this.breakpoint.isTracepoint) { ariaLabel += ", " + Plugin.Resources.getString("TracepointLabel"); } else if(this.breakpoint.condition) { ariaLabel += ", " + Plugin.Resources.getString("ConditionalBreakpointLabel"); } if(!this.breakpoint.isEnabled) { ariaLabel += ", " + Plugin.Resources.getString("BreakpointsContextMenuDisable"); } ariaLabel += ", " + this.breakpoint.toString(); this.rootElement.setAttribute("aria-label", ariaLabel); }; BreakpointWindowRow.prototype.select = function () { var _this = this; if(!this.isSelected()) { setTimeout(function () { _this._window.unselectAll(); _this.rootElement.classList.add("selected"); _this.rootElement.tabIndex = 1; _this.rootElement.focus(); _this._window.selectedBreakpointRow = _this; }); } }; BreakpointWindowRow.prototype.isSelected = function () { return this.rootElement.classList.contains("selected"); }; BreakpointWindowRow.prototype.unselect = function () { this.rootElement.classList.remove("selected"); this.rootElement.tabIndex = -1; }; BreakpointWindowRow.prototype.createButton = function (className, tooltipResourceName, clickHandler) { var buttonDiv = document.createElement("div"); var buttonIconDiv = document.createElement("div"); buttonDiv.className = className + " iconShell_18x18"; buttonIconDiv.className = "buttonIcon icon_14x14"; buttonDiv.appendChild(buttonIconDiv); Common.ButtonHelpers.setupButton(buttonDiv, tooltipResourceName, clickHandler); return buttonDiv; }; BreakpointWindowRow.prototype.linkClicked = function (e) { if(e.button === 0) { this._controller.navigateToBreakpoint(this.breakpoint); return false; } return true; }; BreakpointWindowRow.prototype.onContextMenu = function (e) { if(this.rootElement === e.target || this.rootElement === (e.target).parentElement || this.rootElement === (e.target).parentElement.parentElement) { var x = 0; var y = 0; if(e instanceof MouseEvent) { x = (e).pageX; y = (e).pageY; } if(x <= 0 && y <= 0) { var offset = (e.target).getBoundingClientRect(); x = offset.left; y = offset.top; } this._window.showContextMenu(x, y, this.breakpoint, this.rootElement); } e.preventDefault(); e.stopImmediatePropagation(); }; BreakpointWindowRow.prototype.onKeyDown = function (e) { if(e.keyCode === Common.KeyCodes.F10 && e.shiftKey && !e.ctrlKey && !e.altKey) { this.onContextMenu(e); } }; return BreakpointWindowRow; })(); Debugger.BreakpointWindowRow = BreakpointWindowRow; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=breakpointWindowRow.js.map // breakpointWindow.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var BreakpointWindow = (function () { function BreakpointWindow(debuggerManager, controller, rootElement) { var _this = this; this._deleteAllBreakpointsButton = rootElement.querySelector("#deleteAllBreakpointsButton"); this._toggleAllBreakpointsButton = rootElement.querySelector("#toggleAllBreakpointsButton"); Common.ButtonHelpers.setupButton(this._deleteAllBreakpointsButton, "BreakpointsDeleteAllButton", function (e) { return _this._controller.deleteAll(); }, false); Common.ButtonHelpers.setupButton(this._toggleAllBreakpointsButton, "BreakpointsEnableAllToggleButtonTooltip", function (e) { return _this.toggleAll(); }, false); this._breakpointGrid = rootElement.querySelector(".breakpointgrid"); this._rootElement = rootElement; this._rows = []; this._controller = controller; document.body.addEventListener("click", function (e) { if(_this._menuTargetRow) { _this._menuTargetRow.classList.remove("contextTarget"); _this._menuTargetRow = null; } }); this._rootElement.addEventListener("keydown", function (e) { return _this.onKeyDown(e); }); this._setConditionPrompt = new Debugger.SetConditionPrompt(debuggerManager, document.getElementById("root"), function (value, breakpoint) { return _this._controller.setBreakpointCondition(breakpoint, value, false); }, function (breakpoint) { }, false); this._setTracepointPrompt = new Debugger.SetConditionPrompt(debuggerManager, document.getElementById("root"), function (value, breakpoint) { return _this._controller.setBreakpointCondition(breakpoint, value, true); }, function (breakpoint) { if(breakpoint.condition === "") { _this._controller.deleteBreakpoint(breakpoint); } }, true); } Object.defineProperty(BreakpointWindow.prototype, "selectedBreakpointRow", { set: function (breakpointRow) { this._selectedBreakpointRow = breakpointRow; }, enumerable: true, configurable: true }); BreakpointWindow.prototype.areAnyBreakpointsDisabled = function () { var breakpoints = this._controller.getBreakpoints(); for(var id in breakpoints) { if(!breakpoints[id].isEnabled) { return true; } } return false; }; BreakpointWindow.prototype.createMenuItems = function (breakpoint) { var _this = this; var menuItems = []; menuItems.push({ id: "menuItemGoToBreakpointWindow", callback: function (menuId, menuItem) { return _this.onGoToBreakpoint(menuId, menuItem); }, label: Plugin.Resources.getString("BreakpointsContextMenuGoTo"), type: Plugin.ContextMenu.MenuItemType.command, disabled: function () { return !breakpoint.isBound; } }); menuItems.push({ id: "menuItemSep1BreakpointWindow", type: Plugin.ContextMenu.MenuItemType.separator }); if(breakpoint.isTracepoint) { menuItems.push({ id: "menuItemAddTraceBreakpointWindow", callback: function (menuId, menuItem) { return _this.onEditBreakpoint(menuId, menuItem); }, label: Plugin.Resources.getString("BreakpointsContextMenuAddTraceMessage"), type: Plugin.ContextMenu.MenuItemType.command, accessKey: Plugin.Resources.getString("AccessKeyAltF9") }); } else { menuItems.push({ id: "menuItemAddConditionBreakpointWindow", callback: function (menuId, menuItem) { return _this.onEditBreakpoint(menuId, menuItem); }, label: Plugin.Resources.getString("BreakpointsContextMenuAddCondition"), type: Plugin.ContextMenu.MenuItemType.command, accessKey: Plugin.Resources.getString("AccessKeyAltF9") }); } menuItems.push({ id: "menuItemCopyBreakpointWindow", callback: function (menuId, menuItem) { return _this.onCopyBreakpoint(menuId, menuItem); }, label: Plugin.Resources.getString("BreakpointsContextMenuCopy"), type: Plugin.ContextMenu.MenuItemType.command }); menuItems.push({ id: "menuItemDeleteBreakpointWindow", callback: function (menuId, menuItem) { return _this.onDeleteBreakpoint(menuId, menuItem); }, label: Plugin.Resources.getString("BreakpointsContextMenuDelete"), type: Plugin.ContextMenu.MenuItemType.command, accessKey: Plugin.Resources.getString("AccessKeyF9") }); menuItems.push({ id: "menuItemDeleteAllBreakpointWindow", callback: function (menuId, menuItem) { return _this.onDeleteAllBreakpoints(menuId, menuItem); }, label: Plugin.Resources.getString("BreakpointsConextMenuDeleteAll"), type: Plugin.ContextMenu.MenuItemType.command }); menuItems.push({ id: "menuItemSep2BreakpointWindow", type: Plugin.ContextMenu.MenuItemType.separator }); menuItems.push({ id: "menuItemEnableBreakpointWindow", callback: function (menuId, menuItem) { return _this.onEnableBreakpoint(menuId, menuItem); }, label: Plugin.Resources.getString("BreakpointsContextMenuEnable"), type: Plugin.ContextMenu.MenuItemType.command, disabled: function () { return (breakpoint.isEnabled || !breakpoint.isBound); }, accessKey: Plugin.Resources.getString("AccessKeyCtrlF9") }); menuItems.push({ id: "menuItemDisableBreakpointWindow", callback: function (menuId, menuItem) { return _this.onDisableBreakpoint(menuId, menuItem); }, label: Plugin.Resources.getString("BreakpointsContextMenuDisable"), type: Plugin.ContextMenu.MenuItemType.command, disabled: function () { return (!breakpoint.isEnabled || !breakpoint.isBound); }, accessKey: Plugin.Resources.getString("AccessKeyCtrlF9") }); menuItems.push({ id: "menuItemEnableAllBreakpointWindow", callback: function (menuId, menuItem) { return _this.onEnableAllBreakpoints(menuId, menuItem); }, label: Plugin.Resources.getString("BreakpointsContextMenuEnableAll"), type: Plugin.ContextMenu.MenuItemType.command }); menuItems.push({ id: "menuItemDisableAllBreakpointWindow", callback: function (menuId, menuItem) { return _this.onDisableAllBreakpoints(menuId, menuItem); }, label: Plugin.Resources.getString("BreakpointsContextMenuDisableAll"), type: Plugin.ContextMenu.MenuItemType.command }); return menuItems; }; BreakpointWindow.prototype.onGoToBreakpoint = function (menuId, menuItem) { this._controller.navigateToBreakpoint(this._menuBreakpoint); }; BreakpointWindow.prototype.onCopyBreakpoint = function (menuId, menuItem) { window.clipboardData.setData("Text", this._menuBreakpoint.toString()); }; BreakpointWindow.prototype.onEditBreakpoint = function (menuId, menuItem) { this.getRowFromBreakpoint(this._menuBreakpoint).activateEditBox(); }; BreakpointWindow.prototype.onDeleteBreakpoint = function (menuId, menuItem) { this.deleteBreakpoint(this._menuBreakpoint); }; BreakpointWindow.prototype.onDeleteAllBreakpoints = function (menuId, menuItem) { this._controller.deleteAll(); }; BreakpointWindow.prototype.onEnableBreakpoint = function (menuId, menuItem) { this._controller.setEnabledState(this._menuBreakpoint, true); }; BreakpointWindow.prototype.onDisableBreakpoint = function (menuId, menuItem) { this._controller.setEnabledState(this._menuBreakpoint, false); }; BreakpointWindow.prototype.onEnableAllBreakpoints = function (menuId, menuItem) { this._controller.setAllEnabledStates(true); }; BreakpointWindow.prototype.onDisableAllBreakpoints = function (menuId, menuItem) { this._controller.setAllEnabledStates(false); }; BreakpointWindow.prototype.onKeyDown = function (e) { if(this._selectedBreakpointRow) { if(e.keyCode === Common.KeyCodes.SPACE || e.keyCode === Common.KeyCodes.ENTER) { this._controller.navigateToBreakpoint(this._selectedBreakpointRow.breakpoint); } else if(e.keyCode === Common.KeyCodes.DELETE) { this.deleteBreakpoint(this._selectedBreakpointRow.breakpoint); } else if(e.keyCode === Common.KeyCodes.ARROW_DOWN) { this.selectNextBreakpoint(this._selectedBreakpointRow); } else if(e.keyCode === Common.KeyCodes.ARROW_UP) { this.selectPreviousBreakpoint(this._selectedBreakpointRow); } else if(e.keyCode === Common.KeyCodes.F9) { if(e.ctrlKey && !e.altKey && !e.shiftKey) { this._controller.setEnabledState(this._selectedBreakpointRow.breakpoint, !this._selectedBreakpointRow.breakpoint.isEnabled); } else if(!e.ctrlKey && e.altKey && !e.shiftKey) { this._controller.promptToSetCondition(this._selectedBreakpointRow.breakpoint); } else if(!e.ctrlKey && !e.altKey && !e.shiftKey) { this.deleteBreakpoint(this._selectedBreakpointRow.breakpoint); } } } }; BreakpointWindow.prototype.showContextMenu = function (x, y, breakpoint, targetRow) { if(this._menuTargetRow) { this._menuTargetRow.classList.remove("contextTarget"); this._menuTargetRow = null; } this._menuBreakpoint = breakpoint; this._menuTargetRow = targetRow; this._menuTargetRow.classList.add("contextTarget"); if(this._contextMenu) { this._contextMenu.dispose(); this._contextMenu = null; } this._contextMenu = Plugin.ContextMenu.create(this.createMenuItems(breakpoint), "breakpointMenu"); this._contextMenu.show(x, y); }; Object.defineProperty(BreakpointWindow.prototype, "setConditionPrompt", { get: function () { return this._setConditionPrompt; }, enumerable: true, configurable: true }); Object.defineProperty(BreakpointWindow.prototype, "setTracepointPrompt", { get: function () { return this._setTracepointPrompt; }, enumerable: true, configurable: true }); BreakpointWindow.prototype.promptToSetCondition = function (breakpoint) { var _this = this; setTimeout(function () { if(breakpoint.isTracepoint) { _this.setTracepointPrompt.activate(breakpoint); } else { _this.setConditionPrompt.activate(breakpoint); } }); }; BreakpointWindow.prototype.breakpointAdded = function (breakpoint) { var row = new Debugger.BreakpointWindowRow(breakpoint, this, this._controller); this._rows.push(row); this._breakpointGrid.appendChild(row.rootElement); this.breakpointChanged(breakpoint); if(this._rows.length === 1) { row.rootElement.tabIndex = 1; this.selectedBreakpointRow = row; } if(!Common.ButtonHelpers.isEnabled(this._deleteAllBreakpointsButton)) { Common.ButtonHelpers.changeButtonStatus(this._deleteAllBreakpointsButton, true); Common.ButtonHelpers.changeButtonStatus(this._toggleAllBreakpointsButton, true); } }; BreakpointWindow.prototype.breakpointRemoved = function (breakpoint) { var row = this.getRowFromBreakpoint(breakpoint); if(row) { this._breakpointGrid.removeChild(row.rootElement); this._rows.splice(this._rows.indexOf(row), 1); } if(this._rows.length === 0) { Common.ButtonHelpers.changeButtonStatus(this._deleteAllBreakpointsButton, false); Common.ButtonHelpers.changeButtonStatus(this._toggleAllBreakpointsButton, false); } }; BreakpointWindow.prototype.breakpointChanged = function (breakpoint) { Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_BreakpointWindow_BreakpointChanged_Start); var row = this.getRowFromBreakpoint(breakpoint); if(row) { row.refresh(); } Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_BreakpointWindow_BreakpointChanged_Stop); }; BreakpointWindow.prototype.selectNextBreakpoint = function (breakpointRowCurrent) { var index = this._rows.indexOf(breakpointRowCurrent); if(index < this._rows.length - 1) { this._rows[index + 1].select(); } }; BreakpointWindow.prototype.selectPreviousBreakpoint = function (breakpointRowCurrent) { var index = this._rows.indexOf(breakpointRowCurrent); if(index > 0) { this._rows[index - 1].select(); } }; BreakpointWindow.prototype.unselectAll = function () { for(var index = 0; index < this._rows.length; index++) { this._rows[index].unselect(); } }; BreakpointWindow.prototype.deleteBreakpoint = function (breakpoint) { if(this._rows.length > 1) { var breakpointRow = this.getRowFromBreakpoint(breakpoint); if(breakpointRow) { if(this._rows.indexOf(breakpointRow) !== this._rows.length - 1) { this.selectNextBreakpoint(breakpointRow); } else { this.selectPreviousBreakpoint(breakpointRow); } } } this._controller.deleteBreakpoint(breakpoint); }; BreakpointWindow.prototype.toggleAll = function () { if(!this.areAnyBreakpointsDisabled()) { this._controller.setAllEnabledStates(false); } else { this._controller.setAllEnabledStates(true); } }; BreakpointWindow.prototype.getRowFromBreakpoint = function (breakpoint) { for(var i = 0; i < this._rows.length; i++) { if(this._rows[i].breakpoint.equals(breakpoint)) { return this._rows[i]; } } return null; }; return BreakpointWindow; })(); Debugger.BreakpointWindow = BreakpointWindow; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=breakpointWindow.js.map // lightDismissPopup.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var LightDismissPopup = (function () { function LightDismissPopup(container, cancelCallback) { var _this = this; this._container = container; this._container.style.display = "none"; this._container.classList.add("lightDismissPromptContainer"); this._subContainer = document.createElement("div"); this._subContainer.className = "popupInnerContainer"; this._container.appendChild(this._subContainer); this._cancelCallback = cancelCallback ? cancelCallback : function () { }; this._focusOutListener = function (e) { if(e.target === document.activeElement) { _this.hideControl(); } }; this._documentClickListener = function (e) { if(e.target !== _this._container && !_this._container.contains(e.target)) { _this.hideControl(); } }; this._documentKeydownListener = function (e) { if(e.keyCode === Common.KeyCodes.ESCAPE) { _this._cancelCallback(); _this.hideControl(); e.stopImmediatePropagation(); e.preventDefault(); return false; } }; } Object.defineProperty(LightDismissPopup.prototype, "container", { get: function () { return this._subContainer; }, enumerable: true, configurable: true }); LightDismissPopup.prototype.showControl = function () { var _this = this; if(!this._isVisible) { this._container.style.display = "block"; this._isVisible = true; setTimeout(function () { document.addEventListener("focusout", _this._focusOutListener); document.addEventListener("click", _this._documentClickListener); document.addEventListener("keydown", _this._documentKeydownListener); }); } }; LightDismissPopup.prototype.hideControl = function () { var _this = this; if(this._isVisible) { setTimeout(function () { _this._container.style.display = "none"; _this._isVisible = false; document.removeEventListener("focusout", _this._focusOutListener); document.removeEventListener("click", _this._documentClickListener); document.removeEventListener("keydown", _this._documentKeydownListener); }); } }; return LightDismissPopup; })(); Debugger.LightDismissPopup = LightDismissPopup; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=lightDismissPopup.js.map // setConditionPrompt.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var SetConditionPrompt = (function (_super) { __extends(SetConditionPrompt, _super); function SetConditionPrompt(debuggerManager, parent, dataEnteredCallback, _canceledCallback, isTracepoint) { var _this = this; var container = document.createElement("div"); this._container = container; this._debuggerManager = debuggerManager; container.className = "lightDismissPromptContainer " + (isTracepoint ? "setTracepointContainer" : "setConditionContainer"); parent.insertBefore(container, parent.firstElementChild); this._dataEnteredCallback = dataEnteredCallback; this._canceledCallback = _canceledCallback; _super.call(this, container, this.cancel); var title = document.createElement("div"); title.textContent = Plugin.Resources.getString(isTracepoint ? "TracepointMessageTitle" : "ConditionalBreakpointTitle"); var instructions = document.createElement("div"); instructions.textContent = Plugin.Resources.getString(isTracepoint ? "TracepointInstructions" : "ConditionalBreakpointInstructions"); var inputContainer = document.createElement("div"); inputContainer.className = "popupInputContainer"; var buttonContainer = document.createElement("div"); buttonContainer.className = "popupButtonContainer"; var label = document.createElement("div"); label.textContent = Plugin.Resources.getString(isTracepoint ? "TracepointLabel" : "ConditionalBreakpointLabel"); this._inputBox = document.createElement("input"); this._inputBox.className = "promptInputBox"; this._inputBox.addEventListener("keypress", function (e) { return _this.onKeyPress(e); }); var okButton = document.createElement("button"); okButton.addEventListener("click", function (e) { return _this.submit(); }); okButton.innerText = Plugin.Resources.getString("OkButtonLabel"); okButton.className = "okButton"; var cancelButton = document.createElement("button"); cancelButton.addEventListener("click", function (e) { return _this.cancel(); }); cancelButton.addEventListener("blur", function (e) { return _this._inputBox.focus(); }); cancelButton.innerText = Plugin.Resources.getString("CancelButtonLabel"); cancelButton.className = "cancelButton"; cancelButton.type = "button"; this.container.appendChild(title); this.container.appendChild(instructions); inputContainer.appendChild(label); inputContainer.appendChild(this._inputBox); this.container.appendChild(inputContainer); buttonContainer.appendChild(okButton); buttonContainer.appendChild(cancelButton); this.container.appendChild(buttonContainer); } SetConditionPrompt.prototype.activate = function (breakpoint) { var _this = this; this._breakpoint = breakpoint; this._inputBox.value = breakpoint.condition; this._container.style.top = ""; this.showControl(); var consoleTop = this._debuggerManager.debuggerShell.getConsoleTop(); var dialogRect = this._container.getBoundingClientRect(); var dialogHeight = dialogRect.height + 6; var containerTop = dialogRect.top + dialogHeight; if(consoleTop < containerTop) { this._container.style.top = consoleTop - dialogHeight + "px"; } setTimeout(function () { _this._inputBox.focus(); _this._inputBox.setSelectionRange(0, _this._inputBox.value.length); }); }; SetConditionPrompt.prototype.submit = function () { this.hideControl(); this._dataEnteredCallback(this._inputBox.value, this._breakpoint); }; SetConditionPrompt.prototype.cancel = function () { this.hideControl(); this._canceledCallback(this._breakpoint); }; SetConditionPrompt.prototype.onKeyPress = function (e) { if(e.keyCode === Common.KeyCodes.ENTER) { this.submit(); e.stopPropagation(); e.preventDefault(); return false; } return true; }; return SetConditionPrompt; })(Debugger.LightDismissPopup); Debugger.SetConditionPrompt = SetConditionPrompt; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=setConditionPrompt.js.map // sourceLocation.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var SourceLocation = (function () { function SourceLocation(docId, oneBasedStartLine, oneBasedStartColumn, oneBasedEndLine, oneBasedEndColumn) { Tools.Utility.Assert.IsTrue(oneBasedStartLine > 0 && oneBasedStartColumn > 0); this._docId = docId; this._oneBasedStartLineNumber = oneBasedStartLine; this._oneBasedStartColumn = oneBasedStartColumn; this._oneBasedEndLineNumber = oneBasedEndLine; this._oneBasedEndColumn = oneBasedEndColumn; if(typeof this._oneBasedEndLineNumber === "undefined") { this._oneBasedEndLineNumber = this._oneBasedStartLineNumber; } if(typeof this._oneBasedEndColumn === "undefined") { this._oneBasedEndColumn = this._oneBasedStartColumn; } } Object.defineProperty(SourceLocation.prototype, "docId", { get: function () { return this._docId; }, enumerable: true, configurable: true }); Object.defineProperty(SourceLocation.prototype, "lineNumber", { get: function () { return this._oneBasedStartLineNumber; }, enumerable: true, configurable: true }); Object.defineProperty(SourceLocation.prototype, "column", { get: function () { return this._oneBasedStartColumn; }, enumerable: true, configurable: true }); Object.defineProperty(SourceLocation.prototype, "startLineNumber", { get: function () { return this._oneBasedStartLineNumber; }, enumerable: true, configurable: true }); Object.defineProperty(SourceLocation.prototype, "startColumn", { get: function () { return this._oneBasedStartColumn; }, enumerable: true, configurable: true }); Object.defineProperty(SourceLocation.prototype, "endLineNumber", { get: function () { return this._oneBasedEndLineNumber; }, enumerable: true, configurable: true }); Object.defineProperty(SourceLocation.prototype, "endColumn", { get: function () { return this._oneBasedEndColumn; }, enumerable: true, configurable: true }); SourceLocation.prototype.equals = function (location) { return this._docId === location._docId && this._oneBasedStartLineNumber === location._oneBasedStartLineNumber && this._oneBasedEndLineNumber === location._oneBasedEndLineNumber && this._oneBasedStartColumn === location._oneBasedStartColumn && this._oneBasedEndColumn === location._oneBasedEndColumn; }; SourceLocation.prototype.toFormatServiceIPosition = function () { return { line: this._oneBasedStartLineNumber - 1, column: this._oneBasedStartColumn - 1, file: 0 }; }; SourceLocation.prototype.toIRange = function () { return { startLineNumber: this._oneBasedStartLineNumber, startColumn: this._oneBasedStartColumn, endLineNumber: this._oneBasedStartLineNumber, endColumn: this._oneBasedStartColumn }; }; return SourceLocation; })(); Debugger.SourceLocation = SourceLocation; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=sourceLocation.js.map // executionController.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var ExecutionController = (function () { function ExecutionController(debuggerManager) { this._debuggerManager = debuggerManager; this._listeners = []; this._executionPaused = false; this._isDebuggingDisabled = (Plugin.F12 && Plugin.F12.Profiler.getIsProfiling()); this._breakOnAnyNewWorkerStartingEnabled = false; } ExecutionController.EXCEPTION_FILTER_REG_KEY = "DebuggerExceptionFilter"; ExecutionController.prototype.initialize = function () { var _this = this; if(Plugin.F12) { Plugin.F12.addEventListener("profilingstarted", function (e) { _this.onProfilingStateChange(true); }); Plugin.F12.addEventListener("profilingstopped", function (e) { _this.onProfilingStateChange(false); }); } this.onProfilingStateChange(this._isDebuggingDisabled); this.reinitialize(); }; ExecutionController.prototype.reinitialize = function () { var filterValue = Plugin.F12.getRegEntryForF12(ExecutionController.EXCEPTION_FILTER_REG_KEY); var filterId = parseInt(filterValue, 10); this._exceptionFilter = null; if(!isNaN(filterId)) { this.setExceptionFilter(filterId); } else { this.setExceptionFilter(Debugger.ExceptionFilter.Unhandled); } }; Object.defineProperty(ExecutionController.prototype, "debuggerManager", { get: function () { return this._debuggerManager; }, enumerable: true, configurable: true }); Object.defineProperty(ExecutionController.prototype, "isExecutionPaused", { get: function () { return this._executionPaused; }, set: function (v) { var _this = this; if(v !== this._executionPaused) { var promise = Plugin.Promise.as(null); if(v) { promise = this.removeAnyPseudoBreakpoint(); } promise.done(function () { _this._executionPaused = v; for(var i = 0; i < _this._listeners.length; i++) { _this._listeners[i].breakStateChanged(_this._executionPaused, _this._isDebuggingDisabled); } }); } }, enumerable: true, configurable: true }); Object.defineProperty(ExecutionController.prototype, "isDebuggingDisabled", { get: function () { return this._isDebuggingDisabled; }, set: function (v) { if(v != this._isDebuggingDisabled) { this._isDebuggingDisabled = v; for(var i = 0; i < this._listeners.length; i++) { this._listeners[i].breakStateChanged(this._executionPaused, this._isDebuggingDisabled); } } }, enumerable: true, configurable: true }); Object.defineProperty(ExecutionController.prototype, "exceptionFilter", { get: function () { return this._exceptionFilter; }, enumerable: true, configurable: true }); ExecutionController.prototype.setExceptionFilter = function (v) { var _this = this; var promise = Plugin.Promise.wrap(null); if(v !== this._exceptionFilter) { promise = this._debuggerManager.setExceptionFilter(v).then(function (success) { if(success) { _this._exceptionFilter = v; _this._debuggerManager.debuggerToolbar.exceptionFilterChanged(_this._exceptionFilter); Plugin.F12.setRegEntryForF12(ExecutionController.EXCEPTION_FILTER_REG_KEY, "" + v); } }); } return promise; }; ExecutionController.prototype.registerListener = function (listener) { this._listeners.push(listener); }; ExecutionController.prototype.continueExecution = function () { var _this = this; if(this._debuggerManager.isBreakCompleted) { this._debuggerManager.resume(Debugger.BreakResumeAction.Continue).done(function (success) { _this._debuggerManager.testEventObject.fireEvent("debuggerRunning"); if(success) { _this.isExecutionPaused = false; } }); } }; ExecutionController.prototype.breakAny = function () { var _this = this; if(!this._debuggerManager.isBreakCompleted && !this.isDebuggingDisabled) { this._debuggerManager.causeBreak(Debugger.CauseBreakAction.BreakOnAny).done(function () { _this._debuggerManager.debuggerToolbar.deactivateBreakButton(); }); } }; Object.defineProperty(ExecutionController.prototype, "breakOnAnyNewWorkerStartingEnabled", { get: function () { return this._breakOnAnyNewWorkerStartingEnabled; }, set: function (value) { if(this._breakOnAnyNewWorkerStartingEnabled !== value) { this._breakOnAnyNewWorkerStartingEnabled = value; this._debuggerManager.causeBreak(this._breakOnAnyNewWorkerStartingEnabled ? Debugger.CauseBreakAction.BreakOnAnyNewWorkerStarting : Debugger.CauseBreakAction.UnsetBreakOnAnyNewWorkerStarting).done(); } }, enumerable: true, configurable: true }); ExecutionController.prototype.stepInto = function () { var _this = this; Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_StepInto_Start); if(this._debuggerManager.isBreakCompleted) { this._debuggerManager.resume(Debugger.BreakResumeAction.StepInto).done(function (success) { if(success) { _this.isExecutionPaused = false; } }); } }; ExecutionController.prototype.stepOut = function () { var _this = this; Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_StepOut_Start); if(this._debuggerManager.isBreakCompleted) { this._debuggerManager.resume(Debugger.BreakResumeAction.StepOut).done(function (success) { if(success) { _this.isExecutionPaused = false; } }); } }; ExecutionController.prototype.stepOver = function () { var _this = this; Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_StepOver_Start); if(this._debuggerManager.isBreakCompleted) { this._debuggerManager.resume(Debugger.BreakResumeAction.StepOver).done(function (success) { if(success) { _this.isExecutionPaused = false; } }); } }; ExecutionController.prototype.canSetNextStatement = function (location) { if(this.isDebuggingDisabled || !this._debuggerManager.editorWindow.isRuntimeDocument(location.docId) || !this._debuggerManager.isBreakCompleted) { return Plugin.Promise.wrap(false); } return this._debuggerManager.canSetNextStatement(location); }; ExecutionController.prototype.setNextStatement = function (location) { var _this = this; if(this.isDebuggingDisabled || !this._debuggerManager.editorWindow.isRuntimeDocument(location.docId)) { return Plugin.Promise.wrap(false); } return new Plugin.Promise(function (completed, error) { _this._debuggerManager.setNextStatement(location).done(function (success) { if(!success) { _this._debuggerManager.editorWindow.addSetNextStatementErrorViewZone(location); } completed(success); }); }); }; ExecutionController.prototype.runToCursor = function (docId, location) { var _this = this; if(this.isDebuggingDisabled || !this._debuggerManager.editorWindow.isRuntimeDocument(docId)) { return; } this.removeAnyPseudoBreakpoint().done(function () { var sourceLocation = new Debugger.SourceLocation(docId, location.lineNumber, location.column); _this._debuggerManager.addBreakpoint(sourceLocation, true).done(function (breakpoint) { if(breakpoint) { _this._pseudoBreakpoint = breakpoint; } _this.continueExecution(); }); }); }; ExecutionController.prototype.removeAnyPseudoBreakpoint = function (docId) { var removed = Plugin.Promise.wrap(null); if(this._pseudoBreakpoint && (!docId || docId === this._pseudoBreakpoint.location.docId)) { if(!this._debuggerManager.breakpointController.hasBreakpointWithId(this._pseudoBreakpoint.breakpointId)) { if(this._debuggerManager.isAttached) { removed = this._debuggerManager.removeBreakpoint(this._pseudoBreakpoint.breakpointId); } } this._pseudoBreakpoint = null; } return removed; }; ExecutionController.prototype.onProfilingStateChange = function (isProfiling) { var _this = this; var promise = Plugin.Promise.wrap(!isProfiling); if(Plugin.F12) { if(isProfiling) { this.continueExecution(); this._debuggerManager.breakpointController.unresolveAllBreakpoints(); var consoleAnchor = document.getElementById("hEditorConsoleSplitter"); Plugin.F12.ErrorDisplay.show(Plugin.Resources.getString("ProfilingRunningMessage"), 0, "http://go.microsoft.com/fwlink/?LinkId=290645", consoleAnchor); } else { Plugin.F12.ErrorDisplay.close(); if(this._debuggerManager.isAttached) { promise = this._debuggerManager.enableDynamicDebugging(); } } } promise.done(function (result) { _this.isDebuggingDisabled = (result !== Debugger.ConnectionResult.Succeeded); }); }; return ExecutionController; })(); Debugger.ExecutionController = ExecutionController; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=executionController.js.map // debuggerToolbar.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var DebuggerToolbar = (function () { function DebuggerToolbar(controller) { var _this = this; this._controller = controller; this._continueButton = document.getElementById("continueButton"); this._breakButton = document.getElementById("breakButton"); this._breakWorkerButton = document.getElementById("breakWorkerButton"); this._stepIntoButton = document.getElementById("stepIntoButton"); this._stepOverButton = document.getElementById("stepOverButton"); this._stepOutButton = document.getElementById("stepOutButton"); this._breakOnExceptionButton = document.getElementById("breakOnExceptionsButton"); this._prettyPrintButton = document.getElementById("prettyPrintButton"); this._wordWrapButton = document.getElementById("wordWrapButton"); Common.ButtonHelpers.setupButton(this._continueButton, "ContinueButtonTooltip", this.onButtonClicked.bind(this, "continueButton")); Common.ButtonHelpers.setupButton(this._breakButton, "BreakButtonTooltip", this.onButtonClicked.bind(this, "breakButton")); Common.ButtonHelpers.setupButton(this._breakWorkerButton, "BreakWorkerButtonTooltip", this.onButtonClicked.bind(this, "breakWorkerButton")); Common.ButtonHelpers.setupButton(this._stepIntoButton, "StepIntoButtonTooltip", this.onButtonClicked.bind(this, "stepIntoButton")); Common.ButtonHelpers.setupButton(this._stepOverButton, "StepOverButtonTooltip", this.onButtonClicked.bind(this, "stepOverButton")); Common.ButtonHelpers.setupButton(this._stepOutButton, "StepOutButtonTooltip", this.onButtonClicked.bind(this, "stepOutButton")); Common.ButtonHelpers.setupButton(this._breakOnExceptionButton, "BreakOnExceptionButtonTooltip", this.onButtonClicked.bind(this, "breakOnExceptionButton")); Common.ButtonHelpers.setupButton(this._prettyPrintButton, "PrettyPrintButtonTooltip", this.onButtonClicked.bind(this, "prettyPrintButton")); Common.ButtonHelpers.setupButton(this._wordWrapButton, "WordWrapOffButtonTooltip", this.onButtonClicked.bind(this, "wordWrapButton")); this._breakOnExceptionButton.addEventListener("keydown", function (e) { if(e.keyCode === Common.KeyCodes.ENTER || e.keyCode === Common.KeyCodes.SPACE || (e.keyCode === Common.KeyCodes.ARROW_DOWN && e.ctrlKey)) { _this.activateExceptionDropdown(); return false; } return true; }); this._breakOnExceptionButton.addEventListener("click", function (e) { _this.activateExceptionDropdown(); }); this.updatePrettyPrintButton(); this.updateWordWrapButton(); this.updateBreakWorkerButton(); this.breakStateChanged(this._controller.isExecutionPaused, this._controller.isDebuggingDisabled); document.addEventListener("keydown", function (e) { return _this.onKeyDown(e); }); if(Plugin.F12) { Plugin.F12.addEventListener("browsershortcut", function (e) { return _this.onBrowserShortcut(e); }); Plugin.F12.addEventListener("keydown", function (e) { if(_this.onBrowserShortcut(e)) { _this.onKeyDown(e); } }); } } DebuggerToolbar.prototype.updateWordWrapButton = function () { var enabled = Debugger.Tristate.Off; if(this._controller.debuggerManager.editorWindow) { enabled = this._controller.debuggerManager.editorWindow.getWordWrapEnabled(); } var tooltip; switch(enabled) { case Debugger.Tristate.On: Common.ButtonHelpers.changeButtonStatus(this._wordWrapButton, true, true); tooltip = Plugin.Resources.getString("WordWrapOffButtonTooltip"); (this._wordWrapButton).classList.add("toggledOn"); break; case Debugger.Tristate.Off: Common.ButtonHelpers.changeButtonStatus(this._wordWrapButton, true, false); tooltip = Plugin.Resources.getString("WordWrapOnButtonTooltip"); (this._wordWrapButton).classList.remove("toggledOn"); break; case Debugger.Tristate.Disabled: Common.ButtonHelpers.changeButtonStatus(this._wordWrapButton, false, false); tooltip = Plugin.Resources.getString("WordWrapButtonOffTooltip"); (this._wordWrapButton).classList.remove("toggledOn"); break; default: return; } this._wordWrapButton.setAttribute("data-plugin-vs-tooltip", tooltip); this._wordWrapButton.setAttribute("aria-label", tooltip); }; DebuggerToolbar.prototype.documentActivated = function () { this.updatePrettyPrintButton(); }; DebuggerToolbar.prototype.breakStateChanged = function (isBroken, isDisabled) { Common.ButtonHelpers.changeButtonStatus(this._continueButton, isBroken && !isDisabled); Common.ButtonHelpers.changeButtonStatus(this._breakButton, !isBroken && !isDisabled); Common.ButtonHelpers.changeButtonStatus(this._stepIntoButton, isBroken && !isDisabled); Common.ButtonHelpers.changeButtonStatus(this._stepOutButton, isBroken && !isDisabled); Common.ButtonHelpers.changeButtonStatus(this._stepOverButton, isBroken && !isDisabled); Common.ButtonHelpers.changeButtonStatus(this._breakOnExceptionButton, !isDisabled); Common.ButtonHelpers.changeButtonStatus(this._breakWorkerButton, !isDisabled); }; DebuggerToolbar.prototype.activateExceptionDropdown = function () { if(Common.ButtonHelpers.isEnabled(this._breakOnExceptionButton)) { if(this._contextMenu) { this._contextMenu.dispose(); this._contextMenu = null; } this._contextMenu = Plugin.ContextMenu.create(this.createExceptionDropdownMenuItems(), "exceptionDropdownMenu"); var offset = this._breakOnExceptionButton.getBoundingClientRect(); var x = offset.left; var y = offset.bottom; this._contextMenu.show(x, y); } }; DebuggerToolbar.prototype.exceptionFilterChanged = function (filter) { switch(filter) { case Debugger.ExceptionFilter.Handled: this._breakOnExceptionButton.classList.add("breakAll"); this._breakOnExceptionButton.classList.remove("breakNone"); this._breakOnExceptionButton.classList.remove("breakUnhandled"); break; case Debugger.ExceptionFilter.None: this._breakOnExceptionButton.classList.remove("breakAll"); this._breakOnExceptionButton.classList.add("breakNone"); this._breakOnExceptionButton.classList.remove("breakUnhandled"); break; case Debugger.ExceptionFilter.Unhandled: this._breakOnExceptionButton.classList.remove("breakAll"); this._breakOnExceptionButton.classList.remove("breakNone"); this._breakOnExceptionButton.classList.add("breakUnhandled"); break; } }; DebuggerToolbar.prototype.togglePrettyPrint = function () { var _this = this; Common.ButtonHelpers.changeButtonStatus(this._prettyPrintButton, false, false); this._controller.debuggerManager.togglePrettyPrintEnabledForActiveDocument().done(function () { _this.updatePrettyPrintButton(); }); }; DebuggerToolbar.prototype.deactivateBreakButton = function () { Common.ButtonHelpers.changeButtonStatus(this._breakButton, false); }; DebuggerToolbar.prototype.createExceptionDropdownMenuItems = function () { var _this = this; var menuItems = []; menuItems.push({ id: "menuItemBreakOnExceptionButtonNoneExceptionDropdown", callback: function (menuId, menuItem) { return _this._controller.setExceptionFilter(Debugger.ExceptionFilter.None); }, label: Plugin.Resources.getString("BreakOnExceptionButtonNone"), type: Plugin.ContextMenu.MenuItemType.checkbox, checked: function () { return (_this._controller.exceptionFilter === Debugger.ExceptionFilter.None); } }); menuItems.push({ id: "menuItemBreakOnExceptionButtonUnhandledExceptionDropdown", callback: function (menuId, menuItem) { return _this._controller.setExceptionFilter(Debugger.ExceptionFilter.Unhandled); }, label: Plugin.Resources.getString("BreakOnExceptionButtonUnhandled"), type: Plugin.ContextMenu.MenuItemType.checkbox, checked: function () { return (_this._controller.exceptionFilter === Debugger.ExceptionFilter.Unhandled); } }); menuItems.push({ id: "menuItemBreakOnExceptionButtonAllExceptionDropdown", callback: function (menuId, menuItem) { return _this._controller.setExceptionFilter(Debugger.ExceptionFilter.Handled); }, label: Plugin.Resources.getString("BreakOnExceptionButtonAll"), type: Plugin.ContextMenu.MenuItemType.checkbox, checked: function () { return (_this._controller.exceptionFilter === Debugger.ExceptionFilter.Handled); } }); return menuItems; }; DebuggerToolbar.prototype.onButtonClicked = function (buttonName, e) { var button = e.target; if(!Common.ButtonHelpers.isEnabled(button)) { return; } switch(buttonName) { case "continueButton": this._controller.continueExecution(); break; case "breakButton": this._controller.breakAny(); break; case "breakWorkerButton": this.toggleBreakOnAnyNewWorkerStarting(); break; case "stepIntoButton": this._controller.stepInto(); break; case "stepOverButton": this._controller.stepOver(); break; case "stepOutButton": this._controller.stepOut(); break; case "prettyPrintButton": this.togglePrettyPrint(); break; case "wordWrapButton": this.toggleWordWrap(); break; case "breakOnExceptionButton": this.activateExceptionDropdown(); break; } }; DebuggerToolbar.prototype.onKeyDown = function (e) { var handled = false; if(!Common.HasAnyOfAltCtrlShiftKeyFlags(e)) { if(e.keyCode === Common.KeyCodes.F5 || e.keyCode === Common.KeyCodes.F8) { this._controller.continueExecution(); handled = true; } else if(e.keyCode === Common.KeyCodes.F10) { this._controller.stepOver(); handled = true; } else if(e.keyCode === Common.KeyCodes.F11) { this._controller.stepInto(); handled = true; } } else if(e.keyCode === Common.KeyCodes.F11 && e.shiftKey && !e.ctrlKey && !e.altKey) { this._controller.stepOut(); handled = true; } else if(e.keyCode === Common.KeyCodes.E && e.ctrlKey && e.shiftKey && !e.altKey) { this.activateExceptionDropdown(); handled = true; } else if(e.keyCode === Common.KeyCodes.B && e.ctrlKey && e.shiftKey && !e.altKey) { this._controller.breakAny(); handled = true; } else if(e.keyCode === Common.KeyCodes.W && e.ctrlKey && e.shiftKey && !e.altKey) { this.toggleBreakOnAnyNewWorkerStarting(); handled = true; } else if(e.keyCode === Common.KeyCodes.W && e.altKey && !e.ctrlKey && !e.shiftKey) { this.toggleWordWrap(); handled = true; } if(handled) { e.preventDefault(); e.stopImmediatePropagation(); return false; } return true; }; DebuggerToolbar.prototype.onBrowserShortcut = function (e) { if(e.ctrlKey && e.shiftKey && !e.altKey && e.keyCode === Common.KeyCodes.P) { if(Common.ButtonHelpers.isEnabled(this._prettyPrintButton)) { this.togglePrettyPrint(); return false; } } return true; }; DebuggerToolbar.prototype.updatePrettyPrintButton = function () { switch(this._controller.debuggerManager.prettyPrintEnabledForActiveDocument) { case Debugger.Tristate.On: Common.ButtonHelpers.changeButtonStatus(this._prettyPrintButton, true, true); this._prettyPrintButton.setAttribute("data-plugin-vs-tooltip", Plugin.Resources.getString("PrettyPrintButtonOn")); this._prettyPrintButton.setAttribute("aria-label", Plugin.Resources.getString("PrettyPrintButtonOn")); (this._prettyPrintButton).classList.add("toggledOn"); break; case Debugger.Tristate.Off: Common.ButtonHelpers.changeButtonStatus(this._prettyPrintButton, true, false); this._prettyPrintButton.setAttribute("data-plugin-vs-tooltip", Plugin.Resources.getString("PrettyPrintButtonOff")); this._prettyPrintButton.setAttribute("aria-label", Plugin.Resources.getString("PrettyPrintButtonOff")); (this._prettyPrintButton).classList.remove("toggledOn"); break; case Debugger.Tristate.Disabled: Common.ButtonHelpers.changeButtonStatus(this._prettyPrintButton, false, false); this._prettyPrintButton.setAttribute("data-plugin-vs-tooltip", Plugin.Resources.getString("PrettyPrintButtonTooltip")); this._prettyPrintButton.setAttribute("aria-label", Plugin.Resources.getString("PrettyPrintButtonTooltip")); break; default: Tools.Utility.Assert.Fail("undefined state"); break; } }; DebuggerToolbar.prototype.toggleWordWrap = function () { var editorWindow = this._controller.debuggerManager.editorWindow; editorWindow.setWordWrapEnabled(!(editorWindow.getWordWrapEnabled() === Debugger.Tristate.On)); this.updateWordWrapButton(); }; DebuggerToolbar.prototype.updateBreakWorkerButton = function () { this._controller.breakOnAnyNewWorkerStartingEnabled ? this._breakWorkerButton.classList.add("toggledOn") : this._breakWorkerButton.classList.remove("toggledOn"); Common.ButtonHelpers.changeButtonStatus(this._breakWorkerButton, true, this._controller.breakOnAnyNewWorkerStartingEnabled); }; DebuggerToolbar.prototype.toggleBreakOnAnyNewWorkerStarting = function () { this._controller.breakOnAnyNewWorkerStartingEnabled = !this._controller.breakOnAnyNewWorkerStartingEnabled; this.updateBreakWorkerButton(); }; return DebuggerToolbar; })(); Debugger.DebuggerToolbar = DebuggerToolbar; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=debuggerToolbar.js.map // watchController.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var WatchWindowController = (function () { function WatchWindowController(debuggerManager, container, isDataTip, expandCountChangedCallback) { this._debuggerManager = debuggerManager; this.isDataTip = isDataTip; this._watchStore = new Debugger.WatchStore(this); this._view = new Debugger.WatchWindowView(this, container, expandCountChangedCallback); if(!this.isDataTip) { this.disableWatchesWindow(); } this.testEventObject = new Tools.CustomEventObject(); } WatchWindowController.MINIMAL_PROPERTIES_COUNT = 100; WatchWindowController.prototype.getWatches = function () { if(this._watchStore) { return this._watchStore.getWatches(); } return []; }; WatchWindowController.prototype.getExpandStates = function () { if(this._watchStore) { return this._watchStore.getExpandStates(); } return []; }; WatchWindowController.prototype.refreshView = function (focus, scrollToBottom) { this._view.refreshView(focus, scrollToBottom); }; WatchWindowController.prototype.layout = function () { this._view.layout(); }; WatchWindowController.prototype.addWatch = function (newValue) { var watch = this._watchStore.addWatch(newValue); return this.evaluateWatch(watch, true); }; WatchWindowController.prototype.addWatchByCurrentEditorPosition = function () { var position = this._debuggerManager.editorWindow.getEditorPosition(); var text = ""; var selection = this._debuggerManager.editorWindow.getEditorSelection(); if(selection && !selection.isEmpty() && selection.containsPosition(position)) { text = this._debuggerManager.editorWindow.getEditorRangeContents(selection).trim(); } else { var expressionInfo = this._debuggerManager.editorWindow.dataTips.parseExpression(position); text = expressionInfo.text; text = text.trim(); } if(text) { this._debuggerManager.executionController.debuggerManager.watchController.addWatch(text); return text; } else { this._debuggerManager.watchController.promptToAddWatch(); return null; } }; WatchWindowController.prototype.editWatch = function (newValue, dataIndex) { var _this = this; var watch = this._watchStore.editWatch(newValue, dataIndex); this.evaluateWatch(watch).then(function () { if(_this.isDataTip) { var watchItems = _this._debuggerManager.watchController.getWatches(); var index = -1; for(var i = 0; i < watchItems.length; i++) { if(watchItems[i].fullName === watch.fullName) { index = i; break; } } if(index > 0) { _this._debuggerManager.watchController.refreshWatch(index); } } }); }; WatchWindowController.prototype.refreshWatch = function (index) { var value = this.getWatches()[index].watchName; this.editWatch(value, index); }; WatchWindowController.prototype.deleteWatch = function (index) { this._watchStore.deleteWatch(index); if(this._debuggerManager) { this._debuggerManager.testEventObject.fireEvent("deleteWatchCompleted"); } }; WatchWindowController.prototype.onValueEdit = function (dataIndex, newValue) { var _this = this; var watch = this._watchStore.getWatches()[dataIndex]; if(watch) { if(this._debuggerManager.executionController.isExecutionPaused) { if(watch.displayValue !== newValue) { var activeFrame = this._debuggerManager.callstackController.activeFrame; if(activeFrame) { if(watch.fullName.indexOf(Debugger.WatchStore.EXCEPTION_WATCHITEM_PREFIX) === 0) { this._watchStore.storeExceptionWatchState(); this._watchStore.storeWatchStates(); } watch.reset(); this._debuggerManager.setPropertyValueAsString(watch.uid, newValue).then(function () { _this.evaluateWatch(watch); }); } } } } }; WatchWindowController.prototype.refreshAll = function (focus) { if(this._debuggerManager.executionController.isExecutionPaused) { var activeFrame = this._debuggerManager.callstackController.activeFrame; if(activeFrame) { this._watchStore.reset(); this.updateWatches(activeFrame.frameId, focus); } } }; WatchWindowController.prototype.deleteAll = function () { this._watchStore.deleteAll(); }; WatchWindowController.prototype.activeFrameChanged = function (frame, isInstructionPointer) { if(frame !== this._displayedFrame) { this._displayedFrame = frame; if(frame) { this._displayedFrame = frame; this.updateWatches(frame.frameId, false); } } }; WatchWindowController.prototype.navigateTo = function (location) { return Plugin.Promise.wrap(null); }; WatchWindowController.prototype.getChildPropertiesCount = function (watch) { return this._debuggerManager.getChildPropertiesCount(watch.uid).then(function (totalCount) { watch.propertiesCount = totalCount; return Plugin.Promise.wrap(totalCount); }); }; WatchWindowController.prototype.getChildProperties = function (parentWatch, range) { var _this = this; var startIndex, endIndex; switch(range) { case Debugger.WatchPropertiesRange.Minimal: startIndex = 0; endIndex = WatchWindowController.MINIMAL_PROPERTIES_COUNT; break; case Debugger.WatchPropertiesRange.Remaining: startIndex = WatchWindowController.MINIMAL_PROPERTIES_COUNT; endIndex = 0; break; case Debugger.WatchPropertiesRange.All: startIndex = 0; endIndex = 0; break; } var childProperties = []; return this.getChildPropertiesCount(parentWatch).then(function (propertiesCount) { if(range === Debugger.WatchPropertiesRange.Minimal && propertiesCount > WatchWindowController.MINIMAL_PROPERTIES_COUNT) { parentWatch.hasAdditionalChildren = true; } else { parentWatch.hasAdditionalChildren = false; } return _this._debuggerManager.getChildProperties(parentWatch.uid, startIndex, endIndex).then(function (propInfos) { var exceptionWatchPromise; for(var index = 0; index < propInfos.length; index++) { var watchItem = new Debugger.WatchItem(propInfos[index].propertyId, propInfos[index].name, _this._watchStore); if(_this._watchStore.updateWatchWithPropInfo(watchItem, propInfos[index])) { watchItem.parentWatch = parentWatch; watchItem.rootIndex = parentWatch.rootIndex; if(parentWatch === _this._watchStore.localsExpando && _this._watchStore.isExceptionWatchItem(watchItem)) { _this._watchStore.insertWatchItemAtIndex(watchItem, Debugger.WatchStore.EXCEPTION_WATCHITEM_INDEX); exceptionWatchPromise = _this._watchStore.restoreWatch(watchItem); } else { childProperties = childProperties.concat(watchItem); } } } var watchRestores = childProperties.map(function (childProperty) { return _this._watchStore.restoreWatch(childProperty); }); if(exceptionWatchPromise) { watchRestores.push(exceptionWatchPromise); } return Plugin.Promise.join(watchRestores).then(function () { _this._debuggerManager.testEventObject.fireEvent("getChildPropertiesCompleted"); return Plugin.Promise.wrap(childProperties); }); }); }); }; WatchWindowController.prototype.enableWatchesWindow = function () { this._watchStore.isWatchesEvaluationEnabled = true; }; WatchWindowController.prototype.disableWatchesWindow = function () { this._watchStore.isWatchesEvaluationEnabled = false; this._watchStore.reset(); this.refreshView(); }; WatchWindowController.prototype.getActualHeight = function () { return this._view.getObjectsCount() * Debugger.WatchWindowView.GRID_LINE_HEIGHT; }; WatchWindowController.prototype.evaluateWatchesInRange = function (startIndex, endIndex, focus) { var _this = this; if(this._debuggerManager.executionController.isExecutionPaused && this._debuggerManager.callstackController.activeFrame) { var watches = this._watchStore.getWatches(); watches = watches.slice(startIndex, endIndex + 2); if(this._watchStore.thisWatch) { watches.push(this._watchStore.thisWatch); } var watches = watches.filter(function (watch) { return !watch.local && watch.containsExpression && watch.evalStatus === Debugger.WatchEvalStatus.Stale; }); if(watches.length > 0) { var watchEvals = watches.map(function (watch) { watch.evalStatus = Debugger.WatchEvalStatus.EvalSent; return _this._debuggerManager.eval(_this._debuggerManager.callstackController.activeFrame.frameId, watch.watchName).then(function (propInfo) { if(_this._watchStore.updateWatchWithPropInfo(watch, propInfo)) { return _this._watchStore.restoreWatch(watch); } return Plugin.Promise.wrap(0); }); }); Plugin.Promise.join(watchEvals).done(function () { _this.refreshView(focus); }); } } }; WatchWindowController.prototype.hasUserWatches = function () { return this._watchStore.hasUserWatches(); }; WatchWindowController.prototype.promptToAddWatch = function () { this._view.promptToAddWatch(); }; WatchWindowController.prototype.getLocals = function () { if(this._debuggerManager && this._debuggerManager.executionController.isExecutionPaused) { var activeFrame = this._debuggerManager.callstackController.activeFrame; if(activeFrame) { this._watchStore.deleteAnyExceptionWatch(); return this._debuggerManager.getLocals(activeFrame.frameId); } } return Plugin.Promise.wrap(null); }; WatchWindowController.prototype.updateWatches = function (frameIndex, focus) { var _this = this; this._watchStore.markAllWatchesStale(); this.getLocals().done(function (propertyId) { if(propertyId) { window.setImmediate(function () { var range = _this._view.getViewPortRanges(); _this.evaluateWatchesInRange(range.start, range.end, focus); _this._watchStore.localsExpando.uid = propertyId; _this._watchStore.localsExpando.evalStatus = Debugger.WatchEvalStatus.EvalReceived; _this._watchStore.restoreWatch(_this._watchStore.localsExpando, true).then(function () { _this.refreshView(focus); }); }); } }); }; WatchWindowController.prototype.evaluateWatch = function (watch, scrollToBottom) { var _this = this; if(this._debuggerManager && this._debuggerManager.executionController.isExecutionPaused) { var activeFrame = this._debuggerManager.callstackController.activeFrame; if(activeFrame) { var expression = this.getEvaluationExpression(watch); if(expression.indexOf(Debugger.WatchStore.EXCEPTION_WATCHITEM_PREFIX) === 0 && watch.rootIndex === Debugger.WatchStore.EXCEPTION_WATCHITEM_INDEX) { return this.getLocals().then(function (propertyId) { if(propertyId) { _this._watchStore.localsExpando.uid = propertyId; _this._watchStore.localsExpando.evalStatus = Debugger.WatchEvalStatus.EvalReceived; return _this._watchStore.restoreWatch(_this._watchStore.localsExpando, true).then(function () { _this._view.refreshView(true, scrollToBottom); return Plugin.Promise.wrap(true); }); } }); } else { return this._debuggerManager.eval(activeFrame.frameId, expression).then(function (propInfo) { if(_this._watchStore.updateWatchWithPropInfo(watch, propInfo)) { return _this._watchStore.restoreWatch(watch).then(function () { _this._view.refreshView(true, scrollToBottom); _this._debuggerManager.testEventObject.fireEvent("evaluateWatchCompleted"); if(propInfo.type === "Error" && propInfo.value.indexOf("is undefined") === -1) { return Plugin.Promise.wrap(false); } return Plugin.Promise.wrap(true); }); } return Plugin.Promise.wrap(false); }); } } } return Plugin.Promise.wrap(true); }; WatchWindowController.prototype.getEvaluationExpression = function (watch) { var expression = watch.watchName; watch = watch.parentWatch; while(watch) { if(!watch.fake) { if(expression.length > 0 && expression.charAt(0) === "[") { expression = watch.watchName + expression; } else { expression = watch.watchName + "." + expression; } } watch = watch.parentWatch; } return expression; }; return WatchWindowController; })(); Debugger.WatchWindowController = WatchWindowController; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=watchController.js.map // watchWindowView.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var WatchWindowView = (function () { function WatchWindowView(controller, container, expandCountChangedCallback) { var _this = this; this._controller = controller; var nameColumnString = Plugin.Resources.getString("WatchWindowNameColumn"); var valueColumnString = Plugin.Resources.getString("WatchWindowValueColumn"); var iconColumnString = Plugin.Resources.getString("WatchWindowIconColumn"); var columnsAvailableWidth = container.clientWidth - WatchWindowView.DEFAULT_ICON_COLUMN_FIXED_WIDTH; var nameColumnSize = this._controller.isDataTip ? WatchWindowView.DEFAULT_COLUMN_SIZE : columnsAvailableWidth * WatchWindowView.DEFAULT_COLUMN_PERCENT_WIDTH; var nameColumn = new Debugger.Grid.ColumnInfo("watchName", nameColumnString, nameColumnString, nameColumnSize, false); nameColumn.getCellCSSClass = function (dataIndex, columnIndex, columnOrder, dataSource) { return _this.getCellCSSClass(dataIndex, columnIndex, columnOrder, dataSource); }; nameColumn.getGlyphClass = function (dataIndex, columnIndex, columnOrder, dataSource) { return _this.getCellGlyphClass(dataIndex, columnIndex, columnOrder, dataSource); }; nameColumn.hasMixedContent = true; nameColumn.hasGlyph = true; nameColumn.indent = true; var valueColumnSize = this._controller.isDataTip ? WatchWindowView.EXPANDED_COLUMN_SIZE : columnsAvailableWidth * WatchWindowView.DEFAULT_COLUMN_PERCENT_WIDTH; var valueColumn = new Debugger.Grid.ColumnInfo("watchValue", valueColumnString, valueColumnString, valueColumnSize, false); valueColumn.getColumnValue = function (dataIndex, columnIndex, columnOrder, dataSource) { return _this.getColumnValue(dataIndex, columnIndex, columnOrder, dataSource); }; valueColumn.getCellCSSClass = function (dataIndex, columnIndex, columnOrder, dataSource) { return _this.getCellCSSClass(dataIndex, columnIndex, columnOrder, dataSource); }; var iconColumn = new Debugger.Grid.ColumnInfo("watchIcon", iconColumnString, iconColumnString, WatchWindowView.DEFAULT_ICON_COLUMN_FIXED_WIDTH, false); iconColumn.getCellCSSClass = function (dataIndex, columnIndex, columnOrder, dataSource) { return _this.getCellCSSClass(dataIndex, columnIndex, columnOrder, dataSource); }; iconColumn.hasHTMLContent = true; if(this._controller.isDataTip) { this._columnInfo = [ nameColumn, valueColumn ]; } else { nameColumn.percentWidth = WatchWindowView.DEFAULT_COLUMN_PERCENT_WIDTH; valueColumn.percentWidth = WatchWindowView.DEFAULT_COLUMN_PERCENT_WIDTH; iconColumn.fixed = true; this._columnInfo = [ nameColumn, valueColumn, iconColumn ]; } this._container = container; this.createGrid(this._container, expandCountChangedCallback); this._container.addEventListener("click", function (e) { return _this.buttonsCallback(_this._controller.isDataTip, e); }); if(!this._controller.isDataTip) { this._deleteAllWatchesButton = document.getElementById("deleteAllWatchesButton"); this._addWatchButton = document.getElementById("addWatchButton"); Common.ButtonHelpers.setupButton(this._deleteAllWatchesButton, "WatchesDeleteAllTooltip", function (e) { _this._controller.deleteAll(); }, false); Common.ButtonHelpers.setupButton(this._addWatchButton, "WatchesAddWatchTooltip", function (e) { return _this.promptToAddWatch(); }); this._container.addEventListener("contextmenu", function (e) { _this.showContextMenu(e); }); } this.refreshView(); } WatchWindowView.DEFAULT_COLUMN_PERCENT_WIDTH = 0.50; WatchWindowView.DEFAULT_ICON_COLUMN_FIXED_WIDTH = 20; WatchWindowView.DEFAULT_COLUMN_SIZE = 140; WatchWindowView.EXPANDED_COLUMN_SIZE = 240; WatchWindowView.NAME_COLUMN = 0; WatchWindowView.VALUE_COLUMN = 1; WatchWindowView.GRID_LINE_HEIGHT = 20; WatchWindowView.TWO_COLUMN_WIDTH = WatchWindowView.DEFAULT_COLUMN_SIZE + WatchWindowView.EXPANDED_COLUMN_SIZE; WatchWindowView.prototype.refreshView = function (focus, scrollToBottom) { if(Debugger.DebuggerTraceWriter) { Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_WatchWindowView_RefreshView_Start); } if(!this._controller.isDataTip && Common.ButtonHelpers.isEnabled(this._deleteAllWatchesButton) && !this._controller.hasUserWatches()) { Common.ButtonHelpers.changeButtonStatus(this._deleteAllWatchesButton, false); } else if(!this._controller.isDataTip && !Common.ButtonHelpers.isEnabled(this._deleteAllWatchesButton) && this._controller.hasUserWatches()) { Common.ButtonHelpers.changeButtonStatus(this._deleteAllWatchesButton, true); } var rowIndex = this._grid.getSelectedRowIndex(); var watchItems = this._controller.getWatches(); if((rowIndex === -1 && watchItems.length > 0) || rowIndex >= watchItems.length) { rowIndex = 0; } this._grid.setDataSource(watchItems, this._controller.getExpandStates(), this._columnInfo, null, rowIndex, focus, scrollToBottom); if(Debugger.DebuggerTraceWriter) { Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_WatchWindowView_RefreshView_Stop); } }; WatchWindowView.prototype.layout = function () { this._grid.layoutOnResize(); }; WatchWindowView.prototype.getExpandStates = function () { return this._grid.getExpandStates(); }; WatchWindowView.prototype.getObjectsCount = function () { return this._grid.getExpandedCount(); }; WatchWindowView.prototype.getViewPortRanges = function () { return this._grid.getViewPortRanges(); }; WatchWindowView.prototype.promptToAddWatch = function () { var _this = this; this._grid.scrollToBottom(function () { return _this.createAddWatchTextBox(); }); this.selectDataIndex(this._grid.getDataSource().length - 1); }; WatchWindowView.prototype.selectDataIndex = function (dataIndex) { this._grid.setSelectedDataIndex(dataIndex); }; WatchWindowView.prototype.scrollToBottom = function (callback) { this._grid.scrollToBottom(function () { return callback(); }); }; WatchWindowView.prototype.createAddWatchTextBox = function () { var addWatchRowInfo = this._grid.getRowInfo(this._grid.getDataSource().length - 1); if(addWatchRowInfo) { var nameCell = (addWatchRowInfo.row.children[WatchWindowView.NAME_COLUMN]); this._grid.createEditBox(addWatchRowInfo.dataIndex, WatchWindowView.NAME_COLUMN, nameCell); } }; WatchWindowView.prototype.buttonsCallback = function (isDataTip, e) { var targetElement = e.target; if(e.button === Common.MouseButtons.LEFT_BUTTON) { var dataSource = this._grid.getDataSource(); if(targetElement.classList.contains("deleteWatch") && !isDataTip) { var rowInfo = this._grid.getRowInfoFromEvent(e, ".grid-row"); this._controller.deleteWatch(rowInfo.dataIndex); this.refreshView(); } else if(targetElement.classList.contains("showAll")) { var rowInfo = this._grid.getRowInfoFromEvent(e, ".grid-row"); var watchItem = dataSource[rowInfo.dataIndex]; this.requestRemainingProperties(watchItem, rowInfo.dataIndex); } else if(targetElement.classList.contains("grid-cell") && !isDataTip) { var rowInfo = this._grid.getRowInfoFromEvent(e, ".grid-row"); if(rowInfo) { var watchItem = dataSource[rowInfo.dataIndex]; if(watchItem.uid === Debugger.WatchStore.ADD_WATCH_PLACEHOLDER) { this._grid.onEditCell(e); } } } } }; WatchWindowView.prototype.requestRemainingProperties = function (watchItem, dataIndex) { var _this = this; watchItem.parentWatch.getChildren(Debugger.WatchPropertiesRange.Remaining).done(function (childProperties) { var rowsAndExpandStates = _this.getRowsAndExpandState(childProperties); _this._grid.insertAdditionalDynamicData(rowsAndExpandStates, dataIndex); }); }; WatchWindowView.prototype.createGrid = function (rootElement, expandCountChangedCallback) { var _this = this; this._childDataCallback = function (parentTreeItem, complete) { parentTreeItem.getChildren(Debugger.WatchPropertiesRange.Minimal).done(function (childProperties) { var rowsAndExpandStates = _this.getRowsAndExpandState(childProperties); complete(rowsAndExpandStates); }); }; this._preEditValueCallback = function (dataIndex, columnIndex) { if(columnIndex === WatchWindowView.NAME_COLUMN) { var watch = _this._grid.getDataSource()[dataIndex]; if(watch.uid === Debugger.WatchStore.ADD_WATCH_PLACEHOLDER) { _this._options.commitOnTab = true; var addWatchRowInfo = _this._grid.getRowInfo(dataIndex); var nameCell = (addWatchRowInfo.row.children[WatchWindowView.NAME_COLUMN]); nameCell.innerText = ""; } } }; this._commitEditValueCallback = function (newValue, dataIndex, columnIndex) { if(columnIndex === WatchWindowView.NAME_COLUMN) { if(newValue && newValue !== "") { _this._controller.editWatch(newValue, dataIndex); } else { var watch = _this._grid.getDataSource()[dataIndex]; if(watch.uid !== Debugger.WatchStore.ADD_WATCH_PLACEHOLDER) { _this._controller.deleteWatch(dataIndex); } } } else { _this._controller.onValueEdit(dataIndex, newValue); } }; this._postEditValueCallback = function (dataIndex, columnIndex) { _this._options.commitOnTab = false; if(columnIndex === WatchWindowView.NAME_COLUMN) { var watch = _this._grid.getDataSource()[dataIndex]; if(watch.uid === Debugger.WatchStore.ADD_WATCH_PLACEHOLDER) { var addWatchRowInfo = _this._grid.getRowInfo(dataIndex); var nameCell = (addWatchRowInfo.row.children[WatchWindowView.NAME_COLUMN]); nameCell.innerText = watch.watchName; } } }; this._options = new Debugger.Grid.GridOptions(this._childDataCallback, this._columnInfo, null, this._preEditValueCallback, this._commitEditValueCallback, this._postEditValueCallback); if(!this._controller.isDataTip) { this._options.keyboardEventHandler = { keys: [ Common.Keys.c, Common.Keys.DEL, Common.Keys.ENTER, Common.Keys.SPACEBAR, Common.Keys.F10 ], handler: function (e, dataSource, dataIndex) { return _this.keyboardEventHandler(e, dataSource, dataIndex); } }; this._options.keepSelection = true; this._options.prerenderCallback = function (startIndex, endIndex) { _this._controller.evaluateWatchesInRange(startIndex, endIndex); }; } else { this._options.keyboardEventHandler = { keys: [ Common.Keys.c, Common.Keys.ENTER, Common.Keys.SPACEBAR ], handler: function (e, dataSource, dataIndex) { return _this.keyboardEventHandler(e, dataSource, dataIndex); } }; } this._options.drawRowSplitters = true; this._options.expandedCountChangedCallback = expandCountChangedCallback; this._options.extendViewportBy = 50; this._grid = new Debugger.Grid.GridControl(rootElement, this._options); this._options.onRowToggleCallback = function (dataSource, dataIndex, isExpanded) { var watch = dataSource[dataIndex]; if(isExpanded) { watch.watchState = Debugger.WatchItem.EXPANDED; return; } watch.watchState = Debugger.WatchItem.COLLAPSED; }; }; WatchWindowView.prototype.getColumnValue = function (dataIndex, columnIndex, columnOrder, dataSource) { var watch = dataSource[dataIndex]; return watch.displayValue; }; WatchWindowView.prototype.getCellCSSClass = function (dataIndex, columnIndex, columnOrder, dataSource) { var watch = dataSource[dataIndex]; return watch.cssMap[columnIndex]; }; WatchWindowView.prototype.getCellGlyphClass = function (dataIndex, columnIndex, columnOrder, dataSource) { var watch = dataSource[dataIndex]; return watch.typeClass; }; WatchWindowView.prototype.getRowsAndExpandState = function (childProperties) { var itemsWithPlaceholders = []; for(var index = 0; index < childProperties.length; index++) { itemsWithPlaceholders = itemsWithPlaceholders.concat(childProperties[index].getDescendants()); } var expandStates = []; for(var index = 0; index < itemsWithPlaceholders.length; index++) { expandStates.push(itemsWithPlaceholders[index].getExpandState()); } return { itemsWithPlaceholders: itemsWithPlaceholders, expandStates: expandStates }; }; WatchWindowView.prototype.keyboardEventHandler = function (e, dataSource, dataIndex) { var watch = dataSource[dataIndex]; switch(e.key) { case Common.Keys.c: if(!e.shiftKey && e.ctrlKey && !e.altKey) { clipboardData.setData("text", watch.getCopyString()); return true; } return false; break; case Common.Keys.DEL: if(watch.isUserWatch) { this._controller.deleteWatch(dataIndex); } break; case Common.Keys.ENTER: if(watch.uid === Debugger.WatchStore.ADD_WATCH_PLACEHOLDER) { this.createAddWatchTextBox(); } else if(watch.uid.indexOf(Debugger.WatchItem.SHOWALL_WATCHITEM_SUFFIX) !== -1) { this.requestRemainingProperties(watch, dataIndex); } break; case Common.Keys.SPACEBAR: if(watch.uid.indexOf(Debugger.WatchItem.SHOWALL_WATCHITEM_SUFFIX) !== -1) { this.requestRemainingProperties(watch, dataIndex); } break; case Common.Keys.F10: if(e.shiftKey && !e.ctrlKey && !e.altKey) { this.showContextMenu(e); } break; } return true; }; WatchWindowView.prototype.createMenuItems = function () { var _this = this; var menuItems = []; menuItems.push({ id: "menuItemCopyWatchWindowView", callback: function (menuId, menuItem) { return _this.onCopy(menuId, menuItem); }, label: Plugin.Resources.getString("WatchesContextMenuCopy"), type: Plugin.ContextMenu.MenuItemType.command, disabled: function () { return (_this._contextMenuWatchItem.uid === Debugger.WatchStore.ADD_WATCH_PLACEHOLDER || _this._contextMenuWatchItem.uid === Debugger.WatchStore.LOCALS_EXPANDO_ID); } }); menuItems.push({ id: "menuItemEditValueWatchWindowView", callback: function (menuId, menuItem) { return _this.onEditValue(menuId, menuItem); }, label: Plugin.Resources.getString("WatchesContextMenuEditValue"), type: Plugin.ContextMenu.MenuItemType.command, disabled: function () { return (_this._contextMenuWatchItem.fake || _this._contextMenuWatchItem.readOnly); } }); menuItems.push({ id: "menuItemSep1WatchWindowView", type: Plugin.ContextMenu.MenuItemType.separator }); menuItems.push({ id: "menuItemDeleteWatchWindowView", callback: function (menuId, menuItem) { return _this.onDelete(menuId, menuItem); }, label: Plugin.Resources.getString("WatchesContextMenuDelete"), type: Plugin.ContextMenu.MenuItemType.command, disabled: function () { return !_this._contextMenuWatchItem.isUserWatch; } }); menuItems.push({ id: "menuItemDeleteAllWatchWindowView", callback: function (menuId, menuItem) { return _this.onDeleteAll(menuId, menuItem); }, label: Plugin.Resources.getString("WatchesContextMenuDeleteAll"), type: Plugin.ContextMenu.MenuItemType.command, disabled: function () { return !_this._controller.hasUserWatches(); } }); return menuItems; }; WatchWindowView.prototype.showContextMenu = function (e) { if(this._grid) { if(this._contextMenu) { this._contextMenu.dispose(); this._contextMenu = null; } var rowInfo = this._grid.getRowInfoFromEvent(e, ".grid-row") || this._grid.getRowInfo(this._grid.getSelectedDataIndex()); if(rowInfo) { this._contextMenuSelection = rowInfo.dataIndex; this._contextMenuWatchItem = this._grid.getDataSource()[this._contextMenuSelection]; this._contextMenu = Plugin.ContextMenu.create(this.createMenuItems(), "watchesContextMenu"); var x = 0; var y = 0; if(e instanceof MouseEvent) { x = (e).pageX; y = (e).pageY; } if(x <= 0 && y <= 0) { var offset = rowInfo.row.getBoundingClientRect(); x = offset.left; y = offset.top; } this._contextMenu.show(x, y); } } e.preventDefault(); e.stopImmediatePropagation(); }; WatchWindowView.prototype.onCopy = function (menuId, menuItem) { clipboardData.setData("text", this._contextMenuWatchItem.getCopyString()); }; WatchWindowView.prototype.onEditValue = function (menuId, menuItem) { var _this = this; setTimeout(function () { var rowInfo = _this._grid.getRowInfo(_this._contextMenuSelection); var valueCell = (rowInfo.row.children[WatchWindowView.VALUE_COLUMN]); _this._grid.createEditBox(rowInfo.dataIndex, WatchWindowView.VALUE_COLUMN, valueCell); }, 0); }; WatchWindowView.prototype.onDelete = function (menuId, menuItem) { this._controller.deleteWatch(this._contextMenuSelection); }; WatchWindowView.prototype.onDeleteAll = function (menuId, menuItem) { this._controller.deleteAll(); }; return WatchWindowView; })(); Debugger.WatchWindowView = WatchWindowView; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=watchWindowView.js.map // watchItem.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; (function (WatchEvalStatus) { WatchEvalStatus._map = []; WatchEvalStatus.Stale = 0; WatchEvalStatus.EvalSent = 1; WatchEvalStatus.EvalReceived = 2; WatchEvalStatus.EvalRestoreComplete = 3; })(Debugger.WatchEvalStatus || (Debugger.WatchEvalStatus = {})); var WatchEvalStatus = Debugger.WatchEvalStatus; (function (WatchPropertiesRange) { WatchPropertiesRange._map = []; WatchPropertiesRange.Minimal = 0; WatchPropertiesRange.Remaining = 1; WatchPropertiesRange.All = 2; })(Debugger.WatchPropertiesRange || (Debugger.WatchPropertiesRange = {})); var WatchPropertiesRange = Debugger.WatchPropertiesRange; var CSSMap = (function () { function CSSMap() { this.watchIcon = ""; this.watchName = "watch-watchName"; this.watchValue = ""; } return CSSMap; })(); Debugger.CSSMap = CSSMap; var WatchItem = (function () { function WatchItem(uid, name, store, parentWatch) { this._name = name; this._value = null; this._type = null; this._typeClass = ""; this._children = []; this._store = store; this._isExpandable = false; this.uid = uid; this.cssMap = new CSSMap(); this.containsExpression = false; this.isPlaceholder = false; this.parentWatch = parentWatch; this.local = false; this.watchState = WatchItem.COLLAPSED; this.evalStatus = WatchEvalStatus.Stale; this.propertiesCount = 0; this.cssMap.watchValue += " grid-cell-editable"; } Object.defineProperty(WatchItem.prototype, "watchName", { get: function () { return this._name; }, set: function (name) { this._name = name; }, enumerable: true, configurable: true }); Object.defineProperty(WatchItem.prototype, "watchValue", { get: function () { return this._value; }, set: function (value) { if(this._type && this._type.toLowerCase() === "string" && value.length >= 2) { this._value = JSON.stringify(value.substring(1, value.length - 1)); } else { this._value = value.replace(/[\r\n\s]+/g, ' ').trim(); } }, enumerable: true, configurable: true }); Object.defineProperty(WatchItem.prototype, "watchType", { get: function () { return this._type; }, set: function (type) { this._type = type; if(type.toLowerCase().indexOf("function") !== -1) { this._typeClass = "functionItem"; } else { this._typeClass = "notAFunctionItem"; } }, enumerable: true, configurable: true }); Object.defineProperty(WatchItem.prototype, "displayValue", { get: function () { return this.getDisplayValue(); }, enumerable: true, configurable: true }); Object.defineProperty(WatchItem.prototype, "isExpandable", { get: function () { return this._isExpandable; }, set: function (value) { this._isExpandable = value; if(this._isExpandable) { this._children = []; var placeHolderChild = new WatchItem(this.uid + "-placeholder", "", this._store, this); placeHolderChild.isPlaceholder = true; placeHolderChild.rootIndex = this.rootIndex; this._children.push(placeHolderChild); } else { this._children = null; } }, enumerable: true, configurable: true }); Object.defineProperty(WatchItem.prototype, "fake", { get: function () { return this._fake; }, set: function (value) { this._fake = value; if(this.cssMap.watchValue) { if(this._fake || this._readOnly) { this.cssMap.watchValue = this.cssMap.watchValue.replace("grid-cell-editable", ""); } else if(this.cssMap.watchValue.indexOf("grid-cell-editable") === -1) { this.cssMap.watchValue += " grid-cell-editable"; } } }, enumerable: true, configurable: true }); Object.defineProperty(WatchItem.prototype, "readOnly", { get: function () { return this._readOnly; }, set: function (value) { this._readOnly = value; if(this.cssMap.watchValue) { if(this._fake || this._readOnly) { this.cssMap.watchValue = this.cssMap.watchValue.replace("grid-cell-editable", ""); } else if(this.cssMap.watchValue.indexOf("grid-cell-editable") === -1) { this.cssMap.watchValue += " grid-cell-editable"; } } }, enumerable: true, configurable: true }); WatchItem.EXPANDED = 1; WatchItem.COLLAPSED = -1; WatchItem.SHOWALL_WATCHITEM_SUFFIX = "-showAll"; WatchItem.WATCH_LABEL = "[Locals]"; Object.defineProperty(WatchItem.prototype, "watchIcon", { get: function () { if(this.isUserWatch) { return "
      "; } return ""; }, enumerable: true, configurable: true }); Object.defineProperty(WatchItem.prototype, "typeClass", { get: function () { return this._type === "" ? "" : this._typeClass; }, enumerable: true, configurable: true }); Object.defineProperty(WatchItem.prototype, "isUserWatch", { get: function () { return this.containsExpression && !(this.parentWatch && this.parentWatch.watchName === WatchItem.WATCH_LABEL && this.watchName === "this"); }, enumerable: true, configurable: true }); Object.defineProperty(WatchItem.prototype, "isInvalid", { set: function (value) { this._invalid = value; if(this._invalid) { this.cssMap.watchValue += " watch-Error"; } else { this.cssMap.watchValue = this.cssMap.watchValue.replace("watch-Error", ""); } }, enumerable: true, configurable: true }); Object.defineProperty(WatchItem.prototype, "customProperty", { set: function (property) { this._customProperty = property; this._customProperty.rootIndex = this.rootIndex; }, enumerable: true, configurable: true }); WatchItem.prototype.getExpandState = function () { return this.watchState * (this.getDescendantsCount() - 1); }; WatchItem.prototype.getChildren = function (range) { var _this = this; return this._store.getChildProperties(this, range).then(function (childProperties) { if(_this.hasAdditionalChildren) { _this._children = childProperties; var showAllButton = new WatchItem(_this.uid + WatchItem.SHOWALL_WATCHITEM_SUFFIX, "
      " + Plugin.Resources.getString("WatchesShowAllItems") + "
      ", _this._store, _this); showAllButton.cssMap.watchName += " grid-mixed-cell-html"; _this._children.push(showAllButton); } else if(range === WatchPropertiesRange.Remaining) { _this._children.splice(_this._children.length - 1, 1); _this._children = _this._children.concat(childProperties); return Plugin.Promise.wrap(childProperties); } else { _this._children = childProperties; } if(_this._customProperty) { _this._children.unshift(_this._customProperty); } return Plugin.Promise.wrap(_this._children); }); }; WatchItem.prototype.getDescendantsCount = function () { var descendants = 0; if(this._children) { for(var index = 0; index < this._children.length; index++) { descendants += this._children[index].getDescendantsCount(); } } return 1 + descendants; }; WatchItem.prototype.getDescendants = function (descendants) { if (typeof descendants === "undefined") { descendants = []; } descendants.push(this); if(this._children) { for(var index = 0; index < this._children.length; index++) { this._children[index].getDescendants(descendants); } } return descendants; }; WatchItem.prototype.getDisplayValue = function () { if(this._value === "{...}" || this._value === "[...]") { if(!this._type) { return ""; } else if(this._type.substr(0, 7) === "Object,") { return "[object" + this._type.substr(7) + "]"; } else if(this._type.substr(0, 8) === "[Object,") { return "[object" + this._type.substring(8, this._type.length - 1) + "]"; } else if(this._type === "Object") { return "[object]"; } return "[object " + this._type + "]"; } else { if(this._value === "Anonymous function") { return "[Anonymous function]"; } else { return this._value; } } }; WatchItem.prototype.getCopyString = function () { return this.watchName + "\t" + (this.displayValue || ""); }; WatchItem.prototype.reset = function () { this._value = null; this._type = null; this._children = null; this.isExpandable = false; this.watchState = WatchItem.COLLAPSED; this.evalStatus = WatchEvalStatus.Stale; this.hasAdditionalChildren = null; this.propertiesCount = 0; }; return WatchItem; })(); Debugger.WatchItem = WatchItem; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=watchItem.js.map // watchStore.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var WatchStateInfo = (function () { function WatchStateInfo(fullName, value, hasAdditionalChildren, watchState) { this.fullName = fullName; this.watchValue = value; if(hasAdditionalChildren === false) { this.propertiesRange = Debugger.WatchPropertiesRange.All; } else { this.propertiesRange = Debugger.WatchPropertiesRange.Minimal; } this.watchState = watchState; } return WatchStateInfo; })(); Debugger.WatchStateInfo = WatchStateInfo; var WatchStore = (function () { function WatchStore(controller) { this._store = []; this._watchesStateInfo = []; this._watchController = controller; this._watchId = 0; if(!this._watchController.isDataTip) { this.localsExpando = new Debugger.WatchItem(WatchStore.LOCALS_EXPANDO_ID, Debugger.WatchItem.WATCH_LABEL, this); this.localsExpando.local = true; this.localsExpando.fake = true; this.localsExpando.isExpandable = true; this.localsExpando.fullName = this.localsExpando.watchName; this.localsExpando.rootIndex = 0; this.localsExpando.evalStatus = Debugger.WatchEvalStatus.EvalRestoreComplete; this.thisWatch = new Debugger.WatchItem(WatchStore.LOCALS_EXPANDO_ID + "-this", "this", this, this.localsExpando); this.thisWatch.containsExpression = true; this.localsExpando.customProperty = this.thisWatch; this._store.push(this.localsExpando); this.addWatchPlaceholder = new Debugger.WatchItem(WatchStore.ADD_WATCH_PLACEHOLDER, Plugin.Resources.getString("AddToWatchesWindowLink"), this); this.addWatchPlaceholder.cssMap.watchName += " grid-cell-editable"; this.addWatchPlaceholder.fake = true; this.addWatchPlaceholder.readOnly = true; this._store.push(this.addWatchPlaceholder); } } WatchStore.EXCEPTION_WATCHITEM_INDEX = 0; WatchStore.LOCALS_EXPANDO_ID = "locals"; WatchStore.ADD_WATCH_PLACEHOLDER = "addWatch"; WatchStore.EXCEPTION_WATCHITEM_PREFIX = "{exception}"; WatchStore.ERROR_PROPID = "ERROR"; WatchStore.prototype.addWatch = function (expression) { var watch = new Debugger.WatchItem(this.getUid(), expression, this); watch.containsExpression = true; if(!this._watchController.isDataTip) { watch.cssMap.watchName += " grid-cell-editable"; } if(this._watchController.isDataTip) { watch.rootIndex = this._store.length; this._store.push(watch); } else { watch.rootIndex = this._store.length - 1; this._store.splice(this._store.length - 1, 0, watch); } this._watchController.refreshView(false, true); return watch; }; WatchStore.prototype.editWatch = function (expression, index) { var watch; if(!this._watchController.isDataTip && !this.isWatchesEvaluationEnabled && index < this._store.length - 1) { watch = this._store[index + 1]; if(watch.uid === WatchStore.ADD_WATCH_PLACEHOLDER) { return this.addWatch(expression); } watch.watchName = expression; } else { watch = this.getWatches()[index]; if(watch.uid === WatchStore.ADD_WATCH_PLACEHOLDER) { return this.addWatch(expression); } watch.reset(); watch.watchName = expression; watch.cssMap.watchName += " grid-cell-editable"; this._watchController.refreshView(); } this._watchController.refreshView(); return watch; }; WatchStore.prototype.deleteWatch = function (deleteIndex) { if(!this._watchController.isDataTip && !this.isWatchesEvaluationEnabled && deleteIndex < this._store.length) { this._store.splice(deleteIndex + 1, 1); this._watchController.refreshView(); } else { var watch = this.getWatches()[deleteIndex]; if(watch) { deleteIndex = this._store.indexOf(watch); if(deleteIndex !== -1) { this._store.splice(deleteIndex, 1); this._watchController.refreshView(); if(watch.isUserWatch && this._watchesStateInfo && this._watchesStateInfo[deleteIndex] && this._watchesStateInfo[deleteIndex].hasOwnProperty(watch.fullName)) { this._watchesStateInfo.splice(deleteIndex, 1); } } } } }; WatchStore.prototype.deleteAnyExceptionWatch = function () { if(this.isExceptionWatchItem(this._store[WatchStore.EXCEPTION_WATCHITEM_INDEX])) { this.deleteWatch(WatchStore.EXCEPTION_WATCHITEM_INDEX); } }; WatchStore.prototype.insertWatchItemAtIndex = function (watchItem, index) { if(this._store && index >= 0 && index < this._store.length) { watchItem.rootIndex = index; this._store.splice(index, 0, watchItem); } }; WatchStore.prototype.deleteAll = function () { this._store = this._store.filter(function (item) { return !item.isUserWatch; }); this._watchController.refreshView(); }; WatchStore.prototype.getExpandStates = function () { var expandStates = []; var watches = this.getWatches(); if(this.isWatchesEvaluationEnabled || this._watchController.isDataTip) { for(var index = 0; index < watches.length; index++) { expandStates.push(watches[index].getExpandState()); } } else { for(var index = 0; index < watches.length; index++) { expandStates.push(0); } } return expandStates; }; WatchStore.prototype.getWatches = function () { var watches = []; if(this.isWatchesEvaluationEnabled || this._watchController.isDataTip) { for(var index = 0; index < this._store.length; index++) { watches = watches.concat(this._store[index].getDescendants()); } } else { for(var index = 0; index < this._store.length; index++) { var originalWatch = this._store[index]; if(originalWatch.isUserWatch) { var watch = new Debugger.WatchItem(originalWatch.uid, originalWatch.watchName, this); watch.containsExpression = true; watch.watchValue = Plugin.Resources.getString("NotAvailableMessage"); watch.readOnly = true; watch.cssMap.watchName += " grid-cell-editable"; watches.push(watch); } else if(originalWatch.uid === WatchStore.ADD_WATCH_PLACEHOLDER) { watches.push(originalWatch); } } } return watches; }; WatchStore.prototype.getChildProperties = function (watch, range) { return this._watchController.getChildProperties(watch, range); }; WatchStore.prototype.updateWatchWithPropInfo = function (watch, propInfo) { watch.evalStatus = Debugger.WatchEvalStatus.EvalReceived; if(propInfo.propertyId !== WatchStore.ERROR_PROPID) { watch.uid = propInfo.propertyId; watch.watchType = propInfo.type; watch.watchType = propInfo.type; watch.watchValue = propInfo.value; watch.fullName = propInfo.fullName; watch.isInvalid = propInfo.invalid; watch.isExpandable = propInfo.expandable; watch.fake = propInfo.fake; watch.readOnly = propInfo.readOnly; return true; } return false; }; WatchStore.prototype.storeExceptionWatchState = function () { var exceptionWatchDescendants = this._store[WatchStore.EXCEPTION_WATCHITEM_INDEX].getDescendants(); this._exceptionWatchState = { }; for(var index = 0; index < exceptionWatchDescendants.length; index++) { var watch = exceptionWatchDescendants[index]; if(watch.fullName) { this._exceptionWatchState[watch.fullName] = new WatchStateInfo(watch.fullName, watch.watchValue, watch.hasAdditionalChildren, watch.watchState); } } }; WatchStore.prototype.storeWatchStates = function () { var previousWatchesStateInfo = this._watchesStateInfo; this._watchesStateInfo = []; for(var rootIndex = 0; rootIndex < this._store.length; rootIndex++) { if(this._store[rootIndex].evalStatus === Debugger.WatchEvalStatus.EvalRestoreComplete) { var rootWatchDescendants = this._store[rootIndex].getDescendants(); this._store[rootIndex].rootIndex = rootIndex; var rootWatchStateMap = { }; for(var index = 0; index < rootWatchDescendants.length; index++) { var watch = rootWatchDescendants[index]; if(watch.fullName) { rootWatchStateMap[watch.fullName] = new WatchStateInfo(watch.fullName, watch.watchValue, watch.hasAdditionalChildren, watch.watchState); } } this._watchesStateInfo[rootIndex] = rootWatchStateMap; } else { this._watchesStateInfo[rootIndex] = previousWatchesStateInfo[rootIndex]; } } }; WatchStore.prototype.restoreWatch = function (watch, forceGetChildren) { if(watch && watch.fullName && watch.uid !== WatchStore.ERROR_PROPID) { var rootWatchState = this._watchesStateInfo[watch.rootIndex]; if(watch.fullName.indexOf(WatchStore.EXCEPTION_WATCHITEM_PREFIX) === 0 && watch.rootIndex === WatchStore.EXCEPTION_WATCHITEM_INDEX) { rootWatchState = this._exceptionWatchState; } if(rootWatchState) { var previousWatchState = rootWatchState[watch.fullName]; if(previousWatchState) { if(watch.watchValue !== previousWatchState.watchValue) { watch.cssMap.watchValue += " watch-ValueChanged"; } else { watch.cssMap.watchValue = watch.cssMap.watchValue.replace("watch-ValueChanged", ""); } if(previousWatchState.watchState === Debugger.WatchItem.EXPANDED || forceGetChildren) { return watch.getChildren(previousWatchState.propertiesRange).then(function (childProperties) { watch.watchState = previousWatchState.watchState; watch.evalStatus = Debugger.WatchEvalStatus.EvalRestoreComplete; return Plugin.Promise.wrap(childProperties.length); }); } } } } watch.evalStatus = Debugger.WatchEvalStatus.EvalRestoreComplete; return Plugin.Promise.wrap(0); }; WatchStore.prototype.markAllWatchesStale = function () { for(var index = 0; index < this._store.length; index++) { this._store[index].evalStatus = Debugger.WatchEvalStatus.Stale; } this.thisWatch.evalStatus = Debugger.WatchEvalStatus.Stale; }; WatchStore.prototype.reset = function () { if(this._watchesStateInfo.length === 0) { this.localsExpando.watchState = Debugger.WatchItem.EXPANDED; } if(this._store.length >= WatchStore.EXCEPTION_WATCHITEM_INDEX + 1 && this.isExceptionWatchItem(this._store[WatchStore.EXCEPTION_WATCHITEM_INDEX])) { this._store.splice(WatchStore.EXCEPTION_WATCHITEM_INDEX, 1); this._exceptionWatchState = null; } this.storeWatchStates(); for(var index = 0; index < this._store.length; index++) { this._store[index].reset(); } this.thisWatch.reset(); this.localsExpando.isExpandable = true; }; WatchStore.prototype.hasUserWatches = function () { if(this._watchController.isDataTip) { return this._store.length > 0; } for(var index = 0; index < this._store.length; index++) { if(this._store[index].isUserWatch) { return true; } } return false; }; WatchStore.prototype.isExceptionWatchItem = function (watchItem) { return watchItem && watchItem.parentWatch === this.localsExpando && watchItem.watchName.toLowerCase() === WatchStore.EXCEPTION_WATCHITEM_PREFIX; }; WatchStore.prototype.getUid = function () { return "" + this._watchId++; }; return WatchStore; })(); Debugger.WatchStore = WatchStore; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=watchStore.js.map // GoToLinePrompt.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var GoToLinePrompt = (function (_super) { __extends(GoToLinePrompt, _super); function GoToLinePrompt(parent, dataEnteredCallback) { var _this = this; var container = document.createElement("div"); container.className = "goToLinePromptContainer lightDismissPromptContainer"; parent.appendChild(container); _super.call(this, container); this._dataEnteredCallback = dataEnteredCallback; var inputContainer = document.createElement("div"); inputContainer.className = "popupInputContainer"; var buttonContainer = document.createElement("div"); buttonContainer.className = "popupButtonContainer"; var label = document.createElement("div"); label.appendChild(document.createTextNode(Plugin.Resources.getString("GoToLinePromptMessage"))); this._inputBox = document.createElement("input"); this._inputBox.className = "promptInputBox"; this._inputBox.setAttribute("data-plugin-vs-tooltip", Plugin.Resources.getString("GoToLineInstructionsTooltip")); this._inputBox.addEventListener("keypress", function (e) { return _this.onKeyPress(e); }); var okButton = document.createElement("button"); var cancelButton = document.createElement("button"); okButton.addEventListener("click", function (e) { return _this.submit(); }); cancelButton.addEventListener("click", function (e) { return _this.hideControl(); }); cancelButton.addEventListener("blur", function (e) { return _this._inputBox.focus(); }); okButton.innerText = Plugin.Resources.getString("OkButtonLabel"); cancelButton.innerText = Plugin.Resources.getString("CancelButtonLabel"); okButton.className = "okButton"; cancelButton.className = "cancelButton"; inputContainer.appendChild(label); inputContainer.appendChild(this._inputBox); this.container.appendChild(inputContainer); buttonContainer.appendChild(okButton); buttonContainer.appendChild(cancelButton); this.container.appendChild(buttonContainer); } GoToLinePrompt.prototype.activate = function () { this._inputBox.value = ""; this.showControl(); this._inputBox.focus(); }; GoToLinePrompt.prototype.submit = function () { this.hideControl(); this._dataEnteredCallback(this._inputBox.value); }; GoToLinePrompt.prototype.onKeyPress = function (e) { if(e.keyCode === Common.KeyCodes.ENTER) { this.submit(); return false; } return true; }; return GoToLinePrompt; })(Debugger.LightDismissPopup); Debugger.GoToLinePrompt = GoToLinePrompt; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=GoToLinePrompt.js.map // EditorContextMenu.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var EditorContextMenu = (function () { function EditorContextMenu(window, executionController, breakpointController, callstackController) { this._editorWindow = window; this._executionController = executionController; this._breakpointController = breakpointController; this._callstackController = callstackController; } Object.defineProperty(EditorContextMenu.prototype, "isShowing", { get: function () { return this._isShowing; }, enumerable: true, configurable: true }); EditorContextMenu.prototype.show = function (x, y, canSetNextStatement, currentBreakpoint, position, isInMargin) { var _this = this; if(x === 0 && y === 0) { var cursor = document.querySelector(".monaco-editor .cursors-layer > .cursor"); if(cursor) { var cursorRect = cursor.getBoundingClientRect(); x = cursorRect.right - 1; y = cursorRect.bottom - 14; } } this._menuEditorPosition = position; if(this._contextMenu) { this._contextMenu.dispose(); this._contextMenu = null; } this._menuBreakpoints = null; if(isInMargin) { this._menuBreakpoints = this._breakpointController.getBreakpointsAtLine(this._editorWindow.currentDocId, this._menuEditorPosition.lineNumber); } else { if(currentBreakpoint) { this._menuBreakpoints = [ currentBreakpoint ]; } } this._editorWindow.dataTips.hideImmediately(false); this._contextMenu = Plugin.ContextMenu.create(this.createMenuItems(canSetNextStatement), "editorMenu"); this._isShowing = true; this._contextMenu.show(x, y); this._contextMenu.addEventListener("dismiss", function () { _this._isShowing = false; }); }; EditorContextMenu.prototype.hide = function () { if(this._contextMenu) { this._contextMenu.dismiss(); } }; EditorContextMenu.prototype.createMenuItems = function (canSetNextStatement) { var _this = this; var menuItems = []; var isScriptSource = this._editorWindow.isRuntimeDocument(this._editorWindow.currentDocId); menuItems.push({ id: "menuItemCopyEditorContextMenu", callback: function (menuId, menuItem) { return _this.onCopy(menuId, menuItem); }, label: Plugin.Resources.getString("BreakpointsContextMenuCopy"), type: Plugin.ContextMenu.MenuItemType.command, disabled: function () { return _this._editorWindow.getEditorSelection().isEmpty(); }, accessKey: Plugin.Resources.getString("AccessKeyCtrlC") }); menuItems.push({ id: "menuItemEditCommandsSeparatorEditorContextMenu", type: Plugin.ContextMenu.MenuItemType.separator }); if(this._menuBreakpoints && this._menuBreakpoints.length > 0 && isScriptSource) { menuItems.push({ id: "menuItemRemoveBreakpointEditorContextMenu", callback: function (menuId, menuItem) { return _this.onRemoveBreakpoint(menuId, menuItem); }, label: Plugin.Resources.getString((this._menuBreakpoints.length <= 1 ? "EditorContextMenuRemoveBreakpoint" : "EditorContextMenuRemoveAllBreakpoints")), type: Plugin.ContextMenu.MenuItemType.command, disabled: function () { return false; }, accessKey: (this._menuBreakpoints.length === 1 ? Plugin.Resources.getString("AccessKeyF9") : "") }); var anyEnabled = false; for(var i = 0; i < this._menuBreakpoints.length; i++) { if(this._menuBreakpoints[i].isEnabled) { anyEnabled = true; break; } } if(anyEnabled) { menuItems.push({ id: "menuItemDisableBreakpointEditorContextMenu", callback: function (menuId, menuItem) { return _this.onDisableBreakpoint(menuId, menuItem); }, label: Plugin.Resources.getString((this._menuBreakpoints.length <= 1 ? "EditorContextMenuDisableBreakpoint" : "EditorContextMenuDisableAllBreakpoints")), type: Plugin.ContextMenu.MenuItemType.command, disabled: function () { return false; }, accessKey: (this._menuBreakpoints.length === 1 ? Plugin.Resources.getString("AccessKeyCtrlF9") : "") }); } else { menuItems.push({ id: "menuItemEnableBreakpointEditorContextMenu", callback: function (menuId, menuItem) { return _this.onEnableBreakpoint(menuId, menuItem); }, label: Plugin.Resources.getString((this._menuBreakpoints.length <= 1 ? "EditorContextMenuEnableBreakpoint" : "EditorContextMenuEnableAllBreakpoints")), type: Plugin.ContextMenu.MenuItemType.command, disabled: function () { return false; }, accessKey: (this._menuBreakpoints.length === 1 ? Plugin.Resources.getString("AccessKeyCtrlF9") : "") }); } if(this._menuBreakpoints.length === 1) { var breakpoint = this._menuBreakpoints[0]; if(breakpoint.isTracepoint) { menuItems.push({ id: "menuItemAddTraceEditorContextMenu", callback: function (menuId, menuItem) { return _this.onEditBreakpoint(menuId, menuItem, breakpoint); }, label: Plugin.Resources.getString("BreakpointsContextMenuAddTraceMessage"), type: Plugin.ContextMenu.MenuItemType.command, accessKey: Plugin.Resources.getString("AccessKeyAltF9") }); } else { menuItems.push({ id: "menuItemAddConditionEditorContextMenu", callback: function (menuId, menuItem) { return _this.onEditBreakpoint(menuId, menuItem, breakpoint); }, label: Plugin.Resources.getString("BreakpointsContextMenuAddCondition"), type: Plugin.ContextMenu.MenuItemType.command, accessKey: Plugin.Resources.getString("AccessKeyAltF9") }); } } } else { menuItems.push({ id: "menuItemInsertBreakpointEditorContextMenu", callback: function (menuId, menuItem) { return _this.onInsertBreakpoint(menuId, menuItem, false); }, label: Plugin.Resources.getString("EditorContextMenuInsertBreakpoint"), type: Plugin.ContextMenu.MenuItemType.command, disabled: function () { return !isScriptSource; }, accessKey: Plugin.Resources.getString("AccessKeyF9") }); menuItems.push({ id: "menuItemInsertTracepointEditorContextMenu", callback: function (menuId, menuItem) { return _this.onInsertBreakpoint(menuId, menuItem, true); }, label: Plugin.Resources.getString("EditorContextMenuInsertTracepoint"), type: Plugin.ContextMenu.MenuItemType.command, disabled: function () { return !isScriptSource; } }); } menuItems.push({ id: "menuItemBreakpointControlSeparatorEditorContextMenu", type: Plugin.ContextMenu.MenuItemType.separator }); menuItems.push({ id: "menuItemShowNextStatementEditorContextMenu", callback: function (menuId, menuItem) { return _this.onShowNextStatement(menuId, menuItem); }, label: Plugin.Resources.getString("ShowNextStatement"), type: Plugin.ContextMenu.MenuItemType.command, disabled: function () { return !_this._executionController.isExecutionPaused; } }); menuItems.push({ id: "menuItemRunToCursorEditorContextMenu", callback: function (menuId, menuItem) { return _this.onRunToCursor(menuId, menuItem); }, label: Plugin.Resources.getString("EditorContextMenuRunToCursor"), type: Plugin.ContextMenu.MenuItemType.command, disabled: function () { return !isScriptSource; }, accessKey: Plugin.Resources.getString("AccessKeyCtrlF10") }); menuItems.push({ id: "menuItemSetNextStatementEditorContextMenu", callback: function (menuId, menuItem) { return _this.onSetNextStatement(menuId, menuItem); }, label: Plugin.Resources.getString("EditorContextMenuSetNextStatement"), type: Plugin.ContextMenu.MenuItemType.command, disabled: function () { return !_this._executionController.isExecutionPaused || !isScriptSource || !canSetNextStatement; }, accessKey: Plugin.Resources.getString("AccessKeyCtrlShiftF10") }); if(this._executionController.debuggerManager.isBreakCompleted) { menuItems.push({ id: "menuItemExecutionControlSeparatorEditorContextMenu", type: Plugin.ContextMenu.MenuItemType.separator }); menuItems.push({ id: "menuItemAddToWatchEditorContextMenu", callback: function (menuId, menuItem) { return _this.onAddToWatch(menuId, menuItem); }, label: Plugin.Resources.getString("EditorContextMenuAddToWatch"), type: Plugin.ContextMenu.MenuItemType.command, disabled: function () { return !_this._executionController.isExecutionPaused || !isScriptSource; }, accessKey: Plugin.Resources.getString("AccessKeyCtrlW") }); } return menuItems; }; EditorContextMenu.prototype.onCopy = function (menuId, menuItem) { var selection = this._editorWindow.getEditorSelection(); var text = this._editorWindow.getEditorRangeContents(selection); clipboardData.setData("text", text); }; EditorContextMenu.prototype.onEditBreakpoint = function (menuId, menuItem, breakpoint) { this._breakpointController.promptToSetCondition(breakpoint); }; EditorContextMenu.prototype.onSetNextStatement = function (menuId, menuItem) { this._executionController.setNextStatement(new Debugger.SourceLocation(this._editorWindow.currentDocId, this._menuEditorPosition.lineNumber, this._menuEditorPosition.column)); }; EditorContextMenu.prototype.onShowNextStatement = function (menuId, menuItem) { this._callstackController.showNextStatement(); }; EditorContextMenu.prototype.onInsertBreakpoint = function (menuId, menuItem, isTracepoint) { var column = this._editorWindow.adjustInsertionColumn(this._menuEditorPosition.lineNumber, this._menuEditorPosition.column); this._breakpointController.addBreakpoint(new Debugger.SourceLocation(this._editorWindow.currentDocId, this._menuEditorPosition.lineNumber, column), isTracepoint); }; EditorContextMenu.prototype.onRemoveBreakpoint = function (menuId, menuItem) { Tools.Utility.Assert.IsTrue(this._menuBreakpoints !== null); for(var i = 0; i < this._menuBreakpoints.length; i++) { this._breakpointController.deleteBreakpoint(this._menuBreakpoints[i]); } this._menuBreakpoints = null; }; EditorContextMenu.prototype.onEnableBreakpoint = function (menuId, menuItem) { Tools.Utility.Assert.IsTrue(this._menuBreakpoints !== null); for(var i = 0; i < this._menuBreakpoints.length; i++) { this._breakpointController.setEnabledState(this._menuBreakpoints[i], true); } this._menuBreakpoints = null; }; EditorContextMenu.prototype.onDisableBreakpoint = function (menuId, menuItem) { Tools.Utility.Assert.IsTrue(this._menuBreakpoints !== null); for(var i = 0; i < this._menuBreakpoints.length; i++) { this._breakpointController.setEnabledState(this._menuBreakpoints[i], false); } this._menuBreakpoints = null; }; EditorContextMenu.prototype.onRunToCursor = function (menuId, menuItem) { this._executionController.runToCursor(this._editorWindow.currentDocId, this._menuEditorPosition); }; EditorContextMenu.prototype.onAddToWatch = function (menuId, menuItem) { this._executionController.debuggerManager.watchController.addWatchByCurrentEditorPosition(); }; return EditorContextMenu; })(); Debugger.EditorContextMenu = EditorContextMenu; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=EditorContextMenu.js.map // editorDocument.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var EditorDocument = (function () { function EditorDocument(docId) { this._docId = docId; this.viewZoneMap = { }; this.decorationIdMap = { }; this.glyphIdMap = { }; } Object.defineProperty(EditorDocument.prototype, "model", { get: function () { return this._model; }, set: function (value) { Tools.Utility.Assert.HasValue(value, "Model should not be set without a value"); this.viewZoneMap = { }; this.decorationIdMap = { }; this.glyphIdMap = { }; this._model = value; }, enumerable: true, configurable: true }); Object.defineProperty(EditorDocument.prototype, "docId", { get: function () { return this._docId; }, enumerable: true, configurable: true }); EditorDocument.prototype.addBreakpointDecoration = function (breakpoint) { var _this = this; if(typeof this.model !== "undefined") { this.model.changeDecorations(function (changeAccessor) { var mapId = Debugger.EditorWindow.BP_DECORATION_PREFIX + breakpoint.breakpointId; if(breakpoint.isEnabled && breakpoint.isBound) { if(_this.decorationIdMap[mapId]) { changeAccessor.removeDecoration(_this.decorationIdMap[mapId]); } _this.decorationIdMap[mapId] = changeAccessor.addDecoration(_this.getTrimmedRange(breakpoint.location), { className: "breakpointDecoration" }); } if(!_this.glyphIdMap[mapId]) { _this.glyphIdMap[mapId] = changeAccessor.addDecoration(breakpoint.location.toIRange(), { className: "", showInOverviewRuler: Plugin.Theme.getValue("plugin-editor-scrollbar-marker-breakpoint-color"), glyphMarginClassName: breakpoint.getGlyphClassName() + " breakpointGlyph " + (!breakpoint.isBound ? " bpUnbound" : "") + (!breakpoint.isEnabled ? " bpDisabled" : "") }); } else { changeAccessor.changeDecoration(_this.glyphIdMap[mapId], breakpoint.location.toIRange()); } }); } }; EditorDocument.prototype.displayInstructionPointerDecoration = function (location) { var _this = this; if(typeof this.model !== "undefined") { this.model.changeDecorations(function (changeAccessor) { var mapId = Debugger.EditorWindow.IP_DECORATION_ID; if(_this.decorationIdMap[mapId]) { changeAccessor.removeDecoration(_this.decorationIdMap[mapId]); } _this.decorationIdMap[mapId] = changeAccessor.addDecoration(_this.getTrimmedRange(location), { className: "instructionPointerDecoration" }); if(!_this.glyphIdMap[mapId]) { _this.glyphIdMap[mapId] = changeAccessor.addDecoration(location.toIRange(), { showInOverviewRuler: Plugin.Theme.getValue("plugin-editor-scrollbar-marker-instruction-pointer-color"), glyphMarginClassName: "instructionPointerGlyph" }); } else { changeAccessor.changeDecoration(_this.glyphIdMap[mapId], location.toIRange()); } }); } }; EditorDocument.prototype.addExceptionDecoration = function (range) { var _this = this; if(typeof this.model !== "undefined") { this.model.changeDecorations(function (changeAccessor) { _this.decorationIdMap[Debugger.EditorWindow.EXCEPTION_DECORATION_ID] = changeAccessor.addDecoration(range, { className: "", showInOverviewRuler: Plugin.Theme.getValue("plugin-font-editor-erroradornment-background-color") }); }); } }; EditorDocument.prototype.displayActiveFrameDecoration = function (location) { var _this = this; if(typeof this.model !== "undefined") { this.model.changeDecorations(function (changeAccessor) { var mapId = Debugger.EditorWindow.ACTIVE_FRAME_DECORATION_ID; if(_this.decorationIdMap[mapId]) { changeAccessor.removeDecoration(_this.decorationIdMap[mapId]); } _this.decorationIdMap[mapId] = changeAccessor.addDecoration(_this.getTrimmedRange(location), { className: "activeFrameDecoration" }); if(!_this.glyphIdMap[mapId]) { _this.glyphIdMap[mapId] = changeAccessor.addDecoration(location.toIRange(), { showInOverviewRuler: Plugin.Theme.getValue("plugin-editor-scrollbar-marker-active-frame-color"), glyphMarginClassName: "activeFrameGlyph" }); } else { changeAccessor.changeDecoration(_this.glyphIdMap[mapId], location.toIRange()); } }); } }; EditorDocument.prototype.removeDecoration = function (id) { var _this = this; if(typeof this.model !== "undefined") { this.model.changeDecorations(function (changeAccessor) { changeAccessor.removeDecoration(_this.decorationIdMap[id]); delete _this.decorationIdMap[id]; changeAccessor.removeDecoration(_this.glyphIdMap[id]); delete _this.glyphIdMap[id]; }); } }; EditorDocument.prototype.getTrimmedRange = function (range) { var text = this._model.getValueInRange(range); var endColumn = range.endColumn; var endLine = range.endLineNumber; var i = text.length - 1; while(text.charAt(i).match(/\s/)) { if(text.charAt(i) === "\n") { endLine--; endColumn = this._model.getLineContent(endLine).length; } else { endColumn--; } i--; } Tools.Utility.Assert.IsTrue(endLine >= range.startLineNumber); return { startLineNumber: range.startLineNumber, startColumn: range.startColumn, endLineNumber: endLine, endColumn: endColumn }; }; return EditorDocument; })(); Debugger.EditorDocument = EditorDocument; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=editorDocument.js.map // editorWindow.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var EditorWindow = (function () { function EditorWindow(debuggerManager, breakpointController, executionController, callstackController, debuggerToolbar, rootElement, ready) { var _this = this; this._rootElement = rootElement; this._debuggerManager = debuggerManager; this._breakpointController = breakpointController; this._executionController = executionController; this._callstackController = callstackController; this._debuggerToolbar = debuggerToolbar; this._searchProvider = new Debugger.SearchProvider(debuggerManager); var tabOptions = new Debugger.TabOptions(true); this._tabControl = new Debugger.TabControl(document.getElementById("tabControl"), tabOptions, document.getElementById("tabControlContextMenu")); this._tabControl.tabOptions.onSelectCallback = function (docId) { return _this.switchToDocument(docId); }; this._tabControl.tabOptions.onCloseCallback = function (docId) { return _this.closeDocument(docId, false); }; this._filePicker = new Debugger.FilePicker(document.getElementById("filePickerMenu"), document.getElementById("filePickerButton"), this._debuggerManager.debuggerShell); this._filePicker.onSelectCallback = function (docId) { return _this.openDocument(docId); }; this._activeWidgets = []; this._documentMap = { }; this._sourceTableFederator = new Debugger.SourceTableFederator(); this._viewZoneIdMap = { }; this._wordWrapEnabled = false; this._listeners = []; this.registerListener(this._debuggerToolbar); this._goToLinePrompt = new Debugger.GoToLinePrompt(document.getElementById("editor"), this.goToLine.bind(this)); this._editorContextMenu = new Debugger.EditorContextMenu(this, this._executionController, this._breakpointController, this._callstackController); this._editorElement = document.getElementById("editor"); Tools.Utility.Assert.IsTrue(this._editorElement !== null); this.hideEditor(); window.setImmediate(function () { require([ "vs/editor/editor.main" ], function () { Monaco.Editor.getOrCreateMode("text/html").then(function () { Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_Create_Start); _this._editor = Monaco.Editor.create(_this._editorElement, { value: "", mode: "text/html", scrollbar: { vertical: 'visible', horizontal: 'visible', useShadows: false, verticalHasArrows: true, horizontalHasArrows: true, handleMouseWheel: true, verticalScrollbarSize: 17, horizontalScrollbarSize: 17, arrowSize: 30 }, readOnly: true, scrollBeyondLastLine: false, roundedSelection: true, insertSpaces: false, quickSuggestions: false, autoClosingBrackets: false, automaticLayout: false, glyphMargin: true, hover: false, nativeContextMenu: false, wrappingColumn: _this.getWordWrapEnabled() === Debugger.Tristate.On ? 0 : EditorWindow.WRAPPING_COLUMN, tabFocusMode: true, selectOnLineNumbers: false, stopLineTokenizationAfter: 1e7 }); Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_Create_Stop); _this._dataTips = new Debugger.DataTips(_this._editor, _this, _this._debuggerManager); _this.hideEditor(); window.addEventListener("resize", function () { Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_Layout_Start); _this._editor.layout(); Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_Layout_Stop); }); _this.setupControls(); ready(); }); }); }); } EditorWindow.WRAPPING_COLUMN = 300; EditorWindow.CONTEXTMENU_SHOW_TIMEOUT = 100; EditorWindow.IP_DECORATION_ID = "Decoration:InstructionPointer"; EditorWindow.SETNEXTSTATEMENT_VIEWZONE_ID = "ViewZone:SetNextStatementFailed"; EditorWindow.EXCEPTION_VIEWZONE_ID = "Viewzone:ExceptionOverlay"; EditorWindow.EXCEPTION_DECORATION_ID = "Decoration:ExceptionOverlay"; EditorWindow.ACTIVE_FRAME_DECORATION_ID = "Decoration:ActiveFrame"; EditorWindow.BP_DECORATION_PREFIX = "Decoration:Breakpoint:"; EditorWindow.prototype.getWordWrapEnabled = function () { if(this._editor) { if(this._editor.getConfiguration().isDominatedByLongLines) { return Debugger.Tristate.Disabled; } return this._wordWrapEnabled ? Debugger.Tristate.On : Debugger.Tristate.Off; } return Debugger.Tristate.Off; }; EditorWindow.prototype.setWordWrapEnabled = function (value) { this._wordWrapEnabled = value; this._editor.updateOptions({ wrappingColumn: this._wordWrapEnabled ? 0 : EditorWindow.WRAPPING_COLUMN }); }; EditorWindow.prototype.getDocText = function (docId) { return this._sourceTableFederator.getSourceText(docId); }; Object.defineProperty(EditorWindow.prototype, "currentDocId", { get: function () { return this._currentDocId; }, enumerable: true, configurable: true }); Object.defineProperty(EditorWindow.prototype, "currentDocText", { get: function () { return this._sourceTableFederator.getSourceText(this._currentDocId); }, enumerable: true, configurable: true }); Object.defineProperty(EditorWindow.prototype, "exceptionViewZoneInfo", { get: function () { return this._exceptionViewZoneInfo; }, enumerable: true, configurable: true }); Object.defineProperty(EditorWindow.prototype, "filePicker", { get: function () { return this._filePicker; }, enumerable: true, configurable: true }); Object.defineProperty(EditorWindow.prototype, "searchProvider", { get: function () { return this._searchProvider; }, enumerable: true, configurable: true }); Object.defineProperty(EditorWindow.prototype, "tabControl", { get: function () { return this._tabControl; }, enumerable: true, configurable: true }); Object.defineProperty(EditorWindow.prototype, "dataTips", { get: function () { return this._dataTips; }, enumerable: true, configurable: true }); Object.defineProperty(EditorWindow.prototype, "contextMenu", { get: function () { return this._editorContextMenu; }, enumerable: true, configurable: true }); EditorWindow.prototype.getAvailableSources = function () { return this._sourceTableFederator.getSources(); }; EditorWindow.prototype.getOpenedSources = function () { var sources = []; for(var i = 0; i < this._tabControl.length; i++) { var tabItem = this._tabControl.getTabByIndex(i); sources.push(this._sourceTableFederator.getSource(tabItem.id)); } return sources; }; EditorWindow.prototype.registerListener = function (listener) { if(this._listeners.indexOf(listener) === -1) { this._listeners.push(listener); } }; EditorWindow.prototype.getEditorPosition = function () { return this._editor.getPosition(); }; EditorWindow.prototype.setEditorPosition = function (position) { this._editor.setPosition(position); }; EditorWindow.prototype.getEditorSelection = function () { return this._editor.getSelection(); }; EditorWindow.prototype.getEditorRangeContents = function (selection) { var model = this._editor.getModel(); if(!model) { return ""; } return model.getValueInRange(selection); }; EditorWindow.prototype.breakStateChanged = function (isBroken) { this._editorContextMenu.hide(); }; EditorWindow.prototype.breakpointChanged = function (breakpoint, previousId) { this.breakpointRemoved(breakpoint, previousId); this.breakpointAdded(breakpoint); }; EditorWindow.prototype.breakpointAdded = function (breakpoint) { if(this.isDocumentOpen(breakpoint.location.docId)) { var doc = this._documentMap[breakpoint.location.docId]; if(doc && doc.model) { doc.addBreakpointDecoration(breakpoint); this.updateExecutionDecorations(doc.docId); } } }; EditorWindow.prototype.breakpointsAdded = function (docId) { if(this.isDocumentOpen(docId)) { var doc = this._documentMap[docId]; if(doc && doc.model) { var bps = this._breakpointController.getBreakpoints(docId); for(var i = 0; i < bps.length; i++) { doc.addBreakpointDecoration(bps[i]); } this.updateExecutionDecorations(docId); } } }; EditorWindow.prototype.breakpointRemoved = function (breakpoint, previousId) { if (typeof previousId === "undefined") { previousId = breakpoint.breakpointId; } if(this.isDocumentOpen(breakpoint.location.docId)) { var doc = this._documentMap[breakpoint.location.docId]; if(doc && doc.model) { doc.removeDecoration(EditorWindow.BP_DECORATION_PREFIX + previousId); } } }; EditorWindow.prototype.addExceptionViewZone = function (location, errorMessage) { var _this = this; if(this.isDocumentOpen(location.docId)) { var viewZoneElement = document.createElement("div"); var exceptionGlyph = document.createElement("div"); exceptionGlyph.className = "exceptionGlyph"; viewZoneElement.appendChild(exceptionGlyph); viewZoneElement.appendChild(document.createTextNode(errorMessage)); viewZoneElement.className = "exceptionViewZone"; viewZoneElement.id = "exceptionViewZone"; var doc = this._documentMap[location.docId]; var trimmedLocation = doc.getTrimmedRange(location); var viewZone = { afterLineNumber: trimmedLocation.endLineNumber, afterColumn: trimmedLocation.endColumn, heightInLines: 1, domNode: viewZoneElement }; this._exceptionViewZoneInfo = { line: trimmedLocation.endLineNumber, docId: location.docId, message: errorMessage, exceptionViewZone: viewZone }; doc.viewZoneMap[EditorWindow.EXCEPTION_VIEWZONE_ID] = viewZone; doc.addExceptionDecoration({ startLineNumber: location.endLineNumber + 1, startColumn: 0, endLineNumber: location.endLineNumber + 1, endColumn: 1 }); if(this._currentDocId === location.docId) { Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_ChangeViewZones_Start); this._editor.changeViewZones(function (changeAccessor) { _this._viewZoneIdMap[EditorWindow.EXCEPTION_VIEWZONE_ID] = changeAccessor.addZone(viewZone); }); Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_ChangeViewZones_Stop); } } }; EditorWindow.prototype.removeExceptionViewZone = function () { var _this = this; if(this._exceptionViewZoneInfo) { var docId = this._exceptionViewZoneInfo.docId; if(this.isDocumentOpen(docId)) { if(this._currentDocId === docId && this._viewZoneIdMap[EditorWindow.EXCEPTION_VIEWZONE_ID]) { Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_ChangeViewZones_Start); this._editor.changeViewZones(function (changeAccessor) { changeAccessor.removeZone(_this._viewZoneIdMap[EditorWindow.EXCEPTION_VIEWZONE_ID]); delete _this._viewZoneIdMap[EditorWindow.EXCEPTION_VIEWZONE_ID]; }); Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_ChangeViewZones_Stop); } delete this._documentMap[docId].viewZoneMap[EditorWindow.EXCEPTION_VIEWZONE_ID]; this._documentMap[docId].removeDecoration(EditorWindow.EXCEPTION_DECORATION_ID); } this._exceptionViewZoneInfo = null; } }; EditorWindow.prototype.addSetNextStatementErrorViewZone = function (location) { var _this = this; if(this._documentMap.hasOwnProperty(location.docId)) { this.removeSetNextStatementErrorViewzone(location.docId); var viewZoneElement = document.createElement("div"); var exceptionGlyph = document.createElement("div"); exceptionGlyph.className = "exceptionGlyph"; viewZoneElement.appendChild(exceptionGlyph); viewZoneElement.appendChild(document.createTextNode(Plugin.Resources.getString("SetNextStatementFailed"))); viewZoneElement.className = "setNextStatementErrorViewZone"; var viewZone = { afterLineNumber: location.endLineNumber, heightInLines: 1, domNode: viewZoneElement }; this._documentMap[location.docId].viewZoneMap[EditorWindow.SETNEXTSTATEMENT_VIEWZONE_ID] = viewZone; if(this._currentDocId === location.docId) { Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_ChangeViewZones_Start); this._editor.changeViewZones(function (changeAccessor) { _this._viewZoneIdMap[EditorWindow.SETNEXTSTATEMENT_VIEWZONE_ID] = changeAccessor.addZone(viewZone); }); Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_ChangeViewZones_Stop); } } }; EditorWindow.prototype.removeSetNextStatementErrorViewzone = function (docId) { var _this = this; if(this._documentMap.hasOwnProperty(docId) && this._documentMap[docId].viewZoneMap.hasOwnProperty(EditorWindow.SETNEXTSTATEMENT_VIEWZONE_ID)) { if(this._currentDocId === docId && this._viewZoneIdMap[EditorWindow.SETNEXTSTATEMENT_VIEWZONE_ID]) { Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_ChangeViewZones_Start); this._editor.changeViewZones(function (changeAccessor) { changeAccessor.removeZone(_this._viewZoneIdMap[EditorWindow.SETNEXTSTATEMENT_VIEWZONE_ID]); delete _this._viewZoneIdMap[EditorWindow.SETNEXTSTATEMENT_VIEWZONE_ID]; }); Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_ChangeViewZones_Stop); } delete this._documentMap[docId].viewZoneMap[EditorWindow.SETNEXTSTATEMENT_VIEWZONE_ID]; } }; EditorWindow.prototype.activeFrameChanged = function (frame, isInstructionPointer) { if((!frame || isInstructionPointer) && (this._instructionPointerFrame && this.isDocumentOpen(this._instructionPointerFrame.location.docId))) { var oldDoc = this._documentMap[this._instructionPointerFrame.location.docId]; if(oldDoc) { oldDoc.removeDecoration(EditorWindow.IP_DECORATION_ID); } this.removeSetNextStatementErrorViewzone(this._instructionPointerFrame.location.docId); } if(this._activeFrame && this.isDocumentOpen(this._activeFrame.location.docId)) { var oldDoc = this._documentMap[this._activeFrame.location.docId]; if(oldDoc) { oldDoc.removeDecoration(EditorWindow.ACTIVE_FRAME_DECORATION_ID); } } if(isInstructionPointer || !frame) { this._instructionPointerFrame = null; this._activeFrame = null; } if(!isInstructionPointer || !frame) { this._activeFrame = null; } if(frame && frame.location) { var newLocation = frame.location; if(isInstructionPointer) { this._instructionPointerFrame = frame; } else { this._activeFrame = frame; } this.addFrameDecorations(newLocation, isInstructionPointer); } }; EditorWindow.prototype.addFrameDecorations = function (newLocation, isInstructionPointer) { if(this.isDocumentOpen(newLocation.docId)) { var newDoc = this._documentMap[newLocation.docId]; if(newDoc && newDoc.model) { if(isInstructionPointer) { newDoc.displayInstructionPointerDecoration(newLocation); } else { newDoc.displayActiveFrameDecoration(newLocation); } } } }; EditorWindow.prototype.navigateTo = function (location) { var _this = this; Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_EditorWindow_NavigateTo_Start); if(this.isDocumentOpen(location.docId)) { if(this._currentDocId !== location.docId) { this._tabControl.trySelectItemById(location.docId); } return this._debuggerManager.getDocumentQueuePromise(location.docId).then(function () { return Plugin.Promise.timeout(); }).then(function () { _this.revealRange(location); Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_EditorWindow_NavigateTo_Stop); }); } else { return this.openDocument(location.docId).then(function () { _this.revealRange(location); Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_EditorWindow_NavigateTo_Stop); }); } }; EditorWindow.prototype.isDocumentOpen = function (docId) { return (this._documentMap.hasOwnProperty(docId)); }; EditorWindow.prototype.documentAdded = function (source, isUnmappedDocument) { this._sourceTableFederator.add(source); if(!isUnmappedDocument) { this._filePicker.documentAdded(source); } }; EditorWindow.prototype.openDocument = function (docId, text, isUnmappedDocument) { var _this = this; if(!(docId && this._sourceTableFederator.contains(docId))) { return Plugin.Promise.wrap(false); } Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_OpenDocument_Start); this._dataTips.dataTipsEnabled = false; var tabItem = this._tabControl.getTabById(docId); var source = this._sourceTableFederator.getSource(docId); if(!text && this.isDocumentOpen(docId) && !this._debuggerManager.isDocumentDirty(docId)) { this._tabControl.selectedItem = tabItem; this.switchToDocument(docId); return Plugin.Promise.wrap(true); } if(!tabItem) { this._documentMap[docId] = new Debugger.EditorDocument(docId); tabItem = new Debugger.TabItem(docId, true); tabItem.title = source.url; tabItem.tooltipString = source.url; this._tabControl.addTab(tabItem); } this._currentDocId = docId; this._tabControl.selectedItem = tabItem; this._filePicker.documentOpened(docId); if(text) { this.documentUpdated(docId, text, false); this.fireDocumentActivated(); if(!isUnmappedDocument) { this._dataTips.dataTipsEnabled = true; } Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_OpenDocument_Stop); return Plugin.Promise.wrap(true); } else { return new Plugin.Promise(function (completed, error) { _this.hideEditor(); _this._debuggerManager.queueGetSourceText(docId).then(function () { _this.fireDocumentActivated(); _this._dataTips.dataTipsEnabled = true; completed(true); Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_OpenDocument_Stop); }, function () { completed(false); }, function (textMapping) { _this.documentUpdated(docId, textMapping.text, false); }); }); } }; EditorWindow.prototype.closeDocument = function (docId, isRuntimeTriggered) { var _this = this; Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_CloseDocument_Start); this._tabControl.removeTabById(docId, isRuntimeTriggered); var editorDocument = this._documentMap[docId]; if(editorDocument && editorDocument.model) { editorDocument.model.destroy(); if(!this.isRuntimeDocument(docId)) { this._sourceTableFederator.remove(docId); } this._sourceTableFederator.removeSourceText(docId); delete this._documentMap[docId]; } this._filePicker.documentClosed(docId); if(this._tabControl.length === 0) { this._currentDocId = undefined; this._dataTips.dataTipsEnabled = false; this.fireDocumentActivated(); return new Plugin.Promise(function (completed, error) { if(_this._editor) { Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_SetModel_Start); _this._editor.setModel(null); _this._debuggerToolbar.updateWordWrapButton(); Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_SetModel_Stop); _this.hideEditor(); } completed(); Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_CloseDocument_Stop); }); } else if(this._currentDocId === docId) { Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_CloseDocument_Stop); return this.openDocument(this._tabControl.selectedItem.id); } return Plugin.Promise.wrap(null); }; EditorWindow.prototype.documentRemoved = function (docId) { this._sourceTableFederator.remove(docId); this._filePicker.documentRemoved(docId); return this.closeDocument(docId, true); }; EditorWindow.prototype.documentUpdated = function (docId, newContent, appendText, mimeType, previousPosition) { var _this = this; var source = this._sourceTableFederator.getSource(docId); if(!source) { return; } var sourceText = this._sourceTableFederator.getSourceText(docId); var hasMimeTypeChanged = (mimeType && source.mimeType !== mimeType); if(hasMimeTypeChanged) { source.mimeType = mimeType; this.filePicker.documentUpdated(docId); } if(this.isDocumentOpen(docId)) { if(!appendText && sourceText === newContent) { this.showEditor(); return; } if(newContent) { if(appendText) { this._sourceTableFederator.setSourceText(docId, sourceText + newContent); } else { this._sourceTableFederator.setSourceText(docId, newContent); } } sourceText = this._sourceTableFederator.getSourceText(docId); this.showEditor(); if(!appendText || !this._documentMap[docId].model || hasMimeTypeChanged) { Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_CreateModel_Start); var model = Monaco.Editor.createModel(newContent, source.mimeType); Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_CreateModel_Stop); if(this._documentMap[docId].model) { this._documentMap[docId].model.destroy(); } this._documentMap[docId].model = model; if(this._currentDocId === docId) { Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_SetModel_Start); this._editor.setModel(model); this._debuggerToolbar.updateWordWrapButton(); Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_SetModel_Stop); } } else { var model = this._documentMap[docId].model; model.change(function (changeAccessor) { var lastLineNumber = model.getLineCount(); var lastColumn = model.getLineMaxColumn(lastLineNumber); changeAccessor.insertText({ lineNumber: lastLineNumber, column: lastColumn }, newContent); }); this._debuggerToolbar.updateWordWrapButton(); } this.breakpointsAdded(docId); if(previousPosition && this._currentDocId === docId) { var formattedPosition = this._debuggerManager.getFormattedPosition(docId, previousPosition); this.revealPosition(formattedPosition); } else if(this._activeFrame && this.currentDocId === this._activeFrame.location.docId) { this.revealRange(this._activeFrame.location); } else if(this._instructionPointerFrame && this.currentDocId === this._instructionPointerFrame.location.docId) { this.revealRange(this._instructionPointerFrame.location); } this._searchProvider.findAndHighlightMatches(); if(this._exceptionViewZoneInfo) { if(this._exceptionViewZoneInfo.docId === docId) { var newDoc = this._documentMap[docId]; if(!newDoc.viewZoneMap.hasOwnProperty(EditorWindow.EXCEPTION_VIEWZONE_ID)) { newDoc.viewZoneMap[EditorWindow.EXCEPTION_VIEWZONE_ID] = this._exceptionViewZoneInfo.exceptionViewZone; } Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_ChangeViewZones_Start); this._editor.changeViewZones(function (changeAccessor) { if(_this._viewZoneIdMap[EditorWindow.EXCEPTION_VIEWZONE_ID]) { changeAccessor.removeZone(_this._viewZoneIdMap[EditorWindow.EXCEPTION_VIEWZONE_ID]); } var newLocation = _this._debuggerManager.callstackController.callstacks[0].instructionPointerFrame.location; if(newLocation) { var trimmedLocation = newDoc.getTrimmedRange(newLocation); _this._exceptionViewZoneInfo.exceptionViewZone.afterLineNumber = trimmedLocation.endLineNumber; _this._exceptionViewZoneInfo.line = trimmedLocation.endLineNumber; } _this._viewZoneIdMap[EditorWindow.EXCEPTION_VIEWZONE_ID] = changeAccessor.addZone(_this._exceptionViewZoneInfo.exceptionViewZone); }); Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_ChangeViewZones_Stop); } } } this.fireDocumentActivated(); }; EditorWindow.prototype.documentUrlChanged = function (docId, url, oldUrl) { this._sourceTableFederator.documentUrlChanged(docId, oldUrl, url); this._breakpointController.documentUrlChanged(docId); this.filePicker.documentUpdated(docId); if(this.isDocumentOpen(docId)) { this.tabControl.documentUrlChanged(docId, url); } }; EditorWindow.prototype.isRuntimeDocument = function (docId) { return this._debuggerManager.isRuntimeDocument(docId); }; EditorWindow.prototype.getUrlFromDocId = function (docId) { var source = this._sourceTableFederator.getSource(docId); if(source) { return source.url || ""; } return ""; }; EditorWindow.prototype.getDocIdFromUrl = function (url) { return this._sourceTableFederator.getFirstDocId(url); }; EditorWindow.prototype.layout = function () { Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_Layout_Start); this._editor.layout(); Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_Layout_Stop); this._tabControl.realignControl(false); this._filePicker.resizePicker(); if(Plugin.F12 && Plugin.F12.ErrorDisplay.isShown) { Plugin.F12.ErrorDisplay.resize(false); } }; EditorWindow.prototype.getLocalMatches = function (text) { if(this._documentMap[this._currentDocId] && this._documentMap[this._currentDocId].model) { return this._documentMap[this._currentDocId].model.findMatches(text, false, false, false, false); } return []; }; EditorWindow.prototype.addDecorations = function (ranges, className, color) { var decorationIds = []; if(ranges && this._documentMap[this._currentDocId] && this._documentMap[this._currentDocId].model) { this._documentMap[this._currentDocId].model.changeDecorations(function (changeAccessor) { for(var i = 0; i < ranges.length; i++) { decorationIds.push(changeAccessor.addDecoration(ranges[i], { className: className, showInOverviewRuler: color })); } }); } return decorationIds; }; EditorWindow.prototype.removeDecorations = function (decorationIds, docId) { if(decorationIds && this._documentMap[docId] && this._documentMap[docId].model) { this._documentMap[docId].model.changeDecorations(function (changeAccessor) { for(var i = 0; i < decorationIds.length; i++) { changeAccessor.removeDecoration(decorationIds[i]); } }); } }; EditorWindow.prototype.selectRange = function (range) { this.revealRange(range); this._editor.setSelection(range); }; EditorWindow.prototype.getLineCount = function () { var doc = this._documentMap[this._currentDocId]; if(doc) { return doc.model.getLineCount(); } return 0; }; EditorWindow.prototype.getLineContents = function (lineNumber) { var doc = this._documentMap[this._currentDocId]; if(doc) { if(lineNumber > 0 && lineNumber <= doc.model.getLineCount()) { return doc.model.getLineContent(lineNumber); } } return ""; }; EditorWindow.prototype.revealPosition = function (position) { this.revealRange({ startLineNumber: position.lineNumber, startColumn: position.column, endLineNumber: position.lineNumber, endColumn: position.column }); }; EditorWindow.prototype.revealRange = function (range) { Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_RevealRange_Start); var shouldRevealLineInCenterOfViewport = true; var shouldRevealColumn = true; Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_RevealPosition_Start); this._editor.revealRange(range, shouldRevealLineInCenterOfViewport, shouldRevealColumn); Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_RevealPosition_Stop); this._editor.setPosition({ lineNumber: range.startLineNumber, column: range.startColumn }); this._editor.focus(); Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_RevealRange_Stop); }; EditorWindow.prototype.goToLine = function (lineCol) { var strings = lineCol.split(","); var line, column; line = parseInt(strings[0], 10); if(strings.length > 0) { column = parseInt(strings[1], 10); if(isNaN(line) && !isNaN(column)) { line = this._editor.getPosition().lineNumber; } } if(!isNaN(line) || !isNaN(column)) { if(!column) { column = 0; } this.revealRange({ startLineNumber: line, startColumn: column, endLineNumber: line, endColumn: column }); } }; EditorWindow.prototype.isKnownDocId = function (docId) { return this._sourceTableFederator.isValidDocId(docId); }; EditorWindow.prototype.createUnmappedSource = function (url, mimeType, length, isDynamicCode) { return this._sourceTableFederator.createUnmappedSource(url, mimeType, length, isDynamicCode); }; EditorWindow.prototype.getUnmappedDocSource = function (url) { var docId = this._sourceTableFederator.getFirstDocId(url); if(this._sourceTableFederator.isUnmappedSource(docId)) { return this._sourceTableFederator.getSource(docId); } return null; }; EditorWindow.prototype.updateDocId = function (newDocId, source) { Tools.Utility.Assert.IsFalse(this._sourceTableFederator.contains(newDocId), "Attempting to update an unmapped document's docId to a docId which already exists"); var oldDocId = source.docId; this._tabControl.changeTabId(oldDocId, newDocId); this._sourceTableFederator.updateDocId(source, newDocId); var document = this._documentMap[oldDocId]; delete this._documentMap[oldDocId]; this._documentMap[newDocId] = document; if(this._currentDocId === oldDocId) { this._currentDocId = newDocId; } return this.isDocumentOpen(newDocId); }; EditorWindow.prototype.focusEditor = function () { this._editor.focus(); }; EditorWindow.prototype.adjustInsertionColumn = function (lineNumber, column) { var model = this._editor.getModel(); if(model) { var text = model.getLineContent(lineNumber); if(text) { var firstNonWhitespaceColumn = text.search(/\S/) + 1; return Math.max(column, firstNonWhitespaceColumn); } } return column; }; EditorWindow.prototype.updateExecutionDecorations = function (docId) { if(this._instructionPointerFrame && this._instructionPointerFrame.location && this._instructionPointerFrame.location.docId === docId) { this._documentMap[docId].displayInstructionPointerDecoration(this._instructionPointerFrame.location); } if(this._activeFrame && this._activeFrame.location && this._activeFrame.location.docId === docId && !this._activeFrame.location.equals(this._instructionPointerFrame.location)) { this._documentMap[docId].displayActiveFrameDecoration(this._activeFrame.location); } }; EditorWindow.prototype.switchToDocument = function (docId) { var _this = this; Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_SwitchDocument_Start); if(this.isDocumentOpen(docId)) { if(this._currentDocId) { var oldDoc = this._documentMap[this._currentDocId]; Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_SaveViewState_Start); oldDoc.viewState = this._editor.saveViewState(); Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_SaveViewState_Stop); } Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_ChangeViewZones_Start); this._editor.changeViewZones(function (changeAccessor) { for(var i in _this._viewZoneIdMap) { if(_this._viewZoneIdMap.hasOwnProperty(i)) { changeAccessor.removeZone(_this._viewZoneIdMap[i]); } } }); Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_ChangeViewZones_Stop); for(var i = 0; i < this._activeWidgets.length; i++) { this._editor.removeContentWidget(this._activeWidgets[i]); delete this._activeWidgets[i]; } if(!this._debuggerManager.isDocumentDirty(docId)) { var newDoc = this._documentMap[docId]; this._currentDocId = docId; Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_SetModel_Start); this._editor.setModel(newDoc.model); this._debuggerToolbar.updateWordWrapButton(); Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_SetModel_Stop); Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_ChangeViewZones_Start); this._editor.changeViewZones(function (changeAccessor) { var i; for(i in newDoc.viewZoneMap) { if(newDoc.viewZoneMap.hasOwnProperty(i)) { _this._viewZoneIdMap[i] = changeAccessor.addZone(newDoc.viewZoneMap[i]); } } }); Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_ChangeViewZones_Stop); if(newDoc.model) { this._searchProvider.findAndHighlightMatches(); } if(newDoc.viewState) { Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_RestoreViewState_Start); this._editor.restoreViewState(newDoc.viewState); Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_Editor_RestoreViewState_Stop); } this.fireDocumentActivated(); } else { this.openDocument(docId); } this._dataTips.dataTipsEnabled = this.isRuntimeDocument(docId); } Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_SwitchDocument_Stop); }; EditorWindow.prototype.showContextMenu = function (eventArgs) { var _this = this; this._editorContextMenu.hide(); if(this._currentDocId) { var isInMargin = null; var posx = 0; var posy = 0; var position = null; if(eventArgs) { isInMargin = (eventArgs.target.type === MonacoDefinitions.MouseTargetType.GUTTER_GLYPH_MARGIN || eventArgs.target.type === MonacoDefinitions.MouseTargetType.GUTTER_LINE_NUMBERS); posx = eventArgs.event.posx; posy = eventArgs.event.posy; position = eventArgs.target.position; } if(!position) { position = this.getEditorPosition(); } else { var currentSelection = this.getEditorSelection(); if(!currentSelection || !currentSelection.containsPosition(position)) { this.setEditorPosition(position); } } var sourceLocation = new Debugger.SourceLocation(this._currentDocId, position.lineNumber, position.column); var retValCanSetNextStatement = true; var retValCurrentBreakpoint = null; var canSetNextStatementPromise = new Plugin.Promise(function (completed, error) { _this._executionController.canSetNextStatement(sourceLocation).then(function (canSetNextStatement) { retValCanSetNextStatement = canSetNextStatement; completed(); }); }); var currentBreakpointPromise; if(isInMargin || !this.isRuntimeDocument(this._currentDocId)) { currentBreakpointPromise = Plugin.Promise.wrap(null); } else { var currentBreakpointPromise = new Plugin.Promise(function (completed, error) { var column = _this.adjustInsertionColumn(sourceLocation.lineNumber, sourceLocation.column); var adjustedLocation = new Debugger.SourceLocation(sourceLocation.docId, sourceLocation.lineNumber, column); _this._breakpointController.getBreakpointAtLocation(adjustedLocation).then(function (currentBreakpoint) { retValCurrentBreakpoint = currentBreakpoint; completed(); }); }); } Plugin.Promise.timeout(EditorWindow.CONTEXTMENU_SHOW_TIMEOUT, Plugin.Promise.join([ canSetNextStatementPromise, currentBreakpointPromise ])).then(function () { }, function () { }).done(function () { _this._editorContextMenu.show(posx, posy, retValCanSetNextStatement, retValCurrentBreakpoint, position, isInMargin); }); } if(eventArgs) { eventArgs.event.preventDefault(); eventArgs.event.stopPropagation(); } }; EditorWindow.prototype.setupControls = function () { var _this = this; this._editor.addListener("mousedown", function (eventArgs) { if(eventArgs.event.leftButton) { _this._editorContextMenu.hide(); if(eventArgs.target.type === MonacoDefinitions.MouseTargetType.GUTTER_GLYPH_MARGIN || eventArgs.target.type === MonacoDefinitions.MouseTargetType.GUTTER_LINE_NUMBERS) { var line = eventArgs.target.position.lineNumber; var startCol = (eventArgs.target.range ? eventArgs.target.range.startColumn : eventArgs.target.position.column); var endCol = (eventArgs.target.range ? eventArgs.target.range.endColumn : undefined); if(startCol === 0) { var model = _this._editor.getModel(); if(model) { var lineContent = model.getLineContent(line); if(lineContent) { var spaces = lineContent.match(/^\s*/); if(spaces.length > 0) { startCol = spaces[0].length + 1; } } } } _this.toggleBreakpoint(line, startCol, endCol, true); } } else if(eventArgs.event.rightButton) { _this.showContextMenu(eventArgs); } }); this._editor.addListener("contextMenu", function (eventArgs) { if(eventArgs.event.rightButton) { return; } _this.showContextMenu(eventArgs); }); document.addEventListener("keydown", function (e) { return _this.onKeyDown(e); }); if(Plugin.F12) { Plugin.F12.addEventListener("keydown", function (e) { return _this.onKeyDown(e); }); } this._editor.getHandlerService().bind({ key: "Shift-F10" }, function () { _this.showContextMenu(); return true; }); }; EditorWindow.prototype.onKeyDown = function (e) { if(this.currentDocId && this._editor.getModel()) { if(e.keyCode === Common.KeyCodes.G && e.ctrlKey && !e.shiftKey && !e.altKey) { this._goToLinePrompt.activate(); return false; } else if(e.keyCode === Common.KeyCodes.F9 && !e.ctrlKey && !e.shiftKey && !e.altKey) { var editorLocation = this._editor.getPosition(); this.toggleBreakpoint(editorLocation.lineNumber, editorLocation.column); } else if(e.keyCode === Common.KeyCodes.F9 && !e.ctrlKey && !e.shiftKey && e.altKey) { var editorLocation = this._editor.getPosition(); this.setBreakpointCondition(editorLocation.lineNumber, editorLocation.column); } else if(e.keyCode === Common.KeyCodes.F9 && e.ctrlKey && !e.shiftKey && !e.altKey) { var editorLocation = this._editor.getPosition(); this.setBreakpointState(editorLocation.lineNumber, editorLocation.column); } else if(e.keyCode === Common.KeyCodes.F10 && e.ctrlKey && e.shiftKey && !e.altKey) { if(this._executionController.isExecutionPaused) { var editorLocation = this._editor.getPosition(); this._executionController.setNextStatement(new Debugger.SourceLocation(this._currentDocId, editorLocation.lineNumber, editorLocation.column)); } } else if(e.keyCode === Common.KeyCodes.F10 && e.ctrlKey && !e.shiftKey && !e.altKey) { if(this._executionController.isExecutionPaused) { var editorLocation = this._editor.getPosition(); this._executionController.runToCursor(this._currentDocId, editorLocation); } } } return true; }; EditorWindow.prototype.toggleBreakpoint = function (lineNumber, startColumn, endColumn, removeAll, isTracepoint) { if(this._currentDocId && this.isRuntimeDocument(this._currentDocId)) { var doc = this._documentMap[this._currentDocId]; Tools.Utility.Assert.HasValue(doc, "Toggle breakpoint inside an invalid document"); var startColumn = this.adjustInsertionColumn(lineNumber, startColumn); var location = new Debugger.SourceLocation(this._currentDocId, lineNumber, startColumn, lineNumber, endColumn || startColumn); this._breakpointController.addOrRemoveBreakpointsAtLocation(location, removeAll); } }; EditorWindow.prototype.setBreakpointCondition = function (lineNumber, column, removeAll) { var _this = this; if(this._currentDocId && this.isRuntimeDocument(this._currentDocId)) { var doc = this._documentMap[this._currentDocId]; Tools.Utility.Assert.HasValue(doc, "Toggle breakpoint inside an invalid document"); this._breakpointController.getBreakpointAtLocation(new Debugger.SourceLocation(this._currentDocId, lineNumber, column)).done(function (breakpoint) { if(breakpoint) { _this._breakpointController.promptToSetCondition(breakpoint); } }); } }; EditorWindow.prototype.setBreakpointState = function (lineNumber, column, removeAll) { var _this = this; if(this._currentDocId && this.isRuntimeDocument(this._currentDocId)) { var doc = this._documentMap[this._currentDocId]; Tools.Utility.Assert.HasValue(doc, "Toggle breakpoint inside an invalid document"); this._breakpointController.getBreakpointAtLocation(new Debugger.SourceLocation(this._currentDocId, lineNumber, column)).done(function (breakpoint) { if(breakpoint) { _this._breakpointController.setEnabledState(breakpoint, !breakpoint.isEnabled); } }); } }; EditorWindow.prototype.hideEditor = function () { this._editorElement.style.display = "none"; }; EditorWindow.prototype.showEditor = function () { this._editorElement.style.display = ""; }; EditorWindow.prototype.fireDocumentActivated = function () { this._listeners.forEach(function (listener) { listener.documentActivated(); }); }; return EditorWindow; })(); Debugger.EditorWindow = EditorWindow; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=editorWindow.js.map // dataTips.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var DataTips = (function () { function DataTips(editor, editorWindow, debuggerManager) { this._editor = editor; this._editorWindow = editorWindow; this._debuggerManager = debuggerManager; this.setupDataTipEvents(); } DataTips.WHITESPACE_REGEX = new RegExp("\\s"); DataTips.NO_RESULT = { text: "", range: null }; DataTips.MIN_TOP = 30; DataTips.EDGE_PADDING = 10; DataTips.WINDOW_VERTICAL_PADDING = 38; DataTips.MAX_HEIGHT = 300 + DataTips.WINDOW_VERTICAL_PADDING; DataTips.WINDOW_SCROLLBAR_WIDTH = 24; DataTips.WINDOW_BASIC_WIDTH = 8 + Debugger.WatchWindowView.TWO_COLUMN_WIDTH + DataTips.WINDOW_SCROLLBAR_WIDTH; DataTips.DATATIP_SHOW_TIME = Plugin.F12.getDoubleClickTime() * 0.2; DataTips.DATATIP_DISMISS_TIME = Plugin.F12.getDoubleClickTime() * 1.5; Object.defineProperty(DataTips.prototype, "dataTipsEnabled", { get: function () { return this._dataTipsEnabled; }, set: function (enabled) { this._dataTipsEnabled = enabled; if(!this._dataTipsEnabled) { this.hideImmediately(false); } }, enumerable: true, configurable: true }); Object.defineProperty(DataTips.prototype, "watchController", { get: function () { return this._watchWindowController; }, enumerable: true, configurable: true }); DataTips.prototype.setupDataTipEvents = function () { var _this = this; require([ "require", "vs/base/lib/winjs.base", "vs/editor/core/constants", "vs/editor/core/range", "vs/editor/editor", "vs/editor/contrib/hover/hoverWidgets" ], function (require) { var Constants = require("vs/editor/core/constants"); _this.Range = require("vs/editor/core/range").Range; var Editor = require("vs/editor/editor"); var ContentHoverWidget = require("vs/editor/contrib/hover/hoverWidgets").ContentHoverWidget; _this._dataTipElement = document.getElementById("dataTipElement"); _this._dataTipElement.style.display = "none"; _this._dataTipElement.setAttribute("aria-hidden", "true"); _this._innerContainer = document.createElement("div"); _this._innerContainer.className = "popoverInnerContainer"; _this._dataTipElement.appendChild(_this._innerContainer); _this._watchWindowController = new Debugger.WatchWindowController(_this._debuggerManager, _this._innerContainer, true, function (count) { return _this.redrawCallback(); }); _this._addToWatchesLink = document.createElement("a"); _this._addToWatchesLink.setAttribute("href", ""); _this._addToWatchesLink.id = "addToWatchesLink"; _this._addToWatchesLink.innerText = Plugin.Resources.getString("AddToWatchesWindowLink"); _this._innerContainer.appendChild(_this._addToWatchesLink); _this._dataTipElement.addEventListener("mouseenter", function (e) { return _this.abortPendingActions(); }); _this._dataTipElement.addEventListener("mouseover", function (e) { return _this.abortPendingActions(); }); _this._dataTipElement.addEventListener("mouseleave", function (e) { return _this.hideImmediately(); }); _this._editor.addListener(Constants.EventType.MouseMove, function (e) { return _this.handleMouseMove(e, Editor); }); _this._editor.addListener(Constants.EventType.KeyDown, function () { return _this.hideImmediately(); }); _this._editor.addListener(Constants.EventType.ModelChanged, function () { return _this.hideImmediately(); }); _this._editor.addListener(Constants.EventType.CursorSelectionChanged, function () { return _this.hideImmediately(); }); _this._editor.addListener("scroll", function () { return _this.hideImmediately(); }); _this._handleGlobalClick = function (event) { if(!_this._dataTipElement.contains(event.target)) { _this.hideImmediately(); } }; }); }; DataTips.prototype.hideAfterDelay = function () { var _this = this; if(this._dataTipVisible && !this._hideDataTipTimeoutToken) { this._hideDataTipTimeoutToken = setTimeout(function () { return _this.hideImmediately(true); }, DataTips.DATATIP_DISMISS_TIME); } }; DataTips.prototype.hideImmediately = function (allowPending) { if(!allowPending) { this.cancelPendingDataTip(); } this.dismissElement(); this.cancelPendingHide(); }; DataTips.prototype.showAfterDelay = function (x, y, position) { var _this = this; this.cancelPendingDataTip(); var tokenInfo = this.getTokenInfo(position); if(tokenInfo) { if(this._dataTipVisible && this.areTokensEqual(tokenInfo, this._lastTokenInfo) && !this.isPositionInTokenWhitespace(position, tokenInfo)) { this.cancelPendingHide(); } else { this._showDataTipDelay = Plugin.Promise.timeout(DataTips.DATATIP_SHOW_TIME); this._showDataTipDelay.then(function () { _this._positionLeft = x; _this._positionTop = y + 10; _this._showDataTipDelay = null; if(_this.isPositionInTokenWhitespace(position, tokenInfo)) { _this._lastTokenInfo = null; } else { _this.showImmediately(position); _this._lastTokenInfo = tokenInfo; } }); } } }; DataTips.prototype.showImmediately = function (position) { Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_EditorWindow_CreateDataTipFromPosition_Start); document.body.addEventListener("click", this._handleGlobalClick); var selection = this._editor.getSelection(); if(selection && !selection.isEmpty() && selection.containsPosition(position)) { var model = this._editor.getModel(); if(model) { var text = model.getValueInRange(selection).trim(); this.displayElement(text); } } else { var expressionInfo = this.parseExpression(position); this.displayElement(expressionInfo.text); } Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_EditorWindow_CreateDataTipFromPosition_Stop); }; DataTips.prototype.parseExpression = function (position) { var tokenInfo = this.getTokenInfo(position); if(!tokenInfo) { return DataTips.NO_RESULT; } var tokenType = tokenInfo.token.type; var model = this._editor.getModel(); if(!model) { return DataTips.NO_RESULT; } var tokenText = model.getLineContent(tokenInfo.lineNumber).substring(tokenInfo.startColumn - 1, tokenInfo.endColumn - 1); var text = ""; if(tokenType.lastIndexOf(".html") >= 0 || tokenType.lastIndexOf(".css") >= 0) { return DataTips.NO_RESULT; } if(tokenType.lastIndexOf(".js") >= 0) { tokenType = tokenType.substr(0, tokenType.length - 3); if(tokenType === "key" || tokenType === "comment") { return DataTips.NO_RESULT; } if(tokenType === "delimiter" && tokenText !== ".") { return DataTips.NO_RESULT; } if(tokenType === "string" || tokenType === "number") { return DataTips.NO_RESULT; } if(tokenType === "keyword" && (tokenText === "null" || tokenText === "true" || tokenText === "false" || tokenText === "debugger")) { return DataTips.NO_RESULT; } } if(!text) { return this.calculateEntireToken(model.getLineContent(position.lineNumber), tokenInfo); } return { text: text, range: new this.Range(tokenInfo.lineNumber, tokenInfo.startColumn, tokenInfo.lineNumber, tokenInfo.endColumn) }; }; DataTips.prototype.isPositionInTokenWhitespace = function (position, tokenInfo) { var lineText; var model = this._editor.getModel(); if(model) { lineText = model.getLineContent(tokenInfo.lineNumber); return DataTips.WHITESPACE_REGEX.test(lineText.charAt(position.column - 1)); } return true; }; DataTips.prototype.areTokensEqual = function (token1, token2) { if(!token1 || !token2) { return false; } return token1.lineNumber === token2.lineNumber && token1.startColumn === token2.startColumn && token1.endColumn === token2.endColumn; }; DataTips.prototype.cancelPendingDataTip = function () { if(this._showDataTipDelay) { this._showDataTipDelay.cancel(); this._showDataTipDelay = null; } }; DataTips.prototype.cancelPendingHide = function () { if(this._hideDataTipTimeoutToken !== null) { clearTimeout(this._hideDataTipTimeoutToken); this._hideDataTipTimeoutToken = null; } }; DataTips.prototype.abortPendingActions = function () { this.cancelPendingHide(); this.cancelPendingDataTip(); return; }; DataTips.prototype.handleMouseMove = function (event, Editor) { this.hideAfterDelay(); this.cancelPendingDataTip(); if(this._dataTipsEnabled && this._debuggerManager.executionController.isExecutionPaused && !this._editorWindow.contextMenu.isShowing) { var targetType = event.target.type; if(targetType === Editor.MouseTargetType.CONTENT_TEXT) { this.showAfterDelay(event.event.posx, event.event.posy, event.target.position); } } }; DataTips.prototype.displayElement = function (text) { var _this = this; this.abortPendingActions(); if(text) { text = text.trim(); if(this._dataTipVisible) { this.hideImmediately(true); } if(text.length === 0) { return; } this._addToWatchesLink.onclick = function (e) { _this._debuggerManager.watchController.addWatch(text); return false; }; this._watchWindowController.addWatch(text).then(function (success) { if(!success) { _this.hideImmediately(); } }); this._dataTipElement.style.display = "block"; this._dataTipElement.setAttribute("aria-hidden", "false"); this._dataTipVisible = true; this.redrawCallback(); } }; DataTips.prototype.redrawCallback = function () { if(this._dataTipVisible) { var minTop = DataTips.MIN_TOP + DataTips.EDGE_PADDING; var maxBottom = Math.min(document.body.clientHeight, this._debuggerManager.debuggerShell.getConsoleTop()) - DataTips.EDGE_PADDING; var minLeft = DataTips.EDGE_PADDING; var maxRight = document.body.offsetWidth - DataTips.EDGE_PADDING; var desiredHeight = this._watchWindowController.getActualHeight() + DataTips.WINDOW_VERTICAL_PADDING; var availableHeight = maxBottom - minTop; var height = Math.min(desiredHeight, availableHeight, DataTips.MAX_HEIGHT); var width = DataTips.WINDOW_BASIC_WIDTH; if(height < desiredHeight) { width += DataTips.WINDOW_SCROLLBAR_WIDTH; } var top = this._positionTop; var left = this._positionLeft; if(top + height > maxBottom) { top = Math.max(minTop, maxBottom - height); } if(left + width > maxRight) { left = Math.max(minLeft, maxRight - width); } this._dataTipElement.style.height = height + "px"; this._dataTipElement.style.width = width + "px"; this._dataTipElement.style.top = top + "px"; this._dataTipElement.style.left = left + "px"; this._watchWindowController.layout(); } }; DataTips.prototype.dismissElement = function () { document.body.removeEventListener("click", this._handleGlobalClick); this._hideDataTipTimeoutToken = null; this._dataTipVisible = false; this._dataTipElement.style.display = "none"; this._dataTipElement.setAttribute("aria-hidden", "true"); this._watchWindowController.deleteWatch(0); }; DataTips.prototype.getTokenInfo = function (position) { var currentTokenInfo = null; var model = this._editor.getModel(); if(model) { model.tokenIterator(position, function (it) { currentTokenInfo = it.next(); }); } return currentTokenInfo; }; DataTips.prototype.calculateEntireToken = function (lineContent, tokenInfo) { var start = tokenInfo.startColumn; if(start > 0 && lineContent.charAt(start - 2) === ".") { start = this.findEarlierStart(start, lineContent); } var text = lineContent.substr(start - 1, tokenInfo.endColumn - start); return { text: text, range: new this.Range(tokenInfo.lineNumber, tokenInfo.startColumn, tokenInfo.lineNumber, tokenInfo.endColumn) }; }; DataTips.prototype.findEarlierStart = function (start, line) { for(var i = start - 1; i > 0; i--) { if(line.charAt(i - 1).match(/[\w\d$.]/)) { start = start - 1; } else { break; } } return start; }; return DataTips; })(); Debugger.DataTips = DataTips; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=dataTips.js.map // FilePicker.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var FilePicker = (function () { function FilePicker(container, buttonElement, debuggerShell) { var _this = this; this._buttonElement = buttonElement; this._container = container; this._debuggerShell = debuggerShell; buttonElement.setAttribute("data-plugin-vs-tooltip", Plugin.Resources.getString("FilePickerTooltip")); buttonElement.setAttribute("aria-label", Plugin.Resources.getString("FilePickerTooltip")); buttonElement.setAttribute("aria-expanded", "false"); buttonElement.setAttribute("aria-controls", "filePickerMenu"); this._fileItemsMap = { }; this._rootNodesMap = { }; this._dirtyNodesList = []; this._scalingFactor = screen.deviceXDPI / screen.logicalXDPI; this._filterRegex = ""; this._currentFilter = ""; this._copyStart = 0; this._copyEnd = 0; this._isContextMenuActive = false; this._isFilterEnabled = false; this._filterBox = document.createElement("input"); this._filterBox.classList.add("filterBox"); this._filterBox.id = "filterBox"; this._filterBox.type = "search"; this._filterBox.tabIndex = 1; this._filterBox.placeholder = Plugin.Resources.getString("TypeToFilterWatermark"); this._filterBox.setAttribute("aria-label", Plugin.Resources.getString("TypeToFilterWatermark")); this._filterBox.setAttribute("data-plugin-vs-tooltip", Plugin.Resources.getString("TypeToFilterWatermark")); this._filterNoResults = document.createElement("div"); this._filterNoResults.innerText = Plugin.Resources.getString("/Common/DOMExplorerComputedStylesNoResultsMessage"); this._filterNoResults.classList.add("noResults"); this._filterNoResults.style.display = "none"; this._filterBox.addEventListener("mouseup", function (e) { window.setImmediate(function () { _this.filterList(); }); }); this._filterBox.addEventListener("contextmenu", function (e) { return _this.handleContextMenu(e); }); this._filterBox.addEventListener("keyup", function (e) { var shiftKey = e.shiftKey && !e.ctrlKey && !e.altKey; if(e.keyCode === Common.KeyCodes.F10 && shiftKey) { _this.showContextMenu(0, 0); e.stopImmediatePropagation(); e.preventDefault(); return false; } _this.filterList(); }); this._fileListContainer = document.createElement("div"); this._fileListContainer.classList.add("fileListContainer"); this._fileListContainer.id = "fileListContainer"; container.appendChild(this._filterBox); container.appendChild(this._fileListContainer); container.appendChild(this._filterNoResults); this._treeView = new Common.ObjectView.ObjectTreeView(this._fileListContainer, function (item) { return _this.onListViewToggle(item); }, null, null, function (item, row, cell) { if(_this.isValidDocId(item.docId)) { item.additionalClass += FilePicker.openedDocumentClass; _this._onSelectCallback(item.docId); } window.setImmediate(function () { _this.hidePicker(); }); }); this._treeView.scrollPadding = 100; this._treeView.notifyToggleCallback = function () { _this.refreshViewWithCallback(); }; this._treeView.setFilter(function (item) { return _this.shouldIncludeItemCallback(item); }); this._container.addEventListener("keydown", function (e) { var target = e.target; var handled = false; var docId = null; var noKeys = !e.shiftKey && !e.ctrlKey && !e.altKey; if(target.classList.contains("listview-grid-row-selected")) { if((e.keyCode === Common.KeyCodes.ENTER || e.keyCode === Common.KeyCodes.SPACE) && noKeys) { var fileElement = target.querySelector(".fileItem[data-docid]"); if(fileElement) { docId = fileElement.getAttribute("data-docid"); } handled = true; } else if(e.keyCode === Common.KeyCodes.ARROW_UP && noKeys) { var selectedItem = _this._treeView.getSelectedItem(); var topItem = _this._treeView.getItemAt(0); if(selectedItem === topItem) { _this._filterBox.focus(); } handled = true; } } else if(target.classList.contains("filterBox")) { if(e.keyCode === Common.KeyCodes.ENTER && noKeys) { var selectedItem = _this._treeView.getSelectedItem() || _this._treeView.getItemAt(0); if(selectedItem) { docId = (selectedItem).docId; } handled = true; } else if(e.keyCode === Common.KeyCodes.ARROW_DOWN && noKeys) { var selectedItem = _this._treeView.getSelectedItem() || _this._treeView.getItemAt(0); if(selectedItem) { _this._treeView.selectItem(selectedItem, true); } handled = true; } } if(handled) { if(docId) { if(_this.isValidDocId(docId)) { var item = _this._fileItemsMap[docId]; _this._treeView.selectItem(item, true); item.additionalClass += FilePicker.openedDocumentClass; _this._onSelectCallback(item.docId); } _this.hidePicker(); } e.stopImmediatePropagation(); e.preventDefault(); return false; } return true; }); this._buttonElement.addEventListener("click", function (e) { if(_this._buttonElement.classList.contains("activated")) { _this.hidePicker(); } else { window.setImmediate(function () { return _this.showPicker(); }); } e.stopImmediatePropagation(); return true; }); this._buttonElement.addEventListener("keydown", function (e) { if(e.keyCode === Common.KeyCodes.ENTER || e.keyCode === Common.KeyCodes.SPACE || (e.keyCode === Common.KeyCodes.ARROW_DOWN && e.ctrlKey)) { window.setImmediate(function () { return _this.showPicker(); }); return false; } return true; }); this._buttonElement.addEventListener("DOMAttrModified", function (e) { if(!_this._ignoreReintrantExpand) { if(e.attrName === "aria-expanded") { if(e.newValue === "true") { _this.showPicker(); } else { _this.hidePicker(); } } } _this._ignoreReintrantExpand = false; }); this._focusOutListener = function (e) { if(e.target === document.activeElement && !_this._isContextMenuActive) { _this.hidePicker(); } }; this._documentClickListener = function (e) { if(e.target !== _this._container && !_this._container.contains(e.target) && e.target !== _this._buttonElement) { window.setImmediate(function () { _this.hidePicker(); }); } }; this._documentKeydownListener = function (e) { if(e.keyCode === Common.KeyCodes.ESCAPE) { _this.hidePicker(); e.stopImmediatePropagation(); e.preventDefault(); return false; } }; this._buttonElement.addEventListener("focusout", function (e) { e.stopPropagation(); return false; }); if(Plugin.F12) { Plugin.F12.addEventListener("browsershortcut", function (e) { return _this.onBrowserShortcut(e); }); Plugin.F12.addEventListener("keydown", function (e) { return _this.onBrowserShortcut(e); }); } window.addEventListener("resize", function () { _this.resizePicker(); }); } FilePicker.openedDocumentClass = " openedDocument"; FilePicker.DYNAMIC_DOC_ID_SUFFIX = "-dynamic"; FilePicker.MIN_WIDTH = 250; FilePicker.MIN_HEIGHT = 30; FilePicker.BOTTOM_MARGIN = 10; FilePicker.RIGHT_MARGIN = 20; FilePicker.BOTTOM_PADDING = 10; FilePicker.RIGHT_PADDING = 10; FilePicker.INNER_PADDING = 2; FilePicker.SCROLLBAR_PADDING = 15; FilePicker.FILTERBOX_HEIGHT = 33; FilePicker.FILTERBOX_WIDTH_PADDING = 16; FilePicker.whiteSpaceRegEx = /^[\s]*$/g; FilePicker.searchPartsSplitRegEx = /[\s\"\']+/g; FilePicker.filterInputEscapeRegEx = /([.+?^=!:${}()|\[\]\/\\])|(\*)/g; Object.defineProperty(FilePicker.prototype, "scaledBottomPadding", { get: function () { return this._scalingFactor * FilePicker.BOTTOM_PADDING; }, enumerable: true, configurable: true }); Object.defineProperty(FilePicker.prototype, "scaledRightPadding", { get: function () { return this._scalingFactor * FilePicker.RIGHT_PADDING; }, enumerable: true, configurable: true }); Object.defineProperty(FilePicker.prototype, "scaledScrollbarPadding", { get: function () { return this._scalingFactor * FilePicker.SCROLLBAR_PADDING; }, enumerable: true, configurable: true }); Object.defineProperty(FilePicker.prototype, "scaledInnerPadding", { get: function () { return this._scalingFactor * FilePicker.INNER_PADDING; }, enumerable: true, configurable: true }); FilePicker.prototype.documentAdded = function (source) { var fileItem = new Debugger.FilePickerItem(source); if(source.isDynamicCode) { var rootDocId = this.getRootDocId(source); var rootNode = this._rootNodesMap[rootDocId]; if(rootNode) { if(!rootNode.dynamicDocumentsNode) { rootNode.dynamicDocumentsNode = new Debugger.FilePickerItem(new Debugger.Source(undefined, rootNode.docId + "-dynamic", rootDocId, false, Plugin.Resources.getString("FilePickerDynamicNode"), Debugger.FilePickerItem.DYNAMIC_SCRIPTS, 0, true, [])); } rootNode.dynamicDocumentsNode.addChild(fileItem); this.addToDirtyNodesList(rootNode.dynamicDocumentsNode); } else { if(!this._dynamicDocumentsNode) { this._dynamicDocumentsNode = new Debugger.FilePickerItem(new Debugger.Source(undefined, "IE-dynamic", rootDocId, false, Plugin.Resources.getString("FilePickerDynamicNode"), Debugger.FilePickerItem.DYNAMIC_SCRIPTS, 0, true, [])); this._rootNodesMap[rootDocId] = this._dynamicDocumentsNode; this._treeView.addItems([ this._dynamicDocumentsNode ]); } this._dynamicDocumentsNode.addChild(fileItem); this.addToDirtyNodesList(this._dynamicDocumentsNode); } } else { if(this._fileItemsMap.hasOwnProperty(source.parentDocId)) { var parentItem = this._fileItemsMap[source.parentDocId]; parentItem.addChild(fileItem); this.addToDirtyNodesList(parentItem); } else { this._rootNodesMap[source.docId] = fileItem; this._treeView.addItems([ fileItem ]); } } if(this._fileItemsMap.hasOwnProperty(source.docId)) { var fileItem = this._fileItemsMap[source.docId]; this._treeView.removeItem(fileItem); } this._fileItemsMap[source.docId] = fileItem; }; FilePicker.prototype.documentRemoved = function (docId) { if(this._fileItemsMap.hasOwnProperty(docId)) { var fileItem = this._fileItemsMap[docId]; if(this._rootNodesMap.hasOwnProperty(docId)) { delete this._rootNodesMap[docId]; } delete this._fileItemsMap[docId]; if(fileItem.source.isDynamicCode) { var rootDocId = this.getRootDocId(fileItem.source); var dynamicNode = this._rootNodesMap[rootDocId] ? this._rootNodesMap[rootDocId].dynamicDocumentsNode : this._dynamicDocumentsNode; if(dynamicNode) { dynamicNode.removeChild(fileItem); this.addToDirtyNodesList(dynamicNode); if(!dynamicNode.hasChildren) { if(this._rootNodesMap[rootDocId]) { this._rootNodesMap[rootDocId].removeChild(dynamicNode); } this._treeView.removeItem(dynamicNode); dynamicNode = null; } } } else { if(this._fileItemsMap.hasOwnProperty(fileItem.source.parentDocId)) { var parentItem = this._fileItemsMap[fileItem.source.parentDocId]; if(parentItem) { parentItem.removeChild(fileItem); this.addToDirtyNodesList(parentItem); } } } this._treeView.removeItem(fileItem); } }; FilePicker.prototype.documentOpened = function (docId) { if(this._fileItemsMap.hasOwnProperty(docId)) { this._fileItemsMap[docId].additionalClass += FilePicker.openedDocumentClass; } }; FilePicker.prototype.documentClosed = function (docId) { var fileItem = this._fileItemsMap[docId]; if(fileItem) { fileItem.additionalClass = "listview-grid-cell-clicksection"; } this.restoreList(); this._treeView.refresh(); }; FilePicker.prototype.documentUpdated = function (docId) { var fileItem = this._fileItemsMap[docId]; if(fileItem) { fileItem.refresh(); } this.restoreList(); this._treeView.refresh(); }; Object.defineProperty(FilePicker.prototype, "onSelectCallback", { set: function (v) { this._onSelectCallback = v; }, enumerable: true, configurable: true }); FilePicker.prototype.showPicker = function () { if(!this._pickerVisible) { this._container.style.display = "block"; this._container.style.zIndex = "1000"; this._buttonElement.classList.add("activated"); this._ignoreReintrantExpand = true; this._buttonElement.setAttribute("aria-expanded", "true"); if(this._isFilterEnabled) { this.setFilter(this._filterBox.value); } else { for(var rootItem in this._rootNodesMap) { this._treeView.setRowState(this._treeView.getIndex(this._rootNodesMap[rootItem]), Common.ObjectView.ObjectTreeView.EXPAND_ROW); } this.refreshViewWithCallback(); this._filterBox.focus(); } var selectedItem = this._treeView.getSelectedItem() || this._treeView.getItemAt(0); if(selectedItem) { this._treeView.selectItem(selectedItem, false); } this._pickerVisible = true; document.addEventListener("focusout", this._focusOutListener); document.addEventListener("mousedown", this._documentClickListener); document.addEventListener("keydown", this._documentKeydownListener); } else { this._filterBox.focus(); } }; FilePicker.prototype.hidePicker = function () { var _this = this; if(this._pickerVisible) { this.restoreList(); this._dirtyNodesList.forEach(function (item) { _this._treeView.setRowState(_this._treeView.getIndex(item), Common.ObjectView.ObjectTreeView.COLLAPSE_ROW); }); this._dirtyNodesList = []; this._buttonElement.classList.remove("activated"); this._ignoreReintrantExpand = true; this._buttonElement.setAttribute("aria-expanded", "false"); this._container.style.display = "none"; this._container.style.zIndex = "-1000"; this._pickerVisible = false; document.removeEventListener("focusout", this._focusOutListener); document.removeEventListener("mousedown", this._documentClickListener); document.removeEventListener("keydown", this._documentKeydownListener); } }; FilePicker.prototype.resizePicker = function () { var editorDimensions = this._debuggerShell.getEditorDimensions(); var maxViewPortHeight = editorDimensions.height - FilePicker.BOTTOM_MARGIN; var maxViewPortWidth = editorDimensions.width - FilePicker.RIGHT_MARGIN; var totalRowsHeight = this.getRowHeight() * this._treeView.getItemCount(); var pickerHeight = Math.min(maxViewPortHeight, totalRowsHeight + this.scaledBottomPadding + FilePicker.FILTERBOX_HEIGHT); var pickerWidth = this.getMaxFileItemWidth() + this.scaledRightPadding + this.scaledInnerPadding; var widthPadding = pickerHeight < this.getRowHeight() * this._treeView.getItemCount() ? this.scaledScrollbarPadding : 0; var heightPadding = pickerWidth > maxViewPortWidth ? this.scaledScrollbarPadding : 0; var finalWidth = Math.max(FilePicker.MIN_WIDTH, Math.min(pickerWidth + widthPadding, maxViewPortWidth)); var finalHeight = Math.max(FilePicker.MIN_HEIGHT + FilePicker.FILTERBOX_HEIGHT, Math.min(pickerHeight + heightPadding, maxViewPortHeight)); this._fileListContainer.style.height = finalHeight - FilePicker.FILTERBOX_HEIGHT + "px"; this._fileListContainer.style.width = finalWidth - this.scaledInnerPadding + "px"; this._filterBox.style.width = finalWidth - FilePicker.FILTERBOX_WIDTH_PADDING + "px"; this._container.style.height = finalHeight + "px"; this._container.style.width = finalWidth + "px"; var fileItems = this._container.querySelectorAll(".filePickerMenu .listview-grid-row"); if(fileItems.length < 1) { this._filterNoResults.style.display = "block"; } else { this._filterNoResults.style.display = "none"; } }; FilePicker.prototype.getTotalDocuments = function () { return Object.getOwnPropertyNames(this._fileItemsMap).length; }; FilePicker.prototype.getRootItems = function () { var rootItems = []; for(var index in this._fileItemsMap) { var item = this._fileItemsMap[index]; if(!this._fileItemsMap.hasOwnProperty(item.source.parentDocId)) { rootItems.push(item); } } return rootItems; }; FilePicker.prototype.setFilter = function (text) { this._filterBox.value = text; this.filterList(); this._filterBox.focus(); }; FilePicker.prototype.clearFilter = function () { this._filterBox.value = ""; this.filterList(); this._filterBox.focus(); }; FilePicker.prototype.restoreList = function () { var _this = this; if(this._isFilterEnabled) { this._filterRegex = ""; this._currentFilter = ""; this._treeView.setFilter(function (item) { return _this.shouldIncludeItemCallback(item); }); for(var rootItem in this._rootNodesMap) { this._treeView.collapseAllItems(this._treeView.getIndex(this._rootNodesMap[rootItem])); } } }; FilePicker.prototype.onBrowserShortcut = function (e) { var _this = this; if(e.ctrlKey && !e.altKey && !e.shiftKey && e.keyCode === Common.KeyCodes.O) { window.setImmediate(function () { return _this.showPicker(); }); return false; } return true; }; FilePicker.prototype.onListViewToggle = function (item) { var _this = this; if(item.hasChildren) { item.getChildren(null, function (children) { _this._treeView.addItems(children, item); }); } }; FilePicker.prototype.getRootDocId = function (source) { while(this._fileItemsMap.hasOwnProperty(source.parentDocId)) { source = this._fileItemsMap[source.parentDocId].source; } return source.docId; }; FilePicker.prototype.addToDirtyNodesList = function (item) { if(this._dirtyNodesList.indexOf(item) === -1) { this._dirtyNodesList.push(item); } }; FilePicker.prototype.isValidDocId = function (docId) { return docId.indexOf(FilePicker.DYNAMIC_DOC_ID_SUFFIX) === -1; }; FilePicker.prototype.getMaxFileItemWidth = function () { var fileItems = this._container.querySelectorAll(".filePickerMenu .listview-grid-row"); var maxWidth = 0; for(var index = 0; index < fileItems.length; index++) { var rowItem = fileItems[index]; var childWidth = 0; for(var childIndex = 0; childIndex < rowItem.children.length; childIndex++) { childWidth += rowItem.children[childIndex].clientWidth; } maxWidth = Math.max(childWidth, maxWidth); } return maxWidth; }; FilePicker.prototype.getRowHeight = function () { var rowItem = this._container.querySelector(".filePickerMenu .listview-grid-row"); if(rowItem) { return rowItem.getBoundingClientRect().height; } return 0; }; FilePicker.prototype.refreshViewWithCallback = function () { var _this = this; this._fileListContainer.classList.add("refresh"); this._treeView.postRenderCallback = function () { _this.resizePicker(); _this._fileListContainer.classList.remove("refresh"); }; this._treeView.refresh(); }; FilePicker.prototype.shouldIncludeItemCallback = function (item) { return this._isFilterEnabled ? (item.displayName.match(new RegExp(this._filterRegex, "gi")) && this.isValidDocId(item.docId)) : true; }; FilePicker.prototype.filterList = function () { var _this = this; if(this._filterBox.value !== this._currentFilter) { if(this._filterBox.value.match(FilePicker.whiteSpaceRegEx)) { this._isFilterEnabled = false; this._fileListContainer.classList.remove("flatView"); this._treeView.hasIndent = true; this._filterBox.value = ""; } else { this._isFilterEnabled = true; this._fileListContainer.classList.add("flatView"); this._treeView.hasIndent = false; for(var rootItem in this._rootNodesMap) { this._treeView.expandAllItems(this._treeView.getIndex(this._rootNodesMap[rootItem]), function (item) { return _this.filterDynamicItems(item); }); } this._filterRegex = this._filterBox.value.replace(FilePicker.filterInputEscapeRegEx, function (match) { var newValue; if(match === "\*") { newValue = ".*"; } else { newValue = "\\" + match; } return newValue; }); var searchParts = this._filterRegex.split(FilePicker.searchPartsSplitRegEx); if(searchParts.length > 0) { this._filterRegex = ""; for(var i = 0; i < searchParts.length; i++) { if(searchParts[i] !== "") { this._filterRegex += "(?=.*" + searchParts[i] + ")"; } } this._filterRegex += ".*"; } } this._currentFilter = this._filterBox.value; this._treeView.setFilter(function (item) { return _this.shouldIncludeItemCallback(item); }); if(!this._isFilterEnabled) { for(var rootItem in this._rootNodesMap) { this._treeView.collapseAllItems(this._treeView.getIndex(this._rootNodesMap[rootItem])); } for(var rootItem in this._rootNodesMap) { this._treeView.setRowState(this._treeView.getIndex(this._rootNodesMap[rootItem]), Common.ObjectView.ObjectTreeView.EXPAND_ROW); } } this.refreshList(); } }; FilePicker.prototype.filterDynamicItems = function (item) { return !this.isValidDocId(item.docId); }; FilePicker.prototype.getSortString = function (item) { return item.displayName; }; FilePicker.prototype.refreshList = function () { if(this._isFilterEnabled) { this._treeView.sortFilteredList(this.getSortString); } this.refreshViewWithCallback(); var selectedItem = this._treeView.getItemAt(0); if(selectedItem) { this._treeView.selectItem(selectedItem, false); } }; FilePicker.prototype.showContextMenu = function (clientX, clientY) { var _this = this; var x = clientX; var y = clientY; this._copyStart = this._filterBox.selectionStart; this._copyEnd = this._filterBox.selectionEnd; if(x <= 0 || y <= 0) { var range = this._filterBox.createTextRange(); range.move("character", this._copyStart); x = range.offsetLeft; y = range.offsetTop; } var _menuItems = [ { id: "menuFilePickerCut", type: Plugin.ContextMenu.MenuItemType.command, label: Plugin.Resources.getString("/Common/CutMenuText"), accessKey: Plugin.Resources.getString("/Common/AccessKeyCtrlX") }, { id: "menuFilePickerCopy", type: Plugin.ContextMenu.MenuItemType.command, label: Plugin.Resources.getString("/Common/CopyMenuText"), accessKey: Plugin.Resources.getString("/Common/AccessKeyCtrlC") }, { id: "menuFilePickerPaste", type: Plugin.ContextMenu.MenuItemType.command, label: Plugin.Resources.getString("/Common/PasteMenuText"), accessKey: Plugin.Resources.getString("/Common/AccessKeyCtrlV") } ]; var contextMenu = Plugin.ContextMenu.create(_menuItems, null, null, null, function (menuId, menuItem) { return _this.invokeContextMenu(menuId, menuItem); }); contextMenu.addEventListener("dismiss", function () { contextMenu.dispose(); _this._isContextMenuActive = false; }); contextMenu.attach(this._filterBox); this._isContextMenuActive = true; contextMenu.show(x, y); }; FilePicker.prototype.invokeContextMenu = function (menuId, menuItem) { var selectedText = this._filterBox.value.substring(this._copyStart, this._copyEnd); var pasteText = clipboardData.getData("Text"); switch(menuItem.id) { case "menuFilePickerCut": clipboardData.setData("Text", selectedText); this._filterBox.value = this._filterBox.value.substring(0, this._copyStart) + this._filterBox.value.substring(this._copyEnd); this.filterList(); this._filterBox.focus(); this._filterBox.setSelectionRange(this._copyStart, this._copyStart); break; case "menuFilePickerCopy": clipboardData.setData("Text", selectedText); this._filterBox.focus(); break; case "menuFilePickerPaste": if(pasteText) { var range = this._filterBox.createTextRange(); range.move("character", this._copyStart); range.moveEnd("character", this._copyEnd - this._copyStart); range.text = pasteText; this.filterList(); this._filterBox.focus(); } break; } }; FilePicker.prototype.handleContextMenu = function (event) { this.showContextMenu(event.clientX, event.clientY); event.stopImmediatePropagation(); event.preventDefault(); return false; }; return FilePicker; })(); Debugger.FilePicker = FilePicker; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=FilePicker.js.map // searchProvider.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var SearchProvider = (function () { function SearchProvider(debuggerManager) { var _this = this; this._lastMatchIndex = -1; this._debuggerManager = debuggerManager; this._matchRanges = []; this._matchRangeDocId = ""; this._decorationIds = []; this._docIdForDecorations = null; this._searchBoxBorder = document.getElementById("searchBoxBorder"); this._searchBox = document.getElementById("searchbox"); this._searchBox.setAttribute("data-plugin-vs-tooltip", Plugin.Resources.getString("SearchBoxTooltip")); this._searchBox.setAttribute("placeholder", Plugin.Resources.getString("SearchBoxPlaceholder")); this._searchBox.setAttribute("aria-label", Plugin.Resources.getString("SearchBoxPlaceholder")); this._searchPreviousButton = document.getElementById("searchPreviousResult"); this._searchPreviousButton.setAttribute("data-plugin-vs-tooltip", Plugin.Resources.getString("/Common/SearchPrevText")); this._searchPreviousButton.setAttribute("aria-label", Plugin.Resources.getString("/Common/SearchPrevText")); this._searchPreviousButton.addEventListener("click", function (e) { _this.findNextMatch(false); }); this._searchPreviousButton.addEventListener("keydown", function (e) { if(e.keyCode === Common.KeyCodes.ENTER || e.keyCode === Common.KeyCodes.SPACE) { _this.findNextMatch(false); return false; } return true; }); this._searchNextButton = document.getElementById("searchNextResult"); this._searchNextButton.setAttribute("data-plugin-vs-tooltip", Plugin.Resources.getString("/Common/SearchNextText")); this._searchNextButton.setAttribute("aria-label", Plugin.Resources.getString("/Common/SearchNextText")); this._searchNextButton.addEventListener("click", function (e) { _this.findNextMatch(true); }); this._searchNextButton.addEventListener("keydown", function (e) { if(e.keyCode === Common.KeyCodes.ENTER || e.keyCode === Common.KeyCodes.SPACE) { _this.findNextMatch(true); return false; } return true; }); this.hideNextPreviousButtons(); this._searchBox.addEventListener("input", function (e) { _this._lastMatchIndex = -1; _this.findAndHighlightMatches(); if(_this._searchBox.value === "") { _this.hideNextPreviousButtons(); } }); this._searchBox.addEventListener("keydown", function (e) { if(e.keyCode === Common.KeyCodes.ENTER && !e.altKey && !e.ctrlKey) { if(e.shiftKey) { _this.findNextMatch(false); } else { _this.findNextMatch(true); } } else if(e.keyCode === Common.KeyCodes.ESCAPE) { _this._searchBox.value = ""; _this.findAndHighlightMatches(); _this.hideNextPreviousButtons(); } }); document.addEventListener("keydown", function (e) { return _this.onKeyDown(e); }); if(Plugin.F12) { Plugin.F12.addEventListener("keydown", function (e) { return _this.onKeyDown(e); }); } } Object.defineProperty(SearchProvider.prototype, "_editorWindow", { get: function () { return this._debuggerManager.editorWindow; }, enumerable: true, configurable: true }); SearchProvider._resultNotFoundClass = "BPT-SearchBox-NoResult"; SearchProvider._searchTermDecorationClass = "searchTermDecoration"; Object.defineProperty(SearchProvider.prototype, "searchText", { get: function () { return this._searchBox.value; }, set: function (value) { this._searchBox.value = value; }, enumerable: true, configurable: true }); SearchProvider.prototype.focusSearchBox = function (text) { this._searchBox.focus(); if(text) { this._searchBox.value = text; } this._searchBox.setSelectionRange(0, this._searchBox.value.length); }; SearchProvider.prototype.findAndHighlightMatches = function () { if(this._editorWindow.isDocumentOpen(this._editorWindow.currentDocId)) { this.cleanupOldSearchResults(); this._searchBoxBorder.classList.remove(SearchProvider._resultNotFoundClass); if(this._searchBox.value !== "") { this.showNextPreviousButtons(); } if(this._searchBox.value) { this._matchRanges = this._editorWindow.getLocalMatches(this._searchBox.value); this._matchRangeDocId = this._editorWindow.currentDocId; this._decorationIds = this._editorWindow.addDecorations(this._matchRanges, SearchProvider._searchTermDecorationClass, Plugin.Theme.getValue("plugin-editor-scrollbar-marker-search-result-color")); this._docIdForDecorations = this._editorWindow.currentDocId; } } }; SearchProvider.prototype.findNextMatch = function (forward) { var _this = this; var focusInSearchBox = document.activeElement === this._searchBox; this._lastMatchIndex = forward ? this._lastMatchIndex + 1 : this._lastMatchIndex - 1; var match = this._matchRanges[this._lastMatchIndex]; if(match && this._matchRangeDocId === this._editorWindow.currentDocId) { this._editorWindow.selectRange(match); if(focusInSearchBox) { this._searchBox.focus(); } return Plugin.Promise.wrap(match); } this._lastMatchIndex = -1; return new Plugin.Promise(function (completed, error) { var remainingDocIds = _this.getOrderedDocIdsForSearch(forward); if(!_this._isSearching && _this._searchBox.value) { _this._isSearching = true; _this._searchBox.disabled = true; _this._debuggerManager.getNextDocIdContainingMatch(_this._searchBox.value, remainingDocIds).then(function (docId) { if(docId) { _this._editorWindow.navigateTo(new Debugger.SourceLocation(docId, 1, 1)).then(function () { _this._matchRanges = _this._editorWindow.getLocalMatches(_this._searchBox.value); _this._matchRangeDocId = _this._editorWindow.currentDocId; _this._lastMatchIndex = forward ? 0 : _this._matchRanges.length - 1; var range = _this._matchRanges[_this._lastMatchIndex]; if(range) { _this._editorWindow.selectRange(range); } setTimeout(function () { _this._isSearching = false; _this._searchBox.disabled = false; if(focusInSearchBox) { _this._searchBox.focus(); } }); completed(range); }); } else { _this._isSearching = false; _this._searchBox.disabled = false; _this._searchBoxBorder.classList.add(SearchProvider._resultNotFoundClass); _this.hideNextPreviousButtons(); _this._searchBox.focus(); completed(null); } }); } }); }; SearchProvider.prototype.updateSearchTextFromSelection = function () { var selection = this._debuggerManager.editorWindow.getEditorSelection(); var text = this._debuggerManager.editorWindow.getEditorRangeContents(selection); if(text) { var trimIndex = text.search(/[\n\r]/g); if(trimIndex > -1) { text = text.substring(0, trimIndex); } if(!this.searchText || text.toLocaleLowerCase() !== this.searchText.toLocaleLowerCase()) { this.cleanupOldSearchResults(); this.searchText = text; this._lastMatchIndex = -1; this.findAndHighlightMatches(); return true; } } return false; }; SearchProvider.prototype.onKeyDown = function (e) { var handled = false; if(e.keyCode === Common.KeyCodes.F3 && !e.ctrlKey && !e.altKey) { this.findNextMatch(!e.shiftKey); handled = true; } else if(e.keyCode === Common.KeyCodes.F3 && e.ctrlKey && !e.altKey) { this.updateSearchTextFromSelection(); this.findNextMatch(!e.shiftKey); handled = true; } else if(e.keyCode === Common.KeyCodes.F && e.ctrlKey && !e.altKey && !e.shiftKey) { this.updateSearchTextFromSelection(); this.focusSearchBox(); handled = true; } if(handled) { e.preventDefault(); e.stopImmediatePropagation(); return false; } return true; }; SearchProvider.prototype.showNextPreviousButtons = function () { this._searchPreviousButton.style.display = "block"; this._searchNextButton.style.display = "block"; }; SearchProvider.prototype.cleanupOldSearchResults = function () { this._matchRanges = []; this._matchRangeDocId = ""; this._editorWindow.removeDecorations(this._decorationIds, this._docIdForDecorations); this._decorationIds = []; this._docIdForDecorations = null; }; SearchProvider.prototype.getOrderedDocIdsForSearch = function (forward) { var laterResults = []; var results = []; var currentDocIdPassed = false; var openedSources = this._editorWindow.getOpenedSources(); for(var i = 0; i < openedSources.length; i++) { var docId = openedSources[i].docId; if(docId === this._editorWindow.currentDocId) { currentDocIdPassed = true; } else { if(currentDocIdPassed) { results.push(docId); } else { laterResults.push(docId); } } } var availableSources = this._editorWindow.getAvailableSources(); for(var i in availableSources) { if(!availableSources[i]) { continue; } var docId = availableSources[i].docId; if(results.indexOf(docId) === -1 && laterResults.indexOf(docId) === -1) { if(docId === this._editorWindow.currentDocId) { currentDocIdPassed = true; } else { if(currentDocIdPassed) { results.push(docId); } else { laterResults.push(docId); } } } } if(forward) { results = results.concat(laterResults); results.push(this._editorWindow.currentDocId); } else { results = results.concat(laterResults).reverse(); results.push(this._editorWindow.currentDocId); } return results; }; SearchProvider.prototype.hideNextPreviousButtons = function () { this._searchPreviousButton.style.display = "none"; this._searchNextButton.style.display = "none"; }; return SearchProvider; })(); Debugger.SearchProvider = SearchProvider; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=searchProvider.js.map // SourceTable.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var SourceTable = (function () { function SourceTable(docIdPrefix) { Tools.Utility.Assert.IsTrue(typeof docIdPrefix === "string" && docIdPrefix.length > 0, "Invalid docIdPrefix value."); this._docIdPrefix = docIdPrefix; this._sources = []; this._sourceTexts = []; this._urlToDocIdMap = new Debugger.StringMultiMap(); } SourceTable._fileProtocolPrefix = "file://"; Object.defineProperty(SourceTable.prototype, "docIdPrefix", { get: function () { return this._docIdPrefix; }, enumerable: true, configurable: true }); SourceTable.prototype.add = function (source) { this._sources[source.id] = source; var url = source.url; if(url) { if(SourceTable.isFileProtocol(url)) { url = url.toLowerCase(); } this._urlToDocIdMap.add(url, source.docId); } }; SourceTable.prototype.contains = function (docId) { var id = this.parseId(docId); return SourceTable.isNumber(id) && typeof this._sources[id] !== "undefined"; }; SourceTable.prototype.documentUrlChanged = function (docId, oldUrl, newUrl) { if(newUrl) { Tools.Utility.Assert.IsTrue(docId && oldUrl && oldUrl !== newUrl, "documentUrlChanged failed to occur because parameters were undefined or identical"); this._urlToDocIdMap.remove(oldUrl, docId); this._urlToDocIdMap.add(newUrl, docId); } }; SourceTable.prototype.getFirstDocId = function (url) { if(url) { if(SourceTable.isFileProtocol(url)) { url = url.toLowerCase(); } return this._urlToDocIdMap.getFirstValue(url); } return undefined; }; SourceTable.prototype.getSource = function (docId) { var id = this.parseId(docId); if(SourceTable.isNumber(id)) { return this._sources[id]; } return undefined; }; SourceTable.prototype.getSources = function () { var sources = []; this._sources.forEach(function (value, index, array) { sources.push(value); }); return sources; }; SourceTable.prototype.getSourceText = function (docId) { var id = this.parseId(docId); if(SourceTable.isNumber(id)) { return this._sourceTexts[id]; } return undefined; }; SourceTable.prototype.hasDocIdPrefix = function (docId) { return docId && docId.substring(0, this._docIdPrefix.length) === this._docIdPrefix; }; SourceTable.prototype.isValidDocId = function (docId) { var id = this.parseId(docId); return SourceTable.isNumber(id); }; SourceTable.prototype.parseId = function (docId) { if(typeof docId !== "string") { return undefined; } if(this.hasDocIdPrefix(docId)) { return parseInt(docId.substring(this._docIdPrefix.length)); } return undefined; }; SourceTable.prototype.remove = function (docId) { var source = this.getSource(docId); if(source) { if(source.url) { var url = source.url; if(SourceTable.isFileProtocol(url)) { url = url.toLowerCase(); } this._urlToDocIdMap.remove(url, docId); } delete this._sources[source.id]; } }; SourceTable.prototype.removeSourceText = function (docId) { var id = this.parseId(docId); if(SourceTable.isNumber(id)) { delete this._sourceTexts[id]; } }; SourceTable.prototype.setSourceText = function (docId, text) { var id = this.parseId(docId); if(SourceTable.isNumber(id)) { this._sourceTexts[id] = text; } }; SourceTable.isFileProtocol = function isFileProtocol(url) { return url.substring(0, SourceTable._fileProtocolPrefix.length).toLowerCase() === SourceTable._fileProtocolPrefix; }; SourceTable.isNumber = function isNumber(value) { return typeof value === "number" && !isNaN(value); }; return SourceTable; })(); Debugger.SourceTable = SourceTable; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=SourceTable.js.map // SourceTableFederator.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var SourceTableFederator = (function () { function SourceTableFederator() { this._mappedTable = new Debugger.SourceTable("DOC"); this._nextUnmappedDocId = 0; this._unmappedTable = new Debugger.SourceTable("UNMAPPED"); } SourceTableFederator.prototype.add = function (source) { if(this._mappedTable.hasDocIdPrefix(source.docId)) { this._mappedTable.add(source); } else if(this._unmappedTable.hasDocIdPrefix(source.docId)) { this._unmappedTable.add(source); } }; SourceTableFederator.prototype.contains = function (docId) { if(this._mappedTable.hasDocIdPrefix(docId)) { return this._mappedTable.contains(docId); } if(this._unmappedTable.hasDocIdPrefix(docId)) { return this._unmappedTable.contains(docId); } return false; }; SourceTableFederator.prototype.createUnmappedSource = function (url, mimeType, length, isDynamicCode) { var unmappedDocId = this._nextUnmappedDocId++; return new Debugger.Source(unmappedDocId, this._unmappedTable.docIdPrefix + unmappedDocId, undefined, false, url, mimeType, length, isDynamicCode, undefined); }; SourceTableFederator.prototype.documentUrlChanged = function (docId, oldUrl, newUrl) { if(this._mappedTable.hasDocIdPrefix(docId)) { this._mappedTable.documentUrlChanged(docId, oldUrl, newUrl); } else if(this._unmappedTable.hasDocIdPrefix(docId)) { this._unmappedTable.documentUrlChanged(docId, oldUrl, newUrl); } }; SourceTableFederator.prototype.getFirstDocId = function (url) { return this._mappedTable.getFirstDocId(url) || this._unmappedTable.getFirstDocId(url); }; SourceTableFederator.prototype.getSource = function (docId) { if(this._mappedTable.hasDocIdPrefix(docId)) { return this._mappedTable.getSource(docId); } if(this._unmappedTable.hasDocIdPrefix(docId)) { return this._unmappedTable.getSource(docId); } return undefined; }; SourceTableFederator.prototype.getSources = function () { var mappedSources = this._mappedTable.getSources(); var unmappedSources = this._unmappedTable.getSources(); return mappedSources.concat(unmappedSources); }; SourceTableFederator.prototype.getSourceText = function (docId) { if(this._mappedTable.hasDocIdPrefix(docId)) { return this._mappedTable.getSourceText(docId); } if(this._unmappedTable.hasDocIdPrefix(docId)) { return this._unmappedTable.getSourceText(docId); } return undefined; }; SourceTableFederator.prototype.isUnmappedSource = function (docId) { return this._unmappedTable.hasDocIdPrefix(docId); }; SourceTableFederator.prototype.isValidDocId = function (docId) { if(this._mappedTable.hasDocIdPrefix(docId)) { return this._mappedTable.isValidDocId(docId); } if(this._unmappedTable.hasDocIdPrefix(docId)) { return this._unmappedTable.isValidDocId(docId); } return false; }; SourceTableFederator.prototype.remove = function (docId) { if(this._mappedTable.hasDocIdPrefix(docId)) { this._mappedTable.remove(docId); } else if(this._unmappedTable.hasDocIdPrefix(docId)) { this._unmappedTable.remove(docId); } }; SourceTableFederator.prototype.removeSourceText = function (docId) { if(this._mappedTable.hasDocIdPrefix(docId)) { this._mappedTable.removeSourceText(docId); } else if(this._unmappedTable.hasDocIdPrefix(docId)) { this._unmappedTable.removeSourceText(docId); } }; SourceTableFederator.prototype.setSourceText = function (docId, text) { if(this._mappedTable.hasDocIdPrefix(docId)) { this._mappedTable.setSourceText(docId, text); } else if(this._unmappedTable.hasDocIdPrefix(docId)) { this._unmappedTable.setSourceText(docId, text); } }; SourceTableFederator.prototype.updateDocId = function (source, newDocId) { if(this._unmappedTable.hasDocIdPrefix(source.docId) && this._mappedTable.hasDocIdPrefix(newDocId)) { var sourceText = this._unmappedTable.getSourceText(source.docId); this._unmappedTable.remove(source.docId); this._unmappedTable.removeSourceText(source.docId); var newId = this._mappedTable.parseId(newDocId); source.id = newId; source.docId = newDocId; this._mappedTable.add(source); if(typeof sourceText === "string") { this._mappedTable.setSourceText(newDocId, sourceText); } } }; return SourceTableFederator; })(); Debugger.SourceTableFederator = SourceTableFederator; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=SourceTableFederator.js.map // IFormatService.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { (function (FormatService) { (function (SourceType) { SourceType._map = []; SourceType._map[0] = "Original"; SourceType.Original = 0; SourceType._map[1] = "Sourcemap"; SourceType.Sourcemap = 1; SourceType._map[2] = "PrettyPrint"; SourceType.PrettyPrint = 2; })(FormatService.SourceType || (FormatService.SourceType = {})); var SourceType = FormatService.SourceType; })(Debugger.FormatService || (Debugger.FormatService = {})); var FormatService = Debugger.FormatService; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=IFormatService.js.map // FormatWorker.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { (function (FormatService) { "use strict"; var FormatWorker = (function () { function FormatWorker(msg) { this._source = msg.source; this._mimeType = msg.mimeType; this._generatedSourceSpans = []; this._canBePrettyPrinted = false; this._error = false; this._firstCompilerError = ""; } Object.defineProperty(FormatWorker.prototype, "formattedText", { get: function () { return this._formattedText; }, enumerable: true, configurable: true }); Object.defineProperty(FormatWorker.prototype, "canBePrettyPrinted", { get: function () { return this._canBePrettyPrinted; }, enumerable: true, configurable: true }); Object.defineProperty(FormatWorker.prototype, "generatedSourceSpans", { get: function () { return this._generatedSourceSpans; }, enumerable: true, configurable: true }); Object.defineProperty(FormatWorker.prototype, "error", { get: function () { return this._error; }, enumerable: true, configurable: true }); Object.defineProperty(FormatWorker.prototype, "firstCompilerError", { get: function () { return this._firstCompilerError; }, enumerable: true, configurable: true }); FormatWorker.prototype.getNumLines = function (source) { var count = 0; for(var i = 0; i < source.length; i++) { if(source[i] === '\n') { ++count; } } return count; }; FormatWorker.prototype.parseSource = function (source, mimeType) { if(FormatService.HTMLScriptFinder.isSupportedScript(mimeType)) { this._generatedSourceSpans.push(new FormatService.SourceSpanBuilder(0, source.length, true)); this._canBePrettyPrinted = true; } else if(mimeType === "text/html") { try { var htmlScriptFinder = new FormatService.HTMLScriptFinder(source); if(htmlScriptFinder.sourceSpans.length > 1) { this._generatedSourceSpans = htmlScriptFinder.sourceSpans; this._canBePrettyPrinted = true; } } catch (ex) { } } }; FormatWorker.prototype.formatJavaScript = function (source) { if(source.length === 0) { return; } Tools.Utility.Assert.IsTrue(this._canBePrettyPrinted); Tools.Utility.Assert.IsTrue(this._generatedSourceSpans.length > 0); var generatedLineOffset = 0; var sourceSpanIndex = 0; this._generatedSourceSpans[0].generatedLineOffset = generatedLineOffset; this._formattedText = ""; var TypeScriptServices = require("vs/languages/typescript/lib/typescriptServices"); var TypeScript = TypeScriptServices.TypeScript; while(true) { var sourceSpan = this._generatedSourceSpans[sourceSpanIndex]; if(!sourceSpan.isScript) { sourceSpan.generatedLineOffset += generatedLineOffset; var htmlSource = source.slice(sourceSpan.start, sourceSpan.end + 1); generatedLineOffset += sourceSpan.calculateLineOffsets(htmlSource); this._formattedText += htmlSource; if(++sourceSpanIndex < this._generatedSourceSpans.length) { this._formattedText += "\n"; ++generatedLineOffset; } } if(sourceSpanIndex === this._generatedSourceSpans.length) { return; } sourceSpan = this._generatedSourceSpans[sourceSpanIndex]; Tools.Utility.Assert.IsTrue(sourceSpan.isScript); sourceSpan.generatedLineOffset += generatedLineOffset; var outfile = { source: "", Write: function (s) { this.source += s; }, WriteLine: function (s) { this.source += s + "\n"; }, Close: function () { } }; var outSourceMap = { source: "", Write: function (s) { this.source += s; }, WriteLine: function (s) { this.source += s + "\n"; }, Close: function () { } }; var outerr = { firstError: "", Write: function (s) { if(this.firstError === "") { this.firstError = s; } }, WriteLine: function (s) { if(this.firstError === "") { this.firstError = s; } }, Close: function () { } }; var settings = new TypeScript.CompilationSettings(); settings.emitComments = true; settings.mapSourceFiles = true; var compiler = new TypeScript.TypeScriptCompiler(outerr, new TypeScript.NullLogger(), settings); compiler.parser.errorRecovery = true; var validFormattedText = true; var compilerSource; var compilerSourceNumLines; try { compilerSource = source.slice(sourceSpan.start, sourceSpan.end + 1); compilerSourceNumLines = sourceSpan.calculateLineOffsets(compilerSource); compiler.addUnit(compilerSource, "input.js"); var emitterIOHost = { createFile: function (fileName, useUTF8) { if(fileName === "input.js.map") { return outSourceMap; } return outfile; } }; compiler.emit(emitterIOHost); } catch (e) { validFormattedText = false; }finally { if(validFormattedText) { sourceSpan._mappings = FormatService.SourcemapParser.calculateMappings(outSourceMap.source, TypeScript); if(!sourceSpan._mappings) { validFormattedText = false; } } if(validFormattedText) { var sourceMapPos = outfile.source.lastIndexOf("//@ sourceMappingURL=input.js.map"); if(outfile.source[sourceMapPos - 1] === '\n' && outfile.source[sourceMapPos - 2] === '\n') { --sourceMapPos; } var newPrettyPrintedSource = (sourceMapPos !== -1) ? outfile.source.slice(0, sourceMapPos) : outfile.source; generatedLineOffset += this.getNumLines(newPrettyPrintedSource); this._formattedText += newPrettyPrintedSource; } else { generatedLineOffset += compilerSourceNumLines; this._formattedText += compilerSource; this._error = true; this._firstCompilerError = outerr.firstError; if(this._firstCompilerError) { var pos = this._firstCompilerError.indexOf("("); if(pos > 0) { this._firstCompilerError = this._firstCompilerError.slice(pos); } } } } if(++sourceSpanIndex === this._generatedSourceSpans.length) { return; } } }; FormatWorker.prototype.processSource = function () { this.parseSource(this._source, this._mimeType); if(this._canBePrettyPrinted) { this.formatJavaScript(this._source); } }; return FormatWorker; })(); FormatService.FormatWorker = FormatWorker; onmessage = function (e) { var msg = e.data; var worker = new FormatWorker(msg); importScripts(msg.commonUrl + "assert.js", msg.loader + "loader.js", msg.typescriptServices + "typescriptServices.js", "sourceSpanBuilder.js", "sourcemapParser.js", "workerMessaging.js", "htmlScriptFinder.js"); require.config({ baseUrl: msg.editorBaseUrl }); worker.processSource(); var response = new FormatService.WorkerResponseMessage(); response.formattedText = worker.formattedText; response.canBePrettyPrinted = worker.canBePrettyPrinted; response.error = worker.error; response.errorMessage = worker.firstCompilerError; var generatedSourceSpans = worker.generatedSourceSpans; response.generatedSourceSpanData = []; for(var i = 0; i < generatedSourceSpans.length; i++) { response.generatedSourceSpanData.push(generatedSourceSpans[i].data); } this.postMessage(response); this.close(); }; })(Debugger.FormatService || (Debugger.FormatService = {})); var FormatService = Debugger.FormatService; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=FormatWorker.js.map // Formatter.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { (function (FormatService) { "use strict"; var WorkerBaseUrls = (function () { function WorkerBaseUrls() { } return WorkerBaseUrls; })(); FormatService.WorkerBaseUrls = WorkerBaseUrls; var Formatter = (function () { function Formatter(workerBaseUrl, commonBaseUrl) { this._options = null; this._sourceText = null; this._sourceInfo = null; this._options = new FormatService.FormatterOptions(); this._canBePrettyPrinted = true; this._worker = null; this._workerBaseUrls = new WorkerBaseUrls(); this._workerBaseUrls.worker = (workerBaseUrl !== undefined) ? workerBaseUrl : "formatter/"; this._workerBaseUrls.common = (commonBaseUrl !== undefined) ? commonBaseUrl : "../../common/"; this._workerBaseUrls.editorBaseUrl = (workerBaseUrl !== undefined) ? "editor" : "res://" + window.location.host + "/23/debugger/editor"; this._workerBaseUrls.loader = (workerBaseUrl !== undefined) ? "editor/vs/" : "../editor/vs/"; this._workerBaseUrls.typescriptServices = (workerBaseUrl !== undefined) ? "editor/vs/languages/typescript/lib/" : "../editor/vs/languages/typescript/lib/"; this._prettyPrintPromise = null; } Object.defineProperty(Formatter.prototype, "sourceText", { get: function () { return this._sourceText; }, enumerable: true, configurable: true }); Object.defineProperty(Formatter.prototype, "options", { get: function () { return this._options; }, enumerable: true, configurable: true }); Formatter.prototype.updateOptions = function (newOptions) { this._options.updateAllOptions(newOptions); }; Formatter.prototype.setDocument = function (source, url, mimeType, headers, startPrettyPrint) { var _this = this; Tools.Utility.Assert.HasValue(source, "source does not have a value."); var promise = new Plugin.Promise(function (completed, error) { _this._sourceText = new FormatService.UnmappedTextMapping(source); _this._sourceInfo = { name: "", mimeType: mimeType, sourceType: FormatService.SourceType.PrettyPrint }; _this._canBePrettyPrinted = source.length > 0 && !/^[\s;]+$/.test(source); if(_this._prettyPrintPromise) { _this._prettyPrintPromise.cancel(); _this._prettyPrintPromise = null; } if(startPrettyPrint && _this._canBePrettyPrinted) { _this.formatSource(); } completed(_this._sourceInfo); }); return promise; }; Formatter.prototype.formatSource = function () { var _this = this; Tools.Utility.Assert.IsTrue(this._canBePrettyPrinted, "Source cannot be pretty printed."); if(this._prettyPrintPromise) { return; } var disposeWorker = function () { if(_this._worker) { _this._worker.terminate(); _this._worker = null; } }; this._prettyPrintPromise = new Plugin.Promise(function (completed, error) { _this._worker = new Worker(_this._workerBaseUrls.worker + "formatWorker.js"); var errorMessage = null; _this._worker.onerror = function (e) { _this._canBePrettyPrinted = false; errorMessage = toolwindowHelpers.loadString("FormatterInternalError"); disposeWorker(); completed(new FormatService.UnmappedTextMapping(_this._sourceText.text, errorMessage)); return; }; _this._worker.onmessage = function (e) { var msg = e.data; var errorMessage = null; _this._canBePrettyPrinted = msg.canBePrettyPrinted; var result = null; if(_this._canBePrettyPrinted) { var generatedSourceSpanData = msg.generatedSourceSpanData; var generatedSourceSpans = []; for(var i = 0; i < generatedSourceSpanData.length; i++) { var sourceSpan = new FormatService.SourceSpan(generatedSourceSpanData[i]); generatedSourceSpans.push(sourceSpan); } if(msg.error) { errorMessage = toolwindowHelpers.loadString(generatedSourceSpans.length > 1 ? "FormatterEmbededJSInternalError" : "FormatterInternalError"); if(msg.errorMessage.length > 0) { errorMessage += "\n"; errorMessage += msg.errorMessage; } } result = new FormatService.FormattedTextMapping(FormatService.SourceType.PrettyPrint, msg.formattedText, _this._sourceText, generatedSourceSpans, errorMessage); } disposeWorker(); completed(result || _this.sourceText); }; var msg = new FormatService.WorkerSendMessage(); msg.source = _this._sourceText.text; msg.mimeType = _this._sourceInfo.mimeType; msg.commonUrl = _this._workerBaseUrls.common; msg.editorBaseUrl = _this._workerBaseUrls.editorBaseUrl; msg.loader = _this._workerBaseUrls.loader; msg.typescriptServices = _this._workerBaseUrls.typescriptServices; _this._worker.postMessage(msg); }, disposeWorker); }; Formatter.prototype.getFormattedText = function (options) { Tools.Utility.Assert.IsTrue(!!this.sourceText, "Must call setDocument first"); options = options || this._options; var sourceType = (options.prettyPrint && this._canBePrettyPrinted) ? FormatService.SourceType.PrettyPrint : FormatService.SourceType.Original; if(sourceType == FormatService.SourceType.PrettyPrint) { if(!this._prettyPrintPromise) { this.formatSource(); } Tools.Utility.Assert.HasValue(this._prettyPrintPromise, "No pretty print promise."); return this._prettyPrintPromise; } else { return Plugin.Promise.wrap(this._sourceText); } }; Formatter.calculateLineOffsets = function calculateLineOffsets(source) { var lineCount = 0; var offsets = []; offsets[lineCount] = 0; if(source) { for(var offset = 0; offset < source.length; offset++) { if(source.charAt(offset) === '\n') { offsets[++lineCount] = offset + 1; } } } return offsets; }; return Formatter; })(); FormatService.Formatter = Formatter; })(Debugger.FormatService || (Debugger.FormatService = {})); var FormatService = Debugger.FormatService; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=Formatter.js.map // FormattedTextMapping.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { (function (FormatService) { "use strict"; var FormattedTextMapping = (function () { function FormattedTextMapping(sourceType, formattedText, originalText, sourceSpans, errorMessage) { Tools.Utility.Assert.IsTrue(sourceType == FormatService.SourceType.PrettyPrint || sourceType === FormatService.SourceType.Sourcemap, "Invalid sourceType"); Tools.Utility.Assert.HasValue(sourceSpans && sourceSpans.length, "sourceSpans are required"); this.sourceType = sourceType; this.text = formattedText; this._originalText = originalText; this._sourceSpans = sourceSpans; this.errorMessage = errorMessage || originalText.errorMessage; this._formattedOffsets = FormatService.Formatter.calculateLineOffsets(formattedText); } FormattedTextMapping.prototype.getOriginalPosition = function (mappedPosition) { var offset = this.getOriginalOffset(mappedPosition); return this._originalText.getOriginalPosition(this._originalText.offsetToPosition(offset)); }; FormattedTextMapping.prototype.getOriginalOffset = function (mappedPosition) { if(this._originalText.text.length === 0) { return 0; } var pos = new FormatService.Position(mappedPosition.line, mappedPosition.column, mappedPosition.file); for(var sourceSpanIndex = 0; sourceSpanIndex < this._sourceSpans.length - 1; sourceSpanIndex++) { if(pos.line < this._sourceSpans[sourceSpanIndex + 1].generatedLineOffset) { break; } } var sourceSpan = this._sourceSpans[sourceSpanIndex]; pos.line -= sourceSpan.generatedLineOffset; if(sourceSpan.sourcemap) { pos = sourceSpan.sourcemap.getOriginalPosition(pos); } var offset = sourceSpan.getOffset(pos); return offset; }; FormattedTextMapping.prototype.getMappedPosition = function (originalPosition) { originalPosition = this._originalText.getMappedPosition(originalPosition); var offset = this._originalText.positionToOffset(originalPosition); var originalLength = this._originalText.text.length; if(originalLength === 0) { return new FormatService.Position(0, 0); } if(offset < 0) { offset = 0; } if(offset >= originalLength) { offset = originalLength - 1; } var sourceSpan; var sourceSpanIndex; for(sourceSpanIndex = 0; sourceSpanIndex < this._sourceSpans.length; sourceSpanIndex++) { if(this._sourceSpans[sourceSpanIndex].start <= offset && this._sourceSpans[sourceSpanIndex].end >= offset) { sourceSpan = this._sourceSpans[sourceSpanIndex]; break; } } Tools.Utility.Assert.IsTrue(sourceSpanIndex < this._sourceSpans.length, "Could not find source code for offset"); var pos = sourceSpan.getPosition(offset - sourceSpan.start); if(sourceSpan.sourcemap) { pos = sourceSpan.sourcemap.getGeneratedPosition(pos); } pos.line += sourceSpan.generatedLineOffset; return pos; }; FormattedTextMapping.prototype.positionToOffset = function (mappedPosition) { return this._formattedOffsets[mappedPosition.line] + mappedPosition.column; }; FormattedTextMapping.prototype.offsetToPosition = function (offset) { for(var lineNum = 0; lineNum < this._formattedOffsets.length; lineNum++) { if(this._formattedOffsets[lineNum] > offset) { break; } } lineNum--; return new FormatService.Position(lineNum, offset - this._formattedOffsets[lineNum], 0); }; return FormattedTextMapping; })(); FormatService.FormattedTextMapping = FormattedTextMapping; })(Debugger.FormatService || (Debugger.FormatService = {})); var FormatService = Debugger.FormatService; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=FormattedTextMapping.js.map // UnmappedTextMapping.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { (function (FormatService) { "use strict"; var UnmappedTextMapping = (function () { function UnmappedTextMapping(text, errorMessage) { this.text = text; this.errorMessage = errorMessage; var sourceSpanBuilder = new FormatService.SourceSpanBuilder(0, text.length); sourceSpanBuilder.calculateLineOffsets(text); this._sourceSpan = new FormatService.SourceSpan(sourceSpanBuilder.data); } UnmappedTextMapping.prototype.getOriginalPosition = function (mappedPosition) { return mappedPosition; }; UnmappedTextMapping.prototype.getMappedPosition = function (originalPosition) { return originalPosition; }; UnmappedTextMapping.prototype.positionToOffset = function (mappedPosition) { if(this.text.length === 0) { return 0; } return this._sourceSpan.getOffset(mappedPosition); }; UnmappedTextMapping.prototype.offsetToPosition = function (offset) { if(this.text.length === 0) { return FormatService.Position.empty; } return this._sourceSpan.getPosition(Math.min(this.text.length, Math.max(0, offset))); }; return UnmappedTextMapping; })(); FormatService.UnmappedTextMapping = UnmappedTextMapping; })(Debugger.FormatService || (Debugger.FormatService = {})); var FormatService = Debugger.FormatService; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=UnmappedTextMapping.js.map // FormatterOptions.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { (function (FormatService) { "use strict"; var FormatterOptions = (function () { function FormatterOptions() { this._prettyPrint = false; this._sourcemapSupport = false; } Object.defineProperty(FormatterOptions.prototype, "sourcemapSupport", { get: function () { return this._sourcemapSupport; }, set: function (isEnabled) { this._sourcemapSupport = isEnabled; }, enumerable: true, configurable: true }); Object.defineProperty(FormatterOptions.prototype, "prettyPrint", { get: function () { return this._prettyPrint; }, set: function (isEnabled) { this._prettyPrint = isEnabled; }, enumerable: true, configurable: true }); FormatterOptions.prototype.updateAllOptions = function (newOptions) { this.prettyPrint = newOptions.prettyPrint || false; this.sourcemapSupport = newOptions.sourcemapSupport || false; }; return FormatterOptions; })(); FormatService.FormatterOptions = FormatterOptions; })(Debugger.FormatService || (Debugger.FormatService = {})); var FormatService = Debugger.FormatService; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=FormatterOptions.js.map // htmlScriptFinder.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { (function (FormatService) { "use strict"; var HTMLScriptFinder = (function () { function HTMLScriptFinder(source) { Tools.Utility.Assert.HasValue(source, "Need to set a valid source"); this._source = source; this._sourceSpans = null; this._earlyEnd = false; } HTMLScriptFinder.isSupportedScript = function isSupportedScript(mimeType, scriptLanguage) { var mimeTypeLowerCase = mimeType.toLowerCase(); var scriptLanguageLowerCase = scriptLanguage ? scriptLanguage.toLocaleLowerCase() : ""; var isScriptSupported = ((!mimeTypeLowerCase && !scriptLanguageLowerCase) || (mimeTypeLowerCase === "text/javascript") || mimeTypeLowerCase === "text/jscript" || mimeTypeLowerCase === "application/javascript" || mimeTypeLowerCase === "application/x-javascript" || mimeTypeLowerCase === "text/ecmascript" || (scriptLanguageLowerCase === "javascript" || scriptLanguageLowerCase === "jscript" || scriptLanguageLowerCase === "ecmascript")); return isScriptSupported; }; Object.defineProperty(HTMLScriptFinder.prototype, "sourceSpans", { get: function () { if(this._sourceSpans === null) { this.findScriptTags(); } return this._sourceSpans; }, enumerable: true, configurable: true }); HTMLScriptFinder.prototype.findScriptTags = function () { this._index = 0; this._sourceSpans = []; this._htmlStart = 0; var source = this._source; do { if(source[this._index] === '<') { if(this._index + 1 >= source.length) { break; } if(source[this._index + 1] === '!') { if(this._index + 3 < this._source.length && this._source[this._index + 2] === '-' && this._source[this._index + 3] === '-') { this.ParseComment(); } else { this.ParseTag(); } } else if(source[this._index + 1] === '?') { this.ParseTag(); } else if(source[this._index + 1].match(/[a-zA-Z]/) || source[this._index + 1] === '_' || (source[this._index + 1] === '/' && this._index + 2 < source.length && (source[this._index + 2].match(/a-zA-Z/) || source[this._index + 2] === '_'))) { this.ParseTag(); } } }while(++this._index < source.length); if(!this._earlyEnd) { this._sourceSpans.push(new FormatService.SourceSpanBuilder(this._htmlStart, this._source.length - 1, false)); } }; HTMLScriptFinder.prototype.ParseComment = function () { Tools.Utility.Assert.AreEqual(this._source[this._index], '<'); Tools.Utility.Assert.AreEqual(this._source[this._index + 1], '!'); Tools.Utility.Assert.AreEqual(this._source[this._index + 2], '-'); Tools.Utility.Assert.AreEqual(this._source[this._index + 3], '-'); this._index += 3; while(++this._index < this._source.length) { if(this._source[this._index] === '-' && this._index + 2 < this._source.length && this._source[this._index + 1] === '-' && this._source[this._index + 2] === '>') { this._index += 2; return; } } }; HTMLScriptFinder.prototype.ParseTag = function () { Tools.Utility.Assert.AreEqual(this._source[this._index], '<'); var endTagEncountered = false; if(this._index + 1 < this._source.length && (this._source[this._index + 1] === '/' || this._source[this._index + 1] === '!' || this._source[this._index + 1] === '?')) { endTagEncountered = true; } var nextIsValue = false; var tagNameParsed = false; var obtainElementType = false; var obtainElementLanguage = false; var element; var mimeType = ""; var scriptLanguage = ""; var data; while(++this._index < this._source.length) { switch(this._source[this._index]) { case '>': if(this._source[this._index - 1] === '/' || this._source[this._index - 1] === '?') { endTagEncountered = true; } if(!endTagEncountered) { if(element && element.toLowerCase() === "script") { ++this._index; this.FindScriptEnd(mimeType, scriptLanguage); } } return; case '"': data = this.ParseQuotedValue('"'); nextIsValue = false; if(obtainElementType) { mimeType = data; obtainElementType = false; } if(obtainElementLanguage) { scriptLanguage = data; obtainElementLanguage = false; } break; case '\'': data = this.ParseQuotedValue("'"); nextIsValue = false; if(obtainElementType) { mimeType = data; obtainElementType = false; } if(obtainElementLanguage) { scriptLanguage = data; obtainElementLanguage = false; } break; case '=': nextIsValue = true; break; default: if(nextIsValue && !this._source[this._index].match(/\s/)) { data = this.ParsePropertyValue(); nextIsValue = false; if(obtainElementType) { mimeType = data; obtainElementType = false; } if(obtainElementLanguage) { scriptLanguage = data; obtainElementLanguage = false; } } else if(this._source[this._index].match(/[a-zA-Z]/) || this._source[this._index] === '_') { if(!tagNameParsed) { element = this.ParseElement(); tagNameParsed = true; } else { data = this.ParseAttribute(); if(data.toLowerCase() === "type") { obtainElementType = true; } else if(data.toLowerCase() === "language" && !obtainElementType) { obtainElementLanguage = true; } } } } } }; HTMLScriptFinder.prototype.FindScriptEnd = function (mimeType, scriptLanguage) { var scriptStart = this._index; var isScriptSupported = HTMLScriptFinder.isSupportedScript(mimeType, scriptLanguage); var endScriptStr = "': this._index--; return data; default: if(this._source[this._index].match(/\s/)) { this._index--; return data; } else { data += this._source[this._index]; } break; } }while(++this._index < this._source.length); Tools.Utility.Assert.Fail("Should not be here"); return data; }; HTMLScriptFinder.prototype.ParseElement = function () { Tools.Utility.Assert.IsTrue(this._source[this._index].match(/[a-zA-Z_]/), "Non alpha or underscore character"); var element = ""; element += this._source[this._index]; while(++this._index < this._source.length) { switch(this._source[this._index]) { case ':': element += this._source[this._index]; break; default: if(this._source[this._index].match(/[a-zA-Z0-9]/) || this._source[this._index] === '_' || this._source[this._index] === '.' || this._source[this._index] === '-') { element += this._source[this._index]; } else { this._index--; return element; } break; } } Tools.Utility.Assert.Fail("Should not be here"); return element; }; HTMLScriptFinder.prototype.ParseAttribute = function () { Tools.Utility.Assert.IsTrue(this._source[this._index].match(/[a-zA-Z_]/), "Non alpha or underscore character"); var data = ""; data += this._source[this._index]; while(++this._index < this._source.length) { switch(this._source[this._index]) { case '.': data += this._source[this._index]; break; case ':': data += this._source[this._index]; break; case '-': case '_': data += this._source[this._index]; break; default: if(this._source[this._index].match(/[a-zA-Z0-9]/)) { data += this._source[this._index]; } else { this._index--; return data; } break; } } Tools.Utility.Assert.Fail("Should not be here"); return data; }; return HTMLScriptFinder; })(); FormatService.HTMLScriptFinder = HTMLScriptFinder; })(Debugger.FormatService || (Debugger.FormatService = {})); var FormatService = Debugger.FormatService; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=htmlScriptFinder.js.map // position.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { (function (FormatService) { "use strict"; var Position = (function () { function Position(line, column, file) { if(line) { Tools.Utility.Assert.IsTrue(line >= 0, "Invalid line number: " + line.toString()); this._line = line; } else { this._line = 0; } if(column) { Tools.Utility.Assert.IsTrue(column >= 0, "Invalid column: " + column.toString()); this._column = column; } else { this._column = 0; } if(file) { Tools.Utility.Assert.IsTrue(file >= 0, "Invalid file: " + file.toString()); this._file = file; } else { this._file = 0; } } Object.defineProperty(Position.prototype, "line", { get: function () { return this._line; }, set: function (value) { Tools.Utility.Assert.IsTrue(value >= 0, "Invalid line number: " + value.toString()); this._line = value; }, enumerable: true, configurable: true }); Object.defineProperty(Position.prototype, "column", { get: function () { return this._column; }, set: function (value) { Tools.Utility.Assert.IsTrue(value >= 0, "Invalid column: " + value.toString()); this._column = value; }, enumerable: true, configurable: true }); Object.defineProperty(Position.prototype, "file", { get: function () { return this._file; }, set: function (value) { Tools.Utility.Assert.IsTrue(value >= 0, "Invalid file: " + value.toString()); this._file = value; }, enumerable: true, configurable: true }); Position.empty = new Position(); return Position; })(); FormatService.Position = Position; })(Debugger.FormatService || (Debugger.FormatService = {})); var FormatService = Debugger.FormatService; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=position.js.map // sourcemapMappings.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { (function (FormatService) { "use strict"; var SourcemapMappings = (function () { function SourcemapMappings(mappings) { this._mappings = mappings || []; } SourcemapMappings.prototype.getOriginalPosition = function (generatedPosition) { var _this = this; var pos = new FormatService.Position(generatedPosition.line, generatedPosition.column, generatedPosition.file); if(this._mappings.length > 0) { var index = this.binarySearch(pos, function (i, line, column) { return _this._mappings[i].generatedLine < line || (_this._mappings[i].generatedLine === line && _this._mappings[i].generatedColumn <= column); }); if(index > 0 && index < this._mappings.length && (this._mappings[index].generatedLine > pos.line || this._mappings[index].generatedColumn > pos.column)) { index = index - 1; } pos.line = this._mappings[index].sourceLine; pos.column = this._mappings[index].sourceColumn; } return pos; }; SourcemapMappings.prototype.getGeneratedPosition = function (originalPosition) { var _this = this; var pos = new FormatService.Position(originalPosition.line, originalPosition.column, originalPosition.file); if(this._mappings.length > 0) { var index = this.binarySearch(pos, function (i, line, column) { return _this._mappings[i].sourceLine < line || (_this._mappings[i].sourceLine === line && _this._mappings[i].sourceColumn <= column); }); if(index > 0 && index < this._mappings.length && (this._mappings[index].sourceLine > pos.line || this._mappings[index].sourceColumn > pos.column)) { index = index - 1; } pos.line = this._mappings[index].generatedLine; pos.column = this._mappings[index].generatedColumn; } return pos; }; SourcemapMappings.prototype.binarySearch = function (position, compareFunction) { var max = this._mappings.length - 1; var min = 0; while(min < max) { var mid = (min + max) >> 1; if(compareFunction(mid, position.line, position.column)) { min = mid + 1; } else { max = mid; } } return min; }; return SourcemapMappings; })(); FormatService.SourcemapMappings = SourcemapMappings; })(Debugger.FormatService || (Debugger.FormatService = {})); var FormatService = Debugger.FormatService; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=sourcemapMappings.js.map // sourceSpan.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { (function (FormatService) { "use strict"; var SourceSpan = (function () { function SourceSpan(sourceSpanData) { this._start = sourceSpanData.start; this._end = sourceSpanData.end; this._lineOffsets = sourceSpanData.lineOffsets; this._generatedLineOffset = sourceSpanData.generatedLineOffset; this._sourcemap = new FormatService.SourcemapMappings(sourceSpanData.mappings); this._length = sourceSpanData.length; } SourceSpan.prototype.getPosition = function (offset) { Tools.Utility.Assert.IsTrue(offset >= 0, "Negative offset"); Tools.Utility.Assert.IsTrue(offset <= this._length, "Offset greater than source length"); Tools.Utility.Assert.IsTrue(this._lineOffsets.length >= 1, "Need to call calculateLineOffsets first"); var max = this._lineOffsets.length - 1; var line = 0; while(line < max) { var mid = (line + max) >> 1; if(this._lineOffsets[mid] < offset) { line = mid + 1; } else { max = mid; } } if(line > 0 && line < this._lineOffsets.length && this._lineOffsets[line] > offset) { line = line - 1; } var column = offset - this._lineOffsets[line]; Tools.Utility.Assert.IsTrue(column >= 0, "Calculated negative column"); var pos = new FormatService.Position(line, column); return pos; }; SourceSpan.prototype.getOffset = function (pos) { Tools.Utility.Assert.IsTrue(this._lineOffsets.length >= 1, "Need to call calculateLineOffsets first"); Tools.Utility.Assert.IsTrue(pos.line >= 0 && pos.line < this._lineOffsets.length, "Line outside of range: " + pos.line.toString()); Tools.Utility.Assert.IsTrue(pos.column >= 0, "Column outside of range: " + pos.column.toString()); var offset = this._lineOffsets[pos.line] + pos.column; if(pos.line < this._lineOffsets.length - 1 && offset >= this._lineOffsets[pos.line + 1]) { offset = this._lineOffsets[pos.line + 1] - 1; } Tools.Utility.Assert.IsTrue(offset <= this._length, "Calculated bad offset: " + offset.toString()); if(offset >= this._length) { offset = Math.max(0, this._length - 1); } return offset + this._start; }; Object.defineProperty(SourceSpan.prototype, "start", { get: function () { return this._start; }, enumerable: true, configurable: true }); Object.defineProperty(SourceSpan.prototype, "end", { get: function () { return this._end; }, enumerable: true, configurable: true }); Object.defineProperty(SourceSpan.prototype, "generatedLineOffset", { get: function () { return this._generatedLineOffset; }, enumerable: true, configurable: true }); Object.defineProperty(SourceSpan.prototype, "sourcemap", { get: function () { return this._sourcemap; }, enumerable: true, configurable: true }); return SourceSpan; })(); FormatService.SourceSpan = SourceSpan; })(Debugger.FormatService || (Debugger.FormatService = {})); var FormatService = Debugger.FormatService; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=sourceSpan.js.map // sourceSpanBuilder.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { (function (FormatService) { "use strict"; var SourceSpanBuilder = (function () { function SourceSpanBuilder(start, end, isScript) { Tools.Utility.Assert.IsTrue(start >= 0, "Invalid start offset: " + start.toString()); Tools.Utility.Assert.IsTrue(end >= start, "Invalid end offset: " + end.toString()); this._data = new FormatService.SourceSpanData(); this._data.start = start; this._data.end = end; this._isScript = isScript; this._data.lineOffsets = []; this._data.generatedLineOffset = 0; this._data.length = 0; this._data.mappings = []; } Object.defineProperty(SourceSpanBuilder.prototype, "_mappings", { get: function () { return this._data.mappings; }, set: function (mappings) { this._data.mappings = mappings; }, enumerable: true, configurable: true }); Object.defineProperty(SourceSpanBuilder.prototype, "data", { get: function () { return this._data; }, enumerable: true, configurable: true }); SourceSpanBuilder.prototype.calculateLineOffsets = function (source) { var lineCount = 0; this._data.lineOffsets = []; this._data.lineOffsets[lineCount] = 0; this._data.length = source.length; for(var offset = 0; offset < source.length; offset++) { if(source.charAt(offset) === '\n') { this._data.lineOffsets[++lineCount] = offset + 1; } } return lineCount; }; Object.defineProperty(SourceSpanBuilder.prototype, "start", { get: function () { return this._data.start; }, enumerable: true, configurable: true }); Object.defineProperty(SourceSpanBuilder.prototype, "end", { get: function () { return this._data.end; }, enumerable: true, configurable: true }); Object.defineProperty(SourceSpanBuilder.prototype, "isScript", { get: function () { return this._isScript; }, enumerable: true, configurable: true }); Object.defineProperty(SourceSpanBuilder.prototype, "generatedLineOffset", { get: function () { return this._data.generatedLineOffset; }, set: function (offset) { Tools.Utility.Assert.IsTrue(offset >= 0, "offset is negative"); this._data.generatedLineOffset = offset; }, enumerable: true, configurable: true }); Object.defineProperty(SourceSpanBuilder.prototype, "lineOffsets", { get: function () { return this._data.lineOffsets; }, enumerable: true, configurable: true }); return SourceSpanBuilder; })(); FormatService.SourceSpanBuilder = SourceSpanBuilder; })(Debugger.FormatService || (Debugger.FormatService = {})); var FormatService = Debugger.FormatService; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=sourceSpanBuilder.js.map // sourcemapParser.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { (function (FormatService) { "use strict"; var SourceMap = (function () { function SourceMap() { } return SourceMap; })(); FormatService.SourceMap = SourceMap; var SourcemapParser = (function () { function SourcemapParser() { } SourcemapParser.calculateMappings = function calculateMappings(sourcemapJSONString, TypeScript) { var mappings = []; try { var sourcemap = JSON.parse(sourcemapJSONString); } catch (e) { return null; } if(!sourcemap || sourcemap.version !== 3) { return null; } var lastMapping = new FormatService.SourcemapMapping(); var generatedLine = 0; var str = sourcemap.mappings; if(str.length === 0) { var mapping = new FormatService.SourcemapMapping(); mappings.push(mapping); } while(str.length > 0) { if(str.charAt(0) === ';') { generatedLine++; str = str.slice(1); lastMapping.generatedColumn = 0; } else if(str.charAt(0) === ',') { str = str.slice(1); } else { var mapping = new FormatService.SourcemapMapping(); mapping.generatedLine = generatedLine; var result = TypeScript.Base64VLQFormat.decode(str); mapping.generatedColumn = lastMapping.generatedColumn + result.value; lastMapping.generatedColumn = mapping.generatedColumn; str = result.rest; if(str.length > 0 && str.charAt(0) !== ';' && str.charAt(0) !== ',') { result = TypeScript.Base64VLQFormat.decode(str); str = result.rest; } if(str.length > 0 && str.charAt(0) !== ';' && str.charAt(0) !== ',') { result = TypeScript.Base64VLQFormat.decode(str); mapping.sourceLine = result.value + lastMapping.sourceLine; lastMapping.sourceLine = mapping.sourceLine; str = result.rest; } if(str.length > 0 && str.charAt(0) !== ';' && str.charAt(0) !== ',') { result = TypeScript.Base64VLQFormat.decode(str); mapping.sourceColumn = result.value + lastMapping.sourceColumn; lastMapping.sourceColumn = mapping.sourceColumn; str = result.rest; } if(str.length > 0 && str.charAt(0) !== ';' && str.charAt(0) !== ',') { result = TypeScript.Base64VLQFormat.decode(str); str = result.rest; } mappings.push(mapping); } } return mappings; }; return SourcemapParser; })(); FormatService.SourcemapParser = SourcemapParser; })(Debugger.FormatService || (Debugger.FormatService = {})); var FormatService = Debugger.FormatService; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=sourcemapParser.js.map // workerMessaging.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { (function (FormatService) { "use strict"; var SourcemapMapping = (function () { function SourcemapMapping() { this.generatedColumn = 0; this.generatedLine = 0; this.sourceColumn = 0; this.sourceLine = 0; } return SourcemapMapping; })(); FormatService.SourcemapMapping = SourcemapMapping; var SourceSpanData = (function () { function SourceSpanData() { } return SourceSpanData; })(); FormatService.SourceSpanData = SourceSpanData; var WorkerSendMessage = (function () { function WorkerSendMessage() { } return WorkerSendMessage; })(); FormatService.WorkerSendMessage = WorkerSendMessage; var WorkerResponseMessage = (function () { function WorkerResponseMessage() { } return WorkerResponseMessage; })(); FormatService.WorkerResponseMessage = WorkerResponseMessage; })(Debugger.FormatService || (Debugger.FormatService = {})); var FormatService = Debugger.FormatService; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=workerMessaging.js.map // commonStructs.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var Source = (function () { function Source(id, docId, parentDocId, isRootChild, url, mimeType, length, isDynamicCode, headers) { this.id = id; this.docId = docId; this.parentDocId = parentDocId; this.isRootChild = isRootChild; this.url = url; this.mimeType = mimeType; this.length = length; this.isDynamicCode = isDynamicCode; this.headers = headers; } return Source; })(); Debugger.Source = Source; (function (CauseBreakAction) { CauseBreakAction._map = []; CauseBreakAction._map[0] = "BreakOnAny"; CauseBreakAction.BreakOnAny = 0; CauseBreakAction._map[1] = "BreakOnAnyNewWorkerStarting"; CauseBreakAction.BreakOnAnyNewWorkerStarting = 1; CauseBreakAction._map[2] = "BreakIntoSpecificWorker"; CauseBreakAction.BreakIntoSpecificWorker = 2; CauseBreakAction._map[3] = "UnsetBreakOnAnyNewWorkerStarting"; CauseBreakAction.UnsetBreakOnAnyNewWorkerStarting = 3; })(Debugger.CauseBreakAction || (Debugger.CauseBreakAction = {})); var CauseBreakAction = Debugger.CauseBreakAction; (function (BreakResumeAction) { BreakResumeAction._map = []; BreakResumeAction._map[0] = "Abort"; BreakResumeAction.Abort = 0; BreakResumeAction._map[1] = "Continue"; BreakResumeAction.Continue = 1; BreakResumeAction._map[2] = "StepInto"; BreakResumeAction.StepInto = 2; BreakResumeAction._map[3] = "StepOver"; BreakResumeAction.StepOver = 3; BreakResumeAction._map[4] = "StepOut"; BreakResumeAction.StepOut = 4; BreakResumeAction._map[5] = "Ignore"; BreakResumeAction.Ignore = 5; })(Debugger.BreakResumeAction || (Debugger.BreakResumeAction = {})); var BreakResumeAction = Debugger.BreakResumeAction; (function (BreakpointState) { BreakpointState._map = []; BreakpointState._map[0] = "Deleted"; BreakpointState.Deleted = 0; BreakpointState._map[1] = "Disabled"; BreakpointState.Disabled = 1; BreakpointState._map[2] = "Enabled"; BreakpointState.Enabled = 2; BreakpointState._map[3] = "Pending"; BreakpointState.Pending = 3; })(Debugger.BreakpointState || (Debugger.BreakpointState = {})); var BreakpointState = Debugger.BreakpointState; (function (ExceptionFilter) { ExceptionFilter._map = []; ExceptionFilter._map[0] = "None"; ExceptionFilter.None = 0; ExceptionFilter._map[1] = "Unhandled"; ExceptionFilter.Unhandled = 1; ExceptionFilter._map[2] = "Handled"; ExceptionFilter.Handled = 2; })(Debugger.ExceptionFilter || (Debugger.ExceptionFilter = {})); var ExceptionFilter = Debugger.ExceptionFilter; (function (BreakReason) { BreakReason._map = []; BreakReason._map[0] = "Step"; BreakReason.Step = 0; BreakReason._map[1] = "Breakpoint"; BreakReason.Breakpoint = 1; BreakReason._map[2] = "DebuggerBlock"; BreakReason.DebuggerBlock = 2; BreakReason._map[3] = "HostInitiated"; BreakReason.HostInitiated = 3; BreakReason._map[4] = "LanguageInitiated"; BreakReason.LanguageInitiated = 4; BreakReason._map[5] = "DebuggerHalt"; BreakReason.DebuggerHalt = 5; BreakReason._map[6] = "Error"; BreakReason.Error = 6; BreakReason._map[7] = "JIT"; BreakReason.JIT = 7; })(Debugger.BreakReason || (Debugger.BreakReason = {})); var BreakReason = Debugger.BreakReason; (function (ConnectionResult) { ConnectionResult._map = []; ConnectionResult.Succeeded = 0; ConnectionResult.Failed = 1; ConnectionResult.FailedAlreadyAttached = 2; })(Debugger.ConnectionResult || (Debugger.ConnectionResult = {})); var ConnectionResult = Debugger.ConnectionResult; Debugger.BreakpointIdNotFound = "BKP:notfound:"; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=commonStructs.js.map // runningDocument.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var RunningDocument = (function () { function RunningDocument(source) { Tools.Utility.Assert.HasValue(source, "RunningDocument source is required"); this._source = source; this._formattingPromise = null; this._timerId = null; this._timerPromise = Plugin.Promise.wrap(null); this.listeners = []; this.dirty = true; this.formatter = null; } Object.defineProperty(RunningDocument.prototype, "source", { get: function () { return this._source; }, enumerable: true, configurable: true }); Object.defineProperty(RunningDocument.prototype, "timerPromise", { get: function () { return this._timerPromise; }, enumerable: true, configurable: true }); RunningDocument.prototype.hasTimerId = function () { return !!this._timerId; }; RunningDocument.prototype.getFormattedText = function () { var _this = this; var docPromise = this._formattingPromise || Plugin.Promise.wrap(null); var returnPromise = new Plugin.Promise(function (completed) { docPromise.then(function () { _this._sourceText = _this.formatter.sourceText; _this.formatter.getFormattedText().then(function (textMapping) { if(_this._formattingPromise === returnPromise) { _this._formattingPromise = null; } _this.textMapping = textMapping; completed(textMapping); }); }); }); this._formattingPromise = returnPromise; return this._formattingPromise; }; RunningDocument.prototype.queueGetSourceText = function (callback) { var _this = this; if(this._timerId != null) { window.clearTimeout(this._timerId); } this._timerPromise = new Plugin.Promise(function (completed, error, progress) { _this._timerId = window.setTimeout(function () { _this._timerId = null; callback(completed, progress); }, 50); }); return this._timerPromise; }; RunningDocument.prototype.cancelPendingActions = function () { if(this._timerId != null) { window.clearTimeout(this._timerId); } if(this._timerPromise) { this._timerPromise.cancel(); } if(this._formattingPromise) { this._formattingPromise.cancel(); } }; RunningDocument.prototype.getFormattedPositionFromSourceOffset = function (sourceOffset) { if(this.textMapping && this._sourceText) { var sourcePosition = this._sourceText.offsetToPosition(sourceOffset); return this.textMapping.getMappedPosition(sourcePosition); } else { return Debugger.FormatService.Position.empty; } }; RunningDocument.prototype.getSourceOffsetFromFormattedPosition = function (formattedPosition) { if(this.textMapping && this._sourceText) { var sourcePosition = this.textMapping.getOriginalPosition(formattedPosition); return this._sourceText.positionToOffset(sourcePosition); } else { return 0; } }; RunningDocument.prototype.createSourceLocation = function (start, length) { var zeroBasedStart = this.getFormattedPositionFromSourceOffset(start); var zeroBasedEnd = this.getFormattedPositionFromSourceOffset(start + length); return new Debugger.SourceLocation(this._source.docId, zeroBasedStart.line + 1, zeroBasedStart.column + 1, zeroBasedEnd.line + 1, zeroBasedEnd.column + 1); }; return RunningDocument; })(); Debugger.RunningDocument = RunningDocument; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=runningDocument.js.map // debuggerManager.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; (function (Tristate) { Tristate._map = []; Tristate._map[0] = "On"; Tristate.On = 0; Tristate._map[1] = "Off"; Tristate.Off = 1; Tristate._map[2] = "Disabled"; Tristate.Disabled = 2; })(Debugger.Tristate || (Debugger.Tristate = {})); var Tristate = Debugger.Tristate; var DebuggerManager = (function () { function DebuggerManager(shell) { var _this = this; this.debuggerShell = shell; this._debuggerEngine = null; this._debuggerConnect = null; this._diagOMConnect = null; this._firstPageLoaded = false; this._ignoreNextSetRootDocument = false; this._documents = { }; this._documentOrder = { }; this._documentOrderCount = 0; this._testEventObject = new Tools.CustomEventObject(); this.watchController = new Debugger.WatchWindowController(this, document.querySelector(".gridWatchContainer"), false); this.breakpointController = new Debugger.BreakpointController(this, document.getElementById("BreakpointWindow")); this.callstackController = new Debugger.CallstackController(this); this.executionController = new Debugger.ExecutionController(this); this.debuggerToolbar = new Debugger.DebuggerToolbar(this.executionController); this.executionController.registerListener(this.debuggerToolbar); this.executionController.registerListener(this.callstackController.callstackWindow); this.executionController.registerListener(this.debuggerShell); this.callstackController.registerListener(this.watchController); this.breakpointController.registerListener(this.debuggerShell); var external = (window.external); external.addEventListener("attach", function () { return _this.onAttach(); }); external.addEventListener("detach", function () { return _this.onDetach(); }); this.editorWindow = new Debugger.EditorWindow(this, this.breakpointController, this.executionController, this.callstackController, this.debuggerToolbar, document.getElementById("editor"), function () { _this.callstackController.registerListener(_this.editorWindow); _this.breakpointController.registerListener(_this.editorWindow); _this.executionController.registerListener(_this.editorWindow); if(external.isAttached) { _this.onAttach(); } }); } DebuggerManager._debuggerFailedToConnectFwLink = "http://go.microsoft.com/fwlink/?LinkID=313120"; DebuggerManager.prototype.onAttach = function () { var _this = this; var external = (window.external); this._debuggerEngine = (window.external).createDebuggerEngine(); this._debuggerEngine.loadScriptInProc("../common/isDebugBuild.js"); this._debuggerEngine.loadScriptInProc("../common/assert.js"); this._debuggerEngine.loadScriptInProc("manager/commonStructs.js"); this._debuggerEngine.loadScriptInProc("../common/Remote/rpc.js"); this._debuggerEngine.loadScriptInProc("remote/DebugProvider.js"); if(external.isJitDebugging) { this._debuggerEngine.loadScriptInProc("remote/jitRemote.js"); } this._debuggerEngine.loadScriptInProc("remote/remote.js"); this._debuggerConnect = function (port) { _this._rpc = new Tools.RPC.JsonRPCEndpoint("CLIENT", _this.jsonRpcMethodReceive.bind(_this), _this.jsonRpcNotificationReceive.bind(_this), function (data) { port.postMessage(data); }, function (onMessage) { port.addEventListener("message", onMessage); }); if(!Plugin.F12.Profiler.getIsProfiling()) { _this.initializeDebugger(); } else { var consoleAnchor = document.getElementById("hEditorConsoleSplitter"); Plugin.F12.ErrorDisplay.show(Plugin.Resources.getString("ProfilingRunningMessage"), 0, "http://go.microsoft.com/fwlink/?LinkId=290645", consoleAnchor); var initializeDebugger = function () { Plugin.F12.removeEventListener("profilingstopped", initializeDebugger); if(_this.isAttached) { _this.initializeDebugger(); } }; _this.triggerSourceRundown(); Plugin.F12.addEventListener("profilingstopped", initializeDebugger); } _this.registerPluginMethodHandlers(); }; this._debuggerEngine.addEventListener("connect", this._debuggerConnect); external.loadScriptInProc("../common/isDebugBuild.js"); external.loadScriptInProc("../common/assert.js"); external.loadScriptInProc("../common/Remote/rpc.js"); external.loadScriptInProc("remote/DiagnosticsOMProvider.js"); this._diagOMConnect = function (port) { _this._rpcForDiagOM = new Tools.RPC.JsonRPCEndpoint("DIAGOMCLIENT", _this.jsonDiagOMRpcMethodReceive.bind(_this), _this.jsonDiagOMRpcNotificationReceive.bind(_this), function (data) { port.postMessage(data); }, function (onMessage) { port.addEventListener("message", onMessage); }); _this.registerPluginMethodHandlers(); _this.testEventObject.fireEvent("startDiagnosticsOMCompleted"); }; external.addEventListener("connect", this._diagOMConnect); }; DebuggerManager.prototype.onDetach = function () { this.executionController.isDebuggingDisabled = true; this.executionController.isExecutionPaused = false; this.breakpointController.deleteAll(true); if(this._debuggerConnect) { this._debuggerEngine.removeEventListener("connect", this._debuggerConnect); } this._rpc = null; this._debuggerConnect = null; this._debuggerEngine = null; var external = (window.external); if(this._diagOMConnect) { external.removeEventListener("connect", this._diagOMConnect); } this._rpcForDiagOM = null; this._diagOMConnect = null; var ordered = []; for(var docId in this._documentOrder) { ordered[this._documentOrder[docId]] = docId; } var docIds = []; ordered.forEach(function (value, index, array) { docIds.push(value); }); docIds.reverse(); this.onRemoveDocuments(docIds); this._documentOrderCount = 0; this._breakCompleted = false; this.callstackController.clear(); this.watchController.disableWatchesWindow(); this.editorWindow.removeExceptionViewZone(); Plugin.F12.Debugger.notifyOnRun(); }; DebuggerManager.prototype.registerPluginMethodHandlers = function () { var _this = this; if(!this._havePreviouslyAttached && this._rpc && this._rpcForDiagOM) { Plugin.F12.Communications.registerMethodHandler("breakModeCommand", function (script) { if(_this.isBreakCompleted) { _this.eval(_this.callstackController.activeFrame.frameId, script); return true; } return false; }); Plugin.F12.Communications.registerMethodHandler("addToWatch", function (name) { _this.watchController.addWatch(name); return true; }); Plugin.F12.Communications.registerMethodHandler("showDocument", function (documentPath, oneBasedLine, oneBasedColumn, mimeType) { if (typeof oneBasedLine === "undefined") { oneBasedLine = 1; } if (typeof oneBasedColumn === "undefined") { oneBasedColumn = 1; } if (typeof mimeType === "undefined") { mimeType = ""; } _this.showDocument(documentPath, oneBasedLine || 1, oneBasedColumn || 1, mimeType); return true; }); this._havePreviouslyAttached = true; setTimeout(function () { Plugin.F12.notifyOnToolActivated(); }); } }; DebuggerManager.prototype.initializeDebugger = function () { var _this = this; Tools.Utility.Assert.IsTrue(this.isAttached, "Not attached"); this.enableDynamicDebugging().done(function (result) { Tools.Utility.Assert.IsTrue(!Plugin.F12.Profiler.getIsProfiling(), "Profiler still enabled"); switch(result) { case Debugger.ConnectionResult.Succeeded: if(!_this._debuggerLaunched) { _this.executionController.initialize(); Plugin.F12.Communications.addEventListener("consoleOutput", function () { _this.watchController.refreshAll(false); }); } else { _this.executionController.reinitialize(); } _this._debuggerLaunched = true; _this.testEventObject.fireEvent("debuggerLaunched"); _this.executionController.isDebuggingDisabled = false; Plugin.F12.ErrorDisplay.close(); break; case Debugger.ConnectionResult.FailedAlreadyAttached: case Debugger.ConnectionResult.Failed: _this.executionController.isDebuggingDisabled = true; var errorReason = ""; if(result === Debugger.ConnectionResult.FailedAlreadyAttached) { errorReason = "\n" + Plugin.Resources.getString("DebuggerFailedToConnectAnotherAttached"); } var errorMessage = Plugin.Resources.getString("DebuggerFailedToConnect", errorReason); var consoleAnchor = document.getElementById("hEditorConsoleSplitter"); Plugin.F12.ErrorDisplay.show(errorMessage, 0, DebuggerManager._debuggerFailedToConnectFwLink, consoleAnchor); break; default: Tools.Utility.Assert.Fail("Unknown ConnectionResult. Has something been added to the enum?"); break; } }); }; Object.defineProperty(DebuggerManager.prototype, "testEventObject", { get: function () { return this._testEventObject; }, enumerable: true, configurable: true }); Object.defineProperty(DebuggerManager.prototype, "isBreakCompleted", { get: function () { return this._breakCompleted && this.executionController.isExecutionPaused; }, enumerable: true, configurable: true }); Object.defineProperty(DebuggerManager.prototype, "isDebuggerLaunched", { get: function () { return this._debuggerLaunched; }, enumerable: true, configurable: true }); Object.defineProperty(DebuggerManager.prototype, "isAttached", { get: function () { return !!this._rpc; }, enumerable: true, configurable: true }); DebuggerManager.prototype.createBreakpoint = function (docId, breakpointId, start, length, isBound, doc) { var sourceLocation = doc ? doc.createSourceLocation(start, length) : new Debugger.SourceLocation(docId, 1, 1); return new Debugger.Breakpoint(breakpointId, { start: start, length: length }, sourceLocation, toolwindowHelpers.createShortenedUrlText(this.editorWindow.getUrlFromDocId(docId)), isBound); }; DebuggerManager.prototype.createBreakpointFromInfo = function (info) { var _this = this; var breakpoint = this.createBreakpoint(info.docId, info.breakpointId, info.start, info.length, info.isBound, null); if(!info.isPseudoBreakpoint) { this.getDocument(info.docId).done(function (document) { if(document) { breakpoint.location = document.createSourceLocation(info.start, info.length); _this.breakpointController.breakpointChanged(breakpoint); _this.updateBreakpointLocations(info.docId, document); } }); } return breakpoint; }; DebuggerManager.prototype.updateBreakpointLocations = function (docId, document) { var bps = this.breakpointController.getBreakpoints(docId); for(var i = 0; i < bps.length; i++) { var breakpoint = bps[i]; var newBP = this.createBreakpoint(docId, breakpoint.breakpointId, breakpoint.rawLocation.start, breakpoint.rawLocation.length, breakpoint.isBound, document); this.breakpointController.resolveBreakpointById(breakpoint.breakpointId, newBP); } }; DebuggerManager.prototype.jsonDiagOMRpcMethodCall = function (method, params) { var _this = this; var promise = new Plugin.Promise(function (completed, error) { _this._rpcForDiagOM.jsonRpcMethodCall(method, params, completed, error); }); return promise; }; DebuggerManager.prototype.jsonRpcMethodCall = function (method, params) { var _this = this; var promise = new Plugin.Promise(function (completed, error) { _this._rpc.jsonRpcMethodCall(method, params, completed, error); }); return promise; }; DebuggerManager.prototype.executeOnTargetPage = function (expression) { if(this._rpcForDiagOM) { this.jsonDiagOMRpcMethodCall("executeOnTargetPage", [ expression ]); } else { this.jsonRpcMethodCall("executeOnTargetPage", [ expression ]); } }; DebuggerManager.prototype.enableDynamicDebugging = function () { Tools.Utility.Assert.IsTrue(this.isAttached, "Not attached"); return this.jsonRpcMethodCall("enableDynamicDebugging", []); }; DebuggerManager.prototype.getBreakpointIdFromSourceLocation = function (location) { var _this = this; return this.getDocument(location.docId).then(function (document) { Tools.Utility.Assert.HasValue(document, "A breakpoint has been searched for in a document which does not have a formatter."); var offset = document ? document.getSourceOffsetFromFormattedPosition(location.toFormatServiceIPosition()) : 0; return _this.jsonRpcMethodCall("getBreakpointIdFromSourceLocation", [ location.docId, offset ]); }); }; DebuggerManager.prototype.addBreakpoint = function (location, isPseudoBreakpoint) { var _this = this; return this.getDocument(location.docId).then(function (document) { Tools.Utility.Assert.HasValue(document, "A breakpoint has been added for a document which does not have a formatter."); var offset = document ? document.getSourceOffsetFromFormattedPosition(location.toFormatServiceIPosition()) : 0; return _this.jsonRpcMethodCall("addBreakpoint", [ location.docId, offset, null, false, isPseudoBreakpoint ]); }).then(function (info) { if(info.failed) { return null; } return Plugin.Promise.wrap(_this.createBreakpointFromInfo(info)); }); }; DebuggerManager.prototype.causeBreak = function (causeBreakAction, workerId) { return this.jsonRpcMethodCall("causeBreak", [ causeBreakAction, workerId ]); }; DebuggerManager.prototype.getSourceText = function (docId, start, length) { return this.jsonRpcMethodCall("getSourceText", [ docId, start, length ]); }; DebuggerManager.prototype.queueGetSourceText = function (docId, start, length) { var _this = this; Tools.Utility.Assert.HasValue(this._documents[docId], "queue received for doc that hasn't been added"); return this._documents[docId].queueGetSourceText(function (completed, progress) { _this.getDocument(docId, true).done(function (document) { if(document) { if(__rpcLog) { __rpcLog.push("updating editor for docId " + docId + " start: " + start + " length: " + length); } if(document.formatter && document.formatter.options.prettyPrint && document.formatter.sourceText) { progress(document.formatter.sourceText); } document.getFormattedText().done(function (textMapping) { if(textMapping.errorMessage) { Tools.Utility.Assert.Fail(textMapping.errorMessage); } var text = textMapping.text || Plugin.Resources.getString((document.source.isRootChild ? "OpenFileProgress" : "OpenFileFailed"), _this._documents[docId].source.url); if(start && length && _this.prettyPrintEnabledForActiveDocument !== Tristate.On) { _this.editorWindow.documentUpdated(docId, text.substring(start), true); } else { _this.editorWindow.documentUpdated(docId, text, false); } _this.updateBreakpointLocations(docId, document); completed(); }); } }); }); }; DebuggerManager.prototype.removeBreakpoint = function (breakpointId) { return this.jsonRpcMethodCall("removeBreakpoint", [ breakpointId ]); }; DebuggerManager.prototype.setBreakpointEnabledState = function (breakpointId, enabled) { return this.jsonRpcMethodCall("setBreakpointEnabledState", [ breakpointId, enabled ]); }; DebuggerManager.prototype.setBreakpointCondition = function (breakpointId, condition, isTracepoint) { return this.jsonRpcMethodCall("setBreakpointCondition", [ breakpointId, condition, isTracepoint ]); }; DebuggerManager.prototype.resume = function (breakResumeAction) { this._breakCompleted = false; this.callstackController.clear(); this.watchController.disableWatchesWindow(); this.editorWindow.removeExceptionViewZone(); return this.jsonRpcMethodCall("resume", [ breakResumeAction ]).then(function (result) { Plugin.F12.Debugger.notifyOnRun(); return result; }); }; DebuggerManager.prototype.setExceptionFilter = function (filter) { return this.jsonRpcMethodCall("setExceptionFilter", [ filter ]); }; DebuggerManager.prototype.getNextDocIdContainingMatch = function (query, docIds) { if(!docIds || docIds.length === 0) { return Plugin.Promise.wrap(""); } return this.queueMatchQuery(query, docIds, 0); }; DebuggerManager.prototype.queueMatchQuery = function (query, docIds, index) { var _this = this; return this.isDocContainingMatch(query, docIds[index]).then(function (matched) { if(matched) { return Plugin.Promise.wrap(docIds[index]); } else { ++index; if(index < docIds.length) { return _this.queueMatchQuery(query, docIds, index); } return Plugin.Promise.wrap(""); } }); }; DebuggerManager.prototype.isDocContainingMatch = function (query, docId) { var _this = this; var doc = this._documents[docId]; if(doc && doc.source && doc.formatter) { return doc.formatter.getFormattedText().then(function (formattedTextInfo) { if(formattedTextInfo.errorMessage) { Tools.Utility.Assert.Fail(formattedTextInfo.errorMessage); } var source = formattedTextInfo.text || Plugin.Resources.getString("OpenFileFailed", _this._documents[docId].source.url); if(source && source.toLowerCase().indexOf(query.toLowerCase()) !== -1) { return Plugin.Promise.wrap(true); } return Plugin.Promise.wrap(false); }); } if(this.isRuntimeDocument(docId)) { return this.jsonRpcMethodCall("isDocContainingMatch", [ query, docId ]); } var text = this.editorWindow.getDocText(docId); if(text && text.toLowerCase().indexOf(query.toLowerCase()) !== -1) { return Plugin.Promise.wrap(true); } return Plugin.Promise.wrap(false); }; DebuggerManager.prototype.getFrames = function (framesNeeded) { return this.jsonRpcMethodCall("getFrames", [ framesNeeded ]); }; DebuggerManager.prototype.getCurrentThreadDescription = function () { return this.jsonRpcMethodCall("getCurrentThreadDescription", []); }; DebuggerManager.prototype.getThreads = function () { return this.jsonRpcMethodCall("getThreads", []); }; DebuggerManager.prototype.eval = function (frameIndex, evalString) { return this.jsonRpcMethodCall("eval", [ frameIndex, evalString ]); }; DebuggerManager.prototype.getLocals = function (frameIndex) { return this.jsonRpcMethodCall("getLocals", [ frameIndex ]); }; DebuggerManager.prototype.getChildProperties = function (propertyId, start, length) { return this.jsonRpcMethodCall("getChildProperties", [ propertyId, start, length ]); }; DebuggerManager.prototype.getChildPropertiesCount = function (propertyId) { return this.jsonRpcMethodCall("getChildPropertiesCount", [ propertyId ]); }; DebuggerManager.prototype.setPropertyValueAsString = function (propertyId, value) { return this.jsonRpcMethodCall("setPropertyValueAsString", [ propertyId, value ]); }; DebuggerManager.prototype.triggerSourceRundown = function () { return this.jsonRpcMethodCall("triggerSourceRundown", []); }; DebuggerManager.prototype.canSetNextStatement = function (location) { var _this = this; return this.getDocument(location.docId).then(function (document) { Tools.Utility.Assert.HasValue(document, "Can set next statement has been called for a document which does not have a formatter."); var offset = document ? document.getSourceOffsetFromFormattedPosition(location.toFormatServiceIPosition()) : 0; return _this.jsonRpcMethodCall("canSetNextStatement", [ location.docId, offset ]); }); }; DebuggerManager.prototype.setNextStatement = function (location) { var _this = this; return this.getDocument(location.docId).then(function (document) { Tools.Utility.Assert.HasValue(document, "Set next statement has been called for a document which does not have a formatter."); var offset = document ? document.getSourceOffsetFromFormattedPosition(location.toFormatServiceIPosition()) : 0; return _this.jsonRpcMethodCall("setNextStatement", [ location.docId, offset ]); }); }; DebuggerManager.prototype.togglePrettyPrintEnabledForActiveDocument = function () { var _this = this; var promise = Plugin.Promise.wrap(false); if(!this.editorWindow) { return promise; } var docId = this.editorWindow.currentDocId; var doc = this._documents[docId]; if(!doc || doc.dirty || doc.hasTimerId()) { return promise; } var formatter = doc.formatter; if(!formatter) { return promise; } Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_PrettyPrint_Start); var unformattedPosition = null; var editorPosition = this.editorWindow.getEditorPosition(); if(editorPosition) { unformattedPosition = this.getUnformattedPosition(docId, editorPosition); } var options = formatter.options; options.prettyPrint = !options.prettyPrint; promise = doc.getFormattedText().then(function (textMapping) { var success = true; if(textMapping.errorMessage) { success = false; Tools.Utility.Assert.Fail(textMapping.errorMessage); } _this.updateBreakpointLocations(docId, doc); _this.callstackController.documentUpdated(docId, doc); _this.editorWindow.documentUpdated(docId, textMapping.text, false, null, unformattedPosition); Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_PrettyPrint_Stop); return success; }); return promise; }; Object.defineProperty(DebuggerManager.prototype, "prettyPrintEnabledForActiveDocument", { get: function () { if(!this.editorWindow) { return Tristate.Disabled; } var docId = this.editorWindow.currentDocId; var doc = this._documents[docId]; if(!doc) { return Tristate.Disabled; } var formatter = doc.formatter; if(!formatter) { return Tristate.Disabled; } return (formatter.options.prettyPrint ? Tristate.On : Tristate.Off); }, enumerable: true, configurable: true }); DebuggerManager.prototype.getUnformattedPosition = function (docId, editorPosition) { var formatterPosition = { line: editorPosition.lineNumber - 1, column: editorPosition.column - 1, file: 0 }; var textMapping = this._documents[docId].textMapping; if(textMapping) { formatterPosition = textMapping.getOriginalPosition(formatterPosition); } return formatterPosition; }; DebuggerManager.prototype.getFormattedPosition = function (docId, formatterPosition) { var textMapping = this._documents[docId].textMapping; if(textMapping) { var formatterPosition = textMapping.getMappedPosition(formatterPosition); } ; return { lineNumber: formatterPosition.line + 1, column: formatterPosition.column + 1 }; }; DebuggerManager.prototype.invalidateAllDocuments = function () { for(var docId in this._documents) { if(this.isRuntimeDocument(docId)) { this._documents[docId].dirty = true; } } }; DebuggerManager.prototype.isDocumentDirty = function (docId) { return this.isRuntimeDocument(docId) && this._documents[docId].dirty; }; DebuggerManager.prototype.getDocumentQueuePromise = function (docId) { if(this.isRuntimeDocument(docId) && this._documents[docId].hasTimerId()) { return this._documents[docId].timerPromise; } return Plugin.Promise.wrap(null); }; DebuggerManager.prototype.isRuntimeDocument = function (docId) { return this._documents.hasOwnProperty(docId); }; DebuggerManager.prototype.jsonRpcMethodReceive = function (method, params, response) { switch(method) { default: Tools.Utility.Assert.Fail("Unknown method '" + method + "'"); } }; DebuggerManager.prototype.jsonRpcNotificationReceive = function (event, params) { switch(event) { case "onAddDocuments": Tools.Utility.Assert.IsTrue(params && params.length !== 0); this.onAddDocuments(params); break; case "onRemoveDocuments": Tools.Utility.Assert.IsTrue(params && params.length !== 0); this.onRemoveDocuments(params); break; case "onUpdateDocuments": Tools.Utility.Assert.IsTrue(params && params.length !== 0); this.onUpdateDocuments(params); break; case "onBreak": Tools.Utility.Assert.AreEqual(5, params.length); this.onBreak(params[0], params[1], params[2], params[3], params[4]); break; case "onUnhandledException": Tools.Utility.Assert.AreEqual(4, params.length); this.onUnhandledException(params[0], params[1], params[2], params[3]); break; case "onResolveBreakpoint": Tools.Utility.Assert.AreEqual(2, params.length); this.onResolveBreakpoint(params[0], params[1]); break; case "onDebugOutput": Tools.Utility.Assert.AreEqual(1, params.length); this.onDebugOutput(params[0]); break; case "onAttachFailed": Tools.Utility.Assert.AreEqual(0, params.length); this.onAttachFailed(); break; case "onSetRootDocument": Tools.Utility.Assert.AreEqual(1, params.length); this.onSetRootDocument(params[0]); break; case "onWebWorkerStarted": Tools.Utility.Assert.AreEqual(1, params.length); this.onWebWorkerStarted(params[0]); break; case "onWebWorkerFinished": Tools.Utility.Assert.AreEqual(1, params.length); this.onWebWorkerFinished(params[0]); break; case "onRemoteScriptError": Tools.Utility.Assert.AreEqual(4, params.length); this.onRemoteScriptError(params[0], params[1], params[2], params[3]); break; default: Tools.Utility.Assert.Fail("Unknown event '" + event + "'"); } }; DebuggerManager.prototype.jsonDiagOMRpcMethodReceive = function (method, params, response) { }; DebuggerManager.prototype.jsonDiagOMRpcNotificationReceive = function (event, params) { switch(event) { case "onDocumentLoaded": Tools.Utility.Assert.AreEqual(8, params.length); this.onDocumentLoaded(params[0], params[1], params[2], params[3], params[4], params[5], params[6], params[7]); break; default: Tools.Utility.Assert.Fail("Unknown event '" + event + "'"); } }; DebuggerManager.prototype.onAddDocument = function (source) { var needText = false; var unmappedSource = this.editorWindow.getUnmappedDocSource(source.url); if(unmappedSource) { needText = this.editorWindow.updateDocId(source.docId, unmappedSource); unmappedSource.docId = source.docId; unmappedSource.mimeType = source.mimeType; unmappedSource.parentDocId = source.parentDocId; unmappedSource.isRootChild = source.isRootChild; source = unmappedSource; } Tools.Utility.Assert.IsTrue(this._documents[source.docId] == null, "Received multiple onAddDocument messages for document " + source.docId); this._documents[source.docId] = new Debugger.RunningDocument(source); this._documentOrder[source.docId] = this._documentOrderCount++; this.editorWindow.documentAdded(source); if(needText) { this.queueGetSourceText(source.docId, 0); } }; DebuggerManager.prototype.onAddDocuments = function (sources) { for(var i = 0; i < sources.length; ++i) { var source = sources[i]; this.onAddDocument(source); } }; DebuggerManager.prototype.getDocument = function (docId, startPrettyPrinting) { var _this = this; var doc = this._documents[docId]; Tools.Utility.Assert.HasValue(doc, "The requested document has not been loaded yet."); if(!!doc.formatter && doc.dirty === false) { return Plugin.Promise.wrap(doc); } var promise = new Plugin.Promise(function (completed, error) { doc.listeners.push(completed); }); if(doc.listeners.length == 1) { var originalText = doc.formatter && doc.formatter.sourceText && doc.formatter.sourceText.text; this.getSourceText(docId, originalText && originalText.length).done(function (text) { var formatter = doc.formatter || new Debugger.FormatService.Formatter(); if(originalText) { text = formatter.sourceText.text + text; } if(text.length > doc.source.length) { doc.source.length = text.length; } formatter.setDocument(text, doc.source.url, doc.source.mimeType, doc.source.headers, startPrettyPrinting).done(function () { doc.formatter = formatter; doc.getFormattedText().done(function (textMapping) { doc.dirty = false; doc.listeners.forEach(function (completed) { if(_this._documents.hasOwnProperty(docId)) { completed(doc); } else { completed(null); } }); doc.listeners = []; }); }); }); } return promise; }; DebuggerManager.prototype.onBreak = function (breakReason, description, errorId, firstChance, isWorker) { var _this = this; Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_OnBreak_Start); Plugin.F12.Debugger.notifyOnBreak(isWorker); Plugin.F12.bringPluginToForeground(); this.watchController.enableWatchesWindow(); this.getFrames(0).done(function (stackFrames) { var rawFrames = []; var promises = []; stackFrames.forEach(function (frame, frameIndex) { if(_this._documents.hasOwnProperty(frame.location.docId)) { var documentPromise = _this.getDocument(frame.location.docId).then(function (document) { var zeroBasedStart = document ? document.getFormattedPositionFromSourceOffset(frame.location.start) : Debugger.FormatService.Position.empty; var zeroBasedEnd = document ? document.getFormattedPositionFromSourceOffset(frame.location.start + frame.location.length) : Debugger.FormatService.Position.empty; var location = new Debugger.SourceLocation(frame.location.docId, zeroBasedStart.line + 1, zeroBasedStart.column + 1, zeroBasedEnd.line + 1, zeroBasedEnd.column + 1); var shortFileName = toolwindowHelpers.createShortenedUrlText(_this.editorWindow.getUrlFromDocId(frame.location.docId)); var stackFrame = new Debugger.StackFrame(frame.callFrameId, frame.functionName, shortFileName, frame.location, location); rawFrames[frameIndex] = stackFrame; }); promises.push(documentPromise); } else { var dummyStackFrame = new Debugger.StackFrame(frame.callFrameId, frame.functionName, "", frame.location, new Debugger.SourceLocation(frame.location.docId, 1, 1)); rawFrames[frameIndex] = dummyStackFrame; } }); _this.getCurrentThreadDescription().done(function (threadDescription) { if(!threadDescription.isWorker) { threadDescription.displayName = Plugin.Resources.getString("DebuggerMainFrame"); } Plugin.Promise.join(promises).then(function () { if(!_this._firstPageLoaded) { _this._ignoreNextSetRootDocument = true; } _this.callstackController.updateCallstackOnBreak(threadDescription, rawFrames).done(function () { _this._breakCompleted = true; if(breakReason === Debugger.BreakReason.Error) { _this.editorWindow.addExceptionViewZone(_this.callstackController.getCallstack(threadDescription.id).instructionPointerFrame.location, description); } _this.testEventObject.fireEvent("debuggerBroken"); Debugger.DebuggerTraceWriter.traceWriter.raiseEvent(Common.TraceEvents.Debugger_OnBreak_Stop); }); }); }); }); this.executionController.isExecutionPaused = true; }; DebuggerManager.prototype.onUnhandledException = function (docId, description, errorId, start) { this.getDocument(docId).done(function (document) { var zeroBasedStart = document ? document.getFormattedPositionFromSourceOffset(start) : Debugger.FormatService.Position.empty; var errorInfo = { messageId: "SCRIPT" + errorId, messageText: description, fileName: document && document.source ? document.source.url : null, lineNumber: zeroBasedStart.line, columnNumber: zeroBasedStart.column }; Plugin.F12.Communications.fireEvent("onUnhandledException", (F12).Host.Impl.PluginId.Console, [ errorInfo ]); }); }; DebuggerManager.prototype.onSetRootDocument = function (docId) { this._firstPageLoaded = true; if(this._ignoreNextSetRootDocument) { this._ignoreNextSetRootDocument = false; return; } this.editorWindow.openDocument(docId); }; DebuggerManager.prototype.onWebWorkerStarted = function (workerDescription) { this.callstackController.workerAdded(workerDescription); }; DebuggerManager.prototype.onWebWorkerFinished = function (workerId) { this.callstackController.workerRemoved(workerId); }; DebuggerManager.prototype.onRemoteScriptError = function (description, fileName, lineNumber, column) { window.reportError(description, fileName, lineNumber, "", column); }; DebuggerManager.prototype.showDocument = function (documentPath, oneBasedLine, oneBasedColumn, mimeType) { var _this = this; Plugin.F12.bringPluginToForeground(); if(!this._firstPageLoaded) { this._ignoreNextSetRootDocument = true; } var docId = this.editorWindow.getDocIdFromUrl(documentPath); if(this.editorWindow.isKnownDocId(docId)) { if(this.isRuntimeDocument(docId)) { this.getDocument(docId).then(function (document) { var position = document.textMapping.getMappedPosition({ line: oneBasedLine - 1, column: oneBasedColumn - 1, file: 0 }); _this.editorWindow.navigateTo(new Debugger.SourceLocation(docId, position.line + 1, position.column + 1)).done(function () { Plugin.F12.Communications.fireEvent("onNavigateToSourceComplete", (F12).Host.Impl.PluginId.Header); }); }); } else { this.editorWindow.navigateTo(new Debugger.SourceLocation(docId, oneBasedLine, oneBasedColumn)).done(function () { Plugin.F12.Communications.fireEvent("onNavigateToSourceComplete", (F12).Host.Impl.PluginId.Header); }); } } else { if(this._rpcForDiagOM) { var source = this.editorWindow.createUnmappedSource(documentPath, mimeType, length, false); this.editorWindow.documentAdded(source, true); this.editorWindow.openDocument(source.docId, Plugin.Resources.getString("OpenFileProgress", documentPath), true).done(function () { _this.jsonDiagOMRpcMethodCall("loadDocumentContent", [ source.docId, documentPath, oneBasedLine, oneBasedColumn, mimeType, !_this.executionController.isExecutionPaused ]); }); } } }; DebuggerManager.prototype.onDocumentLoaded = function (success, docId, url, content, line, column, mimeType, message) { var _this = this; if(!success) { content = Plugin.Resources.getString("OpenFileFailedDetail", url, message); } this.editorWindow.documentUpdated(docId, content, false, mimeType); window.setImmediate(function () { docId = _this.editorWindow.getDocIdFromUrl(url) || docId; _this.editorWindow.navigateTo(new Debugger.SourceLocation(docId, line, column)).then(function () { Plugin.F12.Communications.fireEvent("onNavigateToSourceComplete", (F12).Host.Impl.PluginId.Header); }); }); }; DebuggerManager.prototype.onDebugOutput = function (output) { }; DebuggerManager.prototype.onAttachFailed = function () { }; DebuggerManager.prototype.onRemoveDocuments = function (docIds) { for(var i = 0, count = docIds.length; i < count; ++i) { var docId = docIds[i]; var runningDocument = this._documents[docId]; Tools.Utility.Assert.HasValue(runningDocument, "onRemoveDocuments received for document not in table."); runningDocument.cancelPendingActions(); delete this._documents[docId]; delete this._documentOrder[docId]; this.executionController.removeAnyPseudoBreakpoint(docId); this.breakpointController.unresolveBreakpoints(docId); this.editorWindow.documentRemoved(docId); } }; DebuggerManager.prototype.onResolveBreakpoint = function (breakpointId, info) { var breakpoint = this.createBreakpointFromInfo(info); this.breakpointController.resolveBreakpointById(breakpointId, breakpoint); }; DebuggerManager.prototype.onUpdateDocuments = function (sources) { for(var i = 0; i < sources.length; ++i) { var source = sources[i]; var doc = this._documents[source.docId]; Tools.Utility.Assert.HasValue(doc, "onUpdateDocuments received for docId not yet added."); if(doc) { if(doc.source.url !== source.url) { var oldUrl = doc.source.url; doc.source.url = source.url; this.editorWindow.documentUrlChanged(source.docId, source.url, oldUrl); } if(doc.source.mimeType !== source.mimeType) { this.editorWindow.documentUpdated(source.docId, "", true, source.mimeType); } if(source.length - doc.source.length > 0) { doc.dirty = true; if(this.editorWindow.isDocumentOpen(source.docId)) { this.queueGetSourceText(source.docId); } } doc.source.length = source.length; } } }; return DebuggerManager; })(); Debugger.DebuggerManager = DebuggerManager; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=debuggerManager.js.map // CustomEvents.ts var F12; (function (F12) { (function (Tools) { "use strict"; var CustomEventObject = (function () { function CustomEventObject() { this.eventCallbacks = { }; } CustomEventObject.prototype.addEventListener = function (eventName, callback) { var callbacks = this.eventCallbacks[eventName]; if(!callbacks) { this.eventCallbacks[eventName] = new Array(); callbacks = this.eventCallbacks[eventName]; } callbacks.push(callback); }; CustomEventObject.prototype.addOneTimeListener = function (eventName, callback) { var _this = this; var eventCallback = function (data) { _this.removeEventListener(eventName, eventCallback); callback(data); }; this.addEventListener(eventName, eventCallback); }; CustomEventObject.prototype.removeEventListener = function (eventName, callback) { var callbacks = this.eventCallbacks[eventName]; if(callbacks) { callbacks.splice(callbacks.indexOf(callback), 1); } }; CustomEventObject.prototype.fireEvent = function (eventName, eventArgs) { if(this.eventCallbacks[eventName]) { var callbacks = this.eventCallbacks[eventName].slice(0); for(var i = 0; i < callbacks.length; i++) { callbacks[i](eventArgs); } } }; return CustomEventObject; })(); Tools.CustomEventObject = CustomEventObject; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=CustomEvents.js.map // debuggerShell.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; (function (DataSplitterStates) { DataSplitterStates._map = []; DataSplitterStates.ShowBothContainers = 1; DataSplitterStates.ShowTopContainer = 2; DataSplitterStates.ShowBottomContainer = 3; })(Debugger.DataSplitterStates || (Debugger.DataSplitterStates = {})); var DataSplitterStates = Debugger.DataSplitterStates; var DebuggerShell = (function () { function DebuggerShell() { var _this = this; this._vEditorSplitterRightPx = DebuggerShell.MIN_CONTROLS_WIDTH; this._hDataWindowsSplitterBottomPx = DebuggerShell.MIN_CONTROLS_HEIGHT; this._reportedToWatson = false; this._traceWriter = new Common.DefaultTraceWriter(); Plugin.addEventListener("pluginready", function () { Plugin.Tooltip.defaultTooltipContentToHTML = false; _this._traceWriter = new Common.TraceWriter(); }); Plugin.Promise.addEventListener("error", function (event) { if(isDebugBuild || !_this._reportedToWatson) { if(!event.detail.exception.ExceptionType || event.detail.exception.ExceptionType !== "UnexpectedResult") { Common.ErrorHandling.ReportErrorGivenStack(event.detail.exception); _this._reportedToWatson = true; } } }); toolwindowHelpers.registerErrorComponent("Debugger", this.onError.bind(this)); this._debuggerContent = document.getElementById("debuggerContent"); this._editorConsoleContainer = document.getElementById("editorConsoleContainer"); this._hEditorConsoleSplitter = document.getElementById("hEditorConsoleSplitter"); this._vEditorDataWindowsSplitter = document.getElementById("vEditorDataWindowsSplitter"); this._controlsSplitPane = document.getElementById("controlsSplitPane"); this._hDataWindowsSplitter = document.getElementById("hDataWindowsSplitter"); this._topDataWindowsParent = document.getElementById("topDataWindowsParent"); this._bottomDataWindowsParent = document.getElementById("bottomDataWindowsParent"); this._editor = document.getElementById("editor"); this._console = document.getElementById("console"); this._currentResizeClientRect = null; this._isShowingConsole = false; this.setupEditorDataWindowsSplitter(); this.setupEditorConsoleSplitter(); this.setupDataWindowsSplitter(); if(Plugin.F12) { Plugin.F12.addEventListener("hostinfochanged", function (e) { return _this.onHostInfoChanged(e); }); this.onHostInfoChanged(Plugin.F12.getHostInfo()); Plugin.F12.addEventListener("consolestateshown", function () { return _this.onConsoleShowHideStateChanged(true); }); Plugin.F12.addEventListener("consolestatehidden", function () { return _this.onConsoleShowHideStateChanged(false); }); this._editorConsoleContainerMsGridRowsCSSUserSetting = Plugin.F12.getRegEntryForF12(DebuggerShell.H_EDITOR_CONSOLE_SPLITTER_REG_KEY); this.onConsoleShowHideStateChanged(Plugin.F12.getIsShowingConsole()); Plugin.F12.addEventListener("activated", function () { return _this.setConsoleClientArea(); }); } this._topContainer = new Container(this); this._topDataWindowsParent.appendChild(this._topContainer.containerElement); this._bottomContainer = new Container(this); this._bottomDataWindowsParent.appendChild(this._bottomContainer.containerElement); this._topContainer.addTab("Watches", "WatchesWindowTitle", "WatchesWindowTooltip"); this._bottomContainer.addTab("Callstack", "CallstackWindowTitle", "CallstackWindowTooltip"); this._bottomContainer.addTab("BreakpointWindow", "BreakpointsWindowTitle", "BreakpointsWindowTooltip", -1); var debuggerTitle = Plugin.Resources.getString("DebuggerTitle"); (document.querySelector(".BPT-ToolTitle")).innerText = debuggerTitle; (document.querySelector(".BPT-ToolTitle")).setAttribute("aria-label", debuggerTitle); (document.querySelector("#root")).setAttribute("aria-label", debuggerTitle); this._debuggerManager = new Debugger.DebuggerManager(this); window.addEventListener("resize", function (e) { return _this.setConsoleClientArea(); }); document.addEventListener("keyup", function (e) { return _this.onKeyUpOrDown(e); }); document.addEventListener("keydown", function (e) { return _this.onKeyDown(e); }); if(Plugin.F12) { Plugin.F12.addEventListener("keydown", function (e) { return _this.onKeyUpOrDown(e); }); } } DebuggerShell.MIN_EDITOR_CONSOLE_HEIGHT = 120; DebuggerShell.EDITOR_CONSOLE_CONTAINER_MSGRIDROWS_CSS_DEFAULT = "3fr 5px 200px"; DebuggerShell.EDITOR_CONSOLE_CONTAINER_MSGRIDROWS_CSS_HIDDEN = "1fr 0fr 0fr"; DebuggerShell.MIN_CONTROLS_WIDTH = 260; DebuggerShell.MIN_CONTROLS_HEIGHT = 25; DebuggerShell.H_EDITOR_CONSOLE_SPLITTER_REG_KEY = "DebuggerHEditorConsoleSplitterPosition"; DebuggerShell.V_EDITOR_SPLITTER_REG_KEY = "DebuggerVEditorSplitterPosition"; DebuggerShell.H_DATA_WINDOWS_SPLITTER = "DebuggerHDataWindowsSplitterPosition"; DebuggerShell.WATCHES_WINDOW_TAB_INDEX = 0; DebuggerShell.CALLSTACK_WINDOW_TAB_INDEX = 0; DebuggerShell.BREAKPOINTS_WINDOW_TAB_INDEX = 1; Object.defineProperty(DebuggerShell.prototype, "bottomContainer", { get: function () { return this._bottomContainer; }, enumerable: true, configurable: true }); Object.defineProperty(DebuggerShell.prototype, "debuggerManager", { get: function () { return this._debuggerManager; }, enumerable: true, configurable: true }); Object.defineProperty(DebuggerShell.prototype, "topContainer", { get: function () { return this._topContainer; }, enumerable: true, configurable: true }); Object.defineProperty(DebuggerShell.prototype, "traceWriter", { get: function () { return this._traceWriter; }, enumerable: true, configurable: true }); DebuggerShell.prototype.getConsoleTop = function () { if(this._isShowingConsole) { return this._console.getBoundingClientRect().top; } else { return document.body.offsetHeight; } }; DebuggerShell.prototype.getEditorDimensions = function () { var width = this._editorConsoleContainer.offsetWidth; var height = this._editorConsoleContainer.offsetHeight - this._console.offsetHeight; return { width: width, height: height }; }; DebuggerShell.prototype.breakpointChanged = function (breakpoint, previousId) { if(this._bottomContainer.contentVisible && !this._debuggerManager.executionController.isExecutionPaused) { this._bottomContainer.switchToTab(DebuggerShell.BREAKPOINTS_WINDOW_TAB_INDEX, true); } }; DebuggerShell.prototype.breakpointAdded = function (breakpoint) { this.breakpointChanged(breakpoint); }; DebuggerShell.prototype.breakpointRemoved = function (breakpoint) { this.breakpointChanged(breakpoint); }; DebuggerShell.prototype.breakStateChanged = function (isBroken, isDisabled) { if(isBroken) { if(!this._bottomContainer.contentVisible) { this.toggleDataSplitterOrientation(DataSplitterStates.ShowBothContainers); } this._bottomContainer.switchToTab(DebuggerShell.CALLSTACK_WINDOW_TAB_INDEX, true); } }; DebuggerShell.prototype.onKeyDown = function (e) { if(e.ctrlKey && !e.altKey && !e.shiftKey) { if(e.keyCode === Common.KeyCodes.TAB) { var tabControl = this._debuggerManager.editorWindow.tabControl; tabControl.selectNextTab(); e.preventDefault(); return false; } } if(e.ctrlKey && !e.altKey && e.shiftKey) { if(e.keyCode === Common.KeyCodes.TAB) { var tabControl = this._debuggerManager.editorWindow.tabControl; tabControl.selectPreviousTab(); e.preventDefault(); return false; } } return true; }; DebuggerShell.prototype.onKeyUpOrDown = function (e) { if(e.ctrlKey && e.shiftKey && !e.altKey) { if(e.keyCode === Common.KeyCodes.F11) { this._debuggerManager.breakpointController.toggleAll(); return false; } } if(e.ctrlKey && e.altKey && !e.shiftKey) { if(e.keyCode === Common.KeyCodes.B) { if(!this._bottomContainer.contentVisible) { this.toggleDataSplitterOrientation(DataSplitterStates.ShowBothContainers); } this._bottomContainer.switchToTab(DebuggerShell.BREAKPOINTS_WINDOW_TAB_INDEX); return false; } if(e.keyCode === Common.KeyCodes.C) { if(!this._bottomContainer.contentVisible) { this.toggleDataSplitterOrientation(DataSplitterStates.ShowBothContainers); } this._bottomContainer.switchToTab(DebuggerShell.CALLSTACK_WINDOW_TAB_INDEX); return false; } if(e.keyCode === Common.KeyCodes.W) { if(!this._topContainer.contentVisible) { this.toggleDataSplitterOrientation(DataSplitterStates.ShowBothContainers); } this._topContainer.switchToTab(DebuggerShell.WATCHES_WINDOW_TAB_INDEX); return false; } if(e.keyCode === Common.KeyCodes.T) { this.toggleDataSplitterOrientation(); return false; } } if(e.ctrlKey && !e.altKey && !e.shiftKey) { if(e.keyCode === Common.KeyCodes.E) { var position = this._debuggerManager.editorWindow.getEditorPosition(); if(position) { this._debuggerManager.editorWindow.goToLine(position.lineNumber + "," + position.column); } return false; } if(e.keyCode === Common.KeyCodes.W) { this._debuggerManager.watchController.addWatchByCurrentEditorPosition(); return false; } if(e.keyCode === Common.KeyCodes.F4) { var tabControl = this._debuggerManager.editorWindow.tabControl; if(tabControl.selectedItem) { tabControl.removeTab(tabControl.selectedItem); } return false; } } if(!e.ctrlKey && e.altKey && !e.shiftKey) { if(e.keyCode === Common.KeyCodes.MULTIPLY) { if(this._debuggerManager.executionController.isExecutionPaused) { this._debuggerManager.callstackController.showNextStatement(); } return false; } } return true; }; DebuggerShell.prototype.setupDataWindowsSplitter = function () { var _this = this; this._msGridRowsStyleBoth = this._editorConsoleContainer.style.msGridRows; this._hDataWindowsSplitter.addEventListener("mousedown", function (ev) { var prevCursor = document.body.style.cursor; document.body.style.cursor = "n-resize"; var mouseUpHandler = function (e) { _this._currentResizeClientRect = null; Plugin.F12.setRegEntryForF12(DebuggerShell.H_DATA_WINDOWS_SPLITTER, "" + _this._hDataWindowsSplitterBottomPx); document.body.style.cursor = prevCursor; document.removeEventListener("mousemove", mouseMoveHandler); document.removeEventListener("mouseup", mouseUpHandler); }; var mouseMoveHandler = function (e) { if(_this._currentResizeClientRect === null) { _this._currentResizeClientRect = _this._controlsSplitPane.getBoundingClientRect(); } var rect = _this._currentResizeClientRect; var bottomPx = rect.height - e.clientY + rect.top; if((e.clientY - rect.top) < DebuggerShell.MIN_CONTROLS_HEIGHT) { _this._hDataWindowsSplitterBottomPx = (rect.height - DebuggerShell.MIN_CONTROLS_HEIGHT); _this._controlsSplitPane.style.msGridRows = DebuggerShell.MIN_CONTROLS_HEIGHT + "fr 5px " + _this._hDataWindowsSplitterBottomPx + "fr"; _this._topContainer.contentVisible = false; _this._bottomContainer.contentVisible = true; } else if(bottomPx > DebuggerShell.MIN_CONTROLS_HEIGHT) { _this._hDataWindowsSplitterBottomPx = bottomPx; _this._controlsSplitPane.style.msGridRows = (e.clientY - rect.top) + "fr 5px " + _this._hDataWindowsSplitterBottomPx + "fr"; _this._msGridRowsStyleBoth = _this._controlsSplitPane.style.msGridRows; _this._topContainer.contentVisible = true; _this._bottomContainer.contentVisible = true; } else { _this._hDataWindowsSplitterBottomPx = DebuggerShell.MIN_CONTROLS_HEIGHT; _this._controlsSplitPane.style.msGridRows = (rect.height - DebuggerShell.MIN_CONTROLS_HEIGHT) + "fr 5px " + _this._hDataWindowsSplitterBottomPx + "fr"; _this._topContainer.contentVisible = true; _this._bottomContainer.contentVisible = false; } _this._debuggerManager.watchController.layout(); _this._debuggerManager.callstackController.layout(); }; document.addEventListener("mousemove", mouseMoveHandler); document.addEventListener("mouseup", mouseUpHandler); }); var splitterPosition = Plugin.F12.getRegEntryForF12(DebuggerShell.H_DATA_WINDOWS_SPLITTER); if(splitterPosition) { this._hDataWindowsSplitterBottomPx = parseInt(splitterPosition, 10); if(!isNaN(this._hDataWindowsSplitterBottomPx)) { this._controlsSplitPane.style.msGridRows = (this._debuggerContent.getBoundingClientRect().height - this._hDataWindowsSplitterBottomPx) + "fr 5px " + this._hDataWindowsSplitterBottomPx + "fr"; } } this._hDataWindowsSplitter.addEventListener("dblclick", function (ev) { _this.toggleDataSplitterOrientation(); }); }; DebuggerShell.prototype.toggleDataSplitterOrientation = function (targetDataSplitterState) { var rect = this._controlsSplitPane.getBoundingClientRect(); var state; if(targetDataSplitterState) { state = targetDataSplitterState; } else { if(this._topContainer.contentVisible && this._bottomContainer.contentVisible) { state = DataSplitterStates.ShowTopContainer; } else if(this._topContainer.contentVisible && !this._bottomContainer.contentVisible) { state = DataSplitterStates.ShowBottomContainer; } else if(!this._topContainer.contentVisible && this._bottomContainer.contentVisible) { state = DataSplitterStates.ShowBothContainers; } else if(!this._topContainer.contentVisible && !this._bottomContainer.contentVisible) { Tools.Utility.Assert.Fail(); } } if(state === DataSplitterStates.ShowTopContainer) { this._hDataWindowsSplitterBottomPx = DebuggerShell.MIN_CONTROLS_HEIGHT; this._controlsSplitPane.style.msGridRows = (rect.height - DebuggerShell.MIN_CONTROLS_HEIGHT) + "fr 5px " + this._hDataWindowsSplitterBottomPx + "fr"; this._topContainer.contentVisible = true; this._bottomContainer.contentVisible = false; } else if(state === DataSplitterStates.ShowBottomContainer) { this._hDataWindowsSplitterBottomPx = rect.height - DebuggerShell.MIN_CONTROLS_HEIGHT; this._controlsSplitPane.style.msGridRows = DebuggerShell.MIN_CONTROLS_HEIGHT + "fr 5px " + this._hDataWindowsSplitterBottomPx + "fr"; this._topContainer.contentVisible = false; this._bottomContainer.contentVisible = true; } else if(state === DataSplitterStates.ShowBothContainers) { var gridRowsValue = this._msGridRowsStyleBoth.split(" "); this._hDataWindowsSplitterBottomPx = parseInt(gridRowsValue[gridRowsValue.length - 1], 10); this._controlsSplitPane.style.msGridRows = this._msGridRowsStyleBoth; this._topContainer.contentVisible = true; this._bottomContainer.contentVisible = true; } Plugin.F12.setRegEntryForF12(DebuggerShell.H_DATA_WINDOWS_SPLITTER, "" + this._hDataWindowsSplitterBottomPx); this._debuggerManager.watchController.layout(); this._debuggerManager.callstackController.layout(); }; DebuggerShell.prototype.setupEditorConsoleSplitter = function () { var _this = this; this._hEditorConsoleSplitter.addEventListener("mousedown", function (ev) { var prevCursor = document.body.style.cursor; document.body.style.cursor = "n-resize"; var mouseUpHandler = function (e) { _this._editorConsoleContainerMsGridRowsCSSUserSetting = _this._editorConsoleContainer.style.msGridRows; Plugin.F12.setRegEntryForF12(DebuggerShell.H_EDITOR_CONSOLE_SPLITTER_REG_KEY, _this._editorConsoleContainerMsGridRowsCSSUserSetting); _this._currentResizeClientRect = null; _this._debuggerManager.editorWindow.layout(); _this.setConsoleClientArea(); document.body.style.cursor = prevCursor; document.removeEventListener("mousemove", mouseMoveHandler); document.removeEventListener("mouseup", mouseUpHandler); }; var mouseMoveHandler = function (e) { if(_this._currentResizeClientRect === null) { _this._currentResizeClientRect = _this._editorConsoleContainer.getBoundingClientRect(); } var rect = _this._currentResizeClientRect; var bottomPx = rect.height - e.clientY + rect.top; if((e.clientY - rect.top) < DebuggerShell.MIN_EDITOR_CONSOLE_HEIGHT) { _this._editorConsoleContainer.style.msGridRows = DebuggerShell.MIN_EDITOR_CONSOLE_HEIGHT + "fr 5px " + (rect.height - DebuggerShell.MIN_EDITOR_CONSOLE_HEIGHT) + "fr"; } else if(bottomPx > DebuggerShell.MIN_EDITOR_CONSOLE_HEIGHT) { _this._editorConsoleContainer.style.msGridRows = (e.clientY - rect.top) + "fr 5px " + bottomPx + "fr"; } else { _this._editorConsoleContainer.style.msGridRows = (rect.height - DebuggerShell.MIN_EDITOR_CONSOLE_HEIGHT) + "fr 5px " + DebuggerShell.MIN_EDITOR_CONSOLE_HEIGHT + "fr"; } _this.setConsoleClientArea(); _this._debuggerManager.editorWindow.layout(); }; document.addEventListener("mousemove", mouseMoveHandler); document.addEventListener("mouseup", mouseUpHandler); }); }; DebuggerShell.prototype.setupEditorDataWindowsSplitter = function () { var _this = this; this._vEditorDataWindowsSplitter.addEventListener("mousedown", function (ev) { var prevCursor = document.body.style.cursor; document.body.style.cursor = "w-resize"; var mouseUpHandler = function (e) { _this._currentResizeClientRect = null; Plugin.F12.setRegEntryForF12(DebuggerShell.V_EDITOR_SPLITTER_REG_KEY, "" + _this._vEditorSplitterRightPx); _this._debuggerManager.editorWindow.layout(); _this._debuggerManager.watchController.layout(); _this._debuggerManager.callstackController.layout(); _this.setConsoleClientArea(); document.body.style.cursor = prevCursor; document.removeEventListener("mousemove", mouseMoveHandler); document.removeEventListener("mouseup", mouseUpHandler); }; var mouseMoveHandler = function (e) { if(_this._currentResizeClientRect === null) { _this._currentResizeClientRect = _this._debuggerContent.getBoundingClientRect(); } var rect = _this._currentResizeClientRect; var rightPx = rect.width - e.clientX; if(rightPx > DebuggerShell.MIN_CONTROLS_WIDTH) { _this._debuggerContent.style.msGridColumns = e.clientX + "fr 5px " + rightPx + "fr"; _this._vEditorSplitterRightPx = rightPx; } else { _this._debuggerContent.style.msGridColumns = (rect.width - DebuggerShell.MIN_CONTROLS_WIDTH) + "fr 5px " + DebuggerShell.MIN_CONTROLS_WIDTH + "fr"; _this._vEditorSplitterRightPx = DebuggerShell.MIN_CONTROLS_WIDTH; } _this.setConsoleClientArea(); _this._debuggerManager.editorWindow.layout(); _this._debuggerManager.watchController.layout(); _this._debuggerManager.callstackController.layout(); }; document.addEventListener("mousemove", mouseMoveHandler); document.addEventListener("mouseup", mouseUpHandler); }); var splitterPosition = Plugin.F12.getRegEntryForF12(DebuggerShell.V_EDITOR_SPLITTER_REG_KEY); if(splitterPosition) { this._vEditorSplitterRightPx = parseInt(splitterPosition, 10); if(!isNaN(this._vEditorSplitterRightPx)) { this._debuggerContent.style.msGridColumns = (this._debuggerContent.getBoundingClientRect().width - this._vEditorSplitterRightPx) + "fr 5px " + this._vEditorSplitterRightPx + "fr"; } } }; DebuggerShell.prototype.onError = function (message, file, line, additionalInfo, column) { try { if(file) { var parts = file.split("/"); if(parts.length > 0) { file = parts[parts.length - 1]; } } var errorMessage = toolwindowHelpers.loadString("DebuggerScriptError") + "\r\n" + toolwindowHelpers.loadString("ScriptErrorMessage", [ message ]) + "\r\n" + toolwindowHelpers.loadString("ScriptErrorFile", [ file ]) + "\r\n" + toolwindowHelpers.loadString("ScriptErrorLine", [ line ]) + "," + column + "\r\n" + additionalInfo; alert(errorMessage); } catch (ex) { } }; DebuggerShell.prototype.onHostInfoChanged = function (e) { var controls = document.getElementById("searchBoxBorder"); var scaledControlAreaWidth = e.controlAreaWidth * (screen.logicalXDPI / screen.deviceXDPI); controls.style.marginRight = scaledControlAreaWidth + "px"; }; DebuggerShell.prototype.onConsoleShowHideStateChanged = function (showing) { this._isShowingConsole = showing; if(this._isShowingConsole) { this._console.style.display = ""; this._hEditorConsoleSplitter.style.display = ""; if(this._editorConsoleContainerMsGridRowsCSSUserSetting) { this._editorConsoleContainer.style.msGridRows = this._editorConsoleContainerMsGridRowsCSSUserSetting; } else { this._editorConsoleContainer.style.msGridRows = DebuggerShell.EDITOR_CONSOLE_CONTAINER_MSGRIDROWS_CSS_DEFAULT; } this.setConsoleClientArea(); } else { this._editorConsoleContainer.style.msGridRows = DebuggerShell.EDITOR_CONSOLE_CONTAINER_MSGRIDROWS_CSS_HIDDEN; this._console.style.display = "none"; this._hEditorConsoleSplitter.style.display = "none"; } if(this._debuggerManager && this._debuggerManager.editorWindow) { this._debuggerManager.editorWindow.layout(); } }; DebuggerShell.prototype.setConsoleClientArea = function () { if(this._isShowingConsole && Plugin.F12) { var rect = this._console.getBoundingClientRect(); Plugin.F12.setConsoleClientArea(rect.left, rect.top, rect.right, rect.bottom); } }; return DebuggerShell; })(); Debugger.DebuggerShell = DebuggerShell; var Container = (function () { function Container(shell) { this._tabs = []; this._activeIndex = -1; this.containerElement = document.createElement("div"); this.tabStrip = document.createElement("div"); this.tabStrip.className = "tabStrip"; this.tabStrip.setAttribute("role", "tablist"); this.containerElement.className = "controlsContainer"; this.containerElement.appendChild(this.tabStrip); this.contentPane = document.createElement("div"); this.contentPane.className = "contentPane"; this.containerElement.appendChild(this.contentPane); this.contentVisible = true; this._shell = shell; } Container.prototype.addTab = function (id, titleResourceId, tooltipResourceId, tabIndex) { var _this = this; var title = Plugin.Resources.getString(titleResourceId); var tooltip = Plugin.Resources.getString(tooltipResourceId); var titleElement = document.createElement("span"); titleElement.id = "tab-" + id; titleElement.className = "tabTitle"; titleElement.innerText = title; titleElement.tabIndex = tabIndex ? tabIndex : 1; titleElement.setAttribute("data-plugin-vs-tooltip", tooltip); titleElement.setAttribute("aria-label", tooltip); titleElement.setAttribute("role", "tab"); var index = this._tabs.length; var selectHandler = function (e) { _this.switchToTab(index); if(!_this.contentVisible) { _this.contentVisible = true; _this._shell.toggleDataSplitterOrientation(DataSplitterStates.ShowBothContainers); } }; titleElement.addEventListener("click", selectHandler); titleElement.addEventListener("focus", selectHandler); titleElement.addEventListener("keydown", function (e) { if(e.keyCode === Common.KeyCodes.SPACE || e.keyCode === Common.KeyCodes.ENTER) { _this.switchToTab(index); if(!_this.contentVisible) { _this.contentVisible = true; _this._shell.toggleDataSplitterOrientation(DataSplitterStates.ShowBothContainers); } } else if(e.keyCode === Common.KeyCodes.ARROW_LEFT) { if(index > 0) { _this.switchToTab(index - 1); } else if(index === 0) { _this.switchToTab(_this._tabs.length - 1); } } else if(e.keyCode === Common.KeyCodes.ARROW_RIGHT) { if(index < _this._tabs.length - 1) { _this.switchToTab(index + 1); } else if(index === _this._tabs.length - 1) { _this.switchToTab(0); } } }); this.tabStrip.appendChild(titleElement); var controlContents = document.getElementById(id); controlContents.classList.add("controlContents"); this.contentPane.appendChild(controlContents); this._tabs.push({ titleElement: titleElement, contentElement: controlContents }); if(this._activeIndex === -1) { this._activeIndex = 0; this._tabs[this._activeIndex].contentElement.classList.add("controlVisible"); this._tabs[this._activeIndex].titleElement.classList.add("selected"); } }; Container.prototype.switchToTab = function (index, retainFocus) { if(this._tabs[index]) { if(this._activeIndex !== index) { this._tabs[this._activeIndex].contentElement.classList.remove("controlVisible"); this._tabs[this._activeIndex].titleElement.classList.remove("selected"); this._tabs[this._activeIndex].titleElement.tabIndex = -1; this._activeIndex = index; this._tabs[this._activeIndex].contentElement.classList.add("controlVisible"); this._tabs[this._activeIndex].titleElement.classList.add("selected"); this._tabs[this._activeIndex].titleElement.tabIndex = 1; } if(!retainFocus) { this._tabs[this._activeIndex].titleElement.focus(); } } }; return Container; })(); Debugger.Container = Container; Debugger.DebuggerTraceWriter; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); var debuggerShellForTestContractsOnly; //@ sourceMappingURL=debuggerShell.js.map // App.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var DebuggerApp = (function (_super) { __extends(DebuggerApp, _super); function DebuggerApp() { _super.apply(this, arguments); } DebuggerApp.prototype.onStartup = function () { var debuggerShell = new Debugger.DebuggerShell(); debuggerShellForTestContractsOnly = debuggerShell; F12.Tools.Debugger.DebuggerTraceWriter = debuggerShellForTestContractsOnly; }; return DebuggerApp; })(Common.App); Debugger.App = new DebuggerApp(); })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=App.js.map // FilePickerItem.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var FilePickerItem = (function (_super) { __extends(FilePickerItem, _super); function FilePickerItem(source) { _super.call(this, null, false, false, false, null, "listview-grid-cell-clicksection"); Tools.Utility.Assert.HasValue(source, "FilePickerItem source is required"); this._source = source; this._childCount = 0; this._displayName = toolwindowHelpers.createShortenedUrlText(this._source.url); this._docId = this._source.docId; this._unsortedChildren = []; } FilePickerItem.DYNAMIC_SCRIPTS = "custom/dynamicScript"; Object.defineProperty(FilePickerItem.prototype, "source", { get: function () { return this._source; }, enumerable: true, configurable: true }); Object.defineProperty(FilePickerItem.prototype, "docId", { get: function () { return this._docId; }, enumerable: true, configurable: true }); Object.defineProperty(FilePickerItem.prototype, "displayName", { get: function () { return this._displayName; }, enumerable: true, configurable: true }); Object.defineProperty(FilePickerItem.prototype, "hasChildren", { get: function () { return this._childCount > 0 || (this.dynamicDocumentsNode && this.dynamicDocumentsNode.hasChildren); }, enumerable: true, configurable: true }); Object.defineProperty(FilePickerItem.prototype, "htmlLines", { get: function () { if(!this._htmlLines) { this._htmlLines = this.generateHtmlLines(); } return this._htmlLines; }, enumerable: true, configurable: true }); FilePickerItem.prototype.addChild = function (item) { if(FilePickerItem.isNumber(item.source.id)) { this._unsortedChildren[item.source.id] = item; ++this._childCount; this._sortedChildren = null; } }; FilePickerItem.prototype.removeChild = function (item) { if(FilePickerItem.isNumber(item.source.id)) { delete this._unsortedChildren[item.source.id]; --this._childCount; this._sortedChildren = null; } }; Object.defineProperty(FilePickerItem.prototype, "children", { get: function () { this.ensureChildrenSorted(); if(this.dynamicDocumentsNode) { return this._sortedChildren.concat([ this.dynamicDocumentsNode ]); } return this._sortedChildren; }, enumerable: true, configurable: true }); FilePickerItem.prototype.getChildren = function (proxy, onComplete) { onComplete(this.children); }; FilePickerItem.prototype.refresh = function () { this._displayName = toolwindowHelpers.createShortenedUrlText(this._source.url); this._htmlLines = null; }; FilePickerItem.prototype.ensureChildrenSorted = function () { var _this = this; if(!this._sortedChildren) { this._sortedChildren = new Array(this._childCount); var i = 0; this._unsortedChildren.forEach(function (value, index, array) { _this._sortedChildren[i++] = value; }); this._sortedChildren.sort(function (a, b) { return toolwindowHelpers.naturalSort(a._displayName + a._docId, b._displayName + b._docId); }); } }; FilePickerItem.prototype.generateHtmlLines = function () { var cssClass; switch(this._source.mimeType) { case "text/html": cssClass = "htmlFile"; break; case "text/css": cssClass = "cssFile"; break; case FilePickerItem.DYNAMIC_SCRIPTS: cssClass = "filesNode"; break; case "text/javascript": default: cssClass = "scriptFile"; } ; return [ "
      " + toolwindowHelpers.htmlEscape(this._displayName) + "
      " ]; }; FilePickerItem.isNumber = function isNumber(value) { return typeof value === "number" && !isNaN(value); }; return FilePickerItem; })(Common.ObjectView.TreeViewItem); Debugger.FilePickerItem = FilePickerItem; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=FilePickerItem.js.map // StringMultiMap.ts var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var StringMultiMap = (function () { function StringMultiMap() { this._internalMap = { }; } StringMultiMap.prototype.getFirstValue = function (key) { var list = this._internalMap[key]; if(list && list.length > 0) { return list[0]; } return null; }; StringMultiMap.prototype.getValues = function (key) { return this._internalMap[key] || []; }; StringMultiMap.prototype.add = function (key, value) { this._internalMap[key] = this._internalMap[key] || []; if(this._internalMap[key].indexOf(value) === -1) { this._internalMap[key].push(value); } }; StringMultiMap.prototype.remove = function (key, value) { var list = this._internalMap[key]; if(list) { var index = list.indexOf(value); if(index >= 0) { list.splice(index, 1); return true; } } return false; }; return StringMultiMap; })(); Debugger.StringMultiMap = StringMultiMap; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=StringMultiMap.js.map { "start_url": "debugger.html", "domain": "http://microsoft.com", "name": "Debugger", "version": "1.0", "f12": { "localized_tab_resource": "DebuggerTitle", "localized_tooltip_id": 201, "tab_image": "tabIcon.png", "resource_aliases" : { "Debugger": { "is_default" : true }, "Common": { } }, "themed_images": { "f12-debugger-image-search": { "bitmap_source": "images\\search.png", "background_color": "plugin-font-editor-background-color" }, "f12-image-host-error-alert": { "bitmap_source": "..\\pluginhost\\theme\\i_alerterror.png", "background_color": "plugin-font-editor-background-color" }, "f12-image-host-error-close": { "bitmap_source": "..\\pluginhost\\theme\\closeErrorBox.png", "background_color": "plugin-font-editor-background-color" }, "f12-image-host-error-help": { "bitmap_source": "..\\pluginhost\\theme\\helpErrorBox.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-toolbar-button-image-continue": { "bitmap_source": "images\\continue.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-toolbar-button-image-break-all": { "bitmap_source": "images\\breakAll.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-toolbar-button-image-step-into": { "bitmap_source": "images\\stepInto.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-toolbar-button-image-step-over": { "bitmap_source": "images\\stepOver.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-toolbar-button-image-step-out": { "bitmap_source": "images\\stepOut.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-toolbar-button-image-break-worker": { "bitmap_source": "images\\breakWorker.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-toolbar-button-image-toggle-pretty-print": { "bitmap_source": "images\\togglePrettyPrint.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-toolbar-button-image-toggle-word-wrap": { "bitmap_source": "images\\toggleWordWrap.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-toolbar-button-image-break-on-exceptions": { "bitmap_source": "images\\breakOnExceptions.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-image-script-file": { "bitmap_source": "images\\scriptfileicon.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-image-html-file": { "bitmap_source": "images\\htmlfileicon.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-image-breakpoint": { "bitmap_source": "Breakpoints\\images\\breakpointGlyph.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-image-breakpoint-conditional": { "bitmap_source": "Breakpoints\\images\\conditionalBreakpoint.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-image-breakpoint-delete-all": { "bitmap_source": "Breakpoints\\images\\deleteAllBreakpoints.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-image-breakpoint-delete-current": { "bitmap_source": "Breakpoints\\images\\deleteCurrentBreakpoint.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-image-breakpoint-disabled": { "bitmap_source": "Breakpoints\\images\\breakpointDisabled.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-image-breakpoint-edit-current": { "bitmap_source": "Breakpoints\\images\\editCurrentBreakpoint.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-image-breakpoint-select-all": { "bitmap_source": "Breakpoints\\images\\selectAllBreakpoints.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-image-breakpoint-tracepoint": { "bitmap_source": "Breakpoints\\images\\tracepointBreakpoint.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-image-breakpoint-unbound": { "bitmap_source": "Breakpoints\\images\\breakpointUnbound.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-image-callstack-active-frame": { "bitmap_source": "Callstack\\images\\activeFrameGlyph.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-image-callstack-instruction-pointer": { "bitmap_source": "Callstack\\images\\instructionPointerGlyph.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-image-callstack-pause-worker": { "bitmap_source": "Callstack\\images\\pauseWorker.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-image-css-file": { "bitmap_source": "images\\cssfileicon.png", "background_color": "plugin-font-editor-background-color" }, "f12-image-common-icons": { "bitmap_source": "..\\Common\\images\\common_icons.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-image-file-picker": { "bitmap_source": "images\\filepicker.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-image-files-node": { "bitmap_source": "images\\filesnodeicon.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-image-find-next": { "bitmap_source": "images\\i_next.png", "background_color": "plugin-searchcontrol-mouseover-background-background-color" }, "f12-debugger-image-find-previous": { "bitmap_source": "images\\i_previous.png", "background_color": "plugin-searchcontrol-mouseover-background-background-color" }, "f12-debugger-image-grid-control-add-row": { "bitmap_source": "..\\Common\\images\\add_row.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-image-grid-control-column-move": { "bitmap_source": "..\\Common\\images\\columnmove.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-images-item-collapsed": { "bitmap_source": "images\\itemCollapsedIcon.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-images-item-expanded": { "bitmap_source": "images\\itemExpandedIcon.png", "background_color": "plugin-font-editor-background-color" }, "f12-image-misc-icons": { "bitmap_source": "..\\Common\\images\\misc_icons.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-image-tab-control-close": { "bitmap_source": "..\\Common\\images\\tabclose.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-image-tab-control-next": { "bitmap_source": "images\\nextTab.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-image-tab-control-previous": { "bitmap_source": "images\\prevTab.png", "background_color": "plugin-font-editor-background-color" }, "f12-image-tree-icons": { "bitmap_source": "..\\Common\\images\\tree_icons.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-image-watches-add-watch": { "bitmap_source": "Watches\\images\\addWatch.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-image-watches-delete-watch": { "bitmap_source": "Watches\\images\\deleteWatch.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-image-watches-delete-all": { "bitmap_source": "Watches\\images\\deleteAll.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-image-watches-function": { "bitmap_source": "images\\functionIcon.png", "background_color": "plugin-font-editor-background-color" }, "f12-debugger-image-watches-not-a-function": { "bitmap_source": "images\\notAFunctionIcon.png", "background_color": "plugin-font-editor-background-color" } } }, "file_aliases": { "PerformanceTraceExtension": { "path": "PerformanceTrace.dll", "optional": true } } } #BreakpointWindow { width: 100%; height: 100%; } #BreakpointWindow > .windowtoolbar { -ms-grid-columns: 1fr auto auto; display: -ms-grid; } #BreakpointWindow > .windowtoolbar > #deleteAllBreakpointsButton { -ms-grid-column: 2; } #BreakpointWindow > .windowtoolbar > #deleteAllBreakpointsButton > .buttonIcon { background-image: url('Breakpoints/images/deleteAllBreakpoints.png'); /*[url({f12-debugger-image-breakpoint-delete-all})]*/ } #BreakpointWindow > .windowtoolbar > #toggleAllBreakpointsButton { -ms-grid-column: 3; } #BreakpointWindow > .windowtoolbar > #toggleAllBreakpointsButton > .buttonIcon { background-image: url('Breakpoints/images/selectAllBreakpoints.png'); /*[url({f12-debugger-image-breakpoint-select-all})]*/ } #BreakpointWindow > .breakpointgrid { overflow: auto; height: calc(100% - 20px); width: 100%; } #BreakpointWindow .bpRow { display: -ms-grid; -ms-grid-columns: 13px 8px 20px 8px 1fr 42px; -ms-grid-rows: auto; padding: 0px 5px 2px 7px; } #BreakpointWindow .bpRow.selected { background-color: TRANSPARENT; /*[{plugin-debugger-grid-row-selected-background-color rgba(0.2)}]*/ } #BreakpointWindow .bpRow:hover { background-color: TRANSPARENT; /*[{plugin-debugger-grid-row-hover-background-color}]*/ } #BreakpointWindow .bpRow.selected:hover { background-color: TRANSPARENT; /*[{plugin-debugger-grid-row-selected-background-color rgba(0.2)}]*/ } #BreakpointWindow .bpRow.contextTarget { background-color: TRANSPARENT; /*[{plugin-debugger-grid-row-hover-background-color}]*/ } #BreakpointWindow .bpRow .bpCheckbox { display: inline-block; padding: 0; margin: 0px; -ms-grid-column: 1; padding: 1px 0px 0px 2px; background-color: transparent; } #BreakpointWindow .bpRow .bpIcon { display: inline-block; -ms-grid-column: 3; width: 16px; height: 20px; background-repeat: no-repeat; background-position-y: 4px; } #BreakpointWindow .bpRow .bpText { display: inline-block; -ms-grid-column: 5; padding-top: 4px; overflow: hidden; } #BreakpointWindow .bpRow .bpText .bpLink:hover { cursor: pointer; } #BreakpointWindow .bpRow > .bpItemControls { -ms-grid-column: 6; -ms-grid-columns: 2; text-align: right; overflow: hidden; display: -ms-grid; white-space: nowrap; } #BreakpointWindow .bpRow > .bpItemControls > .bpEditButton { -ms-grid-column: 1; visibility: hidden; margin: 2px; } #BreakpointWindow .bpRow > .bpItemControls > .bpEditButton > .buttonIcon { background-image: url('Breakpoints/images/editCurrentBreakpoint.png'); /*[url({f12-debugger-image-breakpoint-edit-current})]*/ } #BreakpointWindow .bpRow > .bpItemControls > .bpDeleteButton { -ms-grid-column: 2; visibility: hidden; margin: 2px; } #BreakpointWindow .bpRow > .bpItemControls > .bpDeleteButton > .buttonIcon { background-image: url('Breakpoints/images/deleteCurrentBreakpoint.png'); /*[url({f12-debugger-image-breakpoint-delete-current})]*/ } #BreakpointWindow .bpRow:hover > .bpItemControls > .bpEditButton, #BreakpointWindow .bpRow:hover > .bpItemControls > .bpDeleteButton { visibility: visible; } #BreakpointWindow .bpRow > .bpItemControls > button { margin: 1px; margin-left: 7px; margin-top: 2px; height: 16px; width: 16px; padding: 0; border: 1px solid transparent; background-color: TRANSPARENT; /*[{plugin-font-editor-background-color}]*/ position: relative; vertical-align: top; } #BreakpointWindow .bpRow > .bpItemControls > button:hover { background-color: TRANSPARENT; /*[{vs-command-bar-mouse-over-background-middle1-color}]*/ border: 1px solid TRANSPARENT; /*[1px solid {vs-command-bar-selected-border-color}]*/ color: TRANSPARENT; /*[{vs-command-bar-text-selected-color}]*/ background-position-y: -16px; cursor: pointer; } #BreakpointWindow .breakpointimg { background-image: url('Breakpoints/images/breakpointGlyph.png'); /*[url({f12-debugger-image-breakpoint})]*/ background-position: 0px 0px; background-repeat: no-repeat; background-size: 14px 14px; } #BreakpointWindow .tracepointimg { background-image: url('Breakpoints/images/tracepointBreakpoint.png'); /*[url({f12-debugger-image-breakpoint-tracepoint})]*/ background-position: 0px 0px; background-repeat: no-repeat; background-size: 14px 14px; } #BreakpointWindow .conditionalimg { background-image: url('Breakpoints/images/conditionalBreakpoint.png'); /*[url({f12-debugger-image-breakpoint-conditional})]*/ background-position: 0px 0px; background-repeat: no-repeat; background-size: 14px 14px; } #BreakpointWindow .bpUnbound { background-image: url('Breakpoints/images/breakpointUnbound.png'); /*[url({f12-debugger-image-breakpoint-unbound})]*/ background-position: 0px 0px; background-repeat: no-repeat; background-size: 14px 14px; } #BreakpointWindow .bpDisabled { background-image: url('Breakpoints/images/breakpointDisabled.png'); /*[url({f12-debugger-image-breakpoint-disabled})]*/ background-position: 0px 0px; background-repeat: no-repeat; background-size: 14px 14px; } .lightDismissPromptContainer { display: block; padding-top: 0.25em; padding-left: 1em; padding-right: 1em; border: 1px solid TRANSPARENT; /*[1px solid {plugin-contextmenu-active-border-color}]*/ background: TRANSPARENT; /*[{plugin-contextmenu-background-color}]*/ box-shadow: 2px 2px 2px TRANSPARENT; /*[2px 2px 2px {plugin-textbox-border-color rgba(0.5)}]*/ position: absolute; z-index: 1010; } .lightDismissPromptContainer div { margin: 2px 0px 4px 0px; line-height: 1.2em; } .lightDismissPromptContainer .popupInnerContainer { padding-top: 0.25em; padding-bottom: 0.75em; height: auto; width: 100%; color: TRANSPARENT; /*[{plugin-color}]*/ } .lightDismissPromptContainer .popupInputContainer { display: -ms-grid; -ms-grid-columns: auto 6px 1fr; margin-top: 10px; } .lightDismissPromptContainer .popupInputContainer .promptInputLabel { width: auto; display: inline; } .lightDismissPromptContainer .popupInputContainer .promptInputBox { -ms-grid-column: 3; width: 100%; } .lightDismissPromptContainer .popupButtonContainer { float: right; } .lightDismissPromptContainer .popupButtonContainer .okButton { margin-top: 14px; margin-bottom: 12px; padding: 2px 6px; min-width: 65px; background-image: none; border: 1px solid TRANSPARENT; /*[1px solid {plugin-contextmenu-border-color}]*/ color: TRANSPARENT; /*[{plugin-color}]*/ } .lightDismissPromptContainer .popupButtonContainer .cancelButton { margin-top: 14px; margin-bottom: 12px; margin-left: 10px; padding: 2px 6px; min-width: 65px; background-image: none; border: 1px solid TRANSPARENT; /*[1px solid {plugin-contextmenu-border-color}]*/ color: TRANSPARENT; /*[{plugin-color}]*/ } .lightDismissPromptContainer .popupButtonContainer .okButton:hover, .lightDismissPromptContainer .popupButtonContainer .cancelButton:hover { border: 1px solid TRANSPARENT; /*[1px solid {plugin-contextmenu-active-border-color}]*/ } .setTracepointContainer, .setConditionContainer { min-height: 100px; width: 350px; top: calc(50% - 80px); left: calc(50% - 175px); } PNG  IHDRr ߔ pHYs+ OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FIDATx 0E]AD%Pt@: $B P 'np \&(,!@ĿzyŞoaL,)0-;@|t{E(6wyV]`s`JCrWwagU@q4֤ѢIi5~`j:q԰LkjZFw6DK+?0昸~caEYhexjikeRki 0;IF7e"W `UL -J w*Y(IENDB`PNG  IHDRr ߔ pHYs+ OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FcIDATxܖMR@F_<{",O @8prYSq覡" ,OU *¨{`>Yɚ4ta4'mMB=g_0k#ؔvTsT`؅ogؔmMy!\a]s:Dӽ&*G"b%ėn0E} IYX(V@R2}J[2hkJ Q:&ۥjw5iG֦ښѭE1j;&iRl96wG3_6}YFRQ T0tIENDB`PNG  IHDRr ߔ pHYs+ OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FIDATxֻ 0 ;fHr0YX.;@!!,J(S@Ee'ZbC({0Kzwb`B)5ĚP cU 'J%R{E=P`7F؅N0.'u4.m.ex'1CyLwt}piuIENDB`PNG  IHDRr ߔ pHYs+ OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FuIDATxĖm0xTʛ_`6N@lLnlPY/{@&)Rdߌt9hßj P g=b%Rx`mA^#$-|,oQ mEǁXO$;u+Xېc$g3<[}΀Z7rPn2L;1+P1}2:H͵2AB뎩Ԅ FϞ p37 遣 czՈS#F!gkT),듨Lt!i*ؘR}$VUynJ oCV.Qcgmid.]1V@VP#߹IENDB`PNG  IHDRr ߔ pHYs+ OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FIDATxڬ1P瞈4DbDJi`o7H7V^)E AIpBziH /E1<0?1M0`9 `rYk1 @ Phc\R\1>>q,GXz[ p^THDG4.5P`;`| ]4.s#%H0 @ :FwƑf$Gh(K.L LTGgmDpa{7,kҸt-mp&Er|{I]+̔[VˤxXkӀ2.e(M,R(i.]3BM/"q[v>,}T d_nk3oq{2e9;v:&V*6ͣs ,@ezRiй 'A4 +rY:OhZK9p;AS>!3U~e^[|݃ ΃]G ".I~k+mh5*Z/U IENDB`PNG  IHDR `|"p pHYs+ OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FIDATxZnJXʒSQd?Bw&n;|upҭbio6dv$) a?Nx<-zs8P0}\xʅOlÑo!罺QF 0r}7}Dr0-҄E]\ێ[;E'@,\i B'M61Q|GZ#S+&m݄'U$"Gs:Fj?$BΓkj)Rj<~R6#-Y:^tLlIts'&569K#|9$dXw٩OJdc#n;}#\ R+fO/ߠ9m׿ǥwtK._jrz~Jl^!7 .8 !*!FјB$]^g~@cI/c H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FIDATx1r0v|! 7-B;{ʺ G#p!?!ș$z,zDuBRཿelF@)b pXţ- ˲Ue) /ƫ!>ߴ,Ͷae6IY[jߓ'@RJkDRBngGc'x[Oƻ:fQTo*@k*[@Blm=+WuИd8qin׶s-깋yrE..pPS 6t %_D"r%hz ,clw} nùcݽHz`;?+H~ Ug@S@ML> П"ٳu8?5"I^~ZW~ 4E&yM(t`smU~:hL2~ǽp-BpE.K |RBx?pK=ۖ ~  x?">R":@Ry~`/:!TUur? Y b8?RD$: RH(t`XI"a)A!%tzžBm߆_H PGIENDB`PNG  IHDR `|"p pHYs+ OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FIDATxX;r"I}t`5k67nPDO0 `OWH7\!0XN6UYQWy<|N`~0ZosA~Z7Х'""-6&oO3NZS {}0WG_sʧNѪZ~nh_ 𛁿jAW]ͩ IӔߌtzxב@㩉wΊOp3~T3++:|EgG HP;J&5)ұ0KMUY@!eF՗`X ĒgFIggF1pE10Ƽ$_J~ \cT?@Eu#+@)DsjO7K5k#?F/C) 1&1??#Ep (P$Ƙ~@Jb;>:pjS?@H@@ĵx#d V?`-N +@º #q:Rooog=ѭI@.8+*ĕ?gH+qz&5jIENDB`PNG  IHDR `|"p pHYs+ OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FIDATxM0P'# ;AΝ "F`rI#8QKHTB|llva%\PU/UJj}JGp_[@9kۏZ^)}G`k'T};!,!2$D&O& —$>oA$^Q"Izmkr½%N];p5p@ _# ׮a{$X!OK |6$\rf;>0t~p޾IֶwXiw8C̦bNf4J ( @D(~ pz i}>tMZ 䆯 / ;Jg#b} Rl} (prI}}`gx>1SRn15 w7}1r6vB0ç4TBdGILp—$h} F[@Np)eZ 䆯 / ;Jg#b} Rl} (prI}}@Jg-α,IENDB`.callstackwindow { width: 100%; height: 100%; } .callstackwindow > .gridcontainer { height: 100%; width: 100%; } .callstackwindow .gridcontainer .grid .grid-canvas { overflow-x: hidden; } .callstackwindow .breakOnWorker { padding: 0; margin: 0; } .callstackwindow .breakOnWorker > .buttonIcon { background-image: url('Callstack/images/pauseWorker.png'); /*[url({f12-debugger-image-callstack-pause-worker})]*/ background-color: transparent; } .callstackwindow .activeFrameGlyph { background-image: url("Callstack/images/activeFrameGlyph.png"); /*[url({f12-debugger-image-callstack-active-frame})]*/ background-repeat: no-repeat; background-position: 11px 2px; background-size: 14px 14px; background-color: transparent; } .callstackwindow .instructionPointerGlyph { background-image: url("Callstack/images/instructionPointerGlyph.png"); /*[url({f12-debugger-image-callstack-instruction-pointer})]*/ background-repeat: no-repeat; background-position: 11px 2px; background-size: 14px 14px; background-color: transparent; } PNG  IHDRr ߔ pHYs+ OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FIDATx=NAw& ;p*;BWV cGb=Px;`H\HOdOfwfw?gGZ՝~uk|tvNw 0t!":hlåf)j[ vvNiF i LТ_hq-^pKox.1*T b"&uo>݅9}\@%"OƟ&FXП&,``(`%Kn̼HIENDB`PNG  IHDRr ߔ pHYs+ OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FZIDATxĖ1N0.l1'ž@W'>pr8 ^۞ pF68RXɲ}~{)18 $D@@J;7Jl,9, X`2Ы1~.!x n9".8i3iq/9 :#NbIHk-?^K.ҵSFj/B':i9AY1v'CXXF꬝}~y H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FIDATxZMr0 =@ B> e 'HXMMYBNg-!'(=@inPYylɖdϐ`cK:aIqа|N!0 O/ 0 Sqyi@2pG5D8)+`UB9h2'! k7:#m_DǑomiDL5*8Pne19B[4c-8L``@=9NGDvbVʖZQxxJw9`=!D 51 kH~zZ#D(`Y%͝mӊA,iNsKH&%9B(KżW5{?5tpaOq:/ fU0l>s݂l=pEMp7 U@&IЛ+pk| *T4g6zu|+ԓ%‡zU)}ҡںП_?~}L؁l=`#G쒮0>`3E6 |Cf}`i@`fg iuoveʗ@ LKHy Fx_r_(1_9n> '& f3Iь(cEoXJٕR#9 t|c,09Lp@LR*`I(\˜4B_@$HpW{@DvOOO1?оkxz.w1X2=RJ+`Rk*R,U1МF(?Sޮ(a$o kĀIENDB`#dataTipElement { padding-left: 1em; padding-right: 1em; border: 1px solid TRANSPARENT; /*[1px solid {plugin-contextmenu-active-border-color}]*/ background: TRANSPARENT; /*[{plugin-contextmenu-background-color}]*/ box-shadow: 2px 2px 2px TRANSPARENT; /*[2px 2px 2px {plugin-textbox-border-color rgba(0.5)}]*/ display: none; position: absolute; z-index: 501; top: 30px; } #dataTipElement .popoverInnerContainer { margin-top: 9px; height: calc(100% - 30px); width: 100%; color: TRANSPARENT; /*[{plugin-color}]*/ } #dataTipElement .popoverInnerContainer a { margin-left: 4px; } #dataTipElement .grid > .grid-canvas { overflow-x: hidden; } .glyph-margin > div { background-repeat: no-repeat; } .monaco-editor.vs { line-height: 18px; } .monaco-editor.vs .breakpointDecoration { background-color: TRANSPARENT; /*[{plugin-font-editor-breakpoint-background-color rgba(0.2)}]*/ } .monaco-editor.vs .breakpointGlyph { background-image: url("Breakpoints/images/breakpointGlyph.png"); /*[url({f12-debugger-image-breakpoint})]*/ background-position-y: 2px; background-size: 14px 14px; margin-left: 2px; } .monaco-editor.vs .breakpointGlyph.bpUnbound { background-image: url("Breakpoints/images/breakpointUnbound.png"); /*[url({f12-debugger-image-breakpoint-unbound})]*/ } .monaco-editor.vs .breakpointGlyph.bpDisabled { background-image: url("Breakpoints/images/breakpointDisabled.png"); /*[url({f12-debugger-image-breakpoint-disabled})]*/ } .monaco-editor.vs .tracepointimg { background-image: url('Breakpoints/images/tracepointBreakpoint.png'); /*[url({f12-debugger-image-breakpoint-tracepoint})]*/ background-position-y: 2px; background-size: 14px 14px; margin-left: 2px; } .monaco-editor.vs .conditionalimg { background-image: url('Breakpoints/images/conditionalBreakpoint.png'); /*[url({f12-debugger-image-breakpoint-conditional})]*/ background-position-y: 2px; background-size: 14px 14px; margin-left: 2px; } .monaco-editor.vs .activeFrameDecoration { background-color: TRANSPARENT; /*[{plugin-font-editor-comment-color rgba(0.4)}]*/ } .monaco-editor.vs .activeFrameGlyph { background-image: url("Callstack/images/activeFrameGlyph.png"); /*[url({f12-debugger-image-callstack-active-frame})]*/ background-position-y: 2px; background-size: 14px 14px; margin-left: 2px; } .monaco-editor.vs .activeFrameGlyph.breakpointGlyph { background-image: url("Callstack/images/activeFrameGlyph.png"), url("Breakpoints/images/breakpointGlyph.png"); /*[url({f12-debugger-image-callstack-active-frame}), url({f12-debugger-image-breakpoint})]*/ } .monaco-editor.vs .activeFrameGlyph.breakpointGlyph.bpUnbound { background-image: url("Callstack/images/activeFrameGlyph.png"), url("Breakpoints/images/breakpointUnbound.png"); /*[url({f12-debugger-image-callstack-active-frame}), url({f12-debugger-image-breakpoint-unbound})]*/ } .monaco-editor.vs .activeFrameGlyph.breakpointGlyph.bpDisabled { background-image: url("Callstack/images/activeFrameGlyph.png"), url("Breakpoints/images/breakpointDisabled.png"); /*[url({f12-debugger-image-callstack-active-frame}), url({f12-debugger-image-breakpoint-disabled})]*/ } .monaco-editor.vs .activeFrameGlyph.tracepointimg { background-image: url("Callstack/images/activeFrameGlyph.png"), url("Breakpoints/images/tracepointBreakpoint.png"); /*[url({f12-debugger-image-callstack-active-frame}), url({f12-debugger-image-breakpoint-tracepoint})]*/ } .monaco-editor.vs .activeFrameGlyph.conditionalimg { background-image: url("Callstack/images/activeFrameGlyph.png"), url("Breakpoints/images/conditionalBreakpoint.png"); /*[url({f12-debugger-image-callstack-active-frame}), url({f12-debugger-image-breakpoint-conditional})]*/ } .monaco-editor.vs .instructionPointerDecoration { background-color: TRANSPARENT; /*[{plugin-font-editor-instruction-pointer-background-color rgba(0.6)}]*/ } .monaco-editor.vs .instructionPointerGlyph { background-image: url("Callstack/images/instructionPointerGlyph.png"); /*[url({f12-debugger-image-callstack-instruction-pointer})]*/ background-position-y: 2px; background-size: 14px 14px; margin-left: 2px; } .monaco-editor.vs .instructionPointerGlyph.breakpointGlyph { background-image: url("Callstack/images/instructionPointerGlyph.png"), url("Breakpoints/images/breakpointGlyph.png"); /*[url({f12-debugger-image-callstack-instruction-pointer}), url({f12-debugger-image-breakpoint})]*/ } .monaco-editor.vs .instructionPointerGlyph.breakpointGlyph.bpUnbound { background-image: url("Callstack/images/instructionPointerGlyph.png"), url("Breakpoints/images/breakpointUnbound.png"); /*[url({f12-debugger-image-callstack-instruction-pointer}), url({f12-debugger-image-breakpoint-unbound})]*/ } .monaco-editor.vs .instructionPointerGlyph.breakpointGlyph.bpDisabled { background-image: url("Callstack/images/instructionPointerGlyph.png"), url("Breakpoints/images/breakpointDisabled.png"); /*[url({f12-debugger-image-callstack-instruction-pointer}), url({f12-debugger-image-breakpoint-disabled})]*/ } .monaco-editor.vs .instructionPointerGlyph.tracepointimg { background-image: url("Callstack/images/instructionPointerGlyph.png"), url("Breakpoints/images/tracepointBreakpoint.png"); /*[url({f12-debugger-image-callstack-instruction-pointer}), url({f12-debugger-image-breakpoint-tracepoint})]*/ } .monaco-editor.vs .instructionPointerGlyph.conditionalimg { background-image: url("Callstack/images/instructionPointerGlyph.png"), url("Breakpoints/images/conditionalBreakpoint.png"); /*[url({f12-debugger-image-callstack-instruction-pointer}), url({f12-debugger-image-breakpoint-conditional})]*/ } .monaco-editor.vs .searchTermDecoration { background-color: TRANSPARENT; /*[{plugin-font-editor-search-result-background-color rgba(0.5)}]*/ } .monaco-editor.vs .exceptionViewZone { color: TRANSPARENT; /*[{plugin-font-editor-erroradornment-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-editor-erroradornment-background-color}]*/ border: solid 1px TRANSPARENT; /*[solid 1px {plugin-font-editor-erroradornment-background-color}]*/ -ms-user-select: none; padding-left: 2px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; } .monaco-editor.vs .exceptionViewZone .exceptionGlyph { background: url("../Common/images/common_icons.png") no-repeat -688px -16px; /*[url({f12-image-common-icons}) no-repeat -688px -16px]*/ padding-top: 1px; float: left; width: 20px; height: 16px; } .monaco-editor.vs .setNextStatementErrorViewZone { color: TRANSPARENT; /*[{plugin-font-editor-erroradornment-color}]*/ background-color: TRANSPARENT; /*[{plugin-font-editor-erroradornment-background-color}]*/ border: solid 1px TRANSPARENT; /*[solid 1px {plugin-font-editor-erroradornment-background-color}]*/ -ms-user-select: none; padding-left: 2px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; } .monaco-editor.vs .setNextStatementErrorViewZone .exceptionGlyph { background: url("../Common/images/common_icons.png") no-repeat -688px -16px; /*[url({f12-image-common-icons}) no-repeat -688px -16px]*/ padding-top: 1px; float: left; width: 20px; height: 16px; } .goToLinePromptContainer { text-align: left; width: 280px; height: 90px; margin-top: 20px; margin-left: 20px; padding-top: 0px; } /* Monaco editor overrides */ .monaco-editor.vs, .monaco-editor.vs .zone-widget .monaco-editor.vs { font-family: 'Comic Sans MS'; /*[{plugin-font-editor}, Nimsum, Monaco, Menlo, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace]*/ font-size: 9pt; /*[{plugin-font-editor-size}]*/ color: TRANSPARENT; /*[{plugin-font-editor-color}]*/ background: TRANSPARENT; /*[{plugin-font-editor-background-color}]*/ } .monaco-editor.vs .monaco-editor-background { background: TRANSPARENT; /*[{plugin-font-editor-background-color}]*/ } .monaco-editor.vs .focus-mode { background-color: TRANSPARENT; /*[{plugin-font-editor-background-color}]*/ opacity: 0.333; } .monaco-editor.vs .cursor { background: TRANSPARENT; /*[{plugin-color}]*/ } .monaco-editor.vs .current-line { background: TRANSPARENT; /*[{plugin-font-editor-background-color}]*/ border: 2px solid TRANSPARENT; /*[2px solid {plugin-table-border-color}]*/ box-sizing: border-box; } .monaco-editor.vs .lineHighlight { background-color: TRANSPARENT; /*[{plugin-highlight-color rgba(0.2)}]*/ } .monaco-editor.vs .dynamic.focused > .selections-layer > .selected-text { background: TRANSPARENT !important; /*[{plugin-highlight-background-color rgba(0.45)} !important]*/ } .monaco-editor.vs .dynamic > .selections-layer > .selected-text { background: TRANSPARENT !important; /*[{plugin-highlight-background-color rgba(0.45)} !important]*/ } .monaco-editor.vs .glyph-margin { background: TRANSPARENT; /*[{plugin-font-editor-margin-background-color}]*/ } .monaco-editor.vs .lines-decorations { background: TRANSPARENT; /*[{plugin-background-color}]*/ } .monaco-editor.vs .line-numbers { background: TRANSPARENT; /*[{plugin-font-editor-background-color}]*/ color: TRANSPARENT; /*[{plugin-font-editor-margin-color}]*/ } .monaco-editor-hover { box-sizing: content-box; } .debuggerEditor .monaco-diff-editor .diffOverview { background-color: TRANSPARENT; /*[{plugin-font-editor-background-color}]*/ } .debuggerEditor .monaco-scrollable-element.modified-in-monaco-diff-editor .scrollbar { background: TRANSPARENT; /*[{plugin-scrollbar-background-color rgba(0.1)}]*/ } .debuggerEditor .monaco-scrollable-element .visible { background: TRANSPARENT; /*[{plugin-scrollbar-background-color}]*/ } .debuggerEditor .monaco-scrollable-element .scrollbar { background: TRANSPARENT; /*[{plugin-scrollbar-face-color rgba(0.1)}]*/ } .debuggerEditor .monaco-scrollable-element .slider { background: TRANSPARENT; /*[{plugin-scrollbar-face-color rgba(0.6)}]*/ } .debuggerEditor .monaco-scrollable-element .slider:hover { background: TRANSPARENT; /*[{plugin-scrollbar-face-color rgba(0.7)}]*/ } .debuggerEditor .monaco-scrollable-element .slider.active { background: TRANSPARENT; /*[{plugin-scrollbar-face-color rgba(0.9)}]*/ } .monaco-editor.vs .wordHighlight { background-color: TRANSPARENT; /*[{plugin-highlight-color rgba(0.35)}]*/ -webkit-animation-duration: 0.2s; -webkit-animation-name: darkWordHighlight; -moz-animation-duration: 0.2s; -moz-animation-name: darkWordHighlight; -ms-animation-duration: 0.2s; -ms-animation-name: darkWordHighlight; animation-duration: 0.2s; animation-name: darkWordHighlight; } @-ms-keyframes darkWordHighlight { from { background-color: TRANSPARENT; /*[{plugin-font-editor-background-color}]*/ } to { background-color: TRANSPARENT; /*[{plugin-highlight-color rgba(0.35)}]*/ } } @keyframes darkWordHighlight { from { background-color: TRANSPARENT; /*[{plugin-font-editor-background-color}]*/ } to { background-color: TRANSPARENT; /*[{plugin-highlight-color rgba(0.35)}]*/ } } .monaco-editor.vs .bracket-match { box-shadow: inset 0 0 0 1px TRANSPARENT; /*[inset 0 0 0 1px {vs-drop-shadow-background-color rgba(0.5)}]*/ } .monaco-editor.vs .monaco-tree.focused .selected > .content { background-color: TRANSPARENT; /*[{plugin-treeview-content-background-color}]*/ } .monaco-editor.vs .monaco-tree.focused .focused > .content { background-color: TRANSPARENT; /*[{plugin-treeview-content-selected-background-color}]*/ } .monaco-editor.vs .monaco-tree .selected > .content { background-color: TRANSPARENT; /*[{plugin-treeview-content-inactive-selected-background-color}]*/ } .monaco-editor.vs .monaco-tree .focused > .content { background-color: TRANSPARENT; /*[{plugin-treeview-content-background-color}]*/ } .monaco-editor.vs .monaco-tree .content:hover { background-color: TRANSPARENT; /*[{plugin-treeview-content-mouseover-background-color}]*/ } .monaco-editor.vs .linked-editing { box-shadow: inset 0 0 0 1px TRANSPARENT; /*[inset 0 0 0 1px {vs-drop-shadow-background-color rgba(0.5)}]*/ } .monaco-editor.vs .new-snippet { background-color: TRANSPARENT; /*[{plugin-color rgba(0.1)}]*/ } .monaco-editor.vs .snippet-placeholder { background-color: TRANSPARENT; /*[{plugin-color rgba(0.1)}]*/ } .monaco-editor.vs .finish-snippet-placeholder { outline: TRANSPARENT solid 1px; /*[{plugin-background-color} solid 1px]*/ } .monaco-editor.vs .detected-link { border-color: TRANSPARENT; /*[{plugin-link-color}]*/ } .monaco-editor.vs .token { color: TRANSPARENT; /*[{plugin-font-editor-color}]*/ } .monaco-editor.vs .token.comment { color: TRANSPARENT; /*[{plugin-font-editor-comment-color}]*/ } .monaco-editor.vs .token.number { color: TRANSPARENT; /*[{plugin-font-editor-number-color}]*/ } .monaco-editor.vs .token.regexp, .monaco-editor.vs .token.regexp.js { color: TRANSPARENT; /*[{plugin-font-editor-number-color}]*/ } .monaco-editor.vs .token.string { color: TRANSPARENT; /*[{plugin-font-editor-string-color}]*/ } .monaco-editor.vs .token.string.escape { color: TRANSPARENT; /*[{plugin-font-editor-string-color}]*/ } .monaco-editor.vs .token.delimiter { color: TRANSPARENT; /*[{plugin-font-editor-color}]*/ } .monaco-editor.vs .token.keyword { color: TRANSPARENT; /*[{plugin-font-editor-keyword-color}]*/ } .monaco-editor.vs .token.keyword.flow { color: TRANSPARENT; /*[{plugin-font-editor-keyword-color}]*/ } .monaco-editor.vs .token.info-token { color: TRANSPARENT; /*[{plugin-font-console-info-color}]*/ } .monaco-editor.vs .token.warn-token { color: TRANSPARENT; /*[{plugin-font-console-warning-color}]*/ } .monaco-editor.vs .token.error-token { color: TRANSPARENT; /*[{plugin-font-console-error-color}]*/ } .monaco-editor.vs .token.debug-token { color: TRANSPARENT; /*[{plugin-font-console-input-color}]*/ } .monaco-editor.vs .token.meta { color: TRANSPARENT; /*[{plugin-font-editor-comment-color}]*/ } .monaco-editor.vs .token.key { color: TRANSPARENT; /*[{plugin-font-editor-literal-color}]*/ } .monaco-editor.vs .token.variable { color: TRANSPARENT; /*[{plugin-font-editor-identifier-color}]*/ } .monaco-editor.vs .token.attribute.name, .monaco-editor.vs .token.attribute.name.html { color: TRANSPARENT; /*[{plugin-font-editor-html-attribute-name-color}]*/ } .monaco-editor.vs .token.attribute.value, .monaco-editor.vs .token.attribute.value.html { color: TRANSPARENT; /*[{plugin-font-editor-html-attribute-value-color}]*/ } .monaco-editor.vs .token.tag.html { color: TRANSPARENT; /*[{plugin-font-editor-html-element-color}]*/ } .monaco-editor.vs .token.delimiter.html { color: TRANSPARENT; /*[{plugin-font-editor-html-tag-color}]*/ } .monaco-editor.vs .token.meta.content.html { color: TRANSPARENT; /*[{plugin-font-editor-comment-color}]*/ } .monaco-editor.vs .token.meta.html { color: TRANSPARENT; /*[{plugin-font-editor-comment-color}]*/ } .monaco-editor.vs .token.tag.xml { color: TRANSPARENT; /*[{plugin-font-editor-html-element-color}]*/ } .monaco-editor.vs .token.delimiter.xml { color: TRANSPARENT; /*[{plugin-font-editor-html-tag-color}]*/ } .monaco-editor.vs .token.meta.content.xml { color: TRANSPARENT; /*[{plugin-font-editor-comment-color}]*/ } .monaco-editor.vs .token.meta.xml { color: TRANSPARENT; /*[{plugin-font-editor-comment-color}]*/ } .monaco-editor.vs .token.attribute.name.css { color: TRANSPARENT; /*[{plugin-font-editor-css-name-color}]*/ } .monaco-editor.vs .token.attribute.value.css { color: TRANSPARENT; /*[{plugin-font-editor-css-value-color}]*/ } .monaco-editor.vs .token.tag.css { color: TRANSPARENT; /*[{plugin-font-editor-css-selector-color}]*/ } .monaco-editor.vs .token.delimiter.css { color: TRANSPARENT; /*[{plugin-font-editor-html-tag-color}]*/ } .monaco-editor.vs .token.vs { color: TRANSPARENT; /*[{plugin-font-editor-color}]*/ } .monaco-editor.vs .token.tag.vs { color: TRANSPARENT; /*[{plugin-font-editor-html-element-color}]*/ } .monaco-editor.vs .token.delimiter.js { color: TRANSPARENT; /*[{plugin-font-editor-color}]*/ } .monaco-editor.vs .token.attribute.name.vs { color: TRANSPARENT; /*[{plugin-font-editor-html-attribute-name-color}]*/ } .monaco-editor.vs .token.attribute.value.vs { color: TRANSPARENT; /*[{plugin-font-editor-html-attribute-value-color}]*/ } .monaco-editor.vs .token.meta.java { color: TRANSPARENT; /*[{plugin-font-editor-comment-color}]*/ } .monaco-editor.vs .token.tag.jade { color: TRANSPARENT; /*[{plugin-font-editor-html-element-color}]*/ } .monaco-editor.vs .token.tag.id.jade, .monaco-editor.vs .token.tag.class.jade { color: TRANSPARENT; /*[{plugin-font-editor-keyword-color}]*/ } .monaco-editor.vs .token.interpolation.jade { color: TRANSPARENT; /*[{plugin-font-editor-keyword-color}]*/ } .monaco-editor.vs .token.interpolation.delimiter.jade { color: TRANSPARENT; /*[{plugin-font-editor-color}]*/ } .monaco-editor.vs .typeInfo { color: TRANSPARENT; /*[{plugin-font-editor-keyword-color}]*/ } /*--------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ !function(e){"use strict";function t(){this._pendingLoads=0}function n(){t.call(this),this._blockedLoads=[],this._mergeStyleSheetsTimeout=-1}function r(){n.call(this)}function s(){this.fs=require.nodeRequire("fs")}function o(e,t,n){return n.replace(/url\(\s*([^\)]+)\s*\)?/g,function(n,r){if(('"'===r.charAt(0)||"'"===r.charAt(0))&&(r=r.substring(1)),('"'===r.charAt(r.length-1)||"'"===r.charAt(r.length-1))&&(r=r.substring(0,r.length-1)),!i(r,"/")&&!i(r,"http://")&&!i(r,"https://")){var s=c(a(e)+r);r=d(t,s)}return"url("+r+")"})}function i(e,t){return e.length>=t.length&&e.substr(0,t.length)===t}function a(e){var t=e.lastIndexOf("/");return-1!==t?e.substr(0,t+1):""}function l(e,t){var n,r,s;for(n=0,r=e.length,s=t.length;r>n&&s>n;n++)if(e[n]!==t[n])return e.substring(0,n);return e.substring(0,Math.min(r,s))}function h(e,t){var n=l(e,t),r=n.lastIndexOf("/");return-1===r?"":n.substring(0,r+1)}function d(e,t){var n=h(e,t);e=e.substr(n.length),t=t.substr(n.length);for(var r=e.split("/").length,s="",o=1;r>o;o++)s+="../";return s+=t}function u(e){for(;i(e,"/../");)e=e.substr(3);for(var t=i(e,"/"),n=e.split("/"),r=0;r0&&".."===n[r]&&".."!==n[r-1]&&(n.splice(r-1,2),r-=2);return(t?"/":"")+n.join("/")}function c(e){var t=e,n=i(t,"http://"),r=i(t,"https://"),s="";if(r||n){t=r?t.substr(8):t.substr(7);var o=t.indexOf("/");o>=0&&(s=t.substring(0,o),t=t.substr(o))}var a="";return r?a+="https://":n&&(a+="http://"),a+=s,a+=u(t)}var p=65279;t.prototype.attachListeners=function(e,t,n,r){var s=null,o=null,i=function(){t.removeEventListener("load",s),t.removeEventListener("error",o)};s=function(){i(),n()},o=function(e){i(),r(e)},t.addEventListener("load",s),t.addEventListener("error",o)},t.prototype._onLoad=function(e,t){this._pendingLoads--,t()},t.prototype._onLoadError=function(e,t){this._pendingLoads--,t()},t.prototype._insertLinkNode=function(e){this._pendingLoads++;var t=document.head||document.getElementsByTagName("head")[0],n=t.getElementsByTagName("link")||document.head.getElementsByTagName("script");n.length>0?t.insertBefore(e,n[n.length-1]):t.appendChild(e)},t.prototype.createLinkTag=function(e,t,n,r){var s=document.createElement("link");s.setAttribute("rel","stylesheet"),s.setAttribute("type","text/css"),s.setAttribute("data-name",e);var o=this._onLoad.bind(this,e,n),i=this._onLoadError.bind(this,e,r);return this.attachListeners(e,s,o,i),s.setAttribute("href",t),s},t.prototype._linkTagExists=function(e,t){var n,r,s,o,i=document.getElementsByTagName("link");for(n=0,r=i.length;r>n;n++)if(s=i[n].getAttribute("data-name"),o=i[n].getAttribute("href"),s===e||o===t)return!0;return!1},t.prototype.load=function(e,t,n,r){if(this._linkTagExists(e,t))return n(),void 0;var s=this.createLinkTag(e,t,n,r);this._insertLinkNode(s)},n.prototype=new t,n.prototype.load=function(e,t,n,r){if(this._linkTagExists(e,t))return n(),void 0;var s=this.createLinkTag(e,t,n,r);this._styleSheetCount()<31?this._insertLinkNode(s):(this._blockedLoads.push(s),this._handleBlocked())},n.prototype._styleSheetCount=function(){var e=document.getElementsByTagName("link").length,t=document.getElementsByTagName("style").length;return e+t},n.prototype._onLoad=function(e,n){t.prototype._onLoad.call(this,e,n),this._handleBlocked()},n.prototype._onLoadError=function(e,n){t.prototype._onLoadError.call(this,e,n),this._handleBlocked()},n.prototype._handleBlocked=function(){var e=this._blockedLoads.length;e>0&&-1===this._mergeStyleSheetsTimeout&&(this._mergeStyleSheetsTimeout=window.setTimeout(this._mergeStyleSheets.bind(this),0))},n.prototype._mergeStyleSheet=function(e,t,n,r){for(var s=0;se;e++)("loaded"===n[e].readyState||"complete"===n[e].readyState)&&s.push({linkNode:n[e],rulesLength:n[e].styleSheet.rules.length});var o=s.length,i=Math.min(o/2,t);s.sort(function(e,t){return t.rulesLength-e.rulesLength});var a,l;for(e=0;i>e;e++)a=s.length-1-e,l=e%(s.length-i),this._mergeStyleSheet(s[l].linkNode.href,s[l].linkNode.styleSheet,s[a].linkNode.href,s[a].linkNode.styleSheet),s[a].linkNode.parentNode.removeChild(s[a].linkNode),r--;for(var h=this._styleSheetCount();31>h&&this._blockedLoads.length>0;)this._insertLinkNode(this._blockedLoads.shift()),h++},r.prototype=new n,r.prototype.attachListeners=function(e,t,n){t.onload=function(){t.onload=null,n()}},s.prototype.load=function(e,t,n){var r=this.fs.readFileSync(t,"utf8");r.charCodeAt(0)===p&&(r=r.substring(1)),n(r)};var f=null;f="undefined"!=typeof process&&process.versions&&process.versions.node?new s:navigator.userAgent.indexOf("MSIE 9")>=0?new n:navigator.userAgent.indexOf("MSIE 8")>=0?new r:new t;var g={};define("vs/css",{load:function(e,t,n,r){r=r||{};var s=t.toUrl(e+".css");f.load(e,s,function(t){r.isBuild&&(g[e]=t),n()},function(){"function"==typeof n.error&&n.error("Could not find "+s+" or it was empty")})},write:function(t,n,r){var s=r.getEntryPoint();e.entryPoints=e.entryPoints||{},e.entryPoints[s]=e.entryPoints[s]||[],e.entryPoints[s].push({moduleName:n,contents:g[n]}),r.asModule(t+"!"+n,"define(['vs/css!"+s+"'], {});")},_rewriteUrls:function(e,t,n){return o(e,t,n)},writeFile:function(t,n,r,s){if(e.entryPoints&&e.entryPoints.hasOwnProperty(n)){for(var o=r.toUrl(n+".css"),i=["/*---------------------------------------------------------"," * Copyright (C) Microsoft Corporation. All rights reserved."," *--------------------------------------------------------*/"],a=e.entryPoints[n],l=0;l=t.length&&e.substr(0,t.length)===t}function n(e,t){return e.length>=t.length&&e.substr(e.length-t.length)===t}function r(e){this.options=e||{},this.options.baseUrl||(this.options.baseUrl=""),this.options.baseUrl.length>0&&(n(this.options.baseUrl,"/")||(this.options.baseUrl+="/")),this.options.paths||(this.options.paths={}),this.options.shim||(this.options.shim={}),this.options.callback||(this.options.callback=y),this.options.ignoreDuplicateModules||(this.options.ignoreDuplicateModules=[]),this.ignoreDuplicateModulesMap={};for(var t=0;t0&&"/"===e.charAt(0),r=e.split("/"),i=0;i0&&".."===r[i]&&".."!==r[i-1]&&(r.splice(i-1,2),i-=2);return(n?"/":"")+r.join("/")},s.prototype.resolveModule=function(e){var n=null;return n=t(e,"./")||t(e,"../")?this.fromModulePath+e:e,this._normalizeModuleId(n)},s.prototype.moduleIdToPath=function(e){return this._config.moduleIdToPath(e)},s.prototype.requireToUrl=function(e){return this._config.requireToUrl(e)},a.prototype._digestDependencies=function(){this._unresolvedDependenciesCount=this._dependencies.length,this._managerDependencies=[],this._managerDependenciesMap={};var e,t,n;for(e=0,t=this._dependencies.length;t>e;e++)if(n=this._dependencies[e])if("exports"===n)this._exportsPassedIn=!0,this._dependenciesValues[e]=this._exports,this._unresolvedDependenciesCount--;else if("module"===n)this._dependenciesValues[e]={id:this._id},this._unresolvedDependenciesCount--;else if("require"===n)this._managerDependencies.push(n),this._managerDependenciesMap[n]=e;else{var r=n.indexOf("!");if(r>=0){var i=n.substring(0,r),o=n.substring(r+1,n.length);n=this._moduleIdResolver.resolveModule(i)+"!"+o}else n=this._moduleIdResolver.resolveModule(n);this._managerDependencies.push(n),this._managerDependenciesMap[n]=e}else console.error("Please check module "+this._id+", the dependency list looks broken"),this._dependenciesValues[e]=null,this._unresolvedDependenciesCount--},a.prototype.renameDependency=function(e,t){if(!this._managerDependenciesMap.hasOwnProperty(e))throw new Error("Loader: Cannot rename an unknown dependency!");var n=this._managerDependenciesMap[e];delete this._managerDependenciesMap[e],this._managerDependenciesMap[t]=n},a.prototype.getId=function(){return this._id},a.prototype.getModuleIdResolver=function(){return this._moduleIdResolver},a.prototype.isExportsPassedIn=function(){return this._exportsPassedIn},a.prototype.getExports=function(){return this._exports},a.prototype.getDependencies=function(){return this._managerDependencies},a.prototype._complete=function(){var t=null;if(this._callback)if("function"==typeof this._callback){var n=this._callback.apply(e,this._dependenciesValues);this._exportsPassedIn||(this._exports=n)}else this._exports=this._callback;t&&(console.error(t.stack),console.error(t))},a.prototype.cleanUp=function(){this._dependencies=null,this._dependenciesValues=null,this._callback=null,this._moduleIdResolver=null,this._managerDependencies=null,this._managerDependenciesMap=null},a.prototype.resolveDependency=function(e,t){if(!this._managerDependenciesMap.hasOwnProperty(e))throw new Error("Cannot resolve a dependency I do not have!");this._dependenciesValues[this._managerDependenciesMap[e]]=t,this._unresolvedDependenciesCount--,0===this._unresolvedDependenciesCount&&this._complete()},a.prototype.isComplete=function(){return 0===this._unresolvedDependenciesCount},l.prototype.enqueueDefineModule=function(e,t,n){0===this._loadingScriptsCount?this.defineModule(e,t,n):this._queuedDefineCalls.push({id:e,dependencies:t,callback:n})},l.prototype.enqueueDefineAnonymousModule=function(e,t){this._queuedDefineCalls.push({id:null,dependencies:e,callback:t})},l.prototype.defineModule=function(e,t,n,r){if(this._modules.hasOwnProperty(e))return this._defaultConfig.isDuplicateMessageIgnoredFor(e)||console.warn("Duplicate definition of module '"+e+"'"),void 0;var i=new a(e,t,n,r||new s(this._defaultConfig,e));this._modules[e]=i,this._resolve(i)},l.prototype._relativeRequire=function(e,t,n){return"string"==typeof t?this.synchronousRequire(t,e):(this.defineModule(f(),t,n,e),void 0)},l.prototype.synchronousRequire=function(e,t){t=t||new s(this._defaultConfig,e);var n=t.resolveModule(e);if(!this._modules.hasOwnProperty(n))throw new Error("Check dependency list! Synchronous require cannot resolve module '"+n+"'. This is the first mention of this module!");var r=this._modules[n];if(!r.isComplete())throw new Error("Check dependency list! Synchronous require cannot resolve module '"+n+"'. This module has not been resolved completely yet.");return r.getExports()},l.prototype.setConfig=function(e){this._defaultConfig=e},l.prototype.getConfig=function(){return this._defaultConfig},l.prototype._onLoad=function(e){var t;if(this._loadingScriptsCount--,this._defaultConfig.isShimmed(e))t=this._defaultConfig.getShimmedModuleDefine(e),this.defineModule(e,t.dependencies,t.callback);else if(0===this._queuedDefineCalls.length)console.warn("No define call received from module "+e+". This might be a problem.");else for(;this._queuedDefineCalls.length>0;){if(t=this._queuedDefineCalls.shift(),t.id===e||null===t.id){t.id=e,this.defineModule(t.id,t.dependencies,t.callback);break}this.defineModule(t.id,t.dependencies,t.callback)}if(0===this._loadingScriptsCount)for(;this._queuedDefineCalls.length>0;)t=this._queuedDefineCalls.shift(),null===t.id?console.error("Found an unmatched anonymous define call in the define queue. Ignoring it!"):this.defineModule(t.id,t.dependencies,t.callback)},l.prototype._onLoadError=function(e){this._loadingScriptsCount--,console.error("Loading "+e+" failed, here are the modules that depend on it: "),console.error(this._inverseDependencies[e])},l.prototype._onModuleComplete=function(e,t){var n,r,i,o,s;if(this._inverseDependencies.hasOwnProperty(e))for(i=this._inverseDependencies[e],delete this._inverseDependencies[e],n=0,r=i.length;r>n;n++)o=i[n],s=this._modules[o],s.resolveDependency(e,t),s.isComplete()&&this._onModuleComplete(o,s.getExports());if(this._inversePluginDependencies.hasOwnProperty(e))for(i=this._inversePluginDependencies[e],delete this._inversePluginDependencies[e],n=0,r=i.length;r>n;n++)this._resolvePluginDependencySync(i[n].moduleId,i[n].dependencyId,t);m(e)?(delete this._modules[e],delete this._dependencies[e]):this._modules[e].cleanUp()},l.prototype._hasDependencyPath=function(e,t){var n,r,i,o,s,a={},l=[];for(l.push(e),a[e]=!0;l.length>0;)if(i=l.shift(),this._dependencies.hasOwnProperty(i))for(o=this._dependencies[i],n=0,r=o.length;r>n;n++){if(s=o[n],s===t)return!0;a.hasOwnProperty(s)||(a[s]=!0,l.push(s))}return!1},l.prototype._findCyclePath=function(e,t,n){if(e===t||50===n)return[e];if(!this._dependencies.hasOwnProperty(e))return null;for(var r,i=this._dependencies[e],o=0,s=i.length;s>o;o++)if(r=this._findCyclePath(i[o],t,n+1),null!==r)return r.push(e),r;return null},l.prototype._createRequire=function(e){var t=this._relativeRequire.bind(this,e);return t.toUrl=function(t){return e.requireToUrl(e.resolveModule(t))},t},l.prototype._resolvePluginDependencySync=function(e,t,n){var r=this._modules[e],i=r.getModuleIdResolver(),o=t.indexOf("!"),s=t.substring(0,o),a=t.substring(o+1,t.length),l=function(e){return i.resolveModule(e)}.bind(this);a="function"==typeof n.normalize?n.normalize(a,l):l(a);var c=t;t=s+"!"+a,r.renameDependency(c,t);var u=function(){var e=this._createRequire(i),r=function(e){this.defineModule(t,[],e)}.bind(this);r.error=function(){console.error("Loading "+t+" failed, here are the modules that depend on it: "),console.error(this._inverseDependencies[t])}.bind(this),n.load(a,e,r,this._defaultConfig.getOptionsLiteral())}.bind(this);this._resolveDependency(e,t,u)},l.prototype._resolvePluginDependencyAsync=function(e,t){var n=this._modules[e],r=t.indexOf("!"),i=t.substring(0,r);this._inversePluginDependencies[i]=this._inversePluginDependencies[i]||[],this._inversePluginDependencies[i].push({moduleId:e,dependencyId:t}),this._modules.hasOwnProperty(i)||this._knownModules.hasOwnProperty(i)||(this._knownModules[i]=!0,this._loadModule(n.getModuleIdResolver(),i))},l.prototype._resolvePluginDependency=function(e,t){var n=t.indexOf("!"),r=t.substring(0,n);this._modules.hasOwnProperty(r)&&this._modules[r].isComplete()?this._resolvePluginDependencySync(e,t,this._modules[r].getExports()):this._resolvePluginDependencyAsync(e,t)},l.prototype._injectedShimModuleFactory=function(e,t){t(e)},l.prototype._resolveShimmedDependency=function(e,t,n){var r=this._defaultConfig.getShimmedModuleDefine(t);r.dependencies.length>0?this.defineModule(f(),r.dependencies,this._injectedShimModuleFactory.bind(this,t,n),new s(this._defaultConfig,t)):n(t)},l.prototype._resolveDependency=function(e,t,n){var r=this._modules[e];if(this._modules.hasOwnProperty(t)&&this._modules[t].isComplete())r.resolveDependency(t,this._modules[t].getExports());else if(this._dependencies[e].push(t),this._hasDependencyPath(t,e)){console.warn("There is a dependency cycle between '"+t+"' and '"+e+"'. The cyclic path follows:");var i=this._findCyclePath(t,e,0);i.reverse(),i.push(t),console.warn(i.join(" => \n"));var o,s=this._modules.hasOwnProperty(t)?this._modules[t]:null;s&&s.isExportsPassedIn()&&(o=s.getExports()),r.resolveDependency(t,o)}else this._inverseDependencies[t]=this._inverseDependencies[t]||[],this._inverseDependencies[t].push(e),this._modules.hasOwnProperty(t)||this._knownModules.hasOwnProperty(t)||(this._knownModules[t]=!0,this._defaultConfig.isShimmed(t)?this._resolveShimmedDependency(e,t,n):n(t))},l.prototype._loadModule=function(e,t){this._loadingScriptsCount++,this._scriptLoader.load(e.moduleIdToPath(t),this._onLoad.bind(this,t),this._onLoadError.bind(this,t))},l.prototype._resolve=function(e){var t,n,r,i,o,s;for(r=e.getId(),i=e.getDependencies(),s=e.getModuleIdResolver(),this._dependencies[r]=[],t=0,n=i.length;n>t;t++)o=i[t],"require"!==o?o.indexOf("!")>=0?this._resolvePluginDependency(r,o):this._resolveDependency(r,o,this._loadModule.bind(this,s)):e.resolveDependency(o,this._createRequire(s));e.isComplete()&&this._onModuleComplete(r,e.getExports())},c.prototype.attachListeners=function(){return e.attachEvent?function(e,t,n){var r=null,i=null,o=function(){e.detachEvent("onreadystatechange",r),e.addEventListener&&e.removeEventListener("error",i)};r=function(){("loaded"===e.readyState||"complete"===e.readyState)&&(o(),t())},i=function(e){o(),n(e)},e.attachEvent("onreadystatechange",r),e.addEventListener&&e.addEventListener("error",i)}:function(e,t,n){var r=null,i=null,o=function(){e.removeEventListener("load",r),e.removeEventListener("error",i)};r=function(){o(),t()},i=function(e){o(),n(e)},e.addEventListener("load",r),e.addEventListener("error",i)}}(),c.prototype.load=function(e,t,n){var r=document.createElement("script");r.setAttribute("async","async"),r.setAttribute("type","text/javascript"),this.attachListeners(r,t,n),r.setAttribute("src",e),document.getElementsByTagName("head")[0].appendChild(r)},u.prototype.load=function(e,t,n){this.loadCalls.push({scriptSrc:e,callback:t,errorback:n}),navigator.userAgent.indexOf("Firefox")>=0?this._load():-1===this.loadTimeout&&(this.loadTimeout=setTimeout(this._load.bind(this),0))},u.prototype._load=function(){this.loadTimeout=-1;var e=this.loadCalls;this.loadCalls=[];var t,n=e.length,r=[];for(t=0;n>t;t++)r.push(e[t].scriptSrc);try{for(importScripts.apply(null,r),t=0;n>t;t++)e[t].callback()}catch(i){for(t=0;n>t;t++)e[t].errorback(i)}};var v=g?new u:new c,T=new l(v);d.config=h,g||(window.onload=function(){var e,t,n,i,o=document.getElementsByTagName("script");for(e=0,t=o.length;t>e&&(n=o[e],!(i=n.getAttribute("data-main")));e++);i&&T.defineModule(f(),[i],null,new s(new r,""))}),p.amd={jQuery:!0},e.define=p,"undefined"!=typeof e.require&&"[object Function]"!==Object.prototype.toString.call(e.require)&&d.config(e.require),e.require=d}}(this),function(e){"use strict";function t(e,t){var n=e.replace(/\{(\d+)\}/g,function(e,n){var r=n[0];return"undefined"!=typeof t[r]?t[r]:e});return self&&self.document&&self.document.URL.match(/[^\?]*\?[^\#]*pseudo=true/)&&(n="["+n.replace(/[aouei]/g,"$&$&")+"]"),n}function n(e,t){var n=e[t];return n?n:(n=e["*"],n?n:null)}function r(e,n){for(var r=[],i=0;i=r.length)return"NLS error unknow index "+n;var o=r[n],s=[];s[0]=t+"_"+o;for(var a=0;a=s.length?"NLS error unknow index "+r:t(s[r],i)}})})}}},localize:r})}(this),function(e){"use strict";function t(){this._pendingLoads=0}function n(){t.call(this),this._blockedLoads=[],this._mergeStyleSheetsTimeout=-1}function r(){n.call(this)}function i(){this.fs=require.nodeRequire("fs")}function o(e,t,n){return n.replace(/url\(\s*([^\)]+)\s*\)?/g,function(n,r){if(('"'===r.charAt(0)||"'"===r.charAt(0))&&(r=r.substring(1)),('"'===r.charAt(r.length-1)||"'"===r.charAt(r.length-1))&&(r=r.substring(0,r.length-1)),!s(r,"/")&&!s(r,"http://")&&!s(r,"https://")){var i=h(a(e)+r);r=u(t,i)}return"url("+r+")"})}function s(e,t){return e.length>=t.length&&e.substr(0,t.length)===t}function a(e){var t=e.lastIndexOf("/");return-1!==t?e.substr(0,t+1):""}function l(e,t){var n,r,i;for(n=0,r=e.length,i=t.length;r>n&&i>n;n++)if(e[n]!==t[n])return e.substring(0,n);return e.substring(0,Math.min(r,i))}function c(e,t){var n=l(e,t),r=n.lastIndexOf("/");return-1===r?"":n.substring(0,r+1)}function u(e,t){var n=c(e,t);e=e.substr(n.length),t=t.substr(n.length);for(var r=e.split("/").length,i="",o=1;r>o;o++)i+="../";return i+=t}function p(e){for(;s(e,"/../");)e=e.substr(3);for(var t=s(e,"/"),n=e.split("/"),r=0;r0&&".."===n[r]&&".."!==n[r-1]&&(n.splice(r-1,2),r-=2);return(t?"/":"")+n.join("/")}function h(e){var t=e,n=s(t,"http://"),r=s(t,"https://"),i="";if(r||n){t=r?t.substr(8):t.substr(7);var o=t.indexOf("/");o>=0&&(i=t.substring(0,o),t=t.substr(o))}var a="";return r?a+="https://":n&&(a+="http://"),a+=i,a+=p(t)}var d=65279;t.prototype.attachListeners=function(e,t,n,r){var i=null,o=null,s=function(){t.removeEventListener("load",i),t.removeEventListener("error",o)};i=function(){s(),n()},o=function(e){s(),r(e)},t.addEventListener("load",i),t.addEventListener("error",o)},t.prototype._onLoad=function(e,t){this._pendingLoads--,t()},t.prototype._onLoadError=function(e,t){this._pendingLoads--,t()},t.prototype._insertLinkNode=function(e){this._pendingLoads++;var t=document.head||document.getElementsByTagName("head")[0],n=t.getElementsByTagName("link")||document.head.getElementsByTagName("script");n.length>0?t.insertBefore(e,n[n.length-1]):t.appendChild(e)},t.prototype.createLinkTag=function(e,t,n,r){var i=document.createElement("link");i.setAttribute("rel","stylesheet"),i.setAttribute("type","text/css"),i.setAttribute("data-name",e);var o=this._onLoad.bind(this,e,n),s=this._onLoadError.bind(this,e,r);return this.attachListeners(e,i,o,s),i.setAttribute("href",t),i},t.prototype._linkTagExists=function(e,t){var n,r,i,o,s=document.getElementsByTagName("link");for(n=0,r=s.length;r>n;n++)if(i=s[n].getAttribute("data-name"),o=s[n].getAttribute("href"),i===e||o===t)return!0;return!1},t.prototype.load=function(e,t,n,r){if(this._linkTagExists(e,t))return n(),void 0;var i=this.createLinkTag(e,t,n,r);this._insertLinkNode(i)},n.prototype=new t,n.prototype.load=function(e,t,n,r){if(this._linkTagExists(e,t))return n(),void 0;var i=this.createLinkTag(e,t,n,r);this._styleSheetCount()<31?this._insertLinkNode(i):(this._blockedLoads.push(i),this._handleBlocked())},n.prototype._styleSheetCount=function(){var e=document.getElementsByTagName("link").length,t=document.getElementsByTagName("style").length;return e+t},n.prototype._onLoad=function(e,n){t.prototype._onLoad.call(this,e,n),this._handleBlocked()},n.prototype._onLoadError=function(e,n){t.prototype._onLoadError.call(this,e,n),this._handleBlocked()},n.prototype._handleBlocked=function(){var e=this._blockedLoads.length;e>0&&-1===this._mergeStyleSheetsTimeout&&(this._mergeStyleSheetsTimeout=window.setTimeout(this._mergeStyleSheets.bind(this),0))},n.prototype._mergeStyleSheet=function(e,t,n,r){for(var i=0;ie;e++)("loaded"===n[e].readyState||"complete"===n[e].readyState)&&i.push({linkNode:n[e],rulesLength:n[e].styleSheet.rules.length});var o=i.length,s=Math.min(o/2,t);i.sort(function(e,t){return t.rulesLength-e.rulesLength});var a,l;for(e=0;s>e;e++)a=i.length-1-e,l=e%(i.length-s),this._mergeStyleSheet(i[l].linkNode.href,i[l].linkNode.styleSheet,i[a].linkNode.href,i[a].linkNode.styleSheet),i[a].linkNode.parentNode.removeChild(i[a].linkNode),r--;for(var c=this._styleSheetCount();31>c&&this._blockedLoads.length>0;)this._insertLinkNode(this._blockedLoads.shift()),c++},r.prototype=new n,r.prototype.attachListeners=function(e,t,n){t.onload=function(){t.onload=null,n()}},i.prototype.load=function(e,t,n){var r=this.fs.readFileSync(t,"utf8");r.charCodeAt(0)===d&&(r=r.substring(1)),n(r)};var f=null;f="undefined"!=typeof process&&process.versions&&process.versions.node?new i:navigator.userAgent.indexOf("MSIE 9")>=0?new n:navigator.userAgent.indexOf("MSIE 8")>=0?new r:new t;var m={};define("vs/css",{load:function(e,t,n,r){r=r||{};var i=t.toUrl(e+".css");f.load(e,i,function(t){r.isBuild&&(m[e]=t),n()},function(){"function"==typeof n.error&&n.error("Could not find "+i+" or it was empty")})},write:function(t,n,r){var i=r.getEntryPoint();e.entryPoints=e.entryPoints||{},e.entryPoints[i]=e.entryPoints[i]||[],e.entryPoints[i].push({moduleName:n,contents:m[n]}),r.asModule(t+"!"+n,"define(['vs/css!"+i+"'], {});")},_rewriteUrls:function(e,t,n){return o(e,t,n)},writeFile:function(t,n,r,i){if(e.entryPoints&&e.entryPoints.hasOwnProperty(n)){for(var o=r.toUrl(n+".css"),s=["/*---------------------------------------------------------"," * Copyright (C) Microsoft Corporation. All rights reserved."," *--------------------------------------------------------*/"],a=e.entryPoints[n],l=0;l=r.length)return"NLS error unknow index "+n;var o=r[n],s=[];s[0]=t+"_"+o;for(var a=0;a=s.length?"NLS error unknow index "+r:t(s[r],i)}})})}}},localize:r})}(this);/*--------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ "use strict";!function(){importScripts("../../loader.js"),require.config({baseUrl:"../../../",catchError:!0});var e=[];self.onmessage=function(r){e.push(r)},require(["vs/base/worker/workerServer"],function(r){var s=new r.WorkerServer(function(e){self.postMessage(JSON.stringify(e))});for(self.onmessage=function(e){s.onmessage(JSON.parse(e.data))};e.length>0;)self.onmessage(e.shift())})}();
      compatibility worker iframe
      /*--------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ define("vs/base/worker/workerServer",["require","exports"],function(e,t){"use strict";function s(e){var t={};return e.stacktrace?t.stack=e.stacktrace.split("\n"):e.stack&&(t.stack=e.stack.split("\n")),t.message=e.toString(),t}var r=e,i=function(){function t(e){this.postMessage=e,this.workerId=0,this.requestHandler=null,this._waitingSchedules={},this.lastScheduleId=0,this._bindConsole()}return t.prototype.schedule=function(e,t){"undefined"==typeof t&&(t=0);var s=++this.lastScheduleId;return this._waitingSchedules[s]=e,this.postMessage({monacoWorker:!0,from:this.workerId,type:"$schedule",scheduleId:s,timestamp:(new Date).getTime()+t}),s},t.prototype.clearSchedule=function(e){this._waitingSchedules.hasOwnProperty(String(e))&&delete this._waitingSchedules[e]},t.prototype._bindConsole=function(){self.console={log:this._sendPrintMessage.bind(this,"log"),debug:this._sendPrintMessage.bind(this,"debug"),info:this._sendPrintMessage.bind(this,"info"),warn:this._sendPrintMessage.bind(this,"warn"),error:this._sendPrintMessage.bind(this,"error")}},t.prototype._sendPrintMessage=function(e,t){this.postMessage({monacoWorker:!0,from:this.workerId,type:"$print",level:e,payload:t instanceof Error?s(t):t})},t.prototype._sendReply=function(e,t,r){this.postMessage({monacoWorker:!0,from:this.workerId,id:e,type:"$reply",action:t,payload:r instanceof Error?s(r):r})},t.prototype.request=function(e,t){if("$"===e.charAt(0))throw new Error("Illegal requestName: "+e);this.postMessage({monacoWorker:!0,from:this.workerId,type:e,payload:t})},t.prototype.loadModule=function(t,s,i){r.onError=i,e([t],function(e){s(e),r.onError=null}.bind(this))},t.prototype.onmessage=function(e){var t=this,r=this._sendReply.bind(this,e.id,"complete"),i=this._sendReply.bind(this,e.id,"error"),n=this._sendReply.bind(this,e.id,"progress");switch(e.type){case"$initialize":this.workerId=e.payload.id,this.loadModule(e.payload.moduleId,function(e){t.requestHandler=e.value,r()},i);break;case"$schedule":if(this._waitingSchedules.hasOwnProperty(e.payload.scheduleId)){var o=this._waitingSchedules[e.payload.scheduleId];delete this._waitingSchedules[e.payload.scheduleId];try{o(),r()}catch(a){i(s(a))}}else r();break;default:this.handleMessage(e,r,i,n)}},t.prototype.handleMessage=function(e,t,r,i){if(!this.requestHandler)return r("Request handler not loaded"),void 0;if(e.type in this.requestHandler&&"function"==typeof this.requestHandler[e.type])try{this.requestHandler[e.type].call(this.requestHandler,this,t,r,i,e.payload)}catch(n){r(s(n))}else this.requestHandler.request(this,t,r,i,e)},t}();t.WorkerServer=i});define("vs/base/worker/workerServer.nls",[],{});define("vs/base/worker/workerServer.nls.keys",[],{});PNG  IHDR w&gAMA a pHYsj։ tEXtSoftwarePaint.NET v3.5.100raIDAT(Sc?h IWpy ǥ$;yML!HY%d@%AHAmVhPb :pL(&d:[kARIENDB`PNG  IHDR w&gAMA a pHYsktEXtSoftwarePaint.NET v3.5.100rPIDAT(Sc`< ..n>נ9qi9i)#+D׀ȶDq&HI=M QtiMd&"?j8r&IENDB`PNG  IHDR w&gAMA a pHYsj։ tEXtSoftwarePaint.NET v3.5.100rIIDAT(Sc?C… -y(Ƨ Bbb"+u=|;$@^hJt8Iu[G)IENDB`PNG  IHDR w&gAMA a pHYsktEXtSoftwarePaint.NET v3.5.100r2IDAT(Sc`Y; p5 AnZ{K[a& B < [?jUAIENDB`PNG  IHDR w&gAMA a pHYsj։ tEXtSoftwarePaint.NET v3.5.100rFIDAT(Sc?E…  ~Ė`OV'Ҁӽ4P=OD 9&6L[DҦIENDB`PNG  IHDR w&gAMA a pHYsktEXtSoftwarePaint.NET v3.5.100r-IDAT(Sc` @- 385܃^TH0 '?jHIENDB`PNG  IHDR w&gAMA a pHYsj։ tEXtSoftwarePaint.NET v3.5.100raIDAT(SQ !Ю XG+)9-K!Q6("UC% OZW+LU8zfq2A<=,i[򿃏QIENDB`PNG  IHDR w&gAMA a pHYsktEXtSoftwarePaint.NET v3.5.100rOIDAT(Sc`Y=w@?hLƮM<@yX5@V1k@1m$?jEIENDB`/*--------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ ::-ms-clear { display: none; } .monaco-editor { position: relative; overflow: hidden; -webkit-text-size-adjust: 100%; } .monaco-editor .view-overlays > .dynamic { position: absolute; top: 0; } .monaco-editor .view-overlays > .static { position: absolute; top: 0; } .monaco-editor > .inputarea { width: 4px; min-width: 0; height: 4px; min-height: 0; margin: 0; padding: 0; position: absolute; outline: none; resize: none; border: none; overflow: hidden; } .monaco-editor > .accessibility-output { position: absolute; top: 0; left: 0; width: 0; height: 0; overflow: hidden; } .monaco-editor.ie > .inputarea, .monaco-editor.ff > .inputarea { width: 0; height: 0; } .monaco-editor .lines-content { position: absolute; top: 0; -webkit-user-select: text; -ms-user-select: text; -khtml-user-select: text; -moz-user-select: text; -o-user-select: text; user-select: text; } .monaco-editor.ie .lines-content { -ms-user-select: none; user-select: none; } .monaco-editor .lines-content > .view-lines { cursor: text; white-space: pre-wrap; word-wrap: break-word; } .monaco-editor .lines-content > .view-lines > .view-line { position: relative; overflow: visible; width: 100%; } .monaco-editor .view-layer-line { position: relative; overflow: visible; width: 100%; } .monaco-editor .redsquiggly { background: url(css/red-squiggly.png) repeat-x bottom left; } .monaco-editor .glyph-warning { background: url(css/warning-glyph.png) no-repeat center; } .monaco-editor .glyph-error { background: url(css/error-glyph.png) no-repeat center; } .monaco-editor .greensquiggly { background: url(css/green-squiggly.png) repeat-x bottom left; } .monaco-editor .linked-editing { box-shadow: inset 0 0 0 1px #B9B9B9; } .monaco-editor.ie8 .linked-editing { outline: #B9B9B9 solid 1px; filter: alpha(opacity=10); background-color: rgb(0, 100, 0); } .monaco-editor .bracket-match { box-shadow: inset 0 0 0 1px #B9B9B9; background-color: rgba(0, 100, 0, 0.1); } .monaco-editor.ie8 .bracket-match { outline: #B9B9B9 solid 1px; filter: alpha(opacity=10); background-color: rgb(0, 100, 0); } .monaco-editor .editor-widget input { color: inherit; background-color: transparent; } .monaco-editor { font-family: Monaco, Menlo, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace; font-size: 14px; line-height: 19px; color: #333; background: white; } .monaco-editor.mac { font-size: 12px; line-height: 18px; } .monaco-editor-background { background: white; } .monaco-editor .cursor { background: black; } .monaco-editor .current-line { background: #eaeaf2; -moz-box-sizing: border-box; box-sizing: border-box; } .monaco-editor .typeInfo { font-size: 12px; } .monaco-editor .typeInfo .documentation { font-family: "Segoe UI", "HelveticaNeue", sans-serif; } .monaco-editor .line-numbers { background: #fff; color: #2B91AF; } .monaco-editor .lineHighlight { background-color: rgba(253, 255, 0, 0.2); } .monaco-editor.ie8 .lineHighlight { filter: alpha(opacity=20); background-color: rgb(253, 255, 0); } .monaco-editor .dynamic.focused > .selections-layer > .selected-text { background: #ADD6FF !important; } .monaco-editor .dynamic > .selections-layer > .selected-text { background: #E5EBF1 !important; } .monaco-diff-editor .diffOverview { background-color: #f9f7f7; } .monaco-editor .wordHighlight { background-color: rgba(253, 255, 0, 0.28); } .monaco-editor.ie8 .wordHighlight { filter: alpha(opacity=28); background-color: rgb(253, 255, 0); } .monaco-editor .wordHighlightStrong { background-color: rgba(249, 206, 130, 0.7); } .monaco-editor.ie8 .wordHighlightStrong { filter: alpha(opacity=70); background-color: rgb(249, 206, 130); } .monaco-editor .valueSetReplacement { outline: solid 2px #888; } .monaco-editor .focus-mode { background-color: #FFFFFF; opacity: 0.333; } .monaco-editor .token { color: #000000; } .monaco-editor .token.meta { color: #e00000; } .monaco-editor .token.meta.code1 { font-weight: bold; } .monaco-editor .token.keyword { color: #0000FF; } .monaco-editor .token.keyword.flow { color: #AF00DB; } .monaco-editor .token.keyword.datatype { color: blue; } .monaco-editor .token.variable { color: #001188; } .monaco-editor .token.variable.predefined { color: #005588; } .monaco-editor .token.constant { color: #dd0000; } .monaco-editor .token.string { color: #A31515; } .monaco-editor .token.string.escape { color: #A31515; } .monaco-editor .token.comment { color: #008000; font-style: italic; } .monaco-editor .token.literal { color: #e00000; } .monaco-editor .token.literal.hex { color: #e07000; } .monaco-editor .token.number { color: #09885A; } .monaco-editor .token.number.hex { color: #3030c0; } .monaco-editor .token.number.octal { color: #204070; } .monaco-editor .token.number.binary { color: #e07070; } .monaco-editor .token.regexp { color: #811f3f; } .monaco-editor .token.delimiter { color: #008080; } .monaco-editor .token.tag { color: #800000; } .monaco-editor .token.key { color: #863B00; } .monaco-editor .token.attribute.name { color: red; } .monaco-editor .token.attribute.value { color: #0451A5; } .monaco-editor .token.info-token { color: #316bcd; } .monaco-editor .token.warn-token { color: #cd9731; } .monaco-editor .token.error-token { color: #cd3131; } .monaco-editor .token.debug-token { color: purple; } .monaco-editor .token.meta.php { font-weight: bold; } .monaco-editor .token.comment.vs { font-style: italic; } .monaco-editor .token.attribute.vs { font-style: italic; } .monaco-editor .token.vs { font-style: italic; } .monaco-editor .token.delimiter.vs { font-style: italic; } .monaco-editor .token.string.vs { font-style: italic; } .monaco-editor .cursors-layer { position: absolute; top: 0; } .monaco-editor .cursors-layer > .current-line { position: absolute; left: 0; } .monaco-editor .cursors-layer > .cursor { position: absolute; width: 2px; z-index: 50; cursor: text; } .monaco-editor .cursors-layer > .cursor.secondary { width: 1px; opacity: 0.6; } .monaco-editor .contentWidgets { position: absolute; top: 0; } .monaco-editor .overlayWidgets { position: absolute; top: 0; left:0; } .monaco-scrollable-element .arrow-background { cursor: pointer; } .monaco-scrollable-element .up-arrow { background: url(../base/ui/scrollbar/arrow-up.png); cursor: pointer; } .monaco-scrollable-element .down-arrow { background: url(../base/ui/scrollbar/arrow-down.png); cursor: pointer; } .monaco-scrollable-element .left-arrow { background: url(../base/ui/scrollbar/arrow-left.png); cursor: pointer; } .monaco-scrollable-element .right-arrow { background: url(../base/ui/scrollbar/arrow-right.png); cursor: pointer; } .monaco-scrollable-element.tomorrow-night .up-arrow { background: url(../base/ui/scrollbar/arrow-up-dark.png); } .monaco-scrollable-element.tomorrow-night .down-arrow { background: url(../base/ui/scrollbar/arrow-down-dark.png); } .monaco-scrollable-element.tomorrow-night .left-arrow { background: url(../base/ui/scrollbar/arrow-left-dark.png); } .monaco-scrollable-element.tomorrow-night .right-arrow { background: url(../base/ui/scrollbar/arrow-right-dark.png); } .monaco-scrollable-element .visible { opacity: 1; background:rgba(0,0,0,0); -webkit-transition: opacity 100ms linear; -o-transition: opacity 100ms linear; -moz-transition: opacity 100ms linear; -ms-transition: opacity 100ms linear; } .monaco-scrollable-element .invisible { opacity: 0; -webkit-transition: opacity 800ms linear; -o-transition: opacity 800ms linear; -moz-transition: opacity 800ms linear; -ms-transition: opacity 800ms linear; } .monaco-scrollable-element .shadow { position: absolute; display: none; } .monaco-scrollable-element .shadow.top { display: block; top: 0; left: 3px; height: 3px; width: 100%; box-shadow: #ccc 0 6px 6px -6px inset; } .monaco-scrollable-element .shadow.left { display: block; top: 3px; left: 0; height: 100%; width: 3px; box-shadow: #ccc 6px 0 6px -6px inset; } .monaco-scrollable-element .shadow.top-left-corner { display: block; top: 0; left: 0; height: 3px; width: 3px; } .monaco-scrollable-element .shadow.top.left { box-shadow: #ccc 6px 6px 6px -6px inset; } .monaco-scrollable-element .slider { background: rgba(100, 100, 100, .4); } .monaco-scrollable-element.ie8 .slider { filter: alpha(opacity=40); background: rgb(100, 100, 100); } .monaco-scrollable-element .slider:hover { background: rgba(100, 100, 100, .7); } .monaco-scrollable-element.ie8 .slider:hover { filter: alpha(opacity=70); background: rgb(100, 100, 100); } .monaco-scrollable-element .slider.active { background: rgba(0, 0, 0, .6); } .monaco-scrollable-element.ie8 .slider.active { filter: alpha(opacity=60); background: rgb(0, 0, 0); } .monaco-editor .selections-layer { position: absolute; top: 0; overflow: hidden; } .monaco-editor .selections-layer > div { position: absolute; } .monaco-editor .top-left-radius { border-top-left-radius: 3px; } .monaco-editor .bottom-left-radius { border-bottom-left-radius: 3px; } .monaco-editor .top-right-radius { border-top-right-radius: 3px; } .monaco-editor .bottom-right-radius { border-bottom-right-radius: 3px; } .monaco-editor .decorations-layer { position: absolute; top: 0; overflow: hidden; } .monaco-editor .decorations-layer > div { position: absolute; } .monaco-editor .glyph-margin { position: absolute; top: 0; background: #E6E7E8; z-index: 51; } .monaco-editor .glyph-margin > div { position: absolute; width: 100%; } .monaco-editor .lines-decorations { position: absolute; top: 0; background: white; z-index: 51; } .monaco-editor .lines-decorations > div { position: absolute; width: 100%; } .monaco-editor .line-numbers { position: absolute; top: 0; text-align: right; cursor: default; z-index: 51; } .monaco-editor .line-numbers > div { position: absolute; width: 100%; } .hidden { display: none !important; visibility: hidden !important; } .builder-visible { display: inherit; visibility: visible; } .monaco-sash { position: absolute; cursor: ew-resize; z-index: 100; width: 10px; } .monaco-diff-editor .diffOverview { z-index: 99; } .monaco-diff-editor.vs-dark { background: #1E1E1E; } .monaco-scrollable-element.modified-in-monaco-diff-editor .scrollbar { background: rgba(0,0,0,0); } .monaco-scrollable-element.modified-in-monaco-diff-editor .slider { z-index: 100; } .modified-in-monaco-diff-editor .slider.active { background: rgba(171, 171, 171, .4); } .monaco-diff-editor .editor.modified { box-shadow: #CCC 0 0 6px; } .monaco-diff-editor.vs-dark .editor.modified { box-shadow: black 0 0 6px; } .monaco-editor .line-delete, .monaco-editor .char-delete { background: rgba(255, 0, 0, 0.2); } .monaco-editor.ie8 .line-delete, .monaco-editor.ie8 .char-delete { filter: alpha(opacity=20); background-color: rgb(255, 0, 0); } .monaco-editor .line-insert, .monaco-editor .char-insert { background: rgba(155, 185, 85, 0.2); } .monaco-editor.ie8 .line-insert, .monaco-editor.ie8 .char-insert { filter: alpha(opacity=20); background: rgb(155, 185, 85); } .monaco-editor .diagonal-fill { background: url(diff/diagonal-fill.png); } .monaco-editor.vs-dark .diagonal-fill { opacity: 0.2; } .monaco-editor-hover { padding: 0 3px 0 3px; box-shadow: 2px 2px 5px #CCC; border: 1px solid #CCC; position: absolute; margin-top: -1px; cursor: default; z-index: 500; border-radius: 4px; -webkit-animation-duration: 0.15s; -webkit-animation-name: fadeIn; -moz-animation-duration: 0.15s; -moz-animation-name: fadeIn; -ms-animation-duration: 0.15s; -ms-animation-name: fadeIn; animation-duration: 0.15s; animation-name: fadeIn; -webkit-user-select: text; -ms-user-select: text; -khtml-user-select: text; -moz-user-select: text; -o-user-select: text; user-select: text; } .monaco-editor.vs-dark .monaco-editor-hover { box-shadow: none; border-color: #555; } .monaco-editor.vs-dark .monaco-editor-hover a { color: #1C5DAF; } .monaco-editor .token.meta.code1 { color: black; } .monaco-editor .token.meta.code30 { color: dimGray; } .monaco-editor .token.meta.code31 { color: #BE1717; } .monaco-editor .token.meta.code32 { color: darkgreen; } .monaco-editor .token.meta.code33 { color: #BEB817; } .monaco-editor .token.meta.code34 { color: darkblue; } .monaco-editor .token.meta.code35 { color: darkmagenta; } .monaco-editor .token.meta.code36 { color: darkcyan; } .monaco-editor .token.meta.code37 { color: #BDBDBD; } .monaco-editor.vs-dark .token.meta.code1 { color: white; } .monaco-editor.vs-dark .token.meta.code30 { color: #5C5C5C; } .monaco-editor.vs-dark .token.meta.code31 { color: #A74747; } .monaco-editor.vs-dark .token.meta.code32 { color: #348F34; } .monaco-editor.vs-dark .token.meta.code33 { color: #5F4C29; } .monaco-editor.vs-dark .token.meta.code34 { color: #6286BB; } .monaco-editor.vs-dark .token.meta.code35 { color: #914191; } .monaco-editor.vs-dark .token.meta.code36 { color: #218D8D; } .monaco-editor.vs-dark .token.meta.code37 { color: #707070; } .monaco-typescript-status .worker { display: inline-block; width: 1em; height: 1em; } .monaco-typescript-status .worker[status=unknown]:before { content: '?'; } .monaco-typescript-status .worker[status=ok]:before { content: '\25CA'; color: rgb(130, 194, 130); } .monaco-typescript-status .worker[status=updating]:before { content: '\2666'; } .monaco-typescript-status .worker[status=fetching]:before { content: '\2666'; color: blue; } .monaco-typescript-status .worker[status=error]:before { content: '!'; color: red; }/*--------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ "undefined"==typeof WinJS&&(function(e){e.msSetImmediate||(e.msSetImmediate=function(t){return e.setTimeout(t,0)}),e.setImmediate||(e.setImmediate=function(t){return e.setTimeout(t,0)})}(this),function(e,t){"use strict";function n(e,n){var i,o,r,s=Object.keys(n);for(o=0,r=s.length;r>o;o++){var a=s[o],u=95!==a.charCodeAt(0),l=n[a];!l||"object"!=typeof l||l.value===t&&"function"!=typeof l.get&&"function"!=typeof l.set?u?e[a]=l:(i=i||{},i[a]={value:l,enumerable:u,configurable:!0,writable:!0}):(l.enumerable===t&&(l.enumerable=u),i=i||{},i[a]=l)}i&&Object.defineProperties(e,i)}!function(t){function i(e,t,i){for(var o=e,r=t.split("."),s=0,a=r.length;a>s;s++){var u=r[s];o[u]||Object.defineProperty(o,u,{value:{},writable:!1,enumerable:!0,configurable:!0}),o=o[u]}return i&&n(o,i),o}function o(t,n){return i(e,t,n)}e[t]||(e[t]=Object.create(Object.prototype));var r=e[t];r.Namespace||(r.Namespace=Object.create(Object.prototype)),Object.defineProperties(r.Namespace,{defineWithParent:{value:i,writable:!0,enumerable:!0,configurable:!0},define:{value:o,writable:!0,enumerable:!0,configurable:!0}})}("WinJS"),function(e){function t(t,i,o){return t=t||function(){},e.Utilities.markSupportedForProcessing(t),i&&n(t.prototype,i),o&&n(t,o),t}function i(i,o,r,s){if(i){o=o||function(){};var a=i.prototype;return o.prototype=Object.create(a),e.Utilities.markSupportedForProcessing(o),Object.defineProperty(o.prototype,"constructor",{value:o,writable:!0,configurable:!0,enumerable:!0}),r&&n(o.prototype,r),s&&n(o,s),o}return t(o,r,s)}function o(e){e=e||function(){};var t,i;for(t=1,i=arguments.length;i>t;t++)n(e.prototype,arguments[t]);return e}e.Namespace.define("WinJS.Class",{define:t,derive:i,mix:o})}(WinJS)}(this),function(e,t){"use strict";function n(e){return e}function i(e,t,n){return e.split(".").reduce(function(e,t){return e?n(e[t]):null},t)}var o=!!e.Windows,r={notSupportedForProcessing:"Value is not supported within a declarative processing context, if you want it to be supported mark it using WinJS.Utilities.markSupportedForProcessing. The value was: '{0}'"};t.Namespace.define("WinJS.Utilities",{_setHasWinRT:{value:function(e){o=e},configurable:!1,writable:!1,enumerable:!1},hasWinRT:{get:function(){return o},configurable:!1,enumerable:!0},_getMemberFiltered:i,getMember:function(t,o){return t?i(t,o||e,n):null},ready:function(n,i){return new t.Promise(function(o,r){function s(){if(n)try{n(),o()}catch(e){r(e)}else o()}var a=t.Utilities.testReadyState;a||(a=e.document?document.readyState:"complete"),"complete"===a||e.document&&null!==document.body?i?msSetImmediate(s):s():e.addEventListener("DOMContentLoaded",s,!1)})},strictProcessing:{get:function(){return!0},configurable:!1,enumerable:!0},markSupportedForProcessing:{value:function(e){return e.supportedForProcessing=!0,e},configurable:!1,writable:!1,enumerable:!0},requireSupportedForProcessing:{value:function(n){var i=!0;switch(i=i&&!(n===e),i=i&&!(n===e.location),i=i&&!(n instanceof HTMLIFrameElement),i=i&&!("function"==typeof n&&!n.supportedForProcessing),e.frames.length){case 0:break;case 1:i=i&&!(n===e.frames[0]);break;default:for(var o=0,s=e.frames.length;i&&s>o;o++)i=i&&!(n===e.frames[o])}if(i)return n;throw new t.ErrorFromName("WinJS.Utilities.requireSupportedForProcessing",t.Resources._formatString(r.notSupportedForProcessing,n))},configurable:!1,writable:!1,enumerable:!0}}),t.Namespace.define("WinJS",{validation:!1,strictProcessing:{value:function(){},configurable:!1,writable:!1,enumerable:!1}})}(this,WinJS),function(){"use strict";function e(e,t,n){var r=e;return"function"==typeof r&&(r=r()),(n&&o.test(n)?"":n?n+": ":"")+(t?t.replace(i,":")+": ":"")+r}function t(e,t,n){var i=WinJS.Utilities.formatLog(e,t,n);console[n&&o.test(n)?n:"log"](i)}function n(e){return e.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&")}var i=/\s+/g,o=/^(error|warn|info|log)$/;WinJS.Namespace.define("WinJS.Utilities",{startLog:function(e){e=e||{},"string"==typeof e&&(e={tags:e});var o=e.type&&new RegExp("^("+n(e.type).replace(i," ").split(" ").join("|")+")$"),r=e.excludeTags&&new RegExp("(^|\\s)("+n(e.excludeTags).replace(i," ").split(" ").join("|")+")(\\s|$)","i"),s=e.tags&&new RegExp("(^|\\s)("+n(e.tags).replace(i," ").split(" ").join("|")+")(\\s|$)","i"),a=e.action||t;if(!(o||r||s||WinJS.log))return WinJS.log=a,void 0;var u=function(e,t,n){o&&!o.test(n)||r&&r.test(t)||s&&!s.test(t)||a(e,t,n),u.next&&u.next(e,t,n)};u.next=WinJS.log,WinJS.log=u},stopLog:function(){delete WinJS.log},formatLog:e})}(),function(e){"use strict";function t(e){var t="_on"+e+"state";return{get:function(){var e=this[t];return e&&e.userHandler},set:function(n){var i=this[t];n?(i||(i={wrapper:function(e){return i.userHandler(e)},userHandler:n},Object.defineProperty(this,t,{value:i,enumerable:!1,writable:!0,configurable:!0}),this.addEventListener(e,i.wrapper,!1)),i.userHandler=n):i&&(this.removeEventListener(e,i.wrapper,!1),this[t]=null)},enumerable:!0}}function n(){for(var e={},n=0,i=arguments.length;i>n;n++){var o=arguments[n];e["on"+o]=t(o)}return e}var i=e.Class.define(function(e,t,n){this.detail=t,this.target=n,this.timeStamp=Date.now(),this.type=e},{bubbles:{value:!1,writable:!1},cancelable:{value:!1,writable:!1},currentTarget:{get:function(){return this.target}},defaultPrevented:{get:function(){return this._preventDefaultCalled}},trusted:{value:!1,writable:!1},eventPhase:{value:0,writable:!1},target:null,timeStamp:null,type:null,preventDefault:function(){this._preventDefaultCalled=!0},stopImmediatePropagation:function(){this._stopImmediatePropagationCalled=!0},stopPropagation:function(){}},{supportedForProcessing:!1}),o={_listeners:null,addEventListener:function(e,t,n){n=n||!1,this._listeners=this._listeners||{};for(var i=this._listeners[e]=this._listeners[e]||[],o=0,r=i.length;r>o;o++){var s=i[o];if(s.useCapture===n&&s.listener===t)return}i.push({listener:t,useCapture:n})},dispatchEvent:function(e,t){var n=this._listeners&&this._listeners[e];if(n){var o=new i(e,t,this);n=n.slice(0,n.length);for(var r=0,s=n.length;s>r&&!o._stopImmediatePropagationCalled;r++)n[r].listener(o);return o.defaultPrevented||!1}return!1},removeEventListener:function(e,t,n){n=n||!1;var i=this._listeners&&this._listeners[e];if(i)for(var o=0,r=i.length;r>o;o++){var s=i[o];if(s.listener===t&&s.useCapture===n){i.splice(o,1),0===i.length&&delete this._listeners[e];break}}}};e.Namespace.define("WinJS.Utilities",{_createEventProperty:t,createEventProperties:n,eventMixin:o})}(WinJS),function(e,t,n){"use strict";var i,o=!1,r="contextchanged",s=t.Class.mix(t.Class.define(null,{},{supportedForProcessing:!1}),t.Utilities.eventMixin),a=new s,u={malformedFormatStringInput:"Malformed, did you mean to escape your '{0}'?"};t.Namespace.define("WinJS.Resources",{addEventListener:function(e,n,i){if(t.Utilities.hasWinRT&&!o&&e===r)try{Windows.ApplicationModel.Resources.Core.ResourceManager.current.defaultContext.qualifierValues.addEventListener("mapchanged",function(e){t.Resources.dispatchEvent(r,{qualifier:e.key,changed:e.target[e.key]})},!1),o=!0}catch(s){}a.addEventListener(e,n,i)},removeEventListener:a.removeEventListener.bind(a),dispatchEvent:a.dispatchEvent.bind(a),_formatString:function(e){var n=arguments;return n.length>1&&(e=e.replace(/({{)|(}})|{(\d+)}|({)|(})/g,function(e,i,o,r,s,a){if(s||a)throw t.Resources._formatString(u.malformedFormatStringInput,s||a);return i&&"{"||o&&"}"||n[(0|r)+1]})),e},_getStringWinRT:function(e){if(!i){var t=Windows.ApplicationModel.Resources.Core.ResourceManager.current.mainResourceMap;try{i=t.getSubtree("Resources")}catch(o){}i||(i=t)}var r,s,a;try{a=i.getValue(e),a&&(r=a.valueAsString,r===n&&(r=a.toString()))}catch(o){}if(!r)return{value:e,empty:!0};try{s=a.getQualifierValue("Language")}catch(o){return{value:r}}return{value:r,lang:s}},_getStringJS:function(t){var n=e.strings&&e.strings[t];return"string"==typeof n&&(n={value:n}),n||{value:t,empty:!0}}}),Object.defineProperties(t.Resources,t.Utilities.createEventProperties(r));var l;t.Resources.getString=function(e){return l=l||(t.Utilities.hasWinRT?t.Resources._getStringWinRT:t.Resources._getStringJS),l(e)}}(this,WinJS),function(e,t){"use strict";function n(){}function i(e,t){var n;n=t&&"object"==typeof t&&"function"==typeof t.then?R:O,e._value=t,e._setState(n)}function o(e,t,n,i,o,r){return{exception:e,error:t,promise:n,handler:r,id:i,parent:o}}function r(e,t,n,i){var r=n._isException,s=n._errorId;return o(r?t:null,r?null:t,e,s,n,i)}function s(e,t,n){var i=n._isException,r=n._errorId;return g(e,r,i),o(i?t:null,i?null:t,e,r,n)}function a(e,t){var n=++H;return g(e,n),o(null,t,e,n)}function u(e,t){var n=++H;return g(e,n,!0),o(t,null,e,n)}function l(e,t,n,i){m(e,{c:t,e:n,p:i})}function h(e,t,n,i){e._value=t,p(e,t,n,i),e._setState(A)}function d(e,t){var n=e._value,i=e._listeners;if(i){e._listeners=null;var o,r;for(o=0,r=Array.isArray(i)?i.length:1;r>o;o++){var s=1===r?i:i[o],a=s.c,u=s.promise;if(u){try{u._setCompleteValue(a?a(n):n)}catch(l){u._setExceptionValue(l)}u._state!==R&&u._listeners&&t.push(u)}else q.prototype.done.call(e,a)}}}function c(e,t){var n=e._value,i=e._listeners;if(i){e._listeners=null;var o,s;for(o=0,s=Array.isArray(i)?i.length:1;s>o;o++){var a=1===s?i:i[o],u=a.e,l=a.promise;if(l){try{u?(u.handlesOnError||p(l,n,r,e,u),l._setCompleteValue(u(n))):l._setChainedErrorValue(n,e)}catch(h){l._setExceptionValue(h)}l._state!==R&&l._listeners&&t.push(l)}else B.prototype.done.call(e,null,u)}}}function p(e,t,n,i,o){if(E._listeners[S]){if(t instanceof Error&&t.message===L)return;E.dispatchEvent(S,n(e,t,i,o))}}function f(e,t){var n=e._listeners;if(n){var i,o;for(i=0,o=Array.isArray(n)?n.length:1;o>i;i++){var r=1===o?n:n[i],s=r.p;if(s)try{s(t)}catch(a){}r.c||r.e||!r.promise||r.promise._progress(t)}}}function m(e,t){var n=e._listeners;n?(n=Array.isArray(n)?n:[n],n.push(t)):n=t,e._listeners=n}function g(e,t,n){e._isException=n||!1,e._errorId=t}function v(e,t,n,i){e._value=t,p(e,t,n,i),e._setState(W)}function y(e,t){var n;n=t&&"object"==typeof t&&"function"==typeof t.then?R:P,e._value=t,e._setState(n)}function C(e,t,n,i){var o=new U(e);return m(e,{promise:o,c:t,e:n,p:i}),o}function _(e){var t;return new WinJS.Promise(function(n){e?t=setTimeout(n,e):setImmediate(n)},function(){t&&clearTimeout(t)})}function b(e,t){var n=function(){t.cancel()},i=function(){e.cancel()};return e.then(n),t.then(i,i),t}e.Debug&&(e.Debug.setNonUserCodeExceptions=!0);var w=WinJS.Class.mix(WinJS.Class.define(null,{},{supportedForProcessing:!1}),WinJS.Utilities.eventMixin),E=new w;E._listeners={};var S="error",L="Canceled",T=!1,N={promise:1,thenPromise:2,errorPromise:4,exceptionPromise:8,completePromise:16};N.all=N.promise|N.thenPromise|N.errorPromise|N.exceptionPromise|N.completePromise;var M,x,R,I,k,D,O,P,A,W,H=1;M={name:"created",enter:function(e){e._setState(x)},cancel:n,done:n,then:n,_completed:n,_error:n,_notify:n,_progress:n,_setCompleteValue:n,_setErrorValue:n},x={name:"working",enter:n,cancel:function(e){e._setState(k)},done:l,then:C,_completed:i,_error:h,_notify:n,_progress:f,_setCompleteValue:y,_setErrorValue:v},R={name:"waiting",enter:function(e){var t=e._value,n=function(i){t._errorId?e._chainedError(i,t):(p(e,i,r,t,n),e._error(i))};n.handlesOnError=!0,t.then(e._completed.bind(e),n,e._progress.bind(e))},cancel:function(e){e._setState(I)},done:l,then:C,_completed:i,_error:h,_notify:n,_progress:f,_setCompleteValue:y,_setErrorValue:v},I={name:"waiting_canceled",enter:function(e){e._setState(D);var t=e._value;t.cancel&&t.cancel()},cancel:n,done:l,then:C,_completed:i,_error:h,_notify:n,_progress:f,_setCompleteValue:y,_setErrorValue:v},k={name:"canceled",enter:function(e){e._setState(D),e._cancelAction()},cancel:n,done:l,then:C,_completed:i,_error:h,_notify:n,_progress:f,_setCompleteValue:y,_setErrorValue:v},D={name:"canceling",enter:function(e){var t=new Error(L);t.name=t.message,e._value=t,e._setState(A)},cancel:n,done:n,then:n,_completed:n,_error:n,_notify:n,_progress:n,_setCompleteValue:n,_setErrorValue:n},O={name:"complete_notify",enter:function(e){if(e.done=q.prototype.done,e.then=q.prototype.then,e._listeners)for(var t,n=[e];n.length;)t=n.pop(),t._state._notify(t,n);e._setState(P)},cancel:n,done:null,then:null,_completed:n,_error:n,_notify:d,_progress:n,_setCompleteValue:n,_setErrorValue:n},P={name:"success",enter:function(e){e.done=q.prototype.done,e.then=q.prototype.then,e._cleanupAction()},cancel:n,done:null,then:null,_completed:n,_error:n,_notify:d,_progress:n,_setCompleteValue:n,_setErrorValue:n},A={name:"error_notify",enter:function(e){if(e.done=B.prototype.done,e.then=B.prototype.then,e._listeners)for(var t,n=[e];n.length;)t=n.pop(),t._state._notify(t,n);e._setState(W)},cancel:n,done:null,then:null,_completed:n,_error:n,_notify:c,_progress:n,_setCompleteValue:n,_setErrorValue:n},W={name:"error",enter:function(e){e.done=B.prototype.done,e.then=B.prototype.then,e._cleanupAction()},cancel:n,done:null,then:null,_completed:n,_error:n,_notify:c,_progress:n,_setCompleteValue:n,_setErrorValue:n};var V,F=WinJS.Class.define(null,{_listeners:null,_nextState:null,_state:null,_value:null,cancel:function(){this._state.cancel(this),this._run()},done:function(e,t,n){this._state.done(this,e,t,n)},then:function(e,t,n){return this._state.then(this,e,t,n)},_chainedError:function(e,t){var n=this._state._error(this,e,s,t);return this._run(),n},_completed:function(e){var t=this._state._completed(this,e);return this._run(),t},_error:function(e){var t=this._state._error(this,e,a);return this._run(),t},_progress:function(e){this._state._progress(this,e)},_setState:function(e){this._nextState=e},_setCompleteValue:function(e){this._state._setCompleteValue(this,e),this._run()},_setChainedErrorValue:function(e,t){var n=this._state._setErrorValue(this,e,s,t);return this._run(),n},_setExceptionValue:function(e){var t=this._state._setErrorValue(this,e,u);return this._run(),t},_run:function(){for(;this._nextState;)this._state=this._nextState,this._nextState=null,this._state.enter(this)}},{supportedForProcessing:!1}),U=WinJS.Class.derive(F,function(e){T&&(T===!0||T&N.thenPromise)&&(this._stack=WinJS.Promise._getStack()),this._creator=e,this._setState(M),this._run()},{_creator:null,_cancelAction:function(){this._creator&&this._creator.cancel()},_cleanupAction:function(){this._creator=null}},{supportedForProcessing:!1}),B=WinJS.Class.define(function(e){T&&(T===!0||T&N.errorPromise)&&(this._stack=WinJS.Promise._getStack()),this._value=e,p(this,e,a)},{cancel:function(){},done:function(e,t){var n=this._value;if(t)try{t.handlesOnError||p(null,n,r,this,t);var i=t(n);return i&&"object"==typeof i&&"function"==typeof i.done&&i.done(),void 0}catch(o){n=o}n instanceof Error&&n.message===L||setImmediate(function(){throw n})},then:function(e,t){if(!t)return this;var n,i=this._value;try{t.handlesOnError||p(null,i,r,this,t),n=new q(t(i))}catch(o){n=o===i?this:new z(o)}return n}},{supportedForProcessing:!1}),z=WinJS.Class.derive(B,function(e){T&&(T===!0||T&N.exceptionPromise)&&(this._stack=WinJS.Promise._getStack()),this._value=e,p(this,e,u)},{},{supportedForProcessing:!1}),q=WinJS.Class.define(function(e){if(T&&(T===!0||T&N.completePromise)&&(this._stack=WinJS.Promise._getStack()),e&&"object"==typeof e&&"function"==typeof e.then){var t=new U(null);return t._setCompleteValue(e),t}this._value=e},{cancel:function(){},done:function(e){if(e)try{var t=e(this._value);t&&"object"==typeof t&&"function"==typeof t.done&&t.done()}catch(n){setImmediate(function(){throw n})}},then:function(e){try{var t=e?e(this._value):this._value;return t===this._value?this:new q(t)}catch(n){return new z(n)}}},{supportedForProcessing:!1}),j=WinJS.Class.derive(F,function(e,t){T&&(T===!0||T&N.promise)&&(this._stack=WinJS.Promise._getStack()),this._oncancel=t,this._setState(M),this._run();try{var n=this._completed.bind(this),i=this._error.bind(this),o=this._progress.bind(this);e(n,i,o)}catch(r){this._setExceptionValue(r)}},{_oncancel:null,_cancelAction:function(){if(this._oncancel)try{this._oncancel()}catch(e){}},_cleanupAction:function(){this._oncancel=null}},{addEventListener:function(e,t,n){E.addEventListener(e,t,n)},any:function(e){return new j(function(t,n){var i=Object.keys(e);Array.isArray(e)?[]:{},0===i.length&&t();var o=0;i.forEach(function(r){j.as(e[r]).then(function(){t({key:r,value:e[r]})},function(s){return s instanceof Error&&s.name===L?(++o===i.length&&t(WinJS.Promise.cancel),void 0):(n({key:r,value:e[r]}),void 0)})})},function(){var t=Object.keys(e);t.forEach(function(t){var n=j.as(e[t]);"function"==typeof n.cancel&&n.cancel()})})},as:function(e){return e&&"object"==typeof e&&"function"==typeof e.then?e:new q(e)},cancel:{get:function(){return V=V||new B(new WinJS.ErrorFromName(L))}},dispatchEvent:function(e,t){return E.dispatchEvent(e,t)},is:function(e){return e&&"object"==typeof e&&"function"==typeof e.then},join:function(e){return new j(function(n,i,o){var r=Object.keys(e),s=Array.isArray(e)?[]:{},a=Array.isArray(e)?[]:{},u=0,l=r.length,h=function(e){if(0===--l){var t=Object.keys(s).length;if(0===t)n(a);else{var u=0;r.forEach(function(e){var t=s[e];t instanceof Error&&t.name===L&&u++}),u===t?n(WinJS.Promise.cancel):i(s)}}else o({Key:e,Done:!0})};return r.forEach(function(n){var i=e[n];i===t?u++:j.then(i,function(e){a[n]=e,h(n)},function(e){s[n]=e,h(n)})}),l-=u,0===l?(n(a),void 0):void 0},function(){Object.keys(e).forEach(function(t){var n=j.as(e[t]);"function"==typeof n.cancel&&n.cancel()})})},removeEventListener:function(e,t,n){E.removeEventListener(e,t,n)},supportedForProcessing:!1,then:function(e,t,n,i){return j.as(e).then(t,n,i)},thenEach:function(e,t,n,i){var o=Array.isArray(e)?[]:{};return Object.keys(e).forEach(function(r){o[r]=j.as(e[r]).then(t,n,i)}),j.join(o)},timeout:function(e,t){var n=_(e);return t?b(n,t):n},wrap:function(e){return new q(e)},wrapError:function(e){return new B(e)},_veryExpensiveTagWithStack:{get:function(){return T},set:function(e){T=e}},_veryExpensiveTagWithStack_tag:N,_getStack:function(){if(Debug.debuggerEnabled)try{throw new Error}catch(e){return e.stack}}});Object.defineProperties(j,WinJS.Utilities.createEventProperties(S));var G=WinJS.Class.derive(F,function(e){this._oncancel=e,this._setState(M),this._run()},{_cancelAction:function(){this._oncancel&&this._oncancel()},_cleanupAction:function(){this._oncancel=null}},{supportedForProcessing:!1}),K=WinJS.Class.define(function(e){this._promise=new G(e)},{promise:{get:function(){return this._promise}},cancel:function(){this._promise.cancel()},complete:function(e){this._promise._completed(e)},error:function(e){this._promise._error(e)},progress:function(e){this._promise._progress(e)}},{supportedForProcessing:!1});WinJS.Namespace.define("WinJS",{Promise:j,_Signal:K})}(this),function(e,t){"use strict";t.Namespace.define("WinJS",{ErrorFromName:t.Class.derive(Error,function(e,t){this.name=e,this.message=t||e},{},{supportedForProcessing:!1})})}(this,WinJS),function(){"use strict";WinJS.Namespace.define("WinJS",{xhr:function(e){var t;return new WinJS.Promise(function(n,i,o){t=new XMLHttpRequest,t.onreadystatechange=function(){t._canceled||(4===t.readyState?(t.status>=200&&t.status<300||1223===t.status?n(t):i(t),t.onreadystatechange=function(){}):o(t))},t.open(e.type||"GET",e.url,!0,e.user,e.password),t.responseType=e.responseType||"",Object.keys(e.headers||{}).forEach(function(n){t.setRequestHeader(n,e.headers[n])}),t.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.customRequestInitializer&&e.customRequestInitializer(t),t.send(e.data)},function(){t._canceled=!0,t.abort()})}})}(),function(e){"use strict";var t,n,i,o,r,s,a={nonStaticHTML:"Unable to add dynamic content. A script attempted to inject dynamic content, or elements previously modified dynamically, that might be unsafe. For example, using the innerHTML property or the document.write method to add a script element will generate this exception. If the content is safe and from a trusted source, use a method to explicitly manipulate elements and attributes, such as createElement, or use setInnerHTMLUnsafe (or other unsafe method)."};t=n=function(e,t){e.innerHTML=t},i=o=function(e,t){e.outerHTML=t},r=s=function(e,t,n){e.insertAdjacentHTML(t,n)};var u=e.MSApp;if(u)n=function(e,t){u.execUnsafeLocalFunction(function(){e.innerHTML=t})},o=function(e,t){u.execUnsafeLocalFunction(function(){e.outerHTML=t})},s=function(e,t,n){u.execUnsafeLocalFunction(function(){e.insertAdjacentHTML(t,n)})};else if(e.msIsStaticHTML){var l=function(t){if(!e.msIsStaticHTML(t))throw new WinJS.ErrorFromName("WinJS.Utitilies.NonStaticHTML",a.nonStaticHTML)};t=function(e,t){l(t),e.innerHTML=t},i=function(e,t){l(t),e.outerHTML=t},r=function(e,t,n){l(n),e.insertAdjacentHTML(t,n)}}WinJS.Namespace.define("WinJS.Utilities",{setInnerHTML:t,setInnerHTMLUnsafe:n,setOuterHTML:i,setOuterHTMLUnsafe:o,insertAdjacentHTML:r,insertAdjacentHTMLUnsafe:s})}(this)),define("vs/base/lib/raw.winjs.base",[],{}),define("vs/editor/core/constants",["require","exports"],function(e,t){"use strict";t.EditorType={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor",ITerminal:"vs.editor.ITerminal"},t.ClassName={EditorWarningDecoration:"greensquiggly",EditorErrorDecoration:"redsquiggly"},t.Handler={ExecuteCommand:"executeCommand",CursorLeft:"cursorLeft",CursorLeftSelect:"cursorLeftSelect",CursorWordLeft:"cursorWordLeft",CursorWordLeftSelect:"cursorWordLeftSelect",CursorRight:"cursorRight",CursorRightSelect:"cursorRightSelect",CursorWordRight:"cursorWordRight",CursorWordRightSelect:"cursorWordRightSelect",CursorUp:"cursorUp",CursorUpSelect:"cursorUpSelect",CursorDown:"cursorDown",CursorDownSelect:"cursorDownSelect",CursorPageUp:"cursorPageUp",CursorPageUpSelect:"cursorPageUpSelect",CursorPageDown:"cursorPageDown",CursorPageDownSelect:"cursorPageDownSelect",CursorHome:"cursorHome",CursorHomeSelect:"cursorHomeSelect",CursorEnd:"cursorEnd",CursorEndSelect:"cursorEndSelect",CursorTop:"cursorTop",CursorTopSelect:"cursorTopSelect",CursorBottom:"cursorBottom",CursorBottomSelect:"cursorBottomSelect",AddCursorDown:"addCursorDown",AddCursorUp:"addCursorUp",MoveTo:"moveTo",MoveToSelect:"moveToSelect",CreateCursor:"createCursor",LastCursorMoveToSelect:"lastCursorMoveToSelect",JumpToBracket:"jumpToBracket",Type:"type",Paste:"paste",Tab:"tab",Indent:"indent",Outdent:"outdent",DeleteLeft:"deleteLeft",DeleteRight:"deleteRight",DeleteWordLeft:"deleteWordLeft",DeleteWordRight:"deleteWordRight",DeleteAllLeft:"deleteAllLeft",DeleteAllRight:"deleteAllRight",Enter:"enter",Escape:"escape",Cut:"cut",Undo:"undo",Redo:"redo",WordSelect:"wordSelect",WordSelectDrag:"wordSelectDrag",LastCursorWordSelect:"lastCursorWordSelect",LineSelect:"lineSelect",LineSelectDrag:"lineSelectDrag",LastCursorLineSelect:"lastCursorLineSelect",LineInsertBefore:"lineInsertBefore",LineInsertAfter:"lineInsertAfter",LineBreakInsert:"lineBreakInsert",SelectAll:"selectAll"},t.EventType={Disposed:"disposed",ConfigurationChanged:"configurationChanged",ConfigurationLineHeightChanged:"configurationLineHeightChanged",ConfigurationFontChanged:"configurationFontChanged",ModelDispose:"modelDispose",ModelChanged:"modelChanged",ModelModeChanged:"modelsModeChanged",ModelTokensChanged:"modelTokensChanged",ModelContentChanged:"contentChanged",ModelContentChangedFlush:"flush",ModelContentChangedLinesDeleted:"linesDeleted",ModelContentChangedLinesInserted:"linesInserted",ModelContentChangedLineChanged:"lineChanged",OnBeforeModelContentChangedFlush:"onBeforeFlush",OnBeforeModelContentChangedLinesDeleted:"onBeforeLinesDeleted",OnBeforeModelContentChangedLinesInserted:"onBeforeLinesInserted",OnBeforeModelContentChangedLineChanged:"onBeforeLineChanged",ModelPropertiesChanged:"propertiesChanged",ModelDecorationsChanged:"decorationsChanged",CursorPositionChanged:"positionChanged",CursorSelectionChanged:"selectionChanged",CursorRevealRange:"revealRange",ViewFocusGained:"focusGained",ViewFocusLost:"focusLost",ViewFocusChanged:"focusChanged",ViewScrollWidthChanged:"scrollWidthChanged",ViewScrollHeightChanged:"scrollHeightChanged",ViewScrollChanged:"scrollChanged",ViewZonesChanged:"zonesChanged",ViewLayoutChanged:"viewLayoutChanged",ContextMenu:"contextMenu",MouseDown:"mousedown",MouseUp:"mouseup",MouseMove:"mousemove",MouseLeave:"mouseleave",KeyDown:"keydown",KeyUp:"keyup",EditorLayout:"editorLayout",DiffUpdated:"diffUpdated"}}),define("vs/base/types",["require","exports"],function(e,t){"use strict";function n(e){return Array.isArray?Array.isArray(e):e&&"number"==typeof e.length&&e.constructor===Array?!0:!1}function i(e){return"string"==typeof e||e instanceof String?!0:!1}function o(e){return"undefined"==typeof e||null===e?!1:"[object Object]"===Object.prototype.toString.call(e)}function r(e){return("number"==typeof e||e instanceof Number)&&!isNaN(e)?!0:!1}function s(e){return"undefined"==typeof e}function a(e){return s(e)||null===e}function u(e){if(!o(e))return!1;for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function l(e){return"[object Function]"===Object.prototype.toString.call(e)}function h(e){for(var t=[],n=0;n0&&null!==e.statusText?t&&null!==e.responseText&&e.responseText.length>0?m.localize("vs_base_errors",3,e.statusText,e.status,e.responseText):m.localize("vs_base_errors",4,e.statusText,e.status):t&&null!==e.responseText&&e.responseText.length>0?m.localize("vs_base_errors",5,e.responseText):m.localize("vs_base_errors",6)}function l(e,t){return u(new C(e),t)}function h(e,t){return t&&e.message&&(e.stack||e.stacktrace)?m.localize("vs_base_errors",7,e.message,e.stack||e.stacktrace):e.message?e.message:m.localize("vs_base_errors",8)}function d(e,t){if("undefined"==typeof t&&(t=!1),!e)return m.localize("vs_base_errors",9);if(v.isString(e))return e;if(e instanceof C)return u(e,t);if(!v.isUndefinedOrNull(e.status))return l(e,t);if(e.detail){var n=e.detail;if(n.error){if(n.error&&!v.isUndefinedOrNull(n.error.status))return l(n.error,t);if(!v.isArray(n.error))return h(n.error,t);for(var i=0;ir;r++)i=i.replace(new RegExp("\\{"+r+"\\}","g"),t[r]);return i}function s(e){return e||(e=new Date),A.localize("vs_base_strings",0,o(e.getMonth()+1,2),o(e.getDate(),2),o(e.getFullYear(),4),o(e.getHours(),2),o(e.getMinutes(),2),o(e.getSeconds(),2))}function a(e){return e||(e=new Date),A.localize("vs_base_strings",1,o(e.getHours(),2),o(e.getMinutes(),2),o(e.getSeconds(),2))}function u(e){return e.replace(/[<|>|&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}function l(e){var t=document.createElement("div"); return t.innerHTML=e,t.textContent||t.innerText||""}function h(e,t){"undefined"==typeof t&&(t=" ");var n=d(e,t);return c(n,t)}function d(e,t){var n=t.length;if(0===n||0===e.length)return e;for(var i=0,o=-1;(o=e.indexOf(t,i))===i;)i+=n;return e.substring(i)}function c(e,t){var n=t.length,i=e.length;if(0===n||0===i)return e;for(var o=i,r=-1;;){if(r=e.lastIndexOf(t,o-1),-1===r||r+n!==o)break;if(0===r)return"";o=r}return e.substring(0,o)}function p(e){return e.replace(/(^\s+|\s+$)/g,"")}function f(e){return e.replace(/\s+/g," ")}function m(e){var t=(new Date).getTime(),n=t-e.getTime();return n/H.DAY>=2?A.localize("vs_base_strings",2,Math.floor(n/H.DAY)):n/H.DAY>=1?A.localize("vs_base_strings",3):n/H.HOUR>=2?A.localize("vs_base_strings",4,Math.floor(n/H.HOUR)):n/H.HOUR>=1?A.localize("vs_base_strings",5):n/H.MINUTE>=2?A.localize("vs_base_strings",6,Math.floor(n/H.MINUTE)):n/H.MINUTE>=1?A.localize("vs_base_strings",7):A.localize("vs_base_strings",8)}function g(e){var t=(new Date).getTime(),n=(t-e)/1e3;if(60>n)return A.localize("vs_base_strings",9,Math.floor(n));var i=n/60;if(60>i)return A.localize("vs_base_strings",10,Math.floor(i));var o=i/60;if(24>o)return A.localize("vs_base_strings",11,Math.floor(o));var r=o/24;return A.localize("vs_base_strings",12,Math.floor(r))}function v(e){return e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function y(e,t){for(var n=0,i=t.length;i>n;n++)if(e.charCodeAt(n)!==t.charCodeAt(n))return!1;return!0}function C(e,t){if(t.length>e.length)return!1;for(var n=0,i=e.length-t.length;ni;i++)n[i]=encodeURIComponent(n[i]);return n.join("/")}return encodeURIComponent(e)}function S(e){return/^\w[\w.]*$/.test(e)}function L(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}function T(e,t,n){return t&&(e="^"+e),n&&(e+="$"),e}function N(e,t){if(w(new RegExp(e,t)))throw new Error("Regular expression /"+e+"/g results in infinitive matches")}function M(e){return e?(0===e.indexOf("/")&&(e=e.substring(1)),E(e,!0)):""}function x(e){return"undefined"==typeof e&&(e=8),R(e)}function R(e){for(var t="",n=0;e>n;n++)t+=V[Math.floor(Math.random()*F)];return t}function I(e,t){return"["+e+"m"+t+""}function k(e){for(var t=0,n=e.length;n>t;t++)if(" "!==e.charAt(t)&&" "!==e.charAt(t))return t;return-1}function D(e){for(var t=0,n=e.length;n>t;t++)if(" "!==e.charAt(t)&&" "!==e.charAt(t))return e.substring(0,t);return e}function O(e){for(var t=e.length-1;t>=0;t--)if(" "!==e.charAt(t)&&" "!==e.charAt(t))return t;return-1}function P(e,t){if(!B&&(B=!0,window.Intl&&W.isFunction(window.Intl.Collator))){var n=new window.Intl.Collator;W.isFunction(n.compare)&&(U=n.compare)}return U?U.call(this,e,t):e.localeCompare(t)}var A=n,W=i;t.pad=o,t.format=r,t.formatDate=s,t.formatTime=a,t.escape=u,t.stripHtml=l,t.trim=h,t.ltrim=d,t.rtrim=c,t.trimWhitespace=p,t.normalize=f;var H={SECOND:1e3,MINUTE:6e4,HOUR:36e5,DAY:864e5};t.formatDiff=m,t.conciseformatDiff=g,t.convertSimple2RegExpPattern=v,t.startsWith=y,t.endsWith=C,t.splice=_,t.createRegExp=b,t.regExpLeadsToEndlessLoop=w,t.encodeURIPart=E,t.isCamelCasePattern=S,t.toRegExpPattern=L,t.anchorPattern=T,t.assertRegExp=N,t.normalizePath=M,t.generateUuid=x;var V="0123456789abcdefghiklmnopkqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",F=V.length;t.colorize=I,t.firstNonWhitespaceIndex=k,t.getLeadingWhitespace=D,t.lastNonWhitespaceIndex=O;var U,B=!1;t.localeCompare=P}),define("vs/base/assert",["require","exports","vs/base/strings"],function(e,t,n){"use strict";function i(e,t){if(!e||null===e)throw new Error(t?r.format("Assertion failed ({0})",t):"Assertion Failed")}function o(e,t,n){if(e!==t||!e||!t)throw new Error(n?r.format("Assertion failed ({0})",n):"Assertion Failed")}var r=n;t.ok=i,t.equals=o});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/platform/platform",["require","exports","vs/base/lib/winjs.base","vs/base/types","vs/base/assert"],function(e,t,n,i,o){"use strict";var r=n,s=i,a=o,u=function(){function e(e){a.ok(s.isFunction(e)),this.ctor=e}return e.prototype.createNew=function(){for(var e=[],t=0;t=0,isMacintosh:u.indexOf("Macintosh")>=0,isOpera:u.indexOf("Opera")>=0,isIE:u.indexOf("IE")>=0||u.indexOf("Trident")>=0,isIE10:u.indexOf("MSIE 10")>=0,isIE9:u.indexOf("MSIE 9")>=0,isIE8:u.indexOf("MSIE 8")>=0,isFirefox:u.indexOf("Firefox")>=0,isWebKit:u.indexOf("AppleWebKit")>=0,isChrome:u.indexOf("Chrome")>=0,isSafari:-1===u.indexOf("Chrome")&&u.indexOf("Safari")>=0,canPushState:function(){return self&&self.history&&self.history.pushState},hasCSSAnimationSupport:function(){if(this._hasCSSAnimationSupport===!0||this._hasCSSAnimationSupport===!1)return this._hasCSSAnimationSupport;for(var e=!1,t=document.createElement("div"),n=["animationName","webkitAnimationName","msAnimationName","MozAnimationName","OAnimationName"],i=0;ir;r++)i.push(new o(e[r].getType(),e[r].getData(),t))}0===n._deferredCnt?n._emitEvents(i):n._collectedEvents.push.apply(n._collectedEvents,i)})},e.prototype.addEmitterTypeListener=function(e,t,n){if(t){if("*"===e)throw new Error("Bulk listeners cannot specify an emitter type");return this.addListener(e+"/"+t,n)}return this.addListener(e,n)},e.prototype._removeListener=function(e,t){if(this._listeners.hasOwnProperty(e))for(var n=this._listeners[e],i=0,o=n.length;o>i;i++)if(n[i]===t){n.splice(i,1);break}},e.prototype._removeBulkListener=function(e){for(var t=0,n=this._bulkListeners.length;n>t;t++)if(this._bulkListeners[t]===e){this._bulkListeners.splice(t,1);break}},e.prototype._emitToSpecificTypeListeners=function(e,t){if(this._listeners.hasOwnProperty(e))for(var n=this._listeners[e].slice(0),o=0,r=n.length;r>o;o++)try{n[o](t)}catch(s){i.onUnexpectedError(s)}},e.prototype._emitToBulkListeners=function(e){for(var t=this._bulkListeners.slice(0),n=0,o=t.length;o>n;n++)try{t[n](e)}catch(r){i.onUnexpectedError(r)}},e.prototype._emitEvents=function(e){this._bulkListeners.length>0&&this._emitToBulkListeners(e);for(var t=0,n=e.length;n>t;t++){var i=e[t];this._emitToSpecificTypeListeners(i.getType(),i.getData()),i.getEmitterType()&&this._emitToSpecificTypeListeners(i.getType()+"/"+i.getEmitterType(),i.getData())}},e.prototype.emit=function(e,t){if("undefined"==typeof t&&(t={}),this._listeners.hasOwnProperty(e)||0!==this._bulkListeners.length){var n=new o(e,t);0===this._deferredCnt?this._emitEvents([n]):this._collectedEvents.push(n)}},e.prototype.deferredEmit=function(e){this._deferredCnt=this._deferredCnt+1;var t=e();return this._deferredCnt=this._deferredCnt-1,0===this._deferredCnt&&this._emitCollected(),t},e.prototype._emitCollected=function(){var e=this._collectedEvents;this._collectedEvents=[],e.length>0&&this._emitEvents(e)},e.prototype.dispose=function(){this._listeners={},this._bulkListeners=[],this._collectedEvents=[],this._deferredCnt=0},e}();t.EventEmitter=r}),define("vs/base/dom/dom",["require","exports","vs/base/env","vs/base/types","vs/base/eventEmitter"],function(e,t,n,i,o){"use strict";function r(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function s(e){for(;e;){if(e===document.body)return!0;e=e.parentNode}return!1}function a(e,t,n,i){var o=function(e){e=e||window.event,n(e)};return x.isFunction(e.addEventListener)?(e.addEventListener(t,o,i||!1),function(){o&&(e.removeEventListener(t,o,i||!1),o=null,e=null,n=null)}):(e.attachEvent("on"+t,o),function(){e.detachEvent("on"+t,o)})}function u(e,t,n,i){var o=a(e,t,n,i);return{dispose:o}}function l(e,t){return a(e,"mouseout",function(n){for(var i=n.relatedTarget||n.toElement;i&&i!==e;)i=i.parentNode;i!==e&&t(n)})}function h(e,n,i,o,r){"undefined"==typeof o&&(o=k),"undefined"==typeof r&&(r=0);var s=null,u=0,l=!1,h=!1,d=function(){u=(new Date).getTime(),i(s),s=null},c=function(){if(h=!1,!l){var e=(new Date).getTime()-u;e>=r?d():h||(h=!0,t.scheduleAtNextAnimationFrame(c))}},p=a(e,n,function(e){s=o(s,e),h||(h=!0,t.scheduleAtNextAnimationFrame(c))});return function(){l=!0,p()}}function d(e,t,n,i,o){"undefined"==typeof i&&(i=k),"undefined"==typeof o&&(o=I);var r=null,s=0,u=-1,l=function(){u=-1,s=(new Date).getTime(),n(r),r=null},h=a(e,t,function(e){r=i(r,e);var t=(new Date).getTime()-s;t>=o?(-1!==u&&window.clearTimeout(u),l()):-1===u&&(u=window.setTimeout(l,o-t))});return function(){-1!==u&&window.clearTimeout(u),h()}}function c(e){return document.defaultView&&x.isFunction(document.defaultView.getComputedStyle)?document.defaultView.getComputedStyle(e,null):e.currentStyle}function p(e,t,n){var i=c(e),o="0";return o=i.getPropertyValue?i.getPropertyValue(t):i.getAttribute(n),D(e,o)}function f(e){for(var t=e.offsetParent,n=e.offsetTop,i=e.offsetLeft;null!==(e=e.parentNode)&&e!==document.body&&e!==document.documentElement;){n-=e.scrollTop;var o=c(e);o&&(i-="rtl"!==o.direction?e.scrollLeft:-e.scrollLeft),e===t&&(i+=O.getBorderLeftWidth(e),n+=O.getBorderTopWidth(e),n+=e.offsetTop,i+=e.offsetLeft,t=e.offsetParent)}return{left:i,top:n}}function m(e){var t=f(e);return{left:t.left,top:t.top,width:e.clientWidth,height:e.clientHeight}}function g(e){var t=O.getBorderLeftWidth(e)+O.getBorderRightWidth(e),n=O.getPaddingLeft(e)+O.getPaddingRight(e);return e.offsetWidth-t-n}function v(e){var t=O.getMarginLeft(e)+O.getMarginRight(e);return e.offsetWidth+t}function y(e){var t=O.getBorderTopWidth(e)+O.getBorderBottomWidth(e),n=O.getPaddingTop(e)+O.getPaddingBottom(e);return e.offsetHeight-t-n}function C(e){var t=O.getMarginTop(e)+O.getMarginBottom(e);return e.offsetHeight+t}function _(e,t){if(null===e)return 0;for(var n=e.offsetLeft,i=e.parentNode;null!==i&&(n-=i.offsetLeft,i!==t);)i=i.parentNode;return n}function b(e,t){if(null===e)return 0;for(var n=e.offsetTop,i=e.parentNode;null!==i&&(n-=i.offsetTop,i!==t);)i=i.parentNode;return n}function w(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function E(){P=document.createElement("style"),P.type="text/css",P.media="screen",document.getElementsByTagName("head")[0].appendChild(P)}function S(e,t){M.isTesting()||t&&(P||E(),P.sheet?P.sheet.insertRule(e+"{"+t+"}",0):P.styleSheet.addRule(e,t))}function L(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&1===e.nodeType&&"string"==typeof e.nodeName}function T(e){try{e.select()}catch(t){}}function N(e){var n=!1,i=!1,o=new R.EventEmitter,r=[],s=null;s={addFocusListener:function(e){var t=o.addListener("focus",e);return r.push(t),t},addBlurListener:function(e){var t=o.addListener("blur",e);return r.push(t),t},dispose:function(){for(;r.length>0;)r.pop()()}};var u=function(){i=!1,n||(n=!0,o.emit("focus",{}))},l=function(){n&&(i=!0,window.setTimeout(function(){i&&(i=!1,n=!1,o.emit("blur",{}))},0))};return r.push(a(e,t.EventType.FOCUS,u,!0)),r.push(a(e,t.EventType.BLUR,l,!0)),s}var M=n,x=i,R=o;t.clearNode=r,t.isInDOM=s,t.hasClass,t.addClass,t.removeClass,t.toggleClass,function(){function e(e,t){var r=e.className;if(!r)return n=-1,void 0;t=t.trim();var s=r.length,a=t.length;if(0===a)return n=-1,void 0;if(a>s)return n=-1,void 0;if(r===t)return n=0,i=s,void 0;for(var u,l=-1;(l=r.indexOf(t,l+1))>=0;){if(u=l+a,(0===l||r.charCodeAt(l-1)===o)&&r.charCodeAt(u)===o)return n=l,i=u+1,void 0;if(l>0&&r.charCodeAt(l-1)===o&&u===s)return n=l-1,i=u,void 0;if(0===l&&u===s)return n=0,i=u,void 0}n=-1}var n,i,o=" ".charCodeAt(0);t.hasClass=function(t,i){return e(t,i),-1!==n},t.addClass=function(t,i){t.className?(e(t,i),-1===n&&(t.className=t.className+" "+i)):t.className=i},t.removeClass=function(t,o){e(t,o),-1!==n&&(t.className=t.className.substring(0,n)+t.className.substring(i))},t.toggleClass=function(i,o,r){e(i,o),-1===n||r||t.removeClass(i,o),-1===n&&r&&t.addClass(i,o)}}(),t.addListener=a,t.addDisposableListener=u,t.addNonBubblingMouseOutListener=l,t.animationFrame=function(){var e=function(e){return e((new Date).getTime()),0},t=self.requestAnimationFrame||self.msRequestAnimationFrame||self.webkitRequestAnimationFrame||self.mozRequestAnimationFrame||self.oRequestAnimationFrame,n=self.cancelAnimationFrame||self.cancelRequestAnimationFrame||self.msCancelAnimationFrame||self.msCancelRequestAnimationFrame||self.webkitCancelAnimationFrame||self.webkitCancelRequestAnimationFrame||self.mozCancelAnimationFrame||self.mozCancelRequestAnimationFrame||self.oCancelAnimationFrame||self.oCancelRequestAnimationFrame,i=!!t,o=t||e,r=n||n;return{isNative:i,request:function(e){return o(e)},cancel:function(e){return r(e)}}}(),t.scheduleAtNextAnimationFrame=function(){var e=[],n=!1,i=function(){n=!1;var t=e;e=[];for(var i=0;ie;e++)t=this.measurements[e],t.container=document.createElement("div"),t.container.style.position="absolute",t.container.style.top="-5000px",t.container.appendChild(t.domNode);for(e=0;n>e;e++)document.body.appendChild(this.measurements[e].container);for(e=0;n>e;e++){t=this.measurements[e];try{t.measureFunc(t.domNode,o.getComputedStyle(t.domNode))}catch(i){console.error("Measurement failed"),console.error(i)}}for(e=0;n>e;e++)document.body.removeChild(this.measurements[e].container)},e}();t.MeasurementHelper=r;var s=function(){function e(e){this._computedStyle=o.getComputedStyle(e),this._dimensions={width:this._computedStyle.getPropertyValue("width"),height:this._computedStyle.getPropertyValue("height")},this._margin={top:this._computedStyle.getPropertyValue("margin-top"),bottom:this._computedStyle.getPropertyValue("margin-bottom"),left:this._computedStyle.getPropertyValue("margin-left"),right:this._computedStyle.getPropertyValue("margin-right")},this._padding={top:this._computedStyle.getPropertyValue("padding-top"),bottom:this._computedStyle.getPropertyValue("padding-bottom"),left:this._computedStyle.getPropertyValue("padding-left"),right:this._computedStyle.getPropertyValue("padding-right")},this._border={top:this._computedStyle.getPropertyValue("border-top-width"),bottom:this._computedStyle.getPropertyValue("border-bottom-width"),left:this._computedStyle.getPropertyValue("border-left-width"),right:this._computedStyle.getPropertyValue("border-right-width")}}return e.prototype.getComputedStyle=function(){return this._computedStyle},e.prototype.getDimensions=function(){return this._dimensions},e.prototype.getMargin=function(){return this._margin},e.prototype.getPadding=function(){return this._padding},e.prototype.getBorder=function(){return this._border},e.prototype.getTotalWidth=function(){return i(this._margin.left)+i(this._border.left)+i(this._padding.left)+i(this._dimensions.width)+i(this._padding.right)+i(this._border.right)+i(this._margin.right)},e.prototype.getTotalHeight=function(){return i(this._margin.top)+i(this._border.top)+i(this._padding.top)+i(this._dimensions.height)+i(this._padding.bottom)+i(this._border.bottom)+i(this._margin.bottom)},e}();t.ComputedDimensions=s});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/editor/core/configuration",["require","exports","vs/base/env","./config","vs/base/objects","./handlerDispatcher","vs/base/eventEmitter","vs/base/dom/measurementHelper","./constants"],function(e,t,n,i,o,r,s,a,u){"use strict";var l=n,h=i,d=o,c=r,p=s,f=a,m=u,g={},v=function(e){function t(t){e.call(this),this.keyBindings=d.clone(h.Config.keyBindings),this.editor=d.clone(h.Config.editor),this._mergeOptionsIn(t),this.handlerDispatcher=new c.HandlerDispatcher,this._readCSSConfiguration()}return __extends(t,e),t.prototype._mergeOptionsIn=function(e){if(e=e||{},e.keyBindings)for(var t in e.keyBindings)e.keyBindings.hasOwnProperty(t)&&(this.keyBindings[t]=this.keyBindings[t]||[],this.keyBindings[t].push(e.keyBindings[t])); e.keyBindings&&delete e.keyBindings;var n="undefined"!=typeof e.stopLineTokenizationAfter,i="undefined"!=typeof e.stopRenderingLineAfter;this.editor=d.mixin(this.editor,e),!n&&this.editor.wrappingColumn>=0&&(this.editor.stopLineTokenizationAfter=-1),!i&&this.editor.wrappingColumn>=0&&(this.editor.stopRenderingLineAfter=-1),this._validateOptions()},t.prototype._validateOptions=function(){this.editor.tabSize=Math.max(1,this._ensureInteger(this.editor.tabSize)),this.editor.lineNumbersMinChars=Math.max(1,this._ensureInteger(this.editor.lineNumbersMinChars))},t.prototype._ensureInteger=function(e){return Math.round(parseInt(e,10))},t.prototype.bindKeys=function(e){var t=this,n=e.bindGroup(function(e){for(var n in t.keyBindings)if(t.keyBindings.hasOwnProperty(n))for(var i=t.handlerDispatcher.trigger.bind(t.handlerDispatcher,"keyboard",n),o=t.keyBindings[n],r=0;r0?0:this.editor.wrappingColumn},t.prototype.normalizeIndentation=function(e){var t,n=0;for(t=0;tt;t++)i+=" "}for(t=0;n>t;t++)i+=" ";return i},t.prototype.getOneIndent=function(){if(this.editor.insertSpaces){for(var e="",t=0;t1?n-=1:t>1&&(t-=1,n=e.getLineMaxColumn(t)),{lineNumber:t,column:n}},e.prototype.getRightOfPosition=function(e,t,n){return nt&&(t=1),n=this.columnFromVisibleColumn(e,t,r),i=r-this.visibleColumnFromColumn(e,t,n),{lineNumber:t,column:n,leftoverVisibleColumns:i}},e.prototype.getPositionDown=function(e,t,n,i,o){var r=this.visibleColumnFromColumn(e,t,n)+i;t+=o;var s=e.getLineCount();return t>s&&(t=s),n=this.columnFromVisibleColumn(e,t,r),i=r-this.visibleColumnFromColumn(e,t,n),{lineNumber:t,column:n,leftoverVisibleColumns:i}},e.prototype.getColumnAtBeginningOfLine=function(e,t,n){var i=e.getLineFirstNonWhitespaceColumn(t)||1;return n=1!==n&&i>=n?1:i},e.prototype.getColumnAtEndOfLine=function(e,t,n){var i=e.getLineMaxColumn(t),o=e.getLineLastNonWhitespaceColumn(t)||i;return n=n!==i&&n>=o?i:o},e.prototype.visibleColumnFromColumn=function(e,t,n){for(var i=e.getLineContent(t),o=0,r=0;n-1>r;r++)o=" "===i.charAt(r)?this.nextTabColumn(o):o+1;return o},e.prototype.columnFromVisibleColumn=function(e,t,n){for(var i=e.getLineContent(t),o=-1,r=0,s=0;s=r;s++)o=r,r=" "===i.charAt(s)?this.nextTabColumn(r):r+1;return r=Math.abs(n-r),o=Math.abs(n-o),o>r?s+1:s},e.prototype.nextTabColumn=function(e){return e+this.configuration.editor.tabSize-e%this.configuration.editor.tabSize},e}();t.ModelCursorMoveHelper=n}),define("vs/base/dom/keyboardEvent",["require","vs/base/lib/winjs.base","vs/base/env","vs/base/dom/dom"],function(e,t,n,i){"use strict";var o=function(){var e={Backspace:8,Tab:9,Enter:13,Shift:16,Ctrl:17,Alt:18,PauseBreak:19,CapsLock:20,Escape:27,Space:32,PageUp:33,PageDown:34,End:35,Home:36,LeftArrow:37,UpArrow:38,RightArrow:39,DownArrow:40,Insert:45,Delete:46,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NumLock:144,ScrollLock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222};n.browser.isIE?e.Meta=91:n.browser.isFirefox?(e["-"]=109,e["="]=107,e[";"]=59,n.browser.isMacintosh&&(e.Meta=224)):n.browser.isOpera?(e["-"]=109,e["="]=61,e[";"]=59,n.browser.isMacintosh&&(e.Meta=57392)):n.browser.isWebKit&&n.browser.isMacintosh&&(e.Meta=91);var t={};!function(){for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n)}(),n.browser.isOpera?(t[189]="-",t[187]="=",t[186]=";"):n.browser.isWebKit&&n.browser.isMacintosh&&(t[93]="Meta");var i=function(e,n){return t.hasOwnProperty(e)?t[e]:n},o=null;return o=n.browser.isOpera?function(e){return"keypress"===e.type?e.which<=32?i(e.keyCode,String.fromCharCode(e.keyCode).toUpperCase()):String.fromCharCode(e.which).toUpperCase():i(e.keyCode,"unknown")}:n.browser.isIE8?function(e){return"keypress"===e.type?String.fromCharCode(e.keyCode).toUpperCase():i(e.keyCode,"unknown")}:function(e){return e.charCode?String.fromCharCode(e.charCode).toUpperCase():i(e.keyCode,"unknown")},{CHAR_TO_CODE:e,CODE_TO_CHAR:t,extractKey:o}}(),r=t.Class.define(function(e){if(this.browserEvent=e,this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,this.target=e.target||e.targetNode,this.key=o.extractKey(e),this.ctrlKey=this.ctrlKey||"Ctrl"===this.key,this.altKey=this.altKey||"Alt"===this.key,this.shiftKey=this.shiftKey||"Shift"===this.key,this.metaKey=this.metaKey||"Meta"===this.key,n.browser.isOpera&&n.browser.isMacintosh){var t=this.metaKey;this.metaKey=this.ctrlKey,this.ctrlKey=t,"Ctrl"===this.key?this.key="Meta":"Meta"===this.key&&(this.key="Ctrl")}},{preventDefault:function(){this.browserEvent.preventDefault?this.browserEvent.preventDefault():this.browserEvent.returnValue=!1},stopPropagation:function(){this.browserEvent.stopPropagation?this.browserEvent.stopPropagation():this.browserEvent.cancelBubble=!0},clone:function(){var e=this.asString();return{ctrlKey:this.ctrlKey,shiftKey:this.shiftKey,altKey:this.altKey,metaKey:this.metaKey,target:this.target,key:this.key,preventDefault:function(){},stopPropagation:function(){},asString:function(){return e}}},asString:function(){var e="";return this.ctrlKey&&(e+="Ctrl"),this.shiftKey&&(e+=(""===e?"":"-")+"Shift"),this.altKey&&(e+=(""===e?"":"-")+"Alt"),this.metaKey&&(e+=(""===e?"":"-")+"Meta"),this.key&&"Ctrl"!==this.key&&"Shift"!==this.key&&"Alt"!==this.key&&"Meta"!==this.key&&(e+=(""===e?"":"-")+this.key),e}}),s=t.Class.define(function(e){this._listeners={},this._previousKeyDown=null,this._previousEventType=null,this.listenersToRemove=[],this.listenersToRemove.push(i.addListener(e,"keydown",this._onKeyDown.bind(this))),this.listenersToRemove.push(i.addListener(e,"keypress",this._onKeyPress.bind(this))),this.listenersToRemove.push(i.addListener(e,"keyup",this._onKeyUp.bind(this)))},{destroy:function(){this.listenersToRemove.forEach(function(e){e()}),this.listenersToRemove=[]},addListener:function(e,t){return this._listeners[e]=t,function(){this._listeners[e]=null}.bind(this)},_fire:function(e,t){this._listeners.hasOwnProperty(e)&&this._listeners[e](t)},_onKeyDown:function(e){var t=new r(e);this._previousKeyDown=t.clone(),this._previousEventType="keydown",this._fire("keydown",t)},_onKeyPress:function(e){var t=new r(e);this._previousKeyDown&&(t.shiftKey&&this._previousKeyDown.asString()!==t.asString()&&(t.shiftKey=!1),"keypress"===this._previousEventType&&this._fire("keydown",this._previousKeyDown)),this._previousEventType="keypress",this._fire("keypress",t)},_onKeyUp:function(e){this._fire("keyup",new r(e))}});return{KEYS:o.CHAR_TO_CODE,KeyboardEvent:r,KeyboardController:s}}),define("vs/base/time/schedulers",["require","exports"],function(e,t){"use strict";var n=function(){function e(e,t){this.timeoutToken=-1,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}return e.prototype.dispose=function(){this.cancel(),this.runner=null},e.prototype.cancel=function(){-1!==this.timeoutToken&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)},e.prototype.setRunner=function(e){this.runner=e},e.prototype.setTimeout=function(e){this.timeout=e},e.prototype.schedule=function(){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,this.timeout)},e.prototype.onTimeout=function(){this.timeoutToken=-1,this.runner&&this.runner()},e}();t.RunOnceScheduler=n}),define("vs/base/dom/mouseEvent",["vs/base/lib/winjs.base","vs/base/env"],function(e,t){"use strict";var n=function(e){var t=window.MonacoScrollDivisor||120;return e/t},i=e.Class.define(function(e,n){this.browserEvent=e,this.extraData=n,t.browser.isIE8?(this.leftButton=1===e.button,this.middleButton=4===e.button,this.rightButton=2===e.button):(this.leftButton=0===e.button,this.middleButton=1===e.button,this.rightButton=2===e.button),this.target=e.target||e.targetNode||e.srcElement,this.detail=e.detail||1,"dblclick"===e.type&&(this.detail=2),this.posx=0,this.posy=0,this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,e.clientX||e.clientY?(this.posx=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,this.posy=e.clientY+document.body.scrollTop+document.documentElement.scrollTop):(e.pageX||e.pageY)&&(this.posx=e.pageX,this.posy=e.pageY)},{preventDefault:function(){this.browserEvent.preventDefault?this.browserEvent.preventDefault():this.browserEvent.returnValue=!1},stopPropagation:function(){this.browserEvent.stopPropagation?this.browserEvent.stopPropagation():this.browserEvent.cancelBubble=!0}}),o=e.Class.derive(i,function(e){i.call(this,e),this.dataTransfer=e.dataTransfer}),r=e.Class.derive(o,function(e){o.call(this,e)}),s=e.Class.define(function(e,i,o){e?this.browserEvent=e:e=e||{},this.deltaY=o||0,e.wheeldeltaY||0===e.wheeldeltaY?this.deltaY=n(e.wheeldeltaY):!e.VERTICAL_AXIS&&0!==e.VERTICAL_AXIS||e.axis!==e.VERTICAL_AXIS||(this.deltaY=-e.detail/3),this.deltaX=i||0,e.wheelDeltaX?this.deltaX=t.browser.isSafari&&t.browser.isWindows?-n(e.wheelDeltaX):n(e.wheelDeltaX):!e.HORIZONTAL_AXIS&&0!==e.HORIZONTAL_AXIS||e.axis!==e.HORIZONTAL_AXIS||(this.deltaX=-e.detail/3),0===this.deltaY&&0===this.deltaX&&e.wheelDelta&&(this.deltaY=n(e.wheelDelta)),this.target=e.target||e.targetNode},{preventDefault:function(){this.browserEvent&&(this.browserEvent.preventDefault?this.browserEvent.preventDefault():this.browserEvent.returnValue=!1)},stopPropagation:function(){this.browserEvent&&(this.browserEvent.stopPropagation?this.browserEvent.stopPropagation():this.browserEvent.cancelBubble=!0)}});return{MouseEvent:i,DragMouseEvent:o,DropMouseEvent:r,MouseWheelEvent:s}}),define("vs/base/arrays",["require","exports"],function(e,t){"use strict";function n(e,t,n){for(var i=0,o=e.length-1;o>=i;){var r=Math.floor((i+o)/2),s=n(e[r],t);if(0>s)i=r+1;else{if(!(s>0))return r;o=r-1}}return-1}function i(e){for(var t=[],n=0,i=e.length;i>n;n++)t.push.apply(t,e[n]);return t}function o(e,t){for(var n,i=0,o=e.length-1;o>i;)n=i+Math.ceil((o-i)/2),e[n].startIndex>t?o=n-1:i=n;return i}t.binarySearch=n,t.merge=i,t.findIndexInSegmentsArray=o}),define("vs/editor/core/view/lines/viewLineParts",["require","exports","vs/base/arrays"],function(e,t,n){"use strict";function i(e,t,n){return n.length>0?new a(e,t,n):new s(t)}var o=n,r=1e6;t.createLineParts=i;var s=function(){function e(e){this.lineTokens=e}return e.prototype.getParts=function(){return this.lineTokens.getTokens()},e.prototype.equals=function(t){if(t instanceof e){var n=t;return this.lineTokens.equals(n.lineTokens)}return!1},e.prototype.findIndexOfOffset=function(e){return this.lineTokens.findIndexOfOffset(e)},e}();t.FastViewLineParts=s;var a=function(){function e(e,t,n){for(var i,o,r,s=d.normalize(e,n),a=0,l=s.length,h=t.getTokens(),c=[],p=0,f=h.length;f>p;p++){for(i=h[p].startIndex,o=f>p+1?h[p+1].startIndex:t.getTextLength(),r=h[p].type;l>a&&s[a].startOffseti&&(c.push(new u(i,r)),i=s[a].startOffset),c.push(new u(i,r+" "+s[a].className)),s[a].endOffset>=o){i=o;break}i=s[a].endOffset+1,a++}o>i&&c.push(new u(i,r))}this.parts=c,this.lastPartIndex=c.length-1,this.lastEndOffset=o}return e.prototype.getParts=function(){return this.parts},e.prototype.equals=function(t){if(t instanceof e){var n=t;if(this.lastPartIndex!==n.lastPartIndex)return!1;if(this.lastEndOffset!==n.lastEndOffset)return!1;for(var i=0,o=this.parts.length;o>i;i++){if(this.parts[i].startIndex!==n.parts[i].startIndex)return!1;if(this.parts[i].type!==n.parts[i].type)return!1}return!0}return!1},e.prototype.findIndexOfOffset=function(e){return o.findIndexInSegmentsArray(this.parts,e)},e}();t.ViewLineParts=a;var u=function(){function e(e,t){this.startIndex=e,this.type=t}return e}(),l=function(){function e(e,t,n){this.startOffset=e,this.endOffset=t,this.className=n}return e}(),h=function(){function e(){this.stopOffsets=[],this.classNames=[],this.count=0}return e.prototype.consumeLowerThan=function(e,t,n){for(;this.count>0&&this.stopOffsets[0]=e){this.stopOffsets.splice(n,0,e),this.classNames.splice(n,0,t);break}this.count++},e}(),d=function(){function e(){}return e.normalize=function(e,t){var n=[];if(0===t.length)return n;var i,o,s,a,u,l=new h,d=0;for(a=0,u=t.length;u>a;a++)i=t[a],o=i.range.startLineNumber===e?i.range.startColumn-1:0,s=i.range.endLineNumber===e?i.range.endColumn-2:r-1,0>s||(d=l.consumeLowerThan(o,d,n),0===l.count&&(d=o),l.insert(s,i.options.inlineClassName));return l.consumeLowerThan(r,d,n),n},e}()}),define("vs/editor/core/view/overviewRuler/overviewRulerImpl",["require","exports"],function(e,t){"use strict";t.hasCanvas=-1===window.navigator.userAgent.indexOf("MSIE 8");var n=function(){function e(e,t,n,i,o,r){this.minimumHeight=i,this.maximumHeight=o,this.getVerticalOffsetForLine=r,this.zones=[],this.domNode=document.createElement("canvas"),this.domNode.className=e,this.domNode.style.position="absolute",this.width=0,this.height=0,this.outerHeight=t,this.lineHeight=n}return e.prototype.dispose=function(){this.zones=[]},e.prototype.setLayout=function(e,t){this.domNode.style.top=e.top+"px",this.domNode.style.right=e.right+"px",(this.width!==e.width||this.height!==e.height)&&(this.width=e.width,this.height=e.height,this.domNode.width=this.width,this.domNode.height=this.height,t&&this.render())},e.prototype.getDomNode=function(){return this.domNode},e.prototype.getWidth=function(){return this.width},e.prototype.getHeight=function(){return this.height},e.prototype.setScrollHeight=function(e,t){this.outerHeight=e,t&&this.render()},e.prototype.setLineHeight=function(e,t){this.lineHeight=e,t&&this.render()},e.prototype.setZones=function(e,t){this.zones=e,t&&this.render()},e.prototype._insertZone=function(e,t,n,i,o){var r=Math.floor((t+n)/2),s=n-r;s>i/2&&(s=i/2),sr-s&&(r=s),r+s>this.height&&(r=this.height-s),e[o]=e[o]||[],e[o].push({from:r-s,to:r+s})},e.prototype.render=function(){if(0!==this.outerHeight&&t.hasCanvas){var e=this.height/this.outerHeight,n=this.domNode.getContext("2d");n.clearRect(0,0,this.width,this.height);var i,o,r,s,a,u,l,h={};for(i=0,o=this.zones.length;o>i;i++)if(r=this.zones[i],s=this.getVerticalOffsetForLine(r.startLineNumber),a=this.getVerticalOffsetForLine(r.endLineNumber)+this.lineHeight,s*=e,a*=e,u=r.endLineNumber-r.startLineNumber+1,l=u*this.maximumHeight,a-s>l)for(var d=r.startLineNumber;d<=r.endLineNumber;d++)s=this.getVerticalOffsetForLine(d),a=s+this.lineHeight,s*=e,a*=e,this._insertZone(h,s,a,this.maximumHeight,r.color);else this._insertZone(h,s,a,l,r.color);var c,p,f,m,g=function(e,t){return e.from-t.from};for(c in h)if(h.hasOwnProperty(c)){for(p=h[c],p.sort(g),f=p[0].from,m=p[0].to,n.fillStyle=c,i=1,o=p.length;o>i;i++)m>=p[i].from?m=Math.max(m,p[i].to):(n.fillRect(0,f,this.width,m-f),f=p[i].from,m=p[i].to);n.fillRect(0,f,this.width,m-f)}}},e}();t.OverviewRulerImpl=n}),define("vs/editor/core/view/viewCursors/viewCursor",["require","exports"],function(e,t){"use strict";var n=function(){function e(e,t){this.context=e,this.isInEditableRange=!0,this.domNode=this._createCursorDomNode(t),this.isVisible=!0,this.updatePosition({lineNumber:1,column:1})}return e.prototype._createCursorDomNode=function(e){var t=document.createElement("div");return t.className="cursor",e&&(t.className+=" secondary"),t.style.height=this.context.configuration.editor.lineHeight+"px",t.style.top="0px",t.style.left="0px",t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true"),t},e.prototype.getDomNode=function(){return this.domNode},e.prototype.getIsInEditableRange=function(){return this.isInEditableRange},e.prototype.getPositionTop=function(){return this.positionTop},e.prototype.getPosition=function(){return this.position},e.prototype.show=function(){this.isVisible||(this.domNode.style.display="block",this.isVisible=!0)},e.prototype.hide=function(){this.isVisible&&(this.domNode.style.display="none",this.isVisible=!1)},e.prototype.onConfigurationLineHeightChanged=function(){return this.domNode.style.height=this.context.configuration.editor.lineHeight+"px",!0},e.prototype.onModelFlushed=function(){return this.updatePosition({lineNumber:1,column:1}),this.isInEditableRange=!0,!0},e.prototype.onCursorPositionChanged=function(e,t){return this.updatePosition(e),this.isInEditableRange=t,!0},e.prototype.onConfigurationChanged=function(){return!0},e.prototype.prepareRender=function(e){var t=e.visibleRangeForPosition(this.position);t?(this.positionTop=t.top,this.positionLeft=t.left):this.positionTop=-1e3},e.prototype.render=function(e){this.domNode.style.left=this.positionLeft-e.viewportLeft+"px",this.domNode.style.top=this.positionTop+"px"},e.prototype.updatePosition=function(e){this.position=e,this.domNode.setAttribute("lineNumber",this.position.lineNumber.toString()),this.domNode.setAttribute("column",this.position.column.toString()),this.positionTop=-1e3,this.positionLeft=-1e3},e}();t.ViewCursor=n}),define("vs/editor/core/view/layout/lines/lineHeightComputer",["require","exports"],function(e,t){"use strict";var n=function(){function e(){this.heights=[],this.isAccurate=[],this.prefixSum=[],this.prefixSumValidIndex=0}return e.prototype.replaceLines=function(e,t){this.heights=[];for(var n=1;e>=n;n++)this.heights[n]=1;if(t){this.isAccurate=[];for(var n=0;ne;e++)this.heights[e]=1;for(e=0,t=this.isAccurate.length;t>e;e++)this.isAccurate[e]=!0;this.prefixSumValidIndex=0},e.prototype.onModelLinesDeleted=function(e,t){this.heights.splice(e,t-e+1),this.isAccurate.splice(e,t-e+1),this.prefixSum.splice(e,t-e+1),this.prefixSumValidIndex=Math.min(this.prefixSumValidIndex,e-1)},e.prototype.onModelLinesInserted=function(e,t,n){for(var i=e;t>=i;i++)this.heights.splice(i,0,1),this.isAccurate.splice(i,0,n),this.prefixSum.splice(i,0,1);this.prefixSumValidIndex=Math.min(this.prefixSumValidIndex,e-1)},e.prototype.getCount=function(){return this.heights.length-1},e.prototype.getTotalHeight=function(){return 0===this.heights.length?0:this.getAccumulatedHeight(this.heights.length-1)},e.prototype.getAccumulatedHeight=function(e){var t=Math.max(1,this.prefixSumValidIndex+1);1===t&&(this.prefixSum[1]=this.heights[1],t++);for(var n=t;e>=n;n++)this.prefixSum[n]=this.prefixSum[n-1]+this.heights[n];return this.prefixSumValidIndex=Math.max(this.prefixSumValidIndex,e),this.prefixSum[e]},e.prototype.getHeight=function(e){return this.heights[e]},e.prototype.heightIsAccurate=function(e){return!!this.isAccurate[e]},e}();t.LineHeightComputer=n}),define("vs/editor/core/view/layout/lines/whitespaceComputer",["require","exports"],function(e,t){"use strict";var n=function(){function e(){this.heights=[],this.ids=[],this.afterLineNumbers=[],this.prefixSum=[],this.prefixSumValidIndex=-1,this.whitespaceId2Index={},this.lastWhitespaceId=0}return e.findInsertionIndex=function(e,t){for(var n,i=0,o=e.length;o>i;)n=Math.floor((i+o)/2),t=t&&(this.whitespaceId2Index[o]=r+1));this.whitespaceId2Index[e.toString()]=t,this.prefixSumValidIndex=Math.min(this.prefixSumValidIndex,t-1)},e.prototype.changeWhitespace=function(e,t){var n=e.toString();if(this.whitespaceId2Index.hasOwnProperty(n)){var i=this.whitespaceId2Index[n];if(this.heights[i]!==t)return this.heights[i]=t,this.prefixSumValidIndex=Math.min(this.prefixSumValidIndex,i-1),!0}return!1},e.prototype.changeAfterLineNumberForWhitespace=function(t,n){var i=t.toString();if(this.whitespaceId2Index.hasOwnProperty(i)){var o=this.whitespaceId2Index[i];if(this.afterLineNumbers[o]!==n){var r=this.heights[o];this.removeWhitespace(t);var s=e.findInsertionIndex(this.afterLineNumbers,n);return this.insertWhitespaceAtIndex(t,s,n,r),!0}}return!1},e.prototype.removeWhitespace=function(e){var t=e.toString();if(this.whitespaceId2Index.hasOwnProperty(t)){var n=this.whitespaceId2Index[t];return delete this.whitespaceId2Index[t],this.removeWhitespaceAtIndex(n),!0}return!1},e.prototype.removeWhitespaceAtIndex=function(e){this.heights.splice(e,1),this.ids.splice(e,1),this.afterLineNumbers.splice(e,1),this.prefixSum.splice(e,1),this.prefixSumValidIndex=Math.min(this.prefixSumValidIndex,e-1);var t,n;for(t in this.whitespaceId2Index)this.whitespaceId2Index.hasOwnProperty(t)&&(n=this.whitespaceId2Index[t],n>=e&&(this.whitespaceId2Index[t]=n-1))},e.prototype.onModelLinesDeleted=function(e,t){var n,i,o;for(i=0,o=this.afterLineNumbers.length;o>i;i++)n=this.afterLineNumbers[i],n>=e&&t>=n?this.afterLineNumbers[i]=e-1:n>t&&(this.afterLineNumbers[i]-=t-e+1)},e.prototype.onModelLinesInserted=function(e,t){var n,i,o;for(i=0,o=this.afterLineNumbers.length;o>i;i++)n=this.afterLineNumbers[i],n>=e&&(this.afterLineNumbers[i]+=t-e+1)},e.prototype.getTotalHeight=function(){return 0===this.heights.length?0:this.getAccumulatedHeight(this.heights.length-1)},e.prototype.getAccumulatedHeight=function(e){var t=Math.max(0,this.prefixSumValidIndex+1);0===t&&(this.prefixSum[0]=this.heights[0],t++);for(var n=t;e>=n;n++)this.prefixSum[n]=this.prefixSum[n-1]+this.heights[n];return this.prefixSumValidIndex=Math.max(this.prefixSumValidIndex,e),this.prefixSum[e]},e.prototype.getAccumulatedHeightBeforeLineNumber=function(e){var t=this.findLastWhitespaceBeforeLineNumber(e);return-1===t?0:this.getAccumulatedHeight(t)},e.prototype.findLastWhitespaceBeforeLineNumber=function(e){for(var t,n=this.afterLineNumbers,i=0,o=n.length-1;o>=i;)if(t=Math.floor((i+o)/2),n[t]=n.length||n[t+1]>=e)return t;i=t+1}else o=t-1;return-1},e.prototype.findFirstWhitespaceAfterLineNumber=function(e){var t=this.findLastWhitespaceBeforeLineNumber(e),n=t+1;return no?1:o},e.prototype.replaceLines=function(e,t){this.lines.replaceLines(e.getLineCount(),!t)},e.prototype.changeLines=function(e,t){this.lines.changeLines(e,t)},e.prototype.invalidateLineHeights=function(){this.lines.invalidateLineHeights()},e.prototype.resetLineHeightsAndMarkAsValid=function(){this.lines.resetLineHeightsAndMarkAsValid()},e.prototype.insertWhitespace=function(e,t){return this.whitespaces.insertWhitespace(e,t)},e.prototype.changeWhitespace=function(e,t){return this.whitespaces.changeWhitespace(e,t)},e.prototype.changeAfterLineNumberForWhitespace=function(e,t){return this.whitespaces.changeAfterLineNumberForWhitespace(e,t)},e.prototype.removeWhitespace=function(e){return this.whitespaces.removeWhitespace(e)},e.prototype.onModelLinesDeleted=function(e,t){this.lines.onModelLinesDeleted(e,t),this.whitespaces.onModelLinesDeleted(e,t)},e.prototype.onModelLineChanged=function(e,t){t&&this.lines.invalidateLineHeight(e)},e.prototype.onModelLinesInserted=function(e,t,n){this.lines.onModelLinesInserted(e,t,!n),this.whitespaces.onModelLinesInserted(e,t)},e.prototype.getTotalHeight=function(e){var t=e*this.lines.getTotalHeight(),n=this.whitespaces.getTotalHeight();return t+n},e.prototype.getVerticalOffsetForLineNumber=function(e,t){var n;n=e>1?t*this.lines.getAccumulatedHeight(e-1):0;var i=this.whitespaces.getAccumulatedHeightBeforeLineNumber(e);return n+i},e.prototype.getHeightForLineNumber=function(e,t){return t*this.lines.getHeight(e)},e.prototype.getLineNumberAtOrAfterVerticalOffset=function(e,t,n,i){"undefined"==typeof n&&(n=1),"undefined"==typeof i&&(i=this.lines.getCount());for(var o,r,s;i>n;)if(o=Math.floor((n+i)/2),r=this.getVerticalOffsetForLineNumber(o,t),s=this.getHeightForLineNumber(o,t),e>=r+s)n=o+1;else{if(e>=r)return o;i=o}return n},e.prototype.getCenteredLineInViewport=function(e,t,n,i,o,r,s){for(var a,u,l=this.getLinesViewportData(0,e,t,n,i,o,r,s),h=(t-e)/2,d=l.visibleRangesDeltaTop,c=l.startLineNumber;c<=l.endLineNumber;c++)if(a=d+l.relativeVerticalOffset[c-l.startLineNumber],u=a+this.getHeightForLineNumber(c,n),d+=this.getHeightForLineNumber(c,n),h>=a&&u>h||a>h)return c;return l.endLineNumber},e.prototype.getLinesViewportData=function(e,t,n,i,o,r,s,a){var u=this.getLineNumberAtOrAfterVerticalOffset(t,i);e&&u>e&&(u=e);var l,h,d=this.lines.getCount(),c=this.getVerticalOffsetForLineNumber(u,i),p=this.whitespaces.getFirstWhitespaceIndexAfterLineNumber(u),f=this.whitespaces.getCount();-1===p?(p=f,h=d+1):(h=this.whitespaces.getAfterLineNumberForWhitespaceIndex(p),l=this.whitespaces.getHeightForWhitespaceIndex(p));for(var m,g=c,v=0,y=[],C=[],_=u;d>=_;_++){for(this.lines.heightIsAccurate(_)?g+=this.getHeightForLineNumber(_,i):(C[_-u]=!0,m=this._estimateLineHeight(o.getLineContent(_).length,r,s,a),g+=m*i),y.push(v),v=0;h===_;)v+=l,g+=l,p++,p>=f?h=d+1:(h=this.whitespaces.getAfterLineNumberForWhitespaceIndex(p),l=this.whitespaces.getHeightForWhitespaceIndex(p));if(g>n&&(!e||_>=e)){d=_;break}}for(var b=1;b=1?t*this.lines.getAccumulatedHeight(i):0;var o;return o=e>0?this.whitespaces.getAccumulatedHeight(e-1):0,n+o},e.prototype.getWhitespaceIndexAtOrAfterVerticallOffset=function(e,t){var n,i,o,r=0,s=this.whitespaces.getCount()-1;if(0>s)return-1;var a=this.getVerticalOffsetForWhitespaceIndex(s,t),u=this.whitespaces.getHeightForWhitespaceIndex(s);if(e>=a+u)return-1;for(;s>r;)if(n=Math.floor((r+s)/2),i=this.getVerticalOffsetForWhitespaceIndex(n,t),o=this.whitespaces.getHeightForWhitespaceIndex(n),e>=i+o)r=n+1;else{if(e>=i)return n;s=n}return r},e.prototype.getWhitespaceAtVerticalOffset=function(e,t){var n=this.getWhitespaceIndexAtOrAfterVerticallOffset(e,t);if(0>n)return null;if(n>=this.whitespaces.getCount())return null;var i=this.getVerticalOffsetForWhitespaceIndex(n,t);if(i>=e)return null;var o=this.whitespaces.getHeightForWhitespaceIndex(n),r=this.whitespaces.getIdForWhitespaceIndex(n),s=this.whitespaces.getAfterLineNumberForWhitespaceIndex(n);return{id:r,afterLineNumber:s,verticalOffset:i,height:o}},e.prototype.getWhitespacesInViewport=function(e,t,n){var i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e,n),o=this.whitespaces.getCount()-1;if(0>i)return[];var r,s,a,u=[];for(r=i;o>=r&&(s=this.getVerticalOffsetForWhitespaceIndex(r,n),a=this.whitespaces.getHeightForWhitespaceIndex(r),!(s>=t));r++)u.push({id:this.whitespaces.getIdForWhitespaceIndex(r),afterLineNumber:this.whitespaces.getAfterLineNumberForWhitespaceIndex(r),verticalOffset:s,height:a});return u},e}();t.VerticalObjects=s}),define("vs/editor/core/view/layout/lines/linesLayout",["require","exports","vs/editor/core/view/layout/lines/verticalObjects"],function(e,t,n){"use strict";var i=n,o=function(){function e(e,t,n){this.configuration=e,this.model=t,this.verticalObjects=new i.VerticalObjects,this.wrappingWidth=n,this.verticalObjects.replaceLines(t,e.editor.viewWordWrap) }return e.VIRTUAL_LINES_AROUND=0,e.prototype.addWhitespace=function(e,t){return this.verticalObjects.insertWhitespace(e,t)},e.prototype.changeWhitespace=function(e,t){return this.verticalObjects.changeWhitespace(e,t)},e.prototype.changeAfterLineNumberForWhitespace=function(e,t){return this.verticalObjects.changeAfterLineNumberForWhitespace(e,t)},e.prototype.removeWhitespace=function(e){return this.verticalObjects.removeWhitespace(e)},e.prototype.onConfigurationChanged=function(e){e.viewWordWrapChanged&&(this.configuration.editor.viewWordWrap?this.verticalObjects.invalidateLineHeights():this.verticalObjects.resetLineHeightsAndMarkAsValid())},e.prototype.onWrappingWidthChanged=function(e){this.wrappingWidth!==e&&(this.wrappingWidth=e,this.configuration.editor.viewWordWrap&&this.verticalObjects.invalidateLineHeights())},e.prototype.onModelFlushed=function(){this.verticalObjects.replaceLines(this.model,this.configuration.editor.viewWordWrap)},e.prototype.onModelLinesDeleted=function(e){this.verticalObjects.onModelLinesDeleted(e.fromLineNumber,e.toLineNumber)},e.prototype.onModelLineChanged=function(e){this.verticalObjects.onModelLineChanged(e.lineNumber,this.configuration.editor.viewWordWrap)},e.prototype.onModelLinesInserted=function(e){this.verticalObjects.onModelLinesInserted(e.fromLineNumber,e.toLineNumber,this.configuration.editor.viewWordWrap)},e.prototype.updateLineHeights=function(e,t){this.verticalObjects.changeLines(e,t)},e.prototype.getVerticalOffsetForLineNumber=function(e){return this.verticalObjects.getVerticalOffsetForLineNumber(e,this.configuration.editor.lineHeight)},e.prototype.getLinesTotalHeight=function(){return this.verticalObjects.getTotalHeight(this.configuration.editor.lineHeight)},e.prototype.getTotalHeight=function(e,t){var n=this.getLinesTotalHeight();return n+=this.configuration.editor.scrollBeyondLastLine?e.height-this.configuration.editor.lineHeight:t,Math.max(e.height,n)},e.prototype.getLineNumberAtVerticalOffset=function(e){return this.verticalObjects.getLineNumberAtOrAfterVerticalOffset(e,this.configuration.editor.lineHeight)},e.prototype.heightInPxForLine=function(e){return this.verticalObjects.getHeightForLineNumber(e,this.configuration.editor.lineHeight)},e.prototype.getWhitespaceViewportData=function(e){return this.verticalObjects.getWhitespacesInViewport(e.top,e.top+e.height,this.configuration.editor.lineHeight)},e.prototype.getWhitespaceAtVerticalOffset=function(e){return this.verticalObjects.getWhitespaceAtVerticalOffset(e,this.configuration.editor.lineHeight)},e.prototype.getLinesViewportData=function(e,t){return this.verticalObjects.getLinesViewportData(e,t.top,t.top+t.height,this.configuration.editor.lineHeight,this.model,this.wrappingWidth,this.configuration.editor.thinnestCharacterWidth,this.configuration.editor.stopRenderingLineAfter)},e.prototype.getCenteredLineInViewport=function(e){return this.verticalObjects.getCenteredLineInViewport(e.top,e.top+e.height,this.configuration.editor.lineHeight,this.model,this.wrappingWidth,this.configuration.editor.thinnestCharacterWidth,this.configuration.editor.stopRenderingLineAfter)},e}();t.LinesLayout=o}),define("vs/editor/core/view/layout/characterSizeProvider",["require","exports","vs/base/env"],function(e,t,n){"use strict";var i=n,o=function(){function e(t){this.configuration=t,this.charactersToMeasure=e.USUAL_CHARS,this.defaultCharWidth=7.69921875,this.charWidths={};var n=this._configurationHash();e.CHAR_MEASUREMENTS_CACHE.hasOwnProperty(n)?(this.charWidths=e.CHAR_MEASUREMENTS_CACHE[n],this.defaultCharWidth=this.charWidths[e.REFERENCE_CHARACTER]):i.isTesting()||this.doMeasurements()}return e.USUAL_CHARS="1234567890",e.REFERENCE_CHARACTER="0",e.CHAR_MEASUREMENTS_CACHE={},e.prototype.doMeasurements=function(){var e=this._measureCharSizePart2(this._measureCharSizePart1());return e},e.prototype.getCharWidth=function(e){return this.charWidths.hasOwnProperty(e)?this.charWidths[e]:this.defaultCharWidth},e.prototype._configurationHash=function(){return this.configuration.editor.font},e.prototype.maxDigitWidth=function(){for(var e=0,t=0;9>=t;t++)e=Math.max(e,this.getCharWidth(t.toString()));return e},e.prototype._testElementId=function(e){return"editorSizeProvider"+e},e.prototype._createTestElement=function(e,t){var n=document.createElement("span");n.id=this._testElementId(e);for(var i=" "===t?" ":t,o=0;8>o;o++)i+=i;return n.textContent=i,n},e.prototype._measureTestElementWidth=function(e){return document.getElementById(this._testElementId(e)).offsetWidth/256},e.prototype._measureTestElementHeight=function(e){return document.getElementById(this._testElementId(e)).offsetHeight},e.prototype._createTestElements=function(){var e=document.createElement("div");e.className=this.configuration.getEditorClassName(),e.style.width="50000px";for(var t=0,n=this.charactersToMeasure.length;n>t;t++)e.appendChild(document.createElement("br")),e.appendChild(this._createTestElement(t,this.charactersToMeasure[t]));return e},e.prototype._measureCharSizePart1=function(){var e=this._createTestElements();return document.body.appendChild(e),e},e.prototype._measureCharSizePart2=function(t){var n,i,o,r,s,a=!1;for(n=0,i=this.charactersToMeasure.length;i>n;n++)o=this.charactersToMeasure[n],r=this.charWidths.hasOwnProperty(o)?this.charWidths[o]:0,s=this._measureTestElementWidth(n),r!==s&&(this.charWidths[o]=s,a=!0);return document.body.removeChild(t),a&&(e.CHAR_MEASUREMENTS_CACHE[this._configurationHash()]=this.charWidths,this.defaultCharWidth=this.charWidths[e.REFERENCE_CHARACTER]),a},e}();t.CharacterSizeProvider=o}),define("vs/editor/core/view/layout/editorLayoutProvider",["require","exports"],function(e,t){"use strict";var n=function(){function e(e,t,n,i,o,r,s){this.verticalScrollbarWidth=10,this.horizontalScrollbarHeight=10,this.outerWidth=e,this.outerHeight=t,this.lineHeight=n,this.showGlyphMargin=i,this.glyphMarginWidth=this.computeGlyphMarginWidth(),this.showLineNumbers=o,this.lineNumbersMinChars=r,this.lineCount=0,this.maxDigitWidth=s,this.lineNumbersWidth=this.computeLineNumbersWidth(),this.layoutInfo=this.layout()}return e.DECORATIONS_WIDTH=10,e.prototype.setDimensions=function(e,t){return this.outerWidth!==e||this.outerHeight!==t?(this.outerWidth=e,this.outerHeight=t,this.layoutInfo=this.layout(),!0):!1},e.prototype.setScrollbarSize=function(e,t){return this.verticalScrollbarWidth!==e||this.horizontalScrollbarHeight!==t?(this.verticalScrollbarWidth=e,this.horizontalScrollbarHeight=t,this.layoutInfo=this.layout(),!0):!1},e.prototype.setGlyphMargin=function(e){return this.showGlyphMargin=e,this.setGlyphMarginWidth(this.computeGlyphMarginWidth())},e.prototype.setLineHeight=function(e){return this.lineHeight=e,this.setGlyphMarginWidth(this.computeGlyphMarginWidth())},e.prototype.computeGlyphMarginWidth=function(){return this.showGlyphMargin?this.lineHeight:0},e.prototype.setGlyphMarginWidth=function(e){return this.glyphMarginWidth!==e?(this.glyphMarginWidth=e,this.layoutInfo=this.layout(),!0):!1},e.prototype.setShowLineNumbers=function(e){return this.showLineNumbers=e,this.setLineNumbersWidth(this.computeLineNumbersWidth())},e.prototype.setLineNumbersMinChars=function(e){return this.lineNumbersMinChars=e,this.setLineNumbersWidth(this.computeLineNumbersWidth())},e.prototype.setLineCount=function(e){return this.lineCount=e,this.setLineNumbersWidth(this.computeLineNumbersWidth())},e.prototype.setMaxDigitWidth=function(e){return this.maxDigitWidth=e,this.setLineNumbersWidth(this.computeLineNumbersWidth())},e.prototype.setLineNumbersWidth=function(e){return this.lineNumbersWidth!==e?(this.lineNumbersWidth=e,this.layoutInfo=this.layout(),!0):!1},e.prototype.getLayoutInfo=function(){return this.layoutInfo},e.prototype.layout=function(){var t=this.outerWidth,n=this.outerHeight,i=this.lineNumbersWidth,o=this.glyphMarginWidth,r=n,s=n,a=e.DECORATIONS_WIDTH,u=n,l=t-o-i-a,h=n,d=this.verticalScrollbarWidth,c=this.horizontalScrollbarHeight,p=0,f=p+o,m=f+i,g=m+a;return{width:t,height:n,glyphMarginLeft:p,glyphMarginWidth:o,glyphMarginHeight:s,lineNumbersLeft:f,lineNumbersWidth:i,lineNumbersHeight:r,decorationsLeft:m,decorationsWidth:a,decorationsHeight:u,contentLeft:g,contentWidth:l,contentHeight:h,verticalScrollbarWidth:d,horizontalScrollbarHeight:c}},e.prototype.digitCount=function(e){for(var t=0;e;)e=Math.floor(e/10),t++;return t?t:1},e.prototype.computeLineNumbersWidth=function(){if(this.showLineNumbers){var e=Math.max(this.digitCount(this.lineCount),this.lineNumbersMinChars);return e*this.maxDigitWidth}return 0},e}();t.EditorLayoutProvider=n}),define("vs/editor/core/view/layout/layout",["require","exports"],function(){"use strict"}),define("vs/base/ui/scrollbar/abstractScrollbar",["require","vs/base/lib/winjs.base","vs/base/env","vs/base/dom/dom","vs/base/dom/mouseEvent"],function(e,t){"use strict";function n(e){return e+"px"}function i(e,t,i,o,r){null!==t&&(e.style.top=n(t)),null!==i&&(e.style.left=n(i)),null!==o&&(e.style.bottom=n(o)),null!==r&&(e.style.right=n(r))}function o(e,t,i){null!==t&&(e.style.width=n(t)),null!==i&&(e.style.height=n(i))}var r=20,s=e("vs/base/env"),a=e("vs/base/dom/dom"),u=e("vs/base/dom/mouseEvent"),l=t.Class.define(function(e,t,n,i,o){this.listenersToRemove=[],this.scrollable=e,this.parent=t,this.options=n,this.visibility=i,this.hasArrows=o,this._hookUnbind=[],this.isDragging=!1,this.scrollPosition=0,this.scrollSize=0,this.sliderSize=0,this.sliderPosition=0,this.isNeeded=!1,this.isVisible=!1,this.shouldBeVisible=!1,this.ARROW_ID=0,this.arrowIntervals={},this.arrowTimeouts={},this.arrowMouseUpUnbind={},this.hideTimeout=-1},{ARROW_IMG_SIZE:11,_createDomNode:function(){this.domNode=document.createElement("div"),this._hide(),this.domNode.style.position="absolute",this.listenersToRemove.push(a.addListener(this.domNode,"mousedown",this._domNodeMouseDown.bind(this)))},_createArrow:function(e,t,n,r,s,u,l,h){var d=document.createElement("div");d.className="arrow-background",d.style.position="absolute",o(d,u,l),i(d,null!==t?0:null,null!==n?0:null,null!==r?0:null,null!==s?0:null);var c=document.createElement("div");return c.className=e,c.style.position="absolute",o(c,this.ARROW_IMG_SIZE,this.ARROW_IMG_SIZE),i(c,t,n,r,s),this.ARROW_ID++,this.listenersToRemove.push(a.addListener(d,"mousedown",this._arrowMouseDown.bind(this,this.ARROW_ID,h))),this.listenersToRemove.push(a.addListener(c,"mousedown",this._arrowMouseDown.bind(this,this.ARROW_ID,h))),this.arrowIntervals[this.ARROW_ID]=-1,this.arrowTimeouts[this.ARROW_ID]=-1,this.arrowMouseUpUnbind[this.ARROW_ID]=null,this.domNode.appendChild(d),this.domNode.appendChild(c),c},_arrowMouseDown:function(e,t,n){var i=function(){this.parent.onMouseWheel&&this.parent.onMouseWheel(t(n))}.bind(this),o=function(){this.arrowIntervals[e]=window.setInterval(i,1e3/24)}.bind(this);i(),this._clearArrowTimers(e),this.arrowMouseUpUnbind[this.ARROW_ID]=a.addListener(document,"mouseup",this._arrowMouseUp.bind(this,e)),this.arrowTimeouts[e]=window.setTimeout(o,200);var r=new u.MouseEvent(n);r.preventDefault()},_clearArrowTimers:function(e){-1!==this.arrowIntervals[e]&&(window.clearInterval(this.arrowIntervals[e]),this.arrowIntervals[e]=-1),-1!==this.arrowTimeouts[e]&&(window.clearTimeout(this.arrowTimeouts[e]),this.arrowTimeouts[e]=-1),this.arrowMouseUpUnbind[e]&&(this.arrowMouseUpUnbind[e](),this.arrowMouseUpUnbind[e]=null)},_arrowMouseUp:function(e){this._clearArrowTimers(e)},_createSlider:function(e,t){this.slider=document.createElement("div"),this.slider.className="slider",this.slider.style.position="absolute",this.slider.style.left=0,o(this.slider,e,t),this.domNode.appendChild(this.slider),this.listenersToRemove.push(a.addListener(this.slider,"mousedown",this._sliderMouseDown.bind(this)))},destroy:function(){this.listenersToRemove.forEach(function(e){e()}),this.listenersToRemove=[];for(var e=1;e<=this.ARROW_ID;e++)this._clearArrowTimers(e)},reveal:function(){this.shouldBeVisible=!0,this.isNeeded&&this._reveal()},hide:function(){this.shouldBeVisible=!1,this._hide()},_reveal:function(){"hidden"!==this.visibility&&(this.isVisible||(this.isVisible=!0,this.domNode.style.display="block",window.setTimeout(function(){this.domNode.className=this._getDomNodeRevealClassName()}.bind(this),0),-1!==this.hideTimeout&&(window.clearTimeout(this.hideTimeout),this.hideTimeout=-1)))},_hide:function(){"visible"!==this.visibility&&this.isVisible&&(this.isVisible=!1,this.domNode.className=this._getDomNodeHideClassName(),-1===this.hideTimeout&&(this.hideTimeout=window.setTimeout(function(){this.hideTimeout=-1,this.isVisible=!1,this.domNode.style.display="none"}.bind(this),800)))},onElementDimensions:function(e,t){this.dimensions=e,this.visibleSize=t,this.representableSize=t-(this.hasArrows?2*this.options.arrowSize:0)-this._getOppositeScrollbarSize(),this.ratio=this.scrollSize>0?this.representableSize/this.scrollSize:0,this._renderDomNode(),this._renderSlider()},onElementScrollSize:function(e){this.scrollSize!==e&&(this.scrollSize=e,this.dimensions&&(this.ratio=this.scrollSize>0?this.representableSize/this.scrollSize:0,this._renderSlider()))},onElementScrollPosition:function(e){this.scrollPosition!==e&&(this.scrollPosition=e,this.dimensions&&this._renderSlider())},_renderSlider:function(){this.isNeeded=this.scrollSize>this.visibleSize,this.isNeeded||(this._hide(),this.isVisible=!1,this.domNode.style.display="none"),this.sliderSize=Math.floor(this.visibleSize*this.ratio);var e,t=0;this.sliderPosition=Math.floor(this.scrollPosition*this.ratio),this.sliderSizethis.representableSize&&(t=this.representableSize-this.sliderSize-this.sliderPosition)),this._updateSlider(this.sliderSize,(this.hasArrows?this.options.arrowSize:0)+this.sliderPosition+t),(this.shouldBeVisible||"visible"===this.visibility)&&this.isNeeded&&this._reveal()},_domNodeMouseDown:function(e){var t=new u.MouseEvent(e);t.target===this.domNode&&this.onMouseDown(e)},onMouseDown:function(e){var t=new u.MouseEvent(e),n=a.getDomNodePosition(this.domNode),i=this._mouseDownRelativePosition(t,n)-(this.hasArrows?this.options.arrowSize:0)-this.sliderSize/2;this.setDesiredScrollPosition(i/this.ratio),this._sliderMouseDown(e)},_unHookGlobalMouse:function(){this._hookUnbind.forEach(function(e){e()}),this._hookUnbind=[]},_hookGlobalMouse:function(){this._hookUnbind.length>0||(this._hookUnbind.push(a.addThrottledListener(document,"mousemove",this._docMouseMove.bind(this),function(e,t){var n=new u.MouseEvent(t);return n.preventDefault(),{leftButton:n.leftButton,posx:n.posx,posy:n.posy}})),this._hookUnbind.push(a.addListener(document,"mouseup",this._sliderDragFinish.bind(this))),s.isInIframe()&&(this._hookUnbind.push(a.addListener(document,"mouseout",function(e){var t=new u.MouseEvent(e);"html"===t.target.tagName.toLowerCase()&&this._sliderDragFinish()}.bind(this))),this._hookUnbind.push(a.addListener(document,"mouseover",function(e){var t=new u.MouseEvent(e);"html"===t.target.tagName.toLowerCase()&&this._sliderDragFinish()}.bind(this))),this._hookUnbind.push(a.addListener(document.body,"mouseleave",function(){this._sliderDragFinish()}.bind(this)))))},_sliderMouseDown:function(e){var t=new u.MouseEvent(e);t.leftButton&&(this.isDragging=!0,this.draggingDelta=this._sliderMousePosition(t)-this.sliderPosition,a.toggleClass(this.slider,"active",!0),this._hookGlobalMouse(),t.preventDefault(),this.parent.onDragStart())},_docMouseMove:function(e){var t=this._sliderMousePosition(e)-this.draggingDelta;this.setDesiredScrollPosition(t/this.ratio)},_sliderDragFinish:function(){this._unHookGlobalMouse(),this.isDragging=!1,a.toggleClass(this.slider,"active",!1),this.parent.onDragEnd()},validateScrollPosition:function(e){return e=Math.round(e),e=Math.max(e,0),e=Math.min(e,this.scrollSize-this.visibleSize)},setDesiredScrollPosition:function(e){e=this.validateScrollPosition(e),this._setScrollPosition(e),this.onElementScrollPosition(e),this._renderSlider()},_renderDomNode:function(){},_getDomNodeRevealClassName:function(){return"visible scrollbar"},_getDomNodeHideClassName:function(){return"invisible scrollbar"},_updateSlider:function(){},_mouseDownRelativePosition:function(){},_sliderMousePosition:function(){},_setScrollPosition:function(){},_getScrollbarSize:function(){},_getOppositeScrollbarSize:function(){}});return{AbstractScrollbar:l}}),define("vs/base/ui/scrollbar/horizontalScrollbar",["vs/base/lib/winjs.base","./abstractScrollbar","vs/base/dom/mouseEvent"],function(e,t,n){"use strict";function i(e){return e+"px"}var o=t.AbstractScrollbar,r=e.Class.derive(o,function(e,t,n){if(o.call(this,e,t,n,n.horizontal,n.horizontalHasArrows),this._createDomNode(),this.options.horizontalHasArrows){var i=(this.options.arrowSize-this.ARROW_IMG_SIZE)/2,r=(this._getScrollbarSize()-this.ARROW_IMG_SIZE)/2;this.leftArrow=this._createArrow("left-arrow",r,i,null,null,this.options.arrowSize,this._getScrollbarSize(),this._createMouseWheelEvent.bind(this,1)),this.rightArrow=this._createArrow("right-arrow",r,null,null,i,this.options.arrowSize,this._getScrollbarSize(),this._createMouseWheelEvent.bind(this,-1))}this._createSlider(null,this._getScrollbarSize()),"visible"===this.visibility?this.reveal():this.hide()},{_createMouseWheelEvent:function(e){return new n.MouseWheelEvent(null,e,0)},_updateSlider:function(e,t){this.slider.style.width=i(e),this.slider.style.left=i(t)},_renderDomNode:function(){this.domNode.style.width=i(Math.max(0,this.visibleSize-this._getOppositeScrollbarSize())),this.domNode.style.height=i(Math.max(0,this._getScrollbarSize())),this.domNode.style.left="0",this.domNode.style.bottom="0"},_getDomNodeRevealClassName:function(){return"visible scrollbar horizontal"},_getDomNodeHideClassName:function(){return"invisible scrollbar horizontal"},_mouseDownRelativePosition:function(e,t){return e.posx-t.left},_sliderMousePosition:function(e){return e.posx},_setScrollPosition:function(e){this.scrollable.setScrollLeft(e)},_getScrollbarSize:function(){return this.options.horizontalScrollbarSize},_getOppositeScrollbarSize:function(){return this.options.verticalScrollbarSize}});return{HorizontalScrollbar:r}}),define("vs/base/ui/scrollbar/verticalScrollbar",["vs/base/lib/winjs.base","./abstractScrollbar","vs/base/dom/mouseEvent"],function(e,t,n){"use strict";function i(e){return e+"px"}var o=t.AbstractScrollbar,r=e.Class.derive(o,function(e,t,n){if(o.call(this,e,t,n,n.vertical,n.verticalHasArrows),this._createDomNode(),this.options.verticalHasArrows){var i=(this.options.arrowSize-this.ARROW_IMG_SIZE)/2,r=(this._getScrollbarSize()-this.ARROW_IMG_SIZE)/2;this.topArrow=this._createArrow("up-arrow",i,r,null,null,this._getScrollbarSize(),this.options.arrowSize,this._createMouseWheelEvent.bind(this,1)),this.bottomArrow=this._createArrow("down-arrow",null,r,i,null,this._getScrollbarSize(),this.options.arrowSize,this._createMouseWheelEvent.bind(this,-1))}this._createSlider(this._getScrollbarSize(),null),"visible"===this.visibility?this.reveal():this.hide()},{_createMouseWheelEvent:function(e){return new n.MouseWheelEvent(null,0,e)},_updateSlider:function(e,t){this.slider.style.height=i(e),this.slider.style.top=i(t)},_renderDomNode:function(){this.domNode.style.width=i(Math.max(0,this._getScrollbarSize())),this.domNode.style.height=i(Math.max(0,this.visibleSize-this._getOppositeScrollbarSize())),this.domNode.style.right="0",this.domNode.style.top="0"},_getDomNodeRevealClassName:function(){return"visible scrollbar vertical"},_getDomNodeHideClassName:function(){return"invisible scrollbar vertical"},_mouseDownRelativePosition:function(e,t){return e.posy-t.top},_sliderMousePosition:function(e){return e.posy},_setScrollPosition:function(e){this.scrollable.setScrollTop(e)},_getScrollbarSize:function(){return this.options.verticalScrollbarSize},_getOppositeScrollbarSize:function(){return this.options.horizontalScrollbarSize}});return{VerticalScrollbar:r}}),define("vs/base/ui/scrollbar/scrollable",["vs/base/lib/winjs.base","vs/base/eventEmitter"],function(e,t){"use strict";var n=t.EventEmitter,i=e.Class.derive(n,function(){n.call(this)},{getScrollHeight:function(){},getScrollWidth:function(){},getScrollLeft:function(){},setScrollLeft:function(){},getScrollTop:function(){},setScrollTop:function(){}});return{Scrollable:i}}),define("vs/base/ui/scrollbar/domNodeScrollable",["vs/base/lib/winjs.base","vs/base/dom/dom","./scrollable","vs/base/eventEmitter"],function(e,t,n,i){"use strict";var o=t,r=n.Scrollable,s=i.EventEmitter,a=e.Class.derive(r,function(e){r.call(this),this.domNode=e},{getScrollHeight:function(){return this.domNode.scrollHeight},getScrollWidth:function(){return this.domNode.scrollWidth},getScrollLeft:function(){return this.domNode.scrollLeft},setScrollLeft:function(e){this.domNode.scrollLeft=e},getScrollTop:function(){return this.domNode.scrollTop},setScrollTop:function(e){this.domNode.scrollTop=e},addListener:function(e,t){var n=s.prototype.addListener.call(this,e,t),i=o.addListener(this.domNode,e,function(t){this.emit(e,{browserEvent:t})}.bind(this));return function(){i(),n()}}});return{DomNodeScrollable:a}}),define("vs/base/lifecycle",["require","exports"],function(e,t){"use strict";function n(e){for(var t=0,n=e.length;n>t;t++)e[t].dispose();return[]}function i(){for(var e=[],t=0;t0;)e.pop()()}t.disposeAll=n,t.combinedDispose=i,t.cAll=o}),define("vs/editor/core/view/viewContext",["require","exports","vs/base/eventEmitter","vs/base/lifecycle"],function(e,t,n,i){"use strict";t.ClassNames={TEXTAREA_COVER:"textAreaCover",TEXTAREA:"inputarea",VIEW_LINES:"view-lines",VIEW_LINE:"view-line",SCROLLABLE_ELEMENT:"editor-scrollable",CONTENT_WIDGETS:"contentWidgets",OVERLAY_WIDGETS:"overlayWidgets",LINES_DECORATIONS:"lines-decorations",LINE_NUMBERS:"line-numbers",GLYPH_MARGIN:"glyph-margin"},t.EventNames={ModelFlushedEvent:"modelFlushedEvent",LinesDeletedEvent:"linesDeletedEvent",LinesInsertedEvent:"linesInsertedEvent",LineChangedEvent:"lineChangedEvent",TokensChangedEvent:"tokensChangedEvent",DecorationsChangedEvent:"decorationsChangedEvent",CursorPositionChangedEvent:"cursorPositionChangedEvent",CursorSelectionChangedEvent:"cursorSelectionChangedEvent",RevealRangeEvent:"revealRangeEvent",LineMappingChangedEvent:"lineMappingChangedEvent"};var o=function(){function e(e,t,n,i,o,r){this.editorId=e,this.configuration=t,this.model=n,this.privateViewEventBus=i,this.addEventHandler=o,this.removeEventHandler=r}return e}();t.ViewContext=o}),define("vs/editor/core/view/viewEventHandler",["require","exports","vs/editor/core/constants","vs/editor/core/view/viewContext"],function(e,t,n,i){"use strict";var o=n,r=i,s=function(){function e(){this.shouldRender=!0}return e.prototype.onLineMappingChanged=function(){return!1},e.prototype.onModelFlushed=function(){return!1},e.prototype.onModelDecorationsChanged=function(){return!1},e.prototype.onModelLinesDeleted=function(){return!1},e.prototype.onModelLineChanged=function(){return!1},e.prototype.onModelLinesInserted=function(){return!1},e.prototype.onModelTokensChanged=function(){return!1},e.prototype.onCursorPositionChanged=function(){return!1},e.prototype.onCursorSelectionChanged=function(){return!1},e.prototype.onCursorRevealRange=function(){return!1},e.prototype.onConfigurationChanged=function(){return!1},e.prototype.onConfigurationFontChanged=function(){return!1},e.prototype.onConfigurationLineHeightChanged=function(){return!1},e.prototype.onLayoutChanged=function(){return!1},e.prototype.onScrollChanged=function(){return!1},e.prototype.onZonesChanged=function(){return!1},e.prototype.onScrollWidthChanged=function(){return!1},e.prototype.onScrollHeightChanged=function(){return!1},e.prototype.onViewFocusChanged=function(){return!1},e.prototype.handleEvents=function(e){var t,n,i,s;for(t=0,n=e.length;n>t;t++)switch(i=e[t],s=i.getData(),i.getType()){case r.EventNames.LineMappingChangedEvent:this.shouldRender=this.onLineMappingChanged()||this.shouldRender;break;case r.EventNames.ModelFlushedEvent:this.shouldRender=this.onModelFlushed()||this.shouldRender;break;case r.EventNames.LinesDeletedEvent:this.shouldRender=this.onModelLinesDeleted(s)||this.shouldRender;break;case r.EventNames.LinesInsertedEvent:this.shouldRender=this.onModelLinesInserted(s)||this.shouldRender;break;case r.EventNames.LineChangedEvent:this.shouldRender=this.onModelLineChanged(s)||this.shouldRender;break;case r.EventNames.TokensChangedEvent:this.shouldRender=this.onModelTokensChanged(s)||this.shouldRender;break;case r.EventNames.DecorationsChangedEvent:this.shouldRender=this.onModelDecorationsChanged(s)||this.shouldRender;break;case r.EventNames.CursorPositionChangedEvent:this.shouldRender=this.onCursorPositionChanged(s)||this.shouldRender;break;case r.EventNames.CursorSelectionChangedEvent:this.shouldRender=this.onCursorSelectionChanged(s)||this.shouldRender;break;case r.EventNames.RevealRangeEvent:this.shouldRender=this.onCursorRevealRange(s)||this.shouldRender;break;case o.EventType.ConfigurationChanged:this.shouldRender=this.onConfigurationChanged(s)||this.shouldRender;break;case o.EventType.ConfigurationLineHeightChanged:this.shouldRender=this.onConfigurationLineHeightChanged()||this.shouldRender;break;case o.EventType.ConfigurationFontChanged:this.shouldRender=this.onConfigurationFontChanged()||this.shouldRender;break;case o.EventType.ViewLayoutChanged:this.shouldRender=this.onLayoutChanged(s)||this.shouldRender;break;case o.EventType.ViewScrollChanged:this.shouldRender=this.onScrollChanged(s)||this.shouldRender;break;case o.EventType.ViewZonesChanged:this.shouldRender=this.onZonesChanged()||this.shouldRender;break;case o.EventType.ViewScrollWidthChanged:this.shouldRender=this.onScrollWidthChanged()||this.shouldRender;break;case o.EventType.ViewScrollHeightChanged:this.shouldRender=this.onScrollHeightChanged(s)||this.shouldRender;break;case o.EventType.ViewFocusChanged:this.shouldRender=this.onViewFocusChanged(s)||this.shouldRender;break;default:console.info("View received unkown event: "),console.info(i)}},e}();t.ViewEventHandler=s});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/editor/core/view/zones/zones",["require","exports","vs/base/types","vs/editor/core/view/viewContext","vs/editor/core/view/viewEventHandler"],function(e,t,n,i,o){"use strict";var r=n,s=o,a=function(e){function t(t,n){e.call(this),this.context=t,this.whitespaceManager=n,this.domNode=document.createElement("div"),this.domNode.className="view-zones",this.domNode.style.position="absolute",this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.zones={},this.context.addEventHandler(this)}return __extends(t,e),t.prototype.dispose=function(){this.context.removeEventHandler(this),this.context=null,this.whitespaceManager=null,this.zones={}},t.prototype.onConfigurationLineHeightChanged=function(){var e,t,n;for(e in this.zones)this.zones.hasOwnProperty(e)&&(t=this.zones[e],n=this.heightInLinesToPixels(t.delegate.heightInLines),r.isFunction(t.delegate.onComputedHeight)&&t.delegate.onComputedHeight(n),t.delegate.domNode.style.height=n+"px",this.whitespaceManager.changeWhitespace(parseInt(e,10),n));return!0},t.prototype.onLineMappingChanged=function(){var e,t,n=!1;for(t in this.zones)if(this.zones.hasOwnProperty(t)){e=this.zones[t];var i=this.computeWhitespaceAfterLineNumber(e.delegate);n=this.whitespaceManager.changeAfterLineNumberForWhitespace(parseInt(t,10),i)||n}return n},t.prototype.onLayoutChanged=function(){return!0},t.prototype.onScrollChanged=function(e){return e.vertical},t.prototype.onZonesChanged=function(){return!0},t.prototype.onModelLinesDeleted=function(){return!0},t.prototype.onModelLinesInserted=function(){return!0},t.prototype.computeWhitespaceAfterLineNumber=function(e){if(0===e.afterLineNumber)return 0;var t;if("undefined"!=typeof e.afterColumn)t=this.context.model.validateModelPosition({lineNumber:e.afterLineNumber,column:e.afterColumn});else{var n=this.context.model.validateModelPosition({lineNumber:e.afterLineNumber,column:1}).lineNumber;t={lineNumber:n,column:this.context.model.getModelLineMaxColumn(n)}}var i=this.context.model.convertModelPositionToViewPosition(t.lineNumber,t.column);return i.lineNumber},t.prototype.addZone=function(e){var t=this.heightInLinesToPixels(e.heightInLines),n=this.whitespaceManager.addWhitespace(this.computeWhitespaceAfterLineNumber(e),t),i={whitespaceId:n,delegate:e,isVisible:!1};return r.isFunction(i.delegate.onComputedHeight)&&i.delegate.onComputedHeight(t),i.delegate.domNode.style.position="absolute",i.delegate.domNode.style.height=t+"px",i.delegate.domNode.style.width="100%",i.delegate.domNode.style.display="none",this.zones[i.whitespaceId.toString()]=i,this.domNode.appendChild(i.delegate.domNode),i.whitespaceId},t.prototype.removeZone=function(e){if(this.zones.hasOwnProperty(e.toString())){var t=this.zones[e.toString()];return delete this.zones[e.toString()],t.delegate.domNode.parentNode&&t.delegate.domNode.parentNode.removeChild(t.delegate.domNode),this.whitespaceManager.removeWhitespace(t.whitespaceId),!0}return!1},t.prototype.heightInLinesToPixels=function(e){return this.context.configuration.editor.lineHeight*e},t.prototype.prepareRender=function(){var e=this.whitespaceManager.getWhitespaceViewportData();return{data:e}},t.prototype.render=function(e,t){var n,i,o={},s=!1;for(n=0,i=e.data.length;i>n;n++)o[e.data[n].id.toString()]=e.data[n],s=!0;var a,u;for(a in this.zones)this.zones.hasOwnProperty(a)&&(u=this.zones[a],o.hasOwnProperty(a)?(u.delegate.domNode.style.top=t.getScrolledTopFromAbsoluteTop(o[a].verticalOffset)+"px",u.delegate.domNode.style.height=o[a].height+"px",u.isVisible||(u.delegate.domNode.style.display="block",u.isVisible=!0),r.isFunction(u.delegate.onDomNodeTop)&&u.delegate.onDomNodeTop(t.getScrolledTopFromAbsoluteTop(o[a].verticalOffset))):(u.isVisible&&(u.delegate.domNode.style.display="none",u.isVisible=!1),r.isFunction(u.delegate.onDomNodeTop)&&u.delegate.onDomNodeTop(t.getScrolledTopFromAbsoluteTop(-1e6))));s&&(this.domNode.style.width=t.scrollWidth+"px")},t}(s.ViewEventHandler);t.ViewZones=a});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/editor/core/view/lines/viewLayer",["require","exports","vs/base/dom/dom","vs/editor/core/view/viewEventHandler"],function(e,t,n,i){"use strict";var o=n,r=i,s=function(e){function t(t,n){var i=this;e.call(this),this._context=t,this._layoutProvider=n,this.domNode=this._createDomNode(),this._guardElement=this._createGuard(),this.domNode.appendChild(this._guardElement),this._lines=[],this._rendLineNumberStart=1;var o=function(e){return i._createLine(e)};this._manyUpdatesCounter=new l,this._manyUpdatesRenderer=new u(o),this._oneUpdateRenderer=new h(o)}return __extends(t,e),t.USE_ONE_UPDATE_RENDERER=!1,t.prototype.dispose=function(){this._context=null,this._layoutProvider=null,this._lines=null},t.prototype.onConfigurationLineHeightChanged=function(){return!0},t.prototype.onLayoutChanged=function(){return!0},t.prototype.onScrollChanged=function(e){return e.vertical},t.prototype.onZonesChanged=function(){return!0},t.prototype.onModelFlushed=function(){return this._lines=[],this._rendLineNumberStart=1,o.clearNode(this.domNode),this.domNode.appendChild(this._guardElement),!0},t.prototype.onModelLinesDeleted=function(e){var t,n=Math.max(e.fromLineNumber-this._rendLineNumberStart,0),i=Math.min(e.toLineNumber-this._rendLineNumberStart,this._lines.length-1);if(e.fromLineNumber=n){for(t=n;i>=t;t++)this.domNode.removeChild(this._lines[t].getDomNode());this._lines.splice(n,i-n+1)}for(t=n;t=0&&t=this._rendLineNumberStart+this._lines.length)return!1;var n=Math.min(e.fromLineNumber-this._rendLineNumberStart,this._lines.length-1),i=Math.min(e.toLineNumber-this._rendLineNumberStart,this._lines.length-1);if(i>=n){var o=this._lines[n].getDomNode();for(t=n;i>=t;t++){var r=this._createLine(!0);this.domNode.insertBefore(r.getDomNode(),o),this._lines.splice(t,0,r)}for(var s=i-n+1,t=this._lines.length-s;tn||t>=this._lines.length)return!1;for(var i=Math.min(Math.max(t,0),this._lines.length-1),o=Math.min(Math.max(n,0),this._lines.length-1),r=!1,s=i;o>=s;s++)r=!0,this._lines[s].onTokensChanged();return r},t.prototype.onConfigurationChanged=function(e){for(var t=0;tt?(r=t,s=Math.min(n,o.rendLineNumberStart-1),s>=r&&(this._insertLinesBefore(o,r,s,i,t),o.linesLength+=s-r+1)):o.rendLineNumberStart0&&(this._removeLinesBefore(o,a),o.linesLength-=a)),o.rendLineNumberStart=t,o.rendLineNumberStart+o.linesLength-1=r&&(this._insertLinesAfter(o,r,s,i,t),o.linesLength+=s-r+1)):o.rendLineNumberStart+o.linesLength-1>n&&(r=Math.max(0,n-o.rendLineNumberStart+1),s=o.linesLength-1,a=s-r+1,a>0&&(this._removeLinesAfter(o,a),o.linesLength-=a)),this._finishRendering(o,i),o},e.prototype._renderUntouchedLines=function(){},e.prototype._insertLinesBefore=function(){},e.prototype._removeLinesBefore=function(){},e.prototype._insertLinesAfter=function(){},e.prototype._removeLinesAfter=function(){},e.prototype._finishRendering=function(){},e}(),u=function(e){function t(t){e.call(this),this._createLine=t}return __extends(t,e),t.prototype.renderWithManyUpdates=function(e,t,n,i){return this._render(e,t,n,i)},t.prototype._renderUntouchedLines=function(e,t,n,i,o){var r,s;for(r=t;n>=r;r++)s=e.rendLineNumberStart+r,e.lines[r].layoutLine(s,i[s-o])},t.prototype._insertLinesBefore=function(e,t,n){var i,o,r=e.linesLength>0?e.lines[0].getDomNode():e.guardElement,s=[];for(o=t;n>=o;o++)i=this._createLine(!0),s.push(i),e.domNode.insertBefore(i.getDomNode(),r);e.lines=s.concat(e.lines)},t.prototype._removeLinesBefore=function(e,t){var n;for(n=0;t>n;n++)e.domNode.removeChild(e.lines[n].getDomNode());e.lines.splice(0,t)},t.prototype._insertLinesAfter=function(e,t,n){var i,o,r=e.guardElement,s=[];for(o=t;n>=o;o++)i=this._createLine(!0),s.push(i),e.domNode.insertBefore(i.getDomNode(),r);e.lines=e.lines.concat(s)},t.prototype._removeLinesAfter=function(e,t){var n,i=e.linesLength-t;for(n=0;t>n;n++)e.domNode.removeChild(e.lines[i+n].getDomNode());e.lines.splice(i,t)},t.prototype._finishRendering=function(e,t){var n,i,o=!1,r=[],s=[];for(n=0;n=i;i++)e.lines[i].shouldUpdateHTML(i+e.rendLineNumberStart)&&this.setInnerHTMLCount++},t.prototype._insertLinesBefore=function(e,t,n){this.insertCount+=n-t+1,this.setInnerHTMLCount+=n-t+1},t.prototype._removeLinesBefore=function(e,t){this.removeCount+=t},t.prototype._insertLinesAfter=function(e,t,n){this.insertCount+=n-t+1,this.setInnerHTMLCount+=n-t+1},t.prototype._removeLinesAfter=function(e,t){this.removeCount+=t},t.prototype._finishRendering=function(){},t}(a),h=function(e){function t(t){e.call(this),this._createLine=t}return __extends(t,e),t.prototype.renderWithOneUpdate=function(e,t,n,i){return this._render(e,t,n,i)},t.prototype._insertLinesBefore=function(e,t,n){var i,o,r=[];for(o=t;n>=o;o++)i=this._createLine(!1),r.push(i);e.lines=r.concat(e.lines)},t.prototype._removeLinesBefore=function(e,t){e.lines.splice(0,t)},t.prototype._insertLinesAfter=function(e,t,n){var i,o,r=[];for(o=t;n>=o;o++)i=this._createLine(!1),r.push(i);e.lines=e.lines.concat(r)},t.prototype._removeLinesAfter=function(e,t){var n=e.linesLength-t;e.lines.splice(n,t)},t.prototype._finishRendering=function(e,t){var n,i=[];for(n=0;n
      "),e.domNode.innerHTML=i.join("");var o=e.domNode.children;for(n=0;n=i?i:n}function u(e,t){return window.screen&&window.screen.deviceXDPI&&(l.browser.isIE9||l.browser.isIE10)?new _(e,t):l.browser.isWebKit?new b(e,t):new C(e,t)}var l=n,h=i,d=r,c=" ".charCodeAt(0),p=" ".charCodeAt(0),f="<".charCodeAt(0),m=">".charCodeAt(0),g="&".charCodeAt(0),v="\r".charCodeAt(0),y=function(){function e(e,t,n,i){this.top=e,this.left=t,this.width=n,this.height=i}return e}(),C=function(){function e(e,t){this.context=e,t&&(this.domNode=document.createElement("div"),this.domNode.className=h.ClassNames.VIEW_LINE),this.isInvalid=!0,this.isMaybeInvalid=!1,this.lineParts=null,this.html=null,this.charOffsetInPart=[],this.hasOverflowed=!1,this.lastRenderedPartIndex=0}return e.prototype.getDomNode=function(){return this.domNode},e.prototype.setDomNode=function(e){this.domNode=e},e.prototype.onContentChanged=function(){this.isInvalid=!0},e.prototype.onLinesInsertedAbove=function(){this.isMaybeInvalid=!0},e.prototype.onLinesDeletedAbove=function(){this.isMaybeInvalid=!0},e.prototype.onLineChangedAbove=function(){this.isMaybeInvalid=!0},e.prototype.onTokensChanged=function(){this.isMaybeInvalid=!0},e.prototype.onModelDecorationsChanged=function(){this.isMaybeInvalid=!0},e.prototype.onConfigurationChanged=function(){this.isInvalid=!0},e.prototype.shouldUpdateHTML=function(e){var t=null;return(this.isMaybeInvalid||this.isInvalid)&&(t=this.computeLineParts(e)),this.isMaybeInvalid&&(this.isInvalid||this.lineParts&&this.lineParts.equals(t)||(this.isInvalid=!0),this.isMaybeInvalid=!1),this.isInvalid&&(this.lineParts=t),this.isInvalid},e.prototype.getLineOuterHTML=function(e,t,n){var i=[];return i.push('
      '),i=i.concat(this.getLineInnerHTML(e,t)),i.push("
      "),i},e.prototype.getLineInnerHTML=function(e,t){return this.isInvalid&&(this.html=this.renderLine(t,this.lineParts),this.isInvalid=!1),this.html},e.prototype.layoutLine=function(e,t){var n=this.domNode.getAttribute("lineNumber");n!==e.toString()&&this.domNode.setAttribute("lineNumber",e.toString());var i=this.domNode.style.top;i!==t+"px"&&(this.domNode.style.top=t+"px")},e.prototype.computeLineParts=function(e){return d.createLineParts(e,this.context.model.getLineTokens(e),this.context.model.getInlineDecorations(e))},e.prototype.renderLine=function(e){var t=[],n=this.context.model.getLineContent(e),i=this.context.configuration.editor.viewWordWrap;if(this.charOffsetInPart=[],this.hasOverflowed=!1,this.bustReadingCache(),t.push(""),n.length>0){var o,r,s,a,u=n.length,h=-1,d=0,y=0,C=0,_=!0,b="",w=this.context.configuration.editor.tabSize,E=this.context.configuration.editor.stopRenderingLineAfter,S=this.lineParts.getParts();for(-1!==E&&u>E-1&&(b=n.substr(E-1,1),u=E-1,this.hasOverflowed=!0),r=0;u>r;r++){switch(r===d&&(h++,d=h+10&&t.push(""),t.push(''),!i||_||l.browser.isIE9?C=0:(t.push("​"),C=1)),this.charOffsetInPart[r]=C,o=n.charCodeAt(r)){case p:for(a=w-(r+y)%w,y+=a-1,C+=a-1;a>0;)t.push(" "),a--;break;case c:t.push(" ");break;case f:_=!1,t.push("<");break;case m:_=!1,t.push(">");break;case g:_=!1,t.push("&");break;case 0:t.push("�");break;case v:t.push("​");break;default:_=!1,t.push(n.charAt(r))}C++}t.push(""),this.charOffsetInPart[u]=C,this.lastRenderedPartIndex=h,b.length>0&&(t.push(''),t.push(b),t.push("…"))}else t.push(" ");return t.push(""),t},e.prototype.getReadingTarget=function(){return this.domNode.firstChild},e.prototype.bustReadingCache=function(){this.cachedWidth=-1},e.prototype.getHeight=function(){return this.domNode.offsetHeight},e.prototype.getWidth=function(){return-1===this.cachedWidth&&(this.cachedWidth=this.getReadingTarget().offsetWidth),this.cachedWidth},e.prototype.getVisibleRangesForRange=function(e,t,n,i,o,r,s){var a=this.context.configuration.editor.stopRenderingLineAfter;return-1!==a&&t>a&&n>a?null:(-1!==a&&t>a&&(t=a),-1!==a&&n>a&&(n=a),this.readVisibleRangesForRange(e,t,n,i,o,r,s))},e.prototype.readVisibleRangesForRange=function(e,t,n,i,o,r,a){var u;if(u=t===n?this.readRawVisibleRangesForPosition(e,t,i,o,r,a):this.readRawVisibleRangesForRange(e,t,n,i,o,r,a),!u||0===u.length)return u;u.sort(s);for(var l,h=[],d=u[0],c=1,p=u.length;p>c;c++)l=u[c],d.top===l.top&&d.height===l.height&&d.left+d.width+.001>=l.left?d.width=Math.max(d.width,l.left+l.width-d.left):(h.push(d),d=l);return h.push(d),h},e.prototype.readRawVisibleRangesForPosition=function(e,t,n,i,o,r){var s=this.lineParts,u=a(s,t-1,this.lastRenderedPartIndex),l=this.charOffsetInPart[t-1],h=this.getReadingTarget();return this.readRawVisibleRangesFrom(h,u,l,u,l,n,i,o,r)},e.prototype.readRawVisibleRangesForRange=function(e,t,n,i,o,r,s){if(!this.context.configuration.editor.viewWordWrap&&1===t&&n===this.charOffsetInPart.length)return this.readRawVisibleRangesForEntireLine(i,o,r);var u=this.lineParts,l=a(u,t-1,this.lastRenderedPartIndex),h=this.charOffsetInPart[t-1],d=a(u,n-1,this.lastRenderedPartIndex),c=this.charOffsetInPart[n-1],p=this.getReadingTarget();return this.readRawVisibleRangesFrom(p,l,h,d,c,i,o,r,s)},e.prototype.readRawVisibleRangesForEntireLine=function(e){var t=this.domNode.getBoundingClientRect();return[new y(t.top-e,0,this.getReadingTarget().offsetWidth,t.height)]},e.prototype.readRawVisibleRangesFrom=function(e,t,n,i,o,r,s,a,u){var l=E.createRange();l.setStart(e.children[t].firstChild,n),l.setEnd(e.children[i].firstChild,o);var h=l.getClientRects(),d=null;return h.length>0&&(d=this.createRawVisibleRangesFromClientRects(h,r+s,a)),E.detachRange(l,u),d},e.prototype.createRawVisibleRangesFromClientRects=function(e,t,n){var i,o,r=e.length,s=[];for(s=new Array(r),o=0;r>o;o++)i=e[o],s[o]=new y(i.top-t,i.left-n,i.width,i.height);return s},e.prototype.getColumnOfNodeOffset=function(e,t,n){for(var i=-1;t;)t=t.previousSibling,i++;var o=this.lineParts.getParts();if(i>=o.length)return this.context.configuration.editor.stopRenderingLineAfter;if(0===n)return o[i].startIndex+1;var r,s,a=o[i].startIndex;i+1l;){if(u=Math.floor((l+h)/2),d=this.charOffsetInPart[u],c=u===r?Number.MAX_VALUE:u+1===r?s:this.charOffsetInPart[u+1],p=u===a?Number.MIN_VALUE:this.charOffsetInPart[u-1],f=(p+d)/2,m=(d+c)/2,n>f&&m>=n)return u+1;f>=n?h=u-1:l=u+1}return l+1},e.prototype.getInnerSpansTopOffset=function(){return this.getReadingTarget().offsetTop},e}(),_=function(e){function t(t,n){e.call(this,t,n)}return __extends(t,e),t.prototype.createRawVisibleRangesFromClientRects=function(e,t,n){var i,o,r=e.length,s=[],a=screen.logicalYDPI/screen.deviceYDPI,u=screen.logicalXDPI/screen.deviceXDPI;for(s=new Array(r),o=0;r>o;o++)i=e[o],s[o]=new y(i.top*a-t,i.left*u-n,i.width*u,i.height*a);return s},t}(C),b=function(e){function t(t,n){e.call(this,t,n)}return __extends(t,e),t.prototype.readVisibleRangesForRange=function(t,n,i,o,r,s,a){var u=e.prototype.readVisibleRangesForRange.call(this,t,n,i,o,r,s,a);if(!u||0===u.length||n===i||1===n&&i===this.charOffsetInPart.length)return u;var l=this.readRawVisibleRangesForPosition(t,i-1,o,r,s,a),h=this.readRawVisibleRangesForPosition(t,i,o,r,s,a);if(l&&l.length>0&&h&&h.length>0){var d=l[0],c=h[0],p=!0;d.top===c.top&&(p=d.left<=c.left);var f=u[u.length-1];p&&f.top===c.top&&f.leftc.top&&u.splice(u.length-1,1)}return u},t}(C),w=function(){function e(){this._handyReadyRange=document.createRange()}return e.prototype.createRange=function(){return this._handyReadyRange},e.prototype.detachRange=function(e,t){e.selectNodeContents(t)},e}(),E=new w;t.createLine=u});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/editor/core/view/overviewRuler/overviewRuler",["require","exports","vs/editor/core/view/overviewRuler/overviewRulerImpl","vs/editor/core/view/viewEventHandler"],function(e,t,n,i){"use strict";var o=n,r=i,s=function(e){function t(t,n,i,r,s,a){e.call(this),this.context=t,this.overviewRuler=new o.OverviewRulerImpl(n,i,this.context.configuration.editor.lineHeight,r,s,a),this.context.addEventHandler(this)}return __extends(t,e),t.prototype.destroy=function(){this.context.removeEventHandler(this),this.overviewRuler.dispose()},t.prototype.onConfigurationLineHeightChanged=function(){return this.overviewRuler.setLineHeight(this.context.configuration.editor.lineHeight,!0),!0},t.prototype.onZonesChanged=function(){return!0},t.prototype.onModelFlushed=function(){return!0},t.prototype.onScrollHeightChanged=function(e){return this.overviewRuler.setScrollHeight(e,!0),!0},t.prototype.getDomNode=function(){return this.overviewRuler.getDomNode()},t.prototype.setLayout=function(e){this.overviewRuler.setLayout(e,!0)},t.prototype.setZones=function(e){this.overviewRuler.setZones(e,!0)},t}(r.ViewEventHandler);t.OverviewRuler=s});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/editor/core/view/overviewRuler/decorationsOverviewRuler",["require","exports","vs/editor/core/view/overviewRuler/overviewRulerImpl","vs/editor/core/view/viewContext","vs/editor/core/view/viewEventHandler"],function(e,t,n,i,o){"use strict";var r=n,s=o,a=function(e){function t(n,i,o){e.call(this),this.context=n,this.overviewRuler=new r.OverviewRulerImpl("decorationsOverviewRuler",i,this.context.configuration.editor.lineHeight,t.DECORATION_HEIGHT,t.DECORATION_HEIGHT,o),this.shouldUpdateDecorations=!0,this.hasDecorations=!1,this.context.addEventHandler(this)}return __extends(t,e),t.DECORATION_HEIGHT=4,t.prototype.dispose=function(){this.context.removeEventHandler(this),this.overviewRuler.dispose()},t.prototype.onConfigurationLineHeightChanged=function(){return this.overviewRuler.setLineHeight(this.context.configuration.editor.lineHeight,!1),!0},t.prototype.onLayoutChanged=function(e){return this.overviewRuler.setLayout(e.overviewRuler,!1),!0},t.prototype.onZonesChanged=function(){return!0},t.prototype.onModelFlushed=function(){return!0},t.prototype.onModelDecorationsChanged=function(){return this.shouldUpdateDecorations=!0,!0},t.prototype.onScrollHeightChanged=function(e){return this.overviewRuler.setScrollHeight(e,!1),!0},t.prototype.getDomNode=function(){return this.overviewRuler.getDomNode()},t.prototype.prepareRender=function(){if(this.shouldUpdateDecorations){this.shouldUpdateDecorations=!1;var e,t,n,i=this.context.model.getAllDecorations(),o=[];for(e=0,t=i.length;t>e;e++)n=i[e],n.options.showInOverviewRuler&&o.push({startLineNumber:n.range.startLineNumber,endLineNumber:n.range.endLineNumber,color:n.options.showInOverviewRuler});this.hasDecorations=o.length>0,this.overviewRuler.setZones(o,!1)}return null},t.prototype.render=function(){if(this.shouldRender&&(this.shouldRender=!1,this.overviewRuler.render(),this.hasDecorations&&r.hasCanvas)){var e=this.overviewRuler.getDomNode().getContext("2d");e.fillStyle="rgba(197,197,197,0.4)",e.fillRect(0,0,this.overviewRuler.getWidth(),1),e.fillRect(0,0,1,this.overviewRuler.getHeight()),e.fillRect(0,this.overviewRuler.getHeight()-1,this.overviewRuler.getWidth(),1)}},t}(s.ViewEventHandler);t.DecorationsOverviewRuler=a}),define("vs/editor/core/view/viewEventDispatcher",["require","exports","vs/base/eventEmitter","vs/editor/core/view/viewContext"],function(e,t,n,i){"use strict";var o=n,r=function(){function e(e){this.eventHandlerGateKeeper=e,this.eventHandlers=[],this.eventQueue=[],this.isConsumingQueue=!1}return e.prototype.addEventHandler=function(e){this.eventHandlers.push(e)},e.prototype.removeEventHandler=function(e){for(var t=0;t0;)for(o=e.eventQueue,e.eventQueue=[],i=e.eventHandlers.slice(0),t=0,n=i.length;n>t;t++)i[t].handleEvents(o)}finally{e.isConsumingQueue=!1}})},e}();t.ViewEventDispatcher=r}),define("vs/editor/core/view/layout/elementSizeObserver",["require","exports","vs/base/lifecycle"],function(e,t,n){"use strict";var i=function(){function e(e,t){this.referenceDomElement=e,this.changeCallback=t,this.measureReferenceDomElementToken=-1,this.width=-1,this.height=-1,this.measureReferenceDomElement()}return e.prototype.dispose=function(){this.stopObserving()},e.prototype.startObserving=function(){var e=this;-1===this.measureReferenceDomElementToken&&(this.measureReferenceDomElementToken=window.setInterval(function(){return e.measureReferenceDomElement()},100))},e.prototype.stopObserving=function(){-1!==this.measureReferenceDomElementToken&&(window.clearInterval(this.measureReferenceDomElementToken),this.measureReferenceDomElementToken=-1)},e.prototype.observe=function(){this.measureReferenceDomElement()},e.prototype.measureReferenceDomElement=function(){var e=Math.max(5,this.referenceDomElement.clientWidth),t=Math.max(5,this.referenceDomElement.clientHeight);(this.width!==e||this.height!==t)&&(this.width=e,this.height=t,this.changeCallback(this.width,this.height))},e.prototype.getReferenceElementWidth=function(){},e}();t.ElementSizeObserver=i});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/editor/core/view/viewOverlays",["require","exports","vs/base/dom/dom","vs/editor/core/view/viewContext","vs/editor/core/view/viewEventHandler","vs/base/lifecycle"],function(e,t,n,i,o,r){"use strict";var s=n,a=o,u=function(e){function t(t){e.call(this),this.context=t,this.dynamicOverlays=[],this.overlays=[],this.domNode=document.createElement("div"),this.domNode.className="view-overlays",this.domNode.style.position="absolute",this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.backgroundDomNode=document.createElement("div"),this.backgroundDomNode.className="background",this.domNode.appendChild(this.backgroundDomNode),this.staticDomNode=document.createElement("div"),this.staticDomNode.className="static",this.domNode.appendChild(this.staticDomNode),this.dynamicDomNode=document.createElement("div"),this.dynamicDomNode.className="dynamic",this.domNode.appendChild(this.dynamicDomNode),this.scrollHeight=0,this.context.addEventHandler(this)}return __extends(t,e),t.prototype.dispose=function(){this.context.removeEventHandler(this),this.context=null;for(var e=0;et;t++)this.prefixSum[t]=0;this.prefixSumValidIndex=-1}return e.prototype.getCount=function(){return this.values.length},e.prototype.insertValue=function(e,t){this.values.splice(e,0,t),this.prefixSum.splice(e,0,0),e-1=n;n++)this.prefixSum[n]=this.prefixSum[n-1]+this.values[n];return this.prefixSumValidIndex=Math.max(this.prefixSumValidIndex,e),this.prefixSum[e]},e.prototype.getIndexOf=function(e,t){for(var n,i,o,r=0,s=this.values.length-1;s>=r;)if(n=0|r+(s-r)/2,o=this.getAccumulatedValue(n),i=o-this.values[n],i>e)s=n-1;else{if(!(e>=o))break;r=n+1}t.index=n,t.remainder=e-i},e}();t.PrefixSumComputer=n});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/base/performance/timer",["require","exports","vs/base/env","vs/base/eventEmitter","vs/nls!vs/editor/editor.main"],function(e,t,n,i,o){"use strict";function r(e,t){return m.start(e,t)}function s(){return m}var a=n,u=i,l=o,h=!!self.msWriteProfilerMark;!function(e){e._map=[],e._map[0]="EDITOR",e.EDITOR=0,e._map[1]="LANGUAGES",e.LANGUAGES=1,e._map[2]="WORKER",e.WORKER=2,e._map[3]="WORKBENCH",e.WORKBENCH=3}(t.Topic||(t.Topic={}));var d=t.Topic,c=function(){function e(){}return e.prototype.start=function(){return this},e.prototype.stop=function(){},e.prototype.timeTaken=function(){return-1},e}();t.NullTimerEvent=c;var p=function(){function e(e,t,n,i){if(this.timeKeeper=e,this.name=t,this.topic=n,this.stopTime=null,i)return this.startTime=i,void 0;if(this.startTime=(new Date).getTime(),h){var o=["Monaco",this.topic,this.name,"start"];self.msWriteProfilerMark(o.join("|"))}}return e.prototype.start=function(e){if(this.stopTime)throw new Error(l.localize("vs_base_performance_timer",0));return this.timeKeeper.start(this.topic,this.name+"."+e)},e.prototype.stop=function(e){if(null===this.stopTime){if(e)return this.stopTime=e,void 0;if(this.stopTime=(new Date).getTime(),this.timeKeeper.emit("eventStop",this),h){var t=["Monaco",this.topic,this.name,"stop"];self.msWriteProfilerMark(t.join("|"))}}},e.prototype.timeTaken=function(){return this.stopTime?this.stopTime-this.startTime:-1},e}();t.TimerEvent=p;var f=function(e){function n(){e.call(this),this.timeoutId=null,this.collectedEvents=[],this.eventCacheLimit=1e3,this.maxTimerLength=6e4,this.cleanupInterval=12e4}return __extends(n,e),n.EVENT_ID=1,n.PARSE_TIME=(new Date).getTime(),n.prototype.enabled=function(){return a.enablePerformanceEvents},n.prototype.start=function(e,n){if(this.enabled()===!1)return t.nullEvent;e===d.EDITOR?e="Editor":e===d.LANGUAGES?e="Languages":e===d.WORKER?e="Worker":e===d.WORKBENCH&&(e="Workbench");var i=new p(this,n,e);return this.addEvent(i),this.cleanupTimers(),i},n.prototype.addEvent=function(e){e.id=n.EVENT_ID,n.EVENT_ID++,this.collectedEvents.push(e),this.emit("eventStart",e),this.collectedEvents.length>this.eventCacheLimit&&this.collectedEvents.shift()},n.prototype.cleanupTimers=function(){var e=this;null===this.timeoutId&&(this.timeoutId=setTimeout(function(){var t=Date.now();e.collectedEvents.forEach(function(n){!n.stopTime&&t-n.startTime>=e.maxTimerLength&&n.stop()})},this.cleanupInterval))},n.prototype.dispose=function(){clearTimeout(this.timeoutId),e.prototype.dispose.call(this)},n.prototype.getCollectedEvents=function(){return this.collectedEvents.slice(0)},n.prototype.clearCollectedEvents=function(){this.collectedEvents=[]},n.prototype.setInitialCollectedEvents=function(e,t){var i=this;this.enabled()!==!1&&(t&&(n.PARSE_TIME=t),e.forEach(function(e){var t=new p(i,e.name,e.topic,e.startTime);t.stop(e.stopTime),i.addEvent(t)}))},n}(u.EventEmitter);t.TimeKeeper=f;var m=new f;t.nullEvent=new c,t.start=r,t.getTimeKeeper=s});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/base/async",["require","exports","vs/base/errors","vs/base/lib/winjs.base"],function(e,t,n,i){"use strict";function o(e,t){return e.then(function(e){try{t(e)}catch(n){r.onUnexpectedError(n)}return e},function(e){try{t(e)}catch(n){r.onUnexpectedError(n)}throw e})}var r=n,s=i,a=function(){function e(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}return e.prototype.queue=function(e){var t=this;if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){var n=function(){t.queuedPromise=null;var e=t.queue(t.queuedPromiseFactory);return t.queuedPromiseFactory=null,e};this.queuedPromise=this.activePromise.then(n,n)}return new s.Promise(function(e,n){t.queuedPromise.then(e,n)})}return this.activePromise=e(),this.activePromise.then(function(e){return t.activePromise=null,e},function(e){return t.activePromise=null,s.Promise.wrapError(e)})},e}();t.Throttler=a;var u=function(){function e(e){this.defaultDelay=e,this.timeoutPromise=null,this.completionPromise=null,this.onSuccess=null,this.task=null}return e.prototype.trigger=function(e,t){"undefined"==typeof t&&(t=this.defaultDelay);var n=this;return this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new s.Promise(function(e){n.onSuccess=e}).then(function(){n.completionPromise=null,n.onSuccess=null;var e=n.task();return n.task=null,e})),this.timeoutPromise=s.Promise.timeout(t),this.timeoutPromise.then(function(){n.timeoutPromise=null,n.onSuccess(null)}),this.completionPromise},e.prototype.isTriggered=function(){return!!this.timeoutPromise},e.prototype.cancel=function(){this.cancelTimeout(),this.completionPromise&&(this.completionPromise.cancel(),this.completionPromise=null)},e.prototype.cancelTimeout=function(){this.timeoutPromise&&(this.timeoutPromise.cancel(),this.timeoutPromise=null)},e}();t.Delayer=u;var l=function(e){function t(t){e.call(this,t),this.throttler=new a}return __extends(t,e),t.prototype.trigger=function(t,n){var i=this;return e.prototype.trigger.call(this,function(){return i.throttler.queue(t)},n)},t}(u);t.ThrottledDelayer=l,t.always=o}),define("vs/base/network",["require","exports","./assert"],function(e,t,n){"use strict";var i=n,o=function(){function e(e){i.ok(!!e,"spec must not be null"),this.spec=e,this.scheme=void 0}return e.prototype.toJSON=function(){return{$url:this.spec}},e.prototype.toExternal=function(){return this.spec},e.prototype.toString=function(){return this.spec},e.prototype.getScheme=function(){return void 0===this.scheme&&(this.scheme=this.doGetScheme()),this.scheme},e.prototype.doGetScheme=function(){var e=this.spec.indexOf(":");return-1===e?null:this.spec.substring(0,e)},e.prototype.getPath=function(){for(var e=0,t=-1,n=0,i=this.spec.length;i>n;n++){var o=this.spec.charAt(n);switch(o){case"/":3===++e&&(t=n);break;case"?":case"#":return-1===t?null:this.spec.substring(t,n) }}return-1===t?null:t===this.spec.length-1?"":this.spec.substring(t)},e}();t.URL=o,function(e){e.inMemory="inMemory"}(t.schemas||(t.schemas={})),t.schemas});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/platform/services",["require","exports","vs/base/lib/winjs.base","vs/base/async","vs/base/eventEmitter","vs/base/strings","vs/base/network","vs/base/eventEmitter","vs/base/performance/timer","vs/base/objects"],function(e,t,n,i,o,r,s,a,u,l){"use strict";var h=n,d=i,c=r,p=s,f=u,m=l,g=function(){function e(e,t,n){"undefined"==typeof n&&(n={}),this.workspace=e,this.configuration=t,this.options=n}return e.prototype.getWorkspace=function(){return this.workspace},e.prototype.getConfiguration=function(){return this.configuration},e.prototype.getOptions=function(){return this.options},e}();t.BaseContextService=g;var v=function(){function e(){}return e.prototype.injectTelemetryService=function(e){this.telemetryService=e},e.prototype.injectContextService=function(e){if(!this.contextService)if(this.contextService=e,this.contextService.getConfiguration()){this.origin=this.contextService.getConfiguration().paths.PUBLIC_WORKSPACE_URL;var t=new p.URL(this.origin).getPath();t&&t.length>0&&(this.origin=this.origin.substring(0,this.origin.length-t.length+1)),c.endsWith(this.origin,"/")||(this.origin+="/")}else this.origin="/"},e.prototype.getRequestUrl=function(e,t,n){var i=this.contextService.getWorkspace();if(i[e]){var o=i[e]+c.normalizePath(t);return n?this.origin+c.ltrim(o,"/"):o}return null},e.prototype.getPath=function(e,t){var n=this.getRequestUrl(e,"/",!0);if(!n)return null;var i=t.toExternal().indexOf(n);return 0===i?t.toExternal().substr(n.length-1):null},e.prototype.getAdditionalHeaders=function(){return this.contextService.getConfiguration().additionalHeaders||{}},e.prototype.poll=function(){return h.Promise.wrapError("Not Implemented")},e.prototype.establishPrivateChannel=function(){return h.Promise.wrapError("Not Implemented")},e.prototype.makeRequest=function(e){var t=f.nullEvent;return e.headers=m.mixin(e.headers,this.getAdditionalHeaders()),this.telemetryService&&(t=this.telemetryService.start("WorkbenchXHR",{url:e.url},!1)),d.always(h.xhr(e),function(e){t.data&&(t.data.status=e.status),t.stop()})},e}();t.BaseRequestService=v;var y=function(){function e(e){this.selection=e||[]}return e.EMPTY=new e([]),e.prototype.isEmpty=function(){return 0===this.selection.length},e}();t.Selection=y;var C=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),t.prototype.toArray=function(){return this.selection},t}(y);t.StructuredSelection=C,function(e){e._map=[],e._map[0]="Info",e.Info=0,e._map[1]="Warning",e.Warning=1,e._map[2]="Error",e.Error=2}(t.Severity||(t.Severity={})),t.Severity;var _=function(){function e(){}return e.SERVICE_CHANGED="service-changed",e.SET_CHANGED="set-changed",e.SET_ADDED="set-added",e.SET_REMOVED="set-removed",e}();t.MarkerServiceConstants=_,t.ResourceEvents={ADDED:"resource.added",REMOVED:"resource.removed",CHANGED:"resource.changed"}});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/base/ui/actions",["require","exports","vs/base/lib/winjs.base","vs/base/eventEmitter"],function(e,t,n,i){"use strict";function o(e){function t(t){return function(){e.forEach(function(e){e.setChecked(e===t)})}}return e.map(function(e){return new u(e,t(e))})}var r=n,s=i,a=function(e){function t(t,n,i,o,r){"undefined"==typeof n&&(n=""),"undefined"==typeof i&&(i=""),"undefined"==typeof o&&(o=!0),"undefined"==typeof r&&(r=null),e.call(this),this.id=t,this.label=n,this.cssClass=i,this.enabled=o,this.actionCallback=r}return __extends(t,e),t.LABEL="label",t.CLASS="class",t.ENABLED="enabled",t.CHECKED="checked",t.prototype.getId=function(){return this.id},t.prototype.getLabel=function(){return this.label},t.prototype.setLabel=function(e){name!==e&&(this.label=e,this.emit(t.LABEL,{source:this}))},t.prototype.getClass=function(){return this.cssClass},t.prototype.setClass=function(e){this.cssClass!==e&&(this.cssClass=e,this.emit(t.CLASS,{source:this}))},t.prototype.isEnabled=function(){return this.enabled},t.prototype.setEnabled=function(e){this.enabled!==e&&(this.enabled=e,this.emit(t.ENABLED,{source:this}))},t.prototype.isChecked=function(){return this.checked},t.prototype.setChecked=function(e){this.checked!==e&&(this.checked=e,this.emit(t.CHECKED,{source:this}))},t.prototype.getOrder=function(){return this.order},t.prototype.setOrder=function(e){this.order=e},t.prototype.run=function(e){return null!==this.actionCallback?this.actionCallback(e):r.Promise.as(!0)},t}(s.EventEmitter);t.Action=a;var u=function(e){function t(t,n){e.call(this,t.getId(),t.getLabel(),t.getClass(),t.isEnabled(),null),this.delegate=t,this.runHandler=n}return __extends(t,e),t.prototype.getId=function(){return this.delegate.getId()},t.prototype.getLabel=function(){return this.delegate.getLabel()},t.prototype.setLabel=function(e){this.delegate.setLabel(e)},t.prototype.getClass=function(){return this.delegate.getClass()},t.prototype.setClass=function(e){this.delegate.setClass(e)},t.prototype.isEnabled=function(){return this.delegate.isEnabled()},t.prototype.setEnabled=function(e){this.delegate.setEnabled(e)},t.prototype.isChecked=function(){return this.delegate.isChecked()},t.prototype.setChecked=function(e){this.delegate.setChecked(e)},t.prototype.run=function(e){return this.runHandler(e),this.delegate.run(e)},t.prototype.addListener=function(e,t){return this.delegate.addListener(e,t)},t.prototype.addBulkListener=function(e){return this.delegate.addBulkListener(e)},t.prototype.addEmitter=function(e,t){return this.delegate.addEmitter(e,t)},t.prototype.addEmitterTypeListener=function(e,t,n){return this.delegate.addEmitterTypeListener(e,t,n)},t.prototype.emit=function(e,t){this.delegate.emit(e,t)},t}(a);t.radioGroup=o}),define("vs/editor/editor",["require","exports","vs/base/eventEmitter"],function(e,t,n){"use strict";!function(e){e._map=[],e._map[0]="LTR",e.LTR=0,e._map[1]="RTL",e.RTL=1}(t.SelectionDirection||(t.SelectionDirection={})),t.SelectionDirection,function(e){e._map=[],e._map[0]="TextDefined",e.TextDefined=0,e._map[1]="LF",e.LF=1,e._map[2]="CRLF",e.CRLF=2}(t.EndOfLinePreference||(t.EndOfLinePreference={})),t.EndOfLinePreference,function(e){e._map=[],e._map[0]="EXACT",e.EXACT=0,e._map[1]="ABOVE",e.ABOVE=1,e._map[2]="BELOW",e.BELOW=2}(t.ContentWidgetPositionPreference||(t.ContentWidgetPositionPreference={})),t.ContentWidgetPositionPreference,function(e){e._map=[],e._map[0]="TOP_RIGHT_CORNER",e.TOP_RIGHT_CORNER=0}(t.OverlayWidgetPositionPreference||(t.OverlayWidgetPositionPreference={})),t.OverlayWidgetPositionPreference,function(e){e._map=[],e._map[0]="UNKNOWN",e.UNKNOWN=0,e._map[1]="TEXTAREA",e.TEXTAREA=1,e._map[2]="GUTTER_GLYPH_MARGIN",e.GUTTER_GLYPH_MARGIN=2,e._map[3]="GUTTER_LINE_NUMBERS",e.GUTTER_LINE_NUMBERS=3,e._map[4]="GUTTER_LINE_DECORATIONS",e.GUTTER_LINE_DECORATIONS=4,e._map[5]="GUTTER_VIEW_ZONE",e.GUTTER_VIEW_ZONE=5,e._map[6]="CONTENT_TEXT",e.CONTENT_TEXT=6,e._map[7]="CONTENT_EMPTY",e.CONTENT_EMPTY=7,e._map[8]="CONTENT_VIEW_ZONE",e.CONTENT_VIEW_ZONE=8,e._map[9]="CONTENT_WIDGET",e.CONTENT_WIDGET=9,e._map[10]="OVERVIEW_RULER",e.OVERVIEW_RULER=10,e._map[11]="SCROLLBAR",e.SCROLLBAR=11,e._map[12]="OVERLAY_WIDGET",e.OVERLAY_WIDGET=12}(t.MouseTargetType||(t.MouseTargetType={})),t.MouseTargetType}),define("vs/editor/core/view/model/filteredLineTokens",["require","exports","vs/editor/editor","vs/base/arrays"],function(e,t,n,i){"use strict";var o=i,r=function(){function e(e,t,n){this._original=e,this._startOffset=t,this._endOffset=n,this.tokens=[];var i=e.getTokens();if(i.length>0){var r,s,a,u=o.findIndexInSegmentsArray(i,t);for(this.tokens.push({startIndex:0,type:i[u].type}),s=u+1,a=i.length;a>s&&(r=i[s],!(r.startIndex>=n));s++)this.tokens.push({startIndex:r.startIndex-t,type:r.type})}}return e.prototype.getTokens=function(){return this.tokens},e.prototype.getTextLength=function(){return this._endOffset-this._startOffset},e.prototype.equals=function(t){if(t instanceof e){var n=t;return this._startOffset!==n._startOffset?!1:this._endOffset!==n._endOffset?!1:this._original.equals(n._original)}return!1},e.prototype.findIndexOfOffset=function(e){return o.findIndexInSegmentsArray(this.tokens,e)},e}();t.FilteredLineTokens=r}),define("vs/editor/core/position",["require","exports","vs/editor/editor"],function(e,t,n){"use strict";function i(e){return e&&"number"==typeof e.lineNumber&&"number"==typeof e.column}t.isIPosition=i;var o=function(){function e(e,t){this.lineNumber=e,this.column=t}return e.prototype.equals=function(e){return this.lineNumber===e.lineNumber&&this.column===e.column},e.prototype.isBefore=function(e){return this.lineNumbere.endLineNumber?!1:t.lineNumber===e.startLineNumber&&t.columne.endColumn?!1:!0},e.containsRange=function(e,t){return t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber?!1:t.startLineNumber===e.startLineNumber&&t.startColumne.endColumn?!1:!0},e.intersectRanges=function(e,t){var n=e.startLineNumber,i=e.startColumn,o=e.endLineNumber,r=e.endColumn,s=t.startLineNumber,a=t.startColumn,l=t.endLineNumber,h=t.endColumn;return s>n?(n=s,i=a):n===s&&(i=Math.max(i,a)),o>l?(o=l,r=h):o===l&&(r=Math.min(r,h)),n>o?null:n===o&&i>r?null:new u(n,i,o,r)},e.plusRange=function(e,t){var n,i,o,r;return t.startLineNumbere.endLineNumber?(o=t.endLineNumber,r=t.endColumn):t.endLineNumber===e.endLineNumber?(o=t.endLineNumber,r=Math.max(t.endColumn,e.endColumn)):(o=e.endLineNumber,r=e.endColumn),new u(n,i,o,r)},e.equalsRange=function(e,t){return e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn},e.compareRangesUsingStarts=function(e,t){return e.startLineNumber===t.startLineNumber?e.startColumn===t.startColumn?e.endLineNumber===t.endLineNumber?e.endColumn-t.endColumn:e.endLineNumber-t.endLineNumber:e.startColumn-t.startColumn:e.startLineNumber-t.startLineNumber},e.compareRangesUsingEnds=function(e,t){return e.endLineNumber===t.endLineNumber?e.endColumn===t.endColumn?e.startLineNumber===t.startLineNumber?e.startColumn-t.startColumn:e.startLineNumber-t.startLineNumber:e.endColumn-t.endColumn:e.endLineNumber-t.endLineNumber},e}();t.RangeUtils=a;var u=function(){function e(e,t,n,i){e>n||e===n&&t>i?(this.startLineNumber=n,this.startColumn=i,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=n,this.endColumn=i)}return e.prototype.isEmpty=function(){return a.isEmpty(this)},e.prototype.containsPosition=function(e){return a.containsPosition(this,e)},e.prototype.containsRange=function(e){return a.containsRange(this,e)},e.prototype.plusRange=function(e){return a.plusRange(this,e)},e.prototype.equalsRange=function(e){return a.equalsRange(this,e)},e.prototype.getEndPosition=function(){return new s.Position(this.endLineNumber,this.endColumn)},e.prototype.getStartPosition=function(){return new s.Position(this.startLineNumber,this.startColumn)},e.prototype.cloneRange=function(){return new e(this.startLineNumber,this.startColumn,this.endLineNumber,this.endColumn)},e.prototype.toString=function(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"},e.prototype.setEndPosition=function(t,n){return new e(this.startLineNumber,this.startColumn,t,n)},e.prototype.setStartPosition=function(t,n){return new e(t,n,this.endLineNumber,this.endColumn)},e}();t.Range=u,t.create=r}),define("vs/editor/core/command/shiftCommand",["require","exports","vs/editor/core/range","vs/editor/editor"],function(e,t,n,i){"use strict";var o=n,r=function(){function e(e,t,n){this._configuration=e,this._isUnshift=t,this._selection=n}return e.prototype.getEditOperations=function(e,t){var n=this._selection.startLineNumber,i=this._selection.endLineNumber;1===this._selection.endColumn&&n!==i&&(i-=1);var r;if(this._isUnshift){var s=this._configuration.editor.tabSize;for(r=n;i>=r;r++){var a,u=e.getLineContent(r);if(" "===u.charAt(0))a=1;else for(a=0;aa;a++){if(" "===u.charAt(a)){a++;break}if(" "!==u.charAt(a))break}0!==a&&t.addEditOperation(new o.Range(r,1,r,a+1),null)}}else{var l=this._configuration.getOneIndent();for(r=n;i>=r;r++)t.addEditOperation(new o.Range(r,1,r,1),l)}this._selectionId=t.trackSelection(this._selection)},e.prototype.computeCursorState=function(e,t){return t.getTrackedSelection(this._selectionId)},e}();t.ShiftCommand=r});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/editor/core/controller/keyboardHandler",["require","exports","vs/editor/core/range","vs/base/dom/keyboardEvent","vs/base/dom/dom","vs/base/env","vs/editor/editor","vs/editor/core/view/viewEventHandler","vs/base/time/schedulers","vs/base/lifecycle"],function(e,t,n,i,o,r,s,a,u,l){"use strict";var h=n,d=i,c=o,p=r,f=s,m=a,g=u;" ".charCodeAt(0)," ".charCodeAt(0),"<".charCodeAt(0),">".charCodeAt(0),"&".charCodeAt(0);var v;!function(e){e._map=[],e._map[0]="Type",e.Type=0,e._map[1]="Paste",e.Paste=1}(v||(v={}));var y=function(e){function t(t,n,i,o){var r=this;e.call(this),this.context=t,this.viewController=n,this.textArea=i,this.accessiblilityOutput=o,this.selection=new h.Range(1,1,1,1),this.asyncReadFromTextArea=new g.RunOnceScheduler(null,0),this.asyncSelectTextAreaOnFocus=new g.RunOnceScheduler(function(){return r._selectTextAreaIfFocused()},0),this.asyncSetSelectionToTextArea=new g.RunOnceScheduler(function(){return r._writePlaceholderAndSelectTextArea()},0),this.asyncTriggerCut=new g.RunOnceScheduler(function(){return r._triggerCut()},0),this.lastCopiedValue=null,this.hasFocus=!1,this.justHadAPaste=!1,this.justHadACut=!1,this.lastKeyPressTime=0,this.lastCompositionEndTime=0,this.lastValueWrittenToTheTextArea="",this.kbController=new d.KeyboardController(this.textArea),this.listenersToRemove=[],this.listenersToRemove.push(this.kbController.addListener("keydown",function(e){return r._onKeyDown(e)})),this.listenersToRemove.push(this.kbController.addListener("keyup",function(e){return r._onKeyUp(e)})),this.listenersToRemove.push(this.kbController.addListener("keypress",function(e){return r._onKeyPress(e)}));var s=0;this.listenersToRemove.push(c.addListener(this.textArea,"compositionstart",function(){s++,r.asyncReadFromTextArea.cancel()})),this.listenersToRemove.push(c.addListener(this.textArea,"compositionend",function(){s--,r.lastCompositionEndTime=(new Date).getTime(),r._scheduleReadFromTextArea(v.Type)})),p.browser.isMacintosh&&this.listenersToRemove.push(c.addListener(this.textArea,"input",function(){if(r.justHadAPaste)return r.justHadAPaste=!1,void 0;if(r.justHadACut)return r.justHadACut=!1,void 0;var e=(new Date).getTime(),t=e-r.lastKeyPressTime;if(!(500>=t)){var n=e-r.lastCompositionEndTime;if(!(500>=n||s>0||r.textArea.selectionStart!==r.textArea.selectionEnd)){var i,o=r.textArea.value;if(p.browser.isChrome){var a=r.lastValueWrittenToTheTextArea.substring(1);if(o.length<=a.length)return;if(o.substring(o.length-a.length)!==a)return;i=o.substring(0,o.length-a.length)}else i=o;console.log("DEDUCED input: <<<"+i+">>>")}}})),this.listenersToRemove.push(c.addListener(this.textArea,"cut",function(e){return r._onCut(e)})),this.listenersToRemove.push(c.addListener(this.textArea,"copy",function(e){return r._onCopy(e)})),this.listenersToRemove.push(c.addListener(this.textArea,"paste",function(e){return r._onPaste(e)})),this.listenersToRemove.push(c.addListener(this.textArea,"contextmenu",function(){c.selectTextInInputElement(r.textArea),r.asyncSelectTextAreaOnFocus.cancel()})),this.previousSelectionStartLineNumber=0,this._writePlaceholderAndSelectTextArea(),this.context.addEventHandler(this)}return __extends(t,e),t.prototype.dispose=function(){this.context.removeEventHandler(this),this.listenersToRemove.forEach(function(e){e()}),this.listenersToRemove=[],this.kbController.destroy(),this.asyncReadFromTextArea.dispose(),this.asyncSelectTextAreaOnFocus.dispose(),this.asyncSetSelectionToTextArea.dispose(),this.asyncTriggerCut.dispose()},t.prototype.onViewFocusChanged=function(e){return this.hasFocus=e,this.hasFocus&&this.asyncSelectTextAreaOnFocus.schedule(),!1},t.prototype.onCursorSelectionChanged=function(e){return this.selection=e.selection,this.asyncSetSelectionToTextArea.schedule(),!1},t.prototype.setTextAreaValue=function(e,t){this.lastValueWrittenToTheTextArea=e,this.textArea.value=e,t&&this.hasFocus&&!p.isTesting()&&c.selectTextInInputElement(this.textArea)},t.prototype._onKeyDown=function(e){this.viewController.emitKeyDown(e)},t.prototype._onKeyUp=function(e){this.viewController.emitKeyUp(e)},t.prototype._onKeyPress=function(e){if(this.hasFocus){if(p.browser.isOpera&&p.browser.isWindows){if("Ctrl-X"===e.asString())return this._onCut(null),void 0;if("Ctrl-V"===e.asString())return this._onPaste(null),void 0;if("Ctrl-C"===e.asString())return this._onCopy(null),void 0}this.lastKeyPressTime=(new Date).getTime(),this._scheduleReadFromTextArea(v.Type)}},t.prototype._selectTextAreaIfFocused=function(){this.hasFocus&&c.selectTextInInputElement(this.textArea)},t.prototype._scheduleReadFromTextArea=function(e){var t=this;this.asyncSetSelectionToTextArea.cancel(),this.asyncSelectTextAreaOnFocus.cancel(),this.asyncReadFromTextArea.setRunner(function(){return t._readFromTextArea(e)}),this.asyncReadFromTextArea.schedule()},t.prototype._readFromTextArea=function(e){if(this.textArea.selectionStart===this.textArea.selectionEnd){var t=this.textArea.value;""!==t&&(this.setTextAreaValue("",!1),e===v.Type?this.executeType(t):this.executePaste(t))}this.asyncSetSelectionToTextArea.schedule()},t.prototype.executePaste=function(e){if(""!==e){var t=e===this.lastCopiedValue;this.viewController.paste("keyboard",e,t)}},t.prototype.executeType=function(e){""!==e&&this.viewController.type("keyboard",e)},t.prototype._getPlaceholderText=function(e){var t=100,n=this.selection.startLineNumber,i=this.selection.startColumn,o=this.selection.endLineNumber,r=this.selection.endColumn,s=this.context.model.getLineMaxColumn(o);this.selection.isEmpty()&&e!==n&&(i=1,r=s);var a=this.context.model.getValueInRange(new h.Range(n,1,n,i),f.EndOfLinePreference.LF);a.length>t&&(a=a.substring(a.length-t,a.length));var u=this.context.model.getValueInRange(new h.Range(o,r,o,s),f.EndOfLinePreference.LF);u.length>t&&(u=u.substring(0,t));var l=this.context.model.getValueInRange(new h.Range(n,i,o,r),f.EndOfLinePreference.LF);return l.length>2*t&&(l=l.substring(0,t)+String.fromCharCode(8230)+l.substring(l.length-t,l.length)),{pretext:a,text:l,posttext:u}},t.prototype._writePlaceholderAndSelectTextArea=function(){try{var e=this._getPlaceholderText(this.previousSelectionStartLineNumber);this.previousSelectionStartLineNumber=this.selection.startLineNumber;var t=e.pretext+e.text+e.posttext;this.textArea.value!==t&&(this.lastValueWrittenToTheTextArea=t,this.textArea.value=t),this.hasFocus&&!p.isTesting()&&this.textArea.setSelectionRange(e.pretext.length,e.pretext.length+e.text.length)}catch(n){}},t.prototype._getAccessibilityOutput=function(){var e=this.selection,t="";if(e.isEmpty()){var n=e.startLineNumber;e=new h.Range(n,1,n,this.context.model.getLineMaxColumn(n)),t="\n"}var i=this.context.model.getValueInRange(e,f.EndOfLinePreference.LF)+t;return i.substr(0,1e4)},t.prototype._onPaste=function(e){e&&e.clipboardData?(e.preventDefault(),this.executePaste(e.clipboardData.getData("text/plain"))):e&&window.clipboardData?(e.preventDefault(),this.executePaste(window.clipboardData.getData("Text"))):(this.textArea.selectionStart!==this.textArea.selectionEnd&&this.setTextAreaValue("",!1),this._scheduleReadFromTextArea(v.Paste)),this.justHadAPaste=!0},t.prototype._onCopy=function(e){this._ensureClipboardGetsEditorSelection(e)},t.prototype._triggerCut=function(){this.viewController.cut("keyboard")},t.prototype._onCut=function(e){this._ensureClipboardGetsEditorSelection(e),this.asyncTriggerCut.schedule(),this.justHadACut=!0},t.prototype._ensureClipboardGetsEditorSelection=function(e){var t=this._getPlainTextToCopy();e&&e.clipboardData?(e.clipboardData.setData("text/plain",t),e.preventDefault()):e&&window.clipboardData?(window.clipboardData.setData("Text",t),e.preventDefault()):this.setTextAreaValue(t,!0),this.lastCopiedValue=t},t.prototype._getPlainTextToCopy=function(){var e=p.browser.isWindows?"\r\n":"\n",t=p.browser.isWindows?f.EndOfLinePreference.CRLF:f.EndOfLinePreference.LF,n=this.selection;if(n.isEmpty()){var i=this.context.model.convertViewPositionToModelPosition(n.startLineNumber,1).lineNumber;return this.context.model.getModelLineContent(i)+e}return this.context.model.getValueInRange(n,t)},t}(m.ViewEventHandler);t.KeyboardHandler=y}),define("vs/editor/core/controller/mouseTarget",["require","exports","vs/editor/core/position","vs/editor/core/range","vs/editor/core/view/viewContext","vs/editor/editor"],function(e,t,n,i,o,r){"use strict";var s=n,a=i,u=o,l=r,h=function(){function e(e,t,n,i,o){"undefined"==typeof n&&(n=null),"undefined"==typeof i&&(i=null),"undefined"==typeof o&&(o=null),this.element=e,this.type=t,this.position=n,!i&&n&&(i=new a.Range(n.lineNumber,n.column,n.lineNumber,n.column)),this.range=i,this.detail=o}return e.prototype._typeToString=function(){return this.type===l.MouseTargetType.TEXTAREA?"TEXTAREA":this.type===l.MouseTargetType.GUTTER_GLYPH_MARGIN?"GUTTER_GLYPH_MARGIN":this.type===l.MouseTargetType.GUTTER_LINE_NUMBERS?"GUTTER_LINE_NUMBERS":this.type===l.MouseTargetType.GUTTER_LINE_DECORATIONS?"GUTTER_LINE_DECORATIONS":this.type===l.MouseTargetType.GUTTER_VIEW_ZONE?"GUTTER_VIEW_ZONE":this.type===l.MouseTargetType.CONTENT_TEXT?"CONTENT_TEXT":this.type===l.MouseTargetType.CONTENT_EMPTY?"CONTENT_EMPTY":this.type===l.MouseTargetType.CONTENT_VIEW_ZONE?"CONTENT_VIEW_ZONE":this.type===l.MouseTargetType.CONTENT_WIDGET?"CONTENT_WIDGET":this.type===l.MouseTargetType.OVERVIEW_RULER?"OVERVIEW_RULER":this.type===l.MouseTargetType.SCROLLBAR?"SCROLLBAR":this.type===l.MouseTargetType.OVERLAY_WIDGET?"OVERLAY_WIDGET":"UNKNOWN"},e.prototype.toString=function(){return this._typeToString()+": "+this.position+" - "+this.range+" - "+this.detail},e}(),d={IS_TEXTAREA_COVER:new RegExp("^[^/]*"+u.ClassNames.TEXTAREA_COVER+"[^/]*$"),IS_TEXTAREA:new RegExp("^"+u.ClassNames.TEXTAREA+"$"),IS_VIEW_LINES:new RegExp("^[^/]+/[^/]+/"+u.ClassNames.VIEW_LINES+"$"),IS_CHILD_OF_VIEW_LINES:new RegExp("^[^/]+/[^/]+/"+u.ClassNames.VIEW_LINES),IS_CHILD_OF_SCROLLABLE_ELEMENT:new RegExp("^[^/]*"+u.ClassNames.SCROLLABLE_ELEMENT),IS_CHILD_OF_CONTENT_WIDGETS:new RegExp("^[^/]+/[^/]+/"+u.ClassNames.CONTENT_WIDGETS),IS_CHILD_OF_OVERLAY_WIDGETS:new RegExp("^"+u.ClassNames.OVERLAY_WIDGETS),IS_CHILD_OF_LINES_DECORATIONS:new RegExp(u.ClassNames.LINES_DECORATIONS),IS_CHILD_OF_LINE_NUMBERS:new RegExp("^[^/]+/[^/]+/"+u.ClassNames.LINE_NUMBERS),IS_CHILD_OF_GLYPH_MARGIN:new RegExp("^[^/]+/[^/]+/"+u.ClassNames.GLYPH_MARGIN)},c=function(){function e(e,t){this.context=e,this.viewHelper=t}return e.prototype.getClassNamePathTo=function(e,t){for(var n,i=[];e&&e!==document.body&&e!==t;)e.nodeType===e.ELEMENT_NODE&&(n=e.className,n&&i.unshift(n)),e=e.parentNode;return i.join("/")},e.prototype.createMouseTarget=function(e,t,n){var i=Math.max(0,this.viewHelper.getScrollTop()+(t.posy-e.top)),o=this.viewHelper.getScrollLeft()+(t.posx-e.left),r=t.target,s=this.getClassNamePathTo(r,this.viewHelper.viewDomNode),a=r.hasAttribute("lineNumber")?r.getAttribute("lineNumber"):null,u=r.hasAttribute("column")?r.getAttribute("column"):null;if(a&&u)return this.createMouseTargetFromViewCursor(r,parseInt(a,10),parseInt(u,10));if(d.IS_CHILD_OF_CONTENT_WIDGETS.test(s))return this.createMouseTargetFromContentWidgetsChild(r);if(d.IS_CHILD_OF_OVERLAY_WIDGETS.test(s))return this.createMouseTargetFromOverlayWidgetsChild(r);if(d.IS_TEXTAREA_COVER.test(s))return this.context.configuration.editor.glyphMargin?this.createMouseTargetFromGlyphMargin(r,i):this.context.configuration.editor.lineNumbers?this.createMouseTargetFromLineNumbers(r,i):this.createMouseTargetFromLinesDecorationsChild(r,i);if(d.IS_TEXTAREA.test(s))return new h(r,l.MouseTargetType.TEXTAREA);if(d.IS_VIEW_LINES.test(s))return this.createMouseTargetFromViewLines(r,i);if(!n||d.IS_CHILD_OF_VIEW_LINES.test(s)){var c=this._doHitTest(e,t);if(c.position)return this.createMouseTargetFromHitTestPosition(r,c.position.lineNumber,c.position.column,o);c.hitTarget&&(r=c.hitTarget,s=this.getClassNamePathTo(r,this.viewHelper.viewDomNode))}return d.IS_CHILD_OF_SCROLLABLE_ELEMENT.test(s)?this.createMouseTargetFromScrollbar(r,i):d.IS_CHILD_OF_LINES_DECORATIONS.test(s)?this.createMouseTargetFromLinesDecorationsChild(r,i):d.IS_CHILD_OF_LINE_NUMBERS.test(s)?this.createMouseTargetFromLineNumbers(r,i):d.IS_CHILD_OF_GLYPH_MARGIN.test(s)?this.createMouseTargetFromGlyphMargin(r,i):this.createMouseTargetFromUnknownTarget(r)},e.prototype._isChild=function(e,t,n){for(;e&&e!==document.body;){if(e===t)return!0;if(e===n)return!1;e=e.parentNode}return!1},e.prototype._findAttribute=function(e,t,n){for(;e&&e!==document.body;){if(e.hasAttribute(t))return e.getAttribute(t);if(e===n)return null;e=e.parentNode}return null},e.prototype._doHitTestWithCaretRangeFromPoint=function(e,t){var n=null,i=null,o=t.posx-document.body.scrollLeft-document.documentElement.scrollLeft,r=t.posy-document.body.scrollTop-document.documentElement.scrollTop,s=document.caretRangeFromPoint(o,r),a=s?s.startContainer:null,l=a?a.parentNode:null,h=l?l.parentNode:null,d=h?h.parentNode:null,c=d&&d.nodeType===d.ELEMENT_NODE?d.className:"";return c===u.ClassNames.VIEW_LINE?n=this.viewHelper.getPositionFromDOMInfo(s.startContainer.parentNode,s.startOffset):i=l,s.detach(),{position:n,hitTarget:i}},e.prototype._doHitTestWithRangeProperties=function(e){var t,n,i=null,o=null;e.browserEvent.rangeParent?(t=e.browserEvent.rangeParent,n=e.browserEvent.rangeOffset):(t=e.extraData.rangeParent,n=e.extraData.rangeOffset);var r=document.createRange();return r.setStart(t,n),r.collapse(!0),i=this.viewHelper.getPositionFromDOMInfo(r.startContainer.parentNode,r.startOffset),r.detach(),{position:i,hitTarget:o}},e.prototype._doHitTestWithMoveToPoint=function(e){var t=null,n=null,i=document.body.createTextRange();try{var o=e.posx-document.body.scrollLeft-document.documentElement.scrollLeft,r=e.posy-document.body.scrollTop-document.documentElement.scrollTop;i.moveToPoint(o,r)}catch(s){return{position:null,hitTarget:null}}i.collapse(!0);var a=i?i.parentElement():null,l=a?a.parentNode:null,h=l?l.parentNode:null,d=h&&h.nodeType===h.ELEMENT_NODE?h.className:""; if(d===u.ClassNames.VIEW_LINE){var c=i.duplicate();c.moveToElementText(a),c.setEndPoint("EndToStart",i),t=this.viewHelper.getPositionFromDOMInfo(a,c.text.length),c.moveToElementText(this.viewHelper.viewDomNode)}else n=a;return i.moveToElementText(this.viewHelper.viewDomNode),{position:t,hitTarget:n}},e.prototype._doHitTest=function(e,t){return document.caretRangeFromPoint?this._doHitTestWithCaretRangeFromPoint(e,t):t.extraData||t.browserEvent.rangeParent?this._doHitTestWithRangeProperties(t):document.body.createTextRange?this._doHitTestWithMoveToPoint(t):{position:null,hitTarget:null}},e.prototype._getZoneAtCoord=function(e){var t=this.viewHelper.getWhitespaceAtVerticalOffset(e);if(t){var n,i,o=t.verticalOffset+t.height/2,r=this.context.model.getLineCount();t.afterLineNumber===r||o>e&&t.afterLineNumber>0?(n=t.afterLineNumber,i=this.context.model.getLineMaxColumn(n)):(n=t.afterLineNumber+1,i=1);var a=new s.Position(n,i);return{viewZoneId:t.id,position:a}}return null},e.prototype._getFullLineRangeAtCoord=function(e){var t=this.viewHelper.getLineNumberAtVerticalOffset(e),n=this.context.model.getLineMaxColumn(t);return new a.Range(t,1,t,n)},e.prototype.createMouseTargetFromViewCursor=function(e,t,n){return new h(e,l.MouseTargetType.CONTENT_TEXT,new s.Position(t,n))},e.prototype.createMouseTargetFromViewLines=function(e,t){var n=this._getZoneAtCoord(t);if(n)return new h(e,l.MouseTargetType.CONTENT_VIEW_ZONE,n.position,null,n.viewZoneId);var i=this.context.model.getLineCount(),o=this.context.model.getLineMaxColumn(i);return new h(e,l.MouseTargetType.CONTENT_EMPTY,new s.Position(i,o))},e.prototype.createMouseTargetFromHitTestPosition=function(e,t,n,i){var o=new s.Position(t,n),r=this.viewHelper.getLineWidth(t);if(i>r)return new h(e,l.MouseTargetType.CONTENT_EMPTY,o);var u=this.viewHelper.visibleRangeForPosition2(t,n).left;if(i===u)return new h(e,l.MouseTargetType.CONTENT_TEXT,o);var d;if(n>1){var c=this.viewHelper.visibleRangeForPosition2(t,n).left;if(d=!1,d=d||i>c&&u>i,d=d||i>u&&c>i){var p=new a.Range(t,n,t,n-1);return new h(e,l.MouseTargetType.CONTENT_TEXT,o,p)}}var f=this.context.model.getLineMaxColumn(t);if(f>n){var m=this.viewHelper.visibleRangeForPosition2(t,n+1);if(m){var g=this.viewHelper.visibleRangeForPosition2(t,n+1).left;if(d=!1,d=d||i>u&&g>i,d=d||i>g&&u>i){var p=new a.Range(t,n,t,n+1);return new h(e,l.MouseTargetType.CONTENT_TEXT,o,p)}}}return new h(e,l.MouseTargetType.CONTENT_TEXT,o)},e.prototype.createMouseTargetFromContentWidgetsChild=function(e){var t=this._findAttribute(e,"widgetId",this.viewHelper.viewDomNode);return t?new h(e,l.MouseTargetType.CONTENT_WIDGET,null,null,t):new h(e,l.MouseTargetType.UNKNOWN)},e.prototype.createMouseTargetFromOverlayWidgetsChild=function(e){var t=this._findAttribute(e,"widgetId",this.viewHelper.viewDomNode);return t?new h(e,l.MouseTargetType.OVERLAY_WIDGET,null,null,t):new h(e,l.MouseTargetType.UNKNOWN)},e.prototype.createMouseTargetFromLinesDecorationsChild=function(e,t){var n=this._getZoneAtCoord(t);if(n)return new h(e,l.MouseTargetType.GUTTER_VIEW_ZONE,n.position,null,n.viewZoneId);var i=this._getFullLineRangeAtCoord(t);return new h(e,l.MouseTargetType.GUTTER_LINE_DECORATIONS,new s.Position(i.startLineNumber,1),i)},e.prototype.createMouseTargetFromLineNumbers=function(e,t){var n=this._getZoneAtCoord(t);if(n)return new h(e,l.MouseTargetType.GUTTER_VIEW_ZONE,n.position,null,n.viewZoneId);var i=this._getFullLineRangeAtCoord(t);return new h(e,l.MouseTargetType.GUTTER_LINE_NUMBERS,new s.Position(i.startLineNumber,1),i)},e.prototype.createMouseTargetFromGlyphMargin=function(e,t){var n=this._getZoneAtCoord(t);if(n)return new h(e,l.MouseTargetType.GUTTER_VIEW_ZONE,n.position,null,n.viewZoneId);var i=this._getFullLineRangeAtCoord(t);return new h(e,l.MouseTargetType.GUTTER_GLYPH_MARGIN,new s.Position(i.startLineNumber,1),i)},e.prototype.createMouseTargetFromScrollbar=function(e){return new h(e,l.MouseTargetType.SCROLLBAR)},e.prototype.createMouseTargetFromUnknownTarget=function(e){var t=this._isChild(e,this.viewHelper.viewDomNode,this.viewHelper.viewDomNode),n=null;return t&&(n=this._findAttribute(e,"widgetId",this.viewHelper.viewDomNode)),n?new h(e,l.MouseTargetType.OVERLAY_WIDGET,null,null,n):new h(e,l.MouseTargetType.UNKNOWN)},e}();t.MouseTargetFactory=c});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/editor/core/controller/mouseHandler",["require","exports","vs/base/env","vs/editor/core/position","vs/base/dom/mouseEvent","vs/base/dom/dom","vs/editor/editor","vs/editor/core/controller/mouseTarget","vs/editor/core/view/viewEventHandler","vs/base/lifecycle"],function(e,t,n,i,o,r,s,a,u,l){"use strict";var h=n,d=i,c=o,p=r,f=s,m=a,g=u,v=l,y=function(e,t){var n=null;t.rangeParent&&(n={rangeParent:t.rangeParent,rangeOffset:t.rangeOffset});var i=new c.MouseEvent(t,n);return i.preventDefault(),i},C=function(e){function t(n,i,o){var r=this;e.call(this),this.context=n,this.viewController=i,this.viewHelper=o,this.mouseTargetFactory=new m.MouseTargetFactory(this.context,o),this.listenersToRemove=[],this.hideTextAreaTimeout=-1,this._hookUnbind=[],this._hookDispose=[],this.lastMouseEvent=null,this.lastMouseDownPosition=null,this.lastMouseDownPositionEqualCount=0,this.lastMouseDownCount=0,this.lastSetMouseDownCountTime=0,this.onScrollTimeout=-1,this.layoutWidth=0,this.layoutHeight=0,this.listenersToRemove.push(p.addListener(this.viewHelper.viewDomNode,"contextmenu",function(e){return r._onContextMenu(e)})),this.listenersToRemove.push(p.addThrottledListener(this.viewHelper.viewDomNode,"mousemove",function(e){return r._onMouseMove(e)},y,t.MOUSE_MOVE_MINIMUM_TIME)),this.listenersToRemove.push(p.addListener(this.viewHelper.viewDomNode,"mouseup",function(e){return r._onMouseUp(e)})),this.listenersToRemove.push(p.addNonBubblingMouseOutListener(this.viewHelper.viewDomNode,function(e){return r._onMouseLeave(e)})),this.listenersToRemove.push(p.addListener(this.viewHelper.viewDomNode,"mousedown",function(e){return r._onMouseDown(e)})),h.browser.isIE8&&(this.listenersToRemove.push(p.addListener(this.viewHelper.viewDomNode,"dblclick",function(e){return r._onIE8DblClick(e)})),this.listenersToRemove.push(p.addListener(this.viewHelper.viewDomNode,"mouseup",function(e){var t=new c.MouseEvent(e),n=p.getDomNodePosition(r.viewHelper.linesContentDomNode),i=r.mouseTargetFactory.createMouseTarget(n,t,!0);(i.type===f.MouseTargetType.CONTENT_EMPTY||i.type===f.MouseTargetType.CONTENT_TEXT)&&r.viewHelper.textArea.focus()}))),this.context.addEventHandler(this)}return __extends(t,e),t.CLEAR_MOUSE_DOWN_COUNT_TIME=400,t.MOUSE_MOVE_MINIMUM_TIME=100,t.prototype.dispose=function(){this.context.removeEventHandler(this),this.listenersToRemove.forEach(function(e){e()}),this.listenersToRemove=[],this._unhook(),-1!==this.hideTextAreaTimeout&&(window.clearTimeout(this.hideTextAreaTimeout),this.hideTextAreaTimeout=-1)},t.prototype.onLayoutChanged=function(){return!1},t.prototype.onScrollChanged=function(e){return(this._hookUnbind.length>0||this._hookDispose.length>0)&&this._hookedOnScroll(e),!1},t.prototype._onContextMenu=function(e){var t=new c.MouseEvent(e),n=p.getDomNodePosition(this.viewHelper.linesContentDomNode),i=this.mouseTargetFactory.createMouseTarget(n,t,!0),o={event:t,target:i};this.viewController.emitContextMenu(o)},t.prototype._onMouseMove=function(e){if(0===this._hookUnbind.length&&0===this._hookDispose.length){var t=p.getDomNodePosition(this.viewHelper.linesContentDomNode),n=this.mouseTargetFactory.createMouseTarget(t,e,!0),i={event:e,target:n};this.viewController.emitMouseMove(i)}},t.prototype._onMouseLeave=function(e){var t={event:new c.MouseEvent(e),target:null};this.viewController.emitMouseLeave(t)},t.prototype._onMouseUp=function(e){var t=new c.MouseEvent(e),n=p.getDomNodePosition(this.viewHelper.linesContentDomNode),i=this.mouseTargetFactory.createMouseTarget(n,t,!0),o={event:t,target:i};this.viewController.emitMouseUp(o)},t.prototype._onMouseDown=function(e){var t=this,n=new c.MouseEvent(e),i=p.getDomNodePosition(this.viewHelper.linesContentDomNode),o=this.mouseTargetFactory.createMouseTarget(i,n,!0),r=o.type===f.MouseTargetType.CONTENT_TEXT||o.type===f.MouseTargetType.CONTENT_EMPTY,s=o.type===f.MouseTargetType.GUTTER_GLYPH_MARGIN||o.type===f.MouseTargetType.GUTTER_LINE_NUMBERS||o.type===f.MouseTargetType.GUTTER_LINE_DECORATIONS,a=o.type===f.MouseTargetType.GUTTER_LINE_NUMBERS,u=this.context.configuration.editor.selectOnLineNumbers;n.leftButton&&(r||a&&u)?(h.browser.isIE?n.browserEvent.fromElement?(n.preventDefault(),this.viewHelper.textArea.focus()):setTimeout(function(){t.viewHelper.textArea.focus()}):(n.preventDefault(),this.viewHelper.textArea.focus()),this._updateMouse(o.type,n,n.shiftKey,n.detail),this._hook(o.type)):s&&n.preventDefault();var l={event:n,target:o};this.viewController.emitMouseDown(l)},t.prototype._onIE8DblClick=function(e){var t=new c.MouseEvent(e),n=p.getDomNodePosition(this.viewHelper.linesContentDomNode),i=this.mouseTargetFactory.createMouseTarget(n,t,!0);(i.type===f.MouseTargetType.CONTENT_TEXT||i.type===f.MouseTargetType.CONTENT_EMPTY)&&(this._updateMouse(i.type,t,t.shiftKey,t.detail),t.preventDefault(),this.viewHelper.textArea.focus())},t.prototype._hookedOnScroll=function(){var e=this;-1===this.onScrollTimeout&&(this.onScrollTimeout=window.setTimeout(function(){e.onScrollTimeout=-1,e._updateMouse(e._hookStartTargetType,null,!0)},10))},t.prototype._hookedOnDocumentMouseMove=function(e){this._updateMouse(this._hookStartTargetType,e,!0)},t.prototype._hookedOnDocumentMouseUp=function(e){var t=new c.MouseEvent(e);t.leftButton&&this._unhook()},t.prototype._hook=function(e){var t=this;this._hookUnbind.length>0||this._hookDispose.length>0||(this._hookStartTargetType=e,this._hookUnbind.push(p.addThrottledListener(document,"mousemove",function(e){return t._hookedOnDocumentMouseMove(e)},y)),this._hookUnbind.push(p.addListener(document,"mouseup",function(e){return t._hookedOnDocumentMouseUp(e)})),h.isInIframe()&&(this._hookUnbind.push(p.addListener(document,"mouseout",function(e){var n=new c.MouseEvent(e);"html"===n.target.tagName.toLowerCase()&&t._unhook()})),this._hookUnbind.push(p.addListener(document,"mouseover",function(e){var n=new c.MouseEvent(e);"html"===n.target.tagName.toLowerCase()&&t._unhook()})),this._hookUnbind.push(p.addListener(document.body,"mouseleave",function(){t._unhook()}))))},t.prototype._unhook=function(){this._hookUnbind.forEach(function(e){e()}),this._hookUnbind=[],this._hookDispose=v.disposeAll(this._hookDispose),-1!==this.onScrollTimeout&&(window.clearTimeout(this.onScrollTimeout),this.onScrollTimeout=-1)},t.prototype._getPositionOutsideEditor=function(e,t){var n;return t.posye.top+e.height?(n=this.viewHelper.getLineNumberAtVerticalOffset(this.viewHelper.getScrollTop()+(t.posy-e.top)),{lineNumber:n,column:this.context.model.getLineMaxColumn(n)}):(n=this.viewHelper.getLineNumberAtVerticalOffset(this.viewHelper.getScrollTop()+(t.posy-e.top)),t.posxe.left+e.width?{lineNumber:n,column:this.context.model.getLineMaxColumn(n)}:null)},t.prototype._updateMouse=function(e,n,i,o){"undefined"==typeof o&&(o=0),n=n||this.lastMouseEvent,this.lastMouseEvent=n;var r,s,a=p.getDomNodePosition(this.viewHelper.viewDomNode),u=this._getPositionOutsideEditor(a,n);if(u)r=u.lineNumber,s=u.column;else{var l=this.mouseTargetFactory.createMouseTarget(a,n,!0),h=l.position;if(!h)return;r=h.lineNumber,s=h.column}if(o){var c=(new Date).getTime();c-this.lastSetMouseDownCountTime>t.CLEAR_MOUSE_DOWN_COUNT_TIME&&(o=1),this.lastSetMouseDownCountTime=c,o>this.lastMouseDownCount+1&&(o=this.lastMouseDownCount+1);var m=new d.Position(r,s);this.lastMouseDownPosition&&this.lastMouseDownPosition.equals(m)?this.lastMouseDownPositionEqualCount++:this.lastMouseDownPositionEqualCount=1,this.lastMouseDownPosition=m,this.lastMouseDownCount=Math.min(o,this.lastMouseDownPositionEqualCount),n.detail=this.lastMouseDownCount}if(e===f.MouseTargetType.GUTTER_LINE_NUMBERS)n.altKey?i?this.viewController.lastCursorLineSelect("mouse",r,s):this.viewController.createCursor("mouse",r,s,!0):i?this.viewController.lineSelectDrag("mouse",r,s):this.viewController.lineSelect("mouse",r,s);else if(this.lastMouseDownCount>=4)this.viewController.selectAll("mouse");else if(3===this.lastMouseDownCount)n.altKey?this.viewController.lastCursorLineSelect("mouse",r,s):i?this.viewController.lineSelectDrag("mouse",r,s):this.viewController.lineSelect("mouse",r,s);else if(2===this.lastMouseDownCount){var g=a.left+this.viewHelper.visibleRangeForPosition2(r,s).left,v="none";n.posx>g?v="right":n.posxi||i>=this._lines.length)return null;var o=this._lines[i].getColumnOfNodeOffset(n,e,t);return{lineNumber:n,column:o}},t.prototype._getLineNumberFromDOMInfo=function(e){for(;e&&1===e.nodeType;){if(e.className===l.ClassNames.VIEW_LINE)return parseInt(e.getAttribute("lineNumber"),10);e=e.parentElement}return-1},t.prototype.getLineWidth=function(e){var t=e-this._rendLineNumberStart;return 0>t||t>=this._lines.length?-1:this._lines[t].getWidth()},t.prototype.getInnerSpansTopOffset=function(e){var t=e-this._rendLineNumberStart;return 0>t||t>=this._lines.length?0:this._lines[t].getInnerSpansTopOffset()},t.prototype.visibleRangesForRange2=function(e,n,i,o){if(this.shouldRender)return null;var r=e.endLineNumber;if(e=h.RangeUtils.intersectRanges(e,this._currentVisibleRange),!e)return null;var s,a,u,l,d,p=[],f=this.domNode.getBoundingClientRect(),m=f.top-n,g=f.left;for(a=e.startLineNumber;a<=e.endLineNumber;a++)u=a-this._rendLineNumberStart,0>u||u>=this._lines.length||(l=a===e.startLineNumber?e.startColumn:1,d=a===e.endLineNumber?e.endColumn:this._context.model.getLineMaxColumn(a),s=this._lines[u].getVisibleRangesForRange(a,l,d,m,i,g,this._guardElement),s&&s.length>0&&(o&&r>a&&(s[s.length-1].width+=t.LINE_FEED_WIDTH),p=p.concat(s)));return 0===p.length?null:new c(p)},t.prototype._createLine=function(e){return a.createLine(this._context,e)},t.prototype._renderAndUpdateLineHeights=function(t){e.prototype._renderLines.call(this,t),this._currentVisibleRange=new h.Range(0+this._rendLineNumberStart,1,this._lines.length-1+this._rendLineNumberStart,this._context.model.getLineMaxColumn(this._lines.length-1+this._rendLineNumberStart));var n=t.visibleRangesDeltaTop+"px";if(this.domNode.style.top!==n&&(this.domNode.style.top=n),this._lastCursorRevealRangeHorizontallyEvent){var i=this.computeScrollLeftToRevealRange(this._lastCursorRevealRangeHorizontallyEvent.range);this._lastCursorRevealRangeHorizontallyEvent=null;var o=this._context.configuration.getWrappingColumn(),r=0===o;this._context.configuration.editor.viewWordWrap||r||this._ensureMaxLineWidth(i.maxHorizontalOffset),this._layoutProvider.setScrollLeft(i.scrollLeft)}var s,a,u=[],l=this._context.configuration.editor.lineHeight,d=!1;for(a=0;athis._lastCursorRevealRangeVerticallyEvent.range.endLineNumber?this._lastCursorRevealRangeVerticallyEvent.range.endLineNumber:this._lastCursorRevealRangeVerticallyEvent.range.startLineNumber);var t=this._layoutProvider.getLinesViewportData(e);if(!this.shouldRender)return t.visibleRange=this._currentVisibleRange,t;if(this.shouldRender=!1,this._renderAndUpdateLineHeights(t),this._lastCursorRevealRangeVerticallyEvent){var n=this.computeScrollTopToRevealRange(this._layoutProvider.getCurrentViewport(),this._lastCursorRevealRangeVerticallyEvent.range,this._lastCursorRevealRangeVerticallyEvent.revealVerticalInCenter);this._lastCursorRevealRangeVerticallyEvent=null;var i=this._layoutProvider.getScrollTop();i!==n.newScrollTop&&(this._layoutProvider.setScrollTop(n.newScrollTop),t=this._layoutProvider.getLinesViewportData(0),this.shouldRender=!1,this._renderAndUpdateLineHeights(t))}return this._asyncUpdateLineWidths.schedule(),t.visibleRange=this._currentVisibleRange,t},t.prototype._ensureMaxLineWidth=function(e){this._maxLineWidthu&&(u=s.getLeft()+s.getWidth());n=u,a=Math.max(0,a-t.HORIZONTAL_EXTRA_PX),u+=t.HORIZONTAL_EXTRA_PX;var l=this.computeMinimumScrolling(o,r,a,u);return{scrollLeft:l,maxHorizontalOffset:n}},t.prototype.computeMinimumScrolling=function(e,t,n,i){var o=t-e,r=i-n;return o>r?e>n?n:i>t?Math.max(0,i-o):e:n},t}(u.ViewLayer);t.ViewLines=p}),define("vs/editor/core/view/model/viewModelDecorations",["require","exports","vs/editor/editor","vs/editor/core/range","vs/editor/core/view/viewContext","vs/base/lifecycle"],function(e,t,n,i,o,r){"use strict";var s=i,a=o,u=function(){function e(e,t,n){this.editorId=e,this.configuration=t,this.converter=n,this.decorations=[]}return e.prototype.dispose=function(){this.converter=null,this.decorations=null},e.compareDecorations=function(e,t){return s.RangeUtils.compareRangesUsingStarts(e.range,t.range)},e.prototype.reset=function(t){var n,i,o,r,s=t.getAllDecorations(this.editorId,this.configuration.editor.readOnly);for(this.decorations=[],n=0,i=s.length;i>n;n++)o=s[n],r={id:o.id,options:o.options,ownerId:o.ownerId,modelRange:o.range,range:this.converter.convertModelRangeToViewRange(o.range)},this.decorations[n]=r;this.decorations.sort(e.compareDecorations)},e.prototype.onModelDecorationsChanged=function(t,n){var i,o,r,s=!1,u={},l={},h=this.configuration.editor.readOnly;for(o=0,r=t.addedOrChangedDecorations.length;r>o;o++)i=t.addedOrChangedDecorations[o],h&&i.isForValidation||i.ownerId&&i.ownerId!==this.editorId||(l[i.id]=i);for(o=0,r=t.removedDecorations.length;r>o;o++)u[t.removedDecorations[o]]=!0;var d,c={};for(o=0,r=this.decorations.length;r>o;o++)d=this.decorations[o],l.hasOwnProperty(d.id)&&(c[d.id]=!0,i=l[d.id],d.options=i.options,d.modelRange=i.range,d.range=this.converter.convertModelRangeToViewRange(i.range),s=!0),u.hasOwnProperty(d.id)&&(this.decorations.splice(o,1),r--,o--,s=!0);var p;for(p in l)!c.hasOwnProperty(p)&&l.hasOwnProperty(p)&&(i=l[p],d={id:i.id,options:i.options,ownerId:i.ownerId,modelRange:i.range,range:this.converter.convertModelRangeToViewRange(i.range)},this.decorations.push(d),s=!0);if(s){this.decorations.sort(e.compareDecorations);var f=null;n(a.EventNames.DecorationsChangedEvent,f)}},e.prototype.onLineMappingChanged=function(t){var n,i,o,r,u=this.decorations,l=!1;for(i=0,r=u.length;r>i;i++)n=u[i],o=this.converter.convertModelRangeToViewRange(n.modelRange),l||s.RangeUtils.equalsRange(o,n.range)||(l=!0),n.range=o;if(l){this.decorations.sort(e.compareDecorations);var h=null;t(a.EventNames.DecorationsChangedEvent,h)}},e.prototype.getAllDecorations=function(){return this.decorations},e.prototype.getInlineDecorations=function(e){return this.getDecorationsInLines(e,e,!0)},e.prototype.getDecorationsInRange=function(e){return this.getDecorationsInLines(e.startLineNumber,e.endLineNumber,!1)},e.prototype.getDecorationsInLines=function(e,t,n){var i,o,r,s,a=[],u=0,l=this.decorations;for(r=0,s=l.length;s>r&&(i=l[r],o=i.range,!(o.startLineNumber>t));r++)o.endLineNumberi&&(n=n.clone(),n.column=i);for(var o=[],s=0,a=e.secondaryPositions.length;a>s;s++)o[s]=this.converter.validateViewPosition(e.secondaryViewPositions[s].lineNumber,e.secondaryViewPositions[s].column,e.secondaryPositions[s]),-1!==i&&o[s].column>i&&(o[s]=o[s].clone(),o[s].column=i);var u={position:n,secondaryPositions:o,isInEditableRange:e.isInEditableRange};t(r.EventNames.CursorPositionChangedEvent,u)},e.prototype.onCursorSelectionChanged=function(e,t){this.lastCursorSelectionChangedEvent=e;for(var n=this.converter.convertModelSelectionToViewSelection(e.selection),i=[],o=0,s=e.secondarySelections.length;s>o;o++)i[o]=this.converter.convertModelSelectionToViewSelection(e.secondarySelections[o]);var a={selection:n,secondarySelections:i};t(r.EventNames.CursorSelectionChangedEvent,a)},e.prototype.onCursorRevealRange=function(e,t){var n=null;if(e.viewRange){var i=this.converter.validateViewPosition(e.viewRange.startLineNumber,e.viewRange.startColumn,e.range.getStartPosition()),s=this.converter.validateViewPosition(e.viewRange.endLineNumber,e.viewRange.endColumn,e.range.getEndPosition());n=new o.Range(i.lineNumber,i.column,s.lineNumber,s.column)}else n=this.converter.convertModelRangeToViewRange(e.range);var a={range:n,revealVerticalInCenter:e.revealVerticalInCenter,revealHorizontal:e.revealHorizontal};t(r.EventNames.RevealRangeEvent,a)},e.prototype.onLineMappingChanged=function(e){this.lastCursorPositionChangedEvent&&this.onCursorPositionChanged(this.lastCursorPositionChangedEvent,e),this.lastCursorSelectionChangedEvent&&this.onCursorSelectionChanged(this.lastCursorSelectionChangedEvent,e)},e}();t.ViewModelCursors=s});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/editor/core/selection",["require","exports","vs/editor/core/range","vs/editor/editor"],function(e,t,n,i){"use strict";function o(e){return e&&"number"==typeof e.selectionStartLineNumber&&"number"==typeof e.selectionStartColumn&&"number"==typeof e.positionLineNumber&&"number"==typeof e.positionColumn}function r(e,t,n,i,o){return o===a.SelectionDirection.LTR?new u(e,t,n,i):new u(n,i,e,t)}var s=n,a=i;t.isISelection=o,t.createWithDirection=r;var u=function(e){function t(t,n,i,o){this.selectionStartLineNumber=t,this.selectionStartColumn=n,this.positionLineNumber=i,this.positionColumn=o,e.call(this,t,n,i,o)}return __extends(t,e),t.prototype.clone=function(){return new t(this.selectionStartLineNumber,this.selectionStartColumn,this.positionLineNumber,this.positionColumn)},t.prototype.equalsSelection=function(e){return this.selectionStartLineNumber===e.selectionStartLineNumber&&this.selectionStartColumn===e.selectionStartColumn&&this.positionLineNumber===e.positionLineNumber&&this.positionColumn===e.positionColumn},t.prototype.getDirection=function(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?a.SelectionDirection.LTR:a.SelectionDirection.RTL},t.prototype.setEndPosition=function(e,n){return this.getDirection()===a.SelectionDirection.LTR?new t(this.startLineNumber,this.startColumn,e,n):new t(e,n,this.startLineNumber,this.startColumn)},t.prototype.setStartPosition=function(e,n){return this.getDirection()===a.SelectionDirection.LTR?new t(e,n,this.endLineNumber,this.endColumn):new t(this.endLineNumber,this.endColumn,e,n)},t}(s.Range);t.Selection=u});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/editor/core/command/replaceCommand",["require","exports","vs/editor/editor","vs/editor/core/selection"],function(e,t,n,i){"use strict";var o=i,r=function(){function e(e,t){this._range=e,this._text=t}return e.prototype.getEditOperations=function(e,t){t.addEditOperation(this._range,this._text)},e.prototype.computeCursorState=function(e,t){var n=t.getInverseEditOperations(),i=n[0].range;return new o.Selection(i.endLineNumber,i.endColumn,i.endLineNumber,i.endColumn)},e}();t.ReplaceCommand=r;var s=function(e){function t(t,n){e.call(this,t,n)}return __extends(t,e),t.prototype.computeCursorState=function(e,t){var n=t.getInverseEditOperations(),i=n[0].range;return new o.Selection(i.startLineNumber,i.startColumn,i.startLineNumber,i.startColumn)},t}(r);t.ReplaceCommandWithoutChangingPosition=s;var a=function(e){function t(t,n,i,o){e.call(this,t,n),this._columnDeltaOffset=o,this._lineNumberDeltaOffset=i}return __extends(t,e),t.prototype.computeCursorState=function(e,t){var n=t.getInverseEditOperations(),i=n[0].range;return new o.Selection(i.endLineNumber+this._lineNumberDeltaOffset,i.endColumn+this._columnDeltaOffset,i.endLineNumber+this._lineNumberDeltaOffset,i.endColumn+this._columnDeltaOffset) },t}(r);t.ReplaceCommandWithOffsetCursorState=a;var u=function(e){function t(t,n,i){e.call(this,t,n),this._initialSelection=i}return __extends(t,e),t.prototype.getEditOperations=function(t,n){e.prototype.getEditOperations.call(this,t,n),this._selectionId=n.trackSelection(this._initialSelection)},t.prototype.computeCursorState=function(e,t){return t.getTrackedSelection(this._selectionId)},t}(r);t.ReplaceCommandThatPreservesSelection=u}),define("vs/editor/core/command/surroundSelectionCommand",["require","exports","vs/editor/core/range","vs/editor/editor","vs/editor/core/selection"],function(e,t,n,i,o){"use strict";var r=n,s=o,a=function(){function e(e,t,n){this._range=e,this._charBeforeSelection=t,this._charAfterSelection=n}return e.prototype.getEditOperations=function(e,t){t.addEditOperation(new r.Range(this._range.startLineNumber,this._range.startColumn,this._range.startLineNumber,this._range.startColumn),this._charBeforeSelection),t.addEditOperation(new r.Range(this._range.endLineNumber,this._range.endColumn,this._range.endLineNumber,this._range.endColumn),this._charAfterSelection)},e.prototype.computeCursorState=function(e,t){var n=t.getInverseEditOperations(),i=n[0].range,o=n[1].range;return new s.Selection(i.endLineNumber,i.endColumn,o.endLineNumber,o.endColumn-this._charAfterSelection.length)},e}();t.SurroundSelectionCommand=a}),define("vs/editor/core/controller/oneCursor",["require","exports","vs/base/strings","vs/editor/modes/modes","vs/editor/core/position","vs/editor/core/range","vs/editor/core/command/shiftCommand","vs/editor/core/command/replaceCommand","vs/editor/core/command/surroundSelectionCommand","vs/editor/core/selection","vs/base/errors","vs/editor/core/controller/cursorMoveHelper"],function(e,t,n,i,o,r,s,a,u,l,h,d){"use strict";var c=n,p=i,f=o,m=r,g=s,v=a,y=u,C=l,_=h,b=d,w=function(){function e(e,t,n,i,o){this.editorId=e,this.model=t,this.configuration=n,this.modeConfiguration=i,this.viewModelHelper=o,this.helper=new E(this.model,this.configuration),this.position=new f.Position(1,1),this.viewPosition=new f.Position(1,1),this.positionMarkerId=null,this.inSelectionMode=!1,this.selectionStart=null,this.viewSelectionStart=null,this.selStartMarkerId=null,this.selEndMarkerId=null,this.leftoverVisibleColumns=0,this.bracketDecorations=[],this._cachedSelection=null,this._cachedViewSelection=null,this.setSelection(new C.Selection(1,1,1,1))}return e.prototype.dispose=function(){this.positionMarkerId&&(this.model._removeMarker(this.positionMarkerId),this.positionMarkerId=null),this.selStartMarkerId&&(this.model._removeMarker(this.selStartMarkerId),this.selStartMarkerId=null),this.selEndMarkerId&&(this.model._removeMarker(this.selEndMarkerId),this.selEndMarkerId=null),this.bracketDecorations=this.model.deltaDecorations(this.bracketDecorations,[],this.editorId)},e.prototype.adjustBracketDecorations=function(){var e=null,t=this.getSelection();t.isEmpty()&&!this.configuration.editor.readOnly&&(e=this.model.matchBracket(this.position,!0));var n=[];if(e&&e.brackets){var i={isOverlay:!1,className:"bracket-match"};n.push({range:e.brackets[0],options:i}),n.push({range:e.brackets[1],options:i})}this.bracketDecorations=this.model.deltaDecorations(this.bracketDecorations,n,this.editorId)},e.computeSelection=function(e,t,n){var i,o,r,s;return e?t.isEmpty()?(i=t.startLineNumber,o=t.startColumn,r=n.lineNumber,s=n.column):n.isBeforeOrEqual(t.getStartPosition())?(i=t.endLineNumber,o=t.endColumn,r=n.lineNumber,s=n.column):(i=t.startLineNumber,o=t.startColumn,r=n.lineNumber,s=n.column):(i=n.lineNumber,o=n.column,r=n.lineNumber,s=n.column),new C.Selection(i,o,r,s)},e.prototype.getSelection=function(){return this._cachedSelection||(this._cachedSelection=e.computeSelection(this.inSelectionMode,this.selectionStart,this.position)),this._cachedSelection},e.prototype.getViewSelection=function(){return this._cachedViewSelection||(this._cachedViewSelection=e.computeSelection(this.inSelectionMode,this.viewSelectionStart,this.viewPosition)),this._cachedViewSelection},e.prototype.setSelection=function(e){var t=this.model.validatePosition({lineNumber:e.selectionStartLineNumber,column:e.selectionStartColumn}),n=this.model.validatePosition({lineNumber:e.positionLineNumber,column:e.positionColumn});t.equals(n)?this._stopSelectionMode():this._startSelectionModeFromPosition(t,this.viewModelHelper.convertModelPositionToViewPosition(t.lineNumber,t.column));var i=this.viewModelHelper.convertModelPositionToViewPosition(n.lineNumber,n.column);this._setPosition(n.lineNumber,n.column,i.lineNumber,i.column)},e.prototype.getPosition=function(){return this.position},e.prototype.getViewPosition=function(){return this.viewPosition},e.prototype._getValidViewPosition=function(){return this.viewModelHelper.validateViewPosition(this.viewPosition.lineNumber,this.viewPosition.column,this.position)},e.prototype._setPosition=function(e,t,n,i,o){"undefined"==typeof o&&(o=0),this.position=new f.Position(e,t),this.viewPosition=new f.Position(n,i),this.leftoverVisibleColumns=o,this._cachedSelection=null,this._cachedViewSelection=null,this.positionMarkerId?this.model._changeMarker(this.positionMarkerId,this.position.lineNumber-1,this.position.column):this.positionMarkerId=this.model._addMarker(this.position.lineNumber-1,this.position.column,"")},e.prototype._startSelectionModeFromPosition=function(e,t){this.inSelectionMode=!0,this.selectionStart=new m.Range(e.lineNumber,e.column,e.lineNumber,e.column),this.viewSelectionStart=new m.Range(t.lineNumber,t.column,t.lineNumber,t.column),this._cachedSelection=null,this._cachedViewSelection=null,this._ensureSelectionMarkers()},e.prototype._startSelectionModeFromRange=function(e,t){this.inSelectionMode=!0,this.selectionStart=e,this.viewSelectionStart=t,this._cachedSelection=null,this._cachedViewSelection=null,this._ensureSelectionMarkers()},e.prototype._stopSelectionMode=function(){this.inSelectionMode=!1,this.selectionStart=null,this.viewSelectionStart=null,this._cachedSelection=null,this._cachedViewSelection=null,this._ensureSelectionMarkers()},e.prototype._ensureSelectionMarkers=function(){this.inSelectionMode?(this.selStartMarkerId?this.model._changeMarker(this.selStartMarkerId,this.selectionStart.startLineNumber-1,this.selectionStart.startColumn):this.selStartMarkerId=this.model._addMarker(this.selectionStart.startLineNumber-1,this.selectionStart.startColumn,""),this.selEndMarkerId?this.model._changeMarker(this.selEndMarkerId,this.selectionStart.endLineNumber-1,this.selectionStart.endColumn):this.selEndMarkerId=this.model._addMarker(this.selectionStart.endLineNumber-1,this.selectionStart.endColumn,"")):(this.selStartMarkerId&&(this.model._removeMarker(this.selStartMarkerId),this.selStartMarkerId=null),this.selEndMarkerId&&(this.model._removeMarker(this.selEndMarkerId),this.selEndMarkerId=null))},e.prototype._moveModelPosition=function(e,t,n,i,o,r,s){var a=this.viewModelHelper.convertModelPositionToViewPosition(i,o);this._actualMove(e,t,n,i,o,a.lineNumber,a.column,r,s)},e.prototype._moveViewPosition=function(e,t,n,i,o,r,s){var a=this.viewModelHelper.convertViewToModelPosition(i,o);this._actualMove(e,t,n,a.lineNumber,a.column,i,o,r,s)},e.prototype._actualMove=function(e,t,n,i,o,r,s,a,u){if(t&&(e.cursorPositionChangeReason=t),n&&!this.inSelectionMode?this._startSelectionModeFromPosition(this.position,this.viewPosition):!n&&this.inSelectionMode&&this._stopSelectionMode(),u){var l=this.model.getEditableRange();il.endLineNumber||i===l.endLineNumber&&o>l.endColumn)&&(i=l.endLineNumber,o=l.endColumn)}this._setPosition(i,o,r,s,a)},e.prototype.recoverSelectionFromMarkers=function(e){e.cursorPositionChangeReason="recoverFromMarkers",e.shouldPushStackElementBefore=!0,e.shouldPushStackElementAfter=!0,e.shouldReveal=!1,e.shouldRevealHorizontal=!1;var t=this.model._getMarker(this.positionMarkerId),n=new f.Position(t.lineNumber,t.column),i=null,o=null,r=null,s=null;if(this.selStartMarkerId&&this.selEndMarkerId){var a=this.model._getMarker(this.selStartMarkerId),u=this.model._getMarker(this.selEndMarkerId);if(i=new m.Range(a.lineNumber,a.column,u.lineNumber,u.column),i.isEmpty())r=new f.Position(i.startLineNumber,i.startColumn),i=null,r.equals(n)?r=null:s=this.viewModelHelper.convertModelPositionToViewPosition(r.lineNumber,r.column);else{var l=this.viewModelHelper.convertModelPositionToViewPosition(i.startLineNumber,i.startColumn),h=this.viewModelHelper.convertModelPositionToViewPosition(i.endLineNumber,i.endColumn);o=new m.Range(l.lineNumber,l.column,h.lineNumber,h.column)}}i?this._startSelectionModeFromRange(i,o):r?this._startSelectionModeFromPosition(r,s):this._stopSelectionMode();var d=this.viewModelHelper.convertModelPositionToViewPosition(n.lineNumber,n.column);return this._setPosition(n.lineNumber,n.column,d.lineNumber,d.column),!0},e.prototype.jumpToBracket=function(e){var t=this.bracketDecorations.length;if(2!==t)return!1;for(var n=0;2>n;n++){var i=this.model.getDecorationRange(this.bracketDecorations[n]),o=this.model.getDecorationRange(this.bracketDecorations[1-n]);if(S.isPositionAtRangeEdges(this.position,i)||S.isPositionInsideRange(this.position,i))return this._moveModelPosition(e,null,!1,o.startLineNumber,o.startColumn,0,!1),!0}return!1},e.prototype.moveTo=function(e,t,n,i,o){var r,s=this.model.validatePosition(t);r=n?this.viewModelHelper.validateViewPosition(n.lineNumber,n.column,s):this.viewModelHelper.convertModelPositionToViewPosition(s.lineNumber,s.column);var a="mouse"===i?"explicit":null;return"api"===i&&(o.shouldRevealVerticalInCenter=!0),this._moveViewPosition(o,a,e,r.lineNumber,r.column,0,!1),!0},e.prototype.moveLeft=function(e,t){var n,i;if(this.inSelectionMode&&!e){var o=this.getViewSelection(),r=this.viewModelHelper.validateViewPosition(o.startLineNumber,o.startColumn,this.getSelection().getStartPosition());n=r.lineNumber,i=r.column}else{var s=this._getValidViewPosition(),a=this.helper.getLeftOfPosition(this.viewModelHelper.viewModel,s.lineNumber,s.column);n=a.lineNumber,i=a.column}return this._moveViewPosition(t,"explicit",e,n,i,0,!0),!0},e.prototype.moveWordLeft=function(e,t){var n=this.position.lineNumber,i=this.position.column,o=!1;1===i&&n>1&&(o=!0,n-=1,i=this.model.getLineMaxColumn(n));var r=this.helper.findWord(new f.Position(n,i),"left",!0);return i=r?o||i>r.end+1?r.end+1:r.start+1:1,this._moveModelPosition(t,"explicit",e,n,i,0,!0),!0},e.prototype.moveRight=function(e,t){var n,i;if(this.inSelectionMode&&!e){var o=this.getViewSelection(),r=this.viewModelHelper.validateViewPosition(o.endLineNumber,o.endColumn,this.getSelection().getEndPosition());n=r.lineNumber,i=r.column}else{var s=this._getValidViewPosition(),a=this.helper.getRightOfPosition(this.viewModelHelper.viewModel,s.lineNumber,s.column);n=a.lineNumber,i=a.column}return this._moveViewPosition(t,"explicit",e,n,i,0,!0),!0},e.prototype.moveWordRight=function(e,t){var n=this.position.lineNumber,i=this.position.column,o=!1;i===this.model.getLineMaxColumn(n)&&n=o&&(o=1),r>=h&&(r=h)}var d=new m.Range(u.lineNumber,o,u.lineNumber,r),c=this.viewModelHelper.convertModelPositionToViewPosition(u.lineNumber,o),p=this.viewModelHelper.convertModelPositionToViewPosition(u.lineNumber,r);this._startSelectionModeFromRange(d,new m.Range(c.lineNumber,c.column,p.lineNumber,p.column)),s=d.endLineNumber,a=d.endColumn}i.cursorPositionChangeReason="explicit";var f=this.viewModelHelper.convertModelPositionToViewPosition(s,a);return this._setPosition(s,a,f.lineNumber,f.column,0),!0},e.prototype.cancelSelection=function(){return this.inSelectionMode?(this._stopSelectionMode(),!0):!0},e.prototype._typeInterceptorEnter=function(e,t){return"\n"!==e?!1:this._enter(!1,t)},e.prototype.lineInsertBefore=function(e){var t=this.position.lineNumber,n=0;return t>1&&(t--,n=this.model.getLineMaxColumn(t)),this._enter(!1,e,new f.Position(t,n),new m.Range(t,n,t,n))},e.prototype.lineInsertAfter=function(e){var t=this.model.getLineMaxColumn(this.position.lineNumber);return this._enter(!1,e,new f.Position(this.position.lineNumber,t),new m.Range(this.position.lineNumber,t,this.position.lineNumber,t))},e.prototype.lineBreakInsert=function(e){return this._enter(!0,e)},e.prototype._enter=function(e,t,n,i){"undefined"==typeof n&&(n=this.position),"undefined"==typeof i&&(i=this.getSelection()),t.shouldPushStackElementBefore=!0;var o,r=this.model.getLineContent(n.lineNumber),s=this.model.getRawLineTokens(n.lineNumber);if(this.model.getMode().electricCharacterSupport)try{o=this.model.getMode().electricCharacterSupport.onEnter(r,s,n.column-1)}catch(a){_.onUnexpectedError(a)}var u=c.getLeadingWhitespace(r);if(u.length>n.column-1&&(u=u.substring(0,n.column-1)),o?(o.appendText?-1===c.firstNonWhitespaceIndex(o.appendText)&&(o.appendText=this.helper.normalizeIndentation(o.appendText)):o.appendText=" ",o.indentOutdentAppendText||(o.indentOutdentAppendText="")):o={indentAction:p.IndentAction.None,appendText:"",indentOutdentAppendText:""},o.indentAction===p.IndentAction.None)this.actualType("\n"+this.helper.normalizeIndentation(u)+o.appendText,e,t,i);else if(o.indentAction===p.IndentAction.Indent)this.actualType("\n"+this.helper.normalizeIndentation(u)+o.appendText,e,t,i);else if(o.indentAction===p.IndentAction.IndentOutdent){var l=this.helper.normalizeIndentation(u),h=this.helper.normalizeIndentation(u)+o.appendText,d="\n"+h+"\n"+l+o.indentOutdentAppendText;t.executeCommand=e?new v.ReplaceCommandWithoutChangingPosition(i,d):new v.ReplaceCommandWithOffsetCursorState(i,d,-1,h.length-l.length)}return!0},e.prototype._typeInterceptorAutoClosingCloseChar=function(e,t){if(!this.configuration.editor.autoClosingBrackets)return!1;var n=this.getSelection();if(!n.isEmpty()||!this.modeConfiguration.autoClosingPairsClose.hasOwnProperty(e))return!1;var i=this.model.getLineContent(this.position.lineNumber),o=i[this.position.column-1];if(o!==e)return!1;var r=new m.Range(this.position.lineNumber,this.position.column,this.position.lineNumber,this.position.column+1);return t.executeCommand=new v.ReplaceCommand(r,e),!0},e.prototype._typeInterceptorAutoClosingOpenChar=function(e,t){if(!this.configuration.editor.autoClosingBrackets)return!1;var n=this.getSelection();if(!n.isEmpty()||!this.modeConfiguration.autoClosingPairsOpen.hasOwnProperty(e))return!1;if(!this.model.getMode().characterPairSupport)return!1;var i=this.model.getLineContent(this.position.lineNumber),o=i[this.position.column-1],r=this.modeConfiguration.autoClosingPairsOpen[e];if(o&&o!==r&&!/\s/.test(o))return!1;var s=this.model.getRawLineTokens(this.position.lineNumber),a=!1;try{a=this.model.getMode().characterPairSupport.shouldAutoClosePair(e,i,s,this.position.column-1)}catch(u){_.onUnexpectedError(u)}return a?(t.shouldPushStackElementBefore=!0,t.executeCommand=new v.ReplaceCommandWithOffsetCursorState(n,e+r,0,-r.length),!0):!1},e.prototype._typeInterceptorSurroundSelection=function(e,t){if(!this.configuration.editor.autoClosingBrackets)return!1;var n=this.getSelection();if(n.isEmpty()||!this.modeConfiguration.surroundingPairs.hasOwnProperty(e))return!1;var i=this.modeConfiguration.surroundingPairs[e];return t.shouldPushStackElementBefore=!0,t.shouldPushStackElementAfter=!0,t.executeCommand=new y.SurroundSelectionCommand(n,e,i),!0},e.prototype._typeInterceptorElectricChar=function(e,t){var n=this;return this.modeConfiguration.electricChars.hasOwnProperty(e)?(t.postOperationRunnable=function(e){return n._typeInterceptorElectricCharRunnable(e)},this.actualType(e,!1,t)):!1},e.prototype._typeInterceptorElectricCharRunnable=function(e){var t,n=this.model.getLineContent(this.position.lineNumber),i=this.model.getRawLineTokens(this.position.lineNumber);if(this.model.getMode().electricCharacterSupport)try{t=this.model.getMode().electricCharacterSupport.onElectricCharacter(n,i,this.position.column-2)}catch(o){_.onUnexpectedError(o)}if(t){var r=t.matchBracketType,s=t.appendText;if(r){var a=null;if(r&&(a=this.model.findMatchingBracketUp(r,this.position)),a){var u=a.startLineNumber,l=this.model.getLineContent(u),h=c.getLeadingWhitespace(l),d=this.helper.normalizeIndentation(h),p=this.model.getLineFirstNonWhitespaceColumn(this.position.lineNumber)||this.position.column,f=n.substring(0,p-1);if(f!==d){var g=n.substring(p-1,this.position.column-1),y=d+g,C=new m.Range(this.position.lineNumber,1,this.position.lineNumber,this.position.column);e.shouldPushStackElementAfter=!0,e.executeCommand=new v.ReplaceCommand(C,y)}}}else if(s){var b=-s.length;t.advanceCount&&(b+=t.advanceCount),e.shouldPushStackElementAfter=!0,e.executeCommand=new v.ReplaceCommandWithOffsetCursorState(this.getSelection(),s,0,b)}}},e.prototype.actualType=function(e,t,n,i){return"undefined"==typeof i&&(i=this.getSelection()),n.executeCommand=t?new v.ReplaceCommandWithoutChangingPosition(i,e):new v.ReplaceCommand(i,e),!0},e.prototype.type=function(e,t){return this._typeInterceptorEnter(e,t)?!0:this._typeInterceptorAutoClosingCloseChar(e,t)?!0:this._typeInterceptorAutoClosingOpenChar(e,t)?!0:this._typeInterceptorSurroundSelection(e,t)?!0:this._typeInterceptorElectricChar(e,t)?!0:this.actualType(e,!1,t)},e.prototype.tab=function(e){if(this.configuration.editor.tabFocusMode)return!1;var t=this.getSelection();if(t.isEmpty()){var n="";if(this.configuration.editor.insertSpaces)for(var i=this.helper.nextTabColumn(this.position.column-1),o=this.position.column;i>=o;o++)n+=" ";else n=" ";e.executeCommand=new v.ReplaceCommand(t,n)}else e.shouldPushStackElementBefore=!0,e.shouldPushStackElementAfter=!0,this.indent(e);return!0},e.prototype.indent=function(e){var t=this.getSelection();return e.executeCommand=new g.ShiftCommand(this.configuration,!1,t),e.shouldRevealHorizontal=!1,!0},e.prototype.outdent=function(e){if(this.configuration.editor.tabFocusMode)return!1;var t=this.getSelection();return e.executeCommand=new g.ShiftCommand(this.configuration,!0,t),e.shouldRevealHorizontal=!1,!0},e.prototype.paste=function(e,t,n){if(t&&"\n"===e.charAt(e.length-1)&&e.indexOf("\n")===e.length-1){var i=new m.Range(this.position.lineNumber,1,this.position.lineNumber,1);return n.executeCommand=new v.ReplaceCommand(i,e),!0}return n.executeCommand=new v.ReplaceCommand(this.getSelection(),e),!0},e.prototype._autoClosingPairDelete=function(e){if(!this.configuration.editor.autoClosingBrackets)return!1;var t=this.model.getLineContent(this.position.lineNumber),n=t[this.position.column-2];if(!this.modeConfiguration.autoClosingPairsOpen.hasOwnProperty(n))return!1;var i=t[this.position.column-1],o=this.modeConfiguration.autoClosingPairsOpen[n];if(i!==o)return!1;var r=new m.Range(this.position.lineNumber,this.position.column-1,this.position.lineNumber,this.position.column+1);return e.executeCommand=new v.ReplaceCommand(r,""),!0},e.prototype.deleteLeft=function(e){if(this._autoClosingPairDelete(e))return!0;var t=this.getSelection();if(t.isEmpty()){var n=this.helper.getLeftOfPosition(this.model,this.position.lineNumber,this.position.column);t=new m.Range(n.lineNumber,n.column,this.position.lineNumber,this.position.column)}return t.isEmpty()?!0:(t.startLineNumber!==t.endLineNumber&&(e.shouldPushStackElementBefore=!0),e.executeCommand=new v.ReplaceCommand(t,""),!0)},e.prototype.deleteWordLeft=function(e){if(this._autoClosingPairDelete(e))return!0;var t=this.getSelection();if(t.isEmpty()){var n=this.position.lineNumber,i=this.position.column;if(1===n&&1===i)return!0;var o=this.helper.findWord(this.position,"left",!0);i=o?o.end+1i?s.start+1:s.end+1:r;var a=new m.Range(n,i,n,this.position.column);if(!a.isEmpty())return e.executeCommand=new v.ReplaceCommand(a,""),!0}return this.deleteRight(e)},e.prototype.deleteAllLeft=function(e){if(this._autoClosingPairDelete(e))return!0;var t=this.getSelection();if(t.isEmpty()){var n=this.position.lineNumber,i=this.position.column;if(1===i)return!0;var o=new m.Range(n,1,n,i);if(!o.isEmpty())return e.executeCommand=new v.ReplaceCommand(o,""),!0}return this.deleteLeft(e)},e.prototype.deleteAllRight=function(e){var t=this.getSelection();if(t.isEmpty()){var n=this.position.lineNumber,i=this.position.column,o=this.model.getLineMaxColumn(n);if(i===o)return!0;var r=new m.Range(n,i,n,o);if(!r.isEmpty())return e.executeCommand=new v.ReplaceCommand(r,""),!0}return this.deleteRight(e)},e.prototype.cut=function(e){var t=this.getSelection();if(t.isEmpty()){var n=this.position.lineNumber,i=1,o=this.position.lineNumber+1,r=1;o>this.model.getLineCount()&&(o--,r=this.model.getLineMaxColumn(o));var s=new m.Range(n,i,o,r);s.isEmpty()||(e.executeCommand=new v.ReplaceCommand(s,""))}else this.deleteLeft(e);return!0},e}();t.OneCursor=w;var E=function(){function e(e,t){this.model=e,this.configuration=t,this.moveHelper=new b.ModelCursorMoveHelper(this.configuration)}return e.prototype.getLeftOfPosition=function(e,t,n){return this.moveHelper.getLeftOfPosition(e,t,n)},e.prototype.getRightOfPosition=function(e,t,n){return this.moveHelper.getRightOfPosition(e,t,n)},e.prototype.getPositionUp=function(e,t,n,i,o){return this.moveHelper.getPositionUp(e,t,n,i,o)},e.prototype.getPositionDown=function(e,t,n,i,o){return this.moveHelper.getPositionDown(e,t,n,i,o)},e.prototype.getColumnAtBeginningOfLine=function(e,t,n){return this.moveHelper.getColumnAtBeginningOfLine(e,t,n)},e.prototype.getColumnAtEndOfLine=function(e,t,n){return this.moveHelper.getColumnAtEndOfLine(e,t,n)},e.prototype.normalizeIndentation=function(e){return this.configuration.normalizeIndentation(e)},e.prototype.nextTabColumn=function(e){return e+this.configuration.editor.tabSize-e%this.configuration.editor.tabSize},e.prototype.findWord=function(e,t,n){"undefined"==typeof n&&(n=!1);var i,o,r,s=this.model.getWords(e.lineNumber,n,!0);if(n){if(i=e.column-1,"left"===t){for(o=s.length-1;o>=0;o--)if(!(s[o].start>=i))return s[o]}else for(o=0,r=s.length;r>o;o++)if(!(s[o].end<=i))return s[o]}else for(i=e.column,"left"===t?1!==i&&(i-=.1):i!==this.model.getLineMaxColumn(e.lineNumber)&&(i+=.1),i-=1,o=0,r=s.length;r>o;o++)if(s[o].start<=i&&i<=s[o].end)return s[o];return null},e}(),S=function(){function e(){}return e.rangeContainsPosition=function(e,t){return t.lineNumbere.endLineNumber?!1:t.lineNumber===e.startLineNumber&&t.columne.endColumn?!1:!0},e.isPositionInsideRange=function(e,t){return e.lineNumbert.endLineNumber?!1:e.lineNumber===t.startLineNumber&&e.columnt.endColumn?!1:!0},e.isPositionAtRangeEdges=function(e,t){return e.lineNumber===t.startLineNumber&&e.column===t.startColumn?!0:e.lineNumber===t.endLineNumber&&e.column===t.endColumn?!0:!1},e}()}),define("vs/editor/core/controller/cursorCollection",["require","exports","vs/editor/core/controller/oneCursor","vs/editor/core/selection","vs/base/errors"],function(e,t,n,i,o){"use strict";var r=n,s=i,a=o,u=function(){function e(e,t,n,i){this.editorId=e,this.model=t,this.configuration=n,this.viewModelHelper=i,this.modeConfiguration=this.getModeConfiguration(),this.primaryCursor=new r.OneCursor(this.editorId,this.model,this.configuration,this.modeConfiguration,this.viewModelHelper),this.secondaryCursors=[],this.lastAddedCursorIndex=0}return e.prototype.dispose=function(){this.primaryCursor.dispose(),this.killSecondaryCursors()},e.prototype.getAll=function(){var e=[];return e.push(this.primaryCursor),e=e.concat(this.secondaryCursors)},e.prototype.getPosition=function(e){return 0===e?this.primaryCursor.getPosition():this.secondaryCursors[e-1].getPosition()},e.prototype.getViewPosition=function(e){return 0===e?this.primaryCursor.getViewPosition():this.secondaryCursors[e-1].getViewPosition()},e.prototype.getPositions=function(){var e=[];e.push(this.primaryCursor.getPosition());for(var t=0,n=this.secondaryCursors.length;n>t;t++)e.push(this.secondaryCursors[t].getPosition());return e},e.prototype.getViewPositions=function(){var e=[];e.push(this.primaryCursor.getViewPosition());for(var t=0,n=this.secondaryCursors.length;n>t;t++)e.push(this.secondaryCursors[t].getViewPosition());return e},e.prototype.getSelection=function(e){return 0===e?this.primaryCursor.getSelection():this.secondaryCursors[e-1].getSelection()},e.prototype.getSelections=function(){var e=[];e.push(this.primaryCursor.getSelection());for(var t=0,n=this.secondaryCursors.length;n>t;t++)e.push(this.secondaryCursors[t].getSelection());return e},e.prototype.getViewSelections=function(){var e=[];e.push(this.primaryCursor.getViewSelection());for(var t=0,n=this.secondaryCursors.length;n>t;t++)e.push(this.secondaryCursors[t].getViewSelection());return e},e.prototype.setSelections=function(e){this.primaryCursor.setSelection(e[0]),this._setSecondarySelections(e.slice(1))},e.prototype.killSecondaryCursors=function(){return this._setSecondarySelections([])>0},e.prototype.normalize=function(){this._mergeCursorsIfNecessary(),this.primaryCursor.adjustBracketDecorations();for(var e=0,t=this.secondaryCursors.length;t>e;e++)this.secondaryCursors[e].adjustBracketDecorations()},e.prototype.addSecondaryCursor=function(e){var t=new r.OneCursor(this.editorId,this.model,this.configuration,this.modeConfiguration,this.viewModelHelper);e&&t.setSelection(e),this.secondaryCursors.push(t),this.lastAddedCursorIndex=this.secondaryCursors.length},e.prototype.getLastAddedCursor=function(){return 0===this.secondaryCursors.length||0===this.lastAddedCursorIndex?this.primaryCursor:this.secondaryCursors[this.lastAddedCursorIndex-1]},e.prototype._setSecondarySelections=function(e){var t=this.secondaryCursors.length,n=e.length,i=n-t;if(n>t)for(var o=n-t,r=0;o>r;r++)this.addSecondaryCursor(null);else if(t>n)for(var s=t-n,r=0;s>r;r++)this._removeSecondaryCursor(this.secondaryCursors.length-1);for(var r=0;n>r;r++)e[r]&&this.secondaryCursors[r].setSelection(e[r]);return i},e.prototype._removeSecondaryCursor=function(e){this.lastAddedCursorIndex>=e+1&&this.lastAddedCursorIndex--,this.secondaryCursors[e].dispose(),this.secondaryCursors.splice(e,1)},e.prototype._mergeCursorsIfNecessary=function(){if(0!==this.secondaryCursors.length){for(var e=this.getAll(),t=[],n=0;nc&&t[_].index--;e.splice(c,1),t.splice(d,1),this._removeSecondaryCursor(c-1),i-- }}}},e.prototype.getModeConfiguration=function(){var e,t,n={electricChars:{},autoClosingPairsOpen:{},autoClosingPairsClose:{},surroundingPairs:{}};if(this.model.getMode().electricCharacterSupport)try{t=this.model.getMode().electricCharacterSupport.getElectricCharacters()}catch(i){a.onUnexpectedError(i),t=null}if(t)for(e=0;ec;c++)d[c]()}});var d=i.cursors.getSelections(),c=i.cursors.getViewSelections(),p=!1;if(u.length!==d.length)p=!0;else{for(var f=0,m=u.length;!p&&m>f;f++)u[f].equalsSelection(d[f])||(p=!0);for(var f=0,m=l.length;!p&&m>f;f++)l[f].equalsSelection(c[f])||(p=!0)}p&&(i.emitCursorPositionChanged(h,e),r&&i.emitCursorRevealRange(s,a),i.emitCursorSelectionChanged(h,e))})}catch(r){_.onUnexpectedError(r)}return this._isHandling=!1,o},t.prototype._interpretHandlerContext=function(e){e.shouldPushStackElementBefore&&(this.model.pushStackElement(),e.shouldPushStackElementBefore=!1),this._internalExecuteCommands(e.executeCommands,e.postOperationRunnables),e.executeCommands=[],e.shouldPushStackElementAfter&&(this.model.pushStackElement(),e.shouldPushStackElementAfter=!1);for(var t=!1,n=0,i=e.postOperationRunnables.length;i>n;n++)if(e.postOperationRunnables[n]){t=!0;break}if(t){var o=e.postOperationRunnables.slice(0);e.postOperationRunnables=[],this._invokeForAll(e,function(e,t,n){o[e]&&o[e](n)}),this._interpretHandlerContext(e)}},t.prototype._interpretCommandResult=function(e){return e?(this.cursors.setSelections(e),!0):!1},t.prototype._getEditOperationsFromCommand=function(e,t,n){var i=this,o=[],r=0,s=function(e,n){(!e.isEmpty()||n)&&o.push({identifier:{major:t,minor:r++},range:e,text:n})},a=!1,u=function(t){var n,o;if(a=!0,t.isEmpty()){var r=i.model.getLineMaxColumn(t.startLineNumber);t.startColumn===r?(n="start",o="start"):(n="end",o="end")}else t.getDirection()===y.SelectionDirection.LTR?(n="end",o="start"):(n="start",o="end");var s=e.selectionStartMarkers.length;return e.selectionStartMarkers[s]=i.model._addMarker(t.selectionStartLineNumber-1,t.selectionStartColumn,n),e.positionMarkers[s]=i.model._addMarker(t.positionLineNumber-1,t.positionColumn,o),s.toString()},l={addEditOperation:s,trackSelection:u};try{n.getEditOperations(this.model,l)}catch(h){return _.onUnexpectedError(h,c.localize("vs_editor_core_controller_cursor",0)),{operations:[],hadTrackedRange:!1}}return{operations:o,hadTrackedRange:a}},t.prototype._getEditOperations=function(e,t){for(var n,i,o=[],r=[],s=0;sn.identifier.major?t.identifier.major:n.identifier.major,o[i.toString()]=!0;for(var s=0;ss&&r--,s--);r>0&&r--}return o},t.prototype._internalExecuteCommands=function(e,t){for(var n={selectionStartMarkers:[],positionMarkers:[]},i=this._innerExecuteCommands(n,e,t),o=0;ot;t++)if(e[t])return!1;return!0},t.prototype._innerExecuteCommands=function(e,t,n){var i=this;if(this.configuration.editor.readOnly)return!1;if(this._arrayIsEmpty(t))return!1;var o=this.cursors.getSelections(),r=this._getEditOperations(e,t);if(0===r.operations.length&&!r.anyoneHadTrackedRange)return!1;for(var s=r.operations,a=this.model.getEditableRange(),u=a.getStartPosition(),l=a.getEndPosition(),h=0;h0||r.hadTrackedRanges[a]?(s[a].sort(l),h[a]=t[a].computeCursorState(i.model,{getInverseEditOperations:function(){return s[a]},getTrackedSelection:function(t){var n=parseInt(t,10),o=i.model._getMarker(e.selectionStartMarkers[n]),r=i.model._getMarker(e.positionMarkers[n]);return new m.Selection(o.lineNumber,o.column,r.lineNumber,r.column)}})):h[a]=o[a];return h}),v=[];for(f in c)c.hasOwnProperty(f)&&v.push(parseInt(f,10));v.sort(function(e,t){return t-e});for(var h=0;hi;i++)this.cursors.addSecondaryCursor(t[i]);return this._invokeForAll(e,function(e,t,i){return e>=n?t.moveUp(!1,!1,i):!1})},t.prototype._addCursorDown=function(e){if(this.configuration.editor.readOnly)return!1;for(var t=this.cursors.getSelections(),n=t.length,i=0;n>i;i++)this.cursors.addSecondaryCursor(t[i]);return this._invokeForAll(e,function(e,t,i){return e>=n?t.moveDown(!1,!1,i):!1})},t.prototype._moveLeft=function(e,t){return this._invokeForAll(t,function(t,n,i){return n.moveLeft(e,i)})},t.prototype._moveWordLeft=function(e,t){return this._invokeForAll(t,function(t,n,i){return n.moveWordLeft(e,i)})},t.prototype._moveRight=function(e,t){return this._invokeForAll(t,function(t,n,i){return n.moveRight(e,i)})},t.prototype._moveWordRight=function(e,t){return this._invokeForAll(t,function(t,n,i){return n.moveWordRight(e,i)})},t.prototype._moveDown=function(e,t,n){return this._invokeForAll(n,function(n,i,o){return i.moveDown(e,t,o)})},t.prototype._moveUp=function(e,t,n){return this._invokeForAll(n,function(n,i,o){return i.moveUp(e,t,o)})},t.prototype._moveToBeginningOfLine=function(e,t){return this._invokeForAll(t,function(t,n,i){return n.moveToBeginningOfLine(e,i)})},t.prototype._moveToEndOfLine=function(e,t){return this._invokeForAll(t,function(t,n,i){return n.moveToEndOfLine(e,i)})},t.prototype._moveToBeginningOfBuffer=function(e,t){return this._invokeForAll(t,function(t,n,i){return n.moveToBeginningOfBuffer(e,i)})},t.prototype._moveToEndOfBuffer=function(e,t){return this._invokeForAll(t,function(t,n,i){return n.moveToEndOfBuffer(e,i)})},t.prototype._selectAll=function(e){return this.cursors.killSecondaryCursors(),this._invokeForAll(e,function(e,t,n){return t.selectAll(n)})},t.prototype._line=function(e,t){return this.cursors.killSecondaryCursors(),this._invokeForAll(t,function(n,i,o){return i.line(e,t.eventData.position,t.eventData.viewPosition,o)})},t.prototype._lastCursorLine=function(e){if(this.configuration.editor.readOnly||this.model.hasEditableRange())return!1;var t=this.cursors.getLastAddedCursor();return this._invokeForAll(e,function(n,i,o){return i===t?i.line(!0,e.eventData.position,e.eventData.viewPosition,o):!1}),e.shouldReveal=!1,e.shouldRevealHorizontal=!1,!0},t.prototype._lineInsertBefore=function(e){return this._invokeForAll(e,function(e,t,n){return t.lineInsertBefore(n)})},t.prototype._lineInsertAfter=function(e){return this._invokeForAll(e,function(e,t,n){return t.lineInsertAfter(n)})},t.prototype._lineBreakInsert=function(e){return this._invokeForAll(e,function(e,t,n){return t.lineBreakInsert(n)})},t.prototype._word=function(e,t){return this.cursors.killSecondaryCursors(),this._invokeForAll(t,function(n,i,o){return i.word(e,t.eventData.position,t.eventData.preference||"none",o)})},t.prototype._lastCursorWord=function(e){if(this.configuration.editor.readOnly||this.model.hasEditableRange())return!1;var t=this.cursors.getLastAddedCursor();return this._invokeForAll(e,function(n,i,o){return i===t?i.word(!0,e.eventData.position,e.eventData.preference||"none",o):!1}),e.shouldReveal=!1,e.shouldRevealHorizontal=!1,!0},t.prototype._cancelSelection=function(e){return this.cursors.killSecondaryCursors()?!0:this._invokeForAll(e,function(e,t,n){return t.cancelSelection(n)})},t.prototype._type=function(e){var t=this,n=e.eventData.text;if("keyboard"===e.eventSource){var i,o,r;for(i=0,o=n.length;o>i;i++)r=n.charAt(i),this.charactersTyped+=r,this._createAndInterpretHandlerCtx(e.eventSource,e.eventData,function(n){t._invokeForAll(n,function(e,t,n){return t.type(r,n)},!1,!1),e.cursorPositionChangeReason=n.cursorPositionChangeReason,e.shouldReveal=n.shouldReveal,e.shouldRevealVerticalInCenter=n.shouldRevealVerticalInCenter,e.shouldRevealHorizontal=n.shouldRevealHorizontal})}else this._invokeForAll(e,function(e,t,i){return t.actualType(n,!1,i)});return!0},t.prototype._tab=function(e){return this._invokeForAll(e,function(e,t,n){return t.tab(n)},!1,!1)},t.prototype._indent=function(e){return this._invokeForAll(e,function(e,t,n){return t.indent(n)})},t.prototype._outdent=function(e){return this._invokeForAll(e,function(e,t,n){return t.outdent(n)})},t.prototype._paste=function(e){return this._invokeForAll(e,function(t,n,i){return n.paste(e.eventData.text,e.eventData.sameSource,i)})},t.prototype._deleteLeft=function(e){return this._invokeForAll(e,function(e,t,n){return t.deleteLeft(n)},!1,!1)},t.prototype._deleteWordLeft=function(e){return this._invokeForAll(e,function(e,t,n){return t.deleteWordLeft(n)},!1,!1)},t.prototype._deleteRight=function(e){return this._invokeForAll(e,function(e,t,n){return t.deleteRight(n)},!1,!1)},t.prototype._deleteWordRight=function(e){return this._invokeForAll(e,function(e,t,n){return t.deleteWordRight(n)},!1,!1)},t.prototype._deleteAllLeft=function(e){return this._invokeForAll(e,function(e,t,n){return t.deleteAllLeft(n)},!1,!1)},t.prototype._deleteAllRight=function(e){return this._invokeForAll(e,function(e,t,n){return t.deleteAllRight(n)},!1,!1)},t.prototype._cut=function(e){return this._invokeForAll(e,function(e,t,n){return t.cut(n)})},t.prototype._undo=function(e){return e.cursorPositionChangeReason="undo",this._interpretCommandResult(this.model.undo()),!0},t.prototype._redo=function(e){return e.cursorPositionChangeReason="redo",this._interpretCommandResult(this.model.redo()),!0},t.prototype._externalExecuteCommand=function(e){return this.cursors.killSecondaryCursors(),this._invokeForAll(e,function(t,n,i){i.shouldPushStackElementBefore=!0,i.shouldPushStackElementAfter=!0,i.executeCommand=e.eventData})},t}(g.EventEmitter);t.Cursor=w});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/editor/core/view/model/viewModel",["require","exports","vs/base/eventEmitter","vs/editor/core/view/viewContext","vs/editor/core/constants","vs/editor/core/selection","vs/editor/core/range","vs/editor/core/view/model/viewModelDecorations","vs/editor/core/view/model/viewModelCursors","vs/base/strings","vs/editor/core/position"],function(e,t,n,i,o,r,s,a,u,l,h){"use strict";var d=n,c=i,p=o,f=r,m=s,g=a,v=u,y=l,C=h,_=function(e){function t(t,n,i,o){var r=this;e.call(this),this.lines=t,this.editorId=n,this.versionId=-2,this.configuration=i,this.model=o,this.restoreCurrentCenteredModelRange=null,this.isHandlingExternalEvents=!1,this.decorations=new g.ViewModelDecorations(this.editorId,this.configuration,this),this.decorations.reset(this.model),this.cursors=new v.ViewModelCursors(this.configuration,this),this.listenersToRemove=[],this.listenersToRemove.push(this.model.addBulkListener(function(e){return r.onEvents(e)})),this.listenersToRemove.push(this.configuration.addBulkListener(function(e){return r.onEvents(e)}))}return __extends(t,e),t.prototype.dispose=function(){this.listenersToRemove.forEach(function(e){e()}),this.listenersToRemove=[],this.decorations.dispose(),this.decorations=null,this.lines=null,this.configuration=null,this.model=null},t.prototype.setTabSize=function(e){var t=this;this.deferredEmit(function(){var n=t.lines.setTabSize(e,function(e,n){return t.emit(e,n)});n&&(t.emit(c.EventNames.LineMappingChangedEvent),t.decorations.onLineMappingChanged(function(e,n){return t.emit(e,n)}),t.cursors.onLineMappingChanged(function(e,n){return t.emit(e,n)}))})},t.prototype.restoreCenteredModelRange=function(){if(this.restoreCurrentCenteredModelRange){var e=this.convertModelRangeToViewRange(this.restoreCurrentCenteredModelRange);this.restoreCurrentCenteredModelRange=null;var t={range:e,revealVerticalInCenter:!0,revealHorizontal:!1};this.emit(c.EventNames.RevealRangeEvent,t)}},t.prototype.setWrappingColumn=function(e,t){var n=this;this.restoreCurrentCenteredModelRange=null;var i=!1;this.deferredEmit(function(){if(t){var o=new m.Range(t,1,t,n.getLineMaxColumn(t));n.restoreCurrentCenteredModelRange=n.convertViewRangeToModelRange(o)}i=n.lines.setWrappingColumn(e,function(e,t){return n.emit(e,t)}),i?(n.emit(c.EventNames.LineMappingChangedEvent),n.decorations.onLineMappingChanged(function(e,t){return n.emit(e,t)}),n.cursors.onLineMappingChanged(function(e,t){return n.emit(e,t)})):n.restoreCurrentCenteredModelRange=null,n.isHandlingExternalEvents||n.restoreCenteredModelRange()})},t.prototype.isUpToDate=function(){return this.model.getVersionId()===this.versionId},t.prototype.addEventSource=function(e){var t=this;this.listenersToRemove.push(e.addBulkListener(function(e){return t.onEvents(e)}))},t.prototype.onEvents=function(e){var t=this;this.isHandlingExternalEvents=!0,this.deferredEmit(function(){var n,i,o,r,s,a=!1,u=!1;for(n=0,i=e.length;i>n;n++)switch(o=e[n],r=o.getData(),o.getType()){case p.EventType.ModelContentChanged:switch(s=r,s.changeType){case p.EventType.ModelContentChangedFlush:t.onModelFlushed(s),a=!0;break;case p.EventType.ModelContentChangedLinesDeleted:t.onModelLinesDeleted(s),a=!0;break;case p.EventType.ModelContentChangedLinesInserted:t.onModelLinesInserted(s),a=!0;break;case p.EventType.ModelContentChangedLineChanged:u=t.onModelLineChanged(s);break;default:console.info("ViewModel received unkown event: "),console.info(o)}t.versionId=s.versionId;break;case p.EventType.ModelTokensChanged:t.onModelTokensChanged(r);break;case p.EventType.ModelPropertiesChanged:break;case p.EventType.ModelDecorationsChanged:t.onModelDecorationsChanged(r);break;case p.EventType.ModelDispose:break;case p.EventType.CursorPositionChanged:t.onCursorPositionChanged(r);break;case p.EventType.CursorSelectionChanged:t.onCursorSelectionChanged(r);break;case p.EventType.CursorRevealRange:t.onCursorRevealRange(r);break;case p.EventType.ConfigurationChanged:t.setTabSize(t.configuration.editor.tabSize),t.emit(o.getType(),r);break;case p.EventType.ConfigurationLineHeightChanged:t.emit(o.getType(),o.getData());break;case p.EventType.ConfigurationFontChanged:t.emit(o.getType(),o.getData());break;default:console.info("View received unkown event: "),console.info(o)}!a&&u&&(t.emit(c.EventNames.LineMappingChangedEvent),t.decorations.onLineMappingChanged(function(e,n){return t.emit(e,n)}),t.cursors.onLineMappingChanged(function(e,n){return t.emit(e,n)}))}),this.restoreCenteredModelRange(),this.isHandlingExternalEvents=!1},t.prototype.onModelFlushed=function(){var e=this;this.lines.onModelFlushed(function(t,n){return e.emit(t,n)}),this.decorations.reset(this.model)},t.prototype.onModelDecorationsChanged=function(e){var t=this;this.decorations.onModelDecorationsChanged(e,function(e,n){return t.emit(e,n)})},t.prototype.onModelLinesDeleted=function(e){var t=this;this.lines.onModelLinesDeleted(e.fromLineNumber,e.toLineNumber,function(e,n){return t.emit(e,n)})},t.prototype.onModelTokensChanged=function(e){var t=this.convertModelPositionToViewPosition(e.fromLineNumber,1).lineNumber,n=this.convertModelPositionToViewPosition(e.toLineNumber,this.model.getLineMaxColumn(e.toLineNumber)).lineNumber,e={fromLineNumber:t,toLineNumber:n};this.emit(c.EventNames.TokensChangedEvent,e)},t.prototype.onModelLineChanged=function(e){var t=this,n=this.lines.onModelLineChanged(e.lineNumber,e.detail,function(e,n){return t.emit(e,n)});return n},t.prototype.onModelLinesInserted=function(e){var t=this;this.lines.onModelLinesInserted(e.fromLineNumber,e.toLineNumber,e.detail.split("\n"),function(e,n){return t.emit(e,n)})},t.prototype.validateViewPosition=function(e,t,n){1>e&&(e=1);var i=this.getLineCount();e>i&&(e=i);var o=this.getLineMaxColumn(e);1>t&&(t=1),t>o&&(t=o);var r=this.convertViewPositionToModelPosition(e,t);return r.equals(n)?new C.Position(e,t):this.convertModelPositionToViewPosition(n.lineNumber,n.column)},t.prototype.onCursorPositionChanged=function(e){var t=this;this.cursors.onCursorPositionChanged(e,function(e,n){return t.emit(e,n)})},t.prototype.onCursorSelectionChanged=function(e){var t=this;this.cursors.onCursorSelectionChanged(e,function(e,n){return t.emit(e,n)})},t.prototype.onCursorRevealRange=function(e){var t=this;this.cursors.onCursorRevealRange(e,function(e,n){return t.emit(e,n)})},t.prototype.getLineCount=function(){return this.lines.getOutputLineCount()},t.prototype.getLineContent=function(e){return this.lines.getOutputLineContent(e)},t.prototype.getLineMaxColumn=function(e){return this.lines.getOutputLineMaxColumn(e)},t.prototype.getLineFirstNonWhitespaceColumn=function(e){var t=y.firstNonWhitespaceIndex(this.getLineContent(e));return-1===t?0:t+1},t.prototype.getLineLastNonWhitespaceColumn=function(e){var t=y.lastNonWhitespaceIndex(this.getLineContent(e));return-1===t?0:t+2},t.prototype.getLineTokens=function(e){return this.lines.getOutputLineTokens(e)},t.prototype.getInlineDecorations=function(e){return this.decorations.getInlineDecorations(e)},t.prototype.getLineRenderLineNumber=function(e){var t=this.convertViewPositionToModelPosition(e,1);if(1!==t.column)return"";var n=t.lineNumber;return"function"==typeof this.configuration.editor.lineNumbers?this.configuration.editor.lineNumbers(n):n.toString()},t.prototype.getDecorationsInRange=function(e){return this.decorations.getDecorationsInRange(e)},t.prototype.getAllDecorations=function(){return this.decorations.getAllDecorations()},t.prototype.getValueInRange=function(e,t){var n=this.convertViewRangeToModelRange(e);return this.model.getValueInRange(n,t)},t.prototype.getModelLineContent=function(e){return this.model.getLineContent(e)},t.prototype.getModelLineMaxColumn=function(e){return this.model.getLineMaxColumn(e)},t.prototype.validateModelPosition=function(e){return this.model.validatePosition(e)},t.prototype.convertViewPositionToModelPosition=function(e,t){return this.lines.convertOutputPositionToInputPosition(e,t)},t.prototype.convertViewRangeToModelRange=function(e){var t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),n=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new m.Range(t.lineNumber,t.column,n.lineNumber,n.column)},t.prototype.convertModelPositionToViewPosition=function(e,t){return this.lines.convertInputPositionToOutputPosition(e,t)},t.prototype.convertModelSelectionToViewSelection=function(e){var t=this.convertModelPositionToViewPosition(e.selectionStartLineNumber,e.selectionStartColumn),n=this.convertModelPositionToViewPosition(e.positionLineNumber,e.positionColumn);return new f.Selection(t.lineNumber,t.column,n.lineNumber,n.column)},t.prototype.convertModelRangeToViewRange=function(e){var t=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn),n=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn);return new m.Range(t.lineNumber,t.column,n.lineNumber,n.column)},t}(d.EventEmitter);t.ViewModel=_}),define("vs/editor/core/view/model/splitLinesCollection",["require","exports","vs/editor/core/view/model/prefixSumComputer","vs/editor/core/view/model/filteredLineTokens","vs/editor/core/view/model/viewModel","vs/editor/core/position","vs/editor/core/view/viewContext"],function(e,t,n,i,o,r,s){"use strict"; var a=n,u=i,l=r,h=s,d={outputLineIndex:0,outputOffset:0},c=function(){function e(e){this.positionMapper=e,this.outputLineCount=this.positionMapper.getOutputLineCount()}return e.prototype.setLineText=function(e){this.positionMapper.setLineText(e),this.outputLineCount=this.positionMapper.getOutputLineCount()},e.prototype.setTabSize=function(e){this.positionMapper.setTabSize(e),this.outputLineCount=this.positionMapper.getOutputLineCount()},e.prototype.setWrappingColumn=function(e){this.positionMapper.setWrappingColumn(e),this.outputLineCount=this.positionMapper.getOutputLineCount()},e.prototype.getOutputLineCount=function(){return this.outputLineCount},e.prototype.getInputStartOffsetOfOutputLineIndex=function(e){return this.positionMapper.getInputOffsetOfOutputPosition(e,0)},e.prototype.getInputEndOffsetOfOutputLineIndex=function(e,t,n){return n+1===this.outputLineCount?e.getLineMaxColumn(t)-1:this.positionMapper.getInputOffsetOfOutputPosition(n+1,0)},e.prototype.getOutputLineContent=function(e,t,n){var i=this.getInputStartOffsetOfOutputLineIndex(n),o=this.getInputEndOffsetOfOutputLineIndex(e,t,n);return e.getLineContent(t).substring(i,o)},e.prototype.getOutputLineMaxColumn=function(e,t,n){return this.getOutputLineContent(e,t,n).length+1},e.prototype.getOutputLineTokens=function(e,t,n){var i=this.getInputStartOffsetOfOutputLineIndex(n),o=this.getInputEndOffsetOfOutputLineIndex(e,t,n);return new u.FilteredLineTokens(e.getLineTokens(t,!0),i,o)},e.prototype.getInputColumnOfOutputPosition=function(e,t){return this.positionMapper.getInputOffsetOfOutputPosition(e,t-1)+1},e.prototype.getOutputPositionOfInputPosition=function(e,t){this.positionMapper.getOutputPositionOfInputOffset(t-1,d);var n=d.outputLineIndex,i=d.outputOffset+1;return new l.Position(e+n,i)},e}(),p=function(){function e(e,t,n,i){this.model=e,this.tabSize=n,this.wrappingColumn=i,this.linePositionMapperFactory=t,this.constructLines(),this.tmpIndexOfResult={index:0,remainder:0}}return e.prototype.constructLines=function(){this.lines=[];for(var e,t,n=[],i=0,o=this.model.getLineCount();o>i;i++)t=this.linePositionMapperFactory.createLineMapper(this.model.getLineContent(i+1),this.tabSize,this.wrappingColumn),e=new c(t),n[i]=e.getOutputLineCount(),this.lines[i]=e;this.prefixSumComputer=new a.PrefixSumComputer(n)},e.prototype.setTabSize=function(e,t){if(this.tabSize===e)return!1;this.tabSize=e;for(var n=0;n=0;l--)s=this.linePositionMapperFactory.createLineMapper(n[l],this.tabSize,this.wrappingColumn),o=new c(s),this.lines.splice(e-1,0,o),r=o.getOutputLineCount(),u+=r,this.prefixSumComputer.insertValue(e-1,r);var d={fromLineNumber:a,toLineNumber:a+u-1};i(h.EventNames.LinesInsertedEvent,d)},e.prototype.onModelLineChanged=function(e,t,n){var i=e-1,o=this.lines[i].getOutputLineCount();this.lines[i].setLineText(t);var r=this.lines[i].getOutputLineCount(),s=!1,a=0,u=-1,l=0,d=-1,c=0,p=-1;o>r?(a=1===e?1:this.prefixSumComputer.getAccumulatedValue(e-2)+1,u=a+r-1,c=u+1,p=c+(o-r)-1,s=!0):r>o?(a=1===e?1:this.prefixSumComputer.getAccumulatedValue(e-2)+1,u=a+o-1,l=u+1,d=l+(r-o)-1,s=!0):(a=1===e?1:this.prefixSumComputer.getAccumulatedValue(e-2)+1,u=a+r-1),this.prefixSumComputer.changeValue(i,r);var f,m,g,v;if(u>=a)for(var f=a;u>=f;f++)m={lineNumber:f},n(h.EventNames.LineChangedEvent,m);return d>=l&&(g={fromLineNumber:l,toLineNumber:d},n(h.EventNames.LinesInsertedEvent,g)),p>=c&&(v={fromLineNumber:c,toLineNumber:p},n(h.EventNames.LinesDeletedEvent,v)),s},e.prototype.getOutputLineCount=function(){return this.prefixSumComputer.getTotalValue()},e.prototype.getOutputLineContent=function(e){this.prefixSumComputer.getIndexOf(e-1,this.tmpIndexOfResult);var t=this.tmpIndexOfResult.index,n=this.tmpIndexOfResult.remainder;return this.lines[t].getOutputLineContent(this.model,t+1,n)},e.prototype.getOutputLineMaxColumn=function(e){this.prefixSumComputer.getIndexOf(e-1,this.tmpIndexOfResult);var t=this.tmpIndexOfResult.index,n=this.tmpIndexOfResult.remainder;return this.lines[t].getOutputLineMaxColumn(this.model,t+1,n)},e.prototype.getOutputLineTokens=function(e){this.prefixSumComputer.getIndexOf(e-1,this.tmpIndexOfResult);var t=this.tmpIndexOfResult.index,n=this.tmpIndexOfResult.remainder;return this.lines[t].getOutputLineTokens(this.model,t+1,n)},e.prototype.convertOutputPositionToInputPosition=function(e,t){this.prefixSumComputer.getIndexOf(e-1,this.tmpIndexOfResult);var n=this.tmpIndexOfResult.index,i=this.tmpIndexOfResult.remainder,o=this.lines[n].getInputColumnOfOutputPosition(i,t);return new l.Position(n+1,o)},e.prototype.convertInputPositionToOutputPosition=function(e,t){var n=1+(1===e?0:this.prefixSumComputer.getAccumulatedValue(e-2)),i=this.lines[e-1].getOutputPositionOfInputPosition(n,t);return i},e}();t.SplitLinesCollection=p}),define("vs/editor/core/view/model/characterHardWrappingLineMapper",["require","exports","vs/editor/core/view/model/splitLinesCollection","vs/editor/core/view/model/prefixSumComputer"],function(e,t,n,i){"use strict";function o(e,t,n){var i,o=[],r=0,s=e+t+n;for(i=0;i=i;i++)o[i]=0;for(i=0;it;t++)o=f.charCodeAt(t),s=o===v,h=og&&0!==t&&(-1!==b?(d=b,c=w):-1!==E?(d=E,c=S):(d=t,c=0),C[_++]=d-y,y=d,i=e.nextVisibleColumn(c,m,s),b=-1,w=0,E=-1,S=0),-1!==b&&(w=e.nextVisibleColumn(w,m,s)),-1!==E&&(S=e.nextVisibleColumn(S,m,s)),h===u&&(b=t+1,w=0),h===l&&(E=t+1,S=0);C[_++]=n-y,this.prefixSums=new r.PrefixSumComputer(C)},e.prototype.getOutputLineCount=function(){return-1===this.wrappingColumn?1:this.prefixSums.getCount()},e.prototype.getInputOffsetOfOutputPosition=function(e,t){return-1===this.wrappingColumn?t:0===e?t:this.prefixSums.getAccumulatedValue(e-1)+t},e.prototype.getOutputPositionOfInputOffset=function(e,t){return-1===this.wrappingColumn?(t.outputLineIndex=0,t.outputOffset=e,void 0):(this.prefixSums.getIndexOf(e,s),t.outputLineIndex=s.index,t.outputOffset=s.remainder,void 0)},e}();t.CharacterHardWrappingLineMapper=h;var d=function(){function e(e,t,n){this.characterClasses=o(e,t,n)}return e.prototype.createLineMapper=function(e,t,n){return new h(this.characterClasses,e,t,n)},e}();t.CharacterHardWrappingLineMapperFactory=d});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/editor/editorExtensions",["require","exports","vs/base/ui/actions","vs/editor/core/constants","vs/base/lib/winjs.base","vs/editor/editor","vs/platform/platform","vs/platform/services"],function(e,t,n,i,o,r,s,a){"use strict";var u=n,l=i,h=o,d=s;!function(e){e._map=[],e.TextFocus=1,e.WidgetFocus=2,e.Writeable=4,e.UpdateOnModelChange=8,e.UpdateOnConfigurationChange=16}(t.Precondition||(t.Precondition={}));var c=t.Precondition;t.defaultPrecondition=c.TextFocus|c.Writeable|c.UpdateOnModelChange;var p=function(e){function n(n,i,o){"undefined"==typeof o&&(o=t.defaultPrecondition);var r=this;e.call(this,i.id),this.descriptor=i,this.editor=n,this.needsTextFocus=!!(o&c.TextFocus),this.needsWidgetFocus=!!(o&c.WidgetFocus),this.needsWritable=!!(o&c.Writeable),this.toUnhook=[],this.bindings=[],i.label&&this.setLabel(i.label),this.hasFocus=!1,this.needsTextFocus&&(this.toUnhook.push(this.editor.addListener("focus",function(){return r.onFocusChanged(!0)})),this.toUnhook.push(this.editor.addListener("blur",function(){return r.onFocusChanged(!1)}))),this.hasWidgetFocus=!1,this.needsWidgetFocus&&(this.toUnhook.push(this.editor.addListener("widgetFocus",function(){return r.onWidgetFocusChanges(!0)})),this.toUnhook.push(this.editor.addListener("widgetBlur",function(){return r.onWidgetFocusChanges(!1)}))),this.isReadOnly=this.editor.getConfiguration().readOnly,this.needsWritable&&this.toUnhook.push(this.editor.addListener(l.EventType.ConfigurationChanged,function(e){return r.onConfigurationChanged(e)})),o&c.UpdateOnModelChange&&this.toUnhook.push(this.editor.addListener(l.EventType.ModelChanged,function(){return r.updateEnablementState()})),o&c.UpdateOnConfigurationChange&&this.toUnhook.push(this.editor.addListener(l.EventType.ConfigurationChanged,function(){return r.updateEnablementState()})),this.setEnabled(this.getEnablementState())}return __extends(n,e),n.prototype.injectTelemetryService=function(e){this.telemetryService=e},n.prototype.injectHandlerService=function(e){var t=this;this.handlerService=e;for(var n=function(){return t.isEnabled()?(t.telemetryService.publicLog("editorActionInvoked",{name:t.label}),h.Promise.as(t.run()).done(),!0):!1},i=0;i0;)this.toUnhook.pop()();for(var t=0;te;e++){var n=this.secondaryCursors[e].getDomNode();n.parentNode.removeChild(n)}return this.secondaryCursors=[],!0},t.prototype.onModelDecorationsChanged=function(){return!1},t.prototype.onModelLinesDeleted=function(){return!0},t.prototype.onModelLineChanged=function(){return!0},t.prototype.onModelLinesInserted=function(){return!0},t.prototype.onCursorPositionChanged=function(e){if(this.primaryCursor.onCursorPositionChanged(e.position,e.isInEditableRange),this.updateBlinking(),this.updateCurrentLine(),this.secondaryCursors.lengthn;n++){var i=new a.ViewCursor(this.context,!0);this.primaryCursor.getDomNode().parentNode.insertBefore(i.getDomNode(),this.primaryCursor.getDomNode().nextSibling),this.secondaryCursors.push(i)}else if(this.secondaryCursors.length>e.secondaryPositions.length)for(var o=this.secondaryCursors.length-e.secondaryPositions.length,n=0;o>n;n++)this.secondaryCursors[0].getDomNode().parentNode.removeChild(this.secondaryCursors[0].getDomNode()),this.secondaryCursors.splice(0,1);for(var n=0;nt;t++)this.secondaryCursors[t].onConfigurationChanged(e);return!0},t.prototype.onConfigurationFontChanged=function(){return!0},t.prototype.onConfigurationLineHeightChanged=function(){this.primaryCursor.onConfigurationLineHeightChanged();for(var e=0,t=this.secondaryCursors.length;t>e;e++)this.secondaryCursors[e].onConfigurationLineHeightChanged();return this.currentLine.style.height=this.context.configuration.editor.lineHeight+"px",!0},t.prototype.onLayoutChanged=function(e){return this.domNode.style.left=e.contentLeft+"px",!0},t.prototype.onScrollChanged=function(){return!0},t.prototype.onZonesChanged=function(){return!0},t.prototype.onScrollWidthChanged=function(){return!0},t.prototype.onScrollHeightChanged=function(){return!1},t.prototype.onViewFocusChanged=function(e){return this.editorHasFocus=e,this.updateBlinking(),!1},t.prototype.getPosition=function(){return this.primaryCursor.getPosition()},t.prototype._shouldShowCurrentLine=function(){return this.selectionIsEmpty&&this.primaryCursor.getIsInEditableRange()&&!this.context.configuration.editor.readOnly},t.prototype.updateCurrentLine=function(){this._shouldShowCurrentLine()?this.currentLineIsVisible||(this.currentLine.style.display="block",this.currentLineIsVisible=!0):this.currentLineIsVisible&&(this.currentLine.style.display="none",this.currentLineIsVisible=!1)},t.prototype.getRenderType=function(){return this.editorHasFocus?this.primaryCursor.getIsInEditableRange()&&!this.context.configuration.editor.readOnly?r.Blink:r.Visible:r.Hidden},t.prototype.updateBlinking=function(){var e=this;-1!==this.blinkTimer&&(window.clearInterval(this.blinkTimer),this.blinkTimer=-1);var n=this.getRenderType();n===r.Visible||n===r.Blink?this._show():this._hide(),n===r.Blink&&(this.blinkTimer=window.setInterval(function(){return e._blink()},t.BLINK_INTERVAL))},t.prototype._blink=function(){this.isVisible?this._hide():this._show()},t.prototype._show=function(){this.primaryCursor.show();for(var e=0,t=this.secondaryCursors.length;t>e;e++)this.secondaryCursors[e].show();this.isVisible=!0},t.prototype._hide=function(){this.primaryCursor.hide();for(var e=0,t=this.secondaryCursors.length;t>e;e++)this.secondaryCursors[e].hide();this.isVisible=!1},t.prototype.prepareRender=function(e){if(this.shouldRender){this.primaryCursor.prepareRender(e);for(var t=0,n=this.secondaryCursors.length;n>t;t++)this.secondaryCursors[t].prepareRender(e)}},t.prototype.render=function(e){if(this.shouldRender){this.shouldRender=!1,this.primaryCursor.render(e);for(var t=0,n=this.secondaryCursors.length;n>t;t++)this.secondaryCursors[t].render(e);this.currentLine.style.top=this.primaryCursor.getPositionTop()+"px",this.currentLine.style.width=e.scrollWidth+"px"}},t}(s.ViewEventHandler);t.ViewCursors=u}),define("vs/css!vs/editor/core/view/contentWidgets/contentWidgets",["vs/css!vs/editor/editor.main"],{});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/editor/core/view/contentWidgets/contentWidgets",["require","exports","vs/editor/core/view/viewContext","vs/editor/editor","vs/editor/core/view/viewEventHandler","vs/css!./contentWidgets"],function(e,t,n,i,o){"use strict";var r=n,s=i,a=o,u=function(e){function t(t){e.call(this),this.context=t,this.widgets={},this.contentWidth=0,this.shouldRender=!0,this.domNode=document.createElement("div"),this.domNode.className=r.ClassNames.CONTENT_WIDGETS,this.context.addEventHandler(this)}return __extends(t,e),t.prototype.dispose=function(){this.context.removeEventHandler(this),this.context=null,this.widgets=null,this.domNode=null},t.prototype.onModelFlushed=function(){return!0},t.prototype.onModelDecorationsChanged=function(){return!1},t.prototype.onModelLinesDeleted=function(){return!0},t.prototype.onModelLineChanged=function(){return!0},t.prototype.onModelLinesInserted=function(){return!0},t.prototype.onCursorPositionChanged=function(){return!1},t.prototype.onCursorSelectionChanged=function(){return!1},t.prototype.onCursorRevealRange=function(){return!1},t.prototype.onConfigurationChanged=function(){return!0},t.prototype.onConfigurationFontChanged=function(){return!0},t.prototype.onConfigurationLineHeightChanged=function(){return!0},t.prototype.onLayoutChanged=function(e){this.contentWidth=e.contentWidth;var t;for(t in this.widgets)this.widgets.hasOwnProperty(t)&&(this.widgets[t].widget.getDomNode().style.maxWidth=this.contentWidth+"px");return!0},t.prototype.onScrollChanged=function(e){return e.vertical},t.prototype.onZonesChanged=function(){return!0},t.prototype.onScrollWidthChanged=function(){return!1},t.prototype.onScrollHeightChanged=function(){return!1},t.prototype.addWidget=function(e){this.widgets[e.getId()]={widget:e,position:null,preference:null,isVisible:!1};var t=e.getDomNode();t.style.position="absolute",t.style.maxWidth=this.contentWidth+"px",t.style.top="-1000px",t.setAttribute("widgetId",e.getId()),this.domNode.appendChild(t),this.shouldRender=!0},t.prototype.setWidgetPosition=function(e,t,n){var i=this.widgets[e.getId()];i.position=t,i.preference=n,this.shouldRender=!0},t.prototype.removeWidget=function(e){var t=e.getId();if(this.widgets.hasOwnProperty(t)){var n=this.widgets[t],i=n.widget.getDomNode();i.parentNode.removeChild(i),delete this.widgets[t]}},t.prototype.layoutBoxInViewport=function(e,t,n){var i=n.visibleRangeForPosition(e);if(!i)return null;var o=t.clientWidth,r=t.clientHeight,s=i.top,a=s,u=i.top+i.height,l=n.viewportHeight-u,h=s-r,d=a>=r,c=u,p=l>=r,f=i.left;return f+o>n.viewportLeft+n.viewportWidth&&(f=n.viewportLeft+n.viewportWidth-o),f=o;o++)for(r=0;r0&&t>0,s=n>0&&i>0;o.toggleClass(this.topShadowDomNode,"top",r),o.toggleClass(this.topLeftShadowDomNode,"top",r),o.toggleClass(this.leftShadowDomNode,"left",s),o.toggleClass(this.topLeftShadowDomNode,"left",s)}this._reveal()},onDragStart:function(){this.isDragging=!0,this._reveal()},onDragEnd:function(){this.isDragging=!1,this._hide()},_onMouseOut:function(){this.mouseIsOver=!1,this._hide()},_onMouseOver:function(){this.mouseIsOver=!0,this._reveal()},_reveal:function(){this.verticalScrollbar.reveal(),this.horizontalScrollbar.reveal(),this._beginHide()},_hide:function(){this.mouseIsOver||this.isDragging||(this.verticalScrollbar.hide(),this.horizontalScrollbar.hide())},_beginHide:function(){-1!==this.hideTimeout&&window.clearTimeout(this.hideTimeout),this.hideTimeout=window.setTimeout(this._hide.bind(this),l)},_computeDimensions:function(){var e=this.domNode.clientWidth,t=this.domNode.clientHeight,n=t-(this.options.verticalHasArrows?2*this.options.arrowSize:0)-this.options.horizontalScrollbarSize,i=e-(this.options.horizontalHasArrows?2*this.options.arrowSize:0)-this.options.verticalScrollbarSize; return{width:e,height:t,representableHeight:n,representableWidth:i}},_createOptions:function(e){for(var t=i.clone(d),o=["useNative","arrowSize","zIndexDelta","className","scrollable","horizontal","vertical","horizontalHasArrows","verticalHasArrows","horizontalScrollbarSize","verticalScrollbarSize","flipAxes","useShadows","handleMouseWheel","listenOnDomNode"],r=0;re&&(e=0),this.width!==e&&(this.width=e,this.setScrollWidth(this.scrollWidth),this.setScrollLeft(this.scrollLeft))},t.prototype.getScrollWidth=function(){return this.scrollWidth},t.prototype.setScrollWidth=function(e){ee&&(e=0),e+this.width>this.scrollWidth&&(e=this.scrollWidth-this.width),this.scrollLeft!==e&&(this.scrollLeft=e,this.linesContent.scrollLeft=e,this._emitScrollEvent(!1,!0))},t.prototype.getHeight=function(){return this.height},t.prototype.setHeight=function(e){0>e&&(e=0),this.height!==e&&(this.height=e,this.setScrollHeight(this.scrollHeight),this.setScrollTop(this.scrollTop))},t.prototype.getScrollHeight=function(){return this.scrollHeight},t.prototype.setScrollHeight=function(e){ee&&(e=0),e+this.height>this.scrollHeight&&(e=this.scrollHeight-this.height),this.scrollTop!==e&&(this.scrollTop=e,this._emitScrollEvent(!0,!1))},t._SCROLL_EVENT="scroll",t.prototype._emitScrollEvent=function(e,n){var i={vertical:e,horizontal:n};this.emit(t._SCROLL_EVENT,i)},t.prototype.addScrollListener=function(e){return this.addListener2(t._SCROLL_EVENT,e)},t._INTERNAL_SIZE_CHANGED_EVENT="internalSizeChanged",t.prototype._emitInternalSizeEvent=function(){this.emit(t._INTERNAL_SIZE_CHANGED_EVENT)},t.prototype.addInternalSizeChangeListener=function(e){return this.addListener2(t._INTERNAL_SIZE_CHANGED_EVENT,e)},t}(o.EventEmitter);t.EditorScrollable=r}),define("vs/editor/core/view/layout/scroll/scrollManager",["require","exports","vs/base/ui/scrollbar/scrollableElement","vs/editor/core/constants","vs/editor/core/view/viewContext","vs/editor/core/view/layout/scroll/editorScrollable","vs/base/dom/dom","vs/base/lifecycle"],function(e,t,n,i,o,r,s,a){"use strict";function u(e,t,n){e.hasOwnProperty(n)&&(t[n]=e[n])}var l=n,h=i,d=o,c=r,p=s,f=a,m=function(){function e(e,t,n,i){var o=this;this.toDispose=[],this.configuration=e,this.privateViewEventBus=t,this.linesContent=n,this.scrollable=new c.EditorScrollable(n),this.toDispose.push(this.scrollable),this.toDispose.push(this.scrollable.addScrollListener(function(e){o.privateViewEventBus.emit(h.EventType.ViewScrollChanged,e)}));var r={scrollable:this.scrollable,listenOnDomNode:i,vertical:this.configuration.editor.scrollbar.vertical,horizontal:this.configuration.editor.scrollbar.horizontal,className:d.ClassNames.SCROLLABLE_ELEMENT+" "+this.configuration.editor.theme};u(this.configuration.editor.scrollbar,r,"verticalHasArrows"),u(this.configuration.editor.scrollbar,r,"horizontalHasArrows"),u(this.configuration.editor.scrollbar,r,"verticalScrollbarSize"),u(this.configuration.editor.scrollbar,r,"horizontalScrollbarSize"),u(this.configuration.editor.scrollbar,r,"useShadows"),u(this.configuration.editor.scrollbar,r,"handleMouseWheel"),u(this.configuration.editor.scrollbar,r,"arrowSize"),this.scrollbar=new l.ScrollableElement(n,r),this.toDispose.push(this.scrollable.addInternalSizeChangeListener(function(){o.scrollbar.onElementInternalDimensions()})),this.toDispose.push(this.configuration.addListener2(h.EventType.ConfigurationChanged,function(){o.scrollbar.updateClassName(o.configuration.editor.theme)}));var s=function(e,t,n){if(t){var i=e.scrollTop;i&&(o.scrollable.setScrollTop(o.getScrollTop()+i),e.scrollTop=0)}if(n){var r=e.scrollLeft;r&&(o.scrollable.setScrollLeft(o.getScrollLeft()+r),e.scrollLeft=0)}};this.toDispose.push(p.addDisposableListener(i,"scroll",function(){return s(i,!0,!0)})),this.toDispose.push(p.addDisposableListener(n,"scroll",function(){return s(n,!0,!1)}))}return e.prototype.dispose=function(){this.toDispose=f.disposeAll(this.toDispose),this.scrollable.dispose(),this.scrollbar&&(this.scrollbar.destroy(),this.scrollbar=null)},e.prototype.getVerticalScrollbarWidth=function(){return this.scrollbar.verticalScrollbarWidth},e.prototype.getHorizontalScrollbarHeight=function(){return this.scrollbar.horizontalScrollbarHeight},e.prototype.onSizeProviderLayoutChanged=function(){this.scrollbar&&this.scrollbar.onElementDimensions()},e.prototype.getScrolledTopFromAbsoluteTop=function(e){return e-this.scrollable.getScrollTop()},e.prototype.getOverviewRulerLayoutInfo=function(){return this.scrollbar?this.scrollbar.getOverviewRulerLayoutInfo():null},e.prototype.getScrollbarContainerDomNode=function(){return this.scrollbar?this.scrollbar.getDomNode():this.linesContent},e.prototype.delegateVerticalScrollbarMouseDown=function(e){this.scrollbar&&this.scrollbar.delegateVerticalScrollbarMouseDown(e)},e.prototype.getWidth=function(){return this.scrollable.getWidth()},e.prototype.setWidth=function(e){this.scrollable.setWidth(e)},e.prototype.getHeight=function(){return this.scrollable.getHeight()},e.prototype.setHeight=function(e){this.scrollable.setHeight(e)},e.prototype.getScrollHeight=function(){return this.scrollable.getScrollHeight()},e.prototype.setScrollHeight=function(e){this.scrollable.setScrollHeight(e)},e.prototype.getScrollWidth=function(){return this.scrollable.getScrollWidth()},e.prototype.setScrollWidth=function(e){this.scrollable.setScrollWidth(e)},e.prototype.getScrollLeft=function(){return this.scrollable.getScrollLeft()},e.prototype.setScrollLeft=function(e){this.scrollable.setScrollLeft(e)},e.prototype.getScrollTop=function(){return this.scrollable.getScrollTop()},e.prototype.setScrollTop=function(e){this.scrollable.setScrollTop(e)},e.prototype.addScrollListener=function(e){return this.scrollable.addScrollListener(e)},e}();t.ScrollManager=m});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/editor/core/view/layout/layoutProvider",["require","exports","vs/editor/core/constants","vs/editor/core/view/viewContext","vs/editor/core/view/layout/lines/linesLayout","vs/editor/core/view/viewEventHandler","vs/editor/core/view/layout/elementSizeObserver","vs/editor/core/view/layout/characterSizeProvider","vs/editor/core/view/layout/editorLayoutProvider","vs/editor/core/view/layout/layout","vs/editor/core/view/layout/scroll/scrollManager","vs/base/lifecycle"],function(e,t,n,i,o,r,s,a,u,l,h,d){"use strict";var c=n,p=o,f=r,m=s,g=a,v=u,y=h,C=function(e){function t(t,n,i,o,r,s){var a=this;e.call(this),this.configuration=n,this.privateViewEventBus=o,this.model=i,this.scrollManager=new y.ScrollManager(n,o,r,s),this.charSizeProvider=new g.CharacterSizeProvider(this.configuration),this.editorLayoutProvider=new v.EditorLayoutProvider(-1,-1,this.configuration.editor.lineHeight,this.configuration.editor.glyphMargin,this.configuration.editor.lineNumbers,this.configuration.editor.lineNumbersMinChars,this.charSizeProvider.maxDigitWidth()),this.editorLayoutProvider.setLineCount(this.model.getLineCount()),this.editorLayoutProvider.setScrollbarSize(this.scrollManager.getVerticalScrollbarWidth(),this.scrollManager.getHorizontalScrollbarHeight()),this.elementSizeObserver=new m.ElementSizeObserver(t,function(e,t){return a._onContainerSizeChanged(e,t)}),this.configuration.editor.automaticLayout&&this.elementSizeObserver.startObserving(),this.linesLayout=new p.LinesLayout(n,i,this.getLayoutInfo().contentWidth),this._updatePageSize(),this._updateHeight()}return __extends(t,e),t.LINES_HORIZONTAL_EXTRA_PX=30,t.prototype.dispose=function(){this.elementSizeObserver.dispose(),this.scrollManager.dispose()},t.prototype.layout=function(){this.elementSizeObserver.observe()},t.prototype.updateLineCount=function(){var e=this.editorLayoutProvider.setLineCount(this.model.getLineCount());e&&this._emitLayoutChangedEvent()},t.prototype.onZonesChanged=function(){return this._updateHeight(),!1},t.prototype.onModelFlushed=function(){return this.linesLayout.onModelFlushed(),this.updateLineCount(),this._updateHeight(),!1},t.prototype.onModelLinesDeleted=function(e){return this.linesLayout.onModelLinesDeleted(e),this.updateLineCount(),this._updateHeight(),!1},t.prototype.onModelLineChanged=function(e){return this.linesLayout.onModelLineChanged(e),!1},t.prototype.onModelLinesInserted=function(e){return this.linesLayout.onModelLinesInserted(e),this.updateLineCount(),this._updateHeight(),!1},t.prototype.onConfigurationChanged=function(e){var t=this.linesLayout.getCenteredLineInViewport(this.getCurrentViewport()),n=this.editorLayoutProvider.setShowLineNumbers(this.configuration.editor.lineNumbers);return n=this.editorLayoutProvider.setLineNumbersMinChars(this.configuration.editor.lineNumbersMinChars)||n,n=this.editorLayoutProvider.setGlyphMargin(this.configuration.editor.glyphMargin)||n,this._updateWrappingColumn(this.getLayoutInfo(),t),n&&this._emitLayoutChangedEvent(),this.linesLayout.onConfigurationChanged(e),this._updateHeight(),!1},t.prototype.onConfigurationLineHeightChanged=function(){this._updatePageSize();var e=this.editorLayoutProvider.setLineHeight(this.configuration.editor.lineHeight);return e&&this._emitLayoutChangedEvent(),this._updateHeight(),!1},t.prototype.onConfigurationFontChanged=function(){var e=this.linesLayout.getCenteredLineInViewport(this.getCurrentViewport()),t=this.charSizeProvider.doMeasurements();if(t){var n=this.editorLayoutProvider.setMaxDigitWidth(this.charSizeProvider.maxDigitWidth());n&&this._emitLayoutChangedEvent()}return this._updateWrappingColumn(this.getLayoutInfo(),e),!1},t.prototype._updateHeight=function(){var e=this.scrollManager.getScrollHeight();this.scrollManager.setScrollHeight(this.getTotalHeight());var t=this.scrollManager.getScrollHeight();e!==t&&this.privateViewEventBus.emit(c.EventType.ViewScrollHeightChanged,t)},t.prototype._updateWrappingColumn=function(e,t){var n=this.configuration.getWrappingColumn(),i=-1;0===n?i=Math.max(1,Math.floor((e.contentWidth-e.verticalScrollbarWidth)/this.configuration.editor.thinnestCharacterWidth)):n>0&&(i=n),this.model.setWrappingColumn(i,t)},t.prototype._onContainerSizeChanged=function(e,t){var n=this.linesLayout?this.linesLayout.getCenteredLineInViewport(this.getCurrentViewport()):0,i=this.editorLayoutProvider.setDimensions(e,t);i&&(this._updatePageSize(),this._emitLayoutChangedEvent(n))},t.prototype._updatePageSize=function(){var e=this.editorLayoutProvider.getLayoutInfo();this.configuration.editor.pageSize=Math.floor(e.height/this.configuration.editor.lineHeight)-2},t.prototype.getLayoutInfo=function(){var e=this.editorLayoutProvider.getLayoutInfo(),t=this.scrollManager.getOverviewRulerLayoutInfo();return e.overviewRuler={top:t.top,width:t.width,height:e.height-t.top-t.bottom,right:0},e},t.prototype.getCurrentViewport=function(){var e=this.editorLayoutProvider.getLayoutInfo();return{top:this.scrollManager.getScrollTop(),left:this.scrollManager.getScrollLeft(),width:e.contentWidth,height:e.contentHeight}},t.prototype._emitLayoutChangedEvent=function(e){"undefined"==typeof e&&(e=0),this.scrollManager.onSizeProviderLayoutChanged();var t=this.getLayoutInfo();this.linesLayout&&this.linesLayout.onWrappingWidthChanged(t.contentWidth),this.scrollManager.setWidth(t.contentWidth),this.scrollManager.setHeight(t.contentHeight),this._updateWrappingColumn(t,e),this.privateViewEventBus.emit(c.EventType.ViewLayoutChanged,t)},t.prototype.emitLayoutChangedEvent=function(){this._emitLayoutChangedEvent()},t.prototype._computeScrollWidth=function(e,n){var i=this.configuration.getWrappingColumn(),o=0===i;return this.configuration.editor.viewWordWrap||o?Math.max(e,n):Math.max(e+t.LINES_HORIZONTAL_EXTRA_PX,n)},t.prototype.onMaxLineWidthChanged=function(e){var t=this._computeScrollWidth(e,this.getCurrentViewport().width),n=this.scrollManager.getScrollWidth();this.scrollManager.setScrollWidth(t);var t=this.scrollManager.getScrollWidth();t!==n&&(this.privateViewEventBus.emit(c.EventType.ViewScrollWidthChanged),this._updateHeight())},t.prototype.saveState=function(){return{scrollTop:this.scrollManager.getScrollTop(),scrollLeft:this.scrollManager.getScrollLeft(),linesDomNodeWidth:this.scrollManager.getScrollWidth()}},t.prototype.restoreState=function(e){this.scrollManager.setScrollTop(e.scrollTop),this.scrollManager.setScrollLeft(e.scrollLeft)},t.prototype.addWhitespace=function(e,t){return this.linesLayout.addWhitespace(e,t)},t.prototype.changeWhitespace=function(e,t){return this.linesLayout.changeWhitespace(e,t)},t.prototype.changeAfterLineNumberForWhitespace=function(e,t){return this.linesLayout.changeAfterLineNumberForWhitespace(e,t)},t.prototype.removeWhitespace=function(e){return this.linesLayout.removeWhitespace(e)},t.prototype.getVerticalOffsetForLineNumber=function(e){return this.linesLayout.getVerticalOffsetForLineNumber(e)},t.prototype.updateLineHeights=function(e,t){this.linesLayout.updateLineHeights(e,t),this._updateHeight()},t.prototype.heightInPxForLine=function(e){return this.linesLayout.heightInPxForLine(e)},t.prototype.getLineNumberAtVerticalOffset=function(e){return this.linesLayout.getLineNumberAtVerticalOffset(e)},t.prototype.getLinesTotalHeight=function(){return this.linesLayout.getLinesTotalHeight()},t.prototype.getTotalHeight=function(){var e=0;return this.scrollManager.getScrollWidth()>this.scrollManager.getWidth()&&(e=this.scrollManager.getHorizontalScrollbarHeight()),this.linesLayout.getTotalHeight(this.getCurrentViewport(),e)},t.prototype.getWhitespaceAtVerticalOffset=function(e){return this.linesLayout.getWhitespaceAtVerticalOffset(e)},t.prototype.getLinesViewportData=function(e){return this.linesLayout.getLinesViewportData(e,this.getCurrentViewport())},t.prototype.getWhitespaceViewportData=function(){return this.linesLayout.getWhitespaceViewportData(this.getCurrentViewport())},t.prototype.getOverviewRulerInsertData=function(){var e=this.scrollManager.getOverviewRulerLayoutInfo();return{parent:e.parent,insertBefore:e.insertBefore}},t.prototype.getScrollbarContainerDomNode=function(){return this.scrollManager.getScrollbarContainerDomNode()},t.prototype.delegateVerticalScrollbarMouseDown=function(e){this.scrollManager.delegateVerticalScrollbarMouseDown(e)},t.prototype.getScrollHeight=function(){return this.scrollManager.getScrollHeight()},t.prototype.getScrollWidth=function(){return this.scrollManager.getScrollWidth()},t.prototype.getScrollLeft=function(){return this.scrollManager.getScrollLeft()},t.prototype.setScrollLeft=function(e){this.scrollManager.setScrollLeft(e)},t.prototype.getScrollTop=function(){return this.scrollManager.getScrollTop()},t.prototype.setScrollTop=function(e){this.scrollManager.setScrollTop(e)},t.prototype.getScrolledTopFromAbsoluteTop=function(e){return this.scrollManager.getScrolledTopFromAbsoluteTop(e)},t}(f.ViewEventHandler);t.LayoutProvider=C}),define("vs/css!vs/editor/core/view/selections/selections",["vs/css!vs/editor/editor.main"],{});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/editor/core/view/selections/selections",["require","exports","vs/editor/core/view/viewOverlays","vs/editor/core/view/viewContext","vs/editor/core/view/viewEventHandler","vs/css!./selections"],function(e,t,n,i,o){"use strict";var r,s=o;!function(e){e._map=[],e._map[0]="EXTERN",e.EXTERN=0,e._map[1]="INTERN",e.INTERN=1,e._map[2]="FLAT",e.FLAT=2}(r||(r={}));var a=function(e){function t(t){e.call(this),this.context=t,this.selections=[],this.contentLeft=0,this.previousRender=null,this.horizontalScrollChanged=!1,this.context.addEventHandler(this)}return __extends(t,e),t.SELECTION_CLASS_NAME="selected-text",t.SELECTION_TOP_LEFT="top-left-radius",t.SELECTION_BOTTOM_LEFT="bottom-left-radius",t.SELECTION_TOP_RIGHT="top-right-radius",t.SELECTION_BOTTOM_RIGHT="bottom-right-radius",t.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background",t.ROUNDED_PIECE_WIDTH=10,t.prototype.dispose=function(){this.context.removeEventHandler(this),this.context=null,this.selections=null,this.previousRender=null},t.prototype.onModelFlushed=function(){return!0},t.prototype.onModelDecorationsChanged=function(){return!1},t.prototype.onModelLinesDeleted=function(){return!0},t.prototype.onModelLineChanged=function(){return!0},t.prototype.onModelLinesInserted=function(){return!0},t.prototype.onCursorPositionChanged=function(){return!1},t.prototype.onCursorSelectionChanged=function(e){return this.selections=[e.selection],this.selections=this.selections.concat(e.secondarySelections),!0},t.prototype.onCursorRevealRange=function(){return!1},t.prototype.onConfigurationChanged=function(){return!0},t.prototype.onConfigurationFontChanged=function(){return!0},t.prototype.onConfigurationLineHeightChanged=function(){return!0},t.prototype.onLayoutChanged=function(e){return this.contentLeft=e.contentLeft,!0},t.prototype.onScrollChanged=function(e){return e.horizontal&&(this.horizontalScrollChanged=!0),e.vertical},t.prototype.onZonesChanged=function(){return!0},t.prototype.onScrollWidthChanged=function(){return!1},t.prototype.onScrollHeightChanged=function(){return!1},t.prototype.visibleRangesHaveGaps=function(e){if(e.length<=1)return!1;var t,n,i,o;for(t=e[0].top,i=1,o=e.length;o>i;i++){if(n=e[i].top,n===t)return!0;t=n}return!1},t.prototype.enrichVisibleRangesWithStyle=function(e){var t,n,i,o,s,a,u,l,h,d,c;for(d=0,c=e.length;c>d;d++)t=e[d],n=t.left,i=t.left+t.width,l={top:r.EXTERN,bottom:r.EXTERN},h={top:r.EXTERN,bottom:r.EXTERN},d>0&&(o=e[d-1].left,s=e[d-1].left+e[d-1].width,n===o?l.top=r.FLAT:n>o&&(l.top=r.INTERN),i===s?h.top=r.FLAT:i>o&&s>i&&(h.top=r.INTERN)),c>d+1&&(a=e[d+1].left,u=e[d+1].left+e[d+1].width,n===a?l.bottom=r.FLAT:n>a&&u>n&&(l.bottom=r.INTERN),i===u?h.bottom=r.FLAT:u>i&&(h.bottom=r.INTERN)),t.startStyle=l,t.endStyle=h},t.prototype.getVisibleRangesWithStyle=function(e,t){var n=t.visibleRangesForRange(e,!0),i=n?n.toArray():[],o=this.visibleRangesHaveGaps(i);return!o&&this.context.configuration.editor.roundedSelection&&this.enrichVisibleRangesWithStyle(i),i},t.prototype.createSelectionPiece=function(e,t,n,i,o,r,s,a,u){s.push('
      ')},t.prototype.actualRenderOneSelection=function(e,n,i,o,s){var a,u,l,h=e.length>0&&e[0].startStyle,d=this.context.configuration.editor.lineHeight.toString();for(u=0;u'),i=0;i"),{html:o,lefts:r,leftsIndices:s}},t.prototype.shouldCallRender=function(){return this.shouldRender||this.horizontalScrollChanged},t.prototype.render=function(e){if(this.shouldRender)this.previousRender=this.actualRender(e),this.shouldRender=!1,this.horizontalScrollChanged=!1;else if(this.horizontalScrollChanged){var t,n,i=this.previousRender.html,o=this.previousRender.lefts,r=this.previousRender.leftsIndices;for(t=0,n=o.length;n>t;t++)i[r[t]]=(o[t]-e.viewportLeft).toString();this.horizontalScrollChanged=!1}return this.previousRender.html},t}(s.ViewEventHandler);t.SelectionsOverlay=a}),define("vs/css!vs/editor/core/view/decorations/decorations",["vs/css!vs/editor/editor.main"],{});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/editor/core/view/decorations/decorations",["require","exports","vs/editor/core/view/viewOverlays","vs/editor/core/view/viewEventHandler","vs/css!./decorations"],function(e,t,n,i){"use strict";var o=i,r=function(e){function t(t){e.call(this),this.context=t,this.contentLeft=0,this.previousRender=null,this.horizontalScrollChanged=!1,this.context.addEventHandler(this)}return __extends(t,e),t.prototype.dispose=function(){this.context.removeEventHandler(this),this.context=null,this.previousRender=null},t.prototype.onModelFlushed=function(){return!0},t.prototype.onModelDecorationsChanged=function(){return!0},t.prototype.onModelLinesDeleted=function(){return!0},t.prototype.onModelLineChanged=function(){return!0},t.prototype.onModelLinesInserted=function(){return!0},t.prototype.onCursorPositionChanged=function(){return!1},t.prototype.onCursorSelectionChanged=function(){return!1},t.prototype.onCursorRevealRange=function(){return!1},t.prototype.onConfigurationChanged=function(){return!0},t.prototype.onConfigurationFontChanged=function(){return!0},t.prototype.onConfigurationLineHeightChanged=function(){return!0},t.prototype.onLayoutChanged=function(e){return this.contentLeft=e.contentLeft,!0},t.prototype.onScrollChanged=function(e){return e.horizontal&&(this.horizontalScrollChanged=!0),e.vertical},t.prototype.onZonesChanged=function(){return!0},t.prototype.onScrollWidthChanged=function(){return!0},t.prototype.onScrollHeightChanged=function(){return!1},t.prototype.actualRender=function(e){var t,n,i,o,r,s,a,u,l=[],h=[],d=[],c=this.context.model.getDecorationsInRange(e.visibleRange),p=this.context.configuration.editor.lineHeight.toString();for(l.push('
      '),s=0,a=c.length;a>s;s++)if(t=c[s],n=t.range,t.options.className)if(t.options.isWholeLine)for(u=n.startLineNumber;u<=n.endLineNumber;u++)e.lineIsVisible(u)&&(o=e.heightInPxForLine(u),r=e.getViewportVerticalOffsetForLineNumber(u),l.push('
      '));else if(i=e.visibleRangesForRange(n,!1))for(;i.next();)l.push('
      ');return l.push("
      "),{html:l,lefts:h,leftsIndices:d}},t.prototype.shouldCallRender=function(){return this.shouldRender||this.horizontalScrollChanged},t.prototype.render=function(e){if(this.shouldRender)this.previousRender=this.actualRender(e),this.shouldRender=!1,this.horizontalScrollChanged=!1;else if(this.horizontalScrollChanged){var t,n,i=this.previousRender.html,o=this.previousRender.lefts,r=this.previousRender.leftsIndices;for(t=0,n=o.length;n>t;t++)i[r[t]]=(o[t]-e.viewportLeft).toString();this.horizontalScrollChanged=!1}return this.previousRender.html},t}(o.ViewEventHandler);t.DecorationsOverlay=r}),define("vs/css!vs/editor/core/view/glyphMargin/glyphMargin",["vs/css!vs/editor/editor.main"],{});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/editor/core/view/glyphMargin/glyphMargin",["require","exports","vs/editor/core/view/viewOverlays","vs/editor/core/view/viewContext","vs/editor/core/view/viewEventHandler","vs/css!./glyphMargin"],function(e,t,n,i,o){"use strict";var r=i,s=o,a=function(e){function t(t){e.call(this),this.context=t,this.glyphMarginLeft=0,this.glyphMarginWidth=0,this.previousRender=[],this.context.addEventHandler(this)}return __extends(t,e),t.prototype.dispose=function(){this.context.removeEventHandler(this),this.context=null,this.previousRender=null},t.prototype.onModelFlushed=function(){return!0},t.prototype.onModelDecorationsChanged=function(){return!0},t.prototype.onModelLinesDeleted=function(){return!0},t.prototype.onModelLineChanged=function(){return!0},t.prototype.onModelLinesInserted=function(){return!0},t.prototype.onCursorPositionChanged=function(){return!1},t.prototype.onCursorSelectionChanged=function(){return!1},t.prototype.onCursorRevealRange=function(){return!1},t.prototype.onConfigurationChanged=function(){return!0},t.prototype.onConfigurationFontChanged=function(){return!0},t.prototype.onConfigurationLineHeightChanged=function(){return!0},t.prototype.onLayoutChanged=function(e){return this.glyphMarginLeft=e.glyphMarginLeft,this.glyphMarginWidth=e.glyphMarginWidth,!0},t.prototype.onScrollChanged=function(e){return e.vertical},t.prototype.onZonesChanged=function(){return!0},t.prototype.onScrollWidthChanged=function(){return!1},t.prototype.onScrollHeightChanged=function(){return!1},t.prototype.actualRender=function(e){var t=[];if(!this.context.configuration.editor.glyphMargin)return t;var n,i,o,s,a,u,l,h,d,c=this.context.model.getDecorationsInRange(e.visibleRange),p=this.context.configuration.editor.lineHeight.toString(),f={};for(s=0,a=c.length;a>s;s++)if(n=c[s],n.options.glyphMarginClassName)if(i=n.range,n.options.isWholeLine)for(d=i.startLineNumber;d<=i.endLineNumber;d++)e.lineIsVisible(d)&&(u=e.getViewportVerticalOffsetForLineNumber(d),f.hasOwnProperty(u.toString())||(f[u.toString()]={}),f[u.toString()][n.options.glyphMarginClassName]=!0);else if(o=e.visibleRangesForRange(i,!1))for(;o.next();)u=o.getTop(),f.hasOwnProperty(u.toString())||(f[u.toString()]={}),f[u.toString()][n.options.glyphMarginClassName]=!0;t.push('
      ');for(l in f){t.push('
      ')}return t.push("
      "),t},t.prototype.shouldCallRender=function(){return this.shouldRender},t.prototype.render=function(e){return this.shouldRender&&(this.previousRender=this.actualRender(e),this.shouldRender=!1),this.previousRender},t}(s.ViewEventHandler);t.GlyphMarginOverlay=a}),define("vs/css!vs/editor/core/view/linesDecorations/linesDecorations",["vs/css!vs/editor/editor.main"],{});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/editor/core/view/linesDecorations/linesDecorations",["require","exports","vs/editor/core/view/viewOverlays","vs/editor/core/view/viewContext","vs/editor/core/view/viewEventHandler","vs/css!./linesDecorations"],function(e,t,n,i,o){"use strict";var r=i,s=o,a=function(e){function t(t){e.call(this),this.context=t,this.decorationsLeft=0,this.decorationsWidth=0,this.previousRender=[],this.context.addEventHandler(this)}return __extends(t,e),t.prototype.dispose=function(){this.context.removeEventHandler(this),this.context=null,this.previousRender=null},t.prototype.onModelFlushed=function(){return!0},t.prototype.onModelDecorationsChanged=function(){return!0},t.prototype.onModelLinesDeleted=function(){return!0},t.prototype.onModelLineChanged=function(){return!0},t.prototype.onModelLinesInserted=function(){return!0},t.prototype.onCursorPositionChanged=function(){return!1},t.prototype.onCursorSelectionChanged=function(){return!1},t.prototype.onCursorRevealRange=function(){return!1},t.prototype.onConfigurationChanged=function(){return!0},t.prototype.onConfigurationFontChanged=function(){return!0},t.prototype.onConfigurationLineHeightChanged=function(){return!0},t.prototype.onLayoutChanged=function(e){return this.decorationsLeft=e.decorationsLeft,this.decorationsWidth=e.decorationsWidth,!0},t.prototype.onScrollChanged=function(e){return e.vertical},t.prototype.onZonesChanged=function(){return!0},t.prototype.onScrollWidthChanged=function(){return!1},t.prototype.onScrollHeightChanged=function(){return!1},t.prototype.actualRender=function(e){var t,n,i,o,s,a,u,l,h,d=[],c=this.context.model.getDecorationsInRange(e.visibleRange),p=this.context.configuration.editor.lineHeight.toString(),f={};for(o=0,s=c.length;s>o;o++)if(t=c[o],t.options.linesDecorationsClassName)if(n=t.range,t.options.isWholeLine)for(h=n.startLineNumber;h<=n.endLineNumber;h++)e.lineIsVisible(h)&&(a=e.getViewportVerticalOffsetForLineNumber(h),f.hasOwnProperty(a.toString())||(f[a.toString()]={}),f[a.toString()][t.options.linesDecorationsClassName]=!0);else if(i=e.visibleRangesForRange(n,!1))for(;i.next();)a=i.getTop(),f.hasOwnProperty(a.toString())||(f[a.toString()]={}),f[a.toString()][t.options.linesDecorationsClassName]=!0;d.push('
      '); for(u in f){d.push('
      ')}return d.push("
      "),d},t.prototype.shouldCallRender=function(){return this.shouldRender},t.prototype.render=function(e){return this.shouldRender&&(this.previousRender=this.actualRender(e),this.shouldRender=!1),this.previousRender},t}(s.ViewEventHandler);t.LinesDecorationsOverlay=a}),define("vs/css!vs/editor/core/view/lineNumbers/lineNumbers",["vs/css!vs/editor/editor.main"],{});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/editor/core/view/lineNumbers/lineNumbers",["require","exports","vs/editor/core/view/viewOverlays","vs/editor/core/view/viewContext","vs/editor/core/view/viewEventHandler","vs/css!./lineNumbers"],function(e,t,n,i,o){"use strict";var r=i,s=o,a=function(e){function t(t){e.call(this),this.context=t,this.lineNumbersLeft=0,this.lineNumbersWidth=0,this.previousRender=[],this.context.addEventHandler(this)}return __extends(t,e),t.prototype.dispose=function(){this.context.removeEventHandler(this),this.context=null,this.previousRender=null},t.prototype.onModelFlushed=function(){return!0},t.prototype.onModelDecorationsChanged=function(){return!1},t.prototype.onModelLinesDeleted=function(){return!0},t.prototype.onModelLineChanged=function(){return!0},t.prototype.onModelLinesInserted=function(){return!0},t.prototype.onCursorPositionChanged=function(){return!1},t.prototype.onCursorSelectionChanged=function(){return!1},t.prototype.onCursorRevealRange=function(){return!1},t.prototype.onConfigurationChanged=function(){return!0},t.prototype.onConfigurationFontChanged=function(){return!0},t.prototype.onConfigurationLineHeightChanged=function(){return!0},t.prototype.onLayoutChanged=function(e){return this.lineNumbersLeft=e.lineNumbersLeft,this.lineNumbersWidth=e.lineNumbersWidth,!0},t.prototype.onScrollChanged=function(e){return e.vertical},t.prototype.onZonesChanged=function(){return!0},t.prototype.onScrollWidthChanged=function(){return!1},t.prototype.onScrollHeightChanged=function(){return!1},t.prototype.actualRender=function(e){var t=[];if(!this.context.configuration.editor.lineNumbers)return t;var n,i;for(t.push('
      '),i=e.visibleRange.startLineNumber;i<=e.visibleRange.endLineNumber;i++)n=e.getViewportVerticalOffsetForLineNumber(i),t.push('
      '),t.push(this.context.model.getLineRenderLineNumber(i)),t.push("
      ");return t.push("
      "),t},t.prototype.shouldCallRender=function(){return this.shouldRender},t.prototype.render=function(e){return this.shouldRender&&(this.previousRender=this.actualRender(e),this.shouldRender=!1),this.previousRender},t}(s.ViewEventHandler);t.LineNumbersOverlay=a});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/editor/core/view/view",["require","exports","vs/nls!vs/editor/editor.main","vs/base/dom/dom","vs/base/eventEmitter","vs/editor/core/constants","vs/editor/core/view/viewContext","vs/editor/core/controller/keyboardHandler","vs/editor/core/controller/pointerHandler","vs/editor/core/view/zones/zones","vs/editor/core/view/lines/viewLines","vs/editor/core/view/overviewRuler/overviewRuler","vs/editor/core/view/overviewRuler/decorationsOverviewRuler","vs/editor/core/view/viewCursors/viewCursors","vs/editor/core/view/contentWidgets/contentWidgets","vs/editor/core/view/overlayWidgets/overlayWidgets","vs/editor/core/view/layout/layoutProvider","vs/editor/core/view/viewEventHandler","vs/editor/core/view/viewEventDispatcher","vs/editor/core/range","vs/base/env","vs/base/errors","vs/editor/core/view/viewController","vs/editor/core/view/viewOverlays","vs/editor/core/view/selections/selections","vs/editor/core/view/decorations/decorations","vs/editor/core/view/glyphMargin/glyphMargin","vs/editor/core/view/linesDecorations/linesDecorations","vs/editor/core/view/lineNumbers/lineNumbers","vs/base/lifecycle"],function(e,t,n,i,o,r,s,a,u,l,h,d,c,p,f,m,g,v,y,C,_,b,w,E,S,L,T,N,M,x){"use strict";var R=n,I=i,k=o,D=r,O=s,P=a,A=u,W=l,H=h,V=d,F=c,U=p,B=f,z=m,q=g,j=v,G=y,K=C,Z=_,X=b,J=w,Y=E,$=S,Q=L,et=T,tt=N,nt=M,it=x,ot=function(e){function t(t,n,i,o){var r=this;e.call(this),this.outgoingEventBus=new k.EventEmitter;var s=new J.ViewController(o,i,this.outgoingEventBus);this.listenersToRemove=[],this.listenersToDispose=[],this.eventDispatcher=new G.ViewEventDispatcher(function(e){return r._renderOnce(e)}),this.linesContent=document.createElement("div"),this.linesContent.className="lines-content",this.domNode=document.createElement("div"),this.domNode.className=i.getEditorClassName(),this.layoutProvider=new q.LayoutProvider(n,i,o,this.eventDispatcher,this.linesContent,this.domNode),this.eventDispatcher.addEventHandler(this.layoutProvider),this.context=new O.ViewContext(t,i,o,this.eventDispatcher,function(e){return r.eventDispatcher.addEventHandler(e)},function(e){return r.eventDispatcher.removeEventHandler(e)}),this.createTextArea(),this.createViewParts(),this.keyboardHandler=new P.KeyboardHandler(this.context,s,this.textArea,this.accessiblilityOutput),this.pointerHandler=new A.PointerHandler(this.context,s,this.createPointerHandlerHelper()),this.hasFocus=!1,this.renderOnceCount=0,this.isRendering=!1,this.codeEditorHelper=null,this.eventDispatcher.addEventHandler(this),this.listenersToRemove.push(o.addBulkListener(function(e){return r.eventDispatcher.emitMany(e)}))}return __extends(t,e),t.prototype.createTextArea=function(){var e=this;this.textArea=document.createElement("textarea"),this.textArea.className=O.ClassNames.TEXTAREA,this.textArea.setAttribute("wrap","off"),this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",R.localize("vs_editor_core_view_view",0)),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-multiline","true"),this.textArea.style.top="0px",this.textArea.style.left="0px",this.accessiblilityOutput=document.createElement("div"),this.accessiblilityOutput.className="accessibility-output",this.listenersToDispose.push(I.addDisposableListener(this.textArea,"focus",function(){return e._setHasFocus(!0)})),this.listenersToDispose.push(I.addDisposableListener(this.textArea,"blur",function(){return e._setHasFocus(!1)})),this.textAreaCover=document.createElement("div"),this.textAreaCover.className=this.context.configuration.editor.glyphMargin?O.ClassNames.GLYPH_MARGIN+" "+O.ClassNames.TEXTAREA_COVER:this.context.configuration.editor.lineNumbers?O.ClassNames.LINE_NUMBERS+" "+O.ClassNames.TEXTAREA_COVER:"monaco-editor-background "+O.ClassNames.TEXTAREA_COVER,this.textAreaCover.style.position="absolute",this.textAreaCover.style.width="4px",this.textAreaCover.style.height="4px",this.textAreaCover.style.top="0px",this.textAreaCover.style.left="0px"},t.prototype.createViewParts=function(){var e=this;this.viewParts=[],this.viewLines=new H.ViewLines(this.context,this.layoutProvider),this.viewZones=new W.ViewZones(this.context,this.layoutProvider),this.viewParts.push(this.viewZones);var t=new F.DecorationsOverviewRuler(this.context,this.layoutProvider.getScrollHeight(),function(t){return e.layoutProvider.getVerticalOffsetForLineNumber(t)});this.viewParts.push(t);var n=new Y.ViewOverlays(this.context);if(this.viewParts.push(n),n.addDynamicOverlay(new et.GlyphMarginOverlay(this.context)),n.addDynamicOverlay(new tt.LinesDecorationsOverlay(this.context)),n.addDynamicOverlay(new nt.LineNumbersOverlay(this.context)),n.addDynamicOverlay(new $.SelectionsOverlay(this.context)),n.addDynamicOverlay(new Q.DecorationsOverlay(this.context)),n.addOverlay(new U.ViewCursors(this.context)),this.contentWidgets=new B.ViewContentWidgets(this.context),this.viewParts.push(this.contentWidgets),this.overlayWidgets=new z.ViewOverlayWidgets(this.context),this.viewParts.push(this.overlayWidgets),this.linesContentContainer=this.layoutProvider.getScrollbarContainerDomNode(),this.linesContentContainer.style.position="absolute",t){var i=this.layoutProvider.getOverviewRulerInsertData();i.parent.insertBefore(t.getDomNode(),i.insertBefore)}this.linesContent.appendChild(this.viewZones.domNode),this.linesContent.appendChild(this.viewLines.domNode),this.linesContent.appendChild(this.contentWidgets.domNode),this.domNode.appendChild(n.domNode),this.domNode.appendChild(this.linesContentContainer),this.domNode.appendChild(this.overlayWidgets.domNode),this.domNode.appendChild(this.textArea),this.domNode.appendChild(this.accessiblilityOutput),this.domNode.appendChild(this.textAreaCover)},t.prototype.createPointerHandlerHelper=function(){var e=this;return{viewDomNode:this.domNode,linesContentDomNode:this.linesContent,textArea:this.textArea,getScrollTop:function(){return e.layoutProvider.getScrollTop()},setScrollTop:function(t){return e.layoutProvider.setScrollTop(t)},getScrollLeft:function(){return e.layoutProvider.getScrollLeft()},setScrollLeft:function(t){return e.layoutProvider.setScrollLeft(t)},getLineNumberAtVerticalOffset:function(t){return e.layoutProvider.getLineNumberAtVerticalOffset(t)},getWhitespaceAtVerticalOffset:function(t){return e.layoutProvider.getWhitespaceAtVerticalOffset(t)},getPositionFromDOMInfo:function(t,n){return e.viewLines.getPositionFromDOMInfo(t,n)},visibleRangeForPosition2:function(t,n){var i=e.viewLines.visibleRangesForRange2(new K.Range(t,n,t,n),0,0,!1);if(!i)return null;i.next();var o={top:i.getTop(),left:i.getLeft(),width:i.getWidth(),height:i.getHeight()};return o},getLineWidth:function(t){return e.viewLines.getLineWidth(t)}}},t.prototype.onLayoutChanged=function(e){return this.domNode.style.width=e.width+"px",this.domNode.style.height=e.height+"px",this.linesContent.style.width=e.contentWidth+"px",this.linesContent.style.height=e.contentHeight+"px",this.linesContentContainer.style.left=e.contentLeft+"px",this.linesContentContainer.style.width=e.contentWidth+"px",this.linesContentContainer.style.height=e.contentHeight+"px",this.outgoingEventBus.emit(D.EventType.ViewLayoutChanged,e),!1},t.prototype.onConfigurationChanged=function(){return this.domNode.className=this.context.configuration.getEditorClassName(),!1},t.prototype.onScrollChanged=function(){return this.outgoingEventBus.emit("scroll",{scrollTop:this.layoutProvider.getScrollTop(),scrollLeft:this.layoutProvider.getScrollLeft()}),!1},t.prototype.onViewFocusChanged=function(e){return I.toggleClass(this.domNode,"focused",e),e?this.outgoingEventBus.emit(D.EventType.ViewFocusGained,{}):this.outgoingEventBus.emit(D.EventType.ViewFocusLost,{}),!1},t.prototype.dispose=function(){this.eventDispatcher.removeEventHandler(this),this.outgoingEventBus.dispose(),this.listenersToRemove.forEach(function(e){e()}),this.listenersToRemove=[],this.listenersToDispose=it.disposeAll(this.listenersToDispose),this.keyboardHandler.dispose(),this.pointerHandler.dispose(),this.viewLines.dispose();for(var e=0,t=this.viewParts.length;t>e;e++)this.viewParts[e].dispose();this.viewParts=[],this.layoutProvider.dispose()},t.prototype.getCodeEditorHelper=function(){var e=this;return this.codeEditorHelper||(this.codeEditorHelper={getScrollTop:function(){return e.layoutProvider.getScrollTop()},setScrollTop:function(t){return e.layoutProvider.setScrollTop(t)},getScrollLeft:function(){return e.layoutProvider.getScrollLeft()},setScrollLeft:function(t){return e.layoutProvider.setScrollLeft(t)},getLayoutInfo:function(){return e.layoutProvider.getLayoutInfo()},getVerticalOffsetForLineNumber:function(t){return e.layoutProvider.getVerticalOffsetForLineNumber(t)},delegateVerticalScrollbarMouseDown:function(t){return e.layoutProvider.delegateVerticalScrollbarMouseDown(t)},getOffsetForColumn:function(t,n){var i=e.viewLines.visibleRangesForRange2(new K.Range(t,n,t,n),0,0,!1);return i?(i.next(),i.getLeft()):-1}}),this.codeEditorHelper},t.prototype.layout=function(){var e=this;this._renderOnce(function(){e.layoutProvider.layout()})},t.prototype.getInternalEventBus=function(){return this.outgoingEventBus},t.prototype.saveState=function(){return this.layoutProvider.saveState()},t.prototype.restoreState=function(e){return this.layoutProvider.restoreState(e)},t.prototype.focus=function(){this.textArea.focus(),this._setHasFocus(!0)},t.prototype.createOverviewRuler=function(e,t,n){var i=this;return new V.OverviewRuler(this.context,e,this.layoutProvider.getScrollHeight(),t,n,function(e){return i.layoutProvider.getVerticalOffsetForLineNumber(e)})},t.prototype.change=function(e){var t=this;this._renderOnce(function(){var n=!1,i={addZone:function(e){return n=!0,t.viewZones.addZone(e)},removeZone:function(e){n=t.viewZones.removeZone(e)||n}},o=e(i);return i.addZone=null,i.removeZone=null,n&&t.context.privateViewEventBus.emit(D.EventType.ViewZonesChanged,null),o})},t.prototype.addContentWidget=function(e){var t=this;this._renderOnce(function(){t.contentWidgets.addWidget(e.widget),t.layoutContentWidget(e)})},t.prototype.layoutContentWidget=function(e){var t=this;this._renderOnce(function(){var n=e.position?e.position.position:null,i=e.position?e.position.preference:null;t.contentWidgets.setWidgetPosition(e.widget,n,i)})},t.prototype.removeContentWidget=function(e){this.contentWidgets.removeWidget(e.widget)},t.prototype.addOverlayWidget=function(e){this.overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e)},t.prototype.layoutOverlayWidget=function(e){var t=e.position?e.position.preference:null;this.overlayWidgets.setWidgetPosition(e.widget,t)},t.prototype.removeOverlayWidget=function(e){this.overlayWidgets.removeWidget(e.widget)},t.prototype.render=function(){this.layoutProvider.emitLayoutChangedEvent()},t.prototype.renderOnce=function(e){return this._renderOnce(e)},t.prototype._renderOnce=function(e){var t=this;return this.outgoingEventBus.deferredEmit(function(){t.renderOnceCount++;try{var n=e?e():null}finally{t.renderOnceCount--}if(0===t.renderOnceCount&&!t.isRendering)try{t.isRendering=!0,t.actualRender()}finally{t.isRendering=!1}return n})},t.prototype.createRenderingContext=function(e){var t=this,n=0;(Z.browser.isFirefox||Z.browser.isWebKit)&&(n=this.viewLines.getInnerSpansTopOffset(e.startLineNumber));var i=this.layoutProvider.getCurrentViewport(),o={scrollWidth:this.layoutProvider.getScrollWidth(),scrollHeight:this.layoutProvider.getScrollHeight(),visibleRange:e.visibleRange,viewportWidth:i.width,viewportHeight:i.height,viewportLeft:i.left,getScrolledTopFromAbsoluteTop:function(e){return t.layoutProvider.getScrolledTopFromAbsoluteTop(e)},getViewportVerticalOffsetForLineNumber:function(e){var n=t.layoutProvider.getVerticalOffsetForLineNumber(e),i=t.layoutProvider.getScrolledTopFromAbsoluteTop(n);return i},heightInPxForLine:function(e){return t.layoutProvider.heightInPxForLine(e)},visibleRangesForRange:function(i,o){return t.viewLines.visibleRangesForRange2(i,e.visibleRangesDeltaTop,n,o)},visibleRangeForPosition:function(i){var o=t.viewLines.visibleRangesForRange2(new K.Range(i.lineNumber,i.column,i.lineNumber,i.column),e.visibleRangesDeltaTop,n,!1);if(!o)return null;o.next();var r={top:o.getTop(),left:o.getLeft(),width:o.getWidth(),height:o.getHeight()};return r},visibleRangeForPosition2:function(i,o){var r=t.viewLines.visibleRangesForRange2(new K.Range(i,o,i,o),e.visibleRangesDeltaTop,n,!1);if(!r)return null;r.next();var s={top:r.getTop(),left:r.getLeft(),width:r.getWidth(),height:r.getHeight()};return s},lineIsVisible:function(t){return e.visibleRange.startLineNumber<=t&&t<=e.visibleRange.endLineNumber}};return o},t.prototype.actualRender=function(){if(I.isInDOM(this.domNode)){var e,t;try{var n=this.viewLines.render(),i=[],o=this.createRenderingContext(n);for(e=0,t=this.viewParts.length;t>e;e++)i[e]=this.viewParts[e].prepareRender(o);for(e=0,t=this.viewParts.length;t>e;e++)this.viewParts[e].render(i[e],o)}catch(r){X.onUnexpectedError(r)}}},t.prototype._setHasFocus=function(e){this.hasFocus!==e&&(this.hasFocus=e,this.context.privateViewEventBus.emit(D.EventType.ViewFocusChanged,this.hasFocus))},t}(j.ViewEventHandler);t.View=ot});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/editor/core/codeEditorWidget",["require","exports","vs/base/lib/winjs.base","vs/editor/core/constants","vs/base/objects","vs/base/types","vs/platform/platform","vs/base/dom/dom","vs/base/eventEmitter","vs/editor/core/configuration","vs/editor/core/controller/cursor","vs/editor/core/view/view","vs/editor/core/view/model/characterHardWrappingLineMapper","vs/editor/core/view/model/splitLinesCollection","vs/editor/core/view/model/viewModel","vs/editor/core/position","vs/editor/core/range","vs/editor/core/selection","vs/base/performance/timer","vs/platform/services","vs/editor/editorExtensions","vs/base/ui/actions","vs/editor/editor","vs/css!./../css/editor","vs/css!./../css/default-theme"],function(e,t,n,i,o,r,s,a,u,l,h,d,c,p,f,m,g,v,y,C,_,b,w){"use strict";var E=n,S=i,L=o,T=r,N=s,M=a,x=u,R=l,I=h,k=d,D=c,O=p,P=f,A=m,W=g,H=v,V=y,F=_,U=w,B=0,z=function(e){function t(t,n,i){var o=this;e.call(this);var r=V.start(V.Topic.EDITOR,"CodeEditor.ctor");this.id=++B,this.domElement=t,this.lifetimeListeners=[],n=n||{};var s=null;n.model&&(s=n.model,delete n.model),this.configuration=new R.Configuration(n),this.focusTracker=M.trackFocus(this.domElement),this.focusTracker.addFocusListener(function(){o.emit("widgetFocus",{})}),this.focusTracker.addBlurListener(function(){o.emit("widgetBlur",{})}),this.handlerService=null,this.injectorService=i,i&&T.isFunction(i.injectTo)&&i.injectTo(this),this.handlerService?(this.bindings=this.configuration.bindKeys(this.handlerService),this.bindings.deactivate(),this.lifetimeListeners.push(this.addListener("blur",function(){return o.bindings.deactivate()})),this.lifetimeListeners.push(this.addListener("focus",function(){return o.bindings.activate()}))):this.bindings=null,this._attachModel(s),this.contentWidgets={},this.overlayWidgets={},this.contributions={};for(var a=N.Registry.as(F.Extensions.EditorContributions),u=a.getEditorContributions(),l=0,h=u.length;h>l;l++){var d=u[l],c=d.createNew(this,d);i&&T.isFunction(i.injectTo)&&i.injectTo(c),this.contributions[c.getId()]=c}r.stop()}return __extends(t,e),t.prototype.getEditorType=function(){return S.EditorType.ICodeEditor},t.prototype.injectHandlerService=function(e){this.handlerService=e},t.prototype.destroy=function(){for(;this.lifetimeListeners.length>0;)this.lifetimeListeners.pop()();var t;for(t in this.contributions)this.contributions.hasOwnProperty(t)&&this.contributions[t].dispose();this.contributions={},this.contentWidgets={},this.overlayWidgets={},this.bindings&&(this.bindings.dispose(),this.bindings=null),this.focusTracker.dispose(),this._detachModel(),this.configuration.dispose(),this.emit(S.EventType.Disposed,{}),e.prototype.dispose.call(this)},t.prototype.updateOptions=function(e){e=e||{},this.configuration.updateOptions(e)},t.prototype.getConfiguration=function(){return L.clone(this.configuration.editor)},t.prototype.normalizeIndentation=function(e){return this.configuration.normalizeIndentation(e)},t.prototype.getValue=function(e){if("undefined"==typeof e&&(e=null),this.model){var t=e&&e.preserveBOM?!0:!1,n=U.EndOfLinePreference.TextDefined;return e&&e.lineEnding&&"\n"===e.lineEnding?n=U.EndOfLinePreference.LF:e&&e.lineEnding&&"\r\n"===e.lineEnding&&(n=U.EndOfLinePreference.CRLF),this.model.getValue(n,t)}return""},t.prototype.getView=function(){return this.view},t.prototype.getModel=function(){return this.model},t.prototype.setModel=function(e){"undefined"==typeof e&&(e=null),this.model!==e&&(this._detachModel(),this._attachModel(e),this.emit(S.EventType.ModelChanged))},t.prototype.getDomNode=function(){return this.hasView?this.view.domNode:null},t.prototype.getPosition=function(){return this.cursor?this.cursor.getPosition().clone():null},t.prototype.setPosition=function(e,t,n,i){if("undefined"==typeof t&&(t=!1),"undefined"==typeof n&&(n=!1),"undefined"==typeof i&&(i=!1),this.cursor){if(!A.isIPosition(e))throw new Error("Invalid arguments");this.cursor.setSelections("api",[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}]),t&&this.revealPosition(e,n,i)}},t.prototype.revealPosition=function(e,t,n){if("undefined"==typeof t&&(t=!1),"undefined"==typeof n&&(n=!1),!A.isIPosition(e))throw new Error("Invalid arguments");this.revealRange({startLineNumber:e.lineNumber,startColumn:e.column,endLineNumber:e.lineNumber,endColumn:e.column},t,n)},t.prototype.getSelection=function(){return this.cursor?this.cursor.getSelection().clone():null},t.prototype.getSelections=function(){if(!this.cursor)return null;for(var e=this.cursor.getSelections(),t=[],n=0,i=e.length;i>n;n++)t[n]=e[n].clone();return t},t.prototype.setSelection=function(e,t,n,i){"undefined"==typeof t&&(t=!1),"undefined"==typeof n&&(n=!1),"undefined"==typeof i&&(i=!1);var o=H.isISelection(e),r=W.isIRange(e);if(!o&&!r)throw new Error("Invalid arguments");if(o)this._setSelectionImpl(e,t,n,i);else if(r){var s={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(s,t,n,i)}},t.prototype._setSelectionImpl=function(e,t,n,i){if(this.cursor){var o=new H.Selection(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this.cursor.setSelections("api",[o]),t&&this.revealRange(o,n,i)}},t.prototype.revealRange=function(e,t,n){if("undefined"==typeof t&&(t=!1),"undefined"==typeof n&&(n=!1),this.model&&this.cursor){if(!W.isIRange(e))throw new Error("Invalid arguments");var i=this.model.validateRange(e),o={range:i,viewRange:null,revealVerticalInCenter:t,revealHorizontal:n};this.cursor.emit(S.EventType.CursorRevealRange,o)}},t.prototype.setSelections=function(e){if(this.cursor){if(!e||0===e.length)throw new Error("Invalid arguments");for(var t=0,n=e.length;n>t;t++)if(!H.isISelection(e[t]))throw new Error("Invalid arguments");this.cursor.setSelections("api",e)}},t.prototype.setScrollTop=function(e){if(this.hasView){if("number"!=typeof e)throw new Error("Invalid arguments");this.view.getCodeEditorHelper().setScrollTop(e)}},t.prototype.getScrollTop=function(){return this.hasView?this.view.getCodeEditorHelper().getScrollTop():-1},t.prototype.delegateVerticalScrollbarMouseDown=function(e){this.hasView&&this.view.getCodeEditorHelper().delegateVerticalScrollbarMouseDown(e)},t.prototype.setScrollLeft=function(e){if(this.hasView){if("number"!=typeof e)throw new Error("Invalid arguments");this.view.getCodeEditorHelper().setScrollLeft(e)}},t.prototype.getScrollLeft=function(){return this.hasView?this.view.getCodeEditorHelper().getScrollLeft():-1},t.prototype.saveViewState=function(){if(!this.cursor||!this.hasView)return null;var e=this.cursor.saveState(),t=this.view.saveState();return{cursorState:e,viewState:t}},t.prototype.restoreViewState=function(e){if(this.cursor&&this.hasView){var t=e;if(t&&t.cursorState&&t.viewState){var n=t;this.cursor.restoreState(n.cursorState),this.view.restoreState(n.viewState)}}},t.prototype.layout=function(){this.hasView&&this.view.layout()},t.prototype.onVisible=function(){},t.prototype.onHide=function(){},t.prototype.focus=function(){this.hasView&&this.view.focus()},t.prototype.getContribution=function(e){return this.contributions[e]||null},t.prototype.getActions=function(){var e,t=[];for(e in this.contributions)if(this.contributions.hasOwnProperty(e)){var n=this.contributions[e];T.isFunction(n.isEnabled)&&T.isFunction(n.run)&&t.push(n)}return t},t.prototype.getAction=function(e){var t=this.contributions[e];return t&&T.isFunction(t.isEnabled)&&T.isFunction(t.run)?t:null},t.prototype.trigger=function(e,t,n){var i=this.getAction(t);null!==i?i.isEnabled()&&E.Promise.as(i.run()).done():this.configuration.handlerDispatcher.trigger(e,t,n)},t.prototype.executeCommand=function(e,t){return this.configuration.handlerDispatcher.trigger(e,S.Handler.ExecuteCommand,t)},t.prototype.addContentWidget=function(e){var t={widget:e,position:e.getPosition()};this.contentWidgets[e.getId()]=t,this.hasView&&this.view.addContentWidget(t)},t.prototype.layoutContentWidget=function(e){var t=e.getId();if(this.contentWidgets.hasOwnProperty(t)){var n=this.contentWidgets[t];n.position=e.getPosition(),this.hasView&&this.view.layoutContentWidget(n)}},t.prototype.removeContentWidget=function(e){var t=e.getId();if(this.contentWidgets.hasOwnProperty(t)){var n=this.contentWidgets[t];delete this.contentWidgets[t],this.hasView&&this.view.removeContentWidget(n)}},t.prototype.addOverlayWidget=function(e){var t={widget:e,position:e.getPosition()};this.overlayWidgets[e.getId()]=t,this.hasView&&this.view.addOverlayWidget(t)},t.prototype.layoutOverlayWidget=function(e){var t=e.getId();if(this.overlayWidgets.hasOwnProperty(t)){var n=this.overlayWidgets[t];n.position=e.getPosition(),this.hasView&&this.view.layoutOverlayWidget(n)}},t.prototype.removeOverlayWidget=function(e){var t=e.getId();if(this.overlayWidgets.hasOwnProperty(t)){var n=this.overlayWidgets[t];delete this.overlayWidgets[t],this.hasView&&this.view.removeOverlayWidget(n)}},t.prototype.changeDecorations=function(e){return this.model?this.model.changeDecorations(e,this.id):null},t.prototype.getLineDecorations=function(e){return this.model?this.model.getLineDecorations(e,this.id,this.configuration.editor.readOnly):null},t.prototype.deltaDecorations=function(e,t){return this.model?this.model.deltaDecorations(e,t,this.id):null},t.prototype.changeViewZones=function(e){this.hasView&&this.view.change(e)},t.prototype.addTypingListener=function(e,t){var n=this;return this.cursor?(this.cursor.addTypingListener(e,t),function(){n.cursor&&n.cursor.removeTypingListener(e,t)}):null},t.prototype.getTopForLineNumber=function(e){return this.hasView?this.view.getCodeEditorHelper().getVerticalOffsetForLineNumber(e):-1},t.prototype.getOffsetForColumn=function(e,t){return this.hasView?this.view.getCodeEditorHelper().getOffsetForColumn(e,t):-1},t.prototype.getLayoutInfo=function(){return this.hasView?this.view.getCodeEditorHelper().getLayoutInfo():null},t.prototype._attachModel=function(e){var t=this;if(this.model=e?e:null,this.listenersToRemove=[],this.view=null,this.viewModel=null,this.cursor=null,this.model){this.model.setStopLineTokenizationAfter(this.configuration.editor.stopLineTokenizationAfter,this.configuration.editor.stopLineTokenizationAfterMillis),this.configuration.setIsDominatedByLongLines(this.model.isDominatedByLongLines(this.configuration.editor.longLineBoundary));var n=this.configuration.getWrappingColumn(),i=-1;n>0&&(i=n);var o=new D.CharacterHardWrappingLineMapperFactory(this.configuration.editor.wordWrapBreakBeforeCharacters,this.configuration.editor.wordWrapBreakAfterCharacters,this.configuration.editor.wordWrapBreakObtrusiveCharacters),r=new O.SplitLinesCollection(this.model,o,this.configuration.editor.tabSize,i);this.viewModel=new P.ViewModel(r,this.id,this.configuration,this.model);var s={viewModel:this.viewModel,convertModelPositionToViewPosition:function(e,n){return t.viewModel.isUpToDate()?t.viewModel.convertModelPositionToViewPosition(e,n):new A.Position(1,1)},convertViewToModelPosition:function(e,n){return t.viewModel.convertViewPositionToModelPosition(e,n)},validateViewPosition:function(e,n,i){return t.viewModel.validateViewPosition(e,n,i)}};this.cursor=new I.Cursor(this.id,this.configuration,this.model,function(e){return t.view.renderOnce(e)},s),this.viewModel.addEventSource(this.cursor),this.view=new k.View(this.id,this.domElement,this.configuration,this.viewModel),this.listenersToRemove.push(this.view.getInternalEventBus().addListener(S.EventType.ViewFocusGained,function(){t.emit("focus"),t.emit("widgetFocus",{})})),this.listenersToRemove.push(this.view.getInternalEventBus().addListener("scroll",function(e){return t.emit("scroll",e)})),this.listenersToRemove.push(this.view.getInternalEventBus().addListener(S.EventType.ViewFocusLost,function(){return t.emit("blur")})),this.listenersToRemove.push(this.view.getInternalEventBus().addListener(S.EventType.ContextMenu,function(e){return t.emit(S.EventType.ContextMenu,e)})),this.listenersToRemove.push(this.view.getInternalEventBus().addListener(S.EventType.MouseDown,function(e){return t.emit(S.EventType.MouseDown,e)})),this.listenersToRemove.push(this.view.getInternalEventBus().addListener(S.EventType.MouseUp,function(e){return t.emit(S.EventType.MouseUp,e)})),this.listenersToRemove.push(this.view.getInternalEventBus().addListener(S.EventType.KeyUp,function(e){return t.emit(S.EventType.KeyUp,e)})),this.listenersToRemove.push(this.view.getInternalEventBus().addListener(S.EventType.MouseMove,function(e){return t.emit(S.EventType.MouseMove,e)})),this.listenersToRemove.push(this.view.getInternalEventBus().addListener(S.EventType.MouseLeave,function(e){return t.emit(S.EventType.MouseLeave,e)})),this.listenersToRemove.push(this.view.getInternalEventBus().addListener(S.EventType.KeyDown,function(e){return t.emit(S.EventType.KeyDown,e)})),this.listenersToRemove.push(this.view.getInternalEventBus().addListener(S.EventType.ViewLayoutChanged,function(e){return t.emit(S.EventType.EditorLayout,e)})),this.listenersToRemove.push(this.model.addListener(S.EventType.ModelContentChanged,function(e){e.changeType===S.EventType.ModelContentChangedFlush&&e.modeChanged&&t.emit(S.EventType.ModelModeChanged),t.emit("change",{})})),this.listenersToRemove.push(this.cursor.addListener(S.EventType.CursorPositionChanged,function(e){return t.emit(S.EventType.CursorPositionChanged,e)})),this.listenersToRemove.push(this.cursor.addListener(S.EventType.CursorSelectionChanged,function(e){return t.emit(S.EventType.CursorSelectionChanged,e)})),this.listenersToRemove.push(this.configuration.addListener(S.EventType.ConfigurationChanged,function(e){return t.emit(S.EventType.ConfigurationChanged,e)})),this.listenersToRemove.push(this.model.addListener(S.EventType.ModelDispose,function(){t.setModel(null)})),this.domElement.appendChild(this.view.domNode),this.view.render(),this.hasView=!0;var a;for(var a in this.contentWidgets)this.contentWidgets.hasOwnProperty(a)&&this.view.addContentWidget(this.contentWidgets[a]);for(var a in this.overlayWidgets)this.overlayWidgets.hasOwnProperty(a)&&this.view.addOverlayWidget(this.overlayWidgets[a])}else this.hasView=!1},t.prototype._detachModel=function(){this.hasView=!1,this.listenersToRemove.forEach(function(e){e()}),this.listenersToRemove=[],this.cursor&&(this.cursor.dispose(),this.cursor=null),this.view&&(this.view.dispose(),this.domElement.removeChild(this.view.domNode),this.view=null),this.viewModel&&(this.viewModel.dispose(),this.viewModel=null),this.model&&(this.model.removeAllDecorationsWithOwnerId(this.id),this.model=null)},t}(x.EventEmitter);t.CodeEditorWidget=z}),define("vs/base/dom/browserService",["require","exports"],function(e,t){"use strict";function n(){return a}var i=function(){function e(e){this.tagName=e,this.children=[],this.style={}}return e.prototype.appendChild=function(e){return this.children.push(e),e},e.prototype.addEventListener=function(){},e.prototype.removeEventListener=function(){},e}(),o=function(){function e(){}return e.prototype.createElement=function(e){return new i(e)},e}(),r=function(){function e(){}return e}(),s=function(){function e(){this.document=window.document,this.window=window}return e.prototype.mock=function(){this.document=new o,this.window=new r},e.prototype.restore=function(){this.document=window.document,this.window=window},e}(),a=new s;t.getService=n}),define("vs/css!vs/base/dom/builder",["vs/css!vs/editor/editor.main"],{}); var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/base/dom/builder",["require","exports","vs/base/lib/winjs.base","vs/base/types","vs/base/strings","vs/base/assert","vs/base/dom/dom","vs/base/dom/browserService","vs/css!./builder"],function(e,t,n,i,o,r,s,a){"use strict";function u(e,t){return L.ok(!(e instanceof P),"Expected HTMLElement as parameter"),new P(e,t)}function l(e){return new A(e)}function h(e,t){return L.ok(e instanceof P||e instanceof A,"Expected Builder as parameter"),e instanceof A?new A(e):new P(e.getHTMLElement(),t)}function d(e){return new A(e)}function c(){return new P(null,!0)}function p(e,t){L.ok(E.isString(e),"Expected String as parameter");var n=N.getService().document.getElementById(e);return n?new P(n,t):null}function f(e,t){L.ok(E.isString(e),"Expected String as parameter");for(var n=N.getService().document.querySelectorAll(e),i=[],o=0;oi;i++)r.insertBefore(this.createdElements[i],s[n++]);else for(i=0,o=this.createdElements.length;o>i;i++)r.appendChild(this.createdElements[i]);return this},e.prototype.appendTo=function(t,n){t?t instanceof e&&(t=t.getHTMLElement()):t=this.container,L.ok(t,"Builder can only be build() with a container provided."),L.ok(T.isHTMLElement(t),"The container must either be a HTMLElement or a Builder.");var i=t;this.currentElement.parentNode&&this.currentElement.parentNode.removeChild(this.currentElement);var o=i.childNodes;return E.isNumber(n)&&n=0){var n=e.split("-");e=n[0];for(var i=1;i=0){var t=e.split("-");e=t[0];for(var n=1;n=0?this.padding.apply(this,e.split(" ")):(null!==e&&(this.currentElement.style.paddingTop=this.toPixel(e)),null!==t&&(this.currentElement.style.paddingRight=this.toPixel(t)),null!==n&&(this.currentElement.style.paddingBottom=this.toPixel(n)),null!==i&&(this.currentElement.style.paddingLeft=this.toPixel(i)),this)},e.prototype.margin=function(e,t,n,i){return E.isString(e)&&e.indexOf(" ")>=0?this.margin.apply(this,e.split(" ")):(null!==e&&(this.currentElement.style.marginTop=this.toPixel(e)),null!==t&&(this.currentElement.style.marginRight=this.toPixel(t)),null!==n&&(this.currentElement.style.marginBottom=this.toPixel(n)),null!==i&&(this.currentElement.style.marginLeft=this.toPixel(i)),this)},e.prototype.position=function(e,t,n,i,o){return E.isString(e)&&e.indexOf(" ")>=0?this.position.apply(this,e.split(" ")):(null!==e&&(this.currentElement.style.top=this.toPixel(e)),null!==t&&(this.currentElement.style.right=this.toPixel(t)),null!==n&&(this.currentElement.style.bottom=this.toPixel(n)),null!==i&&(this.currentElement.style.left=this.toPixel(i)),o||(o="absolute"),this.currentElement.style.position=o,this)},e.prototype.size=function(e,t){return E.isString(e)&&e.indexOf(" ")>=0?this.size.apply(this,e.split(" ")):(null!==e&&(this.currentElement.style.width=this.toPixel(e)),null!==t&&(this.currentElement.style.height=this.toPixel(t)),this)},e.prototype.minSize=function(e,t){return E.isString(e)&&e.indexOf(" ")>=0?this.minSize.apply(this,e.split(" ")):(null!==e&&(this.currentElement.style.minWidth=this.toPixel(e)),null!==t&&(this.currentElement.style.minHeight=this.toPixel(t)),this)},e.prototype.maxSize=function(e,t){return E.isString(e)&&e.indexOf(" ")>=0?this.maxSize.apply(this,e.split(" ")):(null!==e&&(this.currentElement.style.maxWidth=this.toPixel(e)),null!==t&&(this.currentElement.style.maxHeight=this.toPixel(t)),this)},e.prototype.float=function(e){return this.currentElement.style.cssFloat=e,this.currentElement.style.styleFloat=e,this},e.prototype.clear=function(e){return this.currentElement.style.clear=e,this},e.prototype.normal=function(){return this.currentElement.style.fontStyle="normal",this.currentElement.style.fontWeight="normal",this.currentElement.style.textDecoration="none",this},e.prototype.italic=function(){return this.currentElement.style.fontStyle="italic",this},e.prototype.bold=function(){return this.currentElement.style.fontWeight="bold",this},e.prototype.underline=function(){return this.currentElement.style.textDecoration="underline",this},e.prototype.overflow=function(e){return this.currentElement.style.overflow=e,this},e.prototype.display=function(e){return this.currentElement.style.display=e,this},e.prototype.show=function(){return this.hasClass("hidden")&&this.removeClass("hidden"),this.attr("aria-hidden","false"),this.cancelVisibilityPromise(),this},e.prototype.showDelayed=function(e){var t=this;this.cancelVisibilityPromise();var n=w.Promise.timeout(e);return this.setProperty(I,n),n.done(function(){t.removeProperty(I),t.show()}),this},e.prototype.hide=function(){return this.hasClass("hidden")||this.addClass("hidden"),this.attr("aria-hidden","true"),this.cancelVisibilityPromise(),this},e.prototype.isHidden=function(){return this.hasClass("hidden")||"none"===this.currentElement.style.display},e.prototype.toggleVisibility=function(){return this.cancelVisibilityPromise(),this.swapClass("builder-visible","hidden"),this.isHidden()?this.attr("aria-hidden","true"):this.attr("aria-hidden","false"),this},e.prototype.cancelVisibilityPromise=function(){var e=this.getProperty(I);e&&(e.cancel(),this.removeProperty(I))},e.prototype.border=function(e,t,n){return E.isString(e)&&e.indexOf(" ")>=0?this.border.apply(this,e.split(" ")):(this.currentElement.style.borderWidth=this.toPixel(e),n&&(this.currentElement.style.borderColor=n),t&&(this.currentElement.style.borderStyle=t),this)},e.prototype.borderTop=function(e,t,n){return E.isString(e)&&e.indexOf(" ")>=0?this.borderTop.apply(this,e.split(" ")):(this.currentElement.style.borderTopWidth=this.toPixel(e),n&&(this.currentElement.style.borderTopColor=n),t&&(this.currentElement.style.borderTopStyle=t),this)},e.prototype.borderBottom=function(e,t,n){return E.isString(e)&&e.indexOf(" ")>=0?this.borderBottom.apply(this,e.split(" ")):(this.currentElement.style.borderBottomWidth=this.toPixel(e),n&&(this.currentElement.style.borderBottomColor=n),t&&(this.currentElement.style.borderBottomStyle=t),this)},e.prototype.borderLeft=function(e,t,n){return E.isString(e)&&e.indexOf(" ")>=0?this.borderLeft.apply(this,e.split(" ")):(this.currentElement.style.borderLeftWidth=this.toPixel(e),n&&(this.currentElement.style.borderLeftColor=n),t&&(this.currentElement.style.borderLeftStyle=t),this)},e.prototype.borderRight=function(e,t,n){return E.isString(e)&&e.indexOf(" ")>=0?this.borderRight.apply(this,e.split(" ")):(this.currentElement.style.borderRightWidth=this.toPixel(e),n&&(this.currentElement.style.borderRightColor=n),t&&(this.currentElement.style.borderRightStyle=t),this)},e.prototype.textAlign=function(e){return this.currentElement.style.textAlign=e,this},e.prototype.verticalAlign=function(e){return this.currentElement.style.verticalAlign=e,this},e.prototype.toPixel=function(e){return-1===e.toString().indexOf("px")?e.toString()+"px":e},e.prototype.innerHtml=function(e,t){return t?this.currentElement.innerHTML+=e:this.currentElement.innerHTML=e,this},e.prototype.text=function(e,t){return t?0===this.currentElement.children.length?this.currentElement.textContent+=e:this.currentElement.appendChild(this.browserService.document.createTextNode(e)):this.currentElement.textContent=e,this},e.prototype.safeInnerHtml=function(e,t){return this.innerHtml(S.escape(e),t)},e.prototype.insertHtmlBeforeBegin=function(e){return this.currentElement.insertAdjacentHTML("beforeBegin",e),this},e.prototype.insertHtmlAfterBegin=function(e){return this.currentElement.insertAdjacentHTML("afterBegin",e),this},e.prototype.insertHtmlBeforeEnd=function(e){return this.currentElement.insertAdjacentHTML("beforeEnd",e),this},e.prototype.insertHtmlAfterEnd=function(e){return this.currentElement.insertAdjacentHTML("afterEnd",e),this},e.prototype.bind=function(e){return C(this.currentElement,e),this},e.prototype.unbind=function(){return _(this.currentElement),this},e.prototype.getBinding=function(){return b(this.currentElement)},e.prototype.setProperty=function(e,t){return g(this.currentElement,e,t),this},e.prototype.getProperty=function(e,t){return v(this.currentElement,e,t)},e.prototype.removeProperty=function(e){return delete m(this.currentElement)[e],this},e.prototype.parent=function(e){return L.ok(!this.offdom,"Builder was created with offdom = true and thus has no parent set"),u(this.currentElement.parentNode,e)},e.prototype.children=function(e){for(var t=this.currentElement.children,n=[],i=0;it;t++){var i=e.item(t);if(m(i)){var o=m(i)[R];if(E.isArray(o))for(;o.length;)o.pop()();delete i[M]}}return T.clearNode(this.currentElement),this.offdom&&(this.createdElements=[]),this},e.prototype.destroy=function(){if(this.currentElement.parentNode&&this.currentElement.parentNode.removeChild(this.currentElement),this.empty(),m(this.currentElement)){var e=m(this.currentElement)[R];if(E.isArray(e))for(;e.length;)e.pop()();delete this.currentElement[M]}var t;for(t in this.toUnbind)if(this.toUnbind.hasOwnProperty(t)&&E.isArray(this.toUnbind[t]))for(;this.toUnbind[t].length;)this.toUnbind[t].pop()();for(t in this.captureToUnbind)if(this.captureToUnbind.hasOwnProperty(t)&&E.isArray(this.captureToUnbind[t]))for(;this.captureToUnbind[t].length;)this.captureToUnbind[t].pop()();this.currentElement=null,this.container=null,this.offdom=null,this.createdElements=null,this.captureToUnbind=null,this.toUnbind=null},e.prototype.getPositionRelativeTo=function(t){t instanceof e&&(t=t.getHTMLElement());var n=T.getRelativeLeft(this.currentElement,t),i=T.getRelativeTop(this.currentElement,t);return new D(i,-1,-1,n)},e.prototype.getPosition=function(){var e=T.getTopLeftOffset(this.currentElement);return new D(e.top,-1,-1,e.left)},e.prototype.getTotalSize=function(){var e=T.getTotalWidth(this.currentElement),t=T.getTotalHeight(this.currentElement);return new O(e,t)},e.prototype.getContentSize=function(){var e=T.getContentWidth(this.currentElement),t=T.getContentHeight(this.currentElement);return new O(e,t)},e.prototype.getClientArea=function(){if(this.currentElement!==this.browserService.document.body){var e=T.getDomNodePosition(this.currentElement);return new O(e.width,e.height)}if(this.browserService.window.innerWidth&&this.browserService.window.innerHeight)return new O(this.browserService.window.innerWidth,this.browserService.window.innerHeight);if(this.browserService.document.body&&this.browserService.document.body.clientWidth&&this.browserService.document.body.clientWidth)return new O(this.browserService.document.body.clientWidth,this.browserService.document.body.clientHeight);if(this.browserService.document.documentElement&&this.browserService.document.documentElement.clientWidth&&this.browserService.document.documentElement.clientHeight)return new O(this.browserService.document.documentElement.clientWidth,this.browserService.document.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")},e}();t.Builder=P;var A=function(e){function t(n){if(L.ok(E.isArray(n)||n instanceof t,"Expected Array or MultiBuilder as parameter"),e.call(this),this.length=0,this.builders=[],E.isArray(n))for(var i=0;i2*t.MINIMUM_EDITOR_WIDTH?(no-t.MINIMUM_EDITOR_WIDTH&&(n=o-t.MINIMUM_EDITOR_WIDTH)):n=r,(i.width!==this.width||i.height!==this.height||this.sashPosition!==n)&&(this.width=i.width,this.height=i.height,this.sashPosition=n,this.originalDomNode.style.width=n+"px",this.originalDomNode.style.left="0px",this.modifiedDomNode.style.width=this.width-n+"px",this.modifiedDomNode.style.left=n+"px",this.overviewDomElement.style.top="0px",this.overviewDomElement.style.width=t.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",this.overviewDomElement.style.left=this.width-t.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",e&&this.layout(),(this.originalOverviewRuler||this.modifiedOverviewRuler)&&this._layoutOverviewRulers())}},t.prototype._layoutOverviewRulers=function(){var e=t.ENTIRE_DIFF_OVERVIEW_WIDTH-2*t.ONE_OVERVIEW_WIDTH,n=this.modifiedEditor.getLayoutInfo();n&&(this.originalOverviewRuler.setLayout({top:0,width:t.ONE_OVERVIEW_WIDTH,right:e+t.ONE_OVERVIEW_WIDTH,height:this.height-n.horizontalScrollbarHeight}),this.modifiedOverviewRuler.setLayout({top:0,right:0,width:t.ONE_OVERVIEW_WIDTH,height:this.height-n.horizontalScrollbarHeight}))},t.prototype._recreateOverviewRulers=function(){this.originalOverviewRuler&&(this.overviewDomElement.removeChild(this.originalOverviewRuler.getDomNode()),this.originalOverviewRuler.destroy()),this.originalOverviewRuler=this.originalEditor.getView().createOverviewRuler("original diffOverviewRuler",4,Number.MAX_VALUE),this.overviewDomElement.appendChild(this.originalOverviewRuler.getDomNode()),this.modifiedOverviewRuler&&(this.overviewDomElement.removeChild(this.modifiedOverviewRuler.getDomNode()),this.modifiedOverviewRuler.destroy()),this.modifiedOverviewRuler=this.modifiedEditor.getView().createOverviewRuler("modified diffOverviewRuler",4,Number.MAX_VALUE),this.overviewDomElement.appendChild(this.modifiedOverviewRuler.getDomNode()),this._layoutOverviewRulers()},t.prototype._createLeftHandSideEditor=function(e,t){var n=this;this.originalEditor=new f.CodeEditorWidget(this.originalDomNode,this._adjustOptionsForLeftHandSide(e),t),this.listenersToRemove.push(this.originalEditor.addBulkListener(function(e){return n._onOriginalEditorEvents(e)})),this.listenersToRemove.push(this.addEmitter(this.originalEditor,"leftHandSide"))},t.prototype._adjustOptionsForLeftHandSide=function(e){var t=p.clone(e||{});return t.viewWordWrap=!1,t.wrappingColumn=-1,t.readOnly=!0,t.automaticLayout=!1,t.scrollbar=t.scrollbar||{},t.scrollbar.vertical="hidden",t.theme=this.theme+" original-in-monaco-diff-editor",t},t.prototype._createRightHandSideEditor=function(e,t){var n=this;this.modifiedEditor=new f.CodeEditorWidget(this.modifiedDomNode,this._adjustOptionsForRightHandSide(e),t),this.listenersToRemove.push(this.modifiedEditor.addBulkListener(function(e){return n._onModifiedEditorEvents(e)})),this.listenersToRemove.push(this.addEmitter(this.modifiedEditor,"rightHandSide"))},t.prototype._adjustOptionsForRightHandSide=function(e){var t=p.clone(e||{});return t.viewWordWrap=!1,t.wrappingColumn=-1,t.automaticLayout=!1,t.scrollbar=t.scrollbar||{},t.scrollbar.vertical="visible",t.scrollbar.verticalHasArrows=!1,t.scrollbar.verticalScrollbarSize=41,t.theme=this.theme+" modified-in-monaco-diff-editor",t},t.prototype._cleanViewZonesAndDecorationsOnEditor=function(e,t,n){t.length>0&&e.changeViewZones(function(e){for(var n=0,i=t.length;i>n;n++)e.removeZone(t[n])}),n.length>0&&e.changeDecorations(function(e){for(var t=0,i=n.length;i>t;t++)e.removeDecoration(n[t])})},t.prototype._cleanViewZonesAndDecorations=function(){this._cleanViewZonesAndDecorationsOnEditor(this.originalEditor,this.originalZones,this.originalDecorations),this.originalZones=[],this.originalDecorations=[],this._cleanViewZonesAndDecorationsOnEditor(this.modifiedEditor,this.modifiedZones,this.modifiedDecorations),this.modifiedZones=[],this.modifiedDecorations=[] },t.prototype.onSashDragStart=function(){this.startSashPosition=this.sashPosition},t.prototype.onSashDrag=function(e){this._measureDomElement(!0,this.startSashPosition+(e.currentX-e.startX))},t.prototype.onSashDragEnd=function(){this.sash.layout()},t.prototype.destroy=function(){this.listenersToRemove.forEach(function(e){e()}),this.listenersToRemove=[],window.clearInterval(this.measureDomElementToken),this._cleanViewZonesAndDecorations(),this.originalOverviewRuler.destroy(),this.modifiedOverviewRuler.destroy(),this.originalEditor.destroy(),this.modifiedEditor.destroy()},t.prototype.updateOptions=function(e){this.theme=e&&e.theme?e.theme:this.theme,this.containerDomElement.className="monaco-diff-editor monaco-editor-background "+this.theme,this.modifiedEditor.updateOptions(this._adjustOptionsForRightHandSide(e)),this.originalEditor.updateOptions(this._adjustOptionsForLeftHandSide(e))},t.prototype.getValue=function(e){return"undefined"==typeof e&&(e=null),this.modifiedEditor.getValue(e)},t.prototype.getModel=function(){return{original:this.originalEditor.getModel(),modified:this.modifiedEditor.getModel()}},t.prototype.setModel=function(e){this._cleanViewZonesAndDecorations(),this.originalEditor.setModel(e?e.original:null),this.modifiedEditor.setModel(e?e.modified:null),e&&(this._recreateOverviewRulers(),this._beginUpdateDecorations())},t.prototype.getDomNode=function(){return this.domElement},t.prototype.getPosition=function(){return this.modifiedEditor.getPosition()},t.prototype.setPosition=function(e,t,n,i){this.modifiedEditor.setPosition(e,t,n,i)},t.prototype.getSelection=function(){return this.modifiedEditor.getSelection()},t.prototype.getSelections=function(){return this.modifiedEditor.getSelections()},t.prototype.setSelection=function(e,t,n,i){this.modifiedEditor.setSelection(e,t,n,i)},t.prototype.getActions=function(){return this.modifiedEditor.getActions()},t.prototype.saveViewState=function(){var e=this.originalEditor.saveViewState(),t=this.modifiedEditor.saveViewState();return{original:e,modified:t}},t.prototype.restoreViewState=function(e){var t=e;if(t.original&&t.original){var n=t;this.originalEditor.restoreViewState(n.original),this.modifiedEditor.restoreViewState(n.modified)}},t.prototype.layout=function(){this._measureDomElement(!1),this.originalEditor.layout(),this.modifiedEditor.layout(),this.sash.layout()},t.prototype.focus=function(){this.modifiedEditor.focus()},t.prototype.onVisible=function(){this.isVisible=!0,this.originalEditor.onVisible(),this.modifiedEditor.onVisible(),this._beginUpdateDecorations()},t.prototype.onHide=function(){this.isVisible=!1,this.originalEditor.onHide(),this.modifiedEditor.onHide(),this._cleanViewZonesAndDecorations()},t.prototype.trigger=function(e,t,n){this.modifiedEditor.trigger(e,t,n)},t.prototype.getSashTop=function(){return 0},t.prototype.getSashLeft=function(){return this.sashPosition},t.prototype.getSashHeight=function(){return this.containerDomElement.clientHeight},t.prototype._onModifiedEditorEvents=function(e){for(var n=this,i=!1,o=0;o0},t.prototype._isChangeOrDelete=function(e){return e.originalEndLineNumber>0},t.prototype._getOriginalLength=function(e){return e.originalEndLineNumber>0?e.originalEndLineNumber-e.originalStartLineNumber+1:0},t.prototype._getModifiedLength=function(e){return e.modifiedEndLineNumber>0?e.modifiedEndLineNumber-e.modifiedStartLineNumber+1:0},t.prototype._updateOriginalEditorDecorations=function(e){var t=this;this.originalEditor.changeViewZones(function(n){var i,o;for(i=0,o=t.originalZones.length;o>i;i++)n.removeZone(t.originalZones[i]);t.originalZones=[];var r,s,a,u;for(i=0,o=e.length;o>i;i++)r=e[i],t._isChangeOrInsert(r)&&(a=t._getModifiedLength(r),s=t._getOriginalLength(r),a>s&&(u=Math.max(r.originalStartLineNumber,r.originalEndLineNumber),t.originalZones.push(n.addZone({afterLineNumber:u,heightInLines:a-s,domNode:t._createFakeLinesDiv()}))))});var n,i,o,r,s,a,u,l=[],h=[];for(n=0,i=e.length;i>n;n++)if(s=e[n],this._isChangeOrDelete(s)&&(u=this._isChangeOrInsert(s),l.push(this._createDecoration(s.originalStartLineNumber,1,s.originalEndLineNumber,1e5,"line-delete",!0)),u&&s.charChanges||l.push(this._createDecoration(s.originalStartLineNumber,1,s.originalEndLineNumber,1e5,"char-delete",!0)),h.push({startLineNumber:s.originalStartLineNumber,endLineNumber:s.originalEndLineNumber,color:"rgba(255, 0, 0, 0.4)"}),s.charChanges))for(o=0,r=s.charChanges.length;r>o;o++)a=s.charChanges[o],this._isChangeOrDelete(a)&&l.push(this._createDecoration(a.originalStartLineNumber,a.originalStartColumn,a.originalEndLineNumber,a.originalEndColumn,"char-delete",!1));this.originalDecorations=this.originalEditor.deltaDecorations(this.originalDecorations,l),this.originalOverviewRuler.setZones(h)},t.prototype._updateModifiedEditorDecorations=function(e){var t=this;this.modifiedEditor.changeViewZones(function(n){var i,o;for(i=0,o=t.modifiedZones.length;o>i;i++)n.removeZone(t.modifiedZones[i]);t.modifiedZones=[];var r,s,a,u;for(i=0,o=e.length;o>i;i++)r=e[i],t._isChangeOrDelete(r)&&(a=t._getModifiedLength(r),s=t._getOriginalLength(r),s>a&&(u=Math.max(r.modifiedStartLineNumber,r.modifiedEndLineNumber),t.modifiedZones.push(n.addZone({afterLineNumber:u,heightInLines:s-a,domNode:t._createFakeLinesDiv()}))))});var n,i,o,r,s,a,u,l=[],h=[];for(n=0,i=e.length;i>n;n++)if(s=e[n],this._isChangeOrInsert(s)&&(u=this._isChangeOrDelete(s),l.push(this._createDecoration(s.modifiedStartLineNumber,1,s.modifiedEndLineNumber,1e5,"line-insert",!0)),u&&s.charChanges||l.push(this._createDecoration(s.modifiedStartLineNumber,1,s.modifiedEndLineNumber,1e5,"char-insert",!0)),h.push({startLineNumber:s.modifiedStartLineNumber,endLineNumber:s.modifiedEndLineNumber,color:"rgba(155, 185, 85, 0.4)"}),s.charChanges))for(o=0,r=s.charChanges.length;r>o;o++)a=s.charChanges[o],this._isChangeOrInsert(a)&&l.push(this._createDecoration(a.modifiedStartLineNumber,a.modifiedStartColumn,a.modifiedEndLineNumber,a.modifiedEndColumn,"char-insert",!1));this.modifiedDecorations=this.modifiedEditor.deltaDecorations(this.modifiedDecorations,l),this.modifiedOverviewRuler.setZones(h)},t.prototype._updateDecorations=function(e){this._updateOriginalEditorDecorations(e),this._updateModifiedEditorDecorations(e)},t}(g.EventEmitter);t.DiffEditorWidget=C}),define("vs/editor/contrib/hover/hoverOperation",["require","exports","vs/base/time/schedulers","vs/base/errors"],function(e,t,n,i){"use strict";var o,r=n,s=i;!function(e){e._map=[],e.IDLE=0,e.FIRST_WAIT=1,e.SECOND_WAIT=2,e.WAITING_FOR_ASYNC_COMPUTATION=3}(o||(o={}));var a=function(){function e(e,t,n,i){var s=this;this._computer=e,this._state=o.IDLE,this._firstWaitScheduler=new r.RunOnceScheduler(function(){return s._triggerAsyncComputation()},this._getHoverTimeMillis()/2),this._secondWaitScheduler=new r.RunOnceScheduler(function(){return s._triggerSyncComputation()},this._getHoverTimeMillis()/2),this._asyncComputationPromise=null,this._asyncComputationPromiseDone=!1,this._completeCallback=t,this._errorCallback=n,this._progressCallback=i}return e.HOVER_TIME=300,e.prototype.getComputer=function(){return this._computer},e.prototype._getHoverTimeMillis=function(){return this._computer.getHoverTimeMillis?this._computer.getHoverTimeMillis():e.HOVER_TIME},e.prototype._triggerAsyncComputation=function(){var e=this;this._state=o.SECOND_WAIT,this._secondWaitScheduler.schedule(),this._computer.computeAsync?(this._asyncComputationPromiseDone=!1,this._asyncComputationPromise=this._computer.computeAsync(),this._asyncComputationPromise.then(function(t){e._asyncComputationPromiseDone=!0,e._withAsyncResult(t)}).done(null,function(){return e._onError})):this._asyncComputationPromiseDone=!0},e.prototype._triggerSyncComputation=function(){this._computer.computeSync&&this._computer.onResult(this._computer.computeSync(),!0),this._asyncComputationPromiseDone?(this._state=o.IDLE,this._onComplete(this._computer.getResult())):(this._state=o.WAITING_FOR_ASYNC_COMPUTATION,this._onProgress(this._computer.getResult()))},e.prototype._withAsyncResult=function(e){e&&this._computer.onResult(e,!1),this._state===o.WAITING_FOR_ASYNC_COMPUTATION&&(this._state=o.IDLE,this._onComplete(this._computer.getResult()))},e.prototype._onComplete=function(e){this._completeCallback&&this._completeCallback(e)},e.prototype._onError=function(e){this._errorCallback?this._errorCallback(e):s.onUnexpectedError(e)},e.prototype._onProgress=function(e){this._progressCallback&&this._progressCallback(e)},e.prototype.start=function(){this._state===o.IDLE&&(this._state=o.FIRST_WAIT,this._firstWaitScheduler.schedule())},e.prototype.cancel=function(){this._state===o.FIRST_WAIT&&this._firstWaitScheduler.cancel(),this._state===o.SECOND_WAIT&&(this._secondWaitScheduler.cancel(),this._asyncComputationPromise&&this._asyncComputationPromise.cancel()),this._state===o.WAITING_FOR_ASYNC_COMPUTATION&&this._asyncComputationPromise&&this._asyncComputationPromise.cancel(),this._state=o.IDLE},e}();t.HoverOperation=a}),define("vs/editor/contrib/hover/hoverWidgets",["require","exports","vs/editor/editor","vs/editor/core/position"],function(e,t,n,i){"use strict";var o=n,r=i,s=function(){function e(e,t){this._id=e,this._editor=t,this._isVisible=!1,this.containerDomNode=document.createElement("div"),this.containerDomNode.className="monaco-editor-hover monaco-editor-background",this.containerDomNode.style.display="none",this._domNode=document.createElement("div"),this._domNode.style.display="inline-block",this.containerDomNode.appendChild(this._domNode),this._editor.addContentWidget(this),this._showAtPosition=null}return e.prototype.getId=function(){return this._id},e.prototype.getDomNode=function(){return this.containerDomNode},e.prototype.showAt=function(e){this._showAtPosition=new r.Position(e.lineNumber,e.column),this._isVisible||(this._isVisible=!0,this.containerDomNode.style.display="block");var t=parseInt(this.containerDomNode.style.maxWidth,10);this.containerDomNode.style.width=t+"px",this.containerDomNode.style.height="",this.containerDomNode.style.left="0px";var n=Math.min(t,this._domNode.clientWidth+5),i=this._domNode.clientHeight+1;this.containerDomNode.style.width=n+"px",this.containerDomNode.style.height=i+"px",this._editor.layoutContentWidget(this)},e.prototype.hide=function(){this._isVisible&&(this._isVisible=!1,this.containerDomNode.style.display="none",this._editor.layoutContentWidget(this))},e.prototype.getPosition=function(){return this._isVisible?{position:this._showAtPosition,preference:[o.ContentWidgetPositionPreference.ABOVE,o.ContentWidgetPositionPreference.BELOW]}:null},e.prototype.dispose=function(){this.hide()},e}();t.ContentHoverWidget=s;var a=function(){function e(e,t){this._id=e,this._editor=t,this._isVisible=!1,this._domNode=document.createElement("div"),this._domNode.className="monaco-editor-hover monaco-editor-background",this._domNode.style.display="none",this._showAtLineNumber=-1,this._editor.addOverlayWidget(this)}return e.prototype.getId=function(){return this._id},e.prototype.getDomNode=function(){return this._domNode},e.prototype.showAt=function(e){this._showAtLineNumber=e,this._isVisible||(this._isVisible=!0,this._domNode.style.display="block");var t=this._editor.getLayoutInfo(),n=this._editor.getTopForLineNumber(this._showAtLineNumber),i=this._editor.getScrollTop();this._domNode.style.left=t.glyphMarginLeft+t.glyphMarginWidth+"px",this._domNode.style.top=n-i+"px"},e.prototype.hide=function(){this._isVisible&&(this._isVisible=!1,this._domNode.style.display="none")},e.prototype.getPosition=function(){return null},e.prototype.dispose=function(){this.hide()},e}();t.GlyphHoverWidget=a});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/editor/contrib/hover/modesContentHover",["require","exports","vs/editor/core/range","vs/base/lib/winjs.base","vs/editor/contrib/hover/hoverOperation","vs/editor/contrib/hover/hoverWidgets"],function(e,t,n,i,o,r){"use strict";var s=n,a=i,u=o,l=r,h=function(){function e(e){this._editor=e,this._range=null}return e.prototype.setRange=function(e){this._range=e,this._result=[]},e.prototype.computeAsync=function(){var e=this._editor.getModel().getMode(),t=e.extraInfoSupport;return t?t.computeInfo(this._editor.getModel().getAssociatedResource(),{lineNumber:this._range.startLineNumber,column:this._range.startColumn}).then(function(e){return e?[e]:null}):a.Promise.as(null)},e.prototype.computeSync=function(){var e=this,t=this._range.startLineNumber,n=this._editor.getLineDecorations(t),i=this._editor.getModel().getLineMaxColumn(t),o=[];return n.forEach(function(n){var r=n.range.startLineNumber===t?n.range.startColumn:1,a=n.range.endLineNumber===t?n.range.endColumn:i;if(r<=e._range.startColumn&&e._range.endColumn<=a&&n.options.hoverMessage){var u={value:n.options.hoverMessage,range:new s.Range(e._range.startLineNumber,r,e._range.startLineNumber,a)};n.options.isMultiLine&&(u.htmlContent=[{tagName:"pre",text:n.options.hoverMessage}]),o.push(u)}}),o},e.prototype.onResult=function(e,t){this._result=t?e.concat(this._result):this._result.concat(e)},e.prototype.getResult=function(){return this._result.slice(0)},e}(),d=function(e){function t(n){var i=this;e.call(this,t.ID,n),this._computer=new h(this._editor),this._hoverOperation=new u.HoverOperation(this._computer,function(e){return i._withResult(e)},null,function(e){return i._withResult(e)})}return __extends(t,e),t.ID="editor.contrib.modesContentHoverWidget",t.prototype.startShowingAt=function(e){if(!this._lastRange||!this._lastRange.equalsRange(e)){if(this._hoverOperation.cancel(),this._isVisible)if(this._showAtPosition.lineNumber!==e.startLineNumber)this.hide();else{for(var t=[],n=0,i=this._messages.length;i>n;n++){var o=this._messages[n],r=o.range;r.startColumn<=e.startColumn&&r.endColumn>=e.endColumn&&t.push(o)}t.length>0?this._renderMessages(e,t):this.hide()}this._lastRange=e,this._computer.setRange(e),this._hoverOperation.start()}},t.prototype.hide=function(){this._lastRange=null,this._hoverOperation.cancel(),e.prototype.hide.call(this)},t.prototype._withResult=function(e){this._messages=e,this._messages.length>0?this._renderMessages(this._lastRange,this._messages):this.hide()},t.prototype._renderHTML=function(e){var t=this;if(e.isText)return document.createTextNode(e.text);var n=e.tagName||"div",i=document.createElement(n);return e.className&&(i.className=e.className),e.text&&(i.textContent=e.text),e.style&&i.setAttribute("style",e.style),e.customStyle&&Object.keys(e.customStyle).forEach(function(t){i.style[t]=e.customStyle[t]}),e.children&&e.children.forEach(function(e){i.appendChild(t._renderHTML(e))}),i},t.prototype._renderMessages=function(e,t){var n=this,i=Number.MAX_VALUE,o=document.createDocumentFragment();t.forEach(function(e){i=Math.min(i,e.range.startColumn);var t=document.createElement("div"),r=null,s=t;e.className&&(r=document.createElement("span"),r.className=e.className,s=r,t.appendChild(r)),e.htmlContent?e.htmlContent.forEach(function(e){s.appendChild(n._renderHTML(e))}):s.textContent=e.value,o.appendChild(t)}),this._domNode.textContent="",this._domNode.appendChild(o),this.showAt({lineNumber:e.startLineNumber,column:i})},t}(l.ContentHoverWidget);t.ModesContentHoverWidget=d});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/editor/contrib/hover/modesGlyphHover",["require","exports","vs/editor/contrib/hover/hoverOperation","vs/editor/contrib/hover/hoverWidgets"],function(e,t,n,i){"use strict";var o=n,r=i,s=function(){function e(e){this._editor=e,this._lineNumber=-1}return e.prototype.setLineNumber=function(e){this._lineNumber=e,this._result=[]},e.prototype.computeSync=function(){var e,t,n,i=[],o=this._editor.getLineDecorations(this._lineNumber);for(e=0,t=o.length;t>e;e++)n=o[e],n.options.glyphMarginClassName&&n.options.hoverMessage&&i.push({value:n.options.hoverMessage});return i},e.prototype.onResult=function(e){this._result=this._result.concat(e)},e.prototype.getResult=function(){return this._result},e}(),a=function(e){function t(n){var i=this;e.call(this,t.ID,n),-1===this._lastLineNumber,this._computer=new s(this._editor),this._hoverOperation=new o.HoverOperation(this._computer,function(e){return i._withResult(e)},null,function(e){return i._withResult(e)})}return __extends(t,e),t.ID="editor.contrib.modesGlyphHoverWidget",t.prototype.startShowingAt=function(e){this._lastLineNumber!==e&&(this._hoverOperation.cancel(),this.hide(),this._lastLineNumber=e,this._computer.setLineNumber(e),this._hoverOperation.start())},t.prototype.hide=function(){this._lastLineNumber=-1,this._hoverOperation.cancel(),e.prototype.hide.call(this)},t.prototype._withResult=function(e){this._messages=e,this._messages.length>0?this._renderMessages(this._lastLineNumber,this._messages):this.hide()},t.prototype._renderMessages=function(e,t){var n=document.createDocumentFragment();t.forEach(function(e){var t=document.createElement("div"),i=null;e.className?(i=document.createElement("span"),i.textContent=e.value,i.className=e.className,t.appendChild(i)):t.textContent=e.value,n.appendChild(t)}),this._domNode.textContent="",this._domNode.appendChild(n),this.showAt(e)},t}(r.GlyphHoverWidget);t.ModesGlyphHoverWidget=a}),define("vs/css!vs/editor/contrib/hover/hover",["vs/css!vs/editor/editor.main"],{}),define("vs/editor/contrib/hover/hover",["require","exports","vs/editor/core/constants","vs/base/dom/dom","vs/platform/platform","vs/editor/editorExtensions","vs/editor/editor","vs/base/env","vs/editor/contrib/hover/modesContentHover","vs/editor/contrib/hover/modesGlyphHover","vs/css!./hover"],function(e,t,n,i,o,r,s,a,u,l){"use strict";var h=n,d=i,c=o,p=r,f=s,m=a,g=u,v=l,y=function(){function e(e){var t=this;this._editor=e,this._toUnhook=[],e.getConfiguration().hover&&(this._toUnhook.push(this._editor.addListener(h.EventType.MouseMove,function(e){return t._onEditorMouseMove(e)})),this._toUnhook.push(this._editor.addListener(h.EventType.MouseLeave,function(){return t._hideWidgets()})),this._toUnhook.push(this._editor.addListener(h.EventType.KeyDown,function(e){return t._onKeyDown(e)})),this._toUnhook.push(this._editor.addListener(h.EventType.ModelChanged,function(){return t._hideWidgets()})),this._toUnhook.push(this._editor.addListener("scroll",function(){return t._hideWidgets()})),m.browser.isIE8||this._toUnhook.push(d.addListener(window,"blur",function(){return t._hideWidgets()})),this._contentWidget=new g.ModesContentHoverWidget(e),this._glyphWidget=new v.ModesGlyphHoverWidget(e))}return e.ID="editor.contrib.hover",e.prototype._onEditorMouseMove=function(e){var t=e.target.type,n=m.browser.isMacintosh?"metaKey":"ctrlKey";(t!==f.MouseTargetType.CONTENT_WIDGET||e.target.detail!==g.ModesContentHoverWidget.ID||e.event[n])&&(t!==f.MouseTargetType.OVERLAY_WIDGET||e.target.detail!==v.ModesGlyphHoverWidget.ID||e.event[n])&&(t===f.MouseTargetType.CONTENT_TEXT?(this._glyphWidget.hide(),this._contentWidget.startShowingAt(e.target.range)):t===f.MouseTargetType.GUTTER_GLYPH_MARGIN?(this._contentWidget.hide(),this._glyphWidget.startShowingAt(e.target.position.lineNumber)):this._hideWidgets())},e.prototype._onKeyDown=function(e){var t=m.browser.isMacintosh?"Meta":"Ctrl";e.key!==t&&this._hideWidgets()},e.prototype._hideWidgets=function(){this._glyphWidget.hide(),this._contentWidget.hide()},e.prototype.getId=function(){return e.ID},e.prototype.dispose=function(){for(this._glyphWidget&&(this._glyphWidget.dispose(),this._glyphWidget=null),this._contentWidget&&(this._contentWidget.dispose(),this._contentWidget=null);this._toUnhook.length>0;)this._toUnhook.pop()()},e}(),C=c.Registry.as(p.Extensions.EditorContributions);C.registerEditorContribution(new c.BaseDescriptor(y))}),define("vs/editor/contrib/wordHighlighter/wordHighlighter",["require","exports","vs/platform/platform","vs/editor/core/constants","vs/editor/core/range","vs/editor/editorExtensions","vs/editor/editor"],function(e,t,n,i,o,r,s){"use strict";var a=n,u=i,l=o,h=r,d=function(){function e(e){var t=this;this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.workerRequestValue=null,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this.model=this.editor.getModel(),this.toUnhook=[],this.toUnhook.push(e.addListener(u.EventType.CursorPositionChanged,function(e){t._onPositionChanged(e)})),this.toUnhook.push(e.addListener(u.EventType.ModelChanged,function(){t._stopAll(),t.model=t.editor.getModel()})),this.toUnhook.push(e.addListener("change",function(){t._stopAll()})),this._lastWordRange=null,this._decorationIds=[],this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.workerRequestValue=null,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1}return e.prototype._removeDecorations=function(){var e=this;this._decorationIds.length>0&&(this.editor.changeDecorations(function(t){for(var n=0,i=e._decorationIds.length;i>n;n++)t.removeDecoration(e._decorationIds[n])}),this._decorationIds=[])},e.prototype._stopAll=function(){this._lastWordRange=null,this._removeDecorations(),-1!==this.renderDecorationsTimer&&(window.clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),null!==this.workerRequest&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)},e.prototype._onPositionChanged=function(e){var t=this;if("explicit"!==e.reason)return this._stopAll(),void 0;if(this.editor.getConfiguration().readOnly)return this._stopAll(),void 0;if(!this.model.getMode().occurrencesSupport)return this._stopAll(),void 0;var n=this.editor.getSelection();if(n.startLineNumber!==n.endLineNumber)return this._stopAll(),void 0;var i=n.startLineNumber,o=n.startColumn,r=n.endColumn,s=this.model.getWordAtPosition({lineNumber:i,column:o},!0,!0);if(!s||s.startColumn>o||s.endColumnh;h++){var c=this.model.getDecorationRange(this._decorationIds[h]);c&&c.startLineNumber===i&&c.startColumn<=o&&c.endColumn>=r&&(u=!0)}if(this.lastCursorPositionChangeTime=(new Date).getTime(),u)this.workerRequestCompleted&&-1!==this.renderDecorationsTimer&&(window.clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1,this._beginRenderDecorations());else{this._stopAll();var p=++this.workerRequestTokenId;this.workerRequestCompleted=!1,this.workerRequest=this.model.getMode().occurrencesSupport.findOccurrences(this.model.getAssociatedResource(),this.editor.getPosition()),this.workerRequest.then(function(e){p===t.workerRequestTokenId&&(t.workerRequestCompleted=!0,t.workerRequestValue=e,t._beginRenderDecorations())}).done()}this._lastWordRange=a},e.prototype._beginRenderDecorations=function(){var e=this,t=(new Date).getTime(),n=this.lastCursorPositionChangeTime+250;t>=n?(this.renderDecorationsTimer=-1,this.renderDecorations()):this.renderDecorationsTimer=window.setTimeout(function(){e.renderDecorations()},n-t)},e.prototype.renderDecorations=function(){this.renderDecorationsTimer=-1;for(var e=[],t=0,n=this.workerRequestValue.length;n>t;t++){var i=this.workerRequestValue[t],o="wordHighlight",r="rgba(246, 185, 77, 0.7)";i.kind&&"write"===i.kind&&(o+="Strong",r="rgba(249, 206, 130, 0.7)"),e.push({range:i.range,options:{isOverlay:!1,className:o,showInOverviewRuler:r}})}this._decorationIds=this.editor.deltaDecorations(this._decorationIds,e)},e.prototype.destroy=function(){for(this._stopAll();this.toUnhook.length>0;)this.toUnhook.pop()()},e}(),c=function(){function e(e){this.wordHighligher=new d(e)}return e.ID="editor.contrib.wordHighlighter",e.prototype.getId=function(){return e.ID},e.prototype.dispose=function(){this.wordHighligher.destroy()},e}(),p=a.Registry.as(h.Extensions.EditorContributions);p.registerEditorContribution(new a.BaseDescriptor(c))}),define("vs/editor/editor.all",["./core/codeEditorWidget","./diff/diffEditorWidget","./contrib/hover/hover","./contrib/wordHighlighter/wordHighlighter"],function(){"use strict"}),define("vs/css!vs/editor/terminal/terminal",["vs/css!vs/editor/editor.main"],{});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/editor/terminal/terminal",["require","exports","vs/editor/core/codeEditorWidget","vs/editor/core/constants","vs/base/dom/dom","vs/editor/core/command/replaceCommand","vs/editor/editor","vs/css!./terminal"],function(e,t,n,i,o,r,s){"use strict";var a=n,u=i,l=o,h=r,d=function(e){function t(t,n,i){var o=this;e.call(this,t,n,i),this.terminalListenersToRemove=[],this.terminalListenersToRemove.push(l.addListener(t,"mouseup",function(){return o.onMouseUp()})),this.isReadOnly=!1,this.resume(!0,!0)}return __extends(t,e),t.prototype._attachModel=function(t){var n=this;e.prototype._attachModel.call(this,t),this.cursor&&this.listenersToRemove.push(this.cursor.addListener(u.EventType.CursorSelectionChanged,function(e){return n._onCursorSelectionChanged(e)}))},t.prototype._onCursorSelectionChanged=function(e){if("modelChange"===e.source&&e.selection.isEmpty()){var t=this.getPosition(),n=this.cursor.getEditableRange();t.equals(n.getEndPosition())&&this.revealPosition(t,!1,!1)}},t.prototype.onMouseUp=function(){if(this.getModel()&&this.getSelection().isEmpty()){var e=this.getPosition(),t=this.cursor.getEditableRange();if(!t.containsPosition(e)){var n=this.model.getLineCount(),i=this.model.getLineMaxColumn(n);this.setPosition({lineNumber:n,column:i},!1,!1,!1)}}},t.prototype.destroy=function(){this.terminalListenersToRemove.forEach(function(e){e()}),this.terminalListenersToRemove=[],e.prototype.destroy.call(this)},t.prototype.getEditorType=function(){return u.EditorType.ITerminal},t.prototype.peekCurrentInput=function(){var e=this.cursor.getEditableRange();return this.getModel().getValueInRange(e)},t.prototype.acceptInput=function(){var e=this.peekCurrentInput();return this.resume(!0,!0),e},t.prototype.replaceInput=function(e){var t=this.peekCurrentInput(),n=this.cursor.getEditableRange(),i=new h.ReplaceCommand(n,e);return this.trigger("terminal",u.Handler.ExecuteCommand,i),t},t.prototype.setReadOnly=function(e){this.isReadOnly!==e&&(this.isReadOnly=e,this.updateOptions({readOnly:e}))},t.prototype.pause=function(){this.setReadOnly(!0)},t.prototype.resume=function(e,t){if(this.getModel()){this.setReadOnly(!1);var n=this.model.getLineCount(),i=this.model.getLineMaxColumn(n);e&&this.cursor.setEditableRange({startLineNumber:n,startColumn:i,endLineNumber:n,endColumn:i}),t&&this.setPosition({lineNumber:n,column:i},!1,!1,!1)}},t}(a.CodeEditorWidget);t.Terminal=d}),define("vs/editor/standalone/simpleServices",["require","exports","vs/base/lib/winjs.base","vs/platform/services","vs/base/errors","vs/base/types"],function(e,t,n,i,o,r){"use strict";var s=n,a=i,u=o,l=r,h=function(){function e(e){this.editor=e}return e.prototype.getId=function(){return"editor"},e.prototype.getControl=function(){return this.editor},e.prototype.getSelection=function(){return this.editor.getSelection()},e.prototype.focus=function(){this.editor.focus()},e}();t.SimpleEditor=h;var d=function(){function e(e){this.model=e}return e.prototype.getTextEditorModel=function(){return this.model},e}();t.SimpleModel=d;var c=function(){function e(e){this.editor=e}return e.prototype.getActiveEditor=function(){return new h(this.editor)},e.prototype.getActiveEditorInput=function(){return null},e.prototype.openEditor=function(e){var t=this.editor.getModel();if(t.id!==e.path&&t.getAssociatedResource().toExternal()!==e.path)return s.Promise.as(!1);var n=e.options.selection;return n&&(l.isUndefinedOrNull(n.endLineNumber)||l.isUndefinedOrNull(n.endColumn)?this.editor.setPosition({lineNumber:n.startLineNumber,column:n.startColumn},!0,!0,!0):this.editor.setSelection(n,!0,!0,!0)),s.Promise.as(!0)},e.prototype.resolveEditorModel=function(e){var t=this.editor.getModel();return t.id!==e.path&&t.getAssociatedResource().toExternal()!==e.path?s.Promise.as(null):s.Promise.as(new d(t))},e}();t.SimpleEditorService=c;var p=function(){},f=function(){function e(){}return e.prototype.show=function(e,t){switch(e){case a.Severity.Error:console.error(u.toErrorMessage(t,!0));break;case a.Severity.Warning:console.warn(t);break;default:console.log(t)}return p},e}();t.SimpleMessageService=f}),define("vs/base/diagnostics",["require","exports"],function(e,t){"use strict";function n(e,t){return function(){}}var i=self;i.Monaco||(i.Monaco={}),i.Monaco.Diagnostics={};{i.Monaco.Diagnostics}t.register=n}),define("vs/platform/handlerService",["require","exports","vs/platform/services","vs/base/diagnostics","vs/base/env","vs/base/dom/dom","vs/base/dom/keyboardEvent"],function(e,t,n,i,o,r,s){"use strict";function a(e){var t=[];return(e.ctrlCmd&&!l.browser.isMacintosh||e.winCtrl&&l.browser.isMacintosh)&&t.push("Ctrl"),e.shift&&t.push("Shift"),e.alt&&t.push("Alt"),(e.ctrlCmd&&l.browser.isMacintosh||e.winCtrl&&!l.browser.isMacintosh)&&t.push("Meta"),t.push(e.key),t.join("-")}var u=i,l=o,h=r,d=s;t.asString=a;var c=u.register("HandlerServiceActivationVerbose",function(e,t,n){console.log(e+" > "+t.id+" > "+n)}),p=u.register("HandlerServiceFocusVisual",function(e,t){e.style.outlineWidth="5px",e.style.outlineStyle="solid",e.style.outlineColor=t===!0?"yellowgreen":t===!1?"red":"gray"}),f=u.register("HandlerServiceFocusTextual",function(e){console.log("got FOCUS @"+(new Date).getTime(),e)}),m=function(){function e(e,t){this.keyBinding=e,this.onEmpty=t,this.data=[]}return e.prototype.push=function(e,t){"undefined"==typeof t&&(t={});var n,i,o=this,r=this;return n=function(){for(var n=[],o=0;o GROUP disposal"),n.dispose())}catch(o){throw n.dispose(),o}return i}),o.push(i.bind(e,s))};return e(r),n=new g(o)},e.prototype.dispose=function(){this.unbind(),this.map=null},e}();t.HandlerService=v;var y=function(){function e(e){this.delegate=e,this.bindings=[]}return e.prototype.bind=function(e,t,n){var i=this.delegate.bind(e,t,n);return this.bindings.push(i),i},e.prototype.bindGroup=function(e,t){var n=this.delegate.bindGroup(e,t);return this.bindings.push(n),n},e.prototype.capture=function(){return new g(this.bindings)},e}();t.HandlerServiceWrapper=y;var C=function(){function e(e,t){var n=this;this.domNode=e,this.scopeNode=t,this.handlerActive=!1,p(this.scopeNode),this.unbind=h.addListener(this.domNode,h.EventType.FOCUS,function(e){f(e.target),n.update(h.isAncestor(e.target,n.scopeNode))},!0)}return e.prototype.injectHandlerService=function(e){this.delegate=e},e.prototype.update=function(e){this.handlerActive!==e&&(this.handlerActive=e),p(this.scopeNode,e)},e.prototype.bind=function(e,t,n){return this.delegate.bind(e,this.wrapHandler(t),n)},e.prototype.bindGroup=function(e,t){var n=this;return this.delegate.bindGroup(function(t){var i=function(e,i){t(e,n.wrapHandler(i))};e(i)},t)},e.prototype.wrapHandler=function(e){var t=this,n=function(){return t.handlerActive!==!0?!1:e.apply(e,arguments)};return n},e.prototype.dispose=function(){this.unbind()},e}();t.FocusTrackingHandlerService=C}),define("vs/platform/telemetry/telemetryService",["require","exports","vs/platform/services","vs/base/strings","vs/base/lib/winjs.base","vs/base/performance/timer","vs/base/errors"],function(e,t,n,i,o,r,s){"use strict";var a=i,u=o,l=r,h=s,d=function(){function e(t){"undefined"==typeof t&&(t=!1),this.eventQueue=[],this.publicOnly=t,this.sessionID=a.generateUuid(8)+Date.now(),this.eventMaxQueueSize=e.EVENT_QUEUE_LIMIT,this.eventBatchSize=e.EVENT_BATCH_SIZE,this.failureCount=0,this.sendingEvents=!1,this.waitIntervalId=null,this.timeKeeper=new l.TimeKeeper,this.toUnbind=[],this.toUnbind.push(this.timeKeeper.addListener("eventStop",this.onTelemetryTimerEventStop.bind(this))),this.toUnbind.push(h.errorHandler.addListener(this.onErrorEvent.bind(this)))}return e.EVENT_QUEUE_LIMIT=1e4,e.EVENT_INTERVAL=3e4,e.EVENT_BATCH_SIZE=100,e.prototype.dispose=function(){for(;this.toUnbind.length;)this.toUnbind.pop()();this.timeKeeper.dispose()},e.prototype.onTelemetryTimerEventStop=function(e){var t=e.data||{};t.duration=e.timeTaken(),"public"===e.topic?this.publicLog(e.name,t):this.log(e.name,t)},e.prototype.onErrorEvent=function(e,t,n){"undefined"==typeof t&&(t=null),"undefined"==typeof n&&(n=null),this.log("UnhandledError",{friendlyMessage:t,verboseMessage:n})},e.prototype.injectRequestService=function(e){this.requestService=e},e.prototype.start=function(e,t,n){var i=n?"public":"private",o=this.timeKeeper.start(i,e);return t&&(o.data=t),o},e.prototype.log=function(e,t){this.publicOnly||this.handleEvent("restricted",e,t)},e.prototype.publicLog=function(e,t){this.handleEvent("public",e,t)},e.prototype.handleEvent=function(e,t,n){this.eventQueue.length>=this.eventMaxQueueSize||(n=n||{},n.source="client",this.eventQueue.push({name:t,kind:e,timestamp:(new Date).toUTCString(),data:JSON.stringify(n),sessionID:this.sessionID}),this.sendingEvents||this.failureCount>0||(this.eventQueue.length>this.eventBatchSize?(clearTimeout(this.waitIntervalId),this.waitIntervalId=null,this.sendEvents()):this.sendSoon()))},e.prototype.sendSoon=function(){var t=this;null===this.waitIntervalId&&(this.waitIntervalId=setTimeout(function(){t.waitIntervalId=null,t.sendEvents()},e.EVENT_INTERVAL*Math.pow(2,this.failureCount)))},e.prototype.sendEvents=function(){var e=this;this.sendingEvents=!0;var t=this.eventQueue.splice(0,this.eventBatchSize);0!==t.length&&this.submitToServer(t).then(function(){e.failureCount=0},function(){e.eventQueue.unshift.apply(e.eventQueue,t),e.failureCount++}).done(function(){e.sendingEvents=!1,e.eventQueue.length>0&&e.sendSoon()})},e.prototype.submitToServer=function(e){var t=JSON.stringify(e),n=this.requestService.getRequestUrl("telemetry"),i={type:"POST",url:n,data:t,headers:{"Content-Type":"application/json"}};return this.requestService.makeRequest(i).then(function(e){return 201!==e.status?u.Promise.wrapError("Bad response"):void 0})},e}();t.TelemetryService=d;var c=function(){function e(){}return e.prototype.log=function(){},e.prototype.publicLog=function(){},e.prototype.start=function(){return l.nullEvent},e}();t.NullTelemetryService=c,t.nullService=new c}),define("vs/editor/core/model/trackedRanges",["require","exports","vs/editor/core/range"],function(e,t,n){"use strict";var i=n,o=function(){function e(e){this.model=e,this.lastRangeId=0,this.ranges={},this.markerIdToRangeId={},this.multiLineTrackedRanges={}}return e.prototype.clear=function(){this.ranges={},this.markerIdToRangeId={},this.multiLineTrackedRanges={}},e.prototype._setRangeIsMultiLine=function(e,t){var n=this.multiLineTrackedRanges.hasOwnProperty(e);!n&&t?this.multiLineTrackedRanges[e]=!0:n&&!t&&delete this.multiLineTrackedRanges[e]},e.prototype.add=function(e){e=this.model.validateRange(e);var t=this.model._addMarker(e.startLineNumber-1,e.startColumn,"start"),n=this.model._addMarker(e.endLineNumber-1,e.endColumn,"end"),i={id:(++this.lastRangeId).toString(),startMarkerId:t,endMarkerId:n};return this.ranges[i.id]=i,this.markerIdToRangeId[t]=i.id,this.markerIdToRangeId[n]=i.id,this._setRangeIsMultiLine(i.id,e.startLineNumber!==e.endLineNumber),i.id},e.prototype.change=function(e,t){if(this.ranges.hasOwnProperty(e)){t=this.model.validateRange(t);var n=this.ranges[e];this.model._changeMarker(n.startMarkerId,t.startLineNumber-1,t.startColumn),this.model._changeMarker(n.endMarkerId,t.endLineNumber-1,t.endColumn),this._setRangeIsMultiLine(n.id,t.startLineNumber!==t.endLineNumber)}},e.prototype.remove=function(e){if(this.ranges.hasOwnProperty(e)){var t=this.ranges[e];this.model._removeMarker(t.startMarkerId),this.model._removeMarker(t.endMarkerId),this._setRangeIsMultiLine(t.id,!1),delete this.ranges[t.id],delete this.markerIdToRangeId[t.startMarkerId],delete this.markerIdToRangeId[t.endMarkerId]}},e.prototype.onChangedMarkers=function(e){var t,n,i,o,r={};for(var s in e)e.hasOwnProperty(s.toString())&&this.markerIdToRangeId.hasOwnProperty(s.toString())&&(o=e[s],i=this.markerIdToRangeId[s],n=this.ranges[i],r.hasOwnProperty(n.id)?t=r[n.id]:(t={startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0},r[n.id]=t),o.id===n.startMarkerId?(t.startLineNumber=o.oldLineIndex+1,t.startColumn=o.oldColumn):(t.endLineNumber=o.oldLineIndex+1,t.endColumn=o.oldColumn),this._setRangeIsMultiLine(n.id,this.model._getMarkerLineNumber(n.startMarkerId)!==this.model._getMarkerLineNumber(n.endMarkerId)));return r},e.prototype._getMultiLineTrackedRanges=function(e,t){var n,i,o,r,s,a,u={};for(n in this.multiLineTrackedRanges)if(this.multiLineTrackedRanges.hasOwnProperty(n)){if(i=this.ranges[n],o=this.model._getMarkerLineNumber(i.startMarkerId),o>t)continue;if(s=this.model._getMarkerLineNumber(i.endMarkerId),e>s)continue;r=this.model._getMarkerColumn(o,i.startMarkerId),a=this.model._getMarkerColumn(s,i.endMarkerId),u[i.id]={startLineNumber:o,startColumn:r,endLineNumber:s,endColumn:a}}return u},e.prototype.getLinesTrackedRanges=function(e,t){var n,i,o,r,s,a,u=this._getMultiLineTrackedRanges(e,t);for(a=e;t>=a;a++)for(n=this.model._getLineMarkers(a),r=0,s=n.length;s>r;r++)i=n[r],this.markerIdToRangeId.hasOwnProperty(i.id)&&(o=this.markerIdToRangeId[i.id],this.ranges[o].startMarkerId===i.id?u.hasOwnProperty(o)?u[o].startColumn=i.column:u[o]={startLineNumber:a,startColumn:i.column,endLineNumber:a,endColumn:-1}:u.hasOwnProperty(o)?u[o].endColumn=i.column:u[o]={startLineNumber:a,startColumn:-1,endLineNumber:a,endColumn:i.column});return u},e.prototype.getStartLineNumber=function(e){return this.model._getMarkerLineNumber(this.ranges[e].startMarkerId)},e.prototype.getEndLineNumber=function(e){return this.model._getMarkerLineNumber(this.ranges[e].endMarkerId)},e.prototype.getRange=function(e){var t=this.ranges[e],n=this.model._getMarker(t.startMarkerId),o=this.model._getMarker(t.endMarkerId);return new i.Range(n.lineNumber,n.column,o.lineNumber,o.column)},e}();t.TrackedRanges=o}),define("vs/editor/core/model/modelDecorations",["require","exports"],function(e,t){"use strict";var n=function(){function e(e,t){this.model=e,this.trackedRanges=t,this.lastDecorationId=0,this.decorations={},this.rangeIdToDecorationId={}}return e.prototype.clear=function(){this.decorations={},this.rangeIdToDecorationId={}},e.prototype.change=function(e,t,n){var i=this,o={addDecoration:function(n,o){return i._add(e,t,n,o)},changeDecoration:function(t,n){i._change(e,t,n)},changeDecorationOptions:function(t,n){i._changeOptions(e,t,n)},removeDecoration:function(t){i._remove(e,t)},deltaDecorations:function(n,o){return i._delta(e,t,n,o)}},r=n(o);return o.addDecoration=null,o.changeDecoration=null,o.removeDecoration=null,o.deltaDecorations=null,r},e.prototype.getAll=function(e){var t,n,i=[];for(t in this.decorations)if(this.decorations.hasOwnProperty(t)){if(n=this.decorations[t],e&&n.ownerId&&n.ownerId!==e)continue;i.push({id:n.id,ownerId:n.ownerId,range:this.trackedRanges.getRange(n.rangeId),options:n.options})}return i},e.prototype.getLineDecorations=function(e,t){return this.getLinesDecorations(e,e,t)},e.prototype.getLinesDecorations=function(e,t,n){var i,o,r=[],s=this.trackedRanges.getLinesTrackedRanges(e,t);for(o in s)if(s.hasOwnProperty(o)&&this.rangeIdToDecorationId.hasOwnProperty(o)){if(i=this.decorations[this.rangeIdToDecorationId[o]],n&&i.ownerId&&i.ownerId!==n)continue;r.push({id:i.id,ownerId:i.ownerId,range:s[o],options:i.options})}return r},e.prototype.getOptions=function(e){return this.decorations.hasOwnProperty(e)?this.decorations[e].options:null},e.prototype.getRange=function(e){if(this.decorations.hasOwnProperty(e)){var t=this.decorations[e];return this.trackedRanges.getRange(t.rangeId)}return null},e.prototype.removeAllDecorationsWithOwnerId=function(e){var t,n,i=[];for(t in this.decorations)this.decorations.hasOwnProperty(t)&&(n=this.decorations[t],n.ownerId===e&&i.push(n.id));for(var o=0;oo;o++)s[o]=this._normalizeOptions(i[o].options),a[o]=this.model.validateRange(i[o].range);return this._deltaImpl(e,t,n,r,a,s)},e.prototype._deltaImpl=function(e,t,n,i,o,r){var s,a,u,l,h={};for(s=0,a=n.length;a>s;s++)this.decorations.hasOwnProperty(n[s])&&(l=this.decorations[n[s]],u=this._decorationHash(this.trackedRanges.getRange(l.rangeId),l.options),h[u]=h[u]||[],h[u].push(n[s]));var d,c,p,f,m=[],g={};for(s=0;i>s;s++){if(u=this._decorationHash(o[s],r[s]),f=!1,h.hasOwnProperty(u))for(p=h[u],d=0,c=p.length;c>d;d++)if(!g.hasOwnProperty(p[d])){f=!0,g[p[d]]=!0,m.push(p[d]);break}f||m.push(this._add(e,t,o[s],r[s]))}for(s=0,a=n.length;a>s;s++)g.hasOwnProperty(n[s])||this._remove(e,n[s]);return m},e.prototype.onChangedRanges=function(e,t){var n,i;for(n in t)t.hasOwnProperty(n)&&this.rangeIdToDecorationId.hasOwnProperty(n)&&(i=this.rangeIdToDecorationId[n],e.addMovedDecoration(i,t[n]))},e.prototype.getDecorationData=function(e){var t=this.decorations[e];return{id:t.id,ownerId:t.ownerId,range:this.trackedRanges.getRange(t.rangeId),isForValidation:!1,options:t.options}},e}();t.ModelDecorations=n}),define("vs/editor/core/model/tokenIterator",["require","exports","vs/editor/editor"],function(e,t,n){"use strict";var i=function(){function e(e,t){this._model=e,this._currentLineNumber=t.lineNumber,this._currentTokenIndex=0,this._currentLineTokens=this._model.getInternalTokens(this._currentLineNumber),this._next=null,this._prev=null;for(var n=t.column-1,i=Number.MAX_VALUE,o=this._currentLineTokens.length-1;o>=0;o--){if(this._currentLineTokens[o].startIndex<=n&&i>=n){this._currentTokenIndex=o,this._next=this._current(),this._prev=this._current();break}i=this._currentLineTokens[o].startIndex}}return e.prototype._advanceNext=function(){if(this._prev=this._next,this._next=null,this._currentTokenIndex+10){this._currentTokenIndex=0,this._next=this._current();break}null===this._next&&(this._currentLineTokens=this._model.getInternalTokens(this._currentLineNumber),this._currentTokenIndex=this._currentLineTokens.length,this._advancePrev(),this._next=null)}},e.prototype._advancePrev=function(){if(this._next=this._prev,this._prev=null,this._currentTokenIndex>0)this._currentTokenIndex--,this._prev=this._current();else for(;this._currentLineNumber>1;)if(this._currentLineNumber--,this._currentLineTokens=this._model.getInternalTokens(this._currentLineNumber),this._currentLineTokens.length>0){this._currentTokenIndex=this._currentLineTokens.length-1,this._prev=this._current();break}},e.prototype._current=function(){return{token:this._currentLineTokens[this._currentTokenIndex],lineNumber:this._currentLineNumber,startColumn:this._currentLineTokens[this._currentTokenIndex].startIndex+1,endColumn:this._currentTokenIndex+1n;n++)h=t[n].identifier,a=t[n].text,r=t[n].selectionStartMarkerId,s=t[n].positionMarkerId,u=e._getMarker(r),l=e._getMarker(s),d.push({identifier:h,range:new i.Range(u.lineNumber,u.column,l.lineNumber,l.column),text:a}),e._removeMarker(r),e._removeMarker(s);return d},e._applyWithMarkers=function(e,t,n){var i,o,r,s,a,u,l,h,d,c,p=[];for(i=0,o=n.length;o>i;i++)c=n[i].identifier,s=n[i].range,r=n[i].text,s.isEmpty()&&!r?(d={startLineNumber:1,startColumn:1,endLineNumber:1,endColumn:1},h=""):(s.isEmpty()?(h="",a={lineNumber:s.startLineNumber,column:s.startColumn}):(l=t.deleteText(s),h=l.deletedText,a=l.position),r?(u=t.insertText(a,r),d={startLineNumber:a.lineNumber,startColumn:a.column,endLineNumber:u.lineNumber,endColumn:u.column}):d={startLineNumber:a.lineNumber,startColumn:a.column,endLineNumber:a.lineNumber,endColumn:a.column}),p.push({identifier:c,text:h,selectionStartMarkerId:e._addMarker(d.startLineNumber-1,d.startColumn,"start"),positionMarkerId:e._addMarker(d.endLineNumber-1,d.endColumn,"end")});return p},e._compareOperations=function(e,t){return-i.RangeUtils.compareRangesUsingEnds(e.range,t.range)},e}();t.ModelEditOperation=o}),define("vs/editor/core/model/editStack",["require","exports","vs/editor/core/model/modelEditOperation"],function(e,t,n){"use strict";var i=n,o=function(){function e(e){this.model=e,this.currentOpenStackElement=null,this.past=[],this.future=[]}return e.prototype.pushStackElement=function(){null!==this.currentOpenStackElement&&(this.past.push(this.currentOpenStackElement),this.currentOpenStackElement=null)},e.prototype.clear=function(){this.currentOpenStackElement=null,this.past=[],this.future=[]},e.prototype.pushEditOperation=function(e,t,n){this.future=[],this.currentOpenStackElement||(this.currentOpenStackElement={beforeCursorState:e,editOperations:[],afterCursorState:null});var o=i.ModelEditOperation.execute(this.model,{operations:t});return this.currentOpenStackElement.editOperations.push(o),this.currentOpenStackElement.afterCursorState=n?n(o.operations):null,this.currentOpenStackElement.afterCursorState},e.prototype.undo=function(){if(this.pushStackElement(),this.past.length>0){for(var e=this.past.pop(),t=e.editOperations.length-1;t>=0;t--)e.editOperations[t]=i.ModelEditOperation.execute(this.model,e.editOperations[t]);return this.future.push(e),e.beforeCursorState}return null},e.prototype.redo=function(){if(this.future.length>0){if(this.currentOpenStackElement)throw new Error("How is this possible?");for(var e=this.future.pop(),t=0;tt;t++)i=s[t].text.length,i>=e?r+=i:o+=i;return r>o},t.prototype.addWordRegExpProperty=function(){var e=this.massageWordDefinitionOf(this.mode);this.setProperty("$WordDefinitionForMirrorModel",{source:e.source,flags:(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")})},t.prototype.getEndOfLine=function(e){switch(e){case W.EndOfLinePreference.LF:return"\n";case W.EndOfLinePreference.CRLF:return"\r\n";case W.EndOfLinePreference.TextDefined:return this.getEOL()}throw new Error("Unknown EOL preference")},t.prototype.getValue=function(e,t){"undefined"==typeof t&&(t=!1);var n={startLineNumber:1,startColumn:1,endLineNumber:this.linesLength,endColumn:this.getLineMaxColumn(this.linesLength)};return t?this.BOM+this.getValueInRange(n,e):this.getValueInRange(n,e)},t.prototype.getValueInRange=function(e,t){"undefined"==typeof t&&(t=W.EndOfLinePreference.TextDefined);var n=this.validateRange(e);if(n.isEmpty())return"";if(n.startLineNumber===n.endLineNumber)return this.lines[n.startLineNumber-1].text.substring(n.startColumn-1,n.endColumn-1);var i,o,r=this.getEndOfLine(t),s=n.startLineNumber-1,a=n.endLineNumber-1,u=this.lines[s],l=this.lines[a],h=[];i=u.text.substring(n.startColumn-1,u.text.length);for(var d=s+1;a>d;d++)o=this.lines[d],h.push(i),i=o.text;return h.push(i),h.push(l.text.substring(0,n.endColumn-1)),h.join(r)},t.prototype.setProperty=function(e,t){this.extraProperties[e]=t,this.emitModelPropertiesChangedEvent()},t.prototype.getProperty=function(e){return this.extraProperties.hasOwnProperty(e)?this.extraProperties[e]:null},t.prototype.getProperties=function(){return L.clone(this.extraProperties)},t.prototype.getMode=function(){return this.mode},t.prototype.getLineCount=function(){return this.linesLength},t.prototype.getLineContent=function(e){return this.lines[e-1].text},t.prototype.getEOL=function(){return this.EOL},t.prototype.getLineMaxColumn=function(e){return this.lines[e-1].text.length+1},t.prototype.getLineFirstNonWhitespaceColumn=function(e){var t=S.firstNonWhitespaceIndex(this.lines[e-1].text);return-1===t?0:t+1},t.prototype.getLineLastNonWhitespaceColumn=function(e){var t=S.lastNonWhitespaceIndex(this.lines[e-1].text);return-1===t?0:t+2},t.prototype.lineIsTokenized=function(e){return this.invalidLineStartIndex>e-1},t.prototype.getLineTokens=function(e,t){return"undefined"==typeof t&&(t=!1),t||this._updateTokensUntilLine(e,!0),this.lines[e-1].getLineTokens()},t.prototype.getInternalTokens=function(e){return this._updateTokensUntilLine(e,!0),this.lines[e-1].getTokens().slice(0)},t.prototype.getRawLineTokens=function(e){return this._updateTokensUntilLine(e,!0),{tokens:this.lines[e-1].getTokens().slice(0),modeTransitions:this.lines[e-1].modeTransitions.slice(0),endState:e0){var a={ids:s,addedOrChangedDecorations:o,removedDecorations:r,oldOptions:e.oldDecorationOptions,oldRanges:e.oldDecorationRange};this.emitModelDecorationsChangedEvent(a)}},t.prototype._executeWithDeferredEvents=function(e){var t=this;return this.deferredEmit(function(){0===t._executeWithDeferredEventsCnt&&(t._currentDeferredEventBuilder=new K),t._executeWithDeferredEventsCnt=t._executeWithDeferredEventsCnt+1;var n=e(t._currentDeferredEventBuilder);return t._executeWithDeferredEventsCnt=t._executeWithDeferredEventsCnt-1,0===t._executeWithDeferredEventsCnt&&(t._emitEventsFromEventBuilder(t._currentDeferredEventBuilder),t._currentDeferredEventBuilder=null),n})},t.prototype.change=function(e){var t=this;return this._executeWithDeferredEvents(function(n){var i={},o={insertText:function(e,n,o){return"undefined"==typeof o&&(o=!1),t._insertText(i,e,n,o)},deleteText:function(e){return t._deleteText(i,e)}},r=e(o);o.insertText=null,o.deleteText=null;var s=t.trackedRanges.onChangedMarkers(i);return t.modelDecorations.onChangedRanges(n,s),r})},t.prototype.addTrackedRange=function(e){return this.trackedRanges.add(e)},t.prototype.changeTrackedRange=function(e,t){this.trackedRanges.change(e,t)},t.prototype.removeTrackedRange=function(e){this.trackedRanges.remove(e)},t.prototype.getTrackedRange=function(e){return this.trackedRanges.getRange(e)},t.prototype.changeDecorations=function(e,t){"undefined"==typeof t&&(t=0);var n=this;return this._executeWithDeferredEvents(function(i){return n.modelDecorations.change(i,t,e)})},t.prototype.deltaDecorations=function(e,t,n){"undefined"==typeof n&&(n=0);var i=this;return this._executeWithDeferredEvents(function(o){return i.modelDecorations.change(o,n,function(n){return n.deltaDecorations(e,t)})})},t.prototype.removeAllDecorationsWithOwnerId=function(e){this.modelDecorations.removeAllDecorationsWithOwnerId(e)},t.prototype.getDecorationOptions=function(e){return this.modelDecorations.getOptions(e)},t.prototype.getDecorationRange=function(e){return this.modelDecorations.getRange(e)},t.prototype.getLineDecorations=function(e,t,n){return"undefined"==typeof t&&(t=0),"undefined"==typeof n&&(n=!1),this.getLinesDecorations(e,e,t,n)},t.prototype.getLinesDecorations=function(e,t,n,i){"undefined"==typeof n&&(n=0),"undefined"==typeof i&&(i=!1);var o=this.modelDecorations.getLinesDecorations(e,t,n);return i?this._filterOutValidationDecorations(o):o},t.prototype.getDecorationsInRange=function(e,t,n){this.validateRange(e);var i=this.modelDecorations.getLinesDecorations(e.startLineNumber,e.endLineNumber,t);return n?this._filterOutValidationDecorations(i):i},t.prototype._filterOutValidationDecorations=function(e){var t,n,i,o=[];for(t=0,n=e.length;n>t;t++)i=e[t].options.className,i!==N.ClassName.EditorErrorDecoration&&i!==N.ClassName.EditorWarningDecoration&&o.push(e[t]);return o},t.prototype.getAllDecorations=function(e,t){"undefined"==typeof e&&(e=0),"undefined"==typeof t&&(t=!1);var n=this.modelDecorations.getAll(e);return t?this._filterOutValidationDecorations(n):n},t.prototype._constructLines=function(e){var n=t.splitText(e);return this.BOM=n.BOM,this.EOL=n.EOL,n.lines},t.splitText=function(e){var t=0,n="";e.length>0&&e.charCodeAt(0)===B&&(n=e.charAt(0),t=1);var i,o,r,s,a=-1,u=0,l=0,h=[];for(l=t,i=t,r=e.length;r>i;i++)o=e.charCodeAt(i),o===q&&(a===z?(u++,s=e.substring(l,i-1)):s=e.substring(l,i),l=i+1,h.push(new j(s))),a=o;h.push(new j(e.substring(l)));var d=h.length-1,c="";return c=0===d||u>d/2?"\r\n":"\n",{BOM:n,EOL:c,lines:h}},t.prototype.massageWordDefinitionOf=function(e){var t=P.NullMode.DEFAULT_WORD_REGEXP;if(e.tokenTypeClassificationSupport){try{t=e.tokenTypeClassificationSupport.getWordDefinition()}catch(n){H.onUnexpectedError(n)}if(t instanceof RegExp){if(!t.global){var i="g";t.ignoreCase&&(i+="i"),t.multiline&&(i+="m"),t=new RegExp(t.source,i)}}else t=P.NullMode.DEFAULT_WORD_REGEXP}return t.lastIndex=0,t},t.prototype.getSyntaxTokensHashMap=function(){var e={},t=[];try{t=this.mode.tokenTypeClassificationSupport.getNonWordTokenTypes()}catch(n){H.onUnexpectedError(n)}for(var i=0,o=t.length;o>i;i++)e[t[i]]=!0;return e},t.prototype._iterateWords=function(e,t,n){var i=this.getLineContent(e);this.getStateBeforeLine(e);var o,r,s,a,u,l=this.getInternalTokens(e),h=this.getLineModeTransitions(e),d={};if(t&&this.mode.tokenTypeClassificationSupport&&(d=this.getSyntaxTokensHashMap()),0!==i.length){var c=0,p=c+1o;o++){if(u=o===s-1?i.length:l[o+1].startIndex,r>=p&&(c++,p=c+10){m=g.indexOf(C,y),y=m+C.length;var _=n({start:r+m,end:r+y},i);if(_)return _}}}r=u}}},t.prototype.getWordAtText=function(e,t,n,i){var o,r,s,a,u,l,h=i.match(t)||[];for(o=0;o0&&(r=i.indexOf(l,s),s=r+l.length,a=n+r+1,u=n+s+1,a<=e.column&&e.column<=u))return{word:l,startColumn:a,endColumn:u};return null},t.prototype.getWordAtTokens=function(e,t){var n,i,o,r,s,a=this.getInternalTokens(e.lineNumber),u=this.getLineContent(e.lineNumber);for(n=0,i=t.length;i>n;n++){o=t[n],s=a[o].startIndex,r=o0){var r=V.findIndexInSegmentsArray(o,e.column-1),s=null;t?(s=this.getSyntaxTokensHashMap(),s.hasOwnProperty(o[r].type)||i.push(r)):i.push(r),r>0&&o[r].startIndex===e.column-1&&(t?s.hasOwnProperty(o[r-1].type)||i.push(r-1):i.push(r-1))}return 0===i.length?null:this.getWordAtTokens(e,i)},t.prototype.getWordsInText=function(e,t){var n,i,o,r,s,a,u=e.match(t)||[],l=[];for(n=0;n0&&(i=e.indexOf(a,o),o=i+a.length,r=i,s=o,l.push({start:r,end:s}));return l},t.prototype.getWords=function(e,t,n){if("undefined"==typeof n&&(n=!1),n&&!this.lineIsTokenized(e))return this.getWordsInText(this.lines[e-1].text,this.massageWordDefinitionOf(this.mode));var i=[];return this._iterateWords(e,t,function(e){i.push(e)}),i},t.prototype.findMatches=function(e,t,n,i,o){if(""===e)return[];var r=null;try{r=S.createRegExp(e,n,i,o)}catch(s){return[]}if(S.regExpLeadsToEndlessLoop(r))return[];var a;return a=t?this.getEditableRange():this.getFullModelRange(),this.doFindMatches(a,r)},t.prototype.doFindMatches=function(e,t){var n,i=[],o=0;if(e.startLineNumber===e.endLineNumber)return n=this.lines[e.startLineNumber-1].text.substring(e.startColumn-1,e.endColumn-1),o=this.findMatchesInLine(t,n,e.startLineNumber,e.startColumn-1,o,i),i;n=this.lines[e.startLineNumber-1].text.substring(e.startColumn-1),o=this.findMatchesInLine(t,n,e.startLineNumber,e.startColumn-1,o,i);for(var r=e.startLineNumber+1;r=o;r++)o=this.findMatchesInLine(t,this.lines[r-1].text,r,0,o,i);return U>=o&&(n=this.lines[e.endLineNumber-1].text.substring(0,e.endColumn-1),o=this.findMatchesInLine(t,n,e.endLineNumber,0,o,i)),i},t.prototype.findMatchesInLine=function(e,t,n,i,o,r){var s;do if(s=e.exec(t),s&&(r.push(new R.Range(n,s.index+1+i,n,s.index+1+s[0].length+i)),o++,o>U))return o;while(s);return o},t.prototype._addMarker=function(e,t,n){var i=this.validatePosition(new x.Position(e+1,t)),o={id:(++this.lastMarkerId).toString(),column:i.column,type:n};return this.lines[i.lineNumber-1].markers.push(o),this.markerIdToLineIndex[o.id]=i.lineNumber-1,o.id},t.prototype.__findMarkerInMarkersArray=function(e,t){for(var n=0;n=0){var s=o[r],a=this.validatePosition(new x.Position(t+1,n));a.lineNumber-1!==i&&(o.splice(r,1),this.lines[a.lineNumber-1].markers.push(s),this.markerIdToLineIndex[s.id]=a.lineNumber-1),s.column=a.column}}},t.prototype._getMarker=function(e){if(this.markerIdToLineIndex.hasOwnProperty(e)){var t=this.markerIdToLineIndex[e],n=this.lines[t].markers,i=this.__findMarkerInMarkersArray(n,e);if(i>=0)return{lineNumber:t+1,column:n[i].column}}return null},t.prototype._getMarkerLineNumber=function(e){return this.markerIdToLineIndex.hasOwnProperty(e)?this.markerIdToLineIndex[e]+1:-1},t.prototype._getMarkerColumn=function(e,t){var n=this.lines[e-1].markers,i=this.__findMarkerInMarkersArray(n,t);return n[i].column},t.prototype._getLineMarkers=function(e){return this.lines[e-1].markers.slice(0)},t.prototype._removeMarker=function(e){if(this.markerIdToLineIndex.hasOwnProperty(e)){var t=this.markerIdToLineIndex[e],n=this.lines[t].markers,i=this.__findMarkerInMarkersArray(n,e);i>=0&&n.splice(i,1),delete this.markerIdToLineIndex[e]}},t.prototype.validatePosition=function(e){var t=e.lineNumber?e.lineNumber:1,n=e.column?e.column:1;1>t&&(t=1),t>this.linesLength&&(t=this.linesLength),1>n&&(n=1);var i=this.getLineMaxColumn(t);return n>i&&(n=i),new x.Position(t,n)},t.prototype.validateRange=function(e){var t=this.validatePosition(new x.Position(e.startLineNumber,e.startColumn)),n=this.validatePosition(new x.Position(e.endLineNumber,e.endColumn));return new R.Range(t.lineNumber,t.column,n.lineNumber,n.column)},t.prototype._sign=function(e){return 0>e?-1:e>0?1:0},t.prototype._findMatchingBracketUp=function(e,t,n,i){var o,r,s,a,u=i;for(o=t;o>=0;o--){r=this.lines[o];var l=r.getTokens();for(a=(o===t?n:l.length)-1;a>=0;a--)if(l[a].type===e&&(u+=this._sign(l[a].bracket),0===u))return s=a===l.length-1?r.text.length:l[a+1].startIndex,new R.Range(o+1,l[a].startIndex+1,o+1,s+1)}return null},t.prototype._findMatchingBracketDown=function(e,t,n,i){var o,r,s,a,u,l,h=1;for(o=t,s=this.linesLength;s>o;o++){if(i&&!this.lineIsTokenized(o+1))return{range:null,isAccurate:!1};this._updateTokensUntilLine(o+1,!0),r=this.lines[o];var d=r.getTokens();for(u=o===t?n+1:0,l=d.length;l>u;u++)if(d[u].type===e&&(h+=this._sign(d[u].bracket),0===h))return a=u===d.length-1?r.text.length:d[u+1].startIndex,{range:new R.Range(o+1,d[u].startIndex+1,o+1,a+1),isAccurate:!0}}return{range:null,isAccurate:!0}},t.prototype.tokenIterator=function(e,t){var n=new D.TokenIterator(this,this.validatePosition(e)),i=t(n);return n._invalidate(),i},t.prototype.findMatchingBracketUp=function(e,t){this._updateTokensUntilLine(t.lineNumber,!0);var n,i,o,r,s=this.lines[t.lineNumber-1],a=t.column-1,u=-1,l=s.getTokens();for(n=0,i=l.length;-1===u&&i>n;n++)o=l[n],r=n===i-1?s.text.length:l[n+1].startIndex,o.startIndex<=a&&r>=a&&(u=n);return this._findMatchingBracketUp(e,t.lineNumber-1,u+1,0)},t.prototype.matchBracket=function(e,t){if("undefined"==typeof t&&(t=!1),t&&!this.lineIsTokenized(e.lineNumber))return{brackets:null,isAccurate:!1};this._updateTokensUntilLine(e.lineNumber,!0);var n,i,o=this.lines[e.lineNumber-1],r={brackets:null,isAccurate:!0};if(o.text.length>0){var s,a,u=e.column-1,l=o.getTokens();for(n=0,i=l.length;null===r.brackets&&i>n;n++)if(s=l[n],a=n===i-1?o.text.length:l[n+1].startIndex,s.startIndex<=u&&a>=u){if(s.bracket<0){var h=this._findMatchingBracketUp(s.type,e.lineNumber-1,n,-1);h&&(r.brackets=[new R.Range(e.lineNumber,s.startIndex+1,e.lineNumber,a+1),h])}if(null===r.brackets&&s.bracket>0){var d=this._findMatchingBracketDown(s.type,e.lineNumber-1,n,t);r.isAccurate=d.isAccurate,d.range&&(r.brackets=[new R.Range(e.lineNumber,s.startIndex+1,e.lineNumber,a+1),d.range])}}}return r},t.prototype._revalidateTokensNow=function(){this.revalidateTokensTimeout=-1;for(var e,t=50,n=this.invalidLineStartIndex+1,i=Math.min(this.linesLength,this.invalidLineStartIndex+1e6),o=0,r=0,s=0,a=this.stopLineTokenizationAfter,u=(new Date).getTime(),l=n;i>=l;l++){if(e=(new Date).getTime()-u,e>t){i=l-1;break}if(r=this.lines[l-1].text.length,-1!==a&&r>a&&(r=a),o>0&&(s=e/o*r,e+s>t)){i=l-1;break}this._updateTokensUntilLine(l,!1),o+=r}i>=n&&this.emitModelTokensChangedEvent(n,i),this.invalidLineStartIndex=l;l++){var h=l+1,d=null,c=this.lines[l].text;if(this.mode.tokenizationSupport){var p=-1;-1!==s&&(p=(new Date).getTime()+s);try{d=this.mode.tokenizationSupport.tokenize(this.lines[l].text,this.lines[l].state,0,r,p)}catch(f){H.onUnexpectedError(f,t.MODE_TOKENIZATION_FAILED_MSG),this.onModeTokenizationFailed()}d&&d.actualStopOffseth)if(null!==this.lines[h].state&&d.endState.equals(this.lines[h].state)){for(var m=l+1;i>m&&!this.lines[m].isInvalid;){if(i>m+1){if(null===this.lines[m+1].state)break}else if(null===this.lastState)break;m++}this.invalidLineStartIndex=Math.max(this.invalidLineStartIndex,m),l=m-1}else this.lines[h].state=d.endState;else this.lastState=d.endState}n&&u>=a&&this.emitModelTokensChangedEvent(a,u),this.invalidLineStartIndex=Math.max(this.invalidLineStartIndex,o+1)},t.prototype._changeLine=function(e,t){this.lines[e].text=t,this._invalidateLine(e),this._versionId++,this.emitModelContentChangedLineChangedEvent(e+1)},t.prototype._invalidateLine=function(e){this.lines[e].isInvalid=!0,en?!0:t===n?i||"end"===e:!1},t.prototype._insertTextOneLine=function(e,t,n,i){var o=t.lineNumber-1,r=t.column,s=this.lines[o],a=s.text;this._changeLine(o,a.substring(0,r-1)+n+a.substring(r-1,a.length));for(var u,l=new x.Position(o+1,r+n.length),h=0,d=s.markers.length;d>h;h++)u=s.markers[h],this._shouldMoveMarkerOnTextInsert(u.type,u.column,r,i)&&(this._beforeMarkerChange(u,e),u.column+=n.length);return l},t.prototype._insertTextMultiline=function(e,t,n,i){var o,r,s=t.lineNumber-1,a=t.column,u=this.lines[s].text,l=u.substring(a-1,u.length);this._changeLine(s,u.substring(0,a-1)+n[0]);var h="";for(o=1,r=n.length-1;r>o;o++)h+=n[o]+"\n",this.lines.splice(s+o,0,new j(n[o]));var d=s+n.length-1,c=n[n.length-1],p=c+l,f=[];this.lines.splice(d,0,new j(p,f)),this.linesLength=this.lines.length;var m,g=this.lines[s].markers;for(o=0;ov;v++)m=C[v],this._beforeMarkerChange(m,e),this.markerIdToLineIndex[m.id]=o;return n.length>1&&(this._versionId++,this.emitModelContentChangedLinesInsertedEvent(s+2,d+1,h+p)),new x.Position(d+1,1+c.length)},t.prototype._insertText=function(e,t,n,i){var o=this.validatePosition(t);if(0===n.length)return o;for(var r=n.split("\n"),s=0,a=r.length;a>s;s++)"\r"===r[s].charAt(r[s].length-1)&&(r[s]=r[s].substring(0,r[s].length-1));return 1===r.length?this._insertTextOneLine(e,o,r[0],i):this._insertTextMultiline(e,o,r,i)},t.prototype._deleteTextOneLine=function(e,t){var n=t.startLineNumber-1,i=this.lines[n],o=this.lines[n].text,r=o.substring(t.startColumn-1,t.endColumn-1);this._changeLine(n,o.substring(0,t.startColumn-1)+o.substring(t.endColumn-1,o.length));for(var s,a=0,u=i.markers.length;u>a;a++)s=i.markers[a],s.column>=t.endColumn?(this._beforeMarkerChange(s,e),s.column-=t.endColumn-t.startColumn):s.column>=t.startColumn&&(this._beforeMarkerChange(s,e),s.column=t.startColumn);return{position:new x.Position(t.startLineNumber,t.startColumn),deletedText:r}},t.prototype._deleteTextMultiline=function(e,t){var n=t.startLineNumber-1,i=t.endLineNumber-1,o=this.lines[i],r=o.text,s=r.substring(t.endColumn-1,r.length),a=this.lines[n],u=a.text;this._changeLine(n,u.substring(0,t.startColumn-1)+s);var l,h,d=u.substring(t.startColumn-1,u.length);for(l=n+1;i>l;l++)d+="\n"+this.lines[l].text;d+="\n"+r.substring(0,t.endColumn-1);var c=i-n,p=this.lines.splice(n+1,c);this.linesLength=this.lines.length;var f;for(l=0,h=a.markers.length;h>l;l++)f=a.markers[l],f.column>t.startColumn&&(this._beforeMarkerChange(f,e),f.column=t.startColumn);for(l=0;l=t.endColumn&&(this._beforeMarkerChange(f,e),o.markers.splice(l,1),a.markers.push(f),f.column-=t.endColumn-t.startColumn,this.markerIdToLineIndex[f.id]=n,l--);var m=[];for(l=0,h=p.length;h>l;l++)m=m.concat(p[l].markers);for(l=0,h=m.length;h>l;l++)f=m[l],this._beforeMarkerChange(f,e),f.column=t.startColumn,this.markerIdToLineIndex[f.id]=n;a.markers=a.markers.concat(m);var g,v,y;for(l=n+1;lg;g++)f=y[g],this._beforeMarkerChange(f,e),this.markerIdToLineIndex[f.id]=l;return this._versionId++,this.emitModelContentChangedLinesDeletedEvent(n+2,i+1),{position:new x.Position(t.startLineNumber,t.startColumn),deletedText:d}},t.prototype._deleteText=function(e,t){var n=this.validateRange(t);return n.isEmpty()?{position:new x.Position(n.startLineNumber,n.startColumn),deletedText:""}:n.startLineNumber===n.endLineNumber?this._deleteTextOneLine(e,n):this._deleteTextMultiline(e,n)},t.prototype._publishMarkerUpdate=function(e){var t=O.createMarkerUpdateFromJson(e);null!==this.markerService&&this.markerService.change(function(e){e.processMarkerUpdate(t)});for(var n=t.getId(),i=this.markerDecorationIds[n]||[],o=[],r=t.getMarkers(),s=0;s=n)return null;var i=e.charAt(t);return t++,i},saveState:function(){return t},restoreState:function(e){t=e},peek:function(){return t>=n?null:e.charAt(t)},eob:function(){return t>=n}}},e.parse=function(e){for(var t="",n=0,i=this._quickStream(e),o=[];!i.eob();){var r=i.next();if("\r"!==r){if(27===r.charCodeAt(0)){var s=i.saveState();if("["===i.next()){var a=null,u=i.next();if(u>="0"&&"9">=u&&(a=u,u=i.next()),u>="0"&&"9">=u&&(a+=u,u=i.next()),null===a&&(a="0"),"m"===u){o.push({offset:n,code:a});continue}if("K"===u||"G"===u)continue}i.restoreState(s)}t+=r,n++}}return{parsedText:t,escapeSequences:o}},e}(),c=function(e){function t(t,n,i,o){"undefined"==typeof i&&(i=null),"undefined"==typeof o&&(o=null);var r=d.parse(t);e.call(this,r.parsedText,n,i),this.promptText="",this.colorRanges=[],this.addColorRanges(0,r.escapeSequences),this.didFindCarriageReturn=!1}return __extends(t,e),t.prototype.setValue=function(t,n){"undefined"==typeof n&&(n=null);var i=d.parse(t);e.prototype.setValue.call(this,i.parsedText,n),this.colorRanges=[],this.addColorRanges(0,i.escapeSequences)},t.prototype.appendOutput=function(e){var t=this,n=this.getEditableRange();this.change(function(i){for(var o=n.getStartPosition(),r=0,s=0;sthis.promptText.length&&this.change(function(i){var o=i.deleteText(new l.Range(n.startLineNumber,n.startColumn-t.promptText.length,n.startLineNumber,n.startColumn));i.insertText(o.position,e,!0)}),this.setPromptText(e)},t.prototype._insertText=function(t,n,i,o){var r=d.parse(i),s=this.getOffsetFromPosition(n);this.didFindCarriageReturn&&r.parsedText.length>0&&("\n"!==r.parsedText[0]&&(n=this._deleteText(t,new l.Range(n.lineNumber,1,n.lineNumber,n.column)).position),this.didFindCarriageReturn=!1);var a=e.prototype._insertText.call(this,t,n,r.parsedText,o);return this.addColorRanges(s,r.escapeSequences),a},t.prototype.addColorRanges=function(e,t){for(var n=null,i=0;i=n;n++)if(t+=this.getLineContent(n).length+1,t>e){var o=t-(this.getLineContent(n).length+1);return new u.Position(n,e-o+1)}return new u.Position(i,this.getLineMaxColumn(i))},t.prototype.getOffsetFromPosition=function(e){return this.getLineStartOffset(e.lineNumber)+e.column-1},t.prototype.getLineStartOffset=function(e){for(var t=0,n=1,i=Math.min(e,this.getLineCount())-1;i>=n;n++)t+=this.getLineContent(n).length+1;return t},t.prototype.updateLineTokens=function(e,t){var n=t.tokens;if(1===n.length){for(var i=[],o=e+1,r=this.getLineMaxColumn(o),s=0;so||a.endLineNumber0){i.sort(function(e,t){return e.startColumn-t.startColumn}),n=[];for(var s=0;s0?[{start:0,end:t.length}]:[]}function r(e,t){var n=t.toLowerCase().indexOf(e.toLowerCase());return-1===n?null:[{start:n,end:n+e.length}]}function s(e,t){return a(e.toLowerCase(),t.toLowerCase(),0,0)}function a(e,t,n,i){if(n===e.length)return[];if(i===t.length)return null;if(e[n]===t[i]){var o=null;if(o=a(e,t,n+1,i+1))return d({start:i,end:i+1},o)}return a(e,t,n,i+1)}function u(e,t){if(0===t.length)return null;for(var n=null,i=0;i=65&&90>=t}function h(e){var t=e.charCodeAt(0);return t>=48&&57>=t}function d(e,t){return 0===t.length?t=[e]:e.end===t[0].start?t[0].start=e.start:t.unshift(e),t}function c(e,t){for(var n=t;nn;n++)i[n]=!1;for(var n=0;n=this.sourceLength},e.prototype.peek=function(){if(this._pos>=this.sourceLength)throw new Error("Stream is at the end");return this._source[this._pos]},e.prototype.next=function(){if(this._pos>=this.sourceLength)throw new Error("Stream is at the end");return this.tokenStart=-1,this.tokenEnd=-1,this._source[this._pos++]},e.prototype.advance=function(e){var t=this._pos;return this._pos+=e,this.resetPeekedToken(),this._source.substring(t,this._pos)},e.prototype.advanceToEOS=function(){var e=this._pos;return this._pos=this.sourceLength,this.resetPeekedToken(),this._source.substring(e,this._pos)},e.prototype.goBack=function(e){this._pos-=e,this.resetPeekedToken()},e.prototype.createPeeker=function(e){var t=this;if(e instanceof RegExp)return function(){var n=e.exec(t._source.substr(t._pos));if(null===n)return 0;if(0!==n.index)throw new Error('Regular expression must begin with the character "^"');return n[0].length};if((e instanceof String||"string"==typeof e)&&e)return function(){for(var n=e.length,i=t._pos+n<=t.sourceLength,o=0;i&&n>o;o++)i=t._source.charCodeAt(t._pos+o)===e.charCodeAt(o);return i?n:0};throw new Error("Condition must be either a regular expression, function or a non-empty string")},e.prototype.advanceIfStringCaseInsensitive=function(e){var t,n=this._pos,i=this._source,o=e.length;if(1>o||n+o>this.sourceLength)return"";for(t=0;o>t;t++)if(i.charAt(n+t).toLowerCase()!==e.charAt(t).toLowerCase())return"";return this.advance(o)},e.prototype.advanceIfString=function(e){var t,n=this._pos,i=this._source,o=e.length;if(1>o||n+o>this.sourceLength)return"";for(t=0;o>t;t++)if(i.charCodeAt(n+t)!==e.charCodeAt(t))return"";return this.advance(o)},e.prototype.advanceIfCharCode=function(e){return this._pos=this.sourceLength)return"";var t=e.exec(this._source.substr(this._pos));if(t){if(0===t.index)return this.advance(t[0].length);throw new Error('Regular expression must begin with the character "^"')}return""},e.prototype.advanceLoop=function(e,t,n){if(this.eos())return"";var i=this.createPeeker(e),o=this._pos,r=0,s=null;for(s=t?function(e){return e>0}:function(e){return 0===e};!this.eos()&&s(r=i());)r>0?this.advance(r):this.next();return n&&!this.eos()&&this.advance(r),this._source.substring(o,this._pos)},e.prototype.advanceWhile=function(e){return this.advanceLoop(e,!0,!1)},e.prototype.advanceUntil=function(e,t){return this.advanceLoop(e,!1,t)},e.prototype.resetPeekedToken=function(){this.tokenStart=-1,this.tokenEnd=-1},e.prototype.setTokenRules=function(e,t){(this.separators!==e||this.whitespace!==t)&&(this.separators=e,this.separatorsArr=this.stringToArray(this.separators),this.whitespace=t,this.whitespaceArr=this.stringToArray(this.whitespace),this.resetPeekedToken())},e.prototype.peekToken=function(){if(-1!==this.tokenStart)return this._source.substring(this.tokenStart,this.tokenEnd);var e=this._source,t=this.sourceLength,n=this.whitespaceArr,i=this.separatorsArr,o=this._pos;if(o>=t)throw new Error("Stream is at the end");for(;n[e.charCodeAt(o)]&&t>o;)o++;var r=o;if(i[e.charCodeAt(r)]&&t>r)r++;else for(;!i[e.charCodeAt(r)]&&!n[e.charCodeAt(r)]&&t>r;)r++;return this.tokenStart=o,this.tokenEnd=r,e.substring(o,r)},e.prototype.nextToken=function(){if(this._pos>=this.sourceLength)throw new Error("Stream is at the end");var e;return e=-1===this.tokenStart?this.peekToken():this._source.substring(this.tokenStart,this.tokenEnd),this._pos=this.tokenEnd,this.tokenStart=-1,this.tokenEnd=-1,e},e.prototype.peekWhitespace=function(){for(var e=this._source,t=this.sourceLength,n=this.whitespaceArr,i=this._pos;n[e.charCodeAt(i)]&&t>i;)i++;return e.substring(this._pos,i)},e.prototype.skipWhitespace=function(){for(var e=this._source,t=this.sourceLength,n=this.whitespaceArr,i=this._pos,o=this._pos;n[e.charCodeAt(o)]&&t>o;)o++;return i!==o?(this._pos=o,this.tokenStart=-1,this.tokenEnd=-1,e.substring(i,o)):""},e}();t.LineStream=n}),define("vs/base/worker/workerClient",["require","exports","vs/base/lib/winjs.base","vs/base/dom/dom","vs/base/performance/timer"],function(e,t,n,i,o){"use strict";var r=n,s=i,a=o;t.WorkerMain="workerMain.js";var u=function(){function n(n,i,o){this.id=n,this.worker=new Worker(e.toUrl("./"+t.WorkerMain+"?"+encodeURIComponent(i))),this.worker.onmessage=function(e){o(JSON.parse(e.data))}}return n.prototype.getId=function(){return this.id},n.prototype.postMessage=function(e){this.worker.postMessage(JSON.stringify(e))},n.prototype.terminate=function(){this.worker.terminate()},n}(),l=function(){function t(t,n){var i=this;this.id=t,this._loaded=!1,this._beforeLoadMessages=[],this.iframe=document.createElement("iframe"),this.iframe.id=this._iframeId(),this.iframe.src=e.toUrl("./workerMainCompatibility.html"),this.iframe.frameborder=this.iframe.height=this.iframe.width="0",this.iframe.style.display="none",s.addListener(this.iframe,"load",function(){return i._onLoaded()}),this._onMessage=function(e){var t=null;try{t=JSON.parse(e.data)}catch(i){}t&&n(t)},s.addListener(window,"message",this._onMessage),document.body.appendChild(this.iframe)}return t.prototype._iframeId=function(){return"worker_iframe_"+this.id},t.prototype._onLoaded=function(){for(this._loaded=!0;this._beforeLoadMessages.length>0;)this.postMessage(this._beforeLoadMessages.shift())},t.prototype.getId=function(){return this.id},t.prototype.postMessage=function(e){this._loaded===!0?window.frames[this._iframeId()].postMessage(JSON.stringify(e),"*"):this._beforeLoadMessages.push(e)},t.prototype.terminate=function(){window.removeEventListener("message",this._onMessage),window.frames[this._iframeId()].close()},t}(),h=function(){function e(e){this.label=e}return e.prototype.create=function(e,t){var n=null;try{n=new u(e,this.label,t)}catch(i){n=new l(e,t)}return n},e}();t.DefaultWorkerFactory=h;var d=function(){function e(t,n){var i=this;this.lastMessageId=0,this.promises={},this.messageHandlers={},this._messagesQueue=[],this._processQueueTimeout=-1,this._waitingForWorkerReply=!1,this._lastTimerEvent=null,this.worker=t.create(++e.LAST_WORKER_ID,function(e){return i._onmessage(e)}),this.onModuleLoaded=this._sendMessage("$initialize",{id:this.worker.getId(),moduleId:n}),this.onModuleLoaded.then(null,function(){return i.onError("Worker failed to load "+n)})}return e.LAST_WORKER_ID=1,e.prototype.request=function(e,t,n){var i=this;if("$"===e.charAt(0))throw new Error("Illegal requestName: "+e);var o,s=!1;return new r.Promise(function(r,a,u){i.onModuleLoaded.then(function(){s||(o=i._sendMessage(e,t,n).then(r,a,u))},a,u)},function(){o?o.cancel():s=!0})},e.prototype.destroy=function(){var e=Object.keys(this.promises);if(e.length>0){console.warn("Terminating a worker with "+e.length+" pending promises:"),console.warn(this.promises);for(var t in this.promises)e.hasOwnProperty(t)&&this.promises[t].error("Worker forcefully terminated")}this.worker.terminate()},e.prototype.addMessageHandler=function(e,t){this.messageHandlers[e]=t},e.prototype.removeMessageHandler=function(e){delete this.messageHandlers[e]},e.prototype._sendMessage=function(e,t,n){"undefined"==typeof n&&(n=(new Date).getTime());var i,o,s,a=this,u={id:++this.lastMessageId,type:e,timestamp:n,payload:t},l=new r.Promise(function(e,t,n){i=e,o=t,s=n},function(){a._removeMessage(u.id)});return this.promises[u.id]={complete:i,error:o,progress:s,type:e,payload:t},this._enqueueMessage(u),l},e.prototype._enqueueMessage=function(e){var t,n=-1;for(t=this._messagesQueue.length-1;t>=0;t--)if(this._messagesQueue[t].timestamp<=e.timestamp){n=t;break}this._messagesQueue.splice(n+1,0,e),this._processMessagesQueue()},e.prototype._removeMessage=function(e){for(var t=0,n=this._messagesQueue.length;n>t;t++)if(this._messagesQueue[t].id===e)return this.promises.hasOwnProperty(String(e))&&delete this.promises[String(e)],this._messagesQueue.splice(t,1),this._processMessagesQueue(),void 0},e.prototype._processMessagesQueue=function(){var e=this;if(-1!==this._processQueueTimeout&&(clearTimeout(this._processQueueTimeout),this._processQueueTimeout=-1),0!==this._messagesQueue.length&&!this._waitingForWorkerReply){var t=this._messagesQueue[0].timestamp-(new Date).getTime();t=Math.max(0,t),this._processQueueTimeout=setTimeout(function(){if(e._processQueueTimeout=-1,0!==e._messagesQueue.length){e._waitingForWorkerReply=!0;var t=e._messagesQueue.shift();e._lastTimerEvent=a.start(a.Topic.WORKER,e._decodeMessageName(t)),e.worker.postMessage(t)}},t)}},e.prototype._decodeMessageName=function(e){return e.type},e.prototype._onmessage=function(e){if(e.monacoWorker&&(!e.from||e.from===this.worker.getId())){switch(e.type){case"$reply":if(this._waitingForWorkerReply=!1,this._lastTimerEvent&&this._lastTimerEvent.stop(),!this.promises.hasOwnProperty(String(e.id)))return this.onError("Received unexpected message from Worker:",e),void 0;switch(e.action){case"complete":this.promises[e.id].complete(e.payload),delete this.promises[e.id];break;case"error":this.onError("Main Thread sent to worker the following message:",{type:this.promises[e.id].type,payload:this.promises[e.id].payload}),this.onError("And the worker replied with an error:",e.payload),this.promises[e.id].error(e.payload),delete this.promises[e.id];break;case"progress":this.promises[e.id].progress(e.payload)}break;case"$schedule":this._sendMessage("$schedule",{scheduleId:e.scheduleId},e.timestamp);break;case"$print":switch(e.level){case"log":console.log(e.payload);break;case"debug":console.info(e.payload);break;case"info":console.info(e.payload);break;case"warn":console.warn(e.payload);break;case"error":console.error(e.payload);break;default:this.onError("Received unexpected message from Worker:",e)}break;default:if(e.type in this&&"function"==typeof this[e.type])this[e.type](e.payload);else{var t=this.messageHandlers[e.type];t&&"function"==typeof t?t(e.payload):this.onError("Received unexpected message from Worker:",e)}}this._processMessagesQueue()}},e.prototype.onError=function(e,t){console.error(e),console.info(t)},e}();t.WorkerClient=d});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/editor/worker/editorWorkerClient",["require","exports","vs/base/worker/workerClient","vs/editor/core/constants","vs/editor/editor"],function(e,t,n,i,o){"use strict";var r=n,s=i,a=o,u=function(e){function t(t,n,i){e.call(this,new r.DefaultWorkerFactory(n),"vs/editor/worker/editorWorkerServer"),this.languageModeModuleId=t,this.friendlyModuleId=this.languageModeModuleId;var o=this.friendlyModuleId.lastIndexOf("/");o>=0&&(this.friendlyModuleId=this.friendlyModuleId.substr(o+1));var s={languageModeModuleId:t,extraData:i.extraData,configData:i.configData,workspace:i.contextService?i.contextService.getWorkspace():void 0,configuration:i.contextService?i.contextService.getConfiguration():void 0,options:i.contextService?i.contextService.getOptions():void 0,participants:i.participants?i.participants.map(function(e){return{moduleId:e.getModuleId(),ctorName:e.getCtorName()}}):[]};this.onModuleLoaded=this.request("initialize",s),this.models={},this.modelsUnbind={},this.modelsDecorations={},this.modelsValidateTimeout={}}return __extends(t,e),t.prototype._decodeMessageName=function(e){var t=e.type;return"rawRequest"===e.type&&(t=e.payload.name),this.friendlyModuleId+" - "+t},t.prototype.addWorkerParticipant=function(e){this.request("addWorkerParticipant",{moduleId:e.getModuleId(),ctorName:e.getCtorName()})},t.prototype.modelDecorationsUpdate=function(e){if(this.models.hasOwnProperty(e.modelId)){var t=this.models[e.modelId],n=[];for(var i in e.decorations)e.decorations.hasOwnProperty(i)&&n.push(e.decorations[i]);this.modelsDecorations[t.id]=t.deltaDecorations(this.modelsDecorations[t.id]||[],n)}},t.prototype.unbindModel=function(e){this.modelsUnbind[e.id](),delete this.modelsUnbind[e.id],delete this.models[e.id],delete this.modelsDecorations[e.id],this.modelsValidateTimeout.hasOwnProperty(e.id)&&(window.clearTimeout(this.modelsValidateTimeout[e.id]),delete this.modelsValidateTimeout[e.id]),this.request("modelDestroy",[e.getAssociatedResource()],0)},t.prototype._mixinProperties=function(e,t,n){for(var i=0;ir;r++){var u=n[r],l=u.getData();switch(u.getType()){case s.EventType.ModelContentChanged:switch(l.changeType){case s.EventType.ModelContentChangedFlush:i.push(t._mixinProperties({type:u.getType()},l,["changeType","detail","versionId"]));break;case s.EventType.ModelContentChangedLinesDeleted:i.push(t._mixinProperties({type:u.getType()},l,["changeType","fromLineNumber","toLineNumber","versionId"]));break;case s.EventType.ModelContentChangedLinesInserted:i.push(t._mixinProperties({type:u.getType()},l,["changeType","fromLineNumber","toLineNumber","detail","versionId"]));break;case s.EventType.ModelContentChangedLineChanged:i.push(t._mixinProperties({type:u.getType()},l,["changeType","lineNumber","detail","versionId"]))}o=!0;break;case s.EventType.ModelPropertiesChanged:i.push(t._mixinProperties({type:u.getType()},l,["properties"]))}}i.length>0&&t._sendModelEvent(e,i),o&&t._setupValidation(e)})},t.prototype._sendModelEvent=function(e,t){this.request("modelEvents",[e.getAssociatedResource(),t],0)},t.prototype._onError=function(e,t){console.error("["+this.languageModeModuleId+"]: "+e),console.error(t)},t.prototype.publishMarkerUpdates=function(e){for(var t=0;t=e&&t>=S;case 3:return S>=e&&n>=S;case 4:return S>=e&&i>=S;case 5:return S>=e&&o>=S;case 6:return S>=e&&r>=S;case 7:return S>=e&&s>=S;case 8:return S>=e&&a>=S;case 9:return S>=e&&u>=S;case 10:return S>=e&&l>=S;case 11:return S>=e&&l>=S||S===h||S===g;case 12:return S>=e&&l>=S||S>=h&&d>=S||S>=g&&v>=S;case 13:return S>=e&&l>=S||S>=h&&c>=S||S>=g&&y>=S;case 14:return S>=e&&l>=S||S>=h&&p>=S||S>=g&&C>=S;case 15:return S>=e&&l>=S||S>=h&&f>=S||S>=g&&_>=S;default:return S>=e&&l>=S||S>=h&&m>=S||S>=g&&b>=S}}}();var L=function(){function e(e,t,n){this.startIndex=e,this.type=t,this.bracket=n}return e}(),T=function(){function e(e,t,n){"undefined"==typeof e&&(e=null),"undefined"==typeof t&&(t=null),"undefined"==typeof n&&(n=!1),this.id=e,this.workerModule=t,this.supportsNestedMode=n,this.workerPool=[],this.defaultWorker=null,this.models={},this.options=null,this.validationSupport=this,this.tokenizationSupport=this,this.occurrencesSupport=this,this.suggestSupport=this,this.parameterHintsSupport=this,this.formattingSupport=this,this.inplaceReplaceSupport=this,this.diffSupport=this,this.dirtyDiffSupport=this,this.linkSupport=this,this.configSupport=this,this.electricCharacterSupport=this,this.commentsSupport=this,this.characterPairSupport=this,this.tokenTypeClassificationSupport=this}return e.MAX_EMBEDDED_LEVELS=5,e.prototype.getId=function(){return this.id},e.prototype._models=function(){return this.models},e.prototype.injectContextService=function(e){this.contextService=e},e.prototype.newWorker=function(e,n){var i=this;if(!this.workerModule)return null;if(!this.contextService)return null;g.isUndefinedOrNull(n)&&(n=this.workerModule.substring(this.workerModule.lastIndexOf("/")+1));var o=[],r=this.getId();if(null!==r&&r.length>0){var s=v.Registry.as(t.Extensions.EditorModes);s.getWorkerParticipants(r).forEach(function(e){o.push(e)})}try{var a=new _.EditorWorkerClient(this.workerModule,n,{contextService:this.contextService,participants:o,configData:this.options,extraData:e});return this.workerPool.push(a),Object.keys(this.models).forEach(function(e){a.bindModel(i.models[e])}),a}catch(u){return console.error(u),void 0}},e.prototype.getWorkers=function(){return this.workerPool.slice(0)},e.prototype.workerRequest=function(e,t,n){"undefined"==typeof t&&(t=null);var i=w.start(w.Topic.LANGUAGES,e.commandName||e.command),o=function(){i.stop()};return n||(this.ensureDefaultWorker(),n=this.defaultWorker),n?f.decoratePromise(n.request(e.command,e.params),o,o):f.Promise.as(t)},e.prototype.ensureDefaultWorker=function(){this.defaultWorker||(this.defaultWorker=this.newWorker())},e.prototype.bindModel=function(e){this.ensureDefaultWorker(),this.models[e.id]=e,this.workerPool.forEach(function(t){t.bindModel(e)})},e.prototype.unbindModel=function(e){delete this.models[e.id],this.workerPool.forEach(function(t){t.unbindModel(e)})},e.prototype.validate=function(e){return this.request("validate",null,e)},e.prototype.getFilter=function(){return y.DefaultFilter},e.prototype.suggest=function(e,t,n){return this.request("suggest",n,e,t)},e.prototype.getTriggerCharacters=function(){return[]},e.prototype.shouldAutotriggerSuggest=function(t,n,i){return this._handleEvent(t,n,i,function(t,n,i,o){return t instanceof e?t.shouldAutotriggerSuggestImpl(n,i.tokens,o):t.suggestSupport?t.suggestSupport.shouldAutotriggerSuggest(n,i,o):void 0})},e.prototype.shouldAutotriggerSuggestImpl=function(){return!1},e.prototype.shouldShowEmptySuggestionList=function(){return!0},e.prototype.getParameterHints=function(){return f.Promise.as(null)},e.prototype.getParameterHintsTriggerCharacters=function(){return["(",","]},e.prototype.findOccurrences=function(e,t,n,i){return"undefined"==typeof n&&(n=!1),this.request("findOccurrences",i,e,t,n)},e.prototype.format=function(e,t,n){return this.request("format",null,e,t,n)},e.prototype.navigateValueSet=function(e,t,n,i){return this.request("navigateValueSet",i,e,t,n)},e.prototype.computeDiff=function(e,t,n){return this.request("computeDiff",n,e,t)},e.prototype.computeDirtyDiff=function(e,t){return this.request("computeDirtyDiff",t,e)},e.prototype.computeLinks=function(e){return this.request("computeLinks",null,e)},e.prototype.configure=function(e){var t=this;if(g.isEmptyObject(e))return f.Promise.as(!0);this.options=e;var n=this.workerPool.map(function(n){return t.request("configure",n,e)});return f.Promise.join(n)},e.prototype.onEnter=function(t,n,i){return this._handleEvent(t,n,i,function(t,n,i,o){return t instanceof e?t.onEnterImpl(n,i.tokens,o):t.electricCharacterSupport?t.electricCharacterSupport.onEnter(n,i,o):void 0})},e.prototype.onEnterImpl=function(){return null},e.prototype.onElectricCharacter=function(t,n,i){return this._handleEvent(t,n,i,function(t,n,i,o){return t instanceof e?t.onElectricCharacterImpl(n,i.tokens,o):t.electricCharacterSupport?t.electricCharacterSupport.onElectricCharacter(n,i,o):void 0})},e.prototype.onElectricCharacterImpl=function(){return null},e.prototype.getElectricCharacters=function(){return[]},e.prototype.request=function(e,t){for(var n=[],i=0;im;m++)c=r[m],p.push(new L(c.startIndex-f,c.type,c.bracket));var g=e.substring(f,h),v=n-f,y={tokens:p,modeTransitions:[{startIndex:0,mode:a}],actualStopOffset:0,endState:null};return i(a,g,y,v)},e.prototype._getEmbeddedLevel=function(e){for(var t=-1;e;)t++,e=e.getStateData();return t},e.prototype._nestedTokenize=function(e,t,n,i,o,r,s){var a=t.getStateData(),u=this.getLeavingNestedModeData(e,a),l=t.getMode();if(!u){var h;return h=l.tokenizationSupport?t.getMode().tokenizationSupport.tokenize(e,t,n,i,o):E.nullTokenize(l,e,t,n),h.tokens=r.concat(h.tokens),h.modeTransitions=s.concat(h.modeTransitions),h}var d=u.nestedModeBuffer;if(d.length>0){var c;c=l.tokenizationSupport?t.getMode().tokenizationSupport.tokenize(d,t,n,i,o):E.nullTokenize(l,d,t,n),r=r.concat(c.tokens),s=s.concat(c.modeTransitions)}var p=u.bufferAfterNestedMode,f=u.stateAfterNestedMode;return f.setStateData(a.getStateData()),this._myTokenize(p,f,n+d.length,i,o,r,s)},e.prototype._myTokenize=function(t,n,i,o,r,s,a){var u,l,h=new C.LineStream(t),d=null;n=n.clone(),(a.length<=0||a[a.length-1].mode!==this)&&a.push({startIndex:i,mode:this});for(var c=Math.min(o-i,t.length),p=b.Bracket.None,f=0;h.pos()=r);){l=h.pos();do{if(u=n.tokenize(h),null===u||void 0===u||(void 0===u.type||null===u.type)&&(void 0===u.nextState||null===u.nextState))throw new Error("Tokenizer must return a valid state");if(u.nextState&&(u.nextState.setStateData(n.getStateData()),n=u.nextState),h.pos()<=l)throw new Error("Stream did not advance while tokenizing.")}while(!u.type&&""!==u.type);if((d!==u.type||u.bracket||null===d)&&s.push(new L(l+i,u.type,u.bracket||p)),d=u.type,this.supportsNestedMode&&this.enterNestedMode(n)){var m=this._getEmbeddedLevel(n);if(m0;)this.callOnDispose.pop()()},e.prototype.onModelChange=function(){var e=this,t=this.editor.getModel();if(t){var n=t.getMode();"vs.languages.typescript"===n.getId()&&n instanceof h.AbstractMode?(this.domNode.show(),this.created||(this.created=!0,this.factory.getStatus(n).forEach(function(t){var n=p(".worker").appendTo(e.domNode);e.updateWidget(n,a.Unknown),e.callOnDispose.push(t.addListener(f.Events.Updated,function(t){e.updateWidget(n,t)}))}))):this.domNode.hide()}},e.prototype.updateWidget=function(e,t){t&&t!==a.Unknown?t===a.Ok?e.attr("status","ok"):t===a.Updating?e.attr("status","updating"):t===a.Fetching?e.attr("status","fetching"):t===a.Error&&e.attr("status","error"):e.attr("status","unkown")},e.prototype.getDomNode=function(){return this.domNode.getHTMLElement()},e.prototype.getPosition=function(){return{preference:u.OverlayWidgetPositionPreference.TOP_RIGHT_CORNER}},e}();t.StatusPresenter=v}),define("vs/languages/typescript/typescript.contribution",["require","exports","vs/platform/platform","vs/editor/modes/modesExtensions","vs/editor/editorExtensions","./editor/workerStatusReporter","vs/base/env"],function(e,t,n,i,o,r,s){"use strict";var a=n,u=i,l=o,h=r,d=s,c=a.Registry.as(u.Extensions.EditorModes);c.registerMode(["text/typescript"],new a.DeferredDescriptor("vs/languages/typescript/typescript","TypeScriptMode")),d.enableNLSWarnings&&c.registerWorkerParticipant("vs.languages.typescript",new a.DeferredDescriptor("vs/languages/typescript/participants/nlsParticipant","WorkerParticipant")),d.enableMonacoTeamStyleChecker&&c.registerWorkerParticipant("vs.languages.typescript",new a.DeferredDescriptor("vs/languages/typescript/participants/monacoStyleParticipant","WorkerParticipant")),d.enableEditorLanguageServiceIndicator&&a.Registry.as(l.Extensions.EditorContributions).registerEditorContribution(new a.BaseDescriptor(h.StatusPresenter)),c.registerWorkerParticipant("vs.languages.typescript",new a.DeferredDescriptor("vs/languages/typescript/participants/symbolUsageParticipant","WorkerParticipant"))}),define("vs/languages/xml/xml.contribution",["require","exports","vs/platform/platform","vs/editor/modes/modesExtensions"],function(e,t,n,i){"use strict";var o=n,r=i,s=o.Registry.as(r.Extensions.EditorModes);s.registerMode(["text/xml","application/xml","application/xaml+xml"],new o.DeferredDescriptor("vs/languages/xml/xml","XMLMode"))}),define("vs/languages/languages.main",["vs/languages/css/css.contribution","vs/languages/html/html.contribution","vs/languages/javascript/javascript.contribution","vs/languages/plaintext/plaintext.contribution","vs/languages/typescript/typescript.contribution","vs/languages/xml/xml.contribution"],function(){"use strict"}),require.config({ignoreDuplicateModules:["vs/languages/vsxml/vsxml"]}),define("vs/editor/editor.main",["./editor.all","./standalone/standaloneEditor","vs/languages/languages.main"],function(){"use strict"}),define("vs/editor/modes/autoIndentation/autoIndentation",["require","exports","vs/editor/modes/modes"],function(e,t,n){"use strict";var i=n,o=function(){function e(e){this.brackets=e}return e.prototype.getElectricBrackets=function(){for(var e,t=[],n=0;n0&&""===r.type;)o--,r=t[o-1];if(o>0&&this.tokenTypeIsBracket(r.type)&&r.bracket===i.Bracket.Open){for(var s=t[o];oi;i++)if(" "!==e[i]&&" "!==e[i])return null;return{matchBracketType:this.tokenTypeFromChar(e[n])}},e.prototype.tokenTypeFromChar=function(e){for(var t,n=0;n .selections-layer > .selected-text { background: #ADD6FF !important; } .monaco-editor .dynamic > .selections-layer > .selected-text { background: #E5EBF1 !important; } .monaco-diff-editor .diffOverview { background-color: #f9f7f7; } .monaco-editor .wordHighlight { background-color: rgba(253, 255, 0, 0.28); } .monaco-editor.ie8 .wordHighlight { filter: alpha(opacity=28); background-color: rgb(253, 255, 0); } .monaco-editor .wordHighlightStrong { background-color: rgba(249, 206, 130, 0.7); } .monaco-editor.ie8 .wordHighlightStrong { filter: alpha(opacity=70); background-color: rgb(249, 206, 130); } .monaco-editor .valueSetReplacement { outline: solid 2px #888; } .monaco-editor .focus-mode { background-color: #FFFFFF; opacity: 0.333; } .monaco-editor .token { color: #000000; } .monaco-editor .token.meta { color: #e00000; } .monaco-editor .token.meta.code1 { font-weight: bold; } .monaco-editor .token.keyword { color: #0000FF; } .monaco-editor .token.keyword.flow { color: #AF00DB; } .monaco-editor .token.keyword.datatype { color: blue; } .monaco-editor .token.variable { color: #001188; } .monaco-editor .token.variable.predefined { color: #005588; } .monaco-editor .token.constant { color: #dd0000; } .monaco-editor .token.string { color: #A31515; } .monaco-editor .token.string.escape { color: #A31515; } .monaco-editor .token.comment { color: #008000; font-style: italic; } .monaco-editor .token.literal { color: #e00000; } .monaco-editor .token.literal.hex { color: #e07000; } .monaco-editor .token.number { color: #09885A; } .monaco-editor .token.number.hex { color: #3030c0; } .monaco-editor .token.number.octal { color: #204070; } .monaco-editor .token.number.binary { color: #e07070; } .monaco-editor .token.regexp { color: #811f3f; } .monaco-editor .token.delimiter { color: #008080; } .monaco-editor .token.tag { color: #800000; } .monaco-editor .token.key { color: #863B00; } .monaco-editor .token.attribute.name { color: red; } .monaco-editor .token.attribute.value { color: #0451A5; } .monaco-editor .token.info-token { color: #316bcd; } .monaco-editor .token.warn-token { color: #cd9731; } .monaco-editor .token.error-token { color: #cd3131; } .monaco-editor .token.debug-token { color: purple; } .monaco-editor .token.meta.php { font-weight: bold; } .monaco-editor .token.comment.vs { font-style: italic; } .monaco-editor .token.attribute.vs { font-style: italic; } .monaco-editor .token.vs { font-style: italic; } .monaco-editor .token.delimiter.vs { font-style: italic; } .monaco-editor .token.string.vs { font-style: italic; } .monaco-editor.vs .current-line { background: none; border: 2px solid #EEE; box-sizing: border-box; } .monaco-editor.vs.focus .current-line { border-color: #EAEAF2; } .monaco-editor.vs .typeInfo { color: blue; } .monaco-editor.vs .typeInfo .documentation { color: #A21B1B; } .monaco-editor.vs .token.delimiter { color: #000000; } .monaco-editor.vs .token.literal { color: #000000; } .monaco-editor.vs .token.delimiter.html { color: #383838; } .monaco-editor.vs .token.meta.content.html { color: red; } .monaco-editor.vs .token.meta.html { color: gray; } .monaco-editor.vs .token.tag.html { color: #800000; } .monaco-editor.vs .token.attribute.name.html { color: red; } .monaco-editor.vs .token.attribute.value.html { color: blue; } .monaco-editor.vs .token.delimiter.xml { color: blue; } .monaco-editor.vs .token.meta.content.xml { color: red; } .monaco-editor.vs .token.meta.xml { color: gray; } .monaco-editor.vs .token.tag.xml { color: #800000; } .monaco-editor.vs .token.attribute.name.xml { color: red; } .monaco-editor.vs .token.attribute.value.xml { color: blue; } .monaco-editor.vs .token.constant.php { color: #dd0000; } .monaco-editor.vs .token.block.php { color: green; } .monaco-editor.vs .token.variable.predefined.php { color: #ff8888; } .monaco-editor.vs .token.entity.ts { color: black; } .monaco-editor.vs .token.vs { color: #006400; } .monaco-editor.vs .token.comment.vs { color: #aeb9ae; } .monaco-editor.vs .token.tag.vs { color: #aeb9ae; } .monaco-editor.vs .token.attribute.name.vs { color: #aeb9ae; } .monaco-editor.vs .token.attribute.value.vs { color: #2c51cc; } .monaco-editor.vs .token.delimiter.vs { color: #708870; } .monaco-editor.vs .token.meta.java { color: gray; } .monaco-editor.vs .token.tag.jade { color: #800000; } .monaco-editor.vs .token.tag.id.jade, .monaco-editor.vs .token.tag.class.jade { color: #4F76AC; } .monaco-editor.vs .token.interpolation.jade { color: magenta; } .monaco-editor.vs .token.interpolation.delimiter.jade { color: magenta; } .monaco-editor .token.emphasis { font-style: italic;} .monaco-editor .token.strong { font-weight: bold; } .monaco-editor .token.header { color: navy ;}/*--------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ "undefined"==typeof WinJS&&(function(e){e.msSetImmediate||(e.msSetImmediate=function(t){return e.setTimeout(t,0)}),e.setImmediate||(e.setImmediate=function(t){return e.setTimeout(t,0)})}(this),function(e,t){"use strict";function n(e,n){var i,r,o,s=Object.keys(n);for(r=0,o=s.length;o>r;r++){var a=s[r],u=95!==a.charCodeAt(0),l=n[a];!l||"object"!=typeof l||l.value===t&&"function"!=typeof l.get&&"function"!=typeof l.set?u?e[a]=l:(i=i||{},i[a]={value:l,enumerable:u,configurable:!0,writable:!0}):(l.enumerable===t&&(l.enumerable=u),i=i||{},i[a]=l)}i&&Object.defineProperties(e,i)}!function(t){function i(e,t,i){for(var r=e,o=t.split("."),s=0,a=o.length;a>s;s++){var u=o[s];r[u]||Object.defineProperty(r,u,{value:{},writable:!1,enumerable:!0,configurable:!0}),r=r[u]}return i&&n(r,i),r}function r(t,n){return i(e,t,n)}e[t]||(e[t]=Object.create(Object.prototype));var o=e[t];o.Namespace||(o.Namespace=Object.create(Object.prototype)),Object.defineProperties(o.Namespace,{defineWithParent:{value:i,writable:!0,enumerable:!0,configurable:!0},define:{value:r,writable:!0,enumerable:!0,configurable:!0}})}("WinJS"),function(e){function t(t,i,r){return t=t||function(){},e.Utilities.markSupportedForProcessing(t),i&&n(t.prototype,i),r&&n(t,r),t}function i(i,r,o,s){if(i){r=r||function(){};var a=i.prototype;return r.prototype=Object.create(a),e.Utilities.markSupportedForProcessing(r),Object.defineProperty(r.prototype,"constructor",{value:r,writable:!0,configurable:!0,enumerable:!0}),o&&n(r.prototype,o),s&&n(r,s),r}return t(r,o,s)}function r(e){e=e||function(){};var t,i;for(t=1,i=arguments.length;i>t;t++)n(e.prototype,arguments[t]);return e}e.Namespace.define("WinJS.Class",{define:t,derive:i,mix:r})}(WinJS)}(this),function(e,t){"use strict";function n(e){return e}function i(e,t,n){return e.split(".").reduce(function(e,t){return e?n(e[t]):null},t)}var r=!!e.Windows,o={notSupportedForProcessing:"Value is not supported within a declarative processing context, if you want it to be supported mark it using WinJS.Utilities.markSupportedForProcessing. The value was: '{0}'"};t.Namespace.define("WinJS.Utilities",{_setHasWinRT:{value:function(e){r=e},configurable:!1,writable:!1,enumerable:!1},hasWinRT:{get:function(){return r},configurable:!1,enumerable:!0},_getMemberFiltered:i,getMember:function(t,r){return t?i(t,r||e,n):null},ready:function(n,i){return new t.Promise(function(r,o){function s(){if(n)try{n(),r()}catch(e){o(e)}else r()}var a=t.Utilities.testReadyState;a||(a=e.document?document.readyState:"complete"),"complete"===a||e.document&&null!==document.body?i?msSetImmediate(s):s():e.addEventListener("DOMContentLoaded",s,!1)})},strictProcessing:{get:function(){return!0},configurable:!1,enumerable:!0},markSupportedForProcessing:{value:function(e){return e.supportedForProcessing=!0,e},configurable:!1,writable:!1,enumerable:!0},requireSupportedForProcessing:{value:function(n){var i=!0;switch(i=i&&!(n===e),i=i&&!(n===e.location),i=i&&!(n instanceof HTMLIFrameElement),i=i&&!("function"==typeof n&&!n.supportedForProcessing),e.frames.length){case 0:break;case 1:i=i&&!(n===e.frames[0]);break;default:for(var r=0,s=e.frames.length;i&&s>r;r++)i=i&&!(n===e.frames[r])}if(i)return n;throw new t.ErrorFromName("WinJS.Utilities.requireSupportedForProcessing",t.Resources._formatString(o.notSupportedForProcessing,n))},configurable:!1,writable:!1,enumerable:!0}}),t.Namespace.define("WinJS",{validation:!1,strictProcessing:{value:function(){},configurable:!1,writable:!1,enumerable:!1}})}(this,WinJS),function(){"use strict";function e(e,t,n){var o=e;return"function"==typeof o&&(o=o()),(n&&r.test(n)?"":n?n+": ":"")+(t?t.replace(i,":")+": ":"")+o}function t(e,t,n){var i=WinJS.Utilities.formatLog(e,t,n);console[n&&r.test(n)?n:"log"](i)}function n(e){return e.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&")}var i=/\s+/g,r=/^(error|warn|info|log)$/;WinJS.Namespace.define("WinJS.Utilities",{startLog:function(e){e=e||{},"string"==typeof e&&(e={tags:e});var r=e.type&&new RegExp("^("+n(e.type).replace(i," ").split(" ").join("|")+")$"),o=e.excludeTags&&new RegExp("(^|\\s)("+n(e.excludeTags).replace(i," ").split(" ").join("|")+")(\\s|$)","i"),s=e.tags&&new RegExp("(^|\\s)("+n(e.tags).replace(i," ").split(" ").join("|")+")(\\s|$)","i"),a=e.action||t;if(!(r||o||s||WinJS.log))return WinJS.log=a,void 0;var u=function(e,t,n){r&&!r.test(n)||o&&o.test(t)||s&&!s.test(t)||a(e,t,n),u.next&&u.next(e,t,n)};u.next=WinJS.log,WinJS.log=u},stopLog:function(){delete WinJS.log},formatLog:e})}(),function(e){"use strict";function t(e){var t="_on"+e+"state";return{get:function(){var e=this[t];return e&&e.userHandler},set:function(n){var i=this[t];n?(i||(i={wrapper:function(e){return i.userHandler(e)},userHandler:n},Object.defineProperty(this,t,{value:i,enumerable:!1,writable:!0,configurable:!0}),this.addEventListener(e,i.wrapper,!1)),i.userHandler=n):i&&(this.removeEventListener(e,i.wrapper,!1),this[t]=null)},enumerable:!0}}function n(){for(var e={},n=0,i=arguments.length;i>n;n++){var r=arguments[n];e["on"+r]=t(r)}return e}var i=e.Class.define(function(e,t,n){this.detail=t,this.target=n,this.timeStamp=Date.now(),this.type=e},{bubbles:{value:!1,writable:!1},cancelable:{value:!1,writable:!1},currentTarget:{get:function(){return this.target}},defaultPrevented:{get:function(){return this._preventDefaultCalled}},trusted:{value:!1,writable:!1},eventPhase:{value:0,writable:!1},target:null,timeStamp:null,type:null,preventDefault:function(){this._preventDefaultCalled=!0},stopImmediatePropagation:function(){this._stopImmediatePropagationCalled=!0},stopPropagation:function(){}},{supportedForProcessing:!1}),r={_listeners:null,addEventListener:function(e,t,n){n=n||!1,this._listeners=this._listeners||{};for(var i=this._listeners[e]=this._listeners[e]||[],r=0,o=i.length;o>r;r++){var s=i[r];if(s.useCapture===n&&s.listener===t)return}i.push({listener:t,useCapture:n})},dispatchEvent:function(e,t){var n=this._listeners&&this._listeners[e];if(n){var r=new i(e,t,this);n=n.slice(0,n.length);for(var o=0,s=n.length;s>o&&!r._stopImmediatePropagationCalled;o++)n[o].listener(r);return r.defaultPrevented||!1}return!1},removeEventListener:function(e,t,n){n=n||!1;var i=this._listeners&&this._listeners[e];if(i)for(var r=0,o=i.length;o>r;r++){var s=i[r];if(s.listener===t&&s.useCapture===n){i.splice(r,1),0===i.length&&delete this._listeners[e];break}}}};e.Namespace.define("WinJS.Utilities",{_createEventProperty:t,createEventProperties:n,eventMixin:r})}(WinJS),function(e,t,n){"use strict";var i,r=!1,o="contextchanged",s=t.Class.mix(t.Class.define(null,{},{supportedForProcessing:!1}),t.Utilities.eventMixin),a=new s,u={malformedFormatStringInput:"Malformed, did you mean to escape your '{0}'?"};t.Namespace.define("WinJS.Resources",{addEventListener:function(e,n,i){if(t.Utilities.hasWinRT&&!r&&e===o)try{Windows.ApplicationModel.Resources.Core.ResourceManager.current.defaultContext.qualifierValues.addEventListener("mapchanged",function(e){t.Resources.dispatchEvent(o,{qualifier:e.key,changed:e.target[e.key]})},!1),r=!0}catch(s){}a.addEventListener(e,n,i)},removeEventListener:a.removeEventListener.bind(a),dispatchEvent:a.dispatchEvent.bind(a),_formatString:function(e){var n=arguments;return n.length>1&&(e=e.replace(/({{)|(}})|{(\d+)}|({)|(})/g,function(e,i,r,o,s,a){if(s||a)throw t.Resources._formatString(u.malformedFormatStringInput,s||a);return i&&"{"||r&&"}"||n[(0|o)+1]})),e},_getStringWinRT:function(e){if(!i){var t=Windows.ApplicationModel.Resources.Core.ResourceManager.current.mainResourceMap;try{i=t.getSubtree("Resources")}catch(r){}i||(i=t)}var o,s,a;try{a=i.getValue(e),a&&(o=a.valueAsString,o===n&&(o=a.toString()))}catch(r){}if(!o)return{value:e,empty:!0};try{s=a.getQualifierValue("Language")}catch(r){return{value:o}}return{value:o,lang:s}},_getStringJS:function(t){var n=e.strings&&e.strings[t];return"string"==typeof n&&(n={value:n}),n||{value:t,empty:!0}}}),Object.defineProperties(t.Resources,t.Utilities.createEventProperties(o));var l;t.Resources.getString=function(e){return l=l||(t.Utilities.hasWinRT?t.Resources._getStringWinRT:t.Resources._getStringJS),l(e)}}(this,WinJS),function(e,t){"use strict";function n(){}function i(e,t){var n;n=t&&"object"==typeof t&&"function"==typeof t.then?x:O,e._value=t,e._setState(n)}function r(e,t,n,i,r,o){return{exception:e,error:t,promise:n,handler:o,id:i,parent:r}}function o(e,t,n,i){var o=n._isException,s=n._errorId;return r(o?t:null,o?null:t,e,s,n,i)}function s(e,t,n){var i=n._isException,o=n._errorId;return g(e,o,i),r(i?t:null,i?null:t,e,o,n)}function a(e,t){var n=++H;return g(e,n),r(null,t,e,n)}function u(e,t){var n=++H;return g(e,n,!0),r(t,null,e,n)}function l(e,t,n,i){m(e,{c:t,e:n,p:i})}function h(e,t,n,i){e._value=t,p(e,t,n,i),e._setState(A)}function d(e,t){var n=e._value,i=e._listeners;if(i){e._listeners=null;var r,o;for(r=0,o=Array.isArray(i)?i.length:1;o>r;r++){var s=1===o?i:i[r],a=s.c,u=s.promise;if(u){try{u._setCompleteValue(a?a(n):n)}catch(l){u._setExceptionValue(l)}u._state!==x&&u._listeners&&t.push(u)}else q.prototype.done.call(e,a)}}}function c(e,t){var n=e._value,i=e._listeners;if(i){e._listeners=null;var r,s;for(r=0,s=Array.isArray(i)?i.length:1;s>r;r++){var a=1===s?i:i[r],u=a.e,l=a.promise;if(l){try{u?(u.handlesOnError||p(l,n,o,e,u),l._setCompleteValue(u(n))):l._setChainedErrorValue(n,e)}catch(h){l._setExceptionValue(h)}l._state!==x&&l._listeners&&t.push(l)}else B.prototype.done.call(e,null,u)}}}function p(e,t,n,i,r){if(E._listeners[L]){if(t instanceof Error&&t.message===S)return;E.dispatchEvent(L,n(e,t,i,r))}}function f(e,t){var n=e._listeners;if(n){var i,r;for(i=0,r=Array.isArray(n)?n.length:1;r>i;i++){var o=1===r?n:n[i],s=o.p;if(s)try{s(t)}catch(a){}o.c||o.e||!o.promise||o.promise._progress(t)}}}function m(e,t){var n=e._listeners;n?(n=Array.isArray(n)?n:[n],n.push(t)):n=t,e._listeners=n}function g(e,t,n){e._isException=n||!1,e._errorId=t}function v(e,t,n,i){e._value=t,p(e,t,n,i),e._setState(W)}function y(e,t){var n;n=t&&"object"==typeof t&&"function"==typeof t.then?x:P,e._value=t,e._setState(n)}function C(e,t,n,i){var r=new F(e);return m(e,{promise:r,c:t,e:n,p:i}),r}function _(e){var t;return new WinJS.Promise(function(n){e?t=setTimeout(n,e):setImmediate(n)},function(){t&&clearTimeout(t)})}function b(e,t){var n=function(){t.cancel()},i=function(){e.cancel()};return e.then(n),t.then(i,i),t}e.Debug&&(e.Debug.setNonUserCodeExceptions=!0);var w=WinJS.Class.mix(WinJS.Class.define(null,{},{supportedForProcessing:!1}),WinJS.Utilities.eventMixin),E=new w;E._listeners={};var L="error",S="Canceled",T=!1,N={promise:1,thenPromise:2,errorPromise:4,exceptionPromise:8,completePromise:16};N.all=N.promise|N.thenPromise|N.errorPromise|N.exceptionPromise|N.completePromise;var M,k,x,R,I,D,O,P,A,W,H=1;M={name:"created",enter:function(e){e._setState(k)},cancel:n,done:n,then:n,_completed:n,_error:n,_notify:n,_progress:n,_setCompleteValue:n,_setErrorValue:n},k={name:"working",enter:n,cancel:function(e){e._setState(I)},done:l,then:C,_completed:i,_error:h,_notify:n,_progress:f,_setCompleteValue:y,_setErrorValue:v},x={name:"waiting",enter:function(e){var t=e._value,n=function(i){t._errorId?e._chainedError(i,t):(p(e,i,o,t,n),e._error(i))};n.handlesOnError=!0,t.then(e._completed.bind(e),n,e._progress.bind(e))},cancel:function(e){e._setState(R)},done:l,then:C,_completed:i,_error:h,_notify:n,_progress:f,_setCompleteValue:y,_setErrorValue:v},R={name:"waiting_canceled",enter:function(e){e._setState(D);var t=e._value;t.cancel&&t.cancel()},cancel:n,done:l,then:C,_completed:i,_error:h,_notify:n,_progress:f,_setCompleteValue:y,_setErrorValue:v},I={name:"canceled",enter:function(e){e._setState(D),e._cancelAction()},cancel:n,done:l,then:C,_completed:i,_error:h,_notify:n,_progress:f,_setCompleteValue:y,_setErrorValue:v},D={name:"canceling",enter:function(e){var t=new Error(S);t.name=t.message,e._value=t,e._setState(A)},cancel:n,done:n,then:n,_completed:n,_error:n,_notify:n,_progress:n,_setCompleteValue:n,_setErrorValue:n},O={name:"complete_notify",enter:function(e){if(e.done=q.prototype.done,e.then=q.prototype.then,e._listeners)for(var t,n=[e];n.length;)t=n.pop(),t._state._notify(t,n);e._setState(P)},cancel:n,done:null,then:null,_completed:n,_error:n,_notify:d,_progress:n,_setCompleteValue:n,_setErrorValue:n},P={name:"success",enter:function(e){e.done=q.prototype.done,e.then=q.prototype.then,e._cleanupAction()},cancel:n,done:null,then:null,_completed:n,_error:n,_notify:d,_progress:n,_setCompleteValue:n,_setErrorValue:n},A={name:"error_notify",enter:function(e){if(e.done=B.prototype.done,e.then=B.prototype.then,e._listeners)for(var t,n=[e];n.length;)t=n.pop(),t._state._notify(t,n);e._setState(W)},cancel:n,done:null,then:null,_completed:n,_error:n,_notify:c,_progress:n,_setCompleteValue:n,_setErrorValue:n},W={name:"error",enter:function(e){e.done=B.prototype.done,e.then=B.prototype.then,e._cleanupAction()},cancel:n,done:null,then:null,_completed:n,_error:n,_notify:c,_progress:n,_setCompleteValue:n,_setErrorValue:n};var V,U=WinJS.Class.define(null,{_listeners:null,_nextState:null,_state:null,_value:null,cancel:function(){this._state.cancel(this),this._run()},done:function(e,t,n){this._state.done(this,e,t,n)},then:function(e,t,n){return this._state.then(this,e,t,n)},_chainedError:function(e,t){var n=this._state._error(this,e,s,t);return this._run(),n},_completed:function(e){var t=this._state._completed(this,e);return this._run(),t},_error:function(e){var t=this._state._error(this,e,a);return this._run(),t},_progress:function(e){this._state._progress(this,e)},_setState:function(e){this._nextState=e},_setCompleteValue:function(e){this._state._setCompleteValue(this,e),this._run()},_setChainedErrorValue:function(e,t){var n=this._state._setErrorValue(this,e,s,t);return this._run(),n},_setExceptionValue:function(e){var t=this._state._setErrorValue(this,e,u);return this._run(),t},_run:function(){for(;this._nextState;)this._state=this._nextState,this._nextState=null,this._state.enter(this)}},{supportedForProcessing:!1}),F=WinJS.Class.derive(U,function(e){T&&(T===!0||T&N.thenPromise)&&(this._stack=WinJS.Promise._getStack()),this._creator=e,this._setState(M),this._run()},{_creator:null,_cancelAction:function(){this._creator&&this._creator.cancel()},_cleanupAction:function(){this._creator=null}},{supportedForProcessing:!1}),B=WinJS.Class.define(function(e){T&&(T===!0||T&N.errorPromise)&&(this._stack=WinJS.Promise._getStack()),this._value=e,p(this,e,a)},{cancel:function(){},done:function(e,t){var n=this._value;if(t)try{t.handlesOnError||p(null,n,o,this,t);var i=t(n);return i&&"object"==typeof i&&"function"==typeof i.done&&i.done(),void 0}catch(r){n=r}n instanceof Error&&n.message===S||setImmediate(function(){throw n})},then:function(e,t){if(!t)return this;var n,i=this._value;try{t.handlesOnError||p(null,i,o,this,t),n=new q(t(i))}catch(r){n=r===i?this:new z(r)}return n}},{supportedForProcessing:!1}),z=WinJS.Class.derive(B,function(e){T&&(T===!0||T&N.exceptionPromise)&&(this._stack=WinJS.Promise._getStack()),this._value=e,p(this,e,u)},{},{supportedForProcessing:!1}),q=WinJS.Class.define(function(e){if(T&&(T===!0||T&N.completePromise)&&(this._stack=WinJS.Promise._getStack()),e&&"object"==typeof e&&"function"==typeof e.then){var t=new F(null);return t._setCompleteValue(e),t}this._value=e},{cancel:function(){},done:function(e){if(e)try{var t=e(this._value);t&&"object"==typeof t&&"function"==typeof t.done&&t.done()}catch(n){setImmediate(function(){throw n})}},then:function(e){try{var t=e?e(this._value):this._value;return t===this._value?this:new q(t)}catch(n){return new z(n)}}},{supportedForProcessing:!1}),j=WinJS.Class.derive(U,function(e,t){T&&(T===!0||T&N.promise)&&(this._stack=WinJS.Promise._getStack()),this._oncancel=t,this._setState(M),this._run();try{var n=this._completed.bind(this),i=this._error.bind(this),r=this._progress.bind(this);e(n,i,r)}catch(o){this._setExceptionValue(o)}},{_oncancel:null,_cancelAction:function(){if(this._oncancel)try{this._oncancel()}catch(e){}},_cleanupAction:function(){this._oncancel=null}},{addEventListener:function(e,t,n){E.addEventListener(e,t,n)},any:function(e){return new j(function(t,n){var i=Object.keys(e);Array.isArray(e)?[]:{},0===i.length&&t();var r=0;i.forEach(function(o){j.as(e[o]).then(function(){t({key:o,value:e[o]})},function(s){return s instanceof Error&&s.name===S?(++r===i.length&&t(WinJS.Promise.cancel),void 0):(n({key:o,value:e[o]}),void 0)})})},function(){var t=Object.keys(e);t.forEach(function(t){var n=j.as(e[t]);"function"==typeof n.cancel&&n.cancel()})})},as:function(e){return e&&"object"==typeof e&&"function"==typeof e.then?e:new q(e)},cancel:{get:function(){return V=V||new B(new WinJS.ErrorFromName(S))}},dispatchEvent:function(e,t){return E.dispatchEvent(e,t)},is:function(e){return e&&"object"==typeof e&&"function"==typeof e.then},join:function(e){return new j(function(n,i,r){var o=Object.keys(e),s=Array.isArray(e)?[]:{},a=Array.isArray(e)?[]:{},u=0,l=o.length,h=function(e){if(0===--l){var t=Object.keys(s).length;if(0===t)n(a);else{var u=0;o.forEach(function(e){var t=s[e];t instanceof Error&&t.name===S&&u++}),u===t?n(WinJS.Promise.cancel):i(s)}}else r({Key:e,Done:!0})};return o.forEach(function(n){var i=e[n];i===t?u++:j.then(i,function(e){a[n]=e,h(n)},function(e){s[n]=e,h(n)})}),l-=u,0===l?(n(a),void 0):void 0},function(){Object.keys(e).forEach(function(t){var n=j.as(e[t]);"function"==typeof n.cancel&&n.cancel()})})},removeEventListener:function(e,t,n){E.removeEventListener(e,t,n)},supportedForProcessing:!1,then:function(e,t,n,i){return j.as(e).then(t,n,i)},thenEach:function(e,t,n,i){var r=Array.isArray(e)?[]:{};return Object.keys(e).forEach(function(o){r[o]=j.as(e[o]).then(t,n,i)}),j.join(r)},timeout:function(e,t){var n=_(e);return t?b(n,t):n},wrap:function(e){return new q(e)},wrapError:function(e){return new B(e)},_veryExpensiveTagWithStack:{get:function(){return T},set:function(e){T=e}},_veryExpensiveTagWithStack_tag:N,_getStack:function(){if(Debug.debuggerEnabled)try{throw new Error}catch(e){return e.stack}}});Object.defineProperties(j,WinJS.Utilities.createEventProperties(L));var K=WinJS.Class.derive(U,function(e){this._oncancel=e,this._setState(M),this._run()},{_cancelAction:function(){this._oncancel&&this._oncancel()},_cleanupAction:function(){this._oncancel=null}},{supportedForProcessing:!1}),G=WinJS.Class.define(function(e){this._promise=new K(e)},{promise:{get:function(){return this._promise}},cancel:function(){this._promise.cancel()},complete:function(e){this._promise._completed(e)},error:function(e){this._promise._error(e)},progress:function(e){this._promise._progress(e)}},{supportedForProcessing:!1});WinJS.Namespace.define("WinJS",{Promise:j,_Signal:G})}(this),function(e,t){"use strict";t.Namespace.define("WinJS",{ErrorFromName:t.Class.derive(Error,function(e,t){this.name=e,this.message=t||e},{},{supportedForProcessing:!1})})}(this,WinJS),function(){"use strict";WinJS.Namespace.define("WinJS",{xhr:function(e){var t;return new WinJS.Promise(function(n,i,r){t=new XMLHttpRequest,t.onreadystatechange=function(){t._canceled||(4===t.readyState?(t.status>=200&&t.status<300||1223===t.status?n(t):i(t),t.onreadystatechange=function(){}):r(t))},t.open(e.type||"GET",e.url,!0,e.user,e.password),t.responseType=e.responseType||"",Object.keys(e.headers||{}).forEach(function(n){t.setRequestHeader(n,e.headers[n])}),t.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.customRequestInitializer&&e.customRequestInitializer(t),t.send(e.data)},function(){t._canceled=!0,t.abort()})}})}(),function(e){"use strict";var t,n,i,r,o,s,a={nonStaticHTML:"Unable to add dynamic content. A script attempted to inject dynamic content, or elements previously modified dynamically, that might be unsafe. For example, using the innerHTML property or the document.write method to add a script element will generate this exception. If the content is safe and from a trusted source, use a method to explicitly manipulate elements and attributes, such as createElement, or use setInnerHTMLUnsafe (or other unsafe method)."};t=n=function(e,t){e.innerHTML=t},i=r=function(e,t){e.outerHTML=t},o=s=function(e,t,n){e.insertAdjacentHTML(t,n)};var u=e.MSApp;if(u)n=function(e,t){u.execUnsafeLocalFunction(function(){e.innerHTML=t})},r=function(e,t){u.execUnsafeLocalFunction(function(){e.outerHTML=t})},s=function(e,t,n){u.execUnsafeLocalFunction(function(){e.insertAdjacentHTML(t,n)})};else if(e.msIsStaticHTML){var l=function(t){if(!e.msIsStaticHTML(t))throw new WinJS.ErrorFromName("WinJS.Utitilies.NonStaticHTML",a.nonStaticHTML)};t=function(e,t){l(t),e.innerHTML=t},i=function(e,t){l(t),e.outerHTML=t},o=function(e,t,n){l(n),e.insertAdjacentHTML(t,n)}}WinJS.Namespace.define("WinJS.Utilities",{setInnerHTML:t,setInnerHTMLUnsafe:n,setOuterHTML:i,setOuterHTMLUnsafe:r,insertAdjacentHTML:o,insertAdjacentHTMLUnsafe:s})}(this)),define("vs/base/lib/raw.winjs.base",[],{}),define("vs/base/types",["require","exports"],function(e,t){"use strict";function n(e){return Array.isArray?Array.isArray(e):e&&"number"==typeof e.length&&e.constructor===Array?!0:!1}function i(e){return"string"==typeof e||e instanceof String?!0:!1}function r(e){return"undefined"==typeof e||null===e?!1:"[object Object]"===Object.prototype.toString.call(e)}function o(e){return("number"==typeof e||e instanceof Number)&&!isNaN(e)?!0:!1}function s(e){return"undefined"==typeof e}function a(e){return s(e)||null===e}function u(e){if(!r(e))return!1;for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function l(e){return"[object Function]"===Object.prototype.toString.call(e)}function h(e){for(var t=[],n=0;n0&&null!==e.statusText?t&&null!==e.responseText&&e.responseText.length>0?m.localize("vs_base_errors",3,e.statusText,e.status,e.responseText):m.localize("vs_base_errors",4,e.statusText,e.status):t&&null!==e.responseText&&e.responseText.length>0?m.localize("vs_base_errors",5,e.responseText):m.localize("vs_base_errors",6)}function l(e,t){return u(new C(e),t)}function h(e,t){return t&&e.message&&(e.stack||e.stacktrace)?m.localize("vs_base_errors",7,e.message,e.stack||e.stacktrace):e.message?e.message:m.localize("vs_base_errors",8)}function d(e,t){if("undefined"==typeof t&&(t=!1),!e)return m.localize("vs_base_errors",9);if(v.isString(e))return e;if(e instanceof C)return u(e,t);if(!v.isUndefinedOrNull(e.status))return l(e,t);if(e.detail){var n=e.detail;if(n.error){if(n.error&&!v.isUndefinedOrNull(n.error.status))return l(n.error,t);if(!v.isArray(n.error))return h(n.error,t);for(var i=0;io;o++)i.push(new r(e[o].getType(),e[o].getData(),t))}0===n._deferredCnt?n._emitEvents(i):n._collectedEvents.push.apply(n._collectedEvents,i)})},e.prototype.addEmitterTypeListener=function(e,t,n){if(t){if("*"===e)throw new Error("Bulk listeners cannot specify an emitter type");return this.addListener(e+"/"+t,n)}return this.addListener(e,n)},e.prototype._removeListener=function(e,t){if(this._listeners.hasOwnProperty(e))for(var n=this._listeners[e],i=0,r=n.length;r>i;i++)if(n[i]===t){n.splice(i,1);break}},e.prototype._removeBulkListener=function(e){for(var t=0,n=this._bulkListeners.length;n>t;t++)if(this._bulkListeners[t]===e){this._bulkListeners.splice(t,1);break}},e.prototype._emitToSpecificTypeListeners=function(e,t){if(this._listeners.hasOwnProperty(e))for(var n=this._listeners[e].slice(0),r=0,o=n.length;o>r;r++)try{n[r](t) }catch(s){i.onUnexpectedError(s)}},e.prototype._emitToBulkListeners=function(e){for(var t=this._bulkListeners.slice(0),n=0,r=t.length;r>n;n++)try{t[n](e)}catch(o){i.onUnexpectedError(o)}},e.prototype._emitEvents=function(e){this._bulkListeners.length>0&&this._emitToBulkListeners(e);for(var t=0,n=e.length;n>t;t++){var i=e[t];this._emitToSpecificTypeListeners(i.getType(),i.getData()),i.getEmitterType()&&this._emitToSpecificTypeListeners(i.getType()+"/"+i.getEmitterType(),i.getData())}},e.prototype.emit=function(e,t){if("undefined"==typeof t&&(t={}),this._listeners.hasOwnProperty(e)||0!==this._bulkListeners.length){var n=new r(e,t);0===this._deferredCnt?this._emitEvents([n]):this._collectedEvents.push(n)}},e.prototype.deferredEmit=function(e){this._deferredCnt=this._deferredCnt+1;var t=e();return this._deferredCnt=this._deferredCnt-1,0===this._deferredCnt&&this._emitCollected(),t},e.prototype._emitCollected=function(){var e=this._collectedEvents;this._collectedEvents=[],e.length>0&&this._emitEvents(e)},e.prototype.dispose=function(){this._listeners={},this._bulkListeners=[],this._collectedEvents=[],this._deferredCnt=0},e}();t.EventEmitter=o}),define("vs/base/strings",["require","exports","vs/nls!vs/editor/worker/editorWorkerServer","vs/base/types"],function(e,t,n,i){"use strict";function r(e,t){for(var n=""+e;n.lengtho;o++)i=i.replace(new RegExp("\\{"+o+"\\}","g"),t[o]);return i}function s(e){return e||(e=new Date),A.localize("vs_base_strings",0,r(e.getMonth()+1,2),r(e.getDate(),2),r(e.getFullYear(),4),r(e.getHours(),2),r(e.getMinutes(),2),r(e.getSeconds(),2))}function a(e){return e||(e=new Date),A.localize("vs_base_strings",1,r(e.getHours(),2),r(e.getMinutes(),2),r(e.getSeconds(),2))}function u(e){return e.replace(/[<|>|&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}function l(e){var t=document.createElement("div");return t.innerHTML=e,t.textContent||t.innerText||""}function h(e,t){"undefined"==typeof t&&(t=" ");var n=d(e,t);return c(n,t)}function d(e,t){var n=t.length;if(0===n||0===e.length)return e;for(var i=0,r=-1;(r=e.indexOf(t,i))===i;)i+=n;return e.substring(i)}function c(e,t){var n=t.length,i=e.length;if(0===n||0===i)return e;for(var r=i,o=-1;;){if(o=e.lastIndexOf(t,r-1),-1===o||o+n!==r)break;if(0===o)return"";r=o}return e.substring(0,r)}function p(e){return e.replace(/(^\s+|\s+$)/g,"")}function f(e){return e.replace(/\s+/g," ")}function m(e){var t=(new Date).getTime(),n=t-e.getTime();return n/H.DAY>=2?A.localize("vs_base_strings",2,Math.floor(n/H.DAY)):n/H.DAY>=1?A.localize("vs_base_strings",3):n/H.HOUR>=2?A.localize("vs_base_strings",4,Math.floor(n/H.HOUR)):n/H.HOUR>=1?A.localize("vs_base_strings",5):n/H.MINUTE>=2?A.localize("vs_base_strings",6,Math.floor(n/H.MINUTE)):n/H.MINUTE>=1?A.localize("vs_base_strings",7):A.localize("vs_base_strings",8)}function g(e){var t=(new Date).getTime(),n=(t-e)/1e3;if(60>n)return A.localize("vs_base_strings",9,Math.floor(n));var i=n/60;if(60>i)return A.localize("vs_base_strings",10,Math.floor(i));var r=i/60;if(24>r)return A.localize("vs_base_strings",11,Math.floor(r));var o=r/24;return A.localize("vs_base_strings",12,Math.floor(o))}function v(e){return e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function y(e,t){for(var n=0,i=t.length;i>n;n++)if(e.charCodeAt(n)!==t.charCodeAt(n))return!1;return!0}function C(e,t){if(t.length>e.length)return!1;for(var n=0,i=e.length-t.length;ni;i++)n[i]=encodeURIComponent(n[i]);return n.join("/")}return encodeURIComponent(e)}function L(e){return/^\w[\w.]*$/.test(e)}function S(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}function T(e,t,n){return t&&(e="^"+e),n&&(e+="$"),e}function N(e,t){if(w(new RegExp(e,t)))throw new Error("Regular expression /"+e+"/g results in infinitive matches")}function M(e){return e?(0===e.indexOf("/")&&(e=e.substring(1)),E(e,!0)):""}function k(e){return"undefined"==typeof e&&(e=8),x(e)}function x(e){for(var t="",n=0;e>n;n++)t+=V[Math.floor(Math.random()*U)];return t}function R(e,t){return"["+e+"m"+t+""}function I(e){for(var t=0,n=e.length;n>t;t++)if(" "!==e.charAt(t)&&" "!==e.charAt(t))return t;return-1}function D(e){for(var t=0,n=e.length;n>t;t++)if(" "!==e.charAt(t)&&" "!==e.charAt(t))return e.substring(0,t);return e}function O(e){for(var t=e.length-1;t>=0;t--)if(" "!==e.charAt(t)&&" "!==e.charAt(t))return t;return-1}function P(e,t){if(!B&&(B=!0,window.Intl&&W.isFunction(window.Intl.Collator))){var n=new window.Intl.Collator;W.isFunction(n.compare)&&(F=n.compare)}return F?F.call(this,e,t):e.localeCompare(t)}var A=n,W=i;t.pad=r,t.format=o,t.formatDate=s,t.formatTime=a,t.escape=u,t.stripHtml=l,t.trim=h,t.ltrim=d,t.rtrim=c,t.trimWhitespace=p,t.normalize=f;var H={SECOND:1e3,MINUTE:6e4,HOUR:36e5,DAY:864e5};t.formatDiff=m,t.conciseformatDiff=g,t.convertSimple2RegExpPattern=v,t.startsWith=y,t.endsWith=C,t.splice=_,t.createRegExp=b,t.regExpLeadsToEndlessLoop=w,t.encodeURIPart=E,t.isCamelCasePattern=L,t.toRegExpPattern=S,t.anchorPattern=T,t.assertRegExp=N,t.normalizePath=M,t.generateUuid=k;var V="0123456789abcdefghiklmnopkqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",U=V.length;t.colorize=R,t.firstNonWhitespaceIndex=I,t.getLeadingWhitespace=D,t.lastNonWhitespaceIndex=O;var F,B=!1;t.localeCompare=P}),define("vs/base/assert",["require","exports","vs/base/strings"],function(e,t,n){"use strict";function i(e,t){if(!e||null===e)throw new Error(t?o.format("Assertion failed ({0})",t):"Assertion Failed")}function r(e,t,n){if(e!==t||!e||!t)throw new Error(n?o.format("Assertion failed ({0})",n):"Assertion Failed")}var o=n;t.ok=i,t.equals=r}),define("vs/base/network",["require","exports","./assert"],function(e,t,n){"use strict";var i=n,r=function(){function e(e){i.ok(!!e,"spec must not be null"),this.spec=e,this.scheme=void 0}return e.prototype.toJSON=function(){return{$url:this.spec}},e.prototype.toExternal=function(){return this.spec},e.prototype.toString=function(){return this.spec},e.prototype.getScheme=function(){return void 0===this.scheme&&(this.scheme=this.doGetScheme()),this.scheme},e.prototype.doGetScheme=function(){var e=this.spec.indexOf(":");return-1===e?null:this.spec.substring(0,e)},e.prototype.getPath=function(){for(var e=0,t=-1,n=0,i=this.spec.length;i>n;n++){var r=this.spec.charAt(n);switch(r){case"/":3===++e&&(t=n);break;case"?":case"#":return-1===t?null:this.spec.substring(t,n)}}return-1===t?null:t===this.spec.length-1?"":this.spec.substring(t)},e}();t.URL=r,function(e){e.inMemory="inMemory"}(t.schemas||(t.schemas={})),t.schemas}),define("vs/base/env",["require","exports","vs/base/types"],function(e,t,n){"use strict";function i(){return h}function r(){return t.browser.isIE8?self.parent!=self:self.parent!==self}function o(){return l}function s(e){l=e}var a=n,u=navigator.userAgent,l=self.isTest||!1,h=self.document&&self.document.URL.match(/[^\?]*\?[^\#]*pseudo=true/);t.browser={isWindows:u.indexOf("Windows")>=0,isMacintosh:u.indexOf("Macintosh")>=0,isOpera:u.indexOf("Opera")>=0,isIE:u.indexOf("IE")>=0||u.indexOf("Trident")>=0,isIE10:u.indexOf("MSIE 10")>=0,isIE9:u.indexOf("MSIE 9")>=0,isIE8:u.indexOf("MSIE 8")>=0,isFirefox:u.indexOf("Firefox")>=0,isWebKit:u.indexOf("AppleWebKit")>=0,isChrome:u.indexOf("Chrome")>=0,isSafari:-1===u.indexOf("Chrome")&&u.indexOf("Safari")>=0,canPushState:function(){return self&&self.history&&self.history.pushState},hasCSSAnimationSupport:function(){if(this._hasCSSAnimationSupport===!0||this._hasCSSAnimationSupport===!1)return this._hasCSSAnimationSupport;for(var e=!1,t=document.createElement("div"),n=["animationName","webkitAnimationName","msAnimationName","MozAnimationName","OAnimationName"],i=0;ithis.eventCacheLimit&&this.collectedEvents.shift()},n.prototype.cleanupTimers=function(){var e=this;null===this.timeoutId&&(this.timeoutId=setTimeout(function(){var t=Date.now();e.collectedEvents.forEach(function(n){!n.stopTime&&t-n.startTime>=e.maxTimerLength&&n.stop()})},this.cleanupInterval))},n.prototype.dispose=function(){clearTimeout(this.timeoutId),e.prototype.dispose.call(this)},n.prototype.getCollectedEvents=function(){return this.collectedEvents.slice(0)},n.prototype.clearCollectedEvents=function(){this.collectedEvents=[]},n.prototype.setInitialCollectedEvents=function(e,t){var i=this;this.enabled()!==!1&&(t&&(n.PARSE_TIME=t),e.forEach(function(e){var t=new p(i,e.name,e.topic,e.startTime);t.stop(e.stopTime),i.addEvent(t)}))},n}(u.EventEmitter);t.TimeKeeper=f;var m=new f;t.nullEvent=new c,t.start=o,t.getTimeKeeper=s});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/platform/services",["require","exports","vs/base/lib/winjs.base","vs/base/async","vs/base/eventEmitter","vs/base/strings","vs/base/network","vs/base/eventEmitter","vs/base/performance/timer","vs/base/objects"],function(e,t,n,i,r,o,s,a,u,l){"use strict";var h=n,d=i,c=o,p=s,f=u,m=l,g=function(){function e(e,t,n){"undefined"==typeof n&&(n={}),this.workspace=e,this.configuration=t,this.options=n}return e.prototype.getWorkspace=function(){return this.workspace},e.prototype.getConfiguration=function(){return this.configuration},e.prototype.getOptions=function(){return this.options},e}();t.BaseContextService=g;var v=function(){function e(){}return e.prototype.injectTelemetryService=function(e){this.telemetryService=e},e.prototype.injectContextService=function(e){if(!this.contextService)if(this.contextService=e,this.contextService.getConfiguration()){this.origin=this.contextService.getConfiguration().paths.PUBLIC_WORKSPACE_URL;var t=new p.URL(this.origin).getPath();t&&t.length>0&&(this.origin=this.origin.substring(0,this.origin.length-t.length+1)),c.endsWith(this.origin,"/")||(this.origin+="/")}else this.origin="/"},e.prototype.getRequestUrl=function(e,t,n){var i=this.contextService.getWorkspace();if(i[e]){var r=i[e]+c.normalizePath(t);return n?this.origin+c.ltrim(r,"/"):r}return null},e.prototype.getPath=function(e,t){var n=this.getRequestUrl(e,"/",!0);if(!n)return null;var i=t.toExternal().indexOf(n);return 0===i?t.toExternal().substr(n.length-1):null},e.prototype.getAdditionalHeaders=function(){return this.contextService.getConfiguration().additionalHeaders||{}},e.prototype.poll=function(){return h.Promise.wrapError("Not Implemented")},e.prototype.establishPrivateChannel=function(){return h.Promise.wrapError("Not Implemented")},e.prototype.makeRequest=function(e){var t=f.nullEvent;return e.headers=m.mixin(e.headers,this.getAdditionalHeaders()),this.telemetryService&&(t=this.telemetryService.start("WorkbenchXHR",{url:e.url},!1)),d.always(h.xhr(e),function(e){t.data&&(t.data.status=e.status),t.stop()})},e}();t.BaseRequestService=v;var y=function(){function e(e){this.selection=e||[]}return e.EMPTY=new e([]),e.prototype.isEmpty=function(){return 0===this.selection.length},e}();t.Selection=y;var C=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),t.prototype.toArray=function(){return this.selection},t}(y);t.StructuredSelection=C,function(e){e._map=[],e._map[0]="Info",e.Info=0,e._map[1]="Warning",e.Warning=1,e._map[2]="Error",e.Error=2}(t.Severity||(t.Severity={})),t.Severity;var _=function(){function e(){}return e.SERVICE_CHANGED="service-changed",e.SET_CHANGED="set-changed",e.SET_ADDED="set-added",e.SET_REMOVED="set-removed",e}();t.MarkerServiceConstants=_,t.ResourceEvents={ADDED:"resource.added",REMOVED:"resource.removed",CHANGED:"resource.changed"}}),define("vs/base/injector",["require","exports","vs/base/assert","vs/base/types"],function(e,t,n,i){"use strict";var r=n,o=i,s=function(){function e(){this.map={},this.parent=null}return e.inject="inject",e.len=e.inject.length,e.prototype.setParent=function(e){this.parent=e},e.prototype.registerService=function(e,t){return r.ok(!o.isUndefinedOrNull(e)),r.ok(!o.isUndefinedOrNull(t)),this.map[e.toLowerCase()]=t,t},e.prototype.injectTo=function(t){var n=this;if(r.ok(!o.isUndefinedOrNull(t)),o.isArray(t))return t.forEach(function(e){n.injectTo(e)}),void 0;for(var i in t)if(0===i.indexOf(e.inject)){var s=t[i];if(o.isFunction(s)){i=i.substring(e.len).toLowerCase();var a=this.findService(i,t);o.isUndefinedOrNull(a)||s.apply(t,[a])}}},e.prototype.createChild=function(){var t=new e;return t.setParent(this),t},e.prototype.findService=function(e,t){var n=this.map[e];return!o.isUndefinedOrNull(n)&&t!==n||null===this.parent||(n=this.parent.findService(e,t)),n},e.prototype.dispose=function(){this.map=null,this.parent=null},e}();t.Container=s}),define("vs/platform/injectorService",["require","exports","vs/base/injector","vs/base/assert","vs/base/types","vs/platform/services"],function(e,t,n,i,r,o){"use strict";function s(e){var t=new h.Container,n=new p(t);return a(e,t),u(e,t),n}function a(e,t){d.ok(!Object.keys(e).some(function(e){return e===p._name}),"injectorService is NOT allowed to be added because it is implict"),Object.keys(e).forEach(function(n){var i=e[n];t.registerService(n,i)})}function u(e,t){Object.keys(e).forEach(function(n){var i=e[n];t.injectTo(i),l(i)})}function l(e){c.isFunction(e[p._fnInjectionDone])&&e[p._fnInjectionDone].apply(e)}var h=n,d=i,c=r,p=function(){function e(t){this.diContainer=t,this.diContainer.registerService(e._name,this),this.children=[]}return e._name="injectorService",e._fnInjectionDone="injectionDone",e.prototype.injectTo=function(e){this.diContainer.injectTo(e),l(e)},e.prototype.createChild=function(t){var n=this.diContainer.createChild();n.registerService(e._name,n),a(t,n),u(t,n);var i=new e(n);return this.children.push(i),i},e}();t.create=s}),define("vs/platform/telemetry/telemetryService",["require","exports","vs/platform/services","vs/base/strings","vs/base/lib/winjs.base","vs/base/performance/timer","vs/base/errors"],function(e,t,n,i,r,o,s){"use strict";var a=i,u=r,l=o,h=s,d=function(){function e(t){"undefined"==typeof t&&(t=!1),this.eventQueue=[],this.publicOnly=t,this.sessionID=a.generateUuid(8)+Date.now(),this.eventMaxQueueSize=e.EVENT_QUEUE_LIMIT,this.eventBatchSize=e.EVENT_BATCH_SIZE,this.failureCount=0,this.sendingEvents=!1,this.waitIntervalId=null,this.timeKeeper=new l.TimeKeeper,this.toUnbind=[],this.toUnbind.push(this.timeKeeper.addListener("eventStop",this.onTelemetryTimerEventStop.bind(this))),this.toUnbind.push(h.errorHandler.addListener(this.onErrorEvent.bind(this)))}return e.EVENT_QUEUE_LIMIT=1e4,e.EVENT_INTERVAL=3e4,e.EVENT_BATCH_SIZE=100,e.prototype.dispose=function(){for(;this.toUnbind.length;)this.toUnbind.pop()();this.timeKeeper.dispose()},e.prototype.onTelemetryTimerEventStop=function(e){var t=e.data||{};t.duration=e.timeTaken(),"public"===e.topic?this.publicLog(e.name,t):this.log(e.name,t)},e.prototype.onErrorEvent=function(e,t,n){"undefined"==typeof t&&(t=null),"undefined"==typeof n&&(n=null),this.log("UnhandledError",{friendlyMessage:t,verboseMessage:n})},e.prototype.injectRequestService=function(e){this.requestService=e},e.prototype.start=function(e,t,n){var i=n?"public":"private",r=this.timeKeeper.start(i,e);return t&&(r.data=t),r},e.prototype.log=function(e,t){this.publicOnly||this.handleEvent("restricted",e,t)},e.prototype.publicLog=function(e,t){this.handleEvent("public",e,t)},e.prototype.handleEvent=function(e,t,n){this.eventQueue.length>=this.eventMaxQueueSize||(n=n||{},n.source="client",this.eventQueue.push({name:t,kind:e,timestamp:(new Date).toUTCString(),data:JSON.stringify(n),sessionID:this.sessionID}),this.sendingEvents||this.failureCount>0||(this.eventQueue.length>this.eventBatchSize?(clearTimeout(this.waitIntervalId),this.waitIntervalId=null,this.sendEvents()):this.sendSoon()))},e.prototype.sendSoon=function(){var t=this;null===this.waitIntervalId&&(this.waitIntervalId=setTimeout(function(){t.waitIntervalId=null,t.sendEvents()},e.EVENT_INTERVAL*Math.pow(2,this.failureCount)))},e.prototype.sendEvents=function(){var e=this;this.sendingEvents=!0;var t=this.eventQueue.splice(0,this.eventBatchSize);0!==t.length&&this.submitToServer(t).then(function(){e.failureCount=0},function(){e.eventQueue.unshift.apply(e.eventQueue,t),e.failureCount++}).done(function(){e.sendingEvents=!1,e.eventQueue.length>0&&e.sendSoon()})},e.prototype.submitToServer=function(e){var t=JSON.stringify(e),n=this.requestService.getRequestUrl("telemetry"),i={type:"POST",url:n,data:t,headers:{"Content-Type":"application/json"}};return this.requestService.makeRequest(i).then(function(e){return 201!==e.status?u.Promise.wrapError("Bad response"):void 0})},e}();t.TelemetryService=d;var c=function(){function e(){}return e.prototype.log=function(){},e.prototype.publicLog=function(){},e.prototype.start=function(){return l.nullEvent},e}();t.NullTelemetryService=c,t.nullService=new c}),define("vs/editor/core/constants",["require","exports"],function(e,t){"use strict";t.EditorType={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor",ITerminal:"vs.editor.ITerminal"},t.ClassName={EditorWarningDecoration:"greensquiggly",EditorErrorDecoration:"redsquiggly"},t.Handler={ExecuteCommand:"executeCommand",CursorLeft:"cursorLeft",CursorLeftSelect:"cursorLeftSelect",CursorWordLeft:"cursorWordLeft",CursorWordLeftSelect:"cursorWordLeftSelect",CursorRight:"cursorRight",CursorRightSelect:"cursorRightSelect",CursorWordRight:"cursorWordRight",CursorWordRightSelect:"cursorWordRightSelect",CursorUp:"cursorUp",CursorUpSelect:"cursorUpSelect",CursorDown:"cursorDown",CursorDownSelect:"cursorDownSelect",CursorPageUp:"cursorPageUp",CursorPageUpSelect:"cursorPageUpSelect",CursorPageDown:"cursorPageDown",CursorPageDownSelect:"cursorPageDownSelect",CursorHome:"cursorHome",CursorHomeSelect:"cursorHomeSelect",CursorEnd:"cursorEnd",CursorEndSelect:"cursorEndSelect",CursorTop:"cursorTop",CursorTopSelect:"cursorTopSelect",CursorBottom:"cursorBottom",CursorBottomSelect:"cursorBottomSelect",AddCursorDown:"addCursorDown",AddCursorUp:"addCursorUp",MoveTo:"moveTo",MoveToSelect:"moveToSelect",CreateCursor:"createCursor",LastCursorMoveToSelect:"lastCursorMoveToSelect",JumpToBracket:"jumpToBracket",Type:"type",Paste:"paste",Tab:"tab",Indent:"indent",Outdent:"outdent",DeleteLeft:"deleteLeft",DeleteRight:"deleteRight",DeleteWordLeft:"deleteWordLeft",DeleteWordRight:"deleteWordRight",DeleteAllLeft:"deleteAllLeft",DeleteAllRight:"deleteAllRight",Enter:"enter",Escape:"escape",Cut:"cut",Undo:"undo",Redo:"redo",WordSelect:"wordSelect",WordSelectDrag:"wordSelectDrag",LastCursorWordSelect:"lastCursorWordSelect",LineSelect:"lineSelect",LineSelectDrag:"lineSelectDrag",LastCursorLineSelect:"lastCursorLineSelect",LineInsertBefore:"lineInsertBefore",LineInsertAfter:"lineInsertAfter",LineBreakInsert:"lineBreakInsert",SelectAll:"selectAll"},t.EventType={Disposed:"disposed",ConfigurationChanged:"configurationChanged",ConfigurationLineHeightChanged:"configurationLineHeightChanged",ConfigurationFontChanged:"configurationFontChanged",ModelDispose:"modelDispose",ModelChanged:"modelChanged",ModelModeChanged:"modelsModeChanged",ModelTokensChanged:"modelTokensChanged",ModelContentChanged:"contentChanged",ModelContentChangedFlush:"flush",ModelContentChangedLinesDeleted:"linesDeleted",ModelContentChangedLinesInserted:"linesInserted",ModelContentChangedLineChanged:"lineChanged",OnBeforeModelContentChangedFlush:"onBeforeFlush",OnBeforeModelContentChangedLinesDeleted:"onBeforeLinesDeleted",OnBeforeModelContentChangedLinesInserted:"onBeforeLinesInserted",OnBeforeModelContentChangedLineChanged:"onBeforeLineChanged",ModelPropertiesChanged:"propertiesChanged",ModelDecorationsChanged:"decorationsChanged",CursorPositionChanged:"positionChanged",CursorSelectionChanged:"selectionChanged",CursorRevealRange:"revealRange",ViewFocusGained:"focusGained",ViewFocusLost:"focusLost",ViewFocusChanged:"focusChanged",ViewScrollWidthChanged:"scrollWidthChanged",ViewScrollHeightChanged:"scrollHeightChanged",ViewScrollChanged:"scrollChanged",ViewZonesChanged:"zonesChanged",ViewLayoutChanged:"viewLayoutChanged",ContextMenu:"contextMenu",MouseDown:"mousedown",MouseUp:"mouseup",MouseMove:"mousemove",MouseLeave:"mouseleave",KeyDown:"keydown",KeyUp:"keyup",EditorLayout:"editorLayout",DiffUpdated:"diffUpdated"}}),define("vs/editor/core/model/mirrorModel",["require","vs/base/lib/winjs.base","vs/base/network","vs/base/eventEmitter","vs/editor/core/constants"],function(e,t){"use strict";var n=e("vs/base/eventEmitter").EventEmitter,i=e("vs/base/network"),r=e("vs/editor/core/constants"),o=t.Class.derive(n,function(e,t,r,o,s,a){n.call(this),this.id=e,this.version=t,o||(o=new i.URL("inMemory://localhost/vs/editor/core/model/mirrorModel/"+e)),this.associatedResource=o,this.lines=r.split("\n"),this.mainThread=a,this.lastDecorationId=0,this.changeAccessorCount=0,this.decorations={},this.extraProperties=s||{}},{destroy:function(){},getAssociatedResource:function(){return this.associatedResource},getVersionId:function(){return this.version},onEvents:function(e){for(var t=!1,n=0,i=e.length;i>n;n++){var o=e[n];switch(o.type){case r.EventType.ModelContentChanged:switch(this.version=o.versionId,o.changeType){case r.EventType.ModelContentChangedFlush:this.emit(r.EventType.OnBeforeModelContentChangedFlush,o),this.lines=o.detail.split("\n"),t=!0;break;case r.EventType.ModelContentChangedLinesDeleted:this.emit(r.EventType.OnBeforeModelContentChangedLinesDeleted,o),this._onLinesDeleted(o),t=!0;break;case r.EventType.ModelContentChangedLinesInserted:this.emit(r.EventType.OnBeforeModelContentChangedLinesInserted,o),this._onLinesInserted(o),t=!0;break;case r.EventType.ModelContentChangedLineChanged:this.emit(r.EventType.OnBeforeModelContentChangedLineChanged,o),this._onLineChanged(o),t=!0}break;case r.EventType.ModelPropertiesChanged:this.extraProperties=o.properties;break;default:console.warn("Unknown model event: "+o.type)}}t&&this.emit("changed",{})},getProperty:function(e){return this.extraProperties.hasOwnProperty(e)?this.extraProperties[e]:null},_onLineChanged:function(e){this.lines[e.lineNumber-1]=e.detail},_onLinesDeleted:function(e){var t=e.fromLineNumber-1,n=e.toLineNumber-1;this.lines.splice(t,n-t+1)},_onLinesInserted:function(e){var t,n,i=e.detail.split("\n");for(t=e.fromLineNumber-1,n=0;tu;u++)a.push(this.lines[u]);var l=o.substring(e.startColumn-1,o.length);return a.length>0&&(l+=n+a.join(n)),l+=n+s.substring(0,e.endColumn-1)},getLineNumberFromOffset:function(e){for(var t=0,n=0,i=this.lines.length;i>n;n++)if(t+=this.lines[n].length+1,t>e)return n+1;return this.lines.length},getOffsetFromPosition:function(e){return this.getLineStart(e.lineNumber)+e.column-1},getLineStart:function(e){for(var t=0,n=Math.min(e,this.lines.length)-1,i=0,r=this.lines.length;r>i;i++){if(i>=n)return t;t+=this.lines[i].length+1}return t},getLineContent:function(e){return this.lines[e-1]},getRawLines:function(){return this.lines.slice(0)},getLineCount:function(){return this.lines.length},getLineMaxColumn:function(e){return this.lines[e-1].length+1},getAllWordsWithRange:function(){var e,t=[];for(e=0;e=i[r].start;r++)if(t<=i[r].end)return n(e,i[r].start,i[r].end);return n(e,-1,-1)}});return{MirrorModel:o}}),define("vs/editor/worker/dispatcherService",["require","exports","vs/base/lib/winjs.base","vs/base/types","vs/base/network"],function(e,t,n,i,r){"use strict";var o=n,s=i,a=r,u=function(){function e(){this.table={}}return e.prototype.register=function(e){if(s.isString(e))this.table[e]=arguments[1];else for(var t in e){var n=e[t];s.isFunction(n)&&(this.table[t]=n.bind(e))}},e.prototype.dispatch=function(e){if(!this.table[e.type])return o.Promise.wrapError(new Error("no handler/route for: "+e.type));try{var t=this.deserialize(e.payload),n=this.table[e.type].apply(this.table[e.type],t);return o.Promise.is(n)?n:o.Promise.as(n)}catch(i){return o.Promise.wrapError(i)}},e.prototype.deserialize=function(e){for(var t=[],n=0;n0;)this.unbinds[n].pop()();for(var r in this.linked[n])if(this.linked.hasOwnProperty(r)){var o=this.linked[n][r];u.isFunction(o.onRemove)&&o.onRemove()}return delete this.unbinds[n],delete this.linked[n],delete this.data[n],this.emit(l.ResourceEvents.REMOVED,{url:e,removedElement:i,addedElement:t}),!0},t}(a.EventEmitter);t.ResourceService=d;var c=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),t.prototype.injectDispatcherService=function(e){e.register("modelInitialize",this.onModelInitialize.bind(this)),e.register("modelDestroy",this.onModelDestroy.bind(this)),e.register("modelEvents",this.onModelEvents.bind(this))},t.prototype.onModelInitialize=function(e,t,n,i,r){var o=new h.MirrorModel(e,t,n,r,i);this.insert(r,o)},t.prototype.onModelDestroy=function(e){this.remove(e)},t.prototype.onModelEvents=function(e,t){var n=this.get(e);n.onEvents(t)},t}(d);t.WorkerResourceService=c}),define("vs/editor/diff/diffComputer",["require","exports"],function(e,t){"use strict";var n=function(){function e(){}return e.prototype.computeDiff=function(){return[]},e}();t.DiffComputer=n});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/platform/markers/markers",["require","exports","vs/base/assert","vs/base/network"],function(e,t,n,i){"use strict";function r(e,t,n,i,r){return{type:"text",severity:e,code:t,text:n,offset:i,length:r}}function o(e,t,n,i){return{type:"text",severity:e,code:t,text:n,range:i}}function s(e){return new m(e)}function a(e,t){return t+"|"+e.toExternal()}function u(e,t){return new v(e,t)}function l(e){return v.fromJson(e)}function h(e,t){var n=null;if(t){if(d.ok(e.getAssociatedResource().toExternal()===t.getAssociatedResource().toExternal()),e.getId()===m.DEFAULT_GROUP)return n=new m(t.getAssociatedResource(),e.getMarkers()),t.getGroups().forEach(function(e){n.addGroup(e)}),n;var i=new f(t,e.getId(),e.getMarkers()),r=t.getGroup(e.getId());return r?(n=new m(t.getAssociatedResource(),t.getMarkers()),t.getGroups().forEach(function(e){e.getId()!==i.getId()&&n.addGroup(e)}),n.addGroup(i),n):(t.addGroup(i),t)}if(e.getId()===m.DEFAULT_GROUP)return new m(e.getAssociatedResource(),e.getMarkers());var n=new m(e.getAssociatedResource()),o=new f(n,e.getId(),e.getMarkers());return n.addGroup(o),n}var d=n,c=i;!function(e){e._map=[],e._map[0]="Info",e.Info=0,e._map[1]="Warning",e.Warning=1,e._map[2]="Error",e.Error=2}(t.Severity||(t.Severity={})),t.Severity,t.createTextMarker=r,t.createRangeTextMarker=o;var p=function(){function e(e){"undefined"==typeof e&&(e=[]),this.markers=e}return e.prototype.length=function(){return this.markers.length},e.prototype.markerAt=function(e){return this.markers[e]},e.prototype.getMarkers=function(){return this.markers.slice(0)},e.prototype.forEach=function(e){this.markers.forEach(e)},e}(),f=function(e){function t(t,n,i){"undefined"==typeof i&&(i=[]),e.call(this,i),this.owner=t,this.id=n}return __extends(t,e),t.prototype.getAssociatedResource=function(){return this.owner.getAssociatedResource()},t.prototype.getId=function(){return this.id},t}(p),m=function(e){function t(t,n){"undefined"==typeof n&&(n=[]),e.call(this,n),this.resource=t,this.groups=null}return __extends(t,e),t.DEFAULT_GROUP="defaultGroup",t.prototype.getAssociatedResource=function(){return this.resource},t.prototype.getId=function(){return t.DEFAULT_GROUP},t.prototype.getGroups=function(){return this.groups?this.groups.slice(0):[]},t.prototype.getGroup=function(e){if(t.DEFAULT_GROUP===e)return this;if(this.groups)for(var n=0;n1?this.markerUpdateChangeCounts[t]=--n:(delete this.markerUpdateChangeCounts[t],0===this.globalChangeCount&&this._publishMarkerUpdate(e))},e.prototype._getMarkerUpdateChangeCount=function(e){return this.markerUpdateChangeCounts[e.computeKey()]},e.prototype._publishMarkerUpdate=function(e){var t=[];t.push(this._convertToJson(e)),this.publisher.sendMessage("publishMarkerUpdates",t),this._removeMarkerUpdate(e)},e.prototype._publishReadyMarkerUpdates=function(){var e=this,t=[];Object.keys(this.markerUpdates).forEach(function(n){var i=e.markerUpdates[n],r=e._getMarkerUpdateChangeCount(i);"undefined"==typeof r&&t.push(e._convertToJson(i))}),this.publisher.sendMessage("publishMarkerUpdates",t)},e.prototype._convertToJson=function(e){var t=e.toJson(),n=e.getAssociatedResource().toExternal(),i=this.modelInfos[n];i&&(t.model=i);for(var r=this.models[n],o=t.markers,s=0,a=o.length;a>s;s++){var l=o[s];if(r&&"object"!=typeof l.range){var h=null;if("undefined"!=typeof l.offset&&"undefined"!=typeof l.length){l=u.clone(l),h={};var d=l.offset,c=Math.max(0,l.length);h.startLineNumber=r.getLineNumberFromOffset(d),h.startColumn=1+d-r.getLineStart(h.startLineNumber),h.endLineNumber=r.getLineNumberFromOffset(d+c),h.endColumn=1+d+c-r.getLineStart(h.endLineNumber),delete l.offset,delete l.length}else"undefined"!=typeof l.lineNumber&&"undefined"!=typeof l.column&&"undefined"!=typeof l.length?(l=u.clone(l),h={},h.startLineNumber=l.lineNumber,h.startColumn=l.column,h.endLineNumber=l.lineNumber,h.endColumn=l.column+l.length,delete l.lineNumber,delete l.column,delete l.length):"undefined"!=typeof l.startLineNumber&&"undefined"!=typeof l.startColumn&&"undefined"!=typeof l.endLineNumber&&"undefined"!=typeof l.endColumn&&(l=u.clone(l),h={},h.startLineNumber=l.startLineNumber,h.startColumn=l.startColumn,h.endLineNumber=l.endLineNumber,h.endColumn=l.endColumn,delete l.startLineNumber,delete l.startColumn,delete l.endLineNumber,delete l.endColumn);null!==h&&(l.range=h,o[s]=l)}}return t},e}();t.createPublisher=o}),define("vs/editor/modes/modes",["require","exports"],function(e,t){"use strict";!function(e){e._map=[],e.None=0,e.Open=1,e.Close=-1}(t.Bracket||(t.Bracket={})),t.Bracket,function(e){e._map=[],e._map[0]="PREFIX",e.PREFIX=0,e._map[1]="SUFFIX",e.SUFFIX=1}(t.TypesFormat||(t.TypesFormat={})),t.TypesFormat,function(e){e._map=[],e._map[0]="None",e.None=0,e._map[1]="Indent",e.Indent=1,e._map[2]="IndentOutdent",e.IndentOutdent=2}(t.IndentAction||(t.IndentAction={})),t.IndentAction}),define("vs/base/filters",["require","exports"],function(e,t){"use strict";function n(e,t){return function(n,i){return e(n,i)||t(n,i)}}function i(e,t){return function(n,i){return e(n,i)&&t(n,i)}}function r(e,t,n){if(0===n.length||n.length0?[{start:0,end:t.length}]:[]}function o(e,t){var n=t.toLowerCase().indexOf(e.toLowerCase());return-1===n?null:[{start:n,end:n+e.length}]}function s(e,t){return a(e.toLowerCase(),t.toLowerCase(),0,0)}function a(e,t,n,i){if(n===e.length)return[];if(i===t.length)return null;if(e[n]===t[i]){var r=null;if(r=a(e,t,n+1,i+1))return d({start:i,end:i+1},r)}return a(e,t,n,i+1)}function u(e,t){if(0===t.length)return null;for(var n=null,i=0;i=65&&90>=t}function h(e){var t=e.charCodeAt(0);return t>=48&&57>=t}function d(e,t){return 0===t.length?t=[e]:e.end===t[0].start?t[0].start=e.start:t.unshift(e),t}function c(e,t){for(var n=t;nr;r++)s[r]=this._normalizeOptions(i[r].options),a[r]=this.model.validateRange(i[r].range);return this._deltaImpl(e,t,n,o,a,s)},e.prototype._deltaImpl=function(e,t,n,i,r,o){var s,a,u,l,h={};for(s=0,a=n.length;a>s;s++)this.decorations.hasOwnProperty(n[s])&&(l=this.decorations[n[s]],u=this._decorationHash(this.trackedRanges.getRange(l.rangeId),l.options),h[u]=h[u]||[],h[u].push(n[s]));var d,c,p,f,m=[],g={};for(s=0;i>s;s++){if(u=this._decorationHash(r[s],o[s]),f=!1,h.hasOwnProperty(u))for(p=h[u],d=0,c=p.length;c>d;d++)if(!g.hasOwnProperty(p[d])){f=!0,g[p[d]]=!0,m.push(p[d]);break}f||m.push(this._add(e,t,r[s],o[s]))}for(s=0,a=n.length;a>s;s++)g.hasOwnProperty(n[s])||this._remove(e,n[s]);return m},e.prototype.onChangedRanges=function(e,t){var n,i;for(n in t)t.hasOwnProperty(n)&&this.rangeIdToDecorationId.hasOwnProperty(n)&&(i=this.rangeIdToDecorationId[n],e.addMovedDecoration(i,t[n]))},e.prototype.getDecorationData=function(e){var t=this.decorations[e];return{id:t.id,ownerId:t.ownerId,range:this.trackedRanges.getRange(t.rangeId),isForValidation:!1,options:t.options}},e}();t.ModelDecorations=n}),define("vs/editor/modes/nullMode",["require","exports","vs/editor/modes/modes"],function(e,t,n){"use strict";function i(e,t,n,i){"undefined"==typeof i&&(i=0);var o=[{startIndex:i,type:"",bracket:r.Bracket.None}],s=[{startIndex:i,mode:e}];return{tokens:o,actualStopOffset:i+t.length,endState:n,modeTransitions:s}}var r=n,o=function(){function e(e,t){this.mode=e,this.stateData=t}return e.prototype.clone=function(){var t=this.stateData?this.stateData.clone():null;return new e(this.mode,t)},e.prototype.equals=function(e){if(this.mode!==e.getMode())return!1;var t=e.getStateData();return this.stateData||t?this.stateData&&t?this.stateData.equals(t):!1:!0},e.prototype.getMode=function(){return this.mode},e.prototype.tokenize=function(e){return e.advanceToEOS(),{type:""}},e.prototype.getStateData=function(){return this.stateData},e.prototype.setStateData=function(e){this.stateData=e},e}();t.NullState=o;var s=function(){function e(){this.tokenTypeClassificationSupport=this}return e.DEFAULT_WORD_REGEXP=/(-?\d*\.\d\w*)|(\w+)/g,e.prototype.getId=function(){return"vs.editor.modes.nullMode"},e.prototype.bindModel=function(){},e.prototype.unbindModel=function(){},e.prototype.getNonWordTokenTypes=function(){return[]},e.prototype.getWordDefinition=function(){return e.DEFAULT_WORD_REGEXP},e}();t.NullMode=s,t.nullTokenize=i}),define("vs/editor/editor",["require","exports","vs/base/eventEmitter"],function(e,t,n){"use strict";!function(e){e._map=[],e._map[0]="LTR",e.LTR=0,e._map[1]="RTL",e.RTL=1}(t.SelectionDirection||(t.SelectionDirection={})),t.SelectionDirection,function(e){e._map=[],e._map[0]="TextDefined",e.TextDefined=0,e._map[1]="LF",e.LF=1,e._map[2]="CRLF",e.CRLF=2}(t.EndOfLinePreference||(t.EndOfLinePreference={})),t.EndOfLinePreference,function(e){e._map=[],e._map[0]="EXACT",e.EXACT=0,e._map[1]="ABOVE",e.ABOVE=1,e._map[2]="BELOW",e.BELOW=2}(t.ContentWidgetPositionPreference||(t.ContentWidgetPositionPreference={})),t.ContentWidgetPositionPreference,function(e){e._map=[],e._map[0]="TOP_RIGHT_CORNER",e.TOP_RIGHT_CORNER=0}(t.OverlayWidgetPositionPreference||(t.OverlayWidgetPositionPreference={})),t.OverlayWidgetPositionPreference,function(e){e._map=[],e._map[0]="UNKNOWN",e.UNKNOWN=0,e._map[1]="TEXTAREA",e.TEXTAREA=1,e._map[2]="GUTTER_GLYPH_MARGIN",e.GUTTER_GLYPH_MARGIN=2,e._map[3]="GUTTER_LINE_NUMBERS",e.GUTTER_LINE_NUMBERS=3,e._map[4]="GUTTER_LINE_DECORATIONS",e.GUTTER_LINE_DECORATIONS=4,e._map[5]="GUTTER_VIEW_ZONE",e.GUTTER_VIEW_ZONE=5,e._map[6]="CONTENT_TEXT",e.CONTENT_TEXT=6,e._map[7]="CONTENT_EMPTY",e.CONTENT_EMPTY=7,e._map[8]="CONTENT_VIEW_ZONE",e.CONTENT_VIEW_ZONE=8,e._map[9]="CONTENT_WIDGET",e.CONTENT_WIDGET=9,e._map[10]="OVERVIEW_RULER",e.OVERVIEW_RULER=10,e._map[11]="SCROLLBAR",e.SCROLLBAR=11,e._map[12]="OVERLAY_WIDGET",e.OVERLAY_WIDGET=12}(t.MouseTargetType||(t.MouseTargetType={})),t.MouseTargetType}),define("vs/editor/core/position",["require","exports","vs/editor/editor"],function(e,t,n){"use strict";function i(e){return e&&"number"==typeof e.lineNumber&&"number"==typeof e.column}t.isIPosition=i;var r=function(){function e(e,t){this.lineNumber=e,this.column=t}return e.prototype.equals=function(e){return this.lineNumber===e.lineNumber&&this.column===e.column},e.prototype.isBefore=function(e){return this.lineNumber=0;r--){if(this._currentLineTokens[r].startIndex<=n&&i>=n){this._currentTokenIndex=r,this._next=this._current(),this._prev=this._current();break}i=this._currentLineTokens[r].startIndex}}return e.prototype._advanceNext=function(){if(this._prev=this._next,this._next=null,this._currentTokenIndex+10){this._currentTokenIndex=0,this._next=this._current();break}null===this._next&&(this._currentLineTokens=this._model.getInternalTokens(this._currentLineNumber),this._currentTokenIndex=this._currentLineTokens.length,this._advancePrev(),this._next=null)}},e.prototype._advancePrev=function(){if(this._next=this._prev,this._prev=null,this._currentTokenIndex>0)this._currentTokenIndex--,this._prev=this._current();else for(;this._currentLineNumber>1;)if(this._currentLineNumber--,this._currentLineTokens=this._model.getInternalTokens(this._currentLineNumber),this._currentLineTokens.length>0){this._currentTokenIndex=this._currentLineTokens.length-1,this._prev=this._current();break}},e.prototype._current=function(){return{token:this._currentLineTokens[this._currentTokenIndex],lineNumber:this._currentLineNumber,startColumn:this._currentLineTokens[this._currentTokenIndex].startIndex+1,endColumn:this._currentTokenIndex+1=i;){var o=Math.floor((i+r)/2),s=n(e[o],t);if(0>s)i=o+1;else{if(!(s>0))return o;r=o-1}}return-1}function i(e){for(var t=[],n=0,i=e.length;i>n;n++)t.push.apply(t,e[n]);return t}function r(e,t){for(var n,i=0,r=e.length-1;r>i;)n=i+Math.ceil((r-i)/2),e[n].startIndex>t?r=n-1:i=n;return i}t.binarySearch=n,t.merge=i,t.findIndexInSegmentsArray=r}),define("vs/editor/core/range",["require","exports","vs/editor/core/position","vs/editor/editor"],function(e,t,n,i){"use strict";function r(e){return e&&"number"==typeof e.startLineNumber&&"number"==typeof e.startColumn&&"number"==typeof e.endLineNumber&&"number"==typeof e.endColumn}function o(e){return new u(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn)}var s=n;t.isIRange=r;var a=function(){function e(){}return e.isEmpty=function(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn},e.containsPosition=function(e,t){return t.lineNumbere.endLineNumber?!1:t.lineNumber===e.startLineNumber&&t.columne.endColumn?!1:!0},e.containsRange=function(e,t){return t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber?!1:t.startLineNumber===e.startLineNumber&&t.startColumne.endColumn?!1:!0 },e.intersectRanges=function(e,t){var n=e.startLineNumber,i=e.startColumn,r=e.endLineNumber,o=e.endColumn,s=t.startLineNumber,a=t.startColumn,l=t.endLineNumber,h=t.endColumn;return s>n?(n=s,i=a):n===s&&(i=Math.max(i,a)),r>l?(r=l,o=h):r===l&&(o=Math.min(o,h)),n>r?null:n===r&&i>o?null:new u(n,i,r,o)},e.plusRange=function(e,t){var n,i,r,o;return t.startLineNumbere.endLineNumber?(r=t.endLineNumber,o=t.endColumn):t.endLineNumber===e.endLineNumber?(r=t.endLineNumber,o=Math.max(t.endColumn,e.endColumn)):(r=e.endLineNumber,o=e.endColumn),new u(n,i,r,o)},e.equalsRange=function(e,t){return e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn},e.compareRangesUsingStarts=function(e,t){return e.startLineNumber===t.startLineNumber?e.startColumn===t.startColumn?e.endLineNumber===t.endLineNumber?e.endColumn-t.endColumn:e.endLineNumber-t.endLineNumber:e.startColumn-t.startColumn:e.startLineNumber-t.startLineNumber},e.compareRangesUsingEnds=function(e,t){return e.endLineNumber===t.endLineNumber?e.endColumn===t.endColumn?e.startLineNumber===t.startLineNumber?e.startColumn-t.startColumn:e.startLineNumber-t.startLineNumber:e.endColumn-t.endColumn:e.endLineNumber-t.endLineNumber},e}();t.RangeUtils=a;var u=function(){function e(e,t,n,i){e>n||e===n&&t>i?(this.startLineNumber=n,this.startColumn=i,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=n,this.endColumn=i)}return e.prototype.isEmpty=function(){return a.isEmpty(this)},e.prototype.containsPosition=function(e){return a.containsPosition(this,e)},e.prototype.containsRange=function(e){return a.containsRange(this,e)},e.prototype.plusRange=function(e){return a.plusRange(this,e)},e.prototype.equalsRange=function(e){return a.equalsRange(this,e)},e.prototype.getEndPosition=function(){return new s.Position(this.endLineNumber,this.endColumn)},e.prototype.getStartPosition=function(){return new s.Position(this.startLineNumber,this.startColumn)},e.prototype.cloneRange=function(){return new e(this.startLineNumber,this.startColumn,this.endLineNumber,this.endColumn)},e.prototype.toString=function(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"},e.prototype.setEndPosition=function(t,n){return new e(this.startLineNumber,this.startColumn,t,n)},e.prototype.setStartPosition=function(t,n){return new e(t,n,this.endLineNumber,this.endColumn)},e}();t.Range=u,t.create=o}),define("vs/editor/core/model/trackedRanges",["require","exports","vs/editor/core/range"],function(e,t,n){"use strict";var i=n,r=function(){function e(e){this.model=e,this.lastRangeId=0,this.ranges={},this.markerIdToRangeId={},this.multiLineTrackedRanges={}}return e.prototype.clear=function(){this.ranges={},this.markerIdToRangeId={},this.multiLineTrackedRanges={}},e.prototype._setRangeIsMultiLine=function(e,t){var n=this.multiLineTrackedRanges.hasOwnProperty(e);!n&&t?this.multiLineTrackedRanges[e]=!0:n&&!t&&delete this.multiLineTrackedRanges[e]},e.prototype.add=function(e){e=this.model.validateRange(e);var t=this.model._addMarker(e.startLineNumber-1,e.startColumn,"start"),n=this.model._addMarker(e.endLineNumber-1,e.endColumn,"end"),i={id:(++this.lastRangeId).toString(),startMarkerId:t,endMarkerId:n};return this.ranges[i.id]=i,this.markerIdToRangeId[t]=i.id,this.markerIdToRangeId[n]=i.id,this._setRangeIsMultiLine(i.id,e.startLineNumber!==e.endLineNumber),i.id},e.prototype.change=function(e,t){if(this.ranges.hasOwnProperty(e)){t=this.model.validateRange(t);var n=this.ranges[e];this.model._changeMarker(n.startMarkerId,t.startLineNumber-1,t.startColumn),this.model._changeMarker(n.endMarkerId,t.endLineNumber-1,t.endColumn),this._setRangeIsMultiLine(n.id,t.startLineNumber!==t.endLineNumber)}},e.prototype.remove=function(e){if(this.ranges.hasOwnProperty(e)){var t=this.ranges[e];this.model._removeMarker(t.startMarkerId),this.model._removeMarker(t.endMarkerId),this._setRangeIsMultiLine(t.id,!1),delete this.ranges[t.id],delete this.markerIdToRangeId[t.startMarkerId],delete this.markerIdToRangeId[t.endMarkerId]}},e.prototype.onChangedMarkers=function(e){var t,n,i,r,o={};for(var s in e)e.hasOwnProperty(s.toString())&&this.markerIdToRangeId.hasOwnProperty(s.toString())&&(r=e[s],i=this.markerIdToRangeId[s],n=this.ranges[i],o.hasOwnProperty(n.id)?t=o[n.id]:(t={startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0},o[n.id]=t),r.id===n.startMarkerId?(t.startLineNumber=r.oldLineIndex+1,t.startColumn=r.oldColumn):(t.endLineNumber=r.oldLineIndex+1,t.endColumn=r.oldColumn),this._setRangeIsMultiLine(n.id,this.model._getMarkerLineNumber(n.startMarkerId)!==this.model._getMarkerLineNumber(n.endMarkerId)));return o},e.prototype._getMultiLineTrackedRanges=function(e,t){var n,i,r,o,s,a,u={};for(n in this.multiLineTrackedRanges)if(this.multiLineTrackedRanges.hasOwnProperty(n)){if(i=this.ranges[n],r=this.model._getMarkerLineNumber(i.startMarkerId),r>t)continue;if(s=this.model._getMarkerLineNumber(i.endMarkerId),e>s)continue;o=this.model._getMarkerColumn(r,i.startMarkerId),a=this.model._getMarkerColumn(s,i.endMarkerId),u[i.id]={startLineNumber:r,startColumn:o,endLineNumber:s,endColumn:a}}return u},e.prototype.getLinesTrackedRanges=function(e,t){var n,i,r,o,s,a,u=this._getMultiLineTrackedRanges(e,t);for(a=e;t>=a;a++)for(n=this.model._getLineMarkers(a),o=0,s=n.length;s>o;o++)i=n[o],this.markerIdToRangeId.hasOwnProperty(i.id)&&(r=this.markerIdToRangeId[i.id],this.ranges[r].startMarkerId===i.id?u.hasOwnProperty(r)?u[r].startColumn=i.column:u[r]={startLineNumber:a,startColumn:i.column,endLineNumber:a,endColumn:-1}:u.hasOwnProperty(r)?u[r].endColumn=i.column:u[r]={startLineNumber:a,startColumn:-1,endLineNumber:a,endColumn:i.column});return u},e.prototype.getStartLineNumber=function(e){return this.model._getMarkerLineNumber(this.ranges[e].startMarkerId)},e.prototype.getEndLineNumber=function(e){return this.model._getMarkerLineNumber(this.ranges[e].endMarkerId)},e.prototype.getRange=function(e){var t=this.ranges[e],n=this.model._getMarker(t.startMarkerId),r=this.model._getMarker(t.endMarkerId);return new i.Range(n.lineNumber,n.column,r.lineNumber,r.column)},e}();t.TrackedRanges=r}),define("vs/editor/core/model/modelEditOperation",["require","exports","vs/editor/core/range"],function(e,t,n){"use strict";var i=n,r=function(){function e(){}return e.execute=function(t,n){var i=t.change(function(i){return e._apply(t,i,n.operations)});return{operations:i}},e._apply=function(t,n,i){i.sort(e._compareOperations);for(var r=1;rn;n++)h=t[n].identifier,a=t[n].text,o=t[n].selectionStartMarkerId,s=t[n].positionMarkerId,u=e._getMarker(o),l=e._getMarker(s),d.push({identifier:h,range:new i.Range(u.lineNumber,u.column,l.lineNumber,l.column),text:a}),e._removeMarker(o),e._removeMarker(s);return d},e._applyWithMarkers=function(e,t,n){var i,r,o,s,a,u,l,h,d,c,p=[];for(i=0,r=n.length;r>i;i++)c=n[i].identifier,s=n[i].range,o=n[i].text,s.isEmpty()&&!o?(d={startLineNumber:1,startColumn:1,endLineNumber:1,endColumn:1},h=""):(s.isEmpty()?(h="",a={lineNumber:s.startLineNumber,column:s.startColumn}):(l=t.deleteText(s),h=l.deletedText,a=l.position),o?(u=t.insertText(a,o),d={startLineNumber:a.lineNumber,startColumn:a.column,endLineNumber:u.lineNumber,endColumn:u.column}):d={startLineNumber:a.lineNumber,startColumn:a.column,endLineNumber:a.lineNumber,endColumn:a.column}),p.push({identifier:c,text:h,selectionStartMarkerId:e._addMarker(d.startLineNumber-1,d.startColumn,"start"),positionMarkerId:e._addMarker(d.endLineNumber-1,d.endColumn,"end")});return p},e._compareOperations=function(e,t){return-i.RangeUtils.compareRangesUsingEnds(e.range,t.range)},e}();t.ModelEditOperation=r}),define("vs/editor/core/model/editStack",["require","exports","vs/editor/core/model/modelEditOperation"],function(e,t,n){"use strict";var i=n,r=function(){function e(e){this.model=e,this.currentOpenStackElement=null,this.past=[],this.future=[]}return e.prototype.pushStackElement=function(){null!==this.currentOpenStackElement&&(this.past.push(this.currentOpenStackElement),this.currentOpenStackElement=null)},e.prototype.clear=function(){this.currentOpenStackElement=null,this.past=[],this.future=[]},e.prototype.pushEditOperation=function(e,t,n){this.future=[],this.currentOpenStackElement||(this.currentOpenStackElement={beforeCursorState:e,editOperations:[],afterCursorState:null});var r=i.ModelEditOperation.execute(this.model,{operations:t});return this.currentOpenStackElement.editOperations.push(r),this.currentOpenStackElement.afterCursorState=n?n(r.operations):null,this.currentOpenStackElement.afterCursorState},e.prototype.undo=function(){if(this.pushStackElement(),this.past.length>0){for(var e=this.past.pop(),t=e.editOperations.length-1;t>=0;t--)e.editOperations[t]=i.ModelEditOperation.execute(this.model,e.editOperations[t]);return this.future.push(e),e.beforeCursorState}return null},e.prototype.redo=function(){if(this.future.length>0){if(this.currentOpenStackElement)throw new Error("How is this possible?");for(var e=this.future.pop(),t=0;tt;t++)i=s[t].text.length,i>=e?o+=i:r+=i;return o>r},t.prototype.addWordRegExpProperty=function(){var e=this.massageWordDefinitionOf(this.mode);this.setProperty("$WordDefinitionForMirrorModel",{source:e.source,flags:(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")})},t.prototype.getEndOfLine=function(e){switch(e){case W.EndOfLinePreference.LF:return"\n";case W.EndOfLinePreference.CRLF:return"\r\n";case W.EndOfLinePreference.TextDefined:return this.getEOL()}throw new Error("Unknown EOL preference")},t.prototype.getValue=function(e,t){"undefined"==typeof t&&(t=!1);var n={startLineNumber:1,startColumn:1,endLineNumber:this.linesLength,endColumn:this.getLineMaxColumn(this.linesLength)};return t?this.BOM+this.getValueInRange(n,e):this.getValueInRange(n,e)},t.prototype.getValueInRange=function(e,t){"undefined"==typeof t&&(t=W.EndOfLinePreference.TextDefined);var n=this.validateRange(e);if(n.isEmpty())return"";if(n.startLineNumber===n.endLineNumber)return this.lines[n.startLineNumber-1].text.substring(n.startColumn-1,n.endColumn-1);var i,r,o=this.getEndOfLine(t),s=n.startLineNumber-1,a=n.endLineNumber-1,u=this.lines[s],l=this.lines[a],h=[];i=u.text.substring(n.startColumn-1,u.text.length);for(var d=s+1;a>d;d++)r=this.lines[d],h.push(i),i=r.text;return h.push(i),h.push(l.text.substring(0,n.endColumn-1)),h.join(o)},t.prototype.setProperty=function(e,t){this.extraProperties[e]=t,this.emitModelPropertiesChangedEvent()},t.prototype.getProperty=function(e){return this.extraProperties.hasOwnProperty(e)?this.extraProperties[e]:null},t.prototype.getProperties=function(){return S.clone(this.extraProperties)},t.prototype.getMode=function(){return this.mode},t.prototype.getLineCount=function(){return this.linesLength},t.prototype.getLineContent=function(e){return this.lines[e-1].text},t.prototype.getEOL=function(){return this.EOL},t.prototype.getLineMaxColumn=function(e){return this.lines[e-1].text.length+1},t.prototype.getLineFirstNonWhitespaceColumn=function(e){var t=L.firstNonWhitespaceIndex(this.lines[e-1].text);return-1===t?0:t+1},t.prototype.getLineLastNonWhitespaceColumn=function(e){var t=L.lastNonWhitespaceIndex(this.lines[e-1].text);return-1===t?0:t+2},t.prototype.lineIsTokenized=function(e){return this.invalidLineStartIndex>e-1},t.prototype.getLineTokens=function(e,t){return"undefined"==typeof t&&(t=!1),t||this._updateTokensUntilLine(e,!0),this.lines[e-1].getLineTokens()},t.prototype.getInternalTokens=function(e){return this._updateTokensUntilLine(e,!0),this.lines[e-1].getTokens().slice(0)},t.prototype.getRawLineTokens=function(e){return this._updateTokensUntilLine(e,!0),{tokens:this.lines[e-1].getTokens().slice(0),modeTransitions:this.lines[e-1].modeTransitions.slice(0),endState:e0){var a={ids:s,addedOrChangedDecorations:r,removedDecorations:o,oldOptions:e.oldDecorationOptions,oldRanges:e.oldDecorationRange};this.emitModelDecorationsChangedEvent(a)}},t.prototype._executeWithDeferredEvents=function(e){var t=this;return this.deferredEmit(function(){0===t._executeWithDeferredEventsCnt&&(t._currentDeferredEventBuilder=new G),t._executeWithDeferredEventsCnt=t._executeWithDeferredEventsCnt+1;var n=e(t._currentDeferredEventBuilder);return t._executeWithDeferredEventsCnt=t._executeWithDeferredEventsCnt-1,0===t._executeWithDeferredEventsCnt&&(t._emitEventsFromEventBuilder(t._currentDeferredEventBuilder),t._currentDeferredEventBuilder=null),n})},t.prototype.change=function(e){var t=this;return this._executeWithDeferredEvents(function(n){var i={},r={insertText:function(e,n,r){return"undefined"==typeof r&&(r=!1),t._insertText(i,e,n,r)},deleteText:function(e){return t._deleteText(i,e)}},o=e(r);r.insertText=null,r.deleteText=null;var s=t.trackedRanges.onChangedMarkers(i);return t.modelDecorations.onChangedRanges(n,s),o})},t.prototype.addTrackedRange=function(e){return this.trackedRanges.add(e)},t.prototype.changeTrackedRange=function(e,t){this.trackedRanges.change(e,t)},t.prototype.removeTrackedRange=function(e){this.trackedRanges.remove(e)},t.prototype.getTrackedRange=function(e){return this.trackedRanges.getRange(e)},t.prototype.changeDecorations=function(e,t){"undefined"==typeof t&&(t=0);var n=this;return this._executeWithDeferredEvents(function(i){return n.modelDecorations.change(i,t,e)})},t.prototype.deltaDecorations=function(e,t,n){"undefined"==typeof n&&(n=0);var i=this;return this._executeWithDeferredEvents(function(r){return i.modelDecorations.change(r,n,function(n){return n.deltaDecorations(e,t)})})},t.prototype.removeAllDecorationsWithOwnerId=function(e){this.modelDecorations.removeAllDecorationsWithOwnerId(e)},t.prototype.getDecorationOptions=function(e){return this.modelDecorations.getOptions(e)},t.prototype.getDecorationRange=function(e){return this.modelDecorations.getRange(e)},t.prototype.getLineDecorations=function(e,t,n){return"undefined"==typeof t&&(t=0),"undefined"==typeof n&&(n=!1),this.getLinesDecorations(e,e,t,n)},t.prototype.getLinesDecorations=function(e,t,n,i){"undefined"==typeof n&&(n=0),"undefined"==typeof i&&(i=!1);var r=this.modelDecorations.getLinesDecorations(e,t,n);return i?this._filterOutValidationDecorations(r):r},t.prototype.getDecorationsInRange=function(e,t,n){this.validateRange(e);var i=this.modelDecorations.getLinesDecorations(e.startLineNumber,e.endLineNumber,t);return n?this._filterOutValidationDecorations(i):i},t.prototype._filterOutValidationDecorations=function(e){var t,n,i,r=[];for(t=0,n=e.length;n>t;t++)i=e[t].options.className,i!==N.ClassName.EditorErrorDecoration&&i!==N.ClassName.EditorWarningDecoration&&r.push(e[t]);return r},t.prototype.getAllDecorations=function(e,t){"undefined"==typeof e&&(e=0),"undefined"==typeof t&&(t=!1);var n=this.modelDecorations.getAll(e);return t?this._filterOutValidationDecorations(n):n},t.prototype._constructLines=function(e){var n=t.splitText(e);return this.BOM=n.BOM,this.EOL=n.EOL,n.lines},t.splitText=function(e){var t=0,n="";e.length>0&&e.charCodeAt(0)===B&&(n=e.charAt(0),t=1);var i,r,o,s,a=-1,u=0,l=0,h=[];for(l=t,i=t,o=e.length;o>i;i++)r=e.charCodeAt(i),r===q&&(a===z?(u++,s=e.substring(l,i-1)):s=e.substring(l,i),l=i+1,h.push(new j(s))),a=r;h.push(new j(e.substring(l)));var d=h.length-1,c="";return c=0===d||u>d/2?"\r\n":"\n",{BOM:n,EOL:c,lines:h}},t.prototype.massageWordDefinitionOf=function(e){var t=P.NullMode.DEFAULT_WORD_REGEXP;if(e.tokenTypeClassificationSupport){try{t=e.tokenTypeClassificationSupport.getWordDefinition()}catch(n){H.onUnexpectedError(n)}if(t instanceof RegExp){if(!t.global){var i="g";t.ignoreCase&&(i+="i"),t.multiline&&(i+="m"),t=new RegExp(t.source,i)}}else t=P.NullMode.DEFAULT_WORD_REGEXP}return t.lastIndex=0,t},t.prototype.getSyntaxTokensHashMap=function(){var e={},t=[];try{t=this.mode.tokenTypeClassificationSupport.getNonWordTokenTypes()}catch(n){H.onUnexpectedError(n)}for(var i=0,r=t.length;r>i;i++)e[t[i]]=!0;return e},t.prototype._iterateWords=function(e,t,n){var i=this.getLineContent(e);this.getStateBeforeLine(e);var r,o,s,a,u,l=this.getInternalTokens(e),h=this.getLineModeTransitions(e),d={};if(t&&this.mode.tokenTypeClassificationSupport&&(d=this.getSyntaxTokensHashMap()),0!==i.length){var c=0,p=c+1r;r++){if(u=r===s-1?i.length:l[r+1].startIndex,o>=p&&(c++,p=c+10){m=g.indexOf(C,y),y=m+C.length;var _=n({start:o+m,end:o+y},i);if(_)return _}}}o=u}}},t.prototype.getWordAtText=function(e,t,n,i){var r,o,s,a,u,l,h=i.match(t)||[];for(r=0;r0&&(o=i.indexOf(l,s),s=o+l.length,a=n+o+1,u=n+s+1,a<=e.column&&e.column<=u))return{word:l,startColumn:a,endColumn:u};return null},t.prototype.getWordAtTokens=function(e,t){var n,i,r,o,s,a=this.getInternalTokens(e.lineNumber),u=this.getLineContent(e.lineNumber);for(n=0,i=t.length;i>n;n++){r=t[n],s=a[r].startIndex,o=r0){var o=V.findIndexInSegmentsArray(r,e.column-1),s=null;t?(s=this.getSyntaxTokensHashMap(),s.hasOwnProperty(r[o].type)||i.push(o)):i.push(o),o>0&&r[o].startIndex===e.column-1&&(t?s.hasOwnProperty(r[o-1].type)||i.push(o-1):i.push(o-1))}return 0===i.length?null:this.getWordAtTokens(e,i)},t.prototype.getWordsInText=function(e,t){var n,i,r,o,s,a,u=e.match(t)||[],l=[];for(n=0;n0&&(i=e.indexOf(a,r),r=i+a.length,o=i,s=r,l.push({start:o,end:s}));return l},t.prototype.getWords=function(e,t,n){if("undefined"==typeof n&&(n=!1),n&&!this.lineIsTokenized(e))return this.getWordsInText(this.lines[e-1].text,this.massageWordDefinitionOf(this.mode));var i=[];return this._iterateWords(e,t,function(e){i.push(e)}),i},t.prototype.findMatches=function(e,t,n,i,r){if(""===e)return[];var o=null;try{o=L.createRegExp(e,n,i,r)}catch(s){return[]}if(L.regExpLeadsToEndlessLoop(o))return[];var a;return a=t?this.getEditableRange():this.getFullModelRange(),this.doFindMatches(a,o)},t.prototype.doFindMatches=function(e,t){var n,i=[],r=0;if(e.startLineNumber===e.endLineNumber)return n=this.lines[e.startLineNumber-1].text.substring(e.startColumn-1,e.endColumn-1),r=this.findMatchesInLine(t,n,e.startLineNumber,e.startColumn-1,r,i),i;n=this.lines[e.startLineNumber-1].text.substring(e.startColumn-1),r=this.findMatchesInLine(t,n,e.startLineNumber,e.startColumn-1,r,i);for(var o=e.startLineNumber+1;o=r;o++)r=this.findMatchesInLine(t,this.lines[o-1].text,o,0,r,i);return F>=r&&(n=this.lines[e.endLineNumber-1].text.substring(0,e.endColumn-1),r=this.findMatchesInLine(t,n,e.endLineNumber,0,r,i)),i},t.prototype.findMatchesInLine=function(e,t,n,i,r,o){var s;do if(s=e.exec(t),s&&(o.push(new x.Range(n,s.index+1+i,n,s.index+1+s[0].length+i)),r++,r>F))return r;while(s);return r},t.prototype._addMarker=function(e,t,n){var i=this.validatePosition(new k.Position(e+1,t)),r={id:(++this.lastMarkerId).toString(),column:i.column,type:n};return this.lines[i.lineNumber-1].markers.push(r),this.markerIdToLineIndex[r.id]=i.lineNumber-1,r.id},t.prototype.__findMarkerInMarkersArray=function(e,t){for(var n=0;n=0){var s=r[o],a=this.validatePosition(new k.Position(t+1,n));a.lineNumber-1!==i&&(r.splice(o,1),this.lines[a.lineNumber-1].markers.push(s),this.markerIdToLineIndex[s.id]=a.lineNumber-1),s.column=a.column}}},t.prototype._getMarker=function(e){if(this.markerIdToLineIndex.hasOwnProperty(e)){var t=this.markerIdToLineIndex[e],n=this.lines[t].markers,i=this.__findMarkerInMarkersArray(n,e);if(i>=0)return{lineNumber:t+1,column:n[i].column}}return null},t.prototype._getMarkerLineNumber=function(e){return this.markerIdToLineIndex.hasOwnProperty(e)?this.markerIdToLineIndex[e]+1:-1},t.prototype._getMarkerColumn=function(e,t){var n=this.lines[e-1].markers,i=this.__findMarkerInMarkersArray(n,t);return n[i].column},t.prototype._getLineMarkers=function(e){return this.lines[e-1].markers.slice(0)},t.prototype._removeMarker=function(e){if(this.markerIdToLineIndex.hasOwnProperty(e)){var t=this.markerIdToLineIndex[e],n=this.lines[t].markers,i=this.__findMarkerInMarkersArray(n,e);i>=0&&n.splice(i,1),delete this.markerIdToLineIndex[e]}},t.prototype.validatePosition=function(e){var t=e.lineNumber?e.lineNumber:1,n=e.column?e.column:1;1>t&&(t=1),t>this.linesLength&&(t=this.linesLength),1>n&&(n=1);var i=this.getLineMaxColumn(t);return n>i&&(n=i),new k.Position(t,n)},t.prototype.validateRange=function(e){var t=this.validatePosition(new k.Position(e.startLineNumber,e.startColumn)),n=this.validatePosition(new k.Position(e.endLineNumber,e.endColumn));return new x.Range(t.lineNumber,t.column,n.lineNumber,n.column)},t.prototype._sign=function(e){return 0>e?-1:e>0?1:0},t.prototype._findMatchingBracketUp=function(e,t,n,i){var r,o,s,a,u=i;for(r=t;r>=0;r--){o=this.lines[r];var l=o.getTokens();for(a=(r===t?n:l.length)-1;a>=0;a--)if(l[a].type===e&&(u+=this._sign(l[a].bracket),0===u))return s=a===l.length-1?o.text.length:l[a+1].startIndex,new x.Range(r+1,l[a].startIndex+1,r+1,s+1)}return null},t.prototype._findMatchingBracketDown=function(e,t,n,i){var r,o,s,a,u,l,h=1;for(r=t,s=this.linesLength;s>r;r++){if(i&&!this.lineIsTokenized(r+1))return{range:null,isAccurate:!1};this._updateTokensUntilLine(r+1,!0),o=this.lines[r];var d=o.getTokens();for(u=r===t?n+1:0,l=d.length;l>u;u++)if(d[u].type===e&&(h+=this._sign(d[u].bracket),0===h))return a=u===d.length-1?o.text.length:d[u+1].startIndex,{range:new x.Range(r+1,d[u].startIndex+1,r+1,a+1),isAccurate:!0} }return{range:null,isAccurate:!0}},t.prototype.tokenIterator=function(e,t){var n=new D.TokenIterator(this,this.validatePosition(e)),i=t(n);return n._invalidate(),i},t.prototype.findMatchingBracketUp=function(e,t){this._updateTokensUntilLine(t.lineNumber,!0);var n,i,r,o,s=this.lines[t.lineNumber-1],a=t.column-1,u=-1,l=s.getTokens();for(n=0,i=l.length;-1===u&&i>n;n++)r=l[n],o=n===i-1?s.text.length:l[n+1].startIndex,r.startIndex<=a&&o>=a&&(u=n);return this._findMatchingBracketUp(e,t.lineNumber-1,u+1,0)},t.prototype.matchBracket=function(e,t){if("undefined"==typeof t&&(t=!1),t&&!this.lineIsTokenized(e.lineNumber))return{brackets:null,isAccurate:!1};this._updateTokensUntilLine(e.lineNumber,!0);var n,i,r=this.lines[e.lineNumber-1],o={brackets:null,isAccurate:!0};if(r.text.length>0){var s,a,u=e.column-1,l=r.getTokens();for(n=0,i=l.length;null===o.brackets&&i>n;n++)if(s=l[n],a=n===i-1?r.text.length:l[n+1].startIndex,s.startIndex<=u&&a>=u){if(s.bracket<0){var h=this._findMatchingBracketUp(s.type,e.lineNumber-1,n,-1);h&&(o.brackets=[new x.Range(e.lineNumber,s.startIndex+1,e.lineNumber,a+1),h])}if(null===o.brackets&&s.bracket>0){var d=this._findMatchingBracketDown(s.type,e.lineNumber-1,n,t);o.isAccurate=d.isAccurate,d.range&&(o.brackets=[new x.Range(e.lineNumber,s.startIndex+1,e.lineNumber,a+1),d.range])}}}return o},t.prototype._revalidateTokensNow=function(){this.revalidateTokensTimeout=-1;for(var e,t=50,n=this.invalidLineStartIndex+1,i=Math.min(this.linesLength,this.invalidLineStartIndex+1e6),r=0,o=0,s=0,a=this.stopLineTokenizationAfter,u=(new Date).getTime(),l=n;i>=l;l++){if(e=(new Date).getTime()-u,e>t){i=l-1;break}if(o=this.lines[l-1].text.length,-1!==a&&o>a&&(o=a),r>0&&(s=e/r*o,e+s>t)){i=l-1;break}this._updateTokensUntilLine(l,!1),r+=o}i>=n&&this.emitModelTokensChangedEvent(n,i),this.invalidLineStartIndex=l;l++){var h=l+1,d=null,c=this.lines[l].text;if(this.mode.tokenizationSupport){var p=-1;-1!==s&&(p=(new Date).getTime()+s);try{d=this.mode.tokenizationSupport.tokenize(this.lines[l].text,this.lines[l].state,0,o,p)}catch(f){H.onUnexpectedError(f,t.MODE_TOKENIZATION_FAILED_MSG),this.onModeTokenizationFailed()}d&&d.actualStopOffseth)if(null!==this.lines[h].state&&d.endState.equals(this.lines[h].state)){for(var m=l+1;i>m&&!this.lines[m].isInvalid;){if(i>m+1){if(null===this.lines[m+1].state)break}else if(null===this.lastState)break;m++}this.invalidLineStartIndex=Math.max(this.invalidLineStartIndex,m),l=m-1}else this.lines[h].state=d.endState;else this.lastState=d.endState}n&&u>=a&&this.emitModelTokensChangedEvent(a,u),this.invalidLineStartIndex=Math.max(this.invalidLineStartIndex,r+1)},t.prototype._changeLine=function(e,t){this.lines[e].text=t,this._invalidateLine(e),this._versionId++,this.emitModelContentChangedLineChangedEvent(e+1)},t.prototype._invalidateLine=function(e){this.lines[e].isInvalid=!0,en?!0:t===n?i||"end"===e:!1},t.prototype._insertTextOneLine=function(e,t,n,i){var r=t.lineNumber-1,o=t.column,s=this.lines[r],a=s.text;this._changeLine(r,a.substring(0,o-1)+n+a.substring(o-1,a.length));for(var u,l=new k.Position(r+1,o+n.length),h=0,d=s.markers.length;d>h;h++)u=s.markers[h],this._shouldMoveMarkerOnTextInsert(u.type,u.column,o,i)&&(this._beforeMarkerChange(u,e),u.column+=n.length);return l},t.prototype._insertTextMultiline=function(e,t,n,i){var r,o,s=t.lineNumber-1,a=t.column,u=this.lines[s].text,l=u.substring(a-1,u.length);this._changeLine(s,u.substring(0,a-1)+n[0]);var h="";for(r=1,o=n.length-1;o>r;r++)h+=n[r]+"\n",this.lines.splice(s+r,0,new j(n[r]));var d=s+n.length-1,c=n[n.length-1],p=c+l,f=[];this.lines.splice(d,0,new j(p,f)),this.linesLength=this.lines.length;var m,g=this.lines[s].markers;for(r=0;rv;v++)m=C[v],this._beforeMarkerChange(m,e),this.markerIdToLineIndex[m.id]=r;return n.length>1&&(this._versionId++,this.emitModelContentChangedLinesInsertedEvent(s+2,d+1,h+p)),new k.Position(d+1,1+c.length)},t.prototype._insertText=function(e,t,n,i){var r=this.validatePosition(t);if(0===n.length)return r;for(var o=n.split("\n"),s=0,a=o.length;a>s;s++)"\r"===o[s].charAt(o[s].length-1)&&(o[s]=o[s].substring(0,o[s].length-1));return 1===o.length?this._insertTextOneLine(e,r,o[0],i):this._insertTextMultiline(e,r,o,i)},t.prototype._deleteTextOneLine=function(e,t){var n=t.startLineNumber-1,i=this.lines[n],r=this.lines[n].text,o=r.substring(t.startColumn-1,t.endColumn-1);this._changeLine(n,r.substring(0,t.startColumn-1)+r.substring(t.endColumn-1,r.length));for(var s,a=0,u=i.markers.length;u>a;a++)s=i.markers[a],s.column>=t.endColumn?(this._beforeMarkerChange(s,e),s.column-=t.endColumn-t.startColumn):s.column>=t.startColumn&&(this._beforeMarkerChange(s,e),s.column=t.startColumn);return{position:new k.Position(t.startLineNumber,t.startColumn),deletedText:o}},t.prototype._deleteTextMultiline=function(e,t){var n=t.startLineNumber-1,i=t.endLineNumber-1,r=this.lines[i],o=r.text,s=o.substring(t.endColumn-1,o.length),a=this.lines[n],u=a.text;this._changeLine(n,u.substring(0,t.startColumn-1)+s);var l,h,d=u.substring(t.startColumn-1,u.length);for(l=n+1;i>l;l++)d+="\n"+this.lines[l].text;d+="\n"+o.substring(0,t.endColumn-1);var c=i-n,p=this.lines.splice(n+1,c);this.linesLength=this.lines.length;var f;for(l=0,h=a.markers.length;h>l;l++)f=a.markers[l],f.column>t.startColumn&&(this._beforeMarkerChange(f,e),f.column=t.startColumn);for(l=0;l=t.endColumn&&(this._beforeMarkerChange(f,e),r.markers.splice(l,1),a.markers.push(f),f.column-=t.endColumn-t.startColumn,this.markerIdToLineIndex[f.id]=n,l--);var m=[];for(l=0,h=p.length;h>l;l++)m=m.concat(p[l].markers);for(l=0,h=m.length;h>l;l++)f=m[l],this._beforeMarkerChange(f,e),f.column=t.startColumn,this.markerIdToLineIndex[f.id]=n;a.markers=a.markers.concat(m);var g,v,y;for(l=n+1;lg;g++)f=y[g],this._beforeMarkerChange(f,e),this.markerIdToLineIndex[f.id]=l;return this._versionId++,this.emitModelContentChangedLinesDeletedEvent(n+2,i+1),{position:new k.Position(t.startLineNumber,t.startColumn),deletedText:d}},t.prototype._deleteText=function(e,t){var n=this.validateRange(t);return n.isEmpty()?{position:new k.Position(n.startLineNumber,n.startColumn),deletedText:""}:n.startLineNumber===n.endLineNumber?this._deleteTextOneLine(e,n):this._deleteTextMultiline(e,n)},t.prototype._publishMarkerUpdate=function(e){var t=O.createMarkerUpdateFromJson(e);null!==this.markerService&&this.markerService.change(function(e){e.processMarkerUpdate(t)});for(var n=t.getId(),i=this.markerDecorationIds[n]||[],r=[],o=t.getMarkers(),s=0;s0&&null===i;)i=this.valueSetReplace(e.pop(),t,n);return i},e.prototype.valueSetReplace=function(e,t,n){var i=e.indexOf(t);return i>=0?(i+=n?1:-1,0>i?i=e.length-1:i%=e.length,e[i]):null},e.prototype.createLink=function(e,t,n,i){return{range:{startLineNumber:t,startColumn:n+1,endLineNumber:t,endColumn:i+1},url:e.substring(n,i)}},e.prototype.computeLinks=function(e){var t=this.resourceService.get(e),n=[],i=[],r=1,o=9,s=10;i[1]={h:2,H:2},i[2]={t:3,T:3},i[3]={t:4,T:4},i[4]={p:5,P:5},i[5]={s:6,S:6,":":7},i[6]={":":7},i[7]={"/":8},i[8]={"/":9};for(var a=1,u=t.getLineCount();u>=a;a++){for(var l=t.getLineContent(a),h=0,d=l.length,p=null,f=0,m=r;d>h;){var g=l.charAt(h),v=!1;m===s?(" "===g||" "===g||g===p)&&(n.push(this.createLink(l,a,f,h)),v=!0):m===o?" "===g||" "===g||g===p?v=!0:m=s:i[m].hasOwnProperty(g)?m=i[m][g]:v=!0,v&&(m=r,f=h+1,p="("===g?")":"["===g?"]":"<"===g?">":g),h++}m===s&&n.push(this.createLink(l,a,f,d))}return c.Promise.as(n)},e}();t.AbstractWorkerMode=C}),define("vs/editor/worker/editorWorkerServer",["require","exports","vs/base/lib/winjs.base","vs/base/types","vs/platform/services","vs/platform/injectorService","vs/platform/telemetry/telemetryService","./resourceService","./dispatcherService","vs/editor/worker/modesWorker"],function(e,t,n,i,r,o,s,a,u){"use strict";var l=n,h=i,d=r,c=o,p=s,f=a,m=u,g=function(){function t(){var e=this;this.dispatcherService=new m.DispatcherService,this.modePromise=new l.Promise(function(t){e.modeCompleteCallback=t})}return t.prototype.initialize=function(t,n,i,r,o){var s=this;try{var a={sendMessage:function(e,n){t.request(e,n)}},u=c.create({contextService:new d.BaseContextService(o.workspace,o.configuration,o.options),requestService:new d.BaseRequestService,resourceService:new f.WorkerResourceService,dispatcherService:this.dispatcherService,publisherService:a,telemetryService:new p.TelemetryService(!1)});e([o.languageModeModuleId],function(e){if(u.injectTo(e.value),"function"==typeof e.value.setExtraData&&e.value.setExtraData(o.extraData||null),"function"==typeof e.value.configure&&e.value.configure(o.configData||null).done(null,function(e){i(s._transformError(e))}),o.participants&&o.participants.length>0){for(var r=[],a=function(n){return function(i,r,o){s._loadWorkerParticipant(t,e.value,i,r,o,n)}},h=0;h0)return{type:""};if(e.advanceIfString("/*").length>0)return this.inComment=!0,this.tokenizeInComment(e);if(e.advanceIfString("'").length>0)return this.quote="'",this.tokenizeInString(e);if(e.advanceIfString('"').length>0)return this.quote='"',this.tokenizeInString(e);var t=e.next();if(this.kind===c.ValuePostUrl){if("("===t)return this.nextState(c.ValueInUrlFunction,{type:"delimiter.parenthesis.css",bracket:a.Bracket.Open});this.kind=c.Value}else if(this.kind===c.ValueInUrlFunction){if(")"!==t)return e.advanceIfRegExp(/^[^\)]*/),{type:"string.css"};this.kind=c.Value}switch(this.kind){case c.Selector:return"{"===t?this.nextState(c.Rule,{type:"delimiter.bracket.css",bracket:a.Bracket.Open}):"("===t||")"===t?{type:"delimiter.parenthesis.css",bracket:"("===t?a.Bracket.Open:a.Bracket.Close}:"@"!==t||this.inMeta?"}"===t&&this.inMeta?(this.inMeta=!1,this.nextState(c.Selector,{type:"delimiter.bracket.css",bracket:a.Bracket.Close})):/[\*\(\)\[\]\+>=\~\|;]/.test(t)?{type:"delimiter.css"}:"#"===t?(e.advanceIfRegExp(/^[\w\-]*/),{type:"tag.css"}):(e.advanceIfRegExp(/^[\w\-]*/),{type:"tag.css"}):(e.advanceIfRegExp(/^[\w\-]*/),this.nextState(c.Meta,{type:"keyword.css"}));case c.Meta:if("{"===t){var n=c.Rule;return this.inMeta&&(n=c.Selector),this.nextState(n,{type:"delimiter.bracket.css",bracket:a.Bracket.Open})}return"("===t||")"===t?{type:"delimiter.parenthesis.css",bracket:"("===t?a.Bracket.Open:a.Bracket.Close}:";"===t?(0===this.metaBraceCount&&(this.inMeta=!1),this.nextState(c.Selector,{type:"delimiter.css"})):/[\*\(\)\[\]\+>=\~\|]/.test(t)?{type:"delimiter.css"}:(this.inMeta=!0,e.advanceIfRegExp(/^[\w\-]*/),{type:"attribute.value.css"});case c.Rule:return"}"===t?this.nextState(c.Selector,{type:"delimiter.bracket.css",bracket:a.Bracket.Close}):":"===t?this.nextState(c.Value,{type:"delimiter.css"}):"("===t||")"===t?{type:"delimiter.parenthesis.css",bracket:"("===t?a.Bracket.Open:a.Bracket.Close}:(e.advanceIfRegExp(/^[\w\-]*/),{type:"attribute.name.css"});case c.Value:if("}"===t)return this.nextState(c.Selector,{type:"delimiter.bracket.css",bracket:a.Bracket.Close});if(";"===t)return this.nextState(c.Rule,{type:"delimiter.css"});if(("u"===t||"U"===t)&&e.advanceIfStringCaseInsensitive("rl").length>0)return this.nextState(c.ValuePostUrl,{type:"attribute.value.css"});if("("===t||")"===t)return{type:"delimiter.parenthesis.css",bracket:"("===t?a.Bracket.Open:a.Bracket.Close};if(","===t)return{type:"delimiter.css"};if("#"===t)return e.advanceIfRegExp(/^[\w]*/),{type:"attribute.value.hex.css"};if(/\d/.test(t)||/-|\+/.test(t)&&!e.eos()&&/\d/.test(e.peek()))return e.advanceIfRegExp(/^[\d\.]*/),this.nextState(c.Unit,{type:"attribute.value.number.css"});if("!"===t)return{type:"keyword.css"};if(("i"===t||"I"===t)&&e.advanceIfStringCaseInsensitive("mportant").length>0)return{type:"keyword.css"};if(e.advanceIfRegExp(/^[\w\-]*/).length>0)return{type:"attribute.value.css"};break;case c.Unit:return e.goBack(1),e.advanceIfRegExp(/^(em|ex|ch|rem|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)/).length>0?{type:"attribute.value.unit.css"}:(this.nextState(c.Value,null),this.tokenize(e))}return{type:""}},t}(u.AbstractState);t.State=d;var p=function(){function e(e){this.mode=e}return e.prototype.computeInfo=function(e,t){return this.mode.request("computeInfo",null,e,t)},e}(),f=function(e){function t(){e.call(this,"vs.languages.css","vs/languages/css/cssWorker"),this.extraInfoSupport=new p(this),this.outlineSupport=this}return __extends(t,e),t.prototype.getInitialState=function(){return new d(this,c.Selector,!1,null,!1,0)},t.prototype.getNonWordTokenTypes=function(){return["delimiter.css","delimiter.parenthesis.css","delimiter.bracket.css"]},t.prototype.getElectricCharacters=function(){return h.getElectricBrackets()},t.prototype.getAutoClosingPairs=function(){return[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},t.prototype.onEnterImpl=function(e,t,n){return h.onEnter(e,t,n)},t.prototype.onElectricCharacterImpl=function(e,t,n){return h.onElectricCharacter(e,t,n)},t.prototype.getTriggerCharacters=function(){return[]},t.prototype.getCommentsConfiguration=function(){return{blockCommentStartToken:"/*",blockCommentEndToken:"*/"}},t.prototype.getWordDefinition=function(){return/(#?-?\d*\.\d\w*%?)|(@?#?[\w-?]+%?)/g},t.prototype.getOutline=function(e){return this.request("getOutline",null,e)},t}(u.AbstractMode);t.CSSMode=f});define("vs/languages/css/css.nls",[],{});define("vs/languages/css/css.nls.keys",[],{});/*--------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define('vs/languages/css/cssWorker',["require","exports","vs/editor/worker/modesWorker"],function(e,t,n){"use strict";var r=n,i=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),t}(r.AbstractWorkerMode);t.value=new i});define('vs/languages/css/cssWorker.nls'],{});define('vs/languages/css/cssWorker.nls.keys'],{});/*--------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ define("vs/languages/css/monacoParticipant",["require","exports","./lib/cssLib","vs/platform/markers/markers","vs/editor/worker/modesWorker"],function(e,t,n,i,r){"use strict";var o=n,s=i,a=function(){function e(){}return e.ID="vs/languages/css/monacoParticipant",e.prototype.validate=function(t,n){n.changeMarkers(t.getAssociatedResource(),function(n){try{var i=o.CSSLint.newParser();i.addListener("startrule",function(t){var i=t.selectors;if(i&&i.length>0)for(var r=0;r",!1).length>0)return{type:"comment.html.content"};if(e.advanceIfString("-->").length>0)return this.kind=c.Content,{type:"comment.html",bracket:h.Close};break;case c.WithinDoctype:if(e.advanceUntil(">",!1).length>0)return{type:"meta.content.html"};if(e.advanceIfString(">").length>0)return this.kind=c.Content,{type:"meta.html",bracket:h.Close};break;case c.Content:if(e.advanceIfCharCode("<".charCodeAt(0)).length>0){if(!e.eos()&&"!"===e.peek()){if(e.advanceIfString("!--").length>0)return this.kind=c.WithinComment,{type:"comment.html",bracket:h.Open};if(e.advanceIfStringCaseInsensitive("!DOCTYPE").length>0)return this.kind=c.WithinDoctype,{type:"meta.html",bracket:h.Open}}return e.advanceIfCharCode("/".charCodeAt(0)).length>0?(this.kind=c.OpeningEndTag,{type:"delimiter.end.html",bracket:h.Open}):(this.kind=c.OpeningStartTag,{type:"delimiter.start.html",bracket:h.Open})}break;case c.OpeningEndTag:var n=this.nextName(e);return n.length>0?{type:t.escapeTagName(n),bracket:-1!==d.indexOf(n)?-1:h.Close}:e.advanceIfString(">").length>0?(this.kind=c.Content,{type:"delimiter.end.html",bracket:h.Close}):(e.advanceUntil(">",!1),{type:""});case c.OpeningStartTag:if(this.lastTagName=this.nextName(e),this.lastTagName.length>0)return this.lastAttributeName=null,("script"===this.lastTagName||"style"===this.lastTagName)&&(this.lastAttributeName=null,this.embeddedContentType=null),this.kind=c.WithinTag,{type:t.escapeTagName(this.lastTagName),bracket:-1!==d.indexOf(this.lastTagName)?-1:h.Open};break;case c.WithinTag:if(e.skipWhitespace().length>0)return{type:""};var i=this.nextName(e);return i.length>0?(this.lastAttributeName=i,this.kind=c.AttributeName,{type:"attribute.name.html"}):e.advanceIfString("/>").length>0||e.advanceIfCharCode(">".charCodeAt(0)).length>0?-1!==p.indexOf(this.lastTagName)?(this.kind=c.WithinEmbeddedContent,{type:"delimiter.start.html",bracket:h.Close}):(this.kind=c.Content,{type:"delimiter.start.html",bracket:h.Close}):(e.next(),{type:""});case c.AttributeName:return e.skipWhitespace().length>0||e.eos()?{type:""}:"="===e.peek()?(e.next(),this.kind=c.AttributeValue,{type:""}):(this.kind=c.WithinTag,this.tokenize(e));case c.AttributeValue:if(e.skipWhitespace().length>0||e.eos())return{type:""};if('"'!==this.attributeValueQuote&&"'"!==this.attributeValueQuote){var r=e.peek();return"'"===r||'"'===r?(this.attributeValueQuote=r,this.attributeValue=r,e.next(),{type:"attribute.value.html"}):(this.kind=c.WithinTag,this.tokenize(e))}if(this.attributeValue!==this.attributeValueQuote||"script"!==this.lastTagName&&"style"!==this.lastTagName||"type"!==this.lastAttributeName){var o=e.next();return o===this.attributeValueQuote?(this.kind=c.WithinTag,this.attributeValue="",this.attributeValueQuote=""):this.attributeValue+=o,{type:"attribute.value.html"}}if(this.attributeValue=e.advanceUntil(this.attributeValueQuote,!0),this.attributeValue.length>0)return this.embeddedContentType=this.unquote(this.attributeValue),this.kind=c.WithinTag,this.attributeValue="",this.attributeValueQuote="",{type:"attribute.value.html"}}return e.next(),this.kind=c.Content,{type:""}},t.prototype.unquote=function(e){var t=0,n=e.length;return'"'===e[0]&&t++,'"'===e[n-1]&&n--,e.substring(t,n)},t}(a.AbstractState);t.State=m;var g=function(e){function t(t,n){"undefined"==typeof t&&(t="vs.languages.html"),"undefined"==typeof n&&(n="vs/languages/html/htmlWorker"),e.call(this,t,n,!0)}return __extends(t,e),t.prototype.getInitialState=function(){return new m(this,c.Content,"","","","","")},t.prototype.getNonWordTokenTypes=function(){return["delimiter.html"]},t.prototype.getElectricCharacters=function(){var e={">":!0,"=":!0};this.collectElectricCharactersFromMode(e,v.getMode("text/javascript")),this.collectElectricCharactersFromMode(e,v.getMode("text/css"));var t,n=[];for(t in e)n.push(t);return n},t.prototype.collectElectricCharactersFromMode=function(e,t){if(t&&t.electricCharacterSupport){var n=t.electricCharacterSupport.getElectricCharacters();if(null!==n)for(var i=0;i"},{open:'"',close:'"'},{open:"'",close:"'"}]},t.prototype.enterNestedMode=function(e){return e instanceof m&&e.kind===c.WithinEmbeddedContent},t.prototype.getNestedMode=function(e){var t=null,n=e;if(null!==n.embeddedContentType&&(t=v.getMode(n.embeddedContentType)),null===t){var i=null;i="script"===n.lastTagName?"text/javascript":"style"===n.lastTagName?"text/css":"text/plain",t=v.getMode(i)}return t},t.prototype.getLeavingNestedModeData=function(e,t){var n=t.lastTagName,i=new RegExp("<\\/"+n+"\\s*>","i"),r=i.exec(e);return null!==r?{nestedModeBuffer:e.substring(0,r.index),bufferAfterNestedMode:e.substring(r.index),stateAfterNestedMode:new m(this,c.Content,"","","","","")}:null},t.prototype.splitLineIntoTokens=function(e,t,n,i){var r;r=i?function(e,t,n){return n>=e&&t>n}:function(e,t,n){return n>e&&t>=n};for(var o=null,s=[],a=0;a0&&(s.push(e.substring(t[a-1].startIndex,t[a].startIndex)),r(t[a-1].startIndex,t[a].startIndex,n)&&(o=a-1));return s.push(e.substring(t[a-1].startIndex)),o=null===o?s.length-1:o,{lineTokens:s,offsetTokenIndex:o}},t.prototype.onEnterImpl=function(e,t,n){if(""===e)return null;for(var i=this.splitLineIntoTokens(e,t,n,!1),r=i.offsetTokenIndex,o=i.lineTokens;r>0&&""===t[r].type;)r--;return 0>r||"delimiter.start.html"!==t[r].type?null:"/>"===o[r]?null:(r=i.offsetTokenIndex+1,r0&&""===s.type&&"attribute.name.html"===t[r-1].type)return r===t.length-1?{appendText:'""',advanceCount:1}:"attribute.value.html"!==t[r+1].type&&""!==t[r+1].type?{appendText:'""',advanceCount:1}:null;if(r>1&&"delimiter.end.html"!==s.type){var a=e.substring(s.startIndex,r===t.length-1?e.length:t[r+1].startIndex);if("delimiter.start.html"===s.type&&">"===a){var u;do u=s.startIndex,r--,s=t[r];while(r>=0&&0!==s.type.indexOf("tag.html.tag-"));return r>=0?{appendText:""}:null}return null}do r--;while(r>=0&&""===t[r].type);return 0>r||!f.test(t[r].type)?null:{matchBracketType:t[r].type}},t.prototype.getWordDefinition=function(){return/(-?\d*\.\d\w*)|(#?[\w-?]+%?)/g},t.prototype.getTriggerCharacters=function(){return["<","<"]},t.prototype.getCommentsConfiguration=function(){return{blockCommentStartToken:""}},t}(a.AbstractMode);t.HTMLMode=g;var v=l.Registry.as(a.Extensions.EditorModes)});define("vs/languages/html/html.nls",[],{});define("vs/languages/html/html.nls.keys",[],{});/*--------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define('vs/languages/html/htmlWorker',["require","exports","vs/editor/worker/modesWorker"],function(e,t,n){"use strict";var r=n,i=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),t}(r.AbstractWorkerMode);t.value=new i});define('vs/languages/html/htmlWorker.nls'],{});define('vs/languages/html/htmlWorker.nls.keys'],{});/*--------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define('vs/languages/javascript/javascript-worker',["require","exports","vs/editor/worker/modesWorker"],function(e,t,n){"use strict";var r=n,i=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),t}(r.AbstractWorkerMode);t.value=new i});define('vs/languages/javascript/javascript-worker.nls'],{});define('vs/languages/javascript/javascript-worker.nls.keys'],{});/*--------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/languages/vsxml/vsxml",["require","exports","vs/base/objects","vs/editor/modes/modes","vs/editor/modes/modesExtensions"],function(e,t,n,i,r){"use strict";var o=n,s=r,a='<>"=/',u=" ",l=o.createKeywordMatcher(["summary","reference","returns","param","loc"]),c=o.createKeywordMatcher(["type","path","name","locid","filename","format","optional"]),h=o.createKeywordMatcher(a.split("")),d=function(e){function t(t,n,i){e.call(this,t),this.state=n,this.parentState=i}return __extends(t,e),t.prototype.getParentState=function(){return this.parentState},t.prototype.makeClone=function(){return new t(this.getMode(),null===this.state?null:this.state.clone(),null===this.parentState?null:this.parentState.clone())},t.prototype.equals=function(n){if(!e.prototype.equals.call(this,n))return!1;if(!(n instanceof t))return!1;var i=n;return null===this.state&&null===i.state?!0:null===this.state||null===i.state?!1:null===this.parentState&&null===i.parentState?!0:null===this.parentState||null===i.parentState?!1:this.state.equals(i.state)&&this.parentState.equals(i.parentState)},t.prototype.setState=function(e){this.state=e},t.prototype.postTokenize=function(e){return e},t.prototype.tokenize=function(e){var t=this.state.tokenize(e);return void 0!==t.nextState&&this.setState(t.nextState),t.nextState=this,this.postTokenize(t,e)},t}(s.AbstractState);t.EmbeddedState=d;var p=function(e){function t(t,n,i){e.call(this,t,n,i)}return __extends(t,e),t.prototype.setState=function(t){e.prototype.setState.call(this,t),this.parentState.setVSXMLState(t)},t.prototype.postTokenize=function(e,t){return t.eos()&&(e.nextState=this.parentState),e},t}(d);t.VSXMLEmbeddedState=p;var f=function(e){function t(t,n,i){e.call(this,t),this.name=n,this.parent=i,this.whitespaceTokenType=""}return __extends(t,e),t.prototype.stateTokenize=function(){throw new Error("To be implemented")},t.prototype.equals=function(n){return e.prototype.equals.call(this,n)?n instanceof t&&this.getMode()===n.getMode()&&this.name===n.name&&(null===this.parent&&null===n.parent||null!==this.parent&&this.parent.equals(n.parent)):!1},t.prototype.tokenize=function(e){return e.setTokenRules(a,u),e.skipWhitespace().length>0?{type:this.whitespaceTokenType}:this.stateTokenize(e)},t}(s.AbstractState);t.VSXMLState=f;var m=function(e){function t(t,n){e.call(this,t,"string",n),this.parent=n,this.whitespaceTokenType="attribute.value.vs"}return __extends(t,e),t.prototype.makeClone=function(){return new t(this.getMode(),this.parent?this.parent.clone():null)},t.prototype.stateTokenize=function(e){for(;!e.eos();){var t=e.nextToken();if('"'===t)return{type:"attribute.value.vs",nextState:this.parent}}return{type:"attribute.value.vs",nextState:this.parent}},t}(f);t.VSXMLString=m;var g=function(e){function t(t,n){e.call(this,t,"expression",n),this.parent=n,this.whitespaceTokenType="vs"}return __extends(t,e),t.prototype.makeClone=function(){return new t(this.getMode(),this.parent?this.parent.clone():null)},t.prototype.stateTokenize=function(e){var t=e.nextToken(),n=this.whitespaceTokenType;return">"===t?{type:"delimiter.vs",nextState:this.parent}:'"'===t?{type:"attribute.value.vs",nextState:new m(this.getMode(),this)}:(l(t)?n="tag.vs":c(t)?n="attribute.name.vs":h(t)&&(n="delimiter.vs"),{type:n,nextState:this})},t}(f);t.VSXMLTag=g;var v=function(e){function t(t,n){e.call(this,t,"expression",n),this.parent=n,this.whitespaceTokenType="vs"}return __extends(t,e),t.prototype.makeClone=function(){return new t(this.getMode(),this.parent?this.parent.clone():null)},t.prototype.stateTokenize=function(e){var t=e.nextToken();return"<"===t?{type:"delimiter.vs",nextState:new g(this.getMode(),this)}:{type:this.whitespaceTokenType,nextState:this}},t}(f);t.VSXMLExpression=v}),define("vs/languages/javascript/jsdoc",["require","exports","vs/editor/modes/modes","vs/base/strings","vs/base/arrays"],function(e,t,n,i,r){"use strict";function o(e,t,n,i){if("*"!==e)return void 0;var r=t.indexOf("/*",Math.max(0,i-2)),o=t.indexOf("*/",i);return-1!==r&&-1===o}function s(e,t,n){var i,r,o=l.findIndexInSegmentsArray(t,n),s=t[o];return s?u.startsWith(s.type,"comment.doc")?(i=e.indexOf("/**"),r=e.indexOf("*/"),-1===i&&-1===r?{indentAction:a.IndentAction.None,appendText:"* "}:-1!==i&&n>=i+3&&-1!==r&&r>=n?{indentAction:a.IndentAction.IndentOutdent,appendText:" * ",indentOutdentAppendText:" "}:-1!==i&&n>=i+3?{indentAction:a.IndentAction.None,appendText:" * "}:null):null:null}var a=n,u=i,l=r;t.shouldCloseComment=o,t.onEnter=s});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/languages/javascript/javascript",["require","exports","vs/base/lib/winjs.base","vs/editor/modes/autoIndentation/autoIndentation","vs/base/objects","vs/editor/modes/modes","vs/editor/modes/modesExtensions","vs/base/env","vs/languages/vsxml/vsxml","./jsdoc","vs/base/arrays"],function(e,t,n,i,r,o,s,a,u,l,c){"use strict";var h=n,d=i,p=r,f=s,m=a,g=u,v=l,y=c,b="+-*%&|^~!=<>/?;:.,",_="+-*/%&|^~!=<>(){}[]\"'\\/?;:.,",w=" ",C=new d.Brackets([{tokenType:"delimiter.bracket.js",open:"{",close:"}",isElectric:!0},{tokenType:"delimiter.array.js",open:"[",close:"]",isElectric:!0},{tokenType:"delimiter.parenthesis.js",open:"(",close:")",isElectric:!0}]),k=p.createKeywordMatcher(["abstract","boolean","byte","catch","char","class","const","debugger","default","delete","double","enum","extends","false","final","finally","float","for","function","goto","implements","import","in","instanceof","int","interface","let","long","native","new","null","package","protected","short","static","super","synchronized","this","throws","transient","true","try","typeof","var","void","volatile","with"]),E=p.createKeywordMatcher(["if","else","switch","case","while","do","break","continue","throw","return"]),T=p.createKeywordMatcher(["export","public","private"]),S=function(e){return b.indexOf(e)>-1},x=function(e){function t(t,n,i){e.call(this,t),this.name=n,this.parent=i}return __extends(t,e),t.prototype.equals=function(n){if(!e.prototype.equals.call(this,n))return!1;var i=n;return n instanceof t&&this.getMode()===i.getMode()&&this.name===i.name&&(null===this.parent&&null===i.parent||null!==this.parent&&this.parent.equals(i.parent))},t.prototype.tokenize=function(e){return e.setTokenRules(_,w),e.skipWhitespace().length>0?{type:""}:this.stateTokenize(e)},t.prototype.stateTokenize=function(){throw new Error("To be implemented")},t}(f.AbstractState);t.JSState=x;var L=function(e){function t(t,n,i,r){e.call(this,t,"string",n),this.isAtBeginning=r,this.delimiter=i}return __extends(t,e),t.prototype.makeClone=function(){return new t(this.getMode(),this.parent?this.parent.clone():null,this.delimiter,this.isAtBeginning)},t.prototype.equals=function(t){return e.prototype.equals.call(this,t)&&this.delimiter===t.delimiter},t.prototype.tokenize=function(e){var t=this.isAtBeginning?1:0;for(this.isAtBeginning=!1;!e.eos();){var n=e.next();if("\\"===n)return 0===t?e.eos()?{type:"string.escape.js"}:(e.next(),e.eos()?{type:"string.escape.js",nextState:this.parent}:{type:"string.escape.js"}):(e.goBack(1),{type:"string.js"});if(n===this.delimiter)break;t+=1}return{type:"string.js",nextState:this.parent}},t}(x);t.JSString=L;var N=function(e){function t(t,n,i,r){e.call(this,t,"regexp",n),this.previous=i,this.previousTokenText=r}return __extends(t,e),t.prototype.makeClone=function(){return new t(this.getMode(),this.parent?this.parent.clone():null,this.previous,this.previousTokenText)},t.prototype._regexCanFollowPrevious=function(){switch(this.previous){case"":return!0;case"delimiter":return!0;case"bracket":return"({}[".indexOf(this.previousTokenText)>=0;case"keyword":return["new","delete","void","typeof","instanceof","in","do","return","case","throw"].indexOf(this.previousTokenText)>=0}return!1},t.prototype.tokenize=function(e){if(this._regexCanFollowPrevious()){for(var t,n=e.pos();!e.eos();){if(t=e.next(),"/"===t)return{type:"regexp.js",nextState:this.parent};"\\"!==t||e.eos()||"/"!==e.peek()?"\\"!==t||e.eos()||"\\"!==e.peek()||e.next():e.next()}e.goBack(e.pos()-n)}return{type:"delimiter.js",nextState:this.parent}},t}(x);t.JSRegExp=N;var M=function(e){function t(t,n,i){e.call(this,t,"number",n),this.firstDigit=i}return __extends(t,e),t.prototype.makeClone=function(){return new t(this.getMode(),this.parent?this.parent.clone():null,this.firstDigit)},t.prototype.tokenize=function(e){var t=this.firstDigit,n=10,i=!1,r=!1;if("0"===t&&!e.eos()){if(t=e.peek(),"x"===t.toLowerCase())n=16;else if("."===t)n=10;else{if(!f.isDigit(t,8))return{type:"number.js",nextState:this.parent};n=8}e.next()}for(;!e.eos();)if(t=e.peek(),f.isDigit(t,n))e.next();else if(10===n)if("."!==t||r||i){if("e"!==t||r)break;r=!0,e.next(),e.eos()||"-"!==e.peek()||e.next()}else i=!0,e.next();else{if(8!==n||!f.isDigit(t,10))break;n=10,e.next()}var o="number";return 16===n?o+=".hex":8===n&&(o+=".octal"),{type:o+".js",nextState:this.parent}},t}(x);t.JSNumber=M;var I=function(e){function t(t,n,i){e.call(this,t,"comment",n),this.tokenType=i}return __extends(t,e),t.prototype.equals=function(t){return e.prototype.equals.call(this,t)&&this.tokenType===t.tokenType},t.prototype.makeClone=function(){return new t(this.getMode(),this.parent?this.parent.clone():null,this.tokenType)},t.prototype.tokenize=function(e){for(;!e.eos();){var t=e.next();if("*"===t&&!e.eos()&&!e.peekWhitespace()&&"/"===e.peek())return e.next(),{type:this.tokenType,nextState:this.parent}}return{type:this.tokenType}},t}(x);t.JSComment=I;var R=function(e){function t(t,n,i,r){e.call(this,t,"expression",n),this.previous=i,this.previousTokenText=r}return __extends(t,e),t.prototype.equals=function(n){if(!e.prototype.equals.call(this,n))return!1;var i=n;return n instanceof t&&this.getMode()===i.getMode()&&this.previous===i.previous&&this.previousTokenText===i.previousTokenText},t.prototype.makeClone=function(){return new t(this.getMode(),this.parent?this.parent.clone():null,this.previous,this.previousTokenText)},t.prototype.stateTokenize=function(e){if(f.isDigit(e.peek(),10))return this.previous="number",{nextState:new M(this.getMode(),this,e.next())};var t=e.nextToken();if("/"===t)return e.advanceIfString("**/")?{type:"comment.js"}:e.advanceIfString("**")?{nextState:new I(this.getMode(),this,"comment.doc.js")}:e.advanceIfString("*")?{nextState:new I(this.getMode(),this,"comment.js")}:e.advanceIfString("/")?(e.advanceToEOS(),{type:"comment.js"}):{nextState:new N(this.getMode(),this,this.previous,this.previousTokenText)};if('"'===t||"'"===t)return this.previous="string",{nextState:new L(this.getMode(),this,t,!0)};if(C.characterIsBracket(t)){var n=C.bracketTypeFromChar(t);return this.previous="bracket",this.previousTokenText=t,{bracket:n,type:C.tokenTypeFromChar(t)}}return S(t)?(this.previous="delimiter",this.previousTokenText=t,{type:"delimiter.js"}):("delimiter"===this.previous&&","===this.previousTokenText||"bracket"===this.previous&&"{"===this.previousTokenText)&&!e.eos()&&":"===e.peekToken()?(this.previous="key",{type:"key.js"}):E(t)?(this.previous="keyword",this.previousTokenText=t,{type:"keyword.flow.js"}):T(t)?(this.previous="keyword",this.previousTokenText=t,{type:"keyword.visibility.js"}):k(t)?(this.previous="keyword",this.previousTokenText=t,{type:"keyword.js"}):(this.previous="identifier",{type:""})},t}(x);t.JSStatement=R;var O=function(){function e(e){this.mode=e}return e.prototype.findDeclaration=function(e,t){return this.mode.request("findDeclaration",null,e,t)},e.prototype.findReferences=function(e,t){return this.mode.request("findReferences",null,e,t)},e.prototype.getActionsAtPosition=function(e,t){return this.mode.request("getActionsAtPosition",null,e,t)},e.prototype.computeInfo=function(e,t){return this.mode.request("computeInfo",null,e,t)},e.prototype.getRangesToPosition=function(e,t){return this.mode.request("getRangesToPosition",null,e,t)},e.prototype.getParameterHints=function(e,t){return this.mode.request("getParameterHints",null,e,t)},e.prototype.getParameterHintsTriggerCharacters=function(){return["(",","]},e}(),A=function(e){function t(){var t=m.browser.isIE8,n=m.browser.isIE9;if(e.call(this,"vs.languages.javascript",t?"vs/languages/javascript/javascript-worker":n?"vs/languages/javascript/javascriptWorker2Monitored":"vs/languages/javascript/javascriptWorker2"),!t){var i=new O(this);this.inEditorActionsSupport=i,this.declarationSupport=i,this.referenceSupport=i,this.extraInfoSupport=i,this.logicalSelectionSupport=i,this.parameterHintsSupport=i}this.outlineSupport=this}return __extends(t,e),t.prototype.getInitialState=function(){return new R(this,null,"","")},t.prototype.getNonWordTokenTypes=function(){return["delimiter.js","delimiter.parenthesis.js","delimiter.bracket.js","delimiter.array.js","regexp.js"]},t.prototype.getElectricCharacters=function(){return C.getElectricBrackets()},t.prototype.getAutoClosingPairs=function(){return[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"*",close:"*/"},{open:"'",close:"'"}]},t.prototype.shouldAutoClosePairImpl=function(e,t,n,i){var r=v.shouldCloseComment(e,t,n,i);if("undefined"!=typeof r)return r;for(var o=null,s=0;si)break;o=a}return!o||"string.js"!==o.type},t.prototype.onEnterImpl=function(e,t,n){var i=v.onEnter(e,t,n);return i?i:C.onEnter(e,t,n)},t.prototype.onElectricCharacterImpl=function(e,t,n){return C.onElectricCharacter(e,t,n)},t.prototype.getCommentsConfiguration=function(){return{lineCommentTokens:["//"],blockCommentStartToken:"/*",blockCommentEndToken:"*/"}},t.prototype.configure=function(t){var n=this;return e.prototype.configure.call(this,t).then(function(){var e=[],t=n._models();return Object.keys(t).forEach(function(i){var r=t[i];e.push(n.validate(r.getAssociatedResource()))}),h.Promise.join(e)})},t.prototype.getTriggerCharacters=function(){return["."]},t.prototype.shouldAutotriggerSuggestImpl=function(e,t,n){if(0===t.length)return!1;var i=y.findIndexInSegmentsArray(t,n-1),r=t[i].type;return r.indexOf("string")>=0||r.indexOf("comment")>=0||r.indexOf("number")>=0?!1:!0},t.prototype.getOutline=function(e){return this.request("getOutline",null,e)},t}(f.AbstractMode);t.JSMode=A;var P=function(e){function t(t,n,i,r,o){e.call(this,t,i,r,o),this.vsState=n}return __extends(t,e),t.prototype.setVSXMLState=function(e){this.vsState=e},t.prototype.makeClone=function(){return new t(this.getMode(),null!==this.vsState?this.vsState.clone():null,this.parent?this.parent.clone():null,this.previous,this.previousTokenText)},t.prototype.equals=function(n){return e.prototype.equals.call(this,n)&&n instanceof t&&(null===this.vsState&&null===n.vsState||null!==this.vsState&&this.vsState.equals(n.vsState))},t.prototype.stateTokenize=function(t){return t.advanceIfString("///").length>0?t.eos()?{type:"comment.vs"}:"/"===t.peek()?(t.advanceToEOS(),{type:"comment.js"}):{type:"comment.vs",nextState:new g.VSXMLEmbeddedState(this.getMode(),this.vsState,this)}:e.prototype.stateTokenize.call(this,t)},t}(R);t.JSVSStatement=P;var D=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),t.prototype.getInitialState=function(){return new P(this,new g.VSXMLExpression(this,null),null,"","")},t}(A);t.JSVSMode=D});define("vs/languages/javascript/javascript.nls",[],{});define("vs/languages/javascript/javascript.nls.keys",[],{});/*--------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define('vs/languages/javascript/javascriptWorker2',["require","exports","vs/editor/worker/modesWorker"],function(e,t,n){"use strict";var r=n,i=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),t}(r.AbstractWorkerMode);t.value=new i});define('vs/languages/javascript/javascriptWorker2.nls'],{});define('vs/languages/javascript/javascriptWorker2.nls.keys'],{});/*--------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define('vs/languages/javascript/javascriptWorker2Monitored',["require","exports","vs/editor/worker/modesWorker"],function(e,t,n){"use strict";var r=n,i=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),t}(r.AbstractWorkerMode);t.value=new i});define('vs/languages/javascript/javascriptWorker2Monitored.nls'],{});define('vs/languages/javascript/javascriptWorker2Monitored.nls.keys'],{});/*--------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/languages/plaintext/plainTextWorker",["require","exports","vs/editor/worker/modesWorker"],function(e,t,n){"use strict";var r=n,i=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),t}(r.AbstractWorkerMode);t.PlainTextWorker=i,t.value=new i});define("vs/languages/plaintext/plainTextWorker.nls",[],{});define("vs/languages/plaintext/plainTextWorker.nls.keys",[],{});/*--------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/languages/vsxml/vsxml",["require","exports","vs/base/objects","vs/editor/modes/modes","vs/editor/modes/modesExtensions"],function(e,t,n,r,i){"use strict";var o=n,s=i,a='<>"=/',l=" ",c=o.createKeywordMatcher(["summary","reference","returns","param","loc"]),u=o.createKeywordMatcher(["type","path","name","locid","filename","format","optional"]),p=o.createKeywordMatcher(a.split("")),h=function(e){function t(t,n,r){e.call(this,t),this.state=n,this.parentState=r}return __extends(t,e),t.prototype.getParentState=function(){return this.parentState},t.prototype.makeClone=function(){return new t(this.getMode(),null===this.state?null:this.state.clone(),null===this.parentState?null:this.parentState.clone())},t.prototype.equals=function(n){if(!e.prototype.equals.call(this,n))return!1;if(!(n instanceof t))return!1;var r=n;return null===this.state&&null===r.state?!0:null===this.state||null===r.state?!1:null===this.parentState&&null===r.parentState?!0:null===this.parentState||null===r.parentState?!1:this.state.equals(r.state)&&this.parentState.equals(r.parentState)},t.prototype.setState=function(e){this.state=e},t.prototype.postTokenize=function(e){return e},t.prototype.tokenize=function(e){var t=this.state.tokenize(e);return void 0!==t.nextState&&this.setState(t.nextState),t.nextState=this,this.postTokenize(t,e)},t}(s.AbstractState);t.EmbeddedState=h;var d=function(e){function t(t,n,r){e.call(this,t,n,r)}return __extends(t,e),t.prototype.setState=function(t){e.prototype.setState.call(this,t),this.parentState.setVSXMLState(t)},t.prototype.postTokenize=function(e,t){return t.eos()&&(e.nextState=this.parentState),e},t}(h);t.VSXMLEmbeddedState=d;var f=function(e){function t(t,n,r){e.call(this,t),this.name=n,this.parent=r,this.whitespaceTokenType=""}return __extends(t,e),t.prototype.stateTokenize=function(){throw new Error("To be implemented")},t.prototype.equals=function(n){return e.prototype.equals.call(this,n)?n instanceof t&&this.getMode()===n.getMode()&&this.name===n.name&&(null===this.parent&&null===n.parent||null!==this.parent&&this.parent.equals(n.parent)):!1},t.prototype.tokenize=function(e){return e.setTokenRules(a,l),e.skipWhitespace().length>0?{type:this.whitespaceTokenType}:this.stateTokenize(e)},t}(s.AbstractState);t.VSXMLState=f;var m=function(e){function t(t,n){e.call(this,t,"string",n),this.parent=n,this.whitespaceTokenType="attribute.value.vs"}return __extends(t,e),t.prototype.makeClone=function(){return new t(this.getMode(),this.parent?this.parent.clone():null)},t.prototype.stateTokenize=function(e){for(;!e.eos();){var t=e.nextToken();if('"'===t)return{type:"attribute.value.vs",nextState:this.parent}}return{type:"attribute.value.vs",nextState:this.parent}},t}(f);t.VSXMLString=m;var g=function(e){function t(t,n){e.call(this,t,"expression",n),this.parent=n,this.whitespaceTokenType="vs"}return __extends(t,e),t.prototype.makeClone=function(){return new t(this.getMode(),this.parent?this.parent.clone():null)},t.prototype.stateTokenize=function(e){var t=e.nextToken(),n=this.whitespaceTokenType;return">"===t?{type:"delimiter.vs",nextState:this.parent}:'"'===t?{type:"attribute.value.vs",nextState:new m(this.getMode(),this)}:(c(t)?n="tag.vs":u(t)?n="attribute.name.vs":p(t)&&(n="delimiter.vs"),{type:n,nextState:this})},t}(f);t.VSXMLTag=g;var y=function(e){function t(t,n){e.call(this,t,"expression",n),this.parent=n,this.whitespaceTokenType="vs"}return __extends(t,e),t.prototype.makeClone=function(){return new t(this.getMode(),this.parent?this.parent.clone():null)},t.prototype.stateTokenize=function(e){var t=e.nextToken();return"<"===t?{type:"delimiter.vs",nextState:new g(this.getMode(),this)}:{type:this.whitespaceTokenType,nextState:this}},t}(f);t.VSXMLExpression=y}),define("vs/languages/javascript/jsdoc",["require","exports","vs/editor/modes/modes","vs/base/strings","vs/base/arrays"],function(e,t,n,r,i){"use strict";function o(e,t,n,r){if("*"!==e)return void 0;var i=t.indexOf("/*",Math.max(0,r-2)),o=t.indexOf("*/",r);return-1!==i&&-1===o}function s(e,t,n){var r,i,o=c.findIndexInSegmentsArray(t,n),s=t[o];return s?l.startsWith(s.type,"comment.doc")?(r=e.indexOf("/**"),i=e.indexOf("*/"),-1===r&&-1===i?{indentAction:a.IndentAction.None,appendText:"* "}:-1!==r&&n>=r+3&&-1!==i&&i>=n?{indentAction:a.IndentAction.IndentOutdent,appendText:" * ",indentOutdentAppendText:" "}:-1!==r&&n>=r+3?{indentAction:a.IndentAction.None,appendText:" * "}:null):null:null}var a=n,l=r,c=i;t.shouldCloseComment=o,t.onEnter=s});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/languages/typescript/typescript",["require","exports","vs/editor/modes/autoIndentation/autoIndentation","vs/editor/modes/modes","vs/editor/modes/modesExtensions","vs/languages/vsxml/vsxml","vs/languages/javascript/jsdoc","./lib/typescriptServices","vs/base/objects","vs/base/env","vs/base/arrays"],function(e,t,n,r,i,o,s,a,l,c,u){"use strict";var p=n,h=r,d=i,f=o,m=s,g=a,y=l,v=c,T=u,b=new p.Brackets([{tokenType:"delimiter.bracket.ts",open:"{",close:"}",isElectric:!0},{tokenType:"delimiter.array.ts",open:"[",close:"]",isElectric:!0},{tokenType:"delimiter.parenthesis.ts",open:"(",close:")",isElectric:!0}]),k=function(){function e(e,t){if(this.text=e,this.token=t,this.token.classification()===g.TypeScript.TokenClass.Comment){var n=this.token;if(n.isBlock){var r=n.value;this.commentType=r.length>=3&&"/"===r[0]&&"*"===r[1]&&"*"===r[2]?"comment.doc":"comment.block"}else this.commentType="comment.line"}else this.commentType=null}return e.prototype.equals=function(e){return null!==e&&this.text===e.text&&this.token.classification()===e.token.classification()},e.prototype.getCommentType=function(){return this.commentType},e.prototype.isComment=function(){return null!==this.commentType},e.prototype.setDocCommentType=function(e){"comment.doc"===e&&"comment.block"===this.commentType&&(this.commentType=e)},e.prototype.type=function(){switch(this.token.classification()){case g.TypeScript.TokenClass.Comment:return this.commentType;case g.TypeScript.TokenClass.StringLiteral:return"string";case g.TypeScript.TokenClass.NumberLiteral:return"number";case g.TypeScript.TokenClass.Punctuation:case g.TypeScript.TokenClass.Operator:return"delimiter";case g.TypeScript.TokenClass.RegExpLiteral:return"regexp";case g.TypeScript.TokenClass.Keyword:switch(this.token.tokenId){case g.TypeScript.TokenID.If:case g.TypeScript.TokenID.Else:case g.TypeScript.TokenID.Switch:case g.TypeScript.TokenID.Case:case g.TypeScript.TokenID.While:case g.TypeScript.TokenID.Do:case g.TypeScript.TokenID.Break:case g.TypeScript.TokenID.Continue:case g.TypeScript.TokenID.Return:case g.TypeScript.TokenID.Throw:return"keyword.flow";case g.TypeScript.TokenID.Export:case g.TypeScript.TokenID.Public:case g.TypeScript.TokenID.Private:return"keyword.visibility";case g.TypeScript.TokenID.Var:case g.TypeScript.TokenID.Class:case g.TypeScript.TokenID.Interface:case g.TypeScript.TokenID.Enum:case g.TypeScript.TokenID.Function:case g.TypeScript.TokenID.Module:case g.TypeScript.TokenID.Static:case g.TypeScript.TokenID.Import:return"keyword.declare";case g.TypeScript.TokenID.Bool:case g.TypeScript.TokenID.Number:case g.TypeScript.TokenID.String:case g.TypeScript.TokenID.Any:return"keyword.datatype";case g.TypeScript.TokenID.Null:return"keyword.null";default:return"keyword"}default:return""}},e}();t.Token=k;var S=function(e){function t(t,n,r,i,o,s){e.call(this,t),this.lineTokens=n,this.index=r,this.lexState=i,this.commentState=o,this.vsState=s,this.scanner=new g.TypeScript.Scanner}return __extends(t,e),t.prototype.setVSXMLState=function(e){this.vsState=e},t.prototype.makeClone=function(){return new t(this.getMode(),y.clone(this.lineTokens),this.index,y.clone(this.lexState),this.commentState,this.vsState.clone())},t.prototype.equals=function(n){return e.prototype.equals.call(this,n)&&n instanceof t&&this.getMode()===n.getMode()&&this.index===n.index&&this.lexState===n.lexState&&this.commentState===n.commentState&&y.equals(this.lineTokens,n.lineTokens)&&this.vsState.equals(n.vsState)},t.prototype.computeLineTokens=function(e){this.lineTokens=[],this.index=0;var t=e.advanceToEOS();e.goBack(t.length),this.scanner.lexState=this.lexState,this.scanner.setText(t,g.TypeScript.LexMode.Line);for(var n=this.scanner.pos,r=this.scanner.scanInLine();r&&r.tokenId!==g.TypeScript.TokenID.EndOfFile;){var i=new k(t.substring(n,this.scanner.pos),r);i.setDocCommentType(this.commentState),this.commentState=i.getCommentType(),this.lineTokens.push(i),n=this.scanner.pos,r=this.scanner.scanInLine()}this.lexState=this.scanner.lexState},t.prototype.tokenize=function(e){if(this.index===this.lineTokens.length){if(e.advanceIfRegExp(/^\s*\/\/\//).length>0){var t;if(e.eos())t={type:"comment.vs"};else{if("/"===e.peek())return e.advanceToEOS(),{type:"comment.ts"};t={type:"comment.vs",nextState:new f.VSXMLEmbeddedState(this.getMode(),this.vsState,this)}}return t}this.computeLineTokens(e)}var n="",r=h.Bracket.None;if(this.index=0||i.indexOf("comment")>=0||i.indexOf("number")>=0?!1:!0},t.prototype.findOccurrences=function(t,n,r){return"undefined"==typeof r&&(r=!1),e.prototype.findOccurrences.call(this,t,n,r,this.getFastWorker())},t.prototype.getOutline=function(e){return this.request("getOutline",this.getFastWorker(),e)},t.prototype.suggest=function(t,n){return e.prototype.suggest.call(this,t,n,this.getFastWorker())},t.prototype.getParameterHints=function(e,t){return this.request("getParameterHints",this.getFastWorker(),e,t)},t.prototype.navigateValueSet=function(t,n,r){return e.prototype.navigateValueSet.call(this,t,n,r,this.getFastWorker())},t.prototype.computeDiff=function(t,n){return e.prototype.computeDiff.call(this,t,n,this.getFastWorker())},t}(d.AbstractMode);t.TypeScriptMode=w});define("vs/languages/typescript/typescript.nls",[],{});define("vs/languages/typescript/typescript.nls.keys",[],{});/*--------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ define("vs/languages/typescript/service/textEdit",["require","exports","vs/base/strings"],function(e,t,n){"use strict";function r(e){return new s(e)}var i=n,o=function(){function e(e,t,n){this.offset=e,this.length=t,this.text=n||"",this.parent=null,this.children=[]}return e.prototype.isNoop=function(){return 0===this.length&&0===this.text.length},e.prototype.isDelete=function(){return this.length>0&&0===this.text.length},e.prototype.isInsert=function(){return 0===this.length&&this.text.length>0},e.prototype.isReplace=function(){return this.length>0&&this.text.length>0},e.prototype.getRightMostChild=function(){var e=this.children.length;return 0===e?this:this.children[e-1].getRightMostChild()},e.prototype.remove=function(){return this.parent?this.parent.removeChild(this):!1},e.prototype.addChild=function(e){e.parent=this;var t,n;for(t=0,n=this.children.length;n>t&&!(this.children[t].offset>e.offset);t++);this.children.splice(t,0,e)},e.prototype.removeChild=function(e){var t=this.children.indexOf(e);return-1===t?!1:(e.parent=null,this.children.splice(t,1),!0)},e.prototype.insert=function(e){if(this.enclosedBy(e))return e.insert(this),e;var t,n,r;for(t=0,n=this.children.length;n>t;t++)if(r=this.children[t],r.enclosedBy(e))this.removeChild(r),e.insert(r),n--,t--;else if(r.encloses(e))return r.insert(e),this;return this.addChild(e),this},e.prototype.enclosedBy=function(e){return e.encloses(this)},e.prototype.encloses=function(e){return this.offset>e.offset||e.offset>=this.offset+this.length?!1:e.offset+e.length>this.offset+this.length?!1:!0},e}();t.Edit=o;var s=function(){function e(e){this.model=e,this.modelVersion=e.getVersionId(),this.edit=new o(0,this.model.getValue().length,null)}return e.prototype.replace=function(e,t,n){"undefined"==typeof t&&(t=0),"undefined"==typeof n&&(n=null);var r=new o(e,t,n);r.isNoop()||(this.edit=this.edit.insert(r))},e.prototype.apply=function(){if(this.model.getVersionId()!==this.modelVersion)throw new Error("illegal state - model has been changed");for(var e,t=this.model.getValue();(e=this.edit.getRightMostChild())!==this.edit;)t=i.splice(t,e.offset,e.length,e.text),e.parent.length+=e.text.length-e.length,e.remove();return t},e}();t.create=r}),define("vs/languages/lib/javascriptSnippets",["require","exports","vs/nls!vs/languages/typescript/typescriptWorker2"],function(e,t,n){"use strict";var r=n;t.snippets=[{type:"snippet",label:"define",codeSnippet:["define(["," 'require',"," '{{require}}'","], function(require, {{factory}}) {"," 'use strict';"," {{}}","});"].join("\n"),documentationLabel:r.localize("vs_languages_lib_javascriptSnippets",0)},{type:"snippet",label:"for",codeSnippet:["for (var {{index}} = 0; {{index}} < {{array}}.length; {{index}}++) {"," var {{element}} = {{array}}[{{index}}];"," {{}}","}"].join("\n"),documentationLabel:r.localize("vs_languages_lib_javascriptSnippets",1)},{type:"snippet",label:"foreach",codeSnippet:["{{array}}.forEach(function({{element}}) {"," {{}}","}, this);"].join("\n"),documentationLabel:r.localize("vs_languages_lib_javascriptSnippets",2)},{type:"snippet",label:"forin",codeSnippet:["for (var {{key}} in {{object}}) {"," if ({{object}}.hasOwnProperty({{key}})) {"," var {{element}} = {{object}}[{{key}}];"," {{}}"," }","}"].join("\n"),documentationLabel:r.localize("vs_languages_lib_javascriptSnippets",3)},{type:"snippet",label:"function",codeSnippet:["function {{name}}({{params}}) {"," {{}}","}"].join("\n"),documentationLabel:r.localize("vs_languages_lib_javascriptSnippets",4)},{type:"snippet",label:"if",codeSnippet:["if ({{condition}}) {"," {{}}","}"].join("\n"),documentationLabel:r.localize("vs_languages_lib_javascriptSnippets",5)},{type:"snippet",label:"ifelse",codeSnippet:["if ({{condition}}) {"," {{}}","} else {"," ","}"].join("\n"),documentationLabel:r.localize("vs_languages_lib_javascriptSnippets",6)},{type:"snippet",label:"new",codeSnippet:["var {{name}} = new {{type}}({{arguments}});{{}}"].join("\n"),documentationLabel:r.localize("vs_languages_lib_javascriptSnippets",7)},{type:"snippet",label:"switch",codeSnippet:["switch ({{key}}) {"," case {{value}}:"," {{}}"," break;",""," default:"," break;","}"].join("\n"),documentationLabel:r.localize("vs_languages_lib_javascriptSnippets",8)},{type:"snippet",label:"while",codeSnippet:["while ({{condition}}) {"," {{}}","}"].join("\n"),documentationLabel:r.localize("vs_languages_lib_javascriptSnippets",9)},{type:"snippet",label:"dowhile",codeSnippet:["do {"," {{}}","} while ({{condition}});"].join("\n"),documentationLabel:r.localize("vs_languages_lib_javascriptSnippets",10)},{type:"snippet",label:"trycatch",codeSnippet:["try {"," {{}}","} catch ({{error}}) {"," ","}"].join("\n"),documentationLabel:r.localize("vs_languages_lib_javascriptSnippets",11)},{type:"snippet",label:"log",codeSnippet:["console.log({{message}});{{}}"].join("\n"),documentationLabel:r.localize("vs_languages_lib_javascriptSnippets",12)},{type:"snippet",label:"settimeout",codeSnippet:["setTimeout(function() {"," {{}}","}, {{timeout}});"].join("\n"),documentationLabel:r.localize("vs_languages_lib_javascriptSnippets",13)}]}),define("vs/languages/typescript/service/typescriptSnippets",["require","exports","vs/nls!vs/languages/typescript/typescriptWorker2"],function(e,t,n){"use strict";var r=n;t.snippets=[{type:"snippet",label:"foreach =>",codeSnippet:["{{array}}.forEach(({{element}}:{{type}}) => {"," {{}}","});"].join("\n"),documentationLabel:r.localize("vs_languages_typescript_service_typescriptSnippets",0)},{type:"snippet",label:"jsdoc comment",codeSnippet:["/**"," * {{}}"," */"].join("\n"),documentationLabel:r.localize("vs_languages_typescript_service_typescriptSnippets",1)},{type:"snippet",label:"ctor",codeSnippet:["/**"," *"," */","constructor() {"," super();"," {{}}","}"].join("\n"),documentationLabel:r.localize("vs_languages_typescript_service_typescriptSnippets",2)},{type:"snippet",label:"class",codeSnippet:["/**"," * {{name}}"," */","class {{name}} {"," constructor({{parameters}}) {"," {{}}"," }","}"].join("\n"),documentationLabel:r.localize("vs_languages_typescript_service_typescriptSnippets",3)},{type:"snippet",label:"public method",codeSnippet:["/**"," * {{name}}"," */","public {{name}}() {"," {{}}","}"].join("\n"),documentationLabel:r.localize("vs_languages_typescript_service_typescriptSnippets",4)},{type:"snippet",label:"private method",codeSnippet:["private {{name}}() {"," {{}}","}"].join("\n"),documentationLabel:r.localize("vs_languages_typescript_service_typescriptSnippets",5)}]}),define("vs/base/lifecycle",["require","exports"],function(e,t){"use strict";function n(e){for(var t=0,n=e.length;n>t;t++)e[t].dispose();return[]}function r(){for(var e=[],t=0;t0;)e.pop()()}t.disposeAll=n,t.combinedDispose=r,t.cAll=i});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/languages/typescript/resources/remoteModels",["require","exports","vs/base/network","vs/editor/core/model/mirrorModel"],function(e,t,n,r){"use strict";var i=n,o=r,s=function(e){function t(n,r,o){if("undefined"==typeof o&&(o=!1),e.call(this,n.toExternal(),o?-1:1,t.normalize(r),n),o){var s=n.toExternal();this.actualResource=new i.URL(s.substring(0,s.length-5)+".ts")}}return __extends(t,e),t.normalize=function(e){return e.replace(/\r\n/g,"\n")},t.prototype.isGenerated=function(){return!!this.actualResource},t.prototype.getActualResource=function(){return this.actualResource?this.actualResource:this.getAssociatedResource()},t}(o.MirrorModel);t.RemoteModel=s;var a=function(e){function t(t,n){e.call(this,t,n,!1)}return __extends(t,e),t}(s);t.DefaultLibModel=a;var l=function(e){function t(t,n){e.call(this,t.toExternal(),-1,n,t)}return __extends(t,e),t}(o.MirrorModel);t.AllReferences=l}),define("vs/languages/typescript/service/languageServiceAdapter",["require","exports","vs/base/lib/winjs.base","vs/base/network","vs/editor/modes/modes","vs/editor/core/model/mirrorModel","vs/languages/typescript/service/textEdit","vs/languages/typescript/lib/typescriptServices","vs/languages/typescript/resources/remoteModels","vs/languages/lib/javascriptSnippets","vs/languages/typescript/service/typescriptSnippets"],function(e,t,n,r,i,o,s,a,l,c,u){"use strict";var p=n,h=r,d=i,f=o,m=s,g=a,y=l,v=c,T=u,b=function(){function e(e,t){this.resourceService=t,this.setLanguageService(e),this.setSuggestConfiguration({})}return e.prototype.setLanguageService=function(e){this.languageService=e},e.prototype.getLanguageSerivce=function(){return this.languageService},e.prototype.setSuggestConfiguration=function(e){this.suggestConfiguration=e},e.prototype.getAllErrors=function(){var e=this;return this.languageService.getErrors(1e4).map(function(t){var n=e.getResourceFromIndex(t.unitIndex);return{message:t.message,range:e.rangeFromMinAndLim(t,n,!1),resource:n.getAssociatedResource()}})},e.prototype.format=function(e,t,n){var r=this.resourceService.get(e),i=r.getAssociatedResource().toExternal(),o=r.getOffsetFromPosition({lineNumber:t.startLineNumber,column:t.startColumn}),s=r.getOffsetFromPosition({lineNumber:t.endLineNumber,column:t.endColumn}),a=this.languageService.getFormattingEditsForRange(i,o,s,this.createFormatOptions(n)),l=this.applyTextEdits(a,r,o,s);return l.text},e.prototype.formatAfterKeystroke=function(e,t,n){var r=this.resourceService.get(e),i=r.getAssociatedResource().toExternal(),o=r.getOffsetFromPosition(t),s=r.getOffsetFromPosition({lineNumber:t.lineNumber,column:1}),a=r.getLineContent(t.lineNumber).length,l=r.getValueInRange({startColumn:t.column,endColumn:t.column+1,startLineNumber:t.lineNumber,endLineNumber:t.lineNumber}),c=this.languageService.getFormattingEditsAfterKeystroke(i,1+o,l,this.createFormatOptions(n)),u=this.applyTextEdits(c,r,s,s+a);return u},e.prototype.createFormatOptions=function(e){var t=new g.Services.FormatCodeOptions;return t.ConvertTabsToSpaces=e.insertSpaces,t.TabSize=e.tabSize,t.IndentSize=e.tabSize,t.InsertSpaceAfterCommaDelimiter=!0,t.InsertSpaceBeforeAndAfterBinaryOperators=!0,t.InsertSpaceAfterSemicolonInForStatements=!0,t},e.prototype.applyTextEdits=function(e,t,n,r){for(var i,o=m.create(t),s=0;s=0){var p=this.getResourceFromIndex(c.unitIndex,!1);p&&(u={resourceUrl:p.getAssociatedResource().toExternal(),range:this.rangeFromMinAndLim({minChar:c.location,limChar:c.location},p,!0),preview:this.preview(p,c.location,c.location)})}return u},e.prototype.findReferences=function(e,t){var n=this,r=this.resourceService.get(e),i=r.getOffsetFromPosition(t),o=r.getAssociatedResource().toExternal(),s=this.languageService.getReferencesAtPosition(o,i),a=s.filter(function(e){return!n.isBaseLibModel(n.getResourceFromIndex(e.unitIndex))}).map(function(e){var t=n.getResourceFromIndex(e.unitIndex),r={resourceUrl:t.getAssociatedResource().toExternal(),range:n.rangeFromMinAndLim(e.ast,t),preview:n.preview(t,e.ast.minChar,e.ast.limChar)};return r});return a},e.prototype.getTypeInformationAtPosition=function(e,t){var n=this.resourceService.get(e),r=n.getOffsetFromPosition(t),i=n.getAssociatedResource().toExternal(),o=this.languageService.getTypeAtPosition(i,r);if(!o)return null;var s=[];s.push({className:"type",text:o.memberName.toString()}),s.push({className:"documentation",text:o.docComment});var a={value:"",htmlContent:s,className:"typeInfo ts",range:this.rangeFromMinAndLim(o,n)};return a},e.prototype.getRangesToPosition=function(e,t){var n=this,r=this.resourceService.get(e),i=r.getOffsetFromPosition(t),o=r.getAssociatedResource().toExternal(),s=this.languageService.getScriptAST(o),a=this.languageService.getAstPathToPosition(s,i,g.TypeScript.GetAstPathOptions.Default),l=function(e){switch(e.nodeType){case g.TypeScript.NodeType.ModuleDeclaration:return"module";case g.TypeScript.NodeType.ClassDeclaration:return"class";case g.TypeScript.NodeType.InterfaceDeclaration:return"interface";case g.TypeScript.NodeType.FuncDecl:return e.isConstructor?"ctor":"function"}return""},c=a.asts.map(function(e){return{type:l(e),range:n.rangeFromMinAndLim(e,r)}});return c},e.prototype.suggest=function(e,t){var n=this,r=this.resourceService.get(e),i=e.toExternal(),o=r.getWordUntilPosition(t),s=r.getOffsetFromPosition(t),a=s-o.length,l="."===r.getValue().charAt(a-1),c=[],u=this.languageService.getCompletionsAtPosition(i,a,l);l=u.isMemberCompletion,u.entries.forEach(function(e){if("("!==e.type.charAt(0))return c.push({type:"field",label:e.name,documentationLabel:e.docComment,typeLabel:e.type,codeSnippet:e.name}),void 0;var t=n.parseMethodSignature(e.type);if(n.suggestConfiguration.useCodeSnippetsOnMethodSuggest){var r=t.arguments.map(function(e){return"{{"+e.name.trim()+"}}"}),i=e.name;i+=r.length>0?"("+r.join(", ")+"){{}}":"()",c.push({type:"function",label:e.name,documentationLabel:e.docComment,typeLabel:e.type,codeSnippet:i})}else c.push({type:"function",label:e.name,documentationLabel:e.docComment,typeLabel:e.type,codeSnippet:e.name})});var h=!l,d=this.suggestConfiguration.alwaysAllWords||0===u.entries.length;return p.Promise.as([]),d&&r.getAllUniqueWords(o).filter(function(e){return!/^-?\d*\.?\d/.test(e)}).forEach(function(e){var t={type:"text",label:e,codeSnippet:e};c.push(t)}),h&&(c.push.apply(c,v.snippets),c.push.apply(c,T.snippets)),c},e.prototype.quickFix=function(e,t){var n=this,r=this.resourceService.get(e),i=r.getAssociatedResource().toExternal(),o=r.getOffsetFromPosition(t),s=r.getWordUntilPosition(t),a=o-s.length,l="."===r.getValue().charAt(a-1),c=this.languageService.getCompletionsAtPosition(i,a,l),u=[];return c.entries.forEach(function(e){var t=n.calculateStringDifference(s,e.name);if(!(tt;t++)if(r=e.charAt(t),")"===r&&l--,"("===r&&l++,1!==l||":"!==r)if(1!==l||","!==r){if(0===l&&")"===r){""!==o&&i.push({name:o,type:s});break}a?o+=r:s+=r}else i.push({name:o,type:s}),o="",s="",a=!0;else a=!1;return{arguments:i,flatArguments:e.substr(0,t+1),flatReturnType:e.substr(t+5)}},e.prototype.getParameterHints=function(e,t){function n(e){return{name:e.name,type:e.type,isOptional:e.isOptional,documentation:e.docComment}}function r(e){return{parameters:e.parameters.map(function(e){return n(e)}),returnType:e.returnType,documentation:e.docComment}}var i=this.resourceService.get(e),o=i.getOffsetFromPosition(t),s=i.getAssociatedResource().toExternal(),a=this.languageService.getSignatureAtPosition(s,o);if(!a)return null;var l={currentSignature:a.activeFormal<0?0:a.activeFormal,currentParameter:a.actual.currentParameter<0?0:a.actual.currentParameter,signatures:a.formal.signatureGroup.map(function(e){return r(e)}),format:{typeFormat:d.TypesFormat.SUFFIX,typeSeparator:":"}};return l},e.prototype.isInternalSymbol=function(e,t){var n=this.resourceService.get(e),r=n.getOffsetFromPosition(t),i=this.languageService.getScriptAST(e.toExternal()),o=this.languageService.getSymbolAtPosition(i,r);if(!o)return!1;var s=0!==(o.flags&g.TypeScript.SymbolFlags.Public),a=0!==(o.flags&g.TypeScript.SymbolFlags.Exported);return!(s||a)},e.prototype.getAsDeclareFile=function(e){var t=this.languageService.host.getCompilationSettings(),n=t.generateDeclarationFiles;t.generateDeclarationFiles=!0;try{var r=e.toExternal(),i=this.languageService.getEmitOutput(r);return 2!==i.length?null:i[1].text}finally{t.generateDeclarationFiles=n}},e.prototype.getResourceFromIndex=function(e,t){"undefined"==typeof t&&(t=!0);var n,r;if(t)n=new h.URL(this.languageService.host.getScriptId(e)),r=this.resourceService.get(n);else{var i=this.languageService.compilerState;n=new h.URL(i.getScript(e).locationInfo.filename),r=this.resourceService.get(n)}return r instanceof f.MirrorModel?r:null},e.prototype.isBaseLibModel=function(e){return e instanceof y.DefaultLibModel},e.prototype.rangeFromMinAndLim=function(e,t,n){"undefined"==typeof n&&(n=!1);var r=e.minChar,i=e.limChar-e.minChar;i=Math.max(1,i);var o={};return o.startLineNumber=t.getLineNumberFromOffset(r),o.startColumn=1+r-t.getLineStart(o.startLineNumber),n?(o.endLineNumber=o.startLineNumber,o.endColumn=o.startColumn):(o.endLineNumber=t.getLineNumberFromOffset(r+i),o.endColumn=1+r+i-t.getLineStart(o.endLineNumber)),o},e.prototype.preview=function(e,t,n,r){"undefined"==typeof r&&(r=200);for(var i=n-t,o=this.languageService.getScriptAST(e.getAssociatedResource().toExternal()),s=this.languageService.getAstPathToPosition(o,t,g.TypeScript.GetAstPathOptions.Default),a=null,l=s.asts.length-1;null===a&&l>=0;l--){var c=s.asts[l];c.limChar-c.minChar>r&&(a=c)}null===a&&(a=o);var u=e.getOffsetFromPosition({lineNumber:e.getLineNumberFromOffset(a.minChar),column:1}),p=e.getOffsetFromPosition({lineNumber:e.getLineNumberFromOffset(a.limChar),column:e.getLineMaxColumn(e.getLineNumberFromOffset(a.limChar))}),h=e.getValue().substring(u,p),d=t-u,m=new f.MirrorModel("__temp_model_",0,h),y=m.getLineNumberFromOffset(d),v=1+d-m.getLineStart(y),T=m.getLineNumberFromOffset(d+i),b=1+(d+i)-m.getLineStart(T);return m.dispose(),{text:h,range:{startLineNumber:y,startColumn:v,endLineNumber:T,endColumn:b}}},e.prototype.isSubRange=function(e,t){return e.startLineNumber>t.startLineNumber||e.endLineNumbert.startColumn?!1:e.endLineNumber===t.endLineNumber&&e.endColumn4)return 0;var r,i,o=[],s=[];for(r=0;r=n){var s=this.edits[o];r.update(s)}}return new f.TypeScript.ScriptEditRange(r.minChar,r.limChar,r.delta)},e.prototype.onLineChange=function(e){var t=this.edit(),n=this.model.getOffsetFromPosition({lineNumber:e.lineNumber,column:1}),r=this.model.getLineContent(e.lineNumber).length,i=e.detail.length;t.updateMinChar(n),t.updateLimChar(n+r),t.updateDelta(-r),t.updateMinChar(n),t.updateLimChar(n),t.updateDelta(i)},e.prototype.onLineInserted=function(e){var t=this.edit(),n=this.model.getOffsetFromPosition({lineNumber:e.fromLineNumber,column:1}),r=e.detail.length;t.updateMinChar(n),t.updateLimChar(n+r),t.updateDelta(r)},e.prototype.onLineDeleted=function(e){var t=this.edit(),n=this.model.getOffsetFromPosition({lineNumber:e.fromLineNumber,column:1}),r=this.model.getOffsetFromPosition({lineNumber:e.toLineNumber,column:1})+this.model.getLineContent(e.toLineNumber).length;t.updateMinChar(n),t.updateLimChar(r),t.updateDelta(-(r-n))},e.prototype.onModelChanged=function(){if(this.currentEdit){this.edits[this.model.version]=this.currentEdit,this.currentEdit=null;var e=Object.keys(this.edits);if(e.length>100)for(var t=0;tn;n++){var i=e[n];this.error()&&t[i.toExternal()]?this.log("MONACO & TS - adding TWICE this resource: "+i.toExternal()):this.resourceService.contains(i)?this.resources.push(i):this.warning()&&this.log("MONACO & TS - host does not KNOW this resource: "+i.toExternal()),t[i.toExternal()]=!0}},t.prototype.setCompilationSettings=function(e){this.compilationSettings=e},t.prototype.getCompilationSettings=function(){return this.compilationSettings},t.prototype.getScriptCount=function(){return this.resources.length},t.prototype.getScriptId=function(e){return this.resources[e].toExternal()},t.prototype.getScriptSourceText=function(e,t,n){return this.getMirrorModelFromIndex(e).getValue().substring(t,n)},t.prototype.getScriptSourceLength=function(e){return this.getMirrorModelFromIndex(e).getValue().length},t.prototype.getScriptVersion=function(e){return this.getMirrorModelFromIndex(e).version},t.prototype.getScriptIsResident=function(e){for(var t=this.getMirrorModelFromIndex(e),n=0,r=this.residentTypes.length;r>n;n++)if(t instanceof this.residentTypes[n])return!0;return!1},t.prototype.getScriptEditRangeSinceVersion=function(e,t){var n=this.resourceService.getLinked(this.resources[e],l.EditHistory.NAME);return n instanceof l.EditHistory?n.getEditRangeSince(t):c.TypeScript.ScriptEditRange.unknown()},t.prototype.getMirrorModelFromIndex=function(e){var t=this.resources[e];if(!t)throw this.fatal()&&this.log("no model found at index "+e),new Error("model not found");var n=this.resourceService.get(t);if(!(n instanceof s.MirrorModel))throw this.fatal()&&this.log("model found at index "+e+" with url: "+t+" is NOT a mirror model"),new Error("model not a mirror model");return n},t}(u);t.MonacoTypeScriptHost=p}),define("vs/languages/typescript/resources/moduleConfiguration",["require","exports"],function(e,t){"use strict";var n=function(){function e(e,t){this.requestService=e,this.configuration=t}return e.prototype.setConfiguration=function(e){this.configuration=e},e.prototype.getModuleConfiguration=function(e){var t="",n="/",r=Object.keys(this.configuration),i=this.requestService.getPath("root",e);r.sort(function(e,t){return t.length-e.length});for(var o=0;!t&&or;r++)this.store.hasOwnProperty(t[r])&&(i=this.store[t[r]],delete o.outgoing[i.name],delete i.incoming[e])}},e.prototype.removeNode=function(e){var t=this;return this.store.hasOwnProperty(e)?(delete this.store[e],Object.keys(this.store).forEach(function(n){var r=t.store[n];delete r.incoming[e],delete r.outgoing[e]}),!0):!1},e.prototype.nodes=function(){var e=this;return Object.keys(this.store).map(function(t){return e.store[t]})},e.prototype.node=function(e){return this.store.hasOwnProperty(e)?this.store[e]:null},e.prototype.traverse=function(e,t,n){"undefined"==typeof n&&(n={});var r=this;if(this.store.hasOwnProperty(e)&&n[e]!==!0){n[e]=!0;var i=this.store[e];t(i),Object.keys(i.outgoing).forEach(function(e){r.traverse(e,t,n)})}},e.prototype.toJSON=function(){for(var e=Object.keys(this.store),t={},n={},r=[],i=0;is;s++)for(n=t.i[t.g[s]],r=t.g[++s];r>0;)i.insertEdge(n,t.i[t.g[++s]]),r-=1;return i},e}();t.Graph=m,t.computeTransitiveClosure=s,t.buildDependencyGraph=a,t.fillGraph=l;var g=function(){function e(e,t,n){this.offset=e,this.length=t,this.path=n}return e}();t.Reference=g;var y=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),t.REGEXP=/^(\/\/\/\s*/im,t}(g);t.TripleSlashReference=y;var v=function(e){function t(t,n,r){e.call(this,t,n,r),this.isRelative=0===this.path.indexOf("./")||0===this.path.indexOf("../"),this.isRooted=0===this.path.indexOf("/"),this.isAbsolute=!this.isRelative&&!this.isRooted}return __extends(t,e),t.TS=".ts",t.DTS=".d.ts",t}(g);t.ImportReference=v;var T=function(){function e(e,t){this.path=e,this.content=t,this.references=[]}return e.prototype.resolve=function(t,n,r,i){"undefined"==typeof i&&(i={});var o=this;return this.references=n(this.content),i[this.path]=!0,new d.Promise(function(s,a){var l=o.references.length,c=function(){0===--l&&s(null)},u=function(){l+=1};return 0===l?(s(null),void 0):(o.references.forEach(function(s){t.load(o.path,s,r).then(function(o){i[o.path]?(s.file=o,s.error={message:"cyclic reference",path:o.path}):(s.file=o,r.recursive&&s.file instanceof e&&(u(),o.resolve(t,n,r,i).then(function(){c()},a))),c()},function(e){s.error=e,c()})}),void 0)})},e}();t.File=T;var b=function(){function e(){this.references=[]}return e.prototype.getReferences=function(){return this.references},e.prototype.consume=function(e){var t=this,n=p.getAstWalkerFactory().getWalker(function(e){t.vistComments(e.preComments),t.vistImportDeclaration(e),t.vistComments(e.postComments)}),r=this.references.length;return n.walk(e,null),this.references.slice(r)},e.prototype.vistImportDeclaration=function(e){if(e instanceof p.ImportDeclaration){var t=e.alias,n=t.actualText,r=new v(t.minChar+1,-2+t.limChar-t.minChar,n.substring(1,n.length-1));this.references.push(r)}},e.prototype.vistComments=function(e){if(e)for(var t=0;tthis.graphVersionId?!0:!1:!0},t.prototype.setGraph=function(e,t){this.graph=e,this.graphVersionId=t},t.prototype.getGraph=function(){return this.graph},t.prototype.getReferences=function(){return this.references},t.prototype.onContentChange=function(){var e=a.collect(this.target.getValue()),n=!1;if(e.length!==this.references.length)n=!0;else{var r={};this.references.forEach(function(e){r[e.path]=!0}),n=e.some(function(e){return!r[e.path]})}n&&(this.references=e,this.referencesVersionId=this.target.getVersionId(),this.emit(t.EVENTS.OnReferencesChanged,{resource:this.target.getAssociatedResource()}))},t}(p);t.ReferencesState=h}),define("vs/languages/typescript/resources/dependencyResolver",["require","exports","vs/base/lib/winjs.base","vs/base/types"],function(e,t,n,r){"use strict";var i=n,o=r;!function(e){e.OnReferencesChanged="onReferencesChanged"}(t.Events||(t.Events={})),t.Events;var s=function(){function e(){}return e.INSTANCE=new e,e.prototype.fetchDependencies=function(){return i.Promise.as([])},e}();t.NullDependencyResolver=s;var a=function(){function e(e){this.delegates=e}return e.prototype.fetchDependencies=function(e){var t=this.delegates.map(function(t){return t.fetchDependencies(e)});return i.Promise.join(t).then(function(e){for(var t=[],n=0;n0&&".."===i&&(n.splice(r-1,2),r-=2)}return n.join("/")}e.normalize=t,e.dirname=n,e.join=r}(h||(h={}));var C=function(){function e(e,t){this.resourceService=e,this.requestService=t}return e.prototype.load=function(e,t){var n=this;if(!(t instanceof b.TripleSlashReference))return d.Promise.wrapError("only triple slash references are supported");var r=new f.URL(h.join(h.dirname(e),h.normalize(t.path))),i=this.requestService.getPath("root",r),o=new f.URL(this.requestService.getRequestUrl("root",i,!0));if(this.resourceService.contains(o)){var s=this.resourceService.get(o);return d.Promise.as(new b.File(o.toExternal(),s.getValue()))}return this.requestService.makeRequest({url:o.toExternal()}).then(function(e){var t=new b.File(o.toExternal(),e.responseText),r=new v.RemoteModel(o,e.responseText);return n.resourceService.contains(o)||n.resourceService.insert(o,r),t})},e.prototype.dispose=function(){},e}(),w=function(e){function t(t,n){e.call(this),this.resourceService=t,this.requestService=n,this.callOnDispose=[],this.fileLoader=new C(t,n),this.loadRecursivelyValue=!0}return __extends(t,e),t.prototype.dispose=function(){y.cAll(this.callOnDispose)},t.prototype.loadRecursively=function(e){return"undefined"!=typeof e&&(this.loadRecursivelyValue=e),this.loadRecursivelyValue},t.prototype.fetchDependencies=function(e){var t=this;if(!e||e.getScheme()===f.schemas.inMemory)return d.Promise.as([]);var n=this.resourceService.get(e);if(!(n instanceof k.MirrorModel))return d.Promise.as([]);var r=n,i=this.resourcesFromReferenceState(r);if(i)return d.Promise.as(i);var o=this.resourceService.getLinked(e,T.ReferencesState.NAME),s=new b.File(e.toExternal(),r.getValue()),a=r.getVersionId();return b.buildDependencyGraph(this.fileLoader,[s],{recursive:this.loadRecursively(),nodeName:function(e){return e}}).then(function(n){return n.nodes().forEach(function(e){0===e.getName().indexOf("error:")&&n.removeNode(e.getName())}),o.setGraph(n,a),t.resourcesFromGraph(n,e)})},t.prototype.resourcesFromReferenceState=function(e){var t=this,n=e.getAssociatedResource(),r=this.resourceService.getLinked(n,T.ReferencesState.NAME);return r?r.needsUpdate()?null:this.resourcesFromGraph(r.getGraph(),n):(r=new T.ReferencesState(e),this.callOnDispose.push(r.addListener(T.ReferencesState.EVENTS.OnReferencesChanged,function(e){return t.onReferenceStateChanged(e)})),this.resourceService.insertLinked(n,T.ReferencesState.NAME,r),null)},t.prototype.onReferenceStateChanged=function(e){this.emit(S.Events.OnReferencesChanged,e)},t.prototype.resourcesFromGraph=function(e,t){var n=[];return e.traverse(t.toExternal(),function(e){n.unshift(new f.URL(e.getName()))}),n.pop(),n},t}(m.EventEmitter);t.FileBasedResolver=w;var E=function(){function e(e,t,n){this.resourceService=e,this.requestService=t,this.delegate=n,this.baselibs=[]}return e.prototype.setBaselibs=function(e){this.baselibs=e},e.prototype.fetchDependencies=function(){var e=this,t=[];return this.baselibs.forEach(function(n){e.resourceService.contains(n)?t.push(d.Promise.as(n)):t.push(e.requestService.makeRequest({url:n.toExternal()}).then(function(t){var r=new v.DefaultLibModel(n,t.responseText);return e.resourceService.insert(n,r),n},function(){return console.warn("TS - "+n.toExternal()+" can not be loaded as base lib"),null}))}),d.Promise.join(t).then(function(n){return t=[],n.forEach(function(n){n&&t.push(e.delegate.fetchDependencies(n).then(function(e){return e.push(n),e}))}),d.Promise.join(t)}).then(function(e){return g.merge(e)})},e}();t.BaselibDependencyResolver=E});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/languages/typescript/resources/dependencyResolverGraph",["require","exports","vs/base/lib/winjs.base","vs/base/strings","vs/base/env","vs/base/network","vs/editor/core/model/mirrorModel","./remoteModels","./referenceCollection","../service/references","./dependencyResolverFiles"],function(e,t,n,r,i,o,s,a,l,c,u){"use strict";var p,h=n,d=r,f=i,m=o,g=s,y=a,v=l,T=c,b=u;!function(e){function t(e){for(var t,n,r=0,i={};;){if(t=e.indexOf(":",r),n=e.indexOf("\n",t+1),0>t||0>n)break;i[e.substring(r,t).trim()]=e.substring(t+1,n).trim(),r=n+1}return i}function n(e,n){function r(e){if(c)return o("canceled"),void 0;var n=e.indexOf("\r\n\r\n",a);if(-1!==n){var i=t(e.substring(a,n)),u=Number(i["Content-Length"]);n+4+u>e.length||(l.push({header:i,body:e.substr(n+4,u)}),s(l[l.length-1]),a=n+4+u,r(e))}}var i,o,s,a=0,l=[],c=!1,u=new h.Promise(function(e,t,n){i=e,o=t,s=n},function(){c=!0});return e.makeRequest(n).then(function(e){r(e.responseText),i(l)},function(e){o(e)},function(e){f.browser.isIE||3===e.readyState&&r(e.responseText)}).done(null,function(e){o(e)}),u}e.parseHeader=t,e.fetchChunkedData=n}(p||(p={}));var k=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),t.prototype.setModuleSystems=function(e){this.modules=e},t.prototype.onReferenceStateChanged=function(e){var t=this;setTimeout(function(){t.superOnReferenceStateChanged(e)},1e3)},t.prototype.superOnReferenceStateChanged=function(t){e.prototype.onReferenceStateChanged.call(this,t)},t.prototype.fetchDependencies=function(t){var n=this;if(!t)return h.Promise.as([]);var r=this.requestService.getPath("root",t);if(!r)return e.prototype.fetchDependencies.call(this,t);var i=this.resourceService.get(t);if(!(i instanceof g.MirrorModel))return h.Promise.as([]);var o=i,s=this.resourcesFromReferenceState(o);if(s)return h.Promise.as(s);var a=this.builtRequestUrl(t,"typeScriptDependencyGraph"),l=o.getVersionId(),c=this.resourceService.getLinked(t,v.ReferencesState.NAME);return this.requestService.makeRequest({url:a}).then(function(e){var r=JSON.parse(e.responseText),i=n.parseGraph(r);return c.setGraph(i,l),n.resourcesFromGraph(i,t)}).then(function(e){for(var t=[],r=0;r0;)this.callOnDispose.pop()()},n.prototype.injectTelemetryService=function(e){this.telemetryService=e},n.prototype.injectRequestService=function(e){this.requestService=e},n.prototype.injectResourceService=function(e){t.prototype.injectResourceService.call(this,e),this.host=new N.MonacoTypeScriptHost(e);var n=new M.LanguageService(this.host);this.adapter=new x.LanguageServiceAdapter(n,e)},n.prototype.setExtraData=function(e){this.extraData=S.mixin(S.clone(n.defaultExtraData),e||{})},n.prototype.configure=function(e){var t=this;this.delays=S.clone(n.defaultDelays),this.options=S.mixin(S.clone(n.defaultOptions),e||{});var r=new A.CompilationSettings;return r.basepath=this.requestService.getRequestUrl("root","",!0)||"",this.options.showTypeScriptWarnings&&(r.styleSettings.implicitAny=!0,r.styleSettings.reDeclareLocal=!0,r.styleSettings.evalOK=!1,r.styleSettings.newMustBeUsed=!0,r.styleSettings.eqeqeq=!0,r.styleSettings.forin=!1,r.styleSettings.eqnull=!0,r.styleSettings.funcInLoop=!0,r.styleSettings.emptyBlocks=!0),this.host.setCompilationSettings(r),this.adapter.setSuggestConfiguration({useCodeSnippetsOnMethodSuggest:this.options.completeFunctionsAsInvocation}),!this.extraData.includeAllReferences&&this.options.useResidentFlagAggressively&&this.host.setResidentTypes([L.DefaultLibModel,L.RemoteModel]),this.options.updateOnResourceChange&&this.callOnDispose.push(this.resourceService.addBulkListener(function(){return t.scheduleUpdate()})),this.resolver=this.createDependencyResolver(),k.Promise.as(null)},n.prototype.createDependencyResolver=function(){var e=this,t=function(){if(e.requestService.getRequestUrl("typeScriptDependencyGraph")){var t=new D.ModuleSystemConfigurations(e.requestService,e.options.moduleSystems),n=new F.GraphBasedResolver(e.resourceService,e.requestService);return n.setModuleSystems(t),n}return e.requestService.getRequestUrl("root")?new O.FileBasedResolver(e.resourceService,e.requestService):W.NullDependencyResolver.INSTANCE},n=t();n instanceof O.FileBasedResolver&&this.callOnDispose.push(n.addListener(W.Events.OnReferencesChanged,function(t){e.validate(t.resource)})),this.extraData.includeAllReferences&&n instanceof O.FileBasedResolver&&(n.loadRecursively(!1),n=new O.BaselibDependencyResolver(this.resourceService,this.requestService,n),n.setBaselibs([new C.URL(this.requestService.getRequestUrl("root","all.references.ts",!0))]));var r=new O.BaselibDependencyResolver(this.resourceService,this.requestService,t());return r.setBaselibs(this.options.defaultLibraries.map(function(e){return new C.URL(e)})),new W.CompositeDependencyResolver([r,n])},n.prototype.getHost=function(){return this.host},n.prototype.scheduleUpdate=function(){var e=this;if(this.options.updateOnResourceChange){this.scheduleUpdatePromise.cancel();var t=!1,n=k.Promise.as(null);this.scheduleUpdatePromise=new k.Promise(function(n,r){setTimeout(function(){if(t)return r({name:"Canceled"}),void 0;var i=R.start(R.Topic.WORKER,"AUTO update language service");try{e.doUpdateLanguageService(),n(e),i.stop()}catch(o){e.onError(null,o),n(e),i.stop()}},e.delays.updateSoon)},function(){t=!0,n.cancel()})}},n.prototype.fetchDependenciesAndUpdateLanguageService=function(e){var t=this,n=!1;return new k.Promise(function(r,i){t.emitStatus(3),t.resolver.fetchDependencies(e).then(function(r){return t.emitStatus(1),n?(i({name:"Canceled"}),void 0):(e&&r.push(e),t.host.setResources(r),void 0)}).then(function(){try{t.doUpdateLanguageService(),r(t)}catch(e){i(e)}},i)},function(){n=!0}).then(function(e){return t.emitStatus(0),e},function(e){throw t.emitStatus(2),e})},n.prototype.setStatusReporting=function(e){this.shouldEmitStatus=e},n.prototype.emitStatus=function(e){this.shouldEmitStatus&&this.publisher.sendMessage("ts.statusUpdate",{status:e})},n.prototype.doUpdateLanguageService=function(){if(this.currentError)throw{name:"Canceled",message:"updating language service BLOCK because current state caused errors"};this.adapter.getLanguageSerivce().refresh()},n.prototype.onError=function(e,t){var n=this;if("Canceled"!==t.name){this.telemetryService.log("typescript.languageService.update.failure",{detail:P.toErrorMessage(t,!0)}),console.error("ERROR updating language service (file a bug against TypeScript)"),console.error(t),this.currentError=t;var r;r=this.resourceService.addBulkListener(function(){r(),n.currentError=null,console.warn("creating NEW language service after last update failed");var e=new M.LanguageService(n.host);n.adapter.setLanguageService(e)})}return e},n.prototype.updateLanguageService=function(e,t){"undefined"==typeof t&&(t="");var n=R.start(R.Topic.WORKER,"'"+t+"' updates language service");return this.scheduleUpdatePromise.cancel(),this.fetchDependenciesAndUpdateLanguageService(e).then(function(){n.stop()})},n.STYLE_PREFIX="STYLE: ",n.prototype.doValidate=function(e,r){var i=this;this.extraData.validate&&this.updateLanguageService(e,"validate").then(function(){var e={};i.resourceService.all().forEach(function(t){if(t instanceof _.MirrorModel){var n=t;e[n.getAssociatedResource().toExternal()]=[]}});var o=i.adapter.getAllErrors();o.forEach(function(t){e[t.resource.toExternal()].push(t)}),r.batchChanges(function(r){Object.keys(e).forEach(function(o){var s=new C.URL(o),a=i.resourceService.get(s);a instanceof L.RemoteModel||i.adapter.isBaseLibModel(a)||r.changeMarkers(a.getAssociatedResource(),function(s){t.prototype.triggerValidateParticipation.call(i,a.getAssociatedResource(),r,i.adapter.getLanguageSerivce()),(e[o]||[]).forEach(function(e){var t=E.Severity.Error,r=e.message,i=0===e.message.indexOf(n.STYLE_PREFIX);i&&(t=E.Severity.Warning,r=e.message.substr(n.STYLE_PREFIX.length)),s.addMarker(E.createRangeTextMarker(t,2,r,e.range))})})})})},this.onError.bind(this,null))},n.prototype.doSuggest=function(e,t){var n=this;return this.updateLanguageService(e,"doSuggest").then(function(){return n.adapter.suggest(e,t)},this.onError.bind(this,[]))},n.prototype.quickFix=function(e,t){var n=this;return this.updateLanguageService(e,"quickFix").then(function(){return n.adapter.quickFix(e,t)},this.onError.bind(this,[]))},n.prototype.getParameterHints=function(e,t){var n=this;return this.updateLanguageService(e,"getParameterHints").then(function(){return n.adapter.getParameterHints(e,t)},this.onError.bind(this,null))},n.prototype.format=function(e,t,n){var r=this;return this.updateLanguageService(e,"format").then(function(){return r.adapter.format(e,t,n)},this.onError.bind(this,[]))},n.prototype.formatAfterKeystroke=function(e,t,n){var r=this;return this.updateLanguageService(e,"formatAfterKey").then(function(){return r.adapter.formatAfterKeystroke(e,t,n)},this.onError.bind(this,[]))},n.prototype.getActionsAtPosition=function(e,t){var n=this;return this.updateLanguageService(e,"actions at position").then(function(){return n.adapter.getActionsAtPosition(e,t)},this.onError.bind(this,[]))},n.prototype.getOutline=function(e){var t=this;return this.updateLanguageService(e,"outline").then(function(){return t.adapter.getOutline(e)},this.onError.bind(this,[]))},n.prototype.getNavigateToItems=function(e){var t=this;return this.updateLanguageService(null,"navigate to items").then(function(){return t.adapter.getNavigateToItems(e)},this.onError.bind(this,[]))},n.prototype.findOccurrences=function(e,t,n){var r=this;return this.updateLanguageService(e,"find occurrences").then(function(){return r.adapter.findOccurrences(e,t,n)},this.onError.bind(this,[]))},n.prototype.findDeclaration=function(e,t){var n=this;return this.updateLanguageService(e,"find declaration").then(function(){return n.adapter.findDeclaration(e,t)},this.onError.bind(this,null))},n.prototype.findTypeDeclaration=function(e,t){var n=this;return this.updateLanguageService(e,"find type decl").then(function(){return n.adapter.findTypeDeclaration(e,t)},this.onError.bind(this,null))},n.prototype.findReferences=function(e,t){var n=this;return this.updateLanguageService(e,"find references").then(function(){return n.adapter.findReferences(e,t)},this.onError.bind(this,[]))},n.prototype.computeInfo=function(e,t){var n=this;return this.updateLanguageService(e,"hover").then(function(){return n.adapter.getTypeInformationAtPosition(e,t)},this.onError.bind(this,null))},n.prototype.getRangesToPosition=function(e,t){var n=this;return this.updateLanguageService(e,"logical selection").then(function(){return n.adapter.getRangesToPosition(e,t)},this.onError.bind(this,[]))},n.prototype.textReplace=function(e,t){var n=[["true","false"],["string","number","bool"],["private","public"]];return this.valueSetsReplace(n,e,t)},n.prototype.isInternalSymbol=function(e,t){var n=this;return this.updateLanguageService(e,"isInternalSymbol").then(function(){return n.adapter.isInternalSymbol(e,t)},this.onError.bind(this,!1))},n}(w.AbstractWorkerMode);t.TypeScriptWorker2=B,t.value=new B});define("vs/languages/typescript/typescriptWorker2.nls",[],{vs_languages_lib_javascriptSnippets:["define module","For Loop","For-Each Loop","For-In Loop","Function Statement","If Statement","If-Else Statement","New Statement","Switch Statement","While Statement","Do-While Statement","Try-Catch Statement","Console Log","Set Timeout Function"],vs_languages_typescript_service_typescriptSnippets:["For-Each Loop using =>","jsdoc snippet","Constructor","Class Definition","Public Method Definition","Private Method Definition"]});define("vs/languages/typescript/typescriptWorker2.nls.keys",[],{vs_languages_lib_javascriptSnippets:["define.snippet","for.snippet","foreach.snippet","forin.snippet","function.snippet","if.snippet","ifelse.snippet","new.snippet","switch.snippet","while.snippet","dowhile.snippet","trycatch.snippet","log.snippet","settimeout.snippet"],vs_languages_typescript_service_typescriptSnippets:["foreach.snippet","jsdoc.snippet","constructor.snippet","class.snippet","publicmethod.snippet","privatemethod.snippet"]});/*--------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ define("vs/languages/typescript/service/textEdit",["require","exports","vs/base/strings"],function(e,t,n){"use strict";function r(e){return new s(e)}var i=n,o=function(){function e(e,t,n){this.offset=e,this.length=t,this.text=n||"",this.parent=null,this.children=[]}return e.prototype.isNoop=function(){return 0===this.length&&0===this.text.length},e.prototype.isDelete=function(){return this.length>0&&0===this.text.length},e.prototype.isInsert=function(){return 0===this.length&&this.text.length>0},e.prototype.isReplace=function(){return this.length>0&&this.text.length>0},e.prototype.getRightMostChild=function(){var e=this.children.length;return 0===e?this:this.children[e-1].getRightMostChild()},e.prototype.remove=function(){return this.parent?this.parent.removeChild(this):!1},e.prototype.addChild=function(e){e.parent=this;var t,n;for(t=0,n=this.children.length;n>t&&!(this.children[t].offset>e.offset);t++);this.children.splice(t,0,e)},e.prototype.removeChild=function(e){var t=this.children.indexOf(e);return-1===t?!1:(e.parent=null,this.children.splice(t,1),!0)},e.prototype.insert=function(e){if(this.enclosedBy(e))return e.insert(this),e;var t,n,r;for(t=0,n=this.children.length;n>t;t++)if(r=this.children[t],r.enclosedBy(e))this.removeChild(r),e.insert(r),n--,t--;else if(r.encloses(e))return r.insert(e),this;return this.addChild(e),this},e.prototype.enclosedBy=function(e){return e.encloses(this)},e.prototype.encloses=function(e){return this.offset>e.offset||e.offset>=this.offset+this.length?!1:e.offset+e.length>this.offset+this.length?!1:!0},e}();t.Edit=o;var s=function(){function e(e){this.model=e,this.modelVersion=e.getVersionId(),this.edit=new o(0,this.model.getValue().length,null)}return e.prototype.replace=function(e,t,n){"undefined"==typeof t&&(t=0),"undefined"==typeof n&&(n=null);var r=new o(e,t,n);r.isNoop()||(this.edit=this.edit.insert(r))},e.prototype.apply=function(){if(this.model.getVersionId()!==this.modelVersion)throw new Error("illegal state - model has been changed");for(var e,t=this.model.getValue();(e=this.edit.getRightMostChild())!==this.edit;)t=i.splice(t,e.offset,e.length,e.text),e.parent.length+=e.text.length-e.length,e.remove();return t},e}();t.create=r}),define("vs/languages/lib/javascriptSnippets",["require","exports","vs/nls!vs/languages/typescript/typescriptWorkerMonitored"],function(e,t,n){"use strict";var r=n;t.snippets=[{type:"snippet",label:"define",codeSnippet:["define(["," 'require',"," '{{require}}'","], function(require, {{factory}}) {"," 'use strict';"," {{}}","});"].join("\n"),documentationLabel:r.localize("vs_languages_lib_javascriptSnippets",0)},{type:"snippet",label:"for",codeSnippet:["for (var {{index}} = 0; {{index}} < {{array}}.length; {{index}}++) {"," var {{element}} = {{array}}[{{index}}];"," {{}}","}"].join("\n"),documentationLabel:r.localize("vs_languages_lib_javascriptSnippets",1)},{type:"snippet",label:"foreach",codeSnippet:["{{array}}.forEach(function({{element}}) {"," {{}}","}, this);"].join("\n"),documentationLabel:r.localize("vs_languages_lib_javascriptSnippets",2)},{type:"snippet",label:"forin",codeSnippet:["for (var {{key}} in {{object}}) {"," if ({{object}}.hasOwnProperty({{key}})) {"," var {{element}} = {{object}}[{{key}}];"," {{}}"," }","}"].join("\n"),documentationLabel:r.localize("vs_languages_lib_javascriptSnippets",3)},{type:"snippet",label:"function",codeSnippet:["function {{name}}({{params}}) {"," {{}}","}"].join("\n"),documentationLabel:r.localize("vs_languages_lib_javascriptSnippets",4)},{type:"snippet",label:"if",codeSnippet:["if ({{condition}}) {"," {{}}","}"].join("\n"),documentationLabel:r.localize("vs_languages_lib_javascriptSnippets",5)},{type:"snippet",label:"ifelse",codeSnippet:["if ({{condition}}) {"," {{}}","} else {"," ","}"].join("\n"),documentationLabel:r.localize("vs_languages_lib_javascriptSnippets",6)},{type:"snippet",label:"new",codeSnippet:["var {{name}} = new {{type}}({{arguments}});{{}}"].join("\n"),documentationLabel:r.localize("vs_languages_lib_javascriptSnippets",7)},{type:"snippet",label:"switch",codeSnippet:["switch ({{key}}) {"," case {{value}}:"," {{}}"," break;",""," default:"," break;","}"].join("\n"),documentationLabel:r.localize("vs_languages_lib_javascriptSnippets",8)},{type:"snippet",label:"while",codeSnippet:["while ({{condition}}) {"," {{}}","}"].join("\n"),documentationLabel:r.localize("vs_languages_lib_javascriptSnippets",9)},{type:"snippet",label:"dowhile",codeSnippet:["do {"," {{}}","} while ({{condition}});"].join("\n"),documentationLabel:r.localize("vs_languages_lib_javascriptSnippets",10)},{type:"snippet",label:"trycatch",codeSnippet:["try {"," {{}}","} catch ({{error}}) {"," ","}"].join("\n"),documentationLabel:r.localize("vs_languages_lib_javascriptSnippets",11)},{type:"snippet",label:"log",codeSnippet:["console.log({{message}});{{}}"].join("\n"),documentationLabel:r.localize("vs_languages_lib_javascriptSnippets",12)},{type:"snippet",label:"settimeout",codeSnippet:["setTimeout(function() {"," {{}}","}, {{timeout}});"].join("\n"),documentationLabel:r.localize("vs_languages_lib_javascriptSnippets",13)}]}),define("vs/languages/typescript/service/typescriptSnippets",["require","exports","vs/nls!vs/languages/typescript/typescriptWorkerMonitored"],function(e,t,n){"use strict";var r=n;t.snippets=[{type:"snippet",label:"foreach =>",codeSnippet:["{{array}}.forEach(({{element}}:{{type}}) => {"," {{}}","});"].join("\n"),documentationLabel:r.localize("vs_languages_typescript_service_typescriptSnippets",0)},{type:"snippet",label:"jsdoc comment",codeSnippet:["/**"," * {{}}"," */"].join("\n"),documentationLabel:r.localize("vs_languages_typescript_service_typescriptSnippets",1)},{type:"snippet",label:"ctor",codeSnippet:["/**"," *"," */","constructor() {"," super();"," {{}}","}"].join("\n"),documentationLabel:r.localize("vs_languages_typescript_service_typescriptSnippets",2)},{type:"snippet",label:"class",codeSnippet:["/**"," * {{name}}"," */","class {{name}} {"," constructor({{parameters}}) {"," {{}}"," }","}"].join("\n"),documentationLabel:r.localize("vs_languages_typescript_service_typescriptSnippets",3)},{type:"snippet",label:"public method",codeSnippet:["/**"," * {{name}}"," */","public {{name}}() {"," {{}}","}"].join("\n"),documentationLabel:r.localize("vs_languages_typescript_service_typescriptSnippets",4)},{type:"snippet",label:"private method",codeSnippet:["private {{name}}() {"," {{}}","}"].join("\n"),documentationLabel:r.localize("vs_languages_typescript_service_typescriptSnippets",5)}]}),define("vs/base/lifecycle",["require","exports"],function(e,t){"use strict";function n(e){for(var t=0,n=e.length;n>t;t++)e[t].dispose();return[]}function r(){for(var e=[],t=0;t0;)e.pop()()}t.disposeAll=n,t.combinedDispose=r,t.cAll=i});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/languages/typescript/resources/remoteModels",["require","exports","vs/base/network","vs/editor/core/model/mirrorModel"],function(e,t,n,r){"use strict";var i=n,o=r,s=function(e){function t(n,r,o){if("undefined"==typeof o&&(o=!1),e.call(this,n.toExternal(),o?-1:1,t.normalize(r),n),o){var s=n.toExternal();this.actualResource=new i.URL(s.substring(0,s.length-5)+".ts")}}return __extends(t,e),t.normalize=function(e){return e.replace(/\r\n/g,"\n")},t.prototype.isGenerated=function(){return!!this.actualResource},t.prototype.getActualResource=function(){return this.actualResource?this.actualResource:this.getAssociatedResource()},t}(o.MirrorModel);t.RemoteModel=s;var a=function(e){function t(t,n){e.call(this,t,n,!1)}return __extends(t,e),t}(s);t.DefaultLibModel=a;var l=function(e){function t(t,n){e.call(this,t.toExternal(),-1,n,t)}return __extends(t,e),t}(o.MirrorModel);t.AllReferences=l}),define("vs/languages/typescript/service/languageServiceAdapter",["require","exports","vs/base/lib/winjs.base","vs/base/network","vs/editor/modes/modes","vs/editor/core/model/mirrorModel","vs/languages/typescript/service/textEdit","vs/languages/typescript/lib/typescriptServices","vs/languages/typescript/resources/remoteModels","vs/languages/lib/javascriptSnippets","vs/languages/typescript/service/typescriptSnippets"],function(e,t,n,r,i,o,s,a,l,c,u){"use strict";var p=n,h=r,d=i,f=o,m=s,g=a,y=l,v=c,T=u,b=function(){function e(e,t){this.resourceService=t,this.setLanguageService(e),this.setSuggestConfiguration({})}return e.prototype.setLanguageService=function(e){this.languageService=e},e.prototype.getLanguageSerivce=function(){return this.languageService},e.prototype.setSuggestConfiguration=function(e){this.suggestConfiguration=e},e.prototype.getAllErrors=function(){var e=this;return this.languageService.getErrors(1e4).map(function(t){var n=e.getResourceFromIndex(t.unitIndex);return{message:t.message,range:e.rangeFromMinAndLim(t,n,!1),resource:n.getAssociatedResource()}})},e.prototype.format=function(e,t,n){var r=this.resourceService.get(e),i=r.getAssociatedResource().toExternal(),o=r.getOffsetFromPosition({lineNumber:t.startLineNumber,column:t.startColumn}),s=r.getOffsetFromPosition({lineNumber:t.endLineNumber,column:t.endColumn}),a=this.languageService.getFormattingEditsForRange(i,o,s,this.createFormatOptions(n)),l=this.applyTextEdits(a,r,o,s);return l.text},e.prototype.formatAfterKeystroke=function(e,t,n){var r=this.resourceService.get(e),i=r.getAssociatedResource().toExternal(),o=r.getOffsetFromPosition(t),s=r.getOffsetFromPosition({lineNumber:t.lineNumber,column:1}),a=r.getLineContent(t.lineNumber).length,l=r.getValueInRange({startColumn:t.column,endColumn:t.column+1,startLineNumber:t.lineNumber,endLineNumber:t.lineNumber}),c=this.languageService.getFormattingEditsAfterKeystroke(i,1+o,l,this.createFormatOptions(n)),u=this.applyTextEdits(c,r,s,s+a);return u},e.prototype.createFormatOptions=function(e){var t=new g.Services.FormatCodeOptions;return t.ConvertTabsToSpaces=e.insertSpaces,t.TabSize=e.tabSize,t.IndentSize=e.tabSize,t.InsertSpaceAfterCommaDelimiter=!0,t.InsertSpaceBeforeAndAfterBinaryOperators=!0,t.InsertSpaceAfterSemicolonInForStatements=!0,t},e.prototype.applyTextEdits=function(e,t,n,r){for(var i,o=m.create(t),s=0;s=0){var p=this.getResourceFromIndex(c.unitIndex,!1);p&&(u={resourceUrl:p.getAssociatedResource().toExternal(),range:this.rangeFromMinAndLim({minChar:c.location,limChar:c.location},p,!0),preview:this.preview(p,c.location,c.location)})}return u},e.prototype.findReferences=function(e,t){var n=this,r=this.resourceService.get(e),i=r.getOffsetFromPosition(t),o=r.getAssociatedResource().toExternal(),s=this.languageService.getReferencesAtPosition(o,i),a=s.filter(function(e){return!n.isBaseLibModel(n.getResourceFromIndex(e.unitIndex))}).map(function(e){var t=n.getResourceFromIndex(e.unitIndex),r={resourceUrl:t.getAssociatedResource().toExternal(),range:n.rangeFromMinAndLim(e.ast,t),preview:n.preview(t,e.ast.minChar,e.ast.limChar)};return r});return a},e.prototype.getTypeInformationAtPosition=function(e,t){var n=this.resourceService.get(e),r=n.getOffsetFromPosition(t),i=n.getAssociatedResource().toExternal(),o=this.languageService.getTypeAtPosition(i,r);if(!o)return null;var s=[];s.push({className:"type",text:o.memberName.toString()}),s.push({className:"documentation",text:o.docComment});var a={value:"",htmlContent:s,className:"typeInfo ts",range:this.rangeFromMinAndLim(o,n)};return a},e.prototype.getRangesToPosition=function(e,t){var n=this,r=this.resourceService.get(e),i=r.getOffsetFromPosition(t),o=r.getAssociatedResource().toExternal(),s=this.languageService.getScriptAST(o),a=this.languageService.getAstPathToPosition(s,i,g.TypeScript.GetAstPathOptions.Default),l=function(e){switch(e.nodeType){case g.TypeScript.NodeType.ModuleDeclaration:return"module";case g.TypeScript.NodeType.ClassDeclaration:return"class";case g.TypeScript.NodeType.InterfaceDeclaration:return"interface";case g.TypeScript.NodeType.FuncDecl:return e.isConstructor?"ctor":"function"}return""},c=a.asts.map(function(e){return{type:l(e),range:n.rangeFromMinAndLim(e,r)}});return c},e.prototype.suggest=function(e,t){var n=this,r=this.resourceService.get(e),i=e.toExternal(),o=r.getWordUntilPosition(t),s=r.getOffsetFromPosition(t),a=s-o.length,l="."===r.getValue().charAt(a-1),c=[],u=this.languageService.getCompletionsAtPosition(i,a,l);l=u.isMemberCompletion,u.entries.forEach(function(e){if("("!==e.type.charAt(0))return c.push({type:"field",label:e.name,documentationLabel:e.docComment,typeLabel:e.type,codeSnippet:e.name}),void 0;var t=n.parseMethodSignature(e.type);if(n.suggestConfiguration.useCodeSnippetsOnMethodSuggest){var r=t.arguments.map(function(e){return"{{"+e.name.trim()+"}}"}),i=e.name;i+=r.length>0?"("+r.join(", ")+"){{}}":"()",c.push({type:"function",label:e.name,documentationLabel:e.docComment,typeLabel:e.type,codeSnippet:i})}else c.push({type:"function",label:e.name,documentationLabel:e.docComment,typeLabel:e.type,codeSnippet:e.name})});var h=!l,d=this.suggestConfiguration.alwaysAllWords||0===u.entries.length;return p.Promise.as([]),d&&r.getAllUniqueWords(o).filter(function(e){return!/^-?\d*\.?\d/.test(e)}).forEach(function(e){var t={type:"text",label:e,codeSnippet:e};c.push(t)}),h&&(c.push.apply(c,v.snippets),c.push.apply(c,T.snippets)),c},e.prototype.quickFix=function(e,t){var n=this,r=this.resourceService.get(e),i=r.getAssociatedResource().toExternal(),o=r.getOffsetFromPosition(t),s=r.getWordUntilPosition(t),a=o-s.length,l="."===r.getValue().charAt(a-1),c=this.languageService.getCompletionsAtPosition(i,a,l),u=[];return c.entries.forEach(function(e){var t=n.calculateStringDifference(s,e.name);if(!(tt;t++)if(r=e.charAt(t),")"===r&&l--,"("===r&&l++,1!==l||":"!==r)if(1!==l||","!==r){if(0===l&&")"===r){""!==o&&i.push({name:o,type:s});break}a?o+=r:s+=r}else i.push({name:o,type:s}),o="",s="",a=!0;else a=!1;return{arguments:i,flatArguments:e.substr(0,t+1),flatReturnType:e.substr(t+5)}},e.prototype.getParameterHints=function(e,t){function n(e){return{name:e.name,type:e.type,isOptional:e.isOptional,documentation:e.docComment}}function r(e){return{parameters:e.parameters.map(function(e){return n(e)}),returnType:e.returnType,documentation:e.docComment}}var i=this.resourceService.get(e),o=i.getOffsetFromPosition(t),s=i.getAssociatedResource().toExternal(),a=this.languageService.getSignatureAtPosition(s,o);if(!a)return null;var l={currentSignature:a.activeFormal<0?0:a.activeFormal,currentParameter:a.actual.currentParameter<0?0:a.actual.currentParameter,signatures:a.formal.signatureGroup.map(function(e){return r(e)}),format:{typeFormat:d.TypesFormat.SUFFIX,typeSeparator:":"}};return l},e.prototype.isInternalSymbol=function(e,t){var n=this.resourceService.get(e),r=n.getOffsetFromPosition(t),i=this.languageService.getScriptAST(e.toExternal()),o=this.languageService.getSymbolAtPosition(i,r);if(!o)return!1;var s=0!==(o.flags&g.TypeScript.SymbolFlags.Public),a=0!==(o.flags&g.TypeScript.SymbolFlags.Exported);return!(s||a)},e.prototype.getAsDeclareFile=function(e){var t=this.languageService.host.getCompilationSettings(),n=t.generateDeclarationFiles;t.generateDeclarationFiles=!0;try{var r=e.toExternal(),i=this.languageService.getEmitOutput(r);return 2!==i.length?null:i[1].text}finally{t.generateDeclarationFiles=n}},e.prototype.getResourceFromIndex=function(e,t){"undefined"==typeof t&&(t=!0);var n,r;if(t)n=new h.URL(this.languageService.host.getScriptId(e)),r=this.resourceService.get(n);else{var i=this.languageService.compilerState;n=new h.URL(i.getScript(e).locationInfo.filename),r=this.resourceService.get(n)}return r instanceof f.MirrorModel?r:null},e.prototype.isBaseLibModel=function(e){return e instanceof y.DefaultLibModel},e.prototype.rangeFromMinAndLim=function(e,t,n){"undefined"==typeof n&&(n=!1);var r=e.minChar,i=e.limChar-e.minChar;i=Math.max(1,i);var o={};return o.startLineNumber=t.getLineNumberFromOffset(r),o.startColumn=1+r-t.getLineStart(o.startLineNumber),n?(o.endLineNumber=o.startLineNumber,o.endColumn=o.startColumn):(o.endLineNumber=t.getLineNumberFromOffset(r+i),o.endColumn=1+r+i-t.getLineStart(o.endLineNumber)),o},e.prototype.preview=function(e,t,n,r){"undefined"==typeof r&&(r=200);for(var i=n-t,o=this.languageService.getScriptAST(e.getAssociatedResource().toExternal()),s=this.languageService.getAstPathToPosition(o,t,g.TypeScript.GetAstPathOptions.Default),a=null,l=s.asts.length-1;null===a&&l>=0;l--){var c=s.asts[l];c.limChar-c.minChar>r&&(a=c)}null===a&&(a=o);var u=e.getOffsetFromPosition({lineNumber:e.getLineNumberFromOffset(a.minChar),column:1}),p=e.getOffsetFromPosition({lineNumber:e.getLineNumberFromOffset(a.limChar),column:e.getLineMaxColumn(e.getLineNumberFromOffset(a.limChar))}),h=e.getValue().substring(u,p),d=t-u,m=new f.MirrorModel("__temp_model_",0,h),y=m.getLineNumberFromOffset(d),v=1+d-m.getLineStart(y),T=m.getLineNumberFromOffset(d+i),b=1+(d+i)-m.getLineStart(T);return m.dispose(),{text:h,range:{startLineNumber:y,startColumn:v,endLineNumber:T,endColumn:b}}},e.prototype.isSubRange=function(e,t){return e.startLineNumber>t.startLineNumber||e.endLineNumbert.startColumn?!1:e.endLineNumber===t.endLineNumber&&e.endColumn4)return 0;var r,i,o=[],s=[];for(r=0;r=n){var s=this.edits[o];r.update(s)}}return new f.TypeScript.ScriptEditRange(r.minChar,r.limChar,r.delta)},e.prototype.onLineChange=function(e){var t=this.edit(),n=this.model.getOffsetFromPosition({lineNumber:e.lineNumber,column:1}),r=this.model.getLineContent(e.lineNumber).length,i=e.detail.length;t.updateMinChar(n),t.updateLimChar(n+r),t.updateDelta(-r),t.updateMinChar(n),t.updateLimChar(n),t.updateDelta(i)},e.prototype.onLineInserted=function(e){var t=this.edit(),n=this.model.getOffsetFromPosition({lineNumber:e.fromLineNumber,column:1}),r=e.detail.length;t.updateMinChar(n),t.updateLimChar(n+r),t.updateDelta(r)},e.prototype.onLineDeleted=function(e){var t=this.edit(),n=this.model.getOffsetFromPosition({lineNumber:e.fromLineNumber,column:1}),r=this.model.getOffsetFromPosition({lineNumber:e.toLineNumber,column:1})+this.model.getLineContent(e.toLineNumber).length;t.updateMinChar(n),t.updateLimChar(r),t.updateDelta(-(r-n))},e.prototype.onModelChanged=function(){if(this.currentEdit){this.edits[this.model.version]=this.currentEdit,this.currentEdit=null;var e=Object.keys(this.edits);if(e.length>100)for(var t=0;tn;n++){var i=e[n];this.error()&&t[i.toExternal()]?this.log("MONACO & TS - adding TWICE this resource: "+i.toExternal()):this.resourceService.contains(i)?this.resources.push(i):this.warning()&&this.log("MONACO & TS - host does not KNOW this resource: "+i.toExternal()),t[i.toExternal()]=!0}},t.prototype.setCompilationSettings=function(e){this.compilationSettings=e},t.prototype.getCompilationSettings=function(){return this.compilationSettings},t.prototype.getScriptCount=function(){return this.resources.length},t.prototype.getScriptId=function(e){return this.resources[e].toExternal()},t.prototype.getScriptSourceText=function(e,t,n){return this.getMirrorModelFromIndex(e).getValue().substring(t,n)},t.prototype.getScriptSourceLength=function(e){return this.getMirrorModelFromIndex(e).getValue().length},t.prototype.getScriptVersion=function(e){return this.getMirrorModelFromIndex(e).version},t.prototype.getScriptIsResident=function(e){for(var t=this.getMirrorModelFromIndex(e),n=0,r=this.residentTypes.length;r>n;n++)if(t instanceof this.residentTypes[n])return!0;return!1},t.prototype.getScriptEditRangeSinceVersion=function(e,t){var n=this.resourceService.getLinked(this.resources[e],l.EditHistory.NAME);return n instanceof l.EditHistory?n.getEditRangeSince(t):c.TypeScript.ScriptEditRange.unknown()},t.prototype.getMirrorModelFromIndex=function(e){var t=this.resources[e];if(!t)throw this.fatal()&&this.log("no model found at index "+e),new Error("model not found");var n=this.resourceService.get(t);if(!(n instanceof s.MirrorModel))throw this.fatal()&&this.log("model found at index "+e+" with url: "+t+" is NOT a mirror model"),new Error("model not a mirror model");return n},t}(u);t.MonacoTypeScriptHost=p}),define("vs/languages/typescript/resources/moduleConfiguration",["require","exports"],function(e,t){"use strict";var n=function(){function e(e,t){this.requestService=e,this.configuration=t}return e.prototype.setConfiguration=function(e){this.configuration=e},e.prototype.getModuleConfiguration=function(e){var t="",n="/",r=Object.keys(this.configuration),i=this.requestService.getPath("root",e);r.sort(function(e,t){return t.length-e.length});for(var o=0;!t&&or;r++)this.store.hasOwnProperty(t[r])&&(i=this.store[t[r]],delete o.outgoing[i.name],delete i.incoming[e])}},e.prototype.removeNode=function(e){var t=this;return this.store.hasOwnProperty(e)?(delete this.store[e],Object.keys(this.store).forEach(function(n){var r=t.store[n];delete r.incoming[e],delete r.outgoing[e]}),!0):!1},e.prototype.nodes=function(){var e=this;return Object.keys(this.store).map(function(t){return e.store[t]})},e.prototype.node=function(e){return this.store.hasOwnProperty(e)?this.store[e]:null},e.prototype.traverse=function(e,t,n){"undefined"==typeof n&&(n={});var r=this;if(this.store.hasOwnProperty(e)&&n[e]!==!0){n[e]=!0;var i=this.store[e];t(i),Object.keys(i.outgoing).forEach(function(e){r.traverse(e,t,n)})}},e.prototype.toJSON=function(){for(var e=Object.keys(this.store),t={},n={},r=[],i=0;is;s++)for(n=t.i[t.g[s]],r=t.g[++s];r>0;)i.insertEdge(n,t.i[t.g[++s]]),r-=1;return i},e}();t.Graph=m,t.computeTransitiveClosure=s,t.buildDependencyGraph=a,t.fillGraph=l;var g=function(){function e(e,t,n){this.offset=e,this.length=t,this.path=n}return e}();t.Reference=g;var y=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),t.REGEXP=/^(\/\/\/\s*/im,t}(g);t.TripleSlashReference=y;var v=function(e){function t(t,n,r){e.call(this,t,n,r),this.isRelative=0===this.path.indexOf("./")||0===this.path.indexOf("../"),this.isRooted=0===this.path.indexOf("/"),this.isAbsolute=!this.isRelative&&!this.isRooted}return __extends(t,e),t.TS=".ts",t.DTS=".d.ts",t}(g);t.ImportReference=v;var T=function(){function e(e,t){this.path=e,this.content=t,this.references=[]}return e.prototype.resolve=function(t,n,r,i){"undefined"==typeof i&&(i={});var o=this;return this.references=n(this.content),i[this.path]=!0,new d.Promise(function(s,a){var l=o.references.length,c=function(){0===--l&&s(null)},u=function(){l+=1};return 0===l?(s(null),void 0):(o.references.forEach(function(s){t.load(o.path,s,r).then(function(o){i[o.path]?(s.file=o,s.error={message:"cyclic reference",path:o.path}):(s.file=o,r.recursive&&s.file instanceof e&&(u(),o.resolve(t,n,r,i).then(function(){c()},a))),c()},function(e){s.error=e,c()})}),void 0)})},e}();t.File=T;var b=function(){function e(){this.references=[]}return e.prototype.getReferences=function(){return this.references},e.prototype.consume=function(e){var t=this,n=p.getAstWalkerFactory().getWalker(function(e){t.vistComments(e.preComments),t.vistImportDeclaration(e),t.vistComments(e.postComments)}),r=this.references.length;return n.walk(e,null),this.references.slice(r)},e.prototype.vistImportDeclaration=function(e){if(e instanceof p.ImportDeclaration){var t=e.alias,n=t.actualText,r=new v(t.minChar+1,-2+t.limChar-t.minChar,n.substring(1,n.length-1));this.references.push(r)}},e.prototype.vistComments=function(e){if(e)for(var t=0;tthis.graphVersionId?!0:!1:!0},t.prototype.setGraph=function(e,t){this.graph=e,this.graphVersionId=t},t.prototype.getGraph=function(){return this.graph},t.prototype.getReferences=function(){return this.references},t.prototype.onContentChange=function(){var e=a.collect(this.target.getValue()),n=!1;if(e.length!==this.references.length)n=!0;else{var r={};this.references.forEach(function(e){r[e.path]=!0}),n=e.some(function(e){return!r[e.path]})}n&&(this.references=e,this.referencesVersionId=this.target.getVersionId(),this.emit(t.EVENTS.OnReferencesChanged,{resource:this.target.getAssociatedResource()}))},t}(p);t.ReferencesState=h}),define("vs/languages/typescript/resources/dependencyResolver",["require","exports","vs/base/lib/winjs.base","vs/base/types"],function(e,t,n,r){"use strict";var i=n,o=r;!function(e){e.OnReferencesChanged="onReferencesChanged"}(t.Events||(t.Events={})),t.Events;var s=function(){function e(){}return e.INSTANCE=new e,e.prototype.fetchDependencies=function(){return i.Promise.as([])},e}();t.NullDependencyResolver=s;var a=function(){function e(e){this.delegates=e}return e.prototype.fetchDependencies=function(e){var t=this.delegates.map(function(t){return t.fetchDependencies(e)});return i.Promise.join(t).then(function(e){for(var t=[],n=0;n0&&".."===i&&(n.splice(r-1,2),r-=2)}return n.join("/")}e.normalize=t,e.dirname=n,e.join=r}(h||(h={}));var C=function(){function e(e,t){this.resourceService=e,this.requestService=t}return e.prototype.load=function(e,t){var n=this;if(!(t instanceof b.TripleSlashReference))return d.Promise.wrapError("only triple slash references are supported");var r=new f.URL(h.join(h.dirname(e),h.normalize(t.path))),i=this.requestService.getPath("root",r),o=new f.URL(this.requestService.getRequestUrl("root",i,!0));if(this.resourceService.contains(o)){var s=this.resourceService.get(o);return d.Promise.as(new b.File(o.toExternal(),s.getValue()))}return this.requestService.makeRequest({url:o.toExternal()}).then(function(e){var t=new b.File(o.toExternal(),e.responseText),r=new v.RemoteModel(o,e.responseText);return n.resourceService.contains(o)||n.resourceService.insert(o,r),t})},e.prototype.dispose=function(){},e}(),w=function(e){function t(t,n){e.call(this),this.resourceService=t,this.requestService=n,this.callOnDispose=[],this.fileLoader=new C(t,n),this.loadRecursivelyValue=!0}return __extends(t,e),t.prototype.dispose=function(){y.cAll(this.callOnDispose)},t.prototype.loadRecursively=function(e){return"undefined"!=typeof e&&(this.loadRecursivelyValue=e),this.loadRecursivelyValue},t.prototype.fetchDependencies=function(e){var t=this;if(!e||e.getScheme()===f.schemas.inMemory)return d.Promise.as([]);var n=this.resourceService.get(e);if(!(n instanceof k.MirrorModel))return d.Promise.as([]);var r=n,i=this.resourcesFromReferenceState(r);if(i)return d.Promise.as(i);var o=this.resourceService.getLinked(e,T.ReferencesState.NAME),s=new b.File(e.toExternal(),r.getValue()),a=r.getVersionId();return b.buildDependencyGraph(this.fileLoader,[s],{recursive:this.loadRecursively(),nodeName:function(e){return e}}).then(function(n){return n.nodes().forEach(function(e){0===e.getName().indexOf("error:")&&n.removeNode(e.getName())}),o.setGraph(n,a),t.resourcesFromGraph(n,e)})},t.prototype.resourcesFromReferenceState=function(e){var t=this,n=e.getAssociatedResource(),r=this.resourceService.getLinked(n,T.ReferencesState.NAME);return r?r.needsUpdate()?null:this.resourcesFromGraph(r.getGraph(),n):(r=new T.ReferencesState(e),this.callOnDispose.push(r.addListener(T.ReferencesState.EVENTS.OnReferencesChanged,function(e){return t.onReferenceStateChanged(e)})),this.resourceService.insertLinked(n,T.ReferencesState.NAME,r),null)},t.prototype.onReferenceStateChanged=function(e){this.emit(S.Events.OnReferencesChanged,e)},t.prototype.resourcesFromGraph=function(e,t){var n=[];return e.traverse(t.toExternal(),function(e){n.unshift(new f.URL(e.getName()))}),n.pop(),n},t}(m.EventEmitter);t.FileBasedResolver=w;var E=function(){function e(e,t,n){this.resourceService=e,this.requestService=t,this.delegate=n,this.baselibs=[]}return e.prototype.setBaselibs=function(e){this.baselibs=e},e.prototype.fetchDependencies=function(){var e=this,t=[];return this.baselibs.forEach(function(n){e.resourceService.contains(n)?t.push(d.Promise.as(n)):t.push(e.requestService.makeRequest({url:n.toExternal()}).then(function(t){var r=new v.DefaultLibModel(n,t.responseText);return e.resourceService.insert(n,r),n},function(){return console.warn("TS - "+n.toExternal()+" can not be loaded as base lib"),null}))}),d.Promise.join(t).then(function(n){return t=[],n.forEach(function(n){n&&t.push(e.delegate.fetchDependencies(n).then(function(e){return e.push(n),e}))}),d.Promise.join(t)}).then(function(e){return g.merge(e)})},e}();t.BaselibDependencyResolver=E});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/languages/typescript/resources/dependencyResolverGraph",["require","exports","vs/base/lib/winjs.base","vs/base/strings","vs/base/env","vs/base/network","vs/editor/core/model/mirrorModel","./remoteModels","./referenceCollection","../service/references","./dependencyResolverFiles"],function(e,t,n,r,i,o,s,a,l,c,u){"use strict";var p,h=n,d=r,f=i,m=o,g=s,y=a,v=l,T=c,b=u;!function(e){function t(e){for(var t,n,r=0,i={};;){if(t=e.indexOf(":",r),n=e.indexOf("\n",t+1),0>t||0>n)break;i[e.substring(r,t).trim()]=e.substring(t+1,n).trim(),r=n+1}return i}function n(e,n){function r(e){if(c)return o("canceled"),void 0;var n=e.indexOf("\r\n\r\n",a);if(-1!==n){var i=t(e.substring(a,n)),u=Number(i["Content-Length"]);n+4+u>e.length||(l.push({header:i,body:e.substr(n+4,u)}),s(l[l.length-1]),a=n+4+u,r(e))}}var i,o,s,a=0,l=[],c=!1,u=new h.Promise(function(e,t,n){i=e,o=t,s=n},function(){c=!0});return e.makeRequest(n).then(function(e){r(e.responseText),i(l)},function(e){o(e)},function(e){f.browser.isIE||3===e.readyState&&r(e.responseText)}).done(null,function(e){o(e)}),u}e.parseHeader=t,e.fetchChunkedData=n}(p||(p={}));var k=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),t.prototype.setModuleSystems=function(e){this.modules=e},t.prototype.onReferenceStateChanged=function(e){var t=this;setTimeout(function(){t.superOnReferenceStateChanged(e)},1e3)},t.prototype.superOnReferenceStateChanged=function(t){e.prototype.onReferenceStateChanged.call(this,t)},t.prototype.fetchDependencies=function(t){var n=this;if(!t)return h.Promise.as([]);var r=this.requestService.getPath("root",t);if(!r)return e.prototype.fetchDependencies.call(this,t);var i=this.resourceService.get(t);if(!(i instanceof g.MirrorModel))return h.Promise.as([]);var o=i,s=this.resourcesFromReferenceState(o);if(s)return h.Promise.as(s);var a=this.builtRequestUrl(t,"typeScriptDependencyGraph"),l=o.getVersionId(),c=this.resourceService.getLinked(t,v.ReferencesState.NAME);return this.requestService.makeRequest({url:a}).then(function(e){var r=JSON.parse(e.responseText),i=n.parseGraph(r);return c.setGraph(i,l),n.resourcesFromGraph(i,t)}).then(function(e){for(var t=[],r=0;r0;)this.callOnDispose.pop()()},n.prototype.injectTelemetryService=function(e){this.telemetryService=e},n.prototype.injectRequestService=function(e){this.requestService=e},n.prototype.injectResourceService=function(e){t.prototype.injectResourceService.call(this,e),this.host=new N.MonacoTypeScriptHost(e);var n=new M.LanguageService(this.host);this.adapter=new x.LanguageServiceAdapter(n,e)},n.prototype.setExtraData=function(e){this.extraData=S.mixin(S.clone(n.defaultExtraData),e||{})},n.prototype.configure=function(e){var t=this;this.delays=S.clone(n.defaultDelays),this.options=S.mixin(S.clone(n.defaultOptions),e||{});var r=new A.CompilationSettings;return r.basepath=this.requestService.getRequestUrl("root","",!0)||"",this.options.showTypeScriptWarnings&&(r.styleSettings.implicitAny=!0,r.styleSettings.reDeclareLocal=!0,r.styleSettings.evalOK=!1,r.styleSettings.newMustBeUsed=!0,r.styleSettings.eqeqeq=!0,r.styleSettings.forin=!1,r.styleSettings.eqnull=!0,r.styleSettings.funcInLoop=!0,r.styleSettings.emptyBlocks=!0),this.host.setCompilationSettings(r),this.adapter.setSuggestConfiguration({useCodeSnippetsOnMethodSuggest:this.options.completeFunctionsAsInvocation}),!this.extraData.includeAllReferences&&this.options.useResidentFlagAggressively&&this.host.setResidentTypes([L.DefaultLibModel,L.RemoteModel]),this.options.updateOnResourceChange&&this.callOnDispose.push(this.resourceService.addBulkListener(function(){return t.scheduleUpdate()})),this.resolver=this.createDependencyResolver(),k.Promise.as(null)},n.prototype.createDependencyResolver=function(){var e=this,t=function(){if(e.requestService.getRequestUrl("typeScriptDependencyGraph")){var t=new D.ModuleSystemConfigurations(e.requestService,e.options.moduleSystems),n=new F.GraphBasedResolver(e.resourceService,e.requestService);return n.setModuleSystems(t),n}return e.requestService.getRequestUrl("root")?new O.FileBasedResolver(e.resourceService,e.requestService):B.NullDependencyResolver.INSTANCE},n=t();n instanceof O.FileBasedResolver&&this.callOnDispose.push(n.addListener(B.Events.OnReferencesChanged,function(t){e.validate(t.resource)})),this.extraData.includeAllReferences&&n instanceof O.FileBasedResolver&&(n.loadRecursively(!1),n=new O.BaselibDependencyResolver(this.resourceService,this.requestService,n),n.setBaselibs([new C.URL(this.requestService.getRequestUrl("root","all.references.ts",!0))]));var r=new O.BaselibDependencyResolver(this.resourceService,this.requestService,t());return r.setBaselibs(this.options.defaultLibraries.map(function(e){return new C.URL(e)})),new B.CompositeDependencyResolver([r,n])},n.prototype.getHost=function(){return this.host},n.prototype.scheduleUpdate=function(){var e=this;if(this.options.updateOnResourceChange){this.scheduleUpdatePromise.cancel();var t=!1,n=k.Promise.as(null);this.scheduleUpdatePromise=new k.Promise(function(n,r){setTimeout(function(){if(t)return r({name:"Canceled"}),void 0;var i=R.start(R.Topic.WORKER,"AUTO update language service");try{e.doUpdateLanguageService(),n(e),i.stop()}catch(o){e.onError(null,o),n(e),i.stop()}},e.delays.updateSoon)},function(){t=!0,n.cancel()})}},n.prototype.fetchDependenciesAndUpdateLanguageService=function(e){var t=this,n=!1;return new k.Promise(function(r,i){t.emitStatus(3),t.resolver.fetchDependencies(e).then(function(r){return t.emitStatus(1),n?(i({name:"Canceled"}),void 0):(e&&r.push(e),t.host.setResources(r),void 0)}).then(function(){try{t.doUpdateLanguageService(),r(t)}catch(e){i(e)}},i)},function(){n=!0}).then(function(e){return t.emitStatus(0),e},function(e){throw t.emitStatus(2),e})},n.prototype.setStatusReporting=function(e){this.shouldEmitStatus=e},n.prototype.emitStatus=function(e){this.shouldEmitStatus&&this.publisher.sendMessage("ts.statusUpdate",{status:e})},n.prototype.doUpdateLanguageService=function(){if(this.currentError)throw{name:"Canceled",message:"updating language service BLOCK because current state caused errors"};this.adapter.getLanguageSerivce().refresh()},n.prototype.onError=function(e,t){var n=this;if("Canceled"!==t.name){this.telemetryService.log("typescript.languageService.update.failure",{detail:P.toErrorMessage(t,!0)}),console.error("ERROR updating language service (file a bug against TypeScript)"),console.error(t),this.currentError=t;var r;r=this.resourceService.addBulkListener(function(){r(),n.currentError=null,console.warn("creating NEW language service after last update failed");var e=new M.LanguageService(n.host);n.adapter.setLanguageService(e)})}return e},n.prototype.updateLanguageService=function(e,t){"undefined"==typeof t&&(t="");var n=R.start(R.Topic.WORKER,"'"+t+"' updates language service");return this.scheduleUpdatePromise.cancel(),this.fetchDependenciesAndUpdateLanguageService(e).then(function(){n.stop()})},n.STYLE_PREFIX="STYLE: ",n.prototype.doValidate=function(e,r){var i=this;this.extraData.validate&&this.updateLanguageService(e,"validate").then(function(){var e={};i.resourceService.all().forEach(function(t){if(t instanceof _.MirrorModel){var n=t;e[n.getAssociatedResource().toExternal()]=[]}});var o=i.adapter.getAllErrors();o.forEach(function(t){e[t.resource.toExternal()].push(t)}),r.batchChanges(function(r){Object.keys(e).forEach(function(o){var s=new C.URL(o),a=i.resourceService.get(s);a instanceof L.RemoteModel||i.adapter.isBaseLibModel(a)||r.changeMarkers(a.getAssociatedResource(),function(s){t.prototype.triggerValidateParticipation.call(i,a.getAssociatedResource(),r,i.adapter.getLanguageSerivce()),(e[o]||[]).forEach(function(e){var t=E.Severity.Error,r=e.message,i=0===e.message.indexOf(n.STYLE_PREFIX);i&&(t=E.Severity.Warning,r=e.message.substr(n.STYLE_PREFIX.length)),s.addMarker(E.createRangeTextMarker(t,2,r,e.range))})})})})},this.onError.bind(this,null))},n.prototype.doSuggest=function(e,t){var n=this;return this.updateLanguageService(e,"doSuggest").then(function(){return n.adapter.suggest(e,t)},this.onError.bind(this,[]))},n.prototype.quickFix=function(e,t){var n=this;return this.updateLanguageService(e,"quickFix").then(function(){return n.adapter.quickFix(e,t)},this.onError.bind(this,[]))},n.prototype.getParameterHints=function(e,t){var n=this;return this.updateLanguageService(e,"getParameterHints").then(function(){return n.adapter.getParameterHints(e,t)},this.onError.bind(this,null))},n.prototype.format=function(e,t,n){var r=this;return this.updateLanguageService(e,"format").then(function(){return r.adapter.format(e,t,n)},this.onError.bind(this,[]))},n.prototype.formatAfterKeystroke=function(e,t,n){var r=this;return this.updateLanguageService(e,"formatAfterKey").then(function(){return r.adapter.formatAfterKeystroke(e,t,n)},this.onError.bind(this,[]))},n.prototype.getActionsAtPosition=function(e,t){var n=this;return this.updateLanguageService(e,"actions at position").then(function(){return n.adapter.getActionsAtPosition(e,t)},this.onError.bind(this,[]))},n.prototype.getOutline=function(e){var t=this;return this.updateLanguageService(e,"outline").then(function(){return t.adapter.getOutline(e)},this.onError.bind(this,[]))},n.prototype.getNavigateToItems=function(e){var t=this;return this.updateLanguageService(null,"navigate to items").then(function(){return t.adapter.getNavigateToItems(e)},this.onError.bind(this,[]))},n.prototype.findOccurrences=function(e,t,n){var r=this;return this.updateLanguageService(e,"find occurrences").then(function(){return r.adapter.findOccurrences(e,t,n)},this.onError.bind(this,[]))},n.prototype.findDeclaration=function(e,t){var n=this;return this.updateLanguageService(e,"find declaration").then(function(){return n.adapter.findDeclaration(e,t)},this.onError.bind(this,null))},n.prototype.findTypeDeclaration=function(e,t){var n=this;return this.updateLanguageService(e,"find type decl").then(function(){return n.adapter.findTypeDeclaration(e,t)},this.onError.bind(this,null))},n.prototype.findReferences=function(e,t){var n=this;return this.updateLanguageService(e,"find references").then(function(){return n.adapter.findReferences(e,t)},this.onError.bind(this,[]))},n.prototype.computeInfo=function(e,t){var n=this;return this.updateLanguageService(e,"hover").then(function(){return n.adapter.getTypeInformationAtPosition(e,t)},this.onError.bind(this,null))},n.prototype.getRangesToPosition=function(e,t){var n=this;return this.updateLanguageService(e,"logical selection").then(function(){return n.adapter.getRangesToPosition(e,t)},this.onError.bind(this,[]))},n.prototype.textReplace=function(e,t){var n=[["true","false"],["string","number","bool"],["private","public"]];return this.valueSetsReplace(n,e,t)},n.prototype.isInternalSymbol=function(e,t){var n=this;return this.updateLanguageService(e,"isInternalSymbol").then(function(){return n.adapter.isInternalSymbol(e,t)},this.onError.bind(this,!1))},n}(w.AbstractWorkerMode);t.TypeScriptWorker2=W,t.value=new W});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/languages/typescript/typescriptWorkerMonitored",["require","exports","vs/base/strings","vs/languages/typescript/typescriptWorker2"],function(e,t,n,r){"use strict";var i=n,o=r,s=function(e){function t(){e.apply(this,arguments),this.versions={},this.averageDurationPerCharacter=0,this.timeLimitViolationCount=0}return __extends(t,e),t.timeLimit=1500,t.timeLimitViolationCount=5,t.predictionRealityRaito=.15,t.prototype.getAndStore=function(){for(var e,t=this.getHost(),n=0,r=0;rt.timeLimit,s=(new Date).getTime();if(o&&this.timeLimitViolationCount>t.timeLimitViolationCount){var a={name:"Canceled",message:i.format("BLOCKING TypeScript operation because it is predicted to be slow (~{0}ms)",r)};throw console.warn(a.message),a}e.prototype.doUpdateLanguageService.call(this);var l=(new Date).getTime()-s;o&&Math.abs(l-r){0}ms) {1} times (will be block after {2} times)",t.timeLimit,this.timeLimitViolationCount,t.timeLimitViolationCount))),0!==n&&(this.averageDurationPerCharacter=(this.averageDurationPerCharacter+l/n)/2)},t}(o.TypeScriptWorker2);t.MonitoredTypeScriptWorker=s,t.value=new s});define("vs/languages/typescript/typescriptWorkerMonitored.nls",[],{vs_languages_lib_javascriptSnippets:["define module","For Loop","For-Each Loop","For-In Loop","Function Statement","If Statement","If-Else Statement","New Statement","Switch Statement","While Statement","Do-While Statement","Try-Catch Statement","Console Log","Set Timeout Function"],vs_languages_typescript_service_typescriptSnippets:["For-Each Loop using =>","jsdoc snippet","Constructor","Class Definition","Public Method Definition","Private Method Definition"]});define("vs/languages/typescript/typescriptWorkerMonitored.nls.keys",[],{vs_languages_lib_javascriptSnippets:["define.snippet","for.snippet","foreach.snippet","forin.snippet","function.snippet","if.snippet","ifelse.snippet","new.snippet","switch.snippet","while.snippet","dowhile.snippet","trycatch.snippet","log.snippet","settimeout.snippet"],vs_languages_typescript_service_typescriptSnippets:["foreach.snippet","jsdoc.snippet","constructor.snippet","class.snippet","publicmethod.snippet","privatemethod.snippet"]});/*--------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ /* ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ var TypeScript;!function(e){function t(e,t){return 0!=(e&t)}function n(e){return e}function r(e,t){for(var n="",r=1;1<<31>r;r<<=1)if(0!=(t&r))for(var i in e)if(e[i]==r){n.length>0&&(n+="|"),n+=i;break}return n}e.hasFlag=t,function(e){e._map=[],e.None=0,e.Comma=1,e.SColon=2,e.Asg=4,e.BinOp=8,e.RBrack=16,e.RCurly=32,e.RParen=64,e.Dot=128,e.Colon=256,e.PrimType=512,e.AddOp=1024,e.LCurly=2048,e.PreOp=4096,e.RegExp=8192,e.LParen=16384,e.LBrack=32768,e.Scope=65536,e.In=1<<17,e.SCase=1<<18,e.Else=1<<19,e.Catch=1<<20,e.Var=1<<21,e.Stmt=1<<22,e.While=1<<23,e.ID=1<<24,e.Prefix=1<<25,e.Literal=1<<26,e.RLit=1<<27,e.Func=1<<28,e.EOF=1<<29,e.TypeScriptS=1<<30,e.ExprStart=e.SColon|e.AddOp|e.LCurly|e.PreOp|e.RegExp|e.LParen|e.LBrack|e.ID|e.Prefix|e.RLit|e.Func|e.Literal,e.StmtStart=e.ExprStart|e.SColon|e.Var|e.Stmt|e.While|e.TypeScriptS,e.Postfix=e.Dot|e.LParen|e.LBrack}(e.ErrorRecoverySet||(e.ErrorRecoverySet={})),e.ErrorRecoverySet,function(e){e._map=[],e.None=0,e.ModuleDeclarations=4,e.ClassDeclarations=8,e.InterfaceDeclarations=16,e.AmbientDeclarations=1024,e.Properties=2048,e.Global=e.ModuleDeclarations|e.ClassDeclarations|e.InterfaceDeclarations|e.AmbientDeclarations,e.QuickParse=e.Global|e.Properties}(e.AllowedElements||(e.AllowedElements={})),e.AllowedElements,function(e){e._map=[],e.None=0,e.Private=1,e.Public=2,e.Readonly=4,e.Ambient=8,e.Exported=16,e.Getter=32,e.Setter=64,e.Static=128}(e.Modifiers||(e.Modifiers={})),e.Modifiers,function(e){e._map=[],e.None=0,e.ExplicitSemicolon=1,e.AutomaticSemicolon=2,e.Writeable=4,e.Error=8,e.DotLHSPartial=16,e.DotLHS=32,e.IsStatement=64,e.StrictMode=128,e.PossibleOptionalParameter=256,e.ClassBaseConstructorCall=512,e.OptionalName=1024,e.SkipNextRParen=2048}(e.ASTFlags||(e.ASTFlags={})),e.ASTFlags,function(e){e._map=[],e.None=0,e.Exported=1,e.Private=2,e.Public=4,e.Ambient=8,e.Static=16,e.LocalStatic=32,e.GetAccessor=64,e.SetAccessor=128}(e.DeclFlags||(e.DeclFlags={})),e.DeclFlags,function(e){e._map=[],e.None=0,e.Exported=1,e.Private=2,e.Public=4,e.Ambient=8,e.Static=16,e.LocalStatic=32,e.GetAccessor=64,e.SetAccessor=128,e.IsEnum=256,e.ShouldEmitModuleDecl=512,e.IsWholeFile=1024,e.IsDynamic=2048,e.MustCaptureThis=4096}(e.ModuleFlags||(e.ModuleFlags={})),e.ModuleFlags,function(e){e._map=[],e.None=0,e.Exported=1,e.Private=2,e.Public=4,e.Ambient=8,e.Static=16,e.LocalStatic=32,e.GetAccessor=64,e.SetAccessor=128,e.Property=256,e.Readonly=512,e.ModuleMember=1024,e.InterfaceMember=2048,e.ClassMember=4096,e.BuiltIn=8192,e.TypeSetDuringScopeAssignment=16384,e.Constant=32768,e.Optional=65536,e.RecursivelyReferenced=1<<17,e.Bound=1<<18,e.CompilerGenerated=1<<19}(e.SymbolFlags||(e.SymbolFlags={})),e.SymbolFlags,function(e){e._map=[],e.None=0,e.Exported=1,e.Private=2,e.Public=4,e.Ambient=8,e.Static=16,e.LocalStatic=32,e.GetAccessor=64,e.SetAccessor=128,e.AutoInit=256,e.Property=512,e.Readonly=1024,e.Class=2048,e.ClassProperty=4096,e.ClassBodyProperty=8192,e.ClassConstructorProperty=16384,e.ClassSuperMustBeFirstCallInConstructor=32768,e.Constant=65536,e.MustCaptureThis=1<<17}(e.VarFlags||(e.VarFlags={})),e.VarFlags,function(e){e._map=[],e.None=0,e.Exported=1,e.Private=2,e.Public=4,e.Ambient=8,e.Static=16,e.LocalStatic=32,e.GetAccessor=64,e.SetAccessor=128,e.Signature=512,e.Method=1024,e.HasReturnExpression=2048,e.CallMember=4096,e.ConstructMember=8192,e.HasSelfReference=16384,e.IsFatArrowFunction=32768,e.IndexerMember=65536,e.IsFunctionExpression=1<<17,e.ClassMethod=1<<18,e.ClassPropertyMethodExported=1<<19,e.HasSuperReferenceInFatArrowFunction=1<<20,e.IsPropertyBound=1<<21}(e.FncFlags||(e.FncFlags={})),e.FncFlags,function(e){e._map=[],e.None=0,e.IsIndexer=1,e.IsStringIndexer=2,e.IsNumberIndexer=4}(e.SignatureFlags||(e.SignatureFlags={})),e.SignatureFlags,e.ToDeclFlags=n,function(e){e._map=[],e.None=0,e.HasImplementation=1,e.HasSelfReference=2,e.MergeResult=4,e.IsEnum=8,e.BuildingName=16,e.HasBaseType=32,e.HasBaseTypeOfObject=64,e.IsClass=128}(e.TypeFlags||(e.TypeFlags={})),e.TypeFlags,function(e){e._map=[],e.SuccessfulComparison=0,e.SourceIsNullTargetIsVoidOrUndefined=1,e.RequiredPropertyIsMissing=2,e.IncompatibleSignatures=4,e.SourceSignatureHasTooManyParameters=3,e.IncompatibleReturnTypes=16,e.IncompatiblePropertyTypes=32,e.IncompatibleParameterTypes=64}(e.TypeRelationshipFlags||(e.TypeRelationshipFlags={})),e.TypeRelationshipFlags,function(e){e._map=[],e.ES3=0,e.ES5=1}(e.CodeGenTarget||(e.CodeGenTarget={}));var i=e.CodeGenTarget;!function(e){e._map=[],e.Synchronous=0,e.Asynchronous=1,e.Local=2}(e.ModuleGenTarget||(e.ModuleGenTarget={}));var o=e.ModuleGenTarget;e.codeGenTarget=i.ES3,e.moduleGenTarget=o.Synchronous,e.optimizeModuleCodeGen=!0,e.flagsToString=r}(TypeScript||(TypeScript={}));var TypeScript;!function(e){!function(e){e._map=[],e._map[0]="None",e.None=0,e._map[1]="Empty",e.Empty=1,e._map[2]="EmptyExpr",e.EmptyExpr=2,e._map[3]="True",e.True=3,e._map[4]="False",e.False=4,e._map[5]="This",e.This=5,e._map[6]="Super",e.Super=6,e._map[7]="QString",e.QString=7,e._map[8]="Regex",e.Regex=8,e._map[9]="Null",e.Null=9,e._map[10]="ArrayLit",e.ArrayLit=10,e._map[11]="ObjectLit",e.ObjectLit=11,e._map[12]="Void",e.Void=12,e._map[13]="Comma",e.Comma=13,e._map[14]="Pos",e.Pos=14,e._map[15]="Neg",e.Neg=15,e._map[16]="Delete",e.Delete=16,e._map[17]="Await",e.Await=17,e._map[18]="In",e.In=18,e._map[19]="Dot",e.Dot=19,e._map[20]="From",e.From=20,e._map[21]="Is",e.Is=21,e._map[22]="InstOf",e.InstOf=22,e._map[23]="Typeof",e.Typeof=23,e._map[24]="NumberLit",e.NumberLit=24,e._map[25]="Name",e.Name=25,e._map[26]="TypeRef",e.TypeRef=26,e._map[27]="Index",e.Index=27,e._map[28]="Call",e.Call=28,e._map[29]="New",e.New=29,e._map[30]="Asg",e.Asg=30,e._map[31]="AsgAdd",e.AsgAdd=31,e._map[32]="AsgSub",e.AsgSub=32,e._map[33]="AsgDiv",e.AsgDiv=33,e._map[34]="AsgMul",e.AsgMul=34,e._map[35]="AsgMod",e.AsgMod=35,e._map[36]="AsgAnd",e.AsgAnd=36,e._map[37]="AsgXor",e.AsgXor=37,e._map[38]="AsgOr",e.AsgOr=38,e._map[39]="AsgLsh",e.AsgLsh=39,e._map[40]="AsgRsh",e.AsgRsh=40,e._map[41]="AsgRs2",e.AsgRs2=41,e._map[42]="ConditionalExpression",e.ConditionalExpression=42,e._map[43]="LogOr",e.LogOr=43,e._map[44]="LogAnd",e.LogAnd=44,e._map[45]="Or",e.Or=45,e._map[46]="Xor",e.Xor=46,e._map[47]="And",e.And=47,e._map[48]="Eq",e.Eq=48,e._map[49]="Ne",e.Ne=49,e._map[50]="Eqv",e.Eqv=50,e._map[51]="NEqv",e.NEqv=51,e._map[52]="Lt",e.Lt=52,e._map[53]="Le",e.Le=53,e._map[54]="Gt",e.Gt=54,e._map[55]="Ge",e.Ge=55,e._map[56]="Add",e.Add=56,e._map[57]="Sub",e.Sub=57,e._map[58]="Mul",e.Mul=58,e._map[59]="Div",e.Div=59,e._map[60]="Mod",e.Mod=60,e._map[61]="Lsh",e.Lsh=61,e._map[62]="Rsh",e.Rsh=62,e._map[63]="Rs2",e.Rs2=63,e._map[64]="Not",e.Not=64,e._map[65]="LogNot",e.LogNot=65,e._map[66]="IncPre",e.IncPre=66,e._map[67]="DecPre",e.DecPre=67,e._map[68]="IncPost",e.IncPost=68,e._map[69]="DecPost",e.DecPost=69,e._map[70]="TypeAssertion",e.TypeAssertion=70,e._map[71]="FuncDecl",e.FuncDecl=71,e._map[72]="Member",e.Member=72,e._map[73]="VarDecl",e.VarDecl=73,e._map[74]="ArgDecl",e.ArgDecl=74,e._map[75]="Return",e.Return=75,e._map[76]="Break",e.Break=76,e._map[77]="Continue",e.Continue=77,e._map[78]="Throw",e.Throw=78,e._map[79]="For",e.For=79,e._map[80]="ForIn",e.ForIn=80,e._map[81]="If",e.If=81,e._map[82]="While",e.While=82,e._map[83]="DoWhile",e.DoWhile=83,e._map[84]="Block",e.Block=84,e._map[85]="Case",e.Case=85,e._map[86]="Switch",e.Switch=86,e._map[87]="Try",e.Try=87,e._map[88]="TryCatch",e.TryCatch=88,e._map[89]="TryFinally",e.TryFinally=89,e._map[90]="Finally",e.Finally=90,e._map[91]="Catch",e.Catch=91,e._map[92]="List",e.List=92,e._map[93]="Script",e.Script=93,e._map[94]="ClassDeclaration",e.ClassDeclaration=94,e._map[95]="InterfaceDeclaration",e.InterfaceDeclaration=95,e._map[96]="ModuleDeclaration",e.ModuleDeclaration=96,e._map[97]="ImportDeclaration",e.ImportDeclaration=97,e._map[98]="With",e.With=98,e._map[99]="Let",e.Let=99,e._map[100]="Label",e.Label=100,e._map[101]="LabeledStatement",e.LabeledStatement=101,e._map[102]="EBStart",e.EBStart=102,e._map[103]="GotoEB",e.GotoEB=103,e._map[104]="EndCode",e.EndCode=104,e._map[105]="Error",e.Error=105,e._map[106]="Comment",e.Comment=106,e._map[107]="Debugger",e.Debugger=107,e.GeneralNode=e.FuncDecl,e.LastAsg=e.AsgRs2}(e.NodeType||(e.NodeType={})),e.NodeType}(TypeScript||(TypeScript={}));var TypeScript;!function(e){function t(e){var t=668265261;return e=61^e^e>>>16,e+=e<<3,e^=e>>>4,e*=t,e^=e>>>15}function n(e,t){return t^(e>>5)+e}var r=function(){function e(){this.prototype=void 0,this.toString=void 0,this.toLocaleString=void 0,this.valueOf=void 0,this.hasOwnProperty=void 0,this.propertyIsEnumerable=void 0,this.isPrototypeOf=void 0,this.constructor=void 0}return e}();e.BlockIntrinsics=r;var i=function(){function e(){this.itemCount=0,this.table=new r}return e.prototype.getAllKeys=function(){var e=[];for(var t in this.table)void 0!=this.table[t]&&(e[e.length]=t);return e},e.prototype.add=function(e,t){return void 0!=this.table[e]?!1:(this.table[e]=t,this.itemCount++,!0)},e.prototype.addOrUpdate=function(e,t){return void 0!=this.table[e]?(this.table[e]=t,!1):(this.table[e]=t,this.itemCount++,!0)},e.prototype.map=function(e,t){for(var n in this.table){var r=this.table[n];void 0!=r&&e(n,this.table[n],t)}},e.prototype.every=function(e,t){for(var n in this.table){var r=this.table[n];if(void 0!=r&&!e(n,this.table[n],t))return!1}return!0},e.prototype.some=function(e,t){for(var n in this.table){var r=this.table[n];if(void 0!=r&&e(n,this.table[n],t))return!0}return!1},e.prototype.count=function(){return this.itemCount},e.prototype.lookup=function(e){var t=this.table[e];return void 0!=t?t:null},e}();e.StringHashTable=i;var o=function(){function e(e,t){this.primaryTable=e,this.secondaryTable=t,this.insertPrimary=!0}return e.prototype.getAllKeys=function(){return this.primaryTable.getAllKeys().concat(this.secondaryTable.getAllKeys())},e.prototype.add=function(e,t){return this.insertPrimary?this.primaryTable.add(e,t):this.secondaryTable.add(e,t)},e.prototype.addOrUpdate=function(e,t){return this.insertPrimary?this.primaryTable.addOrUpdate(e,t):this.secondaryTable.addOrUpdate(e,t)},e.prototype.map=function(e,t){this.primaryTable.map(e,t),this.secondaryTable.map(e,t)},e.prototype.every=function(e,t){return this.primaryTable.every(e,t)&&this.secondaryTable.every(e,t)},e.prototype.some=function(e,t){return this.primaryTable.some(e,t)||this.secondaryTable.some(e,t)},e.prototype.count=function(){return this.primaryTable.count()+this.secondaryTable.count()},e.prototype.lookup=function(e){var t=this.primaryTable.lookup(e);return void 0!=t?t:this.secondaryTable.lookup(e)},e}();e.DualStringHashTable=o,e.numberHashFn=t,e.combineHashes=n;var s=function(){function e(e,t){this.key=e,this.data=t}return e}();e.HashEntry=s;var a=function(){function e(e,t,n){this.size=e,this.hashFn=t,this.equalsFn=n,this.itemCount=0,this.table=new Array;for(var r=0;r=0;n--){if(this.preComments[n].isDocComment()){var r=t.length>0?t[t.length-1]:null;if(null==r||this.preComments[n].limLine==r.minLine||this.preComments[n].limLine+1==r.minLine){t.push(this.preComments[n]);continue}}break}this.docComments=t.reverse()}return this.docComments},n}(t);e.AST=n;var r=function(t){function n(n,r){t.call(this,e.NodeType.Error),this.minChar=n,this.limChar=r}return __extends(n,t),n}(n);e.IncompleteAST=r;var i=function(t){function n(){t.call(this,e.NodeType.List),this.enclosingScope=null,this.members=new Array}return __extends(n,t),n.prototype.addToControlFlow=function(e){for(var t=this.members.length,n=0;t>n;n++){if(e.noContinuation){e.addUnreachable(this.members[n]);break}this.members[n]=e.walk(this.members[n],this)}e.walker.options.goChildren=!1},n.prototype.append=function(e){return this.members[this.members.length]=e,this},n.prototype.appendAll=function(t){if(t.nodeType==e.NodeType.List)for(var n=t,r=0,i=n.members.length;i>r;r++)this.append(n.members[r]);else this.append(t);return this},n.prototype.emit=function(t,n,r){t.recordSourceMappingStart(this),t.emitJavascriptList(this,null,e.TokenID.Semicolon,r,!1,!1),t.recordSourceMappingEnd(this)},n.prototype.typeCheck=function(e){var t=this.members.length;e.nestingLevel++;for(var n=0;t>n;n++)this.members[n]&&(this.members[n]=this.members[n].typeCheck(e));return e.nestingLevel--,this},n}(n);e.ASTList=i;var o=function(t){function r(n,r){t.call(this,e.NodeType.Name),this.actualText=n,this.hasEscapeSequence=r,this.sym=null,this.cloId=-1,this.setText(n,r)}return __extends(r,t),r.prototype.setText=function(e,t){this.actualText=e,this.text=t?n.getResolvedIdentifierName(e):e},r.prototype.isMissing=function(){return!1},r.prototype.isLeaf=function(){return!0},r.prototype.treeViewLabel=function(){return"id: "+this.actualText},r.prototype.printLabel=function(){return this.actualText?"id: "+this.actualText:"name node"},r.prototype.typeCheck=function(e){return e.typeCheckName(this)},r.prototype.emit=function(e){e.emitJavascriptName(this,!0)},r.fromToken=function(e){return new r(e.getText(),e.hasEscapeSequence)},r}(n);e.Identifier=o;var s=function(e){function t(){e.call(this,"__missing")}return __extends(t,e),t.prototype.isMissing=function(){return!0},t.prototype.emit=function(){},t}(o);e.MissingIdentifier=s;var a=function(t){function n(n){t.call(this,e.NodeType.Label),this.id=n}return __extends(n,t),n.prototype.printLabel=function(){return this.id.actualText+":"},n.prototype.typeCheck=function(e){return this.type=e.voidType,this},n.prototype.emit=function(e){e.emitParensAndCommentsInPlace(this,!0),e.recordSourceMappingStart(this),e.recordSourceMappingStart(this.id),e.writeToOutput(this.id.actualText),e.recordSourceMappingEnd(this.id),e.writeLineToOutput(":"),e.recordSourceMappingEnd(this),e.emitParensAndCommentsInPlace(this,!1)},n}(n);e.Label=a;var l=function(e){function t(t){e.call(this,t)}return __extends(t,e),t.prototype.isExpression=function(){return!0},t.prototype.isStatementOrExpression=function(){return!0},t}(n);e.Expression=l;var c=function(t){function n(e,n){t.call(this,e),this.operand=n,this.targetType=null,this.castTerm=null}return __extends(n,t),n.prototype.addToControlFlow=function(n){t.prototype.addToControlFlow.call(this,n),this.nodeType==e.NodeType.Throw&&n.returnStmt()},n.prototype.typeCheck=function(t){switch(this.nodeType){case e.NodeType.Not:return t.typeCheckBitNot(this);case e.NodeType.LogNot:return t.typeCheckLogNot(this);case e.NodeType.Pos:case e.NodeType.Neg:return t.typeCheckUnaryNumberOperator(this);case e.NodeType.IncPost:case e.NodeType.IncPre:case e.NodeType.DecPost:case e.NodeType.DecPre:return t.typeCheckIncOrDec(this);case e.NodeType.ArrayLit:return t.typeCheckArrayLit(this),this;case e.NodeType.ObjectLit:return t.typeCheckObjectLit(this),this;case e.NodeType.Throw:return this.operand=t.typeCheck(this.operand),this.type=t.voidType,this;case e.NodeType.Typeof:return this.operand=t.typeCheck(this.operand),this.type=t.stringType,this;case e.NodeType.Delete:this.operand=t.typeCheck(this.operand),this.type=t.booleanType;break;case e.NodeType.TypeAssertion:this.castTerm=t.typeCheck(this.castTerm);var n=!this.operand.isParenthesized,r=n?this.castTerm.type:null;return t.checker.typeCheckWithContextualType(r,t.checker.inProvisionalTypecheckMode(),!0,this.operand),t.castWithCoercion(this.operand,this.castTerm.type,!1,!0),this.type=this.castTerm.type,this;case e.NodeType.Void:this.operand=t.typeCheck(this.operand),this.type=t.checker.undefinedType;break;default:throw new Error("please implement in derived class")}return this},n.prototype.emit=function(t){switch(t.emitParensAndCommentsInPlace(this,!0),t.recordSourceMappingStart(this),this.nodeType){case e.NodeType.IncPost:t.emitJavascript(this.operand,e.TokenID.PlusPlus,!1),t.writeToOutput("++");break;case e.NodeType.LogNot:t.writeToOutput("!"),t.emitJavascript(this.operand,e.TokenID.Exclamation,!1);break;case e.NodeType.DecPost:t.emitJavascript(this.operand,e.TokenID.MinusMinus,!1),t.writeToOutput("--");break;case e.NodeType.ObjectLit:t.emitObjectLiteral(this.operand);break;case e.NodeType.ArrayLit:t.emitArrayLiteral(this.operand);break;case e.NodeType.Not:t.writeToOutput("~"),t.emitJavascript(this.operand,e.TokenID.Tilde,!1);break;case e.NodeType.Neg:t.writeToOutput("-"),this.operand.nodeType==e.NodeType.Neg&&(this.operand.isParenthesized=!0),t.emitJavascript(this.operand,e.TokenID.Minus,!1);break;case e.NodeType.Pos:t.writeToOutput("+"),this.operand.nodeType==e.NodeType.Pos&&(this.operand.isParenthesized=!0),t.emitJavascript(this.operand,e.TokenID.Plus,!1);break;case e.NodeType.IncPre:t.writeToOutput("++"),t.emitJavascript(this.operand,e.TokenID.PlusPlus,!1);break;case e.NodeType.DecPre:t.writeToOutput("--"),t.emitJavascript(this.operand,e.TokenID.MinusMinus,!1);break;case e.NodeType.Throw:t.writeToOutput("throw "),t.emitJavascript(this.operand,e.TokenID.Tilde,!1),t.writeToOutput(";");break;case e.NodeType.Typeof:t.writeToOutput("typeof "),t.emitJavascript(this.operand,e.TokenID.Tilde,!1);break;case e.NodeType.Delete:t.writeToOutput("delete "),t.emitJavascript(this.operand,e.TokenID.Tilde,!1);break;case e.NodeType.Void:t.writeToOutput("void "),t.emitJavascript(this.operand,e.TokenID.Tilde,!1);break;case e.NodeType.TypeAssertion:t.emitJavascript(this.operand,e.TokenID.Tilde,!1);break;default:throw new Error("please implement in derived class")}t.recordSourceMappingEnd(this),t.emitParensAndCommentsInPlace(this,!1)},n}(l);e.UnaryExpression=c;var u=function(t){function n(e,n,r){t.call(this,e),this.target=n,this.arguments=r,this.signature=null,this.minChar=this.target.minChar}return __extends(n,t),n.prototype.typeCheck=function(t){return this.nodeType==e.NodeType.New?t.typeCheckNew(this):t.typeCheckCall(this)},n.prototype.emit=function(t){t.emitParensAndCommentsInPlace(this,!0),t.recordSourceMappingStart(this),this.nodeType==e.NodeType.New?t.emitNew(this.target,this.arguments):t.emitCall(this,this.target,this.arguments),t.recordSourceMappingEnd(this),t.emitParensAndCommentsInPlace(this,!1)},n}(l);e.CallExpression=u;var p=function(t){function n(e,n,r){t.call(this,e),this.operand1=n,this.operand2=r}return __extends(n,t),n.prototype.typeCheck=function(t){switch(this.nodeType){case e.NodeType.Dot:return t.typeCheckDotOperator(this);case e.NodeType.Asg:return t.typeCheckAsgOperator(this);case e.NodeType.Add:case e.NodeType.Sub:case e.NodeType.Mul:case e.NodeType.Div:case e.NodeType.Mod:case e.NodeType.Or:case e.NodeType.And:return t.typeCheckArithmeticOperator(this,!1);case e.NodeType.Xor:return t.typeCheckBitwiseOperator(this,!1);case e.NodeType.Ne:case e.NodeType.Eq:var n;t.checker.styleSettings.eqeqeq?(n=e.nodeTypeTable[this.nodeType],t.checker.errorReporter.styleError(this,"use of "+n)):t.checker.styleSettings.eqnull&&(n=e.nodeTypeTable[this.nodeType],null!==this.operand2&&this.operand2.nodeType==e.NodeType.Null&&t.checker.errorReporter.styleError(this,"use of "+n+" to compare with null"));case e.NodeType.Eqv:case e.NodeType.NEqv:case e.NodeType.Lt:case e.NodeType.Le:case e.NodeType.Ge:case e.NodeType.Gt:return t.typeCheckBooleanOperator(this);case e.NodeType.Index:return t.typeCheckIndex(this);case e.NodeType.Member:return this.type=t.voidType,this;case e.NodeType.LogOr:return t.typeCheckLogOr(this);case e.NodeType.LogAnd:return t.typeCheckLogAnd(this);case e.NodeType.AsgAdd:case e.NodeType.AsgSub:case e.NodeType.AsgMul:case e.NodeType.AsgDiv:case e.NodeType.AsgMod:case e.NodeType.AsgOr:case e.NodeType.AsgAnd:return t.typeCheckArithmeticOperator(this,!0);case e.NodeType.AsgXor:return t.typeCheckBitwiseOperator(this,!0);case e.NodeType.Lsh:case e.NodeType.Rsh:case e.NodeType.Rs2:return t.typeCheckShift(this,!1);case e.NodeType.AsgLsh:case e.NodeType.AsgRsh:case e.NodeType.AsgRs2:return t.typeCheckShift(this,!0);case e.NodeType.Comma:return t.typeCheckCommaOperator(this);case e.NodeType.InstOf:return t.typeCheckInstOf(this);case e.NodeType.In:return t.typeCheckInOperator(this);case e.NodeType.From:t.checker.errorReporter.simpleError(this,"Illegal use of 'from' keyword in binary expression");break;default:throw new Error("please implement in derived class")}return this},n.prototype.emit=function(t){var n=e.nodeTypeToTokTable[this.nodeType];if(t.emitParensAndCommentsInPlace(this,!0),t.recordSourceMappingStart(this),void 0!=n)t.emitJavascript(this.operand1,n,!1),"instanceof"==e.tokenTable[n].text?t.writeToOutput(" instanceof "):"in"==e.tokenTable[n].text?t.writeToOutput(" in "):t.writeToOutputTrimmable(" "+e.tokenTable[n].text+" "),t.emitJavascript(this.operand2,n,!1);else switch(this.nodeType){case e.NodeType.Dot:t.tryEmitConstant(this)||(t.emitJavascript(this.operand1,e.TokenID.Dot,!1),t.writeToOutput("."),t.emitJavascriptName(this.operand2,!1));break;case e.NodeType.Index:t.emitIndex(this.operand1,this.operand2);break;case e.NodeType.Member:if(this.operand2.nodeType==e.NodeType.FuncDecl&&this.operand2.isAccessor()){var r=this.operand2;e.hasFlag(r.fncFlags,e.FncFlags.GetAccessor)?t.writeToOutput("get "):t.writeToOutput("set "),t.emitJavascript(this.operand1,e.TokenID.Colon,!1)}else t.emitJavascript(this.operand1,e.TokenID.Colon,!1),t.writeToOutputTrimmable(": ");t.emitJavascript(this.operand2,e.TokenID.Comma,!1);break;case e.NodeType.Comma:t.emitJavascript(this.operand1,e.TokenID.Comma,!1),t.emitState.inObjectLiteral?t.writeLineToOutput(", "):t.writeToOutput(","),t.emitJavascript(this.operand2,e.TokenID.Comma,!1);break;case e.NodeType.Is:throw new Error("should be de-sugared during type check");default:throw new Error("please implement in derived class")}t.recordSourceMappingEnd(this),t.emitParensAndCommentsInPlace(this,!1)},n}(l);e.BinaryExpression=p;var h=function(t){function n(n,r,i){t.call(this,e.NodeType.ConditionalExpression),this.operand1=n,this.operand2=r,this.operand3=i}return __extends(n,t),n.prototype.typeCheck=function(e){return e.typeCheckQMark(this)},n.prototype.emit=function(t){t.emitParensAndCommentsInPlace(this,!0),t.recordSourceMappingStart(this),t.emitJavascript(this.operand1,e.TokenID.Question,!1),t.writeToOutput(" ? "),t.emitJavascript(this.operand2,e.TokenID.Question,!1),t.writeToOutput(" : "),t.emitJavascript(this.operand3,e.TokenID.Question,!1),t.recordSourceMappingEnd(this),t.emitParensAndCommentsInPlace(this,!1)},n}(l);e.ConditionalExpression=h;var d=function(t){function n(n,r){t.call(this,e.NodeType.NumberLit),this.value=n,this.text=r}return __extends(n,t),n.prototype.typeCheck=function(e){return this.type=e.doubleType,this},n.prototype.treeViewLabel=function(){return"num: "+this.printLabel()},n.prototype.emit=function(e){e.emitParensAndCommentsInPlace(this,!0),e.recordSourceMappingStart(this),e.writeToOutput(this.text),e.recordSourceMappingEnd(this),e.emitParensAndCommentsInPlace(this,!1)},n.prototype.printLabel=function(){return this.text},n}(l);e.NumberLiteral=d;var f=function(t){function n(n){t.call(this,e.NodeType.Regex),this.text=n}return __extends(n,t),n.prototype.typeCheck=function(e){return this.type=e.regexType,this},n.prototype.emit=function(e){e.emitParensAndCommentsInPlace(this,!0),e.recordSourceMappingStart(this),e.writeToOutput(this.text),e.recordSourceMappingEnd(this),e.emitParensAndCommentsInPlace(this,!1)},n}(l);e.RegexLiteral=f;var m=function(t){function n(n){t.call(this,e.NodeType.QString),this.text=n}return __extends(n,t),n.prototype.emit=function(e){e.emitParensAndCommentsInPlace(this,!0),e.recordSourceMappingStart(this),e.emitStringLiteral(this.text),e.recordSourceMappingEnd(this),e.emitParensAndCommentsInPlace(this,!1)},n.prototype.typeCheck=function(e){return this.type=e.stringType,this},n.prototype.treeViewLabel=function(){return"st: "+this.text},n.prototype.printLabel=function(){return this.text},n}(l);e.StringLiteral=m;var g=function(e){function t(t){e.call(this,t)}return __extends(t,e),t}(n);e.ModuleElement=g;var y=function(t){function n(n,r){t.call(this,e.NodeType.ImportDeclaration),this.id=n,this.alias=r,this.varFlags=e.VarFlags.None,this.isDynamicImport=!1}return __extends(n,t),n.prototype.isStatementOrExpression=function(){return!0},n.prototype.isDeclaration=function(){return!0},n.prototype.emit=function(t){if(this.alias.type,!this.isDynamicImport||this.id.sym&&!this.id.sym.onlyReferencedAsTypeRef){var n=t.modAliasId,r=t.firstModAlias;t.recordSourceMappingStart(this),t.emitParensAndCommentsInPlace(this,!0),t.writeToOutput("var "+this.id.actualText+" = "),t.modAliasId=this.id.actualText,t.firstModAlias=this.firstAliasedModToString(),t.emitJavascript(this.alias,e.TokenID.Tilde,!1),this.isDynamicImport||t.writeToOutput(";"),t.emitParensAndCommentsInPlace(this,!1),t.recordSourceMappingEnd(this),t.modAliasId=n,t.firstModAlias=r}},n.prototype.typeCheck=function(e){return e.typeCheckImportDecl(this)},n.prototype.getAliasName=function(t){if("undefined"==typeof t&&(t=this.alias),t.nodeType==e.NodeType.Name)return t.actualText;var n=t;return this.getAliasName(n.operand1)+"."+this.getAliasName(n.operand2)},n.prototype.firstAliasedModToString=function(){if(this.alias.nodeType==e.NodeType.Name)return this.alias.actualText;var t=this.alias,n=t.operand1;return n.actualText},n}(g);e.ImportDeclaration=y;var v=function(t){function n(n,r,i){t.call(this,r),this.id=n,this.nestingLevel=i,this.init=null,this.typeExpr=null,this.varFlags=e.VarFlags.None,this.sym=null}return __extends(n,t),n.prototype.isDeclaration=function(){return!0},n.prototype.isStatementOrExpression=function(){return!0},n.prototype.isPrivate=function(){return e.hasFlag(this.varFlags,e.VarFlags.Private)},n.prototype.isPublic=function(){return e.hasFlag(this.varFlags,e.VarFlags.Public)},n.prototype.isProperty=function(){return e.hasFlag(this.varFlags,e.VarFlags.Property)},n.prototype.typeCheck=function(e){return e.typeCheckBoundDecl(this)},n.prototype.printLabel=function(){return this.treeViewLabel()},n}(n);e.BoundDecl=v;var T=function(t){function n(n,r,i){t.call(this,n,e.NodeType.VarDecl,r),this.tokenId=i||e.TokenID.Var}return __extends(n,t),n.prototype.isAmbient=function(){return e.hasFlag(this.varFlags,e.VarFlags.Ambient)},n.prototype.isExported=function(){return e.hasFlag(this.varFlags,e.VarFlags.Exported)},n.prototype.isStatic=function(){return e.hasFlag(this.varFlags,e.VarFlags.Static)},n.prototype.emit=function(e,t){e.emitJavascriptVarDecl(this,t)},n.prototype.treeViewLabel=function(){var t="";switch(this.tokenId){case e.TokenID.Const:t="const ";break;case e.TokenID.Let:t="let ";break;case e.TokenID.Var:t="var "}return t+=this.id.actualText},n}(v);e.VarDecl=T;var b=function(t){function n(n){t.call(this,n,e.NodeType.ArgDecl,0),this.isOptional=!1,this.parameterPropertySym=null}return __extends(n,t),n.prototype.isOptionalArg=function(){return this.isOptional||this.init},n.prototype.treeViewLabel=function(){return"arg: "+this.id.actualText},n.prototype.emit=function(e){e.emitParensAndCommentsInPlace(this,!0),e.recordSourceMappingStart(this),e.writeToOutput(this.id.actualText),e.recordSourceMappingEnd(this),e.emitParensAndCommentsInPlace(this,!1)},n}(v);e.ArgDecl=b;var k=0,S=function(t){function n(n,r,i,o,s,a,l,c){t.call(this,c),this.name=n,this.bod=r,this.isConstructor=i,this.arguments=o,this.vars=s,this.scopes=a,this.statics=l,this.hint=null,this.fncFlags=e.FncFlags.None,this.returnTypeAnnotation=null,this.variableArgList=!1,this.jumpRefs=null,this.internalNameCache=null,this.tmp1Declared=!1,this.enclosingFnc=null,this.freeVariables=[],this.unitIndex=-1,this.classDecl=null,this.boundToProperty=null,this.isOverload=!1,this.innerStaticFuncs=[],this.isInlineCallLiteral=!1,this.accessorSymbol=null,this.leftCurlyCount=0,this.rightCurlyCount=0,this.returnStatementsWithExpressions=[],this.scopeType=null,this.endingToken=null,this.constructorSpan=null }return __extends(n,t),n.prototype.isDeclaration=function(){return!0},n.prototype.internalName=function(){if(null==this.internalNameCache){var e=this.getNameText();this.internalNameCache=e?"_internal_"+e:"_internal_"+k++}return this.internalNameCache},n.prototype.hasSelfReference=function(){return e.hasFlag(this.fncFlags,e.FncFlags.HasSelfReference)},n.prototype.setHasSelfReference=function(){this.fncFlags|=e.FncFlags.HasSelfReference},n.prototype.hasSuperReferenceInFatArrowFunction=function(){return e.hasFlag(this.fncFlags,e.FncFlags.HasSuperReferenceInFatArrowFunction)},n.prototype.setHasSuperReferenceInFatArrowFunction=function(){this.fncFlags|=e.FncFlags.HasSuperReferenceInFatArrowFunction},n.prototype.addCloRef=function(e,t){null==this.envids&&(this.envids=new Array),this.envids[this.envids.length]=e;var n=this.enclosingFnc;if(t)for(;n&&n.type.symbol!=t.container;)n.addJumpRef(t),n=n.enclosingFnc;return this.envids.length-1},n.prototype.addJumpRef=function(e){null==this.jumpRefs&&(this.jumpRefs=new Array);var t=new o(e.name);this.jumpRefs[this.jumpRefs.length]=t,t.sym=e,t.cloId=this.addCloRef(t,null)},n.prototype.buildControlFlow=function(){var t=new e.BasicBlock,n=new e.BasicBlock,r=new e.ControlFlowContext(t,n),i=function(e,t,n){return e.addToControlFlow(n.state),e},o=e.getAstWalkerFactory().getWalker(i,null,null,r);return r.walker=o,o.walk(this.bod,this),r},n.prototype.typeCheck=function(e){return e.typeCheckFunction(this)},n.prototype.emit=function(e){e.emitJavascriptFunction(this)},n.prototype.getNameText=function(){return this.name?this.name.actualText:this.hint},n.prototype.isMethod=function(){return(this.fncFlags&e.FncFlags.Method)!=e.FncFlags.None},n.prototype.isCallMember=function(){return e.hasFlag(this.fncFlags,e.FncFlags.CallMember)},n.prototype.isConstructMember=function(){return e.hasFlag(this.fncFlags,e.FncFlags.ConstructMember)},n.prototype.isIndexerMember=function(){return e.hasFlag(this.fncFlags,e.FncFlags.IndexerMember)},n.prototype.isSpecialFn=function(){return this.isCallMember()||this.isIndexerMember()||this.isConstructMember()},n.prototype.isAnonymousFn=function(){return null===this.name},n.prototype.isAccessor=function(){return e.hasFlag(this.fncFlags,e.FncFlags.GetAccessor)||e.hasFlag(this.fncFlags,e.FncFlags.SetAccessor)},n.prototype.isGetAccessor=function(){return e.hasFlag(this.fncFlags,e.FncFlags.GetAccessor)},n.prototype.isSetAccessor=function(){return e.hasFlag(this.fncFlags,e.FncFlags.SetAccessor)},n.prototype.isAmbient=function(){return e.hasFlag(this.fncFlags,e.FncFlags.Ambient)},n.prototype.isExported=function(){return e.hasFlag(this.fncFlags,e.FncFlags.Exported)},n.prototype.isPrivate=function(){return e.hasFlag(this.fncFlags,e.FncFlags.Private)},n.prototype.isPublic=function(){return e.hasFlag(this.fncFlags,e.FncFlags.Public)},n.prototype.isStatic=function(){return e.hasFlag(this.fncFlags,e.FncFlags.Static)},n.prototype.treeViewLabel=function(){return null==this.name?"funcExpr":"func: "+this.name.actualText},n.prototype.ClearFlags=function(){this.fncFlags=e.FncFlags.None},n.prototype.isSignature=function(){return(this.fncFlags&e.FncFlags.Signature)!=e.FncFlags.None},n}(n);e.FuncDecl=S;var C=function(){function e(e,t,n){this.filename=e,this.lineMap=t,this.unitIndex=n}return e}();e.LocationInfo=C,e.unknownLocationInfo=new C("unknown",null,-1);var w=function(t){function n(n,r){t.call(this,new o("script"),null,!1,null,n,r,null,e.NodeType.Script),this.locationInfo=null,this.referencedFiles=[],this.requiresGlobal=!1,this.requiresExtendsBlock=!1,this.isResident=!1,this.isDeclareFile=!1,this.hasBeenTypeChecked=!1,this.topLevelMod=null,this.leftCurlyCount=0,this.rightCurlyCount=0,this.containsUnicodeChar=!1,this.containsUnicodeCharInComment=!1,this.externallyVisibleImportedSymbols=[],this.vars=n}return __extends(n,t),n.prototype.setCachedEmitRequired=function(e){return this.cachedEmitRequired=e,this.cachedEmitRequired},n.prototype.typeCheck=function(e){return e.typeCheckScript(this)},n.prototype.treeViewLabel=function(){return"Script"},n.prototype.emitRequired=function(t){if(void 0!=this.cachedEmitRequired)return this.cachedEmitRequired;if(!this.isDeclareFile&&!this.isResident&&this.bod){if(0==this.bod.members.length)return this.setCachedEmitRequired(!0);for(var n=0,r=this.bod.members.length;r>n;n++){var i=this.bod.members[n];if(i.nodeType==e.NodeType.ModuleDeclaration){if(!e.hasFlag(i.modFlags,e.ModuleFlags.ShouldEmitModuleDecl|e.ModuleFlags.Ambient))return this.setCachedEmitRequired(!0)}else if(i.nodeType==e.NodeType.ClassDeclaration){if(!e.hasFlag(i.varFlags,e.VarFlags.Ambient))return this.setCachedEmitRequired(!0)}else if(i.nodeType==e.NodeType.VarDecl){if(!e.hasFlag(i.varFlags,e.VarFlags.Ambient))return this.setCachedEmitRequired(!0)}else if(i.nodeType==e.NodeType.FuncDecl){if(!i.isSignature())return this.setCachedEmitRequired(!0)}else if(i.nodeType!=e.NodeType.InterfaceDeclaration&&i.nodeType!=e.NodeType.Empty)return this.setCachedEmitRequired(!0)}if(t.emitComments&&(this.bod.preComments&&this.bod.preComments.length>0||this.bod.postComments&&this.bod.postComments.length>0))return this.setCachedEmitRequired(!0)}return this.setCachedEmitRequired(!1)},n.prototype.emit=function(t){this.emitRequired(t.emitOptions)&&t.emitJavascriptList(this.bod,null,e.TokenID.Semicolon,!0,!1,!1,!0,this.requiresExtendsBlock)},n.prototype.AddExternallyVisibleImportedSymbol=function(t,n){if(!this.isExternallyVisibleSymbol(t)){if(!t.getType().symbol.isExternallyVisible(n)){var r="",i=t.getType().symbol.prettyName;e.isQuoted(i)||(r="'"),n.errorReporter.simpleError(t.declAST,"Externally visible import statement uses non exported module "+r+i+r)}this.externallyVisibleImportedSymbols.push(t)}},n.prototype.isExternallyVisibleSymbol=function(e){for(var t=0;ti;i++)this.labels.members[i].emit(e,t,n);this.stmt.emit(e,t,!0),e.recordSourceMappingEnd(this),e.emitParensAndCommentsInPlace(this,!1)},n.prototype.typeCheck=function(e){return e.typeCheck(this.labels),this.stmt=this.stmt.typeCheck(e),this},n.prototype.addToControlFlow=function(t){var n=t.current,r=new e.BasicBlock;t.current=r,n.addSuccessor(r)},n}(I);e.LabeledStatement=A;var M=function(t){function n(n,r){t.call(this,e.NodeType.Block),this.statements=n,this.isStatementBlock=r}return __extends(n,t),n.prototype.emit=function(t){t.emitParensAndCommentsInPlace(this,!0),t.recordSourceMappingStart(this),this.isStatementBlock?(t.writeLineToOutput(" {"),t.indenter.increaseIndent()):t.setInVarBlock(this.statements.members.length);var n=t.setInObjectLiteral(!1);this.statements&&t.emitJavascriptList(this.statements,null,e.TokenID.Semicolon,!0,!1,!1),this.isStatementBlock&&(t.indenter.decreaseIndent(),t.emitIndent(),t.writeToOutput("}")),t.setInObjectLiteral(n),t.recordSourceMappingEnd(this),t.emitParensAndCommentsInPlace(this,!1)},n.prototype.addToControlFlow=function(t){var n=new e.BasicBlock;t.pushStatement(this,t.current,n),this.statements&&t.walk(this.statements,this),t.walker.options.goChildren=!1,t.popStatement(),n.predecessors.length>0&&(t.current.addSuccessor(n),t.current=n)},n.prototype.typeCheck=function(e){return e.checker.styleSettings.emptyBlocks||(null===this.statements||0==this.statements.members.length)&&e.checker.errorReporter.styleError(this,"empty block"),e.typeCheck(this.statements),this},n}(I);e.Block=M;var R=function(t){function n(e){t.call(this,e),this.target=null,this.resolvedTarget=null}return __extends(n,t),n.prototype.hasExplicitTarget=function(){return this.target},n.prototype.setResolvedTarget=function(t,n){return n.isLoop()?(this.resolvedTarget=n,!0):this.nodeType===e.NodeType.Continue?(t.reportParseError("continue statement applies only to loops"),!1):n.nodeType==e.NodeType.Switch||this.hasExplicitTarget()?(this.resolvedTarget=n,!0):(t.reportParseError("break statement with no label can apply only to a loop or switch statement"),!1)},n.prototype.addToControlFlow=function(n){t.prototype.addToControlFlow.call(this,n),n.unconditionalBranch(this.resolvedTarget,this.nodeType==e.NodeType.Continue)},n.prototype.emit=function(t){t.emitParensAndCommentsInPlace(this,!0),t.recordSourceMappingStart(this),this.nodeType==e.NodeType.Break?t.writeToOutput("break"):t.writeToOutput("continue"),this.hasExplicitTarget()&&t.writeToOutput(" "+this.target),t.recordSourceMappingEnd(this),t.writeToOutput(";"),t.emitParensAndCommentsInPlace(this,!1)},n}(I);e.Jump=R;var P=function(t){function n(n){t.call(this,e.NodeType.While),this.cond=n,this.body=null}return __extends(n,t),n.prototype.isLoop=function(){return!0},n.prototype.emit=function(t){t.emitParensAndCommentsInPlace(this,!0),t.recordSourceMappingStart(this);var n=t.setInObjectLiteral(!1);t.writeToOutput("while("),t.emitJavascript(this.cond,e.TokenID.While,!1),t.writeToOutput(")"),t.emitJavascriptStatements(this.body,!1),t.setInObjectLiteral(n),t.recordSourceMappingEnd(this),t.emitParensAndCommentsInPlace(this,!1)},n.prototype.typeCheck=function(e){return e.typeCheckWhile(this)},n.prototype.addToControlFlow=function(t){var n=t.current,r=new e.BasicBlock,i=new e.BasicBlock;n.addSuccessor(r),t.current=r,t.addContent(this.cond);var o=t.current,s=null;if(this.body&&(t.current=new e.BasicBlock,o.addSuccessor(t.current),t.pushStatement(this,r,i),t.walk(this.body,this),s=t.popStatement()),!t.noContinuation){var a=t.current;a.addSuccessor(r)}t.current=i,o.addSuccessor(i),t.noContinuation=!1,t.walker.options.goChildren=!1},n}(I);e.WhileStatement=P;var D=function(t){function n(){t.call(this,e.NodeType.DoWhile),this.body=null,this.whileAST=null,this.cond=null}return __extends(n,t),n.prototype.isLoop=function(){return!0},n.prototype.emit=function(t){t.emitParensAndCommentsInPlace(this,!0),t.recordSourceMappingStart(this);var n=t.setInObjectLiteral(!1);t.writeToOutput("do"),t.emitJavascriptStatements(this.body,!0),t.recordSourceMappingStart(this.whileAST),t.writeToOutput("while"),t.recordSourceMappingEnd(this.whileAST),t.writeToOutput("("),t.emitJavascript(this.cond,e.TokenID.CloseParen,!1),t.writeToOutput(")"),t.setInObjectLiteral(n),t.recordSourceMappingEnd(this),t.writeToOutput(";"),t.emitParensAndCommentsInPlace(this,!1)},n.prototype.typeCheck=function(e){return e.typeCheckDoWhile(this)},n.prototype.addToControlFlow=function(t){var n=t.current,r=new e.BasicBlock,i=new e.BasicBlock;n.addSuccessor(r),t.current=r;var o=null;if(this.body&&(t.pushStatement(this,r,i),t.walk(this.body,this),o=t.popStatement()),t.noContinuation)t.addUnreachable(this.cond);else{var s=t.current;s.addSuccessor(r),t.addContent(this.cond),t.current=i,s.addSuccessor(i)}t.walker.options.goChildren=!1},n}(I);e.DoWhileStatement=D;var O=function(n){function r(r){n.call(this,e.NodeType.If),this.cond=r,this.elseBod=null,this.statement=new t}return __extends(r,n),r.prototype.isCompoundStatement=function(){return!0},r.prototype.emit=function(t,n){t.emitParensAndCommentsInPlace(this,!0),t.recordSourceMappingStart(this);var r=t.setInObjectLiteral(!1);t.recordSourceMappingStart(this.statement),t.writeToOutput("if("),t.emitJavascript(this.cond,e.TokenID.If,!1),t.writeToOutput(")"),t.recordSourceMappingEnd(this.statement),t.emitJavascriptStatements(this.thenBod,!0),this.elseBod&&(this.elseBod.nodeType===e.NodeType.If?(t.writeToOutput(" else "),this.elseBod.emit(t,n,!1)):(t.writeToOutput(" else"),t.emitJavascriptStatements(this.elseBod,!0))),t.setInObjectLiteral(r),t.recordSourceMappingEnd(this),t.emitParensAndCommentsInPlace(this,!1)},r.prototype.typeCheck=function(e){return e.typeCheckIf(this)},r.prototype.addToControlFlow=function(t){this.cond.addToControlFlow(t);var n=new e.BasicBlock,r=t.current;t.pushStatement(this,r,n);var i=!1;t.current=new e.BasicBlock,r.addSuccessor(t.current),t.walk(this.thenBod,this),t.noContinuation||(i=!0,t.current.addSuccessor(n)),this.elseBod?(t.current=new e.BasicBlock,t.noContinuation=!1,r.addSuccessor(t.current),t.walk(this.elseBod,this),t.noContinuation?i&&(t.noContinuation=!1):(i=!0,t.current.addSuccessor(n))):(r.addSuccessor(n),t.noContinuation=!1,i=!0),t.popStatement(),n.predecessors.length>0&&(t.noContinuation=!1,i=!0),i&&(t.current=n),t.walker.options.goChildren=!1},r}(I);e.IfStatement=O;var F=function(t){function n(){t.call(this,e.NodeType.Return),this.returnExpression=null}return __extends(n,t),n.prototype.emit=function(t){t.emitParensAndCommentsInPlace(this,!0),t.recordSourceMappingStart(this);var n=t.setInObjectLiteral(!1);this.returnExpression?(t.writeToOutput("return "),t.emitJavascript(this.returnExpression,e.TokenID.Semicolon,!1),this.returnExpression.nodeType===e.NodeType.FuncDecl&&t.writeToOutput(";")):t.writeToOutput("return;"),t.setInObjectLiteral(n),t.recordSourceMappingEnd(this),t.emitParensAndCommentsInPlace(this,!1)},n.prototype.addToControlFlow=function(e){t.prototype.addToControlFlow.call(this,e),e.returnStmt()},n.prototype.typeCheck=function(e){return e.typeCheckReturn(this)},n}(I);e.ReturnStatement=F;var B=function(t){function n(){t.call(this,e.NodeType.EndCode)}return __extends(n,t),n}(n);e.EndCode=B;var W=function(n){function r(r,i){n.call(this,e.NodeType.ForIn),this.lval=r,this.obj=i,this.statement=new t,this.lval&&this.lval.nodeType==e.NodeType.VarDecl&&(this.lval.varFlags|=e.VarFlags.AutoInit)}return __extends(r,n),r.prototype.isLoop=function(){return!0},r.prototype.isFiltered=function(){if(this.body){var t=null;if(this.body.nodeType==e.NodeType.List){var n=this.body;1==n.members.length&&(t=n.members[0])}else t=this.body;if(null!==t){if(t.nodeType==e.NodeType.Block){var r=t;null!==r.statements&&1==r.statements.members.length&&(t=r.statements.members[0])}if(t.nodeType==e.NodeType.If){var i=t.cond;if(i.nodeType==e.NodeType.Call){var o=i.target;if(o.nodeType==e.NodeType.Dot){var s=o;if(s.operand1.nodeType==e.NodeType.Name&&this.obj.nodeType==e.NodeType.Name&&s.operand1.actualText==this.obj.actualText){var a=s.operand2;if("hasOwnProperty"==a.actualText){var l=i.arguments;if(null!==l&&1==l.members.length){var c=l.members[0];if(c.nodeType==e.NodeType.Name&&this.lval.nodeType==e.NodeType.Name&&this.lval.actualText==c.actualText)return!0}}}}}}}}return!1},r.prototype.emit=function(t){t.emitParensAndCommentsInPlace(this,!0),t.recordSourceMappingStart(this);var n=t.setInObjectLiteral(!1);t.recordSourceMappingStart(this.statement),t.writeToOutput("for("),t.emitJavascript(this.lval,e.TokenID.For,!1),t.writeToOutput(" in "),t.emitJavascript(this.obj,e.TokenID.For,!1),t.writeToOutput(")"),t.recordSourceMappingEnd(this.statement),t.emitJavascriptStatements(this.body,!0),t.setInObjectLiteral(n),t.recordSourceMappingEnd(this),t.emitParensAndCommentsInPlace(this,!1)},r.prototype.typeCheck=function(e){return e.checker.styleSettings.forin&&(this.isFiltered()||e.checker.errorReporter.styleError(this,"no hasOwnProperty filter")),e.typeCheckForIn(this)},r.prototype.addToControlFlow=function(t){this.lval&&t.addContent(this.lval),this.obj&&t.addContent(this.obj);var n=t.current,r=new e.BasicBlock,i=new e.BasicBlock;if(n.addSuccessor(r),t.current=r,this.body&&(t.pushStatement(this,r,i),t.walk(this.body,this),t.popStatement()),!t.noContinuation){var o=t.current;o.addSuccessor(r)}t.current=i,t.noContinuation=!1,n.addSuccessor(i),t.walker.options.goChildren=!1},r}(I);e.ForInStatement=W;var H=function(t){function n(n){t.call(this,e.NodeType.For),this.init=n}return __extends(n,t),n.prototype.isLoop=function(){return!0},n.prototype.emit=function(t){t.emitParensAndCommentsInPlace(this,!0),t.recordSourceMappingStart(this);var n=t.setInObjectLiteral(!1);t.writeToOutput("for("),this.init&&(this.init.nodeType!=e.NodeType.List?t.emitJavascript(this.init,e.TokenID.For,!1):(t.setInVarBlock(this.init.members.length),t.emitJavascriptList(this.init,null,e.TokenID.For,!1,!1,!1))),t.writeToOutput("; "),t.emitJavascript(this.cond,e.TokenID.For,!1),t.writeToOutput("; "),t.emitJavascript(this.incr,e.TokenID.For,!1),t.writeToOutput(")"),t.emitJavascriptStatements(this.body,!0),t.setInObjectLiteral(n),t.recordSourceMappingEnd(this),t.emitParensAndCommentsInPlace(this,!1)},n.prototype.typeCheck=function(e){return e.typeCheckFor(this)},n.prototype.addToControlFlow=function(t){this.init&&t.addContent(this.init);var n=t.current,r=new e.BasicBlock,i=new e.BasicBlock;n.addSuccessor(r),t.current=r;var o=null,s=r,a=null;this.incr&&(a=new e.BasicBlock,s=a),this.cond&&(o=t.current,t.addContent(this.cond),t.current=new e.BasicBlock,o.addSuccessor(t.current));var l=null;this.body&&(t.pushStatement(this,s,i),t.walk(this.body,this),l=t.popStatement()),this.incr&&(t.noContinuation?0==a.predecessors.length&&t.addUnreachable(this.incr):(t.current.addSuccessor(a),t.current=a,t.addContent(this.incr)));var c=t.current;t.noContinuation||c.addSuccessor(r),o&&(o.addSuccessor(i),t.noContinuation=!1),i.predecessors.length>0&&(t.noContinuation=!1,t.current=i),t.walker.options.goChildren=!1},n}(I);e.ForStatement=H;var V=function(t){function n(n){t.call(this,e.NodeType.Let),this.expr=n}return __extends(n,t),n.prototype.isCompoundStatement=function(){return!0},n.prototype.emit=function(t){t.emitParensAndCommentsInPlace(this,!0),t.recordSourceMappingStart(this),t.writeToOutput("let ("),this.expr&&t.emitJavascript(this.expr,e.TokenID.Let,!1),t.writeToOutput(")"),t.emitJavascriptStatements(this.body,!0),t.recordSourceMappingEnd(this),t.emitParensAndCommentsInPlace(this,!1)},n.prototype.typeCheck=function(e){return e.typeCheckLet(this)},n}(I);e.LetStatement=V;var U=function(t){function n(n){t.call(this,e.NodeType.With),this.expr=n,this.withSym=null}return __extends(n,t),n.prototype.isCompoundStatement=function(){return!0},n.prototype.emit=function(t){t.emitParensAndCommentsInPlace(this,!0),t.recordSourceMappingStart(this),t.writeToOutput("with ("),this.expr&&t.emitJavascript(this.expr,e.TokenID.With,!1),t.writeToOutput(")"),t.emitJavascriptStatements(this.body,!0),t.recordSourceMappingEnd(this),t.emitParensAndCommentsInPlace(this,!1)},n.prototype.typeCheck=function(e){return e.typeCheckWith(this)},n}(I);e.WithStatement=U;var j=function(n){function r(r){n.call(this,e.NodeType.Switch),this.val=r,this.defaultCase=null,this.statement=new t}return __extends(r,n),r.prototype.isCompoundStatement=function(){return!0},r.prototype.emit=function(t){t.emitParensAndCommentsInPlace(this,!0),t.recordSourceMappingStart(this);var n=t.setInObjectLiteral(!1);t.recordSourceMappingStart(this.statement),t.writeToOutput("switch("),t.emitJavascript(this.val,e.TokenID.Identifier,!1),t.writeToOutput(")"),t.recordSourceMappingEnd(this.statement),t.writeLineToOutput(" {"),t.indenter.increaseIndent();for(var r=this.caseList.members.length,i=0;r>i;i++){var o=this.caseList.members[i];t.emitJavascript(o,e.TokenID.Case,!0)}t.indenter.decreaseIndent(),t.emitIndent(),t.writeToOutput("}"),t.setInObjectLiteral(n),t.recordSourceMappingEnd(this),t.emitParensAndCommentsInPlace(this,!1)},r.prototype.typeCheck=function(e){var t=this.caseList.members.length;this.val=e.typeCheck(this.val);for(var n=0;t>n;n++)this.caseList.members[n]=e.typeCheck(this.caseList.members[n]);return this.defaultCase=e.typeCheck(this.defaultCase),this.type=e.voidType,this},r.prototype.addToControlFlow=function(t){var n=t.current;t.addContent(this.val);var r=new e.BasicBlock,i=new e.BasicBlock;n.addSuccessor(r),t.pushSwitch(r),t.current=r,t.pushStatement(this,r,i),t.walk(this.caseList,this),t.popSwitch(),t.popStatement(),null==this.defaultCase,null==this.defaultCase&&n.addSuccessor(i),i.predecessors.length>0?(t.noContinuation=!1,t.current=i):t.noContinuation=!0,t.walker.options.goChildren=!1},r}(I);e.SwitchStatement=j;var K=function(n){function r(){n.call(this,e.NodeType.Case),this.expr=null,this.colonSpan=new t}return __extends(r,n),r.prototype.emit=function(t){t.emitParensAndCommentsInPlace(this,!0),t.recordSourceMappingStart(this),this.expr?(t.writeToOutput("case "),t.emitJavascript(this.expr,e.TokenID.Identifier,!1)):t.writeToOutput("default"),t.recordSourceMappingStart(this.colonSpan),t.writeToOutput(":"),t.recordSourceMappingEnd(this.colonSpan),1==this.body.members.length&&this.body.members[0].nodeType==e.NodeType.Block?t.emitJavascriptStatements(this.body,!1):(t.writeLineToOutput(""),t.indenter.increaseIndent(),t.emitBareJavascriptStatements(this.body),t.indenter.decreaseIndent()),t.recordSourceMappingEnd(this),t.emitParensAndCommentsInPlace(this,!1)},r.prototype.typeCheck=function(e){return this.expr=e.typeCheck(this.expr),e.typeCheck(this.body),this.type=e.voidType,this},r.prototype.addToControlFlow=function(t){var n=new e.BasicBlock,r=t.currentSwitch[t.currentSwitch.length-1];if(this.expr){var i=new e.BasicBlock;t.current=i,r.addSuccessor(i),t.addContent(this.expr),i.addSuccessor(n)}else r.addSuccessor(n);t.current=n,this.body&&t.walk(this.body,this),t.noContinuation=!1,t.walker.options.goChildren=!1},r}(I);e.CaseStatement=K;var q=function(t){function n(n,r){t.call(this,e.NodeType.TypeRef),this.term=n,this.arrayCount=r}return __extends(n,t),n.prototype.emit=function(){throw new Error("should not emit a type ref")},n.prototype.typeCheck=function(t){var n=t.inTypeRefTypeCheck;t.inTypeRefTypeCheck=!0;var r=e.getTypeLink(this,t.checker,!0);return t.checker.resolveTypeLink(t.scope,r,!1),this.term&&t.typeCheck(this.term),t.checkForVoidConstructor(r.type,this),this.type=r.type,this.term&&(this.term.type=this.type),t.inTypeRefTypeCheck=n,this},n}(n);e.TypeReference=q;var z=function(t){function n(n,r){t.call(this,e.NodeType.TryFinally),this.tryNode=n,this.finallyNode=r}return __extends(n,t),n.prototype.isCompoundStatement=function(){return!0},n.prototype.emit=function(t){t.recordSourceMappingStart(this),t.emitJavascript(this.tryNode,e.TokenID.Try,!1),t.emitJavascript(this.finallyNode,e.TokenID.Finally,!1),t.recordSourceMappingEnd(this)},n.prototype.typeCheck=function(e){return this.tryNode=e.typeCheck(this.tryNode),this.finallyNode=e.typeCheck(this.finallyNode),this.type=e.voidType,this},n.prototype.addToControlFlow=function(t){var n=new e.BasicBlock;t.walk(this.tryNode,this);var r=new e.BasicBlock;t.current&&t.current.addSuccessor(r),t.current=r,t.pushStatement(this,null,n),t.walk(this.finallyNode,this),!t.noContinuation&&t.current&&t.current.addSuccessor(n),n.predecessors.length>0?t.current=n:t.noContinuation=!0,t.popStatement(),t.walker.options.goChildren=!1},n}(I);e.TryFinally=z;var G=function(t){function n(n,r){t.call(this,e.NodeType.TryCatch),this.tryNode=n,this.catchNode=r}return __extends(n,t),n.prototype.isCompoundStatement=function(){return!0},n.prototype.emit=function(t){t.emitParensAndCommentsInPlace(this,!0),t.recordSourceMappingStart(this),t.emitJavascript(this.tryNode,e.TokenID.Try,!1),t.emitJavascript(this.catchNode,e.TokenID.Catch,!1),t.recordSourceMappingEnd(this),t.emitParensAndCommentsInPlace(this,!1)},n.prototype.addToControlFlow=function(t){var n=t.current,r=new e.BasicBlock;n.addSuccessor(r),t.current=r;var i=new e.BasicBlock;t.pushStatement(this,null,i),t.walk(this.tryNode,this),t.noContinuation||t.current&&t.current.addSuccessor(i),t.current=new e.BasicBlock,n.addSuccessor(t.current),t.walk(this.catchNode,this),t.popStatement(),t.noContinuation||t.current&&t.current.addSuccessor(i),t.current=i,t.walker.options.goChildren=!1},n.prototype.typeCheck=function(e){return this.tryNode=e.typeCheck(this.tryNode),this.catchNode=e.typeCheck(this.catchNode),this.type=e.voidType,this},n}(I);e.TryCatch=G;var $=function(t){function n(n){t.call(this,e.NodeType.Try),this.body=n}return __extends(n,t),n.prototype.emit=function(t){t.emitParensAndCommentsInPlace(this,!0),t.recordSourceMappingStart(this),t.writeToOutput("try "),t.emitJavascript(this.body,e.TokenID.Try,!1),t.recordSourceMappingEnd(this),t.emitParensAndCommentsInPlace(this,!1)},n.prototype.typeCheck=function(e){return this.body=e.typeCheck(this.body),this},n.prototype.addToControlFlow=function(e){this.body&&e.walk(this.body,this),e.walker.options.goChildren=!1,e.noContinuation=!1},n}(I);e.Try=$;var J=function(n){function r(r,i){n.call(this,e.NodeType.Catch),this.param=r,this.body=i,this.statement=new t,this.containedScope=null,this.param&&(this.param.varFlags|=e.VarFlags.AutoInit)}return __extends(r,n),r.prototype.emit=function(t){t.emitParensAndCommentsInPlace(this,!0),t.recordSourceMappingStart(this),t.writeToOutput(" "),t.recordSourceMappingStart(this.statement),t.writeToOutput("catch ("),t.emitJavascript(this.param,e.TokenID.OpenParen,!1),t.writeToOutput(")"),t.recordSourceMappingEnd(this.statement),t.emitJavascript(this.body,e.TokenID.Catch,!1),t.recordSourceMappingEnd(this),t.emitParensAndCommentsInPlace(this,!1)},r.prototype.addToControlFlow=function(t){if(this.param){t.addContent(this.param);var n=new e.BasicBlock;t.current.addSuccessor(n),t.current=n}this.body&&t.walk(this.body,this),t.noContinuation=!1,t.walker.options.goChildren=!1},r.prototype.typeCheck=function(t){var n=t.scope;t.scope=this.containedScope,this.param=t.typeCheck(this.param);var r=new e.ValueLocation,i=new e.VariableSymbol(this.param.id.text,this.param.minChar,t.checker.locationInfo.unitIndex,r);r.symbol=i,r.typeLink=new e.TypeLink,r.typeLink.type=t.anyType;var o=t.thisFnc;if(r.symbol.container=o&&o.type?o.type.symbol:null,this.param.sym=r.symbol,t.scope.enter(r.symbol.container,this.param,r.symbol,t.checker.errorReporter,!1,!1,!1),this.body=t.typeCheck(this.body),t.checker.inProvisionalTypecheckMode()){var s=t.scope.getTable();s.secondaryTable.table[r.symbol.name]=void 0}return this.type=t.voidType,t.scope=n,this},r}(I);e.Catch=J;var X=function(t){function n(n){t.call(this,e.NodeType.Finally),this.body=n}return __extends(n,t),n.prototype.emit=function(t){t.emitParensAndCommentsInPlace(this,!0),t.recordSourceMappingStart(this),t.writeToOutput("finally"),t.emitJavascript(this.body,e.TokenID.Finally,!1),t.recordSourceMappingEnd(this),t.emitParensAndCommentsInPlace(this,!1)},n.prototype.addToControlFlow=function(e){this.body&&e.walk(this.body,this),e.walker.options.goChildren=!1,e.noContinuation=!1},n.prototype.typeCheck=function(e){return this.body=e.typeCheck(this.body),this},n}(I);e.Finally=X;var Y=function(t){function n(n,r,i){t.call(this,e.NodeType.Comment),this.content=n,this.isBlockComment=r,this.endsLine=i,this.text=null,this.docCommentText=null}return __extends(n,t),n.prototype.getText=function(){if(null==this.text)if(this.isBlockComment){this.text=this.content.split("\n");for(var e=0;en;n++){var o=t.charCodeAt(n);if(o!=e.LexCodeSpace&&o!=e.LexCodeTAB)return n}return i!=t.length?i:-1},n.isSpaceChar=function(t,n){var r=t.length;if(r>n){var i=t.charCodeAt(n);return i==e.LexCodeSpace||i==e.LexCodeTAB}return n==r},n.cleanDocCommentLine=function(e,t,r){var i=n.consumeLeadingSpace(e,0);if(-1!=i){var o=i;if(t&&"*"==e.charAt(i)){var s=i+1;if(i=n.consumeLeadingSpace(e,s,r),-1==i)return null;o=i-s}return{minChar:i,limChar:"\r"==e.charAt(e.length-1)?e.length-1:e.length,jsDocSpacesRemoved:o}}return null},n.cleanJSDocComment=function(e,t){var r=[];e=e.replace("/**",""),e.length>=2&&"/"==e.charAt(e.length-1)&&"*"==e.charAt(e.length-2)&&(e=e.substring(0,e.length-2));for(var i=e.split("\n"),o=!1,s=0;s=0&&p=0;s=o.indexOf("@param",s))if(s+=6,n.isSpaceChar(o,s)){if(s=n.consumeLeadingSpace(o,s),-1==s)break;if(o.charCodeAt(s)==e.LexCodeLC){s++;for(var a=0,l=1;sc?o.length:c),p=void 0,h=o.substring(0,s).lastIndexOf("\n")+1;0!=h&&s>h&&"\r"==o.charAt(h+1)&&h++;var d=n.consumeLeadingSpace(o,h);return d!=s&&"*"==o.charAt(d)&&(p=s-d-1),n.cleanJSDocComment(u,p)}}return""},n.getDocCommentFirstOverloadSignature=function(t){for(var n=0;n=0;i--)n.options.goNextSibling&&(e.members[i]=n.walk(e.members[i],e));else for(var i=0;r>i;i++)n.options.goNextSibling&&(e.members[i]=n.walk(e.members[i],e))}function r(e,t,n){e.castTerm&&(e.castTerm=n.walk(e.castTerm,e)),e.operand&&(e.operand=n.walk(e.operand,e))}function i(e,t,n){n.options.reverseSiblings?(e.operand2&&(e.operand2=n.walk(e.operand2,e)),e.operand1&&n.options.goNextSibling&&(e.operand1=n.walk(e.operand1,e))):(e.operand1&&(e.operand1=n.walk(e.operand1,e)),e.operand2&&n.options.goNextSibling&&(e.operand2=n.walk(e.operand2,e)))}function o(e,t,n){e.term&&(e.term=n.walk(e.term,e))}function s(e,t,n){n.options.reverseSiblings||(e.target=n.walk(e.target,e)),e.arguments&&n.options.goNextSibling&&(e.arguments=n.walk(e.arguments,e)),n.options.reverseSiblings&&n.options.goNextSibling&&(e.target=n.walk(e.target,e))}function a(e,t,n){e.operand1&&(e.operand1=n.walk(e.operand1,e)),e.operand2&&n.options.goNextSibling&&(e.operand2=n.walk(e.operand2,e)),e.operand3&&n.options.goNextSibling&&(e.operand3=n.walk(e.operand3,e))}function l(e,t,n){e.name&&(e.name=n.walk(e.name,e)),e.arguments&&n.options.goNextSibling&&(e.arguments=n.walk(e.arguments,e)),e.returnTypeAnnotation&&n.options.goNextSibling&&(e.returnTypeAnnotation=n.walk(e.returnTypeAnnotation,e)),e.bod&&n.options.goNextSibling&&(e.bod=n.walk(e.bod,e))}function c(e,t,n){e.id&&(e.id=n.walk(e.id,e)),e.init&&(e.init=n.walk(e.init,e)),e.typeExpr&&n.options.goNextSibling&&(e.typeExpr=n.walk(e.typeExpr,e))}function u(e,t,n){e.returnExpression&&(e.returnExpression=n.walk(e.returnExpression,e))}function p(e,t,n){e.init&&(e.init=n.walk(e.init,e)),e.cond&&n.options.goNextSibling&&(e.cond=n.walk(e.cond,e)),e.incr&&n.options.goNextSibling&&(e.incr=n.walk(e.incr,e)),e.body&&n.options.goNextSibling&&(e.body=n.walk(e.body,e))}function h(e,t,n){e.lval=n.walk(e.lval,e),n.options.goNextSibling&&(e.obj=n.walk(e.obj,e)),e.body&&n.options.goNextSibling&&(e.body=n.walk(e.body,e))}function d(e,t,n){e.cond=n.walk(e.cond,e),e.thenBod&&n.options.goNextSibling&&(e.thenBod=n.walk(e.thenBod,e)),e.elseBod&&n.options.goNextSibling&&(e.elseBod=n.walk(e.elseBod,e))}function f(e,t,n){e.cond=n.walk(e.cond,e),e.body&&n.options.goNextSibling&&(e.body=n.walk(e.body,e))}function m(e,t,n){e.cond=n.walk(e.cond,e),e.body&&n.options.goNextSibling&&(e.body=n.walk(e.body,e))}function g(e,t,n){e.statements&&(e.statements=n.walk(e.statements,e))}function y(e,t,n){e.expr&&(e.expr=n.walk(e.expr,e)),e.body&&n.options.goNextSibling&&(e.body=n.walk(e.body,e))}function v(e,t,n){e.val&&(e.val=n.walk(e.val,e)),e.caseList&&n.options.goNextSibling&&(e.caseList=n.walk(e.caseList,e))}function T(e,t,n){e.body&&(e.body=n.walk(e.body,e))}function b(e,t,n){e.tryNode&&(e.tryNode=n.walk(e.tryNode,e)),e.catchNode&&n.options.goNextSibling&&(e.catchNode=n.walk(e.catchNode,e))}function k(e,t,n){e.tryNode&&(e.tryNode=n.walk(e.tryNode,e)),e.finallyNode&&n.options.goNextSibling&&(e.finallyNode=n.walk(e.finallyNode,e))}function S(e,t,n){e.body&&(e.body=n.walk(e.body,e))}function C(e,t,n){e.param&&(e.param=n.walk(e.param,e)),e.body&&n.options.goNextSibling&&(e.body=n.walk(e.body,e))}function w(e,t,n){e.name=n.walk(e.name,e),n.options.goNextSibling&&e.members&&(e.members=n.walk(e.members,e))}function _(e,t,n){w(e,t,n)}function E(e,t,n){_(e,t,n),n.options.goNextSibling&&e.extendsList&&(e.extendsList=n.walk(e.extendsList,e)),n.options.goNextSibling&&e.implementsList&&(e.implementsList=n.walk(e.implementsList,e))}function x(e,t,n){e.bod&&(e.bod=n.walk(e.bod,e))}function N(e,t,n){_(e,t,n),n.options.goNextSibling&&e.extendsList&&(e.extendsList=n.walk(e.extendsList,e)),n.options.goNextSibling&&e.implementsList&&(e.implementsList=n.walk(e.implementsList,e))}function L(e,t,n){w(e,t,n)}function I(e,t,n){e.id&&(e.id=n.walk(e.id,e)),e.alias&&(e.alias=n.walk(e.alias,e))}function A(e,t,n){e.expr&&(e.expr=n.walk(e.expr,e)),e.body&&n.options.goNextSibling&&(e.body=n.walk(e.body,e))}function M(e,t,n){e.expr&&(e.expr=n.walk(e.expr,e)),e.body&&n.options.goNextSibling&&(e.body=n.walk(e.body,e))}function R(){}function P(e,t,n){e.labels=n.walk(e.labels,e),n.options.goNextSibling&&(e.stmt=n.walk(e.stmt,e))}e.walkNone=t,e.walkListChildren=n,e.walkUnaryExpressionChildren=r,e.walkBinaryExpressionChildren=i,e.walkTypeReferenceChildren=o,e.walkCallExpressionChildren=s,e.walkTrinaryExpressionChildren=a,e.walkFuncDeclChildren=l,e.walkBoundDeclChildren=c,e.walkReturnStatementChildren=u,e.walkForStatementChildren=p,e.walkForInStatementChildren=h,e.walkIfStatementChildren=d,e.walkWhileStatementChildren=f,e.walkDoWhileStatementChildren=m,e.walkBlockChildren=g,e.walkCaseStatementChildren=y,e.walkSwitchStatementChildren=v,e.walkTryChildren=T,e.walkTryCatchChildren=b,e.walkTryFinallyChildren=k,e.walkFinallyChildren=S,e.walkCatchChildren=C,e.walkRecordChildren=w,e.walkNamedTypeChildren=_,e.walkClassDeclChildren=E,e.walkScriptChildren=x,e.walkTypeDeclChildren=N,e.walkModuleDeclChildren=L,e.walkImportDeclChildren=I,e.walkWithStatementChildren=A,e.walkLetStatementChildren=M,e.walkLabelChildren=R,e.walkLabeledStatementChildren=P}(s||(s={}))}(TypeScript||(TypeScript={}));var TypeScript;!function(e){!function(t){function n(t,n){var i=function(e){return s.options.goChildren=r(!0,e,n),e},o=function(e){return r(!1,e,n),e},s=e.getAstWalkerFactory().getWalker(i,o);s.walk(t,null)}function r(t,n,r){var i=n.nodeType,o=e.NodeType._map[i]+"Callback";return r[o]?r[o](t,n):r.DefaultCallback?r.DefaultCallback(t,n):!0}t.walk=n}(e.AstWalkerWithDetailCallback||(e.AstWalkerWithDetailCallback={})),e.AstWalkerWithDetailCallback}(TypeScript||(TypeScript={}));var TypeScript;!function(e){function t(e){return null===e||0===e.length?null:e[e.length-1]}function n(e,t){return e>=t?e:t}function r(e,t){return t>=e?e:t}function i(e){return null===e?!1:-1===e.minChar||-1===e.limChar?!1:!0}function o(t,n,r){"undefined"==typeof r&&(r=u.Default);var o=function(e){if(e&&e.length>0)for(var t=0;t=r&&i>n&&a.path.push(e[t])}},s=function(s,l,c){if(i(s)){var p=e.hasFlag(r,u.EdgeInclusive)||s.nodeType===e.NodeType.Name||n===t.limChar,h=s.minChar,d=s.limChar+(p?1:0);if(n>=h&&d>n){var f=a.path.ast();(null==f||s.minChar>=f.minChar&&s.limChar<=f.limChar)&&a.path.push(s)}d>n&&o(s.preComments),n>=h&&o(s.postComments),e.hasFlag(r,u.DontPruneSearchBasedOnPosition)||(c.options.goChildren=n>=h&&d>=n)}return s},a=new c;return e.getAstWalkerFactory().walk(t,s,null,null,a),a.path}function s(t,r){var i=0,o=function(t,o,s){return e.isValidAstNode(t)&&(t.minChar<=r&&(i=n(i,t.minChar)),(t.minChar>r||t.limCharthis.count();)this.asts.pop();return e},n.prototype.push=function(e){for(;this.asts.length>this.count();)this.asts.pop();this.top=this.asts.length,this.asts.push(e)},n.prototype.up=function(){if(this.top<=-1)throw new Error("Invalid call to 'up'");this.top--},n.prototype.down=function(){if(this.top==this.ast.length-1)throw new Error("Invalid call to 'down'");this.top++},n.prototype.nodeType=function(){return null==this.ast()?e.NodeType.None:this.ast().nodeType},n.prototype.ast=function(){return n.reverseIndexOf(this.asts,this.asts.length-(this.top+1))},n.prototype.parent=function(){return n.reverseIndexOf(this.asts,this.asts.length-this.top)},n.prototype.count=function(){return this.top+1},n.prototype.get=function(e){return this.asts[e]},n.prototype.isNameOfClass=function(){return null===this.ast()||null===this.parent()?!1:this.ast().nodeType===e.NodeType.Name&&this.parent().nodeType===e.NodeType.ClassDeclaration&&this.parent().name===this.ast()},n.prototype.isNameOfInterface=function(){return null===this.ast()||null===this.parent()?!1:this.ast().nodeType===e.NodeType.Name&&this.parent().nodeType===e.NodeType.InterfaceDeclaration&&this.parent().name===this.ast()},n.prototype.isNameOfArgument=function(){return null===this.ast()||null===this.parent()?!1:this.ast().nodeType===e.NodeType.Name&&this.parent().nodeType===e.NodeType.ArgDecl&&this.parent().id===this.ast()},n.prototype.isNameOfVariable=function(){return null===this.ast()||null===this.parent()?!1:this.ast().nodeType===e.NodeType.Name&&this.parent().nodeType===e.NodeType.VarDecl&&this.parent().id===this.ast()},n.prototype.isNameOfModule=function(){return null===this.ast()||null===this.parent()?!1:this.ast().nodeType===e.NodeType.Name&&this.parent().nodeType===e.NodeType.ModuleDeclaration&&this.parent().name===this.ast()},n.prototype.isNameOfFunction=function(){return null===this.ast()||null===this.parent()?!1:this.ast().nodeType===e.NodeType.Name&&this.parent().nodeType===e.NodeType.FuncDecl&&this.parent().name===this.ast()},n.prototype.isChildOfScript=function(){var n=t(this.asts);return this.count()>=3&&this.asts[this.top]===n&&this.asts[this.top-1].nodeType===e.NodeType.List&&this.asts[this.top-2].nodeType===e.NodeType.Script},n.prototype.isChildOfModule=function(){var n=t(this.asts);return this.count()>=3&&this.asts[this.top]===n&&this.asts[this.top-1].nodeType===e.NodeType.List&&this.asts[this.top-2].nodeType===e.NodeType.ModuleDeclaration},n.prototype.isChildOfClass=function(){var n=t(this.asts);return this.count()>=3&&this.asts[this.top]===n&&this.asts[this.top-1].nodeType===e.NodeType.List&&this.asts[this.top-2].nodeType===e.NodeType.ClassDeclaration},n.prototype.isArgumentOfClassConstructor=function(){var n=t(this.asts);return this.count()>=5&&this.asts[this.top]===n&&this.asts[this.top-1].nodeType===e.NodeType.List&&this.asts[this.top-2].nodeType===e.NodeType.FuncDecl&&this.asts[this.top-3].nodeType===e.NodeType.List&&this.asts[this.top-4].nodeType===e.NodeType.ClassDeclaration&&this.asts[this.top-2].isConstructor&&this.asts[this.top-2].arguments===this.asts[this.top-1]&&this.asts[this.top-4].constructorDecl===this.asts[this.top-2]},n.prototype.isChildOfInterface=function(){var n=t(this.asts);return this.count()>=3&&this.asts[this.top]===n&&this.asts[this.top-1].nodeType===e.NodeType.List&&this.asts[this.top-2].nodeType===e.NodeType.InterfaceDeclaration},n.prototype.isTopLevelImplicitModule=function(){return this.count()>=1&&this.asts[this.top].nodeType===e.NodeType.ModuleDeclaration&&e.hasFlag(this.asts[this.top].modFlags,e.ModuleFlags.IsWholeFile)},n.prototype.isBodyOfTopLevelImplicitModule=function(){return this.count()>=2&&this.asts[this.top-0].nodeType===e.NodeType.List&&this.asts[this.top-1].nodeType===e.NodeType.ModuleDeclaration&&this.asts[this.top-1].members==this.asts[this.top-0]&&e.hasFlag(this.asts[this.top-1].modFlags,e.ModuleFlags.IsWholeFile)},n.prototype.isBodyOfScript=function(){return this.count()>=2&&this.asts[this.top-1].nodeType===e.NodeType.Script&&this.asts[this.top-1].bod==this.asts[this.top-0]},n.prototype.isBodyOfSwitch=function(){return this.count()>=2&&this.asts[this.top-1].nodeType===e.NodeType.Switch&&this.asts[this.top-1].caseList==this.asts[this.top-0]},n.prototype.isBodyOfModule=function(){return this.count()>=2&&this.asts[this.top-1].nodeType===e.NodeType.ModuleDeclaration&&this.asts[this.top-1].members==this.asts[this.top-0]},n.prototype.isBodyOfClass=function(){return this.count()>=2&&this.asts[this.top-1].nodeType===e.NodeType.ClassDeclaration&&this.asts[this.top-1].members==this.asts[this.top-0]},n.prototype.isBodyOfFunction=function(){return this.count()>=2&&this.asts[this.top-1].nodeType===e.NodeType.FuncDecl&&this.asts[this.top-1].bod==this.asts[this.top-0]},n.prototype.isBodyOfInterface=function(){return this.count()>=2&&this.asts[this.top-1].nodeType===e.NodeType.InterfaceDeclaration&&this.asts[this.top-1].members==this.asts[this.top-0]},n.prototype.isBodyOfBlock=function(){return this.count()>=2&&this.asts[this.top-1].nodeType===e.NodeType.Block&&this.asts[this.top-1].statements==this.asts[this.top-0]},n.prototype.isBodyOfFor=function(){return this.count()>=2&&this.asts[this.top-1].nodeType===e.NodeType.For&&this.asts[this.top-1].body==this.asts[this.top-0]},n.prototype.isBodyOfCase=function(){return this.count()>=2&&this.asts[this.top-1].nodeType===e.NodeType.Case&&this.asts[this.top-1].body==this.asts[this.top-0]},n.prototype.isBodyOfTry=function(){return this.count()>=2&&this.asts[this.top-1].nodeType===e.NodeType.Try&&this.asts[this.top-1].body==this.asts[this.top-0]},n.prototype.isBodyOfCatch=function(){return this.count()>=2&&this.asts[this.top-1].nodeType===e.NodeType.Catch&&this.asts[this.top-1].body==this.asts[this.top-0]},n.prototype.isBodyOfDoWhile=function(){return this.count()>=2&&this.asts[this.top-1].nodeType===e.NodeType.DoWhile&&this.asts[this.top-1].body==this.asts[this.top-0]},n.prototype.isBodyOfWhile=function(){return this.count()>=2&&this.asts[this.top-1].nodeType===e.NodeType.While&&this.asts[this.top-1].body==this.asts[this.top-0]},n.prototype.isBodyOfForIn=function(){return this.count()>=2&&this.asts[this.top-1].nodeType===e.NodeType.ForIn&&this.asts[this.top-1].body==this.asts[this.top-0]},n.prototype.isBodyOfLet=function(){return this.count()>=2&&this.asts[this.top-1].nodeType===e.NodeType.Let&&this.asts[this.top-1].body==this.asts[this.top-0]},n.prototype.isBodyOfWith=function(){return this.count()>=2&&this.asts[this.top-1].nodeType===e.NodeType.With&&this.asts[this.top-1].body==this.asts[this.top-0]},n.prototype.isBodyOfFinally=function(){return this.count()>=2&&this.asts[this.top-1].nodeType===e.NodeType.Finally&&this.asts[this.top-1].body==this.asts[this.top-0]},n.prototype.isCaseOfSwitch=function(){return this.count()>=3&&this.asts[this.top-2].nodeType===e.NodeType.Switch&&this.asts[this.top-1].nodeType===e.NodeType.List&&this.asts[this.top-2].caseList==this.asts[this.top-1]},n.prototype.isDefaultCaseOfSwitch=function(){return this.count()>=3&&this.asts[this.top-2].nodeType===e.NodeType.Switch&&this.asts[this.top-1].nodeType===e.NodeType.List&&this.asts[this.top-2].caseList==this.asts[this.top-1]&&this.asts[this.top-2].defaultCase==this.asts[this.top-0]},n.prototype.isListOfObjectLit=function(){return this.count()>=2&&this.asts[this.top-1].nodeType===e.NodeType.ObjectLit&&this.asts[this.top-0].nodeType===e.NodeType.List&&this.asts[this.top-1].operand==this.asts[this.top-0]},n.prototype.isBodyOfObjectLit=function(){return this.isListOfObjectLit()},n.prototype.isEmptyListOfObjectLit=function(){return this.count()>=2&&this.asts[this.top-1].nodeType===e.NodeType.ObjectLit&&this.asts[this.top-0].nodeType===e.NodeType.List&&this.asts[this.top-1].operand==this.asts[this.top-0]&&0==this.asts[this.top-0].members.length},n.prototype.isMemberOfObjectLit=function(){return this.count()>=3&&this.asts[this.top-2].nodeType===e.NodeType.ObjectLit&&this.asts[this.top-1].nodeType===e.NodeType.List&&this.asts[this.top-0].nodeType===e.NodeType.Member&&this.asts[this.top-2].operand==this.asts[this.top-1]},n.prototype.isNameOfMemberOfObjectLit=function(){return this.count()>=4&&this.asts[this.top-3].nodeType===e.NodeType.ObjectLit&&this.asts[this.top-2].nodeType===e.NodeType.List&&this.asts[this.top-1].nodeType===e.NodeType.Member&&this.asts[this.top-0].nodeType===e.NodeType.Name&&this.asts[this.top-3].operand==this.asts[this.top-2]},n.prototype.isListOfArrayLit=function(){return this.count()>=2&&this.asts[this.top-1].nodeType===e.NodeType.ArrayLit&&this.asts[this.top-0].nodeType===e.NodeType.List&&this.asts[this.top-1].operand==this.asts[this.top-0]},n.prototype.isTargetOfMember=function(){return this.count()>=2&&this.asts[this.top-1].nodeType===e.NodeType.Member&&this.asts[this.top-1].operand1===this.asts[this.top-0]},n.prototype.isMemberOfMember=function(){return this.count()>=2&&this.asts[this.top-1].nodeType===e.NodeType.Member&&this.asts[this.top-1].operand2===this.asts[this.top-0]},n.prototype.isItemOfList=function(){return this.count()>=2&&this.asts[this.top-1].nodeType===e.NodeType.List},n.prototype.isThenOfIf=function(){return this.count()>=2&&this.asts[this.top-1].nodeType===e.NodeType.If&&this.asts[this.top-1].thenBod==this.asts[this.top-0]},n.prototype.isElseOfIf=function(){return this.count()>=2&&this.asts[this.top-1].nodeType===e.NodeType.If&&this.asts[this.top-1].elseBod==this.asts[this.top-0]},n.prototype.isBodyOfDefaultCase=function(){return this.isBodyOfCase()},n.prototype.isSingleStatementList=function(){return this.count()>=1&&this.asts[this.top].nodeType===e.NodeType.List&&1===this.asts[this.top].members.length},n.prototype.isArgumentListOfFunction=function(){return this.count()>=2&&this.asts[this.top-0].nodeType===e.NodeType.List&&this.asts[this.top-1].nodeType===e.NodeType.FuncDecl&&this.asts[this.top-1].arguments===this.asts[this.top-0]},n.prototype.isArgumentOfFunction=function(){return this.count()>=3&&this.asts[this.top-1].nodeType===e.NodeType.List&&this.asts[this.top-2].nodeType===e.NodeType.FuncDecl&&this.asts[this.top-2].arguments===this.asts[this.top-1]},n.prototype.isArgumentListOfCall=function(){return this.count()>=2&&this.asts[this.top-0].nodeType===e.NodeType.List&&this.asts[this.top-1].nodeType===e.NodeType.Call&&this.asts[this.top-1].arguments===this.asts[this.top-0]},n.prototype.isArgumentListOfNew=function(){return this.count()>=2&&this.asts[this.top-0].nodeType===e.NodeType.List&&this.asts[this.top-1].nodeType===e.NodeType.New&&this.asts[this.top-1].arguments===this.asts[this.top-0]},n.prototype.isSynthesizedBlock=function(){return this.count()>=1&&this.asts[this.top-0].nodeType===e.NodeType.Block&&this.asts[this.top-0].isStatementBlock===!1},n}();e.AstPath=l,e.isValidAstNode=i;var c=function(){function t(){this.path=new e.AstPath}return t}();e.AstPathContext=c,function(e){e._map=[],e.Default=0,e.EdgeInclusive=1,e.DontPruneSearchBasedOnPosition=2}(e.GetAstPathOptions||(e.GetAstPathOptions={}));var u=e.GetAstPathOptions;e.getAstPathToPosition=o,e.getTokenizationOffset=s,e.walkAST=a}(TypeScript||(TypeScript={}));var TypeScript;!function(e){var t=function(){function t(e){this.logger=e}return t.prototype.logScript=function(t){var n=this;this.logLinemap(t.locationInfo.lineMap);var r=[],i=function(e){r.push(e);var i=2*(r.length-1);return n.logComments(t,e.preComments,i),n.logNode(t,e,i),n.logComments(t,e.postComments,i),e},o=function(e){return r.pop(),e};e.getAstWalkerFactory().walk(t,i,o)},t.prototype.logNode=function(e,t,n){var r=this.addPadding("",n,"| ",!0);r=r.concat("+ "+t.treeViewLabel()),r=this.addPadding(r,70," ",!1),r+=this.addLineColumn(e,t.minChar),r=this.addPadding(r,80," ",!1),r+="=> ",r+=this.addLineColumn(e,t.limChar),r=this.addPadding(r,102," ",!1),r=r.concat("["+this.addPadding(t.minChar.toString(),1," ",!0)+", "+this.addPadding(t.limChar.toString(),1," ",!0)+"]"),r=this.addPadding(r,115," ",!1),r=r.concat("sym="+t.sym),r=this.addPadding(r,135," ",!1),r=r.concat("type="+(null===t.type?"null":t.type.getTypeName())),this.logger.log(r)},t.prototype.logComments=function(e,t,n){if(null!=t)for(var r=0;r0&&(t+=","),t+=e[n];t+="]",this.logger.log("linemap: "+t)},t.prototype.addPadding=function(e,t,n,r){for(var i=r?"":e,o=e.length;t>o;o++)i+=n;return i+=r?e:""},t.prototype.addLineColumn=function(t,n){var r={line:-1,col:-1};return e.getSourceLineColFromMap(r,n,t.locationInfo.lineMap),-1!==r.col&&r.col++,"("+r.line+", "+r.col+")"},t}();e.AstLogger=t}(TypeScript||(TypeScript={}));var TypeScript;!function(e){var t=function(){function t(e){this.checker=e}return t.prototype.resolveBaseTypeLinks=function(e,t){var n=null;if(e){n=new Array;for(var r=0,i=e.length;i>r;r++)n[r]=this.checker.resolveBaseTypeLink(e[r],t)}return n},t.prototype.resolveBases=function(e,t){t.extendsList=this.resolveBaseTypeLinks(t.extendsTypeLinks,e);for(var n=0,r=t.extendsList.length,i=t.isClassInstance();r>n;n++){var o=t.extendsList[n].isClassInstance();if(t.extendsList[n]!=this.checker.anyType){var s=t.extendsTypeLinks[n].ast;i?o||this.checker.errorReporter.simpleError(s,"A class may only extend other classes, "+t.extendsList[n].symbol.fullName()+" is not a class."):o&&this.checker.errorReporter.simpleError(s,"An interface may only extend other interfaces, "+t.extendsList[n].symbol.fullName()+" is a class.")}}if(t.implementsList=this.resolveBaseTypeLinks(t.implementsTypeLinks,e),t.implementsList)for(n=0,r=t.implementsList.length;r>n;n++){var a=t.implementsList[n],s=t.implementsTypeLinks[n].ast;a.isClassInstance()&&i&&this.checker.errorReporter.simpleError(s,"A class may only implement an interface; "+a.symbol.fullName()+" is a class.")}},t.prototype.resolveSignatureGroup=function(e,t,n){for(var r=!e.hasImplementation,i=0,o=e.signatures.length;o>i;i++){var s=e.signatures[i];n?s.returnType.type=n:this.checker.resolveTypeLink(t,s.returnType,r);for(var a=s.parameters.length,l=0;a>l;l++)this.bindSymbol(t,s.parameters[l]);if(s.hasVariableArgList){var c=s.parameters[a-1];c.argsOffset=a-1,c.getType().isArray()||(this.checker.errorReporter.simpleErrorFromSym(c,"... parameter must have array type"),c.parameter.typeLink.type=this.checker.makeArrayType(c.parameter.typeLink.type))}}},t.prototype.bindType=function(t,n,r){r&&this.bindType(t,r,null);var i=t;if(n.hasMembers()){var o=n.members,s=n.ambientMembers,a=n.getAllEnclosedTypes(),l=n.getAllAmbientEnclosedTypes(),c=new e.SymbolTableScope(o,s,a,l,n.symbol),u=new e.SymbolAggregateScope(n.symbol),p=this.checker.currentModDecl,h=this.checker.inBind;u.addParentScope(c),u.addParentScope(t),n.isModuleType()&&(this.checker.currentModDecl=n.symbol.declAST,this.checker.inBind=!0),o&&this.bind(u,n.members.allMembers),a&&this.bind(u,a.allMembers),s&&this.bind(u,s.allMembers),l&&this.bind(u,l.allMembers),n.isModuleType()&&(i=u),this.checker.currentModDecl=p,this.checker.inBind=h}n.extendsTypeLinks&&this.resolveBases(t,n),n.construct&&this.resolveSignatureGroup(n.construct,i,r),n.call&&this.resolveSignatureGroup(n.call,i,null),n.index&&this.resolveSignatureGroup(n.index,t,null),n.elementType&&this.bindType(t,n.elementType,null)},t.prototype.bindSymbol=function(t,n){if(!n.bound){var r=this.checker.locationInfo;switch(this.checker.units&&n.unitIndex>=0&&n.unitIndext)return e.encodedValues.charAt(t);throw TypeError(t+": not a 64 based value")},e.decodeChar=function(t){if(1===t.length)return e.encodedValues.indexOf(t);throw TypeError('"'+t+'" must have length 1')},e}(),n=function(){function e(){}return e.encode=function(e){0>e?e=(-e<<1)+1:e<<=1;var n="";do{var r=31&e;e>>=5,e>0&&(r=32|r),n+=t.encode(r)}while(e>0);return n},e.decode=function(e){for(var n=0,r=!1,i=0,o=0;o>1):n|=(31&s)<0&&d.push.apply(d,r.names);var T=function(t,n){if(null==g||g.emittedColumn!=t.emittedColumn||g.emittedLine!=t.emittedLine){if(l!==t.emittedLine){for(;l=0&&(o+=e.Base64VLQFormat.encode(f+n-h),h=f+n),m=!0,g=t}},b=function(e){for(var t=0;t1||e.endsLine){for(var r=1;ri;i++){var o=t.members[i],s=null;s=o.nodeType==e.NodeType.Call?o.target.type.symbol:o.type.symbol;var a=s.name;if(s.declModule!=n.type.symbol.declModule&&(a=s.fullName()),o.nodeType==e.NodeType.Call){this.emitIndent(),this.writeToOutput("_super.call(this");var l=o.arguments;l&&l.members.length>0&&(this.writeToOutput(", "),this.emitJavascriptList(l,", ",e.TokenID.Comma,!1,!1,!1)),this.writeToOutput(")")}else o.type&&o.type.isClassInstance()&&(this.emitIndent(),this.writeToOutput(n.name.actualText+"._super.constructor"),this.writeToOutput(".call(this)"))}this.recordSourceMappingEnd(n)}},r.prototype.emitInnerFunction=function(n,r,i,o,s,a){var l=n.isConstructor&&e.hasFlag(n.fncFlags,e.FncFlags.ClassMethod),c=l&&e.hasFlag(this.thisClassNode.type.instanceType.typeFlags,e.TypeFlags.HasBaseType)&&!e.hasFlag(this.thisClassNode.type.instanceType.typeFlags,e.TypeFlags.HasBaseTypeOfObject),u=c&&e.hasFlag(this.thisClassNode.varFlags,e.VarFlags.ClassSuperMustBeFirstCallInConstructor),p=e.hasFlag(n.fncFlags,e.FncFlags.IsFunctionExpression)&&!n.isParenthesized&&!n.isAccessor()&&(e.hasFlag(n.flags,e.ASTFlags.ExplicitSemicolon)||e.hasFlag(n.flags,e.ASTFlags.AutomaticSemicolon));if(this.emitParensAndCommentsInPlace(n,!0),p&&this.writeToOutput("("),this.recordSourceMappingStart(n),n.isAccessor()&&n.accessorSymbol.isObjectLitField||this.writeToOutput("function "),r){var h=n.getNameText();h&&!n.isAccessor()&&(n.name&&this.recordSourceMappingStart(n.name),this.writeToOutput(h),n.name&&this.recordSourceMappingEnd(n.name))}this.writeToOutput("(");var d,f=0,m=0,g=[];if(n.arguments){var y=this.setContainer(t.Args);f=n.arguments.members.length;var v=f;for(n.variableArgList&&v--,m=0;v>m;m++)d=n.arguments.members[m],d.init&&g.push(d),this.emitJavascript(d,e.TokenID.OpenParen,!1),v-1>m&&this.writeToOutput(", ");this.setContainer(y)}for(this.writeLineToOutput(") {"),n.isConstructor?this.recordSourceMappingNameStart("constructor"):n.isGetAccessor()?this.recordSourceMappingNameStart("get_"+n.getNameText()):n.isSetAccessor()?this.recordSourceMappingNameStart("set_"+n.getNameText()):this.recordSourceMappingNameStart(n.getNameText()),this.indenter.increaseIndent(),m=0;mm;m++)d=n.arguments.members[m],(d.varFlags&e.VarFlags.Property)!=e.VarFlags.None&&(this.emitIndent(),this.recordSourceMappingStart(d),this.recordSourceMappingStart(d.id),this.writeToOutput("this."+d.id.actualText),this.recordSourceMappingEnd(d.id),this.writeToOutput(" = "),this.recordSourceMappingStart(d.id),this.writeToOutput(d.id.actualText),this.recordSourceMappingEnd(d.id),this.writeLineToOutput(";"),this.recordSourceMappingEnd(d));e.hasFlag(n.fncFlags,e.FncFlags.ClassMethod)||this.emitConstructorCalls(o,a)}if(s&&this.writeCaptureThisStatement(n),n.variableArgList){f=n.arguments.members.length;var T=n.arguments.members[f-1];this.emitIndent(),this.recordSourceMappingStart(T),this.writeToOutput("var "),this.recordSourceMappingStart(T.id),this.writeToOutput(T.id.actualText),this.recordSourceMappingEnd(T.id),this.writeLineToOutput(" = [];"),this.recordSourceMappingEnd(T),this.emitIndent(),this.writeToOutput("for ("),this.recordSourceMappingStart(T),this.writeToOutput("var _i = 0;"),this.recordSourceMappingEnd(T),this.writeToOutput(" "),this.recordSourceMappingStart(T),this.writeToOutput("_i < (arguments.length - "+(f-1)+")"),this.recordSourceMappingEnd(T),this.writeToOutput("; "),this.recordSourceMappingStart(T),this.writeToOutput("_i++"),this.recordSourceMappingEnd(T),this.writeLineToOutput(") {"),this.indenter.increaseIndent(),this.emitIndent(),this.recordSourceMappingStart(T),this.writeToOutput(T.id.actualText+"[_i] = arguments[_i + "+(f-1)+"];"),this.recordSourceMappingEnd(T),this.writeLineToOutput(""),this.indenter.decreaseIndent(),this.emitIndent(),this.writeLineToOutput("}")}if(n.isConstructor&&e.hasFlag(n.fncFlags,e.FncFlags.ClassMethod)&&!u)for(var b=this.thisClassNode.members.members.length,m=0;b>m;m++)if(this.thisClassNode.members.members[m].nodeType==e.NodeType.VarDecl){var k=this.thisClassNode.members.members[m];!e.hasFlag(k.varFlags,e.VarFlags.Static)&&k.init&&(this.emitIndent(),this.emitJavascriptVarDecl(k,e.TokenID.Tilde),this.writeLineToOutput(""))}this.emitBareJavascriptStatements(n.bod,u),this.indenter.decreaseIndent(),this.emitIndent(),this.recordSourceMappingStart(n.endingToken),this.writeToOutput("}"),this.recordSourceMappingNameEnd(),this.recordSourceMappingEnd(n.endingToken),this.recordSourceMappingEnd(n),p&&this.writeToOutput(")"),this.recordSourceMappingEnd(n),this.emitParensAndCommentsInPlace(n,!1),i||e.hasFlag(n.fncFlags,e.FncFlags.IsFunctionExpression)||e.hasFlag(n.fncFlags,e.FncFlags.Signature)&&!n.isConstructor?e.hasFlag(n.fncFlags,e.FncFlags.IsFunctionExpression)&&(e.hasFlag(n.flags,e.ASTFlags.ExplicitSemicolon)||e.hasFlag(n.flags,e.ASTFlags.AutomaticSemicolon))&&this.writeLineToOutput(";"):this.writeLineToOutput("")},r.prototype.emitJavascriptModule=function(n){var r=n.name.actualText;if(e.isTSFile(r)?n.name.setText(r.substring(0,r.length-3)):e.isSTRFile(r)&&n.name.setText(r.substring(0,r.length-4)),!e.hasFlag(n.modFlags,e.ModuleFlags.Ambient)){var i=e.hasFlag(n.modFlags,e.ModuleFlags.IsDynamic),o=this.outfile,s=this.emittingFileName,a=this.allSourceMappers,l=this.sourceMapper,c=this.emitState.column,u=this.emitState.line,p=this.setContainer(t.Module),h=this.moduleName,d=e.hasFlag(n.modFlags,e.ModuleFlags.Exported);this.moduleDeclList[this.moduleDeclList.length]=n;var f=e.hasFlag(n.modFlags,e.ModuleFlags.IsWholeFile);if(this.moduleName=n.name.actualText,i){var m=e.stripQuotes(n.name.actualText),g=e.trimModName(m)+".js";if(g=this.emitOptions.mapOutputFileName(g,e.TypeScriptCompiler.mapToJSFileName),this.emitOptions.ioHost)if(e.switchToForwardSlashes(g)!=e.switchToForwardSlashes(this.emittingFileName)){this.emittingFileName=g;var y=n.containsUnicodeChar||this.emitOptions.emitComments&&n.containsUnicodeCharInComment;if(this.outfile=this.createFile(this.emittingFileName,y),null!=l){this.allSourceMappers=[];var v=this.createFile(this.emittingFileName+e.SourceMapper.MapFileExtension,!1);this.setSourceMappings(new e.SourceMapper(m,this.emittingFileName,this.outfile,v,this.errorReporter,this.emitOptions.emitFullSourceMapPath)),this.emitState.column=0,this.emitState.line=0}}else e.CompilerDiagnostics.assert(this.emitOptions.outputMany,"Cannot have dynamic modules compiling into single file");if(this.setContainer(t.DynamicModule),this.recordSourceMappingStart(n),e.moduleGenTarget==e.ModuleGenTarget.Asynchronous){for(var T='["require", "exports"',b="require, exports",k=null,S=0;S=0){switch(t){case e.TokenID.Const:this.writeToOutput("const ");break;case e.TokenID.Let:this.writeToOutput("let ");break;case e.TokenID.Var:this.writeToOutput("var ")}this.setInVarBlock(-this.varListCount())}return!0},r.prototype.onEmitVar=function(){this.varListCount()>0?this.setInVarBlock(this.varListCount()-1):this.varListCount()<0&&this.setInVarBlock(this.varListCount()+1)},r.prototype.emitJavascriptVarDecl=function(n,r){if((n.varFlags&e.VarFlags.Ambient)==e.VarFlags.Ambient)this.emitAmbientVarDecl(n),this.onEmitVar();else{var i=n.sym,o=null!=n.init;if(this.emitParensAndCommentsInPlace(n,!0),this.recordSourceMappingStart(n),i&&i.isMember()&&i.container&&i.container.kind()==e.SymbolKind.Type){var s=i.container.type;s.isClass()&&!e.hasFlag(i.flags,e.SymbolFlags.ModuleMember)?this.emitState.container!=t.Args&&(e.hasFlag(i.flags,e.SymbolFlags.Static)?this.writeToOutput(i.container.name+"."):this.writeToOutput("this.")):s.hasImplementation()?e.hasFlag(i.flags,e.SymbolFlags.Exported)||i.container!=this.checker.gloMod&&e.hasFlag(i.flags,e.SymbolFlags.Property)?e.hasFlag(n.varFlags,e.VarFlags.LocalStatic)?this.writeToOutput("."):this.emitState.container==t.DynamicModule?this.writeToOutput("exports."):this.writeToOutput(this.moduleName+"."):this.emitVarDeclVar(n.tokenId):r!=e.TokenID.OpenParen&&(e.hasFlag(i.flags,e.SymbolFlags.Exported)&&i.container==this.checker.gloMod?this.writeToOutput("this."):this.emitVarDeclVar(n.tokenId))}else r!=e.TokenID.OpenParen&&this.emitVarDeclVar(n.tokenId);this.recordSourceMappingStart(n.id),this.writeToOutput(n.id.actualText),this.recordSourceMappingEnd(n.id),o&&(this.writeToOutputTrimmable(" = "),this.varListCountStack.push(0),this.emitJavascript(n.init,e.TokenID.Comma,!1),this.varListCountStack.pop()),this.onEmitVar(),r!=e.TokenID.OpenParen&&(this.varListCount()<0?this.writeToOutput(", "):r!=e.TokenID.For&&this.writeToOutputTrimmable(";")),this.recordSourceMappingEnd(n),this.emitParensAndCommentsInPlace(n,!1)}},r.prototype.declEnclosed=function(e){if(null==e)return!0;for(var t=0,n=this.moduleDeclList.length;n>t;t++)if(this.moduleDeclList[t]==e)return!0;return!1},r.prototype.emitJavascriptName=function(n,r){var i=n.sym;if(this.emitParensAndCommentsInPlace(n,!0),this.recordSourceMappingStart(n),!n.isMissing()){if(r&&this.emitState.container!=t.Args&&i)if(i.container&&i.container.name!=e.globalId){if(e.hasFlag(i.flags,e.SymbolFlags.Static)&&e.hasFlag(i.flags,e.SymbolFlags.Property))i.declModule&&e.hasFlag(i.declModule.modFlags,e.ModuleFlags.IsDynamic)?this.writeToOutput("exports."):this.writeToOutput(i.container.name+".");else if(i.kind()==e.SymbolKind.Field){var o=i;e.hasFlag(o.flags,e.SymbolFlags.ModuleMember)?i.container!=this.checker.gloMod&&(e.hasFlag(i.flags,e.SymbolFlags.Property)||e.hasFlag(i.flags,e.SymbolFlags.Exported))&&(e.hasFlag(i.declModule.modFlags,e.ModuleFlags.IsDynamic)?this.writeToOutput("exports."):this.writeToOutput(i.container.name+".")):i.isInstanceProperty()&&(this.emitThis(),this.writeToOutput("."))}else if(i.kind()==e.SymbolKind.Type)if(i.isInstanceProperty()){var s=i,a=s.type;a.call&&!e.hasFlag(i.flags,e.SymbolFlags.ModuleMember)&&(this.emitThis(),this.writeToOutput("."))}else i.unitIndex==this.checker.locationInfo.unitIndex&&this.declEnclosed(i.declModule)||this.writeToOutput(i.container.name+".")}else i.container!=this.checker.gloMod||!e.hasFlag(i.flags,e.SymbolFlags.Exported)||e.hasFlag(i.flags,e.SymbolFlags.Ambient)||(i.isType()||i.isMember())&&i.declModule&&e.hasFlag(i.declModule.modFlags,e.ModuleFlags.Ambient)||this.emitState.container!=t.Prog||i.declAST.nodeType==e.NodeType.FuncDecl||this.writeToOutput("this.");if(i&&i.declAST&&i.declAST.nodeType==e.NodeType.ModuleDeclaration&&e.hasFlag(i.declAST.modFlags,e.ModuleFlags.IsDynamic)){var l=i.declAST;if(e.moduleGenTarget==e.ModuleGenTarget.Asynchronous)this.writeLineToOutput("__"+this.modAliasId+"__;");else{var c=n.actualText,u=e.isSingleQuoted(c),p=l.mod.symbol.declAST&&e.hasFlag(l.mod.symbol.declAST.modFlags,e.ModuleFlags.Ambient);c=p?c:this.firstModAlias?this.firstModAlias:e.quoteBaseName(c),c=p?c:e.isRelative(e.stripQuotes(c))?c:e.quoteStr("./"+e.stripQuotes(c)),u&&(c=e.changeToSingleQuote(c)),this.writeToOutput("require("+c+")")}}else this.writeToOutput(n.actualText)}this.recordSourceMappingEnd(n),this.emitParensAndCommentsInPlace(n,!1)},r.prototype.emitJavascriptStatements=function(t,n){if(t)if(t.nodeType!=e.NodeType.Block){var r=t&&(t.nodeType!=e.NodeType.List||t.members.length>0);if(n||r){var i=t.nodeType==e.NodeType.Block||t.nodeType==e.NodeType.List&&1==t.members.length&&t.members[0].nodeType==e.NodeType.Block;this.recordSourceMappingStart(t),i||(this.writeLineToOutput(" {"),this.indenter.increaseIndent()),this.emitJavascriptList(t,null,e.TokenID.Semicolon,!0,!1,!1),i||(this.writeLineToOutput(""),this.indenter.decreaseIndent(),this.emitIndent(),this.writeToOutput("}")),this.recordSourceMappingEnd(t)}}else this.emitJavascript(t,e.TokenID.Semicolon,!0);else n&&this.writeToOutput("{ }")},r.prototype.emitBareJavascriptStatements=function(t,n){if("undefined"==typeof n&&(n=!1),t.nodeType!=e.NodeType.Block)if(t.nodeType==e.NodeType.List){var r=t;2==r.members.length&&r.members[0].nodeType==e.NodeType.Block&&r.members[1].nodeType==e.NodeType.EndCode?(this.emitJavascript(r.members[0],e.TokenID.Semicolon,!0),this.writeLineToOutput("")):this.emitJavascriptList(t,null,e.TokenID.Semicolon,!0,!1,n)}else this.emitJavascript(t,e.TokenID.Semicolon,!0);else this.emitJavascript(t,e.TokenID.Semicolon,!0)},r.prototype.recordSourceMappingNameStart=function(e){if(this.sourceMapper){var t=e;e?this.sourceMapper.currentNameIndex.length>0&&(t=this.sourceMapper.names[this.sourceMapper.currentNameIndex[this.sourceMapper.currentNameIndex.length-1]]+"."+e):t="",this.sourceMapper.names.push(t),this.sourceMapper.currentNameIndex.push(this.sourceMapper.names.length-1)}},r.prototype.recordSourceMappingNameEnd=function(){this.sourceMapper&&this.sourceMapper.currentNameIndex.pop()},r.prototype.recordSourceMappingStart=function(t){if(this.sourceMapper&&e.isValidAstNode(t)){var n={line:-1,col:-1},r=new e.SourceMapping;r.start.emittedColumn=this.emitState.column,r.start.emittedLine=this.emitState.line,e.getSourceLineColFromMap(n,t.minChar,this.checker.locationInfo.lineMap),r.start.sourceColumn=n.col,r.start.sourceLine=n.line,e.getSourceLineColFromMap(n,t.limChar,this.checker.locationInfo.lineMap),r.end.sourceColumn=n.col,r.end.sourceLine=n.line,this.sourceMapper.currentNameIndex.length>0&&(r.nameIndex=this.sourceMapper.currentNameIndex[this.sourceMapper.currentNameIndex.length-1]);var i=this.sourceMapper.currentMappings[this.sourceMapper.currentMappings.length-1];i.push(r),this.sourceMapper.currentMappings.push(r.childMappings)}},r.prototype.recordSourceMappingEnd=function(t){if(this.sourceMapper&&e.isValidAstNode(t)){this.sourceMapper.currentMappings.pop();var n=this.sourceMapper.currentMappings[this.sourceMapper.currentMappings.length-1],r=n[n.length-1];r.end.emittedColumn=this.emitState.column,r.end.emittedLine=this.emitState.line}},r.prototype.Close=function(){null!=this.sourceMapper&&e.SourceMapper.EmitSourceMapping(this.allSourceMappers);try{this.outfile.Close()}catch(t){this.errorReporter.emitterError(null,t.message)}},r.prototype.emitJavascriptList=function(t,n,r,i,o,s,a,l){if("undefined"==typeof s&&(s=!1),"undefined"==typeof a&&(a=!1),null!=t)if(t.nodeType!=e.NodeType.List)this.emitPrologue(a),this.emitJavascript(t,r,i);else{var c=t;if(this.emitParensAndCommentsInPlace(t,!0),0==c.members.length)return this.emitParensAndCommentsInPlace(t,!1),void 0;for(var u=c.members.length,p=0;u>p;p++){if(a&&(1!=p&&e.hasFlag(c.flags,e.ASTFlags.StrictMode)||(this.emitPrologue(l),a=!1)),1==p&&s){var h=this.thisClassNode.constructorDecl;if(h&&h.arguments)for(var d=h.arguments.members.length,f=0;d>f;f++){var m=h.arguments.members[f];(m.varFlags&e.VarFlags.Property)!=e.VarFlags.None&&(this.emitIndent(),this.recordSourceMappingStart(m),this.recordSourceMappingStart(m.id),this.writeToOutput("this."+m.id.actualText),this.recordSourceMappingEnd(m.id),this.writeToOutput(" = "),this.recordSourceMappingStart(m.id),this.writeToOutput(m.id.actualText),this.recordSourceMappingEnd(m.id),this.writeLineToOutput(";"),this.recordSourceMappingEnd(m))}for(var g=this.thisClassNode.members.members.length,y=0;g>y;y++)if(this.thisClassNode.members.members[y].nodeType==e.NodeType.VarDecl){var v=this.thisClassNode.members.members[y];!e.hasFlag(v.varFlags,e.VarFlags.Static)&&v.init&&(this.emitIndent(),this.emitJavascriptVarDecl(v,e.TokenID.Tilde),this.writeLineToOutput(""))}}var T=c.members[p],b=T.nodeType==e.NodeType.FuncDecl&&e.hasFlag(T.fncFlags,e.FncFlags.Static)||T.nodeType==e.NodeType.VarDecl&&e.hasFlag(T.varFlags,e.VarFlags.Static);(o?b:!b)&&(this.emitJavascript(T,r,i),n&&u-1>p?i?this.writeLineToOutput(n):this.writeToOutput(n):i&&T.nodeType!=e.NodeType.ModuleDeclaration&&T.nodeType!=e.NodeType.InterfaceDeclaration&&(T.nodeType!=e.NodeType.VarDecl||(T.varFlags&e.VarFlags.Ambient)!=e.VarFlags.Ambient||null!=T.init)&&this.varListCount()>=0&&(T.nodeType!=e.NodeType.Block||T.isStatementBlock)&&T.nodeType!=e.NodeType.EndCode&&T.nodeType!=e.NodeType.FuncDecl&&this.writeLineToOutput("")) }this.emitParensAndCommentsInPlace(t,!1)}},r.prototype.emitJavascript=function(n,r,i){null!=n&&(i&&this.indenter.indentAmt>0&&n.nodeType!=e.NodeType.List&&n.nodeType!=e.NodeType.Block&&(n.nodeType==e.NodeType.InterfaceDeclaration||n.nodeType==e.NodeType.VarDecl&&(n.varFlags&e.VarFlags.Ambient)==e.VarFlags.Ambient&&null==n.init||!(this.varListCount()>=0)||n.nodeType==e.NodeType.EndCode||n.nodeType==e.NodeType.FuncDecl&&this.emitState.container==t.Constructor||this.emitIndent()),n.emit(this,r,i),r==e.TokenID.Semicolon&&n.nodeTypes;s++)this.emitAddBaseMethods(t,n.extendsList[s],r)},r.prototype.emitJavascriptClass=function(n){if(!e.hasFlag(n.varFlags,e.VarFlags.Ambient)){var i=this.thisClassNode,o=0;this.thisClassNode=n;var s=n.name.actualText;this.emitParensAndCommentsInPlace(n,!0);var a=this.setContainer(t.Class);this.recordSourceMappingStart(n),e.hasFlag(n.varFlags,e.VarFlags.Exported)&&n.type.symbol.container==this.checker.gloMod?this.writeToOutput("this."+s):this.writeToOutput("var "+s);var l=n.extendsList&&n.extendsList.members.length,c=null,u=null;l?this.writeLineToOutput(" = (function (_super) {"):this.writeLineToOutput(" = (function () {"),this.recordSourceMappingNameStart(s),this.indenter.increaseIndent(),l&&(c=n.extendsList.members[0],u=c.nodeType==e.NodeType.Call?c.target:c,this.emitIndent(),this.writeLineToOutput("__extends("+s+", _super);")),this.emitIndent();var p=n.constructorDecl;if(p)this.emitJavascript(n.constructorDecl,e.TokenID.OpenParen,!1);else{var h=0;this.recordSourceMappingStart(n),this.indenter.increaseIndent(),this.writeToOutput("function "+n.name.actualText+"() {"),this.recordSourceMappingNameStart("constructor"),l&&(this.writeLineToOutput(""),this.emitIndent(),this.writeLineToOutput("_super.apply(this, arguments);"),h++),n.varFlags&e.VarFlags.MustCaptureThis&&this.writeCaptureThisStatement(n);for(var d=this.thisClassNode.members.members,o=0;og;g++){var y=n.members.members[g];if(y.nodeType==e.NodeType.FuncDecl){var v=y;e.hasFlag(v.fncFlags,e.FncFlags.Method)&&!v.isSignature()&&(e.hasFlag(v.fncFlags,e.FncFlags.Static)?v.isAccessor()?this.emitPropertyAccessor(v,this.thisClassNode.name.actualText,!1):(this.emitIndent(),this.recordSourceMappingStart(v),this.writeToOutput(n.name.actualText+"."+v.name.actualText+" = "),this.emitInnerFunction(v,v.name&&!v.name.isMissing(),!0,null,r.shouldCaptureThis(v),null),this.writeLineToOutput(";")):this.emitPrototypeMember(v,s))}else{if(y.nodeType!=e.NodeType.VarDecl)throw Error("We want to catch this");var f=y;e.hasFlag(f.varFlags,e.VarFlags.Static)&&f.init&&(this.emitIndent(),this.recordSourceMappingStart(f),this.writeToOutput(n.name.actualText+"."+f.id.actualText+" = "),this.emitJavascript(f.init,e.TokenID.Equals,!1),this.writeLineToOutput(";"),this.recordSourceMappingEnd(f))}}if(this.emitIndent(),this.recordSourceMappingStart(n.endingToken),this.writeLineToOutput("return "+s+";"),this.recordSourceMappingEnd(n.endingToken),this.indenter.decreaseIndent(),this.emitIndent(),this.recordSourceMappingStart(n.endingToken),this.writeToOutput("}"),this.recordSourceMappingNameEnd(),this.recordSourceMappingEnd(n.endingToken),this.recordSourceMappingStart(n),this.writeToOutput(")("),l&&this.emitJavascript(u,e.TokenID.Tilde,!1),this.writeToOutput(");"),this.recordSourceMappingEnd(n),(a==t.Module||a==t.DynamicModule)&&e.hasFlag(n.varFlags,e.VarFlags.Exported)){this.writeLineToOutput(""),this.emitIndent();var T=a==t.Module?this.moduleName:"exports";this.recordSourceMappingStart(n),this.writeToOutput(T+"."+s+" = "+s+";"),this.recordSourceMappingEnd(n)}this.emitIndent(),this.recordSourceMappingEnd(n),this.emitParensAndCommentsInPlace(n,!1),this.setContainer(a),this.thisClassNode=i}},r.prototype.emitPrologue=function(e){this.extendsPrologueEmitted||e&&(this.extendsPrologueEmitted=!0,this.writeLineToOutput("var __extends = this.__extends || function (d, b) {"),this.writeLineToOutput(" function __() { this.constructor = d; }"),this.writeLineToOutput(" __.prototype = b.prototype;"),this.writeLineToOutput(" d.prototype = new __();"),this.writeLineToOutput("};")),this.globalThisCapturePrologueEmitted||this.checker.mustCaptureGlobalThis&&(this.globalThisCapturePrologueEmitted=!0,this.writeLineToOutput(this.captureThisStmtString))},r.prototype.emitSuperReference=function(){this.writeToOutput("_super.prototype")},r.prototype.emitSuperCall=function(t){if(t.target.nodeType==e.NodeType.Dot){var n=t.target;if(n.operand1.nodeType==e.NodeType.Super)return this.emitJavascript(n,e.TokenID.OpenParen,!1),this.writeToOutput(".call("),this.emitThis(),t.arguments&&t.arguments.members.length>0&&(this.writeToOutput(", "),this.emitJavascriptList(t.arguments,", ",e.TokenID.Comma,!1,!1,!1)),this.writeToOutput(")"),!0}return!1},r.prototype.emitThis=function(){!this.thisFnc||this.thisFnc.isMethod()||this.thisFnc.isConstructor?this.writeToOutput("this"):this.writeToOutput("_this")},r.shouldCaptureThis=function(e){return e.hasSelfReference()||e.hasSuperReferenceInFatArrowFunction()},r.prototype.createFile=function(e,t){try{return this.emitOptions.ioHost.createFile(e,t)}catch(n){this.errorReporter.emitterError(null,n.message)}},r}();e.Emitter=o}(TypeScript||(TypeScript={}));var TypeScript;!function(e){var t=function(){function t(e){this.outfile=e,this.parser=null,this.checker=null,this.lineCol={line:0,col:0},this.emitAsComments=!0,this.hasErrors=!1,this.pushToErrorSink=!1,this.errorSink=[]}return t.prototype.getCapturedErrors=function(){return this.errorSink},t.prototype.freeCapturedErrors=function(){this.errorSink=[]},t.prototype.captureError=function(e){this.errorSink[this.errorSink.length]=e},t.prototype.setErrOut=function(e){this.outfile=e,this.emitAsComments=!1},t.prototype.emitPrefix=function(){this.emitAsComments&&this.outfile.Write("// "),this.outfile.Write(this.checker.locationInfo.filename+"("+this.lineCol.line+","+this.lineCol.col+"): ")},t.prototype.writePrefix=function(e){e?this.setError(e):(this.lineCol.line=0,this.lineCol.col=0),this.emitPrefix()},t.prototype.writePrefixFromSym=function(t){t&&this.checker.locationInfo.lineMap?e.getSourceLineColFromMap(this.lineCol,t.location,this.checker.locationInfo.lineMap):(this.lineCol.line=-1,this.lineCol.col=-1),this.emitPrefix()},t.prototype.setError=function(t){t&&(t.flags|=e.ASTFlags.Error,this.checker.locationInfo.lineMap&&e.getSourceLineColFromMap(this.lineCol,t.minChar,this.checker.locationInfo.lineMap))},t.prototype.reportError=function(e,t){if(this.pushToErrorSink)return this.captureError(t),void 0;if(this.hasErrors=!0,e&&this.parser.errorRecovery&&this.parser.errorCallback){var n=e.limChar-e.minChar;this.parser.errorCallback(e.minChar,n,t,this.checker.locationInfo.unitIndex)}else this.writePrefix(e),this.outfile.WriteLine(t)},t.prototype.reportErrorFromSym=function(e,t){return this.pushToErrorSink?(this.captureError(t),void 0):(this.hasErrors=!0,this.parser.errorRecovery&&this.parser.errorCallback?this.parser.errorCallback(e.location,e.length,t,this.checker.locationInfo.unitIndex):(this.writePrefixFromSym(e),this.outfile.WriteLine(t)),void 0)},t.prototype.emitterError=function(e,t){throw this.reportError(e,t),Error("EmitError")},t.prototype.duplicateIdentifier=function(e,t){this.reportError(e,"Duplicate identifier '"+t+"'")},t.prototype.showRef=function(e,t,n){var r={line:-1,col:-1};this.parser.getSourceLineCol(r,n.location),this.reportError(e,"symbol "+t+" defined at ("+r.line+","+r.col+")")},t.prototype.unresolvedSymbol=function(e,t){this.reportError(e,"The name '"+t+"' does not exist in the current scope")},t.prototype.symbolDoesNotReferToAValue=function(e,t){this.reportError(e,"The name '"+t+"' does not refer to a value")},t.prototype.styleError=function(e,t){var n=this.pushToErrorSink;this.pushToErrorSink=!1,this.reportError(e,"STYLE: "+t),this.pushToErrorSink=n},t.prototype.simpleError=function(e,t){this.reportError(e,t)},t.prototype.simpleErrorFromSym=function(e,t){this.reportErrorFromSym(e,t)},t.prototype.invalidSuperReference=function(e){this.simpleError(e,"Keyword 'super' can only be used inside a class instance method")},t.prototype.valueCannotBeModified=function(e){this.simpleError(e,"The left-hand side of an assignment expression must be a variable, property or indexer")},t.prototype.invalidCall=function(t,n,r){var i=t.target.type,o=i.getScopedTypeName(r);if(i.construct&&n==e.NodeType.Call)this.reportError(t,"Value of type '"+o+"' is not callable. Did you mean to include 'new'?");else{var s=n==e.NodeType.Call?"callable":"newable";this.reportError(t,"Value of type '"+o+"' is not "+s)}},t.prototype.indexLHS=function(e,t){var n=e.operand1.type.getScopedTypeName(t),r=e.operand2.type.getScopedTypeName(t);this.simpleError(e,"Value of type '"+n+"' is not indexable by type '"+r+"'")},t.prototype.incompatibleTypes=function(e,t,n,r,i,o){t||(t=this.checker.anyType),n||(n=this.checker.anyType);var s=o?o.message:"";r?this.reportError(e,"Operator '"+r+"' cannot be applied to types '"+t.getScopedTypeName(i)+"' and '"+n.getScopedTypeName(i)+"'"+(s?": "+s:"")):this.reportError(e,"Cannot convert '"+t.getScopedTypeName(i)+"' to '"+n.getScopedTypeName(i)+"'"+(s?": "+s:""))},t.prototype.expectedClassOrInterface=function(e){this.simpleError(e,"Expected var, class, interface, or module")},t.prototype.unaryOperatorTypeError=function(e,t,n){this.reportError(e,"Operator '"+t+"' cannot be applied to type '"+n.getTypeName()+"'")},t}();e.ErrorReporter=t}(TypeScript||(TypeScript={}));var TypeScript;!function(e){function t(t,n,r,o,s,a){var l=r.getText(o,s);t.log("Quick parse range ("+o+","+s+'): "'+e.stringToLiteral(l,100)+'"');var c=new i;c.setErrorRecovery(null),c.errorCallback=a;var u=new e.ClassDeclaration(null,null,null,null);c.currentClassDecl=u;var p=c.quickParse(new e.StringSourceText(l),"",0);return p}!function(e){e._map=[],e.NoTypes=0,e.ArraySuffix=1,e.Primitive=2,e.Named=4,e.AllSimpleTypes=e.Primitive|e.Named,e.AllTypes=e.Primitive|e.Named|e.ArraySuffix}(e.TypeContext||(e.TypeContext={}));var n=e.TypeContext,r=function(){function e(e,t){this.Script=e,this.endLexState=t}return e}();e.QuickParseResult=r;var i=function(){function t(){this.varLists=[],this.scopeLists=[],this.staticsLists=[],this.scanner=new e.Scanner,this.currentToken=null,this.needTerminator=!1,this.inFunction=!1,this.inInterfaceDecl=!1,this.currentClassDecl=null,this.inFncDecl=!1,this.anonId=new e.Identifier("_anonymous"),this.style_requireSemi=!1,this.style_funcInLoop=!0,this.incremental=!1,this.errorRecovery=!1,this.outfile=void 0,this.errorCallback=null,this.ambientModule=!1,this.ambientClass=!1,this.topLevel=!0,this.allowImportDeclaration=!0,this.currentUnitIndex=-1,this.prevIDTok=null,this.statementInfoStack=new Array,this.hasTopLevelImportOrExport=!1,this.strictMode=!1,this.nestingLevel=0,this.prevExpr=null,this.currentClassDefinition=null,this.parsingClassConstructorDefinition=!1,this.parsingDeclareFile=!1,this.amdDependencies=[],this.inferPropertiesFromThisAssignment=!1,this.requiresExtendsBlock=!1,this.fname=""}return t.prototype.resetStmtStack=function(){this.statementInfoStack=new Array},t.prototype.inLoop=function(){for(var e=this.statementInfoStack.length-1;e>=0;e--)if(this.statementInfoStack[e].stmt.isLoop())return!0;return!1},t.prototype.pushStmt=function(e,t){var n={stmt:e,labels:t};this.statementInfoStack.push(n)},t.prototype.popStmt=function(){return this.statementInfoStack.pop()},t.prototype.resolveJumpTarget=function(t){for(var n=e.AST.getResolvedIdentifierName(t.target),r=this.statementInfoStack.length,i=r-1;i>=0;i--){var o=this.statementInfoStack[i];if(t.target){if(o.labels&&o.labels.members.length>0)for(var s=0,a=o.labels.members.length;a>s;s++){var l=o.labels.members[s];if(l.id.text==n)return t.setResolvedTarget(this,o.stmt),void 0}}else{if(o.stmt.isLoop())return t.setResolvedTarget(this,o.stmt),void 0;if(o.stmt.nodeType==e.NodeType.Switch&&t.nodeType==e.NodeType.Break)return t.setResolvedTarget(this,o.stmt),void 0}}t.target?this.reportParseError("could not find enclosing statement with label "+t.target):t.nodeType==e.NodeType.Break?this.reportParseError("break statement requires enclosing loop or switch"):this.reportParseError("continue statement requires enclosing loop")},t.prototype.setErrorRecovery=function(e){this.outfile=e,this.errorRecovery=!0},t.prototype.getSourceLineCol=function(t,n){e.getSourceLineColFromMap(t,n,this.scanner.lineMap)},t.prototype.createRef=function(t,n,r){var i=new e.Identifier(t,n);return i.minChar=r,i},t.prototype.reportParseStyleError=function(e){this.reportParseError("STYLE: "+e)},t.prototype.reportParseError=function(e,t,n){"undefined"==typeof t&&(t=this.scanner.startPos),"undefined"==typeof n&&(n=this.scanner.pos);var r=Math.max(1,n-t);if(this.errorCallback)this.errorCallback(t,r,e,this.currentUnitIndex);else{if(!this.errorRecovery)throw new SyntaxError(this.fname+" ("+this.scanner.line+","+this.scanner.col+"): "+e);var i={line:-1,col:-1};this.getSourceLineCol(i,t),this.outfile&&this.outfile.WriteLine("// "+this.fname+" ("+i.line+","+i.col+"): "+e)}},t.prototype.checkNextToken=function(e,t,n){"undefined"==typeof n&&(n=null),this.currentToken=this.scanner.scan(),this.checkCurrentToken(e,t,n)},t.prototype.skip=function(t){t|=e.ErrorRecoverySet.EOF;var n=e.ErrorRecoverySet.None,r=e.lookupToken(this.currentToken.tokenId);void 0!=r&&(n=r.ers);for(var i=0;(n&t)==e.ErrorRecoverySet.None||this.currentToken.tokenId==e.TokenID.CloseBrace&&i>0;)this.currentToken.tokenId==e.TokenID.OpenBrace?i++:this.currentToken.tokenId==e.TokenID.CloseBrace&&i--,this.currentToken=this.scanner.scan(),n=e.ErrorRecoverySet.None,r=e.lookupToken(this.currentToken.tokenId),void 0!=r&&(n=r.ers)},t.prototype.checkCurrentToken=function(t,n,r){"undefined"==typeof r&&(r=null),this.currentToken.tokenId!=t?(r=null==r?"Expected '"+e.tokenTable[t].text+"'":r,this.reportParseError(r),this.errorRecovery&&this.skip(n)):this.currentToken=this.scanner.scan()},t.prototype.pushDeclLists=function(){this.staticsLists.push(new e.ASTList),this.varLists.push(new e.ASTList),this.scopeLists.push(new e.ASTList)},t.prototype.popDeclLists=function(){this.staticsLists.pop(),this.varLists.pop(),this.scopeLists.pop()},t.prototype.topVarList=function(){return this.varLists[this.varLists.length-1]},t.prototype.topScopeList=function(){return this.scopeLists[this.scopeLists.length-1]},t.prototype.topStaticsList=function(){return this.staticsLists[this.staticsLists.length-1]},t.prototype.parseComment=function(t){if(t){var n=new e.Comment(t.value,t.isBlock,t.endsLine);n.minChar=t.startPos,n.limChar=t.startPos+t.value.length;var r={line:-1,col:-1};if(this.getSourceLineCol(r,n.minChar),n.minLine=r.line,this.getSourceLineCol(r,n.limChar),n.limLine=r.line,!t.isBlock&&t.value.length>3&&"///"==t.value.substring(0,3)){var i=e.getAdditionalDependencyPath(t.value);i&&this.amdDependencies.push(i),e.getImplicitImport(t.value)&&(this.hasTopLevelImportOrExport=!0)}return n}return null},t.prototype.parseCommentsInner=function(e){if(e){for(var t=new Array,n=0;n0){var y=c.length,v=c[y-1],T=new e.ModuleDeclaration(v,h,this.topVarList(),f);T.preComments=r,(this.parsingDeclareFile||e.hasFlag(n,e.Modifiers.Ambient))&&(T.modFlags|=e.ModuleFlags.Ambient),T.modFlags|=e.ModuleFlags.Exported,T.minChar=u,T.limChar=g,this.popDeclLists();for(var b,k=y-2;k>=0;k--)b=new e.ASTList,b.append(T),v=c[k],T=new e.ModuleDeclaration(v,b,new e.ASTList,f),b.minChar=T.minChar=u,b.limChar=T.limChar=g,(this.parsingDeclareFile||e.hasFlag(n,e.Modifiers.Ambient))&&(T.modFlags|=e.ModuleFlags.Ambient),T.modFlags|=e.ModuleFlags.Exported;b=new e.ASTList,b.append(T),b.minChar=u,b.limChar=g,m=new e.ModuleDeclaration(l,b,new e.ASTList,f)}else m=new e.ModuleDeclaration(l,h,this.topVarList(),f),m.preComments=r,this.popDeclLists();return(this.parsingDeclareFile||s||e.hasFlag(n,e.Modifiers.Ambient))&&(m.modFlags|=e.ModuleFlags.Ambient),(s||e.hasFlag(n,e.Modifiers.Exported))&&(m.modFlags|=e.ModuleFlags.Exported),p&&(m.modFlags|=e.ModuleFlags.IsDynamic),this.ambientModule=s,this.topLevel=a,m.leftCurlyCount=this.scanner.leftCurlyCount-i,m.rightCurlyCount=this.scanner.rightCurlyCount-o,m.limChar=h.limChar,m},t.prototype.parseTypeReferenceTail=function(t,n,r){var i=new e.TypeReference(r,0);for(i.minChar=n;this.currentToken.tokenId==e.TokenID.OpenBracket;)this.currentToken=this.scanner.scan(),i.arrayCount++,this.checkCurrentToken(e.TokenID.CloseBracket,t|e.ErrorRecoverySet.LBrack);return i.limChar=this.scanner.lastTokenLimChar(),i},t.prototype.parseNamedType=function(t,n,r,i){if(this.currentToken=this.scanner.scan(),this.currentToken.tokenId==e.TokenID.Dot){if(this.scanner.pos,this.currentToken=this.scanner.scan(),this.currentToken.tokenId!=e.TokenID.Identifier&&(this.errorRecovery&&this.scanner.lastTokenHadNewline()||!e.convertTokToID(this.currentToken,this.strictMode))){if(this.reportParseError("need identifier after '.'"),this.errorRecovery)return r.flags|=e.ASTFlags.DotLHS,r.limChar=this.scanner.lastTokenLimChar(),r;var o=new e.MissingIdentifier;o.minChar=this.scanner.pos,o.limChar=this.scanner.pos;var s=new e.BinaryExpression(e.NodeType.Dot,r,o);return s.flags|=e.ASTFlags.Error,s.minChar=r.minChar,s.limChar=o.limChar,this.parseNamedType(t,n,s,i)}var a=e.Identifier.fromToken(this.currentToken);a.minChar=this.scanner.startPos,a.limChar=this.scanner.pos;var l=new e.BinaryExpression(e.NodeType.Dot,r,a);return l.minChar=r.minChar,l.limChar=a.limChar,this.parseNamedType(t,n,l,i)}return i?this.parseTypeReferenceTail(t,n,r):r},t.prototype.parseTypeReference=function(t,n){var r=this.scanner.startPos,i=!1;switch(this.currentToken.tokenId){case e.TokenID.Void:n||this.reportParseError("void not a valid type in this context");case e.TokenID.Any:case e.TokenID.Number:case e.TokenID.Bool:case e.TokenID.String:var o=e.tokenTable[this.currentToken.tokenId].text,s=new e.Identifier(o);return s.minChar=r,s.limChar=this.scanner.pos,this.currentToken=this.scanner.scan(),this.parseTypeReferenceTail(t,r,s);case e.TokenID.Identifier:var a=this.createRef(this.currentToken.getText(),this.currentToken.hasEscapeSequence,r);return a.limChar=this.scanner.pos,this.parseNamedType(t,r,a,!0);case e.TokenID.OpenBrace:return this.parseObjectType(r,t);case e.TokenID.New:this.currentToken=this.scanner.scan(),this.currentToken.tokenId!=e.TokenID.OpenParen?this.reportParseError("Expected '('"):i=!0;case e.TokenID.OpenParen:var l=new e.ASTList,c=this.parseFormalParameterList(t|e.ErrorRecoverySet.RParen,l,!1,!0,!1,!1,!1,!1,null,!0);this.checkCurrentToken(e.TokenID.EqualsGreaterThan,t);var u=this.parseTypeReference(t,!0),p=new e.FuncDecl(null,null,!1,l,null,null,null,e.NodeType.FuncDecl);return p.returnTypeAnnotation=u,p.variableArgList=c,p.fncFlags|=e.FncFlags.Signature,i&&(p.fncFlags|=e.FncFlags.ConstructMember,p.hint="_construct",p.classDecl=null),p.minChar=r,this.parseTypeReferenceTail(t,r,p);default:this.reportParseError("Expected type name");var h=new e.TypeReference(null,0);return h.flags|=e.ASTFlags.Error,h.minChar=this.scanner.pos,h.limChar=this.scanner.pos,h}},t.prototype.parseObjectType=function(t,n){this.currentToken=this.scanner.scan();var r=new e.ASTList;r.minChar=t;var i=this.inInterfaceDecl;this.inInterfaceDecl=!0,this.parseTypeMemberList(n|e.ErrorRecoverySet.RCurly,r),this.inInterfaceDecl=i,this.checkCurrentToken(e.TokenID.CloseBrace,n);var o=new e.InterfaceDeclaration(this.anonId,r,null,null);return o.minChar=t,o.limChar=r.limChar,this.parseTypeReferenceTail(n,t,o)},t.prototype.parseFunctionBlock=function(t,n,r,i,o){this.checkCurrentToken(e.TokenID.OpenBrace,t|e.ErrorRecoverySet.StmtStart);var s=this.inFunction;if(this.inFunction=!0,this.parseStatementList(t|e.ErrorRecoverySet.RCurly|e.ErrorRecoverySet.StmtStart,i,!0,!1,n,r),i.minChar=o,i.limChar=this.scanner.pos,this.inFunction=s,i.limChar>i.minChar){var a=new e.EndCode;a.minChar=i.limChar,a.limChar=a.minChar,i.append(a)}},t.prototype.parseFunctionStatements=function(t,r,i,o,s,a,l,c,u){this.pushDeclLists();var p=this.statementInfoStack;this.resetStmtStack();var h,d=null,f=!1,m=!1;if(c)if(h=this.scanner.pos,this.currentToken.tokenId===e.TokenID.OpenBrace){this.reportParseError("Function declarations are not permitted within interfaces, ambient modules or classes"),d=new e.ASTList;var g=this.scanner.startPos;this.parseFunctionBlock(t,a,u,d,g),this.checkCurrentToken(e.TokenID.CloseBrace,t),this.currentToken.tokenId===e.TokenID.Semicolon&&(this.currentToken=this.scanner.scan())}else this.checkCurrentToken(e.TokenID.Semicolon,t,"Expected ';'");else{d=new e.ASTList;var g=this.scanner.startPos;if(this.currentToken.tokenId==e.TokenID.EqualsGreaterThan&&(o&&this.reportParseError("'=>' may not be used for class methods"),f=!0,this.currentToken=this.scanner.scan()),f&&this.currentToken.tokenId!=e.TokenID.OpenBrace){var y=this.parseExpr(t|e.ErrorRecoverySet.SColon,e.OperatorPrecedence.Assignment,!0,n.NoTypes),v=new e.ReturnStatement;v.returnExpression=y,v.minChar=y.minChar,v.limChar=y.limChar,d.minChar=g,d.limChar=y.limChar,d.append(v)}else this.currentToken.tokenId!=e.TokenID.EndOfFile&&(m=f,this.parseFunctionBlock(t,a,u,d,g)); h=this.scanner.pos}var T=new e.FuncDecl(r,d,i,s,this.topVarList(),this.topScopeList(),this.topStaticsList(),e.NodeType.FuncDecl);this.popDeclLists();var b=this.topScopeList();return b.append(T),c||(!f||m?(T.endingToken=new e.ASTSpan,T.endingToken.minChar=this.scanner.startPos,T.endingToken.limChar=this.scanner.pos,this.checkCurrentToken(e.TokenID.CloseBrace,t),m&&(T.fncFlags|=e.FncFlags.IsFatArrowFunction)):(T.fncFlags|=e.FncFlags.IsFatArrowFunction,T.endingToken=new e.ASTSpan,T.endingToken.minChar=d.members[0].minChar,T.endingToken.limChar=d.members[0].limChar)),T.minChar=l,T.limChar=h,c&&(T.fncFlags|=e.FncFlags.Signature),this.statementInfoStack=p,T},t.prototype.transformAnonymousArgsIntoFormals=function(t,n){var r=this,i=function(n){if(n.nodeType==e.NodeType.Comma)return r.transformAnonymousArgsIntoFormals(t,n);if(n.nodeType==e.NodeType.Name||n.nodeType==e.NodeType.Asg){var i=n.nodeType==e.NodeType.Asg?n.operand1:n;i.isParenthesized=!1;var o=new e.ArgDecl(i);return o.preComments=i.preComments,o.postComments=i.postComments,o.minChar=n.minChar,o.limChar=n.limChar,e.hasFlag(i.flags,e.ASTFlags.PossibleOptionalParameter)&&(o.isOptional=!0),n.nodeType==e.NodeType.Asg&&(o.init=n.operand2),t.append(o),o.isOptional||o.init}return r.reportParseError("Invalid lambda argument"),!1};if(n){if(n.nodeType==e.NodeType.Comma){var o=n;o.operand1.isParenthesized&&this.reportParseError("Invalid lambda argument",o.operand1.minChar,o.operand1.limChar),o.operand2.isParenthesized&&this.reportParseError("Invalid lambda argument",o.operand2.minChar,o.operand2.limChar);var s=i(o.operand1);return s=i(o.operand2)||s}return i(n)}},t.prototype.parseFormalParameterList=function(t,r,i,o,s,a,l,c,u,p){r.minChar=this.scanner.startPos,s?this.currentToken=this.scanner.scan():c||this.checkCurrentToken(e.TokenID.OpenParen,t|e.ErrorRecoverySet.RParen);var h=!1,d=!0,f=!1,m=!1;for(c&&u&&u.nodeType!=e.NodeType.EmptyExpr&&(f=this.transformAnonymousArgsIntoFormals(r,u),r.minChar=u.minChar,m=!0);;){var g=!1,y=e.VarFlags.None,v=this.scanner.startPos;this.inferPropertiesFromThisAssignment&&this.currentToken.tokenId==e.TokenID.This&&(i||this.reportParseError("Instance property declarations using 'this' may only be used in class constructors"),this.currentToken=this.scanner.scan(),y|=e.VarFlags.Public|e.VarFlags.Property,this.currentClassDefinition&&(this.currentClassDefinition.varFlags|=e.VarFlags.ClassSuperMustBeFirstCallInConstructor)),this.currentToken.tokenId==e.TokenID.Public?(y|=e.VarFlags.Public|e.VarFlags.Property,this.currentClassDefinition&&(this.currentClassDefinition.varFlags|=e.VarFlags.ClassSuperMustBeFirstCallInConstructor)):this.currentToken.tokenId==e.TokenID.Private?(y|=e.VarFlags.Private|e.VarFlags.Property,this.currentClassDefinition&&(this.currentClassDefinition.varFlags|=e.VarFlags.ClassSuperMustBeFirstCallInConstructor)):this.currentToken.tokenId==e.TokenID.Static&&i&&(this.reportParseError("Static properties can not be declared as parameter properties"),this.currentToken=this.scanner.scan()),y!=e.VarFlags.None?(i||this.reportParseError("only constructor parameters can be properties"),this.currentToken=this.scanner.scan(),e.isModifier(this.currentToken)&&(this.reportParseError("Multiple modifiers may not be applied to parameters"),this.currentToken=this.scanner.scan()),this.inferPropertiesFromThisAssignment&&this.currentToken.tokenId==e.TokenID.This&&(i||this.reportParseError("Instance property declarations using 'this' may only be used in class constructors"),this.currentToken=this.scanner.scan(),this.currentToken=this.scanner.scan())):this.currentToken.tokenId==e.TokenID.DotDotDot&&(h=!0,this.currentToken=this.scanner.scan(),(this.currentToken.tokenId!=e.TokenID.Identifier||e.convertTokToID(this.currentToken,this.strictMode))&&(this.reportParseError("'...' parameters require both a parameter name and an array type annotation to be specified"),h=!1));var T=null;if((!m&&this.currentToken.tokenId==e.TokenID.Identifier||e.convertTokToID(this.currentToken,this.strictMode))&&(T=e.Identifier.fromToken(this.currentToken),T.minChar=this.scanner.startPos,T.limChar=this.scanner.pos),m||T){g=!0;var b=null,k=null;m&&r.members.length?(k=r.members[r.members.length-1],k.isOptional&&(f=!0)):(k=new e.ArgDecl(T),a&&this.reportParseError("Property getters may not take any arguments"),l&&!d&&this.reportParseError("Property setters may only take one argument"),k.minChar=v,k.preComments=this.parseComments(),this.currentToken=this.scanner.scan()),this.currentToken.tokenId==e.TokenID.Question&&(k.isOptional=!0,f=!0,this.currentToken=this.scanner.scan()),this.currentToken.tokenId==e.TokenID.Colon&&(this.currentToken=this.scanner.scan(),b=this.parseTypeReference(t,!1)),this.currentToken.tokenId==e.TokenID.Equals&&(o&&this.reportParseError("Arguments in signatures may not have default values"),f=!0,this.currentToken=this.scanner.scan(),k.init=this.parseExpr(e.ErrorRecoverySet.Comma|t,e.OperatorPrecedence.Comma,!1,n.NoTypes)),!f||k.isOptionalArg()||h||this.reportParseError("Optional parameters may only be followed by other optional parameters"),h&&k.isOptionalArg()&&this.reportParseError("Varargs may not be optional or have default parameters"),h&&!b&&this.reportParseError("'...' parameters require both a parameter name and an array type annotation to be specified"),k.postComments=this.parseComments(),k.typeExpr=b,k.limChar=this.scanner.lastTokenLimChar(),k.varFlags|=y,m?m=!1:r.append(k)}if(d=!1,this.currentToken.tokenId!=e.TokenID.Comma)break;!g||h?(this.reportParseError("Unexpected ',' in argument list"),this.errorRecovery&&(this.currentToken=this.scanner.scan())):this.currentToken=this.scanner.scan()}return s?this.checkCurrentToken(e.TokenID.CloseBracket,t|e.ErrorRecoverySet.LCurly|e.ErrorRecoverySet.SColon):p&&this.checkCurrentToken(e.TokenID.CloseParen,t|e.ErrorRecoverySet.LCurly|e.ErrorRecoverySet.SColon),r.limChar=this.currentToken.tokenId==e.TokenID.EndOfFile?this.scanner.pos:this.scanner.lastTokenLimChar(),h},t.prototype.parseFncDecl=function(t,n,r,i,o,s,a,l,c,u,p){var h=this.scanner.leftCurlyCount,d=this.scanner.rightCurlyCount,f=this.parsingClassConstructorDefinition;this.parsingClassConstructorDefinition=!1;var m=null,g=this.scanner.startPos,y=this.scanner.pos,v=this.nestingLevel,T=this.parseComments(),b=!!u;if(this.nestingLevel=0,!this.style_funcInLoop&&this.inLoop()&&this.reportParseStyleError("function declaration in loop"),i||a||s||u||o)o&&(m=o);else if(this.currentToken=this.scanner.scan(),this.currentToken.tokenId==e.TokenID.Identifier||e.convertTokToID(this.currentToken,this.strictMode))m=e.Identifier.fromToken(this.currentToken),m.minChar=this.scanner.startPos,m.limChar=this.scanner.pos,this.currentToken=this.scanner.scan();else if(n)return this.reportParseError("Function declaration must include identifier"),this.nestingLevel=v,new e.IncompleteAST(g,this.scanner.pos);var k=new e.ASTList,S=!1,C=!1,w=e.hasFlag(c,e.Modifiers.Getter),_=e.hasFlag(c,e.Modifiers.Setter);(this.currentToken.tokenId==e.TokenID.OpenParen||s&&this.currentToken.tokenId==e.TokenID.OpenBracket||u&&(u.preProcessedLambdaArgs||this.currentToken.tokenId==e.TokenID.DotDotDot))&&(S=this.parseFormalParameterList(t,k,!1,r,s,w,_,b,u?u.preProcessedLambdaArgs:null,p));var E=null;this.currentToken.tokenId==e.TokenID.Colon&&(this.currentToken=this.scanner.scan(),e.hasFlag(c,e.Modifiers.Setter)&&this.reportParseError("Property setters may not declare a return type"),E=this.parseTypeReference(t,!0)),s&&0==k.members.length&&this.reportParseError("Index signatures require a parameter type to be specified"),b&&this.currentToken.tokenId!=e.TokenID.EqualsGreaterThan&&this.reportParseError("Expected '=>'"),!n||this.parsingDeclareFile||l||this.ambientModule||this.ambientClass||this.inInterfaceDecl||this.currentToken.tokenId!=e.TokenID.Semicolon||(C=!0,n=!1,r=!0);var x=this.inFncDecl;this.inFncDecl=!0;var N=this.parseFunctionStatements(t|e.ErrorRecoverySet.RCurly,m,!1,i,k,e.AllowedElements.None,y,r,e.Modifiers.None);return this.inFncDecl=x,N.variableArgList=S,N.isOverload=C,a&&(N.fncFlags|=e.FncFlags.Static),r&&(N.fncFlags|=e.FncFlags.Signature),s&&(N.fncFlags|=e.FncFlags.IndexerMember),N.returnTypeAnnotation=E,i&&(N.fncFlags|=e.FncFlags.Method,N.fncFlags|=e.FncFlags.ClassPropertyMethodExported),N.leftCurlyCount=this.scanner.leftCurlyCount-h,N.rightCurlyCount=this.scanner.rightCurlyCount-d,this.nestingLevel=v,this.parsingClassConstructorDefinition=f,N.preComments=T,N},t.prototype.convertToTypeReference=function(t){var n;switch(t.nodeType){case e.NodeType.TypeRef:return t;case e.NodeType.Name:return n=new e.TypeReference(t,0),n.minChar=t.minChar,n.limChar=t.limChar,n;case e.NodeType.Index:var r=t;if(n=this.convertToTypeReference(r.operand1))return n.arrayCount++,n.minChar=r.minChar,n.limChar=r.limChar,n;var i=new e.AST(e.NodeType.Error);return i}return null},t.prototype.parseArgList=function(t){var r=new e.ASTList;if(r.minChar=this.scanner.startPos,this.currentToken=this.scanner.scan(),this.currentToken.tokenId!==e.TokenID.CloseParen)for(;;){if(r.members.length>65535){this.reportParseError("max number of args exceeded");break}var i=this.parseExpr(e.ErrorRecoverySet.Comma|t,e.OperatorPrecedence.Comma,!0,n.NoTypes);if(r.append(i),this.currentToken.tokenId!=e.TokenID.Comma)break;this.currentToken=this.scanner.scan()}return r.limChar=this.scanner.pos,r},t.prototype.parseBaseList=function(t,n,r,i){for(var o=!0,s=t;;){o&&(this.currentToken.tokenId===e.TokenID.Implements?s=n:this.currentToken.tokenId!=e.TokenID.Extends||this.requiresExtendsBlock||(this.requiresExtendsBlock=i),this.currentToken=this.scanner.scan(),o=!1);var a=null;if(this.currentToken.tokenId==e.TokenID.Identifier||e.convertTokToID(this.currentToken,this.strictMode)){var l=this.scanner.startPos;a=e.Identifier.fromToken(this.currentToken),a.minChar=l,a.limChar=this.scanner.pos,a=this.parseNamedType(r|e.ErrorRecoverySet.LCurly,l,a,!1)}else this.reportParseError("Expected base name"),this.errorRecovery&&(a=new e.MissingIdentifier,a.minChar=this.scanner.pos,a.limChar=this.scanner.pos,a.flags|=e.ASTFlags.Error);if(this.currentToken.tokenId==e.TokenID.OpenParen?i?this.reportParseError("Base classes may only be initialized via a 'super' call within the constructor body"):this.reportParseError("Interfaces may not be extended with a call expression"):s.append(a),i&&s==t&&t.members.length>1&&this.reportParseError("A class may only extend one other class"),this.currentToken.tokenId!=e.TokenID.Comma){if(this.currentToken.tokenId!=e.TokenID.Extends&&this.currentToken.tokenId!=e.TokenID.Implements)break;this.currentToken.tokenId!=e.TokenID.Extends||this.requiresExtendsBlock||(this.requiresExtendsBlock=i),s=t,o=!0}else this.currentToken=this.scanner.scan()}},t.prototype.parseClassDecl=function(t,n,r){var i=this.scanner.leftCurlyCount,o=this.scanner.rightCurlyCount;(r&e.Modifiers.Readonly)!=e.Modifiers.None&&this.reportParseError("const modifier is implicit for class"),(this.parsingDeclareFile||this.ambientModule)&&(r|=e.Modifiers.Ambient,r|=e.Modifiers.Exported);var s=this.parsingDeclareFile||(r&e.Modifiers.Ambient)!=e.Modifiers.None,a=this.ambientClass;this.ambientClass=s,this.currentToken=this.scanner.scan();var l=null;this.currentToken.tokenId==e.TokenID.Identifier||!e.isPrimitiveTypeToken(this.currentToken)&&e.convertTokToID(this.currentToken,this.strictMode)?(l=e.Identifier.fromToken(this.currentToken),l.minChar=this.scanner.startPos,l.limChar=this.scanner.pos,this.currentToken=this.scanner.scan()):(this.reportParseError("class missing name"),this.errorRecovery&&(l=new e.MissingIdentifier,l.minChar=this.scanner.pos,l.limChar=this.scanner.pos,l.flags|=e.ASTFlags.Error));var c=null,u=null;(this.currentToken.tokenId==e.TokenID.Extends||this.currentToken.tokenId==e.TokenID.Implements)&&(c=new e.ASTList,u=new e.ASTList,this.parseBaseList(c,u,t,!0));var p=new e.ClassDeclaration(l,new e.ASTList,c,u);return this.currentClassDefinition=p,this.parseClassElements(p,t,r),(this.ambientModule||this.parsingDeclareFile||e.hasFlag(r,e.Modifiers.Exported))&&(p.varFlags|=e.VarFlags.Exported),(this.ambientModule||e.hasFlag(r,e.Modifiers.Ambient))&&(p.varFlags|=e.VarFlags.Ambient),p.varFlags|=e.VarFlags.Class,this.ambientClass=a,p.leftCurlyCount=this.scanner.leftCurlyCount-i,p.rightCurlyCount=this.scanner.rightCurlyCount-o,p},t.prototype.parseClassElements=function(t,n,r){var i=r,o=!1,s=this.scanner.startPos;this.checkCurrentToken(e.TokenID.OpenBrace,n),this.nestingLevel++;for(var a=this.scanner.startPos,l=!1;this.currentToken.tokenId!=e.TokenID.CloseBrace&&this.currentToken.tokenId!=e.TokenID.EndOfFile;){var c=!0,u=e.Modifiers.Public|e.Modifiers.Private;if(this.currentToken.tokenId==e.TokenID.Get)i&e.Modifiers.Getter&&this.reportParseError("Duplicate 'get' declaration in class body"),i&e.Modifiers.Setter&&this.reportParseError("Getter already marked as a setter"),i|=e.Modifiers.Getter;else if(this.currentToken.tokenId==e.TokenID.Set)i&e.Modifiers.Setter&&this.reportParseError("Duplicate 'set' declaration in class body"),i&e.Modifiers.Getter&&this.reportParseError("Setter already marked as a getter"),i|=e.Modifiers.Setter;else if(this.currentToken.tokenId==e.TokenID.Private)i&u&&this.reportParseError("Multiple modifiers may not be applied to class members"),i|=e.Modifiers.Private;else if(this.currentToken.tokenId==e.TokenID.Public)i&u&&this.reportParseError("Multiple modifiers may not be applied to class members"),i|=e.Modifiers.Public;else if(this.currentToken.tokenId==e.TokenID.Static)i&e.Modifiers.Static&&this.reportParseError("Multiple modifiers may not be applied to class members"),i|=e.Modifiers.Static;else if(this.currentToken.tokenId==e.TokenID.Constructor)i!=r&&this.reportParseError("Constructors may not have modifiers"),this.parseClassConstructorDeclaration(a,n,i),c=!1,o=!0;else if(l||this.currentToken.tokenId==e.TokenID.Identifier||e.convertTokToIDName(this.currentToken)){var p=l?i&e.Modifiers.Getter?"get":"set":this.currentToken.getText(),h=l?new e.Identifier(p):e.Identifier.fromToken(this.currentToken);if(h.minChar=this.scanner.startPos,h.limChar=this.scanner.pos,l?(i^=i&e.Modifiers.Getter?e.Modifiers.Getter:e.Modifiers.Setter,l=!1):this.currentToken=this.scanner.scan(),this.currentToken.tokenId==e.TokenID.OpenParen)this.parseClassMemberFunctionDeclaration(h,a,n,i),c=!1;else{(i&e.Modifiers.Getter||i&e.Modifiers.Setter)&&this.reportParseError("Property accessors must be functions");var d=this.parseClassMemberVariableDeclaration(h,a,!1,n,i);d.init&&d.init.nodeType==e.NodeType.FuncDecl?this.currentToken.tokenId==e.TokenID.CloseBrace&&(c=!1):d.init&&d.init.nodeType==e.NodeType.ObjectLit&&this.currentToken.tokenId!=e.TokenID.Semicolon?(c=!1,d.init.flags|=e.ASTFlags.AutomaticSemicolon):this.currentToken.tokenId!=e.TokenID.Semicolon&&(this.reportParseError("Expected ';'"),c=!1)}o=!0}else this.currentToken.tokenId==e.TokenID.Super?this.reportParseError("Base class initializers must be the first statement in a class definition"):l||!(i&e.Modifiers.Getter||i&e.Modifiers.Setter)||this.currentToken.tokenId!=e.TokenID.OpenParen&&this.currentToken.tokenId!=e.TokenID.Equals&&this.currentToken.tokenId!=e.TokenID.Colon&&this.currentToken.tokenId!=e.TokenID.Semicolon?this.currentToken.tokenId!=e.TokenID.Semicolon&&(this.reportParseError("Unexpected '"+this.currentToken.getText()+"' in class definition"),o=!0):(l=!0,c=!1);c&&(this.currentToken=this.scanner.scan()),o&&(i=r,a=this.scanner.startPos,o=!1)}var f=this.scanner.pos;this.currentToken.tokenId==e.TokenID.CloseBrace&&(t.endingToken=new e.ASTSpan,t.endingToken.minChar=this.scanner.startPos,t.endingToken.limChar=this.scanner.pos,this.currentClassDefinition.members.members.length||(this.currentClassDefinition.preComments=this.parseComments()),this.currentToken=this.scanner.scan()),this.nestingLevel--,this.currentClassDefinition.members.minChar=s,this.currentClassDefinition.members.limChar=f,this.currentClassDefinition.limChar=f,this.currentClassDefinition=null},t.prototype.parseClassConstructorDeclaration=function(t,n,r){this.parsingClassConstructorDefinition=!0;var i=this.parsingDeclareFile||e.hasFlag(r,e.Modifiers.Ambient),o=new e.ASTList,s=!1,a=this.parseComments(),l=new e.ASTSpan;l.minChar=this.scanner.startPos,l.limChar=this.scanner.pos,this.currentToken=this.scanner.scan(),this.currentToken.tokenId==e.TokenID.OpenParen&&(s=this.parseFormalParameterList(n,o,!0,i,!1,!1,!1,!1,null,!0),o.members.length>0&&o.members[o.members.length-1]);var c=i||this.currentToken.tokenId==e.TokenID.Semicolon;if(c)for(var u=0;u0&&e.CompilerDiagnostics.Alert(this.builder);var t=this.indentStrings[this.indentAmt];if(void 0===t){t="";for(var n=0;nr+1;){if(n=r+(i-r)/2,n-=n%2,t[n]<=e&&e<=t[n+1])return!0;e=97&&122>=t||t>=65&&90>=t||t==e.LexCodeDollar||t==e.LexCodeUnderscore}function a(e){return e>=48&&57>=e}function l(e){return b[e]||a(e)}function c(t){return t==e.LexCodeRBR?e.LexCodeLBR:t==e.LexCodeRC?e.LexCodeLC:t==e.LexCodeRPR?e.LexCodeLPR:0}function u(e){return h(e,!0,!1)}function p(e,t){return h(e,!1,t)}function h(t,n,r){if(!(t.tokenId<=e.TokenID.LimKeyword))return!1;var i=e.lookupToken(t.tokenId);if(void 0==i)return!1;var o=e.Reservation.Javascript|e.Reservation.JavascriptFuture;return r&&(o|=e.Reservation.JavascriptFutureStrict),n||!e.hasFlag(i.reservation,o)?!0:void 0}function d(e,t){if(-1===t)return 0;for(var n=0,r=e.length-1;r>n;){var i=n+r>>1;t0&&(e.line=r,e.col=t-n[r])}function m(e,t){var n={line:-1,col:-1};return f(n,t,e.locationInfo.lineMap),n.col>=0&&n.col++,n}function g(e,t,n){return e.locationInfo.lineMap[t]+(n-1)}function y(t){switch(t.tokenId){case e.TokenID.Any:case e.TokenID.Bool:case e.TokenID.Number:case e.TokenID.String:return!0}return!1}function v(t){switch(t.tokenId){case e.TokenID.Public:case e.TokenID.Private:case e.TokenID.Static:return!0}return!1}e.LexEOF=-1,e.LexCodeNWL=10,e.LexCodeRET=13,e.LexCodeLS=8232,e.LexCodePS=8233,e.LexCodeTAB=9,e.LexCodeVTAB=11,e.LexCode_e="e".charCodeAt(0),e.LexCode_E="E".charCodeAt(0),e.LexCode_x="x".charCodeAt(0),e.LexCode_X="X".charCodeAt(0),e.LexCode_a="a".charCodeAt(0),e.LexCode_A="A".charCodeAt(0),e.LexCode_f="f".charCodeAt(0),e.LexCode_F="F".charCodeAt(0),e.LexCode_g="g".charCodeAt(0),e.LexCode_m="m".charCodeAt(0),e.LexCode_i="i".charCodeAt(0),e.LexCode_u="u".charCodeAt(0),e.LexCode_0="0".charCodeAt(0),e.LexCode_9="9".charCodeAt(0),e.LexCode_8="8".charCodeAt(0),e.LexCode_7="7".charCodeAt(0),e.LexCodeBSL="\\".charCodeAt(0),e.LexCodeSHP="#".charCodeAt(0),e.LexCodeBNG="!".charCodeAt(0),e.LexCodeQUO='"'.charCodeAt(0),e.LexCodeAPO="'".charCodeAt(0),e.LexCodePCT="%".charCodeAt(0),e.LexCodeAMP="&".charCodeAt(0),e.LexCodeLPR="(".charCodeAt(0),e.LexCodeRPR=")".charCodeAt(0),e.LexCodePLS="+".charCodeAt(0),e.LexCodeMIN="-".charCodeAt(0),e.LexCodeMUL="*".charCodeAt(0),e.LexCodeSLH="/".charCodeAt(0),e.LexCodeXOR="^".charCodeAt(0),e.LexCodeCMA=",".charCodeAt(0),e.LexCodeDOT=".".charCodeAt(0),e.LexCodeLT="<".charCodeAt(0),e.LexCodeEQ="=".charCodeAt(0),e.LexCodeGT=">".charCodeAt(0),e.LexCodeQUE="?".charCodeAt(0),e.LexCodeLBR="[".charCodeAt(0),e.LexCodeRBR="]".charCodeAt(0),e.LexCodeUSC="_".charCodeAt(0),e.LexCodeLC="{".charCodeAt(0),e.LexCodeRC="}".charCodeAt(0),e.LexCodeBAR="|".charCodeAt(0),e.LexCodeTIL="~".charCodeAt(0),e.LexCodeCOL=":".charCodeAt(0),e.LexCodeSMC=";".charCodeAt(0),e.LexCodeUnderscore="_".charCodeAt(0),e.LexCodeDollar="$".charCodeAt(0),e.LexCodeSpace=32,e.LexCodeAtSign="@".charCodeAt(0),e.LexCodeASCIIChars=128,e.LexKeywordTable=void 0;var T=new Array(e.LexCodeASCIIChars),b=new Array(e.LexCodeASCIIChars),k=[170,170,181,181,186,186,192,214,216,246,248,543,546,563,592,685,688,696,699,705,720,721,736,740,750,750,890,890,902,902,904,906,908,908,910,929,931,974,976,983,986,1011,1024,1153,1164,1220,1223,1224,1227,1228,1232,1269,1272,1273,1329,1366,1369,1369,1377,1415,1488,1514,1520,1522,1569,1594,1600,1610,1649,1747,1749,1749,1765,1766,1786,1788,1808,1808,1810,1836,1920,1957,2309,2361,2365,2365,2384,2384,2392,2401,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2524,2525,2527,2529,2544,2545,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2699,2701,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2784,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2870,2873,2877,2877,2908,2909,2911,2913,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,2997,2999,3001,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3168,3169,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3294,3294,3296,3297,3333,3340,3342,3344,3346,3368,3370,3385,3424,3425,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3805,3840,3840,3904,3911,3913,3946,3976,3979,4096,4129,4131,4135,4137,4138,4176,4181,4256,4293,4304,4342,4352,4441,4447,4514,4520,4601,4608,4614,4616,4678,4680,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4742,4744,4744,4746,4749,4752,4782,4784,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4814,4816,4822,4824,4846,4848,4878,4880,4880,4882,4885,4888,4894,4896,4934,4936,4954,5024,5108,5121,5740,5743,5750,5761,5786,5792,5866,6016,6067,6176,6263,6272,6312,7680,7835,7840,7929,7936,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8319,8319,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8497,8499,8505,8544,8579,12293,12295,12321,12329,12337,12341,12344,12346,12353,12436,12445,12446,12449,12538,12540,12542,12549,12588,12593,12686,12704,12727,13312,19893,19968,40869,40960,42124,44032,55203,63744,64045,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65138,65140,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500],S=[768,846,864,866,1155,1158,1425,1441,1443,1465,1467,1469,1471,1471,1473,1474,1476,1476,1611,1621,1632,1641,1648,1648,1750,1756,1759,1764,1767,1768,1770,1773,1776,1785,1809,1809,1840,1866,1958,1968,2305,2307,2364,2364,2366,2381,2385,2388,2402,2403,2406,2415,2433,2435,2492,2492,2494,2500,2503,2504,2507,2509,2519,2519,2530,2531,2534,2543,2562,2562,2620,2620,2622,2626,2631,2632,2635,2637,2662,2673,2689,2691,2748,2748,2750,2757,2759,2761,2763,2765,2790,2799,2817,2819,2876,2876,2878,2883,2887,2888,2891,2893,2902,2903,2918,2927,2946,2947,3006,3010,3014,3016,3018,3021,3031,3031,3047,3055,3073,3075,3134,3140,3142,3144,3146,3149,3157,3158,3174,3183,3202,3203,3262,3268,3270,3272,3274,3277,3285,3286,3302,3311,3330,3331,3390,3395,3398,3400,3402,3405,3415,3415,3430,3439,3458,3459,3530,3530,3535,3540,3542,3542,3544,3551,3570,3571,3633,3633,3636,3642,3655,3662,3664,3673,3761,3761,3764,3769,3771,3772,3784,3789,3792,3801,3864,3865,3872,3881,3893,3893,3895,3895,3897,3897,3902,3903,3953,3972,3974,3975,3984,3991,3993,4028,4038,4038,4140,4146,4150,4153,4160,4169,4182,4185,4969,4977,6068,6099,6112,6121,6160,6169,6313,6313,8255,8256,8400,8412,8417,8417,12330,12335,12441,12442,12539,12539,64286,64286,65056,65059,65075,65076,65101,65103,65296,65305,65343,65343,65381,65381],C=[170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,880,884,886,887,890,893,902,902,904,906,908,908,910,929,931,1013,1015,1153,1162,1319,1329,1366,1369,1369,1377,1415,1488,1514,1520,1522,1568,1610,1646,1647,1649,1747,1749,1749,1765,1766,1774,1775,1786,1788,1791,1791,1808,1808,1810,1839,1869,1957,1969,1969,1994,2026,2036,2037,2042,2042,2048,2069,2074,2074,2084,2084,2088,2088,2112,2136,2208,2208,2210,2220,2308,2361,2365,2365,2384,2384,2392,2401,2417,2423,2425,2431,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2493,2493,2510,2510,2524,2525,2527,2529,2544,2545,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2785,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2877,2877,2908,2909,2911,2913,2929,2929,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3024,3024,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3133,3133,3160,3161,3168,3169,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3261,3261,3294,3294,3296,3297,3313,3314,3333,3340,3342,3344,3346,3386,3389,3389,3406,3406,3424,3425,3450,3455,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3807,3840,3840,3904,3911,3913,3948,3976,3980,4096,4138,4159,4159,4176,4181,4186,4189,4193,4193,4197,4198,4206,4208,4213,4225,4238,4238,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4992,5007,5024,5108,5121,5740,5743,5759,5761,5786,5792,5866,5870,5872,5888,5900,5902,5905,5920,5937,5952,5969,5984,5996,5998,6e3,6016,6067,6103,6103,6108,6108,6176,6263,6272,6312,6314,6314,6320,6389,6400,6428,6480,6509,6512,6516,6528,6571,6593,6599,6656,6678,6688,6740,6823,6823,6917,6963,6981,6987,7043,7072,7086,7087,7098,7141,7168,7203,7245,7247,7258,7293,7401,7404,7406,7409,7413,7414,7424,7615,7680,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8305,8305,8319,8319,8336,8348,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11502,11506,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11648,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11823,11823,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12445,12447,12449,12538,12540,12543,12549,12589,12593,12686,12704,12730,12784,12799,13312,19893,19968,40908,40960,42124,42192,42237,42240,42508,42512,42527,42538,42539,42560,42606,42623,42647,42656,42735,42775,42783,42786,42888,42891,42894,42896,42899,42912,42922,43e3,43009,43011,43013,43015,43018,43020,43042,43072,43123,43138,43187,43250,43255,43259,43259,43274,43301,43312,43334,43360,43388,43396,43442,43471,43471,43520,43560,43584,43586,43588,43595,43616,43638,43642,43642,43648,43695,43697,43697,43701,43702,43705,43709,43712,43712,43714,43714,43739,43741,43744,43754,43762,43764,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43968,44002,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500],w=[768,879,1155,1159,1425,1469,1471,1471,1473,1474,1476,1477,1479,1479,1552,1562,1611,1641,1648,1648,1750,1756,1759,1764,1767,1768,1770,1773,1776,1785,1809,1809,1840,1866,1958,1968,1984,1993,2027,2035,2070,2073,2075,2083,2085,2087,2089,2093,2137,2139,2276,2302,2304,2307,2362,2364,2366,2383,2385,2391,2402,2403,2406,2415,2433,2435,2492,2492,2494,2500,2503,2504,2507,2509,2519,2519,2530,2531,2534,2543,2561,2563,2620,2620,2622,2626,2631,2632,2635,2637,2641,2641,2662,2673,2677,2677,2689,2691,2748,2748,2750,2757,2759,2761,2763,2765,2786,2787,2790,2799,2817,2819,2876,2876,2878,2884,2887,2888,2891,2893,2902,2903,2914,2915,2918,2927,2946,2946,3006,3010,3014,3016,3018,3021,3031,3031,3046,3055,3073,3075,3134,3140,3142,3144,3146,3149,3157,3158,3170,3171,3174,3183,3202,3203,3260,3260,3262,3268,3270,3272,3274,3277,3285,3286,3298,3299,3302,3311,3330,3331,3390,3396,3398,3400,3402,3405,3415,3415,3426,3427,3430,3439,3458,3459,3530,3530,3535,3540,3542,3542,3544,3551,3570,3571,3633,3633,3636,3642,3655,3662,3664,3673,3761,3761,3764,3769,3771,3772,3784,3789,3792,3801,3864,3865,3872,3881,3893,3893,3895,3895,3897,3897,3902,3903,3953,3972,3974,3975,3981,3991,3993,4028,4038,4038,4139,4158,4160,4169,4182,4185,4190,4192,4194,4196,4199,4205,4209,4212,4226,4237,4239,4253,4957,4959,5906,5908,5938,5940,5970,5971,6002,6003,6068,6099,6109,6109,6112,6121,6155,6157,6160,6169,6313,6313,6432,6443,6448,6459,6470,6479,6576,6592,6600,6601,6608,6617,6679,6683,6741,6750,6752,6780,6783,6793,6800,6809,6912,6916,6964,6980,6992,7001,7019,7027,7040,7042,7073,7085,7088,7097,7142,7155,7204,7223,7232,7241,7248,7257,7376,7378,7380,7400,7405,7405,7410,7412,7616,7654,7676,7679,8204,8205,8255,8256,8276,8276,8400,8412,8417,8417,8421,8432,11503,11505,11647,11647,11744,11775,12330,12335,12441,12442,42528,42537,42607,42607,42612,42621,42655,42655,42736,42737,43010,43010,43014,43014,43019,43019,43043,43047,43136,43137,43188,43204,43216,43225,43232,43249,43264,43273,43302,43309,43335,43347,43392,43395,43443,43456,43472,43481,43561,43574,43587,43587,43596,43597,43600,43609,43643,43643,43696,43696,43698,43700,43703,43704,43710,43711,43713,43713,43755,43759,43765,43766,44003,44010,44012,44013,44016,44025,64286,64286,65024,65039,65056,65062,65075,65076,65101,65103,65296,65305,65343,65343];e.LexLookUpUnicodeMap=t,e.LexIsUnicodeDigit=n,e.LexIsUnicodeIdStart=r,e.LexInitialize=i,e.LexAdjustIndent=o,e.LexIsIdentifierStartChar=s,e.LexIsDigit=a,e.LexIsIdentifierChar=l,e.LexMatchingOpen=c,function(e){e._map=[],e._map[0]="Start",e.Start=0,e._map[1]="InFraction",e.InFraction=1,e._map[2]="InEmptyFraction",e.InEmptyFraction=2,e._map[3]="InExponent",e.InExponent=3}(e.NumberScanState||(e.NumberScanState={}));var _=e.NumberScanState;!function(e){e._map=[],e._map[0]="Start",e.Start=0,e._map[1]="InMultilineComment",e.InMultilineComment=1,e._map[2]="InMultilineSingleQuoteString",e.InMultilineSingleQuoteString=2,e._map[3]="InMultilineDoubleQuoteString",e.InMultilineDoubleQuoteString=3}(e.LexState||(e.LexState={}));var E=e.LexState;!function(e){e._map=[],e._map[0]="Line",e.Line=0,e._map[1]="File",e.File=1}(e.LexMode||(e.LexMode={}));var x=e.LexMode;!function(e){e._map=[],e._map[0]="Line",e.Line=0,e._map[1]="Block",e.Block=1}(e.CommentStyle||(e.CommentStyle={})),e.CommentStyle;var N=function(){function e(e){this.text=e}return e.prototype.getText=function(e,t){return this.text.substring(e,t)},e.prototype.getLength=function(){return this.text.length},e}();e.StringSourceText=N;var L=function(){function e(e,t,n){this.segmentStart=e,this.segmentEnd=t,this.segment=n}return e.prototype.charCodeAt=function(e){return this.segment.charCodeAt(e-this.segmentStart)},e.prototype.substring=function(e,t){return this.segment.substring(e-this.segmentStart,t-this.segmentStart)},e}();e.SourceTextSegment=L;var I=function(){function e(e,t){this.seg1=e,this.seg2=t}return e.prototype.charCodeAt=function(e){return this.seg1.segmentStart<=e&&e=t?e:t},t.prototype.min=function(e,t){return t>=e?e:t},t.prototype.fetchSegment=function(t,n){if(this.agg.seg1.segmentStart<=t&&n<=this.agg.seg1.segmentEnd)return this.agg.seg1;if(this.agg.seg2.segmentStart<=t&&n<=this.agg.seg1.segmentEnd)return this.agg;var r=this.agg.seg1,i=r.segmentEnd,o=e.max(i+512,n);o=e.min(o,this.len);var s=this.sourceText.getText(i,o),a=new L(i,o,s);return this.agg.seg2=r,this.agg.seg1=a,this.agg},t.prototype.charCodeAt=function(e){return this.fetchSegment(e,e+1).charCodeAt(e)},t.prototype.substring=function(e,t){return this.fetchSegment(e,t).substring(e,t)},t}();e.ScannerTextStream=A;var M=function(){function t(){this.prevToken=null,this.curSavedToken=null,this.prevSavedToken=null,this.prevToken=null,this.currentToken=0,this.tokens=new Array,this.seenUnicodeChar=!1,this.seenUnicodeCharInComment=!1,this.prevLine=1,this.line=1,this.col=0,this.lexState=E.Start,this.commentStack=new Array,this.lineMap=[]}return t.prototype.previousToken=function(){return this.prevToken},t.prototype.addToken=function(t,n){this.tokens[this.currentToken++]=new e.SavedToken(t,n.startPos,n.pos)},t.prototype.scan=function(){if(this.startLine=this.line,this.startPos=this.col,this.currentTokenIndex==this.currentTokens.length){if(!(this.line0&&this.commentStack[0].line==e;)t=null==t?[this.commentStack.shift()]:t.concat([this.commentStack.shift()]);return t},t.prototype.resetComments=function(){this.commentStack=[]},t.prototype.setSourceText=function(){},t.prototype.setErrorHandler=function(){},t.prototype.getLookAheadToken=function(){throw new Error("Invalid operation.")},t}();e.SavedTokens=M;var R=function(){function t(){this.prevLine=1,this.line=1,this.col=0,this.pos=0,this.startPos=0,this.len=0,this.lineMap=[],this.ch=e.LexEOF,this.lexState=E.Start,this.mode=x.File,this.scanComments=!0,this.interveningWhitespace=!1,this.interveningWhitespacePos=0,this.leftCurlyCount=0,this.rightCurlyCount=0,this.commentStack=new Array,this.saveScan=null,this.seenUnicodeChar=!1,this.seenUnicodeCharInComment=!1,this.prevTok=e.staticTokens[e.TokenID.EndOfFile],this.startCol=this.col,this.startLine=this.line,this.lineMap[1]=0,e.LexKeywordTable||i()}return t.prototype.previousToken=function(){return this.prevTok},t.prototype.setSourceText=function(e,t){this.mode=t,this.scanComments=this.mode===x.Line,this.pos=0,this.interveningWhitespacePos=0,this.startPos=0,this.line=1,this.col=0,this.startCol=this.col,this.startLine=this.line,this.len=0,this.src=e.getText(0,e.getLength()),this.len=this.src.length,this.lineMap=[],this.lineMap[1]=0,this.commentStack=[],this.leftCurlyCount=0,this.rightCurlyCount=0,this.seenUnicodeChar=!1,this.seenUnicodeCharInComment=!1},t.prototype.setErrorHandler=function(e){this.reportError=e},t.prototype.setText=function(e,t){this.setSourceText(new N(e),t)},t.prototype.setScanComments=function(e){this.scanComments=e},t.prototype.tokenStart=function(){this.startPos=this.pos,this.startLine=this.line,this.startCol=this.col,this.interveningWhitespace=!1},t.prototype.peekChar=function(){return this.pos=e.LexCode_0&&t<=e.LexCode_9||t>=e.LexCode_A&&t<=e.LexCode_F||t>=e.LexCode_a&&t<=e.LexCode_f},t.prototype.IsOctalDigit=function(t){return t>=e.LexCode_0&&t<=e.LexCode_7||t>=e.LexCode_a&&t<=e.LexCode_f},t.prototype.scanHexDigits=function(){for(var t=!1;;){if(!this.IsHexDigit(this.ch)){if(t){var n=this.src.substring(this.startPos,this.pos);return new e.NumberLiteralToken(parseInt(n),n)}return null}this.nextChar(),t=!0}},t.prototype.scanOctalDigits=function(){for(var t=!1;;){if(!this.IsOctalDigit(this.ch)){if(t){var n=this.src.substring(this.startPos,this.pos);return new e.NumberLiteralToken(parseInt(n),n)}return null}this.nextChar(),t=!0}},t.prototype.scanDecimalNumber=function(t){for(var n=!1,r=this.pos,i=this.col;;)if(a(this.ch))n=!0,this.ch!=e.LexCode_0&&t==_.InEmptyFraction&&(t=_.InFraction),this.nextChar();else if(this.ch==e.LexCodeDOT){if(t!=_.Start){if(n){var o=this.src.substring(this.startPos,this.pos); return new e.NumberLiteralToken(parseFloat(o),o)}return this.pos=r,this.col=i,null}this.nextChar(),t=_.InEmptyFraction}else if(this.ch==e.LexCode_e||this.ch==e.LexCode_E)if(t==_.Start){if(!n)return this.pos=r,this.col=i,null;n=!1,this.nextChar(),t=_.InExponent}else{if(t!=_.InFraction&&t!=_.InEmptyFraction){if(n){var o=this.src.substring(this.startPos,this.pos);return new e.NumberLiteralToken(parseFloat(o),o)}return this.pos=r,this.col=i,null}this.nextChar(),t=_.InExponent,n=!1}else{if(this.ch!=e.LexCodePLS&&this.ch!=e.LexCodeMIN){if(n){var o=this.src.substring(this.startPos,this.pos);return new e.NumberLiteralToken(parseFloat(o),o)}return this.pos=r,this.col=i,null}if(t!=_.InExponent){if(t==_.InEmptyFraction||t==_.InFraction){var o=this.src.substring(this.startPos,this.pos);return new e.NumberLiteralToken(parseFloat(o),o)}if(n){var o=this.src.substring(this.startPos,this.pos);return new e.NumberLiteralToken(parseFloat(o),o)}return this.pos=r,this.col=i,null}if(n)return this.pos=r,this.col=i,null;this.nextChar()}},t.prototype.scanNumber=function(){if(this.peekChar()!=e.LexCode_0)return this.scanDecimalNumber(_.Start);switch(this.peekCharAt(this.pos+1)){case e.LexCode_x:case e.LexCode_X:return this.advanceChar(2),this.scanHexDigits();case e.LexCode_8:case e.LexCode_9:case e.LexCodeDOT:return this.scanDecimalNumber(_.Start);default:return this.scanOctalDigits()}},t.prototype.scanFraction=function(){return this.scanDecimalNumber(_.InFraction)},t.prototype.newLine=function(){this.col=0,this.mode==x.File&&(this.line++,this.lineMap[this.line]=this.pos+1)},t.prototype.finishMultilineComment=function(){var t;for(this.lexState=E.InMultilineComment;this.pos=e.LexCodeASCIIChars&&(this.seenUnicodeCharInComment=!0);this.nextChar()}return!1},t.prototype.pushComment=function(e){this.commentStack.push(e)},t.prototype.getComments=function(){var e=this.commentStack;return this.commentStack=[],e},t.prototype.getCommentsForLine=function(e){for(var t=null;this.commentStack.length>0&&this.commentStack[0].line==e;)t=null==t?[this.commentStack.shift()]:t.concat([this.commentStack.shift()]);return t},t.prototype.resetComments=function(){this.commentStack=[]},t.prototype.endsLine=function(t){return t==e.LexCodeNWL||t==e.LexCodeRET||t==e.LexCodeLS||t==e.LexCodePS},t.prototype.finishSinglelineComment=function(){for(;this.pos=e.LexCodeASCIIChars&&(this.seenUnicodeCharInComment=!0),this.nextChar();this.mode==x.File&&this.tokenStart()},t.prototype.findClosingSLH=function(){for(var t=this.pos,n=this.src.charCodeAt(t),r=0,i=!1,o=!1;!this.endsLine(n)&&t0){var i=this.src.substring(t,r),o="";this.pos=r+1,this.ch=this.peekChar();for(var s=this.pos;this.ch==e.LexCode_i||this.ch==e.LexCode_g||this.ch==e.LexCode_m;)this.nextChar();if(this.pos-s>3)return null;o=this.src.substring(s,this.pos);var a=void 0;try{a=new RegExp(i,o)}catch(l){}if(a)return this.col=n+(this.pos-this.startPos),new e.RegularExpressionLiteralToken(this.src.substring(t-1,this.pos))}return this.pos=t,this.col=n,null},t.prototype.lastTokenHadNewline=function(){return this.prevLine!=this.startLine},t.prototype.lastTokenLimChar=function(){return this.interveningWhitespace?this.interveningWhitespacePos:this.startPos},t.prototype.advanceChar=function(e){this.pos+=e,this.col+=e,this.ch=this.peekChar()},t.prototype.nextChar=function(){this.pos++,this.col++,this.ch=this.peekChar()},t.prototype.getLookAheadToken=function(){var e=this.prevLine,t=this.line,n=this.col,r=this.pos,i=this.startPos,o=this.startCol,s=this.startLine,a=this.ch,l=this.prevTok,c=this.lexState,u=this.interveningWhitespace,p=this.interveningWhitespacePos,h=this.leftCurlyCount,d=this.rightCurlyCount,f=this.seenUnicodeChar,m=this.seenUnicodeCharInComment,g=this.commentStack.length,y=this.scan();return this.prevLine=e,this.line=t,this.col=n,this.pos=r,this.startPos=i,this.startCol=o,this.startLine=s,this.ch=a,this.prevTok=l,this.lexState=c,this.interveningWhitespace=u,this.interveningWhitespacePos=p,this.leftCurlyCount=h,this.rightCurlyCount=d,this.seenUnicodeChar=f,this.seenUnicodeCharInComment=m,this.commentStack.length=g,y},t.prototype.scanInLine=function(){if(this.lexState==E.InMultilineComment&&this.scanComments){this.ch=this.peekChar();var t=this.line;if(this.finishMultilineComment(),this.startPosr;r++){if(!this.IsHexDigit(this.ch)){this.reportScannerError("Invalid Unicode escape sequence");break}this.nextChar()}continue e}}this.ch>=e.LexCodeASCIIChars&&(this.seenUnicodeChar=!0),this.nextChar()}return new e.StringLiteralToken(this.src.substring(this.startPos,this.pos))},t.prototype.scanIdentifier=function(){for(var t=!1,i=this.ch==e.LexCodeBSL;;){for(;b[this.ch]||a(this.ch)||this.ch>=e.LexCodeASCIIChars&&this.isValidUnicodeIdentifierChar();)this.nextChar();if(this.ch==e.LexCodeBSL){if(this.nextChar(),this.ch==e.LexCode_u){this.nextChar();for(var o=0;4>o;o++){if(!this.IsHexDigit(this.ch))return this.reportScannerError("Invalid Unicode escape sequence"),e.staticTokens[e.TokenID.Error];this.nextChar()}var s=parseInt(this.src.substring(this.pos-4,this.pos),16);if(!(b[s]||!i&&a(s)||s>=e.LexCodeASCIIChars&&(r(s)||!i&&n(s))))return this.reportScannerError("Invalid identifier character"),e.staticTokens[e.TokenID.Error];t=!0,i=!1;continue}return this.reportScannerError("Invalid Unicode escape sequence"),e.staticTokens[e.TokenID.Error]}break}var l=this.src.substring(this.startPos,this.pos),c=e.LexKeywordTable.lookup(l);return t||null===c||isNaN(Number(c))?new e.IdentifierToken(l,t):e.staticTokens[c]},t.prototype.innerScan=function(){var t;this.tokenStart(),this.ch=this.peekChar();e:for(;this.pos=e.LexCodeASCIIChars&&r(this.ch))return this.scanIdentifier();if(this.ch==e.LexCodeSpace){this.interveningWhitespace||(this.interveningWhitespacePos=this.pos);do this.nextChar();while(this.ch==e.LexCodeSpace);if(this.mode==x.Line){var n=this.src.substring(this.startPos,this.pos);return new e.WhitespaceToken(e.TokenID.Whitespace,n)}this.tokenStart(),this.interveningWhitespace=!0}else if(this.ch==e.LexCodeSLH){this.nextChar();var i;if(this.ch==e.LexCodeSLH){this.interveningWhitespace||(this.interveningWhitespacePos=this.pos-1);var o=this.pos-1,s=this.line;this.finishSinglelineComment();var i=this.src.substring(o,this.pos),a=new e.CommentToken(e.TokenID.Comment,i,!1,o,s,!1);if(this.scanComments)return this.startPos=o,a;this.pushComment(a),this.interveningWhitespace=!0}else{if(this.ch!=e.LexCodeMUL){var l=this.speculateRegex();return l?l:this.peekCharAt(this.pos)==e.LexCodeEQ?(this.nextChar(),e.staticTokens[e.TokenID.SlashEquals]):e.staticTokens[e.TokenID.Slash]}this.interveningWhitespace||(this.interveningWhitespacePos=this.pos-1);var o=this.pos-1,s=this.line;this.nextChar(),this.finishMultilineComment();var i=this.src.substring(o,this.pos),c=this.endsLine(this.peekChar()),a=new e.CommentToken(e.TokenID.Comment,i,!0,o,s,c);if(this.scanComments)return this.startPos=o,a;this.pushComment(a),this.interveningWhitespace=!0}}else{if(this.ch==e.LexCodeSMC)return this.nextChar(),e.staticTokens[e.TokenID.Semicolon];if(this.ch==e.LexCodeAPO||this.ch==e.LexCodeQUO){var u=this.ch;return this.nextChar(),this.scanStringConstant(u)}if(T[this.ch]){var p=T[this.ch];return p.tokenId==e.TokenID.OpenBrace?this.leftCurlyCount++:p.tokenId==e.TokenID.CloseBrace&&this.rightCurlyCount++,this.nextChar(),p}if(this.ch>=e.LexCode_0&&this.ch<=e.LexCode_9)return t=this.scanNumber(),t?t:(this.nextChar(),e.staticTokens[e.TokenID.Error]);switch(this.ch){case e.LexCodeTAB:case e.LexCodeVTAB:if(this.interveningWhitespace||(this.interveningWhitespacePos=this.pos),this.mode==x.Line){do this.nextChar();while(this.ch==e.LexCodeSpace||9==this.ch);var h=this.src.substring(this.startPos,this.pos);return new e.WhitespaceToken(e.TokenID.Whitespace,h)}this.interveningWhitespace=!0;case 255:case 254:case 239:case 187:case 191:case e.LexCodeLS:case e.LexCodePS:case e.LexCodeNWL:case e.LexCodeRET:if(this.ch==e.LexCodeNWL&&(this.newLine(),this.mode==x.Line))return e.staticTokens[e.TokenID.EndOfFile];this.interveningWhitespace||(this.interveningWhitespacePos=this.pos),this.nextChar(),this.tokenStart(),this.interveningWhitespace=!0;break;case e.LexCodeDOT:return this.peekCharAt(this.pos+1)==e.LexCodeDOT?this.peekCharAt(this.pos+2)==e.LexCodeDOT?(this.advanceChar(3),e.staticTokens[e.TokenID.DotDotDot]):(this.nextChar(),e.staticTokens[e.TokenID.Dot]):(this.nextChar(),t=this.scanFraction(),t?t:e.staticTokens[e.TokenID.Dot]);case e.LexCodeEQ:return this.peekCharAt(this.pos+1)==e.LexCodeEQ?this.peekCharAt(this.pos+2)==e.LexCodeEQ?(this.advanceChar(3),e.staticTokens[e.TokenID.EqualsEqualsEquals]):(this.advanceChar(2),e.staticTokens[e.TokenID.EqualsEquals]):this.peekCharAt(this.pos+1)==e.LexCodeGT?(this.advanceChar(2),e.staticTokens[e.TokenID.EqualsGreaterThan]):(this.nextChar(),e.staticTokens[e.TokenID.Equals]);case e.LexCodeBNG:return this.peekCharAt(this.pos+1)==e.LexCodeEQ?this.peekCharAt(this.pos+2)==e.LexCodeEQ?(this.advanceChar(3),e.staticTokens[e.TokenID.ExclamationEqualsEquals]):(this.advanceChar(2),e.staticTokens[e.TokenID.ExclamationEquals]):(this.nextChar(),e.staticTokens[e.TokenID.Exclamation]);case e.LexCodePLS:return this.peekCharAt(this.pos+1)==e.LexCodeEQ?(this.advanceChar(2),e.staticTokens[e.TokenID.PlusEquals]):this.peekCharAt(this.pos+1)==e.LexCodePLS?(this.advanceChar(2),e.staticTokens[e.TokenID.PlusPlus]):(this.nextChar(),e.staticTokens[e.TokenID.Plus]);case e.LexCodeMIN:return this.peekCharAt(this.pos+1)==e.LexCodeEQ?(this.advanceChar(2),e.staticTokens[e.TokenID.MinusEquals]):this.peekCharAt(this.pos+1)==e.LexCodeMIN?(this.advanceChar(2),e.staticTokens[e.TokenID.MinusMinus]):(this.nextChar(),e.staticTokens[e.TokenID.Minus]);case e.LexCodeMUL:return this.peekCharAt(this.pos+1)==e.LexCodeEQ?(this.advanceChar(2),e.staticTokens[e.TokenID.AsteriskEquals]):(this.nextChar(),e.staticTokens[e.TokenID.Asterisk]);case e.LexCodePCT:return this.peekCharAt(this.pos+1)==e.LexCodeEQ?(this.advanceChar(2),e.staticTokens[e.TokenID.PercentEquals]):(this.nextChar(),e.staticTokens[e.TokenID.Percent]);case e.LexCodeLT:return this.peekCharAt(this.pos+1)==e.LexCodeLT?this.peekCharAt(this.pos+2)==e.LexCodeEQ?(this.advanceChar(3),e.staticTokens[e.TokenID.LessThanLessThanEquals]):(this.advanceChar(2),e.staticTokens[e.TokenID.LessThanLessThan]):this.peekCharAt(this.pos+1)==e.LexCodeEQ?(this.advanceChar(2),e.staticTokens[e.TokenID.LessThanEquals]):(this.nextChar(),e.staticTokens[e.TokenID.LessThan]);case e.LexCodeGT:return this.peekCharAt(this.pos+1)==e.LexCodeGT?this.peekCharAt(this.pos+2)==e.LexCodeEQ?(this.advanceChar(3),e.staticTokens[e.TokenID.GreaterThanGreaterThanEquals]):this.peekCharAt(this.pos+2)==e.LexCodeGT?this.peekCharAt(this.pos+3)==e.LexCodeEQ?(this.advanceChar(4),e.staticTokens[e.TokenID.GreaterThanGreaterThanGreaterThanEquals]):(this.advanceChar(3),e.staticTokens[e.TokenID.GreaterThanGreaterThanGreaterThan]):(this.advanceChar(2),e.staticTokens[e.TokenID.GreaterThanGreaterThan]):this.peekCharAt(this.pos+1)==e.LexCodeEQ?(this.advanceChar(2),e.staticTokens[e.TokenID.GreaterThanEquals]):(this.nextChar(),e.staticTokens[e.TokenID.GreaterThan]);case e.LexCodeXOR:return this.peekCharAt(this.pos+1)==e.LexCodeEQ?(this.advanceChar(2),e.staticTokens[e.TokenID.CaretEquals]):(this.nextChar(),e.staticTokens[e.TokenID.Caret]);case e.LexCodeBAR:return this.peekCharAt(this.pos+1)==e.LexCodeEQ?(this.advanceChar(2),e.staticTokens[e.TokenID.BarEquals]):this.peekCharAt(this.pos+1)==e.LexCodeBAR?(this.advanceChar(2),e.staticTokens[e.TokenID.BarBar]):(this.nextChar(),e.staticTokens[e.TokenID.Bar]);case e.LexCodeAMP:return this.peekCharAt(this.pos+1)==e.LexCodeEQ?(this.advanceChar(2),e.staticTokens[e.TokenID.AmpersandEquals]):this.peekCharAt(this.pos+1)==e.LexCodeAMP?(this.advanceChar(2),e.staticTokens[e.TokenID.AmpersandAmpersand]):(this.nextChar(),e.staticTokens[e.TokenID.And]);default:this.reportScannerError("Invalid character"),this.nextChar();continue e}}}return e.staticTokens[e.TokenID.EndOfFile]},t.prototype.reportScannerError=function(e){this.reportError&&this.reportError(e)},t}();e.Scanner=R,e.convertTokToIDName=u,e.convertTokToID=p,e.getLineNumberFromPosition=d,e.getSourceLineColFromMap=f,e.getLineColumnFromPosition=m,e.getPositionFromLineColumn=g,e.isPrimitiveTypeToken=y,e.isModifier=v}(TypeScript||(TypeScript={}));var TypeScript;!function(e){function t(t,n,r,i,o){var s=new e.ScopeChain(null,n.scopeChain,t);s.thisType=r,s.classType=i,s.fnc=o,n.scopeChain=s}function n(e){e.scopeChain=e.scopeChain.previous}function r(e,t){return null!=e&&e.isInstanceProperty()?e:t}function i(e){return e.isInstanceProperty()}function o(n,r){var i=n,o=null,s=null;i.name&&i.mod&&(i.name.sym=i.mod.symbol);var a=i.mod;a&&(o=new e.SymbolTableScope(a.members,a.ambientMembers,a.enclosedTypes,a.ambientEnclosedTypes,a.symbol),a.memberScope=o,r.modDeclChain.push(i),r.typeFlow.checker.currentModDecl=i,s=new e.SymbolAggregateScope(a.symbol),s.addParentScope(o),s.addParentScope(r.scopeChain.scope),t(s,r,null,null,null),a.containedScope=s,a.symbol&&r.typeFlow.addLocalsFromScope(a.containedScope,a.symbol,i.vars,a.members.privateMembers,!0))}function s(n,r){var i=n,o=null,s=null;i.name&&i.type&&(i.name.sym=i.type.symbol);var a=n.type;if(a){a.symbol,o=r.typeFlow.checker.scopeOf(a),s=new e.SymbolAggregateScope(a.symbol),s.addParentScope(o),s.addParentScope(r.scopeChain.scope),a.containedScope=s,a.memberScope=o;var l=a.instanceType;o=r.typeFlow.checker.scopeOf(l),l.memberScope=o,s=new e.SymbolAggregateScope(l.symbol),s.addParentScope(r.scopeChain.scope),t(s,r,l,a,null),l.containedScope=s}else n.type=r.typeFlow.anyType}function a(n,r){var i=n,o=null,s=null;i.name&&i.type&&(i.name.sym=i.type.symbol);var a=n.type;o=r.typeFlow.checker.scopeOf(a),a.memberScope=o,s=new e.SymbolAggregateScope(a.symbol),s.addParentScope(o),s.addParentScope(r.scopeChain.scope),t(s,r,null,null,null),a.containedScope=s}function l(n,r){var i=n,o=i.type,s=new e.ScopedMembers(new e.DualStringHashTable(new e.StringHashTable,new e.StringHashTable)),a=new e.ScopedMembers(new e.DualStringHashTable(new e.StringHashTable,new e.StringHashTable)),o=new e.Type,l=new e.WithSymbol(i.minChar,r.typeFlow.checker.locationInfo.unitIndex,o);o.members=s,o.ambientMembers=a,o.symbol=l,o.setHasImplementation(),i.type=o;var c=new e.SymbolScopeBuilder(o.members,o.ambientMembers,null,null,r.scopeChain.scope,o.symbol);t(c,r,null,null,null),o.containedScope=c}function c(n,r){var i=n,o=i.type,s=new e.ScopedMembers(new e.DualStringHashTable(new e.StringHashTable,new e.StringHashTable)),a=new e.ScopedMembers(new e.DualStringHashTable(new e.StringHashTable,new e.StringHashTable)),o=new e.Type,l=new e.WithSymbol(i.minChar,r.typeFlow.checker.locationInfo.unitIndex,o);o.members=s,o.ambientMembers=a,o.symbol=l,o.setHasImplementation(),i.type=o;var c=new e.SymbolScopeBuilder(o.members,o.ambientMembers,null,null,r.scopeChain.scope,o.symbol);t(c,r,null,null,null),o.containedScope=c}function u(n,r){var i=n,o=null,s=null;i.type&&(s=n.type.symbol);var a=e.hasFlag(i.fncFlags,e.FncFlags.Static),l=a&&null!=r.scopeChain.fnc,c=l?r.scopeChain.fnc.type.memberScope:r.scopeChain.scope;if(!r.scopeChain.thisType||i.isConstructor&&!e.hasFlag(i.fncFlags,e.FncFlags.ClassMethod))i.isConstructor&&r.scopeChain.thisType&&(o=r.scopeChain.thisType.symbol);else{var u=r.scopeChain.thisType;c=u.typeFlags&e.TypeFlags.IsClass||e.hasFlag(i.fncFlags,e.FncFlags.ClassMethod)?r.scopeChain.previous.scope.container&&r.scopeChain.previous.scope.container.declAST&&r.scopeChain.previous.scope.container.declAST.nodeType==e.NodeType.FuncDecl&&r.scopeChain.previous.scope.container.declAST.isConstructor?u.constructorScope:a&&r.scopeChain.classType?r.scopeChain.classType.containedScope:u.containedScope:!i.isMethod()||a?u.constructorScope:u.containedScope,o=u.symbol}if(null==i.type||e.hasFlag(i.type.symbol.flags,e.SymbolFlags.TypeSetDuringScopeAssignment)){r.scopeChain.fnc&&r.scopeChain.fnc.type&&(o=r.scopeChain.fnc.type.symbol);var p=null,h=r.scopeChain.fnc,d=i.name?i.name.actualText:null,f=null;a?(null==h.type.members&&o.getType().memberScope&&(h.type.members=o.type.memberScope.valueMembers),p=r.scopeChain.fnc.type.memberScope,h.innerStaticFuncs[h.innerStaticFuncs.length]=i):p=r.scopeChain.scope,d&&"__missing"!=d&&!i.isAccessor()&&(f=a?p.findLocal(d,!1,!1):p.findLocal(d,!1,!1)),r.typeFlow.checker.createFunctionSignature(i,o,p,f,null==f),(!i.accessorSymbol&&i.fncFlags&e.FncFlags.ClassMethod&&o&&(!f||f.declAST.nodeType!=e.NodeType.FuncDecl)&&i.isAccessor()||f&&f.isAccessor())&&(i.accessorSymbol=r.typeFlow.checker.createAccessorSymbol(i,f,o.getType(),i.isMethod()&&a,!0,p,o)),i.type.symbol.flags|=e.SymbolFlags.TypeSetDuringScopeAssignment}if(i.name&&i.type&&(i.name.sym=i.type.symbol),i.scopeType=i.type,!i.isOverload){var m=new e.StringHashTable,g=new e.ScopedMembers(new e.DualStringHashTable(m,new e.StringHashTable)),y=new e.StringHashTable,v=new e.ScopedMembers(new e.DualStringHashTable(y,new e.StringHashTable)),T=new e.StringHashTable,b=new e.ScopedMembers(new e.DualStringHashTable(T,new e.StringHashTable)),k=new e.StringHashTable,S=new e.ScopedMembers(new e.DualStringHashTable(k,new e.StringHashTable));i.unitIndex=r.typeFlow.checker.locationInfo.unitIndex;var C=new e.SymbolScopeBuilder(g,v,null,null,c,s),w=new e.SymbolScopeBuilder(b,S,null,null,c,null);if(i.isConstructor&&r.scopeChain.thisType&&(r.scopeChain.thisType.constructorScope=C),i.symbols=m,!i.isSpecialFn()){var _=i.type,E=i.signature;i.isConstructor||(_.containedScope=C,C.container=_.symbol,_.memberScope=w,w.container=_.symbol),i.enclosingFnc=r.scopeChain.fnc,_.enclosingType=a?r.scopeChain.classType:r.scopeChain.thisType;var f=n.type.symbol;if((i.fncFlags&e.FncFlags.Signature)==e.FncFlags.None&&i.vars&&(r.typeFlow.addLocalsFromScope(C,f,i.vars,m,!1),r.typeFlow.addLocalsFromScope(w,f,i.statics,T,!1)),E.parameters)for(var x=E.parameters.length,N=0;x>N;N++){var L=E.parameters[N];r.typeFlow.checker.resolveTypeLink(C,L.parameter.typeLink,!0)}r.typeFlow.checker.resolveTypeLink(C,E.returnType,i.isSignature())}if(!i.isConstructor||e.hasFlag(i.fncFlags,e.FncFlags.ClassMethod)){var I=i.isConstructor&&e.hasFlag(i.fncFlags,e.FncFlags.ClassMethod)?r.scopeChain.thisType:null;t(C,r,I,null,i)}i.name&&e.hasFlag(i.fncFlags,e.FncFlags.IsFunctionExpression)&&!i.isAccessor()&&i.name.sym&&m.add(i.name.actualText,i.name.sym)}}function p(n,r){var i=n;if(i.param){var o=new e.ScopedMembers(new e.DualStringHashTable(new e.StringHashTable,new e.StringHashTable)),s=new e.SymbolScopeBuilder(o,null,null,null,r.scopeChain.scope,r.scopeChain.scope.container);i.containedScope=s,t(s,r,r.scopeChain.thisType,r.scopeChain.classType,r.scopeChain.fnc)}}function h(t,n,r){var i=r.state,c=!0;if(t)if(t.nodeType==e.NodeType.List){var h=t;h.enclosingScope=i.scopeChain.scope}else t.nodeType==e.NodeType.ModuleDeclaration?o(t,i):t.nodeType==e.NodeType.ClassDeclaration?s(t,i):t.nodeType==e.NodeType.InterfaceDeclaration?a(t,i):t.nodeType==e.NodeType.With?l(t,i):t.nodeType==e.NodeType.FuncDecl?u(t,i):t.nodeType==e.NodeType.Catch?p(t,i):t.nodeType==e.NodeType.TypeRef&&(c=!1);return r.options.goChildren=c,t}function d(t,r,i){var o=i.state,s=!0;if(t)if(t.nodeType==e.NodeType.ModuleDeclaration)n(o),o.modDeclChain.pop(),o.modDeclChain.length>=1&&(o.typeFlow.checker.currentModDecl=o.modDeclChain[o.modDeclChain.length-1]);else if(t.nodeType==e.NodeType.ClassDeclaration)n(o);else if(t.nodeType==e.NodeType.InterfaceDeclaration)n(o);else if(t.nodeType==e.NodeType.With)n(o);else if(t.nodeType==e.NodeType.FuncDecl){var a=t;a.isConstructor&&!e.hasFlag(a.fncFlags,e.FncFlags.ClassMethod)||a.isOverload||n(o)}else if(t.nodeType==e.NodeType.Catch){var l=t;l.param&&n(o)}else s=!1;return i.options.goChildren=s,t}var f=function(){function e(e,t,n){this.scopeChain=e,this.typeFlow=t,this.modDeclChain=n}return e}();e.AssignScopeContext=f,e.pushAssignScope=t,e.popAssignScope=n,e.instanceCompare=r,e.instanceFilterStop=i;var m=function(){function e(e,t){this.select=e,this.stop=t,this.result=null}return e.prototype.reset=function(){this.result=null},e.prototype.update=function(e){return this.result=this.select(this.result,e),this.result?this.stop(this.result):!1},e}();e.ScopeSearchFilter=m,e.instanceFilter=new m(r,i),e.preAssignModuleScopes=o,e.preAssignClassScopes=s,e.preAssignInterfaceScopes=a,e.preAssignWithScopes=l,e.preAssignLetScopes=c,e.preAssignFuncDeclScopes=u,e.preAssignCatchScopes=p,e.preAssignScopes=h,e.postAssignScopes=d}(TypeScript||(TypeScript={}));var TypeScript;!function(e){function t(t,n,r){var i=r.state;return e.hasFlag(t.flags,i.matchFlag)&&(i.pos<0||i.pos==t.limChar)&&(i.ast=t,null==t.type&&i.pos>=0&&i.flow.inScopeTypeCheck(t,i.scope),i.type=t.type,i.options.stopWalk()),t}function n(t,n,r,i,o,s,a,l,c){var u=new e.SymbolScopeBuilder(n,r,i,o,null,t),p=new e.ScopeChain(t,s.scopeChain,u);p.thisType=a,p.classType=l,p.moduleDecl=c,s.scopeChain=p}function r(e){e.scopeChain=e.scopeChain.previous}function i(t,n,r){var i=r.state,o=t.minChar,s=t.limChar;if(t.nodeType==e.NodeType.Script&&i.pos>s&&(s=i.pos),o<=i.pos&&s>=i.pos){switch(t.nodeType){case e.NodeType.Script:var a=t;i.scopeGetter=function(){return null===a.bod?null:a.bod.enclosingScope},i.scopeStartAST=a;break;case e.NodeType.ClassDeclaration:i.scopeGetter=function(){return null===t.type||null===t.type.instanceType.containedScope?null:t.type.instanceType.containedScope},i.scopeStartAST=t,i.enclosingClassDecl=t;break;case e.NodeType.ObjectLit:var l=t;l.targetType&&(i.scopeGetter=function(){return l.targetType.containedScope},i.objectLiteralScopeGetter=function(){return l.targetType.memberScope},i.enclosingObjectLit=l);break;case e.NodeType.ModuleDeclaration:i.deepestModuleDecl=t,i.scopeGetter=function(){return null===t.type?null:t.type.containedScope},i.scopeStartAST=t;break;case e.NodeType.InterfaceDeclaration:i.scopeGetter=function(){return null===t.type?null:t.type.containedScope},i.scopeStartAST=t;break;case e.NodeType.FuncDecl:var c=t;i.skipNextFuncDeclForClass?i.skipNextFuncDeclForClass=!1:(i.scopeGetter=function(){return c.isConstructor&&e.hasFlag(c.fncFlags,e.FncFlags.ClassMethod)&&t.type&&t.type.enclosingType?t.type.enclosingType.constructorScope:c.scopeType?c.scopeType.containedScope:c.type?c.type.containedScope:null},i.scopeStartAST=t)}r.options.goChildren=!0}else r.options.goChildren=!1;return t}function o(t,n,r,o,s){var a=new l(t,n,r,o,s);return e.getAstWalkerFactory().walk(n,i,null,null,a),null===a.scopeStartAST?null:a}var s=function(){function e(e,t){this.scopeChain=e,this.checker=t,this.script=null}return e}();e.TypeCollectionContext=s;var a=function(){function t(t,n,r){this.flow=t,this.pos=n,this.matchFlag=r,this.type=null,this.ast=null,this.options=new e.AstWalkOptions}return t}();e.MemberScopeContext=a;var l=function(){function t(e,t,n,r,i){this.logger=e,this.script=t,this.text=n,this.pos=r,this.isMemberCompletion=i,this.scopeGetter=null,this.objectLiteralScopeGetter=null,this.scopeStartAST=null,this.skipNextFuncDeclForClass=!1,this.deepestModuleDecl=null,this.enclosingClassDecl=null,this.enclosingObjectLit=null,this.publicsOnly=!0,this.useFullAst=!1}return t.prototype.getScope=function(){return this.scopeGetter()},t.prototype.getObjectLiteralScope=function(){return this.objectLiteralScopeGetter()},t.prototype.getScopeAST=function(){return this.scopeStartAST},t.prototype.getScopePosition=function(){return this.scopeStartAST.minChar},t.prototype.getScriptFragmentStartAST=function(){return this.scopeStartAST},t.prototype.getScriptFragmentPosition=function(){return this.getScriptFragmentStartAST().minChar},t.prototype.getScriptFragment=function(){if(null==this.scriptFragment){var t=this.getScriptFragmentStartAST(),n=t.minChar,r=this.isMemberCompletion?this.pos:this.pos+1;this.scriptFragment=e.quickParse(this.logger,t,this.text,n,r,null).Script}return this.scriptFragment},t}();e.EnclosingScopeContext=l,e.preFindMemberScope=t,e.pushTypeCollectionScope=n,e.popTypeCollectionScope=r,e.preFindEnclosingScope=i,e.findEnclosingScopeAt=o}(TypeScript||(TypeScript={}));var TypeScript;!function(e){var t=function(){function t(){this.hasVariableArgList=!1,this.parameters=null,this.declAST=null,this.typeCheckStatus=e.TypeCheckStatus.NotStarted,this.nonOptionalParameterCount=0}return t.prototype.specializeType=function(n,r,i){var o=new t;if(this.hasVariableArgList&&(o.hasVariableArgList=!0),o.returnType=new e.TypeLink,o.returnType.type=this.returnType.type?this.returnType.type.specializeType(n,r,i,!1):i.anyType,this.parameters){o.parameters=[];for(var s=0,a=this.parameters.length;a>s;s++){var l=this.parameters[s],c=new e.ValueLocation,u=new e.ParameterSymbol(l.name,l.location,i.locationInfo.unitIndex,c);u.declAST=this.declAST,c.symbol=u,c.typeLink=new e.TypeLink,o.parameters[s]=u;var p=l.getType();c.typeLink.type=p?p.specializeType(n,r,i,!1):i.anyType}}return o.nonOptionalParameterCount=this.nonOptionalParameterCount,o.declAST=this.declAST,o},t.prototype.toString=function(){return this.toStringHelper(!1,!1,null)},t.prototype.toStringHelper=function(e,t,n){return this.toStringHelperEx(e,t,n).toString()},t.prototype.toStringHelperEx=function(t,n,r,i){"undefined"==typeof i&&(i="");var o=new e.MemberNameArray;o.prefix=n?i+"[":i+"(";for(var s=this.parameters.length,a=this.hasVariableArgList?s-1:s,l=0;a>l;l++)o.add(e.MemberName.create(this.parameters[l].name+(this.parameters[l].isOptional()?"?":"")+": ")),o.add(this.parameters[l].getType().getScopedTypeNameEx(r)),s-1>l&&o.add(e.MemberName.create(", "));return this.hasVariableArgList&&(o.add(e.MemberName.create("..."+this.parameters[l].name+": ")),o.add(this.parameters[l].getType().getScopedTypeNameEx(r))),t?n?o.add(e.MemberName.create("] => ")):o.add(e.MemberName.create(") => ")):n?o.add(e.MemberName.create("]: ")):o.add(e.MemberName.create("): ")),this.returnType.type?o.add(this.returnType.type.getScopedTypeNameEx(r)):o.add(e.MemberName.create("any")),o},t}();e.Signature=t;var n=function(){function t(){this.signatures=[],this.hasImplementation=!0,this.definitionSignature=null,this.hasBeenTypechecked=!1,this.flags=e.SignatureFlags.None}return t.prototype.addSignature=function(t){null==this.signatures&&(this.signatures=new Array),this.signatures[this.signatures.length]=t,!t.declAST||t.declAST.isOverload||t.declAST.isSignature()||e.hasFlag(t.declAST.fncFlags,e.FncFlags.Ambient)||e.hasFlag(t.declAST.fncFlags,e.FncFlags.Signature)||(this.definitionSignature=t)},t.prototype.toString=function(){return this.signatures.toString()},t.prototype.toStrings=function(t,n,r,i,o){var s=this,a=[],l=this.signatures.length;!i&&l>1&&(n=!1);var c=function(i){return s.flags&e.SignatureFlags.IsIndexer?i.toStringHelperEx(n,!0,r):i.toStringHelperEx(n,!1,r,t)};if(o)a.push(c(o));else for(var u=0;l>u&&(l>1&&this.signatures[u]==this.definitionSignature||(a.push(c(this.signatures[u])),!i));u++);if(i&&l>1){var p=a[a.length-1],h=" (+ "+(null!=this.definitionSignature?l-2:l-1)+" overload(s))";p.add(e.MemberName.create(h))}return a},t.prototype.specializeType=function(e,n,r){var i=new t;if(this.signatures)for(var o=0,s=this.signatures.length;s>o;o++)i.addSignature(this.signatures[o].specializeType(e,n,r));return i},t.prototype.verifySignatures=function(t){var n=0;if(this.signatures&&(n=this.signatures.length)>0)for(var r=0;n>r;r++){for(var i=r+1;n>i;i++)this.signatures[r].declAST&&this.signatures[i].declAST&&e.hasFlag(this.signatures[r].declAST.fncFlags,e.FncFlags.Signature)&&e.hasFlag(this.signatures[i].declAST.fncFlags,e.FncFlags.Signature)&&t.signaturesAreIdentical(this.signatures[r],this.signatures[i])&&t.errorReporter.simpleError(this.signatures[r].declAST,this.signatures[r].declAST&&this.signatures[r].declAST.name?"Signature for '"+this.signatures[r].declAST.name.actualText+"' is duplicated":"Signature is duplicated");this.definitionSignature&&(t.signatureIsAssignableToTarget(this.definitionSignature,this.signatures[r])||t.errorReporter.simpleError(this.signatures[r].declAST,"Overload signature is not compatible with function definition"))}},t.prototype.typeCheck=function(t,n,r){if(!this.hasBeenTypechecked){this.hasBeenTypechecked=!0;var i=0;if(this.signatures&&(i=this.signatures.length)>0){for(var o=0;i>o;o++)r||this.definitionSignature||!this.signatures[o].declAST||!this.signatures[o].declAST.isOverload||e.hasFlag(this.signatures[o].declAST.fncFlags,e.FncFlags.Ambient)||t.errorReporter.simpleError(this.signatures[o].declAST,"Overload declaration lacks definition"),this.signatures[o].declAST&&this.signatures[o].declAST.isConstructor&&this.signatures[o].declAST.classDecl&&this.signatures[o].declAST.classDecl.type.symbol.typeCheckStatus==e.TypeCheckStatus.NotStarted&&t.typeFlow.typeCheck(this.signatures[o].declAST.classDecl),t.typeFlow.typeCheck(this.signatures[o].declAST);this.verifySignatures(t)}}},t}();e.SignatureGroup=n}(TypeScript||(TypeScript={}));var TypeScript;!function(e){function t(t,n){return t.declAST&&n&&n.declAST&&t.declAST.nodeType==e.NodeType.FuncDecl?t.declAST.minChar<=n.declAST.minChar&&t.declAST.limChar>=n.declAST.limChar:!1}function n(e,n){for(;e.container;){if(e==n||t(e.container,n))return!0;e=e.container}return!1}!function(e){e._map=[],e._map[0]="NotStarted",e.NotStarted=0,e._map[1]="Started",e.Started=1,e._map[2]="Finished",e.Finished=2}(e.TypeCheckStatus||(e.TypeCheckStatus={}));var r=e.TypeCheckStatus;e.aLexicallyEnclosesB=t,e.aEnclosesB=n;var i=function(){function t(t,n,r,i){this.name=t,this.location=n,this.length=r,this.unitIndex=i,this.bound=!1,this.flags=e.SymbolFlags.None,this.isObjectLitField=!1,this.declAST=null,this.declModule=null,this.passSymbolCreated=e.CompilerDiagnostics.analysisPass }return t.prototype.instanceScope=function(){return null},t.prototype.isVariable=function(){return!1},t.prototype.isMember=function(){return!1},t.prototype.isInferenceSymbol=function(){return!1},t.prototype.isWith=function(){return!1},t.prototype.writeable=function(){return!1},t.prototype.isType=function(){return!1},t.prototype.getType=function(){return null},t.prototype.isAccessor=function(){return!1},t.prototype.isInstanceProperty=function(){return e.hasFlag(this.flags,e.SymbolFlags.Property)&&!e.hasFlag(this.flags,e.SymbolFlags.ModuleMember)},t.prototype.getTypeName=function(e){return this.getTypeNameEx(e).toString()},t.prototype.getTypeNameEx=function(){return e.MemberName.create(this.toString())},t.prototype.getOptionalNameString=function(){return e.hasFlag(this.flags,e.SymbolFlags.Optional)?"?":""},t.prototype.pathToRoot=function(){for(var t=new Array,n=this;n&&n.name!=e.globalId;)t[t.length]=n,n=n.container;return t},t.prototype.findCommonAncestorPath=function(e){if(null==this.container)return new Array;var t,n=this.container.pathToRoot();t=e?e.pathToRoot():new Array;for(var r=-1,i=0,o=n.length;o>i;i++){for(var s=n[i],a=0,l=t.length;l>a;a++){var c=t[a];if(s==c){r=i;break}}if(r>=0)break}return r>=0?n.slice(0,r):n},t.prototype.getPrettyName=function(){return this.name},t.prototype.scopeRelativeName=function(e){if(null==e)return this.getPrettyName(null)+this.getOptionalNameString();for(var t=this.findCommonAncestorPath(e.container),n="",r=0,i=t.length;i>r;r++){var o=t[r].getPrettyName(r==i-1?e.container:t[r+1]);n=o+"."+n}return n+=this.getPrettyName(0==i?e.container:t[0])+this.getOptionalNameString()},t.prototype.fullName=function(t){var n=t?t.container:null,r=n?n.pathToRoot():[],i=null;r.length>0&&r[r.length-1].declAST&&r[r.length-1].declAST.nodeType==e.NodeType.ModuleDeclaration&&r[r.length-1].declAST.isWholeFile()&&(i=r[r.length-1]);for(var o=this.getPrettyName(n),s=this.container;s&&s.name!=e.globalId&&s!=i;)o=s.getPrettyName(n)+"."+o,s=s.container;return o},t.prototype.isExternallyVisible=function(t){return this==t.gloMod?!0:e.hasFlag(this.flags,e.SymbolFlags.Private)?!1:e.hasFlag(this.flags,e.SymbolFlags.Exported)?this.container.isExternallyVisible(t):this.container==t.gloMod},t.prototype.visible=function(t,r){if(null==r||this.container==r.gloMod)return!0;if(e.hasFlag(this.flags,e.SymbolFlags.ModuleMember))return e.hasFlag(this.flags,e.SymbolFlags.Exported)?e.hasFlag(this.flags,e.SymbolFlags.Private)?n(this,t.container):!0:r&&r.currentModDecl==this.declModule||r.currentModDecl&&r.currentModDecl.mod&&r.currentModDecl.mod.symbol&&this.declModule&&this.declModule.mod&&this.declModule.mod.symbol&&n(r.currentModDecl.mod.symbol,this.declModule.mod.symbol);var i=this.declAST&&this.declAST.nodeType==e.NodeType.FuncDecl,o=i&&this.declAST.isMethod(),s=i&&e.hasFlag(this.declAST.fncFlags,e.FncFlags.Static),a=o&&e.hasFlag(this.declAST.fncFlags,e.FncFlags.Private),l=this.isType()&&this.aliasLink;return this.isMember()||o||s||l?e.hasFlag(this.flags,e.SymbolFlags.Private)||a?null==t.container&&this.container!=t.container?!1:null==this.container?!0:n(t.container,this.container):!0:this.container?n(this,t.container):!0},t.prototype.addRef=function(e){this.refs||(this.refs=[]),this.refs[this.refs.length]=e},t.prototype.toString=function(){return this.name?this.name:"_anonymous"},t.prototype.print=function(e){e.Write(this.toString())},t.prototype.specializeType=function(){throw new Error("please implement in derived class")},t.prototype.setType=function(){throw new Error("please implement in derived class")},t.prototype.kind=function(){throw new Error("please implement in derived class")},t.prototype.getInterfaceDeclFromSymbol=function(t){if(null!=this.declAST){if(this.declAST.nodeType==e.NodeType.InterfaceDeclaration)return this.declAST;if(null!=this.container&&this.container!=t.gloMod&&this.container.declAST.nodeType==e.NodeType.InterfaceDeclaration)return this.container.declAST}return null},t.prototype.getVarDeclFromSymbol=function(){return null!=this.declAST&&this.declAST.nodeType==e.NodeType.VarDecl?this.declAST:null},t.prototype.getDocComments=function(){return null!=this.declAST?this.declAST.getDocComments():[]},t.prototype.isStatic=function(){return e.hasFlag(this.flags,e.SymbolFlags.Static)},t}();e.Symbol=i;var o=function(){function e(){}return e}();e.ValueLocation=o;var s=function(t){function n(e,n,i,o){t.call(this,e,n,i,o),this.typeCheckStatus=r.NotStarted}return __extends(n,t),n.prototype.isInferenceSymbol=function(){return!0},n.prototype.transferVarFlags=function(t){e.hasFlag(t,e.VarFlags.Ambient)&&(this.flags|=e.SymbolFlags.Ambient),e.hasFlag(t,e.VarFlags.Constant)&&(this.flags|=e.SymbolFlags.Constant),e.hasFlag(t,e.VarFlags.Static)&&(this.flags|=e.SymbolFlags.Static),e.hasFlag(t,e.VarFlags.Property)&&(this.flags|=e.SymbolFlags.Property),e.hasFlag(t,e.VarFlags.Private)&&(this.flags|=e.SymbolFlags.Private),e.hasFlag(t,e.VarFlags.Public)&&(this.flags|=e.SymbolFlags.Public),e.hasFlag(t,e.VarFlags.Readonly)&&(this.flags|=e.SymbolFlags.Readonly),e.hasFlag(t,e.VarFlags.Exported)&&(this.flags|=e.SymbolFlags.Exported)},n}(i);e.InferenceSymbol=s;var a=function(t){function n(n,r,i,o,s){t.call(this,n,r,i,o),this.type=s,this.expansions=[],this.expansionsDeclAST=[],this.isDynamic=!1,this.isMethod=!1,this.aliasLink=null,this.onlyReferencedAsTypeRef=e.optimizeModuleCodeGen,this.prettyName=this.name}return __extends(n,t),n.prototype.addLocation=function(e){null==this.additionalLocations&&(this.additionalLocations=[]),this.additionalLocations[this.additionalLocations.length]=e},n.prototype.kind=function(){return e.SymbolKind.Type},n.prototype.isType=function(){return!0},n.prototype.getType=function(){return this.type},n.prototype.getTypeNameEx=function(e){return this.type.getMemberTypeNameEx(this.name?this.name+this.getOptionalNameString():"",!1,!1,e)},n.prototype.instanceScope=function(){return this.type.typeFlags&e.TypeFlags.IsClass||!this.type.isClass()?this.type.containedScope:this.type.instanceType.constructorScope},n.prototype.toString=function(){var e=this.type.getTypeName();return this.name&&(e=this.name+":"+e),e},n.prototype.isClass=function(){return null!=this.instanceType},n.prototype.isFunction=function(){return null!=this.declAST&&this.declAST.nodeType==e.NodeType.FuncDecl},n.prototype.specializeType=function(e,t,r){if(this.type==e)return t.symbol;var i=this.type.specializeType(e,t,r,!1);if(i!=this.type){var o=new n(this.name,-1,0,-1,i);return o}return this},n.prototype.getPrettyName=function(t){if(t&&e.isQuoted(this.prettyName)&&this.type.isModuleType()){var n=t.pathToRoot(),r=this.getPrettyNameOfDynamicModule(n);if(null!=r)return r.name}return this.prettyName},n.prototype.getPrettyNameOfDynamicModule=function(e){var t=e.length,n=null;if(e.length>0&&e[t-1].getType().isModuleType()&&e[t-1].isDynamic){if(t>1&&e[t-2].getType().isModuleType()&&e[t-2].isDynamic){var r=e[t-2].getType();n=r.findDynamicModuleName(this.type)}if(null==n){var r=e[t-1].getType();n=r.findDynamicModuleName(this.type)}}return n},n.prototype.getDocComments=function(){var e=[];null!=this.declAST&&(e=e.concat(this.declAST.getDocComments()));for(var t=0;t>=",e.ErrorRecoverySet.BinOp),t(i.GreaterThanGreaterThanGreaterThanEquals,s.None,o.Assignment,e.NodeType.AsgRs2,o.None,e.NodeType.None,">>>=",e.ErrorRecoverySet.BinOp),t(i.Question,s.None,o.Conditional,e.NodeType.ConditionalExpression,o.None,e.NodeType.None,"?",e.ErrorRecoverySet.BinOp),t(i.Colon,s.None,o.None,e.NodeType.None,o.None,e.NodeType.None,":",e.ErrorRecoverySet.Colon),t(i.BarBar,s.None,o.LogicalOr,e.NodeType.LogOr,o.None,e.NodeType.None,"||",e.ErrorRecoverySet.BinOp),t(i.AmpersandAmpersand,s.None,o.LogicalAnd,e.NodeType.LogAnd,o.None,e.NodeType.None,"&&",e.ErrorRecoverySet.BinOp),t(i.Bar,s.None,o.BitwiseOr,e.NodeType.Or,o.None,e.NodeType.None,"|",e.ErrorRecoverySet.BinOp),t(i.Caret,s.None,o.BitwiseExclusiveOr,e.NodeType.Xor,o.None,e.NodeType.None,"^",e.ErrorRecoverySet.BinOp),t(i.And,s.None,o.BitwiseAnd,e.NodeType.And,o.None,e.NodeType.None,"&",e.ErrorRecoverySet.BinOp),t(i.EqualsEquals,s.None,o.Equality,e.NodeType.Eq,o.None,e.NodeType.None,"==",e.ErrorRecoverySet.BinOp),t(i.ExclamationEquals,s.None,o.Equality,e.NodeType.Ne,o.None,e.NodeType.None,"!=",e.ErrorRecoverySet.BinOp),t(i.EqualsEqualsEquals,s.None,o.Equality,e.NodeType.Eqv,o.None,e.NodeType.None,"===",e.ErrorRecoverySet.BinOp),t(i.ExclamationEqualsEquals,s.None,o.Equality,e.NodeType.NEqv,o.None,e.NodeType.None,"!==",e.ErrorRecoverySet.BinOp),t(i.LessThan,s.None,o.Relational,e.NodeType.Lt,o.None,e.NodeType.None,"<",e.ErrorRecoverySet.BinOp),t(i.LessThanEquals,s.None,o.Relational,e.NodeType.Le,o.None,e.NodeType.None,"<=",e.ErrorRecoverySet.BinOp),t(i.GreaterThan,s.None,o.Relational,e.NodeType.Gt,o.None,e.NodeType.None,">",e.ErrorRecoverySet.BinOp),t(i.GreaterThanEquals,s.None,o.Relational,e.NodeType.Ge,o.None,e.NodeType.None,">=",e.ErrorRecoverySet.BinOp),t(i.LessThanLessThan,s.None,o.Shift,e.NodeType.Lsh,o.None,e.NodeType.None,"<<",e.ErrorRecoverySet.BinOp),t(i.GreaterThanGreaterThan,s.None,o.Shift,e.NodeType.Rsh,o.None,e.NodeType.None,">>",e.ErrorRecoverySet.BinOp),t(i.GreaterThanGreaterThanGreaterThan,s.None,o.Shift,e.NodeType.Rs2,o.None,e.NodeType.None,">>>",e.ErrorRecoverySet.BinOp),t(i.Plus,s.None,o.Additive,e.NodeType.Add,o.Unary,e.NodeType.Pos,"+",e.ErrorRecoverySet.AddOp),t(i.Minus,s.None,o.Additive,e.NodeType.Sub,o.Unary,e.NodeType.Neg,"-",e.ErrorRecoverySet.AddOp),t(i.Asterisk,s.None,o.Multiplicative,e.NodeType.Mul,o.None,e.NodeType.None,"*",e.ErrorRecoverySet.BinOp),t(i.Slash,s.None,o.Multiplicative,e.NodeType.Div,o.None,e.NodeType.None,"/",e.ErrorRecoverySet.BinOp),t(i.Percent,s.None,o.Multiplicative,e.NodeType.Mod,o.None,e.NodeType.None,"%",e.ErrorRecoverySet.BinOp),t(i.Tilde,s.None,o.None,e.NodeType.None,o.Unary,e.NodeType.Not,"~",e.ErrorRecoverySet.PreOp),t(i.Exclamation,s.None,o.None,e.NodeType.None,o.Unary,e.NodeType.LogNot,"!",e.ErrorRecoverySet.PreOp),t(i.PlusPlus,s.None,o.None,e.NodeType.None,o.Unary,e.NodeType.IncPre,"++",e.ErrorRecoverySet.PreOp),t(i.MinusMinus,s.None,o.None,e.NodeType.None,o.Unary,e.NodeType.DecPre,"--",e.ErrorRecoverySet.PreOp),t(i.OpenParen,s.None,o.None,e.NodeType.None,o.None,e.NodeType.None,"(",e.ErrorRecoverySet.LParen),t(i.OpenBracket,s.None,o.None,e.NodeType.None,o.None,e.NodeType.None,"[",e.ErrorRecoverySet.LBrack),t(i.Dot,s.None,o.Unary,e.NodeType.None,o.None,e.NodeType.None,".",e.ErrorRecoverySet.Dot),t(i.EndOfFile,s.None,o.None,e.NodeType.None,o.None,e.NodeType.None,"",e.ErrorRecoverySet.EOF),t(i.EqualsGreaterThan,s.None,o.None,e.NodeType.None,o.None,e.NodeType.None,"=>",e.ErrorRecoverySet.None),e.lookupToken=n,function(e){e._map=[],e._map[0]="Punctuation",e.Punctuation=0,e._map[1]="Keyword",e.Keyword=1,e._map[2]="Operator",e.Operator=2,e._map[3]="Comment",e.Comment=3,e._map[4]="Whitespace",e.Whitespace=4,e._map[5]="Identifier",e.Identifier=5,e._map[6]="NumberLiteral",e.NumberLiteral=6,e._map[7]="StringLiteral",e.StringLiteral=7,e._map[8]="RegExpLiteral",e.RegExpLiteral=8 }(e.TokenClass||(e.TokenClass={}));var l=e.TokenClass,c=function(){function e(e,t,n){this.tok=e,this.minChar=t,this.limChar=n}return e}();e.SavedToken=c;var u=function(){function t(e){this.tokenId=e}return t.prototype.toString=function(){return"token: "+this.tokenId+" "+this.getText()+" ("+i._map[this.tokenId]+")"},t.prototype.print=function(e,t){t.WriteLine(this.toString()+",on line"+e)},t.prototype.getText=function(){return e.tokenTable[this.tokenId].text},t.prototype.classification=function(){if(this.tokenId<=i.LimKeyword)return l.Keyword;var t=n(this.tokenId);return void 0==t||t.unopNodeType==e.NodeType.None&&t.binopNodeType==e.NodeType.None?l.Punctuation:l.Operator},t}();e.Token=u;var p=function(e){function t(t,n){e.call(this,i.NumberLiteral),this.value=t,this.text=n}return __extends(t,e),t.prototype.getText=function(){return this.text},t.prototype.classification=function(){return l.NumberLiteral},t}(u);e.NumberLiteralToken=p;var h=function(e){function t(t){e.call(this,i.StringLiteral),this.value=t}return __extends(t,e),t.prototype.getText=function(){return this.value},t.prototype.classification=function(){return l.StringLiteral},t}(u);e.StringLiteralToken=h;var d=function(e){function t(t,n){e.call(this,i.Identifier),this.value=t,this.hasEscapeSequence=n}return __extends(t,e),t.prototype.getText=function(){return this.value},t.prototype.classification=function(){return l.Identifier},t}(u);e.IdentifierToken=d;var f=function(e){function t(t,n){e.call(this,t),this.value=n}return __extends(t,e),t.prototype.getText=function(){return this.value},t.prototype.classification=function(){return l.Whitespace},t}(u);e.WhitespaceToken=f;var m=function(e){function t(t,n,r,i,o,s){e.call(this,t),this.value=n,this.isBlock=r,this.startPos=i,this.line=o,this.endsLine=s}return __extends(t,e),t.prototype.getText=function(){return this.value},t.prototype.classification=function(){return l.Comment},t}(u);e.CommentToken=m;var g=function(e){function t(t){e.call(this,i.RegularExpressionLiteral),this.text=t}return __extends(t,e),t.prototype.getText=function(){return this.text},t.prototype.classification=function(){return l.RegExpLiteral},t}(u);e.RegularExpressionLiteralToken=g,e.staticTokens=new Array,e.initializeStaticTokens=r}(TypeScript||(TypeScript={}));var TypeScript;!function(e){var t=function(){function e(){this.arrayBase=null}return e.prototype.specialize=function(e,t){return null==this.arrayBase&&(this.arrayBase=e.specializeType(t.wildElm.type,this.arrayType.elementType,t,!0)),this.arrayBase},e}();e.ArrayCache=t;var n=function(){function t(){this.onlyCaptureFirstError=!1,this.flags=e.TypeRelationshipFlags.SuccessfulComparison,this.message=""}return t.prototype.addMessageToFront=function(e){this.onlyCaptureFirstError?this.setMessage(e):this.message=this.message?e+":\n "+this.message:e},t.prototype.setMessage=function(e){this.message=e},t}();e.TypeComparisonInfo=n,function(e){e._map=[],e._map[0]="Resident",e.Resident=0,e._map[1]="Transient",e.Transient=1}(e.TypeCheckCollectionMode||(e.TypeCheckCollectionMode={}));var r=e.TypeCheckCollectionMode,i=function(){function t(t){this.errorReporter=t,this.importedGlobalsTable=new e.ScopedMembers(new e.DualStringHashTable(new e.StringHashTable,new e.StringHashTable)),this.importedGlobalsTypeTable=new e.ScopedMembers(new e.DualStringHashTable(new e.StringHashTable,new e.StringHashTable)),this.globals=null,this.globalTypes=null,this.ambientGlobals=null,this.ambientGlobalTypes=null,this.residentGlobalValues=new e.StringHashTable,this.residentGlobalTypes=new e.StringHashTable,this.residentGlobalAmbientValues=new e.StringHashTable,this.residentGlobalAmbientTypes=new e.StringHashTable,this.residentTypeCheck=!0,this.mod=null,this.gloMod=null,this.wildElm=null,this.importedGlobals=new e.SymbolScopeBuilder(null,this.importedGlobalsTable,null,this.importedGlobalsTypeTable,null,null),this.dualGlobalValues=new e.DualStringHashTable(this.residentGlobalValues,new e.StringHashTable),this.dualGlobalTypes=new e.DualStringHashTable(this.residentGlobalTypes,new e.StringHashTable),this.dualAmbientGlobalValues=new e.DualStringHashTable(this.residentGlobalAmbientValues,new e.StringHashTable),this.dualAmbientGlobalTypes=new e.DualStringHashTable(this.residentGlobalAmbientTypes,new e.StringHashTable);var n=new e.ScopedMembers(new e.DualStringHashTable(this.dualGlobalValues,new e.StringHashTable)),i=new e.ScopedMembers(new e.DualStringHashTable(this.dualAmbientGlobalValues,new e.StringHashTable)),o=new e.ScopedMembers(new e.DualStringHashTable(this.dualGlobalTypes,new e.StringHashTable)),s=new e.ScopedMembers(new e.DualStringHashTable(this.dualAmbientGlobalTypes,new e.StringHashTable));this.globalScope=new e.SymbolScopeBuilder(n,i,o,s,this.importedGlobals,null),this.voidType=this.enterPrimitive(e.Primitive.Void,"void"),this.booleanType=this.enterPrimitive(e.Primitive.Boolean,"bool"),this.doubleType=this.enterPrimitive(e.Primitive.Double,"number"),this.importedGlobals.ambientEnclosedTypes.addPublicMember("number",this.doubleType.symbol),this.stringType=this.enterPrimitive(e.Primitive.String,"string"),this.anyType=this.enterPrimitive(e.Primitive.Any,"any"),this.nullType=this.enterPrimitive(e.Primitive.Null,"null"),this.undefinedType=this.enterPrimitive(e.Primitive.Undefined,"undefined"),this.setCollectionMode(r.Resident),this.wildElm=new e.TypeSymbol("_element",-1,0,-1,new e.Type),this.importedGlobalsTypeTable.addPublicMember(this.wildElm.name,this.wildElm),this.mod=new e.ModuleType(o,s),this.mod.members=n,this.mod.ambientMembers=i,this.mod.containedScope=this.globalScope,this.gloMod=new e.TypeSymbol(e.globalId,-1,0,-1,this.mod),this.mod.members.addPublicMember(this.gloMod.name,this.gloMod),this.defineGlobalValue("undefined",this.undefinedType)}return t.prototype.enterPrimitive=function(t,n){var r=new e.Type;r.primitiveTypeClass=t;var i=new e.TypeSymbol(n,-1,n.length,-1,r);return i.typeCheckStatus=e.TypeCheckStatus.Finished,r.symbol=i,this.importedGlobals.enter(null,null,i,this.errorReporter,!0,!0,!0),r},t.prototype.setCollectionMode=function(e){this.residentTypeCheck=this.dualGlobalValues.insertPrimary=this.dualGlobalTypes.insertPrimary=this.dualAmbientGlobalValues.insertPrimary=this.dualAmbientGlobalTypes.insertPrimary=e==r.Resident},t.prototype.refreshPersistentState=function(){this.globals=new e.StringHashTable,this.globalTypes=new e.StringHashTable,this.ambientGlobals=new e.StringHashTable,this.ambientGlobalTypes=new e.StringHashTable,this.globalTypes.add(this.voidType.symbol.name,this.voidType.symbol),this.globalTypes.add(this.booleanType.symbol.name,this.booleanType.symbol),this.globalTypes.add(this.doubleType.symbol.name,this.doubleType.symbol),this.globalTypes.add("number",this.doubleType.symbol),this.globalTypes.add(this.stringType.symbol.name,this.stringType.symbol),this.globalTypes.add(this.anyType.symbol.name,this.anyType.symbol),this.globalTypes.add(this.nullType.symbol.name,this.nullType.symbol),this.globalTypes.add(this.undefinedType.symbol.name,this.undefinedType.symbol),this.dualGlobalValues.secondaryTable=this.globals,this.dualGlobalTypes.secondaryTable=this.globalTypes,this.dualAmbientGlobalValues.secondaryTable=this.ambientGlobals,this.dualAmbientGlobalTypes.secondaryTable=this.ambientGlobalTypes},t.prototype.defineGlobalValue=function(t,n){var r=new e.ValueLocation;r.typeLink=new e.TypeLink;var i=new e.VariableSymbol(t,0,-1,r);i.setType(n),i.typeCheckStatus=e.TypeCheckStatus.Finished,i.container=this.gloMod,this.importedGlobalsTable.addPublicMember(t,i)},t}();e.PersistentGlobalTypeState=i;var o=function(){function e(e,t,n){this.contextualType=e,this.provisional=t,this.contextID=n,this.targetSig=null,this.targetThis=null,this.targetAccessorType=null}return e}();e.ContextualTypeContext=o;var s=function(){function t(e){this.checker=e,this.contextStack=[],this.hadProvisionalErrors=!1}return t.contextID=e.TypeCheckStatus.Finished+1,t.prototype.pushContextualType=function(e,n){this.contextStack.push(new o(e,n,t.contextID++)),this.checker.errorReporter.pushToErrorSink=n},t.prototype.popContextualType=function(){var e=this.contextStack.pop();return this.checker.errorReporter.pushToErrorSink=this.isProvisional(),this.hadProvisionalErrors=this.hadProvisionalErrors||e.provisional&&this.checker.errorReporter.getCapturedErrors().length,this.checker.errorReporter.freeCapturedErrors(),e},t.prototype.getContextualType=function(){return this.contextStack.length?this.contextStack[this.contextStack.length-1]:null},t.prototype.getContextID=function(){return this.contextStack.length?this.contextStack[this.contextStack.length-1].contextID:e.TypeCheckStatus.Finished},t.prototype.isProvisional=function(){return this.contextStack.length?this.contextStack[this.contextStack.length-1].provisional:!1},t}();e.ContextualTypingContextStack=s;var a=function(){function n(e){this.persistentState=e,this.errorReporter=null,this.checkControlFlow=!1,this.printControlFlowGraph=!1,this.checkControlFlowUseDef=!1,this.styleSettings=null,this.units=null,this.anon="_anonymous",this.locationInfo=null,this.typeFlow=null,this.currentCompareA=null,this.currentCompareB=null,this.currentModDecl=null,this.inBind=!1,this.inWith=!1,this.errorsOnWith=!0,this.currentContextualTypeContext=null,this.resolvingBases=!1,this.canCallDefinitionSignature=!1,this.assignableCache={},this.subtypeCache={},this.identicalCache={},this.provisionalStartedTypecheckObjects=[],this.mustCaptureGlobalThis=!1,this.voidType=this.persistentState.voidType,this.booleanType=this.persistentState.booleanType,this.numberType=this.persistentState.doubleType,this.stringType=this.persistentState.stringType,this.anyType=this.persistentState.anyType,this.nullType=this.persistentState.nullType,this.undefinedType=this.persistentState.undefinedType,this.globals=this.persistentState.dualGlobalValues,this.globalTypes=this.persistentState.dualGlobalTypes,this.ambientGlobals=this.persistentState.dualAmbientGlobalValues,this.ambientGlobalTypes=this.persistentState.dualAmbientGlobalTypes,this.gloModType=this.persistentState.mod,this.gloMod=this.persistentState.gloMod,this.wildElm=this.persistentState.wildElm,this.globalScope=this.persistentState.globalScope,this.typingContextStack=new s(this)}return n.prototype.setStyleOptions=function(e){this.styleSettings=e},n.prototype.setContextualType=function(e,t){this.typingContextStack.pushContextualType(e,t),this.currentContextualTypeContext=this.typingContextStack.getContextualType()},n.prototype.unsetContextualType=function(){var e=this.typingContextStack.popContextualType();return this.currentContextualTypeContext=this.typingContextStack.getContextualType(),e},n.prototype.hadProvisionalErrors=function(){return this.typingContextStack.hadProvisionalErrors},n.prototype.resetProvisionalErrors=function(){this.typingContextStack.getContextualType()||(this.typingContextStack.hadProvisionalErrors=!1)},n.prototype.typeCheckWithContextualType=function(e,t,n,r){n&&this.setContextualType(e,this.typingContextStack.isProvisional()||t),this.typeFlow.typeCheck(r),n&&this.unsetContextualType()},n.prototype.resetTargetType=function(){this.currentContextualTypeContext=this.typingContextStack.getContextualType()},n.prototype.killCurrentContextualType=function(){this.currentContextualTypeContext=null,this.errorReporter.pushToErrorSink=!1},n.prototype.hasTargetType=function(){return this.currentContextualTypeContext&&this.currentContextualTypeContext.contextualType},n.prototype.getTargetTypeContext=function(){return this.currentContextualTypeContext},n.prototype.inProvisionalTypecheckMode=function(){return this.typingContextStack.isProvisional()},n.prototype.getTypeCheckFinishedStatus=function(){return this.inProvisionalTypecheckMode()?this.typingContextStack.getContextID():e.TypeCheckStatus.Finished},n.prototype.typeStatusIsFinished=function(t){return t==e.TypeCheckStatus.Finished||this.inProvisionalTypecheckMode()&&t==this.typingContextStack.getContextID()},n.prototype.addStartedPTO=function(e){this.inProvisionalTypecheckMode()&&(this.provisionalStartedTypecheckObjects[this.provisionalStartedTypecheckObjects.length]=e)},n.prototype.cleanStartedPTO=function(){for(var t=0;t=this.typingContextStack.getContextID()&&(this.provisionalStartedTypecheckObjects[t].typeCheckStatus=e.TypeCheckStatus.NotStarted);this.provisionalStartedTypecheckObjects=[]},n.prototype.collectTypes=function(t){if(t.nodeType==e.NodeType.Script){var n=t;this.locationInfo=n.locationInfo}var r=new e.ScopeChain(this.gloMod,null,this.globalScope),i=new e.TypeCollectionContext(r,this);e.getAstWalkerFactory().walk(t,e.preCollectTypes,e.postCollectTypes,null,i)},n.prototype.makeArrayType=function(n){return null==n.arrayCache&&(n.arrayCache=new t,n.arrayCache.arrayType=new e.Type,n.arrayCache.arrayType.elementType=n,n.arrayCache.arrayType.symbol=n.symbol),n.arrayCache.arrayType},n.prototype.getParameterList=function(t,n){var r=t.arguments,i=null,o=null,s=r.members.length,a=0,l=[];if(s>0){i=new e.ScopedMembers(new e.DualStringHashTable(new e.StringHashTable,new e.StringHashTable)),o=new e.SymbolScopeBuilder(i,null,null,null,null,n);for(var c=0;s>c;c++){var u=r.members[c],p=new e.ValueLocation,h=new e.ParameterSymbol(u.id.text,u.minChar,this.locationInfo.unitIndex,p);h.declAST=u,h.funcDecl=t,u.id.sym=h,u.sym=h,p.symbol=h,p.typeLink=e.getTypeLink(u.typeExpr,this,!1),o.enter(null,u,h,this.errorReporter,!0,!1,!1),l[l.length]=h,u.isOptionalArg()||a++}}return{parameters:l,nonOptionalParameterCount:a}},n.prototype.createFunctionSignature=function(t,n,r,i,o){var s=e.hasFlag(t.fncFlags,e.FncFlags.Exported|e.FncFlags.ClassPropertyMethodExported)||n==this.gloMod,a=e.hasFlag(t.fncFlags,e.FncFlags.Static),l=e.hasFlag(t.fncFlags,e.FncFlags.Private),c=!e.hasFlag(t.fncFlags,e.FncFlags.Signature),u=e.hasFlag(t.fncFlags,e.FncFlags.Ambient),p=t.isConstructMember()||t.isConstructor,h=n==this.gloMod,d=new e.Signature,f=t.fncFlags&e.FncFlags.IsFunctionExpression;t.returnTypeAnnotation||c?d.returnType=e.getTypeLink(t.returnTypeAnnotation,this,!1):(d.returnType=new e.TypeLink,d.returnType.type=this.anyType),d.hasVariableArgList=t.variableArgList;var m=this.getParameterList(t,n);d.parameters=m.parameters,d.nonOptionalParameterCount=m.nonOptionalParameterCount,t.signature=d,d.declAST=t;var g=i&&i.getType()&&!i.isAccessor()&&(t.isSignature()||u==e.hasFlag(i.flags,e.SymbolFlags.Ambient));g&&l!=e.hasFlag(i.flags,e.SymbolFlags.Private)&&this.errorReporter.simpleError(t,"Public/Private visibility of overloads does not agree");var y=g?i.getType():new e.Type;p?(null==y.construct&&(y.construct=new e.SignatureGroup),y.construct.addSignature(d),y.construct.hasImplementation=!t.isSignature(),y.construct.hasImplementation&&y.setHasImplementation()):t.isIndexerMember()?(null==y.index&&(y.index=new e.SignatureGroup,y.index.flags|=e.SignatureFlags.IsIndexer),y.index.addSignature(d),y.index.hasImplementation=!t.isSignature(),y.index.hasImplementation&&y.setHasImplementation()):(null==y.call&&(y.call=new e.SignatureGroup),y.call.addSignature(d),y.call.hasImplementation=!t.isSignature(),y.call.hasImplementation&&y.setHasImplementation());var v=y.instanceType,T=null,b=!1;if(t.name&&!t.name.isMissing()?T=t.name.text:t.hint&&(T=t.hint,b=!0),null==y.symbol&&(y.symbol=new e.TypeSymbol(T?T:this.anon,t.minChar,t.limChar-t.minChar,this.locationInfo.unitIndex,y),g||(y.symbol.declAST=t)),a&&(y.symbol.flags|=e.SymbolFlags.Static),u&&(y.symbol.flags|=e.SymbolFlags.Ambient),l&&(y.symbol.flags|=e.SymbolFlags.Private),y.symbol.isMethod=t.isMethod(),y.symbol.isMethod&&(y.symbol.flags|=e.SymbolFlags.Property),t.type=y,p||(!T||f||t.isAccessor()||b?t.isSpecialFn()||(y.symbol.container=n):o?t.isMethod()&&a?(n.type.members.publicMembers.add(T,y.symbol)||this.errorReporter.duplicateIdentifier(t,T),y.symbol.container=n):(null==i||i.declAST&&!i.declAST.isOverload&&n.isType())&&r.enter(n,t,y.symbol,this.errorReporter,!l&&(s||a||h),!1,u):t.isSpecialFn()||(y.symbol.container=n)),g){var k=i?i.getType():null,S=y;if(S!=k&&(null==S.construct?S.construct=k&&k.construct?k.construct:new e.SignatureGroup:k&&k.construct&&S.construct.signatures.concat(k.construct.signatures),k)){if(null==S.call?S.call=k.call:k.call&&S.call.signatures.concat(k.call.signatures),!a){null==S.instanceType&&(S.instanceType=k.instanceType);var v=S.instanceType;v&&(null==v.call?v.call=k.call:k.call&&v.call.signatures.concat(k.call.signatures))}null==S.index?S.index=k.index:k.index&&S.index.signatures.concat(k.index.signatures)}}return d},n.prototype.createAccessorSymbol=function(t,n,r,i,o,s,a){var l=null,c=t.signature,u=t.name.text,p=e.hasFlag(t.fncFlags,e.FncFlags.Static),h=e.hasFlag(t.fncFlags,e.FncFlags.Private);if(null==n){var d=new e.ValueLocation;l=new e.FieldSymbol(u,t.minChar,this.locationInfo.unitIndex,!1,d),d.symbol=l,l.declAST=t,e.hasFlag(t.fncFlags,e.FncFlags.GetAccessor)?(l.getter&&this.errorReporter.simpleError(t,"Redeclaration of property getter"),l.getter=c.declAST.type.symbol):(l.setter&&this.errorReporter.simpleError(t,"Redeclaration of property setter"),l.setter=c.declAST.type.symbol),d.typeLink=e.getTypeLink(null,this,!1),i?r?(r.members.publicMembers.add(u,l)||this.errorReporter.duplicateIdentifier(t,l.name),l.container=r.symbol):this.errorReporter.simpleError(t,"Accessor property may not be added in this context"):s.enter(a,t,l,this.errorReporter,!h||p,!1,!1),o&&(l.flags|=e.SymbolFlags.Property),p&&(l.flags|=e.SymbolFlags.Static),l.flags|=h?e.SymbolFlags.Private:e.SymbolFlags.Public}else l=n,h!=e.hasFlag(l.flags,e.SymbolFlags.Private)&&this.errorReporter.simpleError(t,"Getter and setter accessors do not agree in visibility"),e.hasFlag(t.fncFlags,e.FncFlags.GetAccessor)?(l.getter&&this.errorReporter.simpleError(t,"Redeclaration of property getter"),l.getter=t.type.symbol):(l.setter&&this.errorReporter.simpleError(t,"Redeclaration of property setter"),l.setter=t.type.symbol);return l},n.prototype.addBases=function(t,n,r){t.addParentScope(new e.SymbolTableScope(n.members,n.ambientMembers,n.getAllEnclosedTypes(),n.getAllAmbientEnclosedTypes(),n.symbol));var i,o=0;if(n.extendsList)for(var s=n.extendsList.length;s>o;o++){if(i=n.extendsList[o],r.baseId==i.typeID){this.errorReporter.reportErrorFromSym(i.symbol,"Type '"+r.base+"' is recursively referenced as a base class of itself"),i.symbol.flags|=e.SymbolFlags.RecursivelyReferenced;break}this.addBases(t,i,r)}},n.prototype.scopeOf=function(t){var n=new e.SymbolAggregateScope(t.symbol),r={base:t.symbol&&t.symbol.name?t.symbol.name:"{}",baseId:t.typeID};return this.addBases(n,t,r),n},n.prototype.lookupMemberTypeSymbol=function(e,t){var n=null;if(e.containedScope?n=e.containedScope.find(t,!1,!0):e.members&&(n=e.members.allMembers.lookup(t),null==n&&e.ambientMembers&&(n=e.ambientMembers.allMembers.lookup(t))),null==n||!n.isType()){var r=e.getAllEnclosedTypes(),i=e.getAllAmbientEnclosedTypes();r&&(n=r.allMembers.lookup(t),null==n&&i&&(n=i.allMembers.lookup(t)))}return n&&n.isType()?n:null},n.prototype.setBasepath=function(e){"/"!==e.charAt(e.length-1)&&(e+="/"),this.basepath=e},n.prototype.findSymbolForDynamicModule=function(t,n,r){var i=t,o=r(t);if(null==o&&(o||(t=e.swapQuotes(i),o=r(t)),o||(t=e.stripQuotes(i)+".ts",o=r(t)),o||(t=e.stripQuotes(i)+".str",o=r(t)),o||(t=e.stripQuotes(i)+".d.ts",o=r(t)),o||(t=e.stripQuotes(i)+".d.str",o=r(t)),!o&&!e.isRelative(i))){t=i;var s=e.stripQuotes(t),a=e.getRootFilePath(e.switchToForwardSlashes(n)),l="";for(0===a.indexOf(this.basepath)&&(a=a.substring(this.basepath.length),l=this.basepath);null==o&&null!==a;)t=l+e.normalizePath(a+s+".ts"),o=r(t),null==o&&(t=e.changePathToSTR(t),o=r(t)),null==o&&(t=e.changePathToDTS(t),o=r(t)),null==o&&(t=e.changePathToDSTR(t),o=r(t)),null==o&&("/"===a||e.isInvalidPath(a)?a=null:(a=e.normalizePath(a+".."),a=a&&"/"!=a?a+"/":a))}return o},n.prototype.resolveTypeMember=function(t,n){var r=n.operand1,i=n.operand2,o=this.anyType,s=this.anyType;if(r&&i&&i.nodeType==e.NodeType.Name){if(r.nodeType==e.NodeType.Dot)s=this.resolveTypeMember(t,r);else if(r.nodeType==e.NodeType.Name){var a=r,l=t.find(a.text,!1,!0);if(null==l)this.errorReporter.unresolvedSymbol(a,a.actualText);else if(l.isType()){var c=l;if(c.aliasLink&&!c.type&&c.aliasLink.alias.nodeType==e.NodeType.Name){var u=c.aliasLink.alias.text,p=this.findSymbolForDynamicModule(u,this.locationInfo.filename,function(e){return t.find(e,!1,!0)});p&&(c.type=p.getType())}if(e.optimizeModuleCodeGen&&l){var h=l.getType();if(h&&c.aliasLink&&c.onlyReferencedAsTypeRef){var d=h.symbol.declAST;d&&e.hasFlag(d.modFlags,e.ModuleFlags.IsDynamic)&&(c.onlyReferencedAsTypeRef=!this.resolvingBases)}}l.visible(t,this)||this.errorReporter.simpleError(r,"The symbol '"+a.actualText+"' is not visible at this point"),s=l.getType(),a.sym=l}else this.errorReporter.simpleError(r,"Expected type")}if(s||(s=this.anyType),s!=this.anyType){var f=i,m=this.lookupMemberTypeSymbol(s,f.text);null==m?(o=this.anyType,this.errorReporter.simpleError(n,"Expected type")):(o=m.getType(),m.visible(t,this)||this.errorReporter.simpleError(r,"The symbol '"+i.actualText+"' is not visible at this point")),f.sym=o.symbol}}return o.isClass()&&(o=o.instanceType),o},n.prototype.resolveFuncDecl=function(e,t,n){var r,i=this.createFunctionSignature(e,t.container,t,n,!1).declAST.type.symbol;r=e.isConstructMember()?i.type.construct.signatures:e.isIndexerMember()?i.type.getInstanceType().index.signatures:i.type.call.signatures;for(var o=r[r.length-1],s=o.parameters.length,a=0;s>a;a++){var l=o.parameters[a];this.resolveTypeLink(t,l.parameter.typeLink,!0)}return s&&e.variableArgList&&(o.parameters[s-1].parameter.typeLink.type.elementType||(this.errorReporter.simpleErrorFromSym(o.parameters[s-1].parameter.symbol,"... parameter must have array type"),o.parameters[s-1].parameter.typeLink.type=this.makeArrayType(o.parameters[s-1].parameter.typeLink.type))),this.resolveTypeLink(t,o.returnType,e.isSignature()),i},n.prototype.resolveVarDecl=function(t,n){var r=new e.ValueLocation,i=new e.FieldSymbol(t.id.text,t.minChar,this.locationInfo.unitIndex,(t.varFlags&e.VarFlags.Readonly)==e.VarFlags.None,r);return i.transferVarFlags(t.varFlags),r.symbol=i,i.declAST=t,r.typeLink=e.getTypeLink(t.typeExpr,this,null==t.init),this.resolveTypeLink(n,r.typeLink,!0),t.sym=i,t.type=r.typeLink.type,i},n.prototype.resolveTypeLink=function(t,n,r){var i=0;if(null==n.type){var o=n.ast;if(o)for(;null==n.type;)switch(o.nodeType){case e.NodeType.Name:var s=o,a=t.find(s.text,!1,!0);null==a?(n.type=this.anyType,this.errorReporter.unresolvedSymbol(s,s.actualText)):a.isType()?(a.visible(t,this)||this.errorReporter.simpleError(o,"The symbol '"+s.actualText+"' is not visible at this point"),s.sym=a,n.type=a.getType(),n.type?n.type.isClass()&&(n.type=n.type.instanceType):n.type=this.anyType):(n.type=this.anyType,this.errorReporter.simpleError(o,"Expected type"));break;case e.NodeType.Dot:n.type=this.resolveTypeMember(t,o);break;case e.NodeType.TypeRef:var l=o;i=l.arrayCount,o=l.term,null==o&&(n.type=this.anyType);break;case e.NodeType.InterfaceDeclaration:var c=o,u=new e.Type,p=new e.TypeSymbol(c.name.text,o.minChar,o.limChar-o.minChar,this.locationInfo.unitIndex,u);u.symbol=p,u.members=new e.ScopedMembers(new e.DualStringHashTable(new e.StringHashTable,new e.StringHashTable)),u.containedScope=new e.SymbolTableScope(u.members,null,null,null,p),u.containedScope.container=p,u.memberScope=u.containedScope;for(var h=c.members,d=h.members,f=d.length,m=0;f>m;m++){var g=d[m],y=null,v=!0,T=null;if(g.nodeType==e.NodeType.FuncDecl){var b=g;T=b.name,y=u.members.allMembers.lookup(b.getNameText()),v=null==y,b.isSpecialFn()?(v=!1,y=this.resolveFuncDecl(b,t,p)):y=this.resolveFuncDecl(b,t,y),b.type=y.type}else T=g.id,y=this.resolveVarDecl(g,t),v=!T.isMissing();v&&(T&&e.hasFlag(T.flags,e.ASTFlags.OptionalName)&&(y.flags|=e.SymbolFlags.Optional),u.members.allMembers.add(y.name,y)||this.errorReporter.duplicateIdentifier(o,y.name))}o.type=u,n.type=u;break;case e.NodeType.FuncDecl:var k=this.resolveFuncDecl(o,t,null);n.type=k.type;break;default:n.type=this.anyType,this.errorReporter.simpleError(o,"Expected type")}for(var S=i;S>0;S--)n.type=this.makeArrayType(n.type);r&&null==n.type&&(n.type=this.anyType),n.ast&&(n.ast.type=n.type)}},n.prototype.resolveBaseTypeLink=function(e,t){this.resolvingBases=!0,this.resolveTypeLink(t,e,!0),this.resolvingBases=!1;var n=null;return n=e.type.isClass()?e.type.instanceType:e.type},n.prototype.findMostApplicableSignature=function(e,t){if(1==e.length)return{sig:e[0].signature,ambiguous:!1};for(var n=e[0],r=null,i=null,o=null,s=null,a=!1,l=1;l=t[l].parameters.length)&&(o=t[l].parameters[c].getType(),t[l].declAST.variableArgList&&c>=t[l].nonOptionalParameterCount-1&&o.isArray()&&(o=o.elementType),o!=this.anyType))if(n.members[c].nodeType==e.NodeType.FuncDecl){if(this.typeFlow.functionInterfaceType&&o==this.typeFlow.functionInterfaceType)continue;if(this.canContextuallyTypeFunction(o,n.members[c],!0)){if(this.typeCheckWithContextualType(o,!0,!0,n.members[c]),this.cleanStartedPTO(),a=this.hadProvisionalErrors(),this.sourceIsAssignableToTarget(n.members[c].type,o,r)||(r&&r.setMessage("Could not apply type '"+o.getTypeName()+"' to argument "+(c+1)+", which is of type '"+n.members[c].type.getTypeName()+"'"),s=!0),this.resetProvisionalErrors(),s)break}else{if(!this.canContextuallyTypeFunction(o,n.members[c],!1))break;if(this.typeFlow.typeCheck(n.members[c]),!this.sourceIsAssignableToTarget(n.members[c].type,o,r))break}}else if(n.members[c].nodeType==e.NodeType.ObjectLit){if(this.typeFlow.objectInterfaceType&&o==this.typeFlow.objectInterfaceType)continue;if(this.typeCheckWithContextualType(o,!0,!0,n.members[c]),this.cleanStartedPTO(),a=this.hadProvisionalErrors(),this.sourceIsAssignableToTarget(n.members[c].type,o,r)||(r&&r.setMessage("Could not apply type '"+o.getTypeName()+"' to argument "+(c+1)+", which is of type '"+n.members[c].type.getTypeName()+"'"),s=!0),this.resetProvisionalErrors(),s)break}else if(n.members[c].nodeType==e.NodeType.ArrayLit){if(this.typeFlow.arrayInterfaceType&&o==this.typeFlow.arrayInterfaceType)continue;if(this.typeCheckWithContextualType(o,!0,!0,n.members[c]),this.cleanStartedPTO(),a=this.hadProvisionalErrors(),!this.sourceIsAssignableToTarget(n.members[c].type,o,r)){r&&r.setMessage("Could not apply type '"+o.getTypeName()+"' to argument "+(c+1)+", which is of type '"+n.members[c].type.getTypeName()+"'");break}if(this.resetProvisionalErrors(),s)break}c==n.members.length&&(i[i.length]={signature:t[l],hadProvisionalErrors:a}),a=!1}return i},n.prototype.canContextuallyTypeFunction=function(e,t,n){if(t.isParenthesized||t.isMethod()||n&&t.returnTypeAnnotation||t.isInlineCallLiteral)return!1;if(n=n||this.typeFlow.functionInterfaceType==e,!n)return!0;t.signature||(this.createFunctionSignature(t,this.typeFlow.scope.container,this.typeFlow.scope,null,null),this.typeFlow.typeCheck(t));for(var r=t.signature,i=r.parameters.length,o=0;i>o;o++){var s=r.parameters[o],a=s,l=a.declAST;if(n&&l.typeExpr)return!1}if(e.construct&&e.call)return!1;var c=e.construct?e.construct:e.call;return!c||c.signatures.length>1?!1:!0},n.prototype.canContextuallyTypeObjectLiteral=function(t,n){if(t==this.typeFlow.objectInterfaceType)return!0;var r=n.operand;if(!r||!t.memberScope)return!1;for(var i=null,o=null,s="",a={},l=0;la;){for(o=0;s>o;o++)if(o!=a){if(c&&(l=c.mergeOrdered(n.getTypeAtIndex(o),this,r,i))&&(c=l),l==this.anyType||null==l)break;t&&n.setTypeAtIndex(o,t)}if(c&&l)break;a++,s>a&&(c=n.getTypeAtIndex(a))}return r?l:l==this.voidType?null:l},n.prototype.typesAreIdentical=function(t,n){if(t==n)return!0;if(!t||!n)return!1;if(t.isClass()||t.isClassInstance())return!1;var r=n.typeID<<16|t.typeID;if(this.identicalCache[r])return!0;if(t.typeFlags&e.TypeFlags.IsEnum||n.typeFlags&e.TypeFlags.IsEnum)return!1;if(t.isArray()||n.isArray()){if(!t.isArray()||!n.isArray())return!1;this.identicalCache[r]=!1;var i=this.typesAreIdentical(t.elementType,n.elementType);return this.subtypeCache[r]=i?!0:void 0,i}if(t.primitiveTypeClass!=n.primitiveTypeClass)return!1;if(this.identicalCache[r]=!1,t.memberScope&&n.memberScope){var o=t.memberScope.getAllValueSymbolNames(!0).sort(),s=n.memberScope.getAllValueSymbolNames(!0).sort();if(o.length!=s.length)return this.identicalCache[r]=void 0,!1;for(var a=null,l=null,c=null,u=null,p=0;ps&&!n.hasVariableArgList)return o&&(o.flags|=e.TypeRelationshipFlags.SourceSignatureHasTooManyParameters,o.addMessageToFront("Call signature expects "+s+" or fewer parameters")),!1;var l=t.returnType.type,c=n.returnType.type;if(c!=this.voidType&&!this.sourceIsRelatableToTarget(l,c,r,i,o))return o&&(o.flags|=e.TypeRelationshipFlags.IncompatibleReturnTypes),!1;for(var u=s>a&&t.hasVariableArgList?s:a,p=null,h=null,d="",f="",m=0,g=0;u>m;m++,g++)if(!t.hasVariableArgList||a>m?(p=t.parameters[m].parameter.typeLink.type,d=t.parameters[m].parameter.symbol.name):m==a&&(p=t.parameters[m].parameter.typeLink.type,p.elementType&&(p=p.elementType),d=t.parameters[m].parameter.symbol.name),gg?(h=n.parameters[g].parameter.typeLink.type,f=n.parameters[g].parameter.symbol.name):n.hasVariableArgList&&g==s&&(h=n.parameters[g].parameter.typeLink.type,h.elementType&&(h=h.elementType),f=n.parameters[g].parameter.symbol.name),!this.sourceIsRelatableToTarget(p,h,r,i,o)&&!this.sourceIsRelatableToTarget(h,p,r,i,o))return o&&(o.flags|=e.TypeRelationshipFlags.IncompatibleParameterTypes),!1;return!0},n}();e.TypeChecker=a}(TypeScript||(TypeScript={}));var TypeScript;!function(e){function t(t,n){if(t){var r=t.members.length;null==n&&(n=new Array);for(var i=0;r>i;i++){var o=t.members[i],s=o,a=new e.TypeLink;a.ast=s,n[n.length]=a}}return n}function n(e,n){e.extendsTypeLinks=t(n.extendsList,e.extendsTypeLinks),e.implementsTypeLinks=t(n.implementsList,e.implementsTypeLinks)}function r(t,n,r){var i=new e.ValueLocation;i.typeLink=new e.TypeLink,i.typeLink.ast=n,i.typeLink.type=t.instanceType;var o=new e.FieldSymbol("prototype",n.minChar,r.checker.locationInfo.unitIndex,!0,i);o.flags|=e.SymbolFlags.Property|e.SymbolFlags.BuiltIn,i.symbol=o,o.declAST=n,t.members.addPublicMember("prototype",o)}function i(t){var n=new e.Signature;n.returnType=new e.TypeLink,n.returnType.type=t.instanceType,n.parameters=[],t.construct=new e.SignatureGroup,t.construct.addSignature(n)}function o(t,n){t.construct=new e.SignatureGroup;var r=null;n.construct||i(n);for(var o=0;ot;t++){var r=this.bb.successors[t];r.useDef&&e.union(r.useDef.top)}e.difference(this.kill),e.union(this.gen);var o=e.notEq(this.top);return this.top=e,o},t.prototype.initialize=function(t){function n(t,n,r){var s=r.state;if(null==t&&(t=null),t.nodeType==e.NodeType.VarDecl){var a=t;(a.init||e.hasFlag(a.varFlags,e.VarFlags.AutoInit))&&i(a.sym,s)}else if(t.nodeType==e.NodeType.Name){if(n)if(n.nodeType==e.NodeType.Asg){var l=n;if(l.operand1==t)return t}else if(n.nodeType==e.NodeType.VarDecl){var c=n;if(c.id==t)return t}var u=t;o(u.sym,s,t)}else if(t.nodeType>=e.NodeType.Asg&&t.nodeType<=e.NodeType.LastAsg){var l=t;if(l.operand1&&l.operand1.nodeType==e.NodeType.Name){var u=l.operand1;i(u.sym,s)}}else t.nodeType==e.NodeType.FuncDecl&&(r.options.goChildren=!1);return t}var r=this,i=function(e,t){if(t.isLocalSym(e)){var n=t.getSymbolIndex(e);r.useIndexBySymbol[n]=new Array,r.defsBySymbol[n]=!0}},o=function(e,t,n){if(t.isLocalSym(e)){var i=t.getSymbolIndex(e);void 0==r.useIndexBySymbol[i]&&(r.useIndexBySymbol[i]=new Array);var o=r.useIndexBySymbol[i],s=t.getUseIndex(n);t.addUse(i,s),o.push(s)}},s=new e.AstWalkOptions;s.reverseSiblings=!0,e.getAstWalkerFactory().walk(this.bb.content,n,null,s,t)},t.prototype.initializeGen=function(e){var t=this.useIndexBySymbol.length,n=e.uses.length;this.gen=new i(n);for(var r=0;t>r;r++){var o=this.useIndexBySymbol[r];if(void 0!=o&&o.length>0)for(var s=0,a=o.length;a>s;s++)this.gen.set(o[s],!0)}this.top=this.gen},t.prototype.initializeKill=function(e){this.kill=new i(this.gen.bitCount);for(var t=0,n=this.defsBySymbol.length;n>t;t++)if(this.defsBySymbol[t]){var r=e.useIndexBySymbol[t];if(r)for(var o=0,s=r.length;s>o;o++)this.kill.set(r[o],!0)}},t}();e.BBUseDefInfo=n;var r=function(){function t(){this.useIndexBySymbol=new Array,this.uses=new Array,this.symbols=new Array,this.symbolMap=new e.StringHashTable,this.symbolCount=0}return t.prototype.getSymbolIndex=function(e){var t=e.name,n=this.symbolMap.lookup(t);return null==n&&(n=this.symbolCount++,this.symbols[n]=e,this.symbolMap.add(t,n)),n},t.prototype.addUse=function(e,t){var n=this.useIndexBySymbol[e];void 0==n&&(n=new Array,this.useIndexBySymbol[e]=n),n[n.length]=t},t.prototype.getUseIndex=function(e){return this.uses[this.uses.length]=e,this.uses.length-1},t.prototype.isLocalSym=function(t){return t&&t.container==this.func&&t.kind()==e.SymbolKind.Variable},t.prototype.killSymbol=function(e,t){for(var n=this.symbolMap.lookup(e.name),r=this.useIndexBySymbol[n],i=0,o=r.length;o>i;i++)t.set(r[i],!0)},t}();e.UseDefContext=r;var i=function(){function e(t){if(this.bitCount=t,this.firstBits=0,this.restOfBits=null,this.bitCount>e.packBits){this.restOfBits=new Array;for(var n=Math.floor(this.bitCount/e.packBits),r=0;n>r;r++)this.restOfBits[r]=0}}return e.packBits=30,e.prototype.set=function(t,n){if(tn;n++)for(var o=this.restOfBits[n],s=0;st;t++){var r=this.restOfBits[t],i=e.restOfBits[t];this.restOfBits[t]=r|i}},e.prototype.intersection=function(e){if(this.firstBits&=e.firstBits,this.restOfBits)for(var t=0,n=this.restOfBits.length;n>t;t++){var r=this.restOfBits[t],i=e.restOfBits[t];this.restOfBits[t]=r&i}},e.prototype.notEq=function(e){if(this.firstBits!=e.firstBits)return!0;if(this.restOfBits)for(var t=0,n=this.restOfBits.length;n>t;t++){var r=this.restOfBits[t],i=e.restOfBits[t];if(r!=i)return!0}return!1},e.prototype.difference=function(e){if(this.firstBits,this.firstBits&=~e.firstBits,this.restOfBits)for(var t=0,n=this.restOfBits.length;n>t;t++){this.restOfBits[t];var r=e.restOfBits[t];this.restOfBits[t]&=~r}},e}();e.BitVector=i;var o=function(){function t(){this.predecessors=new Array,this.index=-1,this.markValue=0,this.successors=new Array,this.useDef=null,this.content=new e.ASTList}return t.prototype.marked=function(e){return this.markValue>e},t.prototype.mark=function(){this.markValue++},t.prototype.addSuccessor=function(e){this.successors[this.successors.length]=e,e.predecessors[e.predecessors.length]=this},t}();e.BasicBlock=o;var s=function(){function t(e,t){this.current=e,this.exit=t,this.entry=null,this.unreachable=null,this.noContinuation=!1,this.statementStack=new Array,this.currentSwitch=new Array,this.markBase=0,this.linearBBs=new Array,this.entry=this.current}return t.prototype.walk=function(e,t){return this.walker.walk(e,t)},t.prototype.pushSwitch=function(e){this.currentSwitch.push(e)},t.prototype.popSwitch=function(){return this.currentSwitch.pop()},t.prototype.reportUnreachable=function(t){if(this.unreachable&&this.unreachable.length>0)for(var n=this.unreachable.length,r=0;n>r;r++){var i=this.unreachable[r];i.nodeType!=e.NodeType.EndCode&&t.simpleError(i,"unreachable code")}},t.prototype.printAST=function(t,n){var r=new e.PrintContext(n,null);r.increaseIndent(),e.getAstWalkerFactory().walk(t,e.prePrintAST,e.postPrintAST,null,r),r.decreaseIndent()},t.prototype.printBlockContent=function(e,t){for(var n=e.content,r=0,i=n.members.length;i>r;r++){var o=n.members[r];this.printAST(o,t)}},t.prototype.bfs=function(e,t,n,r){var i=this.markBase++,o=new Array;for(o[o.length]=this.entry;o.length>0;){var s=o.pop();if(!s.marked(i)){s.mark(),e&&e(s);var a=s.successors.length;if(a>0){n&&n();for(var l=a-1;l>=0;l--){var c=s.successors[l];c.marked(this.markBase)||(t&&t(s,c),o[o.length]=c)}r&&r()}}}},t.prototype.useDef=function(e,t){var i=this,o=new r;o.func=t;var s=function(e){e.useDef=new n(e),e.useDef.initialize(o),i.linearBBs[i.linearBBs.length]=e};this.bfs(s,null,null,null);var a,l;for(a=0,l=this.linearBBs.length;l>a;a++)this.linearBBs[a].useDef.initializeGen(o),this.linearBBs[a].useDef.initializeKill(o);for(var c=!0;c;)for(c=!1,a=0;l>a;a++)c=this.linearBBs[a].useDef.updateTop()||c;var u=this.entry.useDef.top;u.map(function(t){var n=o.uses[t];e.simpleError(n,"use of variable '"+n.actualText+"' that is not definitely assigned")})},t.prototype.print=function(e){function t(){e.Write(" Branches to ")}function n(){e.WriteLine("")}function r(t,n){n.index<0&&(n.index=o++),e.Write(n.index+" ")}var i=this,o=0,s=function(t){t.index<0&&(t.index=o++),t==i.exit?e.WriteLine("Exit block with index "+t.index):(e.WriteLine("Basic block with index "+t.index),i.printBlockContent(t,e))};if(this.bfs(s,r,t,n),null!=this.unreachable)for(var a=0,l=this.unreachable.length;l>a;a++)e.WriteLine("Unreachable basic block ..."),this.printAST(this.unreachable[a],e)},t.prototype.pushStatement=function(e,t,n){this.statementStack.push({stmt:e,continueBB:t,breakBB:n})},t.prototype.popStatement=function(){return this.statementStack.pop()},t.prototype.returnStmt=function(){this.current.addSuccessor(this.exit),this.setUnreachable()},t.prototype.setUnreachable=function(){this.current=null,this.noContinuation=!0},t.prototype.addUnreachable=function(e){null===this.unreachable&&(this.unreachable=new Array),this.unreachable[this.unreachable.length]=e},t.prototype.unconditionalBranch=function(e,t){for(var n=null,r=0,i=this.statementStack.length;i>r;r++){var o=this.statementStack[r];if(o.stmt==e){n=t?o.continueBB:o.breakBB;break}}n&&this.current.addSuccessor(n),this.setUnreachable()},t.prototype.addContent=function(e){this.current&&this.current.content.append(e)},t}();e.ControlFlowContext=s;var a=function(){function e(){this.cacheSize=16,this.rdCache=[],this.nextUp=0;for(var e=0;e=0&&n.unitIndexi;i++){var o=t.parameters[i];o.container=e,n.add(o.name,o)}},n.prototype.addLocalsFromScope=function(t,n,r,i,o){for(var s=r.members.length,a=!1,l=0;s>l;l++){var c=r.members[l];if(null==c.sym||c.sym.kind()!=e.SymbolKind.Field){var u=null;if(null==(u=i.lookup(c.id.text))){var p=new e.ValueLocation;p.typeLink=new e.TypeLink;var h=null;e.hasFlag(c.varFlags,e.VarFlags.Static)?(c.varFlags|=e.VarFlags.LocalStatic,h=new e.FieldSymbol(c.id.text,c.minChar,this.checker.locationInfo.unitIndex,!0,p)):h=new e.VariableSymbol(c.id.text,c.minChar,this.checker.locationInfo.unitIndex,p),h.transferVarFlags(c.varFlags),p.symbol=h,h.declAST=c,p.typeLink.ast=c.typeExpr,this.checker.resolveTypeLink(t,p.typeLink,!1),null==c.type&&null==c.init&&(c.type=this.anyType),p.typeLink.type=c.type,p.symbol.container=n,c.sym=p.symbol,i.add(c.id.text,h),"arguments"==c.id.text&&(a=!0)}else c.type=u.getType(),c.sym=u}}if(!o&&!a){var d=new e.ValueLocation;d.typeLink=new e.TypeLink;var f=new e.VariableSymbol("arguments",r.minChar,this.checker.locationInfo.unitIndex,d);if(!this.iargumentsInterfaceType){var m=t.find("IArguments",!1,!0);m?(m.flags|=e.SymbolFlags.CompilerGenerated,this.iargumentsInterfaceType=m.getType()):this.iargumentsInterfaceType=this.anyType}d.typeLink.type=this.iargumentsInterfaceType,i.add("arguments",f)}},n.prototype.addConstructorLocalArgs=function(t,n,r){var i=t.type.symbol,o=t.arguments;if(o)for(var s=o.members.length,a=0;s>a;a++){var l=o.members[a];if(null==l.sym||r||l.sym.kind()!=e.SymbolKind.Field){var c=null;if(null==(c=n.lookup(l.id.text))){this.resolveBoundDecl(l);var u=new e.ValueLocation;u.typeLink=new e.TypeLink;var p=new e.ParameterSymbol(l.id.text,l.minChar,this.checker.locationInfo.unitIndex,u);p.funcDecl=t,p.declAST=l,u.symbol=p,u.typeLink.type=l.type,u.symbol.container=i,l.sym=u.symbol,n.add(l.id.text,p)}else l.type=c.getType(),l.sym=c}}},n.prototype.checkInitSelf=function(e){if(!e.isMethod())for(var t=e.freeVariables,n=0,r=t.length;r>n;n++){var i=t[n];if(i.isInstanceProperty())return!0}for(var o=e.scopes,s=o.members.length,a=0;s>a;a++){var l=o.members[a];if(this.checkInitSelf(l))return!0}return!1},n.prototype.checkPromoteFreeVars=function(t,n){for(var r=t.freeVariables,i=0,o=r.length;o>i;i++){var s=r[i];s.isInstanceProperty()||s.container!=n||(e.instanceFilter.reset(),this.scope.search(e.instanceFilter,s.name,!1,!1)&&this.checker.errorReporter.simpleError(t,"Constructor-local variable shadows class property '"+s.name+"'. To access the class property, use 'self."+s.name+"'"),this.checker.errorReporter.simpleError(t,"Constructor-local variables may not be accessed from instance method bodies. Consider changing local variable '"+s.name+"' to a class property"))}},n.prototype.allReturnsAreVoid=function(t){var n=!0;if(null==t.signature.returnType.type){var r=function(t,r,i){var o=!0;switch(t.nodeType){case e.NodeType.FuncDecl:o=!1;break;case e.NodeType.Return:var s=t;s.returnExpression&&(n=!1,o=!1)}return i.options.goChildren=o,i.options.goNextSibling=o,t};e.getAstWalkerFactory().walk(t.bod,r)}return n},n.prototype.classConstructorHasSuperCall=function(t){var n=!1,r=function(t,r,i){var o=!0;switch(t.nodeType){case e.NodeType.FuncDecl:o=!1;break;case e.NodeType.Call:var s=t;if(s.target.nodeType==e.NodeType.Super){o=!1,n=!0;break}}return i.options.goChildren=o,t};return e.getAstWalkerFactory().walk(t.bod,r),n},n.prototype.baseListPrivacyErrorReporter=function(t,n,r,i,o,s){var a=t.members[n].type.symbol,l=r.declAST.nodeType==e.NodeType.InterfaceDeclaration?"interface":"class",c=i?"extends":"implements",u=a.declAST.nodeType==e.NodeType.InterfaceDeclaration?"interface":"class",p="";if(s){var h="";e.isQuoted(o)||(h="'"),p=" is using inaccessible module ",u=" "+u+" from private module "+h+o+h}else u=" private "+u+" '"+o+"'";this.checker.errorReporter.simpleError(t.members[n],"exported "+l+" '"+r.name+"' "+c+u)},n.prototype.typeCheckBaseListPrivacy=function(e,t,n){var r=this;if(e)for(var i=e.members.length,o=0;i>o;o++)e.members[o].type&&e.members[o].type!=this.checker.anyType&&this.checkSymbolPrivacy(e.members[o].type.symbol,t,function(i,s){return r.baseListPrivacyErrorReporter(e,o,t,n,i,s)})},n.prototype.checkSymbolPrivacy=function(t,n,r){var i=null,o=null;if(t.isExternallyVisible(this.checker)){var s=t.pathToRoot();o=n.pathToRoot();var a=s.length,l=o.length;if(a>0&&(s[a-1].getType().isModuleType()&&s[a-1].isDynamic&&s[a-1]!=o[l-1]?i=s[a-1]:a>1&&s[a-2].getType().isModuleType()&&s[a-2].isDynamic&&(1==l||s[a-2]!=o[l-2])&&(i=s[a-2])),null==i)return}var c=n.getInterfaceDeclFromSymbol(this.checker);if(!c||e.hasFlag(c.varFlags,e.VarFlags.Exported)){var u=n,p=n.getVarDeclFromSymbol();if(p){if(e.hasFlag(p.varFlags,e.VarFlags.Private))return;e.hasFlag(p.varFlags,e.VarFlags.Public)&&(u=n.container)}if(u.isExternallyVisible(this.checker)){var h=t.name;if(null!=i){var d=i.getPrettyNameOfDynamicModule(o);if(null!=d)return this.currentScript.AddExternallyVisibleImportedSymbol(d.symbol,this.checker),void 0;h=i.prettyName}r(h,t.name!=h)}}},n.prototype.checkTypePrivacy=function(t,n,r){var i=this;if(t&&t.primitiveTypeClass==e.Primitive.None){if(t.isArray())return this.checkTypePrivacy(t.elementType,n,r);if(t.symbol&&t.symbol.name&&"_anonymous"!=t.symbol.name&&(null==t.call&&null==t.construct&&null==t.index||t.members&&!t.isClass()))return this.checkSymbolPrivacy(t.symbol,n,r);t.members&&t.members.allMembers.map(function(t,o){var s=o;e.hasFlag(s.flags,e.SymbolFlags.BuiltIn)||i.checkTypePrivacy(s.getType(),n,r)},null),this.checkSignatureGroupPrivacy(t.call,n,r),this.checkSignatureGroupPrivacy(t.construct,n,r),this.checkSignatureGroupPrivacy(t.index,n,r)}},n.prototype.checkSignatureGroupPrivacy=function(e,t,n){if(e)for(var r=e.signatures.length,i=0;i1&&o==e.definitionSignature)){o.returnType&&this.checkTypePrivacy(o.returnType.type,t,n);for(var s=o.parameters.length,a=0;s>a;a++){var l=o.parameters[a];this.checkTypePrivacy(l.getType(),t,n)}}}},n.prototype.functionArgumentPrivacyErrorReporter=function(t,n,r,i,o){var s=t.isAccessor()&&e.hasFlag(t.fncFlags,e.FncFlags.GetAccessor),a=t.isAccessor()&&e.hasFlag(t.fncFlags,e.FncFlags.SetAccessor),l=e.hasFlag(t.fncFlags,e.FncFlags.Public),c=null!=t.type.symbol.getInterfaceDeclFromSymbol(this.checker),u="";if(o){var p="";e.isQuoted(i)||(p="'"),u=" is using inaccessible module "+p+i+p}else u=" has or is using private type '"+i+"'";c?t.isConstructMember()?this.checker.errorReporter.simpleError(t.arguments.members[n],"exported interface's constructor parameter '"+r.name+"'"+u):t.isCallMember()?this.checker.errorReporter.simpleError(t.arguments.members[n],"exported interface's call parameter '"+r.name+"'"+u):t.isIndexerMember()||this.checker.errorReporter.simpleError(t.arguments.members[n],"exported interface's function parameter '"+r.name+"'"+u):t.isConstructor?this.checker.errorReporter.simpleError(t.arguments.members[n],"exported class's constructor parameter '"+r.name+"'"+u):a?this.checker.errorReporter.simpleError(t.arguments.members[n],(l?"public":"exported")+" setter parameter '"+r.name+"'"+u):s||this.checker.errorReporter.simpleError(t.arguments.members[n],(l?"public":"exported")+" function parameter '"+r.name+"'"+u)},n.prototype.returnTypePrivacyError=function(t,n,r,i){var o=n.isAccessor()&&e.hasFlag(n.fncFlags,e.FncFlags.GetAccessor),s=n.isAccessor()&&e.hasFlag(n.fncFlags,e.FncFlags.SetAccessor),a=e.hasFlag(n.fncFlags,e.FncFlags.Public),l=null!=n.type.symbol.getInterfaceDeclFromSymbol(this.checker),c="";if(i){var u="";e.isQuoted(r)||(u="'"),c=" is using inaccessible module "+u+r+u}else c=" has or is using private type '"+r+"'";l?n.isConstructMember()?this.checker.errorReporter.simpleError(t,"exported interface's constructor return type"+c):n.isCallMember()?this.checker.errorReporter.simpleError(t,"exported interface's call return type"+c):n.isIndexerMember()?this.checker.errorReporter.simpleError(t,"exported interface's indexer return type"+c):this.checker.errorReporter.simpleError(t,"exported interface's function return type"+c):o?this.checker.errorReporter.simpleError(t,(a?"public":"exported")+" getter return type"+c):s||this.checker.errorReporter.simpleError(t,(a?"public":"exported")+" function return type"+c)},n.prototype.functionReturnTypePrivacyErrorReporter=function(e,t,n,r){var i=!1;null!=e.returnTypeAnnotation&&e.returnTypeAnnotation.type==t.returnType.type&&this.returnTypePrivacyError(e.returnTypeAnnotation,e,n,r);for(var o=0;o1&&t.bod.members[1].nodeType==e.NodeType.Call&&t.bod.members[1].target.nodeType==e.NodeType.Super)||this.checker.errorReporter.simpleError(t,"If a derived class contains initialized properties or constructor parameter properties, the first statement in the constructor body must be a call to the super constructor"):this.classConstructorHasSuperCall(t)||this.checker.errorReporter.simpleError(t,"Constructors for derived classes must contain a call to the class's 'super' constructor")) }if(t.isMethod()&&t.type.enclosingType){var _=null;t.type.enclosingType.symbol.declAST.nodeType==e.NodeType.FuncDecl?_=t.type.enclosingType.symbol.declAST.classDecl:t.type.enclosingType.symbol.declAST.nodeType==e.NodeType.ClassDeclaration&&(_=t.type.enclosingType.symbol.declAST),_&&(this.thisClassNode=_)}if(r.enclosingType){var E=r.symbol.container;E&&E.isType()&&E.getType().isClass()&&(E=E.container),E&&E.declAST&&E.declAST.nodeType==e.NodeType.ModuleDeclaration&&(this.checker.currentModDecl=E.declAST)}t.unitIndex>0&&(this.checker.locationInfo=this.checker.units&&t.unitIndexN;N++)o.parameters[N].parameter.typeLink.type=t.arguments.members[N].type,this.checkTypePrivacy(o.parameters[N].getType(),u,function(e,r){return n.functionArgumentPrivacyErrorReporter(t,N,o.parameters[N],e,r)}),t.arguments.members[N].parameterPropertySym&&t.arguments.members[N].parameterPropertySym.setType(t.arguments.members[N].type);t.fncFlags&e.FncFlags.IndexerMember&&(!x||x>1?this.checker.errorReporter.simpleError(t,"Index signatures may take one and only one parameter"):t.arguments.members[0].type==this.checker.numberType?r.index.flags|=e.SignatureFlags.IsNumberIndexer:t.arguments.members[0].type==this.checker.stringType?r.index.flags|=e.SignatureFlags.IsStringIndexer:this.checker.errorReporter.simpleError(t.arguments.members[0],"Index signatures may only take 'string' or 'number' as their parameter"))}else{var L=this.scope,k=this.scope;if(!t.isMethod()&&null==t.returnTypeAnnotation){if(s&&t.name&&!t.name.isMissing()){var I=s.findAmbient(t.name.text,!1,!1);I&&I.declAST&&I.declAST.type&&this.checker.setContextualType(I.declAST.type,!1)}if(this.checker.hasTargetType()){var A=this.checker.getTargetTypeContext(),M=A.contextualType;if(this.checker.canContextuallyTypeFunction(M,t,!0)){var R=M.construct?M.construct:M.call;A.targetSig=R.signatures[0];var P=A.targetSig.parameters;m=P,g=A.targetSig.returnType.type,i.type=A.contextualType,f=!0}else M&&t.isAccessor()?(T=M,A.targetAccessorType=T):this.checker.killCurrentContextualType()}}var D=k.valueMembers;this.scope=new e.SymbolScopeBuilder(D,null,null,null,s,u);for(var N=0;x>N;N++){var O=o.parameters[N],F=O.declAST;if(this.checker.hasTargetType()&&m&&(this.checker.getTargetTypeContext().targetSig.hasVariableArgList||N=m.length-1?m[m.length-1].getType().elementType:m[N].getType(),F.sym.setType(F.type),F.sym.typeCheckStatus=this.checker.getTypeCheckFinishedStatus()}else this.typeCheck(F);v&&T&&(F=this.cast(F,T)),O.container=u,this.checkTypePrivacy(O.getType(),u,function(e,r){return n.functionArgumentPrivacyErrorReporter(t,N,O,e,r)}),D.publicMembers.add(O.name,O)}this.scope=L}if(t.bod&&!t.isSignature()){if(t.isConstructor){if(this.addConstructorLocalArgs(t,d,e.hasFlag(t.fncFlags,e.FncFlags.ClassMethod)),this.thisClassNode&&this.thisClassNode.extendsList){var W=this.scope,H=new e.ScopedMembers(d);this.scope=new e.FilteredSymbolScopeBuilder(H,s,t.type.symbol,function(t){return t.kind()==e.SymbolKind.Parameter}),this.typeCheckBaseCalls(this.thisClassNode.extendsList),this.scope=W}}else this.addFormals(u,o,d);var V=this.checker.currentModDecl;if(t.type&&t.type.symbol&&!t.isMethod()&&t.type.symbol.declModule&&(this.checker.currentModDecl=t.type.symbol.declModule),f&&this.checker.setContextualType(null,this.checker.inProvisionalTypecheckMode()),this.typeCheck(t.bod),f&&this.checker.unsetContextualType(),this.checker.currentModDecl=V,this.checker.checkControlFlow){var U=t.buildControlFlow();this.checker.printControlFlowGraph&&U.print(this.checker.errorReporter.outfile),U.reportUnreachable(this.checker.errorReporter),this.checker.checkControlFlowUseDef&&U.useDef(this.checker.errorReporter,t.type.symbol)}if(t.isConstructor)for(var j=t.scopes,K=j.members.length,q=0;K>q;q++){var z=j.members[q];z.isSignature()||e.hasFlag(z.fncFlags,e.FncFlags.Method)&&!e.hasFlag(z.fncFlags,e.FncFlags.Static)&&this.checkPromoteFreeVars(z,t.type.symbol)}}if(this.scope=s,this.thisFnc=a,this.thisClassNode=c,this.enclosingFncIsMethod=l,this.thisType=p,this.checker.locationInfo=h,this.checker.currentModDecl=b,o.typeCheckStatus=this.checker.getTypeCheckFinishedStatus(),t.returnTypeAnnotation?(this.checkForVoidConstructor(t.returnTypeAnnotation.type,t.returnTypeAnnotation),null==o.returnType.type&&this.checker.resolveTypeLink(this.scope,o.returnType,!1)):g&&(o.returnType.type=g),!(i.flags&e.SymbolFlags.RecursivelyReferenced)&&t.returnStatementsWithExpressions.length>0){var G={getLength:function(){return t.returnStatementsWithExpressions.length},setTypeAtIndex:function(e,n){t.returnStatementsWithExpressions[e].type=n},getTypeAtIndex:function(e){return t.returnStatementsWithExpressions[e].type}},$=t.returnStatementsWithExpressions[0].type;if($=this.checker.findBestCommonType($,null,G,!0))o.returnType.type=this.checker.widenType($);else{for(var J=0;J0&&t.bod.members[0].nodeType==e.NodeType.Throw,X||this.checker.errorReporter.simpleError(t.returnTypeAnnotation||t,"Function declared a non-void return type, but has no return expression")),this.checkTypePrivacy(o.returnType.type,u,function(e,r){return n.functionReturnTypePrivacyErrorReporter(t,o,e,r)})),t.accessorSymbol){var T=t.accessorSymbol.getType();X||!e.hasFlag(t.fncFlags,e.FncFlags.GetAccessor)||e.hasFlag(t.fncFlags,e.FncFlags.HasReturnExpression)||this.checker.errorReporter.simpleError(t,"Getters must return a value"),T?(e.hasFlag(t.fncFlags,e.FncFlags.GetAccessor)&&T!=o.returnType.type||t.arguments.members.length>0&&T!=t.arguments.members[0].type)&&this.checker.errorReporter.simpleError(t,"Getter and setter types do not agree"):e.hasFlag(t.fncFlags,e.FncFlags.GetAccessor)?t.accessorSymbol.setType(o.returnType.type):1!=t.arguments.members.length?this.checker.errorReporter.simpleError(t,"Setters may have one and only one argument"):t.accessorSymbol.setType(t.arguments.members[0].type)}return this.typeCheckOverloadSignatures(r,t),t},n.prototype.typeCheckBases=function(t){var n=!1,r=t.extendsList,i=t.extendsTypeLinks;if(r){var o=r.length;o>0&&(t.typeFlags|=e.TypeFlags.HasBaseType);for(var s=0;o>s;s++){if(r[s]==this.checker.anyType){i[s].type=null;var a=this.checker.errorReporter.getCapturedErrors();e.CompilerDiagnostics.assert(0==a.length,"There shouldnt be any contextual errors when typechecking base type names"),this.checker.errorReporter.pushToErrorSink=!0,r[s]=this.checker.resolveBaseTypeLink(i[s],t.containedScope),this.checker.errorReporter.pushToErrorSink=!1,this.checker.errorReporter.freeCapturedErrors()}var l=r[s],c=i[s].ast,u=l.symbol&&"Object"==l.symbol.name&&l.symbol.container==this.checker.gloMod;if(u&&(t.typeFlags|=e.TypeFlags.HasBaseTypeOfObject),l.isClassInstance())t.isClassInstance()?n&&this.checker.errorReporter.simpleError(c,"Class may not follow interface as base type"):this.checker.errorReporter.simpleError(c,"Interface base type must be interface");else if(l.isModuleType())this.checker.errorReporter.simpleError(c,"Types may not be derived from module types");else{if(!l.members){t.isClassInstance()?this.checker.errorReporter.simpleError(c,"Base type must be interface or class"):this.checker.errorReporter.simpleError(c,"Interface base type must be interface");break}n||(n=!0)}}}},n.prototype.checkMembersImplementInterfaces=function(t){var n=t.getInstanceType();if(n.implementsList)for(var r=n.implementsList.length,i=0;r>i;i++){var o=n.implementsList[i],s=new e.TypeComparisonInfo;if(!this.checker.sourceIsSubtypeOfTarget(n,o,s)){var a="Class '"+n.getTypeName()+"' declares interface '"+o.getTypeName()+"' but does not implement it";s.message?this.checker.errorReporter.simpleErrorFromSym(n.symbol,a+": "+s.message):this.checker.errorReporter.simpleErrorFromSym(n.symbol,a)}}},n.prototype.typeCheckBaseCalls=function(t){if(null!=t)for(var n=t.members.length,r=0;n>r;r++){var i=t.members[r];i.nodeType==e.NodeType.Call&&this.typeCheckNew(i)}},n.prototype.assertUniqueNamesInBaseTypes=function(t,n,r,i){var o=this;if(n&&(n.members&&n.members.publicMembers.map(function(e,s){var a=s,l=t.lookup(a.name);l?i&&o.checker.errorReporter.simpleError(r,"duplicate member name in bases for "+r.name.actualText+": "+n.symbol.name+" and "+l.container.name+" both contain member with name "+a.name):t.add(a.name,a)},null),n.extendsList))for(var s=n.extendsList.length,a=0;s>a;a++)n.extendsList[a].symbol.flags&e.SymbolFlags.RecursivelyReferenced||this.assertUniqueNamesInBaseTypes(t,n.extendsList[a],r,i)},n.prototype.checkBaseTypeMemberInheritance=function(t,n){var r=this,i=t.getInstanceType();if(null!=i.extendsList){var o=i.extendsList.length;if(o>0){var s=new e.StringHashTable;if(i.isClassInstance())for(var a=0;o>a;a++)this.assertUniqueNamesInBaseTypes(s,i.extendsList[a],n,a>0);i.members&&i.members.publicMembers.map(function(t,s){for(var a=s,l=0;o>l;l++){var c=i.extendsList[l];if(null==c.memberScope)r.checker.errorReporter.simpleError(n,"Base type '"+c.symbol.name+"' lacks an implementation.");else{var u=c.memberScope.find(a.name,!1,!1);if(u){var p=a.getType(),h=u.getType();r.checker.sourceIsSubtypeOfTarget(p,h)?a.kind()==e.SymbolKind.Type&&u.kind()==e.SymbolKind.Field&&r.checker.errorReporter.simpleErrorFromSym(a,"Cannot override field '"+a.name+"' with method"):r.checker.errorReporter.simpleErrorFromSym(a,"Type of overridden member '"+a.name+"' is not subtype of original member defined by type '"+u.container.name+"'")}}}},null)}}},n.prototype.typeCheckClass=function(t){var n=t.type.symbol;if(n.typeCheckStatus==e.TypeCheckStatus.Finished)return t;if(n.typeCheckStatus==e.TypeCheckStatus.Started)return t;n.typeCheckStatus=e.TypeCheckStatus.Started,this.checker.addStartedPTO(n);var r=this.scope,i=this.thisClassNode;this.thisClassNode=t;var o=t.type;this.typeCheckBases(o.instanceType),this.typeCheckBaseListPrivacy(t.extendsList,n,!0),this.typeCheckBaseListPrivacy(t.implementsList,n,!1);var s=this.thisType;if(this.thisType=o.instanceType,this.scope=o.instanceType.containedScope,t.constructorDecl){this.scope=o.instanceType.constructorScope;var a=this.scope,l=a.valueMembers.allMembers;this.addConstructorLocalArgs(t.constructorDecl,l,!0)}return this.typeCheck(t.members),n.typeCheckStatus=e.TypeCheckStatus.Finished,this.checkBaseTypeMemberInheritance(o,t),this.checkMembersImplementInterfaces(o),this.typeCheckOverloadSignatures(o,t),this.typeCheckOverloadSignatures(o.instanceType,t),t.constructorDecl||t.extendsList&&t.extendsList.members.length&&t.extendsList.members[0].type&&t.extendsList.members[0].type.symbol.type.isClass()&&e.cloneParentConstructGroupForChildType(t.type,t.extendsList.members[0].type.symbol.type),this.thisType=s,this.thisClassNode=i,this.scope=r,t},n.prototype.typeCheckOverloadSignatures=function(e,t){e.call&&e.call.typeCheck(this.checker,t,null!=e.construct),e.construct&&e.construct.typeCheck(this.checker,t,!1),e.index&&e.index.typeCheck(this.checker,t,!1)},n.prototype.typeCheckInterface=function(e){if(this.typeCheckBases(e.type),this.typeCheckBaseListPrivacy(e.extendsList,e.type.symbol,!0),this.typeCheck(e.members),this.checkBaseTypeMemberInheritance(e.type,e),e.extendsList)for(var t=0;t=e.NodeType.Asg&&t.nodeType<=e.NodeType.LastAsg&&this.checker.errorReporter.simpleError(t,"top-level assignment statement in conditional expression")},n.prototype.typeCheckCompoundStmtBlock=function(t,n){this.checker.styleSettings.blockInCompoundStmt&&t&&t.nodeType!=e.NodeType.Block&&this.checker.errorReporter.styleError(t,n+" requires a block")},n.prototype.typeCheckIf=function(e){return e.cond=this.typeCheck(e.cond),this.typeCheckCondExpr(e.cond),e.thenBod=this.typeCheck(e.thenBod),e.elseBod=this.typeCheck(e.elseBod),this.typeCheckCompoundStmtBlock(e.thenBod,"if statement"),this.typeCheckCompoundStmtBlock(e.elseBod,"if statement"),e.type=this.voidType,e},n.prototype.typeFromAccessorFuncDecl=function(t){return t.isAccessor()?e.hasFlag(t.fncFlags,e.FncFlags.GetAccessor)?t.type.call.signatures[0].returnType.type:t.type.call.signatures[0].parameters[0].getType():null},n.prototype.typeCheckObjectLit=function(t){var n=new e.Type;n.symbol=new e.TypeSymbol(this.checker.anon,t.minChar,t.limChar-t.minChar,this.checker.locationInfo.unitIndex,n),n.members=new e.ScopedMembers(new e.DualStringHashTable(new e.StringHashTable,new e.StringHashTable)),n.memberScope=new e.SymbolTableScope(n.members,null,null,null,null);var r=new e.SymbolAggregateScope(n.symbol);r.addParentScope(n.memberScope),r.addParentScope(this.scope),n.containedScope=r;var i=t.operand,o=this.thisType,s=!1,a=null;if(this.checker.hasTargetType()&&(a=this.checker.getTargetTypeContext().contextualType,a&&a.symbol&&!this.checker.typeStatusIsFinished(a.symbol.typeCheckStatus)&&a.symbol.declAST&&this.typeCheck(a.symbol.declAST),s=!0),i)for(var l=0,c=i.members.length;c>l;l++){var u,p=i.members[l],h=p.operand1,d=null,f=null;if(h.nodeType==e.NodeType.Name)u=h.text;else{if(h.nodeType!=e.NodeType.QString){this.checker.errorReporter.simpleError(t,"malformed object literal"),n=this.anyType;break}var m=h.text;u=m.substring(1,m.length-1)}if(s&&a.memberScope&&(d=a.memberScope.find(u,!1,!1)),p.operand2.nodeType==e.NodeType.FuncDecl&&p.operand2.isAccessor()){var g=p.operand2,y=n.members.publicMembers.lookup(u);y=this.checker.createAccessorSymbol(g,y,n,!0,!1,n.memberScope,null),g.accessorSymbol=y,f=y,h.nodeType==e.NodeType.Name&&(h.sym=y)}if(this.checker.typeCheckWithContextualType(s&&d?d.getType():null,!1,s,p.operand2),s&&d?(p.operand2.type==this.anyType||this.checker.sourceIsAssignableToTarget(p.operand2.type,d.getType())||p.operand2.nodeType==e.NodeType.FuncDecl&&p.operand2.isAccessor()&&this.typeFromAccessorFuncDecl(p.operand2)==d.getType())&&(p.operand1.type=d.getType()):p.operand2.type=p.operand2.type==this.checker.undefinedType?this.anyType:p.operand2.type,null==f){var v=p.operand2.type,T=new e.ValueLocation;f=new e.FieldSymbol(u,h.minChar,this.checker.locationInfo.unitIndex,!0,T),f.flags|=e.SymbolFlags.Property,T.symbol=f,f.typeCheckStatus=this.checker.getTypeCheckFinishedStatus(),T.typeLink=new e.TypeLink,T.typeLink.type=v,n.members.publicMembers.add(u,f)}f.isObjectLitField=!0}this.thisType=o,t.type=n,a&&(t.targetType=a)},n.prototype.typeCheckArrayLit=function(t){var n=t.operand,r=this.anyType,i=null,o=new e.TypeComparisonInfo;if(o.onlyCaptureFirstError=!0,this.checker.hasTargetType()){var s=this.checker.getTargetTypeContext().contextualType;s.elementType&&(i=s.elementType)}if(n){var a=this.inArrayElementTypeCheck;this.inArrayElementTypeCheck=!0,this.checker.typeCheckWithContextualType(i,this.checker.inProvisionalTypecheckMode(),null!=i,n),this.inArrayElementTypeCheck=a,r=n.members[0].type;var l={getLength:function(){return n.members.length},setTypeAtIndex:function(e,t){n.members[e].type=t},getTypeAtIndex:function(e){return n.members[e].type}};r=this.checker.findBestCommonType(r,i,l,!1,o),(r==this.checker.undefinedType||!a&&r==this.nullType)&&(r=this.anyType)}if(r)i&&this.checker.sourceIsAssignableToTarget(r,i)&&(r=i);else{var c="Incompatible types in array literal expression";o.message?this.checker.errorReporter.simpleError(t,c+": "+o.message):this.checker.errorReporter.simpleError(t,c),r=this.anyType}t.type=this.checker.makeArrayType(r)},n.prototype.checkForVoidConstructor=function(e,t){if(e&&e.construct&&e.construct.signatures.length>0)for(var n=0;n=o&&(e.hasVariableArgList||t.length<=s)&&(a=e.hasVariableArgList?e.parameters.length:t.length,l=!0);var c=null;if(l||e.hasVariableArgList){e.hasVariableArgList&&(a-=1,c=e.parameters[a].parameter.typeLink.type,c=c.elementType,l=t.length>=a);for(var u=t.length,p=l,h=l,d=0;u>d;d++){var f;f=a>d?e.parameters[d].parameter.typeLink.type:c;var m=t[d];if(f&&m&&this.checker.typesAreIdentical(f,m)||(p=!1),this.checker.sourceIsAssignableToTarget(m,f,i)||(h=!1),!p&&!h)break}p?n[n.length]=e:h&&0==n.length&&(r[r.length]=e)}},n.prototype.resolveOverload=function(t,n){var r=this.resolutionDataCache.getResolutionData(),i=r.actuals,o=r.exactCandidates,s=r.conversionCandidates,a=null,l=n.signatures.length>1,c=new e.TypeComparisonInfo,u=null,p=null;if(t.nodeType==e.NodeType.Call||t.nodeType==e.NodeType.New){var h=t;if(u=h.arguments,p=h.target,h.arguments)for(var d=h.arguments.members.length,f=0;d>f;f++)i[f]=h.arguments.members[f].type}else if(t.nodeType==e.NodeType.Index){var m=t;p=m.operand1,u=new e.ASTList,u.members[0]=m.operand2,i[0]=m.operand2.type}for(var g=0,y=n.signatures.length;y>g;g++){var v=n.signatures[g];(!l||v!=n.definitionSignature||this.checker.canCallDefinitionSignature)&&(!v.returnType.type&&v.declAST&&v.typeCheckStatus!=e.TypeCheckStatus.Finished&&this.typeCheckFunction(v.declAST),this.tryAddCandidates(v,i,o,s,c))}var T=p.nodeType==e.NodeType.Dot?p.operand2:p;if(0==o.length){var b=this.checker.getApplicableSignatures(s,u,c);if(b.length>0){var k=this.checker.findMostApplicableSignature(b,u);k.ambiguous&&this.checker.errorReporter.simpleError(T,"Ambiguous call expression - could not choose overload"),a=k.sig}else{var S="Supplied parameters do not match any signature of call target";c.message?this.checker.errorReporter.simpleError(T,S+":\n "+c.message):this.checker.errorReporter.simpleError(T,S)}}else if(o.length>1){for(var C=[],f=0;f=i.nonOptionalParameterCount){n=!0;var o=null,s=i.hasVariableArgList?i.parameters.length-1:i.parameters.length,a=t.arguments.members.lengthr;r++)switch(o=i.parameters[r].getType(),t.arguments.members[r].nodeType){case e.NodeType.FuncDecl:case e.NodeType.ObjectLit:case e.NodeType.ArrayLit:this.checker.typeCheckWithContextualType(o,this.checker.inProvisionalTypecheckMode(),!i.parameters[r].declAST.isParenthesized,t.arguments.members[r])}if(i.hasVariableArgList){var l=i.nonOptionalParameterCount-1;o=i.parameters[l].getType(),o&&(o=o.elementType);var c=!i.parameters[l].declAST.isParenthesized;for(r=a;r0?this.extendsList[0]:null},t.prototype.getArrayBase=function(e,t){return this.arrayCache.specialize(e,t)},t.prototype.isClass=function(){return null!=this.instanceType},t.prototype.isArray=function(){return null!=this.elementType},t.prototype.isClassInstance=function(){return this.symbol&&!this.elementType&&this.symbol.type.isClass()},t.prototype.getInstanceType=function(){return this.isClass()?this.instanceType:this},t.prototype.hasImplementation=function(){return e.hasFlag(this.typeFlags,e.TypeFlags.HasImplementation)},t.prototype.setHasImplementation=function(){this.typeFlags|=e.TypeFlags.HasImplementation},t.prototype.isDouble=function(){return e.hasFlag(this.primitiveTypeClass,n.Double)},t.prototype.isString=function(){return e.hasFlag(this.primitiveTypeClass,n.String)},t.prototype.isBoolean=function(){return e.hasFlag(this.primitiveTypeClass,n.Boolean)},t.prototype.isNull=function(){return e.hasFlag(this.primitiveTypeClass,n.Null)},t.prototype.getTypeName=function(){return this.getMemberTypeName("",!0,!1,null)},t.prototype.getScopedTypeName=function(e,t){return this.getMemberTypeName("",!0,!1,e,t)},t.prototype.getScopedTypeNameEx=function(e,t){return this.getMemberTypeNameEx("",!0,!1,e,t)},t.prototype.callCount=function(){var e=0;return this.call&&(e+=this.call.signatures.length),this.construct&&(e+=this.construct.signatures.length),this.index&&(e+=this.index.signatures.length),e},t.prototype.getMemberTypeName=function(e,t,n,r,i){var o=this.getMemberTypeNameEx(e,t,n,r,i);return o.toString()},t.prototype.getMemberTypeNameEx=function(t,n,i,s,a){if(this.elementType)return r.create(this.elementType.getMemberTypeNameEx(t,!1,!0,s),"","[]");if(this.symbol&&this.symbol.name&&"_anonymous"!=this.symbol.name&&(null==this.call&&null==this.construct&&null==this.index||e.hasFlag(this.typeFlags,e.TypeFlags.BuildingName)||this.members&&!this.isClass())){var l=this.symbol.scopeRelativeName(s);return r.create("null"==l?"any":l)}if(this.members||this.call||this.construct){if(e.hasFlag(this.typeFlags,e.TypeFlags.BuildingName))return r.create("this");this.typeFlags|=e.TypeFlags.BuildingName;var c=new o,u=i||null!=this.index,p=0,h="; ";this.members&&this.members.allMembers.map(function(t,n){var r=n;if(!e.hasFlag(r.flags,e.SymbolFlags.BuiltIn)){var i=r.getTypeNameEx(s);i.isArray()&&i.delim==h?c.addAll(i.entries):c.add(i),p++,u=!0}},null);var d=this.callCount(),f=a&&!u&&this.call&&this.call.signatures.length>1&&!this.members&&!this.construct,m=!u&&(1==d||f)&&n;return this.call&&c.addAll(this.call.toStrings(t,m,s,f)),this.construct&&c.addAll(this.construct.toStrings("new",m,s)),this.index&&c.addAll(this.index.toStrings("",m,s)),u||!f&&d>1&&n?(c.prefix="{ ",c.suffix="}",c.delim=h):c.entries.length>1&&(c.delim=h),this.typeFlags&=~e.TypeFlags.BuildingName,0==d&&0==p?r.create("{}"):c}return r.create("{}")},t.prototype.checkDecl=function(e){(this.isClassInstance()||this.isClass())&&this.symbol.declAST&&e.typeFlow.inScopeTypeCheckDecl(this.symbol.declAST)},t.prototype.getMemberScope=function(e){if(this==e.anyType)return null;if(this.isDouble())return e.numberInterfaceType?e.numberInterfaceType.memberScope:null;if(this.isBoolean())return e.booleanInterfaceType?e.booleanInterfaceType.memberScope:null;if(this==e.stringType)return e.stringInterfaceType?e.stringInterfaceType.memberScope:null;if(this.elementType){if(e.arrayInterfaceType){var t=this.elementType.getArrayBase(e.arrayInterfaceType,e.checker);return t.memberScope}return null}return this.memberScope},t.prototype.isReferenceType=function(){return this.members||this.extendsList||this.construct||this.call||this.index||this.elementType},t.prototype.specializeType=function(n,r,i,o){if(n==this)return r;var s=this;return o?this.isReferenceType()&&(s=new t,this.members&&(s.members=new e.ScopedMembers(new e.DualStringHashTable(new e.StringHashTable,new e.StringHashTable)),this.members.publicMembers.map(function(e,t){var o=t,a=o.specializeType(n,r,i);s.members.addPublicMember(a.name,a)},null),this.members.privateMembers.map(function(e,t){var o=t,a=o.specializeType(n,r,i);s.members.addPrivateMember(a.name,a)},null)),this.ambientMembers&&(s.ambientMembers=new e.ScopedMembers(new e.DualStringHashTable(new e.StringHashTable,new e.StringHashTable)),this.ambientMembers.publicMembers.map(function(e,t){var o=t,a=o.specializeType(n,r,i);s.ambientMembers.addPublicMember(a.name,a)},null),this.ambientMembers.privateMembers.map(function(e,t){var o=t,a=o.specializeType(n,r,i);s.ambientMembers.addPrivateMember(a.name,a)},null)),s.containedScope=i.scopeOf(s),s.memberScope=s.containedScope):this.elementType?this.elementType==n?s=i.makeArrayType(r):this.elementType.elementType==n&&(s=i.makeArrayType(i.makeArrayType(r))):this.call&&(s=new t,s.call=this.call.specializeType(n,r,i)),s},t.prototype.hasBase=function(e){if(e==this)return!0;if(this.extendsList)for(var t=0,n=this.extendsList.length;n>t;t++)if(this.extendsList[t].hasBase(e))return!0;return!1},t.prototype.mergeOrdered=function(e,t,n,r){if(this==t.anyType||e==t.anyType)return t.anyType;if(this==e)return this;if(e==t.nullType&&this!=t.nullType)return this;if(this==t.nullType&&e!=t.nullType)return e;if(n&&e==t.voidType&&this!=t.voidType)return this;if(n&&this==t.voidType&&e!=t.voidType)return e;if(e==t.undefinedType&&this!=t.undefinedType)return this;if(this==t.undefinedType&&e!=t.undefinedType)return e;if(this.elementType&&e.elementType){if(this.elementType==e.elementType)return this;var i=this.elementType.mergeOrdered(e.elementType,t,n,r);return null==i?t.makeArrayType(t.anyType):t.makeArrayType(i)}return t.sourceIsSubtypeOfTarget(this,e,r)?e:t.sourceIsSubtypeOfTarget(e,this,r)?this:null},t.prototype.isModuleType=function(){return!1},t.prototype.hasMembers=function(){return null!=this.members},t.prototype.getAllEnclosedTypes=function(){return null},t.prototype.getAllAmbientEnclosedTypes=function(){return null},t.prototype.getPublicEnclosedTypes=function(){return null},t.prototype.getpublicAmbientEnclosedTypes=function(){return null},t.prototype.getDocComments=function(){return this.elementType||!this.symbol?[]:this.isClassInstance()||this.isClass()?this.symbol.declAST.nodeType==e.NodeType.FuncDecl?this.symbol.declAST.classDecl.getDocComments():this.symbol.getDocComments():this.symbol.name&&"_anonymous"!=this.symbol.name&&(null==this.call&&null==this.construct&&null==this.index||this.members)?this.symbol.getDocComments():[]},t}();e.Type=a;var l=function(t){function n(e,n){t.call(this),this.enclosedTypes=e,this.ambientEnclosedTypes=n,this.importedModules=[]}return __extends(n,t),n.prototype.isModuleType=function(){return!0},n.prototype.hasMembers=function(){return null!=this.members||null!=this.enclosedTypes},n.prototype.getAllEnclosedTypes=function(){return this.enclosedTypes},n.prototype.getAllAmbientEnclosedTypes=function(){return this.ambientEnclosedTypes},n.prototype.getPublicEnclosedTypes=function(){return null},n.prototype.getpublicAmbientEnclosedTypes=function(){return null},n.findDynamicModuleNameInHashTable=function(t,n){var r=null;return n.map(function(n,i){if(null==r&&!e.isQuoted(n)){var o=i,s=o.getType();s==t&&(r={name:n,symbol:o})}},null),r},n.prototype.findDynamicModuleName=function(e){var t=null;return t=n.findDynamicModuleNameInHashTable(e,this.members.allMembers),null==t&&(t=n.findDynamicModuleNameInHashTable(e,this.ambientMembers.allMembers)),t},n}(a);e.ModuleType=l;var c=function(){function e(){this.type=null,this.ast=null}return e}();e.TypeLink=c,e.getTypeLink=t}(TypeScript||(TypeScript={}));var TypeScript;!function(e){function t(e){return e.replace('"',"").replace("'","").replace("'","").replace('"',"")}function n(e){return-1!=e.indexOf("'")}function r(e){return-1!=e.indexOf('"')||n(e)}function i(e){return'"'+e+'"'}function o(e){return-1!=e.indexOf('"')?(e=e.replace('"',"'"),e=e.replace('"',"'")):(e=e.replace("'",'"'),e=e.replace("'",'"')),e}function s(e){return-1!=e.indexOf('"')&&(e=e.replace('"',"'"),e=e.replace('"',"'")),e}function a(e){return e.replace(/\\/g,"/")}function l(e){return e.length>6&&".d.str"==e.substring(e.length-6,e.length)?e.substring(0,e.length-6):e.length>4&&".str"==e.substring(e.length-4,e.length)?e.substring(0,e.length-4):e.length>5&&".d.ts"==e.substring(e.length-5,e.length)?e.substring(0,e.length-5):e.length>3&&".ts"==e.substring(e.length-3,e.length)?e.substring(0,e.length-3):e.length>3&&".js"==e.substring(e.length-3,e.length)?e.substring(0,e.length-3):e}function c(e){return h(e)?k(e):d(e)?C(e):C(e)}function u(e,t){var n=e.toLocaleUpperCase(),r=t.toLocaleUpperCase(),i=r.length;return n.length>i&&n.substring(n.length-i,n.length)==r}function p(e){return u(e,".js")}function h(e){return u(e,".str")}function d(e){return u(e,".ts")}function f(e){return u(e,".d.str")}function m(e){return u(e,".d.ts")}function g(e,n,r){"undefined"==typeof n&&(n=!0),"undefined"==typeof r&&(r=!1);var o=r?a(e):l(t(e)),s=this.getPathComponents(o);return s.length?n?i(s[s.length-1]):s[s.length-1]:e}function y(e){return e.split("/")}function v(e,t){t=a(t);for(var n=this.getPathComponents(t),r=this.getPathComponents(e),i=0;i1?1:0;return i(o[s])}function b(e){return l(t(e))+".str"}function k(e){return l(t(e))+".d.str"}function S(e){return l(t(e))+".ts"}function C(e){return l(t(e))+".d.ts"}function w(e){return"."==e.charAt(0)}function _(e){return"\\"==e.charAt(0)||"/"==e.charAt(0)||-1!=e.indexOf(":\\")||-1!=e.indexOf(":/")}function E(e){if(""==e)return e;var t=-1!=e.indexOf("/");return t?N(e):""}function x(e){e=a(e);var t=y(e);return t.slice(0,t.length-1)}function N(e){var t=x(e);return t.join("/")+"/"}function L(e){var t=/^(https?:\/\/[\-\w\.]+(:\d+)?\/)(.*)$/i,n=t.exec(e);if(n){var r=n[1],i=n[3];return r+I(i)}return I(e)}function I(e){e=a(e);for(var t="/"===e.charAt(0),n=this.getPathComponents(e),r=0;r0&&".."===n[r]&&".."!==n[r-1]&&(n.splice(r-1,2),r-=2);return(t?"/":"")+n.join("/")}function A(e){return I(e)}function M(e){return null===e||"undefined"==typeof e?!0:""===e?!0:/^(\.\.\/?)+$/.test(e)?!0:!1}e.stripQuotes=t,e.isSingleQuoted=n,e.isQuoted=r,e.quoteStr=i,e.swapQuotes=o,e.changeToSingleQuote=s,e.switchToForwardSlashes=a,e.trimModName=l,e.getDeclareFilePath=c,e.isJSFile=p,e.isSTRFile=h,e.isTSFile=d,e.isDSTRFile=f,e.isDTSFile=m,e.getPrettyName=g,e.getPathComponents=y,e.getRelativePathToFixedPath=v,e.quoteBaseName=T,e.changePathToSTR=b,e.changePathToDSTR=k,e.changePathToTS=S,e.changePathToDTS=C,e.isRelative=w,e.isRooted=_,e.getRootFilePath=E,e.filePathComponents=x,e.filePath=N,e.normalizeURL=L,e.pathNormalizeRegExp=/\//g,e.normalizePath=I,e.normalizeImportPath=A,e.isInvalidPath=M}(TypeScript||(TypeScript={}));var TypeScript;!function(e){var t=function(){function e(e,t){this.path=e,this.content=t,this.referencedFiles=null}return e.prototype.getText=function(e,t){return this.content.substring(e,t)},e.prototype.getLength=function(){return this.content.length},e}();e.SourceUnit=t;var n=function(){function e(e,t){this.compilationSettings=e,this.ioHost=t,this.residentCode=[],this.code=[],this.inputOutputMap=[]}return e}();e.CompilationEnvironment=n;var r=function(){function n(e){this.environment=e,this.visited={}}return n.prototype.resolveCode=function(n,r,i,o){var s={content:null,path:n},a=this.environment.ioHost,l=e.isRelative(n),c=l?!1:e.isRooted(n),u=l?a.resolvePath(r+"/"+n):c||!r||i?n:r+"/"+n;e.isSTRFile(u)||e.isTSFile(u)||(u+=".ts"),u=e.switchToForwardSlashes(e.stripQuotes(u));var p=this.environment.compilationSettings.useCaseSensitiveFileResolution?u:u.toLocaleUpperCase();if(!this.visited[p]){if(l||c||!i)try{e.CompilerDiagnostics.debugPrint(" Reading code from "+u);try{s.content=a.readFile(u)}catch(h){try{e.isSTRFile(u)?u=e.changePathToTS(u):e.isTSFile(u)&&(u=e.changePathToSTR(u)),e.CompilerDiagnostics.debugPrint(" Reading code from "+u),s.content=a.readFile(u)}catch(h){u=e.changePathToDSTR(u),e.CompilerDiagnostics.debugPrint(" Reading code from "+u);try{s.content=a.readFile(u)}catch(h){u=e.changePathToDTS(u),e.CompilerDiagnostics.debugPrint(" Reading code from "+u),s.content=a.readFile(u)}}}e.CompilerDiagnostics.debugPrint(" Found code at "+u),s.path=u,this.visited[p]=!0}catch(h){return e.CompilerDiagnostics.debugPrint(" Did not find code for "+n),!1}else s=a.findFile(r,u),s||(e.isSTRFile(u)?u=e.changePathToTS(u):e.isTSFile(u)&&(u=e.changePathToSTR(u)),s=a.findFile(r,u)),s||(u=e.changePathToDTS(u),s=a.findFile(r,u),s||(u=e.changePathToDSTR(u),s=a.findFile(r,u))),s?(s.path=e.switchToForwardSlashes(e.stripQuotes(s.path)),e.CompilerDiagnostics.debugPrint(n+" resolved to: "+s.path),s.content=s.content,this.visited[p]=!0):e.CompilerDiagnostics.debugPrint("Could not find "+n);if(s&&null!=s.content){var d=a.dirName(s.path),f=new t(s.path,s.content),m=e.preProcessFile(f,this.environment.compilationSettings),g=a.resolvePath(s.path);f.referencedFiles=m.referencedFiles;for(var y=0;y/gim,r=n.exec(t);if(r){var i=e.normalizePath(r[3]),o=e.normalizePath(i),s=r.length>=7&&"true"==r[6];return s&&e.CompilerDiagnostics.debugPrint(i+" is resident"),{minChar:0,limChar:0,startLine:0,startCol:0,path:e.switchToForwardSlashes(o),isResident:s}}return null}function n(e){var t=/^(\/\/\/\s*/gim,n=t.exec(e);if(n){var r=n[3];return r}return null}function r(e){var t=/^(\/\/\/\s*/gim,n=t.exec(e);return n?!0:!1}function i(e,t){var n=/^(\/\/\/\s*/gim,r=n.exec(e);if(r){var i=/^([a-zA-Z]+=['"]on['|"])/gim;if(r=i.exec(r[2]))for(var o=0;o=0&&T.col++,v.startLine=T.line,v.startCol=T.col,d.push(v)}if(h){i(u.getText(),h.styleSettings);var b=/^(\/\/\/\s*/gim,k=b.exec(u.getText());k&&(m="true"==k[3])}}return{settings:h,referencedFiles:d,importedFiles:f,isLibFile:m}}var a=function(){function e(){this.bitwise=!1,this.blockInCompoundStmt=!1,this.eqeqeq=!1,this.forin=!1,this.emptyBlocks=!0,this.newMustBeUsed=!1,this.requireSemi=!1,this.assignmentInCond=!1,this.eqnull=!1,this.evalOK=!0,this.innerScopeDeclEscape=!0,this.funcInLoop=!0,this.reDeclareLocal=!0,this.literalSubscript=!0,this.implicitAny=!1}return e.prototype.setOption=function(e,t){var n=this[e];return void 0!==n?(this[e]=t,!0):!1},e.prototype.parseOptions=function(e){for(var t=e.split(";"),n=0,r=t.length;r>n;n++){var i=t[n],o=!0,s=i.lastIndexOf(":");if(s>=0){var a=i.substring(s+1);i=i.substring(0,s),"off"==a&&(o=!1)}if(!this.setOption(i,o))return!1}return!0},e}();e.StyleSettings=a;var l=function(){function t(){this.styleSettings=new a,this.propagateConstants=!1,this.minWhitespace=!1,this.parseOnly=!1,this.errorRecovery=!1,this.emitComments=!1,this.watch=!1,this.exec=!1,this.resolve=!0,this.controlFlow=!1,this.printControlFlow=!1,this.controlFlowUseDef=!1,this.errorOnWith=!0,this.preprocess=!0,this.canCallDefinitionSignature=!1,this.inferPropertiesFromThisAssignment=!1,this.useDefaultLib=!0,this.codeGenTarget=e.CodeGenTarget.ES3,this.moduleGenTarget=e.ModuleGenTarget.Synchronous,this.outputOption="",this.mapSourceFiles=!1,this.emitFullSourceMapPath=!1,this.generateDeclarationFiles=!1,this.useCaseSensitiveFileResolution=!1,this.basepath=""}return t.prototype.setStyleOptions=function(e){this.styleSettings.parseOptions(e)},t}();e.CompilationSettings=l,e.getAdditionalDependencyPath=n,e.getImplicitImport=r,e.getStyleSettings=i,e.getReferencedFiles=o,e.preProcessFile=s}(TypeScript||(TypeScript={}));var TypeScript;!function(e){var t=function(){function t(t){this.logger=t,this.astLogger=new e.AstLogger(this.logger)}return t.prototype.getEnclosingScopeContextIfSingleScopeEdit=function(t,n,r,i){if(this.logger.log('checkEditsInsideSingleScope("'+n+'")'),null===i)throw new Error("editRange should be valid");if(i.isUnknown())return this.logger.log(" Bailing out because edit range is unknown"),null;var o=e.findEnclosingScopeAt(this.logger,t,r,i.minChar,!1),s=e.findEnclosingScopeAt(this.logger,t,r,i.limChar,!1);if(null==o||null==s)return this.logger.log(" Bailing out because containing scopes cannot be determined"),null;if(o.scopeStartAST!==s.scopeStartAST)return this.logger.log(" Bailing out because edit overlaps 2 disctint scopes"),null;var a=o.scopeStartAST.limChar-o.scopeStartAST.minChar+i.delta;return 0>=a?(this.logger.log(" Bailing out because scope has been entirely removed from new source text"),null):o},t.prototype.attemptIncrementalUpdateUnit=function(t,n,r,i){if(this.logger.log('attemptIncrementalUpdateUnit("'+n+'")'),null===i)throw new Error("editRange should be valid");var o=this.getEnclosingScopeContextIfSingleScopeEdit(t,n,r,i);if(null===o)return null;var s=o.scopeStartAST.limChar-o.scopeStartAST.minChar+i.delta;if(s>=r.getLength()/2)return this.logger.log(" Bailing out because range of scope to reparse ("+s+" characters) is greater than half the size of the source text"),null;var a=[],l=function(t,n,r,i){a.push(new e.ErrorEntry(i,t,t+n,r))},c=e.quickParse(this.logger,o.scopeStartAST,r,o.scopeStartAST.minChar,o.scopeStartAST.minChar+s,l);if(c.endLexState!=e.LexState.Start)return this.logger.log(" Bailing out because scope contains unterminated comment"),null;var u=c.Script;if(0!==u.vars.members.length)return this.logger.log(" Bailing out because new source text defines variables"),null;if(1!==u.bod.members.length)return this.logger.log(" Bailing out because new source text defines more than one scope (or none)"),null;var p=o.scopeStartAST,h=u.bod.members[0];return p.nodeType!=h.nodeType?(this.logger.log(" Bailing out because new source text does not define the same scope type as the existing scope"),null):p.leftCurlyCount&&p.rightCurlyCount?p.leftCurlyCount!==h.leftCurlyCount?(this.logger.log(" Bailing out because new source text contains more (or fewer) left curly braces"),null):p.rightCurlyCount!==h.rightCurlyCount?(this.logger.log(" Bailing out because new source text contains more (or fewer) right curly braces"),null):0!==h.minChar?(this.logger.log(" Bailing out because new function declaration does not start at position 0"),null):h.limChar!==s?(this.logger.log(" Bailing out because new function declaration does not end at the new end position"),null):e.UpdateUnitResult.singleScopeEdits(t,u,p,h,i,a):(this.logger.log(" Bailing out because sopce doesn't have left/right curly count"),null)},t.prototype.mergeTrees=function(t){var n=this;e.timeFunction(this.logger,"mergeTrees()",function(){var r=new e.ScriptEditRange(t.scope1.minChar,t.scope1.limChar,t.editRange.delta);n.applyDeltaPosition(t.script1,r.limChar,r.delta),n.applyDeltaPosition(t.script2,0,r.minChar),n.mergeLocationInfo(t.script1,t.script2,r),n.replaceAST(t.script1,t.scope1,t.scope2)})},t.prototype.replaceAST=function(t,n,r){var i=this,o=function(t,o,s){return t===n?(r.preComments=t.preComments,r.postComments=t.postComments,i.logger.log("replaced old AST node with new one in script AST"),s.options.stopWalk(),r):(e.isValidAstNode(t)&&(t.limCharn.limChar)&&(s.options.goChildren=!1),t)};e.getAstWalkerFactory().walk(t,o)},t.prototype.mergeLocationInfo=function(e,t,n){var r=e.locationInfo.lineMap,i=t.locationInfo.lineMap;this.logger.information()&&(this.logger.log("lineMap1 (before):"),this.astLogger.logLinemap(r),this.logger.log("lineMap2 (quick parse):"),this.astLogger.logLinemap(i),this.logger.log("EditRange="+n));for(var o=2,s=2,a=r.length,l=i.length;a>o;)r[o]<=n.minChar?o++:r[o]>=n.limChar?(r[o]+=n.delta,o++):l>s?(r.splice(o,0,i[s]+n.minChar),o++,a++,s++):(r.splice(o,1),a--);if(l>s){if(r[a-1]>=i[s]+n.minChar)for(o=2;a>o&&l>s;)r[o]s;s++)r.push(i[s]+n.minChar)}this.logger.information()&&(this.logger.log("lineMap1 (after merge):"),this.astLogger.logLinemap(r))},t.prototype.applyDeltaPosition=function(t,n,r){var i=function(e){-1!==e.minChar&&e.minChar>=n&&(e.minChar+=r),-1!==e.limChar&&e.limChar>=n&&(e.limChar+=r)},o=function(e){if(e&&e.length>0)for(var t=0;t0){for(var r=0;r=0&&(this.emitDeclFlags(e.ToDeclFlags(n.varFlags),"var"),this.varListCount=-this.varListCount),this.declFile.Write(n.id.text));var i=null;n.typeExpr&&n.typeExpr.type?i=n.typeExpr.type:n.sym&&(i=n.sym.getType(),i==this.checker.anyType&&(i=null)),i&&this.canEmitTypeAnnotationSignature(e.ToDeclFlags(n.varFlags))&&(this.declFile.Write(": "),this.emitTypeSignature(i)),this.varListCount>0?this.varListCount--:this.varListCount<0&&this.varListCount++,this.varListCount<0?this.declFile.Write(", "):this.declFile.WriteLine(";")}return!1},n.prototype.BlockCallback=function(e,t){return t.isStatementBlock?!1:(this.varListCount=e?t.statements.members.length:0,!0)},n.prototype.emitArgDecl=function(t,n){this.emitDeclarationComments(t,!1),this.declFile.Write(t.id.text),t.isOptionalArg()&&this.declFile.Write("?"),(t.typeExpr||t.type!=this.checker.anyType)&&this.canEmitTypeAnnotationSignature(e.ToDeclFlags(n.fncFlags))&&(this.declFile.Write(": "),this.emitTypeSignature(t.type))},n.prototype.FuncDeclCallback=function(t,n){if(!t)return!1;if(n.isAccessor())return this.emitPropertyAccessorSignature(n);var r=this.getAstDeclarationContainer().nodeType==e.NodeType.InterfaceDeclaration;if(n.bod){if(n.isConstructor){if(n.type.construct&&n.type.construct.signatures.length>1)return!1}else if(n.type.call&&n.type.call.signatures.length>1)return!1}else if(!r&&e.hasFlag(n.fncFlags,e.FncFlags.Private)&&n.type.call&&n.type.call.signatures.length>1){var i=n.type.call.signatures,o=i[0].declAST;if(o.bod&&(o=i[1].declAST),o!=n)return!1}if(!this.canEmitSignature(e.ToDeclFlags(n.fncFlags),!1))return!1;if(this.emitDeclarationComments(n),n.isConstructor)this.emitIndent(),this.declFile.Write("constructor");else{var s=n.getNameText();r?(this.emitIndent(),n.isConstructMember()?this.declFile.Write("new"):n.isCallMember()||n.isIndexerMember()||(this.declFile.Write(s),e.hasFlag(n.name.flags,e.ASTFlags.OptionalName)&&this.declFile.Write("? "))):(this.emitDeclFlags(e.ToDeclFlags(n.fncFlags),"function"),"__missing"==s&&n.name&&n.name.isMissing()?n.isConstructMember()&&this.declFile.Write("new"):this.declFile.Write(s))}if(n.isIndexerMember()?this.declFile.Write("["):this.declFile.Write("("),this.indenter.increaseIndent(),n.arguments){var a=n.arguments.members.length;n.variableArgList&&a--;for(var l=0;a>l;l++){var c=n.arguments.members[l];this.emitArgDecl(c,n),a-1>l&&this.declFile.Write(", ")}}if(n.variableArgList){var u=n.arguments.members[n.arguments.members.length-1];n.arguments.members.length>1?this.declFile.Write(", ..."):this.declFile.Write("..."),this.emitArgDecl(u,n)}return this.indenter.decreaseIndent(),n.isIndexerMember()?this.declFile.Write("]"):this.declFile.Write(")"),n.isConstructor||!n.returnTypeAnnotation&&n.signature.returnType.type==this.checker.anyType||!this.canEmitTypeAnnotationSignature(e.ToDeclFlags(n.fncFlags))||(this.declFile.Write(": "),this.emitTypeSignature(n.signature.returnType.type)),this.declFile.WriteLine(";"),!1},n.prototype.emitBaseList=function(e,t){if(e&&e.members.length>0){this.declFile.Write(" "+t+" ");for(var n=e.members.length,r=0;n>r;r++){var i=e.members[r]; i.type.symbol;var o=i.type;r>0&&this.declFile.Write(", "),this.emitTypeSignature(o)}}},n.prototype.emitPropertyAccessorSignature=function(t){var n=t.accessorSymbol;if(n.getter&&n.getter.declAST!=t)return!1;this.emitDeclarationComments(n),this.emitDeclFlags(e.ToDeclFlags(n.flags),"var"),this.declFile.Write(t.name.text);var r=n.getType();return this.canEmitTypeAnnotationSignature(e.ToDeclFlags(n.flags))&&(this.declFile.Write(" : "),this.emitTypeSignature(r)),this.declFile.WriteLine(";"),!1},n.prototype.emitClassMembersFromConstructorDefinition=function(t){if(t.arguments){var n=t.arguments.members.length;t.variableArgList&&n--;for(var r=0;n>r;r++){var i=t.arguments.members[r];e.hasFlag(i.varFlags,e.VarFlags.Property)&&(this.emitDeclarationComments(i),this.emitDeclFlags(e.ToDeclFlags(i.varFlags),"var"),this.declFile.Write(i.id.text),i.typeExpr&&this.canEmitTypeAnnotationSignature(e.ToDeclFlags(i.varFlags))&&(this.declFile.Write(": "),this.emitTypeSignature(i.type)),this.declFile.WriteLine(";"))}}},n.prototype.ClassDeclarationCallback=function(t,n){if(!this.canEmitPrePostAstSignature(e.ToDeclFlags(n.varFlags),n,t))return!1;if(t){var r=n.name.text;this.emitDeclarationComments(n),this.emitDeclFlags(e.ToDeclFlags(n.varFlags),"class"),this.declFile.Write(r),this.emitBaseList(n.extendsList,"extends"),this.emitBaseList(n.implementsList,"implements"),this.declFile.WriteLine(" {"),this.pushDeclarationContainer(n),this.indenter.increaseIndent(),n.constructorDecl&&this.emitClassMembersFromConstructorDefinition(n.constructorDecl)}else this.indenter.decreaseIndent(),this.popDeclarationContainer(n),this.emitIndent(),this.declFile.WriteLine("}");return!0},n.prototype.InterfaceDeclarationCallback=function(t,n){if(!this.canEmitPrePostAstSignature(e.ToDeclFlags(n.varFlags),n,t))return!1;if(t){var r=n.name.text;this.emitDeclarationComments(n),this.emitDeclFlags(e.ToDeclFlags(n.varFlags),"interface"),this.declFile.Write(r),this.emitBaseList(n.extendsList,"extends"),this.declFile.WriteLine(" {"),this.indenter.increaseIndent(),this.pushDeclarationContainer(n)}else this.indenter.decreaseIndent(),this.popDeclarationContainer(n),this.emitIndent(),this.declFile.WriteLine("}");return!0},n.prototype.ImportDeclarationCallback=function(e,t){return e&&this.declarationContainerStack[0].isExternallyVisibleSymbol(t.id.sym)&&(this.emitDeclarationComments(t),this.emitIndent(),this.declFile.Write("import "),this.declFile.Write(t.id.text+" = "),t.isDynamicImport?this.declFile.WriteLine("module ("+t.getAliasName()+");"):this.declFile.WriteLine(t.getAliasName()+";")),!1},n.prototype.emitEnumSignature=function(t){if(!this.canEmitSignature(e.ToDeclFlags(t.modFlags)))return!1;this.emitDeclarationComments(t),this.emitDeclFlags(e.ToDeclFlags(t.modFlags),"enum"),this.declFile.WriteLine(t.name.text+" {"),this.indenter.increaseIndent();for(var n=t.members.members.length,r=1;n>r;r++){var i=t.members.members[r];i.nodeType==e.NodeType.VarDecl?(this.emitDeclarationComments(i),this.emitIndent(),this.declFile.WriteLine(i.id.text+",")):e.CompilerDiagnostics.assert(i.nodeType!=e.NodeType.Asg,"We want to catch this")}return this.indenter.decreaseIndent(),this.emitIndent(),this.declFile.WriteLine("}"),!1},n.prototype.ModuleDeclarationCallback=function(n,r){if(e.hasFlag(r.modFlags,e.ModuleFlags.IsWholeFile)){if(e.hasFlag(r.modFlags,e.ModuleFlags.IsDynamic))if(n){if(!this.emitOptions.outputMany){this.singleDeclFile=this.declFile,e.CompilerDiagnostics.assert(0==this.indenter.indentAmt,"Indent has to be 0 when outputing new file");var i=this.emitOptions.mapOutputFileName(e.stripQuotes(r.name.sym.name),e.TypeScriptCompiler.mapToDTSFileName),o=r.containsUnicodeChar||this.emitOptions.emitComments&&r.containsUnicodeCharInComment;try{this.declFile=new t(this.emitOptions.ioHost.createFile(i,o))}catch(s){this.errorReporter.emitterError(null,s.message)}}this.pushDeclarationContainer(r)}else{if(!this.emitOptions.outputMany){e.CompilerDiagnostics.assert(this.singleDeclFile!=this.declFile,"singleDeclFile cannot be null as we are going to revert back to it"),e.CompilerDiagnostics.assert(0==this.indenter.indentAmt,"Indent has to be 0 when outputing new file");try{this.declFile.Close()}catch(s){this.errorReporter.emitterError(null,s.message)}this.declFile=this.singleDeclFile}this.popDeclarationContainer(r)}return!0}if(r.isEnum())return n&&this.emitEnumSignature(r),!1;if(!this.canEmitPrePostAstSignature(e.ToDeclFlags(r.modFlags),r,n))return!1;if(n){this.emitDottedModuleName()?this.dottedModuleEmit+=".":this.dottedModuleEmit=this.getDeclFlagsString(e.ToDeclFlags(r.modFlags),"module"),this.dottedModuleEmit+=r.name.text;var a=1==r.members.members.length&&r.members.members[0].nodeType==e.NodeType.ModuleDeclaration&&!r.members.members[0].isEnum()&&e.hasFlag(r.members.members[0].modFlags,e.ModuleFlags.Exported),l=r.getDocComments();a=a&&(null==l||0==l.length),this.isDottedModuleName.push(a),this.pushDeclarationContainer(r),a||(this.emitDeclarationComments(r),this.declFile.Write(this.dottedModuleEmit),this.declFile.WriteLine(" {"),this.indenter.increaseIndent())}else this.emitDottedModuleName()||(this.indenter.decreaseIndent(),this.emitIndent(),this.declFile.WriteLine("}")),this.popDeclarationContainer(r),this.isDottedModuleName.pop();return!0},n.prototype.ScriptCallback=function(t,n){if(t){if(this.emitOptions.outputMany)for(var r=0;r')}this.pushDeclarationContainer(n)}else this.popDeclarationContainer(n);return!0},n.prototype.DefaultCallback=function(t,n){return!e.hasFlag(n.flags,e.ASTFlags.IsStatement)},n}();e.DeclarationEmitter=n}(TypeScript||(TypeScript={}));var TypeScript;!function(e){!function(e){e._map=[],e._map[0]="Unknown",e.Unknown=0,e._map[1]="NoEdits",e.NoEdits=1,e._map[2]="EditsInsideSingleScope",e.EditsInsideSingleScope=2}(e.UpdateUnitKind||(e.UpdateUnitKind={}));var t=e.UpdateUnitKind,n=function(){function e(e,t,n){this.minChar=e,this.limChar=t,this.delta=n}return e.unknown=function(){return new e(-1,-1,-1)},e.prototype.isUnknown=function(){return-1===this.minChar&&-1===this.limChar&&-1===this.delta},e.prototype.containsPosition=function(e){return this.minChar<=e&&er;r++){var o=n.parseErrors[r];this.parser.errorCallback&&this.parser.errorCallback(o.minChar,o.limChar-o.minChar,o.message,o.unitIndex)}return!0;case t.EditsInsideSingleScope:return new e.IncrementalParser(this.logger).mergeTrees(n),!0}},n.prototype.partialUpdateUnit=function(e,t,n){var o=this;return this.timeFunction("partialUpdateUnit("+t+")",function(){for(var s=0,a=o.units.length;a>s;s++)if(o.units[s].filename==t){if(o.scripts.members[s].isResident)return r.noEdits(s);n&&o.parser.setErrorRecovery(null);var l,c=[],u=function(e,t,n,r){c.push(new i(r,e,e+t,n))},p=o.parser.errorCallback;p&&(o.parser.errorCallback=u);var h=o.scripts.members[s],d=o.parser.parse(e,t,s);return p&&(o.parser.errorCallback=p),l=r.unknownEdits(h,d,c)}throw new Error('Unknown file "'+t+'"')})},n.prototype.addUnit=function(t,n,r,i){return"undefined"==typeof r&&(r=!1),"undefined"==typeof i&&(i=[]),this.addSourceUnit(new e.StringSourceText(t),n,r,i)},n.prototype.addSourceUnit=function(t,n,r,i){"undefined"==typeof i&&(i=[]);var o=this;return this.timeFunction("addSourceUnit("+n+", "+r+")",function(){var s=o.parser.parse(t,n,o.units.length,e.AllowedElements.Global);s.referencedFiles=i,s.isResident=r,o.persistentTypeState.setCollectionMode(r?e.TypeCheckCollectionMode.Resident:e.TypeCheckCollectionMode.Transient);var a=o.units.length;return o.units[a]=s.locationInfo,o.typeChecker.collectTypes(s),o.scripts.append(s),s})},n.prototype.parseUnit=function(t,n){return this.parseSourceUnit(new e.StringSourceText(t),n)},n.prototype.parseSourceUnit=function(e,t){this.parser.setErrorRecovery(this.errorOutput);var n=this.parser.parse(e,t,0),r=this.units.length;this.units[r]=n.locationInfo,this.typeChecker.collectTypes(n),this.scripts.append(n)},n.prototype.typeCheck=function(){var t=this;return this.timeFunction("typeCheck()",function(){var n=new e.Binder(t.typeChecker);t.typeChecker.units=t.units,n.bind(t.typeChecker.globalScope,t.typeChecker.globals),n.bind(t.typeChecker.globalScope,t.typeChecker.ambientGlobals),n.bind(t.typeChecker.globalScope,t.typeChecker.globalTypes),n.bind(t.typeChecker.globalScope,t.typeChecker.ambientGlobalTypes),t.typeFlow=new e.TypeFlow(t.logger,t.typeChecker.globalScope,t.parser,t.typeChecker);var r=0,i=null,o=t.scripts.members.length;for(t.persistentTypeState.setCollectionMode(e.TypeCheckCollectionMode.Resident),r=0;o>r;r++)i=t.scripts.members[r],i.isResident&&!i.hasBeenTypeChecked&&(t.typeFlow.assignScopes(i),t.typeFlow.initLibs());for(r=0;o>r;r++)i=t.scripts.members[r],i.isResident&&!i.hasBeenTypeChecked&&(t.typeFlow.typeCheck(i),i.hasBeenTypeChecked=!0);for(t.persistentTypeState.setCollectionMode(e.TypeCheckCollectionMode.Transient),o=t.scripts.members.length,r=0;o>r;r++)i=t.scripts.members[r],i.isResident||(t.typeFlow.assignScopes(i),t.typeFlow.initLibs());for(r=0;o>r;r++)i=t.scripts.members[r],i.isResident||t.typeFlow.typeCheck(i);return null})},n.prototype.cleanASTTypesForReTypeCheck=function(t){function n(t){if(t.type=null,t.nodeType==e.NodeType.VarDecl){var n=t;n.sym=null}else if(t.nodeType==e.NodeType.ArgDecl){var r=t;r.sym=null}else if(t.nodeType==e.NodeType.Name){var i=t;i.sym=null}else if(t.nodeType==e.NodeType.FuncDecl){var o=t;o.signature=null,o.freeVariables=new Array,o.symbols=null,o.accessorSymbol=null,o.scopeType=null}else if(t.nodeType==e.NodeType.ModuleDeclaration){var s=t;s.mod=null}else t.nodeType==e.NodeType.With?t.withSym=null:t.nodeType==e.NodeType.Catch?t.containedScope=null:t.nodeType===e.NodeType.Script&&(t.externallyVisibleImportedSymbols=[]);return t}e.getAstWalkerFactory().walk(t,n)},n.prototype.cleanTypesForReTypeCheck=function(){var e=this;return this.timeFunction("cleanTypesForReTypeCheck()",function(){for(var t=0,n=e.scripts.members.length;n>t;t++){var r=e.scripts.members[t];r.isResident||(e.cleanASTTypesForReTypeCheck(r),e.typeChecker.collectTypes(r))}return null})},n.prototype.attemptIncrementalTypeCheck=function(){return this.timeFunction("attemptIncrementalTypeCheck()",function(){return!1})},n.prototype.reTypeCheck=function(){var t=this;return this.timeFunction("reTypeCheck()",function(){return e.CompilerDiagnostics.analysisPass++,t.initTypeChecker(t.errorOutput),t.persistentTypeState.setCollectionMode(e.TypeCheckCollectionMode.Transient),t.cleanTypesForReTypeCheck(),t.typeCheck()})},n.prototype.isDynamicModuleCompilation=function(){for(var e=0,t=this.scripts.members.length;t>e;e++){var n=this.scripts.members[e];if(!n.isDeclareFile&&null!=n.topLevelMod)return!0}return!1},n.prototype.updateCommonDirectoryPath=function(){for(var t=[],n=-1,r=0,i=this.scripts.members.length;i>r;r++){var o=this.scripts.members[r];if(o.emitRequired(this.emitSettings)){var s=o.locationInfo.filename,a=e.filePathComponents(s);if(-1==n)t=a,n=t.length;else{for(var l=!1,c=0;n>c&&ct;t++){var r=this.scripts.members[t];this.emitSettings.outputMany||null==e?e=this.emitDeclarationsUnit(r,!this.emitSettings.outputMany):this.emitDeclarationsUnit(r,!0,e)}e&&e.Close()}},n.mapToFileNameExtension=function(e,t,n){if(n)return t;var r=t.split(".");return r.pop(),r.join(".")+e},n.mapToJSFileName=function(e,t){return n.mapToFileNameExtension(".js",e,t)},n.prototype.emitUnit=function(t,r,i,o){if(!t.emitRequired(this.emitSettings))return null;var s=t.locationInfo.filename;if(i)this.settings.mapSourceFiles&&i.setSourceMappings(new e.SourceMapper(s,i.emittingFileName,i.outfile,i.sourceMapper.sourceMapOut,this.errorReporter,this.settings.emitFullSourceMapPath));else{var a=this.emitSettings.mapOutputFileName(s,n.mapToJSFileName),l=this.createFile(a,this.useUTF8ForFile(t));i=new e.Emitter(this.typeChecker,a,l,this.emitSettings,this.errorReporter),this.settings.mapSourceFiles&&i.setSourceMappings(new e.SourceMapper(s,a,l,this.createFile(a+e.SourceMapper.MapFileExtension,!1),this.errorReporter,this.settings.emitFullSourceMapPath)),o&&o(t.locationInfo.unitIndex,a)}return this.typeChecker.locationInfo=t.locationInfo,i.emitJavascript(t,e.TokenID.Comma,!1),r?i:(i.Close(),null)},n.prototype.emit=function(e,t){this.parseEmitOption(e);for(var n=null,r=0,i=this.scripts.members.length;i>r;r++){var o=this.scripts.members[r];this.emitSettings.outputMany||null==n?n=this.emitUnit(o,!this.emitSettings.outputMany,null,t):this.emitUnit(o,!0,n)}n&&n.Close()},n.prototype.emitToOutfile=function(t){if(this.settings.mapSourceFiles)throw Error("Cannot generate source map");if(this.settings.generateDeclarationFiles)throw Error("Cannot generate declaration files");if(""!=this.settings.outputOption)throw Error("Cannot parse output option");for(var n=n=new e.Emitter(this.typeChecker,"stdout",t,this.emitSettings,this.errorReporter),r=0,i=this.scripts.members.length;i>r;r++){var o=this.scripts.members[r];this.typeChecker.locationInfo=o.locationInfo,n.emitJavascript(o,e.TokenID.Comma,!1)}},n.prototype.emitAST=function(t){this.parseEmitOption(t);for(var r=null,i=null,o=0,s=this.scripts.members.length;s>o;o++){var a=this.scripts.members[o];if(this.emitSettings.outputMany||null==i){var l=this.units[o].filename,c=function(e,t){return n.mapToFileNameExtension(".txt",e,t)},u=this.emitSettings.mapOutputFileName(l,c);r=this.createFile(u,this.useUTF8ForFile(a)),i=new e.PrintContext(r,this.parser)}if(e.getAstWalkerFactory().walk(a,e.prePrintAST,e.postPrintAST,null,i),this.emitSettings.outputMany)try{r.Close()}catch(p){this.errorReporter.emitterError(null,p.message)}}if(!this.emitSettings.outputMany)try{r.Close()}catch(p){this.errorReporter.emitterError(null,p.message)}},n.prototype.outputScriptToUTF8=function(e){return e.containsUnicodeChar||this.emitSettings.emitComments&&e.containsUnicodeCharInComment},n.prototype.outputScriptsToUTF8=function(e){for(var t=0,n=e.length;n>t;t++){var r=e[t];if(this.outputScriptToUTF8(r))return!0}return!1},n.prototype.createFile=function(e,t){try{return this.emitSettings.ioHost.createFile(e,t)}catch(n){this.errorReporter.emitterError(null,n.message)}},n}();e.TypeScriptCompiler=o;var s=function(){function e(e,t,n){this.name=e,this.type=t,this.sym=n}return e}();e.ScopeEntry=s;var a=function(){function t(e){this.compiler=e}return t.prototype.getScope=function(e){return e.enclosingObjectLit&&e.isMemberCompletion?e.getObjectLiteralScope():e.isMemberCompletion?e.useFullAst?this.compiler.typeFlow.findMemberScopeAtFullAst(e):this.compiler.typeFlow.findMemberScopeAt(e):e.getScope()},t.prototype.getScopeEntries=function(t,n){var r=this.getScope(t);if(null==r)return[];for(var i=new e.StringHashTable,o=r.getAllSymbolNames(t.isMemberCompletion),s=0;st;if(i){for(var o=t>>1,s=0;o>s;s++)r(s);n+="(...)";for(var s=e.length-o;ss;s++)r(s)}return n}!function(e){function t(t){e.diagnosticWriter&&e.diagnosticWriter.Alert(t)}function n(n){e.debug&&t(n)}function r(n,r){e.debug&&(n||t(r))}e.debug=!1,e.diagnosticWriter=null,e.analysisPass=0,e.Alert=t,e.debugPrint=n,e.assert=r}(e.CompilerDiagnostics||(e.CompilerDiagnostics={})),e.CompilerDiagnostics;var r=function(){function e(){}return e.prototype.information=function(){return!1},e.prototype.debug=function(){return!1},e.prototype.warning=function(){return!1},e.prototype.error=function(){return!1},e.prototype.fatal=function(){return!1},e.prototype.log=function(){},e}();e.NullLogger=r;var i=function(){function e(e){this.logger=e,this._information=this.logger.information(),this._debug=this.logger.debug(),this._warning=this.logger.warning(),this._error=this.logger.error(),this._fatal=this.logger.fatal()}return e.prototype.information=function(){return this._information},e.prototype.debug=function(){return this._debug},e.prototype.warning=function(){return this._warning},e.prototype.error=function(){return this._error},e.prototype.fatal=function(){return this._fatal},e.prototype.log=function(e){this.logger.log(e)},e}();e.LoggerAdapter=i;var o=function(){function e(){this.logContents=[]}return e.prototype.information=function(){return!1},e.prototype.debug=function(){return!1},e.prototype.warning=function(){return!1},e.prototype.error=function(){return!1},e.prototype.fatal=function(){return!1},e.prototype.log=function(e){this.logContents.push(e)},e}();e.BufferedLogger=o,e.timeFunction=t,e.stringToLiteral=n}(TypeScript||(TypeScript={}));var Services;!function(e){var t=function(){function e(e){this.host=e,this.scanner=new TypeScript.Scanner}return e.prototype.getClassificationsForLine=function(e,t){var i=new n;i.initialState=t,this.scanner.lexState=t,this.scanner.setText(e,TypeScript.LexMode.Line);for(var o=this.scanner.scanInLine();o.tokenId!=TypeScript.TokenID.EndOfFile;)i.entries.push(new r(this.scanner.pos,o.classification())),o=this.scanner.scanInLine();return i.finalLexState=this.scanner.lexState,i},e}();e.Classifier=t;var n=function(){function e(){this.initialState=TypeScript.LexState.Start,this.finalLexState=TypeScript.LexState.Start,this.entries=[]}return e}();e.ClassificationResult=n;var r=function(){function e(e,t){this.length=e,this.classification=t}return e}();e.ClassificationInfo=r}(Services||(Services={}));var Services;!function(e){function t(e,t){e.log("*INTERNAL ERROR* - Exception in typescript services: "+t.message)}e.logInternalError=t;var n=function(){function e(e,t){this.host=e,this.scriptIndex=t}return e.prototype.getText=function(e,t){return this.host.getScriptSourceText(this.scriptIndex,e,t)},e.prototype.getLength=function(){return this.host.getScriptSourceLength(this.scriptIndex)},e}();e.SourceTextAdapter=n;var r=function(){function e(e,t){this.length=e.getScriptSourceLength(t),this.text=e.getScriptSourceText(t,0,this.length)}return e.prototype.getText=function(e,t){return this.text.substring(e,t)},e.prototype.getLength=function(){return this.length},e}();e.CachedSourceTextAdapter=r;var i=function(){function e(e,t,n){this.sourceText=e,this.minChar=t,this.limChar=n}return e.prototype.getText=function(e,t){var n=this.minChar+e,r=this.minChar+t;return r>this.limChar&&(r=this.limChar),this.sourceText.getText(n,r)},e.prototype.getLength=function(){return this.limChar-this.minChar},e}();e.SourceTextRange=i;var o=function(){function e(e,t,n){this.unitIndex=e,this.ast=t,this.isWriteAccess=n}return e.prototype.getHashCode=function(){return TypeScript.combineHashes(TypeScript.numberHashFn(this.unitIndex),TypeScript.combineHashes(TypeScript.numberHashFn(this.ast.minChar),TypeScript.numberHashFn(this.ast.limChar)))},e.prototype.equals=function(e){return null===e||void 0===e?!1:this.unitIndex===e.unitIndex&&this.ast.minChar===e.ast.minChar&&this.ast.limChar===e.ast.limChar},e}();e.ReferenceEntry=o;var s=function(){function e(){this.entries=[],this.hashTable=new TypeScript.HashTable(101,function(e){return e.getHashCode()},function(e,t){return e.equals(t)})}return e.prototype.getEntries=function(){return this.entries},e.prototype.addAst=function(e,t,n){var r=new o(e,t,n);null===this.hashTable.lookup(r)&&(this.hashTable.add(r,r),this.entries.push(r))},e.prototype.addSymbol=function(e){var t=e.unitIndex;if(!(0>t)){var n=e.declAST;if(null!=n){var r;switch(n.nodeType){case TypeScript.NodeType.InterfaceDeclaration:r=n.name;break;case TypeScript.NodeType.ClassDeclaration:r=n.name;break;case TypeScript.NodeType.ModuleDeclaration:r=n.name;break;case TypeScript.NodeType.VarDecl:r=n.id;break;case TypeScript.NodeType.FuncDecl:r=n.name;break;default:r=n}null===r&&(r=n),this.addAst(t,r,!1)}}},e}();e.ReferenceEntrySet=s;var a=function(){function e(){this.name="",this.kind="",this.kindModifiers="",this.matchKind="",this.unitIndex=-1,this.minChar=-1,this.limChar=-1,this.containerName="",this.containerKind=""}return e}();e.NavigateToItem=a;var l=function(){function e(){this.options=new TypeScript.AstWalkOptions,this.unitIndex=0,this.containerSymbols=[],this.containerKinds=[],this.containerASTs=[],this.path=new TypeScript.AstPath,this.result=[]}return e}();e.NavigateToContext=l;var c=function(){function e(e,t){this.minChar=e,this.limChar=t}return e}();e.TextRange=c;var u=function(){function e(e,t,n){this.minChar=e,this.limChar=t,this.text=n}return e.createInsert=function(t,n){return new e(t,t,n)},e.createDelete=function(t,n){return new e(t,n,"")},e.createReplace=function(t,n,r){return new e(t,n,r)},e}();e.TextEdit=u;var p=function(){function e(){this.IndentSize=4,this.TabSize=4,this.NewLineCharacter="\r\n",this.ConvertTabsToSpaces=!0}return e}();e.EditorOptions=p;var h=function(e){function t(){e.apply(this,arguments),this.InsertSpaceAfterCommaDelimiter=!0,this.InsertSpaceAfterSemicolonInForStatements=!0,this.InsertSpaceBeforeAndAfterBinaryOperators=!0,this.InsertSpaceAfterKeywordsInControlFlowStatements=!0,this.InsertSpaceAfterFunctionKeywordForAnonymousFunctions=!1,this.InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis=!1,this.PlaceOpenBraceOnNewLineForFunctions=!1,this.PlaceOpenBraceOnNewLineForControlBlocks=!1}return __extends(t,e),t}(p);e.FormatCodeOptions=h;var d=function(){function e(){this.scope=[]}return e}();e.GetReferencesContext=d;var f=function(){function e(e,t,n,r,i,o,s){this.unitIndex=e,this.minChar=t,this.limChar=n,this.kind=r,this.name=i,this.containerKind=o,this.containerName=s}return e}();e.DefinitionInfo=f;var m=function(){function e(e,t,n,r,i,o){this.memberName=e,this.docComment=t,this.fullSymbolName=n,this.kind=r,this.minChar=i,this.limChar=o}return e}();e.TypeInfo=m;var g=function(){function e(e,t,n){"undefined"==typeof n&&(n=null),this.minChar=e,this.limChar=t,this.text=n}return e}();e.SpanInfo=g;var y=function(){function e(){}return e}();e.SignatureInfo=y;var v=function(){function e(){this.signatureGroup=[]}return e}();e.FormalSignatureInfo=v;var T=function(){function e(){this.parameters=[]}return e}();e.FormalSignatureItemInfo=T;var b=function(){function e(){}return e}();e.FormalParameterInfo=b;var k=function(){function e(){this.parameters=[]}return e}();e.ActualSignatureInfo=k;var S=function(){function e(){}return e}();e.ActualParameterInfo=S;var C=function(){function e(){this.maybeInaccurate=!1,this.isMemberCompletion=!1,this.entries=[]}return e}();e.CompletionInfo=C;var w=function(){function e(){this.name="",this.type="",this.kind="",this.kindModifiers="",this.fullSymbolName="",this.docComment=""}return e}();e.CompletionEntry=w;var _=function(){function e(){}return e.unknown="",e.keyword="keyword",e.scriptElement="script",e.moduleElement="module",e.classElement="class",e.interfaceElement="interface",e.enumElement="enum",e.variableElement="var",e.localVariableElement="local var",e.functionElement="function",e.localFunctionElement="local function",e.memberFunctionElement="method",e.memberGetAccessorElement="getter",e.memberSetAccessorElement="setter",e.memberVariableElement="property",e.constructorImplementationElement="constructor",e.callSignatureElement="call",e.indexSignatureElement="index",e.constructSignatureElement="construct",e.parameterElement="parameter",e}();e.ScriptElementKind=_;var E=function(){function e(){}return e.none="",e.publicMemberModifier="public",e.privateMemberModifier="private",e.exportedModifier="export",e.ambientModifier="declare",e.staticModifier="static",e}();e.ScriptElementKindModifier=E;var x=function(){function e(){}return e.none=null,e.exact="exact",e.subString="substring",e.prefix="prefix",e}();e.MatchKind=x;var N=function(){function e(){this.version=-1,this.syntaxAST=null,this.fileName=null}return e}();e.ScriptSyntaxASTState=N;var L=function(){function t(t){this.host=t,this.logger=this.host,this.compilerState=new e.CompilerState(this.host),this.syntaxASTState=new N,this.formattingRulesProvider=new Formatting.RulesProvider(this.logger)}return t.prototype.refresh=function(){var e=this;TypeScript.timeFunction(this.logger,"refresh()",function(){e.compilerState.refresh()})},t.prototype.minimalRefresh=function(){var e=this;TypeScript.timeFunction(this.logger,"minimalRefresh()",function(){e.compilerState.minimalRefresh()})},t.prototype.getSymbolTree=function(){return this.refresh(),this.compilerState.getSymbolTree()},t.prototype.getScriptSyntaxAST=function(e){return this.minimalRefresh(),this._getScriptSyntaxAST(e)},t.prototype._getScriptSyntaxAST=function(e){var t=this;return TypeScript.timeFunction(this.logger,'getScriptSyntaxAST("'+e+'")',function(){var n=t.compilerState.getScriptVersion(e),r=t.syntaxASTState.syntaxAST;return null===r||t.syntaxASTState.fileName!==e?r=t.compilerState.getScriptSyntaxAST(e):t.syntaxASTState.version!==n&&(r=t.attemptIncrementalSyntaxAST(t.syntaxASTState),null===r&&(r=t.compilerState.getScriptSyntaxAST(e))),t.syntaxASTState.version=n,t.syntaxASTState.fileName=e,t.syntaxASTState.syntaxAST=r,t.syntaxASTState.syntaxAST})},t.prototype.attemptIncrementalSyntaxAST=function(t){var n=t.syntaxAST,r=n.getScriptId(),i=this.compilerState.getSourceText2(r),o=this.compilerState.getScriptEditRangeSinceVersion(r,t.version);if(null===o)return n;var s=new TypeScript.IncrementalParser(this.logger),a=s.attemptIncrementalUpdateUnit(n.getScript(),n.getScriptId(),i,o);return null!==a&&a.kind===TypeScript.UpdateUnitKind.EditsInsideSingleScope?(s.mergeTrees(a),new e.ScriptSyntaxAST(this.logger,a.script1,i)):null },t.prototype.getScriptAST=function(e){return this.refresh(),this.compilerState.getScriptAST(e)},t.prototype.getTypeInfo=function(e,t,n,r){var i=null,o="",s="",a="",l=r.getScope();if(n.ast.nodeType==TypeScript.NodeType.Dot)return null;if(t.declAST&&t.declAST.nodeType==TypeScript.NodeType.FuncDecl&&t.declAST.accessorSymbol&&(t=t.declAST.accessorSymbol,e=t.getType()),n.callSignature){var c=null;c=n.isNew?e.construct:e.call;var u=new TypeScript.MemberNameArray;u.addAll(c.toStrings("",!0,l,!0,n.callSignature)),i=u,n.callSignature.declAST?(s=TypeScript.Comment.getDocCommentText(n.callSignature.declAST.getDocComments()),"_anonymous"!=n.callSignature.declAST.type.symbol.name&&(t=n.callSignature.declAST.type.symbol)):s="",o=this.getSymbolElementKind(t,l,!1),(o==_.interfaceElement||o==_.classElement)&&(o=n.isNew?_.constructorImplementationElement:_.functionElement)}else i=e.getScopedTypeNameEx(l,!0),s=this.getDocCommentOfSymbol(t),o=this.getSymbolElementKind(t,l,!0);return a=t?this.getFullNameOfSymbol(t,r):"",new m(i,s,a,o,n.ast.minChar,n.ast.limChar)},t.prototype.getTypeAtPosition=function(e,t){this.refresh();var n=this.compilerState.getScriptAST(e),r=this.compilerState.getSourceText(n),i=this.getTypeInfoAtPosition(t,n,!0);if(null==i)return this.logger.log("No type found at the specified location."),null;var o=TypeScript.findEnclosingScopeAt(this.logger,n,r,t,!1);return null==o?(this.logger.log("No context found at the specified location."),null):i.symbol?this.getTypeInfo(i.symbol.getType(),i.symbol,i,o):i.ast.type?this.getTypeInfo(i.ast.type,i.ast.type.symbol,i,o):(this.logger.log("No type found at the specified location."),null)},t.prototype.getNameOrDottedNameSpan=function(e,t){this.refresh();var n=this.compilerState.getScriptAST(e),r=this.getTypeInfoAtPosition(t,n);return null==r?(this.logger.log("No name or dotted name found at the specified location."),null):r.spanInfo},t.prototype.getBreakpointInStatement=function(e,t,n,r,i,o){if(r||!t||n&&e>t.limChar)return r;if(!o)return t;var s=t,a=null;if(s.nodeType==TypeScript.NodeType.Block){var l=s;a=l.statements}else{if(s.nodeType!=TypeScript.NodeType.List)return s;a=s}if(a.members.length>0){var c=a.members[a.members.length-1];return!i&&e>c.limChar?c:a.members[0]}return null},t.prototype.getBreakpointStatementAtPosition=function(e,t){this.refresh();var n=this.compilerState.getScriptAST(e),r=[],i=this.compilerState.getLineMap(e),o={line:-1,col:-1};TypeScript.getSourceLineColFromMap(o,t,i);var s=function(e,n,i){if(TypeScript.isValidAstNode(e))if(t>=e.minChar&&t<=e.limChar)switch(e.nodeType){case TypeScript.NodeType.ModuleDeclaration:case TypeScript.NodeType.ClassDeclaration:case TypeScript.NodeType.FuncDecl:case TypeScript.NodeType.Break:case TypeScript.NodeType.Continue:r.push(e);break;case TypeScript.NodeType.Script:case TypeScript.NodeType.List:case TypeScript.NodeType.NumberLit:case TypeScript.NodeType.Regex:case TypeScript.NodeType.QString:case TypeScript.NodeType.ArrayLit:case TypeScript.NodeType.ObjectLit:case TypeScript.NodeType.TypeAssertion:case TypeScript.NodeType.Pos:case TypeScript.NodeType.Neg:case TypeScript.NodeType.Not:case TypeScript.NodeType.LogNot:case TypeScript.NodeType.Block:break;case TypeScript.NodeType.TypeRef:i.options.goChildren=!1;break;default:!e.isStatementOrExpression()||e.isExpression()&&0!=r.length&&(r[r.length-1].isExpression()||r[r.length-1].nodeType==TypeScript.NodeType.VarDecl)&&r[r.length-1].nodeType!=TypeScript.NodeType.ConditionalExpression||r.push(e)}else i.options.goChildren=!1;return e};if(TypeScript.getAstWalkerFactory().walk(n,s),0==r.length)return null;var a=null,l=r[r.length-1],c=null;switch(l.nodeType){case TypeScript.NodeType.ModuleDeclaration:var u=l;a=r.length>1?u:this.getBreakpointInStatement(t,u.members,!1,null,!1,!0),c=u.endingToken;break;case TypeScript.NodeType.FuncDecl:var p=l;a=r.length>1?p:this.getBreakpointInStatement(t,p.bod,!1,null,!1,!0),c=p.endingToken;break;case TypeScript.NodeType.ClassDeclaration:var h=l;a=r.length>1?h:this.getBreakpointInStatement(t,h.members,!1,null,!1,!0),c=h.endingToken;break;case TypeScript.NodeType.VarDecl:var d=l;d.init&&(a=d);break;case TypeScript.NodeType.If:var f=l;a=this.getBreakpointInStatement(t,f.statement,!0,a,!1,!1),a=this.getBreakpointInStatement(t,f.thenBod,!0,a,!1,!0),a=this.getBreakpointInStatement(t,f.elseBod,!1,a,!1,!0);break;case TypeScript.NodeType.ForIn:var m=l;a=this.getBreakpointInStatement(t,m.statement,!0,a,!1,!1),a=this.getBreakpointInStatement(t,m.body,!1,a,!1,!0);break;case TypeScript.NodeType.For:var y=l;a=this.getBreakpointInStatement(t,y.init,!0,null,!1,!0),a=this.getBreakpointInStatement(t,y.cond,!0,a,!1,!0),a=this.getBreakpointInStatement(t,y.incr,!0,a,!1,!0),a=this.getBreakpointInStatement(t,y.body,!1,a,!1,!0);break;case TypeScript.NodeType.While:var v=l;a=this.getBreakpointInStatement(t,v.cond,!0,null,!1,!0),a=this.getBreakpointInStatement(t,v.body,!1,a,!1,!0);break;case TypeScript.NodeType.DoWhile:var T=l;a=this.getBreakpointInStatement(t,T.body,!0,null,!1,!0),a=this.getBreakpointInStatement(t,T.cond,!1,a,!1,!0);break;case TypeScript.NodeType.Switch:var b=l;a=this.getBreakpointInStatement(t,b.statement,!0,a,!1,!1);var k=b.caseList.members.length;if(k>0){var S=b.caseList.members[k-1];if(t>=S.limChar){var C=S;a=this.getBreakpointInStatement(t,C.body.members[0],!1,a,!1,!0)}else{var C=b.caseList.members[0];a=this.getBreakpointInStatement(t,C.body.members[0],!1,a,!0,!0)}}break;case TypeScript.NodeType.Case:var w=l;a=this.getBreakpointInStatement(t,w.body.members[0],!1,null,!1,!0);break;case TypeScript.NodeType.With:var _=l;a=this.getBreakpointInStatement(t,_.body,!1,null,!1,!0);break;case TypeScript.NodeType.Try:var E=l;a=this.getBreakpointInStatement(t,E.body,!1,null,!1,!0);break;case TypeScript.NodeType.Catch:var x=l;a=this.getBreakpointInStatement(t,x.statement,!0,null,!1,!1),a=this.getBreakpointInStatement(t,x.body,!1,a,!1,!0);break;case TypeScript.NodeType.Finally:var N=l;a=this.getBreakpointInStatement(t,N,!1,null,!1,!0);break;case TypeScript.NodeType.TryCatch:var L=l;a=this.getBreakpointInStatement(t,L.tryNode.body,!0,null,!1,!0),a=this.getBreakpointInStatement(t,L.catchNode.statement,!0,a,!1,!1),a=this.getBreakpointInStatement(t,L.catchNode.body,!1,a,!1,!0);break;case TypeScript.NodeType.TryFinally:var I=l;if(I.nodeType==TypeScript.NodeType.Try)a=this.getBreakpointInStatement(t,I.tryNode.body,!0,null,!1,!0);else{var L=I.tryNode;a=this.getBreakpointInStatement(t,L.tryNode.body,!0,null,!1,!0),a=this.getBreakpointInStatement(t,L.catchNode.statement,!0,a,!1,!1),a=this.getBreakpointInStatement(t,L.catchNode.body,!0,a,!1,!0)}a=this.getBreakpointInStatement(t,I.finallyNode,!1,a,!1,!0);break;default:a=l}if(TypeScript.isValidAstNode(c)&&t>=c.minChar&&t<=c.limChar&&(a=c),a){var A=new g(a.minChar,a.limChar);return A}return null},t.prototype.getSignatureAtPosition=function(e,t){var n=this;this.refresh();var r=this.compilerState.getScriptAST(e),i=t===r.limChar,o=this.getAstPathToPosition(r,t);if(0==o.count())return null;if(o.nodeType()===TypeScript.NodeType.Comment)return this.logger.log("position is inside a comment"),null;for(var s=null;o.count()>=2;){if(o.isArgumentListOfCall()||o.isArgumentListOfNew()){(i||t>o.ast().minChar)&&(o.pop(),s=o.pop());break}if(t>o.ast().minChar&&o.ast().nodeType!==TypeScript.NodeType.Error&&o.ast().nodeType!==TypeScript.NodeType.List)break;o.pop()}if(!s||!s.target||!s.target.type)return this.logger.log("No call expression for the given position"),null;if(s.target.type===this.compilerState.anyType())return this.logger.log("Call expression is of type 'any'"),null;var a=this.compilerState.getSourceText(r),l=TypeScript.findEnclosingScopeAt(this.logger,r,a,t,!1);if(null==l)return this.logger.log("No context found at the specified location."),null;var c=function(e){return null!=e&&"_anonymous"!=e.name?e.name:""},u=function(e){return null!=e?TypeScript.Comment.getDocCommentText(e.getDocComments()):""},p=function(e,t,r){var i=new v;i.isNew=!1,i.name=c(e),i.docComment=u(e),i.openParen=r.flags&TypeScript.SignatureFlags.IsIndexer?"[":"(",i.closeParen=r.flags&TypeScript.SignatureFlags.IsIndexer?"]":")";var o=r.signatures.length>1;return r.signatures.filter(function(e){return!(o&&e===r.definitionSignature&&!n.compilerState.getCompilationSettings().canCallDefinitionSignature)}).forEach(function(e){var t=new T;t.docComment=null!=e.declAST?TypeScript.Comment.getDocCommentText(e.declAST.getDocComments()):"",t.returnType=null===e.returnType?"any":e.returnType.type.getScopedTypeName(l.getScope()),e.parameters.forEach(function(n,r){var i=new b;i.isVariable=e.hasVariableArgList&&r===e.parameters.length-1,i.isOptional=n.isOptional(),i.name=n.name,i.docComment=n.getParameterDocComments(),i.type=n.getType().getScopedTypeName(l.getScope()),t.parameters.push(i)}),i.signatureGroup.push(t)}),i},h=function(e,t){if(!TypeScript.isValidAstNode(e))return null;if(!TypeScript.isValidAstNode(e.arguments))return null;var n=new k;return n.currentParameter=-1,n.openParenMinChar=e.arguments.minChar,n.closeParenLimChar=Math.max(e.arguments.minChar,e.arguments.limChar),e.arguments.members.forEach(function(e){var t=new S;t.minChar=e.minChar,t.limChar=Math.max(e.minChar,e.limChar),n.parameters.push(t)}),n.parameters.forEach(function(e,r){var o=0==r?n.openParenMinChar:n.parameters[r-1].limChar+1,s=r==n.parameters.length-1?n.closeParenLimChar:n.parameters[r+1].minChar;t>=o&&(i?s>=t:s>t)&&(n.currentParameter=r)}),n},d=function(e,t){return null==e||null==t||null==t.signatures?-1:t.signatures.indexOf(e.signature)},f=function(e){var t=null;if(null!=e.target.sym)t=e.target.sym;else if(null!==e.target.type.symbol)var t=e.target.type.symbol;if(null!=t){if(t.kind()==TypeScript.SymbolKind.Type&&(t.isMethod||t.isClass()||t.isFunction())&&null!=t.name)return t;if(t.kind()==TypeScript.SymbolKind.Parameter)return t;if(t.kind()==TypeScript.SymbolKind.Variable)return t;if(t.kind()==TypeScript.SymbolKind.Field)return t}return null},m=f(s),g=new y;if(s.nodeType===TypeScript.NodeType.Call&&null!==s.target.type.call)g.formal=p(m,!1,s.target.type.call),g.actual=h(s,t),g.activeFormal=d(s,s.target.type.call);else if(s.nodeType===TypeScript.NodeType.New&&null!==s.target.type.construct)g.formal=p(m,!0,s.target.type.construct),g.actual=h(s,t),g.activeFormal=d(s,s.target.type.construct);else{if(s.target.nodeType!==TypeScript.NodeType.Super||!s.target.type.symbol||!s.target.type.symbol.declAST)return this.logger.log("No signature group found for the target of the call expression"),null;var C=s.target.type.symbol.declAST.type;if(!C||null===C.construct)return this.logger.log("No signature group found for the target class type constructor"),null;g.formal=p(m,!0,C.construct),g.actual=h(s,t),g.activeFormal=d(s,C.construct)}return null==g.actual||null==g.formal||null==g.activeFormal?(this.logger.log("Can't compute actual and/or formal signature of the call expression"),null):g},t.prototype.getDefinitionAtPosition=function(e,t){this.refresh();var n=this.compilerState.getScriptAST(e),r=this.getSymbolAtPosition(n,t);if(null==r)return this.logger.log("No identifier at the specified location."),null;if(!TypeScript.isValidAstNode(r.declAST))return this.logger.log("No symbol location for identifier at the specified location."),null;var i=r.unitIndex,o=r.declAST.minChar,s=r.declAST.limChar;return new f(this.compilerState.mapToHostUnitIndex(i),o,s,this.getSymbolElementKind(r),r.name,this.getSymbolContainerKind(r),this.getSymbolContainerName(r))},t.prototype.getSmartIndentAtLineNumber=function(e,t,n){this.minimalRefresh();var r=this._getScriptSyntaxAST(e),i=new Formatting.SmartIndentManager(r,n);return i.getSmartIndentAtLineNumber(t)},t.prototype.getBraceMatchingAtPosition=function(t,n){this.minimalRefresh();var r=this._getScriptSyntaxAST(t),i=new e.BraceMatchingManager(r);return i.getBraceMatchingAtPosition(n)},t.prototype.getFullNameOfSymbol=function(e,t){if(e&&e.container&&e.container.declAST&&e.container.declAST.nodeType==TypeScript.NodeType.FuncDecl){var n=e.container.declAST;if(n.symbols.lookup(e.name)==e)return e.getPrettyName(t.getScope().container)}if(e&&e.kind()==TypeScript.SymbolKind.Type){var r=e;if(r.type&&r.type.symbol==e&&r.type.primitiveTypeClass!=TypeScript.Primitive.None)return""}return e.fullName(t.getScope())},t.prototype.getSymbolElementKind=function(e,t,n){if(!e)return _.unknown;if(null==e.declAST)return _.keyword;var r=function(){return e.container&&e.container.declAST&&e.container.declAST.nodeType==TypeScript.NodeType.FuncDecl&&t&&t.container==e.container?!0:!1},i=e.declAST;switch(i.nodeType){case TypeScript.NodeType.InterfaceDeclaration:return _.interfaceElement;case TypeScript.NodeType.ClassDeclaration:return _.classElement;case TypeScript.NodeType.ModuleDeclaration:var o=i,s=o.isEnum();return s?_.enumElement:_.moduleElement;case TypeScript.NodeType.ImportDeclaration:return _.moduleElement;case TypeScript.NodeType.VarDecl:var a=i;return a.isProperty()?_.memberVariableElement:r()?_.localVariableElement:_.variableElement;case TypeScript.NodeType.ArgDecl:var l=i;return e.kind()==TypeScript.SymbolKind.Parameter?_.parameterElement:l.isProperty()?_.memberVariableElement:_.variableElement;case TypeScript.NodeType.FuncDecl:var c=i;return c.isGetAccessor()?_.memberGetAccessorElement:c.isSetAccessor()?_.memberSetAccessorElement:c.isCallMember()?_.callSignatureElement:c.isIndexerMember()?_.indexSignatureElement:c.isConstructMember()?_.constructSignatureElement:c.isConstructor?n?_.classElement:_.constructorImplementationElement:c.isMethod()?_.memberFunctionElement:r()?_.localFunctionElement:_.functionElement;default:return this.logger.warning()&&this.logger.log("Warning: unrecognized AST node type: "+TypeScript.NodeType._map[i.nodeType]),_.unknown}},t.prototype.getSymbolElementKindModifiers=function(e){return null==e.declAST?E.none:this.getDeclNodeElementKindModifiers(e.declAST)},t.prototype.getSymbolContainerKind=function(){return""},t.prototype.getSymbolContainerName=function(e){return null==e.container?"":e.container.fullName()},t.prototype.getReferencesAtPosition=function(e,t){this.refresh();for(var n=new d,r=0,i=this.compilerState.getScriptCount();i>r;r++)n.scope.push(r);return this.getReferencesForSourceLocation(n,this.compilerState.getUnitIndex(e),t)},t.prototype.getOccurrencesAtPosition=function(e,t){this.refresh();var n=this.compilerState.getUnitIndex(e),r=new d;return r.scope.push(n),this.getReferencesForSourceLocation(r,n,t)},t.prototype.getImplementorsAtPosition=function(t,n){this.refresh();var r=this.compilerState.getScriptAST(t),i=this.getIdentifierPathToPosition(r,n);if(null===i)return this.logger.log("No identifier at the specified location."),[];var o=i.ast(),a=o.sym;if(null===a)return this.logger.log("No symbol annotation on the identifier AST."),[];var l=new e.OverridesCollector(this.getSymbolTree()),c=l.findImplementors(a),u=new s;return c.getAll().forEach(function(e){u.addSymbol(e)}),this.mapUnitIndexInReferenceEntrySet(u)},t.prototype.getReferencesForSourceLocation=function(e,t,n){var r=this.compilerState.getScript(t),i=this.getIdentifierPathToPosition(r,n);if(null===i)return this.logger.log("No identifier at the specified location."),[];var o=i.ast(),s=o.sym;return null===s?(this.logger.log("No symbol annotation on the identifier AST."),[]):this.getReferencesForSymbol(e,s)},t.prototype.isWriteAccess=function(e,t){var n=!1;if(null!==e){var r=e.nodeType;switch(r){case TypeScript.NodeType.VarDecl:null!=e.init&&(n=!0);break;case TypeScript.NodeType.ArgDecl:n=!0;break;case TypeScript.NodeType.Asg:case TypeScript.NodeType.AsgAdd:case TypeScript.NodeType.AsgSub:case TypeScript.NodeType.AsgMul:case TypeScript.NodeType.AsgDiv:case TypeScript.NodeType.AsgMod:case TypeScript.NodeType.AsgOr:case TypeScript.NodeType.AsgAnd:case TypeScript.NodeType.AsgXor:case TypeScript.NodeType.AsgLsh:case TypeScript.NodeType.AsgRsh:case TypeScript.NodeType.AsgRs2:e.operand1===t&&(n=!0);break;case TypeScript.NodeType.IncPost:case TypeScript.NodeType.IncPre:case TypeScript.NodeType.DecPost:case TypeScript.NodeType.DecPre:n=!0}}return n},t.prototype.getReferencesForSymbol=function(t,n){var r=this,i=new e.OverridesCollector(this.getSymbolTree()),o=i.findMemberOverrides(n),a=new s,l=function(e,t,n){a.addAst(e,n,r.isWriteAccess(t,n))};return n.kind()==TypeScript.SymbolKind.Field?(this.logger.log("getReferencesToField"),this.getReferencesToField(t,o,l)):n.kind()==TypeScript.SymbolKind.Parameter?(this.logger.log("getReferencesToParameter"),this.getReferencesToParameter(t,o,l)):n.kind()==TypeScript.SymbolKind.Type?(this.logger.log("getReferencesToType"),this.getReferencesToType(t,o,l)):n.kind()==TypeScript.SymbolKind.Variable?(this.logger.log("getReferencesToVariable"),this.getReferencesToVariable(t,o,l)):this.logger.log("No recognized symbol at the specified location ("+n.kind()+")."),this.mapUnitIndexInReferenceEntrySet(a)},t.prototype.mapUnitIndexInReferenceEntrySet=function(e){var t=this,n=e.getEntries();return n.forEach(function(e){e.unitIndex=t.compilerState.mapToHostUnitIndex(e.unitIndex)}),n},t.prototype.getCompletionsAtPosition=function(e,t,n){this.refresh();var r=this.getQuickCompletionsAtPosition(e,t,n);return null==r&&(this.refresh(),r=this.getAccurateCompletionsAtPosition(e,t,n)),r},t.prototype.getQuickCompletionsAtPosition=function(e,t,n){var r=this.compilerState.getScriptAST(e),i=this.compilerState.getScriptEditRange(r);if(null==i)return this.logger.log("Full refresh required: there are no pending edits for the script. Be conservative and try again with accurate algorithm."),null;var o=this.compilerState.getSourceText(r),s=new TypeScript.IncrementalParser(this.logger).getEnclosingScopeContextIfSingleScopeEdit(r,e,o,i);if(null===s)return this.logger.log("Full refresh required: range of edits may affect more than one scope"),null;if(null!==s.enclosingObjectLit)return this.logger.log("Full refresh required: quick completion list does not work inside object literals, because full typecheck is required to obtain the target type of the object literal."),null;s.pos=t,s.isMemberCompletion=n,this.logger.log("Found scope context in previous script AST: "+i+", pos="+t+", scopePos="+s.getScopePosition());var a=new C;return a.maybeInaccurate=!0,a.isMemberCompletion=n,s.useFullAst=!1,this.getCompletionsFromEnclosingScopeContext(s,a),0==a.entries.length?(this.logger.log("Full refresh required: QuickCompletion returned an empty list. Be conservative and try again with accurate algorithm."),null):a},t.prototype.getAccurateCompletionsAtPosition=function(e,t,n){var r=new C;r.maybeInaccurate=!1,r.isMemberCompletion=n;var i=this.compilerState.getScriptAST(e),o=this.compilerState.getSourceText(i),s=TypeScript.findEnclosingScopeAt(this.logger,i,o,t,n);return null==s?(this.logger.log("No context found at the specified location."),r):(this.logger.log("Found scope context in up-to-date script AST: pos="+t+", scopePos="+s.getScopePosition()),s.useFullAst=!0,this.getCompletionsFromEnclosingScopeContext(s,r),r)},t.prototype.getDocCommentOfSymbol=function(e){if(!e)return"";var t=e.getType();return t&&t.isClass()&&t.symbol.name==e.name?TypeScript.Comment.getDocCommentText(t.getDocComments()):e.declAST&&e.declAST.nodeType==TypeScript.NodeType.FuncDecl&&t.call&&t.call.signatures.length>1?TypeScript.Comment.getDocCommentFirstOverloadSignature(t.call):e.kind()==TypeScript.SymbolKind.Parameter?e.getParameterDocComments():e.declAST&&e.declAST.nodeType==TypeScript.NodeType.ArgDecl&&e.declAST.isProperty()?e.declAST.sym.getParameterDocComments():TypeScript.Comment.getDocCommentText(e.getDocComments())},t.prototype.getCompletionsFromEnclosingScopeContext=function(e,t){var n=this,r=function(r){t.isMemberCompletion=r,e.isMemberCompletion=r;var i=n.compilerState.getScopeEntries(e,!0);i.forEach(function(r){var i=new w;i.name=r.name,i.type=r.type,i.kind=n.getSymbolElementKind(r.sym,e.getScope(),!0),i.fullSymbolName=n.getFullNameOfSymbol(r.sym,e),i.docComment=n.getDocCommentOfSymbol(r.sym),i.kindModifiers=n.getSymbolElementKindModifiers(r.sym),t.entries.push(i)})},i=e.getScriptFragment();try{var o=this.getAstPathToPosition(i,e.pos-e.getScriptFragmentPosition(),TypeScript.GetAstPathOptions.EdgeInclusive|TypeScript.GetAstPathOptions.DontPruneSearchBasedOnPosition);if(this.isCompletionListBlocker(o))this.logger.log("Returning an empty list because position is inside a comment");else{if(this.isObjectLiteralMemberNameCompletion(e))return this.logger.log("Completion list for members of object literal"),r(!0);if(e.isMemberCompletion||this.isCompletionListTriggerPoint(o))return r(e.isMemberCompletion);this.logger.log("Returning an empty list because position is not a valid position for displaying a completion list")}}finally{this.compilerState.cleanASTTypesForReTypeCheck(i)}},t.prototype.isObjectLiteralMemberNameCompletion=function(t){if(null===t.enclosingObjectLit)return!1;if(t.isMemberCompletion)return!1;var n=t.enclosingObjectLit,r=t.script,i=t.pos;if(!TypeScript.isValidAstNode(n))return!1;if(!TypeScript.isValidAstNode(n.operand))return!1;if(n.operand.nodeType!==TypeScript.NodeType.List)return!1;var o=n.operand,s=o.minCharc&&(c=t.operand1.minChar),!l.skipToOffset(t.operand1.limChar))return c=-1,p=!0,void 0;if(l.tokenId()!==TypeScript.TokenID.Colon)return c=-1,void 0;if(c>=0&&i>=c&&i<=l.tokenStartPos())return u=!0,p=!0,void 0;c=-1,TypeScript.isValidAstNode(t.operand2)&&l.skipToOffset(t.operand2.limChar)&&l.tokenId()==TypeScript.TokenID.Comma&&(c=l.tokenEndPos(),l.moveNext())}}),0>c?!1:u?!0:l.tokenId()!==TypeScript.TokenID.CloseBrace?!1:i>=c&&i<=l.tokenStartPos()):!1},t.prototype.isCompletionListBlocker=function(e){e.asts;var t=function(t){return e.count()>=1&&e.ast().nodeType===t};return t(TypeScript.NodeType.Comment)||t(TypeScript.NodeType.Regex)||t(TypeScript.NodeType.QString)?!0:!1},t.prototype.isCompletionListTriggerPoint=function(e){e.asts;var t=function(t){return e.count()>=1&&e.ast().nodeType===t};return e.isNameOfVariable()||e.isNameOfFunction()||e.isNameOfArgument()||e.isArgumentListOfFunction()||e.isNameOfInterface()||e.isNameOfClass()||e.isNameOfModule()?!1:t(TypeScript.NodeType.Member)||t(TypeScript.NodeType.TryCatch)||t(TypeScript.NodeType.Catch)||t(TypeScript.NodeType.Comment)||t(TypeScript.NodeType.Regex)||t(TypeScript.NodeType.QString)?!1:!0},t.prototype.getFormattingEditsForRange=function(e,t,n,r){this.minimalRefresh(),this.formattingRulesProvider.ensureUptodate(r);var i=this._getScriptSyntaxAST(e),o=new Formatting.FormattingManager(i,this.formattingRulesProvider,r),s=o.FormatSelection(t,n);return this.logger.information()&&(this.logFormatCodeOptions(r),this.logEditResults(i,s)),s},t.prototype.getFormattingEditsForDocument=function(e,t,n,r){this.minimalRefresh(),this.formattingRulesProvider.ensureUptodate(r);var i=this._getScriptSyntaxAST(e),o=new Formatting.FormattingManager(i,this.formattingRulesProvider,r),s=o.FormatDocument(t,n);return this.logger.information()&&this.logEditResults(i,s),s},t.prototype.getFormattingEditsOnPaste=function(e,t,n,r){this.minimalRefresh(),this.formattingRulesProvider.ensureUptodate(r);var i=this._getScriptSyntaxAST(e),o=new Formatting.FormattingManager(i,this.formattingRulesProvider,r),s=o.FormatOnPaste(t,n);return this.logger.information()&&this.logEditResults(i,s),s},t.prototype.getFormattingEditsAfterKeystroke=function(e,t,n,r){if(this.minimalRefresh(),this.formattingRulesProvider.ensureUptodate(r),"}"===n){var i=this._getScriptSyntaxAST(e),o=new Formatting.FormattingManager(i,this.formattingRulesProvider,r);return o.FormatOnClosingCurlyBrace(t)}if(";"===n){var i=this._getScriptSyntaxAST(e),o=new Formatting.FormattingManager(i,this.formattingRulesProvider,r);return o.FormatOnSemicolon(t)}if("\n"===n){var i=this._getScriptSyntaxAST(e),o=new Formatting.FormattingManager(i,this.formattingRulesProvider,r);return o.FormatOnEnter(t)}return[]},t.prototype.getNavigateToItems=function(e){this.refresh();for(var t=e.split(" "),n=0;n0)return x.subString}return null},i=[],n=0,o=this.compilerState.getScriptCount();o>n;n++){var s=this.compilerState.getScript(n),l=s.locationInfo.filename,c=r(null,s,l);if(null!=c){var u=new a;u.name=l,u.matchKind=c,u.kind=_.scriptElement,u.unitIndex=this.compilerState.mapToHostUnitIndex(n),u.minChar=s.minChar,u.limChar=s.limChar,i.push(u)}for(var p=this.getASTItems(n,s,r),h=0;hn&&(n=i.limChar)}return n},i=r(e,t),o=0;o0){var a=i[i.length-1];a.target.type==r&&(s.callSignature=a.signature,s.isNew=o||a.nodeType==TypeScript.NodeType.New)}return s},s=function(t){if(TypeScript.isValidAstNode(t))if(e>=t.minChar&&e=s.target.minChar&&e=a.constructorSpan.minChar&&e0){var s=i[i.length-1];s.target.minChar>=t.minChar&&s.target.minChar0&&i[n-1]==t&&i.pop(),e};return TypeScript.getAstWalkerFactory().walk(t,s,a),r},t.prototype.getReferencesToField=function(e,t,n){var r=function(e,t,r){r.nodeType==TypeScript.NodeType.Name&&n(e,t,r)};return this.getReferencesToSymbolSet(e,t,r)},t.prototype.getReferencesToType=function(e,t,n){var r=function(e,t,r){r.nodeType==TypeScript.NodeType.Name&&n(e,t,r)};return this.getReferencesToSymbolSet(e,t,r)},t.prototype.getReferencesToParameter=function(e,t,n){var r=function(e,t,r){r.nodeType==TypeScript.NodeType.Name&&n(e,t,r)};return this.getReferencesToSymbolSet(e,t,r)},t.prototype.getReferencesToVariable=function(e,t,n){var r=function(e,t,r){r.nodeType==TypeScript.NodeType.Name&&n(e,t,r)};return this.getReferencesToSymbolSet(e,t,r)},t.prototype.getReferencesToSymbolSet=function(e,t,n){for(var r=this,i=function(e){var i=function(r,i){if(TypeScript.isValidAstNode(r)){var o=r.sym;null!=o&&t.contains(o)&&n(e,i,r)}return r};TypeScript.getAstWalkerFactory().walk(r.compilerState.getScript(e),i)},o=0,s=e.scope.length;s>o;o++)i(e.scope[o])},t.prototype.getDeclNodeElementKindModifiers=function(e){var t=function(e,t,n){return t?e===E.none?n:e+","+n:e},n=function(e){var n=E.none;return n=t(n,e.isExported(),E.exportedModifier),n=t(n,e.isAmbient(),E.ambientModifier)},r=function(e){var n=E.none;return n=t(n,e.isExported(),E.exportedModifier),n=t(n,e.isAmbient(),E.ambientModifier)},i=function(e){var n=E.none;return n=t(n,e.isExported(),E.exportedModifier),n=t(n,e.isAmbient(),E.ambientModifier)},o=function(e){var n=E.none;return n=t(n,e.isExported(),E.exportedModifier),n=t(n,e.isAmbient(),E.ambientModifier),n=t(n,e.isPublic(),E.publicMemberModifier),n=t(n,e.isPrivate(),E.privateMemberModifier),n=t(n,e.isStatic(),E.staticModifier)},s=function(e){var n=E.none;return n=t(n,e.isPublic(),E.publicMemberModifier),n=t(n,e.isPrivate(),E.privateMemberModifier)},a=function(e){var n=E.none;return n=t(n,e.isExported(),E.exportedModifier),n=t(n,e.isAmbient(),E.ambientModifier),n=t(n,e.isPublic(),E.publicMemberModifier),n=t(n,e.isPrivate(),E.privateMemberModifier),n=t(n,e.isStatic(),E.staticModifier)};switch(e.nodeType){case TypeScript.NodeType.InterfaceDeclaration:var l=e;return n(l);case TypeScript.NodeType.ClassDeclaration:var c=e;return r(c);case TypeScript.NodeType.ModuleDeclaration:var u=e;return i(u);case TypeScript.NodeType.VarDecl:var p=e;return o(p);case TypeScript.NodeType.ArgDecl:var h=e;return s(h);case TypeScript.NodeType.FuncDecl:var d=e;return a(d);default:return this.logger.warning()&&this.logger.log("Warning: unrecognized AST node type: "+TypeScript.NodeType._map[e.nodeType]),E.none}},t.prototype.getASTItems=function(e,t,n,r,i){var o=this;null==r&&(r=function(e,t){return t.minChar}),null==i&&(i=function(e,t){return t.limChar});var s=new l;s.unitIndex=e;var c=function(e,t,l,c){if(!TypeScript.isValidAstNode(t))return null;var u=n(e,t,l),p=r(e,t),h=i(e,t);if(null!=u&&p>=0&&h>=0&&h>=p){var d=new a;return d.name=l,d.matchKind=u,d.kind=c,d.kindModifiers=o.getDeclNodeElementKindModifiers(t),d.unitIndex=o.compilerState.mapToHostUnitIndex(s.unitIndex),d.minChar=p,d.limChar=h,d.containerName=null===TypeScript.lastOf(s.containerSymbols)?"":TypeScript.lastOf(s.containerSymbols).fullName(),d.containerKind=null===TypeScript.lastOf(s.containerKinds)?"":TypeScript.lastOf(s.containerKinds),d}return null},u=function(e,t,n){if(s.path.push(e),!TypeScript.isValidAstNode(e))return e;var r=null;switch(e.nodeType){case TypeScript.NodeType.InterfaceDeclaration:var i=e;r=c(t,i,i.name.actualText,_.interfaceElement),s.containerASTs.push(e),s.containerSymbols.push(i.type.symbol),s.containerKinds.push("interface");break;case TypeScript.NodeType.ClassDeclaration:var o=e; r=c(t,o,o.name.actualText,_.classElement),s.containerASTs.push(e),s.containerSymbols.push(o.type.symbol),s.containerKinds.push("class");break;case TypeScript.NodeType.ModuleDeclaration:var a=e,l=a.isEnum(),u=l?_.enumElement:_.moduleElement;r=c(t,a,a.name.actualText,u),s.containerASTs.push(e),s.containerSymbols.push(a.mod.symbol),s.containerKinds.push(u);break;case TypeScript.NodeType.VarDecl:var p=e;null!==p.id&&(p.isProperty()?r=c(t,p,p.id.actualText,_.memberVariableElement):(s.path.isChildOfScript()||s.path.isChildOfModule())&&(r=c(t,p,p.id.actualText,_.variableElement))),n.options.goChildren=!1;break;case TypeScript.NodeType.ArgDecl:var h=e;null!==h.id&&s.path.isArgumentOfClassConstructor()&&h.isProperty()&&(r=c(t,h,h.id.actualText,_.memberVariableElement)),n.options.goChildren=!1;break;case TypeScript.NodeType.FuncDecl:var d=e,u=null,f=null!==d.name?d.name.actualText:null;d.isGetAccessor()?u=_.memberGetAccessorElement:d.isSetAccessor()?u=_.memberSetAccessorElement:d.isCallMember()?(u=_.callSignatureElement,f="()"):d.isIndexerMember()?(u=_.indexSignatureElement,f="[]"):d.isConstructMember()?(u=_.constructSignatureElement,f="new()"):d.isConstructor?(u=_.constructorImplementationElement,f="constructor"):d.isMethod()?u=_.memberFunctionElement:(s.path.isChildOfScript()||s.path.isChildOfModule())&&(u=_.functionElement),null!==u&&null!==f&&(r=c(t,d,f,u));break;case TypeScript.NodeType.ObjectLit:n.options.goChildren=!1}return null!==r&&s.result.push(r),e},p=function(e){return s.path.pop(),e===TypeScript.lastOf(s.containerASTs)&&(s.containerASTs.pop(),s.containerSymbols.pop(),s.containerKinds.pop()),e};return TypeScript.getAstWalkerFactory().walk(t,u,p),s.result},t.prototype.getAstPathToPosition=function(e,t,n){"undefined"==typeof n&&(n=TypeScript.GetAstPathOptions.Default),this.logger.information()&&this.logger.log("getAstPathToPosition("+e+", "+t+")");var r=TypeScript.getAstPathToPosition(e,t,n);return this.logger.information()&&(0==r.count()?this.logger.log("getAstPathToPosition: no ast found at position"):new TypeScript.AstLogger(this.logger).logNode(e,r.ast(),0)),r},t.prototype.getIdentifierPathToPosition=function(e,t){this.logger.log("getIdentifierPathToPosition("+e+", "+t+")");var n=this.getAstPathToPosition(e,t,TypeScript.GetAstPathOptions.EdgeInclusive);return 0==n.count()?null:n.nodeType()!==TypeScript.NodeType.Name?null:n},t.prototype.getSymbolAtPosition=function(e,t){this.logger.log("getSymbolAtPosition("+e+", "+t+")");var n=this.getAstPathToPosition(e,t);if(0==n.count())return null;var r=n.ast();return null==r?null:r.sym?r.sym:r.nodeType==TypeScript.NodeType.Dot&&r.operand2.sym?r.operand2.sym:r.signature&&r.signature.returnType&&r.signature.returnType.type&&r.signature.returnType.type.symbol?r.signature.returnType.type.symbol:r.type&&r.type.symbol?r.type.symbol:null},t.prototype.logFormatCodeOptions=function(e){this.logger.information()&&(this.logger.log("options.InsertSpaceAfterCommaDelimiter="+e.InsertSpaceAfterCommaDelimiter),this.logger.log("options.InsertSpaceAfterSemicolonInForStatements="+e.InsertSpaceAfterSemicolonInForStatements),this.logger.log("options.InsertSpaceBeforeAndAfterBinaryOperators="+e.InsertSpaceBeforeAndAfterBinaryOperators),this.logger.log("options.InsertSpaceAfterKeywordsInControlFlowStatements="+e.InsertSpaceAfterKeywordsInControlFlowStatements),this.logger.log("options.InsertSpaceAfterFunctionKeywordForAnonymousFunctions="+e.InsertSpaceAfterFunctionKeywordForAnonymousFunctions),this.logger.log("options.InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis="+e.InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis),this.logger.log("options.PlaceOpenBraceOnNewLineForFunctions="+e.PlaceOpenBraceOnNewLineForFunctions),this.logger.log("options.PlaceOpenBraceOnNewLineForControlBlocks="+e.PlaceOpenBraceOnNewLineForControlBlocks))},t.prototype.logEditResults=function(e,t){var n=this;if(this.logger.information()){var r=function(e){for(var t=e.replace(/^\s+|\s+$/g,"").replace(/\r\n?/g,"\n").split(/\n/),r=0;re;e++){var n=this.host.getScriptId(e);this.map.add(n,e),this.array[e]=new r(this.host,e,n,this.host.getScriptVersion(e),this.host.getScriptIsResident(e))}},e.prototype.count=function(){return this.map.count()},e.prototype.getUnitIndex=function(e){var t=this.map.lookup(e);return null==t?-1:t},e.prototype.getVersion=function(e){return this.array[e].version},e.prototype.getIsResident=function(e){return this.array[e].isResident},e.prototype.getScriptId=function(e){return this.array[e].id},e.prototype.getSourceText=function(e,t){return"undefined"==typeof t&&(t=!1),this.array[e].getSourceText(t)},e}();e.HostCache=i;var o=function(){function e(e){this.compiler=e,this.map=new TypeScript.StringHashTable,this.init()}return e.prototype.init=function(){for(var e=0,t=this.compiler.units.length;t>e;e++)this.map.add(this.compiler.units[e].filename,e)},e.prototype.getUnitIndex=function(e){var t=this.map.lookup(e);return null==t?-1:t},e}();e.CompilerCache=o;var s=function(){function e(){this.parseErrors=[],this.typeCheckErrors=[]}return e}();e.UnitErrors=s;var a=function(){function e(e){this.logger=e,this.parseMode=!1,this.fileMap=[]}return e.prototype.startParsing=function(e){this.parseMode=!0;var t=this.fileMap[e];void 0!==t&&(t.parseErrors.length=0)},e.prototype.startTypeChecking=function(){this.parseMode=!1;for(var e=0;ei;i++)this.addCompilerUnit(this.compiler,i);this.compilerCache=new o(this.compiler),this.onTypeCheckStarting(),this.compiler.typeCheck()},n.prototype.minimalRefresh=function(){this.hostCache=new i(this.host)},n.prototype.refresh=function(t){"undefined"==typeof t&&(t=!0);try{if(this.hostCache=new i(this.host),this.fullRefresh()||this.partialRefresh(),this.logger.information()){for(var n=0;nt;t++){var r=this.compiler.units[t].filename,i=this.hostCache.getUnitIndex(r);if(0>i)return this.logger.log("Creating new compiler instance because of unit is not part of program anymore: "+t+"-"+r),this.createCompiler(),!0}for(var t=0,n=this.compiler.units.length;n>t;t++){var r=this.compiler.units[t].filename,o=this.compiler.scripts.members[t].isResident,i=this.hostCache.getUnitIndex(r);if(this.hostCache.getIsResident(i)!=o)return this.logger.log("Creating new compiler instance because of unit 'isResident' status has changed: "+t+"-"+r),this.createCompiler(),!0}return!1},n.prototype.partialRefresh=function(){function e(e){for(var t=null,n=0,r=e.length;r>n;n++){var i=e[n];if(i.kind==TypeScript.UpdateUnitKind.EditsInsideSingleScope){if(null!==t){t=null;break}t=i}else if(i.kind==TypeScript.UpdateUnitKind.Unknown){t=null;break}}return t}this.logger.log("Updating files..."),this.compilerCache=new o(this.compiler);for(var t=[],n=!1,r=0,i=this.host.getScriptCount();i>r;r++){var s=this.hostCache.getScriptId(r),a=this.compilerCache.getUnitIndex(s);if(a>=0){var l=this.updateCompilerUnit(this.compiler,r,a);t.push(l)}else this.addCompilerUnit(this.compiler,r),n=!0}var c=!1,u=e(t);if(n===!1&&null!==u&&(this.logger.log('Attempting incremental type check because there was a single edit to the function "'+u.scope1.name.actualText+'"'),c=this.attemptIncrementalTypeCheck(u)),!c){for(var p=!1,h=0,i=t.length;i>h;h++){var d=t[h];this.applyUpdateResult(d)&&(p=!0)}p||n?(this.logger.log("Incremental type check not applicable, processing unit updates"),this.onTypeCheckStarting(),this.compiler.reTypeCheck()):this.logger.log("No updates to source files, no typecheck needed")}},n.prototype.attemptIncrementalTypeCheck=function(e){var t=this.compiler.attemptIncrementalTypeCheck(e);return t&&this.applyUpdateResult(e),t},n.prototype.applyUpdateResult=function(e){switch(e.kind){case TypeScript.UpdateUnitKind.NoEdits:return!1;case TypeScript.UpdateUnitKind.Unknown:case TypeScript.UpdateUnitKind.EditsInsideSingleScope:return this.errorCollector.startParsing(e.unitIndex),this.compiler.applyUpdateResult(e)}},n.prototype.getScriptAST=function(e){var t=this.compilerCache.getUnitIndex(e);if(0>t)throw new Error('Interal error: No AST found for file "'+e+'".');return this.compiler.scripts.members[t]},n.prototype.getLineMap=function(e){var t=this.compilerCache.getUnitIndex(e);if(0>t)throw new Error('Interal error: No AST found for file "'+e+'".');return this.compiler.units[t].lineMap},n.prototype.getScopeEntries=function(e,t){return new TypeScript.ScopeTraversal(this.compiler).getScopeEntries(e,t)},n.prototype.getErrorEntries=function(e,t){for(var n=[],r=0,i=function(t){return n.push(t),r++,e>r},o=0,s=this.errorCollector.fileMap.length;s>o;o++){var a=this.errorCollector.fileMap[o];if(void 0!==a){for(var l=0;lt)throw new Error('Interal error: No AST found for file "'+e+'".');var n=[],r=this.errorCollector.fileMap[t];if(void 0!==r&&r.parseErrors.length>0)return n;var i={createFile:function(e,t){"undefined"==typeof t&&(t=!1);var r=new l(e,t);return n.push(r),r},directoryExists:function(){return!0},fileExists:function(){return!1},resolvePath:function(e){return e}},o=this.compiler.scripts.members[t];return this.compiler.parseEmitOption(i),this.compiler.emitUnit(o),(void 0==r||0==r.typeCheckErrors.length)&&this.compiler.emitDeclarationsUnit(o),n},n}();e.CompilerState=c}(Services||(Services={}));var Services;!function(e){var t=function(){function t(e,t,n){this.logger=e,this.script=t,this.sourceText=n}return t.prototype.getLogger=function(){return this.logger},t.prototype.getScriptId=function(){return this.script.locationInfo.filename},t.prototype.getScript=function(){return this.script},t.prototype.getSourceText=function(){return this.sourceText},t.prototype.getTokenStream=function(t,r){"undefined"==typeof t&&(t=0),t>0&&(t=this.getTokenizationOffset(t)),r||(r=this.getSourceText().getLength());var i=this.getSourceText();(t>0||r=0){var c=this.getMatchingBraceForward(t,r[l],o[l]);if(c>=0){var u=new e.TextRange(t,t+1),p=new e.TextRange(c,c+1);s.push(u,p)}}a=this.scriptSyntaxAST.getSourceText().getText(t-1,t);var h=i.indexOf(a);if(h>=0){var d=this.getMatchingBraceBackward(t-1,o[h],r[h]);if(d>=0){var u=new e.TextRange(t-1,t),p=new e.TextRange(d,d+1);s.push(u,p)}}return s},t.prototype.getMatchingBraceForward=function(e,t,n){for(var r=this.scriptSyntaxAST.getTokenStream(),i=0,o=!1;r.moveNext();){if(r.tokenStartPos()===e){if(r.tokenId()!==t)break;o=!0}if(o)if(r.tokenId()===t)i++;else if(r.tokenId()===n&&(i--,0===i))return r.tokenStartPos()}return-1},t.prototype.getMatchingBraceBackward=function(e,t,n){for(var r=this.scriptSyntaxAST.getTokenStream(),i=[];r.moveNext()&&!(r.tokenStartPos()>e);){if(r.tokenStartPos()===e&&r.tokenId()===t){if(i.length>0)return i[i.length-1];break}r.tokenId()===n?i.push(r.tokenStartPos()):r.tokenId()===t&&i.length>0&&i.pop()}return-1},t}();e.BraceMatchingManager=t}(Services||(Services={}));var Services;!function(e){var t=function(){function e(){this.rtti=e.rtti_id,this.values=[]}return e.rtti_id={id:"Services.SymbolArraySet"},e.prototype.add=function(e){return this.contains(e)?!1:(this.values.push(e),!0)},e.prototype.contains=function(e){return this.values.indexOf(e)>=0},e.prototype.forEach=function(e){this.values.forEach(e)},e.prototype.getAll=function(){return this.values},e}(),n=function(){function e(){this.table=new TypeScript.StringHashTable}return e.prototype.isSymbolArraySet=function(e){return e.rtti===t.rtti_id},e.prototype.add=function(e){var n=e.name,r=this.table.lookup(n);if(null===r)return this.table.add(n,e),!0;if(this.isSymbolArraySet(r))return r.add(e);var i=r;if(i===e)return!1;var o=new t;return o.add(i),o.add(e),this.table.addOrUpdate(n,o),!0},e.prototype.contains=function(e){var t=e.name,n=this.table.lookup(t);if(null===n)return!1;if(this.isSymbolArraySet(n))return n.contains(e);var r=n;return r===e},e.prototype.isEmpty=function(){return 0===this.table.count()},e.prototype.getAll=function(){var e=[];return this.forEach(function(t){e.push(t)}),e},e.prototype.forEach=function(e){var t=this;this.table.map(function(n,r){null===r||(t.isSymbolArraySet(r)?r.forEach(e):e(r))},null)},e.prototype.union=function(e){var t=this;e.getAll().forEach(function(e){t.add(e)})},e}();e.SymbolSet=n}(Services||(Services={}));var Services;!function(e){var t=function(){function t(e){this.host=e,this._allTypes=null}return t.prototype.findBaseTypesTransitiveClosure=function(t){var n=new e.SymbolSet,r=new e.SymbolSet;for(r.add(t);!r.isEmpty();)n.union(r),r=this.findBaseTypes(n,r);return n},t.prototype.findDerivedTypesTransitiveClosure=function(t){var n=new e.SymbolSet,r=new e.SymbolSet;for(r.add(t);!r.isEmpty();)n.union(r),r=this.findDerivedTypes(n,r);return n},t.prototype.getOverride=function(e,t){var n=null;if(this.isClass(e)?n=e.type.instanceType.members:this.isInterface(e)&&(n=e.type.members),null==n)return null;var r=n.allMembers.lookup(t.name);return null==r?null:this.isMethod(t)===this.isMethod(r)&&this.isField(t)===this.isField(r)&&this.isStatic(t)===this.isStatic(r)?r:null},t.prototype.getAllTypes=function(){var t=this;if(null===this._allTypes){var n=new e.SymbolSet;this.host.getScripts().forEach(function(e){TypeScript.walkAST(e,function(e,r){if(e.isNameOfClass()||e.isNameOfInterface()){var i=e.ast().sym;if(null!=i&&i.kind()===TypeScript.SymbolKind.Type){var o=i;(t.isClass(o)||t.isInterface(o))&&n.add(o)}}e.isBodyOfFunction()&&(r.options.goChildren=!1)})}),this._allTypes=n.getAll()}return this._allTypes},t.prototype.findBaseTypes=function(t,n){var r=this,i=new e.SymbolSet,o=n.getAll();return o.forEach(function(e){if(e.kind()===TypeScript.SymbolKind.Type){var n=e.type;null!==n&&(null!=n.instanceType&&(n=n.instanceType),r.addBaseTypes(t,i,n.implementsList),r.addBaseTypes(t,i,n.extendsList))}}),i},t.prototype.findDerivedTypes=function(t,n){var r=this,i=new e.SymbolSet;return this.getAllTypes().forEach(function(o){if(!t.contains(o)&&o.kind()===TypeScript.SymbolKind.Type){var s=o.type;if(null!==s){null!=s.instanceType&&(s=s.instanceType);var a=new e.SymbolSet,l=new e.SymbolSet;r.addBaseTypes(a,l,s.implementsList),r.addBaseTypes(a,l,s.extendsList),l.getAll().forEach(function(e){n.contains(e)&&i.add(o)})}}}),i},t.prototype.addBaseTypes=function(e,t,n){var r=this;null!=n&&n.forEach(function(n){null!==n.symbol&&(e.contains(n.symbol)||r.isDefinition(n.symbol)&&t.add(n.symbol))})},t.prototype.isDefinition=function(e){return this.isClass(e)||this.isInterface(e)},t.prototype.isClass=function(e){return null!=e&&e.kind()==TypeScript.SymbolKind.Type&&e.isClass()},t.prototype.isInterface=function(e){return null!=e&&e.kind()==TypeScript.SymbolKind.Type&&null!=e.declAST&&e.declAST.nodeType===TypeScript.NodeType.InterfaceDeclaration},t.prototype.isMethod=function(e){return null!=e&&e.kind()===TypeScript.SymbolKind.Type&&e.isMethod},t.prototype.isField=function(e){return null!=e&&e.kind()===TypeScript.SymbolKind.Field},t.prototype.isStatic=function(e){return null!=e&&e.isStatic()},t}();e.SymbolTree=t}(Services||(Services={}));var Services;!function(e){var t=function(){function t(e){this.symbolTree=e}return t.prototype.findMemberOverrides=function(e){return this.findMemberOverridesImpl(e,!0,!0)},t.prototype.findImplementors=function(t){return this.symbolTree.isClass(t)||this.symbolTree.isInterface(t)?this.symbolTree.findDerivedTypesTransitiveClosure(t):this.symbolTree.isMethod(t)||this.symbolTree.isField(t)?this.findMemberOverridesImpl(t,!1,!0):new e.SymbolSet},t.prototype.findMemberOverridesImpl=function(t,n,r){var i=this,o=new e.SymbolSet;if(o.add(t),null===t.container)return o;var s=n?this.symbolTree.findBaseTypesTransitiveClosure(t.container):new e.SymbolSet,a=r?this.symbolTree.findDerivedTypesTransitiveClosure(t.container):new e.SymbolSet,l=new e.SymbolSet;return l.add(t.container),l.union(s),l.union(a),l.getAll().forEach(function(e){var n=i.symbolTree.getOverride(e,t);null!==n&&o.add(n)}),o},t}();e.OverridesCollector=t}(Services||(Services={}));var Services;!function(e){function t(e,t,n){e.log(t);var r=Date.now(),i=n(),o=Date.now();if(e.log(t+" completed in "+(o-r)+" msec"),"string"==typeof i){var s=i;e.log(" result.length="+s.length+', result="'+TypeScript.stringToLiteral(s,128)+(s.length>128?"...":"")+'"')}return i}function n(n,r,i,o){"undefined"==typeof o&&(o=!1);try{return t(n,r,i)}catch(s){if(e.logInternalError(n,s),o)throw s;return"##ERROR##"+s.name+"##"+s.message}}function r(n,r,i){try{return t(n,r,i)}catch(s){return e.logInternalError(n,s),o(s)}}function i(e){return'{"result":'+JSON.stringify(e)+"}"}function o(e){return'{"error":'+JSON.stringify(e)+"}"}var s=function(){function e(e){this.shimHost=e}return e.prototype.information=function(){return this.shimHost.information()},e.prototype.debug=function(){return this.shimHost.debug()},e.prototype.warning=function(){return this.shimHost.warning()},e.prototype.error=function(){return this.shimHost.error()},e.prototype.fatal=function(){return this.shimHost.fatal()},e.prototype.log=function(e){this.shimHost.log(e)},e.prototype.getCompilationSettings=function(){var e=this.shimHost.getCompilationSettings();if(null==e||""==e)return null;var t=JSON.parse(e);return t},e.prototype.getScriptCount=function(){return this.shimHost.getScriptCount()},e.prototype.getScriptId=function(e){return this.shimHost.getScriptId(e)},e.prototype.getScriptSourceText=function(e,t,n){return this.shimHost.getScriptSourceText(e,t,n)},e.prototype.getScriptSourceLength=function(e){return this.shimHost.getScriptSourceLength(e)},e.prototype.getScriptIsResident=function(e){return this.shimHost.getScriptIsResident(e)},e.prototype.getScriptVersion=function(e){return this.shimHost.getScriptVersion(e)},e.prototype.getScriptEditRangeSinceVersion=function(e,t){var n=this.shimHost.getScriptEditRangeSinceVersion(e,t);if(null===n||""===n)return null;var r=n.split(",");return new TypeScript.ScriptEditRange(parseInt(r[0]),parseInt(r[1]),parseInt(r[2]))},e}();e.LanguageServiceShimHostAdapter=s,e.simpleForwardCall=t,e.forwardCall=n,e.forwardJSONCall=r;var a=function(){function t(e,t){this.host=e,this.languageService=t,this.logger=this.host}return t.prototype.forwardCall=function(t,n,r){return"undefined"==typeof r&&(r=!1),e.forwardCall(this.logger,t,n,r)},t.prototype.forwardJSONCall=function(t,n){return e.forwardJSONCall(this.logger,t,n)},t.prototype.dispose=function(){this.logger.log("dispose()"),this.languageService=null,this.logger=null},t.prototype.refresh=function(e){var t=this;this.forwardCall("refresh("+e+")",function(){return t.languageService.refresh(),null},e)},t.prototype.getErrors=function(e){var t=this;return this.forwardJSONCall("getErrors("+e+")",function(){var n=t.languageService.getErrors(e);return i(n)})},t.prototype.getScriptErrors=function(e,t){var n=this;return this.forwardJSONCall("getScriptErrors("+t+")",function(){var r=n.languageService.getScriptErrors(e,t);return i(r)})},t.prototype.getTypeAtPosition=function(e,t){var n=this;return this.forwardJSONCall('getTypeAtPosition("'+e+'", '+t+")",function(){var r=n.languageService.getTypeAtPosition(e,t);return i(r)})},t.prototype.getNameOrDottedNameSpan=function(e,t,n){var r=this;return this.forwardJSONCall('getNameOrDottedNameSpan("'+e+'", '+t+", "+n+")",function(){var o=r.languageService.getNameOrDottedNameSpan(e,t,n);return i(o)})},t.prototype.getBreakpointStatementAtPosition=function(e,t){var n=this;return this.forwardJSONCall('getBreakpointStatementAtPosition("'+e+'", '+t+")",function(){var r=n.languageService.getBreakpointStatementAtPosition(e,t);return i(r)})},t.prototype.getSignatureAtPosition=function(e,t){var n=this;return this.forwardJSONCall('getSignatureAtPosition("'+e+'", '+t+")",function(){var r=n.languageService.getSignatureAtPosition(e,t);return i(r)})},t.prototype.getDefinitionAtPosition=function(e,t){var n=this;return this.forwardCall('getDefinitionAtPosition("'+e+'", '+t+")",function(){var r=n.languageService.getDefinitionAtPosition(e,t),i="";return null!==r&&(i=r.unitIndex+" "+r.minChar+" "+r.limChar+" "+r.kind+" "+r.name+" "+r.containerKind+" "+r.containerName),i})},t.prototype.getBraceMatchingAtPosition=function(e,t){var n=this;return this.forwardJSONCall('getBraceMatchingAtPosition("'+e+'", '+t+")",function(){var r=n.languageService.getBraceMatchingAtPosition(e,t);return i(r)})},t.prototype.getSmartIndentAtLineNumber=function(e,t,n){var r=this;return this.forwardJSONCall('getSmartIndentAtLineNumber("'+e+'", '+t+")",function(){var o=JSON.parse(n),s=r.languageService.getSmartIndentAtLineNumber(e,t,o); return i({value:s})})},t.prototype.getReferencesAtPosition=function(e,t){var n=this;return this.forwardJSONCall('getReferencesAtPosition("'+e+'", '+t+")",function(){var r=n.languageService.getReferencesAtPosition(e,t);return n._referencesToResult(r)})},t.prototype.getOccurrencesAtPosition=function(e,t){var n=this;return this.forwardCall('getOccurrencesAtPosition("'+e+'", '+t+")",function(){var r=n.languageService.getOccurrencesAtPosition(e,t);return n._referencesToResult(r)})},t.prototype.getImplementorsAtPosition=function(e,t){var n=this;return this.forwardJSONCall('getImplementorsAtPosition("'+e+'", '+t+")",function(){var r=n.languageService.getImplementorsAtPosition(e,t);return n._referencesToResult(r)})},t.prototype._referencesToResult=function(e){for(var t="",n=0;nr;){var o=r+i>>1,s=n(t,e.get(o));s>0?r=o+1:i=o}return R.Assert(r>=0&&r<=e.count(),"Incorrect implementation of BinarySearch"),r==e.count()||0!=n(t,e.get(r))?~r:r}function n(e,t){for(var n=0,r=e.count();r>n;n++)if(t(e.get(n)))return e.get(n);return null}function r(e,t){for(var n=e.count(),r=n-1;r>=0;r--)if(t(e.get(r)))return e.get(r);return null}function i(t,n,r,i){for(var s=new f,a=n.getTokenStream(i.startPosition());a.moveNext();){if(t.information()){var l="token: "+TypeScript.TokenID._map[a.tokenId()]+" - startPos="+a.tokenStartPos()+", pos="+a.tokenEndPos();t.log(l)}var c=a.tokenEndPos();if(!(ci.endPosition())break;var h=r.getTokenKind(a.tokenId()),d=new e.TokenSpan(h,a.tokenId(),new o(i.snapshot,p.FromBounds(u,c)));s.add(d)}}return t.log("GetTokens(["+i.startPosition()+","+i.endPosition()+"]): returned "+s.count()+" tokens from source text offset "+a.sourceTextOffset()),s}var o=function(){function e(e,t){this.snapshot=e,this.span=t,this._startPoint=null,this._endPoint=null}return e.prototype.start=function(){return null==this._startPoint&&(this._startPoint=new s(this.snapshot,this.span.start())),this._startPoint},e.prototype.end=function(){return null==this._endPoint&&(this._endPoint=new s(this.snapshot,this.span.end())),this._endPoint},e.prototype.startPosition=function(){return this.span.start()},e.prototype.endPosition=function(){return this.span.end()},e.prototype.GetText=function(){return this.snapshot.GetText(this.span)},e.prototype.IsEmpty=function(){return 0===this.span.length()},e.prototype.OverlapsWith=function(e){return this.span.OverlapsWith(e)},e.prototype.Intersection=function(t){var n=this.span.Intersection(t);return null!==n?new e(this.snapshot,n):null},e}();e.SnapshotSpan=o;var s=function(){function e(e,t){this.snapshot=e,this.position=t}return e.prototype.GetContainingLine=function(){return this.snapshot.GetLineFromPosition(this.position)},e.prototype.Add=function(t){return new e(this.snapshot,this.position+t)},e}();e.SnapshotPoint=s;var a=function(){function e(e){this.scriptSyntaxAST=e}return e.prototype.GetASTCursor=function(){return new l(this)},e}();e.FileAuthoringProxy=a;var l=function(){function t(e){this.fileAuthoringProxy=e,this.logger=this.fileAuthoringProxy.scriptSyntaxAST.getLogger(),this.path=new TypeScript.AstPath}return t.prototype.fixupPath=function(e){for(var t=new TypeScript.AstPath,n=0;n=1&&this.skipNode(n);)n.up();return n},t.prototype.moveToParent=function(e){for(;e.count()>=1&&(e.up(),this.skipNode(e)););},t.prototype.getAuthorParseNodeDetails=function(e){return 0===e.count()?this.getEmptyNodeDetails():this.getDetails(e)},t.prototype.Current=function(){return this.getAuthorParseNodeDetails(this.path)},t.prototype.Parent=function(){var e=this.path.clone();return this.moveToParent(e),this.getAuthorParseNodeDetails(e)},t.prototype.MoveToChild=function(e){var t=this,n=function(e){return null!=e?(t.path.push(e),t.getAuthorParseNodeDetails(t.path)):t.getEmptyNodeDetails()};if(this.path.count()>=1){var r=this.path.ast();switch(r.nodeType){case TypeScript.NodeType.ArrayLit:switch(e){case L.apneElements:return n(r.operand)}}}var i=new TypeScript.AST(TypeScript.NodeType.Empty);return this.path.push(i),this.getAuthorParseNodeDetails(this.path)},t.prototype.MoveUp=function(){return this.moveToParent(this.path),this.getAuthorParseNodeDetails(this.path)},t.prototype.SeekToOffset=function(e,t){var n=this.getAstPath(e,t?TypeScript.GetAstPathOptions.Default:TypeScript.GetAstPathOptions.EdgeInclusive);return this.path=this.fixupPath(n),0==this.path.count()?null:this.getDetails(this.path)},t.prototype.MoveToEnclosingNode=function(e,t){if(e>t)throw new Error("Invalid offsets");var n=this.getAstPath(e),r=this.getAstPath(t-1);if(0==n.count()||0==r.count())throw new Error("No nodes enclosing span");for(var i=0,o=0;i=2&&(e.ast().nodeType==TypeScript.NodeType.List&&!e.isSingleStatementList()&&e.isBodyOfCase()&&(t=!0),e.up(),e.ast().nodeType==TypeScript.NodeType.List&&e.isSingleStatementList()&&e.isBodyOfCase()&&(t=!0),e.down()),t},t.prototype.isBodyOfCase=function(e){var t=e.asts,n=e.top;return e.count()>=2&&t[n-1].nodeType===TypeScript.NodeType.Case&&t[n-0].nodeType===TypeScript.NodeType.Block&&t[n-1].body==t[n-0].statements},t.prototype.mapBodyOfCase=function(e){var t=new TypeScript.Block(e,!1);return t.minChar=e.minChar,t.limChar=e.limChar,t},t.prototype.GetSubTree=function(e){var t=this;if(0==this.path.count())return new I([]);var n={path:new TypeScript.AstPath,nodes:[],curDepth:0,curDepths:[]},r=function(r,i,o){if(n.curDepths.push(n.curDepth),n.path.push(r),n.path.isBodyOfCase()){var s=t.mapBodyOfCase(r),a=n.path.pop();n.path.push(s),n.nodes.push(t.mapAstNode(n.path,n.curDepth)),n.curDepth++,n.path.pop(),n.path.push(a)}var l=t.mapAstNode(n.path,n.curDepth);return null!==l&&(n.nodes.push(l),n.curDepth++),o.options.goChildren=0>e||n.curDepth<=e,r},i=function(e){return n.curDepth=n.curDepths.pop(),n.path.pop(),e};if(TypeScript.getAstWalkerFactory().walk(this.path.ast(),r,i),this.logger.information()){this.logger.log("getSubTree("+e+")");for(var o=0;o0?r.minChar:0;case A.apnpRCurlyMin:return null!==r&&r.limChar>0?r.limChar-1:0;case A.apnpRParenMin:if(null!=n.arguments&&n.arguments.limChar>0)return n.arguments.limChar-1}break;case TypeScript.NodeType.ClassDeclaration:var i=t.Details.ast,r=i.members;switch(e){case A.apnpLCurlyMin:return null!==r?r.minChar:0;case A.apnpRCurlyMin:return null!==r?r.limChar-1:0}}return this.logger.warning()&&this.logger.log("NYI:GetNodeProperty (nodeType="+TypeScript.NodeType._map[t.Details.ast.nodeType]+", "+"propperty= "+A._map[e]+")"),0},t.prototype.GetEdgeLabel=function(){return this.mapAstNode(this.path,0).EdgeLabel},t}();e.AuthorParseNodeCursor=l;var c=function(){function e(e,t){this.script=e,this.sourceText=t,this.lines=[]}return e.prototype.GetText=function(e){return this.sourceText.getText(e.start(),e.end())},e.prototype.GetLineNumberFromPosition=function(e){var t=TypeScript.getLineNumberFromPosition(this.script.locationInfo.lineMap,e);return t-1},e.prototype.GetLineFromPosition=function(e){var t=this.GetLineNumberFromPosition(e);return this.GetLineFromLineNumber(t)},e.prototype.GetLineFromLineNumber=function(e){var t=this.lines[e];return void 0===t&&(t=this.GetLineFromLineNumberWorker(e),this.lines[e]=t),t},e.prototype.GetLineFromLineNumberWorker=function(e){var t=this.script.locationInfo.lineMap,n=e+1;if(1>n||n>=t.length)throw new Error("invalid line number ("+n+")");var r,i,o=t[n],s="";if(n==t.length)r=i=this.sourceText.getLength();else{i=n>=t.length-1?this.sourceText.getLength():this.script.locationInfo.lineMap[n+1];for(var a=i-1;a>=o;a--){var l=this.sourceText.getText(a,a+1);if("\r"!=l&&"\n"!=l)break}r=a+1,s=this.sourceText.getText(r,i)}var c=new u(this,e,o,r,s);return c},e}();e.TextSnapshot=c;var u=function(){function e(e,t,n,r,i){this._snapshot=e,this._lineNumber=t,this._start=n,this._end=r,this._lineBreak=i}return e.prototype.snapshot=function(){return this._snapshot},e.prototype.start=function(){return new s(this._snapshot,this._start)},e.prototype.startPosition=function(){return this._start},e.prototype.end=function(){return new s(this._snapshot,this._end)},e.prototype.endPosition=function(){return this._end},e.prototype.endIncludingLineBreak=function(){return new s(this._snapshot,this._end+this._lineBreak.length)},e.prototype.endIncludingLineBreakPosition=function(){return this._end+this._lineBreak.length},e.prototype.length=function(){return this._end-this._start},e.prototype.lineNumber=function(){return this._lineNumber},e.prototype.getText=function(){return this._snapshot.GetText(p.FromBounds(this._start,this._end))},e}();e.TextSnapshotLine=u;var p=function(){function e(e,t){if(this._start=e,this._length=t,this._start<0)throw new Error("Invalid start value");if(this._length<0)throw new Error("Invalid length value")}return e.prototype.start=function(){return this._start},e.prototype.end=function(){return this._start+this._length},e.prototype.length=function(){return this._length},e.prototype.Intersection=function(t){var n=F.Max(this.start(),t.start()),r=F.Min(this.end(),t.end());return r>=n?e.FromBounds(n,r):null},e.prototype.OverlapsWith=function(e){var t=F.Max(this.start(),e.start()),n=F.Min(this.end(),e.end());return n>t},e.prototype.Contains=function(e){return e.start()>=this.start()&&e.end()<=this.end()},e.FromBounds=function(t,n){return new e(t,n-t)},e}();e.Span=p;var h=function(){function e(e){this.list=e,this.index=-1}return e.prototype.MoveNext=function(){return this.indexe||e>this.items.length)throw new Error("Invalid index when inserting into array (valid range is 0 to "+this.items.length+")");this.copyOnWrite(),this.items.splice(e,0,t)},e.prototype.contains=function(e){var t=!1;return this.foreach(function(n){n===e&&(t=!0)}),t},e.prototype.foreach=function(e){for(var t=this,n=0,r=t.count();r>n;n++)e(t.get(n))},e.prototype.GetEnumerator=function(){return new h(this)},e.prototype.Where=function(t){var n=new e;return this.foreach(function(e){t(e)&&n.add(e)}),n},e}();e.List=d;var f=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),t.prototype.get=function(t){return e.prototype.get.call(this,t)},t.prototype.foreach=function(t){e.prototype.foreach.call(this,t)},t}(d);e.List_TokenSpan=f;var m=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),t.prototype.get=function(t){return e.prototype.get.call(this,t)},t.prototype.foreach=function(t){e.prototype.foreach.call(this,t)},t}(d);e.List_AuthorTokenKind=m;var g=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),t.prototype.get=function(t){return e.prototype.get.call(this,t)},t.prototype.foreach=function(t){e.prototype.foreach.call(this,t)},t}(d);e.List_IndentationInfo=g;var y=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),t.prototype.get=function(t){return e.prototype.get.call(this,t)},t.prototype.foreach=function(t){e.prototype.foreach.call(this,t)},t}(d);e.List_IndentationEditInfo=y;var v=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),t.prototype.get=function(t){return e.prototype.get.call(this,t)},t.prototype.foreach=function(t){e.prototype.foreach.call(this,t)},t}(d);e.List_ParseNode=v;var T=function(e){function t(t){"undefined"==typeof t&&(t=null),e.call(this),null!=t&&this.add(t)}return __extends(t,e),t.prototype.get=function(t){return e.prototype.get.call(this,t)},t.prototype.foreach=function(t){e.prototype.foreach.call(this,t)},t}(d);e.List_TextEditInfo=T;var b=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),t.prototype.get=function(t){return e.prototype.get.call(this,t)},t.prototype.foreach=function(t){e.prototype.foreach.call(this,t)},t.prototype.Add=function(t){e.prototype.add.call(this,t)},t.prototype.AddRange=function(e){var t=this;e.forEach(function(e){t.Add(e)})},t}(d);e.List_Rule=b;var k=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),t.prototype.get=function(t){return e.prototype.get.call(this,t)},t.prototype.foreach=function(t){e.prototype.foreach.call(this,t)},t}(d);e.List_ITextSnapshotLine=k;var S=function(){function e(){this.items=[]}return e.prototype.Count=function(){return this.items.length},e.prototype.Push=function(e){if(void 0===e)throw new Error("Cannot add an undefined value in a list");this.items.push(e)},e.prototype.Pop=function(){if(0===this.items.length)throw new Error("Cannot pop from an empty stack");return this.items.pop()},e}();e.Stack=S;var C=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),t.prototype.Pop=function(){return e.prototype.Pop.call(this)},t}(S);e.Stack_ParseNode=C,e.BinarySearch=t,e.FirstOrDefault=n,e.LastOrDefault=r;var w=function(){function e(){}return e}();e.AuthorParseNode=w;var _=function(){function e(){}return e.prototype.Equals=function(e){return null==e?!1:this.Kind==e.Kind&&this.nodeType==e.nodeType&&this.StartOffset==e.StartOffset&&this.EndOffset==e.EndOffset&&this.Flags==e.Flags},e}();e.AuthorParseNodeDetails=_,function(e){e._map=[],e.apnfNone=0,e.apnfSyntheticNode=256}(e.AuthorParseNodeFlags||(e.AuthorParseNodeFlags={}));var E=e.AuthorParseNodeFlags;!function(e){e._map=[],e._map[0]="apnkEmptyNode",e.apnkEmptyNode=0,e._map[1]="apnkNone",e.apnkNone=1,e._map[2]="apnkName",e.apnkName=2,e._map[3]="apnkInt",e.apnkInt=3,e._map[4]="apnkFlt",e.apnkFlt=4,e._map[5]="apnkStr",e.apnkStr=5,e._map[6]="apnkRegExp",e.apnkRegExp=6,e._map[7]="apnkThis",e.apnkThis=7,e._map[8]="apnkNull",e.apnkNull=8,e._map[9]="apnkFalse",e.apnkFalse=9,e._map[10]="apnkTrue",e.apnkTrue=10,e._map[11]="apnkEmpty",e.apnkEmpty=11,e._map[12]="apnkLdFncSlot",e.apnkLdFncSlot=12,e._map[13]="apnkArgRef",e.apnkArgRef=13,e._map[14]="apnkHelperCall3",e.apnkHelperCall3=14,e._map[15]="apnkNot",e.apnkNot=15,e._map[16]="apnkNeg",e.apnkNeg=16,e._map[17]="apnkPos",e.apnkPos=17,e._map[18]="apnkLogNot",e.apnkLogNot=18,e._map[19]="apnkIncPost",e.apnkIncPost=19,e._map[20]="apnkDecPost",e.apnkDecPost=20,e._map[21]="apnkIncPre",e.apnkIncPre=21,e._map[22]="apnkDecPre",e.apnkDecPre=22,e._map[23]="apnkTypeof",e.apnkTypeof=23,e._map[24]="apnkVoid",e.apnkVoid=24,e._map[25]="apnkDelete",e.apnkDelete=25,e._map[26]="apnkArray",e.apnkArray=26,e._map[27]="apnkObject",e.apnkObject=27,e._map[28]="apnkTempRef",e.apnkTempRef=28,e._map[29]="apnkStFncSlot",e.apnkStFncSlot=29,e._map[30]="apnkAdd",e.apnkAdd=30,e._map[31]="apnkSub",e.apnkSub=31,e._map[32]="apnkMul",e.apnkMul=32,e._map[33]="apnkDiv",e.apnkDiv=33,e._map[34]="apnkMod",e.apnkMod=34,e._map[35]="apnkOr",e.apnkOr=35,e._map[36]="apnkXor",e.apnkXor=36,e._map[37]="apnkAnd",e.apnkAnd=37,e._map[38]="apnkEq",e.apnkEq=38,e._map[39]="apnkNe",e.apnkNe=39,e._map[40]="apnkLt",e.apnkLt=40,e._map[41]="apnkLe",e.apnkLe=41,e._map[42]="apnkGe",e.apnkGe=42,e._map[43]="apnkGt",e.apnkGt=43,e._map[44]="apnkCall",e.apnkCall=44,e._map[45]="apnkDot",e.apnkDot=45,e._map[46]="apnkAsg",e.apnkAsg=46,e._map[47]="apnkInstOf",e.apnkInstOf=47,e._map[48]="apnkIn",e.apnkIn=48,e._map[49]="apnkEqv",e.apnkEqv=49,e._map[50]="apnkNEqv",e.apnkNEqv=50,e._map[51]="apnkComma",e.apnkComma=51,e._map[52]="apnkLogOr",e.apnkLogOr=52,e._map[53]="apnkLogAnd",e.apnkLogAnd=53,e._map[54]="apnkLsh",e.apnkLsh=54,e._map[55]="apnkRsh",e.apnkRsh=55,e._map[56]="apnkRs2",e.apnkRs2=56,e._map[57]="apnkNew",e.apnkNew=57,e._map[58]="apnkIndex",e.apnkIndex=58,e._map[59]="apnkQmark",e.apnkQmark=59,e._map[60]="apnkAsgAdd",e.apnkAsgAdd=60,e._map[61]="apnkAsgSub",e.apnkAsgSub=61,e._map[62]="apnkAsgMul",e.apnkAsgMul=62,e._map[63]="apnkAsgDiv",e.apnkAsgDiv=63,e._map[64]="apnkAsgMod",e.apnkAsgMod=64,e._map[65]="apnkAsgAnd",e.apnkAsgAnd=65,e._map[66]="apnkAsgXor",e.apnkAsgXor=66,e._map[67]="apnkAsgOr",e.apnkAsgOr=67,e._map[68]="apnkAsgLsh",e.apnkAsgLsh=68,e._map[69]="apnkAsgRsh",e.apnkAsgRsh=69,e._map[70]="apnkAsgRs2",e.apnkAsgRs2=70,e._map[71]="apnkScope",e.apnkScope=71,e._map[72]="apnkMember",e.apnkMember=72,e._map[73]="apnkSetMember",e.apnkSetMember=73,e._map[74]="apnkGetMember",e.apnkGetMember=74,e._map[75]="apnkList",e.apnkList=75,e._map[76]="apnkVarDecl",e.apnkVarDecl=76,e._map[77]="apnkTemp",e.apnkTemp=77,e._map[78]="apnkFncDecl",e.apnkFncDecl=78,e._map[79]="apnkProg",e.apnkProg=79,e._map[80]="apnkEndCode",e.apnkEndCode=80,e._map[81]="apnkDebugger",e.apnkDebugger=81,e._map[82]="apnkFor",e.apnkFor=82,e._map[83]="apnkIf",e.apnkIf=83,e._map[84]="apnkWhile",e.apnkWhile=84,e._map[85]="apnkDoWhile",e.apnkDoWhile=85,e._map[86]="apnkForIn",e.apnkForIn=86,e._map[87]="apnkBlock",e.apnkBlock=87,e._map[88]="apnkWith",e.apnkWith=88,e._map[89]="apnkBreak",e.apnkBreak=89,e._map[90]="apnkContinue",e.apnkContinue=90,e._map[91]="apnkLabel",e.apnkLabel=91,e._map[92]="apnkSwitch",e.apnkSwitch=92,e._map[93]="apnkCase",e.apnkCase=93,e._map[94]="apnkTryCatch",e.apnkTryCatch=94,e._map[95]="apnkCatch",e.apnkCatch=95,e._map[96]="apnkReturn",e.apnkReturn=96,e._map[97]="apnkTry",e.apnkTry=97,e._map[98]="apnkThrow",e.apnkThrow=98,e._map[99]="apnkFinally",e.apnkFinally=99,e._map[100]="apnkTryFinally",e.apnkTryFinally=100,e._map[101]="apnkStruct",e.apnkStruct=101,e._map[102]="apnkEnum",e.apnkEnum=102,e._map[103]="apnkTyped",e.apnkTyped=103,e._map[104]="apnkVarDeclList",e.apnkVarDeclList=104,e._map[105]="apnkDefaultCase",e.apnkDefaultCase=105 }(e.AuthorParseNodeKind||(e.AuthorParseNodeKind={}));var x=e.AuthorParseNodeKind;!function(e){e._map=[],e._map[0]="atkEnd",e.atkEnd=0,e._map[1]="atkText",e.atkText=1,e._map[2]="atkIdentifier",e.atkIdentifier=2,e._map[3]="atkComment",e.atkComment=3,e._map[4]="atkNumber",e.atkNumber=4,e._map[5]="atkString",e.atkString=5,e._map[6]="atkRegexp",e.atkRegexp=6,e._map[7]="atkConditionalComp",e.atkConditionalComp=7,e._map[8]="atkScanError",e.atkScanError=8,e._map[9]="atkSColon",e.atkSColon=9,e._map[10]="atkLParen",e.atkLParen=10,e._map[11]="atkRParen",e.atkRParen=11,e._map[12]="atkLBrack",e.atkLBrack=12,e._map[13]="atkRBrack",e.atkRBrack=13,e._map[14]="atkLCurly",e.atkLCurly=14,e._map[15]="atkRCurly",e.atkRCurly=15,e._map[16]="atkComma",e.atkComma=16,e._map[17]="atkArrow",e.atkArrow=17,e._map[18]="atkAsg",e.atkAsg=18,e._map[19]="atkAsgAdd",e.atkAsgAdd=19,e._map[20]="atkAsgSub",e.atkAsgSub=20,e._map[21]="atkAsgMul",e.atkAsgMul=21,e._map[22]="atkAsgDiv",e.atkAsgDiv=22,e._map[23]="atkAsgMod",e.atkAsgMod=23,e._map[24]="atkAsgAnd",e.atkAsgAnd=24,e._map[25]="atkAsgXor",e.atkAsgXor=25,e._map[26]="atkAsgOr",e.atkAsgOr=26,e._map[27]="atkAsgLsh",e.atkAsgLsh=27,e._map[28]="atkAsgRsh",e.atkAsgRsh=28,e._map[29]="atkAsgRs2",e.atkAsgRs2=29,e._map[30]="atkQMark",e.atkQMark=30,e._map[31]="atkColon",e.atkColon=31,e._map[32]="atkLogOr",e.atkLogOr=32,e._map[33]="atkLogAnd",e.atkLogAnd=33,e._map[34]="atkOr",e.atkOr=34,e._map[35]="atkXor",e.atkXor=35,e._map[36]="atkAnd",e.atkAnd=36,e._map[37]="atkEQ",e.atkEQ=37,e._map[38]="atkNE",e.atkNE=38,e._map[39]="atkEqv",e.atkEqv=39,e._map[40]="atkNEqv",e.atkNEqv=40,e._map[41]="atkLT",e.atkLT=41,e._map[42]="atkLE",e.atkLE=42,e._map[43]="atkGT",e.atkGT=43,e._map[44]="atkGE",e.atkGE=44,e._map[45]="atkLsh",e.atkLsh=45,e._map[46]="atkRsh",e.atkRsh=46,e._map[47]="atkRs2",e.atkRs2=47,e._map[48]="atkAdd",e.atkAdd=48,e._map[49]="atkSub",e.atkSub=49,e._map[50]="atkMult",e.atkMult=50,e._map[51]="atkDiv",e.atkDiv=51,e._map[52]="atkPct",e.atkPct=52,e._map[53]="atkTilde",e.atkTilde=53,e._map[54]="atkBang",e.atkBang=54,e._map[55]="atkInc",e.atkInc=55,e._map[56]="atkDec",e.atkDec=56,e._map[57]="atkDot",e.atkDot=57,e._map[58]="atkScope",e.atkScope=58,e._map[59]="atkEllipsis",e.atkEllipsis=59,e._map[60]="atkBreak",e.atkBreak=60,e._map[61]="atkCase",e.atkCase=61,e._map[62]="atkCatch",e.atkCatch=62,e._map[63]="atkClass",e.atkClass=63,e._map[64]="atkConst",e.atkConst=64,e._map[65]="atkContinue",e.atkContinue=65,e._map[66]="atkDebugger",e.atkDebugger=66,e._map[67]="atkDefault",e.atkDefault=67,e._map[68]="atkDelete",e.atkDelete=68,e._map[69]="atkDo",e.atkDo=69,e._map[70]="atkElse",e.atkElse=70,e._map[71]="atkEnum",e.atkEnum=71,e._map[72]="atkExport",e.atkExport=72,e._map[73]="atkExtends",e.atkExtends=73,e._map[74]="atkFalse",e.atkFalse=74,e._map[75]="atkFinally",e.atkFinally=75,e._map[76]="atkFor",e.atkFor=76,e._map[77]="atkFunction",e.atkFunction=77,e._map[78]="atkIf",e.atkIf=78,e._map[79]="atkImport",e.atkImport=79,e._map[80]="atkIn",e.atkIn=80,e._map[81]="atkInstanceof",e.atkInstanceof=81,e._map[82]="atkNew",e.atkNew=82,e._map[83]="atkNull",e.atkNull=83,e._map[84]="atkReturn",e.atkReturn=84,e._map[85]="atkSuper",e.atkSuper=85,e._map[86]="atkSwitch",e.atkSwitch=86,e._map[87]="atkThis",e.atkThis=87,e._map[88]="atkThrow",e.atkThrow=88,e._map[89]="atkTrue",e.atkTrue=89,e._map[90]="atkTry",e.atkTry=90,e._map[91]="atkTypeof",e.atkTypeof=91,e._map[92]="atkVar",e.atkVar=92,e._map[93]="atkVoid",e.atkVoid=93,e._map[94]="atkWhile",e.atkWhile=94,e._map[95]="atkWith",e.atkWith=95,e._map[96]="atkConstructor",e.atkConstructor=96,e._map[97]="atkDeclare",e.atkDeclare=97,e._map[98]="atkModule",e.atkModule=98,e._map[99]="atkGet",e.atkGet=99,e._map[100]="atkSet",e.atkSet=100,e._map[101]="atkImplements",e.atkImplements=101,e._map[102]="atkInterface",e.atkInterface=102,e._map[103]="atkLet",e.atkLet=103,e._map[104]="atkPackage",e.atkPackage=104,e._map[105]="atkPrivate",e.atkPrivate=105,e._map[106]="atkProtected",e.atkProtected=106,e._map[107]="atkPublic",e.atkPublic=107,e._map[108]="atkStatic",e.atkStatic=108,e._map[109]="atkYield",e.atkYield=109,e._map[110]="Length",e.Length=110}(e.AuthorTokenKind||(e.AuthorTokenKind={}));var N=e.AuthorTokenKind;!function(e){e._map=[],e._map[0]="apneNone",e.apneNone=0,e._map[1]="apneOperand",e.apneOperand=1,e._map[2]="apneLeft",e.apneLeft=2,e._map[3]="apneRight",e.apneRight=3,e._map[4]="apneCondition",e.apneCondition=4,e._map[5]="apneThen",e.apneThen=5,e._map[6]="apneElse",e.apneElse=6,e._map[7]="apneInitialization",e.apneInitialization=7,e._map[8]="apneIncrement",e.apneIncrement=8,e._map[9]="apneBody",e.apneBody=9,e._map[10]="apneBlockBody",e.apneBlockBody=10,e._map[11]="apneValue",e.apneValue=11,e._map[12]="apneTarget",e.apneTarget=12,e._map[13]="apneArgument",e.apneArgument=13,e._map[14]="apneArguments",e.apneArguments=14,e._map[15]="apneMembers",e.apneMembers=15,e._map[16]="apneVariable",e.apneVariable=16,e._map[17]="apneObject",e.apneObject=17,e._map[18]="apneTry",e.apneTry=18,e._map[19]="apneCatch",e.apneCatch=19,e._map[20]="apneFinally",e.apneFinally=20,e._map[21]="apneCase",e.apneCase=21,e._map[22]="apneDefaultCase",e.apneDefaultCase=22,e._map[23]="apneElements",e.apneElements=23,e._map[24]="apneListItem",e.apneListItem=24,e._map[25]="apneMember",e.apneMember=25,e._map[26]="apneType",e.apneType=26}(e.AuthorParseNodeEdge||(e.AuthorParseNodeEdge={}));var L=e.AuthorParseNodeEdge,I=function(){function e(e){this.nodes=e}return e.prototype.Count=function(){return this.nodes.length},e.prototype.GetItems=function(e,t){if(0==e&&t==this.nodes.length)return this.nodes;throw new Error("Invalid call to GetItems")},e}();e.AuthorParseNodeSet=I,function(e){e._map=[],e._map[0]="apnpLCurlyMin",e.apnpLCurlyMin=0,e._map[1]="apnpRCurlyMin",e.apnpRCurlyMin=1,e._map[2]="apnpLParenMin",e.apnpLParenMin=2,e._map[3]="apnpRParenMin",e.apnpRParenMin=3,e._map[4]="apnpLBrackMin",e.apnpLBrackMin=4,e._map[5]="apnpRBrackMin",e.apnpRBrackMin=5,e._map[6]="apnpIdentifierMin",e.apnpIdentifierMin=6,e._map[7]="apnpFunctionKeywordMin",e.apnpFunctionKeywordMin=7}(e.AuthorParseNodeProperty||(e.AuthorParseNodeProperty={}));var A=e.AuthorParseNodeProperty,M=function(){function e(){this.tokenMap=[],this.init()}return e.instance=null,e.getInstance=function(){return null===e.instance&&(e.instance=new e),e.instance},e.prototype.init=function(){for(var e=0,t=TypeScript.TokenID.Lim;t>e;e++)this.tokenMap[e]=this.mapTokenID(e)},e.prototype.getTokenKind=function(e){return this.tokenMap[e]},e.prototype.mapTokenID=function(e){switch(e){case TypeScript.TokenID.Any:return N.atkIdentifier;case TypeScript.TokenID.Bool:return N.atkIdentifier;case TypeScript.TokenID.Break:return N.atkBreak;case TypeScript.TokenID.Case:return N.atkCase;case TypeScript.TokenID.Catch:return N.atkCatch;case TypeScript.TokenID.Class:return N.atkClass;case TypeScript.TokenID.Const:return N.atkConst;case TypeScript.TokenID.Continue:return N.atkContinue;case TypeScript.TokenID.Debugger:return N.atkDebugger;case TypeScript.TokenID.Default:return N.atkDefault;case TypeScript.TokenID.Delete:return N.atkDelete;case TypeScript.TokenID.Do:return N.atkDo;case TypeScript.TokenID.Else:return N.atkElse;case TypeScript.TokenID.Enum:return N.atkEnum;case TypeScript.TokenID.Export:return N.atkExport;case TypeScript.TokenID.Extends:return N.atkExtends;case TypeScript.TokenID.Declare:return N.atkDeclare;case TypeScript.TokenID.False:return N.atkFalse;case TypeScript.TokenID.Finally:return N.atkFinally;case TypeScript.TokenID.For:return N.atkFor;case TypeScript.TokenID.Constructor:return N.atkConstructor;case TypeScript.TokenID.Function:return N.atkFunction;case TypeScript.TokenID.Get:return N.atkGet;case TypeScript.TokenID.If:return N.atkIf;case TypeScript.TokenID.Implements:return N.atkImplements;case TypeScript.TokenID.Import:return N.atkImport;case TypeScript.TokenID.In:return N.atkIn;case TypeScript.TokenID.InstanceOf:return N.atkInstanceof;case TypeScript.TokenID.Interface:return N.atkInterface;case TypeScript.TokenID.Let:return N.atkLet;case TypeScript.TokenID.Module:return N.atkModule;case TypeScript.TokenID.New:return N.atkNew;case TypeScript.TokenID.Number:return N.atkIdentifier;case TypeScript.TokenID.Null:return N.atkNull;case TypeScript.TokenID.Package:return N.atkPackage;case TypeScript.TokenID.Private:return N.atkPrivate;case TypeScript.TokenID.Protected:return N.atkProtected;case TypeScript.TokenID.Public:return N.atkPublic;case TypeScript.TokenID.With:return N.atkWith;case TypeScript.TokenID.Return:return N.atkReturn;case TypeScript.TokenID.Set:return N.atkSet;case TypeScript.TokenID.Static:return N.atkStatic;case TypeScript.TokenID.String:return N.atkIdentifier;case TypeScript.TokenID.Super:return N.atkSuper;case TypeScript.TokenID.Switch:return N.atkSwitch;case TypeScript.TokenID.This:return N.atkThis;case TypeScript.TokenID.Throw:return N.atkThrow;case TypeScript.TokenID.True:return N.atkTrue;case TypeScript.TokenID.Try:return N.atkTry;case TypeScript.TokenID.TypeOf:return N.atkTypeof;case TypeScript.TokenID.Var:return N.atkVar;case TypeScript.TokenID.Void:return N.atkVoid;case TypeScript.TokenID.While:return N.atkWhile;case TypeScript.TokenID.Yield:return N.atkYield;case TypeScript.TokenID.Semicolon:return N.atkSColon;case TypeScript.TokenID.OpenParen:return N.atkLParen;case TypeScript.TokenID.CloseParen:return N.atkRParen;case TypeScript.TokenID.OpenBracket:return N.atkLBrack;case TypeScript.TokenID.CloseBracket:return N.atkRBrack;case TypeScript.TokenID.OpenBrace:return N.atkLCurly;case TypeScript.TokenID.CloseBrace:return N.atkRCurly;case TypeScript.TokenID.Comma:return N.atkComma;case TypeScript.TokenID.Equals:return N.atkAsg;case TypeScript.TokenID.PlusEquals:return N.atkAsgAdd;case TypeScript.TokenID.MinusEquals:return N.atkAsgSub;case TypeScript.TokenID.AsteriskEquals:return N.atkAsgMul;case TypeScript.TokenID.SlashEquals:return N.atkAsgDiv;case TypeScript.TokenID.PercentEquals:return N.atkAsgMod;case TypeScript.TokenID.AmpersandEquals:return N.atkAsgAnd;case TypeScript.TokenID.CaretEquals:return N.atkAsgXor;case TypeScript.TokenID.BarEquals:return N.atkAsgOr;case TypeScript.TokenID.LessThanLessThanEquals:return N.atkAsgLsh;case TypeScript.TokenID.GreaterThanGreaterThanEquals:return N.atkAsgRsh;case TypeScript.TokenID.GreaterThanGreaterThanGreaterThanEquals:return N.atkAsgRs2;case TypeScript.TokenID.Question:return N.atkQMark;case TypeScript.TokenID.Colon:return N.atkColon;case TypeScript.TokenID.BarBar:return N.atkLogOr;case TypeScript.TokenID.AmpersandAmpersand:return N.atkLogAnd;case TypeScript.TokenID.Bar:return N.atkOr;case TypeScript.TokenID.Caret:return N.atkXor;case TypeScript.TokenID.And:return N.atkAnd;case TypeScript.TokenID.EqualsEquals:return N.atkEQ;case TypeScript.TokenID.ExclamationEquals:return N.atkNE;case TypeScript.TokenID.EqualsEqualsEquals:return N.atkEqv;case TypeScript.TokenID.ExclamationEqualsEquals:return N.atkNEqv;case TypeScript.TokenID.LessThan:return N.atkLT;case TypeScript.TokenID.LessThanEquals:return N.atkLE;case TypeScript.TokenID.GreaterThan:return N.atkGT;case TypeScript.TokenID.GreaterThanEquals:return N.atkGE;case TypeScript.TokenID.LessThanLessThan:return N.atkLsh;case TypeScript.TokenID.GreaterThanGreaterThan:return N.atkRsh;case TypeScript.TokenID.GreaterThanGreaterThanGreaterThan:return N.atkRs2;case TypeScript.TokenID.Plus:return N.atkAdd;case TypeScript.TokenID.Minus:return N.atkSub;case TypeScript.TokenID.Asterisk:return N.atkMult;case TypeScript.TokenID.Slash:return N.atkDiv;case TypeScript.TokenID.Percent:return N.atkPct;case TypeScript.TokenID.Tilde:return N.atkTilde;case TypeScript.TokenID.Exclamation:return N.atkBang;case TypeScript.TokenID.PlusPlus:return N.atkInc;case TypeScript.TokenID.MinusMinus:return N.atkDec;case TypeScript.TokenID.Dot:return N.atkDot;case TypeScript.TokenID.DotDotDot:return N.atkEllipsis;case TypeScript.TokenID.Error:return N.atkIdentifier;case TypeScript.TokenID.EndOfFile:return N.atkEnd;case TypeScript.TokenID.EqualsGreaterThan:return N.atkArrow;case TypeScript.TokenID.Identifier:return N.atkIdentifier;case TypeScript.TokenID.StringLiteral:return N.atkString;case TypeScript.TokenID.RegularExpressionLiteral:return N.atkRegexp;case TypeScript.TokenID.NumberLiteral:return N.atkNumber;case TypeScript.TokenID.Whitespace:return N.atkIdentifier;case TypeScript.TokenID.Comment:return N.atkComment;default:throw new Error("Invalid token kind:"+e+" ("+TypeScript.TokenID._map[e]+")")}},e}();e.AuthorTokenKindMap=M;var R=function(){function e(){}return e.Assert=function(e,t){if(!e)throw new Error("assertion failure: "+t)},e.Fail=function(t){e.Assert(!1,t)},e}();e.Debug=R;var P=function(){function e(){this.items=[]}return e.prototype.Contains=function(e){return void 0!==this.items[e]},e.prototype.Add=function(e){this.items[e]=e},e}();e.HashSet_int=P;var D=function(){function e(){this.items=[]}return e.prototype.GetValue=function(e){var t=this.items[e];return void 0===t?null:t},e.prototype.Add=function(e,t){this.items[e]=t},e}();e.Dictionary_int_List_IndentationEditInfo=D;var O=function(){function e(){this.items=[]}return e.prototype.GetValue=function(e){var t=this.items[e];return void 0===t?null:t},e.prototype.Add=function(e,t){this.items[e]=t},e}();e.Dictionary_int_int=O;var F=function(){function e(){}return e.Max=function(e,t){return e>t?e:t},e.Min=function(e,t){return t>e?e:t},e}();e.Math=F;var B=function(){function e(){}return e.IndexOf=function(e,t,n){return"undefined"==typeof n&&(n=0),e.indexOf(t,n)},e.Equals=function(e,t){return e==t},e.IsNullOrEmpty=function(e){return null===e||""===e},e.IsWhiteSpace=function(e){return W.IsWhitespace(e)},e.create=function(e,t){for(var n="",r=0;t>r;r++)n+=e;return n},e.foreach=function(e,t){for(var n=0;nn?null:this.tokens.get(n)},t.prototype.setContext=function(t,n,r){e.Debug.Assert(null!=t,"node is null"),e.Debug.Assert(null!=n,"t1 is null"),e.Debug.Assert(null!=r,"t2 is null"),this.contextNode=t,this.tokenSpan=n,this.nextTokenSpan=r,this.contextNodeAllOnSameLine=void 0,this.tokensAreOnSameLine=void 0,this.tokensAreSiblingNodesOnSameLine=void 0},t.prototype.ContextNodeAllOnSameLine=function(){if(void 0===this.contextNodeAllOnSameLine){var t=this.contextNode.GetBlockSpan(this.fileAuthoringProxy,this.tokens),n=this.findTokenAtPosition(t.start());if(null!=n&&n.tokenID==TypeScript.TokenID.OpenBrace){var r=this.findTokenAtPosition(t.end()-1);if(null==r||r.tokenID!=TypeScript.TokenID.CloseBrace)for(var i=t.end()-2;i>n.Span.endPosition();i--)if(r=this.findTokenAtPosition(i),null!=r){t=e.Span.FromBounds(n.Span.startPosition(),r.Span.endPosition());break}}var o=this.snapshot.GetLineNumberFromPosition(t.start()),s=this.snapshot.GetLineNumberFromPosition(t.end());this.contextNodeAllOnSameLine=o==s}return this.contextNodeAllOnSameLine},t.prototype.TokensAreOnSameLine=function(){if(void 0===this.tokensAreOnSameLine){var e=this.tokenSpan.lineNumber(),t=this.nextTokenSpan.lineNumber();this.tokensAreOnSameLine=e==t}return this.tokensAreOnSameLine},t.prototype.TokensAreSiblingNodesOnSameLine=function(){return void 0===this.tokensAreSiblingNodesOnSameLine&&(this.tokensAreSiblingNodesOnSameLine=this.AreTokensSiblingNodesOnSameLine()),this.tokensAreSiblingNodesOnSameLine},t.prototype.AreTokensSiblingNodesOnSameLine=function(){if(null==this.contextNode.children()||this.contextNode.children().count()<2)return!1;var t=null,n=null,r=e.ParseNodeExtensions.TryFindNodeIndexForStartOffset(this.contextNode.children(),this.nextTokenSpan.Span.startPosition());if(0>r)return!1;n=this.contextNode.children().get(r);for(var i=r-1;i>=0;--i){var o=this.contextNode.children().get(i);if(o.AuthorNode.Details.EndOffset==this.tokenSpan.Span.endPosition()){t=o;break}}if(null==t)return!1;var s=this.snapshot.GetLineNumberFromPosition(t.AuthorNode.Details.EndOffset),a=this.snapshot.GetLineNumberFromPosition(n.AuthorNode.Details.StartOffset);return s==a},t}();e.FormattingContext=t}(Formatting||(Formatting={}));var Formatting;!function(e){var t=function(){function t(t,n,r){this.scriptSyntaxAST=t,this.rulesProvider=n,this.editorOptions=r,this.logger=new TypeScript.LoggerAdapter(this.scriptSyntaxAST.getLogger()),this.sourceText=this.scriptSyntaxAST.getSourceText(),this.snapshot=new e.TextSnapshot(this.scriptSyntaxAST.getScript(),this.sourceText),this.fileAuthoringProxy=new e.FileAuthoringProxy(this.scriptSyntaxAST),this.tokenKindMap=e.AuthorTokenKindMap.getInstance()}return t.prototype.FormatSelection=function(t,n){var r=new e.SnapshotSpan(this.snapshot,e.Span.FromBounds(t,n));return this.Format(r,e.FormattingRequestKind.FormatSelection,function(){return!0})},t.prototype.FormatDocument=function(t,n){var r=new e.SnapshotSpan(this.snapshot,e.Span.FromBounds(t,n));return this.Format(r,e.FormattingRequestKind.FormatDocument,function(){return!0})},t.prototype.FormatOnPaste=function(t,n){var r=new e.SnapshotSpan(this.snapshot,e.Span.FromBounds(t,n));return this.Format(r,e.FormattingRequestKind.FormatOnPaste,function(){return!0})},t.prototype.CanFormatSpan=function(){return!0},t.prototype.FormatOnSemicolon=function(t){var n=this,r=new e.SnapshotPoint(this.snapshot,t),i=r.Add(-1),o=this.MapDownSnapshotPoint(i);if(null!==o){var s=this.FindStatementSpan(o,e.FormattingRequestKind.FormatOnSemicolon);if(null!=s)return this.Format(s,e.FormattingRequestKind.FormatOnSemicolon,function(e){return!n.IsInsideStringLiteralOrComment(o,e)})}return[]},t.prototype.FormatOnClosingCurlyBrace=function(t){var n=this,r=new e.SnapshotPoint(this.snapshot,t),i=r.Add(-1),o=this.MapDownSnapshotPoint(i);if(null!==o){var s=this.FindMatchingBlockSpan(o,e.FormattingRequestKind.FormatOnClosingCurlyBrace);if(null!=s)return this.Format(s,e.FormattingRequestKind.FormatOnClosingCurlyBrace,function(e){return!n.IsInsideStringLiteralOrComment(o,e)})}return[]},t.prototype.FormatOnEnter=function(t){var n=this,r=this.snapshot.GetLineNumberFromPosition(t);if(r>0){var i=this.snapshot.GetLineFromLineNumber(r-1),o=this.snapshot.GetLineFromLineNumber(r),s=new e.SnapshotSpan(this.snapshot,e.Span.FromBounds(i.startPosition(),o.endPosition()));if(null!=s){var a=new e.SnapshotPoint(this.snapshot,t),l=this.MapDownSnapshotPoint(a);return this.Format(s,e.FormattingRequestKind.FormatOnEnter,function(e){return!n.IsInsideStringLiteralOrComment(l,e)})}}return[]},t.prototype.FindMatchingBlockSpan=function(t){var n=this.fileAuthoringProxy,r=new e.MatchingBlockFinderTask(t,n),i=r.Run();return null!==i?new e.SnapshotSpan(t.snapshot,i):null},t.prototype.FindStatementSpan=function(t){var n=this.fileAuthoringProxy,r=new e.StatementFinderTask(this.logger,t,n);return r.Run(),null!=r.BlockSpan?new e.SnapshotSpan(t.snapshot,r.BlockSpan):null},t.prototype.MapDownSnapshotSpan=function(e){return e},t.prototype.MapDownSnapshotPoint=function(e){return e},t.prototype.GetTokens=function(t){return e.getTokensInSpan(this.logger,this.scriptSyntaxAST,this.tokenKindMap,t)},t.prototype.IsInsideStringLiteralOrComment=function(t,n){if(null!==t)for(var r=new e.Span(t.position,1),i=0;i=r;++r){var i=this.Snapshot.GetLineFromLineNumber(r);this.TrimWhitespace2(e,i)}},t.prototype.TrimWhitespace=function(e){var t=this.Snapshot.GetLineFromPosition(e.Span.startPosition());this.TrimWhitespace2(e,t)},t.prototype.TrimWhitespace2=function(t,n){if(!(t.Token==e.AuthorTokenKind.atkComment&&t.Span.startPosition()<=n.endPosition()&&t.Span.endPosition()>=n.endPosition())){var r=n.getText(),i=0;for(i=r.length-1;i>=0&&e.EditorUtilities.IsWhitespace(r.charCodeAt(i));--i);if(++i,i0)return new e.List_TextEditInfo(new e.TextEditInfo(o.start(),o.length(),""));break;case e.RuleAction.NewLine:if(t.Flag==e.RuleFlags.CanDeleteNewLines)o=new e.Span(n.Span.endPosition(),r.Span.startPosition()-n.Span.endPosition());else{var s;s=n.lineNumber()==r.lineNumber()?r.Span.startPosition()-n.Span.endPosition():n.Span.end().GetContainingLine().endIncludingLineBreakPosition()-n.Span.endPosition(),o=new e.Span(n.Span.endPosition(),e.Math.Max(0,s))}var a=!1,l=this.Snapshot.GetText(o),c=e.StringUtils.IndexOf(l,this.editorOptions.NewLineCharacter);if(0>c?a=!0:(c=e.StringUtils.IndexOf(l,this.editorOptions.NewLineCharacter,c+1),c>=0&&(a=!0)),a)return new e.List_TextEditInfo(new e.TextEditInfo(o.start(),o.length(),this.editorOptions.NewLineCharacter));break;case e.RuleAction.Space:if(t.Flag==e.RuleFlags.CanDeleteNewLines)o=new e.Span(n.Span.endPosition(),r.Span.startPosition()-n.Span.endPosition());else{var s;s=n.lineNumber()==r.lineNumber()?r.Span.startPosition()-n.Span.endPosition():n.Span.end().GetContainingLine().endPosition()-n.Span.endPosition(),o=new e.Span(n.Span.endPosition(),e.Math.Max(0,s))}if(o.length()>1||" "!=this.Snapshot.GetText(o))return new e.List_TextEditInfo(new e.TextEditInfo(o.start(),o.length()," "))}return i},t.prototype.FindTokenNode=function(t,n){if(n.CoverSpan(t)){if(null!=n.children()){var r=e.ParseNodeExtensions.TryFindNodeForSpan(n.children(),t);if(null!=r)return this.FindTokenNode(t,r)}return n}return null==n.Parent?n:this.FindTokenNode(t,n.Parent)},t}();e.FormattingTask=t}(Formatting||(Formatting={}));var Formatting;!function(e){var t=function(){function t(t){this.snapshot=t,this.indentationEdits=new e.Dictionary_int_List_IndentationEditInfo}return t.prototype.AddIndent=function(t){var n=this.snapshot.GetLineNumberFromPosition(t.Position()),r=this.indentationEdits.GetValue(n);null===r&&(r=new e.List_IndentationEditInfo,this.indentationEdits.Add(n,r)),r.add(t)},t.prototype.FindIndent=function(e){var t=this.snapshot.GetLineNumberFromPosition(e),n=this.indentationEdits.GetValue(t);if(null!==n)for(var r=n.count()-1;r>=0;r--)if(e>=n.get(r).Position())return n.get(r);return null},t}();e.IndentationBag=t}(Formatting||(Formatting={}));var Formatting;!function(e){var t=function(){function t(){}return t.FillIndentationLevels=function(n){var r=new e.Stack_ParseNode;for(r.Push(n);r.Count()>0;)t.FillIndentationLevels2(r.Pop(),r)},t.FillBodyIndentation=function(t,n){t.IsIndentationOverrideEdge=!0,t.ChildrenIndentationDelta=1,e.ParseNodeExtensions.ForAllChildren(e.ParseNodeExtensions.FindChildWithEdge(t,e.AuthorParseNodeEdge.apneBody),function(t){t.AuthorNode.Details.Kind!=e.AuthorParseNodeKind.apnkEndCode&&(t.IndentationDelta=1),n.Push(t)})},t.FillIndentationLevels2=function(n,r){switch(n.AuthorNode.Details.nodeType){case TypeScript.NodeType.ModuleDeclaration:case TypeScript.NodeType.ClassDeclaration:case TypeScript.NodeType.InterfaceDeclaration:return t.FillBodyIndentation(n,r),e.ParseNodeExtensions.ForAllChildren(n,function(e){r.Push(e)}),void 0;case TypeScript.NodeType.ImportDeclaration:return n.ChildrenIndentationDelta=1,e.ParseNodeExtensions.ForAllChildren(n,function(e){r.Push(e)}),void 0}switch(n.AuthorNode.Details.Kind){case e.AuthorParseNodeKind.apnkProg:n.IndentationDelta=0,n.ChildrenIndentationDelta=0;var i=e.ParseNodeExtensions.FindChildWithEdge(n,e.AuthorParseNodeEdge.apneBody);e.ParseNodeExtensions.ForAllChildren(i,function(e){e.IndentationDelta=0,e.ChildrenIndentationDelta=0,r.Push(e)});break;case e.AuthorParseNodeKind.apnkBlock:(n.AuthorNode.Details.Flags&e.AuthorParseNodeFlags.apnfSyntheticNode)!=e.AuthorParseNodeFlags.apnfSyntheticNode?t.FillIndentationEdgesForBlock(n,1):(e.ParseNodeExtensions.ForAllChildren(n,function(e){t.FillIndentationLevels(e)}),n.IndentationDelta=null,n.ChildrenIndentationDelta=null);break;case e.AuthorParseNodeKind.apnkTryCatch:case e.AuthorParseNodeKind.apnkTryFinally:e.ParseNodeExtensions.ForAllChildren(n,function(e){t.FillIndentationLevels(e)}),n.IndentationDelta=null,n.ChildrenIndentationDelta=null;break;case e.AuthorParseNodeKind.apnkFncDecl:t.FillBodyIndentation(n,r);break;case e.AuthorParseNodeKind.apnkSwitch:n.ChildrenIndentationDelta=1;var o=e.ParseNodeExtensions.GetChildren(n).Where(function(t){return t.AuthorNode.EdgeLabel==e.AuthorParseNodeEdge.apneCase||t.AuthorNode.EdgeLabel==e.AuthorParseNodeEdge.apneDefaultCase});o.foreach(function(e){e.IndentationDelta=1,e.ChildrenIndentationDelta=1,r.Push(e)});break;case e.AuthorParseNodeKind.apnkCase:case e.AuthorParseNodeKind.apnkDefaultCase:var i=e.ParseNodeExtensions.FindChildWithEdge(e.ParseNodeExtensions.FindChildWithEdge(n,e.AuthorParseNodeEdge.apneBody),e.AuthorParseNodeEdge.apneBlockBody);null!=i&&(i.AuthorNode.Details.Kind==e.AuthorParseNodeKind.apnkList?e.ParseNodeExtensions.ForAllChildren(i,function(e){e.IndentationDelta=1,r.Push(e)}):i.AuthorNode.Details.Kind==e.AuthorParseNodeKind.apnkBlock?(i.IndentationDelta=1,t.FillIndentationEdgesForBlock(i,1)):(i.IndentationDelta=1,r.Push(i)));break;case e.AuthorParseNodeKind.apnkIf:n.ChildrenIndentationDelta=1;var s=e.ParseNodeExtensions.FindChildWithEdge(n,e.AuthorParseNodeEdge.apneThen);t.FillIndentationEdgesForBlockOrNot(s,1);var a=e.ParseNodeExtensions.FindChildWithEdge(n,e.AuthorParseNodeEdge.apneElse);t.FillIndentationEdgesForBlockOrNot(a,1);break;case e.AuthorParseNodeKind.apnkFor:case e.AuthorParseNodeKind.apnkForIn:case e.AuthorParseNodeKind.apnkWhile:case e.AuthorParseNodeKind.apnkWith:case e.AuthorParseNodeKind.apnkDoWhile:n.ChildrenIndentationDelta=1;var i=e.ParseNodeExtensions.FindChildWithEdge(n,e.AuthorParseNodeEdge.apneBody); t.FillIndentationEdgesForBlockOrNot(i,1);break;case e.AuthorParseNodeKind.apnkObject:n.IsIndentationOverrideEdge=!0,n.ChildrenIndentationDelta=1;var l=e.ParseNodeExtensions.FindChildWithEdge(n,e.AuthorParseNodeEdge.apneMembers);null!=l&&(l.AuthorNode.Details.Kind==e.AuthorParseNodeKind.apnkList?e.ParseNodeExtensions.ForAllChildren(l,function(e){e.ChildrenIndentationDelta=1,e.IndentationDelta=1,r.Push(e)}):(l.ChildrenIndentationDelta=1,l.IndentationDelta=1,r.Push(l)));break;case e.AuthorParseNodeKind.apnkArray:n.IsIndentationOverrideEdge=!0,n.ChildrenIndentationDelta=1;var c=e.ParseNodeExtensions.FindChildWithEdge(n,e.AuthorParseNodeEdge.apneElements);null!=c&&(c.AuthorNode.Details.Kind==e.AuthorParseNodeKind.apnkList?e.ParseNodeExtensions.ForAllChildren(c,function(e){e.IsIndentationOverrideEdge=!0,r.Push(e)}):(c.IsIndentationOverrideEdge=!0,r.Push(c)));break;case e.AuthorParseNodeKind.apnkTry:case e.AuthorParseNodeKind.apnkCatch:case e.AuthorParseNodeKind.apnkFinally:n.ChildrenIndentationDelta=1;var u=e.ParseNodeExtensions.FindChildWithEdge(n,e.AuthorParseNodeEdge.apneBody);if(null==u||null!=u&&u.AuthorNode.Details.Kind!=e.AuthorParseNodeKind.apnkTryCatch&&u.AuthorNode.Details.Kind!=e.AuthorParseNodeKind.apnkTryFinally)for(var p=n.Parent;null!=p;){if((p.AuthorNode.Details.Kind==e.AuthorParseNodeKind.apnkTryCatch||p.AuthorNode.Details.Kind==e.AuthorParseNodeKind.apnkTryFinally)&&null!=p.IndentationDelta){n.IndentationDelta=p.IndentationDelta;break}p=p.Parent}null!=u&&u.AuthorNode.Details.Kind==e.AuthorParseNodeKind.apnkBlock?t.FillIndentationEdgesForBlock(u,1):e.ParseNodeExtensions.ForAllChildren(n,function(e){r.Push(e)});break;case e.AuthorParseNodeKind.apnkAsg:case e.AuthorParseNodeKind.apnkAsgAdd:case e.AuthorParseNodeKind.apnkAsgSub:case e.AuthorParseNodeKind.apnkAsgMul:case e.AuthorParseNodeKind.apnkAsgDiv:case e.AuthorParseNodeKind.apnkAsgMod:case e.AuthorParseNodeKind.apnkAsgAnd:case e.AuthorParseNodeKind.apnkAsgXor:case e.AuthorParseNodeKind.apnkAsgOr:case e.AuthorParseNodeKind.apnkAsgLsh:case e.AuthorParseNodeKind.apnkAsgRsh:case e.AuthorParseNodeKind.apnkAsgRs2:case e.AuthorParseNodeKind.apnkVarDecl:case e.AuthorParseNodeKind.apnkVarDeclList:case e.AuthorParseNodeKind.apnkCall:case e.AuthorParseNodeKind.apnkNew:case e.AuthorParseNodeKind.apnkDelete:case e.AuthorParseNodeKind.apnkReturn:case e.AuthorParseNodeKind.apnkDot:case e.AuthorParseNodeKind.apnkIndex:n.AuthorNode.Details.Kind==e.AuthorParseNodeKind.apnkVarDecl&&null!=n.Parent&&n.Parent.AuthorNode.Details.Kind==e.AuthorParseNodeKind.apnkVarDeclList||(n.ChildrenIndentationDelta=1),e.ParseNodeExtensions.ForAllChildren(n,function(e){r.Push(e)});break;default:e.ParseNodeExtensions.ForAllChildren(n,function(e){r.Push(e)})}},t.FillIndentationEdgesForBlockOrNot=function(n,r){null!=n&&(n.ChildrenIndentationDelta=r,n.AuthorNode.Details.Kind==e.AuthorParseNodeKind.apnkBlock?t.FillIndentationEdgesForBlock(n,r):(n.IndentationDelta=r,t.FillIndentationLevels(n)))},t.FillIndentationEdgesForBlock=function(n,r){if(null!=n){e.Debug.Assert(n.AuthorNode.Details.Kind==e.AuthorParseNodeKind.apnkBlock,"Expecting a node of kind block."),(n.AuthorNode.Details.Flags&e.AuthorParseNodeFlags.apnfSyntheticNode)!=e.AuthorParseNodeFlags.apnfSyntheticNode&&(n.ChildrenIndentationDelta=r);var i=e.FirstOrDefault(e.ParseNodeExtensions.GetChildren(n),function(){return!0});null!=i&&(i.AuthorNode.Details.Kind==e.AuthorParseNodeKind.apnkList?e.ParseNodeExtensions.ForAllChildren(i,function(e){e.IndentationDelta=n.ChildrenIndentationDelta,t.FillIndentationLevels(e)}):(i.IndentationDelta=n.ChildrenIndentationDelta,t.FillIndentationLevels(i)))}},t}();e.IndentationEdgeFinder=t}(Formatting||(Formatting={}));var Formatting;!function(e){var t=function(){function t(e){this.textEditInfo=e,this.OrigIndentPosition=this.textEditInfo.Position}return t.prototype.Position=function(){return this.textEditInfo.Position},t.prototype.Indentation=function(){return this.textEditInfo.ReplaceWith},t.prototype.OrigIndentLength=function(){return this.textEditInfo.Length},t.create1=function(e){return new t(e)},t.create2=function(n,r,i,o){var s=new e.TextEditInfo(n,o,r),a=new t(s);return a.OrigIndentPosition=i,a},t}();e.IndentationEditInfo=t}(Formatting||(Formatting={}));var Formatting;!function(e){var t=function(){function e(e,t){"undefined"==typeof e&&(e=null),"undefined"==typeof t&&(t=0),this.Prefix=e,this.Level=t}return e}();e.IndentationInfo=t}(Formatting||(Formatting={}));var Formatting;!function(e){var t=function(){function t(t,n,r,i,o,s,a){this.logger=t,this.tree=n,this.snapshot=r,this.languageHostIndentation=i,this.editorOptions=o,this.firstToken=s,this.smartIndent=a,this.indentationBag=new e.IndentationBag(this.snapshot),this.scriptBlockBeginLineNumber=-1,this.offsetIndentationDeltas=new e.Dictionary_int_int,this.tree.Root.SetIndentationOverride(""),this.ApplyScriptBlockIndentation(this.languageHostIndentation,this.tree),this.FillInheritedIndentation(this.tree)}return t.prototype.GetIndentationEdits=function(e,t,n,r){this.logger.information()&&this.logger.log("GetIndentationEdits(t1=["+e.Span.startPosition()+","+e.Span.endPosition()+"], "+"t2=["+(null==t?"null":t.Span.startPosition()+","+t.Span.endPosition())+"]"+")");var i=this.GetIndentationEditsWorker(e,t,n,r);if(this.logger.information())for(var o=0;o=o;o++){var s=this.snapshot.GetLineFromLineNumber(o).startPosition(),a=this.GetLineIndentationForOffset(s),l=this.ApplyIndentationDelta2(a,i);if(null!=l){var c=s+a.length,u=this.GetIndentEdit(l,c,!1);null!=u&&n.add(u)}}return n},t.GetIndentSizeFromIndentText=function(e,n){return t.GetIndentSizeFromText(e,n,!1)},t.GetIndentSizeFromText=function(e,t,n){for(var r=0,i=0;il;l++){var u=a.charCodeAt(l);if(!e.StringUtils.IsWhiteSpace(u)){e.Debug.Fail("Formatting error: Will remove user code when indenting the line: "+o.getText());break}}return new e.TextEditInfo(s.start(),s.length(),i)}return null},t.prototype.ApplyIndentationLevel=function(t,n){var r=this.editorOptions.IndentSize,i=this.editorOptions.TabSize,o=this.editorOptions.ConvertTabsToSpaces;if(0>n){if(e.StringUtils.IsNullOrEmpty(t))return"";var s=0;return e.StringUtils.foreach(t,function(e){" "==e?s+=i:s++}),s+=n*r,0>s?"":this.GetIndentString(null,s,i,o)}var a=n*r;return this.GetIndentString(t,a,i,o)},t.prototype.GetIndentString=function(t,n,r,i){var o=i?e.StringUtils.create(" ",r):" ",s="";e.StringUtils.IsNullOrEmpty(t)||(s+=t);for(var a=0;n-r>=a;)s+=o,a+=r;for(;n>a;)s+=" ",a++;return s},t.prototype.ApplyIndentationDeltaFromParent=function(t,n){for(var r=null,i=n;null!=i&&!i.CanIndent();)i=i.Parent;if(null!=i&&i.AuthorNode.Details.Kind!=e.AuthorParseNodeKind.apnkProg){var o=this.GetIndentationDelta(i.AuthorNode.Details.StartOffset,t.Span.startPosition());void 0!==o&&(r=this.ApplyIndentationDelta1(t.Span.startPosition(),o))}return r},t.prototype.ApplyIndentationDelta1=function(t,n){var r=this.snapshot.GetLineFromPosition(t),i=new e.Span(r.startPosition(),t-r.startPosition()),o=this.snapshot.GetText(i);return this.ApplyIndentationDelta2(o,n)},t.prototype.ApplyIndentationDelta2=function(n,r){if(0==r)return null;var i=t.GetIndentSizeFromIndentText(n,this.editorOptions),o=i+r;0>o&&(o=0);var s=this.GetIndentString(null,o,this.editorOptions.TabSize,this.editorOptions.ConvertTabsToSpaces);return null!=s?new e.IndentationInfo(s,0):null},t.prototype.GetIndentationDelta=function(n,r){e.Debug.Assert(void 0!==r,"Error: caller must pass 'null' for undefined position");var i=this.offsetIndentationDeltas.GetValue(n);if(null===i){var o=this.indentationBag.FindIndent(n);if(null==o)return null;var s=this.snapshot.GetText(new e.Span(o.OrigIndentPosition,o.OrigIndentLength())),a=o.Indentation(),l=t.GetIndentSizeFromText(s,this.editorOptions,!0),c=t.GetIndentSizeFromIndentText(a,this.editorOptions);if(null!==r){var u=this.snapshot.GetLineFromPosition(r).startPosition(),p=this.snapshot.GetText(new e.Span(u,r-u)),h=t.GetIndentSizeFromIndentText(p,this.editorOptions);l>h&&(l=t.GetIndentSizeFromIndentText(s,this.editorOptions))}i=c-l,this.offsetIndentationDeltas.Add(n,i)}return i},t.prototype.FillInheritedIndentation=function(t){var n=-1,r=null;if(null!=t.StartNodeSelf)if(this.smartIndent||null===t.StartNodePreviousSibling||0!=t.StartNodeSelf.AuthorNode.Label||0!=t.StartNodePreviousSibling.Label){var i;if(this.smartIndent)for(i=t.StartNodeSelf;null!=i&&i.AuthorNode.Details.StartOffset==this.firstToken.Span.startPosition();)i=i.Parent;else{var o=this.snapshot.GetLineNumberFromPosition(t.StartNodeSelf.AuthorNode.Details.StartOffset);for(i=t.StartNodeSelf.Parent;null!=i&&o==this.snapshot.GetLineNumberFromPosition(i.AuthorNode.Details.StartOffset);)i=i.Parent}for(;null!=i&&!i.CanIndent();)i=i.Parent;null!=i&&i.AuthorNode.Details.Kind!=e.AuthorParseNodeKind.apnkProg&&(n=i.AuthorNode.Details.StartOffset,r=i)}else{r=t.StartNodeSelf,n=t.StartNodePreviousSibling.Details.StartOffset;for(var s=this.snapshot.GetLineNumberFromPosition(n),a=r;null!=a.Parent&&this.snapshot.GetLineNumberFromPosition(a.Parent.AuthorNode.Details.StartOffset)==s;)a=a.Parent,a.CanIndent()&&(r=a,r.IndentationDelta=0)}if(null!=r){var l=this.GetLineIndentationForOffset(n);this.smartIndent||null===t.StartNodePreviousSibling||null==r.Parent||e.ParseNodeExtensions.GetChildren(r.Parent).foreach(function(e){e!==r&&e.CanIndent()&&e.SetIndentationOverride(l)});var c=0,u=this.snapshot.GetLineNumberFromPosition(r.AuthorNode.Details.StartOffset);do{var p=this.snapshot.GetLineNumberFromPosition(r.AuthorNode.Details.StartOffset);u!=p&&(u=p,l=this.ApplyIndentationLevel(l,-c),c=0),r.CanIndent()&&(r.SetIndentationOverride(l),c=r.IndentationDelta),r=r.Parent}while(null!=r)}},t.prototype.GetLineIndentationForOffset=function(e){var t;if(t=this.indentationBag.FindIndent(e),null!=t)return t.Indentation();for(var n=this.snapshot.GetLineFromPosition(e),r=n.getText(),i=0;ithis.snapshot.GetLineNumberFromPosition(e.Span.startPosition())},t}();e.Indenter=t}(Formatting||(Formatting={}));var Formatting;!function(e){var t=function(){function t(e,t){this.bracePoint=e,this.FileAuthoringProxy=t}return t.prototype.Run=function(){var e=this.FileAuthoringProxy.GetASTCursor();return e.SeekToOffset(this.bracePoint.position,!0),this.FindMatchingBlockSpan(e)},t.prototype.FindMatchingBlockSpan=function(t){for(var n=t.Current();n.Kind!=e.AuthorParseNodeKind.apnkEmptyNode;){if(null!=n.ast)switch(n.ast.nodeType){case TypeScript.NodeType.InterfaceDeclaration:case TypeScript.NodeType.ClassDeclaration:case TypeScript.NodeType.ModuleDeclaration:return e.Span.FromBounds(n.ast.minChar,n.ast.limChar);case TypeScript.NodeType.ImportDeclaration:return new e.Span(n.StartOffset,n.EndOffset-n.StartOffset)}switch(n.Kind){case e.AuthorParseNodeKind.apnkProg:return null;case e.AuthorParseNodeKind.apnkVarDecl:case e.AuthorParseNodeKind.apnkSwitch:case e.AuthorParseNodeKind.apnkCase:case e.AuthorParseNodeKind.apnkDefaultCase:case e.AuthorParseNodeKind.apnkTry:case e.AuthorParseNodeKind.apnkCatch:case e.AuthorParseNodeKind.apnkFinally:case e.AuthorParseNodeKind.apnkIf:case e.AuthorParseNodeKind.apnkFor:case e.AuthorParseNodeKind.apnkForIn:case e.AuthorParseNodeKind.apnkWhile:case e.AuthorParseNodeKind.apnkDoWhile:case e.AuthorParseNodeKind.apnkWith:case e.AuthorParseNodeKind.apnkCall:case e.AuthorParseNodeKind.apnkReturn:case e.AuthorParseNodeKind.apnkAsg:case e.AuthorParseNodeKind.apnkAsgAdd:case e.AuthorParseNodeKind.apnkAsgSub:case e.AuthorParseNodeKind.apnkAsgMul:case e.AuthorParseNodeKind.apnkAsgDiv:case e.AuthorParseNodeKind.apnkAsgMod:case e.AuthorParseNodeKind.apnkAsgAnd:case e.AuthorParseNodeKind.apnkAsgXor:case e.AuthorParseNodeKind.apnkAsgOr:case e.AuthorParseNodeKind.apnkAsgLsh:case e.AuthorParseNodeKind.apnkAsgRsh:case e.AuthorParseNodeKind.apnkAsgRs2:return new e.Span(n.StartOffset,n.EndOffset-n.StartOffset);case e.AuthorParseNodeKind.apnkBlock:if((n.Flags&e.AuthorParseNodeFlags.apnfSyntheticNode)!=e.AuthorParseNodeFlags.apnfSyntheticNode){var r=t.Parent();switch(r.Kind){case e.AuthorParseNodeKind.apnkBlock:case e.AuthorParseNodeKind.apnkList:return new e.Span(n.StartOffset,n.EndOffset-n.StartOffset)}}n=t.MoveUp();continue;case e.AuthorParseNodeKind.apnkFncDecl:var i=t.GetNodeProperty(e.AuthorParseNodeProperty.apnpFunctionKeywordMin);i=0==i?n.StartOffset:i;var o=t.GetNodeProperty(e.AuthorParseNodeProperty.apnpRCurlyMin);return o=0==o?n.EndOffset:o+1,new e.Span(i,o-i);case e.AuthorParseNodeKind.apnkObject:var i=t.GetNodeProperty(e.AuthorParseNodeProperty.apnpLCurlyMin);i=0==i?n.StartOffset:i;var o=t.GetNodeProperty(e.AuthorParseNodeProperty.apnpRCurlyMin);return o=0==o?n.EndOffset:o+1,new e.Span(i,o-i);default:n=t.MoveUp();continue}}return null},t}();e.MatchingBlockFinderTask=t}(Formatting||(Formatting={}));var Formatting;!function(e){var t=function(){function t(){this._children=null,this.blockSpan=null,this.indentationOverride=null,this.Parent=null,this.AuthorNode=null,this.IsIndentationOverrideEdge=!1,this.IndentationDelta=null,this.ChildrenIndentationDelta=null,this.TokenTagIndex=null}return t.prototype.children=function(){return this._children},t.prototype.addChildNode=function(t){null===this._children&&(this._children=new e.List_ParseNode);var n=this._children.count();if(0===n)this._children.add(t);else{var r=t.AuthorNode.Details.StartOffset,i=this._children.get(n-1).AuthorNode.Details.StartOffset;if(r>=i)this._children.add(t);else{var o=e.ParseNodeExtensions.findNodeInsertionPivot(this._children,t.AuthorNode.Details.StartOffset);0>o?this._children.insert(~o,t):this._children.insert(o+1,t)}}},t.prototype.CanIndent=function(){return null!=this.IndentationDelta},t.prototype.CoverSpan=function(e){var t=this.AuthorNode.Details;return e.start()>=t.StartOffset&&e.end()<=t.EndOffset},t.prototype.SetIndentationOverride=function(e){this.indentationOverride=e},t.prototype.GetNodeStartLineIndentation=function(t){for(var n=this,r=null;null!=n&&!n.CanIndent()&&!n.IsIndentationOverrideEdge;)n=n.Parent;return null!=n&&(null==n.indentationOverride&&(n.indentationOverride=t.GetLineIndentationForOffset(n.AuthorNode.Details.StartOffset)),r=n.indentationOverride),new e.IndentationInfo(r,0)},t.prototype.GetEffectiveIndentation=function(t){for(var n=this,r=null,i=0;null!=n&&!n.CanIndent()&&!n.IsIndentationOverrideEdge;)n=n.Parent;if(null!=n)if(null!=n.indentationOverride)r=n.indentationOverride;else if(n.CanIndent())for(i=n.IndentationDelta,n.AuthorNode.Label&&i++,n=n.Parent;null!=n;){if(null!=n.indentationOverride){r=n.indentationOverride;break}if(n.CanIndent()||n.IsIndentationOverrideEdge){n.indentationOverride=t.GetLineIndentationForOffset(n.AuthorNode.Details.StartOffset),r=n.indentationOverride;break}n=n.Parent}else n.IsIndentationOverrideEdge&&(n.indentationOverride=t.GetLineIndentationForOffset(n.AuthorNode.Details.StartOffset),r=n.indentationOverride);return new e.IndentationInfo(r,i)},t.prototype.GetEffectiveChildrenIndentation=function(e){for(var t=this,n=null;null==t.ChildrenIndentationDelta&&null!=t.Parent;)t=t.Parent;return null!=t.ChildrenIndentationDelta&&(n=t.GetEffectiveIndentation(e),n.Level+=t.ChildrenIndentationDelta),n},t.prototype.GetEffectiveChildrenIndentationForComment=function(n){for(var r=this,i=null;null!=r.Parent&&(null==r.ChildrenIndentationDelta||null==r.IndentationDelta)&&!t.IsNonIndentableException(r);)r=r.Parent;return null!=r.ChildrenIndentationDelta&&(i=new e.IndentationInfo,i.Level=r.ChildrenIndentationDelta,this.AuthorNode.Details.Kind!=e.AuthorParseNodeKind.apnkProg&&(i.Prefix=n.GetLineIndentationForOffset(r.AuthorNode.Details.StartOffset))),i},t.IsNonIndentableException=function(t){return null==t.IndentationDelta&&(t.AuthorNode.Details.Kind==e.AuthorParseNodeKind.apnkObject||t.AuthorNode.Details.Kind==e.AuthorParseNodeKind.apnkFncDecl)},t.prototype.GetBlockSpan=function(t,n){if(null!=this.blockSpan)return this.blockSpan;var r=this.AuthorNode.Details.StartOffset,i=this.AuthorNode.Details.EndOffset,o=null;if(this.AuthorNode.Details.Kind==e.AuthorParseNodeKind.apnkFncDecl||this.AuthorNode.Details.Kind==e.AuthorParseNodeKind.apnkSwitch?o=this:this.AuthorNode.Details.Kind==e.AuthorParseNodeKind.apnkList&&null!=this.Parent&&this.Parent.AuthorNode.Details.Kind==e.AuthorParseNodeKind.apnkFncDecl&&(o=this.Parent),null!=o)if(null!=o.TokenTagIndex){for(var s=o.TokenTagIndex,a=s+1;a=c&&(r=c)}else if(this.AuthorNode.Details.Kind!=e.AuthorParseNodeKind.apnkBlock){var u=!1;e.ParseNodeExtensions.GetChildren(this).foreach(function(t){t.AuthorNode.Details.Kind==e.AuthorParseNodeKind.apnkBlock&&(u||(u=!0,r=t.AuthorNode.Details.StartOffset,i=t.AuthorNode.Details.EndOffset))})}return e.Debug.Assert(i>=r,"Expecting start to be before end."),this.blockSpan=new e.Span(r,i-r),this.blockSpan},t.prototype.toString=function(){var t=this.AuthorNode.Level+": "+e.AuthorParseNodeKind._map[this.AuthorNode.Details.Kind]+" - "+TypeScript.NodeType._map[this.AuthorNode.Details.nodeType]+" ("+e.AuthorParseNodeEdge._map[this.AuthorNode.EdgeLabel]+") -- I:"+this.IndentationDelta+",IC:"+this.ChildrenIndentationDelta+" -- ("+this.AuthorNode.Details.StartOffset+","+this.AuthorNode.Details.EndOffset+") -- F:("+this.AuthorNode.Details.Flags+")";return t},t}();e.ParseNode=t}(Formatting||(Formatting={}));var Formatting;!function(e){var t=function(){function t(){}return t.GetChildren=function(t){return null==t||null==t.children()?new e.List_ParseNode:t.children()},t.FindChildrenWithEdge=function(n,r){var i=new e.List_ParseNode;return t.GetChildren(n).foreach(function(e){e.AuthorNode.EdgeLabel==r&&i.add(e)}),i},t.FindChildWithEdge=function(n,r){return e.FirstOrDefault(t.GetChildren(n).Where(function(e){return e.AuthorNode.EdgeLabel==r}),function(){return!0})},t.ForAllChildren=function(e,n){t.GetChildren(e).foreach(n)},t.comparer=function(e,t){return e-t.AuthorNode.Details.StartOffset},t.findNodeInsertionPivot=function(n,r){return 0==n.count()?0:e.BinarySearch(n,r,t.comparer)},t.TryFindNodeIndexForStartOffset=function(n,r){var i=-1;if(n.count()>0){var o=e.BinarySearch(n,r,t.comparer);0>o?(o=~o-1,i=o):i=o}return i},t.TryFindNodeForSpan=function(e,n){var r=t.TryFindNodeIndexForStartOffset(e,n.start());if(r>=0&&r=n.start()&&t.Token!=e.AuthorTokenKind.atkComment&&t.Token!=e.AuthorTokenKind.atkSColon&&t.Token!=e.AuthorTokenKind.atkComma});if(null!=o){var s=o.Span.Start,a=e.LastOrDefault(r,function(t){return t.Span.endPosition()<=n.end()&&t.Token!=e.AuthorTokenKind.atkComment&&t.Token!=e.AuthorTokenKind.atkSColon&&t.Token!=e.AuthorTokenKind.atkComma});if(null!=a){var l=a.Span.End;l>s&&(n=new e.Span(s,l-s))}}}this.Initialize(t,n,i)}return t.FindCommonParentNode=function(n,r,i){if(i.CoverSpan(n)&&i.CoverSpan(r)){if(e.Debug.Assert(n.start()<=r.start(),"left token should be before the right token"),null!=i.children()){var o=e.ParseNodeExtensions.TryFindNodeForSpan(i.children(),n);if(null!=o&&o.CoverSpan(r))return t.FindCommonParentNode(n,r,o)}return i}return null==i.Parent?i:t.FindCommonParentNode(n,r,i.Parent)},t.prototype.Initialize=function(n,r,i){var o=n.GetASTCursor();0==r.length()?o.SeekToOffset(r.start(),!1):o.MoveToEnclosingNode(r.start(),r.end());var s=new e.List_ParseNode,a=o.GetSubTree(i?0:-1);if(a.Count()>0){var l=a.GetItems(0,a.Count());if(l[0].Details.Kind!=e.AuthorParseNodeKind.apnkEndCode){var c=o.GetEdgeLabel();if(c!=e.AuthorParseNodeEdge.apneNone){var u=new e.AuthorParseNode;u.Level=0,u.Label=l[0].Label,u.Name=l[0].Name,u.Details=l[0].Details,u.EdgeLabel=c,l[0]=u}}l.forEach(function(t){if(t.Details.Kind!=e.AuthorParseNodeKind.apnkEndCode){var n=new e.ParseNode;n.AuthorNode=t,s.add(n)}}),t.AdjustNodeSpanIfNeeded(o,s.get(0))}this.StartNodeSelf=t.FindStartSelfNode(s,r);var p=0,h=new e.List_ParseNode,d=o.MoveUp();if(!i&&null!=this.StartNodeSelf)if(this.StartNodeSelf.AuthorNode.Level>0)for(var f=s.count()-1;f>=0;--f){var m=s.get(f).AuthorNode;if(m.Level==this.StartNodeSelf.AuthorNode.Level&&t.IsSiblingEdge(m.EdgeLabel)&&m.Details.EndOffset0)){var g=a.GetItems(0,a.Count()),y=t.GetPreviousSibling(this.StartNodeSelf.AuthorNode,g);null!==y&&(this.StartNodePreviousSibling=y)}for(;d.Kind!=e.AuthorParseNodeKind.apnkEmptyNode;){var c=o.GetEdgeLabel(),v=new e.ParseNode;v.AuthorNode=new e.AuthorParseNode,v.AuthorNode.Details=d,v.AuthorNode.Level=--p,v.AuthorNode.EdgeLabel=c,t.AdjustNodeSpanIfNeeded(o,v),h.add(v),d=o.MoveUp()}for(var f=0;f0;o--)if(n[o].Details.Equals(e.Details)){i=n[o].Level;break}for(;o>0;o--){var s=n[o];if(s.Level==i&&t.IsSiblingEdge(s.EdgeLabel)&&s.Details.EndOffset=n.start()&&e.AuthorNode.Details.StartOffseti)o.Parent=r,r.addChildNode(o),r=o,i=o.AuthorNode.Level;else{for(;i>o.AuthorNode.Level;)r=r.Parent,i--;o.Parent=r.Parent,r.Parent.addChildNode(o),r=o}}return n},t.DumpTree=function(n,r){if(n.information()){for(var i="",o=-2;o<=r.AuthorNode.Level;o++)i+=" ";i+=r.toString(),n.log(i),e.ParseNodeExtensions.GetChildren(r).foreach(function(e){t.DumpTree(n,e)})}},t.AdjustNodeSpanIfNeeded=function(t,n){var r=null,i=null,o=n.AuthorNode;if(o.Details.Kind==e.AuthorParseNodeKind.apnkObject?(r=e.AuthorParseNodeProperty.apnpLCurlyMin,i=e.AuthorParseNodeProperty.apnpRCurlyMin):o.Details.Kind==e.AuthorParseNodeKind.apnkArray?(r=e.AuthorParseNodeProperty.apnpLBrackMin,i=e.AuthorParseNodeProperty.apnpRBrackMin):o.Details.Kind==e.AuthorParseNodeKind.apnkFncDecl&&(r=e.AuthorParseNodeProperty.apnpFunctionKeywordMin,i=e.AuthorParseNodeProperty.apnpRCurlyMin),null!=r&&null!=i){var s=t.GetNodeProperty(r);0==s&&(s=n.AuthorNode.Details.StartOffset);var a=t.GetNodeProperty(i);0==a?a=n.AuthorNode.Details.EndOffset:a+=1,e.ParseNodeExtensions.SetNodeSpan(n,s,a)}},t}();e.ParseTree=t}(Formatting||(Formatting={}));var Formatting;!function(e){var t=function(){function t(t,n,r){"undefined"==typeof r&&(r=e.RuleFlags.None),this.Descriptor=t,this.Operation=n,this.Flag=r}return t.prototype.toString=function(){return"[desc="+this.Descriptor+","+"operation="+this.Operation+","+"flag="+this.Flag+"]"},t}();e.Rule=t}(Formatting||(Formatting={}));var Formatting;!function(e){!function(e){e._map=[],e._map[0]="Ignore",e.Ignore=0,e._map[1]="Space",e.Space=1,e._map[2]="NewLine",e.NewLine=2,e._map[3]="Delete",e.Delete=3}(e.RuleAction||(e.RuleAction={})),e.RuleAction}(Formatting||(Formatting={}));var Formatting;!function(e){var t=function(){function t(e,t){this.LeftTokenRange=e,this.RightTokenRange=t}return t.prototype.toString=function(){return"[leftRange="+this.LeftTokenRange+","+"rightRange="+this.RightTokenRange+"]"},t.create1=function(n,r){return t.create4(e.Shared.TokenRange.FromToken(n),e.Shared.TokenRange.FromToken(r))},t.create2=function(n,r){return t.create4(n,e.Shared.TokenRange.FromToken(r))},t.create3=function(n,r){return t.create4(e.Shared.TokenRange.FromToken(n),r)},t.create4=function(e,n){return new t(e,n)},t}();e.RuleDescriptor=t}(Formatting||(Formatting={}));var Formatting;!function(e){!function(e){e._map=[],e._map[0]="None",e.None=0,e._map[1]="CanDeleteNewLines",e.CanDeleteNewLines=1}(e.RuleFlags||(e.RuleFlags={})),e.RuleFlags}(Formatting||(Formatting={}));var Formatting;!function(e){var t=function(){function t(){this.Context=null,this.Action=null}return t.prototype.toString=function(){return"[context="+this.Context+","+"action="+this.Action+"]"},t.create1=function(n){return t.create2(e.RuleOperationContext.Any,n)},t.create2=function(e,n){var r=new t;return r.Context=e,r.Action=n,r},t}();e.RuleOperation=t}(Formatting||(Formatting={}));var Formatting;!function(e){var t=function(){function e(){for(var e=[],t=0;tt;t++)if(!this.customContextChecks[t](e))return!1;return!0},e}();e.RuleOperationContext=t}(Formatting||(Formatting={}));var Formatting;!function(e){var t=function(){function t(){this.IgnoreBeforeComment=new e.Rule(e.RuleDescriptor.create2(e.Shared.TokenRange.Any,e.AuthorTokenKind.atkComment),e.RuleOperation.create1(e.RuleAction.Ignore)),this.IgnoreAfterLineComment=new e.Rule(e.RuleDescriptor.create3(e.AuthorTokenKind.atkComment,e.Shared.TokenRange.Any),e.RuleOperation.create2(new e.RuleOperationContext(t.IsFirstTokenLineCommentContext),e.RuleAction.Ignore)),this.NoSpaceBeforeSemicolon=new e.Rule(e.RuleDescriptor.create2(e.Shared.TokenRange.Any,e.AuthorTokenKind.atkSColon),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext,t.IsNotForContext),e.RuleAction.Delete)),this.NoSpaceBeforeColon=new e.Rule(e.RuleDescriptor.create2(e.Shared.TokenRange.Any,e.AuthorTokenKind.atkColon),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext,t.IsNotBinaryOpContext),e.RuleAction.Delete)),this.NoSpaceBeforeQMark=new e.Rule(e.RuleDescriptor.create2(e.Shared.TokenRange.Any,e.AuthorTokenKind.atkQMark),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext,t.IsNotBinaryOpContext),e.RuleAction.Delete)),this.SpaceAfterColon=new e.Rule(e.RuleDescriptor.create3(e.AuthorTokenKind.atkColon,e.Shared.TokenRange.Any),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext,t.IsNotBinaryOpContext),e.RuleAction.Space)),this.SpaceAfterQMark=new e.Rule(e.RuleDescriptor.create3(e.AuthorTokenKind.atkQMark,e.Shared.TokenRange.Any),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext,t.IsNotBinaryOpContext),e.RuleAction.Space)),this.SpaceAfterSemicolon=new e.Rule(e.RuleDescriptor.create3(e.AuthorTokenKind.atkSColon,e.Shared.TokenRange.Any),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext),e.RuleAction.Space)),this.NewLineAfterCloseCurly=new e.Rule(e.RuleDescriptor.create3(e.AuthorTokenKind.atkRCurly,e.Shared.TokenRange.Any),e.RuleOperation.create2(new e.RuleOperationContext(t.IsMultilineChildParentContext),e.RuleAction.NewLine)),this.SpaceAfterCloseCurly=new e.Rule(e.RuleDescriptor.create3(e.AuthorTokenKind.atkRCurly,e.Shared.TokenRange.Any),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineSiblingNodeContext),e.RuleAction.Space)),this.SpaceBetweenCloseCurlyAndElse=new e.Rule(e.RuleDescriptor.create1(e.AuthorTokenKind.atkRCurly,e.AuthorTokenKind.atkElse),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext),e.RuleAction.Space)),this.SpaceBetweenCloseCurlyAndWhile=new e.Rule(e.RuleDescriptor.create1(e.AuthorTokenKind.atkRCurly,e.AuthorTokenKind.atkWhile),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext),e.RuleAction.Space)),this.NoSpaceBeforeDot=new e.Rule(e.RuleDescriptor.create2(e.Shared.TokenRange.Any,e.AuthorTokenKind.atkDot),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext),e.RuleAction.Delete)),this.NoSpaceAfterDot=new e.Rule(e.RuleDescriptor.create3(e.AuthorTokenKind.atkDot,e.Shared.TokenRange.Any),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext),e.RuleAction.Delete)),this.NoSpaceBeforeOpenBracket=new e.Rule(e.RuleDescriptor.create2(e.Shared.TokenRange.Any,e.AuthorTokenKind.atkLBrack),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext),e.RuleAction.Delete)),this.NoSpaceAfterOpenBracket=new e.Rule(e.RuleDescriptor.create3(e.AuthorTokenKind.atkLBrack,e.Shared.TokenRange.Any),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext),e.RuleAction.Delete)),this.NoSpaceBeforeCloseBracket=new e.Rule(e.RuleDescriptor.create2(e.Shared.TokenRange.Any,e.AuthorTokenKind.atkRBrack),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext),e.RuleAction.Delete)),this.NoSpaceAfterCloseBracket=new e.Rule(e.RuleDescriptor.create3(e.AuthorTokenKind.atkRBrack,e.Shared.TokenRange.Any),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext),e.RuleAction.Delete)),this.SpaceAfterOpenCurly=new e.Rule(e.RuleDescriptor.create3(e.AuthorTokenKind.atkLCurly,e.Shared.TokenRange.Any),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSingleLineBlockContext),e.RuleAction.Space)),this.SpaceBeforeCloseCurly=new e.Rule(e.RuleDescriptor.create2(e.Shared.TokenRange.Any,e.AuthorTokenKind.atkRCurly),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSingleLineBlockContext),e.RuleAction.Space)),this.NoSpaceBetweenEmptyCurlyBrackets=new e.Rule(e.RuleDescriptor.create1(e.AuthorTokenKind.atkLCurly,e.AuthorTokenKind.atkRCurly),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext,t.IsObjectContext),e.RuleAction.Delete)),this.NewLineAfterOpenCurlyInBlockContext=new e.Rule(e.RuleDescriptor.create3(e.AuthorTokenKind.atkLCurly,e.Shared.TokenRange.Any),e.RuleOperation.create2(new e.RuleOperationContext(t.IsMultilineBlockContext),e.RuleAction.NewLine)),this.NewLineBeforeCloseCurlyInFunctionOrControl=new e.Rule(e.RuleDescriptor.create2(e.Shared.TokenRange.Any,e.AuthorTokenKind.atkRCurly),e.RuleOperation.create2(new e.RuleOperationContext(t.IsMultilineBlockContext),e.RuleAction.NewLine)),this.NoSpaceAfterUnaryPrefixOperator=new e.Rule(e.RuleDescriptor.create4(e.Shared.TokenRange.UnaryPrefixOperators,e.Shared.TokenRange.UnaryPrefixExpressions),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext,t.IsNotBinaryOpContext),e.RuleAction.Delete)),this.NoSpaceAfterUnaryPreincrementOperator=new e.Rule(e.RuleDescriptor.create3(e.AuthorTokenKind.atkInc,e.Shared.TokenRange.UnaryPreincrementExpressions),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext),e.RuleAction.Delete)),this.NoSpaceAfterUnaryPredecrementOperator=new e.Rule(e.RuleDescriptor.create3(e.AuthorTokenKind.atkDec,e.Shared.TokenRange.UnaryPredecrementExpressions),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext),e.RuleAction.Delete)),this.NoSpaceBeforeUnaryPostincrementOperator=new e.Rule(e.RuleDescriptor.create2(e.Shared.TokenRange.UnaryPostincrementExpressions,e.AuthorTokenKind.atkInc),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext),e.RuleAction.Delete)),this.NoSpaceBeforeUnaryPostdecrementOperator=new e.Rule(e.RuleDescriptor.create2(e.Shared.TokenRange.UnaryPostdecrementExpressions,e.AuthorTokenKind.atkDec),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext),e.RuleAction.Delete)),this.SpaceAfterPostincrementWhenFollowedByAdd=new e.Rule(e.RuleDescriptor.create1(e.AuthorTokenKind.atkInc,e.AuthorTokenKind.atkAdd),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext,t.IsBinaryOpContext),e.RuleAction.Space)),this.SpaceAfterAddWhenFollowedByUnaryPlus=new e.Rule(e.RuleDescriptor.create1(e.AuthorTokenKind.atkAdd,e.AuthorTokenKind.atkAdd),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext,t.IsBinaryOpContext),e.RuleAction.Space)),this.SpaceAfterAddWhenFollowedByPreincrement=new e.Rule(e.RuleDescriptor.create1(e.AuthorTokenKind.atkAdd,e.AuthorTokenKind.atkInc),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext,t.IsBinaryOpContext),e.RuleAction.Space)),this.SpaceAfterPostdecrementWhenFollowedBySubtract=new e.Rule(e.RuleDescriptor.create1(e.AuthorTokenKind.atkDec,e.AuthorTokenKind.atkSub),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext,t.IsBinaryOpContext),e.RuleAction.Space)),this.SpaceAfterSubtractWhenFollowedByUnaryMinus=new e.Rule(e.RuleDescriptor.create1(e.AuthorTokenKind.atkSub,e.AuthorTokenKind.atkSub),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext,t.IsBinaryOpContext),e.RuleAction.Space)),this.SpaceAfterSubtractWhenFollowedByPredecrement=new e.Rule(e.RuleDescriptor.create1(e.AuthorTokenKind.atkSub,e.AuthorTokenKind.atkDec),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext,t.IsBinaryOpContext),e.RuleAction.Space)),this.NoSpaceBeforeComma=new e.Rule(e.RuleDescriptor.create2(e.Shared.TokenRange.Any,e.AuthorTokenKind.atkComma),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext),e.RuleAction.Delete)),this.SpaceAfterCertainKeywords=new e.Rule(e.RuleDescriptor.create4(e.Shared.TokenRange.FromTokens([e.AuthorTokenKind.atkVar,e.AuthorTokenKind.atkThrow,e.AuthorTokenKind.atkNew,e.AuthorTokenKind.atkDelete,e.AuthorTokenKind.atkReturn,e.AuthorTokenKind.atkVoid,e.AuthorTokenKind.atkTypeof]),e.Shared.TokenRange.Any),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext),e.RuleAction.Space)),this.NoSpaceBeforeOpenParenInFuncCall=new e.Rule(e.RuleDescriptor.create2(e.Shared.TokenRange.Any,e.AuthorTokenKind.atkLParen),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext,t.IsFunctionCallOrNewContext),e.RuleAction.Delete)),this.SpaceAfterFunctionInFuncDecl=new e.Rule(e.RuleDescriptor.create3(e.AuthorTokenKind.atkFunction,e.Shared.TokenRange.Any),e.RuleOperation.create2(new e.RuleOperationContext(t.IsFunctionDeclContext),e.RuleAction.Space)),this.NoSpaceBeforeOpenParenInFuncDecl=new e.Rule(e.RuleDescriptor.create2(e.Shared.TokenRange.Any,e.AuthorTokenKind.atkLParen),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext,t.IsFunctionOrGetSetDeclContext),e.RuleAction.Delete)),this.SpaceBetweenStatements=new e.Rule(e.RuleDescriptor.create4(e.Shared.TokenRange.FromTokens([e.AuthorTokenKind.atkRParen,e.AuthorTokenKind.atkDo,e.AuthorTokenKind.atkElse,e.AuthorTokenKind.atkCase]),e.Shared.TokenRange.Any),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext,t.IsNotForContext),e.RuleAction.Space)),this.SpaceAfterTryFinally=new e.Rule(e.RuleDescriptor.create2(e.Shared.TokenRange.FromTokens([e.AuthorTokenKind.atkTry,e.AuthorTokenKind.atkFinally]),e.AuthorTokenKind.atkLCurly),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext),e.RuleAction.Space)),this.SpaceAfterGetSetInMember=new e.Rule(e.RuleDescriptor.create1(e.AuthorTokenKind.atkIdentifier,e.AuthorTokenKind.atkIdentifier),e.RuleOperation.create2(new e.RuleOperationContext(t.IsGetSetMemberContext),e.RuleAction.Space)),this.SpaceBeforeBinaryKeywordOperator=new e.Rule(e.RuleDescriptor.create4(e.Shared.TokenRange.Any,e.Shared.TokenRange.BinaryKeywordOperators),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext,t.IsBinaryOpContext),e.RuleAction.Space)),this.SpaceAfterBinaryKeywordOperator=new e.Rule(e.RuleDescriptor.create4(e.Shared.TokenRange.BinaryKeywordOperators,e.Shared.TokenRange.Any),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext,t.IsBinaryOpContext),e.RuleAction.Space)),this.NoSpaceAfterConstructor=new e.Rule(e.RuleDescriptor.create1(e.AuthorTokenKind.atkConstructor,e.AuthorTokenKind.atkLParen),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext),e.RuleAction.Delete)),this.NoSpaceAfterModuleImport=new e.Rule(e.RuleDescriptor.create1(e.AuthorTokenKind.atkModule,e.AuthorTokenKind.atkLParen),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext),e.RuleAction.Delete)),this.SpaceAfterCertainTypeScriptKeywords=new e.Rule(e.RuleDescriptor.create4(e.Shared.TokenRange.FromTokens([e.AuthorTokenKind.atkClass,e.AuthorTokenKind.atkDeclare,e.AuthorTokenKind.atkEnum,e.AuthorTokenKind.atkExport,e.AuthorTokenKind.atkExtends,e.AuthorTokenKind.atkGet,e.AuthorTokenKind.atkImplements,e.AuthorTokenKind.atkImport,e.AuthorTokenKind.atkInterface,e.AuthorTokenKind.atkModule,e.AuthorTokenKind.atkPrivate,e.AuthorTokenKind.atkPublic,e.AuthorTokenKind.atkSet,e.AuthorTokenKind.atkStatic]),e.Shared.TokenRange.Any),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext),e.RuleAction.Space)),this.SpaceBeforeCertainTypeScriptKeywords=new e.Rule(e.RuleDescriptor.create4(e.Shared.TokenRange.Any,e.Shared.TokenRange.FromTokens([e.AuthorTokenKind.atkExtends,e.AuthorTokenKind.atkImplements])),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext),e.RuleAction.Space)),this.SpaceAfterModuleName=new e.Rule(e.RuleDescriptor.create1(e.AuthorTokenKind.atkString,e.AuthorTokenKind.atkLCurly),e.RuleOperation.create2(new e.RuleOperationContext(t.IsModuleDeclContext),e.RuleAction.Space)),this.SpaceAfterArrow=new e.Rule(e.RuleDescriptor.create3(e.AuthorTokenKind.atkArrow,e.Shared.TokenRange.Any),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext),e.RuleAction.Space)),this.NoSpaceAfterEllipsis=new e.Rule(e.RuleDescriptor.create1(e.AuthorTokenKind.atkEllipsis,e.AuthorTokenKind.atkIdentifier),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext),e.RuleAction.Delete)),this.NoSpaceAfterOptionalParameters=new e.Rule(e.RuleDescriptor.create3(e.AuthorTokenKind.atkQMark,e.Shared.TokenRange.FromTokens([e.AuthorTokenKind.atkRParen,e.AuthorTokenKind.atkComma])),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext,t.IsNotBinaryOpContext),e.RuleAction.Delete)),this.NoSpaceBetweenEmptyInterfaceCurlyBrackets=new e.Rule(e.RuleDescriptor.create1(e.AuthorTokenKind.atkLCurly,e.AuthorTokenKind.atkRCurly),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext,t.IsInterfaceContext),e.RuleAction.Delete)),this.HighPriorityCommonRules=[this.IgnoreBeforeComment,this.IgnoreAfterLineComment,this.NoSpaceBeforeSemicolon,this.NoSpaceBeforeColon,this.SpaceAfterColon,this.NoSpaceBeforeQMark,this.SpaceAfterQMark,this.NewLineAfterCloseCurly,this.NoSpaceBeforeDot,this.NoSpaceAfterDot,this.NoSpaceAfterUnaryPrefixOperator,this.NoSpaceAfterUnaryPreincrementOperator,this.NoSpaceAfterUnaryPredecrementOperator,this.NoSpaceBeforeUnaryPostincrementOperator,this.NoSpaceBeforeUnaryPostdecrementOperator,this.SpaceAfterPostincrementWhenFollowedByAdd,this.SpaceAfterAddWhenFollowedByUnaryPlus,this.SpaceAfterAddWhenFollowedByPreincrement,this.SpaceAfterPostdecrementWhenFollowedBySubtract,this.SpaceAfterSubtractWhenFollowedByUnaryMinus,this.SpaceAfterSubtractWhenFollowedByPredecrement,this.SpaceAfterOpenCurly,this.SpaceBeforeCloseCurly,this.SpaceAfterCloseCurly,this.SpaceBetweenCloseCurlyAndElse,this.SpaceBetweenCloseCurlyAndWhile,this.NoSpaceBetweenEmptyCurlyBrackets,this.NewLineBeforeCloseCurlyInFunctionOrControl,this.SpaceAfterFunctionInFuncDecl,this.NewLineAfterOpenCurlyInBlockContext,this.SpaceAfterGetSetInMember,this.SpaceAfterCertainKeywords,this.NoSpaceBeforeOpenParenInFuncCall,this.SpaceBeforeBinaryKeywordOperator,this.SpaceAfterBinaryKeywordOperator,this.NoSpaceAfterConstructor,this.NoSpaceAfterModuleImport,this.SpaceAfterCertainTypeScriptKeywords,this.SpaceBeforeCertainTypeScriptKeywords,this.SpaceAfterModuleName,this.SpaceAfterArrow,this.NoSpaceAfterEllipsis,this.NoSpaceAfterOptionalParameters,this.NoSpaceBetweenEmptyInterfaceCurlyBrackets],this.LowPriorityCommonRules=[this.NoSpaceBeforeComma,this.NoSpaceBeforeOpenBracket,this.NoSpaceAfterOpenBracket,this.NoSpaceBeforeCloseBracket,this.NoSpaceAfterCloseBracket,this.SpaceAfterSemicolon,this.NoSpaceBeforeOpenParenInFuncDecl,this.SpaceBetweenStatements,this.SpaceAfterTryFinally],this.SpaceAfterComma=new e.Rule(e.RuleDescriptor.create3(e.AuthorTokenKind.atkComma,e.Shared.TokenRange.Any),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext),e.RuleAction.Space)),this.NoSpaceAfterComma=new e.Rule(e.RuleDescriptor.create3(e.AuthorTokenKind.atkComma,e.Shared.TokenRange.Any),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext),e.RuleAction.Delete)),this.SpaceBeforeBinaryOperator=new e.Rule(e.RuleDescriptor.create4(e.Shared.TokenRange.Any,e.Shared.TokenRange.BinaryOperators),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext,t.IsBinaryOpContext),e.RuleAction.Space)),this.SpaceAfterBinaryOperator=new e.Rule(e.RuleDescriptor.create4(e.Shared.TokenRange.BinaryOperators,e.Shared.TokenRange.Any),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext,t.IsBinaryOpContext),e.RuleAction.Space)),this.NoSpaceBeforeBinaryOperator=new e.Rule(e.RuleDescriptor.create4(e.Shared.TokenRange.Any,e.Shared.TokenRange.BinaryOperators),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext,t.IsBinaryOpContext),e.RuleAction.Delete)),this.NoSpaceAfterBinaryOperator=new e.Rule(e.RuleDescriptor.create4(e.Shared.TokenRange.BinaryOperators,e.Shared.TokenRange.Any),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext,t.IsBinaryOpContext),e.RuleAction.Delete)),this.SpaceAfterKeywordInControl=new e.Rule(e.RuleDescriptor.create2(e.Shared.TokenRange.Keywords,e.AuthorTokenKind.atkLParen),e.RuleOperation.create2(new e.RuleOperationContext(t.IsControlDeclContext),e.RuleAction.Space)),this.NoSpaceAfterKeywordInControl=new e.Rule(e.RuleDescriptor.create2(e.Shared.TokenRange.Keywords,e.AuthorTokenKind.atkLParen),e.RuleOperation.create2(new e.RuleOperationContext(t.IsControlDeclContext),e.RuleAction.Delete)),this.FunctionOpenCurlyLeftTokenRange=e.Shared.TokenRange.Any,this.FunctionOpenCurlyLeftTokenRange_Js=e.Shared.TokenRange.FromTokens([e.AuthorTokenKind.atkRParen,e.AuthorTokenKind.atkComment]),this.SpaceBeforeOpenCurlyInFunction=new e.Rule(e.RuleDescriptor.create2(this.FunctionOpenCurlyLeftTokenRange,e.AuthorTokenKind.atkLCurly),e.RuleOperation.create2(new e.RuleOperationContext(t.IsFunctionDeclContext,t.IsNotFormatOnEnter,t.IsSameLineTokenOrMultilineBlockContext),e.RuleAction.Space),e.RuleFlags.CanDeleteNewLines),this.NewLineBeforeOpenCurlyInFunction=new e.Rule(e.RuleDescriptor.create2(this.FunctionOpenCurlyLeftTokenRange,e.AuthorTokenKind.atkLCurly),e.RuleOperation.create2(new e.RuleOperationContext(t.IsFunctionDeclContext,t.IsMultilineBlockContext),e.RuleAction.NewLine),e.RuleFlags.CanDeleteNewLines),this.TypeScriptOpenCurlyLeftTokenRange=e.Shared.TokenRange.FromTokens([e.AuthorTokenKind.atkIdentifier,e.AuthorTokenKind.atkComment]),this.SpaceBeforeOpenCurlyInTypeScriptDeclWithBlock=new e.Rule(e.RuleDescriptor.create2(this.TypeScriptOpenCurlyLeftTokenRange,e.AuthorTokenKind.atkLCurly),e.RuleOperation.create2(new e.RuleOperationContext(t.IsTypeScriptDeclWithBlockContext,t.IsNotFormatOnEnter,t.IsSameLineTokenOrMultilineBlockContext),e.RuleAction.Space),e.RuleFlags.CanDeleteNewLines),this.NewLineBeforeOpenCurlyInTypeScriptDeclWithBlock=new e.Rule(e.RuleDescriptor.create2(this.TypeScriptOpenCurlyLeftTokenRange,e.AuthorTokenKind.atkLCurly),e.RuleOperation.create2(new e.RuleOperationContext(t.IsTypeScriptDeclWithBlockContext,t.IsMultilineBlockContext),e.RuleAction.NewLine),e.RuleFlags.CanDeleteNewLines),this.ControlOpenCurlyLeftTokenRange=e.Shared.TokenRange.FromTokens([e.AuthorTokenKind.atkRParen,e.AuthorTokenKind.atkComment,e.AuthorTokenKind.atkDo,e.AuthorTokenKind.atkTry,e.AuthorTokenKind.atkFinally,e.AuthorTokenKind.atkElse]),this.SpaceBeforeOpenCurlyInControl=new e.Rule(e.RuleDescriptor.create2(this.ControlOpenCurlyLeftTokenRange,e.AuthorTokenKind.atkLCurly),e.RuleOperation.create2(new e.RuleOperationContext(t.IsControlDeclContext,t.IsNotFormatOnEnter,t.IsSameLineTokenOrMultilineBlockContext),e.RuleAction.Space),e.RuleFlags.CanDeleteNewLines),this.NewLineBeforeOpenCurlyInControl=new e.Rule(e.RuleDescriptor.create2(this.ControlOpenCurlyLeftTokenRange,e.AuthorTokenKind.atkLCurly),e.RuleOperation.create2(new e.RuleOperationContext(t.IsControlDeclContext,t.IsMultilineBlockContext),e.RuleAction.NewLine),e.RuleFlags.CanDeleteNewLines),this.SpaceAfterSemicolonInFor=new e.Rule(e.RuleDescriptor.create3(e.AuthorTokenKind.atkSColon,e.Shared.TokenRange.Any),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext,t.IsForContext),e.RuleAction.Space)),this.NoSpaceAfterSemicolonInFor=new e.Rule(e.RuleDescriptor.create3(e.AuthorTokenKind.atkSColon,e.Shared.TokenRange.Any),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext,t.IsForContext),e.RuleAction.Delete)),this.SpaceAfterOpenParen=new e.Rule(e.RuleDescriptor.create3(e.AuthorTokenKind.atkLParen,e.Shared.TokenRange.Any),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext),e.RuleAction.Space)),this.SpaceBeforeCloseParen=new e.Rule(e.RuleDescriptor.create2(e.Shared.TokenRange.Any,e.AuthorTokenKind.atkRParen),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext),e.RuleAction.Space)),this.NoSpaceBetweenParens=new e.Rule(e.RuleDescriptor.create1(e.AuthorTokenKind.atkLParen,e.AuthorTokenKind.atkRParen),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext),e.RuleAction.Delete)),this.NoSpaceAfterOpenParen=new e.Rule(e.RuleDescriptor.create3(e.AuthorTokenKind.atkLParen,e.Shared.TokenRange.Any),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext),e.RuleAction.Delete)),this.NoSpaceBeforeCloseParen=new e.Rule(e.RuleDescriptor.create2(e.Shared.TokenRange.Any,e.AuthorTokenKind.atkRParen),e.RuleOperation.create2(new e.RuleOperationContext(t.IsSameLineTokenContext),e.RuleAction.Delete)),this.SpaceAfterAnonymousFunctionKeyword=new e.Rule(e.RuleDescriptor.create1(e.AuthorTokenKind.atkFunction,e.AuthorTokenKind.atkLParen),e.RuleOperation.create2(new e.RuleOperationContext(t.IsFunctionDeclContext),e.RuleAction.Space)),this.NoSpaceAfterAnonymousFunctionKeyword=new e.Rule(e.RuleDescriptor.create1(e.AuthorTokenKind.atkFunction,e.AuthorTokenKind.atkLParen),e.RuleOperation.create2(new e.RuleOperationContext(t.IsFunctionDeclContext),e.RuleAction.Delete)) }return t.prototype.getRuleName=function(e){var t=this;for(var n in t)if(t[n]===e)return n;throw new Error("Unknown rule")},t.IsForContext=function(t){return t.contextNode.AuthorNode.Details.Kind==e.AuthorParseNodeKind.apnkFor},t.IsNotForContext=function(t){return t.contextNode.AuthorNode.Details.Kind!=e.AuthorParseNodeKind.apnkFor},t.IsBinaryOpContext=function(t){if(null!=t.contextNode.AuthorNode.Details.ast)switch(t.contextNode.AuthorNode.Details.ast.nodeType){case TypeScript.NodeType.ImportDeclaration:return!0}switch(t.contextNode.AuthorNode.Details.Kind){case e.AuthorParseNodeKind.apnkAdd:case e.AuthorParseNodeKind.apnkSub:case e.AuthorParseNodeKind.apnkMul:case e.AuthorParseNodeKind.apnkDiv:case e.AuthorParseNodeKind.apnkMod:case e.AuthorParseNodeKind.apnkOr:case e.AuthorParseNodeKind.apnkXor:case e.AuthorParseNodeKind.apnkAnd:case e.AuthorParseNodeKind.apnkEq:case e.AuthorParseNodeKind.apnkNe:case e.AuthorParseNodeKind.apnkLt:case e.AuthorParseNodeKind.apnkLe:case e.AuthorParseNodeKind.apnkGe:case e.AuthorParseNodeKind.apnkGt:case e.AuthorParseNodeKind.apnkAsg:case e.AuthorParseNodeKind.apnkInstOf:case e.AuthorParseNodeKind.apnkIn:case e.AuthorParseNodeKind.apnkForIn:case e.AuthorParseNodeKind.apnkEqv:case e.AuthorParseNodeKind.apnkNEqv:case e.AuthorParseNodeKind.apnkLogOr:case e.AuthorParseNodeKind.apnkLogAnd:case e.AuthorParseNodeKind.apnkLsh:case e.AuthorParseNodeKind.apnkRsh:case e.AuthorParseNodeKind.apnkRs2:case e.AuthorParseNodeKind.apnkQmark:case e.AuthorParseNodeKind.apnkAsgAdd:case e.AuthorParseNodeKind.apnkAsgSub:case e.AuthorParseNodeKind.apnkAsgMul:case e.AuthorParseNodeKind.apnkAsgDiv:case e.AuthorParseNodeKind.apnkAsgMod:case e.AuthorParseNodeKind.apnkAsgAnd:case e.AuthorParseNodeKind.apnkAsgXor:case e.AuthorParseNodeKind.apnkAsgOr:case e.AuthorParseNodeKind.apnkAsgLsh:case e.AuthorParseNodeKind.apnkAsgRsh:case e.AuthorParseNodeKind.apnkAsgRs2:return!0;case e.AuthorParseNodeKind.apnkVarDecl:var n=t.contextNode.AuthorNode.Details.ast,r=null;if(t.tokenSpan.tokenID===TypeScript.TokenID.Question?r=t.tokenSpan.Span.span:t.nextTokenSpan.tokenID===TypeScript.TokenID.Question&&(r=t.nextTokenSpan.Span.span),t.tokenSpan.tokenID===TypeScript.TokenID.Colon?r=t.tokenSpan.Span.span:t.nextTokenSpan.tokenID===TypeScript.TokenID.Colon&&(r=t.nextTokenSpan.Span.span),null!=r&&null!=n&&(n.nodeType===TypeScript.NodeType.VarDecl||n.nodeType===TypeScript.NodeType.ArgDecl)&&TypeScript.isValidAstNode(n)){if(!TypeScript.isValidAstNode(n.init))return!1;var i=e.Span.FromBounds(n.init.minChar,n.init.limChar);return i.Contains(r)}return!0;case e.AuthorParseNodeKind.apnkFncDecl:var o=t.contextNode.AuthorNode.Details.ast;if((t.tokenSpan.tokenID===TypeScript.TokenID.EqualsGreaterThan||t.nextTokenSpan.tokenID===TypeScript.TokenID.EqualsGreaterThan)&&null!=o&&TypeScript.hasFlag(o.fncFlags,TypeScript.FncFlags.IsFunctionExpression))return!0;break;default:return!1}},t.IsNotBinaryOpContext=function(e){return!t.IsBinaryOpContext(e)},t.IsBlockContext=function(n){if(t.IsTypeScriptDeclWithBlockContextNode(n))return!0;switch(n.AuthorNode.Details.Kind){case e.AuthorParseNodeKind.apnkBlock:case e.AuthorParseNodeKind.apnkList:case e.AuthorParseNodeKind.apnkObject:case e.AuthorParseNodeKind.apnkFncDecl:case e.AuthorParseNodeKind.apnkFor:case e.AuthorParseNodeKind.apnkIf:case e.AuthorParseNodeKind.apnkWhile:case e.AuthorParseNodeKind.apnkDoWhile:case e.AuthorParseNodeKind.apnkForIn:case e.AuthorParseNodeKind.apnkWith:case e.AuthorParseNodeKind.apnkSwitch:case e.AuthorParseNodeKind.apnkTryCatch:case e.AuthorParseNodeKind.apnkCatch:case e.AuthorParseNodeKind.apnkTry:case e.AuthorParseNodeKind.apnkFinally:case e.AuthorParseNodeKind.apnkTryFinally:return!0;default:return!1}},t.IsTypeScriptDeclWithBlockContextNode=function(e){switch(e.AuthorNode.Details.nodeType){case TypeScript.NodeType.ModuleDeclaration:case TypeScript.NodeType.InterfaceDeclaration:case TypeScript.NodeType.ClassDeclaration:return!0;default:return!1}},t.IsSingleLineBlockContext=function(e){return t.IsBlockContext(e.contextNode)?e.ContextNodeAllOnSameLine():!1},t.IsMultilineBlockContext=function(e){return t.IsBlockContext(e.contextNode)?!e.ContextNodeAllOnSameLine():!1},t.IsFunctionDeclContext=function(t){return t.contextNode.AuthorNode.Details.Kind==e.AuthorParseNodeKind.apnkFncDecl},t.IsTypeScriptDeclWithBlockContext=function(e){return t.IsTypeScriptDeclWithBlockContextNode(e.contextNode)},t.IsControlDeclContext=function(t){switch(t.contextNode.AuthorNode.Details.Kind){case e.AuthorParseNodeKind.apnkFor:case e.AuthorParseNodeKind.apnkIf:case e.AuthorParseNodeKind.apnkWhile:case e.AuthorParseNodeKind.apnkDoWhile:case e.AuthorParseNodeKind.apnkForIn:case e.AuthorParseNodeKind.apnkWith:case e.AuthorParseNodeKind.apnkSwitch:case e.AuthorParseNodeKind.apnkTryCatch:case e.AuthorParseNodeKind.apnkCatch:case e.AuthorParseNodeKind.apnkTry:case e.AuthorParseNodeKind.apnkFinally:case e.AuthorParseNodeKind.apnkTryFinally:return!0;default:return!1}},t.IsObjectContext=function(t){return t.contextNode.AuthorNode.Details.Kind==e.AuthorParseNodeKind.apnkObject},t.IsFunctionCallContext=function(t){return t.contextNode.AuthorNode.Details.Kind==e.AuthorParseNodeKind.apnkCall},t.IsNewContext=function(t){return t.contextNode.AuthorNode.Details.Kind==e.AuthorParseNodeKind.apnkNew},t.IsFunctionCallOrNewContext=function(e){return t.IsFunctionCallContext(e)||t.IsNewContext(e)},t.IsSameLineTokenContext=function(e){return e.TokensAreOnSameLine()},t.IsSameLineSiblingNodeContext=function(e){return e.TokensAreSiblingNodesOnSameLine()},t.IsMultilineChildParentContext=function(e){var n=e.contextNode.Parent;return null==n?!1:n.AuthorNode.Details.EndOffset==e.nextTokenSpan.Span.startPosition()&&t.IsMultilineBlockContext(e)},t.IsNotFormatOnEnter=function(t){return t.formattingRequestKind!=e.FormattingRequestKind.FormatOnEnter},t.IsSameLineTokenOrMultilineBlockContext=function(e){return e.TokensAreOnSameLine()||t.IsMultilineBlockContext(e)},t.IsFunctionOrGetSetDeclContext=function(e){return t.IsFunctionDeclContext(e)||t.IsGetSetMemberContext(e)},t.IsGetSetMemberContext=function(t){return t.contextNode.AuthorNode.Details.Kind==e.AuthorParseNodeKind.apnkGetMember||t.contextNode.AuthorNode.Details.Kind==e.AuthorParseNodeKind.apnkSetMember},t.IsFirstTokenLineCommentContext=function(t){var n=t.tokenSpan,r=n.Span.Intersection(new e.Span(n.Span.startPosition(),2));return null!=r&&"//"==r.GetText()},t.IsModuleDeclContext=function(e){return e.contextNode.AuthorNode.Details.nodeType==TypeScript.NodeType.ModuleDeclaration},t.IsInterfaceContext=function(e){return e.contextNode.AuthorNode.Details.nodeType==TypeScript.NodeType.List&&null!=e.contextNode.Parent&&e.contextNode.Parent.AuthorNode.Details.nodeType==TypeScript.NodeType.InterfaceDeclaration},t}();e.Rules=t}(Formatting||(Formatting={}));var Formatting;!function(e){var t=function(){function t(){this.map=[],this.mapRowLength=0}return t.create=function(e){var n=new t;return n.Initialize(e),n},t.prototype.Initialize=function(t){this.mapRowLength=e.AuthorTokenKind.Length,this.map=new Array(this.mapRowLength*this.mapRowLength);var n=new Array(this.map.length);return this.FillRules(t,n),this.map},t.prototype.FillRules=function(e,t){var n=this;e.foreach(function(e){n.FillRule(e,t)})},t.prototype.GetRuleBucketIndex=function(e,t){var n=e*this.mapRowLength+t;return n},t.prototype.FillRule=function(t,n){var r=this,i=t.Descriptor.LeftTokenRange!=e.Shared.TokenRange.Any&&t.Descriptor.RightTokenRange!=e.Shared.TokenRange.Any;t.Descriptor.LeftTokenRange.GetTokens().foreach(function(e){t.Descriptor.RightTokenRange.GetTokens().foreach(function(o){var a=r.GetRuleBucketIndex(e,o),l=r.map[a];void 0==l&&(l=r.map[a]=new s),l.AddRule(t,i,n,a)})})},t.prototype.GetRule=function(e){var t=this.GetRuleBucketIndex(e.tokenSpan.Token,e.nextTokenSpan.Token),n=this.map[t];if(null!=n)for(var r=0,i=n.Rules().count();i>r;r++){var o=n.Rules().get(r);if(o.Operation.Context.InContext(e))return o}return null},t}();e.RulesMap=t;var n=5,r=31;!function(e){e._map=[],e.IgnoreRulesSpecific=0,e.IgnoreRulesAny=1*n,e.ContextRulesSpecific=2*n,e.ContextRulesAny=3*n,e.NoContextRulesSpecific=4*n,e.NoContextRulesAny=5*n}(e.Position||(e.Position={}));var i=e.Position,o=function(){function t(){this.rulesInsertionIndexBitmap=0}return t.prototype.GetInsertionIndex=function(e){for(var t=0,i=0,o=this.rulesInsertionIndexBitmap;e>=i;)t+=o&r,o>>=n,i+=n;return t},t.prototype.IncreaseInsertionIndex=function(t){var n=this.rulesInsertionIndexBitmap>>t&r;n++,e.Debug.Assert((n&r)==n,"Adding more rules into the sub-bucket than allowed. Maximum allowed is 32 rules.");var i=this.rulesInsertionIndexBitmap&~(r<=0;--r){n=t.snapshot().GetLineFromLineNumber(r);var i=n.getText();if(i.length>0)return e.Indenter.GetIndentSizeFromIndentText(i,this.editorOptions)}return null},t}();e.SmartIndentManager=t}(Formatting||(Formatting={}));var Formatting;!function(e){var t=function(){function t(e,t,n,r,i,o){this.logger=e,this.snapshotSpan=t,this.tokens=n,this.fileAuthoringProxy=r,this.editorOptions=i,this.languageHostIndentation=o,this.snapshot=this.snapshotSpan.snapshot,this.DesiredIndentation=null}return t.prototype.Run=function(){var t=this,n=TypeScript.timeFunction(this.logger,"SmartIndentTask: new ParseTree()",function(){return new e.ParseTree(t.fileAuthoringProxy,t.snapshotSpan.span,null,!0)});null!=n.Root&&(e.IndentationEdgeFinder.FillIndentationLevels(n.Root),e.ParseTree.DumpTree(this.logger,n.Root),this.FindIndentation(n))},t.prototype.FindIndentation=function(t){var n=this.snapshotSpan.span,r=e.ParseTree.FindCommonParentNode(n,n,t.Root);if(r&&r.AuthorNode.Details.nodeType==TypeScript.NodeType.QString){var i=e.Span.FromBounds(r.AuthorNode.Details.StartOffset,r.AuthorNode.Details.EndOffset);if(i.Contains(n))return this.DesiredIndentation="",void 0}for(;null!=r&&r.AuthorNode.Details.StartOffset==n.start()&&(r.AuthorNode.Details.Kind!=e.AuthorParseNodeKind.apnkBlock||r.AuthorNode.Details.Flags==e.AuthorParseNodeFlags.apnfSyntheticNode);)r=r.Parent;if(null!=r){var o=e.FirstOrDefault(this.tokens,function(){return!0});if(null==o?o=new e.TokenSpan(e.AuthorTokenKind.atkSColon,TypeScript.TokenID.Semicolon,this.snapshotSpan):o.Token!=e.AuthorTokenKind.atkElse&&o.Token!=e.AuthorTokenKind.atkWhile&&o.Token!=e.AuthorTokenKind.atkLCurly&&o.Token!=e.AuthorTokenKind.atkRCurly&&(o=new e.TokenSpan(e.AuthorTokenKind.atkSColon,TypeScript.TokenID.Semicolon,this.snapshotSpan)),this.CanDoSmartIndent(r,{token:o})){var s=new e.Indenter(this.logger,t,this.snapshot,this.languageHostIndentation,this.editorOptions,o,!0),a=e.FirstOrDefault(s.GetIndentationEdits(o,null,r,!0),function(){return!0});null!=a&&(this.DesiredIndentation=a.ReplaceWith)}}},t.prototype.CanDoSmartIndent=function(t,n){for(var r=t;null!=r&&null==r.ChildrenIndentationDelta;)r=r.Parent;if(null==r)return!1;if(e.Rules.IsTypeScriptDeclWithBlockContextNode(r))return this.CanDoSmartIndentInStatementWithBlock(r,n);if(null!=r.AuthorNode.Details.ast)switch(r.AuthorNode.Details.ast.nodeType){case TypeScript.NodeType.ImportDeclaration:return this.CanDoSmartIndentInStatement(r)}switch(r.AuthorNode.Details.Kind){case e.AuthorParseNodeKind.apnkAsg:case e.AuthorParseNodeKind.apnkAsgAdd:case e.AuthorParseNodeKind.apnkAsgSub:case e.AuthorParseNodeKind.apnkAsgMul:case e.AuthorParseNodeKind.apnkAsgDiv:case e.AuthorParseNodeKind.apnkAsgMod:case e.AuthorParseNodeKind.apnkAsgAnd:case e.AuthorParseNodeKind.apnkAsgXor:case e.AuthorParseNodeKind.apnkAsgOr:case e.AuthorParseNodeKind.apnkAsgLsh:case e.AuthorParseNodeKind.apnkAsgRsh:case e.AuthorParseNodeKind.apnkAsgRs2:case e.AuthorParseNodeKind.apnkVarDecl:case e.AuthorParseNodeKind.apnkVarDeclList:case e.AuthorParseNodeKind.apnkCall:case e.AuthorParseNodeKind.apnkArray:case e.AuthorParseNodeKind.apnkMember:return this.CanDoSmartIndentInStatement(r);case e.AuthorParseNodeKind.apnkFor:return this.CanDoSmartIndentInFor(r);case e.AuthorParseNodeKind.apnkFncDecl:return this.CanDoSmartIndentInFunction(r,n);case e.AuthorParseNodeKind.apnkTry:case e.AuthorParseNodeKind.apnkFinally:return this.CanDoSmartIndentInStatementWithBlock(r,n);case e.AuthorParseNodeKind.apnkCatch:case e.AuthorParseNodeKind.apnkSwitch:return this.CanDoSmartIndentInStatementWithParenAndBlock(r,n);default:return!0}},t.prototype.CanDoSmartIndentInStatement=function(e){var n=this.snapshot.GetLineNumberFromPosition(e.AuthorNode.Details.StartOffset),r=this.snapshot.GetLineNumberFromPosition(this.snapshotSpan.startPosition());return t.IsEmptyRegion(this.snapshot,n+1,r-1)},t.prototype.CanDoSmartIndentInFunction=function(t,n){var r=this.fileAuthoringProxy.GetASTCursor();r.SeekToOffset(t.AuthorNode.Details.StartOffset,!1);var i=r.GetNodeProperty(e.AuthorParseNodeProperty.apnpRParenMin);if(0==i||this.snapshotSpan.startPosition()<=i)return this.CanDoSmartIndentInStatement(t);var o=r.GetNodeProperty(e.AuthorParseNodeProperty.apnpLCurlyMin);return(0==o||this.snapshotSpan.startPosition()<=o)&&(n={token:new e.TokenSpan(e.AuthorTokenKind.atkLCurly,TypeScript.TokenID.OpenBrace,this.snapshotSpan)}),!0},t.prototype.CanDoSmartIndentInStatementWithBlock=function(t,n){var r=this.fileAuthoringProxy.GetASTCursor();r.SeekToOffset(t.AuthorNode.Details.StartOffset,!1);var i=r.GetNodeProperty(e.AuthorParseNodeProperty.apnpLCurlyMin);return(0==i||this.snapshotSpan.startPosition()<=i)&&(n={token:new e.TokenSpan(e.AuthorTokenKind.atkLCurly,TypeScript.TokenID.OpenBrace,this.snapshotSpan)}),!0},t.prototype.CanDoSmartIndentInStatementWithParenAndBlock=function(t,n){var r=this.fileAuthoringProxy.GetASTCursor();r.SeekToOffset(t.AuthorNode.Details.StartOffset,!1);var i=r.GetNodeProperty(e.AuthorParseNodeProperty.apnpRParenMin),o=r.GetNodeProperty(e.AuthorParseNodeProperty.apnpLCurlyMin);return i>0&&this.snapshotSpan.startPosition()>i&&(0==o||this.snapshotSpan.startPosition()<=o)&&(n={token:new e.TokenSpan(e.AuthorTokenKind.atkLCurly,TypeScript.TokenID.OpenBrace,this.snapshotSpan)}),!0},t.prototype.CanDoSmartIndentInFor=function(t){var n=this.fileAuthoringProxy.GetASTCursor();n.SeekToOffset(t.AuthorNode.Details.StartOffset,!1);var r=n.GetNodeProperty(e.AuthorParseNodeProperty.apnpRParenMin);return 0==r||this.snapshotSpan.startPosition()<=r?this.CanDoSmartIndentInStatement(t):!0},t.IsEmptyRegion=function(e,n,r){for(var i=!0,o=n;r>=o;){var s=e.GetLineFromLineNumber(o),a=s.getText();if(!t.IsEmptyString(a)){i=!1;break}o++}return i},t.IsEmptyString=function(t){for(var n=0,r=t.length;r>n;n++)if(!e.EditorUtilities.IsWhitespace(t.charCodeAt(n)))return!1;return!0},t}();e.SmartIndentTask=t}(Formatting||(Formatting={}));var Formatting;!function(e){var t=function(){function t(e,t,n){this.logger=e,this.semicolonPoint=t,this.fileAuthoringProxy=n,this.BlockSpan=null}return t.prototype.Run=function(){for(var t=this.fileAuthoringProxy.GetASTCursor(),n=-1,r=t.SeekToOffset(this.semicolonPoint.position,!0);r&&r.Kind!==e.AuthorParseNodeKind.apnkEmpty&&r.nodeType!==TypeScript.NodeType.List;)r.EndOffset-1===this.semicolonPoint.position&&(n=r.StartOffset),r=t.MoveUp();-1!==n&&(this.BlockSpan=new e.Span(n,this.semicolonPoint.position-n+1))},t}();e.StatementFinderTask=t}(Formatting||(Formatting={}));var Formatting;!function(e){var t=function(){function e(e,t,n){this.position=e,this.length=t,this.replaceWith=n,this.Position=this.position,this.Length=t,this.ReplaceWith=this.replaceWith}return e}();e.TextEditInfo=t}(Formatting||(Formatting={}));var Formatting;!function(e){!function(t){var n=function(){function t(t,n,r){this.tokens=new e.List_AuthorTokenKind;for(var i=t;n>=i;i++)r.indexOf(i)<0&&this.tokens.add(i)}return t.prototype.GetTokens=function(){return this.tokens},t.prototype.Contains=function(e){return this.tokens.contains(e)},t.prototype.toString=function(){return"[tokenRangeStart="+e.AuthorTokenKind._map[this.tokens.get(0)]+","+"tokenRangeEnd="+e.AuthorTokenKind._map[this.tokens.get(this.tokens.count()-1)]+"]"},t}();t.TokenRangeAccess=n;var r=function(){function t(t){this.tokens=new e.List_AuthorTokenKind,this.tokens.addAll(t)}return t.prototype.GetTokens=function(){return this.tokens},t.prototype.Contains=function(e){return this.GetTokens().contains(e)},t}();t.TokenValuesAccess=r;var i=function(){function t(e){this.token=e}return t.prototype.GetTokens=function(){var t=new e.List_AuthorTokenKind;return t.add(this.token),t},t.prototype.Contains=function(e){return e==this.token},t.prototype.toString=function(){return"[singleTokenKind="+e.AuthorTokenKind._map[this.token]+"]"},t}();t.TokenSingleValueAccess=i;var o=function(){function t(){}return t.prototype.GetTokens=function(){for(var t=new e.List_AuthorTokenKind,n=e.AuthorTokenKind.atkEnd;ni;i++){for(p=g[i],y="",d=!1,o=0,u=p.length;u>o&&(h=p.charAt(o)," "===h||" "===h);o++)""===y?y=h:" "===y&&" "===h&&(d=!0);d&&(f={type:"text",ownerId:e.ID,severity:a.Severity.Warning,code:0,text:s.localize("vs_languages_typescript_participants_monacoStyleParticipant",0),range:{startLineNumber:i+1,startColumn:1,endLineNumber:i+1,endColumn:o+1}},n.addMarker(f))}r.scanner.setText(t.getValue(),c.LexMode.File);for(var v,T,b,k=r.scanner.scan(),S=!1;k.tokenId!==c.TokenID.EndOfFile;)r.assignmentTokens.hasOwnProperty(k.tokenId.toString())&&b.tokenId!==c.TokenID.Whitespace?(r.scanner.startPos===T&&(m={type:"text",ownerId:e.ID,severity:a.Severity.Warning,code:0,text:s.localize("vs_languages_typescript_participants_monacoStyleParticipant",1),offset:T,length:r.scanner.pos-T}),S=!0):(S&&r.scanner.startPos===T&&(m={type:"text",ownerId:e.ID,severity:a.Severity.Warning,code:0,text:s.localize("vs_languages_typescript_participants_monacoStyleParticipant",2),offset:T,length:r.scanner.pos-T}),S=!1),v=r.scanner.startPos,T=r.scanner.pos,b=k,k=r.scanner.scan()})},e}();t.WorkerParticipant=u});define("vs/languages/typescript/participants/monacoStyleParticipant.nls",[],{vs_languages_typescript_participants_monacoStyleParticipant:["Mixed tabs and spaces","Please leave a space before '='","Please leave a space after '='"]});define("vs/languages/typescript/participants/monacoStyleParticipant.nls.keys",[],{vs_languages_typescript_participants_monacoStyleParticipant:["mixedIndentation.message","assignment.message.before","assignment.message.after"]});/*--------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ define("vs/languages/typescript/participants/nlsParticipant",["require","exports","vs/nls!vs/languages/typescript/participants/nlsParticipant","vs/platform/markers/markers","vs/editor/worker/modesWorker","../lib/typescriptServices"],function(e,t,n,r,i,o){"use strict";var s,a=n,l=r,c=o,u=c.TypeScript;!function(e){e._map=[],e._map[0]="Start",e.Start=0,e._map[1]="NlsFound",e.NlsFound=1,e._map[2]="LocalizeFound",e.LocalizeFound=2,e._map[3]="InLocalizeArgs",e.InLocalizeArgs=3,e._map[4]="ModuleFound",e.ModuleFound=4,e._map[5]="InModule",e.InModule=5}(s||(s={}));var p=function(){function e(){this.scanner=new u.Scanner,this.state=s.Start,this.parenCounter=0}return e.ID="vs.languages.typescript.nlsParticipant",e.prototype.validate=function(e,t){var n=this,r=e.getValue();t.changeMarkers(e.getAssociatedResource(),function(e){n.reset(),n.scanner.setText(r,u.LexMode.File);for(var t=n.scanner.scan(),i=[];t.tokenId!==u.TokenID.EndOfFile;){switch(t.tokenId){case u.TokenID.Identifier:var o=t.getText();n.state===s.Start&&"nls"===o?n.state=s.NlsFound:n.state===s.NlsFound&&"localize"===o?n.state=s.LocalizeFound:n.state===s.InLocalizeArgs||n.reset();break;case u.TokenID.Dot:n.state===s.NlsFound||n.state===s.InLocalizeArgs||n.reset();break;case u.TokenID.OpenParen:n.state===s.LocalizeFound?(n.state=s.InLocalizeArgs,n.parenCounter++):n.state===s.InLocalizeArgs?n.parenCounter++:n.state===s.ModuleFound?(n.state=s.InModule,n.parenCounter++):n.reset();break;case u.TokenID.CloseParen:n.state===s.InLocalizeArgs||n.state===s.InModule?0===--n.parenCounter&&n.reset():n.reset();break;case u.TokenID.StringLiteral:var o=t.getText();'"'===o.charAt(0)&&n.state!==s.InLocalizeArgs&&n.state!==s.ModuleFound&&n.state!==s.InModule&&i.push({offset:n.scanner.startPos,length:n.scanner.pos-n.scanner.startPos});break;case u.TokenID.Module:n.state===s.Start?n.state=s.ModuleFound:n.reset();break;default:n.state!==s.InLocalizeArgs&&n.reset()}t=n.scanner.scan()}i.length>0&&i.forEach(function(t){var n=l.createTextMarker(l.Severity.Warning,0,a.localize("vs_languages_typescript_participants_nlsParticipant",0),t.offset,t.length);e.addMarker(n)})})},e.prototype.reset=function(){this.state=s.Start,this.parenCounter=0},e}();t.WorkerParticipant=p});define("vs/languages/typescript/participants/nlsParticipant.nls",[],{vs_languages_typescript_participants_nlsParticipant:["String needs localization"]});define("vs/languages/typescript/participants/nlsParticipant.nls.keys",[],{vs_languages_typescript_participants_nlsParticipant:["needsLocaliztion.message"]});/*--------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ define("vs/base/time/schedulers",["require","exports"],function(e,t){"use strict";var n=function(){function e(e,t){this.timeoutToken=-1,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}return e.prototype.dispose=function(){this.cancel(),this.runner=null},e.prototype.cancel=function(){-1!==this.timeoutToken&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)},e.prototype.setRunner=function(e){this.runner=e},e.prototype.setTimeout=function(e){this.timeout=e},e.prototype.schedule=function(){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,this.timeout)},e.prototype.onTimeout=function(){this.timeoutToken=-1,this.runner&&this.runner()},e}();t.RunOnceScheduler=n}),define("vs/languages/typescript/participants/symbolUsageParticipant",["require","exports","vs/nls!vs/languages/typescript/participants/symbolUsageParticipant","vs/base/time/schedulers","vs/platform/markers/markers","vs/editor/worker/modesWorker","vs/languages/typescript/lib/typescriptServices"],function(e,t,n,r,i,o,s){"use strict";var a=n,l=r,c=i,u=s,p=function(){function e(){this.scheduler=new l.RunOnceScheduler(function(){},e.DELAY)}return e.ID="vs.languages.typescript.symbolUsageParticipant",e.DELAY=1500,e.prototype.validate=function(t,n,r){var i=this;r instanceof u.Services.LanguageService&&(this.scheduler.cancel(),this.scheduler.schedule(),this.scheduler.setRunner(function(){n.changeMarkers(t.getAssociatedResource(),e.ID,function(e){var n,o=r,s=t.getAssociatedResource().toExternal();try{n=o.getScriptAST(s)}catch(a){return}var l=u.TypeScript.getAstWalkerFactory().getWalker(function(t){t instanceof u.TypeScript.ImportDeclaration&&i.visitImportDeclaration(t,s,o,e)});l.walk(n,null)})}))},e.prototype.visitImportDeclaration=function(e,t,n,r){if(e.isDynamicImport){var i=n.getOccurrencesAtPosition(t,e.id.minChar);if(!(i.length>1)){var o=c.createTextMarker(c.Severity.Warning,0,a.localize("vs_languages_typescript_participants_symbolUsageParticipant",0,e.id.actualText),e.minChar,e.limChar-e.minChar);r.addMarker(o)}}},e}();t.WorkerParticipant=p});define("vs/languages/typescript/participants/symbolUsageParticipant.nls",[],{vs_languages_typescript_participants_symbolUsageParticipant:["Unused import '{0}'"]});define("vs/languages/typescript/participants/symbolUsageParticipant.nls.keys",[],{vs_languages_typescript_participants_symbolUsageParticipant:["import.unused"]});/*--------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define("vs/languages/xml/xml",["require","exports","vs/editor/modes/modes","vs/editor/modes/modesExtensions"],function(e,t,n,r){"use strict";var i=n,o=r,s=i.Bracket,a=function(e){function t(t){e.call(this,t)}return __extends(t,e),t.prototype.equals=function(n){if(!(n instanceof t&&e.prototype.equals.call(this,n)))return!1;var r=n;return this.getMode()===r.getMode()&&Object.getPrototypeOf(this)===Object.getPrototypeOf(n)},t.prototype.nextName=function(e){return e.advanceIfRegExp(/^[_:\w][_:\w-.\d]*/)},t.prototype.nextAttrValue=function(e){return e.advanceIfRegExp(/^("|').*?\1/)},t}(o.AbstractState),l=function(e){function t(t){e.call(this,t)}return __extends(t,e),t.prototype.makeClone=function(){return new t(this.getMode())},t.prototype.tokenize=function(e){return e.advanceIfString("",!1).length>0?{type:"comment.xml.content"}:e.advanceIfString("-->").length>0?{type:"comment.xml",bracket:s.Close,nextState:new l(this.getMode())}:(e.next(),{type:"comment.xml.content"})},t}(a),u=function(e){function t(t){e.call(this,t)}return __extends(t,e),t.prototype.makeClone=function(){return new t(this.getMode())},t.prototype.tokenize=function(e){var t=this.nextName(e);return t.length>0?{type:"tag.xml.tag-"+t,bracket:s.Open,nextState:new p(this.getMode(),t)}:(e.next(),{type:""})},t}(a),p=function(e){function t(t,n){e.call(this,t),this.tagName=n}return __extends(t,e),t.prototype.makeClone=function(){return new t(this.getMode(),this.tagName)},t.prototype.equals=function(t){return e.prototype.equals.call(this,t)&&this.tagName===t.tagName},t.prototype.tokenize=function(e){var n=this;if(e.skipWhitespace().length>0)return{type:""};var r=this.nextName(e),i=null;return r.length>0?{type:"attribute.name.xml",bracket:s.None,nextState:new h(this.getMode(),function(e){return new t(e,n.tagName)})}:(i=e.advanceIfRegExp(/^\/?>/)).length>0?"/"===i.charAt(0)?(e.goBack(1),{type:"tag.xml.tag-"+this.tagName,bracket:s.Close,nextState:new f(this.getMode())}):{type:"delimiter.start.xml",bracket:s.Close,nextState:new l(this.getMode())}:(e.next(),{type:""})},t}(a),h=function(e){function t(t,n){e.call(this,t),this.tagStateCreator=n}return __extends(t,e),t.prototype.makeClone=function(){return new t(this.getMode(),this.tagStateCreator)},t.prototype.tokenize=function(e){return e.skipWhitespace().length>0||e.eos()?{type:""}:"="===e.peek()?(e.next(),{type:"",bracket:s.None,nextState:new d(this.getMode(),this.tagStateCreator)}):this.tagStateCreator(this.getMode()).tokenize(e)},t}(a),d=function(e){function t(t,n){e.call(this,t),this.tagStateCreator=n}return __extends(t,e),t.prototype.makeClone=function(){return new t(this.getMode(),this.tagStateCreator)},t.prototype.tokenize=function(e){if(e.skipWhitespace().length>0||e.eos())return{type:""};var t=this.nextAttrValue(e);return t.length>0?{type:"attribute.value.xml",bracket:s.None,nextState:this.tagStateCreator(this.getMode())}:this.tagStateCreator(this.getMode()).tokenize(e)},t}(a),f=function(e){function t(t){e.call(this,t)}return __extends(t,e),t.prototype.makeClone=function(){return new t(this.getMode())},t.prototype.tokenize=function(e){var t=e.next();if(">"!==t)throw new Error("Should never happen");return{type:"delimiter.start.xml",bracket:s.Close,nextState:new l(this.getMode())}},t}(a),m=function(e){function t(t){e.call(this,t)}return __extends(t,e),t.prototype.makeClone=function(){return new t(this.getMode())},t.prototype.tokenize=function(e){var t=this.nextName(e);return t.length>0?{type:"tag.xml.tag-"+t,bracket:s.Close}:e.advanceIfString(">").length>0?{type:"delimiter.end.xml",bracket:s.Close,nextState:new l(this.getMode())}:e.advanceUntil(">",!1).length>0?{type:""}:(e.next(),{type:""})},t}(a),g=function(e){function t(t){e.call(this,t)}return __extends(t,e),t.prototype.makeClone=function(){return new t(this.getMode())},t.prototype.tokenize=function(e){var t=this.nextName(e);return t.length>0?{type:"meta.xml."+t,bracket:s.None,nextState:new y(this.getMode())}:(e.next(),{type:"meta.xml"})},t}(a),y=function(e){function t(t){e.call(this,t)}return __extends(t,e),t.prototype.makeClone=function(){return new t(this.getMode())},t.prototype.tokenize=function(e){if(e.skipWhitespace().length>0)return{type:""};var n=this.nextName(e);return n.length>0?{type:"attribute.name.xml",bracket:s.None,nextState:new h(this.getMode(),function(e){return new t(e)})}:e.advanceIfString("?>").length>0?{type:"delimiter.start.xml",bracket:s.Close,nextState:new l(this.getMode())}:(e.next(),{type:""})},t}(a),v=function(e){function t(t){e.call(this,t)}return __extends(t,e),t.prototype.makeClone=function(){return new t(this.getMode())},t.prototype.tokenize=function(e){return e.advanceUntil("]]>",!1).length>0?{type:""}:e.advanceIfString("]]>").length>0?{type:"delimiter.start.xml",bracket:s.Close,nextState:new l(this.getMode())}:(e.next(),{type:""})},t}(a),T=function(e){function t(){e.call(this,"vs.languages.xml","vs/languages/xml/xmlWorker")}return __extends(t,e),t.prototype.getInitialState=function(){return new l(this)},t.prototype.getNonWordTokenTypes=function(){return["delimiter.xml"]},t.prototype.getCommentsConfiguration=function(){return{blockCommentStartToken:""}},t.prototype.getElectricCharacters=function(){return[">"]},t.prototype.getAutoClosingPairs=function(){return[{open:'"',close:'"'}]},t.prototype.getSurroundingPairs=function(){return[{open:"<",close:">"},{open:'"',close:'"'}]},t.prototype.splitLineIntoTokens=function(e,t,n,r){var i;i=r?function(e,t,n){return n>=e&&t>n}:function(e,t,n){return n>e&&t>=n};for(var o=null,s=[],a=0;a0&&(s.push(e.substring(t[a-1].startIndex,t[a].startIndex)),i(t[a-1].startIndex,t[a].startIndex,n)&&(o=a-1));return s.push(e.substring(t[a-1].startIndex)),o=null===o?s.length-1:o,{lineTokens:s,offsetTokenIndex:o}},t.prototype.onEnterImpl=function(e,t,n){if(""===e)return null;for(var r=this.splitLineIntoTokens(e,t,n,!1),o=r.offsetTokenIndex,s=r.lineTokens;o>0&&""===t[o].type;)o--;return 0>o||"delimiter.start.xml"!==t[o].type?null:">"===s[o]&&o>0&&"/"===s[o-1]||"?>"===s[o]?null:(o=r.offsetTokenIndex+1,o1&&"delimiter.end.xml"!==s.type){if("delimiter.start.xml"===s.type){var a;do a=s.startIndex,o--,s=n[o];while(o>=0&&0!==s.type.indexOf("tag.xml.tag-"));if(o>=0){var l=e.substring(s.startIndex,a);return"/"===l?null:{appendText:""}}return null}return null}do o--;while(o>=0&&""===n[o].type);return 0>o||!t.tagRegExp.test(n[o].type)?null:{matchBracketType:n[o].type}},t}(o.AbstractMode);t.XMLMode=T});define("vs/languages/xml/xml.nls",[],{});define("vs/languages/xml/xml.nls.keys",[],{});/*--------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n};define('vs/languages/xml/xmlWorker',["require","exports","vs/editor/worker/modesWorker"],function(e,t,n){"use strict";var r=n,i=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),t}(r.AbstractWorkerMode);t.value=new i});define('vs/languages/xml/xmlWorker.nls'],{});define('vs/languages/xml/xmlWorker.nls.keys'],{});var F12; (function (F12) { (function (Tools) { (function (Debugger) { (function (FormatService) { "use strict"; var FormatWorker = (function () { function FormatWorker(msg) { this._source = msg.source; this._mimeType = msg.mimeType; this._generatedSourceSpans = []; this._canBePrettyPrinted = false; this._error = false; this._firstCompilerError = ""; } Object.defineProperty(FormatWorker.prototype, "formattedText", { get: function () { return this._formattedText; }, enumerable: true, configurable: true }); Object.defineProperty(FormatWorker.prototype, "canBePrettyPrinted", { get: function () { return this._canBePrettyPrinted; }, enumerable: true, configurable: true }); Object.defineProperty(FormatWorker.prototype, "generatedSourceSpans", { get: function () { return this._generatedSourceSpans; }, enumerable: true, configurable: true }); Object.defineProperty(FormatWorker.prototype, "error", { get: function () { return this._error; }, enumerable: true, configurable: true }); Object.defineProperty(FormatWorker.prototype, "firstCompilerError", { get: function () { return this._firstCompilerError; }, enumerable: true, configurable: true }); FormatWorker.prototype.getNumLines = function (source) { var count = 0; for(var i = 0; i < source.length; i++) { if(source[i] === '\n') { ++count; } } return count; }; FormatWorker.prototype.parseSource = function (source, mimeType) { if(FormatService.HTMLScriptFinder.isSupportedScript(mimeType)) { this._generatedSourceSpans.push(new FormatService.SourceSpanBuilder(0, source.length, true)); this._canBePrettyPrinted = true; } else if(mimeType === "text/html") { try { var htmlScriptFinder = new FormatService.HTMLScriptFinder(source); if(htmlScriptFinder.sourceSpans.length > 1) { this._generatedSourceSpans = htmlScriptFinder.sourceSpans; this._canBePrettyPrinted = true; } } catch (ex) { } } }; FormatWorker.prototype.formatJavaScript = function (source) { if(source.length === 0) { return; } Tools.Utility.Assert.IsTrue(this._canBePrettyPrinted); Tools.Utility.Assert.IsTrue(this._generatedSourceSpans.length > 0); var generatedLineOffset = 0; var sourceSpanIndex = 0; this._generatedSourceSpans[0].generatedLineOffset = generatedLineOffset; this._formattedText = ""; var TypeScriptServices = require("vs/languages/typescript/lib/typescriptServices"); var TypeScript = TypeScriptServices.TypeScript; while(true) { var sourceSpan = this._generatedSourceSpans[sourceSpanIndex]; if(!sourceSpan.isScript) { sourceSpan.generatedLineOffset += generatedLineOffset; var htmlSource = source.slice(sourceSpan.start, sourceSpan.end + 1); generatedLineOffset += sourceSpan.calculateLineOffsets(htmlSource); this._formattedText += htmlSource; if(++sourceSpanIndex < this._generatedSourceSpans.length) { this._formattedText += "\n"; ++generatedLineOffset; } } if(sourceSpanIndex === this._generatedSourceSpans.length) { return; } sourceSpan = this._generatedSourceSpans[sourceSpanIndex]; Tools.Utility.Assert.IsTrue(sourceSpan.isScript); sourceSpan.generatedLineOffset += generatedLineOffset; var outfile = { source: "", Write: function (s) { this.source += s; }, WriteLine: function (s) { this.source += s + "\n"; }, Close: function () { } }; var outSourceMap = { source: "", Write: function (s) { this.source += s; }, WriteLine: function (s) { this.source += s + "\n"; }, Close: function () { } }; var outerr = { firstError: "", Write: function (s) { if(this.firstError === "") { this.firstError = s; } }, WriteLine: function (s) { if(this.firstError === "") { this.firstError = s; } }, Close: function () { } }; var settings = new TypeScript.CompilationSettings(); settings.emitComments = true; settings.mapSourceFiles = true; var compiler = new TypeScript.TypeScriptCompiler(outerr, new TypeScript.NullLogger(), settings); compiler.parser.errorRecovery = true; var validFormattedText = true; var compilerSource; var compilerSourceNumLines; try { compilerSource = source.slice(sourceSpan.start, sourceSpan.end + 1); compilerSourceNumLines = sourceSpan.calculateLineOffsets(compilerSource); compiler.addUnit(compilerSource, "input.js"); var emitterIOHost = { createFile: function (fileName, useUTF8) { if(fileName === "input.js.map") { return outSourceMap; } return outfile; } }; compiler.emit(emitterIOHost); } catch (e) { validFormattedText = false; }finally { if(validFormattedText) { sourceSpan._mappings = FormatService.SourcemapParser.calculateMappings(outSourceMap.source, TypeScript); if(!sourceSpan._mappings) { validFormattedText = false; } } if(validFormattedText) { var sourceMapPos = outfile.source.lastIndexOf("//@ sourceMappingURL=input.js.map"); if(outfile.source[sourceMapPos - 1] === '\n' && outfile.source[sourceMapPos - 2] === '\n') { --sourceMapPos; } var newPrettyPrintedSource = (sourceMapPos !== -1) ? outfile.source.slice(0, sourceMapPos) : outfile.source; generatedLineOffset += this.getNumLines(newPrettyPrintedSource); this._formattedText += newPrettyPrintedSource; } else { generatedLineOffset += compilerSourceNumLines; this._formattedText += compilerSource; this._error = true; this._firstCompilerError = outerr.firstError; if(this._firstCompilerError) { var pos = this._firstCompilerError.indexOf("("); if(pos > 0) { this._firstCompilerError = this._firstCompilerError.slice(pos); } } } } if(++sourceSpanIndex === this._generatedSourceSpans.length) { return; } } }; FormatWorker.prototype.processSource = function () { this.parseSource(this._source, this._mimeType); if(this._canBePrettyPrinted) { this.formatJavaScript(this._source); } }; return FormatWorker; })(); FormatService.FormatWorker = FormatWorker; onmessage = function (e) { var msg = e.data; var worker = new FormatWorker(msg); importScripts(msg.commonUrl + "assert.js", msg.loader + "loader.js", msg.typescriptServices + "typescriptServices.js", "sourceSpanBuilder.js", "sourcemapParser.js", "workerMessaging.js", "htmlScriptFinder.js"); require.config({ baseUrl: msg.editorBaseUrl }); worker.processSource(); var response = new FormatService.WorkerResponseMessage(); response.formattedText = worker.formattedText; response.canBePrettyPrinted = worker.canBePrettyPrinted; response.error = worker.error; response.errorMessage = worker.firstCompilerError; var generatedSourceSpans = worker.generatedSourceSpans; response.generatedSourceSpanData = []; for(var i = 0; i < generatedSourceSpans.length; i++) { response.generatedSourceSpanData.push(generatedSourceSpans[i].data); } this.postMessage(response); this.close(); }; })(Debugger.FormatService || (Debugger.FormatService = {})); var FormatService = Debugger.FormatService; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=FormatWorker.js.map var F12; (function (F12) { (function (Tools) { (function (Debugger) { (function (FormatService) { "use strict"; var HTMLScriptFinder = (function () { function HTMLScriptFinder(source) { Tools.Utility.Assert.HasValue(source, "Need to set a valid source"); this._source = source; this._sourceSpans = null; this._earlyEnd = false; } HTMLScriptFinder.isSupportedScript = function isSupportedScript(mimeType, scriptLanguage) { var mimeTypeLowerCase = mimeType.toLowerCase(); var scriptLanguageLowerCase = scriptLanguage ? scriptLanguage.toLocaleLowerCase() : ""; var isScriptSupported = ((!mimeTypeLowerCase && !scriptLanguageLowerCase) || (mimeTypeLowerCase === "text/javascript") || mimeTypeLowerCase === "text/jscript" || mimeTypeLowerCase === "application/javascript" || mimeTypeLowerCase === "application/x-javascript" || mimeTypeLowerCase === "text/ecmascript" || (scriptLanguageLowerCase === "javascript" || scriptLanguageLowerCase === "jscript" || scriptLanguageLowerCase === "ecmascript")); return isScriptSupported; }; Object.defineProperty(HTMLScriptFinder.prototype, "sourceSpans", { get: function () { if(this._sourceSpans === null) { this.findScriptTags(); } return this._sourceSpans; }, enumerable: true, configurable: true }); HTMLScriptFinder.prototype.findScriptTags = function () { this._index = 0; this._sourceSpans = []; this._htmlStart = 0; var source = this._source; do { if(source[this._index] === '<') { if(this._index + 1 >= source.length) { break; } if(source[this._index + 1] === '!') { if(this._index + 3 < this._source.length && this._source[this._index + 2] === '-' && this._source[this._index + 3] === '-') { this.ParseComment(); } else { this.ParseTag(); } } else if(source[this._index + 1] === '?') { this.ParseTag(); } else if(source[this._index + 1].match(/[a-zA-Z]/) || source[this._index + 1] === '_' || (source[this._index + 1] === '/' && this._index + 2 < source.length && (source[this._index + 2].match(/a-zA-Z/) || source[this._index + 2] === '_'))) { this.ParseTag(); } } }while(++this._index < source.length); if(!this._earlyEnd) { this._sourceSpans.push(new FormatService.SourceSpanBuilder(this._htmlStart, this._source.length - 1, false)); } }; HTMLScriptFinder.prototype.ParseComment = function () { Tools.Utility.Assert.AreEqual(this._source[this._index], '<'); Tools.Utility.Assert.AreEqual(this._source[this._index + 1], '!'); Tools.Utility.Assert.AreEqual(this._source[this._index + 2], '-'); Tools.Utility.Assert.AreEqual(this._source[this._index + 3], '-'); this._index += 3; while(++this._index < this._source.length) { if(this._source[this._index] === '-' && this._index + 2 < this._source.length && this._source[this._index + 1] === '-' && this._source[this._index + 2] === '>') { this._index += 2; return; } } }; HTMLScriptFinder.prototype.ParseTag = function () { Tools.Utility.Assert.AreEqual(this._source[this._index], '<'); var endTagEncountered = false; if(this._index + 1 < this._source.length && (this._source[this._index + 1] === '/' || this._source[this._index + 1] === '!' || this._source[this._index + 1] === '?')) { endTagEncountered = true; } var nextIsValue = false; var tagNameParsed = false; var obtainElementType = false; var obtainElementLanguage = false; var element; var mimeType = ""; var scriptLanguage = ""; var data; while(++this._index < this._source.length) { switch(this._source[this._index]) { case '>': if(this._source[this._index - 1] === '/' || this._source[this._index - 1] === '?') { endTagEncountered = true; } if(!endTagEncountered) { if(element && element.toLowerCase() === "script") { ++this._index; this.FindScriptEnd(mimeType, scriptLanguage); } } return; case '"': data = this.ParseQuotedValue('"'); nextIsValue = false; if(obtainElementType) { mimeType = data; obtainElementType = false; } if(obtainElementLanguage) { scriptLanguage = data; obtainElementLanguage = false; } break; case '\'': data = this.ParseQuotedValue("'"); nextIsValue = false; if(obtainElementType) { mimeType = data; obtainElementType = false; } if(obtainElementLanguage) { scriptLanguage = data; obtainElementLanguage = false; } break; case '=': nextIsValue = true; break; default: if(nextIsValue && !this._source[this._index].match(/\s/)) { data = this.ParsePropertyValue(); nextIsValue = false; if(obtainElementType) { mimeType = data; obtainElementType = false; } if(obtainElementLanguage) { scriptLanguage = data; obtainElementLanguage = false; } } else if(this._source[this._index].match(/[a-zA-Z]/) || this._source[this._index] === '_') { if(!tagNameParsed) { element = this.ParseElement(); tagNameParsed = true; } else { data = this.ParseAttribute(); if(data.toLowerCase() === "type") { obtainElementType = true; } else if(data.toLowerCase() === "language" && !obtainElementType) { obtainElementLanguage = true; } } } } } }; HTMLScriptFinder.prototype.FindScriptEnd = function (mimeType, scriptLanguage) { var scriptStart = this._index; var isScriptSupported = HTMLScriptFinder.isSupportedScript(mimeType, scriptLanguage); var endScriptStr = "': this._index--; return data; default: if(this._source[this._index].match(/\s/)) { this._index--; return data; } else { data += this._source[this._index]; } break; } }while(++this._index < this._source.length); Tools.Utility.Assert.Fail("Should not be here"); return data; }; HTMLScriptFinder.prototype.ParseElement = function () { Tools.Utility.Assert.IsTrue(this._source[this._index].match(/[a-zA-Z_]/), "Non alpha or underscore character"); var element = ""; element += this._source[this._index]; while(++this._index < this._source.length) { switch(this._source[this._index]) { case ':': element += this._source[this._index]; break; default: if(this._source[this._index].match(/[a-zA-Z0-9]/) || this._source[this._index] === '_' || this._source[this._index] === '.' || this._source[this._index] === '-') { element += this._source[this._index]; } else { this._index--; return element; } break; } } Tools.Utility.Assert.Fail("Should not be here"); return element; }; HTMLScriptFinder.prototype.ParseAttribute = function () { Tools.Utility.Assert.IsTrue(this._source[this._index].match(/[a-zA-Z_]/), "Non alpha or underscore character"); var data = ""; data += this._source[this._index]; while(++this._index < this._source.length) { switch(this._source[this._index]) { case '.': data += this._source[this._index]; break; case ':': data += this._source[this._index]; break; case '-': case '_': data += this._source[this._index]; break; default: if(this._source[this._index].match(/[a-zA-Z0-9]/)) { data += this._source[this._index]; } else { this._index--; return data; } break; } } Tools.Utility.Assert.Fail("Should not be here"); return data; }; return HTMLScriptFinder; })(); FormatService.HTMLScriptFinder = HTMLScriptFinder; })(Debugger.FormatService || (Debugger.FormatService = {})); var FormatService = Debugger.FormatService; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=htmlScriptFinder.js.map var F12; (function (F12) { (function (Tools) { (function (Debugger) { (function (FormatService) { "use strict"; var SourceMap = (function () { function SourceMap() { } return SourceMap; })(); FormatService.SourceMap = SourceMap; var SourcemapParser = (function () { function SourcemapParser() { } SourcemapParser.calculateMappings = function calculateMappings(sourcemapJSONString, TypeScript) { var mappings = []; try { var sourcemap = JSON.parse(sourcemapJSONString); } catch (e) { return null; } if(!sourcemap || sourcemap.version !== 3) { return null; } var lastMapping = new FormatService.SourcemapMapping(); var generatedLine = 0; var str = sourcemap.mappings; if(str.length === 0) { var mapping = new FormatService.SourcemapMapping(); mappings.push(mapping); } while(str.length > 0) { if(str.charAt(0) === ';') { generatedLine++; str = str.slice(1); lastMapping.generatedColumn = 0; } else if(str.charAt(0) === ',') { str = str.slice(1); } else { var mapping = new FormatService.SourcemapMapping(); mapping.generatedLine = generatedLine; var result = TypeScript.Base64VLQFormat.decode(str); mapping.generatedColumn = lastMapping.generatedColumn + result.value; lastMapping.generatedColumn = mapping.generatedColumn; str = result.rest; if(str.length > 0 && str.charAt(0) !== ';' && str.charAt(0) !== ',') { result = TypeScript.Base64VLQFormat.decode(str); str = result.rest; } if(str.length > 0 && str.charAt(0) !== ';' && str.charAt(0) !== ',') { result = TypeScript.Base64VLQFormat.decode(str); mapping.sourceLine = result.value + lastMapping.sourceLine; lastMapping.sourceLine = mapping.sourceLine; str = result.rest; } if(str.length > 0 && str.charAt(0) !== ';' && str.charAt(0) !== ',') { result = TypeScript.Base64VLQFormat.decode(str); mapping.sourceColumn = result.value + lastMapping.sourceColumn; lastMapping.sourceColumn = mapping.sourceColumn; str = result.rest; } if(str.length > 0 && str.charAt(0) !== ';' && str.charAt(0) !== ',') { result = TypeScript.Base64VLQFormat.decode(str); str = result.rest; } mappings.push(mapping); } } return mappings; }; return SourcemapParser; })(); FormatService.SourcemapParser = SourcemapParser; })(Debugger.FormatService || (Debugger.FormatService = {})); var FormatService = Debugger.FormatService; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=sourcemapParser.js.map var F12; (function (F12) { (function (Tools) { (function (Debugger) { (function (FormatService) { "use strict"; var SourceSpanBuilder = (function () { function SourceSpanBuilder(start, end, isScript) { Tools.Utility.Assert.IsTrue(start >= 0, "Invalid start offset: " + start.toString()); Tools.Utility.Assert.IsTrue(end >= start, "Invalid end offset: " + end.toString()); this._data = new FormatService.SourceSpanData(); this._data.start = start; this._data.end = end; this._isScript = isScript; this._data.lineOffsets = []; this._data.generatedLineOffset = 0; this._data.length = 0; this._data.mappings = []; } Object.defineProperty(SourceSpanBuilder.prototype, "_mappings", { get: function () { return this._data.mappings; }, set: function (mappings) { this._data.mappings = mappings; }, enumerable: true, configurable: true }); Object.defineProperty(SourceSpanBuilder.prototype, "data", { get: function () { return this._data; }, enumerable: true, configurable: true }); SourceSpanBuilder.prototype.calculateLineOffsets = function (source) { var lineCount = 0; this._data.lineOffsets = []; this._data.lineOffsets[lineCount] = 0; this._data.length = source.length; for(var offset = 0; offset < source.length; offset++) { if(source.charAt(offset) === '\n') { this._data.lineOffsets[++lineCount] = offset + 1; } } return lineCount; }; Object.defineProperty(SourceSpanBuilder.prototype, "start", { get: function () { return this._data.start; }, enumerable: true, configurable: true }); Object.defineProperty(SourceSpanBuilder.prototype, "end", { get: function () { return this._data.end; }, enumerable: true, configurable: true }); Object.defineProperty(SourceSpanBuilder.prototype, "isScript", { get: function () { return this._isScript; }, enumerable: true, configurable: true }); Object.defineProperty(SourceSpanBuilder.prototype, "generatedLineOffset", { get: function () { return this._data.generatedLineOffset; }, set: function (offset) { Tools.Utility.Assert.IsTrue(offset >= 0, "offset is negative"); this._data.generatedLineOffset = offset; }, enumerable: true, configurable: true }); Object.defineProperty(SourceSpanBuilder.prototype, "lineOffsets", { get: function () { return this._data.lineOffsets; }, enumerable: true, configurable: true }); return SourceSpanBuilder; })(); FormatService.SourceSpanBuilder = SourceSpanBuilder; })(Debugger.FormatService || (Debugger.FormatService = {})); var FormatService = Debugger.FormatService; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=sourceSpanBuilder.js.map var F12; (function (F12) { (function (Tools) { (function (Debugger) { (function (FormatService) { "use strict"; var SourcemapMapping = (function () { function SourcemapMapping() { this.generatedColumn = 0; this.generatedLine = 0; this.sourceColumn = 0; this.sourceLine = 0; } return SourcemapMapping; })(); FormatService.SourcemapMapping = SourcemapMapping; var SourceSpanData = (function () { function SourceSpanData() { } return SourceSpanData; })(); FormatService.SourceSpanData = SourceSpanData; var WorkerSendMessage = (function () { function WorkerSendMessage() { } return WorkerSendMessage; })(); FormatService.WorkerSendMessage = WorkerSendMessage; var WorkerResponseMessage = (function () { function WorkerResponseMessage() { } return WorkerResponseMessage; })(); FormatService.WorkerResponseMessage = WorkerResponseMessage; })(Debugger.FormatService || (Debugger.FormatService = {})); var FormatService = Debugger.FormatService; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=workerMessaging.js.map PNG  IHDR$l  pHYs+ OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FIDATx 0 uz-v(4o!KIENDB`PNG  IHDR6=tEXtSoftwareAdobe ImageReadyqe<"iTXtXML:com.adobe.xmp vIDATx]r#E^>A:^HWPR`'UA VB PDvŝR"[ޫ{f7]wg5QC-{lj_<;; 67770y(Qڄ"xk?DmZT!爰|z;xI *]z!a^w/&13Hxʭߝ[_/X!s2lG[ Mkyp1<Y#%y@ EB{"'I}yXƒ'#\¶"j*'b q ]9k}6Ju)z왃YjnZ1Rxl+ì  gcP e1<.l%i څ#Ͷ>̞=_+cDPC _6EBsLJ/0ɚkv̓Hv`T\ɦ(s$P=0UWu! R{,ڭⱎච`X)M$lc&u L$~5hdNQcՃ,sJ[cH[m9nՏjEאʈTc W{J|,d֬1DwkAS9Go р7f7M< !4hR5hZcӠ1cf`HiHJOm}8p EWLօWЈ\vb˄#Ag2k2mI=G~l4I^E~^A##p˃H4&w ڢ~І8=fDZ̶j[j)4ҠE {6 eAcHJ*k چH4|43l 3FSE2\(D$Pz,ypΜTej2b#$cM3SgzRVsD\=(XMb"9/7uXAfc{I! !&!a^ gq&8Y\D" EhLg/~5gq &൴x!ŭ ,n^dટō2`t,nW 7]By;OL_*V, Hi gcP e1 H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FCIDATx[1n0}4rwQ #Ĭ U]Ts{ 59GZMAP.-d lڠ>>oooSL0!>(rQ=Z]BB1dR"T-;B\bm'-6Zy9B)Q|3_-)S*~U"+MR )H9ʲB;q @NHz_>r PC{f*z1S oU!Rjp_#f_tqTH0A~uM-ֹ57K\{oR[_]n`z0nHj r_ݠY_9bl0oc\CBP'=4T ?Q{kCGcŽP!gj[I^*ԬDi ` 2R72=PǕmz22}eeL`&ӧ(S RQS5e/*F7QGLݩs1\0a= 7s8Z '521Άl/'w2,QGǶǸ2=ԗy2(Ӷekj'+0-1 (O|o-bq 1vaG3 F~ H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FpIDATx1n0E@jVsUA*Ebpo`c en 876m6DrbN>9GLu*}9 }?x^|C]]*Wp.t-tǔ`BЅB׫VDzg>Ē/;_R;s[uB \sU,@'qe HO6?Z`EɊn o+@,V8X[q$j/:p66ɲK9 PJ@ s^cCȲ5l2󦼲l.[ǔ sٚ}z ǷX}`ǝ/eϞ/}-_|qbʗdpW^fP5\P `D}gˆv-U[fvOOYKR30O۽C@,6!0 P2pl$]11OȀ72ͦ 0YBlN1ݧ (s7HDc90\TPBIENDB`PNG  IHDR6l!PAL pHYs+ OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FIDATx욱@G)" @⤜d媤:")W(2=2pפ#PQ x(~Ā vkf};?VEcćn56rCi+lݮ*njÛKƞp}P3S]Áev:Ҋۃ^PRʁSwBAgkp_ C0ƈh`{e+) Pƻ #?TeIDATxb?=80%"05@j9`$ʇ԰ ,1`ԛ.!գbQ G-p!n!ht[`3(PIENDB`PNG  IHDR tEXtSoftwareAdobe ImageReadyqe<kIDATxڔTq0@ .t+]A|C B~;A(g AZV#2{MZ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_F>IDATx얽q0 y#ullڅIRVA67:JChlE.t' IDATx Fex=w$NzRZ~l0[B$a( mط`L7sQhs5 H1A 8D* % ^-!sH핣zY_,`6"3w9; 1B@y1@-PmGo[u (ui!x f|+ U`)H# 0&,_m&RIENDB`PNG  IHDR tEXtSoftwareAdobe ImageReadyqe<fiTXtXML:com.adobe.xmp #/IDATxb?5.@L,A ȂWƮ[&",{ @ u Ȇ&PlC~~>;x~ Z^^ Y cccdC d l `H3ٳ 0.("%$0G!@FFFͰP}y"aȆ%B 8/mQ.(QbOYVIwps&BDIENDB`PNG  IHDR tEXtSoftwareAdobe ImageReadyqe<fiTXtXML:com.adobe.xmp {:IDATxڬAP{`۸6 7ca^&SJ Y0ìl1cĔR/P`lle=HV")X9~Oƴ,@zkĺ WD`7 !X v)rD:" \4YIENDB`PNG  IHDR@ ~gAMA|Q cHRMR@}y<s,٩<9SbL!GĈ 3,F0+7T3IlpX"61"H _qW,d ėrIKst.ښAdp&+g]RәY2EE44432PuoJEzg`̉j- -b8o׿M]9La.+-%Mȧg3YះuAxEK i<:ŹPcu*@~(  ]o0 ~y*s7g%9%(3H*@C`-pn VH@ A1 jPA3hA'8΃Kn`Lg` a!2D!H҇ dAP B Byf*z: @]h ~L CUp΅ p%;56< ?" GxG iE>&2 oQEGlQP UFFuzQ7QcYG4G۠t]nB/o'Я1 xb"1I>Lf3bX} *QYvGĩp( &q x)&gsF|7:~@&h!$&B%pH$D.q#xx8F|K!\H$!i.%L";r3EHK-AFCbH$^RSIrdd 3Rx)-))zR#RsiSiT#Wd2Z2n2l2d)EBaQ6S))T UEMSPgeedɆfȞ!4--VJ;N g%K-sɵݖ{'OwO%)P_RRۥEK/+))U<د8䡔TtAiF쨜\|FyZbU)W9.Kw+YUEUOUjꂚZZZCu:C=^\G}VCEO#OE&^WOs^K[+\kV֔vv[]n>z^^u}XROm`m3h01$:fь|:kG23hbabhrT4ߴw3=3Y-s.q_vǂbgբ⃥%߲rJ*֪jAe0JOY6rvvtXLǎl&I']$NϝM.6.\ι"En2nnn[g=,=t٪E2}4\j5loDŽǞ~q=''Z^utv&vvEv >mяN9-{ LOgsΝK?7s>xOL n\x }N}g/]>uɫ,u[dS@u]7ot.<30tKn]p;;SwSyoEV H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FIDATx1 Osܤ=A;]27M|̙r@K[Bj=EcYXG:23 8:̠<+ PZ=`-aL:JBf_f~`{XGΎ^8Pa&?~M֧{@i'I[qkPu4&;pVaO ?BIENDB`PNG  IHDR@ ~ pHYs  ~ OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_F%IDATx @aJl`/•\((l [%IA3(c% 3-?((~6ΈE#"/_C^u^@>%qgPyݕC8;T<'T<T<@VT< 9Xk c3٥ws^~)>@8W_0 9/zp| ~%`$ 07 lbZ(H-C24EV{11mP UPP *IENDB`PNG  IHDR$l gAMA|Q cHRMR@}y<s,٩<9SbL!GĈ 3,F0+7T3IlpX"61"H _qW,d ėrIKst.ښAdp&+g]RәY2EE44432PuoJEzg`̉j- -b8o׿M]9La.+-%Mȧg3YះuAxEK i<:ŹPcu*@~(  ]o0 ~y*s7g%9%(3H*@C`-pn VH@ A1 jPA3hA'8΃Kn`Lg` a!2D!H҇ dAP B Byf*z: @]h ~L CUp΅ p%;56< ?" GxG iE>&2 oQEGlQP UFFuzQ7QcYG4G۠t]nB/o'Я1 xb"1I>Lf3bX} *QYvGĩp( &q x)&gsF|7:~@&h!$&B%pH$D.q#xx8F|K!\H$!i.%L";r3EHK-AFCbH$^RSIrdd 3Rx)-))zR#RsiSiT#Wd2Z2n2l2d)EBaQ6S))T UEMSPgeedɆfȞ!4--VJ;N g%K-sɵݖ{'OwO%)P_RRۥEK/+))U<د8䡔TtAiF쨜\|FyZbU)W9.Kw+YUEUOUjꂚZZZCu:C=^\G}VCEO#OE&^WOs^K[+\kV֔vv[]n>z^^u}XROm`m3h01$:fь|:kG23hbabhrT4ߴw3=3Y-s.q_vǂbgբ⃥%߲rJ*֪jAe0JOY6rvvtXLǎl&I']$NϝM.6.\ι"En2nnn[g=,=t٪E2}4\j5loDŽǞ~q=''Z^utv&vvEv >mяN9-{ LOgsΝK?7s>xOL n\x }N}g/]>uɫ,u[dS@u]7ot.<30tKn]p;;SwSyoEVJ&=1^D`o[jC*z#{9ÿ@G&',H6q.gZo}G킥xF@`& u!, Ô8\6TjgGyi=IENDB`PNG  IHDR$l  pHYs+ OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FJIDATxZ;nJ=4Vrt,.7Ti"R!AQJQ2\DKpkU5wx""o\G 8ss;>R"\&.qH)C:t.$0J?iqH8P D LnNөVj%M@4n_fH)i`@3CTfy-0iK\$ ;iZ&$1Q'2 9(οPrSg :MuF>2@U7]5l p#-'!:75l|I8 i0k hFJV֭iF3v%uDH8Qe6]P(GyH]jdXѧ}HFUK9-[Ln>@az}*jF:*]2a L8X8]IhX60-LlD4zYQ9KR|25{F wf֓SH}li8ے>:KWPwvtq*)=A թ<0!k;^fEI]^,i)PNzqKD3PT71'WE5Et:tz/ԇV _t桦Bv񧒷V&q7`hWwhjnur74"*5#4FKM-b2RNK|$MF|Y\VqGQ5$?_q"1^q-'Vқ{a{xu_8nZ5FJ쁩1>·Ś/4n*{gpS@M m?Hb[DKo. љM6cTɧtin<=\1V[(h1^VPԥ/ iݿ%#kZB MIZJ,*a6!!Xu1Lgj+/.d*ykbZC!:/ 06F1cx9φDM1p꣆(cfIc|ϻScDcFHcxBX5FX( ʡccƘeYh,oڈhjg˲,GjBhBCm1qiugMǵ6,F48Jz82.^δBY>M^3}Cc$2?f-2紷mqw1Rx u갅}c&GSDc4MSc Ci` w3ty]3!/3i2gYFasjqOUkFejU! hU(K_@Ӟnj.dMڼcO7jB?O,+xIENDB`PNG  IHDRr ߔ pHYs+ OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FIDATx 0x##&܍'0ޛ0n#xAF``b?GҴ!\/<-%6I9`3P[ e pPN,}O08؉6@Uyrl45o.?&Cf\A`j1> TQIENDB`PNG  IHDRr ߔ pHYs+ OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FIDATxڼq0FAH+/{ T|C B:܁rY1 F1hOs) IDdl5 TWժ_s.(" 0YZ֣"lW۬fBk-X/p(l{,T5P# Z"\\LƝ=.Eq]IOvC_U ~@刴۷{9Gy|;T-K Y؜4 Ǝ>ׁO!u[<e<ld]-?j-ᨀOɛ u+:(wFTeZXYxi?ZW}g-agi1H>,8٭aM~܆[TPIENDB`PNG  IHDR$l  pHYs+ OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_F(IDATx1v0rH8r9rIZ ӊ"~#Pdo@elT~^IIϼ߫kwXYoNO uJCD@D@D@f:ơ9v} q_De9lbηL}wLMOmc79t>*|̄8L@f1;Lz\]t'@ |qʲLP1z+sQ-rOt ~ H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FIDATx?r0şw8a($iRm b3 h&8F6mLV cYz4E%I`eutB]%kZ[i8xUZ#dgcJf)VfV.X(<âqXvI$]~|ҟr& 6osqcUu1NJ5Դ{ž޸؟rqz7a:]'0K@Y0\api/+>\[jeuֺX9FBHb}!c~'KfJ[Cj$TeZB?7hٴLGmPpF(&BcDclS/mhϐi- 0K& !x1: :: Q\[ B ."}>fKv##clnJ3l6)c+NQ!t!2#cLh4vq cK&E9m>א21߫%n !g5rٿ yIENDB`PNG  IHDR$l  pHYs+ OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_F\IDATx1n@V>@n`.0-˵OMC)kr #lB 03yR$Ǜ{,K ɾa`6>ċvY|کz'F޳Le8~`*/ֻ,+H=4 ?5,yd@8^Y(aǸbmIFu W82q YPK]i:Jؿ*IENDB`var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var Source = (function () { function Source(id, docId, parentDocId, isRootChild, url, mimeType, length, isDynamicCode, headers) { this.id = id; this.docId = docId; this.parentDocId = parentDocId; this.isRootChild = isRootChild; this.url = url; this.mimeType = mimeType; this.length = length; this.isDynamicCode = isDynamicCode; this.headers = headers; } return Source; })(); Debugger.Source = Source; (function (CauseBreakAction) { CauseBreakAction._map = []; CauseBreakAction._map[0] = "BreakOnAny"; CauseBreakAction.BreakOnAny = 0; CauseBreakAction._map[1] = "BreakOnAnyNewWorkerStarting"; CauseBreakAction.BreakOnAnyNewWorkerStarting = 1; CauseBreakAction._map[2] = "BreakIntoSpecificWorker"; CauseBreakAction.BreakIntoSpecificWorker = 2; CauseBreakAction._map[3] = "UnsetBreakOnAnyNewWorkerStarting"; CauseBreakAction.UnsetBreakOnAnyNewWorkerStarting = 3; })(Debugger.CauseBreakAction || (Debugger.CauseBreakAction = {})); var CauseBreakAction = Debugger.CauseBreakAction; (function (BreakResumeAction) { BreakResumeAction._map = []; BreakResumeAction._map[0] = "Abort"; BreakResumeAction.Abort = 0; BreakResumeAction._map[1] = "Continue"; BreakResumeAction.Continue = 1; BreakResumeAction._map[2] = "StepInto"; BreakResumeAction.StepInto = 2; BreakResumeAction._map[3] = "StepOver"; BreakResumeAction.StepOver = 3; BreakResumeAction._map[4] = "StepOut"; BreakResumeAction.StepOut = 4; BreakResumeAction._map[5] = "Ignore"; BreakResumeAction.Ignore = 5; })(Debugger.BreakResumeAction || (Debugger.BreakResumeAction = {})); var BreakResumeAction = Debugger.BreakResumeAction; (function (BreakpointState) { BreakpointState._map = []; BreakpointState._map[0] = "Deleted"; BreakpointState.Deleted = 0; BreakpointState._map[1] = "Disabled"; BreakpointState.Disabled = 1; BreakpointState._map[2] = "Enabled"; BreakpointState.Enabled = 2; BreakpointState._map[3] = "Pending"; BreakpointState.Pending = 3; })(Debugger.BreakpointState || (Debugger.BreakpointState = {})); var BreakpointState = Debugger.BreakpointState; (function (ExceptionFilter) { ExceptionFilter._map = []; ExceptionFilter._map[0] = "None"; ExceptionFilter.None = 0; ExceptionFilter._map[1] = "Unhandled"; ExceptionFilter.Unhandled = 1; ExceptionFilter._map[2] = "Handled"; ExceptionFilter.Handled = 2; })(Debugger.ExceptionFilter || (Debugger.ExceptionFilter = {})); var ExceptionFilter = Debugger.ExceptionFilter; (function (BreakReason) { BreakReason._map = []; BreakReason._map[0] = "Step"; BreakReason.Step = 0; BreakReason._map[1] = "Breakpoint"; BreakReason.Breakpoint = 1; BreakReason._map[2] = "DebuggerBlock"; BreakReason.DebuggerBlock = 2; BreakReason._map[3] = "HostInitiated"; BreakReason.HostInitiated = 3; BreakReason._map[4] = "LanguageInitiated"; BreakReason.LanguageInitiated = 4; BreakReason._map[5] = "DebuggerHalt"; BreakReason.DebuggerHalt = 5; BreakReason._map[6] = "Error"; BreakReason.Error = 6; BreakReason._map[7] = "JIT"; BreakReason.JIT = 7; })(Debugger.BreakReason || (Debugger.BreakReason = {})); var BreakReason = Debugger.BreakReason; (function (ConnectionResult) { ConnectionResult._map = []; ConnectionResult.Succeeded = 0; ConnectionResult.Failed = 1; ConnectionResult.FailedAlreadyAttached = 2; })(Debugger.ConnectionResult || (Debugger.ConnectionResult = {})); var ConnectionResult = Debugger.ConnectionResult; Debugger.BreakpointIdNotFound = "BKP:notfound:"; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=commonStructs.js.map var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var RemoteDebugger = (function () { function RemoteDebugger() { var _this = this; this._port = toolUI.createPort("debuggerPort"); toolUI.connect(this._port); this._rpc = new F12.Tools.RPC.JsonRPCEndpoint("SERVER", function (method, params, response) { return _this.jsonRpcMethodReceive(method, params, response); }, function (method, params) { return _this.jsonRpcNotificationReceive(method, params); }, function (data) { _this.postMessage(data); }, function (onMessage) { _this._port.addEventListener("message", function (data) { if(_this.logging) { DebuggerEval.log("message", data); } onMessage(data); }); }); this._dbg = new Debugger.DebugProvider(this); } RemoteDebugger.prototype.postMessage = function (data) { if(this.logging) { DebuggerEval.log("postMessage", data); } this._port.postMessage(data); }; RemoteDebugger.prototype.jsonRpcMethodReceive = function (method, params, response) { F12.Tools.Utility.Assert.HasValue(this._dbg, "Method received when debugger not attached."); var isAsync = false; if(this._dbg.isAsyncMethod(method)) { params = params || []; params.push(response); isAsync = true; } var result; if(params) { result = this._dbg[method].apply(this._dbg, params); } else { result = this._dbg[method].apply(this._dbg); } if(!isAsync) { response(result, undefined); } }; RemoteDebugger.prototype.jsonRpcNotificationReceive = function (event, params) { }; RemoteDebugger.prototype.methodCall = function (method, params, completed, error) { this._rpc.jsonRpcMethodCall(method, params, completed, error); }; RemoteDebugger.prototype.notify = function (method, params) { this._rpc.jsonRpcNotification(method, params); }; RemoteDebugger.prototype.detach = function () { this._rpc.jsonRpcMethodCall = function () { }; this._rpc.jsonRpcNotification = function () { }; this.postMessage = function () { }; }; return RemoteDebugger; })(); Debugger.RemoteDebugger = RemoteDebugger; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); var DebuggerEval; (function (DebuggerEval) { "use strict"; DebuggerEval.queue = []; function log() { var params = []; for (var _i = 0; _i < (arguments.length - 0); _i++) { params[_i] = arguments[_i + 0]; } var logString = [].join.call(params, "\t"); try { mainBrowser.document.parentWindow.console.log(logString); if(DebuggerEval.queue.length > 0) { var msg; while(msg = DebuggerEval.queue.shift()) { mainBrowser.document.parentWindow.console.log(msg); } } } catch (ex) { DebuggerEval.queue.push(logString); } } DebuggerEval.log = log; })(DebuggerEval || (DebuggerEval = {})); var Debugger = new F12.Tools.Debugger.RemoteDebugger(); //@ sourceMappingURL=remote.js.map var F12; (function (F12) { (function (Tools) { (function (Debugger) { "use strict"; var DebugProvider = (function () { function DebugProvider(callHandler) { var _this = this; this._callHandler = callHandler; this._isEnabled = DebugProvider.isLaunchedViaJitDebugging; this._isBreakOnNextError = DebugProvider.isLaunchedViaJitDebugging; this._documentMap = { }; this._breakpointsAtIdMap = { }; this._breakpointsAtUrlMap = { }; this._breakIntoSpecificWorkerIds = []; this._rootDocIdQueue = []; this._unresolvedBreakpointId = 0; this._sessionNumber = 0; this._initialDocumentDocId = 0; this._exceptionFilter = Debugger.ExceptionFilter.Unhandled; this._debugger = debug; this._debugger.addEventListener("onAddDocuments", function (documents) { return _this.onAddDocuments(documents); }); this._debugger.addEventListener("onRemoveDocuments", function (docIds) { return _this.onRemoveDocuments(docIds); }); this._debugger.addEventListener("onUpdateDocuments", function (documents) { return _this.onUpdateDocuments(documents); }); this._debugger.addEventListener("onBreak", function (breakReason, description, errorId, firstChance) { return _this.onBreak(breakReason, description, errorId, firstChance); }); this._debugger.addEventListener("onPdmClose", function () { _this._sessionNumber++; _this._isEnabled = false; _this.unbindAllBreakpoints(); _this.enableDynamicDebugging(function () { }); }); toolUI.addEventListener("detach", function (dispatchWindow) { _this._callHandler.detach(); var bpId; for(bpId in _this._breakpointsAtIdMap) { _this.removeBreakpoint(bpId); } _this._isEnabled = false; _this._sessionNumber++; _this._debugger.resume(Debugger.BreakResumeAction.Continue); }); toolUI.addEventListener("closed", function () { _this._debugger.shutdown(); }); toolUI.addEventListener("webworkerstarted", function (label, id) { var description = _this.parseThreadDescription(id, label, null); if(_this._breakOnAnyNewWorkerStarting) { _this._lastStartedWorkerId = id; } _this._callHandler.notify("onWebWorkerStarted", [ description ]); }); toolUI.addEventListener("webworkerfinished", function (id) { _this.removeWorkerFromWaitToBreakList(id); _this._callHandler.notify("onWebWorkerFinished", [ id ]); }); toolUI.addEventListener("debuggingdisabled", function () { _this._isEnabled = false; _this.unbindAllBreakpoints(); }); toolUI.addEventListener("debugapplicationcreate", function (isProfiling) { if(!isProfiling) { _this.enableDynamicDebugging(function () { }); } }); toolUI.addEventListener("remotescripterror", function (description, fileName, lineNumber, column) { _this._callHandler.notify("onRemoteScriptError", [ description, fileName, lineNumber, column ]); }); if(DebugProvider.isLaunchedViaJitDebugging) { this._debugger.connect(); } } DebugProvider.BREAKPOINT_ID_PREFIX = "BKP"; DebugProvider.DOC_ID_PREFIX = "DOC"; DebugProvider.FRAME_ID_PREFIX = "FRM"; DebugProvider.PROPERTY_ID_PREFIX = "PRP"; DebugProvider.isLaunchedViaJitDebugging = false; DebugProvider.prototype.removeWorkerFromWaitToBreakList = function (id) { for(var i = 0; i < this._breakIntoSpecificWorkerIds.length; i++) { if(id === this._breakIntoSpecificWorkerIds[i]) { this._breakIntoSpecificWorkerIds.splice(i, 1); return true; } } return false; }; DebugProvider.prototype.flushMessageQueue = function (queue, eventName) { if(queue.length > 0) { switch(eventName) { case "onAddDocuments": case "onRemoveDocuments": case "onUpdateDocuments": this._callHandler.notify(eventName, queue); queue.length = 0; break; default: F12.Tools.Utility.Assert.Fail("Batching of '" + eventName + "' messages isn't supported."); break; } } }; DebugProvider.prototype.onAddDocuments = function (documents) { var _this = this; var sources = []; for(var i = 0; i < documents.length; ++i) { var document = documents[i]; if(document.parentDocId === 0xFFFFFFFF) { this._initialDocumentDocId = document.docId; continue; } this._documentMap[document.docId] = { url: document.url, start: 0, length: document.length }; var isRootChild = document.parentDocId === this._initialDocumentDocId; sources.push(new Debugger.Source(document.docId, this.docString(document.docId), this.docString(document.parentDocId), isRootChild, document.url, document.mimeType, document.length, document.isDynamicCode, document.headers)); if(isRootChild) { var count = 0; for(var x in this._documentMap) { count++; if(count > 1) { break; } } if(count === 1) { this.flushMessageQueue(sources, "onAddDocuments"); this._rootDocId = document.docId; this._callHandler.notify("onSetRootDocument", [ this.docString(this._rootDocId) ]); } else { this._rootDocIdQueue.push(document.docId); } } this.rebindBreakpoints(document.docId, 0, document.length, function () { return _this.flushMessageQueue(sources, "onAddDocuments"); }); } this.flushMessageQueue(sources, "onAddDocuments"); }; DebugProvider.prototype.onRemoveDocuments = function (docIds) { var removedDocIds = []; for(var i = 0; i < docIds.length; ++i) { var docId = docIds[i]; this.unbindBreakpoints(docId); delete this._documentMap[docId]; var oldRootDocIdIndex = this._rootDocIdQueue.indexOf(docId); if(oldRootDocIdIndex > -1) { this._rootDocIdQueue.splice(oldRootDocIdIndex, 1); } if(docId !== this._initialDocumentDocId) { removedDocIds.push(this.docString(docId)); } if(docId === this._rootDocId && this._rootDocIdQueue.length > 0 && this._documentMap[this._rootDocIdQueue[0]]) { this._rootDocId = this._rootDocIdQueue[0]; this.flushMessageQueue(removedDocIds, "onRemoveDocuments"); this._callHandler.notify("onSetRootDocument", [ this.docString(this._rootDocId) ]); } } this.flushMessageQueue(removedDocIds, "onRemoveDocuments"); }; DebugProvider.prototype.onUpdateDocuments = function (documents) { var _this = this; var sources = []; for(var i = 0; i < documents.length; ++i) { var document = documents[i]; var isRootChild = document.parentDocId === this._initialDocumentDocId; var source = new Debugger.Source(document.docId, this.docString(document.docId), undefined, isRootChild, document.url, document.mimeType, document.length, undefined, undefined); if(!this._lastUpdatedSource || source.docId !== this._lastUpdatedSource.docId || source.length !== this._lastUpdatedSource.length || source.mimeType !== this._lastUpdatedSource.mimeType || source.url !== this._lastUpdatedSource.url) { sources.push(source); this._lastUpdatedSource = source; var oldUrl = this._documentMap[document.docId] ? this._documentMap[document.docId].url : null; if(oldUrl !== document.url) { this.updateBreakpointUrlMap(oldUrl, document.url); } } this.rebindBreakpoints(document.docId, 0, document.length, function () { return _this.flushMessageQueue(sources, "onUpdateDocuments"); }); } this.flushMessageQueue(sources, "onUpdateDocuments"); }; DebugProvider.prototype.onBreak = function (breakReason, description, errorId, firstChance) { if(!this._isEnabled || this._isAwaitingDebuggerEnableCall) { this._debugger.resume(Debugger.BreakResumeAction.Continue); return false; } var isRealBreak = true; var threadDescription = this.getCurrentThreadDescription(); if(breakReason === Debugger.BreakReason.DebuggerHalt) { isRealBreak = false; if(this._breakOnAnyNewWorkerStarting) { if(threadDescription.id === this._lastStartedWorkerId) { this._lastStartedWorkerId = null; isRealBreak = true; } } if(!isRealBreak) { if(this.removeWorkerFromWaitToBreakList(threadDescription.id)) { isRealBreak = true; } } if(!isRealBreak && (this._isNextBreakCausedByUser || this.isHaltOnBreakpoint())) { isRealBreak = true; } } else if(breakReason === Debugger.BreakReason.Error) { isRealBreak = false; if(this._isBreakOnNextError || this._exceptionFilter === Debugger.ExceptionFilter.Handled || (this._exceptionFilter === Debugger.ExceptionFilter.Unhandled && !firstChance)) { this._isBreakOnNextError = false; isRealBreak = true; } if(!firstChance && !threadDescription.isWorker) { var frames = this.getFrames(1); if(frames && frames.length > 0) { var frame = frames[0]; this._callHandler.notify("onUnhandledException", [ frame.location.docId, description, errorId, frame.location.start ]); } } } else if(breakReason === Debugger.BreakReason.Breakpoint) { isRealBreak = false; if(this.isHaltOnBreakpoint() || this._breakOnAny) { isRealBreak = true; } } else if(breakReason === Debugger.BreakReason.Step) { this.isHaltOnBreakpoint(); } if(isRealBreak) { this._breakOnAny = false; this._callHandler.notify("onBreak", [ breakReason, description, errorId, firstChance, threadDescription.isWorker ]); } else { this._debugger.resume(Debugger.BreakResumeAction.Continue); if(breakReason !== Debugger.BreakReason.Breakpoint && this._breakIntoSpecificWorkerIds.length > 0) { this._debugger.causeBreak(); } } this._isNextBreakCausedByUser = false; return isRealBreak; }; DebugProvider.prototype.isHaltOnBreakpoint = function () { var frames = this.getFrames(1); if(!frames || frames.length === 0) { return false; } var frame = frames[0]; var docId = this.getDocIdNumber(frame.location.docId); if(!this._documentMap[docId]) { return false; } var url = this.getUrlForDocumentId(docId); if(url) { var breakpoints = this._breakpointsAtUrlMap[url]; if(breakpoints) { for(var i = 0; i < breakpoints.length; i++) { var bp = breakpoints[i]; if(bp.isBound && bp.isEnabled && bp.start === frame.location.start) { var frameIdNumber = this.getFrameIdNumber(frame.callFrameId); if(bp.isTracepoint) { var propertyInfo = this._debugger.eval(frameIdNumber, "console.log(" + bp.condition + ");"); if(propertyInfo.type === "Error") { this._debugger.eval(frameIdNumber, "console.log(\"" + propertyInfo.value + "\");"); } return false; } else if(!bp.condition || this._debugger.eval(frameIdNumber, bp.condition).value === "true") { return true; } } } } } return false; }; DebugProvider.prototype.updateBreakpointUrlMap = function (oldUrl, newUrl) { if(oldUrl && newUrl && this._breakpointsAtUrlMap[oldUrl]) { if(!this._breakpointsAtUrlMap[newUrl]) { this._breakpointsAtUrlMap[newUrl] = []; } var existingBreakpointCount = this._breakpointsAtUrlMap[oldUrl].length; for(var i = existingBreakpointCount - 1; i >= 0; i--) { this._breakpointsAtUrlMap[newUrl].push(this._breakpointsAtUrlMap[oldUrl][i]); this._breakpointsAtUrlMap[oldUrl].splice(i, 1); } } }; DebugProvider.prototype.rebindBreakpoints = function (docId, start, length, flushMessageQueue) { var docLength = start + (length || 0); this._documentMap[docId].length = length; var url = this.getUrlForDocumentId(docId); if(url && this._breakpointsAtUrlMap[url]) { var existingBreakpointCount = this._breakpointsAtUrlMap[url].length; var newlyBoundLocations = []; for(var i = existingBreakpointCount - 1; i >= 0; i--) { var bp = this._breakpointsAtUrlMap[url][i]; if(bp.isPseudoBreakpoint) { this._breakpointsAtUrlMap[url].splice(i, 1); continue; } if(!bp.isBound && bp.start <= docLength && bp.start + bp.length <= docLength) { var justBound = newlyBoundLocations[bp.start]; if(justBound && justBound.length === bp.length && justBound.condition === bp.condition && justBound.isTracepoint === bp.isTracepoint) { continue; } var ignoreUnbound = (!bp.isPseudoBreakpoint && !bp.isBound); var newInfo = this.addBreakpoint(this.docString(docId), bp.start, bp.condition, bp.isTracepoint, false, ignoreUnbound); if(!newInfo || newInfo.failed) { continue; } if(!bp.isEnabled) { newInfo.isEnabled = !this.setBreakpointEnabledState(newInfo.breakpointId, false); } if(newInfo.breakpointId !== bp.breakpointId) { delete this._breakpointsAtIdMap[bp.breakpointId]; this._breakpointsAtUrlMap[url].splice(i, 1); } newlyBoundLocations[bp.start] = newInfo; if(flushMessageQueue) { flushMessageQueue(); } this._callHandler.notify("onResolveBreakpoint", [ bp.breakpointId, newInfo ]); } } } }; DebugProvider.prototype.unbindBreakpoints = function (docId) { var url = this.getUrlForDocumentId(docId); if(url) { var bpInfos = this._breakpointsAtUrlMap[url]; for(var i = 0; bpInfos && i < bpInfos.length; i++) { if(docId === this.getDocIdNumber(bpInfos[i].docId)) { bpInfos[i].isBound = false; if(this._isEnabled) { var realId = this.getBpIdNumber(bpInfos[i].breakpointId); if(!isNaN(realId)) { this._debugger.removeBreakpoint(realId); } } } } } }; DebugProvider.prototype.unbindAllBreakpoints = function () { for(var id in this._documentMap) { var docId = parseInt(id, 10); this.unbindBreakpoints(docId); } }; DebugProvider.prototype.getUrlForDocumentId = function (docId) { var docStorage = this._documentMap[docId]; if(docStorage) { return docStorage.url; } return null; }; DebugProvider.prototype.setAsyncBreakRequired = function () { var isRequired = false; if(this._breakOnAnyNewWorkerStarting || this._breakIntoSpecificWorkerIds.length > 0) { isRequired = true; } else { for(var id in this._breakpointsAtIdMap) { if(this._breakpointsAtIdMap.hasOwnProperty(id)) { isRequired = true; break; } } } this._debugger.setAsyncBreakRequired(isRequired); }; DebugProvider.prototype.isAsyncMethod = function (method) { if(method === "enableDynamicDebugging") { return true; } return false; }; DebugProvider.prototype.enableDynamicDebugging = function (response) { var _this = this; if(!this._isEnabled && !this._isAwaitingDebuggerEnableCall) { var listener = function (succeeded) { var connectionResult = (succeeded ? Debugger.ConnectionResult.Succeeded : Debugger.ConnectionResult.Failed); toolUI.removeEventListener("debuggingenabled", listener); _this._isAwaitingDebuggerEnableCall = false; if(succeeded) { connectionResult = _this._debugger.connect(); if(connectionResult == Debugger.ConnectionResult.Succeeded) { _this._isEnabled = true; var id; for(id in _this._documentMap) { var docId = parseInt(id, 10); _this.rebindBreakpoints(docId, 0, _this._documentMap[docId].length); } } } response(connectionResult); }; toolUI.addEventListener("debuggingenabled", listener); this._isAwaitingDebuggerEnableCall = true; this._debugger.enable(); } else { response(Debugger.ConnectionResult.Succeeded); } }; DebugProvider.prototype.executeOnTargetPage = function (expression) { mainBrowser.document.parentWindow.eval(expression); return true; }; DebugProvider.prototype.getSourceText = function (docId, start, length) { try { var text = this._debugger.getSourceText(this.getDocIdNumber(docId)); if(typeof start === "number" && start > 0) { if(typeof length === "number" && length > 0) { text = text.substr(start, length); } else { text = text.substr(start); } } return text; } catch (ex) { return "Error getting source text: " + ex.toString(); } }; DebugProvider.prototype.causeBreak = function (causeBreakAction, workerId) { var causeBreak = false; if(causeBreakAction === Debugger.CauseBreakAction.BreakOnAny) { this._breakOnAny = true; this._isNextBreakCausedByUser = true; causeBreak = true; } else if(causeBreakAction === Debugger.CauseBreakAction.BreakOnAnyNewWorkerStarting) { this._breakOnAnyNewWorkerStarting = true; } else if(causeBreakAction === Debugger.CauseBreakAction.BreakIntoSpecificWorker) { this._breakIntoSpecificWorkerIds.push(workerId); causeBreak = true; } else if(causeBreakAction === Debugger.CauseBreakAction.UnsetBreakOnAnyNewWorkerStarting) { this._breakOnAnyNewWorkerStarting = false; this._lastStartedWorkerId = null; } this.setAsyncBreakRequired(); if(causeBreak) { return this._debugger.causeBreak(); } return true; }; DebugProvider.prototype.resume = function (breakResumeAction) { if(breakResumeAction != Debugger.BreakResumeAction.Continue) { this._isNextBreakCausedByUser = true; } return this._debugger.resume(breakResumeAction); }; DebugProvider.prototype.getBreakpointIdFromSourceLocation = function (docId, start) { var realDocId = this.getDocIdNumber(docId); var breakpointId; try { breakpointId = this._debugger.getBreakpointIdFromSourceLocation(realDocId, start); } catch (ex) { return Debugger.BreakpointIdNotFound; } if(breakpointId === 0) { return Debugger.BreakpointIdNotFound; } else { return this.bpString(breakpointId); } }; DebugProvider.prototype.addBreakpoint = function (docId, start, condition, isTracepoint, isPseudoBreakpoint, ignoreUnbound) { if(!condition) { condition = ""; } var realDocId = this.getDocIdNumber(docId); var bp; if(this._isEnabled) { try { bp = this._debugger.addBreakpoint(realDocId, start, condition); } catch (ex) { } if(!bp) { bp = { docId: realDocId, start: start, length: 1, breakpointId: ":failed:" + (this._unresolvedBreakpointId++), bound: false, failed: true }; } } if(ignoreUnbound && (!bp || !bp.bound)) { return null; } if(!this._isEnabled || !bp.bound) { bp = { docId: realDocId, start: start, length: 1, breakpointId: ":unresolved:" + (this._unresolvedBreakpointId++), bound: false, failed: bp && bp.failed }; } var bpInfo = { docId: this.docString(bp.docId), start: bp.start, length: bp.length, breakpointId: this.bpString(bp.breakpointId), isBound: bp.bound, isEnabled: true, condition: condition, isTracepoint: isTracepoint, failed: bp.failed, isPseudoBreakpoint: isPseudoBreakpoint }; if(!bpInfo.failed) { var url = this.getUrlForDocumentId(realDocId); if(url) { var addNew = true; if(!this._breakpointsAtUrlMap[url]) { this._breakpointsAtUrlMap[url] = []; } else { var bps = this._breakpointsAtUrlMap[url]; for(var i = 0; i < bps.length; i++) { if(bps[i].breakpointId === bpInfo.breakpointId) { addNew = false; bps[i] = bpInfo; this._breakpointsAtIdMap[bpInfo.breakpointId].bp = bpInfo; break; } } } if(addNew) { this._breakpointsAtUrlMap[url].push(bpInfo); this._breakpointsAtIdMap[bpInfo.breakpointId] = { bp: bpInfo, url: url }; } } } this.setAsyncBreakRequired(); return bpInfo; }; DebugProvider.prototype.removeBreakpoint = function (bpId) { var succeeded = true; var breakpoint = this._breakpointsAtIdMap[bpId]; if(!breakpoint) { return false; } if(this._isEnabled) { var realId = this.getBpIdNumber(bpId); if(!isNaN(realId)) { succeeded = this._debugger.removeBreakpoint(realId); } } if(breakpoint && (succeeded || !breakpoint.bp.isBound)) { var url = breakpoint.url; for(var i = 0; i < this._breakpointsAtUrlMap[url].length; i++) { if(this._breakpointsAtUrlMap[url][i].breakpointId === bpId) { this._breakpointsAtUrlMap[url].splice(i, 1); break; } } delete this._breakpointsAtIdMap[bpId]; } this.setAsyncBreakRequired(); return succeeded; }; DebugProvider.prototype.setBreakpointEnabledState = function (bpId, enabled) { if(this._breakpointsAtIdMap[bpId]) { this._breakpointsAtIdMap[bpId].bp.isEnabled = enabled; return true; } else { return false; } }; DebugProvider.prototype.setBreakpointCondition = function (bpId, condition, isTracepoint) { if(this._breakpointsAtIdMap[bpId]) { this._breakpointsAtIdMap[bpId].bp.condition = condition; this._breakpointsAtIdMap[bpId].bp.isTracepoint = isTracepoint; return true; } else { return false; } }; DebugProvider.prototype.setExceptionFilter = function (filter) { this._exceptionFilter = filter; var succeeded = this._debugger.setBreakOnFirstChanceExceptions(filter === Debugger.ExceptionFilter.Handled); return succeeded; }; DebugProvider.prototype.isDocContainingMatch = function (query, docIds) { query = query.toLowerCase(); var text = this.getSourceText(docIds).toLowerCase(); if(text.indexOf(query) >= 0) { return true; } return false; }; DebugProvider.prototype.triggerSourceRundown = function () { return this._debugger.connect(); }; DebugProvider.prototype.getFrames = function (framesNeeded) { var frames = this._debugger.getFrames(framesNeeded); for(var i = 0; i < frames.length; i++) { frames[i].callFrameId = this.frameString(frames[i].callFrameId) , frames[i].location.docId = this.docString(frames[i].location.docId); } return frames; }; DebugProvider.prototype.parseThreadDescription = function (id, label, description) { var threadDescription = { id: 0, label: null, description: null, poundLabel: null, scriptFileName: null, htmlFileName: null, isWorker: false, displayName: null }; if(id !== null && id >= 1) { threadDescription.id = id; } if(label !== null) { threadDescription.label = label; var idParts = label.split("\r\n"); F12.Tools.Utility.Assert.AreEqual(idParts.length, 3); if(idParts.length === 3) { threadDescription.poundLabel = idParts[0]; var scriptfilePath = idParts[1].split("/"); threadDescription.scriptFileName = scriptfilePath[scriptfilePath.length - 1]; var htmlFilePath = idParts[2].split("/"); threadDescription.htmlFileName = htmlFilePath[htmlFilePath.length - 1]; threadDescription.isWorker = true; threadDescription.displayName = "Worker" + threadDescription.poundLabel + " " + threadDescription.scriptFileName + " (" + threadDescription.htmlFileName + ")"; } } if(description !== null) { threadDescription.description = description; var pattern = /^([0-9]+)##/gi; var match = pattern.test(description); if(match) { threadDescription.id = parseInt(description.split("##")[0], 10); var scriptFilePath = description.split("/"); threadDescription.scriptFileName = scriptFilePath[scriptFilePath.length - 1]; threadDescription.isWorker = true; threadDescription.displayName = "Worker-" + threadDescription.id + " " + threadDescription.scriptFileName; } } return threadDescription; }; DebugProvider.prototype.getCurrentThreadDescription = function () { var description = this._debugger.getThreadDescription(); return this.parseThreadDescription(null, null, description); }; DebugProvider.prototype.getThreads = function () { var _this = this; var descriptions = this._debugger.getThreads(); var decodedDescriptions = []; descriptions.forEach(function (description) { decodedDescriptions.push(_this.parseThreadDescription(null, null, description)); }); return decodedDescriptions; }; DebugProvider.prototype.eval = function (frameId, evalString) { var prop = this._debugger.eval(this.getFrameIdNumber(frameId), evalString); if(prop) { prop.propertyId = this.propString(prop.propertyId); } else { prop = { propertyId: "ERROR", name: null, type: null, fullName: null, value: null, expandable: false, readOnly: true, fake: false, invalid: false }; } return prop; }; DebugProvider.prototype.getLocals = function (frameId) { return this.propString(this._debugger.getLocals(this.getFrameIdNumber(frameId))); }; DebugProvider.prototype.getChildProperties = function (propertyId, start, length) { var props = this._debugger.getChildProperties(this.getPropIdNumber(propertyId), start, length); for(var i = 0; i < props.length; i++) { props[i].propertyId = this.propString(props[i].propertyId); } return props; }; DebugProvider.prototype.getChildPropertiesCount = function (propertyId) { return this._debugger.getChildPropertiesCount(this.getPropIdNumber(propertyId)); }; DebugProvider.prototype.setPropertyValueAsString = function (propertyId, value) { return this._debugger.setPropertyValueAsString(this.getPropIdNumber(propertyId), value); }; DebugProvider.prototype.setNextStatement = function (docId, position) { var success = this._debugger.setNextStatement(this.getDocIdNumber(docId), position); if(success) { this.resume(Debugger.BreakResumeAction.StepOver); } return success; }; DebugProvider.prototype.canSetNextStatement = function (docId, position) { return this._debugger.canSetNextStatement(this.getDocIdNumber(docId), position); }; DebugProvider.prototype.parseDocIdNumber = function (docId) { return parseInt(docId.substr(DebugProvider.DOC_ID_PREFIX.length, 10)); }; DebugProvider.prototype.parseIdNumber = function (id) { var delimiterIndex = id.indexOf("_"); F12.Tools.Utility.Assert.IsTrue(delimiterIndex >= 3 && delimiterIndex < id.length - 1, "Malformed id string detected"); return parseInt(id.substr(delimiterIndex + 1, 10)); }; DebugProvider.prototype.getDocIdNumber = function (docId) { DebugProvider.AssertIsValidId(docId, DebugProvider.DOC_ID_PREFIX); return this.parseDocIdNumber(docId); }; DebugProvider.prototype.getFrameIdNumber = function (frameId) { DebugProvider.AssertIsValidId(frameId, DebugProvider.FRAME_ID_PREFIX); return this.parseIdNumber(frameId); }; DebugProvider.prototype.getBpIdNumber = function (bpId) { DebugProvider.AssertIsValidId(bpId, DebugProvider.BREAKPOINT_ID_PREFIX); return this.parseIdNumber(bpId); }; DebugProvider.prototype.getPropIdNumber = function (propId) { DebugProvider.AssertIsValidId(propId, DebugProvider.PROPERTY_ID_PREFIX); return this.parseIdNumber(propId); }; DebugProvider.AssertIsValidId = function AssertIsValidId(id, idPrefix) { F12.Tools.Utility.Assert.IsTrue(id && id.length > idPrefix.length && id.substr(0, idPrefix.length) === idPrefix); }; DebugProvider.prototype.docString = function (docId) { return DebugProvider.DOC_ID_PREFIX + docId; }; DebugProvider.prototype.frameString = function (frameId) { return DebugProvider.FRAME_ID_PREFIX + this._sessionNumber + "_" + frameId; }; DebugProvider.prototype.bpString = function (bpId) { return DebugProvider.BREAKPOINT_ID_PREFIX + this._sessionNumber + "_" + bpId; }; DebugProvider.prototype.propString = function (propId) { return DebugProvider.PROPERTY_ID_PREFIX + this._sessionNumber + "_" + propId; }; return DebugProvider; })(); Debugger.DebugProvider = DebugProvider; })(Tools.Debugger || (Tools.Debugger = {})); var Debugger = Tools.Debugger; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=DebugProvider.js.map var DiagnosticsOMProvider = (function () { function DiagnosticsOMProvider() { var _this = this; this._port = toolUI.createPort("DiagnosticsOMPort"); toolUI.connect(this._port); this._rpc = new F12.Tools.RPC.JsonRPCEndpoint("DIAGOMSERVER", function (method, params, response) { return _this.jsonRpcMethodReceive(method, params, response); }, function (method, params) { return _this.jsonRpcNotificationReceive(method, params); }, function (data) { _this._port.postMessage(data); }, function (onMessage) { _this._port.addEventListener("message", function (data) { onMessage(data); }); }); } DiagnosticsOMProvider.prototype.notify = function (method, params) { this._rpc.jsonRpcNotification(method, params); }; DiagnosticsOMProvider.prototype.executeOnTargetPage = function (expression) { try { browser.document.parentWindow.eval(expression); } catch (ex) { return false; } return true; }; DiagnosticsOMProvider.prototype.loadDocumentContent = function (docId, url, oneBasedLine, oneBasedColumn, mimeType, isAsync) { var _this = this; try { var xmlhttp = new XMLHttpRequest(); if(isAsync && !this.isLocalUrl(url)) { xmlhttp.onreadystatechange = function () { if(xmlhttp.readyState === 4) { _this.onXHRComplete(true, xmlhttp, docId, url, oneBasedLine, oneBasedColumn, mimeType); } }; xmlhttp.open("GET", url, true); xmlhttp.send(null); } else { xmlhttp.open('GET', url, false); xmlhttp.send(null); this.onXHRComplete(true, xmlhttp, docId, url, oneBasedLine, oneBasedColumn, mimeType); } } catch (ex) { this.onXHRComplete(false, xmlhttp, docId, url, oneBasedColumn, oneBasedColumn, mimeType, ex.message); } return true; }; DiagnosticsOMProvider.prototype.onXHRComplete = function (success, xmlhttp, docId, url, oneBasedLine, oneBasedColumn, mimeType, message) { var containsValidResponse = success && (this.isLocalUrl(url) || xmlhttp.status === 200); if(!mimeType) { if(containsValidResponse) { mimeType = xmlhttp.getResponseHeader("content-type"); mimeType = mimeType ? this.mapToSupportedMimeTypes(mimeType.split(";")[0]) : this.getMimetype(url); } else { mimeType = "text/plain"; message = message || String(xmlhttp.status); } } this.notify("onDocumentLoaded", [ containsValidResponse, docId, url, xmlhttp.responseText, oneBasedLine, oneBasedColumn, mimeType, message ]); }; DiagnosticsOMProvider.prototype.jsonRpcMethodReceive = function (method, params, response) { var result; if(params) { result = this[method].apply(this, params); } else { result = this[method].apply(this); } response(result, undefined); }; DiagnosticsOMProvider.prototype.jsonRpcNotificationReceive = function (event, params) { }; DiagnosticsOMProvider.prototype.isLocalUrl = function (url) { return url && url.indexOf("file://") === 0; }; DiagnosticsOMProvider.prototype.mapToSupportedMimeTypes = function (mimeType) { switch(mimeType.toLowerCase()) { case "text/javascript1.0": case "text/javascript1.1": case "text/javascript1.2": case "text/javascript1.4": case "text/jscript": case "text/x-javascript": case "application/x-javascript": case "application/javascript": case "text/javascript1.3": case "text/javascript1.5": case "text/livescript": case "text/x-ecmascript": case "application/x-ecmascript": case "application/ecmascript": return "text/javascript"; default: return mimeType; } }; DiagnosticsOMProvider.prototype.getMimetype = function (url) { if(url && url.indexOf(".") !== -1) { var extension = url.split(".").pop(); switch(extension) { case "html": return "text/html"; case "css": return "text/css"; case "js": return "text/javascript"; case "xml": return "text/xml"; default: return "text/plain"; } } return "text/plain"; }; return DiagnosticsOMProvider; })(); var diagOMProvider = new DiagnosticsOMProvider(); //@ sourceMappingURL=DiagnosticsOMProvider.js.map F12.Tools.Debugger.DebugProvider.isLaunchedViaJitDebugging = true; //@ sourceMappingURL=jitRemote.js.map /* * TabControl styles */ .tabControl { height: 100%; width: calc(100% - 3.5em); display: -ms-grid; -ms-grid-columns: 1fr; -ms-grid-rows: auto minmax(min-content, 1fr); box-sizing: border-box; float: left; margin-left: 3.5em; } .tabControl > .tabBarContainer { -ms-grid-column: 1; -ms-grid-row: 1; -ms-grid-column-align: end; box-sizing: border-box; position: relative; width: 100%; } .tabControl ul.tabBar { width: calc(100% - 32px); float: left; list-style-type: none; margin: 0; padding-left: 0; padding-top: 2px; cursor: default; position: relative; overflow: hidden; font-size: 0; } .tabControl ul.tabBar li { position: relative; display: inline-block; min-width: 9em; color: TRANSPARENT; /*[{vs-file-tab-text-color}]*/ font-size: 9pt; /*[{plugin-font-size}]*/ font-family: "Segoe UI", Arial, sans-serif; /*[{plugin-font-family} , Arial, sans-serif]*/ height: 2em; padding-top: 2px; } .tabControl ul.tabBar li:hover { color: TRANSPARENT; /*[{vs-file-tab-hot-text-color}]*/ background-color: TRANSPARENT; /*[{vs-file-tab-hot-gradient-bottom-color}]*/ } .tabControl ul.tabBar li:hover .closeButton { background: url("../Common/images/tabclose.png") no-repeat 0 2px; /*[url({f12-debugger-image-tab-control-close}) no-repeat 0 2px]*/ background-size: 32px 16px; } .tabControl ul.tabBar li:hover .closeButton:hover { background: url("../Common/images/tabclose.png") no-repeat -16px 2px; /*[url({f12-debugger-image-tab-control-close}) no-repeat -16px 2px]*/ background-size: 32px 16px; } .tabControl ul.tabBar li:focus { outline: 1px dotted TRANSPARENT; /*[1px dotted {vs-designer-selection-dots-color}]*/ } .tabControl ul.tabBar li.active { color: TRANSPARENT; /*[{vs-file-tab-selected-text-color}]*/ background-color: TRANSPARENT; /*[{vs-file-tab-selected-gradient-bottom-color}]*/ } .tabControl ul.tabBar li.active .closeButton { background: url("../Common/images/tabclose.png") no-repeat 0 2px; /*[url({f12-debugger-image-tab-control-close}) no-repeat 0 2px]*/ background-size: 32px 16px; } .tabControl ul.tabBar li.active .closeButton:hover { background: url("../Common/images/tabclose.png") no-repeat -16px 2px; /*[url({f12-debugger-image-tab-control-close}) no-repeat -16px 2px]*/ background-size: 32px 16px; } .tabControl > .tabContentPane { -ms-grid-column: 1; -ms-grid-row: 2; box-sizing: border-box; } .tabControl > .tabContentPane > .tabItemContent { display: none; } .tabControl > .tabContentPane > .active { display: block; } .tabStrip { position: absolute; margin-left: 3em; float: left; } #tabStripContainer { display: inline-block; border-bottom: 0.2em solid TRANSPARENT; /*[0.2em solid {vs-file-tab-selected-gradient-bottom-color}]*/ } .disableWrap { white-space: nowrap; } .buttonControl { position: absolute; float: left; overflow: hidden; height: 2em; } .buttonControl > button { width: 19px; height: 100%; padding: 1px 5px 4px 5px; border: none; border-bottom: 0.2em solid TRANSPARENT; /*[0.2em solid {vs-file-tab-selected-gradient-bottom-color}]*/ } .tabControl .closeButton { margin-left: 1em; margin-right: 0.5em; float: right; height: 16px; width: 16px; } .tabTitle { margin-left: 3px; overflow: hidden; float: left; text-align: center; height: 100%; padding-top: 1px; } .tabContent { display: inline; height: 2em; } #tabNavigation { width: 32px; float: right; margin-top: 4px; position: relative; z-index: 100; } .prevTabDisabled { background: url("images/prevTab.png"); /*[url({f12-debugger-image-tab-control-previous})]*/ background-repeat: no-repeat; background-position: 0px 0px; background-size: 32px 16px; float: left; width: 16px; height: 16px; } .prevTabDisabled:hover { background-position-x: -16px; } .nextTabDisabled{ background: url("images/nextTab.png"); /*[url({f12-debugger-image-tab-control-next})]*/ background-repeat: no-repeat; background-position: 0px 0px; background-size: 32px 16px; float: right; width: 16px; height: 16px; } .nextTabDisabled:hover { background-position-x: -16px; } .hiddenButton { display: none; } PNG  IHDR@] cHRMz%u0`:o_F pHYsod4IDATx^흿F /k a}cG9t~x>R%u3^U׿Zjt޹p… .\p… .\{3>?3>9C_Jt33c[Gg736Ic3h>X_Ns z "f2?q<.#sdChjz Ɇl=dP)Xd=;7A6d_  ysww tW,R{]5ރf5B3$#YHwnU3,L6ya:%["QXLXEOĬi6iәKhv&Wɼ4"}N'𿰶wMҕ 򶍴^𑉾5NOK׵Bj6CfC}D;Ku?6Cf|DobPrjQoA?>L/804U6v_wB>w)'Ɯ5#ot\]dqgeL0ȇ|y&r8K8+iFD|/[|n"Ç4hVXgM0ȇʰX4c >o6 ˗1@"_ 8 l/cPL'|/48OLqYXgtlA)ýi޴'E_utD6-dco$m}_؏_uni޴'`S0QpZuYs7?T!VUn`Cަb}\6Ͷ%:ESZ%d'n`B2,}`Pܳh.FFob{:\-U}u]DLLź)lMӓ?cIKzM>Ej@$ź% ?`N0hr3cQ# ޮbV5b`M![w :K@,i0}3zWc"jd<ح38jDcQ#lLͷd#o`ǯzlB^L {h/}񛱛!]gϫ|i 5gi**z`2vP3{qUhRB(9v_k:Bx5PDl܋ʴO 7Dz1j@G>U8qgv܋괗L5e{1k@Ew-|,;1௥Vԑ]--'7u1j t[C1']@_K.^&-n,:jv:~Alt^83_KW#Zal1*(fS UM?>7 X_$ьJfz}M/~Vo,Av1 _$8c5>]ӊ@vC>M0#xyIn($>{ů] tf D[z~O$ƮjE3$6;n"SpWxRi0^ Ş'cٮ^KT`w%dߗ8V +MM >գ{ WeW}J ?: 6*t3V![Ю%K)HM`ݳ$~=3N @7Uh })Qkeæ7,dJQk费{ K}'ME@|t'0E n9i0ȏn{y"gvX:e%j-nꃓ =DKT|-tgadX;ݮжE@$]Lwcq?{#`]hZϟA,A+k@E@zAix ߺB{Hn` ?3NMw߽HV[@B"JP\ak$H|[%x>dJ 7sE`a5>XPpHg-P`ұ "aY?Ӵl@U `I3Fj S15@ϴMH~>rAX|F0%Ym)4'@Y$(%A|2* f dXz _*'c5qg6? 0lU"{>{Fi8&@f+ "йӀ=7?  [*`~[3͉n@"ؓdU $>ӗѩ3X @b.5a9WFd2uŜtcW UNeFd2u%2o㝀OyAUDA3ͮ"4bPjz+35"@ ,k,hFߔS?}iz+35m ,蓨jSr A7@ToݿDUb+PFtʪm$ڴyݿ#jSr +%Oy l{|u WtD/ %g"cA{,hC`M@/.%O N58kE@48r"l Trzo+!!%ghyc!&19VeN 6`-Н]K{09kbtC.@9{LfM(' X sg.=X~cς&g hmFmA %}_ jȕNŋqد`8*:^0^bˌ;'lu`1튌 u=)f lŁռ4`*u햨l1 0{^k D{b0>K6EƮb"uE-UO}$6@P QHB̦q3>ڧv)f+U@X,֮whZ؋z'2v5)S 9 ЙC՛^j!f:MSZ-EdT;ж.|f*wWlMۅ[;VL\*bZl4~\" mj,A5`M^l_Ur$;4[J3苴^5s!SC|/48O,z X)`J%cӱɟ#?ns-Ó?J{,  V,2>_m+w[| 6ɟCm;)?6~9|W jO%o4%-xB>w)'Ɯfal.wь,]jNNʆlyFݻ1:4H"Jj5qg.,Y=4xk䔮ٟX_NưZ}kh^6c{I… .\p… .\p…{;8 QaY]IENDB`PNG  IHDR `|"pgAMA a pHYsktEXtSoftwareAdobe ImageReadyqe<IDAThCXQ#1tI.K9g@`LmoZRi[TvUW33+ie{1i170yq&R2.B)Z!LCap8PؓM \3~&4O4,iB 8hh$I2-]Q2qXaM@%h!MPw zhׄ/!M# nÊ|&Y.,rljOͯIr9ĉ)HBƱ_c =>NFbhl֘Hהأd|="_W͌*σ'Mbn`Md\h,R2.B)9.&/7|ޟ5ص;)|R8]d1hfP~iZ L@\ EJƅV"%S|69a6R($|o>m&4hL \v&`o&ooo37zɝdl~1DRޘm&l- 6uo"-^w zh߄@sgH(+JdZ֞Jˑ>6ܝ̝vlsMԀO1]m'ۀAS|8|||\2X;a[⚶i!\~&USc;;v1o}k1NE`zGSJhg,Z;8IENDB`PNG  IHDR `|"p pHYs+ OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FIDATxX;r"I}t`5k67nPDO0 `OWH7\!0XN6UYQWy<|N`~0ZosA~Z7Х'""-6&oO3NZS {}0WG_sʧNѪZ~nh_ 𛁿jAW]ͩ IӔߌtzxב@㩉wΊOp3~T3++:|EgG HP;J&5)ұ0KMUY@!eF՗`X ĒgFIggF1pE10Ƽ$_J~ \cT?@Eu#+@)DsjO7K5k#?F/C) 1&1??#Ep (P$Ƙ~@Jb;>:pjS?@H@@ĵx#d V?`-N +@º #q:Rooog=ѭI@.8+*ĕ?gH+qz&5jIENDB`PNG  IHDR `|"pgAMA a pHYsktEXtSoftwareAdobe ImageReadyqe<IDAThCYQ#1$Xcj!T:,8B!8_pt֔F~ydoI$A777z&lVqqqq(㞅s\]| 8sR3yAA<Ø}K5A`( DA#=Ak?lkwFvD/'AuX6$zf=KoLgc(+^Y?My`i++qr!#7Ӊy0ѵd ϤHWWWyJ!x3S]O{$۠ xyBJ;>%)m&JJ۠ -UA+TRM AH%mRI ~tAb~v{:|F%~Cl鹷,2No1?:+9gpIqp)YEAFXN=V8Xkon-$TY!U> ͳ]X0p?ʯ} i sW񕠸3&B3h"ÔG=w'}͠N0VZ#`NIKodt lKܸegHDH3{VDoC)a=8M8yx8Ɔ @*)m&JJhaVD @*)m&JJ۠ -ZTQd<eV$F o! ᒜ!/c _gAKB/yAP,9~|K^Ā .windowtoolbar { -ms-grid-columns: 1fr auto auto auto; display: -ms-grid; } .watchWindow > .windowtoolbar > #addWatchButton { -ms-grid-column: 2; } .watchWindow > .windowtoolbar > #addWatchButton > .buttonIcon { background-image: url('Watches/images/addWatch.png'); /*[url({f12-debugger-image-watches-add-watch})]*/ } .watchWindow > .windowtoolbar > #deleteAllWatchesButton { -ms-grid-column: 4; } .watchWindow > .windowtoolbar > #deleteAllWatchesButton > .buttonIcon { background-image: url('Watches/images/deleteAll.png'); /*[url({f12-debugger-image-watches-delete-all})]*/ } .watchWindow .gridWatchContainer { height: calc(100% - 23px); width: 100%; border: none; position: relative; } .watchWindow .gridWatchContainer .grid .grid-canvas { overflow-x: hidden; } .grid-row:hover .deleteWatch { background: url("Watches/images/deleteWatch.png") no-repeat; /*[url({f12-debugger-image-watches-delete-watch}) no-repeat]*/ background-size: 16px; } .grid-row:hover .deleteWatch:hover { background: url("Watches/images/deleteWatch.png") no-repeat 0px -16px; /*[url({f12-debugger-image-watches-delete-watch}) no-repeat 0px -16px]*/ background-size: 16px; background-color: TRANSPARENT; /*[{f12-toolbar-button-hover-color}]*/ } .deleteWatch { width: 16px; height: 16px; } .addWatch { color: TRANSPARENT; /*[{plugin-link-active-color}]*/ border: none; } .grid-row:hover { color: TRANSPARENT; /*[{plugin-treeview-content-mouseover-color}]*/ } .watch-Error { color: TRANSPARENT; /*[{plugin-font-console-error-color}]*/ } .watch-ValueChanged { color: TRANSPARENT; /*[{plugin-debugger-watch-font-color}]*/ } .watch-watchName { color: TRANSPARENT; /*[{plugin-link-active-color}]*/ } .grid-row-selected .watch-watchName, .grid-row-selected-blur .watch-watchName, .grid-row:hover .watch-watchName { color: TRANSPARENT; /*[{plugin-link-active-selected-color}]*/ } .grid-row-selected .watch-ValueChanged, .grid-row-selected-blur .watch-ValueChanged, .grid-row:hover .watch-ValueChanged { color: TRANSPARENT; /*[{plugin-treeview-content-selected-color}]*/ } .gridWatchContainer .overlayWindow { opacity: 0.5; position: absolute; display: block; z-index: 10; top: 0; bottom: 0; left: 0; right: 0; background: TRANSPARENT; /*[{plugin-debugger-watch-overlay-color}]*/ } .grid-row .showAll { cursor: pointer; text-decoration: underline; } .grid-row .functionItem { background: url("./images/functionIcon.png") no-repeat; /*[url({f12-debugger-image-watches-function}) no-repeat]*/ background-size: 10px 10px; } .grid-row .notAFunctionItem { background: url("./images/notAFunctionIcon.png") no-repeat; /*[url({f12-debugger-image-watches-not-a-function}) no-repeat]*/ background-size: 10px 10px; } PNG  IHDR `|"p pHYs+ OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FIDATxX;r"I}t`5k67nPDO0 `OWH7\!0XN6UYQWy<|N`~0ZosA~Z7Х'""-6&oO3NZS {}0WG_sʧNѪZ~nh_ 𛁿jAW]ͩ IӔߌtzxב@㩉wΊOp3~T3++:|EgG HP;J&5)ұ0KMUY@!eF՗`X ĒgFIggF1pE10Ƽ$_J~ \cT?@Eu#+@)DsjO7K5k#?F/C) 1&1??#Ep (P$Ƙ~@Jb;>:pjS?@H@@ĵx#d V?`-N +@º #q:Rooog=ѭI@.8+*ĕ?gH+qz&5jIENDB`#mainContainer { background-color: TRANSPARENT; /*[{plugin-background-color}]*/ cursor: default; } #clientArea { position: absolute; top: 2.8em; bottom: 0; left: 0; right: 0; box-sizing: border-box; background-color: TRANSPARENT; /*[{plugin-background-color}]*/ cursor: default; } #clientPanel { width: 100%; height: 100%; overflow: hidden; color: TRANSPARENT; /*[{plugin-color}]*/ background-color: TRANSPARENT; /*[{plugin-background-color}]*/ } .BPT-ConsoleButton { top: 0; display: table-cell; padding-left: 0.5em; padding-right: 0.5em; width: auto; vertical-align: bottom; } .labeledComboBox { } .emulationSection label { display: inline-block; width: 100px; font-size: 12px; line-height: 1.6em; color: TRANSPARENT; /*[{plugin-subheading-color}]*/ } .labeledComboBox select { width: 150px; margin: 3px; } .labeledComboBox option { background-color: TRANSPARENT; /*[{plugin-background-color}]*/ } .emulationSection { margin-left: 14px; margin-right: 70px; margin-bottom: 20px; font-family: "Segoe UI", Arial, sans-serif; /*[{plugin-font-family} , Arial, sans-serif]*/ color: TRANSPARENT; /*[{plugin-color}]*/ float: left; } .emulationSection h1 { font-size: 13px; font-weight: 600; } .labeledRadioButton { font-size: 12px; line-height: 1.6em; color: TRANSPARENT; /*[{plugin-subheading-color}]*/ } .radioButtonLabel { width: auto !important; } .labeledTextBox { } .labeledTextBox input { width: 150px; margin: 3px; } .minorHeadingLabel { color: TRANSPARENT !important; /*[{plugin-color} !important]*/ width: auto !important; } .inputIcon { border: none; background-repeat: no-repeat; } #infoButtonIcon { background-image: url('infoButton.png'); /*[url({f12-emulation-image-info-button})]*/ background-size: 14px 14px; width: 14px; height: 14px; display: inline-block; vertical-align: text-top; cursor: pointer; } #deleteUaStringIcon { background-image: url('deleteUaString.png'); /*[url({f12-emulation-image-delete-user-agent-string})]*/ background-size: 16px 48px; width: 16px; height: 16px; display: inline-block; vertical-align: text-top; } #removeCustomUaStringControlRoot { margin-left: 4px; cursor: default; } .validationErrorIcon { width: 14px; height: 14px; } .labeledTextBoxWithUnits { } .labeledTextBoxWithUnits input { width: 90px; margin: 3px; } .labeledTextBoxWithUnits img { margin-top: 1px; vertical-align: text-top; } .hiddenLabel { display: none; position: absolute; left: -1000px; } .unitsLabel { width: auto !important; } .customSection { margin-top: 6px; } /* do not display the "x" in the custom UA string box */ #customUaStringControlRoot ::-ms-clear { display: none; } #gpsLabel { margin: 3px -3px 3px 0px; } #gpsOffLabel, #gpsOnLabel, #gpsOnNoSignalLabel { margin: 0px 4px 0px -2px; } Emulation

      // // Copyright (C) Microsoft. All rights reserved. // // validatedTextbox.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var F12; (function (F12) { (function (Tools) { (function (Emulation) { "use strict"; (function (ValidationStatus) { ValidationStatus._map = []; ValidationStatus._map[0] = "Unknown"; ValidationStatus.Unknown = 0; ValidationStatus._map[1] = "Okay"; ValidationStatus.Okay = 1; ValidationStatus._map[2] = "Error"; ValidationStatus.Error = 2; })(Emulation.ValidationStatus || (Emulation.ValidationStatus = {})); var ValidationStatus = Emulation.ValidationStatus; var ValidatedTextbox = (function (_super) { __extends(ValidatedTextbox, _super); function ValidatedTextbox(parentElement, validationCallback, templateName) { var _this = this; _super.call(this, templateName); parentElement.appendChild(this.rootElement); this._validationCallback = validationCallback; this._textbox = this.findElement("validatedTextbox"); this._errorIcon = this.findElement("validationErrorIcon"); this._errorHelper = this.findElement("validationErrorHelper"); this._textbox.setAttribute("aria-describedby", this._errorHelper.id); this._textbox.addEventListener("change", function (ev) { return _this.onChange(ev); }); this._textbox.addEventListener("keydown", function (ev) { return _this.onKeydown(ev); }); this._textbox.addEventListener("blur", function (ev) { return _this.onBlur(ev); }); this.clearValidationStatus(ValidationStatus.Okay); } Object.defineProperty(ValidatedTextbox.prototype, "disabled", { get: function () { return this._textbox.disabled; }, set: function (value) { this._textbox.disabled = value; }, enumerable: true, configurable: true }); Object.defineProperty(ValidatedTextbox.prototype, "text", { get: function () { return this._textbox.value; }, set: function (value) { this._textbox.value = value; }, enumerable: true, configurable: true }); Object.defineProperty(ValidatedTextbox.prototype, "validationStatus", { get: function () { return this._validationStatus.status; }, enumerable: true, configurable: true }); Object.defineProperty(ValidatedTextbox.prototype, "validatedValue", { get: function () { return this._validationStatus.validatedValue; }, enumerable: true, configurable: true }); ValidatedTextbox.prototype.getValidationInfo = function () { return this._validationStatus; }; Object.defineProperty(ValidatedTextbox.prototype, "textCommitted", { get: function () { return this._textCommitted; }, set: function (handler) { this._textCommitted = handler; }, enumerable: true, configurable: true }); Object.defineProperty(ValidatedTextbox.prototype, "valueCommitted", { get: function () { return this._valueCommitted; }, set: function (handler) { this._valueCommitted = handler; }, enumerable: true, configurable: true }); Object.defineProperty(ValidatedTextbox.prototype, "validationFailed", { get: function () { return this._validationFailed; }, set: function (handler) { this._validationFailed = handler; }, enumerable: true, configurable: true }); Object.defineProperty(ValidatedTextbox.prototype, "focusableElement", { get: function () { return this._textbox; }, enumerable: true, configurable: true }); ValidatedTextbox.prototype.commitEdits = function () { this.validateAndCommit(); }; ValidatedTextbox.prototype.tryValidate = function () { this.validateAndCommit(false); return this.validationStatus === ValidationStatus.Okay; }; ValidatedTextbox.prototype.onChange = function (ev) { this.validateAndCommit(); }; ValidatedTextbox.prototype.onKeydown = function (ev) { if(ev.keyCode === Common.KeyCodes.ENTER) { this.validateAndCommit(); ev.preventDefault(); } else { this.clearValidationStatus(); } }; ValidatedTextbox.prototype.onBlur = function (ev) { if(this.validationStatus === ValidationStatus.Unknown) { this.validateAndCommit(); } }; ValidatedTextbox.prototype.clearValidationStatus = function (status) { if (typeof status === "undefined") { status = ValidationStatus.Unknown; } this._validationStatus = { status: status, tooltip: "" }; this._errorIcon.style.display = "none"; this._errorHelper.innerText = ""; }; ValidatedTextbox.prototype.validateAndCommit = function (commitValue) { if (typeof commitValue === "undefined") { commitValue = true; } try { this._validationStatus = this._validationCallback(this._textbox.value); } catch (e) { this._validationStatus = { status: ValidationStatus.Error, tooltip: "" }; } if(this._validationStatus.status === ValidationStatus.Okay) { this._errorIcon.style.display = "none"; this._errorHelper.innerText = ""; if(this.validatedValue && this.validatedValue.toString() !== this.text) { this.text = this.validatedValue.toString(); } if(commitValue) { if(this.textCommitted) { this.textCommitted(this.text); } if(this.valueCommitted) { this.valueCommitted(this.validatedValue); } } } else { this._errorIcon.title = this._validationStatus.tooltip; this._errorIcon.style.display = "inline"; this._errorHelper.innerText = this._validationStatus.tooltip; if(this.validationFailed) { this.validationFailed(); } } }; return ValidatedTextbox; })(Common.Controls.TemplateControl); Emulation.ValidatedTextbox = ValidatedTextbox; })(Tools.Emulation || (Tools.Emulation = {})); var Emulation = Tools.Emulation; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=validatedTextbox.js.map // emulation.ts var F12; (function (F12) { (function (Tools) { (function (Emulation) { "use strict"; ; (function (BrowserMode) { BrowserMode._map = []; BrowserMode._map[0] = "Desktop"; BrowserMode.Desktop = 0; BrowserMode._map[1] = "Phone"; BrowserMode.Phone = 1; BrowserMode._map[2] = "Unknown"; BrowserMode.Unknown = 2; })(Emulation.BrowserMode || (Emulation.BrowserMode = {})); var BrowserMode = Emulation.BrowserMode; (function (ModeUpdate) { ModeUpdate._map = []; ModeUpdate._map[0] = "BrowserMode"; ModeUpdate.BrowserMode = 0; ModeUpdate._map[1] = "UserAgentString"; ModeUpdate.UserAgentString = 1; })(Emulation.ModeUpdate || (Emulation.ModeUpdate = {})); var ModeUpdate = Emulation.ModeUpdate; (function (Orientation) { Orientation._map = []; Orientation._map[0] = "Landscape"; Orientation.Landscape = 0; Orientation._map[1] = "Portrait"; Orientation.Portrait = 1; Orientation._map[2] = "Unknown"; Orientation.Unknown = 2; })(Emulation.Orientation || (Emulation.Orientation = {})); var Orientation = Emulation.Orientation; (function (ViewportUpdate) { ViewportUpdate._map = []; ViewportUpdate._map[0] = "Orientation"; ViewportUpdate.Orientation = 0; ViewportUpdate._map[1] = "Resolution"; ViewportUpdate.Resolution = 1; })(Emulation.ViewportUpdate || (Emulation.ViewportUpdate = {})); var ViewportUpdate = Emulation.ViewportUpdate; (function (GeolocationState) { GeolocationState._map = []; GeolocationState._map[0] = "Off"; GeolocationState.Off = 0; GeolocationState._map[1] = "On"; GeolocationState.On = 1; GeolocationState._map[2] = "OnNoSignal"; GeolocationState.OnNoSignal = 2; GeolocationState._map[3] = "Unknown"; GeolocationState.Unknown = 3; })(Emulation.GeolocationState || (Emulation.GeolocationState = {})); var GeolocationState = Emulation.GeolocationState; var EmulationWindow = (function () { function EmulationWindow(hostBridge, diagnosticsBridge) { var _this = this; this._traceWriter = new Common.TraceWriter(); this.traceWriter.raiseEvent(Common.TraceEvents.Emulation_Window_Create_Start); toolwindowHelpers.registerErrorComponent("Emulation", this.onError.bind(this)); this._proxy = new Proxy(hostBridge, diagnosticsBridge); this._hostBridge = hostBridge; this._diagnosticsBridge = diagnosticsBridge; var jsonText = this._hostBridge.readPluginFile("emulation.json"); this._config = JSON.parse(jsonText); this.initializeModel(); this._documentModeSelector = new Common.Controls.ComboBox(document.getElementById("documentModeListRoot")); this._documentModeInfoButton = new Common.Controls.Button(document.getElementById("documentModeInfoControlRoot")); this._browserModeSelector = new Common.Controls.ComboBox(document.getElementById("browserModeListRoot")); this._userAgentStringSelector = new Common.Controls.ComboBox(document.getElementById("uaStringListRoot")); this._customUserAgentStringContainer = new Common.Controls.Control(document.getElementById("customUaStringSection")); this._customUserAgentStringInput = new Common.Controls.DataListTextBox(document.getElementById("customUaStringControlRoot")); this._removeCustomUAStringButton = new Common.Controls.Button(document.getElementById("removeCustomUaStringControlRoot")); this._orientationSelector = new Common.Controls.ComboBox(document.getElementById("orientationControlRoot")); this._resolutionSelector = new Common.Controls.ComboBox(document.getElementById("resolutionControlRoot")); this._customDisplaySizeContainer = new Common.Controls.Control(document.getElementById("customDisplaySizeSection")); this._displaySizeInput = new Emulation.ValidatedTextbox(document.getElementById("displaySizeControlRoot"), function (value) { return _this.validateDisplaySize(value); }, "validatedTextboxTemplate"); this._displayWidthInput = new Emulation.ValidatedTextbox(document.getElementById("displayWidthControlRoot"), function (value) { return _this.validateDisplayDimension(value); }, "validatedTextboxTemplate"); this._displayHeightInput = new Emulation.ValidatedTextbox(document.getElementById("displayHeightControlRoot"), function (value) { return _this.validateDisplayDimension(value); }, "validatedTextboxTemplate"); this._geolocationOffButton = new Common.Controls.RadioButton(document.getElementById("gpsOff")); this._geolocationOnButton = new Common.Controls.RadioButton(document.getElementById("gpsOn")); this._geolocationOnNoSignalButton = new Common.Controls.RadioButton(document.getElementById("gpsOnNoSignal")); this._gpsLatitudeInput = new Emulation.ValidatedTextbox(document.getElementById("latitudeControlRoot"), function (value) { return _this.validateCoordinate(value, -90, 90, "EmulationLatitudeError"); }, "validatedTextboxTemplate"); this._gpsLongitudeInput = new Emulation.ValidatedTextbox(document.getElementById("longitudeControlRoot"), function (value) { return _this.validateCoordinate(value, -180, 180, "EmulationLongitudeError"); }, "validatedTextboxTemplate"); this.initializeView(); this._documentModeSelector.focusableElement.focus(); if(!(Plugin).F12) { window.addEventListener("keydown", function (e) { if(e.keyCode === Common.KeyCodes.TAB && !e.altKey && !e.ctrlKey) { var activeElement = document.activeElement; var firstFocusableElement = _this._documentModeSelector.focusableElement; var lastFocusableElement; if(_this._geolocationState === GeolocationState.Off) { lastFocusableElement = _this._geolocationOffButton.focusableElement; } else { lastFocusableElement = _this._gpsLongitudeInput.focusableElement; } if(e.shiftKey) { if(activeElement === firstFocusableElement) { lastFocusableElement.focus(); e.preventDefault(); return false; } } else { if(activeElement === lastFocusableElement) { firstFocusableElement.focus(); e.preventDefault(); return false; } } } }); } this._isInitialHandshake = true; this._isAtBreakpoint = false; this._currentUrl = ""; this._proxy.initializeProxy(function (msg) { return _this.onMessage(msg); }, function () { return _this.onAttach(); }, function () { return _this.onDetach(); }, function () { return _this.onBreak(); }, function () { return _this.onRun(); }); toolwindowHelpers.initializeToolWindow(this._hostBridge); this._documentModeSelector.valueChanged = function (mode) { return _this.onDocumentModeChanged(mode); }; this._documentModeInfoButton.click = function () { return _this.onDocumentModeInfoClicked(); }; this._browserModeSelector.valueChanged = function (mode) { return _this.onBrowserModeChanged(mode); }; this._userAgentStringSelector.valueChanged = function (uaString) { return _this.onUserAgentStringChanged(uaString); }; this._customUserAgentStringInput.textCommitted = function (uaString) { return _this.onCustomUserAgentStringChanged(uaString); }; this._removeCustomUAStringButton.click = function () { return _this.onRemoveCustomUserAgentString(); }; this._orientationSelector.valueChanged = function (orientation) { return _this.onOrientationChanged(orientation); }; this._resolutionSelector.valueChanged = function (resolution) { return _this.onResolutionChanged(resolution); }; this._displaySizeInput.valueCommitted = function (value) { return _this.onCustomDisplayFieldsCommitted(); }; this._displayWidthInput.valueCommitted = function (value) { return _this.onCustomDisplayFieldsCommitted(); }; this._displayWidthInput.validationFailed = function () { return _this.onDisplayDimensionValidationFailure(); }; this._displayHeightInput.valueCommitted = function (value) { return _this.onCustomDisplayFieldsCommitted(); }; this._displayHeightInput.validationFailed = function () { return _this.onDisplayDimensionValidationFailure(); }; this._geolocationOffButton.check = function () { return _this.onGeolocationStateChanged(GeolocationState.Off); }; this._geolocationOnButton.check = function () { return _this.onGeolocationStateChanged(GeolocationState.On); }; this._geolocationOnNoSignalButton.check = function () { return _this.onGeolocationStateChanged(GeolocationState.OnNoSignal); }; this._gpsLatitudeInput.valueCommitted = function (value) { return _this.onLatitudeCommitted(value); }; this._gpsLongitudeInput.valueCommitted = function (value) { return _this.onLongitudeCommitted(value); }; if(Plugin.F12) { var hostInfoChanged = function (info) { var spacer = document.querySelector(".shellButtonSpacer"); var scaledControlAreaWidth = info.controlAreaWidth * (screen.logicalXDPI / screen.deviceXDPI); spacer.style.width = scaledControlAreaWidth + "px"; }; Plugin.F12.addEventListener("hostinfochanged", function (e) { return hostInfoChanged(e); }); hostInfoChanged(Plugin.F12.getHostInfo()); } this.traceWriter.raiseEvent(Common.TraceEvents.Emulation_Window_Create_Stop); } EmulationWindow.DEFAULT_VALUE = ""; EmulationWindow.CUSTOM_VALUE = "?"; EmulationWindow.DOCMODE_INFO_LINK = "http://go.microsoft.com/fwlink/?LinkID=286288"; EmulationWindow.IEMOBILE_UA_SUBSTRING = "IEMobile"; EmulationWindow.MAX_MOBILE_SCREEN_SIZE = 5; EmulationWindow.EMULATION_MODE_EDGE = "Edge"; EmulationWindow.EMULATION_MODE_MAX = 10; EmulationWindow.EMULATION_MODES = [ "Edge", "10", "9", "8", "7", "5" ]; Object.defineProperty(EmulationWindow.prototype, "traceWriter", { get: function () { return this._traceWriter; }, enumerable: true, configurable: true }); EmulationWindow.prototype.initializeModel = function () { this._documentMode = EmulationWindow.DEFAULT_VALUE; this._documentModeItems = []; this._browserMode = BrowserMode.Desktop; this._browserModeItems = []; this._browserModeItems[BrowserMode.Desktop] = { value: BrowserMode.Desktop, text: "Default" }; this._browserModeItems[BrowserMode.Phone] = { value: BrowserMode.Phone, text: "Edge" }; this._userAgentString = EmulationWindow.DEFAULT_VALUE; this._userAgentStringItems = []; this._customUserAgentString = ""; this._customUserAgentStringItems = []; this._orientation = Orientation.Landscape; this._orientationItems = []; this._orientationItems[Orientation.Landscape] = { value: Orientation.Landscape, text: "Landscape" }; this._orientationItems[Orientation.Portrait] = { value: Orientation.Portrait, text: "Portrait" }; this._resolution = EmulationWindow.DEFAULT_VALUE; this._resolutionItems = []; this._geolocationState = GeolocationState.Off; this._gpsLatitude = this._config.categories.simulateGPS.off.latitude; this._gpsLongitude = this._config.categories.simulateGPS.off.longitude; }; EmulationWindow.prototype.initializeView = function () { this._localizedControlInfo = [ { controlId: "toolLabel", stringId: "EmulationTitle" }, { controlId: "modeLabel", stringId: "EmulationModeSection" }, { controlId: "documentModeLabel", stringId: "EmulationDocMode", labeledElement: this._documentModeSelector.focusableElement }, { controlId: "browserModeLabel", stringId: "EmulationBrowserMode", labeledElement: this._browserModeSelector.focusableElement }, { controlId: "uaStringLabel", stringId: "EmulationUAString", labeledElement: this._userAgentStringSelector.focusableElement }, { controlId: "enterCustomStringLabel", stringId: "EmulationCustomUAStringInfo" }, { controlId: "customUaStringLabel", stringId: "EmulationCustomUAStringLabel", labeledElement: this._customUserAgentStringInput.focusableElement }, { controlId: "", stringId: "DeleteWatchTooltip", labeledElement: document.getElementById("removeCustomUaStringControlRoot"), describerElementId: "customUaStringLabel" }, { controlId: "displayLabel", stringId: "EmulationDisplaySection" }, { controlId: "orientationLabel", stringId: "EmulationOrientation", labeledElement: this._orientationSelector.focusableElement }, { controlId: "resolutionLabel", stringId: "EmulationResolution", labeledElement: this._resolutionSelector.focusableElement }, { controlId: "enterCustomResolutionLabel", stringId: "EmulationCustomResolution" }, { controlId: "customDisplaySizeLabel", stringId: "EmulationDisplaySize", labeledElement: this._displaySizeInput.focusableElement }, { controlId: "displaySizeInchesLabel", stringId: "EmulationInches" }, { controlId: "customDisplayWidthLabel", stringId: "EmulationWidth", labeledElement: this._displayWidthInput.focusableElement }, { controlId: "widthPixelsLabel", stringId: "EmulationPixels" }, { controlId: "customDisplayHeightLabel", stringId: "EmulationHeight", labeledElement: this._displayHeightInput.focusableElement }, { controlId: "heightPixelsLabel", stringId: "EmulationPixels" }, { controlId: "geoLabel", stringId: "EmulationGeoLocationSection" }, { controlId: "gpsLabel", stringId: "EmulationSimulateGPS" }, { controlId: "gpsOffLabel", stringId: "EmulationGPSOff", labeledElement: this._geolocationOffButton.focusableElement, describerElementId: "gpsLabel" }, { controlId: "gpsOnLabel", stringId: "EmulationGPSOn", labeledElement: this._geolocationOnButton.focusableElement, describerElementId: "gpsLabel" }, { controlId: "gpsOnNoSignalLabel", stringId: "EmulationGPSOnNoSignal", labeledElement: this._geolocationOnNoSignalButton.focusableElement, describerElementId: "gpsLabel" }, { controlId: "latitudeLabel", stringId: "EmulationLatitude", labeledElement: this._gpsLatitudeInput.focusableElement }, { controlId: "longitudeLabel", stringId: "EmulationLongitude", labeledElement: this._gpsLongitudeInput.focusableElement }, ]; this.localizeAllLabels(); this.updateView(); }; EmulationWindow.prototype.formatResolutionInfo = function (resolutioInfo) { var itemText = "" + resolutioInfo.displaySize + "\" " + resolutioInfo.width + " x " + resolutioInfo.height; return itemText; }; EmulationWindow.prototype.localizeAllLabels = function () { for(var i = 0; i < this._localizedControlInfo.length; ++i) { var info = this._localizedControlInfo[i]; this.localizeControl(info.controlId, info.stringId, info.labeledElement, info.describerElementId); } this._documentModeInfoButton.rootElement.setAttribute("title", EmulationWindow.DOCMODE_INFO_LINK); this._browserModeItems[BrowserMode.Desktop].text = toolwindowHelpers.loadString("EmulationModesDesktopMode"); this._browserModeItems[BrowserMode.Phone].text = toolwindowHelpers.loadString("EmulationModesPhoneMode"); this._orientationItems[Orientation.Landscape].text = toolwindowHelpers.loadString("EmulationOrientationLandscape"); this._orientationItems[Orientation.Portrait].text = toolwindowHelpers.loadString("EmulationOrientationPortrait"); this._resolutionItems = [ { value: EmulationWindow.DEFAULT_VALUE, text: toolwindowHelpers.loadString("EmulationDefault") } ]; this._mobileResolutions = []; for(var i = 0; i < this._config.categories.resolution.length; ++i) { var itemInfo = this._config.categories.resolution[i]; var itemText = this.formatResolutionInfo(itemInfo); this._resolutionItems.push({ text: itemText, value: itemText, info: itemInfo }); if(itemInfo.displaySize < EmulationWindow.MAX_MOBILE_SCREEN_SIZE) { this._mobileResolutions.push(itemText); } } this._resolutionItems.push({ value: EmulationWindow.CUSTOM_VALUE, text: toolwindowHelpers.loadString("EmulationCustom") }); }; EmulationWindow.prototype.localizeControl = function (controlId, stringId, labeledElement, describerElementId) { var locString = toolwindowHelpers.loadString(stringId); if(controlId !== "") { document.getElementById(controlId).innerText = locString; } if(typeof labeledElement !== "undefined") { if(controlId !== "") { labeledElement.setAttribute("aria-labelledby", controlId); } else { labeledElement.setAttribute("aria-label", locString); } } if(typeof describerElementId !== "undefined") { labeledElement.setAttribute("aria-describedby", describerElementId); } }; EmulationWindow.prototype.ensureValueIsNumber = function (value) { if(typeof (value) === "string") { return parseInt(value, 10); } else if(typeof (value) === "number") { return value; } throw new Error("Only strings and numbers are supported as arguments"); }; EmulationWindow.prototype.getBrowserModeFromString = function (mode) { if(mode === "Desktop") { return BrowserMode.Desktop; } else if(mode === "Mobile") { return BrowserMode.Phone; } throw new Error("Got unexpected browser mode string: " + mode); }; EmulationWindow.prototype.getStringFromBrowserMode = function (mode) { if(mode === BrowserMode.Desktop) { return "Desktop"; } else if(mode === BrowserMode.Phone) { return "Mobile"; } throw new Error("Got unknown browser mode value"); }; EmulationWindow.prototype.onBrowserModeChanged = function (mode, doneCallback) { var _this = this; var newMode = this.ensureValueIsNumber(mode); if(this._browserMode !== newMode) { this._browserMode = this.ensureValueIsNumber(mode); this.commitBrowserModeSetting(false, function () { _this.commitModeSettings(ModeUpdate.BrowserMode, true, doneCallback); }); } else if(doneCallback) { doneCallback(); } }; EmulationWindow.prototype.commitBrowserModeSetting = function (performRefresh, doneCallback) { this._proxy.callRemote("setBrowserMode", [ this.getStringFromBrowserMode(this._browserMode), this.shouldPerformRefreshes && performRefresh ], doneCallback); }; EmulationWindow.prototype.commitModeSettings = function (updatedSetting, performRefresh, doneCallback) { var _this = this; var onBrowserOrUserAgentSettingDone = function () { _this.updateBrowserViewport(ViewportUpdate.Resolution, doneCallback); _this.updateView(); }; if(updatedSetting === ModeUpdate.BrowserMode) { var commitUaString = true; var newUaString = this._userAgentString; if(this._userAgentString === EmulationWindow.CUSTOM_VALUE) { commitUaString = false; } if(this._browserMode === BrowserMode.Desktop) { newUaString = EmulationWindow.DEFAULT_VALUE; this._resolution = EmulationWindow.DEFAULT_VALUE; } else if(this._browserMode === BrowserMode.Phone && this._mobileUserAgentStrings.length > 0) { newUaString = this._mobileUserAgentStrings[0]; this._resolution = this._mobileResolutions[this._mobileResolutions.length - 1]; } else { throw new Error("BrowserMode was set to an unknown value"); } if(commitUaString) { this._userAgentString = newUaString; this.commitUserAgentStringSetting(performRefresh, onBrowserOrUserAgentSettingDone); } else { onBrowserOrUserAgentSettingDone(); } } else if(updatedSetting === ModeUpdate.UserAgentString) { var commitBrowserMode = true; if(this._userAgentString === EmulationWindow.CUSTOM_VALUE) { commitBrowserMode = false; } else if(this._mobileUserAgentStrings.indexOf(this._userAgentString) < 0) { this._browserMode = BrowserMode.Desktop; this._resolution = EmulationWindow.DEFAULT_VALUE; } else { this._browserMode = BrowserMode.Phone; this._resolution = this._mobileResolutions[this._mobileResolutions.length - 1]; } if(commitBrowserMode) { this.commitBrowserModeSetting(performRefresh, onBrowserOrUserAgentSettingDone); } else { onBrowserOrUserAgentSettingDone(); } } }; EmulationWindow.prototype.onDocumentModeChanged = function (mode, doneCallback) { if(this._documentMode !== mode) { this._documentMode = mode; if(this._documentMode === EmulationWindow.DEFAULT_VALUE) { mode = null; } this._proxy.callRemote("setDocumentModeOverride", [ mode, this.shouldPerformRefreshes ], doneCallback); } else if(doneCallback) { doneCallback(); } }; EmulationWindow.prototype.onDocumentModeInfoClicked = function () { this._hostBridge.openBrowser(EmulationWindow.DOCMODE_INFO_LINK); }; EmulationWindow.prototype.commitUserAgentStringSetting = function (performRefresh, doneCallback) { if(this._userAgentString === EmulationWindow.DEFAULT_VALUE) { this._proxy.callRemote("setUserAgentStringToDefault", [ this.shouldPerformRefreshes && performRefresh ], doneCallback); } else if(this._userAgentString !== EmulationWindow.CUSTOM_VALUE) { this._proxy.callRemote("setCurrentUserAgentString", [ this._userAgentString, this.shouldPerformRefreshes && performRefresh ], doneCallback); } else if(doneCallback) { doneCallback(); } }; EmulationWindow.prototype.onUserAgentStringChanged = function (uaString, doneCallback) { var _this = this; if(this._userAgentString !== uaString) { this._userAgentString = uaString; this.commitUserAgentStringSetting(false, function () { _this.commitModeSettings(ModeUpdate.UserAgentString, true, doneCallback); }); } else if(doneCallback) { doneCallback(); } }; EmulationWindow.prototype.onCustomUserAgentStringChanged = function (uaString, doneCallback) { var _this = this; this._customUserAgentString = uaString; if(uaString !== "") { this._proxy.callRemote("storeAndSetCustomUserAgentString", [ uaString, this.shouldPerformRefreshes ], function (customUaStrings) { _this._customUserAgentStringItems = customUaStrings.map(function (value, index, array) { return { text: value.value, date: value.name }; }); _this.updateView(); if(doneCallback) { doneCallback(); } }); } else if(doneCallback) { doneCallback(); } }; EmulationWindow.prototype.onRemoveCustomUserAgentString = function (doneCallback) { var _this = this; var uaString = this._customUserAgentStringInput.text; this._customUserAgentString = ""; this._proxy.callRemote("removeCustomUserAgentString", [ uaString, this.shouldPerformRefreshes ], function (customUaStrings) { _this._customUserAgentStringItems = customUaStrings.map(function (value, index, array) { return { text: value.value, date: value.name }; }); _this.updateView(); if(doneCallback) { doneCallback(); } }); }; EmulationWindow.prototype.onOrientationChanged = function (orientation, doneCallback) { var newOrientation = this.ensureValueIsNumber(orientation); if(this._orientation !== newOrientation) { this._orientation = newOrientation; this.updateBrowserViewport(ViewportUpdate.Orientation, doneCallback); } else if(doneCallback) { doneCallback(); } }; EmulationWindow.prototype.onResolutionChanged = function (resolution, doneCallback) { if(this._resolution !== resolution) { this._resolution = resolution; this.updateBrowserViewport(ViewportUpdate.Resolution, doneCallback); this.updateView(); } else if(doneCallback) { doneCallback(); } }; EmulationWindow.prototype.getResolutionInfo = function (resolutionValue) { for(var i = 0; i < this._resolutionItems.length; ++i) { if(this._resolutionItems[i].text === resolutionValue) { return this._resolutionItems[i].info; } } throw new Error("Resolution is set to an unknown value"); }; EmulationWindow.prototype.displayWidthHasValidValue = function () { return ((this._displayWidthInput.validationStatus === Emulation.ValidationStatus.Okay) && (this._displayWidthInput.text !== "")); }; EmulationWindow.prototype.displayHeightHasValidValue = function () { return ((this._displayHeightInput.validationStatus === Emulation.ValidationStatus.Okay) && (this._displayHeightInput.text !== "")); }; EmulationWindow.prototype.displayWidthAndHeightHaveValidValues = function () { if(this.displayWidthHasValidValue() && this.displayHeightHasValidValue()) { return true; } else { return false; } }; EmulationWindow.prototype.validateDisplaySize = function (value) { if(value === "") { return { status: Emulation.ValidationStatus.Okay, tooltip: "" }; } var n = parseFloat(value); if(isNaN(n)) { return { status: Emulation.ValidationStatus.Error, tooltip: toolwindowHelpers.loadString("EmulationNonNumericResolutionError") }; } else if(n > 0) { if(this.displayWidthAndHeightHaveValidValues()) { return { status: Emulation.ValidationStatus.Okay, tooltip: "", validatedValue: n }; } else { return { status: Emulation.ValidationStatus.Error, tooltip: toolwindowHelpers.loadString("EmulationNoResolutionError") }; } } else { return { status: Emulation.ValidationStatus.Error, tooltip: toolwindowHelpers.loadString("EmulationResolutionLessThanZeroError") }; } }; EmulationWindow.prototype.validateDisplayDimension = function (value) { if(value === "") { return { status: Emulation.ValidationStatus.Okay, tooltip: "" }; } var n = parseInt(value, 10); if(isNaN(n)) { return { status: Emulation.ValidationStatus.Error, tooltip: toolwindowHelpers.loadString("EmulationNonNumericResolutionError") }; } else if(n > 0) { return { status: Emulation.ValidationStatus.Okay, tooltip: "", validatedValue: n }; } else { return { status: Emulation.ValidationStatus.Error, tooltip: toolwindowHelpers.loadString("EmulationResolutionLessThanZeroError") }; } }; EmulationWindow.prototype.onDisplayDimensionValidationFailure = function () { this._displaySizeInput.tryValidate(); }; EmulationWindow.prototype.getStringFromOrientation = function (orientation) { if(orientation === Orientation.Landscape) { return "landscape"; } else if(orientation === Orientation.Portrait) { return "portrait"; } throw new Error("Got unknown orientation value"); }; EmulationWindow.prototype.onCustomDisplayFieldsCommitted = function (doneCallback) { var orientationString = this.getStringFromOrientation(this._orientation); if(this.displayWidthAndHeightHaveValidValues()) { var displaySizeIsValid = this._displaySizeInput.tryValidate(); if(displaySizeIsValid) { if(this._displaySizeInput.validatedValue) { this._proxy.callRemote("setViewportSize", [ this._displaySizeInput.validatedValue, this._displayWidthInput.validatedValue, this._displayHeightInput.validatedValue, orientationString ], doneCallback); } else { this._proxy.callRemote("setViewportWidthAndHeight", [ this._displayWidthInput.validatedValue, this._displayHeightInput.validatedValue, orientationString ], doneCallback); } } else if(doneCallback) { doneCallback(); } } else { var displaySizeIsValid = this._displaySizeInput.tryValidate(); if(displaySizeIsValid) { if(this.displayWidthHasValidValue()) { this._proxy.callRemote("setViewportWidth", [ this._displayWidthInput.validatedValue, orientationString ], doneCallback); } else if(this.displayHeightHasValidValue()) { this._proxy.callRemote("setViewportHeight", [ this._displayHeightInput.validatedValue, orientationString ], doneCallback); } else if(doneCallback) { doneCallback(); } } else if(doneCallback) { doneCallback(); } } }; EmulationWindow.prototype.onGeolocationStateChanged = function (state, doneCallback) { this._geolocationState = state; var profile = this._config.categories.simulateGPS.off; if(state === GeolocationState.Off) { profile = this._config.categories.simulateGPS.off; } else if(state === GeolocationState.On) { profile = this._config.categories.simulateGPS.on; } else if(state === GeolocationState.OnNoSignal) { profile = this._config.categories.simulateGPS.onWithNoSignal; } else { F12.Tools.Utility.Assert.Fail("Geolocation is set to an invalid state"); } this.setGpsCoordinates(profile.latitude, profile.longitude, doneCallback); }; EmulationWindow.prototype.validateCoordinate = function (value, min, max, rangeErrorString) { if(value === "") { return { status: Emulation.ValidationStatus.Okay, tooltip: "" }; } var n = parseFloat(value); if(isNaN(n)) { return { status: Emulation.ValidationStatus.Error, tooltip: toolwindowHelpers.loadString("EmulationNonNumericResolutionError") }; } else if(n >= min && n <= max) { return { status: Emulation.ValidationStatus.Okay, tooltip: "", validatedValue: n }; } else { return { status: Emulation.ValidationStatus.Error, tooltip: toolwindowHelpers.loadString(rangeErrorString) }; } }; EmulationWindow.prototype.onLatitudeCommitted = function (value) { this._gpsLatitude = value; this.commitGpsCoordinates(); }; EmulationWindow.prototype.onLongitudeCommitted = function (value) { this._gpsLongitude = value; this.commitGpsCoordinates(); }; EmulationWindow.prototype.commitGpsCoordinates = function (doneCallback) { if(this._geolocationState === GeolocationState.Off) { this._proxy.callRemote("clearGpsSettings", [], doneCallback); doneCallback = null; } else { var hasSignal = this._geolocationState === GeolocationState.On; if(this._gpsLatitudeInput.validationStatus === Emulation.ValidationStatus.Okay && this._gpsLongitudeInput.validationStatus === Emulation.ValidationStatus.Okay) { if(typeof this._gpsLatitude !== "undefined" && this._gpsLatitude !== null) { if(typeof this._gpsLongitude !== "undefined" && this._gpsLongitude !== null) { this._proxy.callRemote("setGpsPosition", [ this._gpsLatitude, this._gpsLongitude, hasSignal ], doneCallback); doneCallback = null; } else { this._proxy.callRemote("setGpsLatitude", [ this._gpsLatitude, hasSignal ], doneCallback); doneCallback = null; } } else if(typeof this._gpsLongitude !== "undefined" && this._gpsLongitude !== null) { this._proxy.callRemote("setGpsLongitude", [ this._gpsLongitude, hasSignal ], doneCallback); doneCallback = null; } } else { this._proxy.callRemote("setGpsHasSignal", [ hasSignal ], doneCallback); } } if(doneCallback) { doneCallback(); } }; EmulationWindow.prototype.setGpsCoordinates = function (latitude, longitude, doneCallback) { this._gpsLatitude = latitude; this._gpsLongitude = longitude; this.updateView(); this.commitGpsCoordinates(doneCallback); }; EmulationWindow.prototype.updateBrowserViewport = function (update, doneCallback) { if(this._resolution === EmulationWindow.DEFAULT_VALUE) { if(update === ViewportUpdate.Resolution) { this._proxy.callRemote("resetViewportSizeToDefault", [], doneCallback); } else if(doneCallback) { doneCallback(); } } else if(this._resolution !== EmulationWindow.CUSTOM_VALUE) { var info = this.getResolutionInfo(this._resolution); var width, height; if(this._orientation === Orientation.Landscape) { width = info.width; height = info.height; } else if(this._orientation === Orientation.Portrait) { width = info.height; height = info.width; } else if(this._orientation === Orientation.Unknown) { throw new Error("Orientation is set to an unknown value"); } this._proxy.callRemote("setViewportSize", [ info.displaySize, width, height ], doneCallback); } else { this.onCustomDisplayFieldsCommitted(doneCallback); } }; EmulationWindow.prototype.updateView = function () { this._browserModeSelector.items = this._browserModeItems; this._browserModeSelector.value = this._browserMode; this._documentModeSelector.items = this._documentModeItems; this._documentModeSelector.value = this._documentMode; if(this._userAgentString === EmulationWindow.CUSTOM_VALUE) { this._customUserAgentStringContainer.rootElement.style.display = "block"; } else { this._customUserAgentStringContainer.rootElement.style.display = "none"; } this._userAgentStringSelector.items = this._userAgentStringItems; this._userAgentStringSelector.value = this._userAgentString; this._customUserAgentStringInput.items = this._customUserAgentStringItems.sort(function (a, b) { return b.date.localeCompare(a.date); }); this._customUserAgentStringInput.text = this._customUserAgentString; this._orientationSelector.items = this._orientationItems; this._orientationSelector.value = this._orientation; if(this._resolution === EmulationWindow.CUSTOM_VALUE) { this._customDisplaySizeContainer.rootElement.style.display = "block"; } else { this._customDisplaySizeContainer.rootElement.style.display = "none"; this._displaySizeInput.text = ""; this._displayWidthInput.text = ""; this._displayHeightInput.text = ""; } this._resolutionSelector.items = this._resolutionItems; this._resolutionSelector.value = this._resolution; if(this._geolocationState === GeolocationState.Off) { this._gpsLatitudeInput.disabled = true; this._gpsLongitudeInput.disabled = true; this._geolocationOffButton.checked = true; } else { this._gpsLatitudeInput.disabled = false; this._gpsLongitudeInput.disabled = false; if(this._geolocationState === GeolocationState.On) { this._geolocationOnButton.checked = true; } else { this._geolocationOnNoSignalButton.checked = true; } } this._gpsLatitudeInput.text = this._gpsLatitude !== null && typeof this._gpsLatitude !== "undefined" ? this._gpsLatitude.toString() : ""; if(this._gpsLatitudeInput.tryValidate()) { this._gpsLatitude = this._gpsLatitudeInput.validatedValue; } this._gpsLongitudeInput.text = this._gpsLongitude !== null && typeof this._gpsLatitude !== "undefined" ? this._gpsLongitude.toString() : ""; if(this._gpsLongitudeInput.tryValidate()) { this._gpsLongitude = this._gpsLongitudeInput.validatedValue; } }; EmulationWindow.prototype.onAttach = function () { this._isInitialHandshake = true; this._isAtBreakpoint = this._proxy.atBreakpoint; try { this._hostBridge.start(); this._diagnosticsBridge.loadScriptInProc("../Common/remoteHelpers.js"); this._diagnosticsBridge.loadScriptInProc("remote.js"); this._diagnosticsBridge.loadScriptInProc("remoteMain.js"); } catch (e) { return; } }; EmulationWindow.prototype.onDetach = function () { this._isAtBreakpoint = false; this._currentUrl = ""; this._documentMode = EmulationWindow.DEFAULT_VALUE; this._browserMode = BrowserMode.Desktop; this._userAgentString = EmulationWindow.DEFAULT_VALUE; this._customUserAgentString = ""; this._orientation = Orientation.Landscape; this._resolution = EmulationWindow.DEFAULT_VALUE; this._geolocationState = GeolocationState.Off; this._gpsLatitude = this._config.categories.simulateGPS.off.latitude; this._gpsLongitude = this._config.categories.simulateGPS.off.longitude; }; EmulationWindow.prototype.onBreak = function () { this._isAtBreakpoint = true; }; EmulationWindow.prototype.onRun = function () { this._isAtBreakpoint = false; }; EmulationWindow.prototype.onMessage = function (msg) { var _this = this; window.msWriteProfilerMark("ConsoleWindow:BeginOnMessage"); if(msg.data === "DocumentNotYetReady") { window.setTimeout(function () { try { _this._proxy.remotePort.postMessage("InitializeDocument"); } catch (e) { return; } }, 100); } else if(msg.data.substr(0, 10) === "Handshake:") { var connectionInfo = JSON.parse(msg.data.substring(10)); this.onHandshake(connectionInfo); toolwindowHelpers.codeMarker(toolwindowHelpers.codeMarkers.perfBrowserTools_DiagnosticsToolWindowsConsoleReady); } else { this._proxy.fireCallbacks(msg.data); } window.msWriteProfilerMark("ConsoleWindow:EndOnMessage"); }; EmulationWindow.prototype.makeDefaultDocumentModeText = function (mode) { var defaultModeText = mode + " (" + toolwindowHelpers.loadString("EmulationDefault") + ")"; return defaultModeText; }; EmulationWindow.prototype.onHandshake = function (connectionInfo) { if(this._isInitialHandshake) { this._isInitialHandshake = false; } else { this._displaySizeInput.commitEdits(); this._displayWidthInput.commitEdits(); this._displayHeightInput.commitEdits(); this._gpsLatitudeInput.commitEdits(); this._gpsLongitudeInput.commitEdits(); } var urlChanged = this._currentUrl !== connectionInfo.currentUrl; this._currentUrl = connectionInfo.currentUrl; this._browserMode = this.getBrowserModeFromString(connectionInfo.currentBrowserMode); var defaultDocumentMode; if(connectionInfo.documentModeState.defaultMode > EmulationWindow.EMULATION_MODE_MAX) { defaultDocumentMode = EmulationWindow.EMULATION_MODE_EDGE; } else { defaultDocumentMode = connectionInfo.documentModeState.defaultMode.toString(); } this._documentModeItems = []; for(var i = 0; i < EmulationWindow.EMULATION_MODES.length; ++i) { var mode = EmulationWindow.EMULATION_MODES[i]; if(connectionInfo.documentModeState.overrideMode === defaultDocumentMode || mode !== defaultDocumentMode) { this._documentModeItems.push({ value: mode, text: mode }); } if(mode === defaultDocumentMode) { this._documentModeItems.push({ value: EmulationWindow.DEFAULT_VALUE, text: this.makeDefaultDocumentModeText(mode) }); } } if(connectionInfo.documentModeState.overrideMode !== null) { this._documentMode = connectionInfo.documentModeState.overrideMode; } else { this._documentMode = EmulationWindow.DEFAULT_VALUE; } this._userAgentStringItems = [ { value: EmulationWindow.DEFAULT_VALUE, text: toolwindowHelpers.loadString("EmulationDefault") } ]; this._customUserAgentStringItems = []; this._mobileUserAgentStrings = []; for(var i = 0; i < connectionInfo.allUserAgentStrings.length; ++i) { var uaString = connectionInfo.allUserAgentStrings[i]; if(uaString.category === "custom") { this._customUserAgentStringItems.push({ text: uaString.value, date: uaString.name }); } else { this._userAgentStringItems.push({ value: uaString.value, text: uaString.name }); if(uaString.value.indexOf(EmulationWindow.IEMOBILE_UA_SUBSTRING) >= 0) { this._mobileUserAgentStrings.push(uaString.value); } } } this._userAgentStringItems.push({ value: EmulationWindow.CUSTOM_VALUE, text: toolwindowHelpers.loadString("EmulationCustom") }); var customWasSelected = this._userAgentString === EmulationWindow.CUSTOM_VALUE; if(connectionInfo.currentUserAgentString.category === "custom") { this._userAgentString = EmulationWindow.CUSTOM_VALUE; this._customUserAgentString = connectionInfo.currentUserAgentString.value; } else if(!customWasSelected) { if(connectionInfo.currentUserAgentString.category === "default") { this._userAgentString = EmulationWindow.DEFAULT_VALUE; this._customUserAgentString = ""; } else { this._userAgentString = connectionInfo.currentUserAgentString.value; this._customUserAgentString = ""; } } this.updateView(); }; EmulationWindow.prototype.onError = function (message, file, line, additionalInfo) { }; Object.defineProperty(EmulationWindow.prototype, "shouldPerformRefreshes", { get: function () { return !this._isAtBreakpoint; }, enumerable: true, configurable: true }); EmulationWindow.prototype.setDocumentMode = function (documentMode, doneCallback) { var newMode = this._documentMode; for(var i = 0; i < this._documentModeItems.length; ++i) { if(this._documentModeItems[i].text === documentMode) { newMode = this._documentModeItems[i].value; } } var changedHandler = this._documentModeSelector.valueChanged; this._documentModeSelector.valueChanged = null; this._documentModeSelector.value = newMode; this._documentModeSelector.valueChanged = changedHandler; this.onDocumentModeChanged(newMode, doneCallback); }; EmulationWindow.prototype.getDocumentModeTextFromValue = function (value) { var displayString = "Invalid"; for(var i = 0; i < this._documentModeItems.length; ++i) { if(this._documentModeItems[i].value === value) { displayString = this._documentModeItems[i].text; } } return displayString; }; EmulationWindow.prototype.getDocumentMode = function () { return this.getDocumentModeTextFromValue(this._documentMode); }; EmulationWindow.prototype.getIEDocumentMode = function (callback) { var _this = this; this._proxy.callRemote("getFullDocumentModeState", [], function (state) { var documentMode; if(state.overrideMode !== null) { documentMode = state.overrideMode; } else { documentMode = EmulationWindow.DEFAULT_VALUE; } callback(_this.getDocumentModeTextFromValue(documentMode)); }); }; EmulationWindow.prototype.getIEDefaultDocumentMode = function (callback) { this._proxy.callRemote("getDefaultDocumentMode", [], function (defaultDocumentMode) { callback("" + defaultDocumentMode); }); }; EmulationWindow.prototype.setBrowserMode = function (browserMode, doneCallback) { var foundBrowserMode = false; var newBrowserMode; for(var i = 0; i < this._browserModeItems.length; ++i) { if(this._browserModeItems[i].text === browserMode) { newBrowserMode = this._browserModeItems[i].value; foundBrowserMode = true; } } if(!foundBrowserMode) { throw new Error("Unknown browser mode value"); } var changedHandler = this._browserModeSelector.valueChanged; this._browserModeSelector.valueChanged = null; this._browserModeSelector.value = newBrowserMode; this._browserModeSelector.valueChanged = changedHandler; this.onBrowserModeChanged(newBrowserMode, doneCallback); }; EmulationWindow.prototype.getBrowserMode = function () { return this._browserModeItems[this._browserMode].text; }; EmulationWindow.prototype.getIEBrowserMode = function (callback) { var _this = this; this._proxy.callRemote("getBrowserMode", [], function (browserModeString) { var browserMode = _this.getBrowserModeFromString(browserModeString); var displayString = _this._browserModeItems[browserMode].text; callback(displayString); }); }; EmulationWindow.prototype.setUserAgentString = function (uaString, doneCallback) { uaString = this.sanitizeString(uaString); var foundStringValue = false; var uaStringValue; for(var i = 0; i < this._userAgentStringItems.length; ++i) { if(this._userAgentStringItems[i].text === uaString) { uaStringValue = this._userAgentStringItems[i].value; foundStringValue = true; } } if(!foundStringValue) { throw new Error("Unknown user agent string value"); } var changedHandler = this._userAgentStringSelector.valueChanged; this._userAgentStringSelector.valueChanged = null; this._userAgentStringSelector.value = uaStringValue; this._userAgentStringSelector.valueChanged = changedHandler; this.onUserAgentStringChanged(uaStringValue, doneCallback); }; EmulationWindow.prototype.getUADisplayStringFromUAString = function (uaString) { uaString = this.sanitizeString(uaString); for(var i = 0; i < this._userAgentStringItems.length; ++i) { if(this._userAgentStringItems[i].value === uaString) { return this._userAgentStringItems[i].text; } } for(var i = 0; i < this._customUserAgentStringItems.length; ++i) { if(this._customUserAgentStringItems[i].text === uaString) { return this._customUserAgentStringItems[i].text; } } return this._userAgentStringItems[0].text; }; EmulationWindow.prototype.sanitizeString = function (inputString) { var nullIdx = inputString.indexOf('\0'); if(nullIdx >= 0) { return inputString.substr(0, nullIdx); } return inputString; }; EmulationWindow.prototype.getUserAgentString = function () { return this.getUADisplayStringFromUAString(this._userAgentString); }; EmulationWindow.prototype.getIEUserAgentString = function (callback) { var _this = this; this._proxy.callRemote("getCurrentUserAgentString", [], function (uaString) { callback(_this.getUADisplayStringFromUAString(uaString)); }); }; EmulationWindow.prototype.getAllIEUserAgentStrings = function (callback) { this._proxy.callRemote("getAllUserAgentStrings", [], function (uaStringEntries) { callback(uaStringEntries); }); }; EmulationWindow.prototype.setCustomUserAgentString = function (value, doneCallback) { this.onCustomUserAgentStringChanged(value, doneCallback); }; EmulationWindow.prototype.deleteCustomUserAgentString = function (value, doneCallback) { this._customUserAgentStringInput.text = value; this.onRemoveCustomUserAgentString(doneCallback); }; EmulationWindow.prototype.getCustomUserAgentString = function () { return this._customUserAgentString; }; EmulationWindow.prototype.setOrientation = function (orientation, doneCallback) { var value = Orientation.Unknown; for(var i = 0; i < this._orientationItems.length; ++i) { if(this._orientationItems[i].text.localeCompare(orientation) === 0) { value = this._orientationItems[i].value; break; } } this.onOrientationChanged(value, doneCallback); }; EmulationWindow.prototype.getOrientation = function () { for(var i = 0; i < this._orientationItems.length; ++i) { if(this._orientation === this._orientationItems[i].value) { return this._orientationItems[i].text; } } return "unknown"; }; EmulationWindow.prototype.getIEOrientation = function (callback) { this._proxy.callRemote("getOrientation", [], function (orientation) { callback(orientation); }); }; EmulationWindow.prototype.getResolutionList = function () { var _this = this; return this._config.categories.resolution.map(function (value, index, array) { return { displayString: _this.formatResolutionInfo(value), width: value.width, height: value.height }; }); }; EmulationWindow.prototype.setResolution = function (resolution, doneCallback) { var resolutionValue; for(var i = 0; i < this._resolutionItems.length; ++i) { if(this._resolutionItems[i].text.localeCompare(resolution) === 0) { resolutionValue = this._resolutionItems[i].value; } } this.onResolutionChanged(resolutionValue, doneCallback); }; EmulationWindow.prototype.getResolution = function () { var resolutionText; for(var i = 0; i < this._resolutionItems.length; ++i) { if(this._resolutionItems[i].value.localeCompare(this._resolution) === 0) { resolutionText = this._resolutionItems[i].text; } } return resolutionText; }; EmulationWindow.prototype.getIEResolution = function (callback) { this._proxy.callRemote("getResolution", [], function (resolution) { callback(resolution); }); }; EmulationWindow.prototype.getCustomResolutionDisplaySize = function () { return this._displaySizeInput.text; }; EmulationWindow.prototype.getCustomResolutionWidth = function () { return this._displayWidthInput.text; }; EmulationWindow.prototype.getCustomResolutionHeight = function () { return this._displayHeightInput.text; }; EmulationWindow.prototype.setCustomResolutionDisplaySize = function (value, doneCallback) { this._displaySizeInput.text = value; this._displaySizeInput.tryValidate(); this.onCustomDisplayFieldsCommitted(doneCallback); }; EmulationWindow.prototype.setCustomResolutionWidth = function (value, doneCallback) { this._displayWidthInput.text = value; this._displayWidthInput.tryValidate(); this.onCustomDisplayFieldsCommitted(doneCallback); }; EmulationWindow.prototype.setCustomResolutionHeight = function (value, doneCallback) { this._displayHeightInput.text = value; this._displayHeightInput.tryValidate(); this.onCustomDisplayFieldsCommitted(doneCallback); }; EmulationWindow.prototype.setGpsState = function (enabled, signal, doneCallback) { var state; if(enabled) { if(signal) { state = GeolocationState.On; } else { state = GeolocationState.OnNoSignal; } } else { if(signal) { state = GeolocationState.Unknown; } else { state = GeolocationState.Off; } } this.onGeolocationStateChanged(state, doneCallback); }; EmulationWindow.prototype.getGpsState = function () { if(this._geolocationState === GeolocationState.Off) { return { enabled: false, hasSignal: false }; } else if(this._geolocationState === GeolocationState.On) { return { enabled: true, hasSignal: true }; } else if(this._geolocationState === GeolocationState.OnNoSignal) { return { enabled: true, hasSignal: false }; } else { throw new Error("Gps is set to an unknown state"); } }; EmulationWindow.prototype.setGpsPosition = function (doneCallback, latitude, longitude) { if(latitude !== null && typeof latitude !== "undefined") { this._gpsLatitude = latitude; } if(longitude !== null && typeof longitude !== "undefined") { this._gpsLongitude = longitude; } this.updateView(); this.commitGpsCoordinates(doneCallback); }; EmulationWindow.prototype.getGpsPosition = function () { return { latitude: this._gpsLatitude, longitude: this._gpsLongitude }; }; EmulationWindow.prototype.getIEGpsPosition = function (callback) { this._proxy.callRemote("getGpsPosition", [], callback); }; EmulationWindow.prototype.getDisplaySizeValidationInfo = function () { return this._displaySizeInput.getValidationInfo(); }; EmulationWindow.prototype.getDisplayWidthValidationInfo = function () { return this._displayWidthInput.getValidationInfo(); }; EmulationWindow.prototype.getDisplayHeightValidationInfo = function () { return this._displayHeightInput.getValidationInfo(); }; EmulationWindow.prototype.getGpsLatitudeValidationInfo = function () { return this._gpsLatitudeInput.getValidationInfo(); }; EmulationWindow.prototype.getGpsLongitudeValidationInfo = function () { return this._gpsLongitudeInput.getValidationInfo(); }; return EmulationWindow; })(); Emulation.EmulationWindow = EmulationWindow; })(Tools.Emulation || (Tools.Emulation = {})); var Emulation = Tools.Emulation; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=emulation.js.map // app.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var F12; (function (F12) { (function (Tools) { (function (Emulation) { var EmulationApp = (function (_super) { __extends(EmulationApp, _super); function EmulationApp() { _super.apply(this, arguments); } EmulationApp.prototype.onStartup = function () { var _this = this; window.setImmediate(function () { toolwindowHelpers.registerThemeChange(_this.hostBridge, [ "emulation.css", "../common/toolwindow.css" ], true); }); Plugin.addEventListener("pluginready", function () { _this.emulation = new Emulation.EmulationWindow(_this.hostBridge, _this.diagnosticsBridge); if(_this.onEmulationAppLoaded) { _this.onEmulationAppLoaded(); } }); }; return EmulationApp; })(Common.App); Emulation.EmulationApp = EmulationApp; Emulation.App = new EmulationApp(); })(Tools.Emulation || (Tools.Emulation = {})); var Emulation = Tools.Emulation; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=app.js.map { "profileSelection": "default", "categories": { "resolution": [ { "displaySize": 4.0, "width": 800, "height": 480 }, { "displaySize": 4.3, "width": 800, "height": 480 }, { "displaySize": 4.3, "width": 1280, "height": 720 }, { "displaySize": 4.5, "width": 1280, "height": 768 }, { "displaySize": 10.6, "width": 1024, "height": 768 }, { "displaySize": 10.6, "width": 1366, "height": 768 }, { "displaySize": 10.6, "width": 1920, "height": 1080 }, { "displaySize": 10.6, "width": 2560, "height": 1440 }, { "displaySize": 12.0, "width": 1280, "height": 800 }, { "displaySize": 23.0, "width": 1920, "height": 1080 }, { "displaySize": 27.0, "width": 2560, "height": 1440 } ], "simulateGPS": { "off": { "latitude": null, "longitude": null }, "on": { "latitude": 47.6448, "longitude": -122.2985 }, "onWithNoSignal": { "latitude": null, "longitude": null } } }, "userProfiles": [ { "profileName": "Profile1", "browserProfile": "EmulationModesPhoneMode", "userAgentString": "xxx", "orientation": "EmulationDisplayPortrait", "resolution": { "displaySize": 10.6, "width": 1024, "height": 768 }, "simulateGPS": { "state": "on", "location": { "latitude": 47.6097, "longitude": -122.3331 } } } ] }PNG  IHDRr ߔ pHYs+ cHRMz%u0`:o_FIDATx̖n0?AOZ7 jQc yo o 7ukI,סK$%%⑟yO;(T%gX%pӚUh!/JqO -&RgiM TԞ5/P){x JEpkexw<5w&H t]Hk\ٞp\h`! @;!Uuʗ?a kn l盕P׻Β\ϵ,V(zt AΔc͊f1+L3F} mĞk&|-l4!f1wiά03A|uHVn=<:aumt7۾[>^ܯ;l<9<\7iol1`d+Mg'MZS_Ti7R΀O~&|NIENDB`PNG  IHDRr ߔ pHYs   OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FQIDATxڼMMa9sga42ac(yKBfP,PBd! J!ElXdF,,䵰0Čqϵ\;s_̯y=9Em]PIH C7ˤ-lĴ "b'vHEa|I2r BMq&RrF6W pTlwQg{-NnNq+lÁIJGmֆء9M2Lsp zJ?TЖغ2_n= 0) { var removedString = customUAStrings.splice(uaStringIdx, 1); emulation.userAgentStringManager.removeCustom(removedString[0].name); } var newString = { name: "" + Date.now(), category: "custom", value: uaString }; customUAStrings.push(newString); emulation.userAgentStringManager.addCustom(newString.name, newString.value); customUAStrings = customUAStrings.reverse(); for(var i = 10; i < customUAStrings.length; ++i) { emulation.userAgentStringManager.removeCustom(customUAStrings[i].name); } this.setCurrentUserAgentString(uaString, refresh); }; RemoteEmulation.prototype.removeCustomUserAgentString = function (uaString) { var customUAStrings = this.getCustomUserAgentStrings(); for(var i = 0; i < customUAStrings.length; ++i) { if(customUAStrings[i].value === uaString) { emulation.userAgentStringManager.removeCustom(customUAStrings[i].name); break; } } }; RemoteEmulation.prototype.getCustomUserAgentStrings = function () { return this.getAllUserAgentStrings().filter(function (value, index, array) { return value.category === "custom"; }); }; RemoteEmulation.prototype.setViewportSize = function (diagonalInInches, widthInPx, heightInPx) { emulation.viewport.setDimensions(diagonalInInches, widthInPx, heightInPx); }; RemoteEmulation.prototype.setViewportWidth = function (widthInPx) { emulation.viewport.widthInPx = widthInPx; }; RemoteEmulation.prototype.setViewportHeight = function (heightInPx) { emulation.viewport.heightInPx = heightInPx; }; RemoteEmulation.prototype.resetViewportSizeToDefault = function () { emulation.viewport.restoreOriginalSettings(); }; RemoteEmulation.prototype.getOrientation = function () { return emulation.viewport.orientation; }; RemoteEmulation.prototype.setOrientation = function (orientation) { emulation.viewport.orientation = orientation; }; RemoteEmulation.prototype.getResolution = function () { return { width: emulation.viewport.widthInPx, height: emulation.viewport.heightInPx }; }; RemoteEmulation.prototype.setGpsLatitude = function (value) { emulation.geoLocation.latitude = value; }; RemoteEmulation.prototype.setGpsLongitude = function (value) { emulation.geoLocation.longitude = value; }; RemoteEmulation.prototype.setGpsPosition = function (latitude, longitude) { var altitude = 6.275; var accuracy = 2.0; var altitudeAccuracy = 2.0; var heading = 0; var speed = 0; emulation.geoLocation.setPosition(latitude, longitude, altitude, accuracy, altitudeAccuracy, heading, speed); }; RemoteEmulation.prototype.setGpsHasSignal = function (value) { emulation.geoLocation.hasSignal = value; }; RemoteEmulation.prototype.getGpsPosition = function () { return { latitude: emulation.geoLocation.latitude, longitude: emulation.geoLocation.longitude }; }; RemoteEmulation.prototype.clearGpsSettings = function () { emulation.geoLocation.clearAll(); }; return RemoteEmulation; })(); Emulation.RemoteEmulation = RemoteEmulation; var MessageHandlers = (function () { function MessageHandlers() { } MessageHandlers.prototype.getBrowserMode = function () { return Emulation.EmulationRemoteApp.remoteCode.getBrowserMode(); }; MessageHandlers.prototype.setBrowserMode = function (mode) { Emulation.EmulationRemoteApp.remoteCode.setBrowserMode(mode); }; MessageHandlers.prototype.getDocumentMode = function () { return Emulation.EmulationRemoteApp.remoteCode.getDocumentMode(); }; MessageHandlers.prototype.getDefaultDocumentMode = function () { return Emulation.EmulationRemoteApp.remoteCode.getDefaultDocumentMode(); }; MessageHandlers.prototype.getForceEdgeModeDocumentFamily = function () { return Emulation.EmulationRemoteApp.remoteCode.getForceEdgeModeDocumentFamily(); }; MessageHandlers.prototype.getDocumentModeOverride = function () { return Emulation.EmulationRemoteApp.remoteCode.getDocumentModeOverride(); }; MessageHandlers.prototype.getFullDocumentModeState = function () { return Emulation.EmulationRemoteApp.remoteCode.getFullDocumentModeState(); }; MessageHandlers.prototype.setForceEdgeModeDocumentFamily = function (enabled, refresh) { Emulation.EmulationRemoteApp.remoteCode.setForceEdgeModeDocumentFamily(enabled, refresh); }; MessageHandlers.prototype.setDocumentModeOverride = function (mode, refresh) { Emulation.EmulationRemoteApp.remoteCode.setDocumentModeOverride(mode, refresh); }; MessageHandlers.prototype.getAllUserAgentStrings = function () { return Emulation.EmulationRemoteApp.remoteCode.getAllUserAgentStrings(); }; MessageHandlers.prototype.setCurrentUserAgentString = function (uaString, refresh) { Emulation.EmulationRemoteApp.remoteCode.setCurrentUserAgentString(uaString, refresh); }; MessageHandlers.prototype.getCurrentUserAgentString = function () { return Emulation.EmulationRemoteApp.remoteCode.getCurrentUserAgentString(); }; MessageHandlers.prototype.setUserAgentStringToDefault = function (refresh) { Emulation.EmulationRemoteApp.remoteCode.setUserAgentStringToDefault(refresh); }; MessageHandlers.prototype.storeAndSetCustomUserAgentString = function (uaString, refresh) { Emulation.EmulationRemoteApp.remoteCode.storeAndSetCustomUserAgentString(uaString, refresh); return Emulation.EmulationRemoteApp.remoteCode.getCustomUserAgentStrings(); }; MessageHandlers.prototype.removeCustomUserAgentString = function (uaString, refresh) { Emulation.EmulationRemoteApp.remoteCode.removeCustomUserAgentString(uaString); Emulation.EmulationRemoteApp.remoteCode.setUserAgentStringToDefault(refresh); return Emulation.EmulationRemoteApp.remoteCode.getCustomUserAgentStrings(); }; MessageHandlers.prototype.setViewportSize = function (diagonalInInches, widthInPx, heightInPx, orientation) { Emulation.EmulationRemoteApp.remoteCode.setViewportSize(diagonalInInches, widthInPx, heightInPx); if(orientation) { Emulation.EmulationRemoteApp.remoteCode.setOrientation(orientation); } }; MessageHandlers.prototype.setViewportWidthAndHeight = function (widthInPx, heightInPx, orientation) { Emulation.EmulationRemoteApp.remoteCode.resetViewportSizeToDefault(); Emulation.EmulationRemoteApp.remoteCode.setViewportWidth(widthInPx); Emulation.EmulationRemoteApp.remoteCode.setViewportHeight(heightInPx); Emulation.EmulationRemoteApp.remoteCode.setOrientation(orientation); }; MessageHandlers.prototype.setViewportWidth = function (widthInPx, orientation) { Emulation.EmulationRemoteApp.remoteCode.resetViewportSizeToDefault(); Emulation.EmulationRemoteApp.remoteCode.setViewportWidth(widthInPx); Emulation.EmulationRemoteApp.remoteCode.setOrientation(orientation); }; MessageHandlers.prototype.setViewportHeight = function (heightInPx, orientation) { Emulation.EmulationRemoteApp.remoteCode.resetViewportSizeToDefault(); Emulation.EmulationRemoteApp.remoteCode.setViewportHeight(heightInPx); Emulation.EmulationRemoteApp.remoteCode.setOrientation(orientation); }; MessageHandlers.prototype.resetViewportSizeToDefault = function () { Emulation.EmulationRemoteApp.remoteCode.resetViewportSizeToDefault(); }; MessageHandlers.prototype.getOrientation = function () { return Emulation.EmulationRemoteApp.remoteCode.getOrientation(); }; MessageHandlers.prototype.getResolution = function () { return Emulation.EmulationRemoteApp.remoteCode.getResolution(); }; MessageHandlers.prototype.setGpsLatitude = function (value, hasSignal) { Emulation.EmulationRemoteApp.remoteCode.setGpsHasSignal(hasSignal); Emulation.EmulationRemoteApp.remoteCode.setGpsLatitude(value); }; MessageHandlers.prototype.setGpsLongitude = function (value, hasSignal) { Emulation.EmulationRemoteApp.remoteCode.setGpsHasSignal(hasSignal); Emulation.EmulationRemoteApp.remoteCode.setGpsLongitude(value); }; MessageHandlers.prototype.setGpsPosition = function (latitude, longitude, hasSignal) { Emulation.EmulationRemoteApp.remoteCode.setGpsHasSignal(hasSignal); Emulation.EmulationRemoteApp.remoteCode.setGpsPosition(latitude, longitude); }; MessageHandlers.prototype.getGpsPosition = function () { return Emulation.EmulationRemoteApp.remoteCode.getGpsPosition(); }; MessageHandlers.prototype.setGpsHasSignal = function (value) { Emulation.EmulationRemoteApp.remoteCode.setGpsHasSignal(value); }; MessageHandlers.prototype.clearGpsSettings = function () { Emulation.EmulationRemoteApp.remoteCode.clearGpsSettings(); }; return MessageHandlers; })(); Emulation.MessageHandlers = MessageHandlers; })(Tools.Emulation || (Tools.Emulation = {})); var Emulation = Tools.Emulation; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=remote.js.map var remoteHelpers; var F12; (function (F12) { (function (Tools) { (function (Emulation) { var EmulationRemoteApp = (function () { function EmulationRemoteApp() { } EmulationRemoteApp.main = function main() { EmulationRemoteApp.messageHandlers = new Emulation.MessageHandlers(); remoteHelpers = new Common.RemoteHelpers(EmulationRemoteApp.messageHandlers); EmulationRemoteApp.remoteCode = new Emulation.RemoteEmulation(); EmulationRemoteApp.remoteCode.initialize(); }; return EmulationRemoteApp; })(); Emulation.EmulationRemoteApp = EmulationRemoteApp; })(Tools.Emulation || (Tools.Emulation = {})); var Emulation = Tools.Emulation; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); F12.Tools.Emulation.EmulationRemoteApp.main(); //@ sourceMappingURL=remoteMain.js.map PNG  IHDR@]gAMA|Q cHRMR@}y<s,٩<9SbL!GĈ 3,F0+7T3IlpX"61"H _qW,d ėrIKst.ښAdp&+g]RәY2EE44432PuoJEzg`̉j- -b8o׿M]9La.+-%Mȧg3YះuAxEK i<:ŹPcu*@~(  ]o0 ~y*s7g%9%(3H*@C`-pn VH@ A1 jPA3hA'8΃Kn`Lg` a!2D!H҇ dAP B Byf*z: @]h ~L CUp΅ p%;56< ?" GxG iE>&2 oQEGlQP UFFuzQ7QcYG4G۠t]nB/o'Я1 xb"1I>Lf3bX} *QYvGĩp( &q x)&gsF|7:~@&h!$&B%pH$D.q#xx8F|K!\H$!i.%L";r3EHK-AFCbH$^RSIrdd 3Rx)-))zR#RsiSiT#Wd2Z2n2l2d)EBaQ6S))T UEMSPgeedɆfȞ!4--VJ;N g%K-sɵݖ{'OwO%)P_RRۥEK/+))U<د8䡔TtAiF쨜\|FyZbU)W9.Kw+YUEUOUjꂚZZZCu:C=^\G}VCEO#OE&^WOs^K[+\kV֔vv[]n>z^^u}XROm`m3h01$:fь|:kG23hbabhrT4ߴw3=3Y-s.q_vǂbgբ⃥%߲rJ*֪jAe0JOY6rvvtXLǎl&I']$NϝM.6.\ι"En2nnn[g=,=t٪E2}4\j5loDŽǞ~q=''Z^utv&vvEv >mяN9-{ LOgsΝK?7s>xOL n\x }N}g/]>uɫ,u[dS@u]7ot.<30tKn]p;;SwSyoEVkWɝCzkYzK⳦2\|4ٙg͓;݇⳦gMei3_Ϛ'wgM-ћϚxsYdg 5Oi tZtӢ4hc+N?@E?-:Lk0=Oi tZtӢ4hc+N?@E?-:Lk0=Oi tZtӢ4hc+N?@E?-:Lk0=Oi tZtӢ4hc+N?@E?-:Lk0=Oi tZtӢ4hc+N?@E?-:Lk0=O|YE|`*/Р]c#xQ/2+[*|YE0hX鈿bTa*A JGh/rŨ"k>/W5#Р]c)˸h=dxQE|^ׯ"k>/GvA Rq]{`Oɚ_E|^Bvh/㺢5-FYy9^م2K^uE;=%k>/[*r~Yy9 e0v{J|^Udx*rd`,E{o1ȚUd.4hX2+y)Yy9bT5Țˑ]h.e\WSrŨ"k>/W5#Р]c)˸h=dxQE|^ׯ"k>/GvA Rq]{`Oɚ_E|^Bvh/㺢5-FYy9^م2K^uEz12/.Fbe^W/^. c/㺢}bT/^~be^«02+.Fbe^W/^. c/㺢}bT/^~be^«02+ϑh- ޳rfمű{VV,{86{ʙ%;dž8h/㺢=++g]8[ڽge̲gcCYcql2+ϑh- ޳rfمű{VV,{86{ʙ%;dž8h/㺢=++g]8[ڽge̲gcCYcql2+ϑh- ޳rfمű{VV,{86{ʙ%;dž8h/㺢=++g]8[ڽge̲gcCYcql2+ϑh- ޳rfمű{VV,{86{ʙ%;dž8h/㺢=++g]8[ڽge̲gcCYcql2+qLv)v:$vX;Qć+RĪޙ">)bULF&XE;ɬ--oF_^o" Emulation
      Placholder
       
      Another Placeholder
      TODO
      // // Copyright (C) Microsoft. All rights reserved. // // app.ts var F12; (function (F12) { (function (Tools) { (function (Resources) { var ResourcesApp = (function () { function ResourcesApp() { } ResourcesApp.main = function main() { var externalObj; if(window.parent.getExternalObj) { externalObj = window.parent.getExternalObj(); } else if(window.external) { externalObj = window.external; } var hostBridge; var diagnosticsBridge; if(externalObj.vsBridge) { hostBridge = new Common.IEHostBridge(externalObj); diagnosticsBridge = new Common.IEDiagnosticsBridge(externalObj); } else { hostBridge = new Common.HostBridge(); diagnosticsBridge = new Common.DiagnosticsBridge(); } window.setTimeout(function () { toolwindowHelpers.registerThemeChange(hostBridge, [ "resources.css", "../common/toolwindow.css" ], true); }, 0); window.onload = function () { ResourcesApp.resources = new Resources.ResourcesWindow(hostBridge, diagnosticsBridge); if(ResourcesApp.onResourcesAppLoaded) { ResourcesApp.onResourcesAppLoaded(); } }; }; return ResourcesApp; })(); Resources.ResourcesApp = ResourcesApp; })(Tools.Resources || (Tools.Resources = {})); var Resources = Tools.Resources; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=app.js.map // resources.ts var F12; (function (F12) { (function (Tools) { (function (Resources) { "use strict"; var ResourcesWindow = (function () { function ResourcesWindow(hostBridge, diagnosticsBridge) { var _this = this; toolwindowHelpers.registerErrorComponent("Resources", this.onError.bind(this)); this._proxy = new Proxy(hostBridge, diagnosticsBridge); this._hostBridge = hostBridge; this._diagnosticsBridge = diagnosticsBridge; this.initialize(); this._proxy.initializeProxy(function (msg) { return _this.onMessage(msg); }, function () { return _this.onAttach(); }, function () { return _this.onDetach(); }); toolwindowHelpers.initializeToolWindow(this._hostBridge); } ResourcesWindow.prototype.initialize = function () { }; ResourcesWindow.prototype.attachButtonEvents = function (button, callback) { button.addEventListener("click", function (e) { callback(e); }); button.addEventListener("keydown", function (e) { if(e.keyCode === Common.KeyCodes.ENTER || e.keyCode === Common.KeyCodes.SPACE) { callback(e); } }); }; ResourcesWindow.prototype.onAttach = function () { try { this._diagnosticsBridge.loadScriptInProc("../Common/remoteHelpers.js"); this._diagnosticsBridge.loadScriptInProc("remote.js"); this._diagnosticsBridge.loadScriptInProc("remoteMain.js"); } catch (e) { return; } }; ResourcesWindow.prototype.onDetach = function () { }; ResourcesWindow.prototype.onMessage = function (msg) { var _this = this; window.msWriteProfilerMark("ConsoleWindow:BeginOnMessage"); if(msg.data === "DocumentNotYetReady") { window.setTimeout(function () { try { _this._proxy.remotePort.postMessage("InitializeDocument"); } catch (e) { return; } }, 100); } else { this._proxy.fireCallbacks(msg.data); } window.msWriteProfilerMark("ConsoleWindow:EndOnMessage"); }; ResourcesWindow.prototype.onError = function (message, file, line, additionalInfo) { }; return ResourcesWindow; })(); Resources.ResourcesWindow = ResourcesWindow; })(Tools.Resources || (Tools.Resources = {})); var Resources = Tools.Resources; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=resources.js.map var F12; (function (F12) { (function (Tools) { (function (Resources) { var RemoteResources = (function () { function RemoteResources() { } RemoteResources.prototype.initialize = function () { var _this = this; mainBrowser.addEventListener("BeforeScriptExecute", function (dispatchWindow) { return _this.onBeforeScriptExecute(dispatchWindow); }); remoteHelpers.initialize("ResourcesPort", function () { return _this.initializePage(); }, "__BROWSERTOOLS_RESOURCESTOOLS_ADDED", function () { return _this.onDetach(); }); }; RemoteResources.prototype.initializePage = function () { try { this.addRemotePageFunctions(mainBrowser.document.parentWindow); remoteHelpers.initializeDocumentTries = 0; } catch (e) { this.onDocumentNotReady(); } }; RemoteResources.prototype.onDocumentNotReady = function () { if(remoteHelpers.initializeDocumentTries < remoteHelpers.initializeDocumentMaxTries) { remoteHelpers.initializeDocumentTries++; try { remoteHelpers.port.postMessage("DocumentNotYetReady"); } catch (e) { return; } } else { errorHandler.onErrorHandler("Document timed out", "remote.js", 0); } }; RemoteResources.prototype.onBeforeScriptExecute = function (dispatchWindow) { var realWindow = null; try { realWindow = dispatchWindow.document.parentWindow; } catch (ex) { return; } if(realWindow === mainBrowser.document.parentWindow) { if(remoteHelpers.port) { remoteHelpers.postAllMessages(); } this.initializePage(); } else { } }; RemoteResources.prototype.addRemotePageFunctions = function (realWindow) { realWindow.__BROWSERTOOLS_RESOURCESTOOLS_ADDED = true; }; RemoteResources.prototype.onDetach = function () { remoteHelpers.initializeDocumentTries = 0; try { if(mainBrowser.document.parentWindow.__BROWSERTOOLS_RESOURCESTOOLS_ADDED) { mainBrowser.document.parentWindow.__BROWSERTOOLS_RESOURCESTOOLS_ADDED = null; } } catch (ex) { } }; return RemoteResources; })(); Resources.RemoteResources = RemoteResources; var MessageHandlers = (function () { function MessageHandlers() { } return MessageHandlers; })(); Resources.MessageHandlers = MessageHandlers; })(Tools.Resources || (Tools.Resources = {})); var Resources = Tools.Resources; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); //@ sourceMappingURL=remote.js.map var F12; (function (F12) { (function (Tools) { (function (Resources) { var ResourcesRemoteApp = (function () { function ResourcesRemoteApp() { } ResourcesRemoteApp.main = function main() { ResourcesRemoteApp.messageHandlers = new Resources.MessageHandlers(); ResourcesRemoteApp.remoteHelpers = new Common.RemoteHelpers(ResourcesRemoteApp.messageHandlers); ResourcesRemoteApp.remoteCode = new Resources.RemoteResources(); ResourcesRemoteApp.remoteCode.initialize(); }; return ResourcesRemoteApp; })(); Resources.ResourcesRemoteApp = ResourcesRemoteApp; })(Tools.Resources || (Tools.Resources = {})); var Resources = Tools.Resources; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); F12.Tools.Resources.ResourcesRemoteApp.main(); //@ sourceMappingURL=remoteMain.js.map html, body { width: 100%; height: 100%; margin: 0; padding: 0; } body { -ms-user-select: none; overflow: hidden; background-color: TRANSPARENT; /*[{f12-header-background-color}]*/ } #f12Logo { background-image: url("images/f12Logo.png"); background-position: center; background-repeat: no-repeat; background-size: 32px 32px; width: 100%; height: 32px; } #tabContainer { display: -ms-grid; -ms-grid-columns: 1fr; -ms-grid-rows: auto 1fr auto; width: 100%; height: calc(100% - 32px); text-align: center; } #tabListContainer { -ms-grid-row: 2; overflow: hidden; } #tabList { list-style: none; padding: 0; margin: 0; transition: margin-top 0.2s; } .tabItem { position: relative; padding: 6px 0 6px 0; } .tabItem > .tabSelectedArea { position: absolute; top: 0; left: 0; bottom: 0; right: 0; display: none; background-color: TRANSPARENT; /*[{f12-header-tab-selected-background-color}]*/ } .tabItem:hover { background-color: TRANSPARENT; /*[{f12-header-tab-hover-background-color}]*/ } .tabItem > .tabImage { width: 32px; height: 32px; background-repeat: no-repeat; background-position: -64px 0; background-color: transparent; background-size: 128px 32px; display: inline-block; position: relative; z-index: 1; cursor: pointer; } .tabItem > .tabImage:focus { outline: 1px dotted TRANSPARENT; /*[1px dotted {vs-designer-selection-dots-color}]*/ } .tabItem.tabItemSelected > .tabImage, .tabItem.tabItemSelected > .tabImage:hover { background-position: -96px 0; } .tabItem > .tabImage:hover { background-position: -64px 0; } .tabItem.tabItemDisabled > .tabImage { background-position: -96px 0; } .tabItem.tabItemSelected > .tabSelectedArea { display: inline-block; } .tabNavButton { width: 16px; height: 16px; -ms-grid-column-align: center; background-repeat: no-repeat; background-position: 0 0; } #prevTabButton { -ms-grid-row: 1; background-image: url('Images/prevTab.png'); background-color: TRANSPARENT; /*[{f12-header-background-color}]*/ background-repeat: no-repeat; background-size: 64px 16px; } #nextTabButton { -ms-grid-row: 3; background-image: url('Images/nextTab.png'); background-color: TRANSPARENT; /*[{f12-header-background-color}]*/ background-repeat: no-repeat; background-size: 64px 16px; } .tabNavButton:active { background-position: -16px 0; } .tabNavButton:hover { background-position: -32px 0; } .tabNavButton.tabNavButtonDisabled { background-position: -48px 0; visibility: hidden; } F12 Tools
      // // Copyright (C) Microsoft. All rights reserved. // // tabControl.ts var F12; (function (F12) { (function (Host) { (function (Header) { "use strict"; var TabControl = (function () { function TabControl(createUI) { this._offsetChange = 47; this._tabScrollDelayTime = 200; this._tabListContainer = document.getElementById("tabListContainer"); this._tabList = document.getElementById("tabList"); this._prevTabButton = document.getElementById("prevTabButton"); this._nextTabButton = document.getElementById("nextTabButton"); this._tabElements = []; this._selectedTab = null; this._highlightedTab = null; this._listeners = []; this._overflowOffset = 0; this._lastHeight = 0; this._isInScrollHandler = false; this.initialize(); } TabControl.prototype.initialize = function () { var _this = this; document.addEventListener("keydown", function (e) { var moveTo = null; if(e.keyCode === Common.KeyCodes.ARROW_DOWN) { moveTo = _this._highlightedTab.nextElementSibling; } else if(e.keyCode === Common.KeyCodes.ARROW_UP) { moveTo = _this._highlightedTab.previousElementSibling; } else if(e.keyCode === Common.KeyCodes.SPACE || e.keyCode === Common.KeyCodes.ENTER) { var pluginId = parseInt(_this._highlightedTab.getAttribute("data-pluginId"), 10); if(pluginId > 0) { _this.onTabSelected(pluginId); } } if(moveTo) { _this.highlightTabByElement(moveTo); } }); this._tabScrollDelayTime = (Plugin).F12.getDoubleClickTime() * 0.4; this._prevTabButton.addEventListener("mousedown", function () { return _this.onPrevTabMouseDown(); }); this._prevTabButton.addEventListener("mouseup", function () { return _this.onPrevTabMouseUp(); }); this._nextTabButton.addEventListener("mousedown", function () { return _this.onNextTabMouseDown(); }); this._nextTabButton.addEventListener("mouseup", function () { return _this.onNextTabMouseUp(); }); document.addEventListener("mousewheel", function (e) { return _this.onMouseWheelScroll(e); }); window.addEventListener("resize", function () { return _this.onResize(); }); this._lastHeight = this._tabListContainer.offsetHeight; this.checkOverflowButtons(); }; TabControl.prototype.onPrevTabMouseDown = function () { this.scrollToPrevTab(); this.startPrevTabScroll(); }; TabControl.prototype.startPrevTabScroll = function () { var _this = this; this._isTabScrolling = true; this._tabScrollTimerId = window.setInterval(function () { return _this.scrollToPrevTab(); }, this._tabScrollDelayTime); }; TabControl.prototype.stopPrevTabScroll = function () { window.clearInterval(this._tabScrollTimerId); this._isTabScrolling = false; }; TabControl.prototype.stopAnyPrevTabScroll = function () { if(this._isTabScrolling) { this.stopPrevTabScroll(); } }; TabControl.prototype.onPrevTabMouseUp = function () { this.stopPrevTabScroll(); }; TabControl.prototype.scrollToPrevTab = function () { var newOffset = Math.min(0, this._overflowOffset + this._offsetChange); this.updateOverflowPosition(newOffset); }; TabControl.prototype.onNextTabMouseDown = function () { this.scrollToNextTab(); this.startNextTabScroll(); }; TabControl.prototype.startNextTabScroll = function () { var _this = this; this._isTabScrolling = true; this._tabScrollTimerId = window.setInterval(function () { return _this.scrollToNextTab(); }, this._tabScrollDelayTime); }; TabControl.prototype.stopNextTabScroll = function () { window.clearInterval(this._tabScrollTimerId); this._isTabScrolling = false; }; TabControl.prototype.stopAnyNextTabScroll = function () { if(this._isTabScrolling) { this.stopNextTabScroll(); } }; TabControl.prototype.onNextTabMouseUp = function () { this.stopNextTabScroll(); }; TabControl.prototype.scrollToNextTab = function () { var newOffset = this._overflowOffset - this._offsetChange; this.updateOverflowPosition(newOffset); }; TabControl.prototype.onMouseWheelScroll = function (e) { var scrollValue = (e).wheelDelta; if(isNaN(scrollValue)) { return; } if(scrollValue > 0 && this.isScrollPrevPossible()) { this.scrollToPrevTab(); } else if(scrollValue < 0 && this.isScrollNextPossible()) { this.scrollToNextTab(); } }; TabControl.prototype.onContainerScrolled = function (e) { if(!this._isInScrollHandler) { this._isInScrollHandler = true; var top = this._tabListContainer.scrollTop; this.updateOverflowPosition(0 - top); this._tabListContainer.scrollTop = 0; e.preventDefault(); } else { this._isInScrollHandler = false; } }; TabControl.prototype.onResize = function () { var containerHeight = this._tabListContainer.offsetHeight; var listHeight = this._tabList.offsetHeight; if(containerHeight > this._lastHeight && this._overflowOffset < 0) { if(containerHeight > listHeight) { this.updateOverflowPosition(0); } else if(listHeight + this._overflowOffset < containerHeight) { var delta = containerHeight - this._lastHeight; this.updateOverflowPosition(this._overflowOffset + delta); } } this._lastHeight = containerHeight; this.checkOverflowButtons(); }; TabControl.prototype.highlightTabById = function (pluginId) { if(this._highlightedTab) { this._highlightedTab.classList.remove("tabItemHighlighted"); (this._highlightedTab.querySelector(".tabImage")).setAttribute("tabindex", "-1"); } if(this._tabElements[pluginId]) { this._tabElements[pluginId].classList.add("tabItemHighlighted"); this._highlightedTab = this._tabElements[pluginId]; var highlightedTabImage = (this._highlightedTab.querySelector(".tabImage")); highlightedTabImage.setAttribute("tabindex", "1"); highlightedTabImage.focus(); this.scrollHighlightedTabIntoView(); } }; TabControl.prototype.highlightTabByElement = function (element) { var pluginId = parseInt(element.getAttribute("data-pluginId"), 10); if(pluginId > 0) { this.highlightTabById(pluginId); } }; TabControl.prototype.onTabImageSelected = function (e, pluginId) { this.highlightTabByElement((e.currentTarget).parentElement); this.onTabSelected(pluginId); }; TabControl.prototype.onTabSelected = function (pluginId) { if(this._selectedTab) { this._selectedTab.classList.remove("tabItemSelected"); } this._selectedTab = this._highlightedTab; if(this._selectedTab) { this._selectedTab.classList.add("tabItemSelected"); } for(var i = 0; i < this._listeners.length; i++) { if(this._listeners[i]) { this._listeners[i](pluginId); } } }; TabControl.prototype.scrollHighlightedTabIntoView = function () { var tabRect = this._highlightedTab.getBoundingClientRect(); var tabContainerRect = this._tabListContainer.getBoundingClientRect(); var isTabInView = (tabRect.top > tabContainerRect.top) && (tabRect.bottom < tabContainerRect.bottom); if(!isTabInView) { var children = this._tabList.children; var index = -1; for(var i = 0; i < children.length; i++) { if(children[i] === this._highlightedTab) { index = i; break; } } if(index > -1) { var top = -this._offsetChange * index; if((this._overflowOffset < top) || (this._overflowOffset + this._tabList.offsetHeight > this._tabListContainer.offsetHeight)) { this.updateOverflowPosition(top); } } } }; TabControl.prototype.updateOverflowPosition = function (newOffset) { this._overflowOffset = newOffset; this._tabList.style.marginTop = this._overflowOffset + "px"; this.checkOverflowButtons(); }; TabControl.prototype.isScrollPrevPossible = function () { return this._overflowOffset < 0; }; TabControl.prototype.isScrollNextPossible = function () { var containerHeight = this._tabListContainer.offsetHeight; var listHeight = this._tabList.offsetHeight; return containerHeight < listHeight + this._overflowOffset; }; TabControl.prototype.checkOverflowButtons = function () { if(this.isScrollPrevPossible()) { this._prevTabButton.classList.remove("tabNavButtonDisabled"); } else { this._prevTabButton.classList.add("tabNavButtonDisabled"); this.stopAnyPrevTabScroll(); } if(this.isScrollNextPossible()) { this._nextTabButton.classList.remove("tabNavButtonDisabled"); } else { this._nextTabButton.classList.add("tabNavButtonDisabled"); this.stopAnyNextTabScroll(); } }; Object.defineProperty(TabControl.prototype, "selectedTab", { get: function () { return this._selectedTab; }, enumerable: true, configurable: true }); Object.defineProperty(TabControl.prototype, "selectedTabName", { get: function () { if(this._selectedTab) { return this._selectedTab.getAttribute("data-tabId"); } return ""; }, enumerable: true, configurable: true }); Object.defineProperty(TabControl.prototype, "selectedTabPluginId", { get: function () { if(this._selectedTab) { return parseInt(this._selectedTab.getAttribute("data-pluginId"), 10); } return -1; }, enumerable: true, configurable: true }); TabControl.prototype.addEventListener = function (eventName, callback) { if(eventName === "tabClicked") { this._listeners.push(callback); } }; TabControl.prototype.addTab = function (pluginId, pluginType, scriptId, startFile, tabImageSrc, localizedTooltip) { var _this = this; var tab = document.createElement("li"); tab.setAttribute("data-tabId", scriptId); tab.setAttribute("data-pluginId", "" + pluginId); tab.className = "tabItem"; tab.setAttribute("title", localizedTooltip); tab.setAttribute("aria-label", localizedTooltip); var tabSelectedArea = document.createElement("span"); tabSelectedArea.className = "tabSelectedArea"; tab.appendChild(tabSelectedArea); var tabImage = document.createElement("span"); tabImage.className = "tabImage"; tabImage.style.backgroundImage = "url(" + tabImageSrc + ")"; tabImage.setAttribute("role", "button"); tabImage.setAttribute("aria-label", localizedTooltip); tab.appendChild(tabImage); tabImage.addEventListener("click", function (e) { _this.onTabImageSelected(e, pluginId); }); this._tabElements[pluginId] = tab; this._tabList.appendChild(tab); this.checkOverflowButtons(); }; TabControl.prototype.selectTabById = function (pluginId) { this.highlightTabById(pluginId); this.onTabSelected(pluginId); }; return TabControl; })(); Header.TabControl = TabControl; })(Host.Header || (Host.Header = {})); var Header = Host.Header; })(F12.Host || (F12.Host = {})); var Host = F12.Host; })(F12 || (F12 = {})); //@ sourceMappingURL=tabControl.js.map // header.ts var F12; (function (F12) { (function (Host) { (function (Header) { "use strict"; (function (PluginType) { PluginType._map = []; PluginType.script = 0; PluginType.native = 1; })(Header.PluginType || (Header.PluginType = {})); var PluginType = Header.PluginType; var HeaderControl = (function () { function HeaderControl(dispatch) { var createUI = false; if(!dispatch) { dispatch = (window.external).header; createUI = true; } this._diagOMConnect = null; this._headerDispatch = dispatch; Common.blockBrowserAccelerators(); this.initialize(createUI); } Object.defineProperty(HeaderControl.prototype, "currentTitle", { get: function () { return this._currentTitle; }, enumerable: true, configurable: true }); Object.defineProperty(HeaderControl.prototype, "selectedTabElement", { get: function () { return this._tabControl.selectedTab; }, enumerable: true, configurable: true }); Object.defineProperty(HeaderControl.prototype, "selectedTabName", { get: function () { return this._tabControl.selectedTabName; }, enumerable: true, configurable: true }); Object.defineProperty(HeaderControl.prototype, "selectedTabPluginId", { get: function () { return this._tabControl.selectedTabPluginId; }, enumerable: true, configurable: true }); HeaderControl.prototype.initialize = function (createUI) { var _this = this; this._tabControl = new Header.TabControl(createUI); this._tabControl.addEventListener("tabClicked", function (pluginId) { return _this.onTabSelectedByControl(pluginId); }); this._headerDispatch.addEventListener("tabselected", function (pluginId) { return _this.onTabSelectedByFrame(pluginId); }); this._headerDispatch.addEventListener("windowactivation", function (isActiveWindow) { return _this.onWindowActivation(isActiveWindow); }); this._headerDispatch.addEventListener("togglealwaysrefreshfromserver", function (enable) { return _this.onToggleAlwaysRefreshFromServer(enable); }); if(createUI) { var external = (window.external); external.addEventListener("attach", function () { return _this.onAttach(); }); external.addEventListener("detach", function () { return _this.onDetach(); }); if(external.isAttached) { this.onAttach(); } } this.initializeTabs(); }; HeaderControl.prototype.onAttach = function () { var _this = this; var diagOMEngine = (window.external); diagOMEngine.loadScriptInProc("../common/isDebugBuild.js"); diagOMEngine.loadScriptInProc("../common/assert.js"); diagOMEngine.loadScriptInProc("../common/Remote/rpc.js"); diagOMEngine.loadScriptInProc("../common/remoteHelpers.js"); diagOMEngine.loadScriptInProc("remote/remote.js"); this._diagOMConnect = function (port) { _this._rpc = new F12.Tools.RPC.JsonRPCEndpoint("HEADER_CLIENT", _this.jsonRpcMethodReceive.bind(_this), _this.jsonRpcNotificationReceive.bind(_this), function (data) { port.postMessage(data); }, function (onMessage) { port.addEventListener("message", onMessage); }); }; diagOMEngine.addEventListener("connect", this._diagOMConnect); }; HeaderControl.prototype.onDetach = function () { var diagOMEngine = (window.external); if(this._diagOMConnect) { diagOMEngine.removeEventListener("connect", this._diagOMConnect); } this._rpc = null; this._diagOMConnect = null; }; HeaderControl.prototype.initializeTabs = function () { var initialTabId; var pluginInfos = this._headerDispatch.getPluginInfos(); for(var i = 0; i < pluginInfos.length; i++) { var id = pluginInfos[i].id; var type = pluginInfos[i].type; var scriptId = pluginInfos[i].scriptId; var localizedTooltip = pluginInfos[i].scriptId; var startFile = ""; var tabImageSrc = "images/tabIcon.png"; try { var manifestFile = this._headerDispatch.readManifestFile(scriptId + "/manifest.json"); var manifest = JSON.parse(manifestFile); if(manifest.f12 && manifest.f12.start_url) { startFile = manifest.f12.start_url; } else if(manifest.start_url) { startFile = manifest.start_url; } if(manifest.f12 && manifest.f12.tab_image) { tabImageSrc = "../" + scriptId + "/" + manifest.f12.tab_image; } if(manifest.name) { localizedTooltip = manifest.name; } if(manifest.f12 && typeof manifest.f12.localized_tooltip_id === "number") { var locTooltip = this._headerDispatch.getLocalizedString(manifest.f12.localized_tooltip_id); if(locTooltip) { var index = i + 1; locTooltip = locTooltip.replace("{0}", "(Ctrl+" + index + ")"); localizedTooltip = locTooltip; } } } catch (ex) { } this._tabControl.addTab(id, type, scriptId, startFile, tabImageSrc, localizedTooltip); this._headerDispatch.setTabInfo(id, type, scriptId, startFile); if(!initialTabId) { initialTabId = id; } if(this._headerDispatch.initialTabId === id) { initialTabId = id; } } if(initialTabId) { this._headerDispatch.activateTab(initialTabId); } }; HeaderControl.prototype.onTabSelectedByControl = function (pluginId) { this._headerDispatch.activateTab(pluginId); }; HeaderControl.prototype.onTabSelectedByFrame = function (pluginId) { this._tabControl.selectTabById(pluginId); }; HeaderControl.prototype.jsonRpcMethodCall = function (method, params) { var _this = this; var promise = new Plugin.Promise(function (completed, error) { _this._rpc.jsonRpcMethodCall(method, params, completed, error); }); return promise; }; HeaderControl.prototype.jsonRpcMethodReceive = function (method, params, response) { switch(method) { default: F12.Tools.Utility.Assert.Fail("Unknown method '" + method + "'"); } }; HeaderControl.prototype.onInspectElement = function (elementId) { if(elementId) { (Plugin).F12.setInspectElementId(elementId); } (Plugin).F12.activateTab(5); }; HeaderControl.prototype.jsonRpcNotificationReceive = function (event, params) { switch(event) { case "onDocumentComplete": F12.Tools.Utility.Assert.AreEqual(1, params.length); this.onDocumentComplete(params[0]); break; case "onInspectElement": this.onInspectElement(params[0]); break; default: F12.Tools.Utility.Assert.Fail("Unknown event '" + event + "'"); } }; HeaderControl.prototype.onDocumentComplete = function (href) { this._currentTitle = toolwindowHelpers.createShortenedUrlText(href); this._headerDispatch.notifyPageChanged(this._currentTitle); }; HeaderControl.prototype.onWindowActivation = function (isActiveWindow) { var backgroundColor = ""; if(isActiveWindow) { backgroundColor = Plugin.Theme.getValue("f12-header-background-color"); } else { backgroundColor = Plugin.Theme.getValue("f12-header-background-inactive-color"); } document.body.style.backgroundColor = backgroundColor; }; HeaderControl.prototype.onToggleAlwaysRefreshFromServer = function (enable) { this.jsonRpcMethodCall("toggleAlwaysRefreshFromServer", [ enable ]); }; return HeaderControl; })(); Header.HeaderControl = HeaderControl; })(Host.Header || (Host.Header = {})); var Header = Host.Header; })(F12.Host || (F12.Host = {})); var Host = F12.Host; })(F12 || (F12 = {})); //@ sourceMappingURL=header.js.map // app.ts var F12; (function (F12) { (function (Host) { (function (Header) { "use strict"; var App = (function () { function App() { } App.main = function main() { window.addEventListener("DOMContentLoaded", function () { App.header = new Header.HeaderControl(); }); }; return App; })(); Header.App = App; })(Host.Header || (Host.Header = {})); var Header = Host.Header; })(F12.Host || (F12.Host = {})); var Host = F12.Host; })(F12 || (F12 = {})); //@ sourceMappingURL=app.js.map PNG  IHDR@@iqtEXtSoftwareAdobe ImageReadyqe<fiTXtXML:com.adobe.xmp IDATx왍m0qX 0!@G#ttz YQ`NzB·V8&1K6 % .IW`W23$Q)-N\!xUi,@\H,J.{ [?Osv\>I5Ljm7K%߮Hڇ~bkQ9Ojn9 h]Vfy)}pD%t4LHO9|g9|d*)+ Y$&W|O#hHɗ.[ܣ 'g!U6C֜;(T?+`w>l"_7ǻIENDB`PNG  IHDR "p% pHYs   OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FIDATx @FUqhNhCܤBEQvg`ȾpRLFUԋ0m6gw|/H#ar=gMS% Ǩo L) z^z~=+d\DJ"J%?Wҿ8a5({%Z{P+]"%^w_ ~ox/ߧUͽZU׫-8ÿ*Vl42IENDB`PNG  IHDR "p% pHYs   OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FIDATxK@{X5 mܰ0&"8LU‚D}<_EMZEy l1$\{v$"u?  AIDATx[ 0P#XVE?*B,Js 2^KA 2ouxn؞_o @P@RM`7ߐo[&M .items { margin: 0px; padding: 0px; left: 0px; right: 0px; list-style-type: none; white-space: nowrap; position: absolute; } .scroll.virtualizing-list-view > .items { right: 18px; } .grid { box-sizing: border-box; overflow: hidden; position: relative; } .grid ::selection { background: transparent; } .grid-focus { top: 5px; width: 50%; height: 3px; position: absolute; outline: none; } .grid-canvas { left: 0px; top: 0px; right: 0px; bottom: 0px; overflow: auto; position: absolute; box-sizing: border-box; } .has-header.grid .grid-canvas { top: 33px; } .grid-content-spacer { left: 0px; top: 0px; width: 1px; height: 1px; position: absolute; } .grid-header { left: 0px; top: 0px; height: 2.2em; right: 0px; margin-left: 10px; overflow: hidden; position: absolute; z-index: 6; box-sizing: border-box; } .grid-header-canvas { left: 0px; top: 0px; width: 999999px; bottom: 0px; overflow: hidden; border-bottom-color: transparent; border-bottom-width: 1px; border-bottom-style: solid; position: absolute; box-sizing: border-box; } .grid-header-column { height: 100%; overflow: visible; border-right-color: transparent; border-right-width: 1px; border-right-style: solid; float: left; position: relative; cursor: default; box-sizing: border-box; } .grid-header-column:hover { background-color: TRANSPARENT; /*[{plugin-perftools-grid-header-hover}]*/ } .grid-header-column:hover > .title { color: TRANSPARENT; /*[{plugin-perftools-grid-header-hover-text}]*/ } .grid-header-column:hover .sort-handle { background-position-y: -9px !important; } .grid-header-column > .separator { top: 0px; width: 12px; right: -6px; bottom: 0px; position: absolute; z-index: 6; cursor: e-resize; } .grid-header-column > .sort-handle { height: 9px; margin-left: auto; margin-right: auto; overflow: hidden; right: -5000px; top: 2px; width: 9px; z-index: 3; } .ascending.grid-header-column > .sort-handle { background: url("../Common/images/i_sort_up.png") no-repeat; /*[url({image-sort-up}) no-repeat]*/ background-size: 9px 18px; } .descending.grid-header-column > .sort-handle { background: url("../Common/images/i_sort_down.png") no-repeat; /*[url({image-sort-down}) no-repeat]*/ background-size: 9px 18px; } .grid-header-column > .title { padding: 4px; left: 0px; top: 3px; text-align: left; right: 0px; color: red; /*[{plugin-perftools-grid-header-text}]*/ overflow: hidden; vertical-align: middle; white-space: nowrap; position: absolute; cursor: default; -ms-text-overflow: ellipsis; } .grid-header-column > .indented-title { text-indent: 16px; } .ascending.grid-header-column > .title { } .descending.grid-header-column > .title { } .grid-column-sizing { width: 0px; border-left-color: rgb(204, 204, 204); /*[{plugin-perftools-grid-column-sizer}]*/ border-left-width: 1px; border-left-style: solid; position: absolute; z-index: 5; opacity: 0.5; } .grid-column-moving { padding: 7px 4px 4px; height: 100%; overflow: hidden; vertical-align: middle; white-space: nowrap; position: absolute; z-index: 5; cursor: pointer; -ms-text-overflow: ellipsis; opacity: 0.75; background-color: red !important; } .grid-gutter { left: 0px; top: 0px; width: 30px; height: 50px; overflow: hidden; position: absolute; z-index: 6; } .grid-gutter-canvas { left: 0px; top: 0px; width: 29px; height: 1px; position: absolute; z-index: 5; } .grid-gutter-header { bottom: 0px; left: 0px; position: absolute; top: 0px; width: 20px; z-index: 7; } .grid-gutter-row { height: 1em; overflow: hidden; padding-left: 10px; position: absolute; width: 100%; } .grid-gutter-cell { border: currentColor; cursor: default; display: table-cell; float: left; height: 100%; overflow: hidden; position: absolute; vertical-align: middle; } .grid-gutter-menu { margin: 0px 3px; width: 12px; } .grid-gutter-icon { height: 18px; width: 18px; } .grid-row { margin: 0px 0px 0px 10px; width: 100%; color: rgb(0, 0, 0); /*[{plugin-color}]*/ overflow: hidden; position: absolute; cursor: default; box-sizing: border-box; } .grid-row:hover { color: rgb(0, 0, 0); /*[{plugin-treeview-content-mouseover-color}]*/ background-color: rgb(242, 247, 253); /*[{plugin-treeview-content-mouseover-background-color}]*/ } .grid-row-normal { border: 1px solid transparent; } .grid-row-selected, .grid-row-selected:hover { color: rgb(0, 0, 0); /*[{plugin-treeview-content-selected-color}]*/ background-color: rgb(220, 235, 252); /*[{plugin-treeview-content-selected-background-color}]*/ } .grid-row-selected a { text-decoration: none; } .grid-row-selected a:hover { text-decoration: underline; } .grid-row-selected a:visited { } .grid-row-selected a:active { } .grid-row-selected-blur { color: rgb(0, 0, 0); /*[{plugin-treeview-content-inactive-selected-color}]*/ background-color: rgb(230, 230, 230); /*[{plugin-treeview-content-inactive-selected-background-color}]*/ } .grid-row-drop-active { border-top-color: blue; border-top-width: 2px; border-top-style: solid; } .grid-row-dragging { background-color: rgb(230, 230, 230); } .grid-row-group { width: 100%; color: rgb(0, 0, 0); overflow: hidden; font-weight: bold; border-bottom-color: rgb(240, 240, 240); border-bottom-width: 1px; border-bottom-style: solid; position: absolute; cursor: default; background-color: rgb(255, 255, 255); } .grid-cell { padding: 4px; border: currentColor; width: 100px; text-align: left; text-indent: 2px; overflow: hidden; vertical-align: middle; float: left; display: table-cell; white-space: nowrap; position: relative; cursor: default; -ms-text-overflow: ellipsis; } .grid-cell input[type='checkbox'] { margin: 0px; } .grid-cell-first { width: 100%; height: 100%; text-align: left; overflow: hidden; vertical-align: middle; cursor: default; -ms-text-overflow: ellipsis; } .grid-edit-box { border: none; width: 100%; height: 100%; } .grid-tree-icon { text-indent: 0px; position: absolute; cursor: pointer; } .sample-containers { display: none; } .samples-main { left: 0px; top: 0px; right: 0px; bottom: 0px; overflow: hidden; position: fixed; } .samples-main > .right { left: 200px; top: 0px; right: 0px; bottom: 0px; overflow: auto; position: absolute; } .samples-main > .right .demoview > div { height: 400px; overflow: auto; } var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var Microsoft; (function (Microsoft) { (function (VisualStudio) { (function (DiagnosticsHub) { "use strict"; var QpcTimeProperties = (function () { function QpcTimeProperties(collectionStartTime, frequency) { this._collectionStartTime = collectionStartTime; this._frequency = frequency; } QpcTimeProperties.prototype.getCollectionStartTime = function () { return this._collectionStartTime; }; QpcTimeProperties.prototype.getFrequency = function () { return this._frequency; }; QpcTimeProperties.prototype.convertQpcTimestampToMilliseconds = function (qpcValue) { var twoToThe64 = 18446744073709551616; var originalQpcValue = qpcValue; if(qpcValue < 0) { qpcValue += twoToThe64; } if(qpcValue < 0 || qpcValue > twoToThe64) { throw new Error("Invalid qpcValue:" + originalQpcValue); } var ticks = qpcValue - this._collectionStartTime; if(ticks < 0) { ticks += twoToThe64; } var seconds = ticks / this._frequency; var milliseconds = seconds * 1000.0; return milliseconds; }; QpcTimeProperties.prototype.convertMillisecondsToQpcTimestamp = function (milliseconds) { var twoToThe64 = 18446744073709551616; if(milliseconds < 0) { throw new Error("Invalid milliseconds:" + milliseconds); } var seconds = milliseconds / 1000.0; var ticks = seconds * this._frequency; var qpcValue = ticks + this._collectionStartTime; if(qpcValue >= twoToThe64) { qpcValue -= twoToThe64; } return qpcValue; }; return QpcTimeProperties; })(); DiagnosticsHub.QpcTimeProperties = QpcTimeProperties; (function (Controls) { (function (Charting) { (function (GraphScaleType) { GraphScaleType._map = []; GraphScaleType._map[0] = "Unknown"; GraphScaleType.Unknown = 0; GraphScaleType._map[1] = "Fixed"; GraphScaleType.Fixed = 1; GraphScaleType._map[2] = "Dynamic"; GraphScaleType.Dynamic = 2; GraphScaleType._map[3] = "Expanding"; GraphScaleType.Expanding = 3; })(Charting.GraphScaleType || (Charting.GraphScaleType = {})); var GraphScaleType = Charting.GraphScaleType; (function (ChartFontType) { ChartFontType._map = []; ChartFontType._map[0] = "Foreground"; ChartFontType.Foreground = 0; })(Charting.ChartFontType || (Charting.ChartFontType = {})); var ChartFontType = Charting.ChartFontType; (function (SeriesRenderType) { SeriesRenderType._map = []; SeriesRenderType.Line = 1; SeriesRenderType.Marks = 2; SeriesRenderType.StepLine = 3; })(Charting.SeriesRenderType || (Charting.SeriesRenderType = {})); var SeriesRenderType = Charting.SeriesRenderType; (function (MarkShapeType) { MarkShapeType._map = []; MarkShapeType.Unknown = 0; MarkShapeType.Circles = 1; MarkShapeType.Triangles = 2; MarkShapeType.VerticalLines = 3; MarkShapeType.Squares = 4; })(Charting.MarkShapeType || (Charting.MarkShapeType = {})); var MarkShapeType = Charting.MarkShapeType; (function (SeriesOrderType) { SeriesOrderType._map = []; SeriesOrderType._map[0] = "Sort"; SeriesOrderType.Sort = 0; SeriesOrderType._map[1] = "Remove"; SeriesOrderType.Remove = 1; })(Charting.SeriesOrderType || (Charting.SeriesOrderType = {})); var SeriesOrderType = Charting.SeriesOrderType; (function (ChartAreaType) { ChartAreaType._map = []; ChartAreaType._map[0] = "Background"; ChartAreaType.Background = 0; ChartAreaType._map[1] = "Foreground"; ChartAreaType.Foreground = 1; ChartAreaType._map[2] = "Grid"; ChartAreaType.Grid = 2; ChartAreaType._map[3] = "LegendBackground"; ChartAreaType.LegendBackground = 3; })(Charting.ChartAreaType || (Charting.ChartAreaType = {})); var ChartAreaType = Charting.ChartAreaType; (function (GraphState) { GraphState._map = []; GraphState.None = 0; GraphState.Roll = 1; GraphState.Stop = 2; })(Charting.GraphState || (Charting.GraphState = {})); var GraphState = Charting.GraphState; var Point2d = (function () { function Point2d(x, y, data, isInView, seriesIndex, xTranslate, yTranslate, xPx, yPx) { if (typeof xTranslate === "undefined") { xTranslate = 0; } if (typeof yTranslate === "undefined") { yTranslate = -1; } this.x = x; this.y = y; this.data = data; this.isInView = isInView; this.seriesIndex = seriesIndex; this.xTranslate = xTranslate; this.yTranslate = yTranslate; this.xPx = xPx; this.yPx = yPx; } return Point2d; })(); Charting.Point2d = Point2d; var Padding = (function () { function Padding(left, top, right, bottom) { this.left = left; this.top = top; this.right = right; this.bottom = bottom; } return Padding; })(); Charting.Padding = Padding; var RectangleDimension = (function (_super) { __extends(RectangleDimension, _super); function RectangleDimension(left, top, right, bottom) { _super.call(this, left, top, right, bottom); if(this.left > this.right || this.top > this.bottom) { throw "Invalid rectange size"; } } Object.defineProperty(RectangleDimension.prototype, "width", { get: function () { return this.right - this.left; }, enumerable: true, configurable: true }); Object.defineProperty(RectangleDimension.prototype, "height", { get: function () { return this.bottom - this.top; }, enumerable: true, configurable: true }); return RectangleDimension; })(Padding); Charting.RectangleDimension = RectangleDimension; var MinMax = (function () { function MinMax(min, max) { this.min = min; this.max = max; } return MinMax; })(); Charting.MinMax = MinMax; var ChartColorScheme = (function () { function ChartColorScheme(light, dark) { this._light = "#FF0000"; this._dark = "#FF0000"; this._light = light; this._dark = dark; } Object.defineProperty(ChartColorScheme.prototype, "light", { get: function () { return this._light; }, enumerable: true, configurable: true }); Object.defineProperty(ChartColorScheme.prototype, "dark", { get: function () { return this._dark; }, enumerable: true, configurable: true }); return ChartColorScheme; })(); Charting.ChartColorScheme = ChartColorScheme; var ChartSeries = (function () { function ChartSeries(context, index, legendText, seriesRenderType, counterId, config, markShapeType, colorScheme) { this.colorSchemes = [ new ChartColorScheme("rgba(83, 134, 191, 0.50)", "rgb(83, 134, 191)"), new ChartColorScheme("rgba(167, 148, 50, 0.25)", "rgb(167, 148, 50)"), ]; this.context = context; this.index = index; this.legendText = legendText; this.seriesRenderType = seriesRenderType; this.data = []; this.colorScheme = colorScheme || this.colorSchemes[index]; this.counterId = counterId; this.markShapeType = markShapeType; this.graphConfiguration = config; } ChartSeries.prototype.getStartIndexForView = function () { var query = this.graphConfiguration.data.gridX.min; var seriesPoints = this.data; if(!seriesPoints.length) { return -1; } var maxIndex = seriesPoints.length - 1; var minIndex = 0; var pivotIndex; var pivotValue; while(minIndex <= maxIndex) { pivotIndex = Math.floor((minIndex + maxIndex) / 2); pivotValue = seriesPoints[pivotIndex]; if(pivotValue.x > query) { maxIndex = pivotIndex - 1; } else if(pivotValue.x < query) { minIndex = pivotIndex + 1; } else { break; } } return seriesPoints[pivotIndex].x >= query ? pivotIndex : pivotIndex + 1; }; ChartSeries.prototype.removeInvalidPoints = function () { var finalPoints = this.data; if(finalPoints && finalPoints.length > 0 && finalPoints[0].x < this.graphConfiguration.data.dataTimeRangeStart) { var count = 0; for(var i = 0; i <= finalPoints.length; i++) { if(finalPoints[i].x > this.graphConfiguration.data.dataTimeRangeStart) { break; } count++; } finalPoints.splice(0, count > 0 ? count - 1 : 0); } }; ChartSeries.prototype.getPointsToRender = function (chartRect, drawEntireChart) { var renderedPoints = new Array(); var seriesPoints = this.data; var seriesIndex = this.index; this.removeInvalidPoints(); if(seriesPoints.length > 0) { var startIndex = drawEntireChart ? 0 : seriesPoints.length - 1; var endIndex = seriesPoints.length - 1; var startX = this.graphConfiguration.data.gridX.min; var rangeX = this.graphConfiguration.data.gridRange.x; var endX = this.graphConfiguration.data.gridX.max; var scaleX = chartRect.width / rangeX; if(this.seriesRenderType === SeriesRenderType.Line || this.seriesRenderType === SeriesRenderType.StepLine) { if(startIndex === 0) { if(this.seriesRenderType === SeriesRenderType.Line) { renderedPoints.push(new Point2d(this.graphConfiguration.data.gridX.min, seriesPoints[startIndex].y, null, false, seriesIndex, 0, 0, this.graphConfiguration.style.chartAxisPadding.left, this.getYCoord(seriesPoints[startIndex].y, chartRect.top, chartRect.height))); } else if(this.seriesRenderType === SeriesRenderType.StepLine) { renderedPoints.push(new Point2d(seriesPoints[startIndex].x, this.graphConfiguration.data.gridY.min, null, false, seriesIndex, 0, 0, chartRect.left + (seriesPoints[startIndex].x - startX) * scaleX, this.getYCoord(this.graphConfiguration.data.gridY.min, chartRect.top, chartRect.height))); } } else { startIndex--; } } var x = 0; var y = 0; var startPoint = seriesPoints[startIndex]; var hasMovedToStart = false; for(var i = startIndex; i <= endIndex; i++) { var point = seriesPoints[i]; var pointInView = (point.x >= startX && point.x <= endX); var requiresDrawing = pointInView; point.isInView = pointInView; point.seriesIndex = seriesIndex; if(!requiresDrawing) { if((point.x < startX && i < endIndex && seriesPoints[i + 1].x > startX) || (point.x > endX && i > 0 && seriesPoints[i - 1].x < endX)) { requiresDrawing = true; } } if(requiresDrawing) { x = chartRect.left + (point.x - startX) * scaleX; y = this.getYCoord(point.y, chartRect.top, chartRect.height); point.xPx = Math.floor(x); point.yPx = Math.floor(y); renderedPoints.push(point); } } } return renderedPoints; }; ChartSeries.prototype.getYCoord = function (y, top, height) { return top + ((this.graphConfiguration.data.gridY.max - y) / this.graphConfiguration.data.gridRange.y) * height; }; return ChartSeries; })(); Charting.ChartSeries = ChartSeries; var GraphData = (function () { function GraphData() { this.chartAxisCount = 5; this.chartAxisIncreaseRatio = 1.1; this.scaleForWhiteSpace = 0.05; this.chartDrawFill = true; this.gridX = new MinMax(0, 0); this.gridY = new MinMax(0, 0); this.gridRange = new Point2d(0, 0); this.dataTimeRangeStart = 0; this.graphState = GraphState.None; this.markRerenderTimeRange = 10000; } return GraphData; })(); Charting.GraphData = GraphData; var GraphStyle = (function () { function GraphStyle() { this.chartAxisPadding = new Padding(15, 15, 5, 15); this.legendPadding = new Padding(10, 5, 5, 5); this.legendSize = 8; this.isLegendHidden = false; this.isAxesHidden = false; } return GraphStyle; })(); Charting.GraphStyle = GraphStyle; var GraphConfigurations = (function () { function GraphConfigurations(data, style) { if(!data || !style) { throw Error("Either Data or Style are invalid."); } this.data = data; this.style = style; } return GraphConfigurations; })(); Charting.GraphConfigurations = GraphConfigurations; var Axes = (function () { function Axes(context, config) { this.renderValues = true; this.renderAxes = true; this._context = context; this._chartConfig = config; } Axes.prototype.render = function () { if(this.renderValues === null || this.renderValues === undefined) { this.renderValues = true; } if(this.renderValues) { this.drawChartAxes(); } if(this.renderAxes === null || this.renderAxes === undefined) { this.renderAxes = true; } if(this.renderAxes) { this.drawChartBorder(); } }; Axes.prototype.drawXAxesValue = function (value, offsetY) { this._context.save(); this._context.fillStyle = Plugin.Theme.getValue("plugin-color"); this._context.font = Plugin.Theme.getValue("plugin-font-size") + " " + Plugin.Theme.getValue("plugin-font-family"); this._context.fillText(value, this._chartConfig.style.chartAxisPadding.left - 5, this._chartConfig.style.chartAxisPadding.top + offsetY); this._context.restore(); }; Axes.prototype.drawChartAxes = function () { this._context.fillStyle = Plugin.Theme.getValue("plugin-background-color"); this._context.strokeStyle = Plugin.Theme.getValue("plugin-background-color"); this._context.textAlign = "left"; this.drawXAxesValue(this.convertToUnits(this._chartConfig.data.gridY.max, true), -1 * this._chartConfig.style.legendPadding.bottom); this.drawXAxesValue(this.convertToUnits(this._chartConfig.data.gridY.min), this._chartConfig.style.chartHeight - this._chartConfig.style.legendPadding.top); }; Axes.prototype.drawChartBorder = function () { this._context.save(); this._context.fillStyle = "transparent"; this._context.strokeStyle = Plugin.Theme.getValue("diagnostics-host-border"); this._context.lineWidth = (this._chartConfig.style.chartRect.height < 100 ? 1 : 2); this._context.beginPath(); this._context.moveTo(this._chartConfig.style.chartRect.left - 0.5, this._chartConfig.style.chartRect.top - 0.5); this._context.lineTo(this._chartConfig.style.chartRect.left - 0.5, this._chartConfig.style.chartRect.top - 0.5 + this._chartConfig.style.chartRect.height); this._context.lineTo(this._chartConfig.style.chartRect.left - 0.5 + this._chartConfig.style.chartRect.width, this._chartConfig.style.chartRect.top - 0.5 + this._chartConfig.style.chartRect.height); this._context.stroke(); this._context.restore(); }; Axes.prototype.convertToUnits = function (value, fIncludeUnitsString) { if (typeof fIncludeUnitsString === "undefined") { fIncludeUnitsString = false; } var result = value.toString(); for(var i = 0; i < this._chartConfig.data.units.length; i++) { var units = this._chartConfig.data.units[i]; if(units.FromValue <= value && value <= units.ToValue) { if(units.Divider != 1) { value = value / units.Divider; } var decimals = Math.pow(10, units.Decimals); value = Math.round(value * decimals) / (decimals); result = value.toFixed(units.Decimals); if(fIncludeUnitsString) { result = result + " " + units.Units; } break; } } return result; }; return Axes; })(); Charting.Axes = Axes; var Legend = (function () { function Legend(context, config, series) { this._context = context; this._chartConfig = config; this._series = series; } Legend.prototype.render = function () { this._context.save(); var legendStartX = 0; for(var i = 0; i < this._series.length; i++) { this._context.fillStyle = Plugin.Theme.getValue("plugin-color"); this._context.font = Plugin.Theme.getValue("plugin-font-size") + " " + Plugin.Theme.getValue("plugin-font-family"); var legendTextLength = this._context.measureText(this._series[i].legendText); this._context.textAlign = "left"; legendStartX += legendTextLength.width; this._context.fillText(this._series[i].legendText, this._chartConfig.style.chartWidth - legendStartX, this._chartConfig.style.chartAxisPadding.top - this._chartConfig.style.legendPadding.top); this._context.fillStyle = this._series[i].colorScheme.dark; this._context.strokeStyle = this._series[i].colorScheme.dark; legendStartX += this._chartConfig.style.legendSize + this._chartConfig.style.legendPadding.right; var point = new Point2d(0, 0, null, null, null, 0, 4, this._chartConfig.style.chartWidth - legendStartX, this._chartConfig.style.chartAxisPadding.top - (this._chartConfig.style.legendSize / 2) - this._chartConfig.style.legendPadding.top); if(this._series[i].seriesRenderType === SeriesRenderType.Marks) { if(this._series[i].markShapeType === MarkShapeType.Circles) { Mark.drawCircle(point, this._context, this._chartConfig.style.legendSize); } if(this._series[i].markShapeType === MarkShapeType.Triangles) { Mark.drawTriangle(point, this._context, this._chartConfig.style.legendSize); } if(this._series[i].markShapeType === MarkShapeType.Squares) { Mark.drawSquare(point, this._context, this._chartConfig.style.legendSize); } } if(this._series[i].seriesRenderType === SeriesRenderType.Line || this._series[i].seriesRenderType === SeriesRenderType.StepLine) { this._context.fillRect(this._chartConfig.style.chartWidth - legendStartX - (this._chartConfig.style.legendSize * 1 / 4), this._chartConfig.style.chartAxisPadding.top - (this._chartConfig.style.legendSize * 3 / 4) - this._chartConfig.style.legendPadding.top, this._chartConfig.style.legendSize, this._chartConfig.style.legendSize / 2); } legendStartX += this._chartConfig.style.legendPadding.left; } this._context.restore(); }; return Legend; })(); Charting.Legend = Legend; var Mark = (function () { function Mark() { } Mark.render = function render(markShapeType, point, context, markSize) { if (typeof markSize === "undefined") { markSize = 8; } switch(markShapeType) { case MarkShapeType.Circles: Mark.drawCircle(point, context, markSize); break; case MarkShapeType.Triangles: Mark.drawTriangle(point, context, markSize); break; case MarkShapeType.Squares: Mark.drawSquare(point, context, markSize); break; } ; }; Mark.drawCircle = function drawCircle(point, context, markSize) { var xt = 0; var yt = 0; if(point.xTranslate) { xt = point.xTranslate; } else { point.xTranslate = xt; } if(point.yTranslate) { yt = point.yTranslate; } else { point.yTranslate = yt; } context.save(); context.beginPath(); context.translate(point.xPx + xt, point.yPx + yt); context.arc(0, -1 * markSize / 2, markSize / 2, 0, Math.PI * 2); context.fill(); context.restore(); }; Mark.drawTriangle = function drawTriangle(point, context, markSize) { var xt = 0; var yt = 0; if(point.xTranslate) { xt = point.xTranslate; } else { point.xTranslate = xt; } if(point.yTranslate) { yt = point.yTranslate; } else { point.yTranslate = yt; } context.save(); context.translate(point.xPx + xt, point.yPx + yt); context.beginPath(); context.moveTo(0, -1 * markSize); context.lineTo(-1 * markSize / 2, 0); context.lineTo(markSize / 2, 0); context.closePath(); context.fill(); context.restore(); }; Mark.drawSquare = function drawSquare(point, context, markSize) { var xt = 0; var yt = 0; if(point.xTranslate) { xt = point.xTranslate; } else { point.xTranslate = xt; } if(point.yTranslate) { yt = point.yTranslate; } else { point.yTranslate = yt; } context.save(); context.translate(point.xPx + xt, point.yPx + yt); context.fillRect(-1 * markSize / 2, -1 * markSize, markSize, markSize); context.restore(); }; return Mark; })(); Charting.Mark = Mark; var LineSeries = (function (_super) { __extends(LineSeries, _super); function LineSeries(context, config, index, legendText, seriesRenderType, counterId, markShapeType, colorScheme) { _super.call(this, context, index, legendText, seriesRenderType, counterId, config, markShapeType, colorScheme); } LineSeries.prototype.render = function (drawEntireChart) { var seriesPoints = this.data; this.removeInvalidPoints(); var renderedPoints = this.getPointsToRender(this.graphConfiguration.style.chartRect, drawEntireChart); if(renderedPoints && renderedPoints.length > 0) { this.drawLineFill(renderedPoints, drawEntireChart); this.drawLineSeries(renderedPoints); } }; LineSeries.prototype.drawLineFill = function (renderedPoints, drawEntireChart) { if(renderedPoints.length > 0) { var startIndex = 0; var endIndex = renderedPoints.length - 1; var startX = this.graphConfiguration.data.gridX.min; var rangeX = this.graphConfiguration.data.gridRange.x; var endX = this.graphConfiguration.data.gridX.max; var scaleX = this.graphConfiguration.style.chartRect.width / rangeX; var x = 0; var y = 0; var hasMovedToStart = false; this.context.save(); this.context.beginPath(); var previousPoint = renderedPoints[0]; this.context.rect(this.graphConfiguration.style.chartRect.left, this.graphConfiguration.style.chartRect.top, this.graphConfiguration.style.chartRect.width, this.graphConfiguration.style.chartRect.height); this.context.clip(); this.context.fillStyle = Plugin.Theme.getValue("plugin-background-color"); var xPos = previousPoint.x >= this.graphConfiguration.data.gridX.min ? previousPoint.xPx : this.graphConfiguration.style.chartAxisPadding.left; this.context.fillRect(xPos, this.graphConfiguration.style.chartRect.top, this.graphConfiguration.style.chartWidth - xPos, this.graphConfiguration.style.chartRect.height); this.context.fillStyle = this.colorScheme.light; this.context.strokeStyle = this.colorScheme.dark; this.context.beginPath(); for(var i = startIndex; i <= endIndex; i++) { var point = renderedPoints[i]; if(!hasMovedToStart) { this.context.moveTo(point.xPx, point.yPx); hasMovedToStart = true; } else { this.context.lineTo(point.xPx, point.yPx); } previousPoint = point; } if(this.graphConfiguration.data.chartDrawFill) { var y = this.getYCoord(0, this.graphConfiguration.style.chartRect.top, this.graphConfiguration.style.chartRect.height); this.context.lineTo(point.xPx, y); this.context.lineTo(drawEntireChart ? this.graphConfiguration.style.chartAxisPadding.left : renderedPoints[0].xPx, y); this.context.closePath(); this.context.fill(); } else { this.context.stroke(); } this.context.restore(); } }; LineSeries.prototype.drawLineSeries = function (renderedPoints) { if(renderedPoints.length > 0) { this.context.save(); this.context.beginPath(); if(this.graphConfiguration.data.chartDrawFill) { this.context.lineWidth = (this.graphConfiguration.style.chartRect.height < 100 ? 1 : 2); this.context.strokeStyle = this.colorScheme.dark; this.context.beginPath(); for(var i = 0; i < renderedPoints.length; i++) { var rp = renderedPoints[i]; if(i === 0) { this.context.moveTo(renderedPoints[i].xPx, renderedPoints[i].yPx - 0.5); } else { this.context.lineTo(rp.xPx, Math.round(rp.yPx) - 0.5); } } this.context.stroke(); } this.context.restore(); } }; return LineSeries; })(ChartSeries); Charting.LineSeries = LineSeries; var StepLineSeries = (function (_super) { __extends(StepLineSeries, _super); function StepLineSeries(context, config, index, legendText, seriesRenderType, counterId, markShapeType, colorScheme) { _super.call(this, context, index, legendText, seriesRenderType, counterId, config, markShapeType, colorScheme); } StepLineSeries.prototype.render = function (drawEntireChart) { var seriesPoints = this.data; this.removeInvalidPoints(); var renderedPoints = this.getPointsToRender(this.graphConfiguration.style.chartRect, drawEntireChart); if(renderedPoints && renderedPoints.length > 0) { this.drawLineFill(renderedPoints, drawEntireChart); this.drawLineSeries(renderedPoints); } }; StepLineSeries.prototype.drawLineFill = function (renderedPoints, drawEntireChart) { if(renderedPoints.length > 0) { var startIndex = 0; var endIndex = renderedPoints.length - 1; var startX = this.graphConfiguration.data.gridX.min; var rangeX = this.graphConfiguration.data.gridRange.x; var endX = this.graphConfiguration.data.gridX.max; var scaleX = this.graphConfiguration.style.chartRect.width / rangeX; var x = 0; var y = 0; var hasMovedToStart = false; this.context.save(); this.context.beginPath(); var previousPoint = renderedPoints[0]; this.context.rect(this.graphConfiguration.style.chartRect.left, this.graphConfiguration.style.chartRect.top, this.graphConfiguration.style.chartRect.width, this.graphConfiguration.style.chartRect.height); this.context.clip(); this.context.fillStyle = Plugin.Theme.getValue("plugin-background-color"); var xPos = previousPoint.x >= this.graphConfiguration.data.gridX.min ? previousPoint.xPx : this.graphConfiguration.style.chartAxisPadding.left; this.context.fillRect(xPos, this.graphConfiguration.style.chartRect.top, this.graphConfiguration.style.chartWidth - xPos, this.graphConfiguration.style.chartRect.height); this.context.fillStyle = this.colorScheme.light; this.context.strokeStyle = this.colorScheme.dark; this.context.beginPath(); for(var i = startIndex; i <= endIndex; i++) { var point = renderedPoints[i]; if(!hasMovedToStart) { this.context.moveTo(point.xPx, point.yPx); hasMovedToStart = true; } else { this.context.lineTo(point.xPx, previousPoint.yPx); this.context.lineTo(point.xPx, point.yPx); } previousPoint = point; } if(this.graphConfiguration.data.chartDrawFill) { var y = this.getYCoord(0, this.graphConfiguration.style.chartRect.top, this.graphConfiguration.style.chartRect.height); this.context.lineTo(point.xPx, y); this.context.lineTo(drawEntireChart ? this.graphConfiguration.style.chartAxisPadding.left : renderedPoints[0].xPx, y); this.context.closePath(); this.context.fill(); } else { this.context.stroke(); } this.context.restore(); } }; StepLineSeries.prototype.drawLineSeries = function (renderedPoints) { if(renderedPoints.length > 0) { this.context.save(); this.context.beginPath(); if(this.graphConfiguration.data.chartDrawFill) { this.context.lineWidth = (this.graphConfiguration.style.chartRect.height < 100 ? 1 : 2); this.context.strokeStyle = this.colorScheme.dark; this.context.beginPath(); var previousPoint = null; for(var i = 0; i < renderedPoints.length; i++) { var rp = renderedPoints[i]; if(i === 0) { this.context.moveTo(renderedPoints[i].xPx, renderedPoints[i].yPx - 0.5); } else { var yPos = this.graphConfiguration.style.chartHeight - 0.5; if(previousPoint && previousPoint.yPx) { yPos = Math.round(previousPoint.yPx) - 0.5; } this.context.lineTo(rp.xPx, yPos); this.context.lineTo(rp.xPx, Math.round(rp.yPx) - 0.5); } previousPoint = rp; } this.context.stroke(); } this.context.restore(); } }; return StepLineSeries; })(ChartSeries); Charting.StepLineSeries = StepLineSeries; var MarkSeries = (function (_super) { __extends(MarkSeries, _super); function MarkSeries(context, config, index, legendText, seriesRenderType, counterId, markShapeType, colorScheme) { _super.call(this, context, index, legendText, seriesRenderType, counterId, config, markShapeType, colorScheme); } MarkSeries.prototype.drawCircles = function (renderedPoints) { for(var i = 0; i < renderedPoints.length; i++) { if(renderedPoints[i].isInView) { Mark.drawCircle(renderedPoints[i], this.context, this.graphConfiguration.style.legendSize); } } }; MarkSeries.prototype.drawTriangles = function (renderedPoints) { for(var i = 0; i < renderedPoints.length; i++) { if(renderedPoints[i].isInView) { Mark.drawTriangle(renderedPoints[i], this.context, this.graphConfiguration.style.legendSize); } } }; MarkSeries.prototype.drawSquares = function (renderedPoints) { for(var i = 0; i < renderedPoints.length; i++) { if(renderedPoints[i].isInView) { Mark.drawSquare(renderedPoints[i], this.context, this.graphConfiguration.style.legendSize); } } }; MarkSeries.prototype.render = function (drawEntireChart) { var seriesPoints = this.data; this.removeInvalidPoints(); var renderedPoints = this.getPointsToRender(this.graphConfiguration.style.chartRect, drawEntireChart); if(drawEntireChart && (!renderedPoints || renderedPoints.length <= 0)) { return; } var seriesIndexForColor = -1; var seriesPoints = this.data; if(!drawEntireChart && this.referencePoint) { renderedPoints = []; for(var i = seriesPoints.length - 1; 0 <= i; i--) { var point = seriesPoints[i]; if(point.x <= this.referencePoint.x && point.x > this.referencePoint.x - this.graphConfiguration.data.markRerenderTimeRange && point.x >= this.graphConfiguration.data.gridX.min) { renderedPoints.push(point); } else { break; } } } this.context.fillStyle = this.colorScheme.dark; this.context.strokeStyle = this.colorScheme.dark; switch(this.markShapeType) { case MarkShapeType.Circles: this.drawCircles(renderedPoints); break; case MarkShapeType.Triangles: this.drawTriangles(renderedPoints); break; case MarkShapeType.Squares: this.drawSquares(renderedPoints); break; } }; return MarkSeries; })(ChartSeries); Charting.MarkSeries = MarkSeries; var Graph = (function () { function Graph(config) { this._series = []; this._containerId = config.containerId; this._container = document.getElementById(this._containerId); if(this._container !== null) { while(this._container.childNodes.length > 0) { this._container.removeChild(this._container.firstChild); } this._canvas = document.createElement("canvas"); this._canvas.width = this._container.clientWidth; this._canvas.height = this._container.clientHeight; this._container.appendChild(this._canvas); this._canvas.style.background = Plugin.Theme.getValue("plugin-background-color"); if(!this._container.runtimeStyle.position || this._container.runtimeStyle.position === "static") { this._container.style.position = "relative"; } this._canvas.addEventListener('mousemove', this.onMouseOver.bind(this)); this._canvas.addEventListener('mouseout', this.onMouseOut.bind(this)); this._context = this._canvas.getContext("2d"); this._config = config; this.initialize(); this._axes = new Axes(this._context, this._graphConfiguration); this._legend = new Legend(this._context, this._graphConfiguration, this._series); window.addEventListener("resize", this.onResize.bind(this)); this.onResize(null); this._graphConfiguration.data.graphState = GraphState.Roll; Plugin.Theme.addEventListener("themechanged", this.onThemeChanged.bind(this)); } else { throw "An element with id " + this._containerId + " could not be found"; } } Graph.prototype.onThemeChanged = function (args) { this.render(true); }; Graph.prototype.initialize = function () { this._graphConfiguration = new GraphConfigurations(new GraphData(), new GraphStyle()); this._graphConfiguration.style.isAxesHidden = (this._config.isAxesHidden != null || this._config.isAxesHidden != undefined) ? this._config.isAxesHidden : this._graphConfiguration.style.isAxesHidden; if(this._graphConfiguration.style.isAxesHidden) { this._graphConfiguration.style.chartAxisPadding = new Padding(0, 15, 15, 0); } this._graphConfiguration.style.isLegendHidden = (this._config.isLegendHidden != null || this._config.isLegendHidden != undefined) ? this._config.isLegendHidden : this._graphConfiguration.style.isLegendHidden; if(this._config.logger) { this._graphConfiguration.data.logger = this._config.logger; } else { this._graphConfiguration.data.logger = Microsoft.VisualStudio.DiagnosticsHub.getLogger(); } if(this._config.timeProperties) { this._graphConfiguration.data.timeProperties = new QpcTimeProperties(this._config.timeProperties.CollectionStartTime, this._config.timeProperties.Frequency); } else { this._graphConfiguration.data.timeProperties = new QpcTimeProperties(0, 1000); } if(this._config.windowsZoomLevel) { this._graphConfiguration.style.windowsZoomLevel = this._config.windowsZoomLevel; } else { this._graphConfiguration.style.windowsZoomLevel = { X: 1, Y: 1 }; } this._graphConfiguration.style.chartAxisPadding = new Padding(this._graphConfiguration.style.chartAxisPadding.left * this._graphConfiguration.style.windowsZoomLevel.X, this._graphConfiguration.style.chartAxisPadding.top * this._graphConfiguration.style.windowsZoomLevel.Y, this._graphConfiguration.style.chartAxisPadding.right * this._graphConfiguration.style.windowsZoomLevel.X, this._graphConfiguration.style.chartAxisPadding.bottom * this._graphConfiguration.style.windowsZoomLevel.Y); if(this._config.data.Units) { this._graphConfiguration.data.units = this._config.data.Units; } this._graphConfiguration.data.gridY.min = this._config.data.MinValue; this._graphConfiguration.data.gridY.max = this._config.data.MaxValue; this._graphConfiguration.data.gridRange.y = this._graphConfiguration.data.gridY.max - this._graphConfiguration.data.gridY.min; if(this._config.timeRange) { this._graphConfiguration.data.gridX.min = this._config.timeRange.ViewportTimeRange.Start; this._graphConfiguration.data.gridX.max = this._config.timeRange.ViewportTimeRange.End; this._graphConfiguration.data.gridRange.x = this._graphConfiguration.data.gridX.max - this._graphConfiguration.data.gridX.min; } for(var i = 0; i < this._config.data.Series.length; i++) { this.addSeries(this._config.data.Series[i].Legend, this._config.data.Series[i].SeriesType, this._config.data.Series[i].DataSource.CounterId, this._config.data.Series[i].MarkShapeType); } }; Graph.prototype.onResize = function (evt) { if(this.calculateChartSize()) { this.render(true); if(this._mousePosition) { this.onMouseOver({ mousePosition: this._mousePosition }); } } }; Graph.prototype.calculateChartSize = function () { var isCalculated = false; if(this._container.clientWidth > 0 && this._container.clientHeight > 0) { this._canvas.width = this._container.clientWidth; this._canvas.height = this._container.clientHeight; this._graphConfiguration.style.chartWidth = this._canvas.width - this._graphConfiguration.style.chartAxisPadding.right; this._graphConfiguration.style.chartHeight = this._canvas.height - this._graphConfiguration.style.chartAxisPadding.bottom; isCalculated = true; } return isCalculated; }; Graph.prototype.renderSeries = function (drawEntireChart) { var renderedPoints = new Array(); var lastPoint; for(var seriesIndex = 0; seriesIndex < this._series.length; seriesIndex++) { var series = this._series[seriesIndex]; series.referencePoint = this.lastPointOfEntireSeries; series.render(drawEntireChart); } this._context.save(); this._context.fillStyle = Plugin.Theme.getValue("plugin-background-color"); this._context.fillRect(0, this._graphConfiguration.style.chartRect.top, this._graphConfiguration.style.chartAxisPadding.left, this._graphConfiguration.style.chartRect.height); this._context.restore(); }; Graph.prototype.render = function (drawEntireChart) { if(this._graphConfiguration.style.chartAxisPadding.left <= this._graphConfiguration.style.chartWidth && this._graphConfiguration.style.chartAxisPadding.top <= this._graphConfiguration.style.chartHeight) { if(drawEntireChart) { this.drawChartBackground(); } this._graphConfiguration.style.chartRect = new RectangleDimension(this._graphConfiguration.style.chartAxisPadding.left, this._graphConfiguration.style.chartAxisPadding.top, this._graphConfiguration.style.chartWidth, this._graphConfiguration.style.chartHeight); if(!this._graphConfiguration.style.isLegendHidden && drawEntireChart) { this._legend.render(); } if(this._graphConfiguration.data.graphState === GraphState.Roll) { this.renderSeries(drawEntireChart); } if(!this._graphConfiguration.style.isAxesHidden) { this._axes.renderValues = this._graphConfiguration.data.units && this._graphConfiguration.data.units.length > 0 && drawEntireChart ? true : false; this._axes.render(); } } }; Graph.prototype.drawChartBackground = function () { this._context.fillStyle = Plugin.Theme.getValue("plugin-background-color"); this._context.fillRect(0, 0, this._canvas.width, this._canvas.height); }; Graph.prototype.calculateYRange = function (point) { var drawEntireChart = false; if(this._graphConfiguration.data.gridY.min > point.y) { this._graphConfiguration.data.gridY.min = Math.floor((point.y * this._graphConfiguration.data.chartAxisIncreaseRatio) / this._graphConfiguration.data.chartAxisCount) * this._graphConfiguration.data.chartAxisCount; } if(this._graphConfiguration.data.gridY.max < point.y + Math.ceil(this._graphConfiguration.data.gridY.max * this._graphConfiguration.data.scaleForWhiteSpace)) { this._graphConfiguration.data.gridY.max = Math.ceil((point.y * this._graphConfiguration.data.chartAxisIncreaseRatio) / this._graphConfiguration.data.chartAxisCount) * this._graphConfiguration.data.chartAxisCount; drawEntireChart = true; } this._graphConfiguration.data.gridRange.y = this._graphConfiguration.data.gridY.max - this._graphConfiguration.data.gridY.min; return drawEntireChart; }; Graph.prototype.addSeries = function (legendText, seriesRenderType, counterId, markShapeType) { var newSeries; switch(seriesRenderType) { case SeriesRenderType.Line: newSeries = new LineSeries(this._context, this._graphConfiguration, this._series.length, legendText, seriesRenderType, counterId, markShapeType); break; case SeriesRenderType.StepLine: newSeries = new StepLineSeries(this._context, this._graphConfiguration, this._series.length, legendText, seriesRenderType, counterId, markShapeType); break; case SeriesRenderType.Marks: newSeries = new MarkSeries(this._context, this._graphConfiguration, this._series.length, legendText, seriesRenderType, counterId, markShapeType); break; } ; if(!newSeries) { return; } this._series.push(newSeries); var filledLines = 0; for(var i = 0; i < this._series.length; i++) { if(this._series[i].seriesRenderType === SeriesRenderType.Line || this._series[i].seriesRenderType === SeriesRenderType.StepLine) { filledLines++; if(filledLines >= 2) { this._graphConfiguration.data.chartDrawFill = false; break; } } } }; Graph.prototype.drawToolTip = function (points, mousePosition) { if(!points || points.length === 0) { return; } var pointsWithMessages = []; for(var i = 0; i < points.length; i++) { if(points[i].data) { pointsWithMessages.push(points[i].data); } } var message = ""; var seperator = "
      "; var count = pointsWithMessages.length - 1; while(count >= 0) { message = pointsWithMessages[count] + message; if(count > 0) { message = seperator + message; } count--; } if(message) { this._graphConfiguration.data.logger.debug("x: " + mousePosition.xTranslate + ", y: " + mousePosition.yTranslate); var config = { content: message, resource: message, delay: 0, contentContainsHTML: true }; Plugin.Tooltip.show(config); } }; Graph.prototype.getMousePosition = function (evt) { var rect = this._canvas.getBoundingClientRect(); var root = document.documentElement; var mouseX = evt.clientX - rect.top - root.scrollTop; var mouseY = evt.clientY - rect.left - root.scrollLeft; return new Point2d(mouseX, mouseY, null, null, null, evt.screenX, evt.screenY); }; Graph.prototype.onMouseOver = function (evt) { var mousePos = null; if(evt.mousePosition) { mousePos = evt.mousePosition; } else { mousePos = this.getMousePosition(evt); } this._mousePosition = mousePos; this.onMouseOut(null); var count = 0; if(mousePos.x >= this._graphConfiguration.style.chartAxisPadding.left && mousePos.x <= this._graphConfiguration.style.chartWidth && mousePos.y >= this._graphConfiguration.style.chartAxisPadding.top && mousePos.y <= this._graphConfiguration.style.chartHeight) { var foundPoints = this.getMousePointInsideShape(mousePos); if(!foundPoints || foundPoints.length === 0) { this._foundPoints = null; (Plugin).Tooltip.dismiss(); } else { this.drawCursor(mousePos); } if(this._foundPoints && foundPoints && this._foundPoints.length === foundPoints.length) { for(var i = 0; i < foundPoints.length; i++) { if(this._foundPoints[i].x === foundPoints[i].x && this._foundPoints[i].xPx === foundPoints[i].xPx && this._foundPoints[i].y === foundPoints[i].y && this._foundPoints[i].yPx === foundPoints[i].yPx) { count++; } } } if(count !== foundPoints.length && foundPoints.length > 0) { this._foundPoints = foundPoints; this.drawToolTip(foundPoints, mousePos); } } }; Graph.prototype.onMouseOut = function (evt) { var mDiv = document.getElementById("mDiv"); if(mDiv) { mDiv.style.visibility = "hidden"; } if(this._mousePosition && evt) { this._mousePosition = null; } }; Graph.prototype.drawCursor = function (point) { var mDiv = document.getElementById("mDiv"); if(!mDiv) { mDiv = document.createElement("div"); mDiv.id = "mDiv"; mDiv.style.position = "absolute"; mDiv.style.left = point.x.toString() + "px"; mDiv.style.top = this._graphConfiguration.style.chartAxisPadding.top.toString() + "px"; mDiv.style.height = (this._graphConfiguration.style.chartHeight - this._graphConfiguration.style.chartAxisPadding.top).toString() + "px"; mDiv.style.width = "1px"; mDiv.style.zIndex = "100"; mDiv.style.backgroundColor = Plugin.Theme.getValue("diagnostics-host-graph-cursor"); mDiv.style.visibility = "visible"; this._container.appendChild(mDiv); } else { mDiv.style.left = point.x.toString() + "px"; mDiv.style.top = this._graphConfiguration.style.chartAxisPadding.top.toString() + "px"; mDiv.style.visibility = "visible"; } }; Graph.prototype.getMousePointInsideShape = function (point) { var foundPoints = []; for(var i = 0; i < this._series.length; i++) { if(this._series[i].seriesRenderType === SeriesRenderType.Marks) { var seriesData = this._series[i].data; for(var j = 0; j < seriesData.length; j++) { var renderedPoint = seriesData[j]; if(renderedPoint.x >= this._graphConfiguration.data.gridX.min && renderedPoint.x <= this._graphConfiguration.data.gridX.max && renderedPoint.xPx && point.x >= renderedPoint.xPx - (this._graphConfiguration.style.legendSize / 2) - 1 && point.x < renderedPoint.xPx + (this._graphConfiguration.style.legendSize / 2) + 1 && point.y <= this._graphConfiguration.style.chartHeight && point.y >= this._graphConfiguration.style.chartAxisPadding.top) { foundPoints.push(renderedPoint); } } } } return foundPoints; }; Object.defineProperty(Graph.prototype, "lastPointOfEntireSeries", { get: function () { var validSeries = []; var min = null; for(var i = 0; i < this._series.length; i++) { if(this._series[i].data && this._series[i].data.length > 0) { var temp = this._series[i].data[this._series[i].data.length - 1]; if(min) { if(min.x > temp.x) { min = temp; } } else { min = temp; } } } return min; }, enumerable: true, configurable: true }); Graph.prototype.setTimeRange = function (timeRange) { var drawEntireChart = false; if(this._graphConfiguration.data.gridX.max != timeRange.ViewportTimeRange.End || this._graphConfiguration.data.gridX.min != timeRange.ViewportTimeRange.Start) { drawEntireChart = true; this.calculateChartSize(); this._graphConfiguration.data.gridX.min = timeRange.ViewportTimeRange.Start; this._graphConfiguration.data.gridX.max = timeRange.ViewportTimeRange.End; this._graphConfiguration.data.gridRange.x = this._graphConfiguration.data.gridX.max - this._graphConfiguration.data.gridX.min; } this._graphConfiguration.data.dataTimeRangeStart = timeRange.DataTimeRange.Start; if(this._graphConfiguration.data.graphState === GraphState.Roll) { var seriesIndex = -1; for(var i = 0; i < this._series.length; i++) { if(this._series[i].seriesRenderType === SeriesRenderType.StepLine) { seriesIndex = i; break; } } if(seriesIndex >= 0 && this._series[seriesIndex].seriesRenderType === SeriesRenderType.StepLine && timeRange.DataTimeRange.End) { var y = this._graphConfiguration.style.chartHeight; if(this._series[seriesIndex].data && this._series[seriesIndex].data.length > 0) { y = this._series[seriesIndex].data[this._series[seriesIndex].data.length - 1].y; } this._series[seriesIndex].data.push(new Point2d(timeRange.DataTimeRange.End, y)); this.render(drawEntireChart); this._series[seriesIndex].data.pop(); } else { this.render(drawEntireChart); } if(this._mousePosition) { this.onMouseOver({ mousePosition: this._mousePosition }); } } }; Graph.prototype.setGraphState = function (graphState) { this._graphConfiguration.data.graphState = graphState; }; Graph.prototype.addPointToSeries = function (counterId, timestamp, value, tooltip) { var milliseconds = this._graphConfiguration.data.timeProperties.convertQpcTimestampToMilliseconds(timestamp); var seriesData; for(var i = 0; i < this._series.length; i++) { if(this._series[i].counterId === counterId) { seriesData = this._series[i].data; } } if(!seriesData) { throw Error("Invalid counterId"); } if(seriesData.length > 0) { if(seriesData[seriesData.length - 1].x >= milliseconds) { return; } } var newPoint = new Point2d(milliseconds, value, tooltip); seriesData.push(newPoint); var drawEntireChart = this.calculateYRange(newPoint); if(this._graphConfiguration.data.graphState === GraphState.Roll) { this.render(drawEntireChart); if(this._mousePosition) { this.onMouseOver({ mousePosition: this._mousePosition }); } } }; return Graph; })(); Charting.Graph = Graph; })(Controls.Charting || (Controls.Charting = {})); var Charting = Controls.Charting; })(DiagnosticsHub.Controls || (DiagnosticsHub.Controls = {})); var Controls = DiagnosticsHub.Controls; })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {})); var DiagnosticsHub = VisualStudio.DiagnosticsHub; })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {})); var VisualStudio = Microsoft.VisualStudio; })(Microsoft || (Microsoft = {})); var Microsoft; (function (Microsoft) { (function (VisualStudio) { (function (DiagnosticsHub) { (function (Common) { "use strict"; var QpcTimeProperties = (function () { function QpcTimeProperties(collectionStartTime, frequency) { this._collectionStartTime = collectionStartTime; this._frequency = frequency; } QpcTimeProperties.prototype.getCollectionStartTime = function () { return this._collectionStartTime; }; QpcTimeProperties.prototype.getFrequency = function () { return this._frequency; }; QpcTimeProperties.prototype.convertQpcTimestampToMilliseconds = function (qpcValue) { var twoToThe64 = 18446744073709551616; var originalQpcValue = qpcValue; if(qpcValue < 0) { qpcValue += twoToThe64; } if(qpcValue < 0 || qpcValue > twoToThe64) { throw new Error("Invalid qpcValue:" + originalQpcValue); } var ticks = qpcValue - this._collectionStartTime; if(ticks < 0) { ticks += twoToThe64; } var seconds = ticks / this._frequency; var milliseconds = seconds * 1000.0; return milliseconds; }; QpcTimeProperties.prototype.convertMillisecondsToQpcTimestamp = function (milliseconds) { var twoToThe64 = 18446744073709551616; if(milliseconds < 0) { throw new Error("Invalid milliseconds:" + milliseconds); } var seconds = milliseconds / 1000.0; var ticks = seconds * this._frequency; var qpcValue = ticks + this._collectionStartTime; if(qpcValue >= twoToThe64) { qpcValue -= twoToThe64; } return qpcValue; }; return QpcTimeProperties; })(); Common.QpcTimeProperties = QpcTimeProperties; })(DiagnosticsHub.Common || (DiagnosticsHub.Common = {})); var Common = DiagnosticsHub.Common; })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {})); var DiagnosticsHub = VisualStudio.DiagnosticsHub; })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {})); var VisualStudio = Microsoft.VisualStudio; })(Microsoft || (Microsoft = {})); var Microsoft; (function (Microsoft) { (function (VisualStudio) { (function (DiagnosticsHub) { (function (Common) { var Publisher = (function () { function Publisher(events) { this._events = { }; this._listeners = { }; if(events && events.length > 0) { for(var i = 0; i < events.length; i++) { var type = events[i]; if(type) { this._events[type] = type; } } } else { throw Error("Events are null or empty."); } } Publisher.prototype.addEventListener = function (eventType, func) { if(eventType && func) { var type = this._events[eventType]; if(type) { var callbacks = this._listeners[type] ? this._listeners[type] : this._listeners[type] = []; callbacks.push(func); } } }; Publisher.prototype.removeEventListener = function (eventType, func) { if(eventType && func) { var callbacks = this._listeners[eventType]; if(callbacks) { for(var i = 0; i < callbacks.length; i++) { if(func === callbacks[i]) { callbacks.splice(i, 1); break; } } } } }; Publisher.prototype.invokeListener = function (args) { if(args.type) { var callbacks = this._listeners[args.type]; if(callbacks) { for(var i = 0; i < callbacks.length; i++) { var func = callbacks[i]; if(func) { func(args); } } } } }; return Publisher; })(); Common.Publisher = Publisher; })(DiagnosticsHub.Common || (DiagnosticsHub.Common = {})); var Common = DiagnosticsHub.Common; })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {})); var DiagnosticsHub = VisualStudio.DiagnosticsHub; })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {})); var VisualStudio = Microsoft.VisualStudio; })(Microsoft || (Microsoft = {})); var Microsoft; (function (Microsoft) { (function (VisualStudio) { (function (DiagnosticsHub) { (function (Common) { var TimeStamp = (function () { function TimeStamp(nsec) { if (typeof nsec === "undefined") { nsec = 0; } this._nsec = nsec; } TimeStamp.nanoSecInMillSec = 1000 * 1000; TimeStamp.nanoSecInSec = 1000 * 1000 * 1000; Object.defineProperty(TimeStamp.prototype, "nsec", { get: function () { return this._nsec; }, enumerable: true, configurable: true }); Object.defineProperty(TimeStamp.prototype, "msec", { get: function () { return this._nsec / TimeStamp.nanoSecInMillSec; }, enumerable: true, configurable: true }); Object.defineProperty(TimeStamp.prototype, "sec", { get: function () { return this._nsec / TimeStamp.nanoSecInSec; }, enumerable: true, configurable: true }); TimeStamp.fromNanoseconds = function fromNanoseconds(nsec) { return new TimeStamp(nsec); }; TimeStamp.fromMilliseconds = function fromMilliseconds(msec) { return new TimeStamp(msec * TimeStamp.nanoSecInMillSec); }; TimeStamp.fromSeconds = function fromSeconds(sec) { return new TimeStamp(sec * TimeStamp.nanoSecInSec); }; TimeStamp.prototype.equals = function (other) { return this._nsec === other.nsec; }; return TimeStamp; })(); Common.TimeStamp = TimeStamp; var TimeSpan = (function () { function TimeSpan(begin, end) { if (typeof begin === "undefined") { begin = new TimeStamp(); } if (typeof end === "undefined") { end = new TimeStamp(); } this._begin = begin; this._end = end; if(this._begin.nsec > this._end.nsec) { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1000")); } } Object.defineProperty(TimeSpan.prototype, "begin", { get: function () { return this._begin; }, enumerable: true, configurable: true }); Object.defineProperty(TimeSpan.prototype, "end", { get: function () { return this._end; }, enumerable: true, configurable: true }); Object.defineProperty(TimeSpan.prototype, "elapsed", { get: function () { return new TimeStamp(this._end.nsec - this.begin.nsec); }, enumerable: true, configurable: true }); TimeSpan.prototype.equals = function (other) { return this.begin.equals(other.begin) && this.end.equals(other.end); }; return TimeSpan; })(); Common.TimeSpan = TimeSpan; })(DiagnosticsHub.Common || (DiagnosticsHub.Common = {})); var Common = DiagnosticsHub.Common; })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {})); var DiagnosticsHub = VisualStudio.DiagnosticsHub; })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {})); var VisualStudio = Microsoft.VisualStudio; })(Microsoft || (Microsoft = {})); var Microsoft; (function (Microsoft) { (function (VisualStudio) { (function (DiagnosticsHub) { var SeriesType = (function () { function SeriesType() { } Object.defineProperty(SeriesType, "Line", { get: function () { return "Line"; }, enumerable: true, configurable: true }); Object.defineProperty(SeriesType, "StepLine", { get: function () { return "StepLine"; }, enumerable: true, configurable: true }); Object.defineProperty(SeriesType, "Mark", { get: function () { return "Mark"; }, enumerable: true, configurable: true }); return SeriesType; })(); DiagnosticsHub.SeriesType = SeriesType; (function (GraphState) { GraphState._map = []; GraphState.None = 0; GraphState.Roll = 1; GraphState.Stop = 2; })(DiagnosticsHub.GraphState || (DiagnosticsHub.GraphState = {})); var GraphState = DiagnosticsHub.GraphState; (function (GraphBehaviourType) { GraphBehaviourType._map = []; GraphBehaviourType.None = 0; GraphBehaviourType.Live = 1; GraphBehaviourType.PostMortem = 2; })(DiagnosticsHub.GraphBehaviourType || (DiagnosticsHub.GraphBehaviourType = {})); var GraphBehaviourType = DiagnosticsHub.GraphBehaviourType; var SwimlaneEvents = (function () { function SwimlaneEvents() { } Object.defineProperty(SwimlaneEvents, "Filter", { get: function () { return "filterTimeRange"; }, enumerable: true, configurable: true }); Object.defineProperty(SwimlaneEvents, "Graph", { get: function () { return "graphEvent"; }, enumerable: true, configurable: true }); Object.defineProperty(SwimlaneEvents, "Visibility", { get: function () { return "graphVisibility"; }, enumerable: true, configurable: true }); return SwimlaneEvents; })(); DiagnosticsHub.SwimlaneEvents = SwimlaneEvents; var GraphEvents = (function () { function GraphEvents() { } Object.defineProperty(GraphEvents, "HeaderInfoChanged", { get: function () { return "headerInfoChange"; }, enumerable: true, configurable: true }); Object.defineProperty(GraphEvents, "LegendInfoChanged", { get: function () { return "legendInfoChanged"; }, enumerable: true, configurable: true }); Object.defineProperty(GraphEvents, "ScaleInfoChanged", { get: function () { return "scaleInfoChanged"; }, enumerable: true, configurable: true }); return GraphEvents; })(); DiagnosticsHub.GraphEvents = GraphEvents; (function (AxisPositionType) { AxisPositionType._map = []; AxisPositionType.top = 0; AxisPositionType.middle = 1; AxisPositionType.bottom = 2; })(DiagnosticsHub.AxisPositionType || (DiagnosticsHub.AxisPositionType = {})); var AxisPositionType = DiagnosticsHub.AxisPositionType; (function (ScaleType) { ScaleType._map = []; ScaleType.Left = 0; ScaleType.Right = 1; })(DiagnosticsHub.ScaleType || (DiagnosticsHub.ScaleType = {})); var ScaleType = DiagnosticsHub.ScaleType; (function (GraphType) { GraphType._map = []; GraphType.Unknown = 0; GraphType.Standard = 1; GraphType.Custom = 2; })(DiagnosticsHub.GraphType || (DiagnosticsHub.GraphType = {})); var GraphType = DiagnosticsHub.GraphType; var TitleEvents = (function () { function TitleEvents() { } Object.defineProperty(TitleEvents, "Click", { get: function () { return "click"; }, enumerable: true, configurable: true }); Object.defineProperty(TitleEvents, "KeyPress", { get: function () { return "keydown"; }, enumerable: true, configurable: true }); return TitleEvents; })(); DiagnosticsHub.TitleEvents = TitleEvents; (function (MarkType) { MarkType._map = []; MarkType.LifeCycleEvent = 1; MarkType.UserMark = 2; })(DiagnosticsHub.MarkType || (DiagnosticsHub.MarkType = {})); var MarkType = DiagnosticsHub.MarkType; (function (TickMarkType) { TickMarkType._map = []; TickMarkType.Big = 0; TickMarkType.Medium = 1; TickMarkType.Small = 2; })(DiagnosticsHub.TickMarkType || (DiagnosticsHub.TickMarkType = {})); var TickMarkType = DiagnosticsHub.TickMarkType; var RulerEvents = (function () { function RulerEvents() { } Object.defineProperty(RulerEvents, "Filter", { get: function () { return "filterTimeRange"; }, enumerable: true, configurable: true }); return RulerEvents; })(); DiagnosticsHub.RulerEvents = RulerEvents; (function (UnitFormat) { UnitFormat._map = []; UnitFormat._map[0] = "italizedAbbreviations"; UnitFormat.italizedAbbreviations = 0; UnitFormat._map[1] = "fullName"; UnitFormat.fullName = 1; })(DiagnosticsHub.UnitFormat || (DiagnosticsHub.UnitFormat = {})); var UnitFormat = DiagnosticsHub.UnitFormat; })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {})); var DiagnosticsHub = VisualStudio.DiagnosticsHub; })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {})); var VisualStudio = Microsoft.VisualStudio; })(Microsoft || (Microsoft = {})); var Microsoft; (function (Microsoft) { (function (VisualStudio) { })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {})); var VisualStudio = Microsoft.VisualStudio; })(Microsoft || (Microsoft = {})); var Microsoft; (function (Microsoft) { (function (VisualStudio) { (function (DiagnosticsHub) { (function (Common) { (function (KeyCodes) { KeyCodes._map = []; KeyCodes.TAB = 9; KeyCodes.ENTER = 13; KeyCodes.ESCAPE = 27; KeyCodes.SPACE = 32; KeyCodes.PAGE_UP = 33; KeyCodes.PAGE_DOWN = 34; KeyCodes.END = 35; KeyCodes.HOME = 36; KeyCodes.ARROW_LEFT = 37; KeyCodes.ARROW_FIRST = 37; KeyCodes.ARROW_UP = 38; KeyCodes.ARROW_RIGHT = 39; KeyCodes.ARROW_DOWN = 40; KeyCodes.ARROW_LAST = 40; KeyCodes.DELETE = 46; KeyCodes.B = 66; KeyCodes.C = 67; KeyCodes.PLUS = 107; KeyCodes.MINUS = 109; KeyCodes.F1 = 112; KeyCodes.F2 = 113; KeyCodes.F3 = 114; KeyCodes.F4 = 115; KeyCodes.F5 = 116; KeyCodes.F6 = 117; KeyCodes.F7 = 118; KeyCodes.F8 = 119; KeyCodes.F9 = 120; KeyCodes.F10 = 121; KeyCodes.F11 = 122; KeyCodes.F12 = 123; })(Common.KeyCodes || (Common.KeyCodes = {})); var KeyCodes = Common.KeyCodes; })(DiagnosticsHub.Common || (DiagnosticsHub.Common = {})); var Common = DiagnosticsHub.Common; })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {})); var DiagnosticsHub = VisualStudio.DiagnosticsHub; })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {})); var VisualStudio = Microsoft.VisualStudio; })(Microsoft || (Microsoft = {})); var RegisterNamespace = (function () { function RegisterNamespace() { } RegisterNamespace.registeredGraphs = { }; RegisterNamespace.register = function register(name) { if(name) { var main = window || this; var arr = name.split("."); for(var i = 0; i < arr.length; i++) { var functionName = main[arr[i]]; if(functionName) { main = functionName; } else { throw new Error("Invalid class name."); } } RegisterNamespace.registeredGraphs[name] = functionName; } else { throw new Error("Invalid class name."); } }; RegisterNamespace.getRegisteredGraph = function getRegisteredGraph(name) { return RegisterNamespace.registeredGraphs[name]; }; return RegisterNamespace; })(); var Microsoft; (function (Microsoft) { (function (VisualStudio) { (function (DiagnosticsHub) { var RectangleDimension = (function () { function RectangleDimension(left, top, right, bottom) { this.left = left; this.top = top; this.right = right; this.bottom = bottom; if(this.left > this.right || this.top > this.bottom) { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1000")); } } Object.defineProperty(RectangleDimension.prototype, "width", { get: function () { return this.right - this.left; }, enumerable: true, configurable: true }); Object.defineProperty(RectangleDimension.prototype, "height", { get: function () { return this.bottom - this.top; }, enumerable: true, configurable: true }); return RectangleDimension; })(); DiagnosticsHub.RectangleDimension = RectangleDimension; var MinMax = (function () { function MinMax(min, max) { this.min = min; this.max = max; } Object.defineProperty(MinMax.prototype, "range", { get: function () { return this.max - this.min; }, enumerable: true, configurable: true }); return MinMax; })(); DiagnosticsHub.MinMax = MinMax; var ChartColorScheme = (function () { function ChartColorScheme(lineColorString, lineFillColorString) { this._lineColorString = "#FF0000"; this._lineFillColorString = "#FF0000"; this._lineColorString = lineColorString; this._lineFillColorString = lineFillColorString; } Object.defineProperty(ChartColorScheme.prototype, "lineColor", { get: function () { return this._lineColorString; }, enumerable: true, configurable: true }); Object.defineProperty(ChartColorScheme.prototype, "lineFillColor", { get: function () { return this._lineFillColorString; }, enumerable: true, configurable: true }); return ChartColorScheme; })(); DiagnosticsHub.ChartColorScheme = ChartColorScheme; var MultiLineGraph = (function () { function MultiLineGraph(config) { this._series = []; this._graphContainerCss = "graphContainer"; this._isCursorEnabled = false; this._tabFocusPointList = []; this.chartAxisCount = 5; this.chartAxisIncreaseRatio = 1.1; this.scaleForWhiteSpace = 0.05; this._graphState = DiagnosticsHub.GraphState.Roll; this._oldGridX = new MinMax(0, 0); this._markSeries = []; if(config) { this._config = config; } else { throw new Error("Invalid configuration"); } this.initialize(); } MultiLineGraph.prototype.initialize = function () { if(this._config.resources) { this._resource = this._config.resources; } var jsonObject = this._config.jsonConfig; this._config.scale.axes = jsonObject.Axes || []; this._graphInfo = { gridX: new MinMax(this._config.timeRange.begin.msec, this._config.timeRange.end.msec), gridY: new MinMax(this._config.scale.minimum, this._config.scale.maximum), chartDrawFill: true, chartRect: null }; this._oldGridX = new MinMax(this._config.timeRange.begin.msec, this._config.timeRange.end.msec); if(jsonObject.TimeProperties) { this._timeProperties = jsonObject.TimeProperties; } if(jsonObject.GraphBehaviour) { this._graphBehaviour = jsonObject.GraphBehaviour; } if(!this._config.legend) { this._config.legend = { data: [] }; } for(var i = 0; i < jsonObject.Series.length; i++) { var series = jsonObject.Series[i]; if(series.SeriesType === DiagnosticsHub.SeriesType.Mark && this._config.addMarkSeries) { this._config.addMarkSeries(series.DataSource.CounterId, DiagnosticsHub.MarkType.UserMark); this._markSeries.push(series.DataSource.CounterId); } else { if(this._resource && this._resource[series.Legend]) { series.Legend = this._resource[series.Legend]; } this.addSeries(series.Legend, series.DataSource.CounterId, series.SeriesType); this._config.legend.data.push({ legendText: series.Legend, color: this._series[i].colorScheme.lineColor }); } } this._config.scale.minimum = typeof jsonObject.MinValue !== "undefined" && jsonObject.MinValue !== null ? jsonObject.MinValue : this._config.scale.minimum; this._config.scale.maximum = typeof jsonObject.MaxValue !== "undefined" && jsonObject.MaxValue !== null ? jsonObject.MaxValue : this._config.scale.maximum; if(jsonObject.Unit && typeof jsonObject.Unit === "string") { this._config.unit = jsonObject.Unit; } if(jsonObject.Units) { this._unitConverter = jsonObject.Units; } this._keyPress = this.onKeyPress.bind(this); this._hideCursor = this.hideCursor.bind(this); if(this._config.loadCss) { this._config.loadCss("MultiLineGraph.css"); } }; MultiLineGraph.prototype.deinitialize = function () { }; MultiLineGraph.prototype.initializeGraphStructure = function () { this._container = document.getElementById(this._config.containerId); if(this._container === null) { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1001")); } this._container.classList.add(this._graphContainerCss); this._container.style.height = this._config.height + "px"; while(this._container.childNodes.length > 0) { this._container.removeChild(this._container.firstChild); } this._canvasDiv = document.createElement("div"); this._canvasDiv.className = "graph-canvas-div"; if(this._keyPress) { this._canvasDiv.addEventListener("keydown", this._keyPress, true); } this._container.appendChild(this._canvasDiv); this._canvas = document.createElement("canvas"); this._canvasDiv.appendChild(this._canvas); this._canvas.className = "graph-canvas"; this._canvas.addEventListener('mousemove', this.onMouseOver.bind(this)); this._canvas.addEventListener('mouseout', this.onMouseOut.bind(this)); if(!this._container.runtimeStyle.position || this._container.runtimeStyle.position === "static") { this._container.style.position = "relative"; } this._context = this._canvas.getContext("2d"); Plugin.Theme.addEventListener("themechanged", this.onThemeChanged.bind(this)); }; MultiLineGraph.prototype.render = function (fullRender) { if (typeof fullRender === "undefined") { fullRender = true; } if(!this._container) { this.initializeGraphStructure(); } if(fullRender) { this._container.style.backgroundColor = Plugin.Theme.getValue("plugin-background-color"); this._canvas.style.background = Plugin.Theme.getValue("plugin-background-color"); this.calculateChartSize(); if(0 <= this._container.clientWidth && 0 <= this._config.height) { this._graphInfo.chartRect = new RectangleDimension(0, 0, this._container.clientWidth, this._config.height); this.drawChartBackground(); this.renderSeries(fullRender); } } else { this.renderSeries(fullRender); } this.createPointIndexInfoList(); }; MultiLineGraph.prototype.renderSeries = function (fullRender) { for(var seriesIndex = 0; seriesIndex < this._series.length; seriesIndex++) { var series = this._series[seriesIndex]; series.render(this._context, this._graphInfo, fullRender); } }; MultiLineGraph.prototype.setViewPortTimeRange = function (viewPort) { var viewPortHasChanged = false; var gridX = new DiagnosticsHub.Common.TimeSpan(DiagnosticsHub.Common.TimeStamp.fromMilliseconds(this._graphInfo.gridX.min), DiagnosticsHub.Common.TimeStamp.fromMilliseconds(this._graphInfo.gridX.max)); if(!gridX.equals(viewPort)) { viewPortHasChanged = true; this.calculateChartSize(); this._graphInfo.gridX.min = viewPort.begin.msec; this._graphInfo.gridX.max = viewPort.end.msec; this._config.timeRange = viewPort; this.removeFocus(); this.render(viewPortHasChanged); } }; MultiLineGraph.prototype.getViewPortTimeRange = function () { return new DiagnosticsHub.Common.TimeSpan(DiagnosticsHub.Common.TimeStamp.fromMilliseconds(this._graphInfo.gridX.min), DiagnosticsHub.Common.TimeStamp.fromMilliseconds(this._graphInfo.gridX.max)); }; MultiLineGraph.prototype.getGraphConfiguration = function () { return this._config; }; MultiLineGraph.prototype.addSeriesData = function (counterId, points, fullRender, dropOldData) { if (typeof fullRender === "undefined") { fullRender = true; } if (typeof dropOldData === "undefined") { dropOldData = false; } if(counterId && points && points.length > 0) { for(var i = 0; i < this._series.length; i++) { var series = this._series[i]; if(series.counterId === counterId) { if(!series.data) { series.data = []; } if(this._timeProperties && DiagnosticsHub.GraphBehaviourType.Live === this._graphBehaviour) { var newPoints = []; for(var j = 0; j < points.length; j++) { var toolTip = points[j].ToolTip; if((toolTip === null || toolTip === undefined) && this._unitConverter) { var formattedPoint = this.convertToUnits(points[j].Value); toolTip = formattedPoint ? formattedPoint.value + " " + formattedPoint.unit : undefined; } newPoints.push({ CustomData: points[j].CustomData, Timestamp: this._timeProperties.convertQpcTimestampToMilliseconds(points[j].Timestamp), ToolTip: toolTip, Value: points[j].Value }); } } else { newPoints = points; } series.data = series.data.concat(newPoints); break; } } if(this._markSeries) { for(var j = 0; j < this._markSeries.length; j++) { if(counterId === this._markSeries[j]) { for(var k = 0; k < points.length; k++) { this._config.addMark(counterId, DiagnosticsHub.Common.TimeStamp.fromMilliseconds(this._timeProperties.convertQpcTimestampToMilliseconds(points[k].Timestamp)), points[k].ToolTip); } } } } if(series && series.data) { var oldValueMin = this._graphInfo.gridY.min; var oldValueMax = this._graphInfo.gridY.max; this.calculateYRange(this.getMaxPoint(series.data)); if(oldValueMin !== this._graphInfo.gridY.min || oldValueMax !== this._graphInfo.gridY.max) { var maxNumber = this.convertToUnits(this._graphInfo.gridY.max); var minNumberValue = this.convertToUnits(this._graphInfo.gridY.min).value; this._config.invokeEventListener(DiagnosticsHub.GraphEvents.ScaleInfoChanged, { minimum: minNumberValue, maximum: maxNumber.value, unit: maxNumber.unit }); fullRender = true; } if(this._graphState === DiagnosticsHub.GraphState.Roll || DiagnosticsHub.GraphBehaviourType.PostMortem === this._graphBehaviour) { this.render(fullRender); } } } }; MultiLineGraph.prototype.convertToUnits = function (value) { var result = { value: value.toString(), unit: "" }; if(this._unitConverter) { for(var i = 0; i < this._unitConverter.length; i++) { var units = this._unitConverter[i]; if(units.FromValue <= value && value <= units.ToValue) { if(units.Divider != 1) { value = value / units.Divider; } var decimals = Math.pow(10, units.Decimals); value = Math.round(value * decimals) / (decimals); result.value = value.toFixed(units.Decimals); var unit = units.Unit; if(this._resource) { unit = this._resource[unit]; } result.unit = unit || units.Unit; break; } } } return result; }; MultiLineGraph.prototype.setGraphState = function (graphState) { this._graphState = graphState; }; MultiLineGraph.prototype.resize = function (evt) { if(this.calculateChartSize()) { this.removeFocus(); this.render(); } }; MultiLineGraph.prototype.removeInvalidPoints = function (base) { for(var i = 0; i < this._series.length; i++) { var series = this._series[i]; var finalPoints = series.data; if(finalPoints && finalPoints.length > 0) { var count = 0; for(var i = 0; i <= finalPoints.length; i++) { if(finalPoints[i].Timestamp >= base.msec) { break; } count++; } finalPoints.splice(0, count > 0 ? count - 1 : 0); } } }; MultiLineGraph.prototype.onThemeChanged = function (args) { this._container.style.backgroundColor = Plugin.Theme.getValue("plugin-background-color"); this.render(); }; MultiLineGraph.prototype.calculateChartSize = function () { var isCalculated = false; if(this._container.offsetWidth > 0 && this._container.offsetHeight > 0) { var canvasWidth = this._container.clientWidth; var canvasHeight = this._config.height; this._canvas.height = canvasHeight; this._canvas.width = canvasWidth; isCalculated = true; } return isCalculated; }; MultiLineGraph.prototype.convertToChartAreaPercentage = function (event) { var rect = this._canvas.getBoundingClientRect(); var mouseX = event.clientX - rect.left; return (mouseX) / this._canvasDiv.clientWidth * 100; }; MultiLineGraph.prototype.drawChartBackground = function () { this._context.fillStyle = Plugin.Theme.getValue("plugin-background-color"); this._context.fillRect(0, 0, this._canvas.width, this._canvas.height); }; MultiLineGraph.prototype.convertChartAreaPercentToDataValue = function (percent) { return Math.round(percent * (this._graphInfo.gridX.max - this._graphInfo.gridX.min) / 100) + this._graphInfo.gridX.min; }; MultiLineGraph.prototype.calculateYRange = function (point) { if(point) { if(this._graphInfo.gridY.min > point.Value) { this._graphInfo.gridY.min = Math.floor((point.Value * this.chartAxisIncreaseRatio) / this.chartAxisCount) * this.chartAxisCount; } if(this._graphInfo.gridY.max < point.Value + Math.ceil(this._graphInfo.gridY.max * this.scaleForWhiteSpace)) { this._graphInfo.gridY.max = Math.ceil((point.Value * this.chartAxisIncreaseRatio) / this.chartAxisCount) * this.chartAxisCount; } } }; MultiLineGraph.prototype.addSeries = function (legendText, counterId, type) { var newSeries; if(type && type === DiagnosticsHub.SeriesType.StepLine) { newSeries = new StepLineSeries(this._series.length, counterId, legendText, this._graphBehaviour); } else { newSeries = new LineSeries(this._series.length, counterId, legendText, this._graphBehaviour); } this._series.push(newSeries); var filledLines = 0; for(var i = 0; i < this._series.length; i++) { filledLines++; if(filledLines >= 2) { this._graphInfo.chartDrawFill = false; break; } } }; MultiLineGraph.prototype.createVerticalRulerLine = function (position) { var x = this._container.clientWidth * position / 100; x = Math.round(x) + 0.5; this._context.save(); this._context.beginPath(); this._context.strokeStyle = Plugin.Theme.getValue("diagnostics-host-graph-line"); this._context.lineWidth = 1; this._context.moveTo(x, 0); this._context.lineTo(x, this._config.height); this._context.closePath(); this._context.stroke(); this._context.restore(); }; MultiLineGraph.prototype.getMaxPoint = function (points) { var max; if(points) { if(points.length > 0) { max = points[0]; } for(var i = 1; i < points.length; i++) { if(points[i].Value > max.Value) { max = points[i]; } } } return max; }; MultiLineGraph.prototype.drawToolTip = function (points, mousePosition) { if(!points || points.length === 0) { return; } var pointsWithMessages = []; for(var i = 0; i < points.length; i++) { if(points[i].ToolTip !== null && points[i].ToolTip !== undefined && points[i].ToolTip !== "undefined" && points[i].ToolTip !== "") { pointsWithMessages.push(points[i].ToolTip); } } if(pointsWithMessages.length > 0) { var message = pointsWithMessages.join("\r\n"); var config = { content: message }; Plugin.Tooltip.show(config); } }; MultiLineGraph.prototype.getMousePosition = function (evt) { var rect = this._canvas.getBoundingClientRect(); var root = document.documentElement; var mouseX = evt.clientX - rect.left; var mouseY = evt.clientY - rect.top; return { Timestamp: mouseX, Value: mouseY }; }; MultiLineGraph.prototype.onMouseOver = function (evt) { var mousePos = this.getMousePosition(evt); if((!this._oldMousePosition || this._oldMousePosition.Timestamp !== mousePos.Timestamp) && mousePos.Timestamp <= this._container.clientWidth - 2 && mousePos.Timestamp >= 0 && mousePos.Value <= this._config.height && mousePos.Value >= 0) { (Plugin).Tooltip.dismiss(); var foundPoints = this.getPointsBelowMousePointer(mousePos); if(this._isCursorEnabled) { this.drawCursor(mousePos); } if(foundPoints && foundPoints.length !== 0) { this.drawToolTip(foundPoints, mousePos); } } this._oldMousePosition = mousePos; }; MultiLineGraph.prototype.hideCursor = function () { if(this._isCursorEnabled) { var mdiv = MultiLineGraph._cursor; if(!mdiv) { mdiv = MultiLineGraph._cursor = document.getElementById("mDiv"); } if(mdiv) { mdiv.style.visibility = "hidden"; } } (Plugin).Tooltip.dismiss(); }; MultiLineGraph.prototype.onMouseOut = function (evt) { var mousePos = this.getMousePosition(evt); if(mousePos.Timestamp > this._container.clientWidth - 2 || mousePos.Timestamp < 0 || mousePos.Value > this._config.height || mousePos.Value < 0) { this.hideCursor(); } }; MultiLineGraph.prototype.drawCursor = function (point) { var mdiv = MultiLineGraph._cursor; if(!mdiv) { mdiv = MultiLineGraph._cursor = document.getElementById("mDiv"); } if(!mdiv) { mdiv = document.createElement("div"); mdiv.className = "graph-cursor"; mdiv.id = "mDiv"; mdiv.style.left = point.Timestamp.toString() + "px"; mdiv.style.top = "0px"; mdiv.style.height = (this._canvas.height).toString() + "px"; mdiv.style.visibility = "visible"; mdiv.style.zIndex = "2"; this._canvasDiv.appendChild(mdiv); } else { mdiv.style.left = point.Timestamp.toString() + "px"; mdiv.style.top = "0px"; mdiv.style.visibility = "visible"; } }; MultiLineGraph.prototype.getPointsBelowMousePointer = function (point) { var timeStamp = (point.Timestamp * this._graphInfo.gridX.range) / this._canvas.width; var foundPoints = []; for(var i = 0; i < this._series.length; i++) { var seriesData = this._series[i].data; if(seriesData && seriesData.length > 0) { for(var j = 1; j < seriesData.length; j++) { var previousPoint = seriesData[j - 1]; var renderedPoint = seriesData[j]; if(typeof renderedPoint.xPx !== "undefined" && typeof previousPoint.xPx !== "undefined" && timeStamp < renderedPoint.Timestamp && timeStamp >= previousPoint.Timestamp) { foundPoints.push(previousPoint); break; } } } } return foundPoints; }; MultiLineGraph.prototype.onKeyPress = function (evt) { if(this._series && (DiagnosticsHub.Common.KeyCodes.ARROW_LEFT === evt.keyCode || DiagnosticsHub.Common.KeyCodes.ARROW_RIGHT === evt.keyCode)) { if(DiagnosticsHub.Common.KeyCodes.ARROW_LEFT === evt.keyCode) { this._index--; if(this._index < 0) { this._index = this._tabFocusPointList.length - 1; } } else if(DiagnosticsHub.Common.KeyCodes.ARROW_RIGHT === evt.keyCode) { this._index++; if(this._index >= this._tabFocusPointList.length) { this._index = 0; } } this.focusPoint(this._tabFocusPointList[this._index]); } else if(DiagnosticsHub.Common.KeyCodes.TAB === evt.keyCode) { this.removeFocus(); } }; MultiLineGraph.prototype.focusPoint = function (pointInfo) { var isMoved = false; var series = this._series[this._tabFocusPointList[this._index].seriesIndex]; if(series && series.renderedPoints) { var points = series.renderedPoints; var previousPoint = points[this._tabFocusPointList[this._index].pointIndex - 1]; var nextPoint = points[this._tabFocusPointList[this._index].pointIndex]; var divStart; var divEnd; if(previousPoint && nextPoint) { divStart = previousPoint.Timestamp - this._selectedTimeRange.min > 0 ? previousPoint.Timestamp : this._selectedTimeRange.min; divEnd = this._selectedTimeRange.max - nextPoint.Timestamp > 0 ? nextPoint.Timestamp : this._selectedTimeRange.max; } if(typeof divEnd !== "undefined" && typeof divStart !== "undefined") { var divs = this._canvasDiv.getElementsByClassName("graph-focus"); while(divs.length > 0) { this._canvasDiv.removeChild(divs[0]); } var focusDiv = document.createElement("div"); focusDiv.classList.add("graph-focus"); focusDiv.style.width = ((divEnd - divStart) / this._graphInfo.gridX.range * this._canvasDiv.clientWidth) + "px"; focusDiv.style.left = ((divStart - this._graphInfo.gridX.min) / this._graphInfo.gridX.range * this._canvasDiv.clientWidth) - 1 + "px"; focusDiv.style.top = previousPoint.yPx - 1 + "px"; focusDiv.setAttribute("aria-label", previousPoint.ToolTip); this._canvasDiv.appendChild(focusDiv); focusDiv.focus(); isMoved = true; } } return isMoved; }; MultiLineGraph.prototype.createPointIndexInfoList = function () { var startX = this.convertChartAreaPercentToDataValue(this._graphInfo.gridX.min); var endX = this.convertChartAreaPercentToDataValue(this._graphInfo.gridX.max); this._selectedTimeRange = new MinMax(startX, endX); this._tabFocusPointList = this.getPointIndexInfoList(startX, endX); this._index = -1; }; MultiLineGraph.prototype.getPointIndexInfoList = function (start, end) { var lists = []; if(this._series) { for(var i = 0; i < this._series.length; i++) { var series = this._series[i]; var seriesPoints = series.renderedPoints; var list = []; for(var j = 0; j < seriesPoints.length; j++) { var seriesPoint = seriesPoints[j]; var required = seriesPoint.Timestamp > start && seriesPoint.Timestamp <= end; if(!required) { if(seriesPoint.Timestamp > end && j > 0 && seriesPoints[j - 1].Timestamp < end) { required = true; } } if(required) { list.push({ seriesIndex: i, pointIndex: j }); } } lists.push(list); } } return this.sortPointIndexInfoList(lists); }; MultiLineGraph.prototype.sortPointIndexInfoList = function (lists) { var finalList = []; if(lists) { while(!this.areAllListEmpty(lists)) { var smallest = null; var index = null; for(var i = 0; i < lists.length; i++) { var list = lists[i]; if(list.length > 0) { var smallestInList = list[0]; if(smallestInList && (!smallest || this._series[smallestInList.seriesIndex].renderedPoints[smallestInList.pointIndex].Timestamp < this._series[smallest.seriesIndex].renderedPoints[smallest.pointIndex].Timestamp)) { smallest = smallestInList; index = i; } } } if(smallest) { finalList.push(lists[index].shift()); } } } return finalList; }; MultiLineGraph.prototype.areAllListEmpty = function (lists) { var allListEmpty = true; if(lists) { for(var i = 0; i < lists.length; i++) { if(lists[i].length > 0) { allListEmpty = false; break; } } } return allListEmpty; }; MultiLineGraph.prototype.removeFocus = function () { this._index = -1; var divs = this._canvasDiv.getElementsByClassName("graph-focus"); for(var i = 0; i < divs.length; i++) { (divs[i]).classList.add("graph-unfocused"); } }; return MultiLineGraph; })(); DiagnosticsHub.MultiLineGraph = MultiLineGraph; var ChartSeries = (function () { function ChartSeries(index, counterId, legendText, type, graphBehaviour) { this.colorSchemes = [ new ChartColorScheme("rgb(118, 174, 200)", "rgba(118, 174, 200, 0.65)"), new ChartColorScheme("rgb(158, 202, 0)", "rgba(158, 202, 0, 0.65)"), new ChartColorScheme("rgb(198, 198, 198)", "rgba(198, 198, 198, 0.75)"), new ChartColorScheme("rgb(167, 148, 50)", "rgba(167, 148, 50, 0.25)") ]; this.index = index; this.data = []; this.colorScheme = index < this.colorSchemes.length ? this.colorSchemes[index] : this.colorSchemes[0]; this.counterId = counterId; this.type = type; this.legendText = legendText; this.graphBehaviour = graphBehaviour; } ChartSeries.prototype.getPointsToRender = function (chartRect, fullRender) { var renderedPoints = new Array(); var seriesPoints = this.data; var seriesIndex = this.index; if(seriesPoints.length > 0) { var startIndex = fullRender ? 0 : seriesPoints.length - 1; var endIndex = seriesPoints.length - 1; var startX = this.info.gridX.min; var rangeX = this.info.gridX.range; var endX = this.info.gridX.max; var scaleX = chartRect.width / rangeX; if(this.type === DiagnosticsHub.SeriesType.Line || this.type === DiagnosticsHub.SeriesType.StepLine) { if(startIndex === 0) { if(this.type === DiagnosticsHub.SeriesType.Line) { renderedPoints.push({ Timestamp: this.info.gridX.min, Value: seriesPoints[startIndex].Value, ToolTip: seriesPoints[startIndex].ToolTip, CustomData: seriesPoints[startIndex].CustomData, isInView: false, seriesIndex: seriesIndex, xPx: 0, yPx: this.getYCoordinate(seriesPoints[startIndex].Value, chartRect.top, chartRect.height) }); } else if(this.type === DiagnosticsHub.SeriesType.StepLine) { renderedPoints.push({ Timestamp: seriesPoints[startIndex].Timestamp, Value: this.info.gridY.min, ToolTip: seriesPoints[startIndex].ToolTip, CustomData: seriesPoints[startIndex].CustomData, isInView: false, seriesIndex: seriesIndex, xPx: chartRect.left + (seriesPoints[startIndex].Timestamp - startX) * scaleX, yPx: this.getYCoordinate(this.info.gridY.min, chartRect.top, chartRect.height) }); } } else { startIndex--; } } var x = 0; var y = 0; var startPoint = seriesPoints[startIndex]; var hasMovedToStart = false; for(var i = startIndex; i <= endIndex; i++) { var point = seriesPoints[i]; var pointInView = (point.Timestamp >= startX && point.Timestamp <= endX); var requiresDrawing = pointInView; point.isInView = pointInView; point.seriesIndex = seriesIndex; if(!requiresDrawing) { if((point.Timestamp < startX && i < endIndex && seriesPoints[i + 1].Timestamp > startX) || (point.Timestamp > endX && i > 0 && seriesPoints[i - 1].Timestamp < endX)) { requiresDrawing = true; } } if(requiresDrawing) { x = chartRect.left + (point.Timestamp - startX) * scaleX; y = this.getYCoordinate(point.Value, chartRect.top, chartRect.height); point.xPx = Math.floor(x); point.yPx = Math.floor(y); renderedPoints.push(point); } } } return renderedPoints; }; ChartSeries.prototype.getYCoordinate = function (y, top, height) { return top + ((this.info.gridY.max - y) / this.info.gridY.range) * height; }; return ChartSeries; })(); DiagnosticsHub.ChartSeries = ChartSeries; var StepLineSeries = (function (_super) { __extends(StepLineSeries, _super); function StepLineSeries(index, counterId, legendText, graphBehaviour) { _super.call(this, index, counterId, legendText, DiagnosticsHub.SeriesType.StepLine, graphBehaviour); } StepLineSeries.prototype.drawLineFill = function (renderedPoints, fullRender) { if(this.info.chartDrawFill && renderedPoints.length > 0) { var startIndex = 0; var endIndex = renderedPoints.length - 1; var startX = this.info.gridX.min; var rangeX = this.info.gridX.range; var endX = this.info.gridX.max; var scaleX = this.info.chartRect.width / rangeX; var x = 0; var y = 0; var hasMovedToStart = false; this.context.save(); this.context.beginPath(); var previousPoint = renderedPoints[0]; this.context.beginPath(); this.context.fillStyle = this.colorScheme.lineFillColor; this.context.strokeStyle = this.colorScheme.lineColor; for(var i = startIndex; i <= endIndex; i++) { var point = renderedPoints[i]; if(!hasMovedToStart) { this.context.moveTo(point.xPx, point.yPx); hasMovedToStart = true; } else { this.context.lineTo(point.xPx, previousPoint.yPx); this.context.lineTo(point.xPx, point.yPx); } previousPoint = point; } var y = this.getYCoordinate(0, this.info.chartRect.top, this.info.chartRect.height); this.context.lineTo(point.xPx, y); this.context.lineTo(fullRender ? 0 : renderedPoints[0].xPx, y); this.context.closePath(); this.context.fill(); this.context.restore(); } }; StepLineSeries.prototype.drawLineSeries = function (renderedPoints, fullRender) { if(renderedPoints.length > 0) { this.context.save(); this.context.beginPath(); this.context.lineWidth = (this.info.chartRect.height < 100 ? 1 : 2); this.context.fillStyle = this.colorScheme.lineFillColor; this.context.strokeStyle = this.colorScheme.lineColor; var previousPoint = null; for(var i = 0; i < renderedPoints.length; i++) { var rp = renderedPoints[i]; if(i === 0) { this.context.moveTo(renderedPoints[i].xPx, renderedPoints[i].yPx - 0.5); } else { var yPos = this.context.canvas.height - 0.5; if(previousPoint && previousPoint.yPx) { yPos = Math.round(previousPoint.yPx) - 0.5; } this.context.lineTo(rp.xPx, yPos); this.context.lineTo(rp.xPx, Math.round(rp.yPx) - 0.5); } previousPoint = rp; } this.context.stroke(); this.context.restore(); } }; StepLineSeries.prototype.render = function (context, info, fullRender) { if(context && !this.context) { this.context = context; } if(info) { this.info = info; } this.renderedPoints = this.getPointsToRender(this.info.chartRect, fullRender); if(this.renderedPoints && this.renderedPoints.length > 0) { this.drawLineFill(this.renderedPoints, fullRender); this.drawLineSeries(this.renderedPoints, fullRender); } }; return StepLineSeries; })(ChartSeries); DiagnosticsHub.StepLineSeries = StepLineSeries; var LineSeries = (function (_super) { __extends(LineSeries, _super); function LineSeries(index, counterId, legendText, graphBehaviour) { _super.call(this, index, counterId, legendText, DiagnosticsHub.SeriesType.Line, graphBehaviour); } LineSeries.prototype.drawLineFill = function (renderedPoints, fullRender) { if(renderedPoints.length > 0) { var startIndex = 0; var endIndex = renderedPoints.length - 1; var startX = this.info.gridX.min; var rangeX = this.info.gridX.range; var endX = this.info.gridX.max; var scaleX = this.info.chartRect.width / rangeX; var x = 0; var y = 0; var hasMovedToStart = false; this.context.save(); this.context.beginPath(); var previousPoint = renderedPoints[0]; this.context.beginPath(); this.context.fillStyle = this.colorScheme.lineFillColor; this.context.strokeStyle = this.colorScheme.lineColor; for(var i = startIndex; i <= endIndex; i++) { var point = renderedPoints[i]; if(!hasMovedToStart) { this.context.moveTo(point.xPx, point.yPx); hasMovedToStart = true; } else { this.context.lineTo(point.xPx, point.yPx); } previousPoint = point; } if(this.info.chartDrawFill) { var y = this.getYCoordinate(0, this.info.chartRect.top, this.info.chartRect.height); this.context.lineTo(point.xPx, y); this.context.lineTo(fullRender ? 0 : renderedPoints[0].xPx, y); this.context.closePath(); this.context.fill(); } else { this.context.stroke(); } this.context.restore(); } }; LineSeries.prototype.drawLineSeries = function (renderedPoints, fullRender) { if(renderedPoints.length > 0) { this.context.save(); if(this.info.chartDrawFill) { this.context.beginPath(); this.context.lineWidth = (this.info.chartRect.height < 100 ? 1 : 2); this.context.fillStyle = this.colorScheme.lineFillColor; this.context.strokeStyle = this.colorScheme.lineColor; for(var i = 0; i < renderedPoints.length; i++) { var rp = renderedPoints[i]; if(i === 0) { this.context.moveTo(renderedPoints[i].xPx, renderedPoints[i].yPx - 0.5); } else { this.context.lineTo(rp.xPx, Math.round(rp.yPx) - 0.5); } } this.context.stroke(); } this.context.restore(); } }; LineSeries.prototype.render = function (context, info, fullRender) { if(context && !this.context) { this.context = context; } if(info) { this.info = info; } this.renderedPoints = this.getPointsToRender(this.info.chartRect, fullRender); if(this.renderedPoints && this.renderedPoints.length > 0) { this.drawLineFill(this.renderedPoints, fullRender); this.drawLineSeries(this.renderedPoints, fullRender); } }; return LineSeries; })(ChartSeries); DiagnosticsHub.LineSeries = LineSeries; })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {})); var DiagnosticsHub = VisualStudio.DiagnosticsHub; })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {})); var VisualStudio = Microsoft.VisualStudio; })(Microsoft || (Microsoft = {})); RegisterNamespace.register("Microsoft.VisualStudio.DiagnosticsHub.MultiLineGraph"); var Microsoft; (function (Microsoft) { (function (VisualStudio) { (function (DiagnosticsHub) { (function (Common) { var Helper = (function () { function Helper() { } Helper.doesObjectExist = function doesObjectExist(objectName, type, context) { type = type || "object"; context = context || window; if(typeof objectName !== "string" || objectName.length === 0 || typeof context === "undefined" || typeof context !== "object" || context === null) { return false; } var names = objectName.split("."), length = names.length, obj = context, i = 0; for(; i < length - 1; i++) { obj = obj[names[i]]; if(typeof obj === "undefined" || typeof obj !== "object" || obj === null) { return false; } } obj = obj[names[i]]; if(typeof obj === type) { return true; } return false; }; return Helper; })(); Common.Helper = Helper; })(DiagnosticsHub.Common || (DiagnosticsHub.Common = {})); var Common = DiagnosticsHub.Common; })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {})); var DiagnosticsHub = VisualStudio.DiagnosticsHub; })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {})); var VisualStudio = Microsoft.VisualStudio; })(Microsoft || (Microsoft = {})); var Microsoft; (function (Microsoft) { (function (VisualStudio) { (function (DiagnosticsHub) { (function (Common) { (function (DependencyManagerStateType) { DependencyManagerStateType._map = []; DependencyManagerStateType.NotReady = -1; DependencyManagerStateType.Ready = 0; DependencyManagerStateType.Loading = 1; DependencyManagerStateType.Done = 2; })(Common.DependencyManagerStateType || (Common.DependencyManagerStateType = {})); var DependencyManagerStateType = Common.DependencyManagerStateType; var DependencyManager = (function () { function DependencyManager() { this._deps = []; this._loadedDeps = []; this._notLoadedDeps = []; this._totalDeps = 0; this._state = DependencyManagerStateType.Ready; } DependencyManager.prototype._isDone = function () { if(this._deps.length === 0 && (this._loadedDeps.length + this._notLoadedDeps.length) === this._totalDeps) { this._state = DependencyManagerStateType.Done; if(this._callback) { this._callback.apply(this, [ this._loadedDeps ], [ this._notLoadedDeps ]); } return true; } else { return false; } }; DependencyManager.prototype._loadNextDependency = function (contextObject) { if(!this._isDone() && this._deps.length !== 0) { this._state = DependencyManagerStateType.Loading; var dep = this._deps.shift(); if(dep.objType && Common.Helper.doesObjectExist(dep.objType, "function")) { this._loadedDeps.push(dep); this._loadNextDependency(contextObject); return; } var scr = contextObject.createElement('script'); scr.type = 'text/javascript'; scr.src = dep.url; if(!dep.async) { if(scr.readyState) { scr.onreadystatechange = function () { if(scr.readyState === "loaded" || scr.readyState === "complete") { scr.onreadystatechange = null; this._loadedDeps.push(dep); this._loadNextDependency(contextObject); } }.bind(this); } else { scr.onload = function () { this._loadedDeps.push(dep); this._loadNextDependency(contextObject); }.bind(this); scr.onerror = function () { this._notLoadedDeps.push(dep); this._loadNextDependency(contextObject); }.bind(this); } } else { if(scr.readyState) { scr.onreadystatechange = function () { if(scr.readyState === "loaded" || scr.readyState === "complete") { scr.onreadystatechange = null; this._loadedDeps.push(dep); this._isDone(); } }.bind(this); } else { scr.onload = function () { this._loadedDeps.push(dep); this._isDone(); }.bind(this); scr.onerror = function () { this._notLoadedDeps.push(dep); this._isDone(); }.bind(this); } this._loadNextDependency(contextObject); } contextObject.getElementsByTagName("head")[0].appendChild(scr); } }; DependencyManager.prototype.addDependencies = function (dependencyArray) { if(this._state === DependencyManagerStateType.Loading) { throw Error("DependencyManager loading other dependency."); } else if(dependencyArray && dependencyArray.length > 0) { this._deps = this._deps.concat(dependencyArray); this._totalDeps += dependencyArray.length; } }; DependencyManager.prototype.getState = function () { return this._state; }; DependencyManager.prototype.loadDependencies = function (callback, contextObject) { if(this._state === DependencyManagerStateType.Loading) { throw Error("DependencyManager loading other dependency."); } else { this._callback = callback; this._loadNextDependency((contextObject || document)); } }; DependencyManager.prototype.loadCss = function (fullCssFilePath) { if(typeof fullCssFilePath !== "string" && fullCssFilePath.split('.').length > 0) { throw new Error("file name is null or undefined."); } var nameArr = fullCssFilePath.split('.')[0]; var oldCss = document.getElementById(nameArr); if(!oldCss) { var link = document.createElement("link"); link.rel = "stylesheet"; link.type = "text/css"; link.href = fullCssFilePath; link.media = "all"; link.id = nameArr; document.getElementsByTagName("head")[0].appendChild(link); } }; return DependencyManager; })(); Common.DependencyManager = DependencyManager; })(DiagnosticsHub.Common || (DiagnosticsHub.Common = {})); var Common = DiagnosticsHub.Common; })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {})); var DiagnosticsHub = VisualStudio.DiagnosticsHub; })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {})); var VisualStudio = Microsoft.VisualStudio; })(Microsoft || (Microsoft = {})); var Microsoft; (function (Microsoft) { (function (VisualStudio) { (function (DiagnosticsHub) { var Toolbar = (function () { function Toolbar(config) { this._containerCss = "toolbar-container"; this._buttonCss = "toolbar-button"; this._disabledButtonCss = "disabled"; if(!config) { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1002")); } this._config = config; } Toolbar.prototype.render = function () { if(this._config && this._config.containerId) { var parent = document.getElementById(this._config.containerId); var container = document.createElement("div"); container.classList.add(this._containerCss); parent.appendChild(container); this._zoomIn = document.createElement("div"); this._zoomIn.classList.add(this._buttonCss); this._zoomIn.classList.add(this._disabledButtonCss); this._zoomIn.addEventListener("click", this.zoomInHandler.bind(this)); this._zoomIn.innerHTML = Plugin.Resources.getString("ToolbarZoomInButton"); this._zoomIn.setAttribute("role", "button"); this._zoomIn.setAttribute("aria-label", Plugin.Resources.getString("ToolbarZoomInAriaLabel")); container.appendChild(this._zoomIn); this._zoomReset = document.createElement("div"); this._zoomReset.classList.add(this._buttonCss); this._zoomReset.classList.add(this._disabledButtonCss); this._zoomReset.addEventListener("click", this.zoomOutHandler.bind(this)); this._zoomReset.innerHTML = Plugin.Resources.getString("ToolbarZoomOutButton"); this._zoomReset.setAttribute("role", "button"); this._zoomReset.setAttribute("aria-label", Plugin.Resources.getString("ToolbarZoomOutAriaLabel")); container.appendChild(this._zoomReset); this._clearSelection = document.createElement("div"); this._clearSelection.classList.add(this._buttonCss); this._clearSelection.classList.add(this._disabledButtonCss); this._clearSelection.addEventListener("click", this.selectionHandler.bind(this)); this._clearSelection.innerHTML = Plugin.Resources.getString("ToolbarClearSelectionButton"); this._clearSelection.setAttribute("role", "button"); this._clearSelection.setAttribute("aria-label", Plugin.Resources.getString("ToolbarcClearSelectionAriaLabel")); container.appendChild(this._clearSelection); } else { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1001")); } }; Toolbar.prototype.setButtonState = function (state) { if(state) { if(typeof state.isZoomInEnabled !== "undefined" && this._zoomIn) { if(state.isZoomInEnabled && this._zoomIn.classList.contains(this._disabledButtonCss)) { this._zoomIn.classList.remove(this._disabledButtonCss); this._zoomIn.tabIndex = 0; } else if(!state.isZoomInEnabled && !this._zoomIn.classList.contains(this._disabledButtonCss)) { this._zoomIn.classList.add(this._disabledButtonCss); this._zoomIn.tabIndex = -1; } } if(typeof state.isResetZoomEnabled !== "undefined" && this._zoomReset) { if(state.isResetZoomEnabled && this._zoomReset.classList.contains(this._disabledButtonCss)) { this._zoomReset.classList.remove(this._disabledButtonCss); this._zoomReset.tabIndex = 0; } else if(!state.isResetZoomEnabled && !this._zoomReset.classList.contains(this._disabledButtonCss)) { this._zoomReset.classList.add(this._disabledButtonCss); this._zoomReset.tabIndex = -1; } } if(typeof state.isClearSelectionEnabled !== "undefined" && this._clearSelection) { if(state.isClearSelectionEnabled && this._clearSelection.classList.contains(this._disabledButtonCss)) { this._clearSelection.classList.remove(this._disabledButtonCss); this._clearSelection.tabIndex = 0; } else if(!state.isClearSelectionEnabled && !this._clearSelection.classList.contains(this._disabledButtonCss)) { this._clearSelection.classList.add(this._disabledButtonCss); this._clearSelection.tabIndex = -1; } } } }; Toolbar.prototype.zoomInHandler = function (evt) { if(this._config.zoomInHandler) { this._config.zoomInHandler(); } }; Toolbar.prototype.selectionHandler = function (evt) { if(this._config.selectionHandler) { this._config.selectionHandler(); } }; Toolbar.prototype.zoomOutHandler = function (evt) { if(this._config.zoomOutHandler) { this._config.zoomOutHandler(); } }; return Toolbar; })(); DiagnosticsHub.Toolbar = Toolbar; })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {})); var DiagnosticsHub = VisualStudio.DiagnosticsHub; })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {})); var VisualStudio = Microsoft.VisualStudio; })(Microsoft || (Microsoft = {})); var Microsoft; (function (Microsoft) { (function (VisualStudio) { (function (DiagnosticsHub) { (function (DragDirection) { DragDirection._map = []; DragDirection._map[0] = "none"; DragDirection.none = 0; DragDirection._map[1] = "left"; DragDirection.left = 1; DragDirection._map[2] = "right"; DragDirection.right = 2; })(DiagnosticsHub.DragDirection || (DiagnosticsHub.DragDirection = {})); var DragDirection = DiagnosticsHub.DragDirection; })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {})); var DiagnosticsHub = VisualStudio.DiagnosticsHub; })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {})); var VisualStudio = Microsoft.VisualStudio; })(Microsoft || (Microsoft = {})); var Microsoft; (function (Microsoft) { (function (VisualStudio) { (function (DiagnosticsHub) { var SwimLane = (function () { function SwimLane(config) { this._swimLaneHeaderCss = "swimlane-header"; this._swimLaneBodyCss = "swimlane-body"; this._graphDivCss = "graph-div"; this._verticalLineCss = "swimlane-vertical-line"; this._minSelectionWidthInPixels = 10; this._minimumGraphHeight = 50; this._graphDataSource = []; this._isVisible = true; if(config) { this._config = config; } if(this._config.containerId) { this._container = document.getElementById(this._config.containerId); } else { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1000")); } this.initialize(); } SwimLane.prototype.initialize = function () { if(this._config.isSelectionEnabled) { this._mouseupHandler = this.stopSelection.bind(this); this._dragHandler = this.drag.bind(this); this._startSelection = this.startSelection.bind(this); } this._resizeHandler = this.resize.bind(this); this._titleClickHandler = this.setBodyVisibility.bind(this); window.addEventListener("resize", this._resizeHandler); if(this._config.body.events) { this._publisher = new DiagnosticsHub.Common.Publisher(this._config.body.events); } if(this._config.minSelectionWidthInPixels) { this._minSelectionWidthInPixels = this._config.minSelectionWidthInPixels; } if(this._config.getVerticalRulerLinePositions) { this._getVerticalRulerLinePositions = this._config.getVerticalRulerLinePositions; } this._selectionTimeRange = this._config.timeRange; this._graphId = this._config.containerId + "_graph"; var className = this._config.body.graph.registeredClass; var args = { timeRange: this._config.timeRange, containerId: this._graphId, events: [], height: this._config.body.graph.height, scale: { minimum: this._config.body.leftScale.minimum || this._config.body.rightScale.minimum || 0, maximum: this._config.body.leftScale.maximum || this._config.body.rightScale.maximum || 0, axes: [] }, invokeEventListener: this.invokeGraphEventListener.bind(this), loadCss: this._config.body.graph.loadCss, jsonConfig: this._config.body.graph.jsonConfig, legend: this._config.header.legend, unit: null, addMarkSeries: this._config.body.graph.addMarkSeries, addMark: this._config.body.graph.addMark, resources: this._config.body.graph.resources }; this._graph = new className(args); }; SwimLane.prototype.deinitialize = function () { if(this._resizeHandler) { window.removeEventListener("resize", this._resizeHandler); } if(this._graph) { this._graph.deinitialize(); } }; SwimLane.prototype.convertTimeStampToPixel = function (time, currentTimeRange) { var pixels = 0; if(currentTimeRange.elapsed.nsec > 0) { pixels = (time.nsec - currentTimeRange.begin.nsec) * (this._graphContainer.clientWidth) / currentTimeRange.elapsed.nsec; } return pixels; }; SwimLane.prototype.resize = function (e) { if(this._config.isSelectionEnabled) { var handlePosition = this._selectionTimeRange; var current = this._graph.getViewPortTimeRange(); var lValue = this.convertTimeStampToPixel(handlePosition.begin, current); var rValue = this.convertTimeStampToPixel(handlePosition.end, current); var positionChanged = false; if(rValue - lValue < this._minSelectionWidthInPixels) { if(lValue + this._minSelectionWidthInPixels <= this._graphContainer.clientWidth) { rValue = lValue + this._minSelectionWidthInPixels; positionChanged = true; } else if(rValue - this._minSelectionWidthInPixels >= 0) { lValue = rValue - this._minSelectionWidthInPixels; positionChanged = true; } } this._leftUnselectedRegion.style.width = lValue + "px"; this._rightUnselectedRegion.style.left = rValue + "px"; this._rightUnselectedRegion.style.width = Math.ceil(this._graphContainer.clientWidth - rValue) + "px"; this._selectionPixelStartX = lValue; this._selectionPixelWidth = rValue - lValue; if(positionChanged) { this.raiseSelectionChanged(false); } } if(this._graph && this._graph.resize) { this._graph.resize(e); } this.drawVerticalLines(); }; SwimLane.prototype.renderHeader = function () { var headerDiv = document.createElement("div"); headerDiv.classList.add(this._swimLaneHeaderCss); this._container.appendChild(headerDiv); this._config.header.title.titleText = this._config.header.title.titleText; this._config.header.title.unit = this._graphConfig.unit; this._config.header.legend = this._graphConfig.legend; this._header = new Header(this._config.header, headerDiv); this._header.render(); this._header.title.registerCallback(DiagnosticsHub.TitleEvents.Click, this._titleClickHandler); this._header.title.registerCallback(DiagnosticsHub.TitleEvents.KeyPress, this._titleClickHandler); }; SwimLane.prototype.renderBody = function () { if(this._config.body) { if(!this._body) { this._body = document.createElement("div"); this._body.classList.add(this._swimLaneBodyCss); var graphHeight = this._minimumGraphHeight; if(this._config.body.graph && this._config.body.graph) { if(this._config.body.graph.height == null || typeof this._config.body.graph.height == "undefined" || this._config.body.graph.height < this._minimumGraphHeight) { this._config.body.graph.height = this._minimumGraphHeight; } } else { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1002")); } this._body.style.height = this._config.body.graph.height + "px"; this._container.appendChild(this._body); } else { while(this._body.hasChildNodes()) { this._body.removeChild(this._body.firstChild); } } var scale; if(this._config.body.leftScale) { this._config.body.leftScale.minimum = this._graphConfig.scale.minimum; this._config.body.leftScale.maximum = this._graphConfig.scale.maximum; this._config.body.leftScale.axes = this._graphConfig.scale.axes; this._leftScale = new Scale(this._config.body.leftScale, this._body); this._leftScale.render(); scale = this._config.body.leftScale; } if(this._config.body.rightScale) { this._config.body.rightScale.minimum = this._graphConfig.scale.minimum; this._config.body.rightScale.maximum = this._graphConfig.scale.maximum; this._config.body.rightScale.axes = this._graphConfig.scale.axes; this._rightScale = new Scale(this._config.body.rightScale, this._body); this._rightScale.render(); scale = this._config.body.rightScale; } this._graphContainer = document.createElement("div"); this._graphContainer.classList.add(this._graphDivCss); this._graphContainer.tabIndex = 0; if(this._config.isSelectionEnabled) { this._graphContainer.addEventListener("mousedown", this._startSelection); } this._graphContainer.setAttribute("aria-label", this._config.header.description); this._body.appendChild(this._graphContainer); var graph = document.createElement("div"); graph.id = this._graphId; this._graphContainer.appendChild(graph); this.drawVerticalLines(); if(scale) { this._axes = new Axes(scale, this._graphContainer); this._axes.render(); } this.calculateHandlerPosition(); if(this._config.isSelectionEnabled) { this.initializeUnselectedRegions(); } } else { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1002")); } }; SwimLane.prototype.drawVerticalLines = function () { if(this._graphContainer) { var children = this._graphContainer.getElementsByClassName(this._verticalLineCss); while(children.length > 0) { this._graphContainer.removeChild(children[0]); } var current = this._graph.getViewPortTimeRange(); var lines = this._config.getVerticalRulerLinePositions(current, this._graphContainer.clientWidth); for(var i = 0; i < lines.length; i++) { var line = document.createElement("div"); line.classList.add(this._verticalLineCss); line.style.left = lines[i] + "%"; this._graphContainer.appendChild(line); } } }; SwimLane.prototype.calculateHandlerPosition = function () { if(this._graph && this._graph.getViewPortTimeRange) { var current = this._graph.getViewPortTimeRange(); this._selectionPixelStartX = (this._selectionTimeRange.begin.nsec - current.begin.nsec) / current.elapsed.nsec * this._graphContainer.clientWidth; this._selectionPixelWidth = this._selectionTimeRange.elapsed.nsec / current.elapsed.nsec * this._graphContainer.clientWidth; } }; SwimLane.prototype.getSelectionStartWidth = function (event) { var mouseX = event.clientX - this._graphContainer.offsetLeft; return mouseX; }; SwimLane.prototype.drag = function (event) { var xPixel = this.getSelectionStartWidth(event); if(xPixel >= 0 && xPixel <= this._graphContainer.clientWidth) { this._dragDirection = SwimLane.getDragDirection(xPixel - this._initialSelectionPixelStartX); this._selectionPixelWidth = Math.abs(xPixel - this._initialSelectionPixelStartX); if(this._dragDirection === DiagnosticsHub.DragDirection.left) { this._selectionPixelStartX = this._initialSelectionPixelStartX - this._selectionPixelWidth; } this.drawSelection(); this.raiseSelectionChanged(true); } }; SwimLane.prototype.drawSelection = function () { this._leftUnselectedRegion.style.width = this._selectionPixelStartX + "px"; this._rightUnselectedRegion.style.left = (this._selectionPixelStartX + this._selectionPixelWidth) + "px"; this._rightUnselectedRegion.style.width = (this._graphContainer.clientWidth - (this._selectionPixelStartX + this._selectionPixelWidth)) + "px"; }; SwimLane.prototype.ensureMinSelectionWidth = function () { if(typeof this._selectionPixelStartX === "undefined") { return; } if(Math.abs(this._selectionPixelWidth) < this._minSelectionWidthInPixels) { this._selectionPixelWidth = this._minSelectionWidthInPixels; switch(this._dragDirection) { case DiagnosticsHub.DragDirection.right: if(this._selectionPixelStartX + this._selectionPixelWidth > this._graphContainer.clientWidth) { this._selectionPixelStartX = this._graphContainer.clientWidth - this._selectionPixelWidth; } break; case DiagnosticsHub.DragDirection.left: if(this._selectionPixelStartX - this._selectionPixelWidth < 0) { this._selectionPixelStartX = 0; } else if(this._selectionPixelStartX + this._selectionPixelWidth > this._graphContainer.clientWidth) { this._selectionPixelStartX = this._graphContainer.clientWidth - this._selectionPixelWidth; } else { this._selectionPixelStartX = this._initialSelectionPixelStartX - this._selectionPixelWidth; } break; default: if(this._selectionPixelStartX + (this._selectionPixelWidth / 2) > this._graphContainer.clientWidth) { this._selectionPixelStartX = this._graphContainer.clientWidth - this._selectionPixelWidth; } else if(this._selectionPixelStartX - (this._selectionPixelWidth / 2) < 0) { this._selectionPixelStartX = 0; } else { this._selectionPixelStartX = this._selectionPixelStartX - (this._selectionPixelWidth / 2); } break; } } }; SwimLane.prototype.convertChartAreaPercentToDataValue = function (pixel) { var currentTimeRange = this._graph.getViewPortTimeRange(); return Math.round(pixel * currentTimeRange.elapsed.nsec / this._graphContainer.clientWidth) + currentTimeRange.begin.nsec; }; SwimLane.prototype.initializeUnselectedRegions = function () { this._leftUnselectedRegion = this.createUnselectedRegion(0, this._selectionPixelStartX); this._rightUnselectedRegion = this.createUnselectedRegion(this._selectionPixelStartX + this._selectionPixelWidth, this._graphContainer.clientWidth - this._selectionPixelStartX - this._selectionPixelWidth); this._graphContainer.appendChild(this._leftUnselectedRegion); this._graphContainer.appendChild(this._rightUnselectedRegion); }; SwimLane.prototype.startSelection = function (event) { this._initialSelectionPixelStartX = this._selectionPixelStartX = this.getSelectionStartWidth(event); this._selectionPixelWidth = 0; this._dragDirection = SwimLane.getDragDirection(this._selectionPixelWidth); this._graphContainer.addEventListener("mousemove", this._dragHandler); this._graphContainer.addEventListener("mouseup", this._mouseupHandler); this._graphContainer.setCapture(true); this.drawSelection(); }; SwimLane.prototype.stopSelection = function (event) { this._graphContainer.removeEventListener("mousemove", this._dragHandler); this._graphContainer.removeEventListener("mouseup", this._mouseupHandler); this._graphContainer.releaseCapture(); this.ensureMinSelectionWidth(); this.drawSelection(); this._dragDirection = DiagnosticsHub.DragDirection.none; this.raiseSelectionChanged(false); }; SwimLane.prototype.createUnselectedRegion = function (left, width) { var rect = document.createElement("div"); rect.style.height = this._graphContainer.offsetHeight + "px"; rect.style.width = width + "px"; rect.style.left = left + "px"; rect.style.top = "0px"; rect.className = "unselected"; return rect; }; SwimLane.getDragDirection = function getDragDirection(selectionWidth) { if(selectionWidth > 0) { return DiagnosticsHub.DragDirection.right; } else if(selectionWidth < 0) { return DiagnosticsHub.DragDirection.left; } return DiagnosticsHub.DragDirection.none; }; SwimLane.prototype.raiseSelectionChanged = function (isIntermittent) { if (typeof isIntermittent === "undefined") { isIntermittent = false; } var minValue = this.convertChartAreaPercentToDataValue(this._selectionPixelStartX); var maxValue = this.convertChartAreaPercentToDataValue(this._selectionPixelStartX + this._selectionPixelWidth); var begin = DiagnosticsHub.Common.TimeStamp.fromNanoseconds(minValue); var end = DiagnosticsHub.Common.TimeStamp.fromNanoseconds(maxValue); if(this._selectionTimeRange && (this._selectionTimeRange.begin !== begin || this._selectionTimeRange.end !== end)) { this._selectionTimeRange = new DiagnosticsHub.Common.TimeSpan(begin, end); this.invokeEventListener(DiagnosticsHub.SwimlaneEvents.Filter, { position: this._selectionTimeRange, invoker: this._graphId, isIntermittent: isIntermittent }); } }; SwimLane.prototype.setBodyVisibility = function (arg) { if(arg && arg.data && typeof arg.data.visible !== "undefined") { this.setGraphVisibility(arg.data.visible); } }; SwimLane.prototype.setGraphVisibility = function (visible) { this._body.style.display = visible ? "-ms-grid" : "none"; this._isVisible = visible; if(visible && this._graph) { if(this._config.isSelectionEnabled) { this.calculateHandlerPosition(); this.drawSelection(); } this.drawVerticalLines(); this._graph.render(); } if(this._publisher) { this._publisher.invokeListener({ data: { visible: visible }, type: DiagnosticsHub.SwimlaneEvents.Visibility }); } }; SwimLane.prototype.invokeEventListener = function (type, data) { switch(type) { case DiagnosticsHub.GraphEvents.ScaleInfoChanged: if(data) { if(this._leftScale) { this._leftScale.config = data; this._leftScale.render(); } if(this._rightScale) { this._rightScale.config.minimum = data.minimum; this._rightScale.render(); } if(this._axes) { this._axes.config = data; this._axes.render(); } } break; default: if(this._publisher) { this._publisher.invokeListener({ type: type, data: data }); } } }; SwimLane.prototype.invokeGraphEventListener = function (type, data) { if(type) { if(data) { switch(type) { case DiagnosticsHub.GraphEvents.ScaleInfoChanged: if(this._leftScale) { this._leftScale.Minimum = data.minimum; this._leftScale.Maximum = data.maximum; this._leftScale.render(); } if(this._rightScale) { this._rightScale.Minimum = data.minimum; this._rightScale.Maximum = data.maximum; this._rightScale.render(); } if(this._axes) { this._axes.Minimum = data.minimum; this._axes.Maximum = data.maximum; this._axes.render(); } if(this._header) { this._header.title.Unit = data.unit; } break; } } } }; Object.defineProperty(SwimLane.prototype, "isVisible", { get: function () { return this._isVisible; }, enumerable: true, configurable: true }); SwimLane.prototype.addEventListener = function (eventType, func) { if(this._publisher) { this._publisher.addEventListener(eventType, func); } }; SwimLane.prototype.removeEventListener = function (eventType, func) { if(this._publisher) { this._publisher.removeEventListener(eventType, func); } }; SwimLane.prototype.render = function () { while(this._container.hasChildNodes()) { this._container.removeChild(this._container.firstChild); } this._graphConfig = this._graph.getGraphConfiguration(); this.renderHeader(); this.renderBody(); if(this._config.header.title.isBodyExpanded === null || typeof this._config.header.title.isBodyExpanded === "undefined" || this._config.header.title.isBodyExpanded) { this._graph.render(); } else { this.setGraphVisibility(false); } }; SwimLane.prototype.zoom = function (current, selection) { if(current) { if(this._graph && this._graph.setViewPortTimeRange) { this._graph.setViewPortTimeRange(current); this._selectionTimeRange = current; if(selection) { this._selectionTimeRange = selection; } if(this._body.style.display !== "none") { this.calculateHandlerPosition(); this.drawSelection(); this.drawVerticalLines(); } } else { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1003")); } } }; SwimLane.prototype.setSelection = function (selection) { if(selection) { this._selectionTimeRange = selection; if(this._body.style.display !== "none") { this.calculateHandlerPosition(); this.drawSelection(); } } }; SwimLane.prototype.getSelection = function () { return this._selectionTimeRange; }; SwimLane.prototype.addGraphSeriesData = function (counterId, points, fullRender) { if(points) { this._graph.addSeriesData(counterId, points, fullRender); } }; SwimLane.prototype.updateTimeRange = function (viewPort) { if(viewPort) { this._graph.setViewPortTimeRange(viewPort); this.drawVerticalLines(); } }; SwimLane.prototype.setGraphState = function (state) { if(state && this._graph) { this._graph.setGraphState(state); } }; SwimLane.prototype.removeInvalidPoints = function (base) { if(this._graph && base) { this._graph.removeInvalidPoints(base); } }; return SwimLane; })(); DiagnosticsHub.SwimLane = SwimLane; var SwimLaneConfiguration = (function () { function SwimLaneConfiguration() { this.containerId = ""; this.header = { title: { isBodyExpanded: true, titleText: "Graph", unit: "unit", isGraphCollapsible: true }, legend: { data: [] }, description: null }; this.body = { leftScale: { width: 40, isVisible: true, type: DiagnosticsHub.ScaleType.Left, borderWidth: 1, axes: [], minimum: 0, maximum: 100 }, rightScale: { width: 40, isVisible: true, type: DiagnosticsHub.ScaleType.Right, borderWidth: 1, axes: [], minimum: 0, maximum: 100 }, graph: { height: 100, registeredClass: null, loadCss: null, jsonConfig: { } }, events: [ DiagnosticsHub.SwimlaneEvents.Filter, DiagnosticsHub.SwimlaneEvents.Graph, DiagnosticsHub.SwimlaneEvents.Visibility ] }; this.minSelectionWidthInPixels = 10; this.isSelectionEnabled = true; this.isZoomEnabled = true; } return SwimLaneConfiguration; })(); DiagnosticsHub.SwimLaneConfiguration = SwimLaneConfiguration; var Header = (function () { function Header(config, container) { this._legendContainerCss = "legend-container"; this._titleContainerCss = "title-container"; if(config) { this._config = config; } else { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1002")); } if(container) { this._container = container; } else { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1004")); } } Header.prototype.renderTitle = function () { var titleContainer = document.createElement("div"); titleContainer.className = this._titleContainerCss; this._container.appendChild(titleContainer); this.title = new Title(this._config.title, titleContainer); this.title.render(); }; Header.prototype.renderLegend = function () { var legendContainer = document.createElement("div"); legendContainer.className = this._legendContainerCss; this._container.appendChild(legendContainer); this.legend = new Legend(this._config.legend, legendContainer); this.legend.render(); }; Header.prototype.render = function () { this.renderTitle(); this.renderLegend(); }; return Header; })(); DiagnosticsHub.Header = Header; var Legend = (function () { function Legend(config, container) { this._legendDivCss = "legend-div"; this._legendTextDivCss = "legend-text-div"; this._legendColorCss = "legend-color"; this._legendColorDivCss = "legend-color-div"; if(config) { this._config = config; } else { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1002")); } if(container) { this._container = container; } else { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1004")); } } Legend.prototype.render = function () { if(this._config.data) { for(var i = 0; i < this._config.data.length; i++) { var legendColorDiv = document.createElement("div"); legendColorDiv.className = this._legendColorDivCss; var colorDiv = document.createElement("div"); colorDiv.className = this._legendColorCss; colorDiv.style.backgroundColor = (this._config.data[i]).color; legendColorDiv.appendChild(colorDiv); var legendTextDiv = document.createElement("div"); legendTextDiv.className = this._legendTextDivCss; legendTextDiv.innerText = this._config.data[i].legendText; var individualLegendBox = document.createElement("div"); individualLegendBox.className = this._legendDivCss; individualLegendBox.appendChild(legendColorDiv); individualLegendBox.appendChild(legendTextDiv); this._container.appendChild(individualLegendBox); } } }; return Legend; })(); DiagnosticsHub.Legend = Legend; var Title = (function () { function Title(config, container) { this._callbackArr = []; this._focused = false; this._titleTextCss = "title-text"; this._titleExpandButtonCss = "title-expand-button"; this._titleCollapseButtonCss = "title-collapse-button"; this._titleButtonDisabledCss = "title-button-disabled"; if(config) { this._config = config; } else { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1002")); } if(container) { this._container = container; } else { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1004")); } this._publisher = new DiagnosticsHub.Common.Publisher([ DiagnosticsHub.TitleEvents.Click, DiagnosticsHub.TitleEvents.KeyPress ]); } Title.prototype.onTabFocus = function (e) { this._focused = true; }; Title.prototype.onTabBlur = function (e) { this._focused = false; }; Title.prototype.onKeyDown = function (e) { if(this._focused && DiagnosticsHub.Common.KeyCodes.ENTER === e.keyCode) { this.setRegionState(DiagnosticsHub.TitleEvents.KeyPress); } }; Title.prototype.mouseClick = function (e) { this.setRegionState(DiagnosticsHub.TitleEvents.Click); }; Title.prototype.setRegionState = function (evt) { this._config.isBodyExpanded = !this._config.isBodyExpanded; this.setAraiLabelAndStylesheet(); this._publisher.invokeListener({ type: evt, data: { visible: this._config.isBodyExpanded } }); }; Title.prototype.setAraiLabelAndStylesheet = function () { if(this._config.isBodyExpanded === null || this._config.isBodyExpanded === undefined || this._config.isBodyExpanded) { this._titleCollapseExpandButton.className = this._titleExpandButtonCss; this._titleCollapseExpandButton.setAttribute("aria-label", Plugin.Resources.getString("SwimlaneCollapseAriaLabel")); } else { this._titleCollapseExpandButton.className = this._titleCollapseButtonCss; this._titleCollapseExpandButton.setAttribute("aria-label", Plugin.Resources.getString("SwimlaneExpandAriaLabel")); } }; Title.prototype.renderTitleText = function () { this._titleText = document.createElement("div"); this._titleText.className = this._titleTextCss; var text = ""; if(this._config.titleText) { text = this._config.titleText; } else { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1005")); } if(this._config.unit) { text += " (" + this._config.unit + ")"; } this._titleText.innerHTML = text; this._container.appendChild(this._titleText); }; Title.prototype.renderTitleCollapseExpandButton = function () { this._titleCollapseExpandButton = document.createElement("div"); if(this._config.isGraphCollapsible) { this._titleCollapseExpandButton.setAttribute("role", "button"); this.setAraiLabelAndStylesheet(); this._titleCollapseExpandButton.addEventListener("click", this.mouseClick.bind(this)); this._titleCollapseExpandButton.tabIndex = 0; this._titleCollapseExpandButton.addEventListener("focus", this.onTabFocus.bind(this)); this._titleCollapseExpandButton.addEventListener("blur", this.onTabBlur.bind(this)); this._titleCollapseExpandButton.addEventListener("keydown", this.onKeyDown.bind(this)); } else { this._titleCollapseExpandButton.classList.add(this._titleButtonDisabledCss); } this._container.appendChild(this._titleCollapseExpandButton); }; Title.prototype.render = function () { this.renderTitleCollapseExpandButton(); this.renderTitleText(); }; Title.prototype.registerCallback = function (evt, callback) { this._publisher.addEventListener(evt, callback); }; Object.defineProperty(Title.prototype, "Unit", { set: function (value) { if(this._titleText) { var text = this._config.titleText; this._config.unit = value; if(value) { text += " (" + value + ")"; } this._titleText.innerHTML = text; } }, enumerable: true, configurable: true }); return Title; })(); DiagnosticsHub.Title = Title; var Scale = (function () { function Scale(config, container) { this._scaleLeftCss = "graph-scale-left"; this._scaleRightCss = "graph-scale-right"; this._axisLeftCss = "graph-axis-left"; this._axisRightCss = "graph-axis-right"; if(config) { this.config = config; } else { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1002")); } if(container) { this._container = container; } else { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1004")); } } Scale.prototype.drawAxisValue = function (position, value) { var axisDiv = document.createElement("div"); axisDiv.className = this.config.type === DiagnosticsHub.ScaleType.Left ? this._axisLeftCss : this._axisRightCss; axisDiv.innerHTML = value.toString(); this._graphScale.appendChild(axisDiv); var top = 0; switch(position) { case DiagnosticsHub.AxisPositionType.top: top = 0; break; case DiagnosticsHub.AxisPositionType.middle: var y = Math.floor(((this.config.maximum - value) / (this.config.maximum - this.config.minimum)) * this._container.offsetHeight); top = y - (axisDiv.offsetHeight / 2); break; case DiagnosticsHub.AxisPositionType.bottom: top = this._container.offsetHeight - axisDiv.offsetHeight; break; } axisDiv.style.top = top + "px"; }; Scale.prototype.render = function () { if(!this._graphScale) { this._graphScale = document.createElement("div"); this._graphScale.className = this.config.type === DiagnosticsHub.ScaleType.Left ? this._scaleLeftCss : this._scaleRightCss; this._graphScale.style.width = this.config.width + "px"; if(this.config.type === DiagnosticsHub.ScaleType.Left) { this._graphScale.style.borderRightWidth = this.config.borderWidth + "px"; } else { this._graphScale.style.borderLeftWidth = this.config.borderWidth + "px"; } this._container.appendChild(this._graphScale); } else { while(this._graphScale.childNodes.length > 0) { this._graphScale.removeChild(this._graphScale.firstChild); } } if((this.config.isVisible || this.config.isVisible === null || typeof this.config.isVisible === "undefined") && this.config.width) { if(this.config.minimum !== null && typeof this.config.minimum !== "undefined" && this.config.maximum !== null && typeof this.config.maximum !== "undefined") { if(this.config.axes && this.config.axes.length > 0) { for(var i = 0; i < this.config.axes.length; i++) { var axis = this.config.axes[i]; this.drawAxisValue(DiagnosticsHub.AxisPositionType.middle, axis.value); } } else { this.drawAxisValue(DiagnosticsHub.AxisPositionType.top, this.config.maximum); this.drawAxisValue(DiagnosticsHub.AxisPositionType.bottom, this.config.minimum); } } else { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1006")); } } }; Object.defineProperty(Scale.prototype, "Minimum", { set: function (value) { if(typeof value !== "undefined" && value !== null) { this.config.minimum = value; } }, enumerable: true, configurable: true }); Object.defineProperty(Scale.prototype, "Maximum", { set: function (value) { if(typeof value !== "undefined" && value !== null) { this.config.maximum = value; } }, enumerable: true, configurable: true }); return Scale; })(); DiagnosticsHub.Scale = Scale; var Axes = (function () { function Axes(config, container) { this._axisLineCss = "graph-axis-line"; if(config) { this.config = config; } else { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1002")); } if(container) { this._container = container; } else { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1004")); } } Axes.prototype.drawAxisLine = function (value) { var axisLine = document.createElement("div"); axisLine.className = this._axisLineCss; this._container.appendChild(axisLine); var y = Math.floor(((this.config.maximum - value) / (this.config.maximum - this.config.minimum)) * this._container.offsetHeight); axisLine.style.top = y - (axisLine.offsetHeight / 2) + "px"; }; Axes.prototype.render = function () { var children = this._container.getElementsByClassName(this._axisLineCss); if(children) { while(children.length > 0) { this._container.removeChild(children[children.length - 1]); } } if(this.config.axes && this.config.axes.length > 0) { for(var i = 0; i < this.config.axes.length; i++) { var axis = this.config.axes[i]; this.drawAxisLine(axis.value); } } }; Object.defineProperty(Axes.prototype, "Minimum", { set: function (value) { if(typeof value !== "undefined" && value !== null) { this.config.minimum = value; } }, enumerable: true, configurable: true }); Object.defineProperty(Axes.prototype, "Maximum", { set: function (value) { if(typeof value !== "undefined" && value !== null) { this.config.maximum = value; } }, enumerable: true, configurable: true }); return Axes; })(); DiagnosticsHub.Axes = Axes; })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {})); var DiagnosticsHub = VisualStudio.DiagnosticsHub; })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {})); var VisualStudio = Microsoft.VisualStudio; })(Microsoft || (Microsoft = {})); var Microsoft; (function (Microsoft) { (function (VisualStudio) { (function (DiagnosticsHub) { (function (Common) { var ElementRecyclerFactory = (function () { function ElementRecyclerFactory(container, elementCreator) { this._container = container; this._elementCreator = elementCreator; this._index = null; this._elements = []; this._recycledElements = []; } ElementRecyclerFactory.forDivWithClass = function forDivWithClass(container, className) { return new ElementRecyclerFactory(container, function () { var element = document.createElement("div"); element.className = className; return element; }); }; ElementRecyclerFactory.prototype.start = function () { this._index = 0; }; ElementRecyclerFactory.prototype.getNext = function () { if(this._index === null) { throw ""; } var element = this._elements[this._index]; if(!element) { if(this._recycledElements.length > 0) { element = this._recycledElements.pop(); } else { element = this._elementCreator(); } this._elements.push(element); this._container.appendChild(element); } this._index++; return element; }; ElementRecyclerFactory.prototype.stop = function () { if(this._index === null) { return; } for(var i = this._elements.length - 1; i >= this._index; --i) { var element = this._elements.pop(); this._recycledElements.push(element); this._container.removeChild(element); } this._index = null; }; ElementRecyclerFactory.prototype.recycleAll = function () { for(var i = this._elements.length - 1; i >= 0; --i) { var element = this._elements.pop(); this._recycledElements.push(element); this._container.removeChild(element); } }; ElementRecyclerFactory.prototype.removeAll = function () { for(var i = this._elements.length - 1; i >= 0; --i) { var element = this._elements.pop(); this._container.removeChild(element); } this._elements = []; this._recycledElements = []; }; return ElementRecyclerFactory; })(); Common.ElementRecyclerFactory = ElementRecyclerFactory; })(DiagnosticsHub.Common || (DiagnosticsHub.Common = {})); var Common = DiagnosticsHub.Common; })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {})); var DiagnosticsHub = VisualStudio.DiagnosticsHub; })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {})); var VisualStudio = Microsoft.VisualStudio; })(Microsoft || (Microsoft = {})); var Microsoft; (function (Microsoft) { (function (VisualStudio) { (function (DiagnosticsHub) { var RulerConfig = (function () { function RulerConfig(containerId) { this.containerId = "rulerContainer"; this.className = "ruler-container"; this.id = ""; this.doubleSlider = { containerId: "sliderContainer", className: "ruler-body", id: "rulerBody", height: 1.8, events: [ DiagnosticsHub.RulerEvents.Filter ], leftSlider: { left: 0, width: 5, className: "ruler-slider" }, rightSlider: { left: 0, width: 5, className: "ruler-slider" }, bar: { className: "ruler-bar", id: "rulerBar", left: 40, right: 40 }, timeRange: new DiagnosticsHub.Common.TimeSpan(), step: 1, markSeries: [], minimumRangeInPixel: 10, minimumZoomLevelMsec: 50, isSelectionEnabled: true, isZoomEnabled: true }; this.header = { containerId: "rulerHeaderContainer", className: "ruler-header", titleConfig: { containerId: "rulerTitleContainer", className: "ruler-title-container", text: "Diagnostic Session", isExpanded: true, description: "" }, legendConfig: { containerId: "rulerLegendContainer", className: "ruler-legend-container", data: [] } }; if(containerId) { this.containerId = containerId; } else { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1001")); } } return RulerConfig; })(); DiagnosticsHub.RulerConfig = RulerConfig; var Ruler = (function () { function Ruler(config) { this._rulerAreaCss = "ruler-area"; if(config && config.containerId) { this._parent = document.getElementById(config.containerId); if(this._parent) { this._config = config; this.initialize(this._config); } else { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1001")); } } else { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1002")); } } Ruler.prototype.deinitialize = function () { if(this._doubleSlider) { this._doubleSlider.deinitialize(); } }; Ruler.prototype.initialize = function (object) { for(var property in object) { if(object[property] && (property === "id" || property === "containerId")) { object[property] += RulerUtilities.getRandomNumber(); } else if(typeof object[property] === "object" && property !== "data" && property !== "markSeries") { this.initialize(object[property]); } } }; Ruler.prototype.zoom = function (current, selection) { this._doubleSlider.zoom(current, selection); }; Ruler.prototype.addEventListener = function (eventType, func) { this._doubleSlider.addEventListener(eventType, func); }; Ruler.prototype.removeEventListener = function (eventType, func) { this._doubleSlider.removeEventListener(eventType, func); }; Ruler.prototype.setHandlePosition = function (timeRange) { this._doubleSlider.SliderHandlePosition = timeRange; }; Object.defineProperty(Ruler.prototype, "Series", { get: function () { return this._config.doubleSlider.markSeries; }, enumerable: true, configurable: true }); Ruler.prototype.render = function () { if(!this._container) { this._container = document.createElement("div"); this._container.style.width = "100%"; this._container.style.height = "100%"; this._parent.appendChild(this._container); } while(this._container.hasChildNodes()) { this._container.removeChild(this._container.firstChild); } this._container.classList.add(this._config.className); this._headerDiv = document.createElement("div"); this._headerDiv.className = this._config.header.className; this._headerDiv.id = this._config.header.containerId; this._container.appendChild(this._headerDiv); this._body = document.createElement("div"); this._body.id = this._config.doubleSlider.containerId; this._body.style.height = this._config.doubleSlider.height + "em"; this._container.appendChild(this._body); var i = 0; for(i = 0; i < this._config.doubleSlider.markSeries.length; i++) { var series = this._config.doubleSlider.markSeries[i]; series.index = i; series.type = series.type || DiagnosticsHub.MarkType.LifeCycleEvent; this._config.header.legendConfig.data.push({ text: series.label, type: series.type, tooltip: series.tooltip }); } this._config.header.titleConfig.description = RulerUtilities.formatTitleTime(this._config.doubleSlider.timeRange.elapsed, DiagnosticsHub.UnitFormat.fullName); this._header = new RulerHeader(this._config.header); this._header.render(); this._doubleSlider = new DoubleSlider(this._config.doubleSlider); this._doubleSlider.render(); }; Ruler.prototype.addMark = function (id, timeStamp, toolTip) { if(this._doubleSlider) { var markData = new MarkData(timeStamp, toolTip); this._doubleSlider.addMark(id, markData); } }; Ruler.prototype.getHandlePosition = function () { return this._doubleSlider.SliderHandlePosition; }; Ruler.prototype.updateTimeRange = function (viewPort, original) { this._doubleSlider.updateTimeRange(viewPort); }; Ruler.prototype.setDiagnosticsSessionTimeRange = function (range) { if(this._header && range) { this._header.Title = RulerUtilities.formatTitleTime(range, DiagnosticsHub.UnitFormat.fullName, true); } }; Ruler.prototype.addMarkSeries = function (id, type) { if(this._doubleSlider) { this._doubleSlider.addMarkSeries(id, type); } }; Ruler.prototype.setState = function (state) { this._doubleSlider.setState(state); }; Ruler.prototype.resize = function () { this._doubleSlider.resize(null); }; return Ruler; })(); DiagnosticsHub.Ruler = Ruler; var DoubleSlider = (function () { function DoubleSlider(config) { this._containerOffsetWidth = null; this._focused = false; this._rulerUnselectedCss = "ruler-unselected"; this._rulerBodyCss = "ruler-body"; this._isZoomed = false; this._selectionPixelStartX = 0; this._selectionPixelWidth = 0; this._rulerState = DiagnosticsHub.GraphState.Roll; this._onResizeHandler = this.resize.bind(this); if(config && config.containerId) { this._container = document.getElementById(config.containerId); if(this._container) { this._config = config; this.initialize(); } else { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1001")); } } else { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1002")); } } DoubleSlider.prototype.deinitialize = function () { window.removeEventListener("resize", this._onResizeHandler); if(this._scale) { this._scale.deinitialize(); } }; Object.defineProperty(DoubleSlider.prototype, "containerOffsetWidth", { get: function () { return this._container.offsetWidth; }, enumerable: true, configurable: true }); DoubleSlider.prototype.initialize = function () { this._publisher = new DiagnosticsHub.Common.Publisher(this._config.events); window.addEventListener("resize", this._onResizeHandler); this._currentTimeRange = this._config.timeRange; this._handlePosition = this._currentTimeRange; if(this._config.isSelectionEnabled) { this._tabFocus = this.onTabFocus.bind(this); this._tabBlur = this.onTabBlur.bind(this); this._keyDown = this.onKeyDown.bind(this); this._keyUp = this.onKeyUp.bind(this); this._mouseMoveListener = this.onMouseMove.bind(this); this._mouseUpListener = this.onMouseUp.bind(this); this._startSelection = this.onStartSelection.bind(this); this._onDrag = this.onDrag.bind(this); this._container.addEventListener("mousedown", this._startSelection); } }; DoubleSlider.prototype.raiseFilterEvent = function (position, isIntermittent) { if (typeof isIntermittent === "undefined") { isIntermittent = false; } var args = { type: DiagnosticsHub.RulerEvents.Filter, data: { position: position, isIntermittent: isIntermittent } }; this._publisher.invokeListener(args); }; DoubleSlider.prototype.renderRulerBar = function () { this._bar = document.createElement("div"); this._bar.id = this._config.bar.id; this._bar.className = this._config.bar.className; this._bar.style.left = (this._config.bar.left) + "px"; this._bar.style.width = (this.containerOffsetWidth - this._config.bar.left - this._config.bar.right - 2) + "px"; this._container.appendChild(this._bar); }; DoubleSlider.prototype.renderRulerScale = function () { var config = { timeRange: this._currentTimeRange, containerId: this._bar.id, series: this._config.markSeries }; this._scale = new RulerScale(config); this._scale.render(); this.setAriaLabelForRuler(); this.setAriaLabelForSliders(); }; DoubleSlider.prototype.renderLeftSliderHandle = function () { this._lSlider = document.createElement("div"); this._lSlider.className = this._config.leftSlider.className; this._lSlider.style.width = this._config.leftSlider.width + "px"; var sliderLeft = this._config.bar.left - this._config.leftSlider.width; this._lSlider.style.left = sliderLeft + "px"; this._lSlider.tabIndex = 0; this._container.appendChild(this._lSlider); this._config.leftSlider.left = sliderLeft; this._lSlider.addEventListener("mousedown", this.mouseDown.bind(this)); this._lSlider.addEventListener("focus", this._tabFocus); this._lSlider.addEventListener("blur", this._tabBlur); this.setAriaLabelForLeftSlider(); this._lUnselectedRegion = document.createElement("div"); this._lUnselectedRegion.className = this._rulerUnselectedCss; this._lUnselectedRegion.style.width = "0px"; this._lUnselectedRegion.style.left = this._config.bar.left + "px"; this._container.appendChild(this._lUnselectedRegion); }; DoubleSlider.prototype.setAriaLabelForLeftSlider = function () { if(this._lSlider) { this._lSlider.setAttribute("role", "slider"); this._lSlider.setAttribute("aria-label", Plugin.Resources.getString("RulerLeftSliderAriaLabel")); var label = Plugin.Resources.getString("RulerSliderAriaValueText", RulerUtilities.formatTime(this._handlePosition.begin, DiagnosticsHub.UnitFormat.fullName), RulerUtilities.formatTime(this._currentTimeRange.begin, DiagnosticsHub.UnitFormat.fullName), RulerUtilities.formatTime(this._handlePosition.end, DiagnosticsHub.UnitFormat.fullName)); this._lSlider.setAttribute("aria-valuetext", label); this._lSlider.setAttribute("aria-valuenow", this._handlePosition.begin.sec.toString()); this._lSlider.setAttribute("aria-valuemin", this._currentTimeRange.begin.sec.toString()); this._lSlider.setAttribute("aria-valuemax", this._handlePosition.end.sec.toString()); } }; DoubleSlider.prototype.setAriaLabelForRightSlider = function () { if(this._rSlider) { this._rSlider.setAttribute("role", "slider"); this._rSlider.setAttribute("aria-label", Plugin.Resources.getString("RulerRightSliderAriaLabel")); var label = Plugin.Resources.getString("RulerSliderAriaValueText", RulerUtilities.formatTime(this._handlePosition.end, DiagnosticsHub.UnitFormat.fullName), RulerUtilities.formatTime(this._handlePosition.begin, DiagnosticsHub.UnitFormat.fullName), RulerUtilities.formatTime(this._currentTimeRange.end, DiagnosticsHub.UnitFormat.fullName)); this._rSlider.setAttribute("aria-valuetext", label); this._rSlider.setAttribute("aria-valuenow", this._handlePosition.end.sec.toString()); this._rSlider.setAttribute("aria-valuemin", this._handlePosition.begin.sec.toString()); this._rSlider.setAttribute("aria-valuemax", this._currentTimeRange.end.sec.toString()); } }; DoubleSlider.prototype.setAriaLabelForSliders = function () { this.setAriaLabelForLeftSlider(); this.setAriaLabelForRightSlider(); }; DoubleSlider.prototype.renderRightSliderHandle = function () { this._rSlider = document.createElement("div"); this._rSlider.className = this._config.rightSlider.className; this._rSlider.style.width = this._config.rightSlider.width + "px"; var sliderLeft = this.containerOffsetWidth - this._config.bar.right; this._rSlider.style.left = sliderLeft + "px"; this._rSlider.tabIndex = 0; this._container.appendChild(this._rSlider); this._config.rightSlider.left = sliderLeft; this._rSlider.addEventListener("mousedown", this.mouseDown.bind(this)); this._rSlider.addEventListener("focus", this._tabFocus); this._rSlider.addEventListener("blur", this._tabBlur); this.setAriaLabelForRightSlider(); this._rUnselectedRegion = document.createElement("div"); this._rUnselectedRegion.className = this._rulerUnselectedCss; this._rUnselectedRegion.style.width = "0px"; this._rUnselectedRegion.style.left = sliderLeft + "px"; this._container.appendChild(this._rUnselectedRegion); }; DoubleSlider.prototype.resize = function (e) { this.invalidateSizeCache(); var newRulerBarWidth = this.containerOffsetWidth - this._config.bar.left - this._config.bar.right; if(this._bar) { this._bar.style.width = newRulerBarWidth + "px"; if(this._config.isSelectionEnabled) { var lValue = this.convertToPixel(this._handlePosition.begin); var rValue = this.convertToPixel(this._handlePosition.end); var positionChanged = false; if(rValue - lValue < this._config.minimumRangeInPixel) { if(lValue + this._config.minimumRangeInPixel <= newRulerBarWidth) { rValue = lValue + this._config.minimumRangeInPixel; positionChanged = true; } else if(rValue - this._config.minimumRangeInPixel >= 0) { lValue = rValue - this._config.minimumRangeInPixel; positionChanged = true; } } var lSliderLeft = lValue - this._config.leftSlider.width + this._config.bar.left; this._lSlider.style.left = lSliderLeft + "px"; this._config.leftSlider.left = lSliderLeft; this._lUnselectedRegion.style.width = lValue + "px"; var rSliderLeft = rValue + this._config.bar.left; this._rSlider.style.left = rSliderLeft + "px"; this._config.rightSlider.left = rSliderLeft; this._rUnselectedRegion.style.left = rSliderLeft + "px"; this._rUnselectedRegion.style.width = Math.ceil(this.containerOffsetWidth - rSliderLeft - this._config.bar.right) + "px"; if(positionChanged) { this._handlePosition = new DiagnosticsHub.Common.TimeSpan(this.convertToTime(lValue), this.convertToTime(rValue)); this.raiseFilterEvent(this._handlePosition, true); this.setAriaLabelForSliders(); } } this._scale.resize(); } }; DoubleSlider.prototype.onTabFocus = function (e) { if(e.srcElement === this._lSlider) { this._currentSlider = this._lSlider; this._lSlider.addEventListener("keydown", this._keyDown, false); this._lSlider.addEventListener("keyup", this._keyUp, false); } else if(e.srcElement === this._rSlider) { this._currentSlider = this._rSlider; this._rSlider.addEventListener("keydown", this._keyDown, false); this._rSlider.addEventListener("keyup", this._keyUp, false); } this._focused = true; }; DoubleSlider.prototype.onTabBlur = function (e) { if(e.srcElement === this._lSlider) { this._lSlider.removeEventListener("keydown", this._keyDown, false); this._lSlider.removeEventListener("keyup", this._keyUp, false); } else if(e.srcElement === this._rSlider) { this._rSlider.removeEventListener("keydown", this._keyDown, false); this._rSlider.removeEventListener("keyup", this._keyUp, false); } this._currentSlider = null; this._focused = false; }; DoubleSlider.prototype.onKeyDown = function (e) { this.handleKeyEvent(e, true); }; DoubleSlider.prototype.onKeyUp = function (e) { this.handleKeyEvent(e, false); }; DoubleSlider.prototype.handleKeyEvent = function (e, isDown) { var isIntermittent = isDown; if(this._focused && e.keyCode === DiagnosticsHub.Common.KeyCodes.ARROW_LEFT) { if(e.srcElement === this._lSlider) { this.setHandlePosition(parseFloat(this._lSlider.style.left) - this._config.step, isIntermittent); } else if(e.srcElement === this._rSlider) { this.setHandlePosition(parseFloat(this._rSlider.style.left) - this._config.step, isIntermittent); } } if(this._focused && e.keyCode === DiagnosticsHub.Common.KeyCodes.ARROW_RIGHT) { if(e.srcElement === this._lSlider) { this.setHandlePosition(parseFloat(this._lSlider.style.left) + this._config.step, isIntermittent); } else if(e.srcElement === this._rSlider) { this.setHandlePosition(parseFloat(this._rSlider.style.left) + this._config.step, isIntermittent); } } }; DoubleSlider.prototype.mouseDown = function (e) { var rect = this._container.getBoundingClientRect(); var root = document.documentElement; var x = e.clientX - rect.left - root.scrollLeft; if(x >= parseFloat(this._lSlider.style.left) && x <= parseFloat(this._lSlider.style.left) + parseFloat(this._lSlider.style.width)) { this._currentSlider = this._lSlider; } else if(x >= parseFloat(this._rSlider.style.left) && x <= parseFloat(this._rSlider.style.left) + parseFloat(this._rSlider.style.width)) { this._currentSlider = this._rSlider; } if(this._currentSlider) { document.addEventListener("mousemove", this._mouseMoveListener, false); document.addEventListener("mouseup", this._mouseUpListener, false); } return false; }; DoubleSlider.prototype.setHandlePosition = function (position, isIntermittent) { if(this._currentSlider) { var handle; if(this._currentSlider === this._lSlider && (parseFloat(this._rSlider.style.left) - position - this._config.leftSlider.width) >= this._config.minimumRangeInPixel) { if(position >= this._config.bar.left - this._config.leftSlider.width && position <= parseFloat(this._rSlider.style.left) - parseFloat(this._lSlider.style.width)) { this._currentSlider.style.left = position + "px"; this._lUnselectedRegion.style.width = position - this._config.bar.left + "px"; this._config.leftSlider.left = position; handle = new DiagnosticsHub.Common.TimeSpan(this.convertToTime(position + this._config.leftSlider.width - this._config.bar.left), this._handlePosition.end); } else if(position < this._config.bar.left) { this._currentSlider.style.left = this._config.bar.left - this._config.leftSlider.width + "px"; this._lUnselectedRegion.style.width = "0px"; this._config.leftSlider.left = this._config.bar.left - this._config.leftSlider.width; handle = new DiagnosticsHub.Common.TimeSpan(this._currentTimeRange.begin, this._handlePosition.end); } } else if(this._currentSlider === this._rSlider && (position - parseFloat(this._lSlider.style.left) - this._config.leftSlider.width) >= this._config.minimumRangeInPixel) { if(position <= this.containerOffsetWidth - this._config.bar.right && position >= parseFloat(this._lSlider.style.left) + parseFloat(this._lSlider.style.width)) { this._currentSlider.style.left = position + "px"; this._rUnselectedRegion.style.left = position + "px"; this._rUnselectedRegion.style.width = Math.ceil(this.containerOffsetWidth - this._config.bar.right - position) + "px"; this._config.rightSlider.left = position; handle = new DiagnosticsHub.Common.TimeSpan(this._handlePosition.begin, this.convertToTime(position - this._config.bar.left)); } else if(position > this.containerOffsetWidth - this._config.bar.right) { this._currentSlider.style.left = this.containerOffsetWidth - this._config.bar.right + "px"; this._rUnselectedRegion.style.left = this.containerOffsetWidth - this._config.bar.right + "px"; this._rUnselectedRegion.style.width = "0px"; this._config.rightSlider.left = this.containerOffsetWidth - this._config.bar.right; handle = new DiagnosticsHub.Common.TimeSpan(this._handlePosition.begin, this._currentTimeRange.end); } } if(handle) { this._handlePosition = handle; this.raiseFilterEvent(this._handlePosition, isIntermittent); } else if(!isIntermittent && this._handlePosition) { this.raiseFilterEvent(this._handlePosition, isIntermittent); } this.setAriaLabelForSliders(); } }; DoubleSlider.prototype.convertToTime = function (pixels) { var time = 0; if(this.containerOffsetWidth - this._config.bar.left - this._config.bar.right > 0) { time = this._currentTimeRange.begin.nsec + (pixels * this._currentTimeRange.elapsed.nsec) / (this.containerOffsetWidth - this._config.bar.left - this._config.bar.right); } return new DiagnosticsHub.Common.TimeStamp(time); }; DoubleSlider.prototype.onMouseMove = function (e) { this.handleMouseEvent(e, true); }; DoubleSlider.prototype.onMouseUp = function (e) { this.handleMouseEvent(e, false); document.removeEventListener("mousemove", this._mouseMoveListener, false); document.removeEventListener("mouseup", this._mouseUpListener, false); if(!this._focused) { this._currentSlider = null; } }; DoubleSlider.prototype.handleMouseEvent = function (e, isMove) { var isIntermittent = isMove; var rect = this._container.getBoundingClientRect(); var root = document.documentElement; var mouseX = e.clientX - rect.left - root.scrollLeft; if(this._currentSlider && (mouseX < parseFloat(this._currentSlider.style.left) || mouseX > parseFloat(this._currentSlider.style.left) + parseFloat(this._currentSlider.style.width))) { this.setHandlePosition(mouseX, isIntermittent); } }; DoubleSlider.getDragDirection = function getDragDirection(selectionWidth) { if(selectionWidth > 0) { return DiagnosticsHub.DragDirection.right; } else if(selectionWidth < 0) { return DiagnosticsHub.DragDirection.left; } return DiagnosticsHub.DragDirection.none; }; DoubleSlider.prototype.checkIfMouseInsideValidSelectionArea = function (event) { var isValid = false; var rect = this._container.getBoundingClientRect(); var mouseX = event.clientX - rect.left - this._bar.offsetLeft; if(mouseX >= 0 && mouseX <= this._bar.clientWidth) { isValid = true; } return isValid; }; DoubleSlider.prototype.getSelectionStartWidth = function (event) { var rect = this._container.getBoundingClientRect(); var mouseX = event.clientX - rect.left - this._bar.offsetLeft; return mouseX; }; DoubleSlider.prototype.drawSelection = function () { this._lUnselectedRegion.style.width = this._selectionPixelStartX + "px"; this._lSlider.style.left = this._selectionPixelStartX - this._config.leftSlider.width + this._bar.offsetLeft + "px"; this._config.leftSlider.left = this._selectionPixelStartX + this._bar.offsetLeft; var left = this._selectionPixelStartX + this._selectionPixelWidth + this._bar.offsetLeft; this._rUnselectedRegion.style.left = left + "px"; this._rUnselectedRegion.style.width = (this._bar.clientWidth - this._selectionPixelStartX - this._selectionPixelWidth) + "px"; this._config.rightSlider.left = left; this._rSlider.style.left = left + "px"; if(this._dragDirection === DiagnosticsHub.DragDirection.left) { this._lSlider.focus(); } else { this._rSlider.focus(); } this._handlePosition = new DiagnosticsHub.Common.TimeSpan(this.convertToTime(this._selectionPixelStartX), this.convertToTime(this._selectionPixelStartX + this._selectionPixelWidth)); }; DoubleSlider.prototype.ensureMinSelectionWidth = function () { if(typeof this._selectionPixelStartX === "undefined") { return; } if(Math.abs(this._selectionPixelWidth) < this._config.minimumRangeInPixel) { this._selectionPixelWidth = this._config.minimumRangeInPixel; switch(this._dragDirection) { case DiagnosticsHub.DragDirection.right: if(this._selectionPixelStartX + this._selectionPixelWidth > this._bar.clientWidth) { this._selectionPixelStartX = this._bar.clientWidth - this._selectionPixelWidth; } break; case DiagnosticsHub.DragDirection.left: if(this._selectionPixelStartX - this._selectionPixelWidth < 0) { this._selectionPixelStartX = 0; } else if(this._selectionPixelStartX + this._selectionPixelWidth > this._bar.clientWidth) { this._selectionPixelStartX = this._bar.clientWidth - this._selectionPixelWidth; } else { this._selectionPixelStartX = this._initialSelectionPixelStartX - this._selectionPixelWidth; } break; default: if(this._selectionPixelStartX + (this._selectionPixelWidth / 2) > this._bar.clientWidth) { this._selectionPixelStartX = this._bar.clientWidth - this._selectionPixelWidth; } else if(this._selectionPixelStartX - (this._selectionPixelWidth / 2) < 0) { this._selectionPixelStartX = 0; } else { this._selectionPixelStartX = this._selectionPixelStartX - (this._selectionPixelWidth / 2); } break; } } }; DoubleSlider.prototype.onStartSelection = function (event) { if((event.target !== this._lSlider && event.target !== this._rSlider) && this.checkIfMouseInsideValidSelectionArea(event)) { this._initialSelectionPixelStartX = this._selectionPixelStartX = this.getSelectionStartWidth(event); this._selectionPixelWidth = 0; this._dragDirection = DoubleSlider.getDragDirection(this._selectionPixelWidth); this._mouseupHandler = this.onStopSelection.bind(this); this._container.addEventListener("mousemove", this._onDrag); this._container.addEventListener("mouseup", this._mouseupHandler); this._container.setCapture(true); this.drawSelection(); } }; DoubleSlider.prototype.onStopSelection = function (event) { this._container.removeEventListener("mousemove", this._onDrag); this._container.removeEventListener("mouseup", this._mouseupHandler); this._container.releaseCapture(); this.ensureMinSelectionWidth(); this.drawSelection(); this.raiseFilterEvent(this._handlePosition); this.setAriaLabelForSliders(); this._dragDirection = DiagnosticsHub.DragDirection.none; }; DoubleSlider.prototype.onDrag = function (event) { if(this.checkIfMouseInsideValidSelectionArea(event)) { var xPixels = this.getSelectionStartWidth(event); this._dragDirection = DoubleSlider.getDragDirection(xPixels - this._initialSelectionPixelStartX); this._selectionPixelWidth = Math.abs(xPixels - this._initialSelectionPixelStartX); if(this._dragDirection === DiagnosticsHub.DragDirection.left) { this._selectionPixelStartX = this._initialSelectionPixelStartX - this._selectionPixelWidth; } this.drawSelection(); this.raiseFilterEvent(this._handlePosition); } }; DoubleSlider.prototype.resetHandlePosition = function () { this._lSlider.style.left = (this._config.bar.left - this._config.leftSlider.width) + "px"; this._config.leftSlider.left = (this._config.bar.left - this._config.leftSlider.width); this._lUnselectedRegion.style.width = "0px"; this._lUnselectedRegion.style.left = this._config.bar.left + "px"; var rSliderLeft = this.containerOffsetWidth - this._config.bar.right; this._rSlider.style.left = rSliderLeft + "px"; this._config.rightSlider.left = rSliderLeft; this._rUnselectedRegion.style.width = "0px"; this._rUnselectedRegion.style.left = rSliderLeft + "px"; }; DoubleSlider.prototype.resetScale = function () { this._scale.timeRange = this._currentTimeRange; this._scale.render(); this.setAriaLabelForRuler(); this.setAriaLabelForSliders(); }; DoubleSlider.prototype.convertToPixel = function (time) { var pixels = 0; if(this._currentTimeRange.elapsed.nsec > 0) { pixels = (time.nsec - this._currentTimeRange.begin.nsec) * (this.containerOffsetWidth - this._config.bar.left - this._config.bar.right) / this._currentTimeRange.elapsed.nsec; } return pixels; }; DoubleSlider.prototype.setAriaLabelForRuler = function () { if(this._container) { var label = Plugin.Resources.getString("RulerAriaLabel", RulerUtilities.formatTime(this._currentTimeRange.begin, DiagnosticsHub.UnitFormat.fullName), RulerUtilities.formatTime(this._currentTimeRange.end, DiagnosticsHub.UnitFormat.fullName)); this._container.setAttribute("aria-label", label); } }; DoubleSlider.prototype.addEventListener = function (eventType, func) { this._publisher.addEventListener(eventType, func); }; DoubleSlider.prototype.removeEventListener = function (eventType, func) { this._publisher.removeEventListener(eventType, func); }; Object.defineProperty(DoubleSlider.prototype, "SliderHandlePosition", { get: function () { return this._handlePosition; }, set: function (position) { if(position && this._config.isSelectionEnabled) { this._handlePosition = position; var lSliderLeft = this.convertToPixel(this._handlePosition.begin) + this._config.bar.left - this._config.leftSlider.width; this._lSlider.style.left = lSliderLeft + "px"; this._config.leftSlider.left = lSliderLeft; this._lUnselectedRegion.style.width = lSliderLeft - this._config.bar.left + this._config.leftSlider.width + "px"; this._lUnselectedRegion.style.left = this._config.bar.left + "px"; var rSliderLeft = this.convertToPixel(this._handlePosition.end) + this._config.bar.left; this._rSlider.style.left = rSliderLeft + "px"; this._config.rightSlider.left = rSliderLeft; this._rUnselectedRegion.style.width = Math.ceil(this.containerOffsetWidth - rSliderLeft - this._config.bar.right) + "px"; this._rUnselectedRegion.style.left = rSliderLeft + "px"; this.setAriaLabelForSliders(); } }, enumerable: true, configurable: true }); DoubleSlider.prototype.zoom = function (current, selection) { if(this._config.isZoomEnabled) { this._currentTimeRange = current; this.resetScale(); if(!selection) { this.SliderHandlePosition = current; } else { this.SliderHandlePosition = selection; } } }; DoubleSlider.prototype.invalidateSizeCache = function () { this._containerOffsetWidth = null; if(this._scale) { this._scale.invalidateSizeCache(); } }; DoubleSlider.prototype.render = function () { while(this._container.hasChildNodes()) { this._container.removeChild(this._container.firstChild); } this._container.className = this._config.className = this._rulerBodyCss; this._containerWidth = this.containerOffsetWidth; this._container.tabIndex = 0; this.renderRulerBar(); this.renderRulerScale(); if(this._config.isSelectionEnabled) { this.renderLeftSliderHandle(); this.renderRightSliderHandle(); } this.setAriaLabelForRuler(); }; DoubleSlider.prototype.addMark = function (id, markData) { if(this._scale) { this._scale.addMark(id, markData); } }; DoubleSlider.prototype.addMarkSeries = function (id, type) { if(this._scale) { this._scale.addMarkSeries(id, type); } }; DoubleSlider.prototype.updateTimeRange = function (viewPort) { if(viewPort && !this._currentTimeRange.equals(viewPort)) { this._currentTimeRange = viewPort; this._scale.timeRange = viewPort; this._scale.render(); } }; DoubleSlider.prototype.setState = function (state) { if(state) { this._rulerState = state; } }; return DoubleSlider; })(); DiagnosticsHub.DoubleSlider = DoubleSlider; var MarkData = (function () { function MarkData(time, tooltip) { this.time = time; this.tooltip = tooltip; } return MarkData; })(); DiagnosticsHub.MarkData = MarkData; var AggregatedMarkData = (function () { function AggregatedMarkData() { this.marks = []; } AggregatedMarkData.prototype.updateData = function () { this._content = []; for(var i = 0; i < this.marks.length; i++) { if(this.marks[i].tooltip !== null && typeof this.marks[i].tooltip !== "undefined") { this._content.push(this.marks[i].tooltip); } } }; AggregatedMarkData.prototype.getTooltipContent = function () { this.updateData(); return this._content.join("\r\n"); }; AggregatedMarkData.prototype.getAriaContent = function () { this.updateData(); return this._content.join(", "); }; AggregatedMarkData.prototype.length = function () { return this.marks.length; }; AggregatedMarkData.prototype.push = function (mark) { if(!this.time) { this.time = mark.time; } this.marks.push(mark); }; return AggregatedMarkData; })(); DiagnosticsHub.AggregatedMarkData = AggregatedMarkData; var RulerScale = (function () { function RulerScale(config) { this._containerOffsetWidth = null; this._scaleMainDivClientWidth = null; this._scaleMarksImageHeight = 4; this._rulerScaleTickmarkBigCss = "ruler-scale-tickmark-big"; this._rulerScaleTickmarkMediumCss = "ruler-scale-tickmark-medium"; this._rulerScaleTickmarkSmallCss = "ruler-scale-tickmark-small"; this._rulerScaleMarkImageAppEventCss = "ruler-scale-mark-image-appevent"; this._rulerScaleMarkImageUserMarkCss = "ruler-scale-mark-image-usermark"; this._rulerScaleLabelTextCss = "ruler-scale-label-text"; this._rulerScaleMainCss = "ruler-scale-main"; this._rulerScaleTickmarksCss = "ruler-scale-tickmarks"; this._rulerScaleMarkImagePositionCss = "ruler-scale-mark-image-position"; this._scaleMainDivBorderWidth = 1; this._minimumMarkDistance = 5; this._onResizeHandler = this.resize.bind(this); if(config && config.containerId && config.timeRange) { this._timeRange = config.timeRange; this._container = document.getElementById(config.containerId); this._container.onresize = this._onResizeHandler; this._seriesList = config.series; while(this._container.hasChildNodes()) { this._container.removeChild(this._container.firstChild); } } else { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1001")); } } RulerScale.prototype.deinitialize = function () { window.removeEventListener("resize", this._onResizeHandler); if(this._container) { this._container.onresize = null; } }; Object.defineProperty(RulerScale.prototype, "containerOffsetWidth", { get: function () { if(this._containerOffsetWidth === null) { this._containerOffsetWidth = this._container.offsetWidth; } return this._containerOffsetWidth; }, enumerable: true, configurable: true }); Object.defineProperty(RulerScale.prototype, "scaleMainDivClientWidth", { get: function () { if(this._scaleMainDivClientWidth === null) { this._scaleMainDivClientWidth = this._scaleMainDiv.clientWidth; } return this._scaleMainDivClientWidth; }, enumerable: true, configurable: true }); RulerScale.prototype.renderTickMarks = function () { this._scaleBigTickMarkElementsFactory.start(); this._scaleMediumTickMarkElementsFactory.start(); this._scaleSmallTickMarkElementsFactory.start(); this._scaleTickMarkLabelElementsFactory.start(); for(var i = 0; i < this._tickMarkList.length; i++) { var tick; switch(this._tickMarkList[i].type) { case DiagnosticsHub.TickMarkType.Big: tick = this._scaleBigTickMarkElementsFactory.getNext(); break; case DiagnosticsHub.TickMarkType.Medium: tick = this._scaleMediumTickMarkElementsFactory.getNext(); break; case DiagnosticsHub.TickMarkType.Small: tick = this._scaleSmallTickMarkElementsFactory.getNext(); break; } if(tick) { tick.style.left = this.calculateElementPosition(this._tickMarkList[i].value) + "px"; if(DiagnosticsHub.TickMarkType.Big === this._tickMarkList[i].type) { var label = this._scaleTickMarkLabelElementsFactory.getNext(); label.innerText = this._tickMarkList[i].label; label.style.left = parseFloat(tick.style.left) + 1 + "px"; } } } this._scaleBigTickMarkElementsFactory.stop(); this._scaleMediumTickMarkElementsFactory.stop(); this._scaleSmallTickMarkElementsFactory.stop(); this._scaleTickMarkLabelElementsFactory.stop(); this.renderMarks(); }; RulerScale.prototype.renderMarks = function () { var _this = this; if(this._scaleTickMarksDiv) { this.createAggregateMarkList(); this._scaleMarkAppEventElementsFactory.start(); this._scaleMarkUserElementsFactory.start(); if(this._data) { for(var j = 0; j < this._data.length; j++) { var mark = this._data[j]; if(mark && mark.time && mark.time.nsec >= this._timeRange.begin.nsec && mark.time.nsec <= this._timeRange.end.nsec) { (function (mark) { mark.type = mark.type || DiagnosticsHub.MarkType.LifeCycleEvent; var markDiv; if(!mark.type || mark.type === DiagnosticsHub.MarkType.LifeCycleEvent) { markDiv = _this._scaleMarkAppEventElementsFactory.getNext(); } else { markDiv = _this._scaleMarkUserElementsFactory.getNext(); } markDiv.style.left = mark.pixelPosition + "px"; markDiv.onmouseover = function () { return _this.showMarkTooltip(mark); }; markDiv.onmouseout = (Plugin).Tooltip.dismiss; markDiv.onfocus = function () { markDiv.setAttribute("aria-label", Plugin.Resources.getString("RulerMarkLabel", mark.getAriaContent())); }; })(mark); } } } this._scaleMarkAppEventElementsFactory.stop(); this._scaleMarkUserElementsFactory.stop(); } }; RulerScale.prototype.createAggregateMarkList = function () { var seriesList = this._seriesList; this._data = []; if(this._seriesList) { for(var i = 0; i < seriesList.length; i++) { var seriesData = seriesList[i].data; if(!seriesData) { seriesData = []; } for(var j = 0; j < seriesData.length; j++) { var dataPoint = seriesData[j]; this.createAggregatedMark(dataPoint, seriesList[i].type); } } } }; RulerScale.prototype.createAggregatedMark = function (dataPoint, type) { var pixelPosition = this.calculateElementPosition(dataPoint.time) - this._scaleMarksImageHeight; var isNewPoint = true; var index = -1; for(var k = 0; k < this._data.length; k++) { if(pixelPosition <= this._data[k].pixelPosition + this._minimumMarkDistance && pixelPosition >= this._data[k].pixelPosition - this._minimumMarkDistance) { this._data[k].push(dataPoint); if(this._data[k].type !== type) { this._data[k].type = DiagnosticsHub.MarkType.UserMark; } isNewPoint = false; index = k; break; } } if(isNewPoint) { var data = new AggregatedMarkData(); data.push(dataPoint); data.type = type; data.pixelPosition = pixelPosition; this._data.push(data); index = this._data.length - 1; } return index; }; RulerScale.prototype.showMarkTooltip = function (mark) { var toolTipContent = mark.getTooltipContent(); if(toolTipContent) { var config = { content: toolTipContent }; (Plugin).Tooltip.show(config); } }; RulerScale.prototype.createMarkVisual = function (className) { var markDiv = document.createElement("div"); markDiv.tabIndex = 0; markDiv.classList.add(className); markDiv.classList.add(this._rulerScaleMarkImagePositionCss); return markDiv; }; RulerScale.prototype.calculateElementPosition = function (time) { return Math.round((this.scaleMainDivClientWidth * (time.nsec - this._timeRange.begin.nsec) / this._timeRange.elapsed.nsec)); }; RulerScale.prototype.resize = function () { this.invalidateSizeCache(); this.render(); }; Object.defineProperty(RulerScale.prototype, "timeRange", { set: function (time) { this._timeRange = time; }, enumerable: true, configurable: true }); RulerScale.prototype.invalidateSizeCache = function () { this._containerOffsetWidth = null; this._scaleMainDivClientWidth = null; }; RulerScale.prototype.render = function () { var _this = this; if(this._container) { if(!this._scaleMainDiv) { this._scaleMainDiv = document.createElement("div"); this._scaleMainDiv.className = this._rulerScaleMainCss; window.addEventListener("resize", this._onResizeHandler); this._container.appendChild(this._scaleMainDiv); } if(!this._scaleTickMarksDiv) { this._scaleTickMarksDiv = document.createElement("div"); this._scaleTickMarksDiv.className = this._rulerScaleTickmarksCss; this._scaleMainDiv.appendChild(this._scaleTickMarksDiv); this._scaleBigTickMarkElementsFactory = DiagnosticsHub.Common.ElementRecyclerFactory.forDivWithClass(this._scaleTickMarksDiv, this._rulerScaleTickmarkBigCss); this._scaleMediumTickMarkElementsFactory = DiagnosticsHub.Common.ElementRecyclerFactory.forDivWithClass(this._scaleTickMarksDiv, this._rulerScaleTickmarkMediumCss); this._scaleSmallTickMarkElementsFactory = DiagnosticsHub.Common.ElementRecyclerFactory.forDivWithClass(this._scaleTickMarksDiv, this._rulerScaleTickmarkSmallCss); this._scaleTickMarkLabelElementsFactory = DiagnosticsHub.Common.ElementRecyclerFactory.forDivWithClass(this._scaleTickMarksDiv, this._rulerScaleLabelTextCss); this._scaleMarkAppEventElementsFactory = new DiagnosticsHub.Common.ElementRecyclerFactory(this._scaleTickMarksDiv, function () { return _this.createMarkVisual(_this._rulerScaleMarkImageAppEventCss); }); this._scaleMarkUserElementsFactory = new DiagnosticsHub.Common.ElementRecyclerFactory(this._scaleTickMarksDiv, function () { return _this.createMarkVisual(_this._rulerScaleMarkImageUserMarkCss); }); } this._tickMarkList = RulerUtilities.getTickMarksPosition(this._timeRange, this.containerOffsetWidth); this.renderTickMarks(); } }; RulerScale.prototype.addMark = function (id, markData) { if(this._seriesList && id && markData && markData.time && markData.time.nsec >= this._timeRange.begin.nsec && markData.time.nsec <= this._timeRange.end.nsec) { var series; for(var j = 0; j < this._seriesList.length; j++) { if(this._seriesList[j].id === id) { series = this._seriesList[j]; if(!series.data) { series.data = []; } series.data.push(markData); break; } } this.renderMarks(); } }; RulerScale.prototype.addMarkSeries = function (id, type) { var series = { id: id, index: this._seriesList.length, type: type }; this._seriesList.push(series); }; return RulerScale; })(); DiagnosticsHub.RulerScale = RulerScale; var RulerUtilities = (function () { function RulerUtilities() { } RulerUtilities.counter = 0; RulerUtilities.OneMillisecond = 1000000; RulerUtilities.OneSecond = 1000 * 1000000; RulerUtilities.OneMinute = 60 * 1000 * 1000000; RulerUtilities.getRandomNumber = function getRandomNumber() { return RulerUtilities.counter++; }; RulerUtilities.getTickMarksPosition = function getTickMarksPosition(timeRange, width) { var rangeNsec = timeRange.elapsed.nsec; var beginNsec = timeRange.begin.nsec; var tickMarkList = []; var intervalDuration = Math.pow(10, Math.floor(Math.log(rangeNsec) / Math.LN10)); var intervalWidth = (width / rangeNsec) * intervalDuration; if(intervalWidth < 100) { if(intervalWidth < 25) { intervalDuration *= 8; } else if(intervalWidth < 50) { intervalDuration *= 4; } else if(intervalWidth < 100) { intervalDuration *= 2; } } else if(intervalWidth > 250) { if(intervalWidth < 400) { intervalDuration /= 2; } else if(intervalWidth < 800) { intervalDuration /= 4; } else if(intervalWidth < 1600) { intervalDuration /= 8; } else { intervalDuration /= 10; } } var smallTickDuration = intervalDuration / 10; var mediumTickDuration = intervalDuration / 2; intervalWidth = (width / rangeNsec) * intervalDuration; if(intervalWidth < 130) { smallTickDuration = intervalDuration / 5; } tickMarkList = RulerUtilities.generateTickMarks(timeRange, beginNsec - (beginNsec % intervalDuration), intervalDuration, mediumTickDuration, smallTickDuration); return tickMarkList; }; RulerUtilities.getVerticalLinePositions = function getVerticalLinePositions(timeRange, width) { var positions = []; var marks = RulerUtilities.getTickMarksPosition(timeRange, width); for(var i = 0; i < marks.length; ++i) { var mark = marks[i]; if(mark.type === DiagnosticsHub.TickMarkType.Big) { var position = (mark.value.nsec - timeRange.begin.nsec) / timeRange.elapsed.nsec * 100; positions.push(position); } } return positions; }; RulerUtilities.generateTickMarks = function generateTickMarks(timeRange, start, bigTick, mediumTick, step) { var tickMarkList = []; var beginNsec = timeRange.begin.nsec; var endNsec = timeRange.end.nsec; start = Math.round(DiagnosticsHub.Common.TimeStamp.fromNanoseconds(start).nsec); bigTick = Math.round(DiagnosticsHub.Common.TimeStamp.fromNanoseconds(bigTick).nsec); mediumTick = Math.round(DiagnosticsHub.Common.TimeStamp.fromNanoseconds(mediumTick).nsec); step = Math.round(DiagnosticsHub.Common.TimeStamp.fromNanoseconds(step).nsec); for(var i = start; i < endNsec; i += step) { if(i > beginNsec) { var tickMarkTime = DiagnosticsHub.Common.TimeStamp.fromNanoseconds(i); if(!isNaN(i % bigTick) && i % bigTick === 0) { tickMarkList.push({ type: DiagnosticsHub.TickMarkType.Big, value: tickMarkTime, label: RulerUtilities.formatTime(tickMarkTime) }); } else if(!isNaN(i % mediumTick) && i % mediumTick === 0) { tickMarkList.push({ type: DiagnosticsHub.TickMarkType.Medium, value: tickMarkTime, label: RulerUtilities.formatTime(tickMarkTime) }); } else { tickMarkList.push({ type: DiagnosticsHub.TickMarkType.Small, value: tickMarkTime, label: RulerUtilities.formatTime(tickMarkTime) }); } } } return tickMarkList; }; RulerUtilities.formatTime = function formatTime(value, unitFormat) { if (typeof unitFormat === "undefined") { unitFormat = DiagnosticsHub.UnitFormat.italizedAbbreviations; } var splitTime = RulerUtilities.getSplittedTime(value); var valueNs = Math.floor(value.nsec); var time = "0"; var nf = RulerUtilities.getNumberFormat(); if(splitTime.minutes) { if(!splitTime.seconds && !splitTime.milliseconds && !splitTime.nanoseconds) { time = splitTime.minString + ":00"; } else if(!splitTime.milliseconds && !splitTime.nanoseconds) { time = splitTime.minString + ":" + splitTime.secString; } else if(!splitTime.nanoseconds) { splitTime.msString = splitTime.msString.replace(/0*$/, ""); time = splitTime.minString + ":" + splitTime.secString + nf.numberDecimalSeparator + splitTime.msString; } else { splitTime.nsString = splitTime.nsString.replace(/0*$/, ""); time = splitTime.minString + ":" + splitTime.secString + nf.numberDecimalSeparator + splitTime.msString + splitTime.nsString; } } else if(splitTime.seconds) { if(!splitTime.milliseconds && !splitTime.nanoseconds) { time = splitTime.secString; } else if(!splitTime.nanoseconds) { splitTime.msString = splitTime.msString.replace(/0*$/, ""); time = splitTime.secString + nf.numberDecimalSeparator + splitTime.msString; } else { splitTime.nsString = splitTime.nsString.replace(/0*$/, ""); time = splitTime.secString + nf.numberDecimalSeparator + splitTime.msString + splitTime.nsString; } } else if(splitTime.milliseconds) { if(!splitTime.nanoseconds) { time = splitTime.msString; } else { splitTime.nsString = splitTime.nsString.replace(/0*$/, ""); time = splitTime.msString + nf.numberDecimalSeparator + splitTime.nsString; } } else if(splitTime.nanoseconds) { splitTime.nsString = splitTime.nsString.replace(/0*$/, ""); time = "0" + nf.numberDecimalSeparator + splitTime.nsString; } var unit = RulerUtilities.getUnit(valueNs, unitFormat); return time + unit; }; RulerUtilities.formatTitleTime = function formatTitleTime(value, unitFormat, isLive) { if (typeof unitFormat === "undefined") { unitFormat = DiagnosticsHub.UnitFormat.fullName; } if (typeof isLive === "undefined") { isLive = false; } var splitTime = RulerUtilities.getSplittedTime(value); var valueNs = Math.floor(value.nsec); var time = "0"; var nf = RulerUtilities.getNumberFormat(); if(isLive) { splitTime.milliseconds = 0; splitTime.nanoseconds = 0; } if(splitTime.minutes) { if(!splitTime.seconds) { time = splitTime.minString + ":00"; } else { time = splitTime.minString + ":" + splitTime.secString; } } else if(splitTime.seconds) { if(!splitTime.milliseconds) { time = splitTime.secString; } else { splitTime.msString = splitTime.msString.replace(/0*$/, ""); time = splitTime.secString + nf.numberDecimalSeparator + splitTime.msString; } } else if(splitTime.milliseconds) { if(!splitTime.nanoseconds) { time = splitTime.msString; } else { splitTime.nsString = splitTime.nsString.replace(/0*$/, ""); time = splitTime.msString + nf.numberDecimalSeparator + splitTime.nsString; } } else if(splitTime.nanoseconds) { splitTime.nsString = splitTime.nsString.replace(/0*$/, ""); time = "0" + nf.numberDecimalSeparator + splitTime.nsString; } var unit = RulerUtilities.getUnit(valueNs, unitFormat, isLive); return time + unit; }; RulerUtilities.getUnit = function getUnit(valueNs, unitFormat, isLive) { if (typeof isLive === "undefined") { isLive = false; } var units = this.getUnits(unitFormat); var unit; if(valueNs < RulerUtilities.OneSecond && !isLive) { unit = units.milliseconds; } else if(valueNs < RulerUtilities.OneMinute) { unit = units.seconds; } else { unit = units.minutes; } return unit; }; RulerUtilities.getUnits = function getUnits(unitFormat) { var unitLabelFormat; if(unitFormat === DiagnosticsHub.UnitFormat.fullName) { unitLabelFormat = { milliseconds: " " + Plugin.Resources.getString("MillisecondsLabel"), seconds: " " + Plugin.Resources.getString("SecondsLabel"), minutes: " " + Plugin.Resources.getString("MinutesLabel") }; } else { unitLabelFormat = { milliseconds: Plugin.Resources.getString("MillisecondsAbbreviation"), seconds: Plugin.Resources.getString("SecondsAbbreviation"), minutes: Plugin.Resources.getString("MinutesAbbreviation") }; } return unitLabelFormat; }; RulerUtilities.getSplittedTime = function getSplittedTime(value) { var valueNs = Math.floor(value.nsec); if(valueNs < 0) { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1000")); } var nanoseconds = Math.floor(valueNs % RulerUtilities.OneMillisecond); var milliseconds = Math.floor((valueNs - nanoseconds) % RulerUtilities.OneSecond); var seconds = Math.floor((valueNs - nanoseconds - milliseconds) % RulerUtilities.OneMinute); var minutes = Math.floor(valueNs - nanoseconds - milliseconds - seconds); minutes = minutes / RulerUtilities.OneMinute; seconds = seconds / RulerUtilities.OneSecond; milliseconds = milliseconds / RulerUtilities.OneMillisecond; var ns = ""; if(nanoseconds > 999) { ns = nanoseconds.toString().substr(0, 3); } var ms = ""; if(ns || milliseconds) { var ms = milliseconds.toString(); if(seconds) { while(ms.length < 3) { ms = "0" + ms; } } } var sec = ""; if(ns || ms || seconds) { sec = seconds.toString(); if(minutes) { while(sec.length < 2) { sec = "0" + sec; } } } var min = ""; if(minutes) { min = minutes.toString(); } return { minutes: minutes, seconds: seconds, milliseconds: milliseconds, nanoseconds: nanoseconds, nsString: ns, msString: ms, secString: sec, minString: min }; }; RulerUtilities.getNumberFormat = function getNumberFormat() { var nf = (Plugin).Culture.NumberFormat; if(!nf || nf.length === 0) { nf = { numberDecimalSeparator: "." }; } return nf; }; return RulerUtilities; })(); DiagnosticsHub.RulerUtilities = RulerUtilities; var RulerLegend = (function () { function RulerLegend(config) { this._rulerLegendColorDivCss = "ruler-legend-color-div"; this._rulerLegendTextDivCss = "ruler-legend-text-div"; this._rulerLegendDivCss = "ruler-legend-div"; this._rulerScaleLabelImageAppEventCss = "ruler-label-mark-image-appevent"; this._rulerScaleLabelImageUserMarkCss = "ruler-label-mark-image-usermark"; this._rulerScaleMarkImageUserMarkLabel = "User Marks"; this._rulerScaleMarkImageAppEventLabel = "App Lifecycle Events"; if(!config || !config.containerId) { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1001")); } this._config = config; } RulerLegend.prototype.render = function () { for(var legendItemIndex = 0; legendItemIndex < this._config.data.length; legendItemIndex++) { var legendItem = this._config.data[legendItemIndex]; this.renderLegendItem(legendItem); } }; RulerLegend.prototype.renderLegendItem = function (legendItemData) { var legendColorDiv = document.createElement("div"); legendColorDiv.className = this._rulerLegendColorDivCss; var label; var className; if(legendItemData.type === DiagnosticsHub.MarkType.LifeCycleEvent) { className = this._rulerScaleLabelImageAppEventCss; label = legendItemData.text || this._rulerScaleMarkImageAppEventLabel; } else { className = this._rulerScaleLabelImageUserMarkCss; label = legendItemData.text || this._rulerScaleMarkImageUserMarkLabel; } var colorDiv = document.createElement("div"); colorDiv.className = className; legendColorDiv.appendChild(colorDiv); var legendTextDiv = document.createElement("div"); legendTextDiv.className = this._rulerLegendTextDivCss; legendTextDiv.innerHTML = label; var individualLegendBox = document.createElement("div"); individualLegendBox.className = this._rulerLegendDivCss; individualLegendBox.appendChild(legendColorDiv); individualLegendBox.appendChild(legendTextDiv); if(legendItemData.tooltip) { individualLegendBox.setAttribute("data-plugin-vs-tooltip", legendItemData.tooltip); } var container = document.getElementById(this._config.containerId); container.appendChild(individualLegendBox); }; return RulerLegend; })(); DiagnosticsHub.RulerLegend = RulerLegend; var RulerHeader = (function () { function RulerHeader(config) { this._rulerTitleTextCss = "ruler-title-text"; this._config = config; } RulerHeader.prototype.render = function () { var titleContainer = document.createElement("div"); titleContainer.id = this._config.titleConfig.containerId; titleContainer.className = this._config.titleConfig.className; this._titleText = document.createElement("div"); this._titleText.className = this._rulerTitleTextCss; var text = Plugin.Resources.getString("RulerTitle") || this._config.titleConfig.text || ""; if(this._config.titleConfig.description) { text += ": " + this._config.titleConfig.description; } this._titleText.innerHTML = text; titleContainer.appendChild(this._titleText); var legendContainer = document.createElement("div"); legendContainer.id = this._config.legendConfig.containerId; legendContainer.className = this._config.legendConfig.className; this._container = document.getElementById(this._config.containerId); this._container.appendChild(titleContainer); this._container.appendChild(legendContainer); this.legend = new RulerLegend(this._config.legendConfig); this.legend.render(); }; Object.defineProperty(RulerHeader.prototype, "Title", { set: function (value) { if(this._titleText) { var text = this._config.titleConfig.text || ""; if(this._config.titleConfig.description) { text += ": " + value; } this._titleText.innerHTML = text; } }, enumerable: true, configurable: true }); return RulerHeader; })(); DiagnosticsHub.RulerHeader = RulerHeader; })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {})); var DiagnosticsHub = VisualStudio.DiagnosticsHub; })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {})); var VisualStudio = Microsoft.VisualStudio; })(Microsoft || (Microsoft = {})); var Microsoft; (function (Microsoft) { (function (VisualStudio) { (function (DiagnosticsHub) { function randomizer() { var arr = []; var j = 0; for(var i = 0; i < 100; i++) { j += 100; var ran = Math.floor(Math.random() * 100); arr.push({ Timestamp: j, Value: ran, ToolTip: "time: " + j + " value: " + ran }); } return arr; } var Renderer = (function () { function Renderer(config) { this._swimLanes = []; this._swimLaneContainers = []; this._mainContainerId = "mainContainer"; this._rulerContainerId = "rulerContainer"; this._mainSwimlaneContainerId = "mainSwimlaneContainer"; this._mainToolbarContainerId = "toolBarContainer"; this._mainSwimlaneContainerCSS = "main-swimlane-container"; this._swimlaneDivCss = "swimlane-container"; this._swimlaneContainerIdPrefix = "swimlaneContainer"; this._divIndex = 0; if(!config) { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1002")); } if(!config.swimlane) { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1002")); } this._eventManager = Microsoft.VisualStudio.DiagnosticsHub.getEventAggregator(); this._config = config; this._graphConfigurationMarshaler = Plugin.Utilities.JSONMarshaler.attachToPublishedObject("Microsoft.DiagnosticsHub.VisualStudio.Presentation.JavaScriptModels.SwimLanesViewMarshaler", { }, true); if(!this._graphConfigurationMarshaler) { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1007")); } this._graphConfigurationMarshaler.addEventListener = function (str, func) { if("timeRangeChanged" === str) { func({ ViewportTimeRange: { Start: 0, End: 10000 } }); } if("dataUpdate" === str) { setTimeout(func, 200, { UpdatedSeries: [ { DataSource: { CounterId: "First Counter" }, NewPoints: randomizer() }, { DataSource: { CounterId: "Third Counter" }, NewPoints: randomizer() } ], Timestamp: null }); setTimeout(func, 400, { UpdatedSeries: [ { DataSource: { CounterId: "Second Counter" }, NewPoints: randomizer() } ], Timestamp: null }); } }; } Renderer.prototype.execute = function () { this._graphConfigurationMarshaler._call("getConfigurations").done(function (data) { var eventArgs = { ViewportTimeRange: { Start: 0, End: 10000 } }; var timeRange = this._originalTimeRange = this._currentTimeRange = this._handlePosition = new DiagnosticsHub.Common.TimeSpan(DiagnosticsHub.Common.TimeStamp.fromMilliseconds(eventArgs.ViewportTimeRange.Start), DiagnosticsHub.Common.TimeStamp.fromMilliseconds(eventArgs.ViewportTimeRange.End)); for(var i = 0; i < data.GraphConfigurations.length; i++) { var config = data.GraphConfigurations[i]; config.JsonObject = JSON.parse(config.JsonConfiguration); } this._graphsConfig = { data: data.GraphConfigurations, timeProperties: null, windowsZoomLevel: null }; this.loadScripts(); }.bind(this)); }; Renderer.prototype.loadScripts = function () { var deps = []; this._dependencyManager = new DiagnosticsHub.Common.DependencyManager(); for(var i = 0; i < this._graphsConfig.data.length; i++) { if(this._graphsConfig.data[i].PathToJavaScript) { deps.push({ async: false, objType: this._graphsConfig.data[i].ClassName, url: this._graphsConfig.data[i].PathToJavaScript }); } } this._dependencyManager.addDependencies(deps); this._dependencyManager.loadDependencies(this.scriptLoadedCallback.bind(this)); }; Renderer.prototype.scriptLoadedCallback = function () { this.renderToolbar(); this.renderRuler(this._currentTimeRange); this.createSwimlaneContainers(); this.renderSwimlanes(); this._graphConfigurationMarshaler.addEventListener("dataUpdate", function (eventArgs) { for(var i = 0; i < eventArgs.UpdatedSeries.length; i++) { this.addSeriesData(eventArgs.UpdatedSeries[i]); } }.bind(this)); }; Renderer.prototype.createSwimlaneContainers = function () { this._mainSwimlaneContainer = document.getElementById(this._mainSwimlaneContainerId); var msGridRowsArr = []; if(this._mainSwimlaneContainer) { this._mainSwimlaneContainer.classList.add(this._mainSwimlaneContainerCSS); for(var i = 0; i < this._graphsConfig.data.length; i++) { var swimlaneDiv = document.createElement("div"); swimlaneDiv.id = this._swimlaneContainerIdPrefix + i; swimlaneDiv.classList.add(this._swimlaneDivCss); swimlaneDiv.style.msGridRow = (i + 1).toString(); this._swimLaneContainers.push(swimlaneDiv); msGridRowsArr.push("auto"); } this._mainSwimlaneContainer.style.msGridRows = msGridRowsArr.join(" "); for(var i = 0; i < this._swimLaneContainers.length; i++) { this._mainSwimlaneContainer.appendChild(this._swimLaneContainers[i]); } this._divIndex = 0; } else { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1001")); } }; Renderer.prototype.renderRuler = function (timeRange) { var config = new DiagnosticsHub.RulerConfig(this._rulerContainerId); config.doubleSlider.isSelectionEnabled = typeof this._config.swimlane.isSelectionEnabled !== "undefined" && this._config.swimlane.isSelectionEnabled !== null ? this._config.swimlane.isSelectionEnabled : config.doubleSlider.isSelectionEnabled; config.doubleSlider.isZoomEnabled = typeof this._config.swimlane.isZoomEnabled !== "undefined" && this._config.swimlane.isZoomEnabled !== null ? this._config.swimlane.isZoomEnabled : config.doubleSlider.isZoomEnabled; config.doubleSlider.timeRange = timeRange; config.doubleSlider.markSeries = []; this._ruler = new DiagnosticsHub.Ruler(config); this._ruler.render(); this._ruler.addEventListener(DiagnosticsHub.RulerEvents.Filter, this.selectionChanged.bind(this)); }; Renderer.prototype.renderToolbar = function () { var config = { containerId: this._mainToolbarContainerId, selectionHandler: this.clearSelectionHandler.bind(this), zoomInHandler: this.zoomInHandler.bind(this), zoomOutHandler: this.zoomOutHandler.bind(this) }; this._toolbar = new DiagnosticsHub.Toolbar(config); this._toolbar.render(); }; Renderer.prototype.renderSwimlanes = function () { for(var i = 0; i < this._graphsConfig.data.length; i++) { var config = this._graphsConfig.data[i]; var swimLaneConfig = this.getSwimlaneConfiguration(config); var swimLane = new DiagnosticsHub.SwimLane(swimLaneConfig); swimLane.addEventListener(VisualStudio.DiagnosticsHub.SwimlaneEvents.Filter, this.selectionChanged.bind(this)); swimLane.render(); this._swimLanes.push({ swimLane: swimLane, config: swimLaneConfig, graphSeries: this._graphsConfig.data[i].JsonObject.Series }); } }; Renderer.prototype.addSeriesData = function (eventArgs) { for(var i = 0; i < this._swimLanes.length; i++) { var swimlaneInfo = this._swimLanes[i]; for(var j = 0; j < swimlaneInfo.graphSeries.length; j++) { var series = swimlaneInfo.graphSeries[j]; if(series.DataSource.CounterId === eventArgs.DataSource.CounterId) { swimlaneInfo.swimLane.addGraphSeriesData(eventArgs.DataSource.CounterId, eventArgs.NewPoints, true); break; } } } }; Renderer.prototype.getSwimlaneConfiguration = function (config) { var swimlaneConfig = new DiagnosticsHub.SwimLaneConfiguration(); swimlaneConfig.containerId = this._swimlaneContainerIdPrefix + this._divIndex; this._divIndex++; if(config.ClassName) { swimlaneConfig.body.graph.registeredClass = RegisterNamespace.getRegisteredGraph(config.ClassName); } else { swimlaneConfig.body.graph.registeredClass = RegisterNamespace.getRegisteredGraph("Microsoft.VisualStudio.DiagnosticsHub.MultiLineGraph"); } swimlaneConfig.body.graph.height = this._config.swimlane.graph.height; swimlaneConfig.body.graph.jsonConfig = config.JsonObject; swimlaneConfig.body.graph.jsonConfig.GraphBehaviour = DiagnosticsHub.GraphBehaviourType.PostMortem; swimlaneConfig.body.graph.resources = config.Resources; swimlaneConfig.body.leftScale.isVisible = this._config.swimlane.leftScale.isVisible; swimlaneConfig.body.leftScale.width = this._config.swimlane.leftScale.width; swimlaneConfig.body.rightScale.isVisible = this._config.swimlane.rightScale.isVisible; swimlaneConfig.body.rightScale.width = this._config.swimlane.rightScale.width; swimlaneConfig.minSelectionWidthInPixels = this._config.swimlane.minSelectionWidthInPixels; swimlaneConfig.timeRange = this._currentTimeRange; swimlaneConfig.header.title.titleText = config.Title; swimlaneConfig.header.description = config.Description; swimlaneConfig.header.legend.data = []; swimlaneConfig.getVerticalRulerLinePositions = DiagnosticsHub.RulerUtilities.getVerticalLinePositions; if(this._dependencyManager) { swimlaneConfig.body.graph.loadCss = this._dependencyManager.loadCss.bind(this); } swimlaneConfig.isSelectionEnabled = typeof this._config.swimlane.isSelectionEnabled !== "undefined" && this._config.swimlane.isSelectionEnabled !== null ? this._config.swimlane.isSelectionEnabled : swimlaneConfig.isSelectionEnabled; swimlaneConfig.isZoomEnabled = typeof this._config.swimlane.isZoomEnabled !== "undefined" && this._config.swimlane.isZoomEnabled !== null ? this._config.swimlane.isZoomEnabled : swimlaneConfig.isZoomEnabled; return swimlaneConfig; }; Renderer.prototype.selectionChanged = function (evt) { var newSelectionTimeRange = evt.data.position; for(var i = 0; i < this._swimLanes.length; i++) { var swimlane = this._swimLanes[i].swimLane; var selectionTimeRange = swimlane.getSelection(); if(!newSelectionTimeRange.equals(selectionTimeRange)) { swimlane.setSelection(newSelectionTimeRange); } } var handlePosition = this._ruler.getHandlePosition(); if(!handlePosition.equals(newSelectionTimeRange)) { this._ruler.setHandlePosition(newSelectionTimeRange); } this._handlePosition = newSelectionTimeRange; this._toolbar.setButtonState(this.getCommandsStatus()); this.raiseSelectionChangedEvent(evt.type, evt.data.position); }; Renderer.prototype.zoomInHandler = function () { for(var i = 0; i < this._swimLanes.length; i++) { var swimlane = this._swimLanes[i].swimLane; swimlane.zoom(this._handlePosition); } this._ruler.zoom(this._handlePosition); this._currentTimeRange = this._handlePosition; this._toolbar.setButtonState(this.getCommandsStatus()); }; Renderer.prototype.zoomOutHandler = function () { for(var i = 0; i < this._swimLanes.length; i++) { var swimlane = this._swimLanes[i].swimLane; swimlane.zoom(this._originalTimeRange, this._handlePosition); } this._ruler.zoom(this._originalTimeRange, this._handlePosition); this._currentTimeRange = this._originalTimeRange; this._toolbar.setButtonState(this.getCommandsStatus()); }; Renderer.prototype.clearSelectionHandler = function () { for(var i = 0; i < this._swimLanes.length; i++) { var swimlane = this._swimLanes[i].swimLane; swimlane.setSelection(this._currentTimeRange); } this._ruler.setHandlePosition(this._currentTimeRange); this._handlePosition = this._currentTimeRange; this._toolbar.setButtonState(this.getCommandsStatus()); this.raiseSelectionChangedEvent(DiagnosticsHub.SwimlaneEvents.Filter, this._currentTimeRange); }; Renderer.prototype.raiseSelectionChangedEvent = function (type, position) { if(this._eventManager) { var information = { type: type, data: { position: { begin: position.begin.nsec, end: position.end.nsec } } }; this._eventManager.raiseEvent(type, information); } }; Renderer.prototype.getCommandsStatus = function () { return { isZoomInEnabled: this.getZoomInButtonState(), isResetZoomEnabled: this.getResetZoomButtonState(), isClearSelectionEnabled: this.getClearSelectionButtonState() }; }; Renderer.prototype.getZoomInButtonState = function () { var isEnabled = true; if(this._handlePosition.equals(this._currentTimeRange)) { isEnabled = false; } return isEnabled; }; Renderer.prototype.getResetZoomButtonState = function () { var isEnabled = false; if(!this._originalTimeRange.equals(this._currentTimeRange)) { isEnabled = true; } return isEnabled; }; Renderer.prototype.getClearSelectionButtonState = function () { var isEnabled = false; if(!this._handlePosition.equals(this._currentTimeRange)) { isEnabled = true; } return isEnabled; }; return Renderer; })(); DiagnosticsHub.Renderer = Renderer; })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {})); var DiagnosticsHub = VisualStudio.DiagnosticsHub; })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {})); var VisualStudio = Microsoft.VisualStudio; })(Microsoft || (Microsoft = {})); var Microsoft; (function (Microsoft) { (function (VisualStudio) { (function (DiagnosticsHub) { var Scrollbar = (function () { function Scrollbar(config) { this._parentCss = "scrollbar-container"; this._containerCss = "scrollbar"; this._containerId = "scrollbar"; this._scrollbarCalculatorId = "scrollbarWidthCalculator"; this._scrollbarCalculatorCss = "scrollbar-width-calculator"; this._ignoreEvent = false; this._isScrollbarLive = true; if(!config) { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1002")); } this._config = config; } Scrollbar.prototype.render = function () { if(this._config && this._config.containerId) { var parent = document.getElementById(this._config.containerId); parent.classList.add(this._parentCss); this._container = document.createElement("div"); this._container.classList.add(this._containerCss); this._container.id = this._containerId; this._container.addEventListener("scroll", this.onScroll.bind(this)); parent.appendChild(this._container); this._scrollbarCalculator = document.createElement("div"); this._scrollbarCalculator.classList.add(this._scrollbarCalculatorCss); this._scrollbarCalculator.id = this._scrollbarCalculatorId; this._container.appendChild(this._scrollbarCalculator); this._scrollbarCalculator.style.left = this._container.offsetWidth - 1 + "px"; this._container.scrollLeft = this._container.scrollWidth - this._container.offsetWidth; } }; Scrollbar.prototype.setScrollPosition = function (current, original) { var elapsedTime = original.elapsed.nsec; var currentElapsed = current.elapsed.nsec; var width = this._container.offsetWidth; this._scrollbarCalculator.style.left = ((width * elapsedTime) / currentElapsed) - 1 + "px"; if(this._isScrollbarLive) { this._container.scrollLeft = this._container.scrollWidth - this._container.offsetWidth; this._ignoreEvent = true; } }; Scrollbar.prototype.onScroll = function (evt) { if(this._config.scrollHandler && !this._ignoreEvent) { this._config.scrollHandler(this._container.scrollLeft, this._container.scrollWidth); } this._ignoreEvent = false; }; return Scrollbar; })(); DiagnosticsHub.Scrollbar = Scrollbar; })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {})); var DiagnosticsHub = VisualStudio.DiagnosticsHub; })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {})); var VisualStudio = Microsoft.VisualStudio; })(Microsoft || (Microsoft = {})); var Microsoft; (function (Microsoft) { (function (VisualStudio) { (function (DiagnosticsHub) { var DiagnosticsHubDataManager = (function () { function DiagnosticsHubDataManager() { this._graphConfigurationMarshaler = Plugin.Utilities.JSONMarshaler.attachToPublishedObject("Microsoft.DiagnosticsHub.VisualStudio.Presentation.JavaScriptModels.SwimLanesViewMarshaler", { }, true); if(!this._graphConfigurationMarshaler) { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1007")); } } DiagnosticsHubDataManager.prototype.getConfigurations = function (func) { this._graphConfigurationMarshaler._call("getConfigurations").done(func); }; DiagnosticsHubDataManager.prototype.dataUpdate = function (func) { this._graphConfigurationMarshaler.addEventListener("dataUpdate", func); }; return DiagnosticsHubDataManager; })(); DiagnosticsHub.DiagnosticsHubDataManager = DiagnosticsHubDataManager; })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {})); var DiagnosticsHub = VisualStudio.DiagnosticsHub; })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {})); var VisualStudio = Microsoft.VisualStudio; })(Microsoft || (Microsoft = {})); var Microsoft; (function (Microsoft) { (function (VisualStudio) { (function (DiagnosticsHub) { var LiveRenderer = (function () { function LiveRenderer(config) { this._swimLanes = []; this._swimLaneContainers = []; this._mainContainerId = "mainContainer"; this._rulerContainerId = "rulerContainer"; this._mainSwimlaneContainerId = "mainSwimlaneContainer"; this._mainToolbarContainerId = "toolBarContainer"; this._mainScrollbarContainerId = "mainScrollContainer"; this._mainSwimlaneContainerCss = "main-swimlane-container"; this._swimlaneDivCss = "swimlane-container"; this._swimlaneContainerIdPrefix = "swimlaneContainer"; this._mainContainerCss = "main-container"; this._mainRulerContainerCss = "main-ruler-container"; this._mainToolbarContainerCss = "main-toolbar-container"; this._mainScrollbarContainerCss = "main-scrollbar"; this._divIndex = 0; this._isGraphRolling = true; this._isInitialized = false; this._oneHour = 60 * 60 * 1000 * 1000000; this._diagnosticSessionTimeRange = DiagnosticsHub.Common.TimeStamp.fromMilliseconds(0); this._bottomBuffer = 15; if(!config) { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1002")); } if(!config.swimlane) { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1002")); } this._config = config; if(!this._config.dataManager) { this._config.dataManager = new DiagnosticsHub.DiagnosticsHubDataManager(); } this._resizeHandler = this.onResize.bind(this); } LiveRenderer.prototype.execute = function () { this._config.dataManager.getConfigurations(this.getConfigurationsCallback.bind(this)); }; LiveRenderer.prototype.refresh = function () { for(var i = 0; i < this._swimLanes.length; i++) { this._swimLanes[i].swimLane.resize(null); } this._ruler.resize(); this.onResize(null); }; LiveRenderer.prototype.getConfigurationsCallback = function (data) { var graphConfigurations = data.GraphConfigurations; for(var i = 0; i < data.GraphConfigurations.length; i++) { var config = data.GraphConfigurations[i]; config.JsonObject = JSON.parse(config.JsonConfiguration); } if(data.QpcTimeProperties) { this._timeProperties = new DiagnosticsHub.Common.QpcTimeProperties(data.QpcTimeProperties.CollectionStartTime, data.QpcTimeProperties.Frequency); } else { this._timeProperties = new DiagnosticsHub.Common.QpcTimeProperties(0, 1000); } this._graphsConfig = { data: graphConfigurations }; this.render(); }; LiveRenderer.prototype.onResize = function (e) { this.createTime(this._currentTimeRange.begin); if(this._dataTimeRange) { this.adjustTimeRange(this._dataTimeRange.end); } var isLatestPointWithinTimeRange = this._diagnosticSessionTimeRange.nsec <= this._currentTimeRange.end.nsec && this._diagnosticSessionTimeRange.nsec >= this._currentTimeRange.begin.nsec; if(isLatestPointWithinTimeRange !== this._isGraphRolling) { this._isGraphRolling = this._scrollbar._isScrollbarLive = isLatestPointWithinTimeRange; this.setGraphState(this._isGraphRolling); } this.updateTimeRange(); this.setScrollPosition(); }; LiveRenderer.prototype.render = function () { this._mainContainerId = this._config.containerId || this._mainContainerId; this._container = document.getElementById(this._mainContainerId); this._container.classList.add(this._mainContainerCss); this._toolbarContainer = document.createElement("div"); this._toolbarContainer.id = this._mainToolbarContainerId; this._toolbarContainer.classList.add(this._mainToolbarContainerCss); this._container.appendChild(this._toolbarContainer); this._rulerContainer = document.createElement("div"); this._rulerContainer.id = this._rulerContainerId; this._rulerContainer.classList.add(this._mainRulerContainerCss); this._container.appendChild(this._rulerContainer); this._swimlaneContainer = document.createElement("div"); this._swimlaneContainer.id = this._mainSwimlaneContainerId; this._container.appendChild(this._swimlaneContainer); this._mainScrollbarContainer = document.createElement("div"); this._mainScrollbarContainer.id = this._mainScrollbarContainerId; this._mainScrollbarContainer.classList.add(this._mainScrollbarContainerCss); this._container.appendChild(this._mainScrollbarContainer); this.renderToolArea(); this._config.dataManager.dataUpdate(this.dataUpdateListener.bind(this)); }; LiveRenderer.prototype.dataUpdateListener = function (eventArgs) { if(!this._isInitialized) { this.renderToolArea(); } if(this._isInitialized) { if(eventArgs.Timestamp) { var msTimeStamp = DiagnosticsHub.Common.TimeStamp.fromMilliseconds(this._timeProperties.convertQpcTimestampToMilliseconds(eventArgs.Timestamp)); if(this.adjustTimeRange(msTimeStamp)) { if(this._isGraphRolling) { this.updateTimeRange(); } this.setScrollPosition(); } } this.addSeriesData(eventArgs); } }; LiveRenderer.prototype.renderToolArea = function () { if(this._container.clientWidth > this._config.swimlane.leftScale.width + this._config.swimlane.rightScale.width + 2) { this.createTime(DiagnosticsHub.Common.TimeStamp.fromMilliseconds(0)); window.addEventListener("resize", this._resizeHandler); this.renderRuler(); this.createSwimlaneContainers(); this.renderSwimlanes(); this.renderScrollbar(); this._isInitialized = true; if(this._config.isResizeHandlerRequired) { this._eventAggregator = VisualStudio.DiagnosticsHub.getEventAggregator(); this.resizeHost(); } } }; LiveRenderer.prototype.createTime = function (start) { if(this._container.clientWidth > this._config.swimlane.leftScale.width + this._config.swimlane.rightScale.width + 2) { var width = this._container.clientWidth - this._config.swimlane.leftScale.width - this._config.swimlane.rightScale.width - 2; this._currentTimeRange = new DiagnosticsHub.Common.TimeSpan(start, DiagnosticsHub.Common.TimeStamp.fromMilliseconds((width * 200) + start.msec)); if(this._isGraphRolling) { if(this._originalTimeRange) { this._originalTimeRange = new DiagnosticsHub.Common.TimeSpan(this._originalTimeRange.begin, this._currentTimeRange.end); } else { this._originalTimeRange = this._currentTimeRange; } } } }; LiveRenderer.prototype.createSwimlaneContainers = function () { this._mainSwimlaneContainer = document.getElementById(this._mainSwimlaneContainerId); var msGridRowsArr = []; if(this._mainSwimlaneContainer) { this._mainSwimlaneContainer.classList.add(this._mainSwimlaneContainerCss); for(var i = 0; i < this._graphsConfig.data.length; i++) { var swimlaneDiv = document.createElement("div"); swimlaneDiv.id = this._swimlaneContainerIdPrefix + i; swimlaneDiv.classList.add(this._swimlaneDivCss); swimlaneDiv.style.msGridRow = (i + 1).toString(); this._swimLaneContainers.push(swimlaneDiv); msGridRowsArr.push("auto"); } this._mainSwimlaneContainer.style.msGridRows = msGridRowsArr.join(" "); for(var i = 0; i < this._swimLaneContainers.length; i++) { this._mainSwimlaneContainer.appendChild(this._swimLaneContainers[i]); } this._divIndex = 0; } else { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1001")); } }; LiveRenderer.prototype.renderRuler = function () { var config = new DiagnosticsHub.RulerConfig(this._rulerContainerId); config.doubleSlider.isSelectionEnabled = typeof this._config.swimlane.isSelectionEnabled !== "undefined" && this._config.swimlane.isSelectionEnabled !== null ? this._config.swimlane.isSelectionEnabled : config.doubleSlider.isSelectionEnabled; config.doubleSlider.isZoomEnabled = typeof this._config.swimlane.isZoomEnabled !== "undefined" && this._config.swimlane.isZoomEnabled !== null ? this._config.swimlane.isZoomEnabled : config.doubleSlider.isZoomEnabled; config.doubleSlider.timeRange = this._currentTimeRange; config.doubleSlider.markSeries = [ { id: "UserMark", label: Plugin.Resources.getString("RulerUserMarkLabel"), tooltip: Plugin.Resources.getString("UserMarkTooltip"), type: DiagnosticsHub.MarkType.UserMark } ]; this._ruler = new DiagnosticsHub.Ruler(config); this._ruler.render(); }; LiveRenderer.prototype.renderSwimlanes = function () { for(var i = 0; i < this._graphsConfig.data.length; i++) { var config = this._graphsConfig.data[i]; var swimLaneConfig = this.getSwimlaneConfiguration(config); var swimLane = new DiagnosticsHub.SwimLane(swimLaneConfig); swimLane.addEventListener(VisualStudio.DiagnosticsHub.SwimlaneEvents.Visibility, this.visibilityChanged.bind(this)); swimLane.render(); this._swimLanes.push({ swimLane: swimLane, config: swimLaneConfig, graphSeries: this._graphsConfig.data[i].JsonObject.Series }); } }; LiveRenderer.prototype.resizeHost = function () { if(this._eventAggregator) { var height = Math.ceil(this._toolbarContainer.offsetHeight + this._rulerContainer.offsetHeight + this._swimlaneContainer.offsetHeight + this._mainScrollbarContainer.offsetHeight + this._bottomBuffer); this._eventAggregator.raiseEvent("Microsoft.DiagnosticsHub.SwimlaneResizeHeight", height); } }; LiveRenderer.prototype.renderScrollbar = function () { var config = { containerId: this._mainScrollbarContainerId, scrollHandler: this.onScroll.bind(this) }; this._scrollbar = new DiagnosticsHub.Scrollbar(config); this._scrollbar.render(); }; LiveRenderer.prototype.addSeriesData = function (eventArgs) { if(this._swimLanes && eventArgs.UpdatedSeries) { for(var i = 0; i < this._swimLanes.length; i++) { var swimlaneInfo = this._swimLanes[i]; for(var j = 0; j < swimlaneInfo.graphSeries.length; j++) { var series = swimlaneInfo.graphSeries[j]; for(var k = 0; k < eventArgs.UpdatedSeries.length; k++) { var newSeries = eventArgs.UpdatedSeries[k]; if(series.DataSource.CounterId === newSeries.DataSource.CounterId && newSeries.NewPoints) { for(var l = 0; l < newSeries.NewPoints.length; l++) { swimlaneInfo.swimLane.addGraphSeriesData(newSeries.DataSource.CounterId, [ newSeries.NewPoints[l] ], false); var newRange = DiagnosticsHub.Common.TimeStamp.fromMilliseconds(this._timeProperties.convertQpcTimestampToMilliseconds(newSeries.NewPoints[l].Timestamp)); if(this._ruler && this._diagnosticSessionTimeRange.msec < newRange.msec) { this._diagnosticSessionTimeRange = newRange; this._ruler.setDiagnosticsSessionTimeRange(newRange); } } break; } } } } } }; LiveRenderer.prototype.adjustTimeRange = function (time) { var isAdjusted = false; if(time) { while(time.msec > this._originalTimeRange.end.msec || (time.msec > this._currentTimeRange.end.msec && this._currentTimeRange.end.msec <= this._originalTimeRange.end.msec && this._isGraphRolling)) { if(this._isGraphRolling) { var elapsed = this._currentTimeRange.elapsed.nsec * 0.30; this._originalTimeRange = new DiagnosticsHub.Common.TimeSpan(this._originalTimeRange.begin, DiagnosticsHub.Common.TimeStamp.fromNanoseconds(this._currentTimeRange.end.nsec + elapsed)); this._currentTimeRange = new DiagnosticsHub.Common.TimeSpan(DiagnosticsHub.Common.TimeStamp.fromNanoseconds(this._currentTimeRange.begin.nsec + elapsed), DiagnosticsHub.Common.TimeStamp.fromNanoseconds(this._currentTimeRange.end.nsec + elapsed)); } else { this._originalTimeRange = new DiagnosticsHub.Common.TimeSpan(this._originalTimeRange.begin, time); } isAdjusted = true; } if(!isAdjusted) { this._dataTimeRange = new DiagnosticsHub.Common.TimeSpan(this._currentTimeRange.begin, time); } } return isAdjusted; }; LiveRenderer.prototype.updateTimeRange = function () { var pointRequiredToBeDropped = false; if(this._diagnosticSessionTimeRange && (this._diagnosticSessionTimeRange.nsec - this._oneHour > this._originalTimeRange.begin.nsec)) { this._originalTimeRange = new DiagnosticsHub.Common.TimeSpan(DiagnosticsHub.Common.TimeStamp.fromNanoseconds(this._diagnosticSessionTimeRange.nsec - this._oneHour), this._originalTimeRange.end); if(this._currentTimeRange.begin.nsec < this._originalTimeRange.begin.nsec) { this._currentTimeRange = new DiagnosticsHub.Common.TimeSpan(this._originalTimeRange.begin, this._currentTimeRange.end); } pointRequiredToBeDropped = true; } for(var i = 0; i < this._swimLanes.length; i++) { var swimlaneInfo = this._swimLanes[i]; for(var j = 0; j < swimlaneInfo.graphSeries.length; j++) { var series = swimlaneInfo.graphSeries[j]; if(pointRequiredToBeDropped) { swimlaneInfo.swimLane.removeInvalidPoints(this._originalTimeRange.begin); } swimlaneInfo.swimLane.updateTimeRange(this._currentTimeRange); } } this._ruler.updateTimeRange(this._currentTimeRange, this._originalTimeRange); }; LiveRenderer.prototype.setScrollPosition = function () { if(this._scrollbar) { this._scrollbar.setScrollPosition(this._currentTimeRange, this._originalTimeRange); } }; LiveRenderer.prototype.getSwimlaneConfiguration = function (config) { var swimlaneConfig = new DiagnosticsHub.SwimLaneConfiguration(); swimlaneConfig.containerId = this._swimlaneContainerIdPrefix + this._divIndex; this._divIndex++; swimlaneConfig.body.graph.height = this._config.swimlane.graph.height; swimlaneConfig.body.graph.jsonConfig = config.JsonObject; swimlaneConfig.body.graph.jsonConfig.GraphBehaviour = DiagnosticsHub.GraphBehaviourType.Live; swimlaneConfig.body.graph.jsonConfig.TimeProperties = this._timeProperties; swimlaneConfig.body.graph.registeredClass = RegisterNamespace.getRegisteredGraph("Microsoft.VisualStudio.DiagnosticsHub.MultiLineGraph"); swimlaneConfig.body.graph.addMarkSeries = this._ruler.addMarkSeries.bind(this._ruler); swimlaneConfig.body.graph.addMark = this._ruler.addMark.bind(this._ruler); swimlaneConfig.body.graph.resources = config.Resources; swimlaneConfig.body.leftScale.isVisible = this._config.swimlane.leftScale.isVisible; swimlaneConfig.body.leftScale.width = this._config.swimlane.leftScale.width; swimlaneConfig.body.rightScale.isVisible = this._config.swimlane.rightScale.isVisible; swimlaneConfig.body.rightScale.width = this._config.swimlane.rightScale.width; swimlaneConfig.minSelectionWidthInPixels = this._config.swimlane.minSelectionWidthInPixels; swimlaneConfig.timeRange = this._currentTimeRange; swimlaneConfig.header.title.titleText = config.Title; swimlaneConfig.header.description = config.Description; swimlaneConfig.header.legend.data = []; swimlaneConfig.header.title.isGraphCollapsible = typeof this._config.swimlane.isGraphCollapsible !== "undefined" && this._config.swimlane.isGraphCollapsible !== null ? this._config.swimlane.isGraphCollapsible : swimlaneConfig.header.title.isGraphCollapsible; swimlaneConfig.getVerticalRulerLinePositions = DiagnosticsHub.RulerUtilities.getVerticalLinePositions; if(this._dependencyManager) { swimlaneConfig.body.graph.loadCss = this._dependencyManager.loadCss.bind(this); } swimlaneConfig.isSelectionEnabled = typeof this._config.swimlane.isSelectionEnabled !== "undefined" && this._config.swimlane.isSelectionEnabled !== null ? this._config.swimlane.isSelectionEnabled : swimlaneConfig.isSelectionEnabled; swimlaneConfig.isZoomEnabled = typeof this._config.swimlane.isZoomEnabled !== "undefined" && this._config.swimlane.isZoomEnabled !== null ? this._config.swimlane.isZoomEnabled : swimlaneConfig.isZoomEnabled; return swimlaneConfig; }; LiveRenderer.prototype.onScroll = function (left, totalLength) { var time = (this._originalTimeRange.elapsed.nsec * left) / totalLength; this._currentTimeRange = new DiagnosticsHub.Common.TimeSpan(DiagnosticsHub.Common.TimeStamp.fromNanoseconds(this._originalTimeRange.begin.nsec + time), DiagnosticsHub.Common.TimeStamp.fromNanoseconds(this._originalTimeRange.begin.nsec + time + this._currentTimeRange.elapsed.nsec)); var isLatestPointWithinTimeRange = this._diagnosticSessionTimeRange.nsec <= this._currentTimeRange.end.nsec && this._diagnosticSessionTimeRange.nsec >= this._currentTimeRange.begin.nsec; if(isLatestPointWithinTimeRange !== this._isGraphRolling) { this._isGraphRolling = this._scrollbar._isScrollbarLive = isLatestPointWithinTimeRange; this.setGraphState(this._isGraphRolling); } this.updateTimeRange(); }; LiveRenderer.prototype.setGraphState = function (isGraphRolling) { for(var i = 0; i < this._swimLanes.length; i++) { var swimlaneInfo = this._swimLanes[i]; for(var j = 0; j < swimlaneInfo.graphSeries.length; j++) { var series = swimlaneInfo.graphSeries[j]; swimlaneInfo.swimLane.setGraphState(isGraphRolling ? DiagnosticsHub.GraphState.Roll : DiagnosticsHub.GraphState.Stop); } } this._ruler.setState(isGraphRolling ? DiagnosticsHub.GraphState.Roll : DiagnosticsHub.GraphState.Stop); }; LiveRenderer.prototype.visibilityChanged = function (args) { if(args.data && typeof args.data.visible !== "undefined" && args.data.visible !== null) { if(args.data.visible === true) { this._mainScrollbarContainer.style.visibility = "visible"; } else { var hideScrollbar = true; for(var i = 0; i < this._swimLanes.length; i++) { if(this._swimLanes[i].swimLane.isVisible) { hideScrollbar = false; break; } } if(hideScrollbar) { this._mainScrollbarContainer.style.visibility = "hidden"; } } } this.resizeHost(); }; LiveRenderer.prototype.deinitialize = function () { if(this._ruler) { this._ruler.deinitialize(); } if(this._resizeHandler) { window.removeEventListener("resize", this._resizeHandler); } for(var i = 0; i < this._swimLanes.length; i++) { this._swimLanes[i].swimLane.deinitialize(); } }; return LiveRenderer; })(); DiagnosticsHub.LiveRenderer = LiveRenderer; })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {})); var DiagnosticsHub = VisualStudio.DiagnosticsHub; })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {})); var VisualStudio = Microsoft.VisualStudio; })(Microsoft || (Microsoft = {})); .graph-canvas-div { height: 100%; width: 100%; -ms-grid-row: 1; -ms-grid-column: 1; position: relative; } .graph-canvas-div:focus { outline: 1px dotted grey; /*[1px dotted {plugin-treeview-content-selected-border-color}]*/ } .graph-canvas { left: 0px; top: 0px; height: 100%; width: 100%; position: absolute; } .line-separator { height: 1px; background: black; padding: 0px 0px 0px 0px; } .graph-cursor { position: absolute; width: 1px; z-index: 100; background-color: black; /*[{diagnostics-host-graph-cursor}]*/ } .graphContainer { height: 100%; width: 100%; margin: 0; padding: 0; overflow: hidden; display: -ms-grid; -ms-grid-columns: 1fr; -ms-grid-rows: 1fr; color: black; /*[{plugin-color}]*/ font-size: 9pt; /*[{plugin-font-size}]*/ font-family: "Segoe UI", Arial, sans-serif; /*[{plugin-font-family} , Arial, sans-serif]*/ } .graph-focus { position: absolute; height: 2px; } .graph-focus:focus { outline: 1px dotted grey; /*[1px dotted {plugin-treeview-content-selected-border-color}]*/ } .graph-unfocused { outline: none !important; } .main-container { -ms-grid-columns: 1fr; -ms-grid-rows: auto auto auto auto; display: -ms-grid; height: 100vh; width: 100vw; } .main-container .main-toolbar-container { -ms-grid-row: 1; -ms-grid-column: 1; } .main-container .main-ruler-container { -ms-grid-row: 2; -ms-grid-column: 1; } .main-container .main-swimlane-container { -ms-grid-row: 3; -ms-grid-column: 1; display: -ms-grid; -ms-grid-columns: 1fr; } .main-container .main-swimlane-container .swimlane-container { -ms-grid-column: 1; } .main-container .main-scrollbar { -ms-grid-row: 4; -ms-grid-column: 1; } .ruler-body { width: 100%; position: relative; margin: 0; padding: 0; overflow: hidden; z-index: 97; -ms-user-select: none; user-select: none; -ms-grid-row: 2; -ms-grid-column: 1; -ms-grid-row-align: center; border-bottom: 1px solid #c0c0c0; /*[1px solid {diagnostics-host-border}]*/ } .ruler-body:focus { outline: 1px dotted grey; /*[1px dotted {plugin-treeview-content-selected-border-color}]*/ } .ruler-container { width: 100%; margin: 0; padding: 0; overflow: hidden; display: -ms-grid; -ms-grid-columns: 1fr; -ms-grid-rows: auto 1fr; color: black; /*[{plugin-color}]*/ font-size: 9pt; /*[{plugin-font-size}]*/ font-family: "Segoe UI", Arial, sans-serif; /*[{plugin-font-family} , Arial, sans-serif]*/ } .ruler-bar { position: absolute; margin: 0; padding: 0; overflow: hidden; top: 0; height: 100%; z-index: 98; border-left: 1px solid black; /*[1px solid {diagnostics-host-ruler-tickmark}]*/ border-right: 1px solid black; /*[1px solid {diagnostics-host-ruler-tickmark}]*/ } .ruler-slider { cursor: col-resize !important; height: 100%; position: absolute; top: 0px; background-color: black; /*[{diagnostics-host-ruler-slider}]*/ margin: 0; padding: 0; overflow: hidden; z-index: 100; } .ruler-slider:hover { outline: 1px dotted grey; /*[1px dotted {plugin-treeview-content-selected-border-color}]*/ background-color: blue; /*[{diagnostics-host-ruler-slider-active}]*/ } .ruler-slider:focus { outline: 1px dotted grey; /*[1px dotted {plugin-treeview-content-selected-border-color}]*/ background-color: blue; /*[{diagnostics-host-ruler-slider-active}]*/ } .ruler-unselected { height: 100%; position: absolute; top: 0px; background-color: rgba(200,200,200,0.50); margin: 0; padding: 0; overflow: hidden; z-index: 99; } .ruler-scale-main { width: 100%; height: 1.8em; display: block; margin: 0; padding: 0; } .ruler-scale-tickmarks { width: 100%; display: block; height: 100%; margin: 0; padding: 0; position: relative; } .ruler-scale-tickmark-big { position: absolute; margin: 0; padding: 0; top: 0; width: 0px; height: 100%; border-left-width: 1px; border-left-style: solid; border-left-color: black; /*[{diagnostics-host-ruler-tickmark}]*/ } .ruler-scale-tickmark-medium { position: absolute; margin: 0; padding: 0; top: 1em; width: 0px; height: 0.833em; border-left-width: 1px; border-left-style: solid; border-left-color: black; /*[{diagnostics-host-ruler-tickmark}]*/ } .ruler-scale-tickmark-small { position: absolute; margin: 0; padding: 0; top: 1.333em; width: 0px; height: 0.500em; border-left-width: 1px; border-left-style: solid; border-left-color: black; /*[{diagnostics-host-ruler-tickmark}]*/ } .ruler-scale-label-text { position: absolute; margin: 0; padding: 0px 2px 0px 2px; top: 0; line-height: 1em; text-overflow: clip; white-space: nowrap; } .ruler-scale-mark-image-appevent { width: 0.750em; height: 0.750em; background: url("../images/i_appevent.png") no-repeat; /*[url({vs-image-graph-app-event}) no-repeat]*/ background-position-x: left; background-position-y: bottom; background-size: 9px 9px; } .ruler-scale-mark-image-usermark { width: 0.750em; height: 0.750em; background: url("../images/i_usermark.png") no-repeat; /*[url({vs-image-graph-user-mark}) no-repeat]*/ background-position-x: left; background-position-y: bottom; background-size: 9px 9px; } .ruler-scale-mark-image-position { position: absolute; top: 1.083em; } .ruler-legend-div { -ms-grid-columns: auto 1fr; -ms-grid-rows: 1fr; display: -ms-grid; -ms-grid-row-align: center; } .ruler-legend-color-div { width: 9px; height: 9px; -ms-grid-column: 1; -ms-grid-row: 1; -ms-grid-row-align: center; } .ruler-legend-text-div { -ms-grid-column: 2; -ms-grid-row: 1; -ms-grid-row-align: center; margin-right: 10px; margin-left: 2px; } .ruler-legend-container { margin-right: 5px; -ms-grid-row: 1; -ms-grid-column: 2; -ms-grid-row-align: center; -ms-flex-direction: row; -ms-flex-wrap: wrap; -ms-grid-column: 3; -ms-grid-column-align: end; display: -ms-flexbox; } .ruler-legend-color { width: 20px; height: 16px; padding: 0px 0px 0px 0px; vertical-align: middle; } .ruler-label-mark-image-appevent { width: 9px; height: 9px; background: url("../images/i_appevent.png") no-repeat; /*[url({vs-image-graph-app-event}) no-repeat]*/ background-size: 9px 9px; } .ruler-label-mark-image-usermark { width: 9px; height: 9px; background: url("../images/i_usermark.png") no-repeat !important; /*[url({vs-image-graph-user-mark}) no-repeat]*/ background-size: 9px 9px; } .ruler-title-container { -ms-grid-columns: 1fr; -ms-grid-rows: 1fr; display: -ms-grid; -ms-grid-row: 1; -ms-grid-column: 1; -ms-grid-row-align: center; } .ruler-title-expand { width: 10px; height: 10px; padding-right: 2px; display: table-cell; } .ruler-title-text { -ms-grid-row: 1; -ms-grid-column: 1; -ms-grid-row-align: center; font-weight: 600; } .ruler-header { border-bottom: 1px solid grey; /*[1px solid {diagnostics-host-border}]*/ padding-top: 4px; padding-bottom: 4px; -ms-grid-columns: auto 1fr; -ms-grid-rows: 1fr; display: -ms-grid; -ms-grid-row: 1; -ms-grid-column: 1; -ms-grid-row-align: center; } .ruler-area { width: 100%; display: block; vertical-align: middle; } .scrollbar-container { width:100%; height: 100%; } .scrollbar-container .scrollbar { width: 100%; height: 100%; position: relative; overflow-x: scroll !important; } .scrollbar-container .scrollbar .scrollbar-width-calculator { position: relative; height: 1px; width: 1px; } .graphDiv { width: 100%; height: 100%; } .line-separator { height: 1px; background: black; } .legend-div { -ms-grid-columns: auto 1fr; -ms-grid-rows: 1fr; display: -ms-grid; -ms-grid-row-align: center; } .legend-color-div { width: 12px; height: 12px; -ms-grid-column: 1; -ms-grid-row: 1; -ms-grid-row-align: center; -ms-grid-columns: 1fr; -ms-grid-rows: 1fr; display: -ms-grid; } .legend-text-div { -ms-grid-column: 2; -ms-grid-row: 1; -ms-grid-row-align: center; margin-left: 2px; margin-right: 10px; white-space: nowrap; } .legend-container { -ms-grid-row: 1; -ms-grid-column: 2; -ms-grid-row-align: center; -ms-flex-direction: row; -ms-flex-wrap: wrap; -ms-grid-column-align: end; display: -ms-flexbox; margin-left: 20px; } .legend-color { width: 12px; height: 12px; -ms-grid-column: 1; -ms-grid-row: 1; -ms-grid-row-align: center; } .title-container { margin-left: 5px; -ms-grid-columns: 25px 1fr; -ms-grid-rows: 1fr; display: -ms-grid; -ms-grid-row: 1; -ms-grid-column: 1; -ms-grid-row-align: center; } .title-expand { -ms-grid-columns: 1fr; -ms-grid-rows: 1fr; display: -ms-grid; -ms-grid-row: 1; -ms-grid-column: 1; -ms-grid-row-align: center; } .title-text { -ms-grid-row: 1; -ms-grid-column: 2; -ms-grid-row-align: center; font-weight: 600; margin-left: 2px; } .title-expand-button { background: url("../images/itemExpandedIcon.png") no-repeat; /*[url({vs-image-icon-tree-expanded}) no-repeat]*/ background-size: 10px 10px; width: 10px; height: 10px; background-repeat: no-repeat; background-position-x: left; background-position-y: left; -ms-grid-row: 1; -ms-grid-column: 1; -ms-grid-row-align: center; } .title-collapse-button { background: url("../images/itemCollapsedIcon.png") no-repeat; /*[url({vs-image-icon-tree-collapsed}) no-repeat]*/ background-size: 10px 10px; width: 10px; height: 10px; background-repeat: no-repeat; background-position-x: left; background-position-y: left; -ms-grid-row: 1; -ms-grid-column: 1; -ms-grid-row-align: center; } .title-button-disabled { width: 10px; height: 10px; background-repeat: no-repeat; background-position-x: left; background-position-y: left; -ms-grid-row: 1; -ms-grid-column: 1; -ms-grid-row-align: center; } .swimlane-header { border-bottom: 1px solid grey; /*[1px solid {diagnostics-host-swimlane-border}]*/ padding-bottom: 2px; padding-top: 5px; -ms-grid-columns: auto 1fr; -ms-grid-rows: 1fr; display: -ms-grid; -ms-grid-row: 1; -ms-grid-column: 1; -ms-grid-row-align: center; } .swimlane-body { width: 100%; display: -ms-grid; -ms-grid-columns: auto 1fr auto; -ms-grid-rows: 1fr; border-bottom: 1px solid grey; /*[1px solid {diagnostics-host-swimlane-border}]*/ -ms-grid-row: 2; -ms-grid-column: 1; -ms-grid-row-align: center; } .graph-scale-left { border-right-style: solid; border-right-color: grey; /*[{diagnostics-host-graph-scale}]*/ -ms-grid-row: 1; -ms-grid-column: 1; position: relative; } .graph-scale-right { border-left-style: solid; border-left-color: grey; /*[{diagnostics-host-graph-scale}]*/ -ms-grid-row: 1; -ms-grid-column: 3; position: relative; } .graph-axis-left { position: absolute; text-align: right; right: 5px; } .graph-axis-right { position: absolute; text-align: left; left: 5px; } .graph-div { -ms-grid-row: 1; -ms-grid-column: 2; position: relative; } .graph-div:focus { outline: 1px solid red; } .graph-div .unselected { background-color: rgba(200, 200, 200, 0.50); position: absolute; } .graph-canvas { left: 0px; top: 0px; height: 100%; width: 100%; position: absolute; } .graph-axis-line { position: absolute; width: 100%; height: 0px; left: 0px; z-index: 99; border-bottom-color: #c0c0c0; /*[{diagnostics-host-graph-line}]*/ border-bottom-width: 1px; border-bottom-style: dashed; } .swimlane-vertical-line { position:absolute; height:100%; width: 0px; border-right-color: #c0c0c0; /*[{diagnostics-host-graph-line}]*/ border-right-width: 1px; border-right-style: solid; top: 0px; } .toolbar-button { min-width: 73px; padding: 1px 19px 2px 19px; float: left; border: 1px solid #B1B1B2; background: #B1B1B2 none; /*[{plugin-background-color} none]*/ text-align: center; } .disabled { color: #838383; opacity: 0.65; } .toolbar-container { width: 100%; height: 100%; } .header { background-color: TRANSPARENT; /*[{plugin-background-color}]*/ border-bottom: 1px solid TRANSPARENT; /*[1px solid {f12-toolbar-border-color}]*/ min-height: 29px; padding-top: 1px; width: 100%; } .header > .toolbar { margin: 0px 0px 0px 14px; } .header > .toolbar > .buttons { display: inline-block; margin-right: 10px; white-space: nowrap; } .header > .toolbar > .title { font-family: "Segoe UI", Arial, sans-serif; /*[{plugin-font-family} , Arial, sans-serif]*/ font-size: 20px; font-weight: 200; line-height: 32px; margin-top: 6px; padding-right: 31px; } .header > .toolbar > .shellButtonSpacer { display: inline-block; float: right; height: 29px; width: 116px; /* 116px corresponds to 4 shell buttons; no feedback button */ } .toolbarButton { border: 1px solid transparent; display: inline-block; margin: 1px 1px 1px 15px; position: relative; top: 3px; } .toolbarButton:focus { outline: 1px dotted TRANSPARENT; /*[1px dotted {plugin-perftools-focusdots}]*/ } .toolbarButton .buttonIcon { float: left; height: 18px; margin-bottom: auto; margin-top: auto; width: 18px; } .toolbarButtonMouseHover { background-color: TRANSPARENT; /*[{f12-toolbar-button-hover-color}]*/ } .toolbarButtonMouseHover .buttonIcon { background-position-y: -18px; } .toolbarButtonStateDisabled { background-color: transparent; } .toolbarButtonStateDisabled .buttonIcon { background-position-y: -36px; } .toolbarButtonMouseDown { background-color: TRANSPARENT; /*[{f12-toolbar-button-pressed-color}]*/ } var Microsoft; (function (Microsoft) { (function (VisualStudio) { (function (DiagnosticsHub) { "use strict"; var Logger = (function () { function Logger() { this._loggerProxy = Plugin.Utilities.JSONMarshaler.attachToPublishedObject("Microsoft.DiagnosticsHub.VisualStudio.Presentation.JavaScriptModels.LoggerPortMarshaler", { }, true); } Logger.prototype.info = function (message) { this._loggerProxy._call("logInfo", message); }; Logger.prototype.debug = function (message) { this._loggerProxy._call("logDebug", message); }; Logger.prototype.warning = function (message) { this._loggerProxy._call("logWarning", message); }; Logger.prototype.error = function (message) { this._loggerProxy._call("logError", message); }; return Logger; })(); var _logger = null; function getLogger() { if(_logger == null) { _logger = new Logger(); } return _logger; } DiagnosticsHub.getLogger = getLogger; Plugin.addEventListener("pluginready", function () { getLogger(); }); })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {})); var DiagnosticsHub = VisualStudio.DiagnosticsHub; })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {})); var VisualStudio = Microsoft.VisualStudio; })(Microsoft || (Microsoft = {})); var Microsoft; (function (Microsoft) { (function (VisualStudio) { (function (DiagnosticsHub) { "use strict"; var RequestProgress = (function () { function RequestProgress() { } return RequestProgress; })(); DiagnosticsHub.RequestProgress = RequestProgress; var DiagnosticsHubNativeHost = (function () { function DiagnosticsHubNativeHost(logger) { this._logger = logger; this._externalObject = Plugin.VS.Utilities.createExternalObject("DiagnosticsHub.DataWarehouseHost", "{339B3787-FC17-4BF5-A0DC-CBEF24DB2EDE}"); } DiagnosticsHubNativeHost.prototype.request = function (controllerId, actionId, sessionId, request) { var that = this; var completePromise; var errorPromise; var progressPromise; var promiseInitialization = function (completed, error, progress) { completePromise = completed; errorPromise = error; progressPromise = progress; }; var safeInvoke = function (callback, response) { try { callback(response); } catch (e) { that._logger.error(e.toString()); } }; var result = 1; if(this._externalObject != null) { result = this._externalObject.request(controllerId, actionId, sessionId, (typeof request == "object") ? JSON.stringify(request) : (typeof request == "undefined") ? "" : request, function (jsonResponse) { if(completePromise != null) { var result = null; if(jsonResponse != null) { try { result = jsonResponse == null || jsonResponse == "" ? null : JSON.parse(jsonResponse); } catch (e) { that._logger.error("Could not parse complete response: " + jsonResponse); that._logger.error(e.toString()); } } safeInvoke(completePromise, result); } else { that._logger.warning("DiagnosticsHubNativeHost: completed callback is null."); } }, function (jsonResponse) { if(errorPromise != null) { var result = null; if(jsonResponse != null) { try { result = JSON.parse(jsonResponse); } catch (e) { that._logger.error("Could not parse failed response: " + jsonResponse); that._logger.error(e.toString()); } } safeInvoke(errorPromise, result); } else { that._logger.warning("DiagnosticsHubNativeHost: failed callback is null."); } }, function (jsonResponse) { if(progressPromise != null) { var result = null; if(jsonResponse != null) { try { result = JSON.parse(jsonResponse); } catch (e) { that._logger.error("Could not progress parse response: " + jsonResponse); that._logger.error(e.toString()); } } safeInvoke(progressPromise, result); } else { that._logger.warning("DiagnosticsHubNativeHost: progress callback is null."); } }); } else { that._logger.warning("External object is null. Verify that DiagnosticsHub.ScriptedSandboxPlugin.dll was loaded into ScriptedSandbox."); } if(result != 0) { this._logger.error("Could not invoke request method of native host"); var error = new Error(); error.message = error.name = result.toString(16); return Plugin.Promise.wrapError(error); } return new Plugin.Promise(promiseInitialization); }; return DiagnosticsHubNativeHost; })(); DiagnosticsHub.DiagnosticsHubNativeHost = DiagnosticsHubNativeHost; var NativeHostController = (function () { function NativeHostController(sessionId, controllerId) { this._sessionId = sessionId; this._controllerId = controllerId; this._nativeHost = getNativeHost(); } NativeHostController.prototype.request = function (actionId, requestData) { return this._nativeHost.request(this._controllerId, actionId, this._sessionId, requestData); }; return NativeHostController; })(); DiagnosticsHub.NativeHostController = NativeHostController; var _host = null; function getNativeHost() { if(_host == null) { _host = new DiagnosticsHubNativeHost(DiagnosticsHub.getLogger()); } return _host; } DiagnosticsHub.getNativeHost = getNativeHost; })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {})); var DiagnosticsHub = VisualStudio.DiagnosticsHub; })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {})); var VisualStudio = Microsoft.VisualStudio; })(Microsoft || (Microsoft = {})); var Microsoft; (function (Microsoft) { (function (VisualStudio) { (function (DiagnosticsHub) { "use strict"; (function (SessionState) { SessionState._map = []; SessionState.Unknown = 0; SessionState.Created = 100; SessionState.SetupTargets = 150; SessionState.CollectionStarting = 200; SessionState.CollectionStarted = 300; SessionState.CollectionPausing = 325; SessionState.CollectionPauseCanceling = 330; SessionState.CollectionPaused = 350; SessionState.CollectionResuming = 375; SessionState.CollectionResumeCanceling = 380; SessionState.CollectionFinishing = 400; SessionState.CollectionFinished = 500; SessionState.Analyzing = 530; SessionState.AnalyzingFinished = 560; SessionState.CollectionTerminating = 600; SessionState.CollectionTerminated = 700; SessionState.CollectionStartFailed = 10000; SessionState.CollectionStartCanceling = 10100; SessionState.CollectionFinishFailed = 20000; SessionState.CollectionFinishCanceling = 20100; })(DiagnosticsHub.SessionState || (DiagnosticsHub.SessionState = {})); var SessionState = DiagnosticsHub.SessionState; var EventDeferral = (function () { function EventDeferral(onHandlerCompleted) { this._onHandlerCompleted = onHandlerCompleted; } EventDeferral.prototype.complete = function () { this._onHandlerCompleted(); }; return EventDeferral; })(); var StateChangedEventArgs = (function () { function StateChangedEventArgs(eventArgs, onHandlerCompleted) { this._eventArgs = eventArgs; this._waitHandler = false; this._onHandlerCompleted = onHandlerCompleted; this._eventDeferral = null; } Object.defineProperty(StateChangedEventArgs.prototype, "currentState", { get: function () { return this._eventArgs.CurrentState; }, enumerable: true, configurable: true }); Object.defineProperty(StateChangedEventArgs.prototype, "previousState", { get: function () { return this._eventArgs.PreviousState; }, enumerable: true, configurable: true }); StateChangedEventArgs.prototype.getDeferral = function () { if(this._eventDeferral == null) { this._eventDeferral = new EventDeferral(this._onHandlerCompleted); } return this._eventDeferral; }; Object.defineProperty(StateChangedEventArgs.prototype, "waitHandler", { get: function () { return this._eventDeferral != null; }, enumerable: true, configurable: true }); return StateChangedEventArgs; })(); var Session = (function () { function Session(logger) { var that = this; this._eventsListeners = new Array(); this._logger = logger; this._sessionProxy = Plugin.Utilities.JSONMarshaler.attachToPublishedObject("Microsoft.DiagnosticsHub.VisualStudio.Presentation.JavaScriptModels.SessionPortMarshaler", { }, true); this._sessionProxy._call("initialize").done(function () { that._logger.debug("JavaScript session object connected to host. Ready to get session state notification events."); }, function (error) { that._logger.error("Cannot initialize session, error name: '" + error.name + "', error message: '" + error.message + "'"); }); this._sessionProxy.addEventListener("sessionStateChanged", function (eventArgs) { that.stateChangedHandler(eventArgs); }); try { var apex = Plugin.Utilities.JSONMarshaler.attachToPublishedObject("Microsoft.Test.Apex.DiagnosticsHub.ApexJSExtension", { }, true); if(apex != null) { apex._call("getApexJavaScript").done(function (result) { var scriptObj = document.createElement("script"); scriptObj.setAttribute("type", "text/javascript"); scriptObj.setAttribute("src", result); var head = document.getElementsByTagName("head"); if(!head) { that._logger.debug("Unable to add apex script to document"); } else { head[0].appendChild(scriptObj); that._logger.debug("Added ApexJSExtension '" + result + "' to document"); } }); } } catch (e) { this._logger.error(e.toString()); } } Session.prototype.getState = function (callback, onError) { var that = this; this._logger.debug("Calling get state"); return this._sessionProxy._call("getState").done(function (result) { that._logger.debug("On getstate done, state value: " + result); if(callback != null) { callback(result); } }, function (error) { that._logger.error("Cannot get state, error name: '" + error.name + "', error message: '" + error.message + "'"); if(onError != null) { onError(error); } }); }; Session.prototype.addStateChangedEventListener = function (listener) { this._eventsListeners.push(listener); this._logger.debug('State changed event handler added.'); }; Session.prototype.removeStateChangedEventListener = function (listener) { for(var i = 0; i < this._eventsListeners.length; i++) { if(this._eventsListeners[i] == listener) { this._logger.debug('State changed event handler removed.'); this._eventsListeners.splice(i, 1); break; } } }; Session.prototype.stateChangedHandler = function (eventArgs) { var that = this; this._logger.debug('Invoking JavaScript handlers for State Change Event.'); var handlersCount = 0; var onCompleted = function () { handlersCount--; if(handlersCount <= 0) { that._sessionProxy._call("sessionStateChangedCompleted", eventArgs.Token); } else { that._logger.debug("Still waiting when all event state change handlers will complete their work. Handlers count: " + handlersCount); } }; for(var propertyName in this._eventsListeners) { var handler = this._eventsListeners[propertyName]; if(this._eventsListeners.hasOwnProperty(propertyName)) { if(typeof handler == 'function') { try { var jsEventArgs = new StateChangedEventArgs(eventArgs, onCompleted); handler(jsEventArgs); if(jsEventArgs.waitHandler) { handlersCount++; that._logger.debug("JavaScipt handlers for event state changed asked to wait while they will finish. Handlers count: " + handlersCount); } } catch (e) { this._logger.error(e.toString()); } } else { this._logger.warning('One of the listeners not a "function", it has type ' + (typeof handler)); } } } if(handlersCount == 0) { onCompleted(); } }; return Session; })(); var _currentSession = null; function getCurrentSession() { if(_currentSession == null) { _currentSession = new Session(DiagnosticsHub.getLogger()); } return _currentSession; } DiagnosticsHub.getCurrentSession = getCurrentSession; Plugin.addEventListener("pluginready", function () { getCurrentSession(); }); })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {})); var DiagnosticsHub = VisualStudio.DiagnosticsHub; })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {})); var VisualStudio = Microsoft.VisualStudio; })(Microsoft || (Microsoft = {})); var Microsoft; (function (Microsoft) { (function (VisualStudio) { (function (DiagnosticsHub) { (function (DataWarehouse) { "use strict"; var DataSourceIdentity = (function () { function DataSourceIdentity() { } DataSourceIdentity.EtlFile = "DiagnosticsHub.Resource.EtlFile"; DataSourceIdentity.DiagnosticsPackage = "DiagnosticsHub.FileDataSource.DiagnosticsPackage"; DataSourceIdentity.Directory = "DiagnosticsHub.FileDataSource.Directory"; DataSourceIdentity.UnknownFile = "DiagnosticsHub.FileDataSource.UnknownFile"; return DataSourceIdentity; })(); DataWarehouse.DataSourceIdentity = DataSourceIdentity; (function (DataSourceInfoType) { DataSourceInfoType._map = []; DataSourceInfoType.Unknown = 0; DataSourceInfoType.File = 1; DataSourceInfoType.Directory = 2; DataSourceInfoType.Package = 3; })(DataWarehouse.DataSourceInfoType || (DataWarehouse.DataSourceInfoType = {})); var DataSourceInfoType = DataWarehouse.DataSourceInfoType; var DataSourceInfo = (function () { function DataSourceInfo(id, type, identity, path) { this.id = id; this.type = type; this.identity = identity; this.path = path; } return DataSourceInfo; })(); DataWarehouse.DataSourceInfo = DataSourceInfo; var DataWarehouseService = (function () { function DataWarehouseService() { this._serviceProxy = Plugin.Utilities.JSONMarshaler.attachToPublishedObject("Microsoft.DiagnosticsHub.VisualStudio.Presentation.JavaScriptModels.DataWarehouseServiceMarshaler", { }, true); this._logger = DiagnosticsHub.getLogger(); } DataWarehouseService.prototype.getAllDataSourceInfos = function (callback) { var that = this; this._serviceProxy._call("getAllDataSourceInfos").done(function (result) { var infos = new Array(); for(var i = 0; i < result.length; i++) { var dataSource = result[i]; if(dataSource.Type == DataSourceInfoType.File || dataSource.Type == DataSourceInfoType.Directory || dataSource.Type == DataSourceInfoType.Package) { infos.push(new DataSourceInfo(dataSource.Id, dataSource.Type, dataSource.Identity, dataSource.Path)); } else { that._logger.error("Unknown type of data source info type: " + dataSource.Type); } } callback(infos); }); }; return DataWarehouseService; })(); var _service = null; function getDataWarehouseService() { if(_service == null) { _service = new DataWarehouseService(); } return _service; } DataWarehouse.getDataWarehouseService = getDataWarehouseService; Plugin.addEventListener("pluginready", function () { getDataWarehouseService(); }); })(DiagnosticsHub.DataWarehouse || (DiagnosticsHub.DataWarehouse = {})); var DataWarehouse = DiagnosticsHub.DataWarehouse; })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {})); var DiagnosticsHub = VisualStudio.DiagnosticsHub; })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {})); var VisualStudio = Microsoft.VisualStudio; })(Microsoft || (Microsoft = {})); var Microsoft; (function (Microsoft) { (function (VisualStudio) { (function (DiagnosticsHub) { "use strict"; var EventAggregator = (function () { function EventAggregator(logger) { this._eventsListeners = { }; var that = this; this._logger = logger; this._eventAggregatorProxy = Plugin.Utilities.JSONMarshaler.attachToPublishedObject("Microsoft.DiagnosticsHub.VisualStudio.Presentation.JavaScriptModels.EventAggregatorMarshaler", { }, true); this._eventAggregatorProxy.addEventListener("globalEventHandler", function (eventArgs) { that.globalEventHandler(eventArgs); }); } EventAggregator.prototype.addEventListener = function (eventType, listener) { if(typeof this._eventsListeners[eventType] == 'undefined') { this._eventsListeners[eventType] = new Array(); } this._eventsListeners[eventType].push(listener); this._logger.debug('Event listener added.'); }; EventAggregator.prototype.removeEventListener = function (eventType, listener) { if(typeof this._eventsListeners[eventType] != 'undefined') { var subscribers = this._eventsListeners[eventType]; for(var i = 0; i < subscribers.length; i++) { if(subscribers[i] == listener) { this._logger.debug('Event listener removed.'); subscribers.splice(i, 1); break; } } if(subscribers.length == 0) { delete this._eventsListeners[eventType]; } } }; EventAggregator.prototype.globalEventHandler = function (eventArgs) { var eventType = eventArgs.EventType; this._logger.debug('Handling event type ' + eventType + '.'); var listeners = this._eventsListeners[eventType]; if(typeof listeners != 'undefined') { for(var propertyName in listeners) { var handler = listeners[propertyName]; if(listeners.hasOwnProperty(propertyName)) { if(typeof handler == 'function') { var dataString = eventArgs.HubEventArgs.Data; this._logger.debug('Raise handler for event type ' + eventType + ' with data ' + dataString + '.'); try { var data = null; if(dataString != null) { data = JSON.parse(dataString); } handler(data); } catch (e) { this._logger.error(e.toString()); } } else { this._logger.warning('One of the listeners not a "function", it has type ' + (typeof handler)); } } } } else { this._logger.debug('Does not have listeners for event type ' + eventType + '.'); } }; EventAggregator.prototype.raiseEvent = function (eventType, data) { var dataString = null; if(data != null) { dataString = JSON.stringify(data); } this._logger.debug('Raising event type ' + eventType + ' with data ' + dataString + '.'); this._eventAggregatorProxy._call("raiseEvent", eventType, dataString); }; return EventAggregator; })(); var _eventAggregator = null; function getEventAggregator() { if(_eventAggregator == null) { _eventAggregator = new EventAggregator(DiagnosticsHub.getLogger()); } return _eventAggregator; } DiagnosticsHub.getEventAggregator = getEventAggregator; Plugin.addEventListener("pluginready", function () { getEventAggregator(); }); })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {})); var DiagnosticsHub = VisualStudio.DiagnosticsHub; })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {})); var VisualStudio = Microsoft.VisualStudio; })(Microsoft || (Microsoft = {})); var Microsoft; (function (Microsoft) { (function (VisualStudio) { (function (DiagnosticsHub) { "use strict"; var GraphDataUpdateService = (function () { function GraphDataUpdateService(logger) { this._logger = logger; this._serviceProxy = Plugin.Utilities.JSONMarshaler.attachToPublishedObject("Microsoft.DiagnosticsHub.VisualStudio.Presentation.JavaScriptModels.GraphDataUpdateServiceMarshaler", { }, true); } GraphDataUpdateService.prototype.addNewPoints = function (counterId, points) { var that = this; this._serviceProxy._call("addNewPoints", counterId, points).done(function () { }, function (error) { that._logger.error(error.message); }); }; return GraphDataUpdateService; })(); var _graphDataUpdateService = null; function getGraphDataUpdateService() { if(_graphDataUpdateService == null) { _graphDataUpdateService = new GraphDataUpdateService(DiagnosticsHub.getLogger()); } return _graphDataUpdateService; } DiagnosticsHub.getGraphDataUpdateService = getGraphDataUpdateService; Plugin.addEventListener("pluginready", function () { getGraphDataUpdateService(); }); })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {})); var DiagnosticsHub = VisualStudio.DiagnosticsHub; })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {})); var VisualStudio = Microsoft.VisualStudio; })(Microsoft || (Microsoft = {})); var Microsoft; (function (Microsoft) { (function (VisualStudio) { (function (DiagnosticsHub) { "use strict"; var OutputWindowsService = (function () { function OutputWindowsService() { this._loggerProxy = Plugin.Utilities.JSONMarshaler.attachToPublishedObject("Microsoft.DiagnosticsHub.VisualStudio.Presentation.JavaScriptModels.OutputWindowServiceMarshaler", { }, true); } OutputWindowsService.prototype.outputLine = function (message) { this._loggerProxy._call("outputLine", message); }; OutputWindowsService.prototype.outputLineAndShow = function (message) { this._loggerProxy._call("outputLineAndShow", message); }; OutputWindowsService.prototype.outputString = function (message) { this._loggerProxy._call("outputString", message); }; OutputWindowsService.prototype.outputStringAndShow = function (message) { this._loggerProxy._call("outputStringAndShow", message); }; return OutputWindowsService; })(); var _outputWindowService = null; function getOutputWindowsService() { if(_outputWindowService == null) { _outputWindowService = new OutputWindowsService(); } return _outputWindowService; } DiagnosticsHub.getOutputWindowsService = getOutputWindowsService; Plugin.addEventListener("pluginready", function () { getOutputWindowsService(); }); })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {})); var DiagnosticsHub = VisualStudio.DiagnosticsHub; })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {})); var VisualStudio = Microsoft.VisualStudio; })(Microsoft || (Microsoft = {})); var Microsoft; (function (Microsoft) { (function (VisualStudio) { (function (DiagnosticsHub) { (function (Collectors) { "use strict"; var StandardTransportService = (function () { function StandardTransportService(logger) { var that = this; this._messageListeners = { }; this._logger = logger; this._proxy = Plugin.Utilities.JSONMarshaler.attachToPublishedObject("Microsoft.DiagnosticsHub.VisualStudio.Presentation.JavaScriptModels.StandardTransportServicePortMarshaller", { }, true); this._proxy.addEventListener("stringMessageReceived", function (eventArgs) { that._logger.debug("StandardTransportService.stringMessageReceived"); that.onStringMessageReceived(eventArgs); }); } StandardTransportService.prototype.getIsRemoteConnection = function () { return this._proxy._call("getIsRemoteConnection"); }; StandardTransportService.prototype.sendStringToCollectionAgent = function (agentClassId, request) { this._logger.debug("StandardTransportService.sendStringToCollectionAgent"); return this._proxy._call("sendStringToCollectionAgent", agentClassId, request); }; StandardTransportService.prototype.downloadFile = function (targetFilePath, localFilePath) { this._logger.debug("StandardTransportService.downloadFile"); return this._proxy._call("downloadFile", targetFilePath, localFilePath); }; StandardTransportService.prototype.addMessageListener = function (listenerGuid, listener) { var _this = this; this._logger.debug("StandardTransportService.addMessageListener(" + listenerGuid + ")"); if(typeof listenerGuid != "string" || (listenerGuid.length != 38 && listenerGuid.length != 36)) { throw new Error("'listenerGuid' must be a Guid string"); } if(listenerGuid.length == 38 && listenerGuid[0] == '{' && listenerGuid[37] == '}') { listenerGuid = listenerGuid.substr(1, 36); } listenerGuid = listenerGuid.toLowerCase(); var lowerCaseGuidRegEx = new RegExp("^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$"); if(!lowerCaseGuidRegEx.test(listenerGuid)) { throw new Error("'listenerGuid' must be a Guid string"); } if(this._messageListeners[listenerGuid]) { throw new Error("Listener already exists with guid = " + listenerGuid); } this._messageListeners[listenerGuid] = listener; return this._proxy._call("enableEventsForListenerId", listenerGuid).then(null, function (value) { _this._messageListeners[listenerGuid] = null; }); }; StandardTransportService.prototype.onStringMessageReceived = function (eventArgs) { this._logger.debug('StandardTransportService.onStringMessageReceived'); var listenerGuid = eventArgs.ListenerId; var message = eventArgs.Message; if(this._messageListeners[listenerGuid]) { var listener = this._messageListeners[listenerGuid]; listener(message); } else { this._logger.warning('Unexpected message recieved without a message listener. listenerGuid=' + listenerGuid); } }; return StandardTransportService; })(); var _standardTransportService = null; function getStandardTransportService() { if(_standardTransportService == null) { _standardTransportService = new StandardTransportService(DiagnosticsHub.getLogger()); } return _standardTransportService; } Collectors.getStandardTransportService = getStandardTransportService; })(DiagnosticsHub.Collectors || (DiagnosticsHub.Collectors = {})); var Collectors = DiagnosticsHub.Collectors; })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {})); var DiagnosticsHub = VisualStudio.DiagnosticsHub; })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {})); var VisualStudio = Microsoft.VisualStudio; })(Microsoft || (Microsoft = {})); var Microsoft; (function (Microsoft) { (function (VisualStudio) { (function (DiagnosticsHub) { "use strict"; var JsonTimestamp = (function () { function JsonTimestamp(high, low) { this.isHighNegative = false; this.isLowNegative = false; if(!Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.validate(high) || !Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.validate(low)) { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1000")); } if(high < 0) { high = (high >>> 0); this.isHighNegative = true; } if(low < 0) { low = (low >>> 0); this.isLowNegative = true; } this.value = { h: high, l: low }; } JsonTimestamp._oldest = { h: 0, l: 0 }; JsonTimestamp._latest = { h: 0xffffffff, l: 0xffffffff }; Object.defineProperty(JsonTimestamp, "Oldest", { get: function () { return Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp._oldest; }, enumerable: true, configurable: true }); Object.defineProperty(JsonTimestamp, "Latest", { get: function () { return Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp._latest; }, enumerable: true, configurable: true }); Object.defineProperty(JsonTimestamp.prototype, "JsonValue", { get: function () { var high = this.value.h; if(this.isHighNegative || high > 0x7fffffff) { high = high << 0; } var low = this.value.l; if(this.isLowNegative || low > 0x7fffffff) { low = low << 0; } return { h: high, l: low }; }, enumerable: true, configurable: true }); Object.defineProperty(JsonTimestamp.prototype, "Value", { get: function () { return "0x" + Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.padLeadingZeros(this.value.h.toString(16), 8) + Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.padLeadingZeros(this.value.l.toString(16), 8); }, enumerable: true, configurable: true }); JsonTimestamp.prototype.equals = function (other) { var isEqual = false; if(Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.validateTimestamp(other)) { var otherTime = Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.convertToManagedTimeFormat(other.JsonValue); isEqual = (this.value.h === otherTime.h && this.value.l === otherTime.l); } return isEqual; }; JsonTimestamp.prototype.greater = function (other) { var isGreater = false; if(Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.validateTimestamp(other)) { var otherTime = Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.convertToManagedTimeFormat(other.JsonValue); if(this.value.h > otherTime.h) { isGreater = true; } else if(this.value.h === otherTime.h) { if(this.value.l > otherTime.l) { isGreater = true; } } } return isGreater; }; JsonTimestamp.add = function add(first, second) { return Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.addition(first, second); }; JsonTimestamp.subtract = function subtract(first, second) { if(!Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.validateTimestamp(first) || !Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.validateTimestamp(second) || second.greater(first)) { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1000")); } var otherTime = Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.convertToManagedTimeFormat(second.JsonValue); var negateHigh = ~(otherTime.h); var negateLow = ~(otherTime.l); var twosComplement = Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.addition(new Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp(negateHigh, negateLow), new Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp(0, 1), true); return Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.addition(first, twosComplement, true); }; JsonTimestamp.convertToManagedTimeFormat = function convertToManagedTimeFormat(time) { var high = time.h < 0 ? time.h >>> 0 : time.h; var low = time.l < 0 ? time.l >>> 0 : time.l; return { h: high, l: low }; }; JsonTimestamp.addition = function addition(first, second, ignoreOverflow) { if (typeof ignoreOverflow === "undefined") { ignoreOverflow = false; } if(!Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.validateTimestamp(first) || !Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.validateTimestamp(second)) { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1000")); } var firstTime = Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.convertToManagedTimeFormat(first.JsonValue); var secondTime = Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.convertToManagedTimeFormat(second.JsonValue); var low = 0; var high = 0; var low0 = (firstTime.l & 0xff) + (secondTime.l & 0xff); var low8 = (low0 >>> 8) + ((firstTime.l >>> 8) & 0xff) + ((secondTime.l >>> 8) & 0xff); low0 = low0 & 0xff; var low16 = (low8 >>> 8) + ((firstTime.l >>> 16) & 0xff) + ((secondTime.l >>> 16) & 0xff); low8 = low8 & 0xff; var low24 = (low16 >>> 8) + ((firstTime.l >>> 24) & 0xff) + ((secondTime.l >>> 24) & 0xff); low16 = low16 & 0xff; var high0 = (low24 >>> 8) + (firstTime.h & 0xff) + (secondTime.h & 0xff); low24 = low24 & 0xff; var high8 = (high0 >>> 8) + ((firstTime.h >>> 8) & 0xff) + ((secondTime.h >>> 8) & 0xff); high0 = high0 & 0xff; var high16 = (high8 >>> 8) + ((firstTime.h >>> 16) & 0xff) + ((secondTime.h >>> 16) & 0xff); high8 = high8 & 0xff; var high24 = (high16 >>> 8) + ((firstTime.h >>> 24) & 0xff) + ((secondTime.h >>> 24) & 0xff); high16 = high16 & 0xff; if(!ignoreOverflow && (high24 >>> 8) > 0) { return new JsonTimestamp(0xffffffff, 0xffffffff); } high24 = high24 & 0xff; var finalLow16 = low24 << 8 | low16; var finalLow0 = low8 << 8 | low0; var finalHigh16 = high24 << 8 | high16; var finalHigh0 = high8 << 8 | high0; low = Number("0x" + Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.padLeadingZeros(finalLow16.toString(16), 4) + Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.padLeadingZeros(finalLow0.toString(16), 4)); high = Number("0x" + Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.padLeadingZeros(finalHigh16.toString(16), 4) + Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.padLeadingZeros(finalHigh0.toString(16), 4)); return new JsonTimestamp(high, low); }; JsonTimestamp.padLeadingZeros = function padLeadingZeros(value, totalLength) { var hex = value; var zeros = "00000000"; if(hex && typeof totalLength !== "undefined" && totalLength !== null && totalLength > 0 && totalLength <= 8) { hex = zeros.substr(0, totalLength - hex.length) + hex; } return hex; }; JsonTimestamp.validateTimestamp = function validateTimestamp(value) { return value && Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.validate(value.JsonValue.h) && Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.validate(value.JsonValue.l); }; JsonTimestamp.validate = function validate(value) { return typeof value !== "undefined" && value !== null && value < Math.pow(2, 32) && value > -1 * Math.pow(2, 31); }; return JsonTimestamp; })(); DiagnosticsHub.JsonTimestamp = JsonTimestamp; var JsonTimespan = (function () { function JsonTimespan(begin, end) { if(begin.greater(end)) { throw new Error(Plugin.Resources.getErrorString("JSProfiler.1000")); } this.begin = begin; this.end = end; } Object.defineProperty(JsonTimespan.prototype, "elapsed", { get: function () { return Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.subtract(this.end, this.begin); }, enumerable: true, configurable: true }); return JsonTimespan; })(); DiagnosticsHub.JsonTimespan = JsonTimespan; })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {})); var DiagnosticsHub = VisualStudio.DiagnosticsHub; })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {})); var VisualStudio = Microsoft.VisualStudio; })(Microsoft || (Microsoft = {})); var Microsoft; (function (Microsoft) { (function (VisualStudio) { (function (DiagnosticsHub) { (function (DataWarehouse) { "use strict"; var Constants = (function () { function Constants() { } Constants.CONTROLLER_ID_DATAWAREHOUSE = 1; Constants.CONTROLLER_ID_DATAWAREHOUSECONTEXTSERVICE = 2; Constants.CONTROLLER_ID_DATAWAREHOUSECONTEXT = 3; Constants.ACTION_DATAWAREHOUSE_INITIALIZATION = 1; Constants.ACTION_DATAWAREHOUSE_GETDATA = 2; Constants.ACTION_DATAWAREHOUSE_GETRESULT = 3; Constants.ACTION_DATAWAREHOUSE_DISPOSERESULT = 4; Constants.ACTION_DATAWAREHOUSE_CLOSE = 400; Constants.ACTION_DATAWAREHOUSECONTEXTSERVICE_CREATECONTEXT = 1; Constants.ACTION_DATAWAREHOUSECONTEXTSERVICE_DELETECONTEXT = 2; Constants.ACTION_DATAWAREHOUSECONTEXTSERVICE_COPYCONTEXT = 3; Constants.ACTION_DATAWAREHOUSECONTEXTSERVICE_GETCONTEXT = 4; Constants.ACTION_DATAWAREHOUSECONTEXTSERVICE_GETGLOBALCONTEXT = 5; Constants.ACTION_DATAWAREHOUSECONTEXT_GETTIMEDOMAIN = 1; Constants.ACTION_DATAWAREHOUSECONTEXT_SETTIMEDOMAIN = 2; Constants.ACTION_DATAWAREHOUSECONTEXT_GETMACHINEDOMAIN = 3; Constants.ACTION_DATAWAREHOUSECONTEXT_ADDTOMACHINEDOMAIN = 4; Constants.ACTION_DATAWAREHOUSECONTEXT_CLEARMACHINEDOMAIN = 5; Constants.ACTION_DATAWAREHOUSECONTEXT_GETPROCESSDOMAIN = 6; Constants.ACTION_DATAWAREHOUSECONTEXT_ADDTOPROCESSDOMAIN = 7; Constants.ACTION_DATAWAREHOUSECONTEXT_CLEARPROCESSDOMAIN = 8; Constants.ACTION_DATAWAREHOUSECONTEXT_GETCUSTOMDOMAIN = 9; Constants.ACTION_DATAWAREHOUSECONTEXT_SETCUSTOMDOMAIN = 10; return Constants; })(); var DhJsonResult = (function () { function DhJsonResult(resultId, sessionId, controller) { this._resultId = resultId; this._sessionId = sessionId; this._controller = controller; } DhJsonResult.prototype.getResult = function (customData) { var that = this; var requestObject = null; if(customData !== null) { requestObject = { resultId: that._resultId, customData: JSON.stringify(customData) }; } else { requestObject = { resultId: that._resultId }; } return that._controller.request(Constants.ACTION_DATAWAREHOUSE_GETRESULT, requestObject); }; DhJsonResult.prototype.dispose = function () { var that = this; return that._controller.request(Constants.ACTION_DATAWAREHOUSE_DISPOSERESULT, { resultId: that._resultId }); }; return DhJsonResult; })(); var DataWarehouseFactory = (function () { function DataWarehouseFactory() { this._serviceProxy = Plugin.Utilities.JSONMarshaler.attachToPublishedObject("Microsoft.DiagnosticsHub.VisualStudio.Presentation.JavaScriptModels.DataWarehouseServiceMarshaler", { }, true); this._logger = DiagnosticsHub.getLogger(); } DataWarehouseFactory.prototype.getDataWarehouse = function () { var that = this; return this._serviceProxy._call("getDataWarehouseConfiguration").then(function (configuration) { that._logger.debug("Got the sessionId '" + configuration.sessionId + "'. Creating datawarehouse..."); return new DataWarehouseInstance(configuration); }); }; return DataWarehouseFactory; })(); var DataWarehouseInstance = (function () { function DataWarehouseInstance(dwConfiguration) { this._logger = DiagnosticsHub.getLogger(); this._dwConfiguration = dwConfiguration; this._controller = new DiagnosticsHub.NativeHostController(this._dwConfiguration.sessionId, Constants.CONTROLLER_ID_DATAWAREHOUSE); } DataWarehouseInstance.prototype.getData = function (contextId, analyzerId) { var that = this; var jsonRequest = null; if(contextId == null) { jsonRequest = { analyzerId: analyzerId }; } else { jsonRequest = { contextId: contextId, analyzerId: analyzerId }; } return that._controller.request(Constants.ACTION_DATAWAREHOUSE_GETDATA, jsonRequest).then(function (jsonObject) { return new DhJsonResult(jsonObject.resultId, that._dwConfiguration.sessionId, that._controller); }); }; DataWarehouseInstance.prototype.getContextService = function () { if(this._contextService == null) { this._contextService = new DhContextService(this._dwConfiguration.sessionId); } return this._contextService; }; DataWarehouseInstance.prototype.close = function () { return this._controller.request(Constants.ACTION_DATAWAREHOUSE_CLOSE); }; DataWarehouseInstance.prototype.initialize = function () { this._logger.debug("Initializing DataWarehouse..."); var jsonConfiguration = { analyzers: this._dwConfiguration.analyzers, dataSources: this._dwConfiguration.dataSources, symbolStorePath: this._dwConfiguration.symbolStorePath, symbolCachePath: this._dwConfiguration.symbolCachePath }; return this._controller.request(Constants.ACTION_DATAWAREHOUSE_INITIALIZATION, jsonConfiguration); }; return DataWarehouseInstance; })(); var DhContextService = (function () { function DhContextService(sessionId) { this._controller = new DiagnosticsHub.NativeHostController(sessionId, Constants.CONTROLLER_ID_DATAWAREHOUSECONTEXTSERVICE); this._sessionId = sessionId; } DhContextService.prototype.createContext = function () { var that = this; return this._controller.request(Constants.ACTION_DATAWAREHOUSECONTEXTSERVICE_CREATECONTEXT).then(function (contextInfo) { return new DhContext(contextInfo, that._sessionId); }); }; DhContextService.prototype.deleteContext = function (contextId) { var that = this; return this._controller.request(Constants.ACTION_DATAWAREHOUSECONTEXTSERVICE_DELETECONTEXT, { contextId: contextId }); }; DhContextService.prototype.copyContext = function (contextId) { var that = this; return this._controller.request(Constants.ACTION_DATAWAREHOUSECONTEXTSERVICE_COPYCONTEXT, { contextId: contextId }).then(function (contextInfo) { return new DhContext(contextInfo, that._sessionId); }); }; DhContextService.prototype.getContext = function (contextId) { var that = this; return this._controller.request(Constants.ACTION_DATAWAREHOUSECONTEXTSERVICE_GETCONTEXT, { contextId: contextId }).then(function (contextInfo) { return new DhContext(contextInfo, that._sessionId); }); }; DhContextService.prototype.getGlobalContext = function () { var that = this; return this._controller.request(Constants.ACTION_DATAWAREHOUSECONTEXTSERVICE_GETGLOBALCONTEXT).then(function (contextInfo) { return new DhContext(contextInfo, that._sessionId); }); }; return DhContextService; })(); var DhContext = (function () { function DhContext(contextInfo, sessionId) { this._info = contextInfo; this._sessionId = sessionId; this._controller = new DiagnosticsHub.NativeHostController(this._sessionId, Constants.CONTROLLER_ID_DATAWAREHOUSECONTEXT); } DhContext.prototype.getContextId = function () { return this._info.contextId; }; DhContext.prototype.getParentContextId = function () { return this._info.parentContextId; }; DhContext.prototype.getTimeDomain = function () { return this._controller.request(Constants.ACTION_DATAWAREHOUSECONTEXT_GETTIMEDOMAIN, { contextId: this._info.contextId }); }; DhContext.prototype.setTimeDomain = function (timeDomain) { return this._controller.request(Constants.ACTION_DATAWAREHOUSECONTEXT_SETTIMEDOMAIN, { contextId: this._info.contextId, timeDomain: { begin: timeDomain.begin.JsonValue, end: timeDomain.end.JsonValue } }); }; DhContext.prototype.getMachineDomain = function () { return this._controller.request(Constants.ACTION_DATAWAREHOUSECONTEXT_GETMACHINEDOMAIN, { contextId: this._info.contextId }); }; DhContext.prototype.addToMachineDomain = function (machineName) { return this._controller.request(Constants.ACTION_DATAWAREHOUSECONTEXT_ADDTOMACHINEDOMAIN, { contextId: this._info.contextId, machineName: machineName }); }; DhContext.prototype.clearMachineDomain = function () { return this._controller.request(Constants.ACTION_DATAWAREHOUSECONTEXT_CLEARMACHINEDOMAIN, { contextId: this._info.contextId }); }; DhContext.prototype.getProcessDomain = function () { return this._controller.request(Constants.ACTION_DATAWAREHOUSECONTEXT_GETPROCESSDOMAIN, { contextId: this._info.contextId }); }; DhContext.prototype.addToProcessDomain = function (processId) { return this._controller.request(Constants.ACTION_DATAWAREHOUSECONTEXT_ADDTOPROCESSDOMAIN, { contextId: this._info.contextId, processId: processId }); }; DhContext.prototype.clearProcessDomain = function () { return this._controller.request(Constants.ACTION_DATAWAREHOUSECONTEXT_CLEARPROCESSDOMAIN, { contextId: this._info.contextId }); }; DhContext.prototype.getCustomDomain = function (name) { return this._controller.request(Constants.ACTION_DATAWAREHOUSECONTEXT_GETCUSTOMDOMAIN, { contextId: this._info.contextId, name: name }).then(function (result) { return result.value; }); }; DhContext.prototype.setCustomDomain = function (name, value) { return this._controller.request(Constants.ACTION_DATAWAREHOUSECONTEXT_SETCUSTOMDOMAIN, { contextId: this._info.contextId, name: name, value: value }); }; return DhContext; })(); var _dwFactory = null; var _dataWarehousePromise = null; function loadDataWarehouse() { if(_dataWarehousePromise == null) { if(_dwFactory == null) { _dwFactory = new DataWarehouseFactory(); } return _dataWarehousePromise = _dwFactory.getDataWarehouse(); } return _dataWarehousePromise; } DataWarehouse.loadDataWarehouse = loadDataWarehouse; })(DiagnosticsHub.DataWarehouse || (DiagnosticsHub.DataWarehouse = {})); var DataWarehouse = DiagnosticsHub.DataWarehouse; })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {})); var DiagnosticsHub = VisualStudio.DiagnosticsHub; })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {})); var VisualStudio = Microsoft.VisualStudio; })(Microsoft || (Microsoft = {})); var Microsoft; (function (Microsoft) { (function (VisualStudio) { (function (DiagnosticsHub) { "use strict"; var DocumentClosingEventDeferral = (function () { function DocumentClosingEventDeferral(onHandlerCompleted) { this._onHandlerCompleted = onHandlerCompleted; } DocumentClosingEventDeferral.prototype.complete = function (result) { this._onHandlerCompleted(result); }; return DocumentClosingEventDeferral; })(); DiagnosticsHub.DocumentClosingEventDeferral = DocumentClosingEventDeferral; var DocumentClosingEventArgs = (function () { function DocumentClosingEventArgs(onHandlerCompleted) { this._waitHandler = false; this._onHandlerCompleted = onHandlerCompleted; this._eventDeferral = null; } DocumentClosingEventArgs.prototype.getDeferral = function () { if(this._eventDeferral === null) { this._eventDeferral = new DocumentClosingEventDeferral(this._onHandlerCompleted); } return this._eventDeferral; }; Object.defineProperty(DocumentClosingEventArgs.prototype, "waitHandler", { get: function () { return this._eventDeferral != null; }, enumerable: true, configurable: true }); return DocumentClosingEventArgs; })(); DiagnosticsHub.DocumentClosingEventArgs = DocumentClosingEventArgs; var Document = (function () { function Document() { this._onCloseHandlers = []; this._documentProxy = Plugin.Utilities.JSONMarshaler.attachToPublishedObject("Microsoft.DiagnosticsHub.VisualStudio.Presentation.JavaScriptModels.DocumentPortMarshaler", { }, true); this._logger = DiagnosticsHub.getLogger(); this._documentProxy._call("connected").then(function () { this._logger.debug("JavaScript Document object connected to host. Ready to get onClosingEvent."); }.bind(this), function (error) { this._logger.error("Cannot connect DocumentPortMarshaler, error name: '" + error.name + "', error message: '" + error.message + "'"); }.bind(this)).then(function () { this._documentProxy.addEventListener("onClosing", function (eventArgs) { this.onClosingHandler(); }.bind(this)); }.bind(this)); } Document.prototype.addOnClosingHandler = function (handler) { this._onCloseHandlers.push(handler); this._logger.debug('New on closing handler was added.'); }; Document.prototype.onClosingHandler = function () { this._logger.debug('Invoking JavaScript handlers for document on closing event.'); var finalResult = true; var handlersCount = 0; var onCompleted = function (handlerResult) { finalResult = finalResult && handlerResult; handlersCount--; if(handlersCount <= 0) { this._documentProxy._call("onClosingCompleted", finalResult); } else { this._logger.debug("Still waiting when all on closing handlers will complete their work. Handlers count: " + handlersCount); } }.bind(this); for(var propertyName in this._onCloseHandlers) { var handler = this._onCloseHandlers[propertyName]; if(this._onCloseHandlers.hasOwnProperty(propertyName)) { if(typeof handler === 'function') { try { var jsEventArgs = new DocumentClosingEventArgs(onCompleted); handler(jsEventArgs); if(jsEventArgs.waitHandler) { handlersCount++; this._logger.debug("JavaScipt handlers for on closing asked to wait while they will finish. Handlers count: " + handlersCount); } } catch (e) { this._logger.error(e.toString()); } } else { this._logger.warning('One of the listeners not a "function", it has type ' + (typeof handler)); } } } if(handlersCount == 0) { onCompleted(finalResult); } }; return Document; })(); var _currentDocument = null; function getCurrentDocument() { if(_currentDocument == null) { _currentDocument = new Document(); } return _currentDocument; } DiagnosticsHub.getCurrentDocument = getCurrentDocument; })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {})); var DiagnosticsHub = VisualStudio.DiagnosticsHub; })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {})); var VisualStudio = Microsoft.VisualStudio; })(Microsoft || (Microsoft = {})); PNG  IHDR$jgAMA|Q cHRMR@}y<s,٩<9SbL!GĈ 3,F0+7T3IlpX"61"H _qW,d ėrIKst.ښAdp&+g]RәY2EE44432PuoJEzg`̉j- -b8o׿M]9La.+-%Mȧg3YះuAxEK i<:ŹPcu*@~(  ]o0 ~y*s7g%9%(3H*@C`-pn VH@ A1 jPA3hA'8΃Kn`Lg` a!2D!H҇ dAP B Byf*z: @]h ~L CUp΅ p%;56< ?" GxG iE>&2 oQEGlQP UFFuzQ7QcYG4G۠t]nB/o'Я1 xb"1I>Lf3bX} *QYvGĩp( &q x)&gsF|7:~@&h!$&B%pH$D.q#xx8F|K!\H$!i.%L";r3EHK-AFCbH$^RSIrdd 3Rx)-))zR#RsiSiT#Wd2Z2n2l2d)EBaQ6S))T UEMSPgeedɆfȞ!4--VJ;N g%K-sɵݖ{'OwO%)P_RRۥEK/+))U<د8䡔TtAiF쨜\|FyZbU)W9.Kw+YUEUOUjꂚZZZCu:C=^\G}VCEO#OE&^WOs^K[+\kV֔vv[]n>z^^u}XROm`m3h01$:fь|:kG23hbabhrT4ߴw3=3Y-s.q_vǂbgբ⃥%߲rJ*֪jAe0JOY6rvvtXLǎl&I']$NϝM.6.\ι"En2nnn[g=,=t٪E2}4\j5loDŽǞ~q=''Z^utv&vvEv >mяN9-{ LOgsΝK?7s>xOL n\x }N}g/]>uɫ,u[dS@u]7ot.<30tKn]p;;SwSyoEVnV+d-n=$aR!9wSC0l%jJ;K5#ʫ|$*9 hVVnꮝ%xM@F7{;m >IENDB`PNG  IHDR$jgAMA|Q cHRMR@}y<s,٩<9SbL!GĈ 3,F0+7T3IlpX"61"H _qW,d ėrIKst.ښAdp&+g]RәY2EE44432PuoJEzg`̉j- -b8o׿M]9La.+-%Mȧg3YះuAxEK i<:ŹPcu*@~(  ]o0 ~y*s7g%9%(3H*@C`-pn VH@ A1 jPA3hA'8΃Kn`Lg` a!2D!H҇ dAP B Byf*z: @]h ~L CUp΅ p%;56< ?" GxG iE>&2 oQEGlQP UFFuzQ7QcYG4G۠t]nB/o'Я1 xb"1I>Lf3bX} *QYvGĩp( &q x)&gsF|7:~@&h!$&B%pH$D.q#xx8F|K!\H$!i.%L";r3EHK-AFCbH$^RSIrdd 3Rx)-))zR#RsiSiT#Wd2Z2n2l2d)EBaQ6S))T UEMSPgeedɆfȞ!4--VJ;N g%K-sɵݖ{'OwO%)P_RRۥEK/+))U<د8䡔TtAiF쨜\|FyZbU)W9.Kw+YUEUOUjꂚZZZCu:C=^\G}VCEO#OE&^WOs^K[+\kV֔vv[]n>z^^u}XROm`m3h01$:fь|:kG23hbabhrT4ߴw3=3Y-s.q_vǂbgբ⃥%߲rJ*֪jAe0JOY6rvvtXLǎl&I']$NϝM.6.\ι"En2nnn[g=,=t٪E2}4\j5loDŽǞ~q=''Z^utv&vvEv >mяN9-{ LOgsΝK?7s>xOL n\x }N}g/]>uɫ,u[dS@u]7ot.<30tKn]p;;SwSyoEV,٩<9SbL!GĈ 3,F0+7T3IlpX"61"H _qW,d ėrIKst.ښAdp&+g]RәY2EE44432PuoJEzg`̉j- -b8o׿M]9La.+-%Mȧg3YះuAxEK i<:ŹPcu*@~(  ]o0 ~y*s7g%9%(3H*@C`-pn VH@ A1 jPA3hA'8΃Kn`Lg` a!2D!H҇ dAP B Byf*z: @]h ~L CUp΅ p%;56< ?" GxG iE>&2 oQEGlQP UFFuzQ7QcYG4G۠t]nB/o'Я1 xb"1I>Lf3bX} *QYvGĩp( &q x)&gsF|7:~@&h!$&B%pH$D.q#xx8F|K!\H$!i.%L";r3EHK-AFCbH$^RSIrdd 3Rx)-))zR#RsiSiT#Wd2Z2n2l2d)EBaQ6S))T UEMSPgeedɆfȞ!4--VJ;N g%K-sɵݖ{'OwO%)P_RRۥEK/+))U<د8䡔TtAiF쨜\|FyZbU)W9.Kw+YUEUOUjꂚZZZCu:C=^\G}VCEO#OE&^WOs^K[+\kV֔vv[]n>z^^u}XROm`m3h01$:fь|:kG23hbabhrT4ߴw3=3Y-s.q_vǂbgբ⃥%߲rJ*֪jAe0JOY6rvvtXLǎl&I']$NϝM.6.\ι"En2nnn[g=,=t٪E2}4\j5loDŽǞ~q=''Z^utv&vvEv >mяN9-{ LOgsΝK?7s>xOL n\x }N}g/]>uɫ,u[dS@u]7ot.<30tKn]p;;SwSyoEV) h/re2EaLjuzެb@d_@h.}Y@GQzoӃj_<ErhTC rVpxREvnyɅn4IV2AVvWVxP 4 t^V:v+x 1[AhIX&d2C3_7us:[_bK?PyWb |}\]@Q 2RsL7 _,t9)_4U{?`Ͳ"\u4db ,ҭ 4AZAX(5d+  Ы B1 DkI ǟL&< .{Xn~sv :v0P49#Ө_!F:Eo~H ł,٩<9SbL!GĈ 3,F0+7T3IlpX"61"H _qW,d ėrIKst.ښAdp&+g]RәY2EE44432PuoJEzg`̉j- -b8o׿M]9La.+-%Mȧg3YះuAxEK i<:ŹPcu*@~(  ]o0 ~y*s7g%9%(3H*@C`-pn VH@ A1 jPA3hA'8΃Kn`Lg` a!2D!H҇ dAP B Byf*z: @]h ~L CUp΅ p%;56< ?" GxG iE>&2 oQEGlQP UFFuzQ7QcYG4G۠t]nB/o'Я1 xb"1I>Lf3bX} *QYvGĩp( &q x)&gsF|7:~@&h!$&B%pH$D.q#xx8F|K!\H$!i.%L";r3EHK-AFCbH$^RSIrdd 3Rx)-))zR#RsiSiT#Wd2Z2n2l2d)EBaQ6S))T UEMSPgeedɆfȞ!4--VJ;N g%K-sɵݖ{'OwO%)P_RRۥEK/+))U<د8䡔TtAiF쨜\|FyZbU)W9.Kw+YUEUOUjꂚZZZCu:C=^\G}VCEO#OE&^WOs^K[+\kV֔vv[]n>z^^u}XROm`m3h01$:fь|:kG23hbabhrT4ߴw3=3Y-s.q_vǂbgբ⃥%߲rJ*֪jAe0JOY6rvvtXLǎl&I']$NϝM.6.\ι"En2nnn[g=,=t٪E2}4\j5loDŽǞ~q=''Z^utv&vvEv >mяN9-{ LOgsΝK?7s>xOL n\x }N}g/]>uɫ,u[dS@u]7ot.<30tKn]p;;SwSyoEV H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FIDATxڬ0 @WN  pNPN/汗|/Ѷ-)"#Qm' 8EBcߣ-fKc+,٩<9SbL!GĈ 3,F0+7T3IlpX"61"H _qW,d ėrIKst.ښAdp&+g]RәY2EE44432PuoJEzg`̉j- -b8o׿M]9La.+-%Mȧg3YះuAxEK i<:ŹPcu*@~(  ]o0 ~y*s7g%9%(3H*@C`-pn VH@ A1 jPA3hA'8΃Kn`Lg` a!2D!H҇ dAP B Byf*z: @]h ~L CUp΅ p%;56< ?" GxG iE>&2 oQEGlQP UFFuzQ7QcYG4G۠t]nB/o'Я1 xb"1I>Lf3bX} *QYvGĩp( &q x)&gsF|7:~@&h!$&B%pH$D.q#xx8F|K!\H$!i.%L";r3EHK-AFCbH$^RSIrdd 3Rx)-))zR#RsiSiT#Wd2Z2n2l2d)EBaQ6S))T UEMSPgeedɆfȞ!4--VJ;N g%K-sɵݖ{'OwO%)P_RRۥEK/+))U<د8䡔TtAiF쨜\|FyZbU)W9.Kw+YUEUOUjꂚZZZCu:C=^\G}VCEO#OE&^WOs^K[+\kV֔vv[]n>z^^u}XROm`m3h01$:fь|:kG23hbabhrT4ߴw3=3Y-s.q_vǂbgբ⃥%߲rJ*֪jAe0JOY6rvvtXLǎl&I']$NϝM.6.\ι"En2nnn[g=,=t٪E2}4\j5loDŽǞ~q=''Z^utv&vvEv >mяN9-{ LOgsΝK?7s>xOL n\x }N}g/]>uɫ,u[dS@u]7ot.<30tKn]p;;SwSyoEVR;www0e'777(1X_ӭ>A؎^m--1;FK);F3KxǎQג׎Q^߯f {fb{f6OGLlc)u8jfd3KxXQ33Y|w8jXm I~9j(*s̜bKX #/IDATxb?5.@L,A ȂWƮ[&",{ @ u Ȇ&PlC~~>;x~ Z^^ Y cccdC d l `H3ٳ 0.("%$0G!@FFFͰP}y"aȆ%B 8/mQ.(QbOYVIwps&BDIENDB`PNG  IHDR tEXtSoftwareAdobe ImageReadyqe<fiTXtXML:com.adobe.xmp {:IDATxڬAP{`۸6 7ca^&SJ Y0ìl1cĔR/P`lle=HV")X9~Oƴ,@zkĺ WD`7 !X v)rD:" \4YIENDB`// // Copyright (C) Microsoft. All rights reserved. // // control.ts var Common; (function (Common) { "use strict"; (function (Controls) { var Control = (function () { function Control(root) { this._rootElement = root; if(typeof this._rootElement === "undefined") { this._rootElement = document.createElement("div"); this._rootElement.style.width = this._rootElement.style.height = "100%"; } else if(this._rootElement === null) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1017")); } } Control.prototype.appendChild = function (child) { this._rootElement.appendChild(child.rootElement); child.parent = this; }; Control.prototype.removeChild = function (child) { this._rootElement.removeChild(child.rootElement); child.parent = null; }; Object.defineProperty(Control.prototype, "rootElement", { get: function () { return this._rootElement; }, set: function (newRoot) { if(!newRoot) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1018")); } var oldRoot = this._rootElement; this._rootElement = newRoot; if(oldRoot && oldRoot.parentNode) { oldRoot.parentNode.replaceChild(newRoot, oldRoot); } }, enumerable: true, configurable: true }); Object.defineProperty(Control.prototype, "parent", { get: function () { return this._parent; }, set: function (newParent) { if(this._parent !== newParent) { this._parent = newParent; if(this._parent && !this._parent.rootElement.contains(this._rootElement)) { this._parent.appendChild(this); } this.onParentChanged(); } }, enumerable: true, configurable: true }); Control.prototype.onParentChanged = function () { }; return Control; })(); Controls.Control = Control; })(Common.Controls || (Common.Controls = {})); var Controls = Common.Controls; })(Common || (Common = {})); //@ sourceMappingURL=control.js.map // templateControl.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var Common; (function (Common) { "use strict"; (function (Controls) { var TemplateControl = (function (_super) { __extends(TemplateControl, _super); function TemplateControl(templateName) { _super.call(this); this._idPostfix = TemplateControl._globalIdPostfix++; if(templateName) { this.setTemplateFromName(templateName); } } TemplateControl._globalIdPostfix = 1; TemplateControl.prototype.setTemplateFromName = function (templateName) { var root = this.getTemplateElementCopy(templateName); this.adjustElementIds(root); this.rootElement = root; }; TemplateControl.prototype.setTemplateFromHTML = function (htmlContent) { var root = this.getTemplateElementFromHTML(htmlContent); this.adjustElementIds(root); this.rootElement = root; }; TemplateControl.prototype.findElement = function (id) { var fullId = id + this._idPostfix; return this.forAllSelfAndDescendants(this.rootElement, function (elem) { if(elem.id && elem.id === fullId) { return false; } return true; }); }; TemplateControl.prototype.findElementsByClassName = function (className) { var elements = []; this.forAllSelfAndDescendants(this.rootElement, function (elem) { if(elem.classList && elem.classList.contains(className)) { elements.push(elem); } return true; }); return elements; }; TemplateControl.prototype.getTemplateElementCopy = function (templateName) { var templateElement = document.getElementById(templateName); if(!templateElement) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1023")); } if(templateElement.tagName.toLowerCase() !== "script") { throw new Error(Plugin.Resources.getErrorString("JSPerf.1024")); } return this.getTemplateElementFromHTML(templateElement.innerHTML); }; TemplateControl.prototype.getTemplateElementFromHTML = function (htmlContent) { var root = this.getTemplateRootElement(); root.innerHTML = htmlContent; if(root.childElementCount === 1) { root = root.firstElementChild; } return root; }; TemplateControl.prototype.getTemplateRootElement = function () { var div = document.createElement("div"); div.style.width = div.style.height = "100%"; return div; }; TemplateControl.prototype.adjustElementIds = function (root) { var idPostfix = this._idPostfix; this.forAllSelfAndDescendants(root, function (elem) { if(elem.id) { elem.id = elem.id + idPostfix; } return true; }); }; TemplateControl.prototype.forAllSelfAndDescendants = function (root, func) { var brokeAtElement = null; if(!func(root)) { brokeAtElement = root; } else { if(root.children) { var children = root.children; var childrenLength = children.length; for(var i = 0; i < childrenLength; i++) { brokeAtElement = this.forAllSelfAndDescendants(children[i], func); if(brokeAtElement) { break; } } } } return brokeAtElement; }; return TemplateControl; })(Controls.Control); Controls.TemplateControl = TemplateControl; })(Common.Controls || (Common.Controls = {})); var Controls = Common.Controls; })(Common || (Common = {})); //@ sourceMappingURL=templateControl.js.map // gridControl.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var Common; (function (Common) { "use strict"; (function (Controls) { (function (Grid) { var Utility; (function (Utility) { var TreeNodeSort = (function () { function TreeNodeSort() { } TreeNodeSort.stableReverse = function stableReverse(array, comparer) { var result = []; var reverseIndex = array.length - 1; if(reverseIndex >= 0 && array[reverseIndex].data.hasMoreText) { reverseIndex--; } for(; reverseIndex >= 0; reverseIndex--) { var firstDiffIndex = reverseIndex - 1; for(; firstDiffIndex >= 0; firstDiffIndex--) { if(0 !== comparer(array[firstDiffIndex], array[reverseIndex])) { break; } } for(var equalIndex = firstDiffIndex + 1; equalIndex <= reverseIndex; equalIndex++) { result.push(array[equalIndex]); } reverseIndex = firstDiffIndex + 1; } for(var index = 0; index < result.length; index++) { array[index] = result[index]; } }; TreeNodeSort.defaultComparer = function defaultComparer(column, order, rowA, rowB) { var v1 = rowA[column.index], v2 = rowB[column.index]; if(typeof v1 === "undefined" || v1 === null) { if(typeof v2 === "undefined" || v2 === null) { return 0; } else { return -1; } } return v1.toString().toLocaleUpperCase().localeCompare(v2.toString().toLocaleUpperCase()); }; TreeNodeSort.sortComparer = function sortComparer(sortOrder, sortColumns, rowA, rowB) { if(rowA.hasMoreText) { return 1; } if(rowB.hasMoreText) { return -1; } for(var i = 0; i < sortOrder.length; i++) { var orderInfo = sortOrder[i]; var column = sortColumns[i]; var comparer = column.comparer || Utility.TreeNodeSort.defaultComparer; var result = comparer(column, orderInfo.order, rowA, rowB); if(result === 0) { continue; } else if(orderInfo.order === "desc") { return -result; } else { return result; } } return 0; }; return TreeNodeSort; })(); Utility.TreeNodeSort = TreeNodeSort; })(Utility || (Utility = {})); var TreeInfo = (function () { function TreeInfo(gridData, expandStates, toggleFunction) { this.gridData = gridData; this.expandStates = expandStates; this.toggleFunction = toggleFunction; } return TreeInfo; })(); Grid.TreeInfo = TreeInfo; var ColumnInfo = (function () { function ColumnInfo(index, text, tooltip, width, canSortBy, getColumnValue, getCellCSSClass, comparer, variableWidth) { this.index = index; this.text = text; this.tooltip = tooltip; this.width = width; this.canSortBy = canSortBy; this.getColumnValue = getColumnValue; this.getCellCSSClass = getCellCSSClass; this.comparer = comparer; this.hasHTMLContent = false; this.variableWidth = variableWidth; } return ColumnInfo; })(); Grid.ColumnInfo = ColumnInfo; var SortOrderInfo = (function () { function SortOrderInfo(index, order) { this.index = index; this.order = order; } return SortOrderInfo; })(); Grid.SortOrderInfo = SortOrderInfo; var TreeNode = (function () { function TreeNode(data, expandState) { this.data = data; this.expandState = expandState; this.children = []; } return TreeNode; })(); Grid.TreeNode = TreeNode; var GutterOptions = (function () { function GutterOptions(backgroundColor, icon, checkbox, headerClickSortColumn, getTooltip) { this.backgroundColor = backgroundColor; this.icon = icon; this.checkbox = checkbox; this.headerClickSortColumn = headerClickSortColumn; this.getTooltip = getTooltip; } return GutterOptions; })(); Grid.GutterOptions = GutterOptions; var GridOptions = (function () { function GridOptions(childDataCallback, loadMoreChildDataCallback, columns, sortOrders, editCellCallback, rowSelectedCallback) { this.childDataCallback = childDataCallback; this.loadMoreChildDataCallback = loadMoreChildDataCallback; this.columns = columns; this.sortOrders = sortOrders; this.allowMultiSelect = false; this.allowSortOnMultiColumns = false; this.ariaTitle = ""; this.asyncInit = true; this.autoSort = true; this.coreCssClass = "grid"; this.cssClass = ""; this.expandStates = []; this.extendViewportBy = 3; this.gutter = new GutterOptions(); this.header = true; this.height = "100%"; this.initialSelection = false; this.keepSelection = false; this.payloadSize = 200; this.source = null; this.editCellCallback = editCellCallback; this.rowSelectedCallback = rowSelectedCallback; this.disableRightClickSelection = true; this.isGridDisabled = false; this.sizeColumns(); } GridOptions.prototype.sizeColumns = function () { if(this.columns) { var maxWidth = document.documentElement.offsetWidth - 66; var usedWidth = 0; var variableWidthIndex = -1; for(var i = 0; i < this.columns.length; i++) { if(this.columns[i].variableWidth && variableWidthIndex === -1) { variableWidthIndex = i; } else { usedWidth += this.columns[i].width; } } if(variableWidthIndex >= 0) { var targetWidth = maxWidth - usedWidth; if(targetWidth > this.columns[variableWidthIndex].width) { this.columns[variableWidthIndex].width = targetWidth; } } } }; return GridOptions; })(); Grid.GridOptions = GridOptions; var RowIndexInfo = (function () { function RowIndexInfo(rowIndex, dataIndex) { this.rowIndex = rowIndex; this.dataIndex = dataIndex; } return RowIndexInfo; })(); Grid.RowIndexInfo = RowIndexInfo; var Size = (function () { function Size(width, height) { this.width = width; this.height = height; } return Size; })(); var Range = (function () { function Range(start, end) { this.start = start; this.end = end; } return Range; })(); var ColumnSizing = (function () { function ColumnSizing(active, index, originalWidth, origin) { this.active = active; this.index = index; this.originalWidth = originalWidth; this.origin = origin; } return ColumnSizing; })(); var GridControl = (function (_super) { __extends(GridControl, _super); function GridControl(root, options) { _super.call(this, root); this._gridInstanceNumber = GridControl.GlobalGridInstanceNumber++; this._options = options; this._canvas = null; this._contentSpacer = null; this._element = null; this._gutter = null; this._gutterHeader = null; this._header = null; this._headerCanvas = null; this._dataSource = []; this._rows = { }; this._columns = []; this._expandStates = null; this._expandedCount = 0; this._sortOrder = []; this._rowInfoMap = { }; this._editCellCallback = null; this._selectedRows = null; this._selectionStart = -1; this._selectionCount = 0; this._selectedIndex = -1; this._active = false; this._activeAriaId = null; this._getChildDataCallback = null; this._getLoadMoreChildDataCallback = null; this._rowSelectedCallback = null; this._canvasHeight = 300; this._canvasWidth = 300; this._contentSize = null; this._measurements = { }; this._count = 0; this._indentIndex = 0; this._indentLevels = null; this._visibleRange = []; this._columnSizing = null; this._sizingElement = null; this._copyInProgress = false; this._resetScroll = false; this._ignoreScroll = false; this._scrollTop = 0; this._scrollLeft = 0; this._cancelable = null; this._onAriaExpandedModifiedHandler = this.onAriaExpandedModified.bind(this); this.initialize(); } GridControl.TYPE_NAME = "GridControl"; GridControl.MAX_COPY_SIZE = 1000; GridControl.PAYLOAD_SIZE = 200; GridControl.EVENT_SELECTED_INDEX_CHANGED = "selectedIndexChanged"; GridControl.GlobalGridInstanceNumber = 0; GridControl.prototype.initialize = function () { this._element = document.createElement("div"); this._element.className = this._options.coreCssClass; this._element.style.height = this._options.height; this.rootElement.appendChild(this._element); this._buildDom(); this._contentSize = new Size(300, 400); this._takeMeasurements(); this._getChildDataCallback = this._options.childDataCallback || null; this._getLoadMoreChildDataCallback = this._options.loadMoreChildDataCallback || null; this._editCellCallback = this._options.editCellCallback || null; this._rowSelectedCallback = this._options.rowSelectedCallback || null; if(this._options.asyncInit) { window.setTimeout(function () { this._attachEvents(); }.bind(this), 10); } else { this._attachEvents(); } this.initializeDataSource(); }; GridControl.prototype.findClosestElement = function (element, selector) { var stop = this._element.parentNode; var closest = element; while(closest && closest !== stop) { if(closest.msMatchesSelector(selector)) { return closest; } closest = closest.parentNode; } return closest; }; GridControl.prototype.fireCustomEvent = function (element, eventName, args) { var customEvent = document.createEvent("Event"); customEvent.initEvent(eventName, true, true); (customEvent).customData = args; element.dispatchEvent(customEvent); }; GridControl.prototype.onAriaExpandedModified = function (event) { if(event.attrName === "aria-expanded") { var rowInfo = this.getRowInfoFromEvent(event, ".grid-row"); if(rowInfo) { this.tryToggle(event.newValue === "true", false, rowInfo.dataIndex); } } }; GridControl.prototype.createElementWithClass = function (tagName, className) { var element = document.createElement(tagName); if(className) { element.className = className; } return element; }; GridControl.expand = function expand(states) { var result = []; if(states.length > 0) { var stack = []; var currState = { level: 1, origCount: states.length, remainingCount: states.length }; stack.push(currState); var i = 0; while(i < states.length) { result.push(currState.level); currState.remainingCount--; while(currState.remainingCount === 0) { stack.pop(); if(stack.length == 0) { if(i === (states.length - 1)) { break; } else { throw new Error("invalid descendant counts, nesting not possible"); } } var newState = stack[stack.length - 1]; newState.remainingCount -= currState.origCount; currState = newState; if(currState.remainingCount < 0) { throw new Error("invalid descendant counts, cannot convert to indentation levels"); } } var nextCount = Math.abs(states[i]); if(nextCount > 0) { var nextItem = { level: result[result.length - 1] + 1, origCount: nextCount, remainingCount: nextCount }; stack.push(nextItem); currState = nextItem; } i++; } if(stack.length > 0) { throw new Error("invalid descendant counts, more input expected"); } } return result; }; GridControl.addItemsToTree = function addItemsToTree(dataSource, expandStates, start, count, parentNode) { var end = Math.min(start + count, dataSource.length); for(var i = start; i < end; i++) { var node = new TreeNode(dataSource[i], expandStates[i]); var childrenCount = Math.abs(node.expandState); if(childrenCount > 0) { GridControl.addItemsToTree(dataSource, expandStates, i + 1, childrenCount, node); i += childrenCount; } parentNode.children.push(node); } }; GridControl.walkTree = function walkTree(tree, visit) { if(visit) { visit(tree); var numChildren = 0; var children = tree.children; if(children && (numChildren = children.length)) { for(var i = 0; i < numChildren; i++) { var item = children[i]; GridControl.walkTree(item, visit); } } } }; GridControl.makeElementUnselectable = function makeElementUnselectable(element) { element.setAttribute("unselectable", "on"); var elements = element.querySelectorAll("*"); for(var i = 0; i < elements.length; i++) { var e = elements[i]; switch(e.tagName) { case "IFRAME": case "TEXTAREA": case "INPUT": case "SELECT": break; default: e.setAttribute("unselectable", "on"); } } }; GridControl.toDecimalLocaleString = function toDecimalLocaleString(value, includeGroupSeparators, cultureInfo) { var zeroPad = function (str, count, left) { for(var l = str.length; l < count; l++) { str = (left ? ('0' + str) : (str + '0')); } return str; }; var exponent, nf, split, numberString = value.toString(), right = ""; if(cultureInfo) { nf = cultureInfo.numberFormat; } else { nf = Plugin.Culture.NumberFormat; } split = numberString.split(/e/i); numberString = split[0]; exponent = (split.length > 1 ? parseInt(split[1], 10) : 0); split = numberString.split('.'); numberString = split[0]; right = split.length > 1 ? split[1] : ""; if(exponent > 0) { right = zeroPad(right, exponent, false); numberString += right.slice(0, exponent); right = right.substr(exponent); } else if(exponent < 0) { exponent = -exponent; numberString = zeroPad(numberString, exponent + 1, true); right = numberString.slice(-exponent, numberString.length) + right; numberString = numberString.slice(0, -exponent); } if(right.length > 0) { right = nf.numberDecimalSeparator + right; } if(includeGroupSeparators === true) { var groupSizes = nf.numberGroupSizes, sep = nf.numberGroupSeparator, curSize = groupSizes[0], curGroupIndex = 1, stringIndex = numberString.length - 1, ret = ""; while(stringIndex >= 0) { if(curSize === 0 || curSize > stringIndex) { if(ret.length > 0) { return numberString.slice(0, stringIndex + 1) + sep + ret + right; } else { return numberString.slice(0, stringIndex + 1) + right; } } if(ret.length > 0) { ret = numberString.slice(stringIndex - curSize + 1, stringIndex + 1) + sep + ret; } else { ret = numberString.slice(stringIndex - curSize + 1, stringIndex + 1); } stringIndex -= curSize; if(curGroupIndex < groupSizes.length) { curSize = groupSizes[curGroupIndex]; curGroupIndex++; } } return numberString.slice(0, stringIndex + 1) + sep + ret + right; } else { return numberString + right; } }; GridControl.convertValueToDisplayString = function convertValueToDisplayString(value, format) { if(value != null) { if(typeof value === "string") { return value; } else if(value instanceof Date) { return value.localeFormat(format || "G"); } else if(typeof value === "number") { if(format) { return value.localeFormat(format); } else { return GridControl.toDecimalLocaleString(value); } } else if(typeof value === "boolean") { return value ? "True" : "False"; } else { return value.toString(); } } return ""; }; GridControl.prototype._getId = function () { return GridControl.TYPE_NAME + this._gridInstanceNumber; }; GridControl.prototype.getSelectionCount = function () { return this._selectionCount; }; GridControl.prototype.getElement = function () { return this._element; }; GridControl.prototype._enhance = function (element) { this._buildDom(); }; GridControl.prototype._buildDom = function () { var fragment = document.createDocumentFragment(); var gutterOptions = this._options.gutter; var gutterVisible = gutterOptions && (gutterOptions.icon || gutterOptions.checkbox); this._canvas = document.createElement("div"); this._canvas.className = "grid-canvas"; this._contentSpacer = document.createElement("div"); this._contentSpacer.className = "grid-content-spacer"; this._canvas.appendChild(this._contentSpacer); if(this._options.header) { this._element.classList.add("has-header"); this._header = document.createElement("div"); this._header.className = "grid-header"; this._headerCanvas = document.createElement("div"); this._headerCanvas.className = "grid-header-canvas"; this._header.appendChild(this._headerCanvas); fragment.appendChild(this._header); } if(gutterVisible) { this._element.classList.add("has-gutter"); this._gutter = document.createElement("div"); this._gutter.className = "grid-gutter"; if(gutterOptions && gutterOptions.backgroundColor) { this._gutter.style.backgroundColor = gutterOptions.backgroundColor; } this._canvas.appendChild(this._gutter); if(this._header) { this._gutterHeader = document.createElement("div"); this._gutterHeader.className = "grid-gutter-header"; this._gutterHeader.classList.add("grid-header-column"); if(gutterOptions && gutterOptions.backgroundColor) { this._gutterHeader.style.backgroundColor = gutterOptions.backgroundColor; } this._header.appendChild(this._gutterHeader); var sortElement = this.createElementWithClass("div", "sort-handle"); this._gutterHeader.appendChild(sortElement); this.setGutterHeaderSortOrder(); } } fragment.appendChild(this._canvas); this._element.appendChild(fragment); var dataGridAriaLabel = this._options.ariaTitle; for(var cIndex = 0; cIndex < this._options.columns.length; cIndex++) { var columnInfo = this._options.columns[cIndex]; if(dataGridAriaLabel) { dataGridAriaLabel += ", "; } dataGridAriaLabel += columnInfo.text; } this._element.setAttribute("aria-label", dataGridAriaLabel); }; GridControl.prototype.setGutterHeaderSortOrder = function () { if(!this._sortOrder || this._sortOrder.length === 0 || !this._options.gutter.headerClickSortColumn) { return; } if(!this._options.allowSortOnMultiColumns) { var currentSortOrder = this._sortOrder[0]; if(currentSortOrder.index === this._options.gutter.headerClickSortColumn.index) { this._setSortOrderClass(this._gutterHeader, currentSortOrder.order); } else { this._setSortOrderClass(this._gutterHeader, "none"); } } else { var sortOrderFound = false; for(var i = 0; i < this._sortOrder.length; i++) { var currentSortOrder = this._sortOrder[i]; if(currentSortOrder.index === this._options.gutter.headerClickSortColumn.index) { sortOrderFound = true; this._setSortOrderClass(this._gutterHeader, currentSortOrder.order); } } if(!sortOrderFound) { this._setSortOrderClass(this._gutterHeader, "none"); } } }; GridControl.prototype._attachEvents = function () { var _this = this; window.addEventListener("resize", function (e) { return _this._onContainerResize(e); }); this._element.addEventListener("keydown", function (e) { return _this._onKeyDown(e); }); this._canvas.addEventListener("mousedown", function (e) { return _this._onRowMouseDown(e); }); this._canvas.addEventListener("dblclick", function (e) { return _this._onEditCell(e); }); this._canvas.addEventListener("scroll", function (e) { return _this._onCanvasScroll(e); }); this._canvas.addEventListener("selectstart", function () { return false; }); this._canvas.addEventListener("focusin", function (e) { _this._canvasContainsFocus = true; }); this._canvas.addEventListener("focusout", function (e) { _this._canvasContainsFocus = false; }); if(this._header) { this._header.addEventListener("mousedown", function (e) { return _this._onHeaderMouseDown(e); }); this._header.addEventListener("mouseup", function (e) { return _this._onHeaderMouseUp(e); }); this._header.addEventListener("click", function (e) { return _this._onHeaderClick(e); }); this._header.addEventListener("dblclick", function (e) { return _this._onHeaderDblClick(e); }); } if(this._gutter) { if(this._gutterHeader) { this._gutterHeader.addEventListener("click", function (e) { _this._sortBy(_this._options.gutter.headerClickSortColumn, false); _this.setGutterHeaderSortOrder(); }); } this._gutter.addEventListener("click", function (e) { return _this._onGutterClick(e); }); this._gutter.addEventListener("mouseover", function (e) { var row = this.findClosestElement(e.target, ".grid-gutter-row"); if(row) { row.classList.add("grid-gutter-row-hover"); } }.bind(this)); this._gutter.addEventListener("mouseout", function (e) { var row = this.findClosestElement(e.target, ".grid-gutter-row"); if(row) { row.classList.remove("grid-gutter-row-hover"); } }.bind(this)); } }; GridControl.prototype._mergeExpandStates = function (parentIndex, childPlaceholderIndex, oldExpandStates, newExpandStates) { var netIncreaseInExpandStates = newExpandStates.length - 1; oldExpandStates.splice(childPlaceholderIndex, 1); for(var i = 0; i <= netIncreaseInExpandStates; i++) { oldExpandStates.splice(childPlaceholderIndex + i, 0, newExpandStates[i]); } var countSinceLastParent = 0; for(var i = parentIndex; i >= 0; i--) { var origValue = oldExpandStates[i]; if(Math.abs(origValue) > countSinceLastParent) { if(origValue < 0) { oldExpandStates[i] = origValue - netIncreaseInExpandStates; } else { oldExpandStates[i] = origValue + netIncreaseInExpandStates; } countSinceLastParent = 0; } else { countSinceLastParent++; } } }; GridControl.prototype._takeMeasurements = function () { var cssClass = this._options.coreCssClass; if(this._options.cssClass) { cssClass += " " + this._options.cssClass; } var measurementContainer = this.createElementWithClass("div", cssClass); measurementContainer.style.position = "absolute"; measurementContainer.style.left = "-5000px"; measurementContainer.style.top = "-5000px"; measurementContainer.style.width = "1000px"; measurementContainer.style.height = "500px"; document.body.appendChild(measurementContainer); var row = this.createElementWithClass("div", "grid-row grid-row-normal"); measurementContainer.appendChild(row); var cell = this.createElementWithClass("div", "grid-cell"); cell.style.width = "100px"; cell.innerText = "1"; row.appendChild(cell); this._measurements.rowHeight = row.offsetHeight; this._measurements.cellOffset = cell.offsetWidth - 100; var textUnit = this.createElementWithClass("div"); textUnit.style.overflow = "hidden"; textUnit.style.width = "1em"; textUnit.style.height = "1ex"; cell.appendChild(textUnit); this._measurements.unitEx = textUnit.offsetHeight; var gutter = this.createElementWithClass("div", "grid-gutter"); gutter.appendChild(this.createElementWithClass("div", "grid-gutter-row")); measurementContainer.appendChild(gutter); if(this._gutter) { this._measurements.gutterWidth = gutter.clientWidth; } else { this._measurements.gutterWidth = 0; } document.body.removeChild(measurementContainer); }; GridControl.prototype.initializeDataSource = function () { var canvas; if(this._resetScroll) { this._ignoreScroll = true; try { canvas = this._canvas; canvas.scrollTop = 0; canvas.scrollLeft = 0; this._scrollLeft = 0; this._scrollTop = 0; this._resetScroll = false; }finally { this._ignoreScroll = false; } } this.setDataSource(this._options.source, this._options.expandStates, this._options.columns, this._options.sortOrders); if(this._expandedCount > 0) { if(this._options.keepSelection && this._selectedIndex >= 0) { this._selectRow(Math.min(this._selectedIndex, this._expandedCount - 1)); } else { this._selectRow(this._options.initialSelection !== false ? 0 : -1); } } else { this.setSelectedRowIndex(-1); } }; GridControl.prototype.setDataSource = function (source, expandStates, columns, sortOrder, selectedIndex) { var _this = this; var i, l, count; this._rowInfoMap = { }; this._dataSource = source || []; this._count = count = this._dataSource.length; if(expandStates) { this._expandStates = expandStates; this._indentLevels = GridControl.expand(expandStates); } else { this._indentLevels = null; this._expandStates = null; } this._expandedCount = count; this._updateRanges(); this._columns = []; if(columns) { var defaultGetCellContents = function (rowInfo, dataIndex, expandedState, level, column, indentIndex, columnOrder) { return _this._drawCell(rowInfo, dataIndex, expandedState, level, column, indentIndex, columnOrder); }; var defaultGetHeaderCellContents = function (column, columnOrder) { return _this._drawHeaderCellValue(column, columnOrder); }; var defaultGetColumnValue = function (dataIndex, columnIndex, columnOrder) { return _this.getColumnValue(dataIndex, columnIndex, columnOrder); }; for(i = 0 , l = columns.length; i < l; i++) { var column = columns[i]; column.index = typeof (column.index) !== "undefined" ? column.index : String(i); column.canSortBy = column.canSortBy !== false; column.canMove = column.canMove !== false; column.width = typeof (column.width) !== "undefined" ? column.width : 100; column.getCellContents = column.getCellContents || defaultGetCellContents; column.getHeaderCellContents = column.getHeaderCellContents || defaultGetHeaderCellContents; column.getColumnValue = column.getColumnValue || defaultGetColumnValue; this._columns.push(column); } } this._sortOrder = []; if(sortOrder) { for(i = 0 , l = sortOrder.length; i < l; i++) { var columnSortOrder = sortOrder[i]; if(columnSortOrder.order !== "desc") { columnSortOrder.order = "asc"; } this._sortOrder.push(columnSortOrder); } this.setGutterHeaderSortOrder(); } this._clearSelection(); this._determineIndentIndex(); if(this._options.asyncInit) { window.setTimeout(function () { return _this._layoutAfterSetDataSource(selectedIndex); }, 0); } else { this._layoutAfterSetDataSource(selectedIndex); } }; GridControl.prototype.updateGetChildDataCallback = function (callback) { this._getChildDataCallback = callback; }; GridControl.prototype._layoutAfterSetDataSource = function (selectedIndex) { this.layout(); this._ensureSelectedIndex(selectedIndex); }; GridControl.prototype._adjustForDynamicData = function (newRows, newExpandStates, parentIndex, childPlaceholderIndex, hasMoreText) { if(hasMoreText) { var hasMoreItem = { hasMoreText: hasMoreText }; newRows.push(hasMoreItem); newExpandStates.push(0); } this._dataSource.splice(childPlaceholderIndex, 1); for(var i = 0; i < newRows.length; i++) { this._dataSource.splice(childPlaceholderIndex + i, 0, newRows[i]); } this._mergeExpandStates(parentIndex, childPlaceholderIndex, this._expandStates, newExpandStates); var count = this._dataSource.length; this._count = count; if(this._expandStates) { this._indentLevels = GridControl.expand(this._expandStates); } else { this._indentLevels = null; } this._expandedCount = count; this._updateRanges(); this._clearSelection(); this._determineIndentIndex(); this.layout(); }; GridControl.prototype._ensureSelectedIndex = function (index) { var oldSelectedIndex = this._selectedIndex; if(typeof index === "number") { this._selectedIndex = index; } if(this._selectedIndex >= 0) { if(this._count <= this._selectedIndex) { this._selectedIndex = this._count - 1; } if(this._selectedIndex !== oldSelectedIndex) { this._addSelection(this._selectedIndex); } } }; GridControl.prototype.getRowInfo = function (dataIndex) { return this._rows[dataIndex]; }; GridControl.prototype.getRowData = function (dataIndex) { return this._dataSource[dataIndex]; }; GridControl.prototype.getColumns = function () { return this._columns || []; }; GridControl.prototype.getSortOrder = function () { return this._sortOrder || []; }; GridControl.prototype._determineIndentIndex = function () { var _columns = this._columns, i, l; for(i = 0 , l = _columns.length; i < l; i++) { if(_columns[i].indent) { this._indentIndex = i; return; } } this._indentIndex = 0; }; GridControl.prototype._getDataIndex = function (visibleIndex) { var i, l, lastIndex = -1; var ranges = this._visibleRange; var range; if(visibleIndex < 0) { return -1; } for(i = 0 , l = ranges.length; i < l; i++) { range = ranges[i]; lastIndex += range.end - range.start + 1; if(visibleIndex <= lastIndex) { return range.end - lastIndex + visibleIndex; } } return visibleIndex; }; GridControl.prototype._getRowIndex = function (dataIndex) { var i, l, result = 0; var ranges = this._visibleRange; var range; for(i = 0 , l = ranges.length; i < l; i++) { range = ranges[i]; if(dataIndex >= range.start) { if(dataIndex <= range.end) { return result + dataIndex - range.start; } } else { break; } result += range.end - range.start + 1; } return -Math.max(0, result - 1); }; GridControl.prototype._updateRanges = function () { var i = 0, first = 0, l = this._count, newRanges = [], count = 0; if(this._expandStates) { while(i < l) { var state = this._expandStates[i]; if(state < 0) { newRanges[newRanges.length] = new Range(first, i); count += (i - first) + 1; i += 1 - state; first = i; } else { i++; } } if(first < l) { newRanges[newRanges.length] = new Range(first, l - 1); count += (l - first); } } else { count = l; newRanges[newRanges.length] = new Range(0, count); } this._expandedCount = count; this._visibleRange = newRanges; }; GridControl.prototype.expandNode = function (dataIndex) { var _this = this; if(this._dataSource[dataIndex + 1].isPlaceholder) { this._getChildDataCallback(this._dataSource[dataIndex], function (dynamicData, hasMoreText) { if(dynamicData !== null) { var dummyChildPlaceholderIndex = dataIndex + 1; _this._adjustForDynamicData(dynamicData.itemsWithPlaceholders, dynamicData.expandStates, dataIndex, dummyChildPlaceholderIndex, hasMoreText); } }); } if(this._expandStates) { var state = this._expandStates[dataIndex]; if(state < 0) { this._expandStates[dataIndex] = -state; this._updateRanges(); var row = this._rows[dataIndex]; if(row) { row.isDirty = true; } } } }; GridControl.prototype.collapseNode = function (dataIndex) { if(this._expandStates) { var state = this._expandStates[dataIndex]; if(state > 0) { this._expandStates[dataIndex] = -state; this._updateRanges(); var row = this._rows[dataIndex]; if(row) { row.isDirty = true; } } } }; GridControl.prototype.expandAllNodes = function () { var i = 0, l = this._count, states = this._expandStates, result = false, rows = this._rows; if(states) { while(i < l) { var state = states[i]; if(state < 0) { states[i] = -state; result = true; var row = rows[i]; if(row) { row.isDirty = true; } } i++; } if(result) { this._updateRanges(); } } return result; }; GridControl.prototype.collapseAllNodes = function () { var i = 0, l = this._count, states = this._expandStates, result = false, rows = this._rows; if(states) { while(i < l) { var state = states[i]; if(state > 0) { states[i] = -state; result = true; var row = rows[i]; if(row) { row.isDirty = true; } } i++; } if(result) { this._updateRanges(); } } return result; }; GridControl.prototype.expandAll = function () { var _this = this; this._updateExpansionStateAndRedraw(function () { return _this.expandAllNodes; }); }; GridControl.prototype.collapseAll = function () { var _this = this; this._updateExpansionStateAndRedraw(function () { return _this.collapseAllNodes; }); }; GridControl.prototype._updateExpansionStateAndRedraw = function (action) { var dataIndex, oldSelectedIndex = this._selectedIndex; if(oldSelectedIndex >= 0) { dataIndex = this._getDataIndex(oldSelectedIndex); } action(); if(oldSelectedIndex >= 0) { this._clearSelection(); this._addSelection(Math.abs(this._getRowIndex(dataIndex))); } this._layoutContentSpacer(); this._redraw(); }; GridControl.prototype.tryToggle = function (expand, shiftKey, rowDataIndex) { var state; if(!this._expandStates || this._selectedIndex < 0 || this._expandedCount <= 0) { return false; } var dataIndex = typeof rowDataIndex !== "undefined" ? rowDataIndex : this._getDataIndex(this._selectedIndex); var row = this._rows[dataIndex]; if(!row) { return false; } { state = this._expandStates[dataIndex]; if(state !== 0) { if(expand) { if(state < 0) { this.expandNode(dataIndex); } else { return false; } } else { if(state > 0) { this.collapseNode(dataIndex); } else { return false; } } this._clearSelection(); this._addSelection(this._getRowIndex(dataIndex)); this._layoutContentSpacer(); this._redraw(); return true; } } return false; }; GridControl.prototype._getVisibleRowIndices = function () { var top = this._scrollTop, bottom = top + this._canvasHeight, count = this._expandedCount - 1, rh = this._measurements.rowHeight; return { first: Math.min(count, Math.max(0, Math.ceil(top / rh))), last: Math.min(count, Math.floor(bottom / rh) - 1) }; }; GridControl.prototype._getRowIntoView = function (rowIndex, force) { if(force) { this._canvas.scrollTop = Math.max(0, Math.min(rowIndex || 0, this._expandedCount - 1)) * this._measurements.rowHeight; return true; } var visibleIndices = this._getVisibleRowIndices(); var firstIndex = visibleIndices.first; var lastIndex = visibleIndices.last; var count = lastIndex - firstIndex; if(rowIndex < firstIndex || rowIndex > lastIndex) { if(this._selectedIndex > firstIndex) { firstIndex = Math.max(rowIndex - count, 0); } else { firstIndex = Math.max(0, Math.min(rowIndex + count, this._expandedCount - 1) - count); } this._canvas.scrollTop = firstIndex * this._measurements.rowHeight; return true; } return false; }; GridControl.prototype.getSelectedRowIntoView = function (force) { return this._getRowIntoView(this._selectedIndex, force); }; GridControl.prototype.cacheRows = function (aboveRange, visibleRange, belowRange) { }; GridControl.prototype._updateViewport = function (includeNonDirtyRows) { var resultCount = this._count, above = [], below = [], visible = [], states = this._expandStates || [], maxIndex = this._expandedCount - 1; var visibleIndices = this._getVisibleRowIndices(); var firstIndex = visibleIndices.first; var lastIndex = visibleIndices.last; firstIndex = Math.max(0, firstIndex - this._options.extendViewportBy); lastIndex = Math.min(maxIndex, lastIndex + this._options.extendViewportBy); var cachingStart = Math.max(0, firstIndex - this._options.payloadSize); var cachingEnd = Math.min(maxIndex, lastIndex + this._options.payloadSize); var dataIndex = this._getDataIndex(cachingStart); var lastVisible = firstIndex; for(var i = cachingStart; i <= cachingEnd && dataIndex < resultCount; i++) { if(i < firstIndex) { above[above.length] = new RowIndexInfo(i, dataIndex); } else if(i > lastIndex) { below[below.length] = new RowIndexInfo(i, dataIndex); } else { visible[visible.length] = new RowIndexInfo(i, dataIndex); lastVisible = i; } var nodeState = states[dataIndex]; if(nodeState < 0) { dataIndex += (1 - nodeState); } else { dataIndex++; } } this.cacheRows(above, visible, below); this._drawRows(visible, includeNonDirtyRows); if(this._updateAriaOnViewportUpdate) { this._updateAriaOnViewportUpdate = false; this._updateAriaAttribute(); } }; GridControl.prototype._cleanUpRows = function () { var rows = this._rows, gutterDiv = this._gutter; for(var dataIndex in rows) { var row = rows[dataIndex]; if(row.row.parentElement) { row.row.parentElement.removeChild(row.row); } if(gutterDiv && row.gutterRow.parentElement) { row.gutterRow.parentElement.removeChild(row.gutterRow); } } this._rows = { }; }; GridControl.prototype._drawRows = function (visibleRange, includeNonDirtyRows) { var states = this._expandStates, expandedState = 0, levels = this._indentLevels, level = 0, hasGutter = this._gutter, canvasDom = this._canvas, gutterCanvasDom, updateRow; var fragment = document.createDocumentFragment(); var gutterFragment = null; if(hasGutter) { gutterCanvasDom = this._gutter; gutterFragment = document.createDocumentFragment(); } var existingRows = this._rows; var newRows = { }; this._rows = newRows; var visibleRowCount = visibleRange.length; for(var i = 0; i < visibleRowCount; i++) { var range = visibleRange[i]; var rowIndex = range.rowIndex; var dataIndex = range.dataIndex; var row = existingRows[dataIndex]; if(row) { updateRow = (row.rowIndex !== rowIndex); if(updateRow) { row.rowIndex = rowIndex; } else { updateRow = row.isDirty; delete row.isDirty; } if(includeNonDirtyRows) { updateRow = true; } delete existingRows[dataIndex]; } else { updateRow = true; var rowElement = this.createElementWithClass("div", "grid-row grid-row-normal"); rowElement.id = "row_" + this._getId() + "_" + rowIndex; fragment.appendChild(rowElement); var rowInfo = { rowIndex: rowIndex, dataIndex: dataIndex, row: rowElement }; if(hasGutter) { var gutterRowElement = this.createElementWithClass("div", "grid-gutter-row"); gutterFragment.appendChild(gutterRowElement); this._rowInfoMap[gutterRowElement.uniqueID] = rowInfo; rowInfo.gutterRow = gutterRowElement; } this._rowInfoMap[rowElement.uniqueID] = rowInfo; row = rowInfo; rowElement.onfocus = this._onFocus.bind(this); rowElement.onblur = this._onBlur.bind(this); } newRows[dataIndex] = row; if(updateRow) { if(states) { expandedState = states[dataIndex]; level = levels[dataIndex]; } this._updateRow(row, rowIndex, dataIndex, expandedState, level); } } for(var existingRowIdx in existingRows) { row = existingRows[existingRowIdx]; if(hasGutter) { delete this._rowInfoMap[row.gutterRow.uniqueID]; row.gutterRow.parentElement.removeChild(row.gutterRow); } delete this._rowInfoMap[row.row.uniqueID]; row.row.parentElement.removeChild(row.row); } canvasDom.appendChild(fragment); if(hasGutter) { gutterCanvasDom.appendChild(gutterFragment); } }; GridControl.prototype._setSortOrderClass = function (element, sortOrder) { if(sortOrder === "asc") { element.classList.remove("descending"); element.classList.add("ascending"); } else if(sortOrder === "desc") { element.classList.remove("ascending"); element.classList.add("descending"); } else if(sortOrder === "none") { element.classList.remove("ascending"); element.classList.remove("descending"); } }; GridControl.prototype.updateRow = function (rowIndex, dataIndex) { var expandedState = 0, level = 0; if(typeof dataIndex === "undefined" || dataIndex < 0) { dataIndex = this._getDataIndex(rowIndex); } else if(typeof rowIndex === "undefined" || rowIndex < 0) { rowIndex = this._getRowIndex(dataIndex); } var rowInfo = this._rows[dataIndex]; if(rowInfo) { if(this._expandStates) { expandedState = this._expandStates[dataIndex]; level = this._indentLevels[dataIndex]; } this._updateRow(rowInfo, rowIndex, dataIndex, expandedState, level); } }; GridControl.prototype._updateRow = function (rowInfo, rowIndex, dataIndex, expandedState, level) { var indentIndex = this._indentIndex; if(this._gutter) { var gutterOptions = this._options.gutter; var gutterRowElem = rowInfo.gutterRow; gutterRowElem.style.top = (rowIndex * this._measurements.rowHeight) + "px"; gutterRowElem.style.left = "0px"; gutterRowElem.style.width = (this._measurements.gutterWidth) + "px"; gutterRowElem.style.height = (this._measurements.rowHeight) + "px"; gutterRowElem.innerHTML = ""; if(gutterOptions.checkbox) { var gutterCheckbox = this.createElementWithClass("input", "checkbox " + (gutterOptions.checkbox.cssClass || "")); gutterCheckbox.setAttribute("type", "checkbox"); var gutterCheckboxCellElem = this.createElementWithClass("div", "grid-gutter-cell grid-gutter-checkbox"); gutterCheckboxCellElem.appendChild(gutterCheckbox[0]); gutterRowElem.appendChild(gutterCheckboxCellElem); } if(gutterOptions.icon) { var gutterIconCss = "grid-gutter-cell grid-gutter-icon "; if(typeof gutterOptions.icon.cssClass !== "undefined") { gutterIconCss += gutterOptions.icon.cssClass + " "; } if(typeof gutterOptions.icon.index !== "undefined") { gutterIconCss += (this.getColumnValue(dataIndex, gutterOptions.icon.index, -1) || "") + " "; } if(gutterOptions.icon.gutterIconCssCallback) { gutterIconCss += (gutterOptions.icon.gutterIconCssCallback(dataIndex, this._dataSource) || ""); } var gutterIconElem = this.createElementWithClass("div", gutterIconCss); if(gutterOptions.getTooltip) { var toolTip = gutterOptions.getTooltip(dataIndex, this._dataSource); if(toolTip) { GridControl._setTooltip(gutterIconElem, toolTip, 16); } } gutterRowElem.appendChild(gutterIconElem); } this._drawGutterCell(rowInfo, rowIndex, dataIndex, expandedState, level); } var rowElement = rowInfo.row; rowElement.innerHTML = ""; rowElement.style.top = (rowIndex * this._measurements.rowHeight) + "px"; rowElement.style.left = this._measurements.gutterWidth + "px"; rowElement.style.height = (this._measurements.rowHeight) + "px"; rowElement.style.width = isNaN(this._contentSize.width) ? "" : (this._contentSize.width + 2) + "px"; var columns = this._columns; for(var i = 0, columnsLength = columns.length; i < columnsLength; i++) { var column = columns[i]; if(column.hidden) { continue; } var cellElement = column.getCellContents(rowInfo, dataIndex, expandedState, level, column, indentIndex, i); if(cellElement) { rowElement.appendChild(cellElement); } } GridControl.makeElementUnselectable(rowElement); if(this._gutter) { GridControl.makeElementUnselectable(gutterRowElem); } this._updateRowSelectionStyle(rowInfo, this._selectedRows, this._selectedIndex); rowElement.removeEventListener("DOMAttrModified", this._onAriaExpandedModifiedHandler); if(expandedState !== 0) { rowElement.setAttribute("aria-expanded", expandedState > 0 ? "true" : "false"); rowElement.addEventListener("DOMAttrModified", this._onAriaExpandedModifiedHandler); } }; GridControl.prototype._drawGutterCell = function (rowInfo, rowIndex, dataIndex, expandedState, level) { }; GridControl._setTooltip = function _setTooltip(element, value, height) { var content = value.trim(); if(content) { var tooltip = { content: content, height: height }; element.setAttribute("data-plugin-vs-tooltip", JSON.stringify(tooltip)); } }; GridControl.prototype._drawCell = function (rowInfo, dataIndex, expandedState, level, column, indentIndex, columnOrder) { var width = column.width || 20, href, value; var cellElement = this.createElementWithClass("div", "grid-cell"); cellElement.style.width = isNaN(width) ? String(width) : width + "px"; var item = this._dataSource[dataIndex]; var tooltip; if(column.hasMoreColumn && item && item.hasMoreText) { href = this._onHasMoreClick.bind(this, item); value = item.hasMoreText; } else { if(typeof column.hrefIndex !== "undefined") { href = this.getColumnValue(dataIndex, column.hrefIndex, -1); } value = this.getColumnText(dataIndex, column, columnOrder); tooltip = this.getColumnText(dataIndex, column, columnOrder, true); } if(!column.hasHTMLContent) { GridControl._setTooltip(cellElement, tooltip ? tooltip : value, 65); } if(href) { var link = document.createElement("a"); if(typeof href === "function") { link.onclick = href; } else { link.setAttribute("href", href); } link.textContent = value; cellElement.appendChild(link); } else { if(value) { if(column.hasHTMLContent) { cellElement.innerHTML = value; } else { cellElement.textContent = value; } } else { cellElement.innerHTML = " "; } } if(columnOrder === indentIndex && level > 0) { var indent = ((level * 16) - 13); column.indentOffset = indent; if(expandedState !== 0) { var treeSign = this.createElementWithClass("div", "icon grid-tree-icon"); treeSign.style.left = indent + "px"; cellElement.appendChild(treeSign); if(expandedState > 0) { treeSign.classList.add("icon-tree-expanded"); } else { treeSign.classList.add("icon-tree-collapsed"); } } cellElement.style.textIndent = (level * 16) + "px"; } if(column.getCellCSSClass) { var cellStyle = column.getCellCSSClass(dataIndex, column.index, columnOrder, this._dataSource); if(cellStyle) { var styles = cellStyle.trim().split(" "); for(var index = 0; index < styles.length; index++) { cellElement.classList.add(styles[index]); } } } if(column.rowCss) { cellElement.classList.add(column.rowCss); } return cellElement; }; GridControl.prototype._drawHeader = function () { var _this = this; var columns = this._columns, sortOrder = this._sortOrder; if(this._header) { var fragment = document.createDocumentFragment(); for(var i = 0, l = columns.length; i < l; i++) { var column = columns[i]; if(column.hidden) { continue; } var headerElement = this.createElementWithClass("div", "grid-header-column"); GridControl._setTooltip(headerElement, column.tooltip, 65); headerElement.style.width = (column.width || 20) + "px"; (headerElement)._data = { columnIndex: i, header: true }; var seperatorElement = this.createElementWithClass("div", "separator"); if(column.fixed) { seperatorElement.style.cursor = "auto"; } (seperatorElement)._data = { columnIndex: i, separator: true }; headerElement.appendChild(seperatorElement); var headerCellElement = column.getHeaderCellContents(column, i); if(column.headerCss) { headerCellElement.classList.add(column.headerCss); } if(column.tooltip) { GridControl._setTooltip(headerCellElement, column.tooltip, 65); } headerElement.appendChild(headerCellElement); var sortElement = this.createElementWithClass("div", "sort-handle"); sortOrder.forEach(function (element, index, array) { if(element.index === column.index) { _this._setSortOrderClass(headerElement, element.order); return false; } }); this.setGutterHeaderSortOrder(); headerElement.appendChild(sortElement); fragment.appendChild(headerElement); } this._headerCanvas.innerHTML = ""; this._headerCanvas.appendChild(fragment); GridControl.makeElementUnselectable(this._header); } }; GridControl.prototype._drawHeaderCellValue = function (column, columnOrder) { var cellElement = document.createElement("div"); cellElement.classList.add("title"); cellElement.innerText = column.text || ""; if(columnOrder === this._indentIndex && !(typeof this._indentLevels === "undefined" || this._indentLevels === null)) { cellElement.classList.add("indented-title"); } return cellElement; }; GridControl.prototype._layoutContentSpacer = function () { var width = 0, columns = this._columns; for(var i = 0, l = columns.length; i < l; i++) { if(columns[i].hidden) { continue; } width += (columns[i].width || 20) + this._measurements.cellOffset; } width = width + 2; var height = Math.max(1, this._expandedCount * this._measurements.rowHeight); this._contentSpacer.style.width = width + "px"; this._contentSpacer.style.height = height + "px"; if(this._gutter) { this._gutter.style.height = height + "px"; } this._ignoreScroll = true; try { var scrollTop = Math.max(0, Math.min(this._scrollTop, height - this._canvasHeight)); if(scrollTop !== this._scrollTop) { this._scrollTop = scrollTop; this._canvas.scrollTop = scrollTop; } var scrollLeft = Math.max(0, Math.min(this._scrollLeft, width - this._canvasWidth)); if(scrollLeft !== this._scrollLeft) { this._scrollLeft = scrollLeft; this._canvas.scrollLeft = scrollLeft; } }finally { this._ignoreScroll = false; } this._contentSize.width = width; this._contentSize.height = height; }; GridControl.prototype._layoutHeader = function () { if(this._header) { this._headerCanvas.style.left = this._measurements.gutterWidth - this._scrollLeft + "px"; } if(this._gutter) { this._gutter.style.left = this._scrollLeft + "px"; } }; GridControl.prototype.layout = function () { this._measureCanvasSize(); this._cleanUpRows(); this._fixScrollPos(); this._layoutContentSpacer(); this._updateViewport(); this._layoutHeader(); this._drawHeader(); }; GridControl.prototype._fixScrollPos = function () { var oldIgnoreScroll = this._ignoreScroll; this._ignoreScroll = true; try { this._canvas.scrollLeft = this._scrollLeft; this._canvas.scrollTop = this._scrollTop; }finally { this._ignoreScroll = oldIgnoreScroll; } }; GridControl.prototype.redraw = function () { this._fixScrollPos(); this._redraw(true); }; GridControl.prototype._redraw = function (includeNonDirtyRows) { this._layoutHeader(); this._updateViewport(includeNonDirtyRows); }; GridControl.prototype.getColumnValue = function (dataIndex, columnIndex, columnOrder) { return this._dataSource[dataIndex][columnIndex]; }; GridControl.prototype.getColumnText = function (dataIndex, column, columnOrder, isForTooltip) { var text; var value = column.getColumnValue(dataIndex, column.index, columnOrder, this._dataSource, isForTooltip); if(typeof value !== "string") { text = GridControl.convertValueToDisplayString(value, column.format); } else { text = value; } column.maxLength = Math.max(column.maxLength || 0, text.length); return text; }; GridControl.prototype._getExpandState = function (dataIndex) { var result = 0; if(this._expandStates) { if(typeof (this._expandStates[dataIndex]) === "number") { result = this._expandStates[dataIndex]; } } return result; }; GridControl.prototype._selectRow = function (rowIndex, dataIndex, options) { var ctrl = options && options.ctrl, shift = options && options.shift, rightClick = options && options.rightClick; if(ctrl) { this._addSelection(rowIndex, dataIndex, { toggle: true }); } else if(shift) { this._clearSelection(); this._addSelectionRange(rowIndex, dataIndex); } else if(rightClick) { if(!this._selectedRows || !(this._selectedRows.hasOwnProperty(rowIndex))) { this._clearSelection(); this._addSelection(rowIndex, dataIndex); } else { this._selectedIndex = rowIndex; this._updateAriaAttribute(); } } else { this._clearSelection(); this._addSelection(rowIndex, dataIndex); } }; GridControl.prototype._selectAll = function () { if(this._count > 0 && this._options.allowMultiSelect !== false) { this._clearSelection(); this._selectionStart = 0; var prevIndex = Math.max(0, this._selectedIndex); this._addSelectionRange(this._count - 1, undefined, { doNotFireEvent: true }); this._selectedIndex = prevIndex; this._updateSelectionStyles(); this._selectionChanged(); } }; GridControl.prototype.getSelectedRowIndex = function () { return this._selectedIndex; }; GridControl.prototype.setSelectedRowIndex = function (selectedRowIndex) { this._clearSelection(); this._addSelection(selectedRowIndex); }; GridControl.prototype.getSelectedDataIndex = function () { return this._getDataIndex(this._selectedIndex); }; GridControl.prototype.getSelectedDataIndices = function () { var index, rows = this._selectedRows, indices = []; if(rows) { for(index in rows) { indices[indices.length] = rows[index]; } } return indices; }; GridControl.prototype.ensureDataIndexExpanded = function (dataIndex) { var rowIndex = this._getRowIndex(dataIndex); while(rowIndex < 0 || (dataIndex > 0 && rowIndex === 0)) { this.expandNode(this._getDataIndex(-rowIndex)); rowIndex = this._getRowIndex(dataIndex); } return rowIndex; }; GridControl.prototype.setSelectedDataIndex = function (dataIndex, expandNodes) { var rowIndex = expandNodes ? this.ensureDataIndexExpanded(dataIndex) : this._getRowIndex(dataIndex); this.setSelectedRowIndex(rowIndex); }; GridControl.prototype._clearSelection = function () { this._selectionCount = 0; this._selectedRows = null; }; GridControl.prototype._addSelection = function (rowIndex, dataIndex, options) { var keepSelectionStart = options && options.keepSelectionStart, doNotFireEvent = options && options.doNotFireEvent, toggle = options && options.toggle; if(this._options.allowMultiSelect === false) { keepSelectionStart = false; this._clearSelection(); } if(!this._selectedRows) { this._selectedRows = { }; } if(rowIndex >= 0) { var add = true; if(!(this._selectedRows.hasOwnProperty(rowIndex))) { this._selectionCount++; } else if(toggle) { add = false; this._selectionCount = Math.max(0, this._selectionCount - 1); delete this._selectedRows[rowIndex]; } if(typeof (dataIndex) !== "number") { dataIndex = this._getDataIndex(rowIndex); } if(add) { this._selectedRows[rowIndex] = dataIndex; } this._selectedIndex = rowIndex; this._updateAriaAttribute(); if(this._selectionStart < 0 || !keepSelectionStart) { this._selectionStart = rowIndex; } } else { dataIndex = -1; this._selectedIndex = -1; } if(!doNotFireEvent) { this._updateSelectionStyles(); this._selectionChanged(); this._selectedIndexChanged(this._selectedIndex, dataIndex); } }; GridControl.prototype._addSelectionRange = function (rowIndex, dataIndex, options) { var doNotFireEvent = options && options.doNotFireEvent, prevSelectedDataIndex = -1, selectedDataIndex; if(this._options.allowMultiSelect === false) { this._addSelection(rowIndex, dataIndex); } else { if(this._selectedRows) { prevSelectedDataIndex = this._selectedRows[this._selectedIndex]; } if(this._selectionStart < 0) { this._selectionStart = rowIndex; } var start = Math.min(this._selectionStart, rowIndex); var end = Math.max(this._selectionStart, rowIndex); if(typeof (dataIndex) !== "number" || start !== rowIndex) { dataIndex = this._getDataIndex(start); } for(var i = start; i <= end; i++) { this._addSelection(i, dataIndex, { keepSelectionStart: true, doNotFireEvent: true }); if(i === rowIndex) { selectedDataIndex = dataIndex; } var nodeState = this._getExpandState(dataIndex); if(nodeState < 0) { dataIndex += (1 - nodeState); } else { dataIndex++; } } this._selectedIndex = rowIndex; this._updateAriaAttribute(); if(!doNotFireEvent) { this._updateSelectionStyles(); this._selectionChanged(); if(prevSelectedDataIndex !== selectedDataIndex) { this._selectedIndexChanged(this._selectedIndex, selectedDataIndex); } } } }; GridControl.prototype.setFocusToSelectedRow = function () { this._updateAriaAttribute(); this.getSelectedRowIntoView(true); }; GridControl.prototype._updateAriaAttribute = function () { var dataIndex = this._getDataIndex(this._selectedIndex); if(dataIndex >= 0) { var rowInfo = this.getRowInfo(dataIndex); if(!rowInfo || !rowInfo.row) { this._updateAriaOnViewportUpdate = true; } else { var id = rowInfo.row.getAttribute("id"); if(id !== this._activeAriaId) { var ariaLabel = this._getAriaLabelForRow(rowInfo); rowInfo.row.setAttribute("aria-label", ariaLabel); this._activeAriaId = id; } try { if(this._canvasContainsFocus) { rowInfo.row.setActive(); } else { rowInfo.row.focus(); } } catch (err) { } } } }; GridControl.prototype._getAriaLabelForRow = function (rowInfo) { var ariaLabel = ""; var rowIndex = rowInfo.rowIndex; var dataIndex = rowInfo.dataIndex; var expandedState = 0, level = 0; if(this._expandStates) { expandedState = this._expandStates[dataIndex]; level = this._indentLevels[dataIndex]; } if(this._gutter) { var gutterOptions = this._options.gutter; if(gutterOptions.getTooltip) { var toolTip = gutterOptions.getTooltip(dataIndex, this._dataSource); if(toolTip) { if(ariaLabel) { ariaLabel += ", "; } ariaLabel += toolTip; } } } var columns = this._columns; for(var i = 0, l = columns.length; i < l; i++) { var column = columns[i]; if(column.hidden) { continue; } var cellText = this.getColumnText(dataIndex, column, i); if(ariaLabel) { ariaLabel += ", "; } ariaLabel += cellText; } return ariaLabel; }; GridControl.prototype._updateSelectionStyles = function () { var _this = this; if(this._delayedUpdateCookie) { window.clearTimeout(this._delayedUpdateCookie); } this._delayedUpdateCookie = window.setTimeout(function () { var dataIndex, selectedRows = _this._selectedRows, focusIndex = _this._selectedIndex, rows = _this._rows; for(dataIndex in rows) { var rowInfo = rows[dataIndex]; _this._updateRowSelectionStyle(rowInfo, selectedRows, focusIndex); } }, 10); }; GridControl.prototype._selectionChanged = function () { this.selectionChanged(this._selectedIndex, this._selectionCount, this._selectedRows); this.fireCustomEvent(this._element, "selectionchanged", [ { selectedIndex: this._selectedIndex, selectedCount: this._selectionCount, selectedRows: this._selectedRows } ]); }; GridControl.prototype.selectionChanged = function (selectedIndex, selectedCount, selectedRows) { }; GridControl.prototype._selectedIndexChanged = function (selectedRowIndex, selectedDataIndex) { this.selectedIndexChanged(selectedRowIndex, selectedDataIndex); this.fireCustomEvent(this._element, GridControl.EVENT_SELECTED_INDEX_CHANGED, [ selectedRowIndex, selectedDataIndex ]); }; GridControl.prototype.selectedIndexChanged = function (selectedRowIndex, selectedDataIndex) { }; GridControl.prototype._updateRowSelectionStyle = function (rowInfo, selectedRows, focusIndex) { var rowIndex = rowInfo.rowIndex; var rowElement = rowInfo.row; var gutterElement = rowInfo.gutterRow; rowElement.classList.remove("grid-row-selected"); rowElement.classList.remove("grid-row-selected-blur"); rowElement.classList.remove("grid-row-current"); if(gutterElement) { var checkbox = gutterElement.querySelector("input.checkbox"); if(checkbox) { checkbox.setAttribute("checked", String(false)); } } if(selectedRows && selectedRows.hasOwnProperty(rowIndex)) { if(gutterElement) { var checkbox = gutterElement.querySelector("input.checkbox"); if(checkbox) { checkbox.setAttribute("checked", String(false)); } } if(this._active) { rowElement.classList.add("grid-row-selected"); } else { rowElement.classList.add("grid-row-selected-blur"); } } if(rowIndex === focusIndex) { rowElement.classList.add("grid-row-current"); if(this._rowSelectedCallback) { this._rowSelectedCallback(); } } }; GridControl.prototype._measureCanvasSize = function () { this._canvasHeight = this._canvas.clientHeight; this._canvasWidth = this._canvas.clientWidth; }; GridControl.prototype._onContainerResize = function (e) { this.layout(); }; GridControl.prototype._setupMoveEvents = function () { var _this = this; document.addEventListener("mousemove", function (e) { return _this._onDocumentMouseMove(e); }); document.addEventListener("mouseup", function (e) { return _this._onDocumentMouseUp(e); }); }; GridControl.prototype._clearMoveEvents = function () { document.removeEventListener("mousemove", null, true); document.removeEventListener("mouseup", null, true); }; GridControl.prototype._onDocumentMouseMove = function (e) { var columnSizing = this._columnSizing; if(columnSizing && columnSizing.active === true) { var delta = e.pageX - columnSizing.origin; var newWidth = Math.max(15, columnSizing.originalWidth + delta); var column = this._columns[columnSizing.index]; column.width = newWidth; this._applyColumnSizing(columnSizing.index); this._moveSizingElement(columnSizing.index); } }; GridControl.prototype._onDocumentMouseUp = function (e) { var _this = this; window.setTimeout(function () { _this._tryFinishColumnSizing(false); }, 0); return false; }; GridControl.prototype._onHeaderMouseDown = function (e) { if(e.which !== 1) { return true; } var separator = this.findClosestElement(e.target, ".separator"); if(separator && (separator)._data) { var columnIndex = (separator)._data.columnIndex; var column = this._columns[columnIndex]; if(!column.fixed) { this._columnSizing = new ColumnSizing(true, columnIndex, column.width, e.pageX); this._moveSizingElement(columnIndex); this._setupMoveEvents(); e.stopImmediatePropagation(); e.preventDefault(); return false; } } }; GridControl.prototype._onHeaderMouseUp = function (e) { return false; }; GridControl.prototype._onHeaderClick = function (e) { var headerColumn = this.findClosestElement(e.target, ".grid-header-column"); if(headerColumn) { if(!this._columnSizing) { var separator = this.findClosestElement(e.target, ".separator"); if(separator && (separator)._data) { return false; } else if((headerColumn)._data) { var columnIndex = (headerColumn)._data.columnIndex; var column = this._columns[columnIndex]; if(column.canSortBy && !column.fixed) { this._sortBy(column, e.shiftKey); } } } } }; GridControl.prototype._onHeaderDblClick = function (e) { var separator = this.findClosestElement(e.target, ".separator"); if(separator && (separator)._data) { this._tryFinishColumnSizing(true); var columnIndex = (separator)._data.columnIndex; var column = this._columns[columnIndex]; var maxLength = Math.max(column.maxLength || 0, 3); var ratio = 1.1 + 0.7 * Math.exp(-maxLength / 20); var originalWidth = column.width; column.width = (column.indentOffset || 0) + Math.round(maxLength * ratio * this._measurements.unitEx); this._applyColumnSizing(columnIndex, originalWidth, true); return false; } }; GridControl.prototype._onHasMoreClick = function (hasMoreItem) { var _this = this; var parentItem; var parentIndex; var hasMoreIndex; for(var i = 0; i < this._dataSource.length; i++) { if(this._dataSource[i] === hasMoreItem) { hasMoreIndex = i; break; } } if(typeof hasMoreIndex === "undefined") { return; } if(hasMoreIndex < this._expandStates.length) { for(var i = hasMoreIndex - 1; i >= 0; i--) { var expandState = Math.abs(this._expandStates[i]); if(expandState >= hasMoreIndex - i) { parentIndex = i; break; } } } if(typeof parentIndex === "undefined") { return; } parentItem = this._dataSource[parentIndex]; this._getLoadMoreChildDataCallback(parentItem, function (dynamicData, hasMoreText) { if(dynamicData !== null) { _this._adjustForDynamicData(dynamicData.itemsWithPlaceholders, dynamicData.expandStates, parentIndex, hasMoreIndex, hasMoreText); } }); }; GridControl.prototype._moveSizingElement = function (columnIndex) { var left = this._measurements.gutterWidth; if(!this._sizingElement) { if(columnIndex < 0) { return; } this._sizingElement = this.createElementWithClass("div", "grid-column-sizing"); this._canvas.appendChild(this._sizingElement); } this._sizingElement.style.height = (this._canvas.clientHeight - 1) + "px"; this._sizingElement.style.top = this._scrollTop + "px"; if(columnIndex < 0) { this._sizingElement.style.left = "-5000px"; this._sizingElement.style.top = "-5000px"; this._sizingElement.style.height = 0 + "px"; } else { var i = 0; while(i <= columnIndex) { var column = this._columns[i++]; if(!column.hidden) { left += column.width; } } this._sizingElement.style.left = (left - 1) + "px"; } }; GridControl.prototype._getVisibleColumnIndex = function (columnIndex) { var columnCounter = 0, visibleColumnIndex = 0, length = this._columns.length; if(this._columns[columnIndex].hidden) { return -1; } while(columnCounter < columnIndex) { if(!this._columns[columnCounter].hidden) { visibleColumnIndex++; } columnCounter++; } return visibleColumnIndex; }; GridControl.prototype._applyColumnSizing = function (columnIndex, initialWidth, finish) { var domColumnIndex = this._getVisibleColumnIndex(columnIndex) + 1, column = this._columns[columnIndex], columnSizeChanged = false; initialWidth = initialWidth || -1; if(column) { columnSizeChanged = column.width !== initialWidth; var columnDiv = this.rootElement.querySelector(".grid-header-canvas .grid-header-column:nth-child(" + domColumnIndex + ")"); columnDiv.style.width = column.width + "px"; } if(finish === true) { if(columnSizeChanged) { this.layout(); } this._onColumnResize(column); } }; GridControl.prototype._onColumnResize = function (column) { this.fireCustomEvent(this._element, "columnresize", [ column ]); }; GridControl.prototype._tryFinishColumnSizing = function (cancel) { var columnSizing = this._columnSizing; if(columnSizing) { if(columnSizing.active === true) { if(!cancel) { this._applyColumnSizing(columnSizing.index, columnSizing.originalWidth, true); } this._moveSizingElement(-1); } this._columnSizing = null; this._clearMoveEvents(); } }; GridControl.prototype._getSortColumns = function (sortOrder) { var columns = this._columns, sortColumns = []; for(var i = 0, l = sortOrder.length; i < l; i++) { var c; var sc = sortOrder[i]; columns.forEach(function (element, index, array) { if(element.index === sc.index) { c = element; return false; } }); sortColumns.push(c); } return sortColumns; }; GridControl.prototype._sortBy = function (column, add) { var sortOrder = this._sortOrder.slice(0), found = false; if(column) { for(var i = 0, l = sortOrder.length; i < l; i++) { var sc = sortOrder[i]; if(sc.index === column.index) { sortOrder.splice(i, 1); found = true; break; } } var sc; if(found) { sc = new SortOrderInfo(sc.index, sc.order === "asc" ? "desc" : "asc"); } else { sc = new SortOrderInfo(column.index, "asc"); } if(add && this._options.allowSortOnMultiColumns) { sortOrder.push(sc); } else { sortOrder = [ sc ]; } } var sortColumns = this._getSortColumns(sortOrder); this._onSort(sortOrder, sortColumns); }; GridControl.prototype._onSort = function (sortOrder, sortColumns) { if(this.onSort(sortOrder, sortColumns) !== false) { this.fireCustomEvent(this._element, "sort", [ { sortOrder: sortOrder, sortColumns: sortColumns } ]); } }; GridControl.prototype.onSort = function (sortOrder, sortColumns) { this.fireCustomEvent(this._element, "sortStarted"); if(this._options.autoSort) { this._trySorting(sortOrder, sortColumns); this._sortOrder = sortOrder; this.layout(); } return true; }; GridControl.prototype._trySorting = function (sortOrder, sortColumns) { var _this = this; if(!sortColumns) { sortColumns = this._getSortColumns(sortOrder); } var selectedDatas = [], sumOfSelectedRowIndices = 0; for(var rowIndex in this._selectedRows) { var dataIndex = this._selectedRows[rowIndex]; var data = this._dataSource[dataIndex]; if(data) { selectedDatas.push(data); sumOfSelectedRowIndices += parseInt(rowIndex); } } var rootNode = new TreeNode(null, null); GridControl.addItemsToTree(this._dataSource, this._expandStates, 0, this._dataSource.length, rootNode); if(this._sortOrder && this._sortOrder.length === 1 && sortOrder.length === 1 && this._sortOrder[0] !== sortOrder[0] && this._sortOrder[0].index === sortOrder[0].index) { if(this._sortOrder[0].order !== sortOrder[0].order) { GridControl.walkTree(rootNode, function (node) { Utility.TreeNodeSort.stableReverse(node.children, function (v1, v2) { return Utility.TreeNodeSort.sortComparer(sortOrder, sortColumns, v1.data, v2.data); }); }); } } else { GridControl.walkTree(rootNode, function (node) { node.children.sort(function (v1, v2) { return Utility.TreeNodeSort.sortComparer(sortOrder, sortColumns, v1.data, v2.data); }); }); } this._dataSource = []; this._expandStates = []; for(var i = 0; i < rootNode.children.length; i++) { GridControl.walkTree(rootNode.children[i], function (node) { _this._dataSource.push(node.data); _this._expandStates.push(node.expandState); }); } this._indentLevels = GridControl.expand(this._expandStates); this._updateRanges(); if(this._selectionCount > 0) { this._clearSelection(); var sumOfNewSelectedRowIndices = 0; for(var i = 0; i < selectedDatas.length; i++) { var dataIndex = this._dataSource.indexOf(selectedDatas[i]); if(dataIndex >= 0) { var dataRowIndex = this._getRowIndex(dataIndex); this._addSelection(dataRowIndex, dataIndex); sumOfNewSelectedRowIndices += dataRowIndex; } } this._scrollTop += (sumOfNewSelectedRowIndices - sumOfSelectedRowIndices) / this._selectionCount * this._measurements.rowHeight; } }; GridControl.prototype._onCanvasScroll = function (e) { var canvas = this._canvas; this._resetScroll = true; this._scrollLeft = canvas.scrollLeft; this._scrollTop = canvas.scrollTop; if(!this._ignoreScroll) { this._redraw(); } return false; }; GridControl.prototype.getRowInfoFromEvent = function (e, selector) { var element = this.findClosestElement(e.target, selector); return this._rowInfoMap[element.uniqueID]; }; GridControl.prototype._getClickedCell = function (e) { return this.findClosestElement(e.target, ".grid-cell"); }; GridControl.prototype._createEditCellBox = function (rowDataIndex, columnIndex, editElement, editCallback) { var previousValue = editElement.innerText; var editBox = this.createElementWithClass("input", "grid-edit-box"); editBox.setAttribute("type", "text"); editBox.setAttribute("value", previousValue); function commitValue(e) { var data = (editBox).value; editElement.innerText = data; if(editCallback) { editCallback(data, rowDataIndex, columnIndex); e.stopPropagation(); e.preventDefault(); return false; } } editBox.addEventListener("focusout", function (e) { commitValue(e); }); editBox.addEventListener("keydown", function (e) { if(e.keyCode === Common.KeyCodes.ENTER) { commitValue(e); } else if(e.keyCode === Common.KeyCodes.ESCAPE) { editElement.innerText = previousValue; e.stopPropagation(); e.preventDefault(); return false; } }); editElement.innerHTML = ""; editElement.appendChild(editBox); editBox.select(); editBox.focus(); }; GridControl.prototype._onEditCell = function (e) { var targetElement = e.target; if(!targetElement.classList.contains("grid-tree-icon")) { var cellElement = this._getClickedCell(e); if(cellElement && cellElement.classList.contains("grid-cell-editable")) { var rowInfo = this.getRowInfoFromEvent(e, ".grid-row"); if(rowInfo) { var cells = rowInfo.row.children; var totalCells = cells.length; var columnIndex = -1; for(var index = 0; index < totalCells; index++) { if(cellElement === cells[index]) { columnIndex = index; } } this._createEditCellBox(rowInfo.dataIndex, columnIndex, cellElement, this._editCellCallback); } } } }; GridControl.prototype._onRowMouseDown = function (e) { var rowInfo = this.getRowInfoFromEvent(e, ".grid-row"); if(rowInfo) { var targetElement = e.target; if(e.which === 1 && targetElement.classList.contains("grid-tree-icon")) { this._onToggle(rowInfo); } else if(!(e.which === 3 && this._options && this._options.disableRightClickSelection)) { this._selectRow(rowInfo.rowIndex, rowInfo.dataIndex, { ctrl: e.ctrlKey, shift: e.shiftKey, rightClick: e.which === 3 }); } } }; GridControl.prototype._onGutterClick = function (e) { var rowInfo = this.getRowInfoFromEvent(e, ".grid-gutter-row"); if(rowInfo) { if(!this._selectedRows || typeof (this._selectedRows[rowInfo.rowIndex]) !== "number") { this._selectRow(rowInfo.rowIndex, rowInfo.dataIndex); } } }; GridControl.prototype._onBlur = function (e) { var targetElement = e.target; if(targetElement.classList.contains("grid-edit-box")) { e.stopPropagation(); return; } this._active = false; this._updateSelectionStyles(); }; GridControl.prototype._onFocus = function (e) { var targetElement = e.target; if(targetElement.classList.contains("grid-edit-box")) { e.stopPropagation(); return; } this._active = true; this._updateSelectionStyles(); this._updateAriaAttribute(); }; GridControl.prototype._onKeyDown = function (e) { var bounds = { lo: -1, hi: -1 }, keyCode = Common.KeyCodes, canvas = this._canvas; if(this._options.isGridDisabled) { return false; } if(this._copyInProgress) { if(e.keyCode === keyCode.ESCAPE) { if(this._cancelable) { this._cancelable.cancel(); } } return false; } if(this._count > 0) { bounds = { lo: 0, hi: this._expandedCount - 1 }; } if(this._selectedIndex < 0) { this._addSelection(bounds.lo); } var bubbleUp = false; switch(e.keyCode) { case keyCode.A: if(e.ctrlKey) { this._selectAll(); } else { return true; } break; case keyCode.ARROW_DOWN: this._clearSelection(); if(e.ctrlKey) { if(e.shiftKey) { this._addSelectionRange(bounds.hi); } else { this._addSelection(bounds.hi); } } else { if(e.shiftKey) { this._addSelectionRange(Math.min(this._selectedIndex + 1, bounds.hi)); } else { this._addSelection(Math.min(this._selectedIndex + 1, bounds.hi)); } } break; case keyCode.ARROW_UP: this._clearSelection(); if(e.ctrlKey) { if(e.shiftKey) { this._addSelectionRange(bounds.lo); } else { this._addSelection(bounds.lo); } } else { if(e.shiftKey) { this._addSelectionRange(Math.max(this._selectedIndex - 1, bounds.lo)); } else { this._addSelection(Math.max(this._selectedIndex - 1, bounds.lo)); } } break; case keyCode.PAGE_DOWN: case keyCode.PAGE_UP: var span = canvas.clientHeight; var rowsPerPage = Math.floor(span / this._measurements.rowHeight); this._clearSelection(); if(e.keyCode === keyCode.PAGE_DOWN) { if(e.shiftKey) { this._addSelectionRange(Math.min(this._selectedIndex + rowsPerPage, bounds.hi)); } else { this._addSelection(Math.min(this._selectedIndex + rowsPerPage, bounds.hi)); } } else { if(e.shiftKey) { this._addSelectionRange(Math.max(this._selectedIndex - rowsPerPage, bounds.lo)); } else { this._addSelection(Math.max(this._selectedIndex - rowsPerPage, bounds.lo)); } } break; case keyCode.ARROW_RIGHT: if(!this.tryToggle(true, e.shiftKey)) { this._addSelection(Math.min(this._selectedIndex + 1, bounds.hi)); } else { this._clearSelection(); this._addSelection(this._selectedIndex); } break; case keyCode.ARROW_LEFT: if(!this.tryToggle(false, e.shiftKey)) { this._addSelection(Math.max(this._selectedIndex - 1, bounds.lo)); } else { this._clearSelection(); this._addSelection(this._selectedIndex); } break; case keyCode.HOME: this._clearSelection(); if(e.shiftKey) { this._addSelectionRange(bounds.lo); } else { this._addSelection(bounds.lo); } break; case keyCode.END: this._clearSelection(); if(e.shiftKey) { this._addSelectionRange(bounds.hi); } else { this._addSelection(bounds.hi); } break; default: bubbleUp = true; } this.getSelectedRowIntoView(); if(!bubbleUp) { e.preventDefault(); } return false; }; GridControl.prototype._onToggle = function (rowInfo) { if(this._expandStates) { var state = this._expandStates[rowInfo.dataIndex]; if(state !== 0) { if(state > 0) { this.collapseNode(rowInfo.dataIndex); } else if(state < 0) { this.expandNode(rowInfo.dataIndex); } this._clearSelection(); this._addSelection(Math.min(rowInfo.rowIndex, this._expandedCount - 1), rowInfo.dataIndex); this._layoutContentSpacer(); this._redraw(); } } }; GridControl.prototype.getExpandStates = function () { return this._expandStates; }; return GridControl; })(Controls.Control); Grid.GridControl = GridControl; })(Controls.Grid || (Controls.Grid = {})); var Grid = Controls.Grid; })(Common.Controls || (Common.Controls = {})); var Controls = Common.Controls; })(Common || (Common = {})); //@ sourceMappingURL=gridControl.js.map // ButtonHelpers.ts var Common; (function (Common) { "use strict"; var ButtonHelpers = (function () { function ButtonHelpers() { } ButtonHelpers.changeButtonStatus = function changeButtonStatus(buttonDiv, enabled, pressed) { var wasEnabled = ButtonHelpers.isEnabled(buttonDiv); if(enabled && !wasEnabled) { buttonDiv.classList.remove("toolbarButtonStateDisabled"); buttonDiv.setAttribute("aria-disabled", "false"); } else if(!enabled && wasEnabled) { buttonDiv.classList.add("toolbarButtonStateDisabled"); buttonDiv.setAttribute("aria-disabled", "true"); } if(typeof pressed === "boolean") { ButtonHelpers._isChangingAriaPressed = true; buttonDiv.setAttribute("aria-pressed", pressed ? "true" : "false"); ButtonHelpers._isChangingAriaPressed = false; } }; ButtonHelpers.isEnabled = function isEnabled(buttonDiv) { return !buttonDiv.classList.contains("toolbarButtonStateDisabled"); }; ButtonHelpers.isValidEvent = function isValidEvent(event) { return (event.type === "click" || event.keyCode === Common.KeyCodes.ENTER || event.keyCode === Common.KeyCodes.SPACE) && ButtonHelpers.isEnabled(event.currentTarget); }; ButtonHelpers.setupButton = function setupButton(buttonDiv, tooltipResourceName, clickHandler, isEnabled) { if (typeof isEnabled === "undefined") { isEnabled = true; } if(typeof tooltipResourceName === "string") { var tooltip = Plugin.Resources.getString(tooltipResourceName); buttonDiv.setAttribute("data-plugin-vs-tooltip", tooltip); buttonDiv.setAttribute("aria-label", tooltip); buttonDiv.setAttribute("role", "button"); } if(clickHandler) { buttonDiv.addEventListener("click", function (event) { return ButtonHelpers.onButtonPress(event, clickHandler); }); buttonDiv.addEventListener("keydown", function (event) { return ButtonHelpers.onButtonPress(event, clickHandler); }); buttonDiv.addEventListener("DOMAttrModified", function (event) { if(!ButtonHelpers._isChangingAriaPressed && ButtonHelpers.isEnabled(buttonDiv) && event.attrName === "aria-pressed" && event.attrChange === event.MODIFICATION) { clickHandler(event); } }); } buttonDiv.addEventListener("mousedown", ButtonHelpers.onButtonMouseDown); buttonDiv.addEventListener("mouseenter", ButtonHelpers.onButtonMouseEnter); buttonDiv.addEventListener("mouseleave", ButtonHelpers.onButtonMouseLeave); buttonDiv.addEventListener("mouseup", ButtonHelpers.onButtonMouseUp); if(!isEnabled) { ButtonHelpers.changeButtonStatus(buttonDiv, false); } }; ButtonHelpers.onButtonMouseDown = function onButtonMouseDown(event) { var buttonDiv = event.currentTarget; if(ButtonHelpers.isEnabled(buttonDiv)) { buttonDiv.classList.add("toolbarButtonMouseDown"); } else { event.stopImmediatePropagation(); } }; ButtonHelpers.onButtonMouseEnter = function onButtonMouseEnter(event) { var buttonDiv = event.currentTarget; if(ButtonHelpers.isEnabled(buttonDiv)) { buttonDiv.classList.add("toolbarButtonMouseHover"); } else { event.preventDefault(); event.stopImmediatePropagation(); } }; ButtonHelpers.onButtonMouseLeave = function onButtonMouseLeave(event) { var buttonDiv = event.currentTarget; buttonDiv.classList.remove("toolbarButtonMouseHover"); buttonDiv.classList.remove("toolbarButtonMouseDown"); }; ButtonHelpers.onButtonMouseUp = function onButtonMouseUp(event) { var buttonDiv = event.currentTarget; buttonDiv.classList.remove("toolbarButtonMouseDown"); }; ButtonHelpers.onButtonPress = function onButtonPress(event, clickHandler) { if(ButtonHelpers.isValidEvent(event)) { clickHandler(event); event.preventDefault(); event.stopImmediatePropagation(); } }; return ButtonHelpers; })(); Common.ButtonHelpers = ButtonHelpers; })(Common || (Common = {})); //@ sourceMappingURL=ButtonHelpers.js.map // Diagnostics.ts var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; (function (Diagnostics) { var HelperProxy = (function () { function HelperProxy() { this._proxy = Plugin.Utilities.JSONMarshaler.attachToPublishedObject("Microsoft.VisualStudio.WebClient.Diagnostics.PerformanceToolHost.Package.Extensions.DiagnosticsHelper", { }, true); } HelperProxy.prototype.getFileContents = function (filePath) { return this._proxy._call("getFileContents", filePath); }; return HelperProxy; })(); Diagnostics.HelperProxy = HelperProxy; var HubDiagnosticSession = (function () { function HubDiagnosticSession() { this._agentGuid = "B9B36E3F-BC87-440C-901E-7FC364FC5BBB"; this._eventManager = new Plugin.Utilities.EventManager(); this._isAttached = false; this._privatePorts = { }; this._helper = new HelperProxy(); this._standardCollector = Microsoft.VisualStudio.DiagnosticsHub.Collectors.getStandardTransportService(); if(this._standardCollector) { this._standardCollector.addMessageListener(this._agentGuid, this.onMessageReceived.bind(this)); } } HubDiagnosticSession.prototype.addEventListener = function (type, listener) { this._eventManager.addEventListener(type, listener); }; HubDiagnosticSession.prototype.createPort = function (portName) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1028")); }; HubDiagnosticSession.prototype.isAttached = function () { return Plugin.Promise.wrap(this._isAttached); }; HubDiagnosticSession.prototype.loadScriptInProc = function (scriptFileName) { var _this = this; var baseDir = document.location.href.substring(0, document.location.href.lastIndexOf("/")); var filePath = baseDir + "/" + scriptFileName; var fileName = HubDiagnosticSession.getFileName(scriptFileName); this._helper.getFileContents(filePath).done(function (contents) { var obj = { commandName: "loadScriptInProc", fileName: fileName, script: contents }; var message = JSON.stringify(obj); _this.sendMessage(message); }); }; HubDiagnosticSession.prototype.removeEventListener = function (type, listener) { this._eventManager.removeEventListener(type, listener); }; HubDiagnosticSession.prototype.createPortInternal = function (portName) { var _this = this; if(this._privatePorts.hasOwnProperty(portName)) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1029")); } var internalData = { isConnected: false, eventManager: new Plugin.Utilities.EventManager() }; var port = { name: portName, postMessage: function (data) { if(internalData.isConnected) { var obj = { commandName: "message", portName: portName, jsonData: data }; var message = JSON.stringify(obj); _this.sendMessage(message); } else { throw new Error(Plugin.Resources.getErrorString("JSPerf.1030")); } }, addEventListener: internalData.eventManager.addEventListener.bind(internalData.eventManager), removeEventListener: internalData.eventManager.removeEventListener.bind(internalData.eventManager) }; var privatePort = { internalData: internalData, port: port }; this._privatePorts[portName] = privatePort; return privatePort; }; HubDiagnosticSession.prototype.onMessageReceived = function (message) { if(message) { var obj = JSON.parse(message); var args = null; if(obj.eventName) { switch(obj.eventName) { case "attach": this._isAttached = true; this._eventManager.dispatchEvent(obj.eventName); break; case "connect": var connectEvent = obj; if(!connectEvent.portName) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1031")); } var privatePort = this.createPortInternal(connectEvent.portName); privatePort.internalData.isConnected = true; this._eventManager.dispatchEvent(obj.eventName, privatePort.port); break; case "detach": this._isAttached = false; this._eventManager.dispatchEvent(obj.eventName); break; case "message": args = obj; if(!args.portName) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1032")); } var privatePort = this._privatePorts[args.portName]; if(privatePort) { args = { data: args.jsonData }; privatePort.internalData.eventManager.dispatchEvent("message", args); } break; default: this._eventManager.dispatchEvent(obj.eventName); break; } } } }; HubDiagnosticSession.prototype.sendMessage = function (message) { this._standardCollector.sendStringToCollectionAgent(this._agentGuid, message).done(function (response) { if(response) { var obj = JSON.parse(response); if(!obj.succeeded) { throw new Error(obj.errorMessage); } } }); }; HubDiagnosticSession.getFileName = function getFileName(filePath) { var index = filePath.lastIndexOf("/"); if(index == -1) { index = filePath.lastIndexOf("\\"); } if(index > -1) { filePath = filePath.substring(index + 1); } return filePath; }; return HubDiagnosticSession; })(); Diagnostics.HubDiagnosticSession = HubDiagnosticSession; var F12DiagnosticsSession = (function () { function F12DiagnosticsSession(externalObj) { this._externalObj = externalObj; } F12DiagnosticsSession.prototype.addEventListener = function (type, listener) { this._externalObj.addEventListener(type, listener); }; F12DiagnosticsSession.prototype.createPort = function (portName) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1028")); }; F12DiagnosticsSession.prototype.isAttached = function () { return Plugin.Promise.wrap(this._externalObj.isAttached); }; F12DiagnosticsSession.prototype.loadScriptInProc = function (fileName) { this._externalObj.loadScriptInProc(fileName); }; F12DiagnosticsSession.prototype.removeEventListener = function (type, listener) { this._externalObj.removeEventListener(type, listener); }; return F12DiagnosticsSession; })(); Diagnostics.F12DiagnosticsSession = F12DiagnosticsSession; })(MemoryAnalyzer.Diagnostics || (MemoryAnalyzer.Diagnostics = {})); var Diagnostics = MemoryAnalyzer.Diagnostics; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=Diagnostics.js.map // enumHelper.ts var Common; (function (Common) { "use strict"; var Enum = (function () { function Enum() { } Enum.GetName = function GetName(enumType, value) { var result; if(enumType) { for(var enumKey in enumType) { if(enumType.hasOwnProperty(enumKey)) { var enumValue = enumType[enumKey]; if(enumValue === value) { result = enumKey; break; } } } } if(!result) { result = value.toString(); } return result; }; Enum.Parse = function Parse(enumType, name, ignoreCase) { if (typeof ignoreCase === "undefined") { ignoreCase = true; } var result; if(enumType) { if(ignoreCase) { name = name.toLowerCase(); } for(var enumKey in enumType) { if(enumType.hasOwnProperty(enumKey)) { var compareAginst = enumKey.toString(); if(ignoreCase) { compareAginst = compareAginst.toLowerCase(); } if(name === compareAginst) { result = enumType[enumKey]; break; } } } } return result; }; Enum.GetValues = function GetValues(enumType) { var result = []; if(enumType) { for(var enumKey in enumType) { if(enumType.hasOwnProperty(enumKey)) { var enumValue = enumType[enumKey]; if(typeof enumValue === "number") { result.push(enumValue); } } } } return result; }; return Enum; })(); Common.Enum = Enum; })(Common || (Common = {})); //@ sourceMappingURL=enumHelper.js.map // eventHelper.ts var Common; (function (Common) { "use strict"; var Publisher = (function () { function Publisher(events) { this._events = { }; this._listeners = { }; if(events && events.length > 0) { for(var i = 0; i < events.length; i++) { var type = events[i]; if(type) { this._events[type] = type; } } } else { throw Error("Events are null or empty."); } } Publisher.prototype.addEventListener = function (eventType, func) { if(eventType && func) { var type = this._events[eventType]; if(type) { var callbacks = this._listeners[type] ? this._listeners[type] : this._listeners[type] = []; callbacks.push(func); } } }; Publisher.prototype.removeEventListener = function (eventType, func) { if(eventType && func) { var callbacks = this._listeners[eventType]; if(callbacks) { for(var i = 0; i < callbacks.length; i++) { if(func === callbacks[i]) { callbacks.splice(i, 1); break; } } } } }; Publisher.prototype.invokeListener = function (args) { if(args.type) { var callbacks = this._listeners[args.type]; if(callbacks) { for(var i = 0; i < callbacks.length; i++) { var func = callbacks[i]; if(func) { func(args); } } } } }; return Publisher; })(); Common.Publisher = Publisher; })(Common || (Common = {})); //@ sourceMappingURL=eventHelper.js.map // KeyCodes.ts var Common; (function (Common) { "use strict"; var Keys = (function () { function Keys() { } Keys.c = "c"; Keys.DEL = "Del"; Keys.DOWN = "Down"; Keys.END = "End"; Keys.ENTER = "Enter"; Keys.F10 = "F10"; Keys.HOME = "Home"; Keys.LEFT = "Left"; Keys.RIGHT = "Right"; Keys.SPACEBAR = "Spacebar"; Keys.UP = "Up"; return Keys; })(); Common.Keys = Keys; (function (KeyCodes) { KeyCodes._map = []; KeyCodes.BACKSPACE = 8; KeyCodes.TAB = 9; KeyCodes.ENTER = 13; KeyCodes.SHIFT = 16; KeyCodes.CONTROL = 17; KeyCodes.ALT = 18; KeyCodes.CAPS_LOCK = 20; KeyCodes.ESCAPE = 27; KeyCodes.SPACE = 32; KeyCodes.PAGE_UP = 33; KeyCodes.PAGE_DOWN = 34; KeyCodes.END = 35; KeyCodes.HOME = 36; KeyCodes.ARROW_LEFT = 37; KeyCodes.ARROW_FIRST = 37; KeyCodes.ARROW_UP = 38; KeyCodes.ARROW_RIGHT = 39; KeyCodes.ARROW_DOWN = 40; KeyCodes.ARROW_LAST = 40; KeyCodes.INSERT = 45; KeyCodes.DELETE = 46; KeyCodes.A = 65; KeyCodes.B = 66; KeyCodes.C = 67; KeyCodes.D = 68; KeyCodes.E = 69; KeyCodes.F = 70; KeyCodes.G = 71; KeyCodes.H = 72; KeyCodes.I = 73; KeyCodes.J = 74; KeyCodes.K = 75; KeyCodes.L = 76; KeyCodes.M = 77; KeyCodes.N = 78; KeyCodes.O = 79; KeyCodes.P = 80; KeyCodes.Q = 81; KeyCodes.R = 82; KeyCodes.S = 83; KeyCodes.T = 84; KeyCodes.U = 85; KeyCodes.V = 86; KeyCodes.W = 87; KeyCodes.X = 88; KeyCodes.Y = 89; KeyCodes.Z = 90; KeyCodes.CONTEXTMENU = 93; KeyCodes.MULTIPLY = 106; KeyCodes.PLUS = 107; KeyCodes.MINUS = 109; KeyCodes.F1 = 112; KeyCodes.F2 = 113; KeyCodes.F3 = 114; KeyCodes.F4 = 115; KeyCodes.F5 = 116; KeyCodes.F6 = 117; KeyCodes.F7 = 118; KeyCodes.F8 = 119; KeyCodes.F9 = 120; KeyCodes.F10 = 121; KeyCodes.F11 = 122; KeyCodes.F12 = 123; KeyCodes.COMMA = 188; KeyCodes.PERIOD = 190; })(Common.KeyCodes || (Common.KeyCodes = {})); var KeyCodes = Common.KeyCodes; (function (MouseButtons) { MouseButtons._map = []; MouseButtons.LEFT_BUTTON = 0; MouseButtons.MIDDLE_BUTTON = 1; MouseButtons.RIGHT_BUTTON = 2; })(Common.MouseButtons || (Common.MouseButtons = {})); var MouseButtons = Common.MouseButtons; (function (KeyFlags) { KeyFlags._map = []; KeyFlags.KeyFlags_None = 0x0; KeyFlags.KeyFlags_Shift = 0x1; KeyFlags.KeyFlags_Ctrl = 0x2; KeyFlags.KeyFlags_Alt = 0x4; })(Common.KeyFlags || (Common.KeyFlags = {})); var KeyFlags = Common.KeyFlags; function blockBrowserAccelerators() { document.addEventListener("keydown", function (e) { return preventIEKeys(e); }); document.addEventListener("contextmenu", function (e) { e.preventDefault(); e.stopPropagation(); return false; }); window.addEventListener("mousewheel", function (e) { if(e.ctrlKey) { e.preventDefault(); e.stopPropagation(); return false; } }); } Common.blockBrowserAccelerators = blockBrowserAccelerators; function HasAnyOfAltCtrlShiftKeyFlags(e) { return e.shiftKey || e.ctrlKey || e.altKey; } Common.HasAnyOfAltCtrlShiftKeyFlags = HasAnyOfAltCtrlShiftKeyFlags; function preventIEKeys(e) { if(e.keyCode === Common.KeyCodes.F5 || e.keyCode === Common.KeyCodes.F6 || (e.keyCode === Common.KeyCodes.F10 && e.shiftKey) || (e.keyCode === Common.KeyCodes.F && e.ctrlKey)) { e.preventDefault(); e.stopPropagation(); return false; } return true; } Common.preventIEKeys = preventIEKeys; })(Common || (Common = {})); //@ sourceMappingURL=KeyCodes.js.map // Notifications.ts "use strict"; var Notifications = (function () { function Notifications() { } Object.defineProperty(Notifications, "isTestMode", { get: function () { return window["TestMode"]; }, enumerable: true, configurable: true }); Object.defineProperty(Notifications, "notifications", { get: function () { if(!Notifications._notifications) { Notifications._notifications = new Plugin.Utilities.EventManager(); } return Notifications._notifications; }, enumerable: true, configurable: true }); Notifications.subscribe = function subscribe(type, listener) { if(Notifications.isTestMode) { Notifications.notifications.addEventListener(type, listener); } }; Notifications.unsubscribe = function unsubscribe(type, listener) { if(Notifications.isTestMode) { Notifications.notifications.removeEventListener(type, listener); } }; Notifications.subscribeOnce = function subscribeOnce(type, listener) { if(Notifications.isTestMode) { function onNotify() { Notifications.unsubscribe(type, onNotify); listener.apply(this, arguments); } Notifications.subscribe(type, onNotify); } }; Notifications.notify = function notify(type, details) { if(Notifications.isTestMode) { Notifications.notifications.dispatchEvent(type, details); } }; return Notifications; })(); //@ sourceMappingURL=Notifications.js.map // trace.ts var Common; (function (Common) { "use strict"; (function (TraceEvents) { TraceEvents._map = []; TraceEvents.Timeline_Zoom_Start = 0x65; TraceEvents.Timeline_Zoom_Stop = 0x66; TraceEvents.Timeline_GridSort_Start = 0x67; TraceEvents.Timeline_GridSort_Stop = 0x68; TraceEvents.Timeline_LoadGraphs_Start = 0x69; TraceEvents.Timeline_LoadGraphs_Stop = 0x6a; TraceEvents.Timeline_GridScrolled = 0x6b; TraceEvents.Timeline_GridUpdatedForTimeSelection = 0x6c; TraceEvents.Timeline_UserSelectedTimeSlice_Start = 0x6d; TraceEvents.Timeline_UserSelectedTimeSlice_Stop = 0x6e; TraceEvents.Memory_TakeSnapshot_Start = 0xc9; TraceEvents.Memory_TakeSnapshot_Stop = 0xca; TraceEvents.Memory_CompareSnapshot_Start = 0xcb; TraceEvents.Memory_CompareSnapshot_Stop = 0xcc; TraceEvents.Memory_ViewSnapshot_Start = 0xcd; TraceEvents.Memory_ViewSnapshot_Stop = 0xce; TraceEvents.Memory_GridSort_Start = 0xcf; TraceEvents.Memory_GridSort_Stop = 0xd0; TraceEvents.Memory_DisplayFirstLevelSnapshotData_Start = 0xd1; TraceEvents.Memory_DisplayFirstLevelSnapshotData_Stop = 0xd2; TraceEvents.Memory_ToolReady_Start = 0xd3; TraceEvents.Memory_ToolReady_Stop = 0xd4; TraceEvents.Memory_GridFilterUIResponse_Start = 0xd5; TraceEvents.Memory_GridFilterUIResponse_Stop = 0xd6; })(Common.TraceEvents || (Common.TraceEvents = {})); var TraceEvents = Common.TraceEvents; var DefaultTraceWriter = (function () { function DefaultTraceWriter() { } DefaultTraceWriter.prototype.raiseEvent = function (eventId) { }; DefaultTraceWriter.prototype.raiseEventWithMessage = function (eventId, traceMessage) { }; return DefaultTraceWriter; })(); Common.DefaultTraceWriter = DefaultTraceWriter; var TraceWriter = (function () { function TraceWriter(performanceTracer) { this._performanceTracer = performanceTracer; } TraceWriter.prototype.raiseEventWithMessage = function (eventId, traceMessage) { this._performanceTracer.raiseEvent(eventId, traceMessage); }; TraceWriter.prototype.raiseEvent = function (eventId) { this.raiseEventWithMessage(eventId, ""); }; return TraceWriter; })(); Common.TraceWriter = TraceWriter; })(Common || (Common = {})); //@ sourceMappingURL=trace.js.map // utilities.ts var Common; (function (Common) { "use strict"; var Utilities = (function () { function Utilities() { } Utilities.HtmlEncodeDiv = document.createElement("div"); Utilities.htmlEncode = function htmlEncode(value) { Utilities.HtmlEncodeDiv.innerText = value; return Utilities.HtmlEncodeDiv.innerHTML; }; return Utilities; })(); Common.Utilities = Utilities; })(Common || (Common = {})); //@ sourceMappingURL=utilities.js.map // EtwDataCollector.ts var Common; (function (Common) { (function (Data) { "use strict"; var F12EtwDataCollector = (function () { function F12EtwDataCollector(dataCollectorProxy) { this._proxy = dataCollectorProxy; if(!this._proxy) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1055")); } } F12EtwDataCollector.prototype.startSession = function (agentFile, agentGuid) { var _this = this; return new Plugin.Promise(function (completed, error) { _this._proxy.startSession(agentFile, agentGuid, function (sessionProxy) { completed(new F12EtwDataCollectorSession(sessionProxy)); }, function (hr) { if(error) { error(new Error(hr.toString())); } }); }); }; return F12EtwDataCollector; })(); Data.F12EtwDataCollector = F12EtwDataCollector; var F12EtwDataCollectorSession = (function () { function F12EtwDataCollectorSession(sessionProxy) { this._proxy = sessionProxy; } F12EtwDataCollectorSession.prototype.stop = function () { var _this = this; return new Plugin.Promise(function (completed, error) { _this._proxy.stop(function (file) { completed(file); }, function (hr) { if(error) { error(new Error("Error: " + hr)); } }); }); }; F12EtwDataCollectorSession.prototype.getGraphDataUpdate = function (counterId) { var _this = this; return new Plugin.Promise(function (completed, error) { _this._proxy.getGraphDataUpdate(counterId, function (points) { completed(points); }, function (hr) { if(error) { error(new Error("Error: " + hr)); } }); }); }; return F12EtwDataCollectorSession; })(); Data.F12EtwDataCollectorSession = F12EtwDataCollectorSession; })(Common.Data || (Common.Data = {})); var Data = Common.Data; })(Common || (Common = {})); //@ sourceMappingURL=EtwDataCollector.js.map // Constants.ts var Common; (function (Common) { "use strict"; var Constants = (function () { function Constants() { } Object.defineProperty(Constants, "minimumRequiredDocumentMode", { get: function () { return 10; }, enumerable: true, configurable: true }); return Constants; })(); Common.Constants = Constants; })(Common || (Common = {})); //@ sourceMappingURL=Constants.js.map /* CSS file for the plugin's base styles and themes (light / dark / high contrast) Light theme values are used as defaults but token replacement occurs to provide the correct property for the active theme. Tokens must appear as comments on the same line as the property to replace and are in the following format: [] - indicates token replacement will occur for this css declaration {} - indicates the token value to replace. Anything inside the square brackets ([]) that is not a token will remain as is Example: border-right: 1px solid #8591A2; /*[1px solid {plugin-background-color}] Base plugin tokens available to all hosts: plugin-background-color plugin-color plugin-contextmenu-active-color plugin-contextmenu-background-color plugin-contextmenu-border-color plugin-contextmenu-color plugin-contextmenu-hover-color plugin-contextmenu-hover-text-color plugin-contextmenu-icon-checkbox plugin-contextmenu-inactive-text-color plugin-contextmenu-separator-color plugin-font-family plugin-font-size plugin-font-weight plugin-highlight-background-color plugin-highlight-color plugin-inactive-color plugin-link-color plugin-link-active-color plugin-link-hover-color plugin-scrollbar-arrow-color plugin-scrollbar-background-color plugin-scrollbar-face-color plugin-select-option-background-color plugin-select-option-color plugin-select-option-checked-background-color plugin-select-option-checked-border-color plugin-select-option-checked-foreground-color plugin-select-option-hover-background-color plugin-select-option-hover-border-color plugin-select-option-hover-foreground-color plugin-select-border-color plugin-select-background-color plugin-select-foreground-color plugin-select-hover-background-color plugin-select-hover-border-color plugin-select-hover-foreground-color plugin-table-border-color plugin-table-header-background-color plugin-table-header-color plugin-textbox-border-color plugin-textbox-background-color plugin-textbox-color plugin-textbox-disabled-background-color plugin-textbox-disabled-border-color plugin-textbox-disabled-color plugin-treeview-content-background-color plugin-treeview-content-color plugin-treeview-content-inactive-selected-color plugin-treeview-content-mouseover-background-color plugin-treeview-content-mouseover-color plugin-treeview-content-inactive-selected-color plugin-treeview-content-selected-background-color plugin-treeview-content-selected-border-color plugin-treeview-content-selected-color VS host also has access to all VS themed color key tokens (EnvironmentColors) and category specific tokens. http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.platformui.environmentcolors_properties Please see product documentation for instructions on how to add these tokens to the plugin manifest. */ /* HTML and body styles */ html, body { font-family: "Segoe UI", Arial, sans-serif; /*[{plugin-font-family, Arial, sans-serif}]*/ font-size: 9pt; /*[{plugin-font-size}]*/ font-weight: normal; /*[{plugin-font-weight}]*/ color: #1E1E1E; /*[{plugin-color}]*/ background-color: #F6F6F6; /*[{plugin-background-color}]*/ scrollbar-3dlight-color: #E8E8EC; /*[{plugin-scrollbar-background-color}]*/ scrollbar-darkshadow-color: #E8E8EC; /*[{plugin-scrollbar-background-color}]*/ scrollbar-highlight-color: #E8E8EC; /*[{plugin-scrollbar-background-color}]*/ scrollbar-shadow-color: #E8E8EC; /*[{plugin-scrollbar-background-color}]*/ scrollbar-track-color: #E8E8EC; /*[{plugin-scrollbar-background-color}]*/ scrollbar-arrow-color: #868999; /*[{plugin-scrollbar-arrow-color}]*/ scrollbar-face-color: #D0D1D7; /*[{plugin-scrollbar-face-color}]*/ } /* Select styles */ select { color: #1E1E1E; /*[{plugin-select-foreground-color}]*/ background-color: #FFFFFF; /*[{plugin-select-background-color}]*/ font: normal 9pt "Segoe UI", Arial, sans-serif; /*[{plugin-font-weight} {plugin-font-size} {plugin-font-family}, Arial, sans-serif]*/ border: 1px solid #CCCEDB; /*[1px solid {plugin-select-border-color}]*/ } select:hover { color: #1E1E1E; /*[{plugin-select-hover-foreground-color}]*/ background-color: #FFFFFF; /*[{plugin-select-hover-background-color}]*/ border: 1px solid #007ACC; /*[1px solid {plugin-select-hover-border-color}]*/ } select[multiple], select option { color: #1E1E1E; /*[{plugin-select-option-color}]*/ background-color: #F6F6F6; /*[{plugin-select-option-background-color}]*/ } select option:hover { color: #1E1E1E; /*[{plugin-select-option-hover-foreground-color}]*/ background-color: #C9DEF5; /*[{plugin-select-option-hover-background-color}]*/ border: 1px solid #C9DEF5; /*[1px solid {plugin-select-option-hover-border-color}]*/ } select option:checked { color: #1E1E1E; /*[{plugin-select-option-checked-foreground-color}]*/ background-color: #C9DEF5; /*[{plugin-select-option-checked-background-color}]*/ border: 1px solid #C9DEF5; /*[1px solid {plugin-select-option-checked-border-color}]*/ } /* Input styles */ input { font: normal 9pt "Segoe UI", Arial, sans-serif; /*[{plugin-font-weight} {plugin-font-size} {plugin-font-family}, Arial, sans-serif]*/ color: #1E1E1E; /*[{plugin-textbox-color}]*/ background-color: #FFFFFF; /*[{plugin-textbox-background-color}]*/ border: 1px solid #DBDDE6; /*[1px solid {plugin-textbox-border-color}]*/ padding: 0 3px; } input:disabled { color: #A2A4A5; /*[{plugin-textbox-disabled-color}]*/ background-color: #FFFFFF; /*[{plugin-textbox-disabled-background-color}]*/ border: 1px solid #DBDDE6; /*[1px solid {plugin-textbox-disabled-border-color}]*/ } input[type="checkbox"], input[type="radio"] { border: none; background-color: inherit; margin-right: 4px; vertical-align: middle; } input[type="file"], input[type="image"] { border: none; background-color: inherit; padding: 0; } /* TextArea styles */ textarea { font-family: "Segoe UI", Arial, sans-serif; /*[{plugin-font-family}, Arial, sans-serif]*/ font-size: 9pt; /*[{plugin-font-size}]*/ font-weight: normal; /*[{plugin-font-weight}]*/ color: #1E1E1E; /*[{plugin-color}]*/ background-color: #F6F6F6; /*[{plugin-textbox-background-color}]*/ border: 1px solid #DBDDE6; /*[1px solid {plugin-textbox-border-color}]*/ padding: 0 3px; } /* Button styles */ button, input[type="button"], input[type="reset"], input[type="submit"] { color: #000000; background-image: -ms-linear-gradient(top, #F0F0F0 0%, #E5E5E5 100%); border: 1px solid #ACACAC; font-family: "Segoe UI", Arial, sans-serif; /*[{plugin-font-family}, Arial, sans-serif]*/ font-size: 9pt; /*[{plugin-font-size}]*/ font-weight: normal; /*[{plugin-font-weight}]*/ min-width: 73px; padding: 1px 19px 2px 19px; } button:hover, input[type="button"]:hover, input[type="reset"]:hover, input[type="submit"]:hover { background-image: -ms-linear-gradient(top, #ECF4FC 0%, #DCECFC 100%); border: 1px solid #7EB4EA; } button:focus, input[type="button"]:focus, input[type="reset"]:focus, input[type="submit"]:focus { border: 1px solid #569DE5; } button:active, input[type="button"]:active, input[type="reset"]:active, input[type="submit"]:active { background-image: -ms-linear-gradient(top, #DAECFC 0%, #C4E0FC 100%); border: 1px solid #569DE5; } button[disabled], input[type="button"][disabled], input[type="reset"][disabled], input[type="submit"][disabled] { color: #838383; background: #F4F4F4 none; border: 1px solid #B1B1B2; } /* Other form styles */ fieldset { border: 1px solid #DBDDE6; /*[1px solid {plugin-textbox-border-color}]*/ } /* Link styles */ a, a:link, a:visited, a:focus { color: #0E70C0; /*[{plugin-link-color}]*/ text-decoration: none; } a:hover { color: #0E70C0; /*[{plugin-link-hover-color}]*/ text-decoration: underline; } a:active { color: #0E70C0; /*[{plugin-link-active-color}]*/ } /* Table styles */ th { color: #1E1E1E; /*[{plugin-table-header-color}]*/ background-color: #EFEFE2; /*[{plugin-table-header-background-color}]*/ } td, th { border-color: #F0F0F0; /*[{plugin-table-border-color}]*/ } /* Disabled styles */ :disabled { color: #A2A4A5; /*[{plugin-inactive-color}]*/ } /* Highlight styles Use this class when you have a highlighted item, for example a highlighted row in a grid */ .plugin-highlight { color: #FFFFFF; /*[{plugin-highlight-color}]*/ background-color: #3399FF; /*[{plugin-highlight-background-color}]*/ } /* Tooltip styles This class will be included automatically on all tooltips In VS tooltips aren't, by default, themed, so we just copy the WPF tooltip defaults, which is what VS uses for its tooltips. We set its initial display style to none and its initial position to (-500,-500) just to ensure that when we insert it into the document (for measuring) it isn't visible until we have done the layout and calculated its final position. */ #plugin-vs-tooltip { display: none; position: absolute; top: -500px; left: -500px; color: #575757; background-color: #F1F2F7; border: thin solid #767676; padding: 1px 5px 4px 5px; line-height: normal; } #plugin-vs-tooltip > #plugin-vs-tooltip-nested-cell { display: table-cell; vertical-align: middle; color: #575757; background-color: #F1F2F7; } #plugin-vs-tooltip > #plugin-vs-tooltip-nested-cell > #plugin-vs-tooltip-content { color: #575757; background-color: #F1F2F7; } /* Selection styles */ .selectNone { -ms-user-select: none; } .selectElement { -ms-user-select: element; } /* Context Menu styles */ ul.plugin-contextmenu { background-color: #e9e8ea; /*[{plugin-contextmenu-background-color}]*/ border: thin solid #cdd0d6; /*[thin solid {plugin-contextmenu-border-color}]*/ color: #1E1E1E; /*[{plugin-contextmenu-color}]*/ padding: 1px 2px 2px 2px; margin: 0; position: absolute; display: none; outline: none; z-index: 100; white-space: nowrap; -ms-high-contrast-adjust: none; line-height: normal; } .plugin-contextmenu .menuitem { position: relative; cursor: default; outline: none; list-style: none; margin-top: 1px; } .plugin-contextmenu .menuitem:focus { background-color: #f9f9fa; /*[{plugin-contextmenu-hover-color}]*/ color: #1E1E1E; /*[{plugin-contextmenu-hover-text-color}]*/ } .plugin-contextmenu .menuitem:active, .plugin-contextmenu .active { background-color: #f9f9fa; /*[{plugin-contextmenu-active-color}]*/ color: #1E1E1E; /*[{plugin-contextmenu-hover-text-color}]*/ } .plugin-contextmenu .disabled:hover, .plugin-contextmenu .disabled:active, .plugin-contextmenu .disabled:focus, .plugin-contextmenu .disabled { background-color: #e9e8ea; /*[{plugin-contextmenu-background-color}]*/ color: #a2a4a5; /*[{plugin-contextmenu-inactive-text-color}]*/ } .plugin-contextmenu .menuitem .icon { margin: 0 10px 0 6px; background-color: transparent; width: 16px; height: 16px; position: absolute; top: 4px; left: 0; } .plugin-contextmenu .menuitem .checkbox { background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/PbtGwMpgAWIfXx8iFS9ZcsWJgYSAQuctW7tejzqgoIDIQx8Nrx69QqobvKUyciC+DSsXLUSSIaHhROlAWj8/v37HB2dxMTEiNKA1Xh0DR2dHUBHvwIDrMajhBIQJCUmnTp1EmI2VuPRNQDNA5oKNBvIxmo8Fj/ATcVqPLoNEEvwxyALZlziBySnJUZSkzdAgAEAfm84vuieuk0AAAAASUVORK5CYII=); /*[url({plugin-contextmenu-icon-checkbox})]*/ } .plugin-contextmenu .hidden { display: none; } .plugin-contextmenu .disabled { color: #a2a4a5; /*[{plugin-contextmenu-inactive-text-color}]*/ } .plugin-contextmenu .menuitem .main { margin-left: 32px; padding: 4px 0 5px 0; } .plugin-contextmenu .menuitem .shortcut { min-width: 25px; position: absolute; padding-right: 25px; top: 4px; right: 0; } .plugin-contextmenu .menuitem .arrow { width: 5px; height: 7px; position: absolute; top: 4px; right: 8px; overflow: visible; } .plugin-contextmenu .menuitem .arrow:before, .plugin-contextmenu .menuitem.disabled:hover .arrow:before, .plugin-contextmenu .menuitem.disabled:active .arrow:before, .plugin-contextmenu .menuitem.disabled:focus .arrow:before, .plugin-contextmenu .menuitem.disabled .arrow:before { content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAHCAYAAADAp4fuAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFZJREFUeNpiWL5i5X8gYEDGTKdOnmCYOXP2fwYkwAQibt68ztDXP+E/iiAIPHn8iGHChIn/UQSFhIQZCgryGUFsFhAhIyvHUFRYwAg3dMaMWRi2AwQYAAcRMJwq3CX+AAAAAElFTkSuQmCC); } .plugin-contextmenu .menuitem:hover .arrow:before, .plugin-contextmenu .menuitem:active .arrow:before, .plugin-contextmenu .menuitem:focus .arrow:before, .plugin-contextmenu .active .arrow:before { content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAHCAYAAADAp4fuAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFRJREFUeNpiKNzy6D8QMCBjBoaqM/+DltxGkWACCjOsu/aRwXrmDZASMGCCMY49+spgP/vmfxRBdRF2hoOp6oxwQSs5boYbhTqMMAUM6JaAMECAAQDqqjmrw1gHVwAAAABJRU5ErkJggg==); } .plugin-contextmenu .menuitem .hr, .plugin-contextmenu .menuitem:hover .hr, .plugin-contextmenu .menuitem:active .hr, .plugin-contextmenu .menuitem:focus .hr, .plugin-contextmenu .active .hr { height: 1px; background-color: #cdd0d6; /*[{plugin-contextmenu-separator-color}]*/ padding: 0; } (function () { var cookie, pluginUrl = window.external.pluginUrl || (cookie = document.cookie.match(/(?:^|;)\s?pluginUrl=(.*?)(?:;|$)/)) && unescape(cookie[1]) || "plugin.b.js", scripts = document.getElementsByTagName('script'); if (scripts && pluginUrl) { for (var i = 0; i < scripts.length; i++) { var script = scripts[i]; var src = script.src; if (/(^|\\|\/)plugin.js$/.test(src)) { var newScript = document.createElement("script"); newScript.src = pluginUrl; script.parentElement.insertBefore(newScript, script.nextSibling); break; } } } })(); var expectedWindowProperty; var Common; (function (Common) { "use strict"; var __BROWSERTOOLS_RemoteHelper = (function () { function __BROWSERTOOLS_RemoteHelper(messageHandlers) { this._messageHandlers = []; this._pendingMessages = []; this._pendingMessagesMap = { }; this._pendingTimeout = null; this._portId = 0; this._uid = 0; this.childrenElementLimit = 200; this.initializeDocumentMaxTries = 15; this.initializeDocumentTries = 0; this.isEvalModified = false; this.isExecScriptModified = false; this.onDetachCallback = null; this.port = null; this.portReady = false; this._messageHandlers = messageHandlers; } Object.defineProperty(__BROWSERTOOLS_RemoteHelper.prototype, "errorHandler", { get: function () { return this._errorHandler; }, enumerable: true, configurable: true }); Object.defineProperty(__BROWSERTOOLS_RemoteHelper.prototype, "useTimeout", { get: function () { return toolUI.getBreakFlags() === 0; }, enumerable: true, configurable: true }); __BROWSERTOOLS_RemoteHelper.prototype.getUid = function () { return "uid" + (this._uid++).toString(36); }; __BROWSERTOOLS_RemoteHelper.prototype.initialize = function (portName, handshakeCallback, onDetachCallback) { this._errorHandler = new __BROWSERTOOLS_ErrorHandler(this); this.onDetachCallback = onDetachCallback; browser.addEventListener("documentComplete", this.onDocumentComplete.bind(this)); toolUI.addEventListener("detach", this.onDetach.bind(this)); toolUI.addEventListener("breakpointhit", this.onBreak.bind(this)); ++this._portId; this.port = toolUI.createPort(portName + this._portId); if(this.port) { this.port.addEventListener("message", this.processMessages.bind(this)); toolUI.connect(this.port); handshakeCallback(); } this._handshakeCallback = handshakeCallback; }; __BROWSERTOOLS_RemoteHelper.prototype.initializeScriptEngines = function (window) { if(window) { if(window.document && window.document.scripts && window.document.scripts.length === 0) { browser.executeScript("void(0);", window); } if(window.frames) { for(var i = 0; i < window.frames.length; i++) { var frame = window.frames[i]; if(frame) { var iframe = dom.getCrossSiteWindow(window, frame); this.initializeScriptEngines(iframe); } } } } }; __BROWSERTOOLS_RemoteHelper.prototype.postAllMessages = function () { for(var key in this._pendingMessagesMap) { this._pendingMessages.push(this._pendingMessagesMap[key]); } if(this._pendingMessages.length > 0) { var messageString = JSON.stringify(this._pendingMessages); this._pendingMessages = []; this._pendingMessagesMap = { }; this._pendingTimeout = null; try { this.port.postMessage(messageString); } catch (ex) { return; } } }; __BROWSERTOOLS_RemoteHelper.prototype.processMessages = function (args) { var _this = this; if(args.data === "InitializeDocument") { this._handshakeCallback(); return; } var createVSPostFunction = function (uid) { return function (arg, hash) { _this.postObject({ uid: uid, args: [ arg ] }, hash); }; }; var payload = JSON.parse(args.data); for(var i = 0; i < payload.length; ++i) { var obj = payload[i]; if(this._messageHandlers[obj.command]) { var args = obj.args; for(var j = 0; j < args.length; ++j) { if(args[j] && args[j].type === "callback") { args[j] = createVSPostFunction(args[j].uid); } } var returnValue = this._messageHandlers[obj.command].apply(this, args); this.postObject({ uid: obj.uid, args: (returnValue !== undefined ? [ returnValue ] : undefined) }); } } }; __BROWSERTOOLS_RemoteHelper.prototype.onBreak = function () { this.postAllMessages(); }; __BROWSERTOOLS_RemoteHelper.prototype.onDetach = function () { this._uid = 0; this._pendingMessages = []; this._pendingMessagesMap = { }; this._pendingTimeout = null; this.isEvalModified = false; this.isExecScriptModified = false; if(this.onDetachCallback) { this.onDetachCallback(); } }; __BROWSERTOOLS_RemoteHelper.prototype.onDocumentComplete = function (dispatchWindow) { if(expectedWindowProperty) { var doc = null; if(dispatchWindow) { if(dispatchWindow.browserOrWindow) { dispatchWindow = dispatchWindow.browserOrWindow; } if(dispatchWindow.document) { doc = dispatchWindow.document; } else if(dispatchWindow.Document) { doc = dispatchWindow.Document; } if(!doc || doc.parentWindow[expectedWindowProperty]) { return; } try { browser.executeScript("void(0);", doc.parentWindow); } catch (ex) { } } } }; __BROWSERTOOLS_RemoteHelper.prototype.postObject = function (obj, hash, postImmediately) { if (typeof postImmediately === "undefined") { postImmediately = true; } if(hash) { this._pendingMessagesMap[hash] = obj; } else { this._pendingMessages.push(obj); } if(this.useTimeout && typeof postImmediately !== "undefined" && !postImmediately) { if(!this._pendingTimeout) { browser.document.parentWindow.setTimeout(this.postAllMessages.bind(this), 50); } } else { this.postAllMessages(); } }; return __BROWSERTOOLS_RemoteHelper; })(); Common.__BROWSERTOOLS_RemoteHelper = __BROWSERTOOLS_RemoteHelper; var __BROWSERTOOLS_ErrorHandler = (function () { function __BROWSERTOOLS_ErrorHandler(remoteHelper) { this._remoteHelper = remoteHelper; this.initializeListeners(); } __BROWSERTOOLS_ErrorHandler.prototype.initializeListeners = function () { var _this = this; this._onErrorHandler = this.onError.bind(this); toolUI.addEventListener("scripterror", this._onErrorHandler); toolUI.addEventListener("detach", function () { toolUI.removeEventListener("scripterror", _this._onErrorHandler); }); if(browser && browser.document && browser.document.parentWindow) { this._remoteHelper.initializeScriptEngines(browser.document.parentWindow); } }; __BROWSERTOOLS_ErrorHandler.prototype.onError = function (message, file, line) { if(this._remoteHelper && this._remoteHelper.port) { var maxStackSize = 10; var callstack = []; try { var currentFunction = arguments.callee; var functionText, functionName, match, args, stringifiedArgs; while(currentFunction && callstack.length < maxStackSize) { functionName = "unknown"; stringifiedArgs = []; try { functionText = currentFunction.toString() || ""; match = functionText.match(/function\s*([\w\-$]+)?\s*\(/i); functionName = (match.length >= 2 ? match[1] || "anonymous" : "anonymous"); if(currentFunction["arguments"]) { args = currentFunction["arguments"]; for(var i = 0; i < args.length; i++) { stringifiedArgs.push(__BROWSERTOOLS_ErrorHandler.getArgumentString(args[i])); } } } catch (ex) { } callstack.push(functionName + " (" + stringifiedArgs.join(", ") + ")"); currentFunction = currentFunction["caller"]; } } catch (ex) { } var info = []; try { info.push("Callstack:\r\n" + callstack.join("\r\n")); info.push("BreakFlags: " + toolUI.getBreakFlags()); info.push("TicksSinceLastRefresh: " + toolUI.getTicksSinceLastRefresh()); info.push("IsEvalModified: " + this._remoteHelper.isEvalModified); info.push("IsExecScriptModified: " + this._remoteHelper.isExecScriptModified); info.push("Url: " + browser.document.parentWindow.location.href); } catch (ex) { } var errorObject = [ { uid: "scriptError", args: [ { message: message, file: file, line: line, additionalInfo: info.join("\r\n\r\n") } ] } ]; var messageString = JSON.stringify(errorObject); try { this._remoteHelper.port.postMessage(messageString); } catch (ex) { return; } return true; } return false; }; __BROWSERTOOLS_ErrorHandler.getArgumentString = function getArgumentString(argument) { var type = (typeof argument); if(argument === undefined) { type = "undefined"; } else { if(type === "object") { if(argument) { if(typeof argument.length === "number" && typeof argument.propertyIsEnumerable === "function" && !(argument.propertyIsEnumerable("length")) && typeof argument.splice === "function") { type = "array"; } try { if(argument.constructor === Array) { type = "array"; } else if(argument.constructor === Date) { type = "date"; } else if(argument.constructor === RegExp) { type = "regex"; } } catch (ex) { } } else { type = "null"; } type = "object"; } } switch(type) { case "boolean": return argument; case "date": return "[date] " + argument; case "function": return "" + argument; case "null": return "null"; case "number": return argument; case "regex": return "[regex] " + argument; case "string": return "\"" + argument + "\""; case "undefined": return "undefined"; case "htmlElement": case "array": case "object": return JSON.stringify(argument); } }; return __BROWSERTOOLS_ErrorHandler; })(); Common.__BROWSERTOOLS_ErrorHandler = __BROWSERTOOLS_ErrorHandler; })(Common || (Common = {})); //@ sourceMappingURL=RemoteHelpers.js.map { "start_url": "memoryAnalyzer.html", "domain": "http://microsoft.com", "name":"JavaScript Memory Analyzer", "version":"1.1", "f12": { "localized_tab_resource": "F12ToolTitle", "localized_tooltip_id": 2158, "tab_image": "tabIcon.png", "resource_aliases" : { "MemoryAnalyzer": { "is_default" : true } }, "themed_images": { "f12-image-host-error-alert": { "bitmap_source": "..\\..\\pluginhost\\theme\\i_alerterror.png", "background_color": "plugin-font-editor-background-color" }, "f12-image-host-error-close": { "bitmap_source": "..\\..\\pluginhost\\theme\\closeErrorBox.png", "background_color": "plugin-font-editor-background-color" }, "f12-image-host-error-help": { "bitmap_source": "..\\..\\pluginhost\\theme\\helpErrorBox.png", "background_color": "plugin-font-editor-background-color" }, "f12-image-toolbar-snapshot": { "bitmap_source": "images\\i_snapshot.png", "background_color": "plugin-background-color" }, "f12-image-toolbar-start": { "bitmap_source": "..\\Common\\images\\i_start.png", "background_color": "plugin-background-color" }, "f12-image-toolbar-stop": { "bitmap_source": "..\\Common\\images\\i_stop.png", "background_color": "plugin-background-color" }, "image-checkmark": { "bitmap_source": "images\\checkmark.png", "background_color": "plugin-memory-drop-down-button" }, "image-detached-dom-node-warning": { "bitmap_source": "images\\i_info.png", "background_color": "plugin-background-color" }, "image-heap-decrease": { "bitmap_source": "images\\status_heap_decrease.png", "background_color": "plugin-background-color" }, "image-heap-increase": { "bitmap_source": "images\\status_heap_increase.png", "background_color": "plugin-background-color" }, "image-settings": { "bitmap_source": "images\\i_table_options.png", "background_color": "plugin-background-color" }, "image-snapshot": { "bitmap_source": "images\\takeSnapshot.png", "background_color": "plugin-background-color" }, "image-sort-down": { "bitmap_source": "..\\Common\\images\\i_sort_down.png", "background_color": "plugin-background-color" }, "image-sort-up": { "bitmap_source": "..\\Common\\images\\i_sort_up.png", "background_color": "plugin-background-color" }, "image-warning": { "bitmap_source": "..\\Common\\images\\i_warning.png", "background_color": "plugin-background-color" }, "vs-image-graph-user-mark": { "bitmap_source": "..\\Common\\images\\i_usermark.png", "background_color": "plugin-background-color" }, "vs-image-icon-tree-expanded": { "bitmap_source": "..\\Common\\images\\itemExpandedIcon.png", "background_color": "plugin-background-color" }, "vs-image-icon-tree-collapsed": { "bitmap_source": "..\\Common\\images\\itemCollapsedIcon.png", "background_color": "plugin-background-color" } } }, "file_aliases": { "MemoryAnalyzerExtension": { "path": "MemoryAnalyzer.dll" }, "PerformanceTraceExtension": { "path": "PerformanceTrace.dll", "optional": true } }, "vs": { "architecture": "x86", "resource_aliases": { "MemoryAnalyzer": { "path": "Resources\\Resources", "is_default": true } }, "guid_symbols": { "GuidPerfToolHostCmdSet": "5D4B80C3-23AB-4391-9F90-794C201831CE", "GuidPerfToolGridContextMenu": "DB731D4D-421B-4944-9695-28538DD8A563" }, "command_aliases": { "takesnapshotcommand": { "guid": "GuidPerfToolHostCmdSet", "id": 264, "focus": false }, "showinrootsviewcommand": { "guid": "GuidPerfToolHostCmdSet", "id": 256, "focus": true } }, "menu_aliases": { "gridcontextmenu": { "guid": "GuidPerfToolGridContextMenu", "id": 257 } }, "theme_token_aliases": { "diagnostics-host-border": { "category": "f8a8b2a5-dd35-43f6-a382-fd6a61325c22", "key_type": "BackgroundColor", "name": "Border" }, "diagnostics-host-graph-cursor": { "category": "f8a8b2a5-dd35-43f6-a382-fd6a61325c22", "key_type": "BackgroundColor", "name": "GraphCursor" }, "diagnostics-host-graph-line": { "category": "f8a8b2a5-dd35-43f6-a382-fd6a61325c22", "key_type": "BackgroundColor", "name": "GraphLine" }, "diagnostics-host-graph-scale": { "category": "f8a8b2a5-dd35-43f6-a382-fd6a61325c22", "key_type": "BackgroundColor", "name": "GraphScale" }, "diagnostics-host-ruler-slider": { "category": "f8a8b2a5-dd35-43f6-a382-fd6a61325c22", "key_type": "BackgroundColor", "name": "RulerSlider" }, "diagnostics-host-ruler-slider-active": { "category": "f8a8b2a5-dd35-43f6-a382-fd6a61325c22", "key_type": "BackgroundColor", "name": "RulerSliderActive" }, "diagnostics-host-ruler-tickmark": { "category": "f8a8b2a5-dd35-43f6-a382-fd6a61325c22", "key_type": "BackgroundColor", "name": "RulerTickmark" }, "diagnostics-host-swimlane-border": { "category": "f8a8b2a5-dd35-43f6-a382-fd6a61325c22", "key_type": "BackgroundColor", "name": "SwimlaneBorder" }, "plugin-memory-drop-down-button": { "category": "A5441C8F-ED08-40E1-AB04-BA3281D84770", "key_type": "BackgroundColor", "name": "DropDownButton" }, "plugin-memory-drop-down-button-focus": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "CommandBarMouseDownBackgroundMiddle" }, "plugin-memory-drop-down-button-focus-border": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "CommandBarMouseDownBorder" }, "plugin-memory-drop-down-button-hover": { "category": "A5441C8F-ED08-40E1-AB04-BA3281D84770", "key_type": "BackgroundColor", "name": "DropDownButtonHover" }, "plugin-memory-snapshot-button": { "category": "A5441C8F-ED08-40E1-AB04-BA3281D84770", "key_type": "BackgroundColor", "name": "SnapshotButton" }, "plugin-memory-snapshot-button-active": { "category": "A5441C8F-ED08-40E1-AB04-BA3281D84770", "key_type": "BackgroundColor", "name": "SnapshotButtonActive" }, "plugin-memory-snapshot-button-active-text": { "category": "A5441C8F-ED08-40E1-AB04-BA3281D84770", "key_type": "ForegroundColor", "name": "SnapshotButtonActive" }, "plugin-memory-snapshot-button-border": { "category": "A5441C8F-ED08-40E1-AB04-BA3281D84770", "key_type": "BackgroundColor", "name": "SnapshotButtonBorder" }, "plugin-memory-snapshot-button-border-active": { "category": "A5441C8F-ED08-40E1-AB04-BA3281D84770", "key_type": "BackgroundColor", "name": "SnapshotButtonBorderActive" }, "plugin-memory-snapshot-button-border-hover": { "category": "A5441C8F-ED08-40E1-AB04-BA3281D84770", "key_type": "BackgroundColor", "name": "SnapshotButtonBorderHover" }, "plugin-memory-snapshot-button-disabled": { "category": "A5441C8F-ED08-40E1-AB04-BA3281D84770", "key_type": "BackgroundColor", "name": "SnapshotButtonDisabled" }, "plugin-memory-snapshot-button-disabled-text": { "category": "A5441C8F-ED08-40E1-AB04-BA3281D84770", "key_type": "ForegroundColor", "name": "SnapshotButtonDisabledText" }, "plugin-memory-snapshot-button-hover": { "category": "A5441C8F-ED08-40E1-AB04-BA3281D84770", "key_type": "BackgroundColor", "name": "SnapshotButtonHover" }, "plugin-memory-snapshot-button-hover-text": { "category": "A5441C8F-ED08-40E1-AB04-BA3281D84770", "key_type": "ForegroundColor", "name": "SnapshotButtonHover" }, "plugin-memory-snapshot-diff-added-text": { "category": "A5441C8F-ED08-40E1-AB04-BA3281D84770", "key_type": "ForegroundColor", "name": "SnapshotDiffAddedText" }, "plugin-memory-snapshot-diff-modified-text": { "category": "A5441C8F-ED08-40E1-AB04-BA3281D84770", "key_type": "ForegroundColor", "name": "SnapshotDiffModifiedText" }, "plugin-memory-snapshot-messages-border": { "category": "A5441C8F-ED08-40E1-AB04-BA3281D84770", "key_type": "BackgroundColor", "name": "SnapshotMessagesBorder" }, "plugin-memory-snapshot-tile": { "category": "A5441C8F-ED08-40E1-AB04-BA3281D84770", "key_type": "BackgroundColor", "name": "SnapshotTile" }, "plugin-memory-snapshot-tile-baseline-text": { "category": "A5441C8F-ED08-40E1-AB04-BA3281D84770", "key_type": "ForegroundColor", "name": "SnapshotTileBaselineText" }, "plugin-memory-snapshot-tile-border": { "category": "A5441C8F-ED08-40E1-AB04-BA3281D84770", "key_type": "BackgroundColor", "name": "SnapshotTileBorder" }, "plugin-memory-snapshot-tile-error-text": { "category": "A5441C8F-ED08-40E1-AB04-BA3281D84770", "key_type": "ForegroundColor", "name": "SnapshotTileErrorText" }, "plugin-memory-snapshot-tile-header": { "category": "A5441C8F-ED08-40E1-AB04-BA3281D84770", "key_type": "BackgroundColor", "name": "SnapshotTileHeader" }, "plugin-memory-tab-header": { "category": "A5441C8F-ED08-40E1-AB04-BA3281D84770", "key_type": "BackgroundColor", "name": "TabHeader" }, "plugin-memory-tab-text": { "category": "A5441C8F-ED08-40E1-AB04-BA3281D84770", "key_type": "ForegroundColor", "name": "TabText" }, "plugin-memory-tab-hover": { "category": "A5441C8F-ED08-40E1-AB04-BA3281D84770", "key_type": "BackgroundColor", "name": "TabHover" }, "plugin-memory-tab-hover-text": { "category": "A5441C8F-ED08-40E1-AB04-BA3281D84770", "key_type": "ForegroundColor", "name": "TabHover" }, "plugin-perftools-detail-pane": { "category": "634eef98-6af2-4f63-8d9f-36351e18b606", "key_type": "BackgroundColor", "name": "DetailPane" }, "plugin-perftools-focusdots": { "category": "634eef98-6af2-4f63-8d9f-36351e18b606", "key_type": "ForegroundColor", "name": "FocusDots" }, "plugin-perftools-grid-column-sizer": { "category": "634eef98-6af2-4f63-8d9f-36351e18b606", "key_type": "BackgroundColor", "name": "GridColumnSizer" }, "plugin-perftools-grid-header-hover": { "category": "634eef98-6af2-4f63-8d9f-36351e18b606", "key_type": "BackgroundColor", "name": "GridHeaderHover" }, "plugin-perftools-grid-header-hover-text": { "category": "634eef98-6af2-4f63-8d9f-36351e18b606", "key_type": "ForegroundColor", "name": "GridHeaderHover" }, "plugin-perftools-grid-header-text": { "category": "634eef98-6af2-4f63-8d9f-36351e18b606", "key_type": "ForegroundColor", "name": "GridHeaderText" }, "plugin-perftools-menu": { "category": "634eef98-6af2-4f63-8d9f-36351e18b606", "key_type": "BackgroundColor", "name": "Menu" }, "plugin-perftools-menu-border": { "category": "634eef98-6af2-4f63-8d9f-36351e18b606", "key_type": "BackgroundColor", "name": "MenuBorder" }, "plugin-perftools-menu-drop-shadow": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "ThreeDLightShadow" }, "plugin-perftools-menu-focus": { "category": "634eef98-6af2-4f63-8d9f-36351e18b606", "key_type": "BackgroundColor", "name": "MenuFocus" }, "plugin-perftools-menu-focus-text": { "category": "634eef98-6af2-4f63-8d9f-36351e18b606", "key_type": "ForegroundColor", "name": "MenuFocus" }, "plugin-perftools-menu-hover": { "category": "634eef98-6af2-4f63-8d9f-36351e18b606", "key_type": "BackgroundColor", "name": "MenuHover" }, "plugin-perftools-menu-hover-text": { "category": "634eef98-6af2-4f63-8d9f-36351e18b606", "key_type": "ForegroundColor", "name": "MenuHover" }, "plugin-perftools-progress": { "category": "634eef98-6af2-4f63-8d9f-36351e18b606", "key_type": "BackgroundColor", "name": "Progress" }, "plugin-perftools-splitter": { "category": "634eef98-6af2-4f63-8d9f-36351e18b606", "key_type": "BackgroundColor", "name": "Splitter" }, "plugin-perftools-watermark-text": { "category": "634eef98-6af2-4f63-8d9f-36351e18b606", "key_type": "ForegroundColor", "name": "WatermarkText" } }, "themed_images": { "image-checkmark": { "bitmap_source": "images\\checkmark.png", "background_color": "plugin-memory-drop-down-button" }, "image-detached-dom-node-warning": { "bitmap_source": "images\\i_info.png", "background_color": "plugin-background-color" }, "image-heap-decrease": { "bitmap_source": "images\\status_heap_decrease.png", "background_color": "plugin-background-color" }, "image-heap-increase": { "bitmap_source": "images\\status_heap_increase.png", "background_color": "plugin-background-color" }, "image-settings": { "bitmap_source": "images\\i_table_options.png", "background_color": "plugin-background-color" }, "image-snapshot": { "bitmap_source": "images\\takeSnapshot.png", "background_color": "plugin-background-color" }, "image-sort-down": { "bitmap_source": "..\\Common\\images\\i_sort_down.png", "background_color": "plugin-background-color" }, "image-sort-up": { "bitmap_source": "..\\Common\\images\\i_sort_up.png", "background_color": "plugin-background-color" }, "image-warning": { "bitmap_source": "..\\Common\\images\\i_warning.png", "background_color": "plugin-background-color" }, "vs-image-icon-tree-expanded": { "bitmap_source": "..\\Common\\images\\itemExpandedIcon.png", "background_color": "plugin-background-color" }, "vs-image-icon-tree-collapsed": { "bitmap_source": "..\\Common\\images\\itemCollapsedIcon.png", "background_color": "plugin-background-color" } } } } PNG  IHDR@] cHRMz%u0`:o_F pHYsod ;IDATx^OIF .a`ֳ'p.0ڕKwfb'<7j:+^EfeU]/dWU         ׯ/5u[qWf\zϠ?>!ۍ_v[?c_R0+fQ _0[d%tvU'go3m~6 Vb>kqJCV"/ b0΋\ߦv]g?j{?_iW1^tKv=_ɍwMAĿ"`l?Z(AH{"Mcսkݍ}._[|H&b6{m58b6mL}Eu1|@VAkri,ŵPr󉺝>H N1>EVb-տH&v䫕v?'jc>CFA.~)z9]d6j~!hni7}]d0Q"Ui3)z9x]d8(`dS,ׅDjm7[T-u= mBg|%R o) əD,}]I>`P=|wG2i o)Ngd7Ǜg'Li o)mb3&s`ii>`Pgh#;JY$Pg$F9!wYc :~rfi?dE)Gv'f.MR@ʊWh^ Yf=HdxMAI*K~bsbLMȲ6IcB>~Z e{P{C,&$CW~I D 8)bDQ0ۏC&G,3tu$P$\(#m${do{XWgxM1/'gY$;6([$G,3tu>`W 82D~h {uqrlIĘX븍HWgxM1/YOU'uqEw6~,ۚ]b?$Or}m-} 7$PxojK]|8u3$_ۂR~1 ɡ;j'G6A]Еrkj7n^]|8u3y-G0D 6f!]'V܍$Mg|޺w_%5wc9O,OrOzb6f!]'k_O?IЏH3'k䗡.ˇCg?9SCR[{A }TlOX|ԥGv?9͎J~@],HCAeW#uFj){HWԵ.~r%5yfk?ؘ@r~/#uy,Hps<${C)="X*~ G!<"`]ǂobp* vͤaaLf"5DVfҰX>j3`<iqhX~1 iҰO1iҰX>, 9sVhX~1 iҰXIgiXn,{农9+4,?|hQбZȲ%z󏂎)i0.rkdr;q wZY%\zv[vbOuTr?A }?\z'zؓ |wG-.~f?_EĿ8|]tKx{|w             sfjńIENDB`html, body { -ms-high-contrast-adjust: none; cursor: default; height: 100%; margin: 0px; } input:-ms-input-placeholder { color: TRANSPARENT; /*[{plugin-perftools-watermark-text}]*/ } #mainContainer { height: 100%; width: 100%; } .warningMessage { -ms-grid-row: 1; background-image: url('../common/images/i_warning.png'); /*[url({image-warning})]*/ background-position-y: -18px; background-repeat: no-repeat; background-size: 18px 54px; color: TRANSPARENT; /*[{plugin-color}]*/ display: none; height: 18px; margin-top: 2px; padding-left: 21px; width: 18px; } input { padding: 2px; } .controlDropdown { padding: 0; margin: 0; } .additionalSeperator { display: none; } .heapOverviewGraph { display: none; /* Initial state is display:none, but becomes visible on control initialization */ height: 100%; margin-bottom: 5px; position: relative; width: 100%; } .datatypeSelection { width: 90px; } .gridSplitter { position: relative; background-color: TRANSPARENT; /*[{plugin-perftools-splitter}]*/ } .gridSplitter-Vertical { width: 100%; height: 3px; cursor: ns-resize; } .gridSplitter-Horizontal { width: 3px; height: 100%; cursor: ew-resize; } .summaryView { -ms-grid-columns: 1fr; -ms-grid-rows: auto auto 1fr; display: -ms-grid; height: 100%; overflow-y: auto; width: 100%; } .summaryView > .giveFeedbackContainer { position: absolute; bottom: 2px; left: 2px; } .mainSection { -ms-grid-row: 2; padding-left: 14px; padding-right: 14px; } .snapshotScrollableContainer { height: 100%; overflow-y: auto; width: 100%; } .snapshotView { -ms-grid-columns: 1fr; -ms-grid-rows: .7fr .3fr auto; box-sizing: border-box; display: -ms-grid; height: 100%; min-height: 21em; width: 100%; } .snapshotView > .snapshotGridContainer { -ms-grid-column: 1; -ms-grid-row: 1; box-sizing: border-box; padding-top: 3px; } .snapshotView > .gridSplitter { -ms-grid-column: 1; -ms-grid-row: 2; z-index: 10; box-sizing: border-box; } .snapshotView > .referenceView { -ms-grid-column: 1; -ms-grid-row: 2; display: -ms-grid; -ms-grid-columns: 1fr; -ms-grid-rows: auto 1fr; box-sizing: border-box; } .snapshotView > .snapshotMessagesContainer { -ms-grid-column: 1; -ms-grid-row: 3; border-top: 1px solid TRANSPARENT; /*[1px solid {plugin-memory-snapshot-messages-border}]*/ box-sizing: border-box; cursor: default; } .snapshotView > .snapshotMessagesContainer > .reachedItemsCapMessageContainer { box-sizing: border-box; display: none; margin: 5px 0px 5px 10px; } .analysisContainer { margin-left: 14px; margin-right: 14px; margin-bottom: 3px; } .analysisContainer > .giveFeedbackButton { vertical-align: middle; } .analysisContainer > .filterInput { font-size: 90%; margin-top: 3px; vertical-align: top; } .analysisContainer > .settingsMenuButton { background-color: TRANSPARENT; /*[{plugin-memory-drop-down-button}]*/ background-image: none; border: 1px solid transparent; display: inline-block; height: 25px; min-width: 0; padding: 3px 0px 0px 1px; width: 31px; } .analysisContainer > .settingsMenuButton:hover:not(.menuControlActive) { background-color: TRANSPARENT; /*[{plugin-memory-drop-down-button-hover}]*/ border: 1px solid transparent; } .analysisContainer > .menuControlActive { background-color: TRANSPARENT; /*[{plugin-memory-drop-down-button-focus}]*/ border-left: 1px solid TRANSPARENT; /*[1px solid {plugin-memory-drop-down-button-focus-border}]*/ border-right: 1px solid TRANSPARENT; /*[1px solid {plugin-memory-drop-down-button-focus-border}]*/ border-top: 1px solid TRANSPARENT; /*[1px solid {plugin-memory-drop-down-button-focus-border}]*/ } .analysisContainer > .settingsMenuButton > .settingsIcon { background: url('images/i_table_options.png') no-repeat 0px 0px; /*[url({image-settings}) no-repeat 0px 0px]*/ background-size: 27px 54px; height: 18px; width: 27px; } .referenceView > .referenceGraphTitle { -ms-grid-column: 1; -ms-grid-row: 1; background-color: TRANSPARENT; /*[{plugin-memory-tab-header}]*/ box-sizing: border-box; font-weight: 600; padding: 5px 0px 5px 10px; } .referenceView > .referenceViewContainer { -ms-grid-column: 1; -ms-grid-row: 2; background-color: #f9f9f9; /*[{plugin-perftools-detail-pane}]*/ box-sizing: border-box; padding-top: 3px; } .snapshotTab { height: 100%; } .snapshotTab > .snapshotDataNavigation { height: 100%; } .snapshotTab > .snapshotDataNavigationHidden { display: none; } .snapshotTab > .snapshotErrorProgress { height: 100%; width: 100%; margin-left: 10px; margin-right: 10px; } .snapshotTab > .snapshotErrorProgress > .snapshotError { font-size: 20px; } .snapshotTab > .snapshotErrorProgress > .snapshotError > .snapshotProcessingErrorFrown { font-size: 100px; margin-bottom: 20px; } .snapshotTab > .snapshotErrorProgress > .snapshotProcessingProgressDiv { -ms-grid-columns: 1fr; -ms-grid-rows: 1fr; display: -ms-grid; height: 100%; width: 100%; } .snapshotTab > .snapshotErrorProgress > .snapshotProcessingProgressDivHidden { display: none; } .snapshotTab > .snapshotErrorProgress > .snapshotProcessingProgressDiv > .progressContent { -ms-grid-column: 1; -ms-grid-column-align: center; -ms-grid-row: 1; -ms-grid-row-align: center; max-width: 300px; text-align: center; } .grid-row:not(.grid-row-current) > .diffAddedObject { color: TRANSPARENT; /*[{plugin-memory-snapshot-diff-added-text}]*/ } .grid-row:not(.grid-row-current) > .diffModifiedObject { color: TRANSPARENT; /*[{plugin-memory-snapshot-diff-modified-text}]*/ } .grid-row:not(.grid-row-current):hover > .diffAddedObject, .grid-row:not(.grid-row-current):hover > .diffModifiedObject { color: TRANSPARENT; /*[{plugin-treeview-content-mouseover-color}]*/ } .menuControl { background-color: TRANSPARENT; /*[{plugin-perftools-menu}]*/ border: 1px solid TRANSPARENT; /*[1px solid {plugin-perftools-menu-border}]*/ box-shadow: 2px 2px 2px TRANSPARENT; /*[2px 2px 2px {plugin-perftools-menu-drop-shadow rgba(0.5)}]*/ display: none; list-style-type: none; padding: 2px; position: absolute; width: auto; z-index: 10; } .menuControl > li { padding: 2px 5px 2px 5px; width: 100%; } .menuControl > li:hover { background-color: TRANSPARENT; /*[{plugin-perftools-menu-hover}]*/ color: TRANSPARENT; /*[{plugin-perftools-menu-hover-text}]*/ cursor: pointer; } .menuControl > li:focus { background-color: TRANSPARENT; /*[{plugin-perftools-menu-focus}]*/ color: TRANSPARENT; /*[{plugin-perftools-menu-focus-text}]*/ } .menuControl > li > .menuToggleIcon { height: 12px; margin-top: -2px; margin-right: 5px; vertical-align: middle; width: 12px; } .menuControl > li > .menuToggleIcon.hiddenCheckMark { visibility: hidden; } .headerAndTabContainer { -ms-grid-columns: 1fr; -ms-grid-rows: auto 1fr; display: -ms-grid; height: 100%; width: 100%; } .tabContainer { -ms-grid-columns: 1fr; -ms-grid-row: 2; -ms-grid-rows: 1fr; background-color: TRANSPARENT; /*[{plugin-background-color}]*/ display: -ms-grid; } .tabContainer .startProfilingPrompt { -ms-grid-column-align: center; -ms-grid-row-align: center; } .tabContainer .startProfilingPrompt .startProfilingMessage { font-size: 14px; } .startToolbarButton { background: url('../Common/images/i_start.png') no-repeat 0px 0px; /*[url({f12-image-toolbar-start}) no-repeat 0px 0px]*/ background-size: 18px 54px; } .stopToolbarButton { background: url('../Common/images/i_stop.png') no-repeat 0px 0px; /*[url({f12-image-toolbar-stop}) no-repeat 0px 0px]*/ background-size: 18px 54px; } .takeSnapshotToolbarButton { background: url('images/i_snapshot.png') no-repeat 0px 0px; /*[url({f12-image-toolbar-snapshot}) no-repeat 0px 0px]*/ background-size: 18px 54px; } .detachedDomNodeWarning { background: url('images/i_info.png') no-repeat 0px 0px; /*[url({image-detached-dom-node-warning}) no-repeat 0px 0px]*/ background-position-y: -18px; background-size: 18px 54px; } .grid-gutter-row { padding-top: 4px; } /*From the DOM/Console common "toolwindow.css"*/ .BPT-FileLink, .BPT-HelpLink { border: 1px solid transparent; color: TRANSPARENT; /*[{plugin-link-color}]*/ /*EnvironmentColors.CommandBarMenuLinkTextColorKey*/ cursor: pointer; } .BPT-FileLink:hover, .BPT-HelpLink:hover { color: TRANSPARENT; /*[{plugin-link-hover-color}]*/ /*EnvironmentColors.CommandBarMenuLinkTextHoverColorKey*/ text-decoration: underline; }/* We only show a blue hover state for icons in f12 */ .analysisContainer > .settingsMenuButton:hover > .settingsIcon, .analysisContainer > .menuControlActive > .settingsIcon { background-position-y: -18px !important; } .snapshotTileBlank > .snapshotTileInner .takeSnapshotButton:hover:enabled .takeSnapshotIcon { background-position-y: -32px; }  Memory
      // // Copyright (C) Microsoft. All rights reserved. // // canvasChartControl.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; (function (Controls) { (function (Charting) { (function (ChartViewType) { ChartViewType._map = []; ChartViewType._map[0] = "Scale"; ChartViewType.Scale = 0; ChartViewType._map[1] = "Expand"; ChartViewType.Expand = 1; ChartViewType._map[2] = "Roll"; ChartViewType.Roll = 2; ChartViewType._map[3] = "Fixed"; ChartViewType.Fixed = 3; })(Charting.ChartViewType || (Charting.ChartViewType = {})); var ChartViewType = Charting.ChartViewType; (function (SeriesRenderType) { SeriesRenderType._map = []; SeriesRenderType.Points = 1; SeriesRenderType.Line = 2; SeriesRenderType.PointsAndLine = SeriesRenderType.Points | SeriesRenderType.Line; SeriesRenderType.VerticalLines = 4; SeriesRenderType.Triangles = 8; })(Charting.SeriesRenderType || (Charting.SeriesRenderType = {})); var SeriesRenderType = Charting.SeriesRenderType; (function (SeriesOrderType) { SeriesOrderType._map = []; SeriesOrderType._map[0] = "Sort"; SeriesOrderType.Sort = 0; SeriesOrderType._map[1] = "Remove"; SeriesOrderType.Remove = 1; })(Charting.SeriesOrderType || (Charting.SeriesOrderType = {})); var SeriesOrderType = Charting.SeriesOrderType; var ChartColorType; (function (ChartColorType) { ChartColorType._map = []; ChartColorType._map[0] = "Background"; ChartColorType.Background = 0; ChartColorType._map[1] = "Foreground"; ChartColorType.Foreground = 1; ChartColorType._map[2] = "Grid"; ChartColorType.Grid = 2; ChartColorType._map[3] = "LegendBackground"; ChartColorType.LegendBackground = 3; ChartColorType._map[4] = "ViewSelection"; ChartColorType.ViewSelection = 4; ChartColorType._map[5] = "ViewSelectionOutside"; ChartColorType.ViewSelectionOutside = 5; })(ChartColorType || (ChartColorType = {})); var ChartFontType; (function (ChartFontType) { ChartFontType._map = []; ChartFontType._map[0] = "Foreground"; ChartFontType.Foreground = 0; })(ChartFontType || (ChartFontType = {})); var Point2d = (function () { function Point2d(x, y) { this.x = x; this.y = y; } return Point2d; })(); var Point2dWithData = (function (_super) { __extends(Point2dWithData, _super); function Point2dWithData(x, y, data) { _super.call(this, x, y); this.data = data; } return Point2dWithData; })(Point2d); var Point2dRendered = (function (_super) { __extends(Point2dRendered, _super); function Point2dRendered(x, y, isInView, seriesIndex) { _super.call(this, x, y); this.isInView = isInView; this.seriesIndex = seriesIndex; } return Point2dRendered; })(Point2d); var Padding = (function () { function Padding(left, top, right, bottom) { this.left = left; this.top = top; this.right = right; this.bottom = bottom; } return Padding; })(); var Rect = (function (_super) { __extends(Rect, _super); function Rect(left, top, right, bottom) { _super.call(this, left, top, right, bottom); if(this.left > this.right || this.top > this.bottom) { throw "Invalid rectange size"; } } Object.defineProperty(Rect.prototype, "width", { get: function () { return this.right - this.left; }, enumerable: true, configurable: true }); Object.defineProperty(Rect.prototype, "height", { get: function () { return this.bottom - this.top; }, enumerable: true, configurable: true }); return Rect; })(Padding); var MinMax = (function () { function MinMax(min, max) { this.min = min; this.max = max; } return MinMax; })(); var ChartSeries = (function () { function ChartSeries(index, legendText, seriesRenderType) { this._lineColorString = "#FF0000"; this._lineFillColorString = "#FF0000"; this._pointColorString = "#FF0000"; this._pointStrokeColorString = "#FF0000"; this.index = index; this.legendText = legendText; this.seriesRenderType = seriesRenderType; this.data = []; switch(index) { case 0: this._lineColorString = "rgb(180, 180, 255)"; this._lineFillColorString = "rgba(200, 200, 255, 0.3)"; this._pointColorString = "rgb(0, 0, 255)"; this._pointStrokeColorString = "rgb(0, 0, 0)"; break; case 1: this._lineColorString = "rgb(255, 180, 180)"; this._lineFillColorString = "rgba(255, 200, 200, 0.3)"; this._pointColorString = "rgb(255, 0, 0)"; this._pointStrokeColorString = "rgb(0, 0, 0)"; break; case 2: this._lineColorString = "rgb(180, 200, 100)"; this._lineFillColorString = "rgba(200, 255, 200, 0.3)"; this._pointColorString = "rgb(0, 200, 0)"; this._pointStrokeColorString = "rgb(0, 0, 0)"; break; case 3: this._lineColorString = "rgb(180, 255, 255)"; this._lineFillColorString = "rgba(200, 255, 255, 0.3)"; this._pointColorString = "rgb(0, 255, 255)"; this._pointStrokeColorString = "rgb(0, 0, 0)"; break; case 4: this._lineColorString = "rgb(255, 255, 180)"; this._lineFillColorString = "rgba(255, 255, 200, 0.3)"; this._pointColorString = "rgb(255, 255, 0)"; this._pointStrokeColorString = "rgb(0, 0, 0)"; break; default: break; } } Object.defineProperty(ChartSeries.prototype, "lineColor", { get: function () { return this._lineColorString; }, enumerable: true, configurable: true }); Object.defineProperty(ChartSeries.prototype, "lineFillColor", { get: function () { return this._lineFillColorString; }, enumerable: true, configurable: true }); Object.defineProperty(ChartSeries.prototype, "pointColor", { get: function () { return this._pointColorString; }, enumerable: true, configurable: true }); Object.defineProperty(ChartSeries.prototype, "pointStrokeColor", { get: function () { return this._pointStrokeColorString; }, enumerable: true, configurable: true }); return ChartSeries; })(); var CanvasChartControl = (function (_super) { __extends(CanvasChartControl, _super); function CanvasChartControl(containerId) { _super.call(this, "CanvasChartTemplate"); this._chartInitialStartSet = false; this._chartAxisPadding = new Padding(50, 40, 5, 5); this._chartAxisCount = 5; this._chartAxisIncreaseRatio = 1.5; this._chartDrawFill = true; this._chartOverviewPadding = 4; this._chartViewOverview = false; this._chartViewX = 0; this._chartViewWidth = 60; this._chartViewType = ChartViewType.Roll; this._gridX = new MinMax(0, 0); this._gridY = new MinMax(0, 0); this._gridRange = new Point2d(0, 0); this._triangleSize = 7; this._containerId = containerId; this._series = []; this._container = document.getElementById(this._containerId); if(this._container !== null) { this._container.appendChild(this.rootElement); this._canvas = this.findElement("mainCanvas"); this._context = this._canvas.getContext("2d"); if(!this._container.runtimeStyle.position || this._container.runtimeStyle.position === "static") { this._container.style.position = "relative"; } window.addEventListener("resize", this.onResize.bind(this)); this.onResize(null); } else { throw "An element with id " + this._containerId + " could not be found"; } } CanvasChartControl.prototype.onResize = function (event) { if(this._container.clientWidth > 0 && this._container.clientHeight > 0) { this._canvas.width = this._container.clientWidth; this._canvas.height = this._container.clientHeight; this._chartWidth = this._canvas.width - this._chartAxisPadding.right; this._chartHeight = this._canvas.height - this._chartAxisPadding.bottom; this.drawChart(); } }; CanvasChartControl.prototype.getColor = function (colorId) { switch(colorId) { case ChartColorType.Background: return "rgb(255, 255, 255)"; case ChartColorType.Foreground: return "rgb(0, 0, 0)"; case ChartColorType.Grid: return "rgb(200, 200, 200)"; case ChartColorType.LegendBackground: return "rgba(250, 250, 250, 0.75)"; case ChartColorType.ViewSelection: return "rgb(120, 120, 120)"; case ChartColorType.ViewSelectionOutside: return "rgba(255, 255, 255, 0.6)"; } return "rgb(255, 0, 0)"; }; CanvasChartControl.prototype.getFontString = function (fontId) { switch(fontId) { case ChartFontType.Foreground: return "7.5pt \"Segoe UI\", Arial, sans-serif"; } return "7.5pt \"Segoe UI\", Arial, sans-serif"; }; CanvasChartControl.prototype.getYCoord = function (y, top, height) { return top + ((this._gridY.max - y) / this._gridRange.y) * height; }; CanvasChartControl.prototype.drawXAxesValue = function (value, offsetY) { this._context.save(); this._context.fillStyle = this.getColor(ChartColorType.Foreground); this._context.font = this.getFontString(ChartFontType.Foreground); this._context.fillText("" + value.toFixed(2), this._chartAxisPadding.left - 5, this._chartAxisPadding.top + offsetY + 1.5); this._context.restore(); }; CanvasChartControl.prototype.drawChartBackground = function () { this._context.fillStyle = this.getColor(ChartColorType.Background); this._context.fillRect(0, 0, this._canvas.width, this._canvas.height); }; CanvasChartControl.prototype.drawChartAxes = function (chartRect) { this._context.fillStyle = this.getColor(ChartColorType.Grid); this._context.strokeStyle = this.getColor(ChartColorType.Grid); this._context.textAlign = "right"; var step = (this._gridRange.y / this._chartAxisCount); this.drawXAxesValue(this._gridY.max, 0); for(var i = 1; i < this._chartAxisCount; i++) { var y = ((step * i) / this._gridRange.y) * chartRect.height; var lineY = chartRect.top + Math.floor(y) + 0.5; this._context.beginPath(); this._context.moveTo(chartRect.left, lineY); this._context.lineTo(chartRect.left + chartRect.width, lineY); this._context.stroke(); this.drawXAxesValue(this._gridY.max - (step * i), y); } this.drawXAxesValue(this._gridY.min, chartRect.height); }; CanvasChartControl.prototype.drawChartBorder = function (chartRect) { this._context.fillStyle = "transparent"; this._context.strokeStyle = this.getColor(ChartColorType.Foreground); this._context.strokeRect(chartRect.left - 0.5, chartRect.top - 0.5, chartRect.width, chartRect.height); }; CanvasChartControl.prototype.drawChartLegend = function (chartRect) { if(!this._legendDiv) { this._legendDiv = document.createElement("div"); this._legendDiv.className = "chartLegend"; this._legendDiv.style.position = "absolute"; this._legendDiv.style.right = "20px"; this._legendDiv.style.bottom = (this._canvas.height - chartRect.bottom + 10) + "px"; this._legendDiv.style.backgroundColor = this.getColor(ChartColorType.LegendBackground); this._legendDiv.style.color = this.getColor(ChartColorType.Foreground); this._legendDiv.style.padding = "2px 5px 2px 5px"; this._legendDiv.style.font = this.getFontString(ChartFontType.Foreground); this._legendDiv.style.borderRadius = "3px"; if(this._container !== null) { this._container.appendChild(this._legendDiv); } } if(this._legendDiv.children.length !== this._series.length) { for(var i = 0; i < this._series.length; i++) { var seriesDiv = document.createElement("div"); seriesDiv.className = "chartLegendSeries"; var colorSpan = document.createElement("span"); colorSpan.style.display = "inline-block"; colorSpan.style.width = "16px"; colorSpan.style.height = "10px"; colorSpan.style.margin = "0 4px 2px 0"; colorSpan.style.verticalAlign = "middle"; colorSpan.style.border = "solid " + this._series[i].lineColor + " 1px"; if(this._series[i].seriesRenderType & SeriesRenderType.Line) { colorSpan.style.backgroundColor = this._series[i].lineFillColor; } var innerColorSpan = document.createElement("span"); innerColorSpan.style.display = "inline-block"; innerColorSpan.style.width = "12px"; innerColorSpan.style.height = "8px"; innerColorSpan.style.margin = "0 0 10px 1px"; innerColorSpan.style.verticalAlign = "middle"; innerColorSpan.style.backgroundColor = this._series[i].pointColor; colorSpan.appendChild(innerColorSpan); seriesDiv.appendChild(colorSpan); var textSpan = document.createElement("span"); textSpan.innerText = this._series[i].legendText; seriesDiv.appendChild(textSpan); this._legendDiv.appendChild(seriesDiv); } } }; CanvasChartControl.prototype.drawChartType = function (chartViewType, chartRect, isOverview) { var renderedPoints = new Array(); for(var seriesIndex = 0; seriesIndex < this._series.length; seriesIndex++) { var series = this._series[seriesIndex]; var seriesPoints = series.data; if(seriesPoints.length > 0) { var startIndex = 0; var endIndex = seriesPoints.length - 1; var startX = 0; var rangeX = 0; switch(chartViewType) { case ChartViewType.Scale: startX = this._gridX.min; rangeX = this._gridRange.x; break; case ChartViewType.Expand: startX = this._gridX.min; rangeX = Math.max(this._gridRange.x, this._chartViewWidth); break; case ChartViewType.Fixed: startX = this._chartViewX; rangeX = this._chartViewWidth; break; case ChartViewType.Roll: this._chartViewX = Math.max(this._gridX.max - this._chartViewWidth, this._gridX.min); startX = this._chartViewX; rangeX = this._chartViewWidth; break; } var endX = startX + rangeX; var scaleX = chartRect.width / rangeX; var x = 0; var y = 0; var startPoint = seriesPoints[startIndex]; var hasMovedToStart = false; this._context.save(); this._context.beginPath(); this._context.rect(chartRect.left, chartRect.top, chartRect.width, chartRect.height); this._context.clip(); this._context.fillStyle = series.lineFillColor; this._context.strokeStyle = series.lineColor; this._context.beginPath(); for(var i = startIndex; i <= endIndex; i++) { var point = seriesPoints[i]; var pointInView = (point.x >= startX && point.x <= endX); var requiresDrawing = pointInView; if(!requiresDrawing) { if((point.x < startX && i < endIndex && seriesPoints[i + 1].x > startX) || (point.x > endX && i > 0 && seriesPoints[i - 1].x < endX)) { requiresDrawing = true; } } if(requiresDrawing) { x = chartRect.left + (point.x - startX) * scaleX; y = this.getYCoord(point.y, chartRect.top, chartRect.height); if(!hasMovedToStart) { this._context.moveTo(x, this.getYCoord(0, chartRect.top, chartRect.height)); hasMovedToStart = true; } if(series.seriesRenderType & SeriesRenderType.Line) { this._context.lineTo(x, y); } renderedPoints.push({ x: x, y: y, isInView: pointInView, seriesIndex: seriesIndex }); } } if(series.seriesRenderType & SeriesRenderType.Line) { if(this._chartDrawFill) { var y = this.getYCoord(0, chartRect.top, chartRect.height); this._context.lineTo(x, y); this._context.closePath(); this._context.fill(); } else { this._context.stroke(); } if(this._chartDrawFill) { this._context.lineWidth = (chartRect.height < 100 ? 1 : 2); this._context.strokeStyle = series.lineColor; this._context.beginPath(); for(var i = 0; i < renderedPoints.length; i++) { var rp = renderedPoints[i]; if(i === 0) { this._context.moveTo(rp.x, Math.round(rp.y) - 0.5); } this._context.lineTo(rp.x, Math.round(rp.y) - 0.5); } this._context.stroke(); } } this._context.restore(); } } this.drawChartBorder(chartRect); var overviewStartX = chartRect.left + (this._chartViewX - this._gridX.min) * scaleX; var overviewEndX = overviewStartX + Math.min(this._chartViewWidth * scaleX, chartRect.width); var seriesIndexForColor = -1; for(var i = 0; i < renderedPoints.length; i++) { if(renderedPoints[i].isInView) { var si = renderedPoints[i].seriesIndex; if(seriesIndexForColor !== si) { this._context.fillStyle = this._series[si].pointColor; this._context.strokeStyle = this._series[si].pointStrokeColor; seriesIndexForColor = si; } if(this._series[si].seriesRenderType & SeriesRenderType.Points) { this._context.beginPath(); this._context.arc(renderedPoints[i].x - 0.5, renderedPoints[i].y - 0.5, 3, 0, Math.PI * 2); this._context.fill(); } if(this._series[si].seriesRenderType & SeriesRenderType.VerticalLines) { this._context.beginPath(); this._context.rect(Math.round(renderedPoints[i].x), chartRect.top, 1, chartRect.height); this._context.fill(); } if(this._series[si].seriesRenderType & SeriesRenderType.Triangles) { this._context.beginPath(); this._context.moveTo(renderedPoints[i].x, chartRect.bottom - 2 * this._triangleSize); this._context.lineTo(renderedPoints[i].x - this._triangleSize, chartRect.bottom); this._context.lineTo(renderedPoints[i].x + this._triangleSize, chartRect.bottom); this._context.lineTo(renderedPoints[i].x, chartRect.bottom - 2 * this._triangleSize); this._context.closePath(); this._context.fill(); } } } }; CanvasChartControl.prototype.drawChartViewSelection = function (chartRect) { var padding = this._chartOverviewPadding; var doublePadding = padding * 2; var scaleX = (chartRect.width / this._gridRange.x); var x = (this._chartViewX - this._gridX.min) * scaleX; var y = chartRect.top - padding; var w = Math.min(this._chartViewWidth * scaleX, chartRect.width); var h = chartRect.height + doublePadding; this._context.fillStyle = this.getColor(ChartColorType.ViewSelectionOutside); this._context.fillRect(chartRect.left - padding, y, Math.max(x, 0), h); this._context.fillRect(chartRect.left + x + w + padding, y, Math.max(chartRect.width - (x + w), 0), h); var snappedX = Math.floor(chartRect.left + x - padding) - 0.5; var snappedY = Math.floor(chartRect.top - padding) - 0.5; var snappedW = Math.ceil(w + doublePadding); var snappedH = Math.ceil(chartRect.height + doublePadding); this._context.save(); this._context.strokeStyle = this.getColor(ChartColorType.ViewSelection); this._context.lineWidth = 1; this._context.strokeRect(snappedX, snappedY, snappedW, snappedH); this._context.restore(); }; CanvasChartControl.prototype.drawChart = function () { if(this._chartViewType === ChartViewType.Scale || this._chartViewType === ChartViewType.Expand) { this._chartViewX = this._gridX.min; this._chartViewWidth = Math.max(this._gridRange.x, this._chartViewWidth); } this.drawChartBackground(); var chartRect = new Rect(this._chartAxisPadding.left, this._chartAxisPadding.top, this._chartWidth, this._chartHeight - (this._chartViewOverview ? 40 : 0)); this.drawChartAxes(chartRect); this.drawChartType(this._chartViewType, chartRect, false); this.drawChartLegend(chartRect); if(this._chartViewOverview) { chartRect.top += chartRect.height + 10; chartRect.bottom = chartRect.top + 30; this.drawChartType(ChartViewType.Expand, chartRect, true); this.drawChartViewSelection(chartRect); } }; CanvasChartControl.prototype.calculateRange = function (point) { if(this._gridX.max < point.x) { this._gridX.max = point.x; } if(this._gridX.min > point.x) { this._gridX.min = point.x; } if(this._gridY.min > point.y) { this._gridY.min = Math.floor((point.y * this._chartAxisIncreaseRatio) / this._chartAxisCount) * this._chartAxisCount; } if(this._gridY.max < point.y) { this._gridY.max = Math.ceil((point.y * this._chartAxisIncreaseRatio) / this._chartAxisCount) * this._chartAxisCount; } this._gridRange.x = this._gridX.max - this._gridX.min; this._gridRange.y = this._gridY.max - this._gridY.min; }; CanvasChartControl.prototype.setViewType = function (viewType, viewStartX, viewWidth, viewHeight) { if(viewStartX < this._gridX.min) { viewStartX = this._gridX.min; } this._chartViewType = viewType; this._chartViewX = viewStartX; this._chartViewWidth = viewWidth; if(typeof viewHeight === "number") { this._gridY.max = viewHeight; this._gridRange.y = viewHeight; } this.drawChart(); }; CanvasChartControl.prototype.addSeries = function (legendText, seriesRenderType) { var newSeries = new ChartSeries(this._series.length, legendText, seriesRenderType); this._series.push(newSeries); var filledLines = 0; for(var i = 0; i < this._series.length; i++) { if(this._series[i].seriesRenderType & SeriesRenderType.Line) { filledLines++; if(filledLines >= 2) { this._chartDrawFill = false; break; } } } return this._series.length - 1; }; CanvasChartControl.prototype.addPointToSeries = function (seriesIndex, x, y, tooltip, orderType, skipRender) { if (typeof orderType === "undefined") { orderType = SeriesOrderType.Sort; } if(seriesIndex >= 0 && seriesIndex < this._series.length) { var newPoint = new Point2dWithData(x, y, tooltip); var seriesData = this._series[seriesIndex].data; seriesData.push(newPoint); if(newPoint.x < this._gridX.max) { switch(orderType) { case SeriesOrderType.Remove: for(var deleteIndex = seriesData.length - 2; deleteIndex >= 0; deleteIndex--) { if(seriesData[deleteIndex].x < x) { break; } } deleteIndex++; seriesData.splice(deleteIndex, seriesData.length - deleteIndex - 1); this._gridX.max = newPoint.x; break; case SeriesOrderType.Sort: default: seriesData.sort(function (a, b) { return a.x - b.x; }); break; } } if(!this._chartInitialStartSet) { this._chartInitialStartSet = true; this._gridX.min = newPoint.x; this._chartViewX = newPoint.x; } this.calculateRange(newPoint); if(!skipRender) { this.drawChart(); } } }; return CanvasChartControl; })(Common.Controls.TemplateControl); Charting.CanvasChartControl = CanvasChartControl; })(Controls.Charting || (Controls.Charting = {})); var Charting = Controls.Charting; })(MemoryAnalyzer.Controls || (MemoryAnalyzer.Controls = {})); var Controls = MemoryAnalyzer.Controls; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=canvasChartControl.js.map // componentModel.ts var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; (function (Controls) { var ObservableViewModel = (function () { function ObservableViewModel() { this._propertyChangedObservers = []; } ObservableViewModel.prototype.registerPropertyChanged = function (observer) { this._propertyChangedObservers.push(observer); }; ObservableViewModel.prototype.removePropertyChanged = function (observer) { var index = this._propertyChangedObservers.indexOf(observer); if(index >= 0) { this._propertyChangedObservers = this._propertyChangedObservers.splice(index, 1); } }; ObservableViewModel.prototype.raisePropertyChanged = function (propertyName) { for(var i = 0; i < this._propertyChangedObservers.length; i++) { this._propertyChangedObservers[i].onPropertyChanged(propertyName); } }; return ObservableViewModel; })(); Controls.ObservableViewModel = ObservableViewModel; (function (NotifyCollectionChangedAction) { NotifyCollectionChangedAction._map = []; NotifyCollectionChangedAction._map[0] = "Add"; NotifyCollectionChangedAction.Add = 0; NotifyCollectionChangedAction._map[1] = "Reset"; NotifyCollectionChangedAction.Reset = 1; })(Controls.NotifyCollectionChangedAction || (Controls.NotifyCollectionChangedAction = {})); var NotifyCollectionChangedAction = Controls.NotifyCollectionChangedAction; var NotifyCollectionChangedEventArgs = (function () { function NotifyCollectionChangedEventArgs(action, newItems, newStartingIndex, oldItems, oldStartingIndex) { this._action = action; this._newItems = newItems; this._newStartingIndex = newStartingIndex; this._oldItems = oldItems; this._oldStartingIndex = oldStartingIndex; } Object.defineProperty(NotifyCollectionChangedEventArgs.prototype, "action", { get: function () { return this._action; }, enumerable: true, configurable: true }); Object.defineProperty(NotifyCollectionChangedEventArgs.prototype, "newItems", { get: function () { return this._newItems; }, enumerable: true, configurable: true }); Object.defineProperty(NotifyCollectionChangedEventArgs.prototype, "newStartingIndex", { get: function () { return this._newStartingIndex; }, enumerable: true, configurable: true }); Object.defineProperty(NotifyCollectionChangedEventArgs.prototype, "oldItems", { get: function () { return this._oldItems; }, enumerable: true, configurable: true }); Object.defineProperty(NotifyCollectionChangedEventArgs.prototype, "oldStartingIndex", { get: function () { return this._oldStartingIndex; }, enumerable: true, configurable: true }); return NotifyCollectionChangedEventArgs; })(); Controls.NotifyCollectionChangedEventArgs = NotifyCollectionChangedEventArgs; var ObservableCollection = (function () { function ObservableCollection() { this._items = []; this._collectionChangedObservers = []; } ObservableCollection.prototype.registerCollectionChanged = function (observer) { this._collectionChangedObservers.push(observer); }; ObservableCollection.prototype.removeCollectionChanged = function (observer) { var index = this._collectionChangedObservers.indexOf(observer); if(index >= 0) { this._collectionChangedObservers = this._collectionChangedObservers.splice(index, 1); } }; ObservableCollection.prototype.add = function (item) { this._items.push(item); var args = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, [ item ], this._items.length - 1, [], 0); this.onCollectionChanged(args); }; ObservableCollection.prototype.clear = function () { var oldItems = this._items; this._items = []; var args = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset, [], 0, oldItems, oldItems.length - 1); this.onCollectionChanged(args); }; ObservableCollection.prototype.getItem = function (index) { return this._items[index]; }; Object.defineProperty(ObservableCollection.prototype, "length", { get: function () { return this._items.length; }, enumerable: true, configurable: true }); ObservableCollection.prototype.onCollectionChanged = function (eventArgs) { for(var i = 0; i < this._collectionChangedObservers.length; i++) { this._collectionChangedObservers[i].onCollectionChanged(eventArgs); } }; return ObservableCollection; })(); Controls.ObservableCollection = ObservableCollection; })(MemoryAnalyzer.Controls || (MemoryAnalyzer.Controls = {})); var Controls = MemoryAnalyzer.Controls; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=componentModel.js.map // contentControl.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; (function (Controls) { var ContentControl = (function (_super) { __extends(ContentControl, _super); function ContentControl() { _super.call(this); } Object.defineProperty(ContentControl.prototype, "content", { get: function () { return this._content; }, set: function (newContent) { if(this._content !== newContent) { if(this._content) { this.removeChild(this._content); } this._content = newContent; this.appendChild(this._content); this.onContentChanged(); } }, enumerable: true, configurable: true }); ContentControl.prototype.appendChild = function (child) { if(this.rootElement.children.length != 0) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1016")); } _super.prototype.appendChild.call(this, child); }; ContentControl.prototype.onContentChanged = function () { }; return ContentControl; })(Common.Controls.Control); Controls.ContentControl = ContentControl; })(MemoryAnalyzer.Controls || (MemoryAnalyzer.Controls = {})); var Controls = MemoryAnalyzer.Controls; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=contentControl.js.map // gridSplitterControl.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; (function (Controls) { (function (GridSplitterDirection) { GridSplitterDirection._map = []; GridSplitterDirection._map[0] = "Horizontal"; GridSplitterDirection.Horizontal = 0; GridSplitterDirection._map[1] = "Vertical"; GridSplitterDirection.Vertical = 1; })(Controls.GridSplitterDirection || (Controls.GridSplitterDirection = {})); var GridSplitterDirection = Controls.GridSplitterDirection; var GridSplitterControl = (function (_super) { __extends(GridSplitterControl, _super); function GridSplitterControl(splitterElement, minSize, scrollableContainer, callback) { _super.call(this, splitterElement); this._direction = null; this._minSize = (typeof minSize === "number" && minSize > 0) ? minSize : GridSplitterControl._gridSplitterDefaultMinSize; this._scrollableContainer = scrollableContainer; this._callback = callback; if(!this.rootElement.contains(GridSplitterControl._gridSplitterClass)) { this.rootElement.classList.add(GridSplitterControl._gridSplitterClass); } this._resizerDisplay = document.createElement("div"); this._resizerDisplay.className = GridSplitterControl._gridSplitterClass + " " + GridSplitterControl._gridSplitterResizerClass; this._resizerDisplay.style.position = "relative"; this._resizerDisplay.style.display = "none"; this.rootElement.appendChild(this._resizerDisplay); this.rootElement.addEventListener("mousedown", this.onMouseDown.bind(this)); } GridSplitterControl._gridSplitterClass = "gridSplitter"; GridSplitterControl._gridSplitterResizerClass = "gridSplitter-Resizer"; GridSplitterControl._gridSplitterVerticalClass = "gridSplitter-Vertical"; GridSplitterControl._gridSplitterHorizontalClass = "gridSplitter-Horizontal"; GridSplitterControl._gridSplitterDefaultMinSize = 100; Object.defineProperty(GridSplitterControl.prototype, "direction", { get: function () { if(this._direction === null) { this._direction = this.getSplitterDirection(); } return this._direction; }, enumerable: true, configurable: true }); Object.defineProperty(GridSplitterControl.prototype, "gridCSS", { get: function () { if(!this._gridCSS) { this._gridCSS = this.getParentGridCSS(); } return this._gridCSS; }, enumerable: true, configurable: true }); GridSplitterControl.prototype.getSplitterDirection = function () { var direction; if(this.rootElement.classList.contains(GridSplitterControl._gridSplitterVerticalClass)) { direction = GridSplitterDirection.Vertical; } else if(this.rootElement.classList.contains(GridSplitterControl._gridSplitterHorizontalClass)) { direction = GridSplitterDirection.Horizontal; } else { if(this.rootElement.clientWidth > this.rootElement.clientHeight) { direction = GridSplitterDirection.Vertical; } else { direction = GridSplitterDirection.Horizontal; } } if(direction == GridSplitterDirection.Vertical) { this._gridIndex = parseInt(this.rootElement.currentStyle.msGridRow, 10) - 1; this._resizerDisplay.className += " " + GridSplitterControl._gridSplitterClass + "-Vertical"; } else { this._gridIndex = parseInt(this.rootElement.currentStyle.msGridColumn, 10) - 1; this._resizerDisplay.className += " " + GridSplitterControl._gridSplitterClass + "-Horizontal"; } return direction; }; GridSplitterControl.prototype.getParentGridCSS = function () { if(this.direction === GridSplitterDirection.Vertical) { return this.rootElement.parentElement.currentStyle.msGridRows; } else { return this.rootElement.parentElement.currentStyle.msGridColumns; } }; GridSplitterControl.prototype.calculateGridInfo = function () { this._gridCSS = this.getParentGridCSS(); if(!this._gridCSS) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1019")); } this._gridCSSParts = this._gridCSS.split(" "); if(this._gridCSSParts.length >= this._gridIndex && this._gridIndex > 0) { var previous = this._gridCSSParts[this._gridIndex - 1]; var current = this._gridCSSParts[this._gridIndex]; if(previous.indexOf("fr") === -1 || current.indexOf("fr") === -1) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1020")); } this._gridCSSTotal = (parseFloat(previous) + parseFloat(current)); } else { throw new Error(Plugin.Resources.getErrorString("JSPerf.1021")); } }; GridSplitterControl.prototype.onMouseMove = function (e) { var mousePosition = (this.direction === GridSplitterDirection.Vertical ? e.pageY : e.pageX); var previous = this.rootElement.previousElementSibling; var next = this.rootElement.nextElementSibling; var min = 0; var max = 0; if(this.direction === GridSplitterDirection.Vertical) { min = previous.offsetTop + this._minSize; max = next.offsetTop + next.offsetHeight - this._minSize; } else { min = previous.offsetLeft + this._minSize; max = next.offsetLeft + next.offsetWidth - this._minSize; } if(!this._scrollableContainer) { var scrollOffset = this._scrollableContainer.scrollTop; min -= scrollOffset; max -= scrollOffset; } var newPostion = mousePosition; if(mousePosition < min) { newPostion = min; } else if(mousePosition > max) { newPostion = max; } this._endPosition = newPostion; var displayPosition = newPostion - this._startPosition; if(this.direction === GridSplitterDirection.Vertical) { this._resizerDisplay.style.top = displayPosition + "px"; } else { this._resizerDisplay.style.left = displayPosition + "px"; } e.stopImmediatePropagation(); e.preventDefault(); }; GridSplitterControl.prototype.onMouseUp = function (e) { this._resizerDisplay.style.display = "none"; this.rootElement.style.removeProperty("background-color"); document.body.style.cursor = this._previousCursor; var sizePrevious = 0; var sizeCurrent = 0; if(this.direction === GridSplitterDirection.Vertical) { sizePrevious = this.rootElement.previousElementSibling.clientHeight; sizeCurrent = this.rootElement.nextElementSibling.clientHeight; } else { sizePrevious = this.rootElement.previousElementSibling.clientWidth; sizeCurrent = this.rootElement.nextElementSibling.clientWidth; } var changeInPosition = (this._endPosition - this._startPosition); var ratioCurrent = (sizeCurrent - changeInPosition) / (sizePrevious + sizeCurrent); if(ratioCurrent > 0 && ratioCurrent < 1) { var newSizePrevious = (1 - ratioCurrent) * this._gridCSSTotal; var newSizeCurrent = ratioCurrent * this._gridCSSTotal; var newGridCSS = ""; for(var i = 0; i < this._gridCSSParts.length; i++) { if(i === this._gridIndex - 1) { newGridCSS += newSizePrevious + "fr"; } else if(i === this._gridIndex) { newGridCSS += newSizeCurrent + "fr"; } else { newGridCSS += this._gridCSSParts[i]; } if(i < this._gridCSSParts.length - 1) { newGridCSS += " "; } } if(this.direction === GridSplitterDirection.Vertical) { this.rootElement.parentElement.style.msGridRows = newGridCSS; } else { this.rootElement.parentElement.style.msGridColumns = newGridCSS; } this._gridCSS = newGridCSS; if(this._callback && typeof (this._callback) == "function") { this._callback(); } } document.removeEventListener("mousemove", this._mouseMoveListener, true); document.removeEventListener("mouseup", this._mouseUpListener, true); e.stopImmediatePropagation(); e.preventDefault(); }; GridSplitterControl.prototype.onMouseDown = function (e) { this.calculateGridInfo(); this._previousCursor = document.body.style.cursor; document.body.style.cursor = this.rootElement.currentStyle.cursor; this._startPosition = (this.direction === GridSplitterDirection.Vertical ? e.pageY : e.pageX); this.rootElement.style.backgroundColor = "transparent"; this._resizerDisplay.style.display = "block"; this._resizerDisplay.style.top = "0"; this._resizerDisplay.style.left = "0"; this._mouseMoveListener = this.onMouseMove.bind(this); this._mouseUpListener = this.onMouseUp.bind(this); document.addEventListener("mousemove", this._mouseMoveListener, true); document.addEventListener("mouseup", this._mouseUpListener, true); e.stopImmediatePropagation(); e.preventDefault(); }; return GridSplitterControl; })(Common.Controls.Control); Controls.GridSplitterControl = GridSplitterControl; })(MemoryAnalyzer.Controls || (MemoryAnalyzer.Controls = {})); var Controls = MemoryAnalyzer.Controls; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=gridSplitterControl.js.map // tabControl.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; (function (Controls) { var TabControl = (function (_super) { __extends(TabControl, _super); function TabControl() { _super.call(this); this._items = []; this.setTemplateFromHTML('
      ' + '
      ' + '
      ' + '
      ' + '
        ' + '
        ' + '
        ' + '
        ' + '
        ' + '
        '); this._barPanel = new Common.Controls.Control(this.rootElement.getElementsByClassName("tabBar")[0]); this._contentPane = new Common.Controls.Control(this.rootElement.getElementsByClassName("tabContentPane")[0]); this.beforeBarContainer = new Common.Controls.Control(this.rootElement.getElementsByClassName("beforeBarContainer")[0]); this.afterBarContainer = new Common.Controls.Control(this.rootElement.getElementsByClassName("afterBarContainer")[0]); this._tabBarContainer = this.findElement("tabBarContainer"); } Object.defineProperty(TabControl.prototype, "tabsLeftAligned", { get: function () { return this._tabBarContainer.classList.contains("tabBarContainerLeftAlign"); }, set: function (v) { if(v) { this._tabBarContainer.classList.add("tabBarContainerLeftAlign"); } else { this._tabBarContainer.classList.remove("tabBarContainerLeftAlign"); } }, enumerable: true, configurable: true }); TabControl.prototype.addTab = function (tabItem) { this._items.push(tabItem); tabItem.ownerTabControl = this; this._barPanel.appendChild(tabItem.header); this._contentPane.appendChild(tabItem); if(!this._selectedItem) { this.selectedItem = tabItem; } }; TabControl.prototype.removeTab = function (tabItem) { var indexOfItem = this._items.indexOf(tabItem); if(indexOfItem < 0) { return; } if(this.selectedItem === tabItem) { this.selectedItem = null; } this._items.splice(indexOfItem, 1); var newSelectedItemIndex = Math.min(this._items.length - 1, indexOfItem); if(newSelectedItemIndex >= 0) { this.selectedItem = this._items[newSelectedItemIndex]; } this._barPanel.removeChild(tabItem.header); this._contentPane.removeChild(tabItem); tabItem.ownerTabControl = null; }; TabControl.prototype.containsTab = function (tabItem) { return this._items.indexOf(tabItem) >= 0; }; TabControl.prototype.getTab = function (index) { return this._items[index]; }; TabControl.prototype.length = function () { return this._items.length; }; Object.defineProperty(TabControl.prototype, "selectedItem", { get: function () { return this._selectedItem; }, set: function (tabItem) { if(this._selectedItem !== tabItem) { if(!this.containsTab(tabItem)) { return; } if(this._selectedItem) { this._selectedItem.active = false; } this._selectedItem = tabItem; if(this._selectedItem) { this._selectedItem.active = true; } if(this.selectedItemChanged) { this.selectedItemChanged(); } } }, enumerable: true, configurable: true }); TabControl.prototype.onTabItemSelected = function (item) { this.selectedItem = item; }; return TabControl; })(Common.Controls.TemplateControl); Controls.TabControl = TabControl; })(MemoryAnalyzer.Controls || (MemoryAnalyzer.Controls = {})); var Controls = MemoryAnalyzer.Controls; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=tabControl.js.map // tabItem.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; (function (Controls) { var TabItem = (function (_super) { __extends(TabItem, _super); function TabItem() { _super.call(this); this.header = new Common.Controls.Control(document.createElement("li")); this.header.rootElement.onclick = this.onHeaderClicked.bind(this); this.header.rootElement.setAttribute("tabindex", "2"); this.header.rootElement.addEventListener("keydown", this.onKeyDown.bind(this)); this.rootElement.className = "tabItemContent"; } Object.defineProperty(TabItem.prototype, "ownerTabControl", { get: function () { return this._ownerTabControl; }, set: function (v) { if(this._ownerTabControl !== v) { if(this._ownerTabControl && v) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1022")); } this._ownerTabControl = v; } }, enumerable: true, configurable: true }); Object.defineProperty(TabItem.prototype, "active", { get: function () { return this._active; }, set: function (v) { if(this._active !== v) { this._active = v; this.header.rootElement.classList.toggle("active"); this.rootElement.classList.toggle("active"); this.onActiveChanged(); } }, enumerable: true, configurable: true }); Object.defineProperty(TabItem.prototype, "title", { get: function () { return this.header.rootElement.innerText; }, set: function (v) { this.header.rootElement.innerText = v; }, enumerable: true, configurable: true }); Object.defineProperty(TabItem.prototype, "tooltipString", { get: function () { return this.header.rootElement.getAttribute("data-plugin-vs-tooltip"); }, set: function (v) { var tooltip = { content: v }; this.header.rootElement.setAttribute("data-plugin-vs-tooltip", JSON.stringify(tooltip)); }, enumerable: true, configurable: true }); TabItem.prototype.onActiveChanged = function () { }; TabItem.prototype.onHeaderClicked = function () { if(this.ownerTabControl) { this.ownerTabControl.selectedItem = this; } MemoryAnalyzer.Program.onIdle(); }; TabItem.prototype.onKeyDown = function (e) { if(e.keyCode === Common.KeyCodes.ENTER || e.keyCode === Common.KeyCodes.SPACE) { this.onHeaderClicked(); } }; return TabItem; })(Controls.ContentControl); Controls.TabItem = TabItem; })(MemoryAnalyzer.Controls || (MemoryAnalyzer.Controls = {})); var Controls = MemoryAnalyzer.Controls; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=tabItem.js.map // menuControl.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; (function (Controls) { var MenuItem = (function () { function MenuItem(itemText, ownerControl, canToggle, initialState) { if (typeof canToggle === "undefined") { canToggle = false; } if (typeof initialState === "undefined") { initialState = false; } this.element = document.createElement("li"); if(canToggle) { this._toggleIcon = document.createElement("img"); this.element.appendChild(this._toggleIcon); this._toggleIcon.className = "menuToggleIcon"; this._toggleIcon.src = Plugin.Theme.getValue("image-checkmark"); this.toggled = initialState; this.element.addEventListener("DOMAttrModified", this.onAriaCheckedModified.bind(this)); } var span = document.createElement("span"); this.element.appendChild(span); span.innerText = itemText; } Object.defineProperty(MenuItem.prototype, "toggled", { get: function () { return this._toggled; }, set: function (v) { this._toggled = v; if(this._toggled) { this._toggleIcon.classList.remove("hiddenCheckMark"); this.element.setAttribute("aria-checked", "true"); } else { this._toggleIcon.classList.add("hiddenCheckMark"); this.element.setAttribute("aria-checked", "false"); } }, enumerable: true, configurable: true }); MenuItem.prototype.onAriaCheckedModified = function (event) { if(event.attrName === "aria-checked") { var checked = event.newValue === "true"; if(this.toggled !== checked) { this.toggled = checked; } } }; return MenuItem; })(); Controls.MenuItem = MenuItem; var MenuControl = (function (_super) { __extends(MenuControl, _super); function MenuControl(target) { var _this = this; _super.call(this); this._target = target; this._isVisible = false; this.setTemplateFromHTML("
          "); this._listElement = this.findElement("menuControl"); this._listElement.setAttribute("aria-hidden", "true"); this._closeMenuFunction = this.closeMenu.bind(this); document.body.addEventListener("keydown", function (e) { if(e.keyCode === Common.KeyCodes.ESCAPE) { _this.closeMenu(); } }); target.onclick = this.showMenu.bind(this); target.onkeydown = function (e) { if(e.keyCode === Common.KeyCodes.ENTER || e.keyCode === Common.KeyCodes.SPACE) { if(!_this._isVisible) { _this.showMenu(); } else { _this.closeMenu(); } } }; target.appendChild(this._listElement); target.setAttribute("role", "button"); target.setAttribute("aria-haspopup", "true"); target.setAttribute("aria-owns", this._listElement.id.toString()); target.addEventListener("keydown", function (e) { if((e.keyCode === Common.KeyCodes.ARROW_DOWN) && (_this._isVisible)) { (_this._listElement.firstElementChild).focus(); } }); } MenuControl.prototype.addToggleItem = function (itemText, itemCallback, initialState, tabIndex) { if (typeof initialState === "undefined") { initialState = false; } if (typeof tabIndex === "undefined") { tabIndex = 0; } var menuItem = new MenuItem(itemText, this, true, initialState); this._listElement.appendChild(menuItem.element); menuItem.element.tabIndex = tabIndex; menuItem.element.setAttribute("role", "menuitemcheckbox"); menuItem.element.onclick = (function (e) { menuItem.toggled = itemCallback(e); e.stopImmediatePropagation(); }); menuItem.element.onkeydown = function (e) { if(e.keyCode === Common.KeyCodes.ENTER || e.keyCode === Common.KeyCodes.SPACE) { menuItem.toggled = itemCallback(e); e.stopImmediatePropagation(); } else if(e.keyCode === Common.KeyCodes.ARROW_UP) { if(menuItem.element.previousElementSibling) { (menuItem.element.previousElementSibling).focus(); } e.stopImmediatePropagation(); } else if(e.keyCode === Common.KeyCodes.ARROW_DOWN) { if(menuItem.element.nextElementSibling) { (menuItem.element.nextElementSibling).focus(); } e.stopImmediatePropagation(); } }; this._target.disabled = false; }; MenuControl.totalOffsetLeft = function totalOffsetLeft(elem) { var offsetLeft = 0; do { if(!isNaN(elem.offsetLeft)) { offsetLeft += elem.offsetLeft; } }while(elem = elem.offsetParent); return offsetLeft; }; MenuControl.totalOffsetTop = function totalOffsetTop(elem) { var offsetTop = 0; do { if(!isNaN(elem.offsetTop)) { offsetTop += elem.offsetTop; } }while(elem = elem.offsetParent); return offsetTop; }; MenuControl.prototype.showMenu = function (e) { var _this = this; if(!this._isVisible) { this._listElement.style.display = "block"; this._listElement.setAttribute("aria-hidden", "false"); this.setMenuPosition(); this._target.classList.add("menuControlActive"); window.setImmediate(function () { document.body.addEventListener("click", _this._closeMenuFunction); window.addEventListener("resize", _this._closeMenuFunction); }); this._isVisible = true; } }; MenuControl.prototype.closeMenu = function () { if(this._isVisible) { this._listElement.style.display = "none"; this._listElement.setAttribute("aria-hidden", "true"); this._target.classList.remove("menuControlActive"); document.body.removeEventListener("click", this._closeMenuFunction); window.removeEventListener("resize", this._closeMenuFunction); this._isVisible = false; } }; MenuControl.prototype.setMenuPosition = function () { this._listElement.style.left = "0px"; this._listElement.style.top = "0px"; var targetTotalOffsetLeft = MenuControl.totalOffsetLeft(this._target); var targetTotalOffsetTop = MenuControl.totalOffsetTop(this._target); var listElementZeroOffsetLeft = MenuControl.totalOffsetLeft(this._listElement); var listElementZeroOffsetTop = MenuControl.totalOffsetTop(this._listElement); var left = targetTotalOffsetLeft; var right = left + this._listElement.offsetWidth; if(right > window.innerWidth) { var newRight = targetTotalOffsetLeft + this._target.offsetWidth; var newLeft = newRight - this._listElement.offsetWidth; if(newLeft >= 0) { left = newLeft; right = newRight; } } this._listElement.style.left = left - listElementZeroOffsetLeft + "px"; var top = targetTotalOffsetTop + this._target.offsetHeight; var bottom = top + this._listElement.offsetHeight; if(bottom > window.innerHeight) { var newBottom = targetTotalOffsetTop; var newTop = bottom - this._listElement.offsetHeight; if(newTop >= 0) { top = newTop; bottom = newBottom; } } this._listElement.style.top = top - listElementZeroOffsetTop + "px"; }; return MenuControl; })(Common.Controls.TemplateControl); Controls.MenuControl = MenuControl; })(MemoryAnalyzer.Controls || (MemoryAnalyzer.Controls = {})); var Controls = MemoryAnalyzer.Controls; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=menuControl.js.map // internalFeedback.ts var MemoryAnalyzer; (function (MemoryAnalyzer) { (function (Extensions) { "use strict"; var InternalFeedbackProxy = (function () { function InternalFeedbackProxy() { this._proxy = Plugin.Utilities.JSONMarshaler.attachToPublishedObject("Microsoft.VisualStudio.WebClient.Diagnostics.PerformanceToolHost.Package.Extensions.InternalFeedback", { }, true); } InternalFeedbackProxy.instance = new InternalFeedbackProxy(); InternalFeedbackProxy.prototype.isEnabled = function () { return this._proxy._call("isEnabled"); }; InternalFeedbackProxy.prototype.sendData = function (showDialog, titleText, feedbackText, viewName, trace, sessionFilePath) { return this._proxy._call("sendData", showDialog, titleText, feedbackText, viewName, trace, sessionFilePath); }; return InternalFeedbackProxy; })(); Extensions.InternalFeedbackProxy = InternalFeedbackProxy; var NoOperationInternalFeedback = (function () { function NoOperationInternalFeedback() { } NoOperationInternalFeedback.prototype.isEnabled = function () { return Plugin.Promise.as(false); }; NoOperationInternalFeedback.prototype.sendData = function (showDialog, titleText, feedbackText, viewName, trace, sessionFilePath) { return Plugin.Promise.as(null); }; return NoOperationInternalFeedback; })(); Extensions.NoOperationInternalFeedback = NoOperationInternalFeedback; })(MemoryAnalyzer.Extensions || (MemoryAnalyzer.Extensions = {})); var Extensions = MemoryAnalyzer.Extensions; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=internalFeedback.js.map // session.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var MemoryAnalyzer; (function (MemoryAnalyzer) { (function (Extensions) { "use strict"; (function (SessionType) { SessionType._map = []; SessionType.session = 0; SessionType.snapshot = 1; SessionType.snapshotDiff = 2; })(Extensions.SessionType || (Extensions.SessionType = {})); var SessionType = Extensions.SessionType; var Session = (function () { function Session() { this._snapshotId = 1; } Session.prototype.getNewSnapshotRelativePath = function () { return "snapshot" + (this._snapshotId++) + ".snapjs"; }; return Session; })(); Extensions.Session = Session; var HostSessionProxy = (function (_super) { __extends(HostSessionProxy, _super); function HostSessionProxy() { _super.call(this); this._sessionProxy = Plugin.Utilities.JSONMarshaler.attachToPublishedObject("Microsoft.VisualStudio.WebClient.Diagnostics.PerformanceToolHost.Package.Extensions.Session", { }, true); } HostSessionProxy.prototype.addViewTypeEventListener = function (callback) { this._sessionProxy.addEventListener("viewtypechange", callback); }; HostSessionProxy.prototype.getSessionInfo = function () { return this._sessionProxy._call("getSessionInfo"); }; HostSessionProxy.prototype.openSnapshotDetails = function (relativePath, targetView, tabName, sortProperty) { return this._sessionProxy._call("openSnapshotDetails", relativePath, targetView, tabName, sortProperty); }; HostSessionProxy.prototype.openSnapshotDiff = function (relativePaths, targetView, tabName, sortProperty) { return this._sessionProxy._call("openSnapshotDiff", relativePaths, targetView, tabName, sortProperty); }; HostSessionProxy.prototype.save = function (addToProject) { return this._sessionProxy._call("save", addToProject); }; return HostSessionProxy; })(Session); Extensions.HostSessionProxy = HostSessionProxy; var LocalSession = (function (_super) { __extends(LocalSession, _super); function LocalSession() { _super.call(this); this._sessionInfo = { filePaths: [], isOffline: false, sessionType: SessionType.session, sortProperty: "", storageId: LocalSession.getUniqueStorageId(), targetView: "" }; } LocalSession.prototype.addViewTypeEventListener = function (callback) { }; LocalSession.prototype.getSessionInfo = function () { return Plugin.Promise.as(this._sessionInfo); }; LocalSession.prototype.openSnapshotDetails = function (relativePath, targetView, tabName, sortProperty) { var _this = this; return new Plugin.Promise(function (completed, error) { completed({ filePaths: [ relativePath ], isOffline: true, sessionType: SessionType.snapshot, sortProperty: sortProperty, storageId: _this._sessionInfo.storageId, targetView: targetView }); }); }; LocalSession.prototype.openSnapshotDiff = function (relativePaths, targetView, tabName, sortProperty) { var _this = this; return new Plugin.Promise(function (completed, error) { completed({ filePaths: relativePaths, isOffline: true, sessionType: SessionType.snapshotDiff, sortProperty: sortProperty, storageId: _this._sessionInfo.storageId, targetView: targetView }); }); }; LocalSession.prototype.save = function (addToProject) { return new Plugin.Promise(function (completed, error) { }); }; LocalSession.getUniqueStorageId = function getUniqueStorageId() { return Math.floor(Math.random() * 2821109907455).toString(36) + "." + Math.floor(Math.random() * 46655).toString(36); }; return LocalSession; })(Session); Extensions.LocalSession = LocalSession; })(MemoryAnalyzer.Extensions || (MemoryAnalyzer.Extensions = {})); var Extensions = MemoryAnalyzer.Extensions; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=session.js.map // userSettings.ts var MemoryAnalyzer; (function (MemoryAnalyzer) { (function (Extensions) { "use strict"; var UserSettingsProxy = (function () { function UserSettingsProxy() { } UserSettingsProxy.prototype.getUserSettings = function () { return new Plugin.Promise(function (completed) { Plugin.Settings.get("JavaScriptPerfTools").done(function (result) { completed(result); }, function (error) { completed({ }); }); }, null); }; return UserSettingsProxy; })(); Extensions.UserSettingsProxy = UserSettingsProxy; })(MemoryAnalyzer.Extensions || (MemoryAnalyzer.Extensions = {})); var Extensions = MemoryAnalyzer.Extensions; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=userSettings.js.map // errorFormatter.ts var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; var ErrorFormatter = (function () { function ErrorFormatter() { } ErrorFormatter.format = function format(error) { if(MemoryAnalyzer.Program.userSettings.showDetailedErrors) { var message = "Error description: " + (error.message || (error).description); if((error).number) { message += "\r\nError number: " + (error).number; } if((error).stack) { message += "\r\nError stack: " + (error).stack; } return message; } else { return (error.message || (error).description); } }; return ErrorFormatter; })(); MemoryAnalyzer.ErrorFormatter = ErrorFormatter; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=errorFormatter.js.map // formattingHelpers.ts var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; var FormattingHelpers = (function () { function FormattingHelpers() { } FormattingHelpers.getPrettyPrintSize = function getPrettyPrintSize(bytes) { var size = 0; var unitAbbreviation; if(Math.abs(bytes) > (1024 * 1024 * 1024)) { size = bytes / (1024 * 1024 * 1024); unitAbbreviation = Plugin.Resources.getString("GigabyteUnits"); } else if(Math.abs(bytes) > (1024 * 1024)) { size = bytes / (1024 * 1024); unitAbbreviation = Plugin.Resources.getString("MegabyteUnits"); } else if(Math.abs(bytes) > 1024) { size = bytes / 1024; unitAbbreviation = Plugin.Resources.getString("KilobyteUnits"); } else { size = bytes; unitAbbreviation = Plugin.Resources.getString("ByteUnits"); } return FormattingHelpers.getDecimalLocaleString(parseFloat(size.toFixed(2)), true) + " " + unitAbbreviation; }; FormattingHelpers.zeroPad = function zeroPad(stringToPad, newLength, padLeft) { for(var i = stringToPad.length; i < newLength; i++) { stringToPad = (padLeft ? ("0" + stringToPad) : (stringToPad + "0")); } return stringToPad; }; FormattingHelpers.getDecimalLocaleString = function getDecimalLocaleString(numberToConvert, includeGroupSeparators) { if(numberToConvert < 0) { numberToConvert = numberToConvert * -1; } var numberString = numberToConvert.toString(); var split = numberString.split(/e/i); numberString = split[0]; var exponent = (split.length > 1 ? parseInt(split[1], 10) : 0); split = numberString.split('.'); numberString = split[0]; var right = split.length > 1 ? split[1] : ""; if(exponent > 0) { right = FormattingHelpers.zeroPad(right, exponent, false); numberString += right.slice(0, exponent); right = right.substr(exponent); } else if(exponent < 0) { exponent = -exponent; numberString = FormattingHelpers.zeroPad(numberString, exponent + 1, true); right = numberString.slice(-exponent, numberString.length) + right; numberString = numberString.slice(0, -exponent); } var nf = Plugin.Culture.NumberFormat; if(!nf) { nf = { numberDecimalSeparator: ".", numberGroupSizes: [ 3 ], numberGroupSeparator: "," }; } if(right.length > 0) { right = nf.numberDecimalSeparator + right; } if(includeGroupSeparators === true) { var groupSizes = nf.numberGroupSizes, sep = nf.numberGroupSeparator, curSize = groupSizes[0], curGroupIndex = 1, stringIndex = numberString.length - 1, ret = ""; while(stringIndex >= 0) { if(curSize === 0 || curSize > stringIndex) { if(ret.length > 0) { return numberString.slice(0, stringIndex + 1) + sep + ret + right; } else { return numberString.slice(0, stringIndex + 1) + right; } } if(ret.length > 0) { ret = numberString.slice(stringIndex - curSize + 1, stringIndex + 1) + sep + ret; } else { ret = numberString.slice(stringIndex - curSize + 1, stringIndex + 1); } stringIndex -= curSize; if(curGroupIndex < groupSizes.length) { curSize = groupSizes[curGroupIndex]; curGroupIndex++; } } return numberString.slice(0, stringIndex + 1) + sep + ret + right; } else { return numberString + right; } }; return FormattingHelpers; })(); MemoryAnalyzer.FormattingHelpers = FormattingHelpers; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=formattingHelpers.js.map // heapObject.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; (function (ExternalObjectKind) { ExternalObjectKind._map = []; ExternalObjectKind.Default = 1; ExternalObjectKind.Unknown = 2; ExternalObjectKind.Dispatch = 3; })(MemoryAnalyzer.ExternalObjectKind || (MemoryAnalyzer.ExternalObjectKind = {})); var ExternalObjectKind = MemoryAnalyzer.ExternalObjectKind; (function (WinRTObjectKind) { WinRTObjectKind._map = []; WinRTObjectKind.Instance = 1; WinRTObjectKind.RuntimeClass = 2; WinRTObjectKind.Delegate = 3; WinRTObjectKind.Namespace = 4; })(MemoryAnalyzer.WinRTObjectKind || (MemoryAnalyzer.WinRTObjectKind = {})); var WinRTObjectKind = MemoryAnalyzer.WinRTObjectKind; (function (HeapObjectFlags) { HeapObjectFlags._map = []; HeapObjectFlags.ExternalOffset = 0; HeapObjectFlags.ExternalMask = 7; HeapObjectFlags.WinRtOffset = 3; HeapObjectFlags.WinRtMask = 7; HeapObjectFlags.IsNew = 1 << 6; HeapObjectFlags.IsRoot = 1 << 7; HeapObjectFlags.IsSiteClosed = 1 << 8; HeapObjectFlags.IsBuiltIn = 1 << 9; HeapObjectFlags.IsMarkup = 1 << 10; HeapObjectFlags.IsSizeApproximate = 1 << 11; HeapObjectFlags.IsChanged = 1 << 12; HeapObjectFlags.IsDetachedDomNode = 1 << 13; HeapObjectFlags.IsWinJsDisposable = 1 << 14; HeapObjectFlags.IsAdded = 1 << 15; HeapObjectFlags.IsBaseline = 1 << 16; })(MemoryAnalyzer.HeapObjectFlags || (MemoryAnalyzer.HeapObjectFlags = {})); var HeapObjectFlags = MemoryAnalyzer.HeapObjectFlags; var MaskOperations = (function () { function MaskOperations() { } MaskOperations.getValue = function getValue(input, offset, mask) { return (input >> offset) & mask; }; MaskOperations.setValue = function setValue(input, newValue, offset, mask) { return (~(mask << offset) & input) | ((newValue & mask) << offset); }; MaskOperations.isFlagSet = function isFlagSet(input, flag) { return (input & flag) !== 0 ? true : false; }; MaskOperations.setFlag = function setFlag(input, newValue, flag) { return newValue ? (input | flag) : (input & (~flag)); }; return MaskOperations; })(); MemoryAnalyzer.MaskOperations = MaskOperations; var NamedHeapObject = (function () { function NamedHeapObject(node, displayObjectIDs) { this._innerObj = node.object; this._hasChildren = node.hasChildren; this.name = this.initName(node.name, displayObjectIDs); if(this.isAdded) { this._diffOperation = Plugin.Resources.getString("DiffColumnOperationAdded"); } else if(this.isChanged) { this._diffOperation = Plugin.Resources.getString("DiffColumnOperationModified"); } else { this._diffOperation = Plugin.Resources.getString("DiffColumnOperationUnchanged"); if(this.isBaseline) { this._diffOperation += " (" + Plugin.Resources.getString("Baseline") + ")"; } } } Object.defineProperty(NamedHeapObject.prototype, "id", { get: function () { return this.objectId; }, enumerable: true, configurable: true }); Object.defineProperty(NamedHeapObject.prototype, "flags", { get: function () { return this._innerObj.flags; }, enumerable: true, configurable: true }); Object.defineProperty(NamedHeapObject.prototype, "kind", { get: function () { return this._innerObj.kind; }, enumerable: true, configurable: true }); Object.defineProperty(NamedHeapObject.prototype, "objectId", { get: function () { return this._innerObj.objectId; }, enumerable: true, configurable: true }); Object.defineProperty(NamedHeapObject.prototype, "retainedSize", { get: function () { return this._innerObj.retainedSize; }, enumerable: true, configurable: true }); Object.defineProperty(NamedHeapObject.prototype, "size", { get: function () { return this._innerObj.size; }, enumerable: true, configurable: true }); Object.defineProperty(NamedHeapObject.prototype, "type", { get: function () { return this._innerObj.type; }, enumerable: true, configurable: true }); Object.defineProperty(NamedHeapObject.prototype, "value", { get: function () { return this._innerObj.value; }, enumerable: true, configurable: true }); Object.defineProperty(NamedHeapObject.prototype, "diffOperation", { get: function () { return this._diffOperation; }, enumerable: true, configurable: true }); Object.defineProperty(NamedHeapObject.prototype, "sizeDiff", { get: function () { return this._innerObj.sizeDiff; }, enumerable: true, configurable: true }); Object.defineProperty(NamedHeapObject.prototype, "retainedSizeDiff", { get: function () { return this._innerObj.retainedSizeDiff; }, enumerable: true, configurable: true }); Object.defineProperty(NamedHeapObject.prototype, "hasChildren", { get: function () { return this._hasChildren; }, enumerable: true, configurable: true }); Object.defineProperty(NamedHeapObject.prototype, "isDetachedDomNode", { get: function () { var val = MaskOperations.isFlagSet(this._innerObj.flags, HeapObjectFlags.IsDetachedDomNode); return val; }, enumerable: true, configurable: true }); Object.defineProperty(NamedHeapObject.prototype, "isSizeApproximate", { get: function () { var val = MaskOperations.isFlagSet(this._innerObj.flags, HeapObjectFlags.IsSizeApproximate); return val; }, enumerable: true, configurable: true }); Object.defineProperty(NamedHeapObject.prototype, "isNew", { get: function () { var val = MaskOperations.isFlagSet(this._innerObj.flags, HeapObjectFlags.IsNew); return val; }, enumerable: true, configurable: true }); Object.defineProperty(NamedHeapObject.prototype, "isRoot", { get: function () { var val = MaskOperations.isFlagSet(this._innerObj.flags, HeapObjectFlags.IsRoot); return val; }, enumerable: true, configurable: true }); Object.defineProperty(NamedHeapObject.prototype, "isSiteClosed", { get: function () { var val = MaskOperations.isFlagSet(this._innerObj.flags, HeapObjectFlags.IsSiteClosed); return val; }, enumerable: true, configurable: true }); Object.defineProperty(NamedHeapObject.prototype, "isBuiltIn", { get: function () { var val = MaskOperations.isFlagSet(this._innerObj.flags, HeapObjectFlags.IsBuiltIn); return val; }, enumerable: true, configurable: true }); Object.defineProperty(NamedHeapObject.prototype, "external", { get: function () { var val = MaskOperations.getValue(this._innerObj.flags, HeapObjectFlags.ExternalOffset, HeapObjectFlags.ExternalMask); return val; }, enumerable: true, configurable: true }); Object.defineProperty(NamedHeapObject.prototype, "winrt", { get: function () { var val = MaskOperations.getValue(this._innerObj.flags, HeapObjectFlags.WinRtOffset, HeapObjectFlags.WinRtMask); return val; }, enumerable: true, configurable: true }); Object.defineProperty(NamedHeapObject.prototype, "isMarkup", { get: function () { var val = MaskOperations.isFlagSet(this._innerObj.flags, HeapObjectFlags.IsMarkup); return val; }, enumerable: true, configurable: true }); Object.defineProperty(NamedHeapObject.prototype, "isAdded", { get: function () { var val = MaskOperations.isFlagSet(this._innerObj.flags, HeapObjectFlags.IsAdded); return val; }, enumerable: true, configurable: true }); Object.defineProperty(NamedHeapObject.prototype, "isBaseline", { get: function () { var val = MaskOperations.isFlagSet(this._innerObj.flags, HeapObjectFlags.IsBaseline); return val; }, enumerable: true, configurable: true }); Object.defineProperty(NamedHeapObject.prototype, "isChanged", { get: function () { var val = MaskOperations.isFlagSet(this._innerObj.flags, HeapObjectFlags.IsChanged); return val; }, enumerable: true, configurable: true }); Object.defineProperty(NamedHeapObject.prototype, "isWinJsDisposable", { get: function () { var val = MaskOperations.isFlagSet(this._innerObj.flags, HeapObjectFlags.IsWinJsDisposable); return val; }, enumerable: true, configurable: true }); NamedHeapObject.prototype.initName = function (nameOverride, displayObjectIDs) { var name = ""; if(typeof nameOverride !== "undefined") { name += nameOverride; } if(this.winrt) { switch(this.winrt) { case 2: name += "{Runtime Class} "; break; case 3: name += "{Delegate} "; break; case 4: name += "{Namespace} "; break; } } if(this.external) { if(name) { name += ": "; } else { name = ""; } var externalPostfix = "External"; switch(this.external) { case 2: externalPostfix += " IUnknown"; break; case 3: externalPostfix += " IDispatch"; break; } name += externalPostfix; } if(typeof this.value !== "undefined") { if(name) { name += " = "; } else { name = ""; } var isString = typeof (this.value) === "string"; if(isString) { name += "\""; } name += this.value; if(isString) { name += "\""; } } if(name === "" && this.type) { name += "(" + this.type + ") "; } if(displayObjectIDs && this.objectId) { name += " @" + this.objectId; } return name; }; return NamedHeapObject; })(); MemoryAnalyzer.NamedHeapObject = NamedHeapObject; var ReferenceDataObject = (function (_super) { __extends(ReferenceDataObject, _super); function ReferenceDataObject(innerObj, displayObjectIDs, parentObjectId, nodeId) { if (typeof nodeId === "undefined") { nodeId = 0; } _super.call(this, innerObj, displayObjectIDs); this.nodeId = nodeId; this.parentObjectId = parentObjectId; } return ReferenceDataObject; })(NamedHeapObject); MemoryAnalyzer.ReferenceDataObject = ReferenceDataObject; var TypeDataObject = (function () { function TypeDataObject(objectHeapType) { this.objectHeapType = objectHeapType; this._name = this.objectHeapType.type; if(this.isAdded) { this._diffOperation = Plugin.Resources.getString("DiffColumnOperationAdded"); } else if(this.isChanged) { this._diffOperation = Plugin.Resources.getString("DiffColumnOperationModified"); } } Object.defineProperty(TypeDataObject.prototype, "isAdded", { get: function () { return false; }, enumerable: true, configurable: true }); Object.defineProperty(TypeDataObject.prototype, "isBaseline", { get: function () { return false; }, enumerable: true, configurable: true }); Object.defineProperty(TypeDataObject.prototype, "isChanged", { get: function () { return this.objectHeapType.hasModifiedChildren; }, enumerable: true, configurable: true }); Object.defineProperty(TypeDataObject.prototype, "id", { get: function () { return this.objectHeapType.type; }, enumerable: true, configurable: true }); Object.defineProperty(TypeDataObject.prototype, "isDetachedDomNode", { get: function () { return false; }, enumerable: true, configurable: true }); Object.defineProperty(TypeDataObject.prototype, "name", { get: function () { return this._name; }, enumerable: true, configurable: true }); Object.defineProperty(TypeDataObject.prototype, "retainedSize", { get: function () { return 0; }, enumerable: true, configurable: true }); Object.defineProperty(TypeDataObject.prototype, "size", { get: function () { return this.objectHeapType.size; }, enumerable: true, configurable: true }); Object.defineProperty(TypeDataObject.prototype, "isSizeApproximate", { get: function () { return false; }, enumerable: true, configurable: true }); Object.defineProperty(TypeDataObject.prototype, "isNew", { get: function () { return true; }, enumerable: true, configurable: true }); Object.defineProperty(TypeDataObject.prototype, "type", { get: function () { return this.objectHeapType.type; }, enumerable: true, configurable: true }); Object.defineProperty(TypeDataObject.prototype, "isBuiltIn", { get: function () { return false; }, enumerable: true, configurable: true }); Object.defineProperty(TypeDataObject.prototype, "childrenCount", { get: function () { return this.objectHeapType.childrenCount; }, enumerable: true, configurable: true }); Object.defineProperty(TypeDataObject.prototype, "childrenCountDiff", { get: function () { return this.objectHeapType.childrenCountDiff; }, enumerable: true, configurable: true }); Object.defineProperty(TypeDataObject.prototype, "hasChildren", { get: function () { return this.objectHeapType.childrenCount > 0; }, enumerable: true, configurable: true }); Object.defineProperty(TypeDataObject.prototype, "diffOperation", { get: function () { return this._diffOperation; }, enumerable: true, configurable: true }); return TypeDataObject; })(); MemoryAnalyzer.TypeDataObject = TypeDataObject; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=heapObject.js.map // snapshot.ts var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; var Snapshot = (function () { function Snapshot(snapshotData, isDiff) { this._snapshotData = snapshotData; this._isDiff = isDiff; } Object.defineProperty(Snapshot.prototype, "isDiff", { get: function () { return this._isDiff; }, enumerable: true, configurable: true }); Object.defineProperty(Snapshot.prototype, "hasDetachedDomNodes", { get: function () { return this._snapshotData.hasDetachedDomNodes(); }, enumerable: true, configurable: true }); Snapshot.prototype.getAllObjects = function (filter, sorter, startIndex, maxResult) { if (typeof startIndex === "undefined") { startIndex = 0; } if (typeof maxResult === "undefined") { maxResult = -1; } return this._snapshotData.getDominators(startIndex, maxResult, filter.filterString, filter).then(function (dataSet) { var objNodes = dataSet.result; var ret = []; for(var i = 0; i < objNodes.length; i++) { var objNode = objNodes[i]; var namedHeapObject = new MemoryAnalyzer.NamedHeapObject(objNode, filter.displayObjectIDs); ret.push(namedHeapObject); } ret.sort(sorter.sortComparer); return { items: ret, totalCount: dataSet.totalCount }; }); }; Snapshot.prototype.getAllRootObjects = function (filter, sorter) { var dataSet = this._snapshotData.getRootObjects(filter); var objNodes = dataSet.result; var ret = []; for(var i = 0; i < objNodes.length; i++) { var objNode = objNodes[i]; var namedHeapObject = new MemoryAnalyzer.NamedHeapObject(objNode, filter.displayObjectIDs); ret.push(namedHeapObject); } ret.sort(sorter.sortComparer); return { items: ret, totalCount: dataSet.totalCount }; }; Snapshot.prototype.getAllTypes = function (filter, sorter) { return this._snapshotData.getTypes(filter.filterString, (filter)).then(function (types) { var ret = []; for(var i = 0; i < types.length; i++) { var typeNode = types[i]; var typeDataObject = new MemoryAnalyzer.TypeDataObject(typeNode); ret.push(typeDataObject); } ret.sort(sorter.sortComparer); return { items: ret, totalCount: ret.length }; }); }; Snapshot.prototype.getAllChildrenForObjectOrType = function (id, filter, sorter, startIndex, maxResult) { if (typeof startIndex === "undefined") { startIndex = 0; } if (typeof maxResult === "undefined") { maxResult = -1; } var objectId = parseInt(id); if(!isNaN(objectId)) { return this.getAllChildrenForObject(objectId, filter, sorter, startIndex, maxResult); } else { return this.getAllObjectsByType(id, filter, sorter, startIndex, maxResult); } }; Snapshot.prototype.getAllObjectsByType = function (typeName, filter, sorter, startIndex, maxResult) { if (typeof startIndex === "undefined") { startIndex = 0; } if (typeof maxResult === "undefined") { maxResult = -1; } var dataSet = this._snapshotData.getObjectsByType(typeName, startIndex, maxResult, filter); var objNodes = dataSet.result; var ret = []; for(var i = 0; i < objNodes.length; i++) { var objNode = objNodes[i]; var namedHeapObject = new MemoryAnalyzer.NamedHeapObject(objNode, filter.displayObjectIDs); ret.push(namedHeapObject); } ret.sort(sorter.sortComparer); return { items: ret, totalCount: dataSet.totalCount }; }; Snapshot.prototype.getAllChildrenForObject = function (objectId, filter, sorter, startIndex, maxResult) { if (typeof startIndex === "undefined") { startIndex = 0; } if (typeof maxResult === "undefined") { maxResult = -1; } var dataSet = this._snapshotData.getChildrenForObject(objectId, startIndex, maxResult, filter); var objNodes = dataSet.result; var ret = []; for(var i = 0; i < objNodes.length; i++) { var objNode = objNodes[i]; var namedHeapObject = new MemoryAnalyzer.NamedHeapObject(objNode, filter.displayObjectIDs); ret.push(namedHeapObject); } ret.sort(sorter.sortComparer); return { items: ret, totalCount: dataSet.totalCount }; }; Snapshot.prototype.getRetainedDescendants = function (objectId, filter, sorter, startIndex, maxResult) { if (typeof startIndex === "undefined") { startIndex = 0; } if (typeof maxResult === "undefined") { maxResult = -1; } var dataSet = this._snapshotData.getRetainedDescendants(objectId, startIndex, maxResult, filter); var objNodes = dataSet.result; var ret = []; for(var i = 0; i < objNodes.length; i++) { var objNode = objNodes[i]; var namedHeapObject = new MemoryAnalyzer.NamedHeapObject(objNode, filter.displayObjectIDs); ret.push(namedHeapObject); } ret.sort(sorter.sortComparer); return { items: ret, totalCount: dataSet.totalCount }; }; Snapshot.prototype.getReferenceTreeItems = function (rootObjectId, objectId, nodeId, sorter, displayObjectIds, includeCircularReferences) { var dataSet = this._snapshotData.getReferenceTreeItems(rootObjectId, objectId, nodeId, includeCircularReferences); var objNodes = dataSet.result; var ret = []; for(var i = 0; i < objNodes.length; i++) { var objNode = objNodes[i]; var namedHeapObject = new MemoryAnalyzer.ReferenceDataObject(objNode, displayObjectIds, objNode.parentId, objNode.nodeId); ret.push(namedHeapObject); } ret.sort(sorter.sortComparer); return { items: ret, totalCount: dataSet.totalCount }; }; Snapshot.prototype.getPathToRoot = function (objectId, filter, parentObjectId) { return this._snapshotData.getPathToRoot(objectId, parentObjectId, filter); }; return Snapshot; })(); MemoryAnalyzer.Snapshot = Snapshot; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=snapshot.js.map // snapshotDataSource.ts var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; (function (DataViewType) { DataViewType._map = []; DataViewType._map[0] = "dominators"; DataViewType.dominators = 0; DataViewType._map[1] = "types"; DataViewType.types = 1; DataViewType._map[2] = "roots"; DataViewType.roots = 2; })(MemoryAnalyzer.DataViewType || (MemoryAnalyzer.DataViewType = {})); var DataViewType = MemoryAnalyzer.DataViewType; (function (SortOrderType) { SortOrderType._map = []; SortOrderType._map[0] = "ascending"; SortOrderType.ascending = 0; SortOrderType._map[1] = "descending"; SortOrderType.descending = 1; })(MemoryAnalyzer.SortOrderType || (MemoryAnalyzer.SortOrderType = {})); var SortOrderType = MemoryAnalyzer.SortOrderType; var SnapshotDataSource = (function () { function SnapshotDataSource() { } SnapshotDataSource.getDataSource = function getDataSource(viewType, snapshot) { switch(viewType) { case DataViewType.roots: return new SnapshotRootDataSource(snapshot); case DataViewType.types: return new SnapshotTypeDataSource(snapshot); case DataViewType.dominators: return new SnapshotDominatorDataSource(snapshot); default: { throw new Error(Plugin.Resources.getErrorString("JSPerf.1002")); } } }; return SnapshotDataSource; })(); MemoryAnalyzer.SnapshotDataSource = SnapshotDataSource; var SnapshotRootDataSource = (function () { function SnapshotRootDataSource(snapshot) { this.snapshot = snapshot; } SnapshotRootDataSource.prototype.getRootHeapDataTreeItem = function (filter, sorter, startIndex, maxResult) { return Plugin.Promise.as(this.snapshot.getAllRootObjects(filter, sorter)); }; SnapshotRootDataSource.prototype.getHeapDataTreeItem = function (filter, sorter, parentId, startIndex, maxResult) { return this.snapshot.getAllChildrenForObject(parentId, filter, sorter, startIndex, maxResult); }; SnapshotRootDataSource.prototype.getReferenceTreeItems = function (rootObjectId, objectId, nodeId, sorter, displayObjectIds, includeCircularReferences, startIndex, maxResult) { return this.snapshot.getReferenceTreeItems(rootObjectId, objectId, nodeId, sorter, displayObjectIds, includeCircularReferences); }; SnapshotRootDataSource.prototype.getAvailableFields = function () { var fields = []; fields.push("name"); fields.push("type"); if(this.snapshot.isDiff) { fields.push("diffOperation"); } fields.push("size"); fields.push("isDetachedDomNode"); if(this.snapshot.isDiff) { fields.push("sizeDiff"); } fields.push("retainedSize"); if(this.snapshot.isDiff) { fields.push("retainedSizeDiff"); } return fields; }; SnapshotRootDataSource.prototype.getAvailableFieldsForReferenceTree = function () { return this.getAvailableFields(); }; Object.defineProperty(SnapshotRootDataSource.prototype, "hasDetachedDomNodes", { get: function () { return this.snapshot.hasDetachedDomNodes; }, enumerable: true, configurable: true }); return SnapshotRootDataSource; })(); var SnapshotTypeDataSource = (function () { function SnapshotTypeDataSource(snapshot) { this.snapshot = snapshot; } SnapshotTypeDataSource.prototype.getRootHeapDataTreeItem = function (filter, sorter, startIndex, maxResult) { return this.snapshot.getAllTypes(filter, sorter); }; SnapshotTypeDataSource.prototype.getHeapDataTreeItem = function (filter, sorter, parentId, startIndex, maxResult) { return this.snapshot.getAllChildrenForObjectOrType(parentId, filter, sorter, startIndex, maxResult); }; SnapshotTypeDataSource.prototype.getReferenceTreeItems = function (rootObjectId, objectId, nodeId, sorter, displayObjectIds, includeCircularReferences, startIndex, maxResult) { return this.snapshot.getReferenceTreeItems(rootObjectId, objectId, nodeId, sorter, displayObjectIds, includeCircularReferences); }; SnapshotTypeDataSource.prototype.getAvailableFields = function () { var fields = []; fields.push("name"); if(this.snapshot.isDiff) { fields.push("diffOperation"); } fields.push("size"); fields.push("isDetachedDomNode"); if(this.snapshot.isDiff) { fields.push("sizeDiff"); } fields.push("retainedSize"); if(this.snapshot.isDiff) { fields.push("retainedSizeDiff"); } fields.push("childrenCount"); if(this.snapshot.isDiff) { fields.push("childrenCountDiff"); } return fields; }; SnapshotTypeDataSource.prototype.getAvailableFieldsForReferenceTree = function () { var fields = []; fields.push("name"); fields.push("type"); if(this.snapshot.isDiff) { fields.push("diffOperation"); } fields.push("size"); if(this.snapshot.isDiff) { fields.push("sizeDiff"); } fields.push("retainedSize"); return fields; }; Object.defineProperty(SnapshotTypeDataSource.prototype, "hasDetachedDomNodes", { get: function () { return this.snapshot.hasDetachedDomNodes; }, enumerable: true, configurable: true }); return SnapshotTypeDataSource; })(); var SnapshotDominatorDataSource = (function () { function SnapshotDominatorDataSource(snapshot) { this.snapshot = snapshot; } SnapshotDominatorDataSource.prototype.getRootHeapDataTreeItem = function (filter, sorter, startIndex, maxResult) { return this.snapshot.getAllObjects(filter, sorter, startIndex, maxResult); }; SnapshotDominatorDataSource.prototype.getHeapDataTreeItem = function (filter, sorter, parentId, startIndex, maxResult) { return this.snapshot.getRetainedDescendants(parentId, filter, sorter, startIndex, maxResult); }; SnapshotDominatorDataSource.prototype.getReferenceTreeItems = function (rootObjectId, objectId, nodeId, sorter, displayObjectIds, includeCircularReferences, startIndex, maxResult) { return this.snapshot.getReferenceTreeItems(rootObjectId, objectId, nodeId, sorter, displayObjectIds, includeCircularReferences); }; SnapshotDominatorDataSource.prototype.getAvailableFields = function () { var fields = []; fields.push("name"); fields.push("type"); if(this.snapshot.isDiff) { fields.push("diffOperation"); } fields.push("size"); fields.push("isDetachedDomNode"); if(this.snapshot.isDiff) { fields.push("sizeDiff"); } fields.push("retainedSize"); if(this.snapshot.isDiff) { fields.push("retainedSizeDiff"); } return fields; }; SnapshotDominatorDataSource.prototype.getAvailableFieldsForReferenceTree = function () { return this.getAvailableFields(); }; Object.defineProperty(SnapshotDominatorDataSource.prototype, "hasDetachedDomNodes", { get: function () { return this.snapshot.hasDetachedDomNodes; }, enumerable: true, configurable: true }); return SnapshotDominatorDataSource; })(); })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=snapshotDataSource.js.map // snapshotDataView.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; var TreeInfo = (function () { function TreeInfo(gridData, expandStates, toggleFunction, loadMoreFunction) { this.gridData = gridData; this.expandStates = expandStates; this.toggleFunction = toggleFunction; this.loadMoreFunction = loadMoreFunction; } return TreeInfo; })(); MemoryAnalyzer.TreeInfo = TreeInfo; var GridContextMenuData = (function () { function GridContextMenuData(view, objectId, parentObjectId) { this.view = view; this.objectId = objectId; this.parentObjectId = parentObjectId; } return GridContextMenuData; })(); MemoryAnalyzer.GridContextMenuData = GridContextMenuData; var SnapshotDataViewController = (function () { function SnapshotDataViewController(viewType, snapshot, viewSwitcher, displayObjectIDs, showBuiltIns, displayCircularReferences) { this.viewType = viewType; this._dataSource = MemoryAnalyzer.SnapshotDataSource.getDataSource(viewType, snapshot); this._viewSwitcher = viewSwitcher; this.model = new SnapshotDataViewModel(this.viewType, snapshot.isDiff); this.model.displayCircularReferences = displayCircularReferences; this.model.displayObjectIDs = displayObjectIDs; this.model.showBuiltIns = showBuiltIns; this.model.showUnknownTypes = MemoryAnalyzer.Program.userSettings.showUnknownTypes; this.model.showUnknownSizes = MemoryAnalyzer.Program.userSettings.showUnknownSizes; this.view = new SnapshotDataView(this, this.model); } Object.defineProperty(SnapshotDataViewController.prototype, "displayCircularReferences", { get: function () { return this.model.displayCircularReferences; }, set: function (value) { this.model.displayCircularReferences = value; }, enumerable: true, configurable: true }); Object.defineProperty(SnapshotDataViewController.prototype, "displayObjectIDs", { get: function () { return this.model.displayObjectIDs; }, set: function (value) { this.model.displayObjectIDs = value; }, enumerable: true, configurable: true }); Object.defineProperty(SnapshotDataViewController.prototype, "filterString", { get: function () { return this.model.filterString; }, set: function (value) { this.model.filterString = value; }, enumerable: true, configurable: true }); Object.defineProperty(SnapshotDataViewController.prototype, "showBuiltIns", { get: function () { return this.model.showBuiltIns; }, set: function (value) { this.model.showBuiltIns = value; }, enumerable: true, configurable: true }); SnapshotDataViewController.prototype.setSnapshotDataSource = function () { this.model.snapshotDataSource = this._dataSource; this.view.refreshGrids(); }; SnapshotDataViewController.prototype.showPathToRoot = function (objectId, parentObjectId) { this._viewSwitcher.switchToDataView(MemoryAnalyzer.DataViewType.roots); this._viewSwitcher.currentDataView.showPathToRoot(objectId, parentObjectId); }; Object.defineProperty(SnapshotDataViewController.prototype, "currentDataView", { get: function () { return this._viewSwitcher.currentDataView; }, enumerable: true, configurable: true }); Object.defineProperty(SnapshotDataViewController.prototype, "isTextFilterSupported", { get: function () { return this.viewType !== MemoryAnalyzer.DataViewType.roots; }, enumerable: true, configurable: true }); return SnapshotDataViewController; })(); MemoryAnalyzer.SnapshotDataViewController = SnapshotDataViewController; var SnapshotDataViewModel = (function (_super) { __extends(SnapshotDataViewModel, _super); function SnapshotDataViewModel(viewType, isDiff) { if (typeof isDiff === "undefined") { isDiff = false; } _super.call(this); this.viewType = viewType; this._isDiff = isDiff; } Object.defineProperty(SnapshotDataViewModel.prototype, "hasDetachedDomNodes", { get: function () { return this._snapshotDataSource.hasDetachedDomNodes; }, enumerable: true, configurable: true }); Object.defineProperty(SnapshotDataViewModel.prototype, "showBuiltIns", { get: function () { return this._showBuiltIns; }, set: function (v) { if(this._showBuiltIns !== v) { this._showBuiltIns = v; this.raisePropertyChanged("showBuiltIns"); } }, enumerable: true, configurable: true }); Object.defineProperty(SnapshotDataViewModel.prototype, "displayCircularReferences", { get: function () { return this._displayCircularReferences; }, set: function (v) { if(this._displayCircularReferences !== v) { this._displayCircularReferences = v; this.raisePropertyChanged("displayCircularReferences"); } }, enumerable: true, configurable: true }); Object.defineProperty(SnapshotDataViewModel.prototype, "displayObjectIDs", { get: function () { return this._displayObjectIDs; }, set: function (v) { if(this._displayObjectIDs !== v) { this._displayObjectIDs = v; this.raisePropertyChanged("displayObjectIDs"); } }, enumerable: true, configurable: true }); Object.defineProperty(SnapshotDataViewModel.prototype, "showUnknownTypes", { get: function () { return this._showUnknownTypes; }, set: function (v) { if(this._showUnknownTypes !== v) { this._showUnknownTypes = v; this.raisePropertyChanged("showUnknownTypes"); } }, enumerable: true, configurable: true }); Object.defineProperty(SnapshotDataViewModel.prototype, "showUnknownSizes", { get: function () { return this._showUnknownSizes; }, set: function (v) { if(this._showUnknownSizes !== v) { this._showUnknownSizes = v; this.raisePropertyChanged("showUnknownSizes"); } }, enumerable: true, configurable: true }); Object.defineProperty(SnapshotDataViewModel.prototype, "filterString", { get: function () { return this._filterString; }, set: function (v) { if(this._filterString !== v) { this._filterString = v; this.raisePropertyChanged("filterString"); } }, enumerable: true, configurable: true }); Object.defineProperty(SnapshotDataViewModel.prototype, "snapshotDataSource", { get: function () { return this._snapshotDataSource; }, set: function (v) { if(this._snapshotDataSource !== v) { this._snapshotDataSource = v; this.raisePropertyChanged("snapshotDataSource"); } }, enumerable: true, configurable: true }); Object.defineProperty(SnapshotDataViewModel.prototype, "isDiff", { get: function () { return this._isDiff; }, set: function (v) { if(this._isDiff !== v) { this._isDiff = v; this.raisePropertyChanged("isDiff"); } }, enumerable: true, configurable: true }); return SnapshotDataViewModel; })(MemoryAnalyzer.Controls.ObservableViewModel); MemoryAnalyzer.SnapshotDataViewModel = SnapshotDataViewModel; var SnapshotDataView = (function (_super) { __extends(SnapshotDataView, _super); function SnapshotDataView(controller, model, sortProperty) { _super.call(this, "SnapshotDataViewTemplate"); this._fieldNameToColumnMapMainGrid = { }; this._fieldNameToColumnMapReferenceGrid = { }; this._controller = controller; this._model = model; this._model.registerPropertyChanged(this); this._referenceViewContainer = this.findElement("referenceViewContainer"); this._snapshotGridContainer = this.findElement("snapshotGridContainer"); this._reachedItemsCapMessageContainer = this.findElement("reachedItemsCapMessageContainer"); this.findElement("referenceGraphTitleLabel").innerText = Plugin.Resources.getString("ReferenceGraph"); this._snapshotViewGridSplitter = new MemoryAnalyzer.Controls.GridSplitterControl(this.findElement("snapshotViewGridSplitter"), null, this.findElement("snapshotScrollableContainer"), this.refreshGrids.bind(this)); if(!SnapshotDataView._gridContextMenu) { var showInRootsViewMenuItem = { callback: SnapshotDataView.onShowInRootsViewCommand, label: Plugin.Resources.getString("ShowInRootsViewLabel"), type: Plugin.ContextMenu.MenuItemType.command }; SnapshotDataView._gridContextMenu = Plugin.ContextMenu.create([ showInRootsViewMenuItem ]); } if(sortProperty) { this._sortOrder = new Common.Controls.Grid.SortOrderInfo(sortProperty, "desc"); } else if(this._model.isDiff) { if(this._model.viewType === MemoryAnalyzer.DataViewType.types) { this._sortOrder = new Common.Controls.Grid.SortOrderInfo("childrenCountDiff", "desc"); } else { this._sortOrder = new Common.Controls.Grid.SortOrderInfo("retainedSizeDiff", "desc"); } } else if(this._model.viewType === MemoryAnalyzer.DataViewType.types) { this._sortOrder = new Common.Controls.Grid.SortOrderInfo("childrenCount", "desc"); } else { this._sortOrder = new Common.Controls.Grid.SortOrderInfo("retainedSize", "desc"); } this._sortOrderForReferences = new Common.Controls.Grid.SortOrderInfo("retainedSize", "desc"); this.uiUpdateSnapshotDataSource(); } SnapshotDataView._RootsLoadCap = 2000; SnapshotDataView._ChildrenLoadCap = 2000; SnapshotDataView.prototype.onPropertyChanged = function (propertyName) { switch(propertyName) { case "isDiff": case "showBuiltIns": case "showUnknownTypes": case "showUnknownSizes": case "snapshotDataSource": case "filterString": case "displayCircularReferences": case "displayObjectIDs": this.uiUpdateSnapshotDataSource(); break; } }; SnapshotDataView.prototype.refreshGrids = function () { if(this._grid) { this._grid.layout(); } if(this._gridReference) { this._gridReference.layout(); } }; SnapshotDataView.prototype.showPathToRoot = function (objectId, parentObjectId) { var _this = this; var path = this._model.snapshotDataSource.snapshot.getPathToRoot(objectId, this.getFilter(), parentObjectId); if(path && path.length > 0) { var pathFromRoot = path.reverse(); var dataSource = (this._grid)._dataSource; var expandStates = this._grid.getExpandStates(); var dataSourceIndex = 0; for(var pathIndex = 0; pathIndex < pathFromRoot.length; pathIndex++) { for(; dataSourceIndex < dataSource.length; dataSourceIndex++) { if(dataSource[dataSourceIndex].objectId === pathFromRoot[pathIndex]) { if(pathIndex === pathFromRoot.length - 1) { this._grid.setSelectedDataIndex(dataSourceIndex); } else { if(expandStates[dataSourceIndex] < 0) { this._grid.expandNode(dataSourceIndex); } dataSourceIndex++; } break; } else { if(expandStates[dataSourceIndex] !== 0) { dataSourceIndex += Math.abs(expandStates[dataSourceIndex]) - 1; } } } } this._grid.layout(); window.setImmediate(function () { _this._grid.setFocusToSelectedRow(); }); } }; SnapshotDataView.prototype.sortBy = function (sortProperty, sortOrder) { this._sortOrder.index = sortProperty; this._sortOrder.order = sortOrder; this.updateTree(); }; SnapshotDataView.prototype.onGridContextMenu = function (grid, e) { if(this._model.viewType !== MemoryAnalyzer.DataViewType.roots || grid === this._gridReference) { var dataIndex = grid.getSelectedDataIndex(); var foundRow = false; var menuX = e.pageX; var menuY = e.pageY; if(e.clientX === 0 && e.clientY === 0) { foundRow = (dataIndex > -1); var row = grid.getRowInfo(dataIndex).row; if(row) { var rect = row.getBoundingClientRect(); menuX = Math.round(rect.left + (rect.width / 4)); menuY = Math.round(rect.top + (rect.height / 2)); } else { foundRow = false; } } else { var clickedElement = document.elementFromPoint(e.clientX, e.clientY); while(clickedElement) { if(clickedElement && clickedElement.classList) { if(clickedElement.classList.contains("grid-row")) { foundRow = true; break; } else if(clickedElement.classList.contains("grid-canvas")) { break; } } clickedElement = clickedElement.parentElement; } } if(foundRow) { var objectId = -1; if(typeof dataIndex === "number" && dataIndex >= 0) { var obj = grid.getRowData(dataIndex); if(!(obj instanceof MemoryAnalyzer.TypeDataObject)) { objectId = obj.objectId; } } if(objectId >= 0) { if(SnapshotDataView._gridContextMenu) { SnapshotDataView._gridContextMenuData = new GridContextMenuData(this, objectId, obj.parentObjectId); SnapshotDataView._gridContextMenu.show(menuX, menuY); } } else { SnapshotDataView._gridContextMenuData = null; } } } e.preventDefault(); e.stopImmediatePropagation(); return false; }; SnapshotDataView.prototype.uiUpdateAll = function () { this.uiUpdateSnapshotDataSource(); }; SnapshotDataView.prototype.uiUpdateSnapshotDataSource = function () { if(this._model.snapshotDataSource) { var isDiff = this._model.snapshotDataSource.snapshot.isDiff; this._fieldNameToColumnMapMainGrid = SnapshotDataView.populateFieldNameToColumnMap(isDiff); this._fieldNameToColumnMapReferenceGrid = SnapshotDataView.populateFieldNameToColumnMap(isDiff); } this._referenceViewContainer.style.display = "none"; this.updateTree(); }; SnapshotDataView.prototype.getFilter = function () { return { displayObjectIDs: this._model.displayObjectIDs, showBuiltIns: this._model.showBuiltIns, showUnknownTypes: this._model.showUnknownTypes, showUnknownSizes: this._model.showUnknownSizes, filterString: this._model.filterString }; }; SnapshotDataView.prototype.getSorter = function () { return { sortProperty: this._sortOrder.index, sortOrder: this._sortOrder.order === "asc" ? MemoryAnalyzer.SortOrderType.ascending : MemoryAnalyzer.SortOrderType.descending, sortComparer: SnapshotDataView.getSortComparer(this._sortOrder, this._fieldNameToColumnMapMainGrid) }; }; SnapshotDataView.prototype.getSorterForReferences = function () { return { sortProperty: this._sortOrderForReferences.index, sortOrder: this._sortOrderForReferences.order === "asc" ? MemoryAnalyzer.SortOrderType.ascending : MemoryAnalyzer.SortOrderType.descending, sortComparer: SnapshotDataView.getSortComparer(this._sortOrderForReferences, this._fieldNameToColumnMapReferenceGrid) }; }; SnapshotDataView.prototype.updateTree = function () { var _this = this; if(!this._model.snapshotDataSource) { return; } if(this._rootQueryPromise) { MemoryAnalyzer.Program.traceWriter.raiseEvent(Common.TraceEvents.Memory_DisplayFirstLevelSnapshotData_Stop); this._rootQueryPromise.cancel(); } MemoryAnalyzer.Program.traceWriter.raiseEvent(Common.TraceEvents.Memory_DisplayFirstLevelSnapshotData_Start); this._rootQueryPromise = this._model.snapshotDataSource.getRootHeapDataTreeItem(this.getFilter(), this.getSorter(), 0, SnapshotDataView._RootsLoadCap); this._rootQueryPromise.done(function (dataSet) { var roots = dataSet.items; var treeInfo = _this.getTreeInfo(roots, function (item, startIndex, maxResult) { return _this._model.snapshotDataSource.getHeapDataTreeItem(_this.getFilter(), _this.getSorter(), item.id, startIndex, maxResult); }); var columns = _this.getColumnInfoForMainGrid(_this._model.snapshotDataSource.getAvailableFields()); var gridOptions = new Common.Controls.Grid.GridOptions(treeInfo.toggleFunction, treeInfo.loadMoreFunction, columns, [ _this._sortOrder ], null, _this.notifyRowSelected.bind(_this)); gridOptions.disableRightClickSelection = false; if(!_this._grid) { if(_this._model.hasDetachedDomNodes) { var gutterIcon = { cssClass: "", index: "", gutterIconCssCallback: SnapshotDataView.getWarningCss }; gridOptions.gutter.backgroundColor = Plugin.Theme.getValue("plugin-background-color"); gridOptions.gutter.icon = gutterIcon; gridOptions.gutter.headerClickSortColumn = _this._fieldNameToColumnMapMainGrid["isDetachedDomNode"]; gridOptions.gutter.getTooltip = _this.detachedDomNodeTooltip.bind(_this); } _this._grid = _this.createGrid(treeInfo.gridData, treeInfo.expandStates, gridOptions, _this._snapshotGridContainer); _this._grid.getElement().tabIndex = 4; _this._grid.getElement().addEventListener("sort", _this.sortCompleted.bind(_this)); _this._grid.getElement().addEventListener("sortStarted", _this.sortStarted.bind(_this)); _this._grid.getElement().addEventListener("selectionchanged", _this.onGridSelectionChanged.bind(_this)); } else { _this._grid.setDataSource(treeInfo.gridData, treeInfo.expandStates, gridOptions.columns, gridOptions.sortOrders); } if(dataSet.totalCount > dataSet.items.length) { _this._reachedItemsCapMessageContainer.style.display = "block"; _this._reachedItemsCapMessageContainer.innerText = Plugin.Resources.getString("ReachedItemsCapMessage", MemoryAnalyzer.FormattingHelpers.getDecimalLocaleString(dataSet.items.length, true), MemoryAnalyzer.FormattingHelpers.getDecimalLocaleString(dataSet.totalCount, true)); } else { _this._reachedItemsCapMessageContainer.style.display = "none"; } MemoryAnalyzer.Program.traceWriter.raiseEvent(Common.TraceEvents.Memory_DisplayFirstLevelSnapshotData_Stop); }); }; SnapshotDataView.prototype.detachedDomNodeTooltip = function (dataIndex, dataSource) { var originalItem = dataSource[dataIndex]; if(originalItem.isDetachedDomNode) { if(originalItem.isWinJsDisposable) { return Plugin.Resources.getString("DetachedDomNodeDisposableTooltip"); } else { return Plugin.Resources.getString("DetachedDomNodeTooltip"); } } else { return null; } }; SnapshotDataView.prototype.onGridSelectionChanged = function (args) { var item; var customArgs = args.customData[0]; if(customArgs.selectedCount === 1) { var dataIndex = customArgs.selectedRows[customArgs.selectedIndex]; if(typeof dataIndex !== "undefined") { item = this._grid.getRowData(dataIndex); } } this.showReferences(item); }; SnapshotDataView.prototype.notifyRowSelected = function () { Notifications.notify(MemoryAnalyzer.MemoryNotifications.DetailsViewRowSelected); }; SnapshotDataView.prototype.showReferences = function (item) { var _this = this; var items; if(item && item.id && !isNaN(item.id)) { items = this._model.snapshotDataSource.getReferenceTreeItems(item.id, item.id, 0, this.getSorterForReferences(), this._model.displayObjectIDs, this._model.displayCircularReferences, 0, -1).items; } if(!items || items.length === 0) { this._referenceViewContainer.style.display = "none"; return; } var rootItemId = item.id; var treeInfo = this.getTreeInfo(items, function (parentItem, startIndex, maxResult) { return _this._model.snapshotDataSource.getReferenceTreeItems(rootItemId, (parentItem).parentObjectId, (parentItem).nodeId, _this.getSorterForReferences(), _this._model.displayObjectIDs, _this._model.displayCircularReferences, 0, -1); }); var columns = this.getColumnInfoForReferenceGrid(this._model.snapshotDataSource.getAvailableFieldsForReferenceTree()); var gridOptions = new Common.Controls.Grid.GridOptions(treeInfo.toggleFunction, treeInfo.loadMoreFunction, columns, [ this._sortOrderForReferences ], null, this.notifyRowSelected.bind(this)); gridOptions.disableRightClickSelection = false; gridOptions.ariaTitle = Plugin.Resources.getString("ReferenceGraph"); if(!this._gridReference) { if(this._model.hasDetachedDomNodes) { var gutterIcon = { cssClass: "", index: "", gutterIconCssCallback: SnapshotDataView.getWarningCss }; gridOptions.gutter.backgroundColor = Plugin.Theme.getValue("plugin-perftools-detail-pane"); gridOptions.gutter.icon = gutterIcon; gridOptions.gutter.headerClickSortColumn = this._fieldNameToColumnMapMainGrid["isDetachedDomNode"]; gridOptions.gutter.getTooltip = this.detachedDomNodeTooltip.bind(this); } this._gridReference = this.createGrid(treeInfo.gridData, treeInfo.expandStates, gridOptions, this._referenceViewContainer); this._gridReference.getElement().tabIndex = 4; this._gridReference.getElement().addEventListener("sort", this.sortCompletedForReferences.bind(this)); } else { this._gridReference.setDataSource(treeInfo.gridData, treeInfo.expandStates, gridOptions.columns, gridOptions.sortOrders); this._gridReference.updateGetChildDataCallback(treeInfo.toggleFunction); } this._referenceViewContainer.style.removeProperty("display"); if(items.length === 1 && items[0].hasChildren) { this._gridReference.expandNode(0); } }; SnapshotDataView.prototype.getMoreText = function (totalLoaded, totalCount, capCount) { var hasMoreText; if(totalLoaded < totalCount) { var toLoadCount = Math.min(capCount, totalCount - totalLoaded); hasMoreText = Plugin.Resources.getString("ChildrenLoadNext", MemoryAnalyzer.FormattingHelpers.getDecimalLocaleString(toLoadCount, true)); } return hasMoreText; }; SnapshotDataView.prototype.getTreeInfo = function (roots, getChildren) { var _this = this; var rowsAndExpandStates = this.getPlaceholderRowsAndExpandStates(roots); var items = rowsAndExpandStates.itemsWithPlaceholders; var expandStates = rowsAndExpandStates.expandStates; var toggleFunction = function (parentTreeItem, complete) { var dataSet = getChildren(parentTreeItem, 0, SnapshotDataView._ChildrenLoadCap); var hasMoreText = _this.getMoreText(dataSet.items.length, dataSet.totalCount, SnapshotDataView._ChildrenLoadCap); if(hasMoreText) { (parentTreeItem).nextStartIndex = dataSet.items.length; } complete(_this.getPlaceholderRowsAndExpandStates(dataSet.items), hasMoreText); }; var loadMoreFunction = function (parentTreeItem, complete) { var startIndex = (parentTreeItem).nextStartIndex; if(!startIndex) { return; } var dataSet = getChildren(parentTreeItem, startIndex, SnapshotDataView._ChildrenLoadCap); var hasMoreText = _this.getMoreText(startIndex + dataSet.items.length, dataSet.totalCount, SnapshotDataView._ChildrenLoadCap); if(hasMoreText) { (parentTreeItem).nextStartIndex = startIndex + dataSet.items.length; } complete(_this.getPlaceholderRowsAndExpandStates(dataSet.items), hasMoreText); }; return new TreeInfo(items, expandStates, toggleFunction, loadMoreFunction); }; SnapshotDataView.prototype.getPlaceholderRowsAndExpandStates = function (roots) { var items = []; var placeHolderRow = { name: "", value: "", isPlaceholder: true }; var expandStates = []; for(var i = 0; roots && i < roots.length; i++) { items.push(roots[i]); if(roots[i].hasChildren) { expandStates.push(-1); items.push(placeHolderRow); expandStates.push(0); } else { expandStates.push(0); } } return { itemsWithPlaceholders: items, expandStates: expandStates }; }; SnapshotDataView.prototype.createGrid = function (gridData, expandStates, gridOptions, container) { container.innerHTML = ""; var grid = new Common.Controls.Grid.GridControl(container, gridOptions); grid.setDataSource(gridData, expandStates, gridOptions.columns, gridOptions.sortOrders); container.addEventListener("contextmenu", this.onGridContextMenu.bind(this, grid)); container.addEventListener("keydown", this.onKeyDown.bind(this)); return grid; }; SnapshotDataView.prototype.getColumnInfo = function (fieldNames, fieldNamesToColumnInfo) { var columnInfo = []; for(var i = 0; i < fieldNames.length; i++) { if(fieldNamesToColumnInfo.hasOwnProperty(fieldNames[i])) { columnInfo.push(fieldNamesToColumnInfo[fieldNames[i]]); } else { throw new Error(Plugin.Resources.getErrorString("JSPerf.1003")); } } return columnInfo; }; SnapshotDataView.prototype.getColumnInfoForMainGrid = function (fieldNames) { return this.getColumnInfo(fieldNames, this._fieldNameToColumnMapMainGrid); }; SnapshotDataView.prototype.getColumnInfoForReferenceGrid = function (fieldNames) { return this.getColumnInfo(fieldNames, this._fieldNameToColumnMapReferenceGrid); }; SnapshotDataView.prototype.onKeyDown = function (e) { if(e.keyCode === Common.KeyCodes.F10 && e.shiftKey) { var evt = document.createEvent("MouseEvent"); evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); this.onGridContextMenu(this._grid, evt); } }; SnapshotDataView.prototype.sortCompleted = function (event) { var customData = event.customData[0]; this._sortOrder = customData.sortOrder[0]; MemoryAnalyzer.Program.onIdle(); MemoryAnalyzer.Program.traceWriter.raiseEvent(Common.TraceEvents.Memory_GridSort_Stop); }; SnapshotDataView.prototype.sortStarted = function (event) { MemoryAnalyzer.Program.traceWriter.raiseEvent(Common.TraceEvents.Memory_GridSort_Start); }; SnapshotDataView.prototype.sortCompletedForReferences = function (event) { var customData = event.customData[0]; this._sortOrderForReferences = customData.sortOrder[0]; }; SnapshotDataView.getSortComparer = function getSortComparer(sortOrder, fieldNameToColumnMap) { var column = fieldNameToColumnMap[sortOrder.index], comparer = column.comparer, isAsc = sortOrder.order === "asc"; return function (v1, v2) { var result = comparer(column, sortOrder.order, v1, v2); return isAsc ? result : -result; }; }; SnapshotDataView.getWarningCss = function getWarningCss(dataIndex, dataSource) { var item = dataSource[dataIndex]; if(item.isDetachedDomNode) { return "detachedDomNodeWarning"; } }; SnapshotDataView.populateFieldNameToColumnMap = function populateFieldNameToColumnMap(isDiff) { var fieldNameToColumnMap = { }; fieldNameToColumnMap["name"] = new Common.Controls.Grid.ColumnInfo("name", Plugin.Resources.getString("Identifiers"), Plugin.Resources.getString("IdentifiersTooltip"), 350, true, null, isDiff ? SnapshotDataView.getDiffNameCellCSSClass : null, SnapshotDataView.columnComparerForStrings, true); fieldNameToColumnMap["type"] = new Common.Controls.Grid.ColumnInfo("type", Plugin.Resources.getString("Type"), Plugin.Resources.getString("TypeTooltip"), 150, true, null, isDiff ? SnapshotDataView.getDiffNameCellCSSClass : null, SnapshotDataView.columnComparerForStrings); fieldNameToColumnMap["diffOperation"] = new Common.Controls.Grid.ColumnInfo("diffOperation", Plugin.Resources.getString("DiffColumnOperationHeader"), Plugin.Resources.getString("DiffColumnOperationHeader"), 100, true, null, SnapshotDataView.getDiffNameCellCSSClass, SnapshotDataView.columnComparerForStrings); fieldNameToColumnMap["size"] = new Common.Controls.Grid.ColumnInfo("size", Plugin.Resources.getString("Size"), Plugin.Resources.getString("SizeTooltip"), 100, true, SnapshotDataView.formatSize, null, SnapshotDataView.columnComparerForNumbers); fieldNameToColumnMap["retainedSize"] = new Common.Controls.Grid.ColumnInfo("retainedSize", Plugin.Resources.getString("RetainedSize"), Plugin.Resources.getString("RetainedSizeTooltip"), 100, true, SnapshotDataView.formatRetainedSize, null, SnapshotDataView.columnComparerForNumbers); fieldNameToColumnMap["childrenCount"] = new Common.Controls.Grid.ColumnInfo("childrenCount", Plugin.Resources.getString("Count"), Plugin.Resources.getString("CountTooltip"), 50, true, SnapshotDataView.formatChildrenCount, null, SnapshotDataView.columnComparerForNumbers); fieldNameToColumnMap["sizeDiff"] = new Common.Controls.Grid.ColumnInfo("sizeDiff", Plugin.Resources.getString("SizeDiff"), Plugin.Resources.getString("SizeDiffTooltip"), 100, true, SnapshotDataView.formatSizeDiff, null, SnapshotDataView.columnComparerForNumbers); fieldNameToColumnMap["retainedSizeDiff"] = new Common.Controls.Grid.ColumnInfo("retainedSizeDiff", Plugin.Resources.getString("RetainedSizeDiff"), Plugin.Resources.getString("RetainedSizeDiffTooltip"), 150, true, SnapshotDataView.formatRetainedSizeDiff, null, SnapshotDataView.columnComparerForNumbers); fieldNameToColumnMap["childrenCountDiff"] = new Common.Controls.Grid.ColumnInfo("childrenCountDiff", Plugin.Resources.getString("CountDiff"), Plugin.Resources.getString("CountDiffTooltip"), 100, true, SnapshotDataView.formatChildrenCountDiff, null, SnapshotDataView.columnComparerForNumbers); fieldNameToColumnMap["isDetachedDomNode"] = new Common.Controls.Grid.ColumnInfo("isDetachedDomNode", "", "", 0, true, null, null, SnapshotDataView.columnComparerForStrings); fieldNameToColumnMap["isDetachedDomNode"].hidden = true; fieldNameToColumnMap["name"].hasMoreColumn = true; return fieldNameToColumnMap; }; SnapshotDataView.columnComparerForNumbers = function columnComparerForNumbers(column, order, rowA, rowB) { var n1 = rowA[column.index] || 0, n2 = rowB[column.index] || 0; return n1 - n2; }; SnapshotDataView.columnComparerForStrings = function columnComparerForStrings(column, order, rowA, rowB) { return SnapshotDataView.naturalSort(rowA[column.index], rowB[column.index]); }; SnapshotDataView.naturalSort = function naturalSort(a, b) { var regexSortGroup = /(\d+)|(\D+)/g; var aGroups = String(a).toLowerCase().match(regexSortGroup); var bGroups = String(b).toLowerCase().match(regexSortGroup); while(aGroups.length > 0 && bGroups.length > 0) { var aFront = aGroups.shift(); var bFront = bGroups.shift(); var aAsDigit = parseInt(aFront, 10); var bAsDigit = parseInt(bFront, 10); if(isNaN(aAsDigit) && isNaN(bAsDigit)) { if(aFront !== bFront) { return (aFront > bFront ? 1 : -1); } } else if(isNaN(aAsDigit)) { return 1; } else if(isNaN(bAsDigit)) { return -1; } else { if(aAsDigit !== bAsDigit) { return (aAsDigit - bAsDigit); } } } return aGroups.length - bGroups.length; }; SnapshotDataView.onShowInRootsViewCommand = function onShowInRootsViewCommand() { if(SnapshotDataView._gridContextMenuData && SnapshotDataView._gridContextMenuData.view) { SnapshotDataView._gridContextMenuData.view._controller.showPathToRoot(SnapshotDataView._gridContextMenuData.objectId, SnapshotDataView._gridContextMenuData.parentObjectId); SnapshotDataView._gridContextMenuData = null; } }; SnapshotDataView.formatChildrenCount = function formatChildrenCount(dataIndex, columnIndex, columnOrder, dataSource, isForTooltip) { var originalItem = dataSource[dataIndex]; if(originalItem.childrenCount) { return MemoryAnalyzer.FormattingHelpers.getDecimalLocaleString(originalItem.childrenCount, true); } else { return ""; } }; SnapshotDataView.formatChildrenCountDiff = function formatChildrenCountDiff(dataIndex, columnIndex, columnOrder, dataSource, isForTooltip) { var originalItem = dataSource[dataIndex]; if(originalItem.childrenCountDiff) { return (originalItem.childrenCountDiff > 0 ? "+" : "-") + MemoryAnalyzer.FormattingHelpers.getDecimalLocaleString(originalItem.childrenCountDiff, true); } else { return ""; } }; SnapshotDataView.formatSize = function formatSize(dataIndex, columnIndex, columnOrder, dataSource, isForTooltip) { var originalItem = dataSource[dataIndex]; if(originalItem.size) { var text = MemoryAnalyzer.FormattingHelpers.getPrettyPrintSize(originalItem.size) + (originalItem.isSizeApproximate ? "*" : " "); if(isForTooltip && originalItem.isSizeApproximate) { text = Plugin.Resources.getString("ApproximateSizeTooltip", text); } return text; } else { return ""; } }; SnapshotDataView.formatRetainedSize = function formatRetainedSize(dataIndex, columnIndex, columnOrder, dataSource, isForTooltip) { var namedHeapObject = dataSource[dataIndex]; if(namedHeapObject.retainedSize) { return MemoryAnalyzer.FormattingHelpers.getPrettyPrintSize(namedHeapObject.retainedSize); } else { return ""; } }; SnapshotDataView.formatRetainedSizeDiff = function formatRetainedSizeDiff(dataIndex, columnIndex, columnOrder, dataSource, isForTooltip) { var namedHeapObject = dataSource[dataIndex]; if(namedHeapObject.retainedSizeDiff) { return (namedHeapObject.retainedSizeDiff > 0 ? "+" : "-") + MemoryAnalyzer.FormattingHelpers.getPrettyPrintSize(Math.abs(namedHeapObject.retainedSizeDiff)); } else { return ""; } }; SnapshotDataView.formatSizeDiff = function formatSizeDiff(dataIndex, columnIndex, columnOrder, dataSource, isForTooltip) { var namedHeapObject = dataSource[dataIndex]; if(namedHeapObject.sizeDiff) { return (namedHeapObject.sizeDiff > 0 ? "+" : "-") + MemoryAnalyzer.FormattingHelpers.getPrettyPrintSize(Math.abs(namedHeapObject.sizeDiff)); } else { return ""; } }; SnapshotDataView.getDiffNameCellCSSClass = function getDiffNameCellCSSClass(dataIndex, columnIndex, columnOrder, dataSource) { var item = dataSource[dataIndex]; if(item.isAdded) { return "diffAddedObject"; } else if(item.isChanged) { return "diffModifiedObject"; } return null; }; return SnapshotDataView; })(Common.Controls.TemplateControl); MemoryAnalyzer.SnapshotDataView = SnapshotDataView; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=snapshotDataView.js.map // snapshotDataViewTab.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; var SnapshotDataViewTab = (function (_super) { __extends(SnapshotDataViewTab, _super); function SnapshotDataViewTab(snapshotDataViewController) { _super.call(this); this._snapshotDataViewController = snapshotDataViewController; this.title = Plugin.Resources.getString(Common.Enum.GetName(MemoryAnalyzer.DataViewType, this._snapshotDataViewController.model.viewType)); this.tooltipString = Plugin.Resources.getString(Common.Enum.GetName(MemoryAnalyzer.DataViewType, this._snapshotDataViewController.model.viewType) + "Tooltip"); this.content = this._snapshotDataViewController.view; } Object.defineProperty(SnapshotDataViewTab.prototype, "controller", { get: function () { return this._snapshotDataViewController; }, enumerable: true, configurable: true }); SnapshotDataViewTab.prototype.onActiveChanged = function () { if(this.active) { this._snapshotDataViewController.setSnapshotDataSource(); } }; return SnapshotDataViewTab; })(MemoryAnalyzer.Controls.TabItem); MemoryAnalyzer.SnapshotDataViewTab = SnapshotDataViewTab; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=snapshotDataViewTab.js.map // snapshotDiffController.ts var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; var SnapshotDiffController = (function () { function SnapshotDiffController(storageId) { this._storageId = storageId; this.model = new MemoryAnalyzer.SnapshotViewModel(); this.model.progressText = Plugin.Resources.getString("GeneratingComparisonView"); this.view = new MemoryAnalyzer.SnapshotView(this, this.model); } Object.defineProperty(SnapshotDiffController.prototype, "currentDataViewController", { get: function () { return this.view.currentDataViewController; }, enumerable: true, configurable: true }); SnapshotDiffController.prototype.getSnapshotDataViewController = function (viewType) { var controller = new MemoryAnalyzer.SnapshotDataViewController(viewType, this.model.snapshot, this.view, this.model.displayObjectIDs, this.model.showBuiltIns, this.model.displayCircularReferences); return controller; }; SnapshotDiffController.prototype.diffSnapshots = function (storageId, relativePaths, targetView, sortProperty) { var _this = this; this.setTargetView(targetView, sortProperty); var snapshotPaths = []; for(var i = 0; i < relativePaths.length; i++) { var path = MemoryAnalyzer.Program.shell.getSnapshotFullPath(storageId, relativePaths[i]); snapshotPaths.push(path); } MemoryAnalyzer.Program.memoryAnalyzerData.processSnapshotDiff(snapshotPaths).done(this.onDiffCompleted.bind(this), this.onDiffFailed.bind(this), function (progress) { _this.model.progressText = Plugin.Resources.getString(progress.stringId); _this.model.progressValue = progress.percentage; }); }; SnapshotDiffController.prototype.setTargetView = function (targetView, sortProperty) { this.model.targetView = targetView; this.model.sortProperty = sortProperty; }; SnapshotDiffController.prototype.onDiffCompleted = function (snapshotData) { var snapshot = new MemoryAnalyzer.Snapshot(snapshotData, true); this.model.snapshot = snapshot; MemoryAnalyzer.Program.onIdle(); }; SnapshotDiffController.prototype.onDiffFailed = function (error) { this.model.latestSnapshotError = error; MemoryAnalyzer.Program.onIdle(); }; return SnapshotDiffController; })(); MemoryAnalyzer.SnapshotDiffController = SnapshotDiffController; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=snapshotDiffController.js.map // snapshotFile.ts var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; var SnapshotFile = (function () { function SnapshotFile(storageId, relativePath) { this.storageId = storageId; this.relativePath = relativePath; } return SnapshotFile; })(); MemoryAnalyzer.SnapshotFile = SnapshotFile; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=snapshotFile.js.map // snapshotSummary.ts var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; var SnapshotSummary = (function () { function SnapshotSummary(snapshotDataSummary, snapshotFile, timeTaken, id) { this.detachedDomNodeCount = snapshotDataSummary.detachedDomNodeCount; this.id = id; this.objectsCount = snapshotDataSummary.objectsCount; this.processPrivateBytes = snapshotDataSummary.privateBytes.toString(); this.pointerSize = snapshotDataSummary.pointerSize; this.screenshotData = snapshotDataSummary.base64Image; this.snapshotFile = snapshotFile; this.statsAddedObjects = snapshotDataSummary.statsAddedObjects; this.statsDeletedObjects = snapshotDataSummary.statsDeletedObjects; this.taken = timeTaken; this.totalObjectSize = snapshotDataSummary.totalObjectSize; } Object.defineProperty(SnapshotSummary, "fileExtension", { get: function () { return ".snapshotsummary"; }, enumerable: true, configurable: true }); SnapshotSummary.prototype.save = function (completed, failed) { var _this = this; var summaryRelativePath = this.snapshotFile.relativePath + SnapshotSummary.fileExtension; Plugin.Storage.createFile(this.snapshotFile.storageId + "\\" + summaryRelativePath, { access: Plugin.Storage.FileAccess.write, encoding: "UTF-8", persistence: Plugin.Storage.FilePersistence.temporary, type: Plugin.Storage.FileType.text }).done(function (file) { file.write(JSON.stringify(_this)).done(function () { file.close(); completed(); }, function (error) { file.close(); if(failed) { failed(error); } }); }, function (error) { if(failed) { failed(error); } }); }; SnapshotSummary.load = function load(storageId, relativePath, completed, failed) { var stream; var snapshotSummary; Plugin.Storage.openFile(storageId + "\\" + relativePath, { access: Plugin.Storage.FileAccess.read, encoding: "UTF-8", persistence: Plugin.Storage.FilePersistence.temporary, type: Plugin.Storage.FileType.text }).then(function (file) { stream = file; return file.read(); }).then(function (snapshotResultString) { snapshotSummary = JSON.parse(snapshotResultString); snapshotSummary.snapshotFile.storageId = storageId; return stream.close(); }).done(function () { completed(snapshotSummary); }, function (error) { if(failed) { failed(error); } }); }; return SnapshotSummary; })(); MemoryAnalyzer.SnapshotSummary = SnapshotSummary; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=snapshotSummary.js.map // snapshotTab.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; var SnapshotTab = (function (_super) { __extends(SnapshotTab, _super); function SnapshotTab(controller) { _super.call(this); this._snapshotViewController = controller; this.content = controller.view; } SnapshotTab.prototype.onActiveChanged = function () { if(this.active) { var currentDataView = this._snapshotViewController.view.currentDataView; if(currentDataView) { currentDataView.refreshGrids(); } } }; return SnapshotTab; })(MemoryAnalyzer.Controls.TabItem); MemoryAnalyzer.SnapshotTab = SnapshotTab; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=snapshotTab.js.map // snapshotTileView.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; var SnapshotTileViewModel = (function () { function SnapshotTileViewModel(summary, snapshotSummaryCollection) { this._summary = summary; this._snapshotSummaryCollection = snapshotSummaryCollection; } Object.defineProperty(SnapshotTileViewModel.prototype, "summaryData", { get: function () { return this._summary; }, enumerable: true, configurable: true }); Object.defineProperty(SnapshotTileViewModel.prototype, "timeTaken", { get: function () { var date = new Date(this._summary.taken); return "(" + date.toLocaleTimeString() + ")"; }, enumerable: true, configurable: true }); Object.defineProperty(SnapshotTileViewModel.prototype, "detachedDomNodeCount", { get: function () { return this._summary.detachedDomNodeCount; }, enumerable: true, configurable: true }); Object.defineProperty(SnapshotTileViewModel.prototype, "processPrivateBytes", { get: function () { return MemoryAnalyzer.FormattingHelpers.getPrettyPrintSize(parseInt(this.summaryData.processPrivateBytes)); }, enumerable: true, configurable: true }); Object.defineProperty(SnapshotTileViewModel.prototype, "totalObjectSize", { get: function () { return MemoryAnalyzer.FormattingHelpers.getPrettyPrintSize(this.summaryData.totalObjectSize); }, enumerable: true, configurable: true }); Object.defineProperty(SnapshotTileViewModel.prototype, "objectsCount", { get: function () { return this.summaryData.objectsCount; }, enumerable: true, configurable: true }); SnapshotTileViewModel.prototype.getComparableSnapshots = function () { var result = []; var currentSnapshotDate = this._summary.taken; for(var i = 0; i < this._snapshotSummaryCollection.length; i++) { var snapshot = this._snapshotSummaryCollection.getItem(i); if(snapshot.id !== this._summary.id) { result.push(snapshot); } } result = result.sort(function (a, b) { return a.id - b.id; }); return result; }; return SnapshotTileViewModel; })(); MemoryAnalyzer.SnapshotTileViewModel = SnapshotTileViewModel; var SnapshotTileView = (function (_super) { __extends(SnapshotTileView, _super); function SnapshotTileView(controller, model) { _super.call(this, "SnapshotTileTemplate"); this._controller = controller; this._model = model; this._tileContextMenuItems = []; this._snapshotTile = this.findElement("snapshotTile"); this._comparableSnapshots = this._model.getComparableSnapshots(); this._tileHeader = this.findElement("snapshotTileHeader"); this.findElement("snapshotTileTitle").innerText = Plugin.Resources.getString("SnapshotNumber", this._model.summaryData.id); if(this._model.summaryData.screenshotData) { var imgHolder = this.findElement("snapshotTileImage"); imgHolder.src = "data:image/jpeg;base64," + this._model.summaryData.screenshotData.replace(/\r\n/g, ""); imgHolder.alt = Plugin.Resources.getString("Screenshot"); } var objectsCountText = MemoryAnalyzer.FormattingHelpers.getDecimalLocaleString(this._model.objectsCount, true); this.findElement("snapshotTakenDate").innerText = this._model.timeTaken; this.findElement("heapSizeLink").innerText = this._model.totalObjectSize; this.findElement("objectsCountLink").innerText = Plugin.Resources.getString("ObjectsCount", objectsCountText); this.findElement("heapSizeLink").setAttribute("data-plugin-vs-tooltip", Plugin.Resources.getString("HeapSizeLinkTooltip")); this.findElement("objectsCountLink").setAttribute("data-plugin-vs-tooltip", Plugin.Resources.getString("ObjectsCountLinkTooltip")); this.setupSizeDiff(this.findElement("heapDiffLink"), this.findElement("heapDiffIndicatorIcon")); this.setupCountDiff(this.findElement("objectsDiffLink"), this.findElement("objectDiffIndicatorIcon")); this.findElement("heapSizeLink").onclick = this.onSizeClick.bind(this); this.findElement("objectsCountLink").onclick = this.onObjectCountClick.bind(this); this.findElement("heapDiffLink").onclick = this.onDiffClick.bind(this); this.findElement("objectsDiffLink").onclick = this.onObjectDiffClick.bind(this); if(model.detachedDomNodeCount > 0) { var detachedDomNodeCount = this.findElement("snapshotTileDetachedDomNodeCount"); detachedDomNodeCount.innerText = model.detachedDomNodeCount.toString(); detachedDomNodeCount.setAttribute("data-plugin-vs-tooltip", Plugin.Resources.getString("PotentialIssuesTooltip")); detachedDomNodeCount.setAttribute("aria-label", Plugin.Resources.getString("PotentialIssuesTooltip")); detachedDomNodeCount.onclick = this.onDetachedDomNodesClick.bind(this); this.findElement("snapshotTileDetachedDomNodeInfo").style.visibility = "visible"; } var links = this.findElementsByClassName("BPT-FileLink"); for(var linkIndex = 0; linkIndex < links.length; linkIndex++) { var linkElement = links[linkIndex]; (function (link) { link.onkeydown = function (e) { if((e.keyCode === Common.KeyCodes.ENTER || e.keyCode === Common.KeyCodes.SPACE) && !e.ctrlKey && !e.altKey && !e.shiftKey) { link.click(); } }; })(linkElement); } this.populateContextMenu(); } SnapshotTileView.prototype.onCollectionChanged = function (eventArgs) { if(eventArgs.action === MemoryAnalyzer.Controls.NotifyCollectionChangedAction.Add) { var newSummary = eventArgs.newItems[0]; if(this._model.summaryData.id !== newSummary.id) { var contextMenuItem = { callback: this.diffTo.bind(this, newSummary.id), label: Plugin.Resources.getString("SnapshotNumber", newSummary.id), type: Plugin.ContextMenu.MenuItemType.command }; this._tileContextMenuItems.push(contextMenuItem); } this.createContextMenu(); } }; SnapshotTileView.prototype.setFocus = function () { this._tileHeader.focus(); }; SnapshotTileView.prototype.createContextMenu = function () { if(this._tileContextMenu) { this._tileContextMenu.detach(this._snapshotTile); } if(this._tileContextMenuItems.length > 0) { var compareToMenuItem = { callback: function () { }, label: Plugin.Resources.getString("CompareTo"), submenu: this._tileContextMenuItems, type: Plugin.ContextMenu.MenuItemType.command }; this._tileContextMenu = Plugin.ContextMenu.create([ compareToMenuItem ]); this._tileContextMenu.attach(this._snapshotTile); } }; SnapshotTileView.prototype.populateContextMenu = function () { this._comparableSnapshots = this._model.getComparableSnapshots(); for(var i = 0; i < this._comparableSnapshots.length; i++) { var comparable = this._comparableSnapshots[i]; var contextMenuItem = { callback: this.diffTo.bind(this, comparable.id), label: Plugin.Resources.getString("SnapshotNumber", comparable.id), type: Plugin.ContextMenu.MenuItemType.command }; this._tileContextMenuItems.push(contextMenuItem); } this.createContextMenu(); }; SnapshotTileView.prototype.setupSizeDiff = function (element, iconElement) { var toSnapshot = this._comparableSnapshots[this._model.summaryData.id - 2]; if(toSnapshot) { var size = (this._model.summaryData.totalObjectSize - toSnapshot.totalObjectSize); if(size > 0) { iconElement.classList.add("heapIncreaseIcon"); } else if(size < 0) { iconElement.classList.add("heapDecreaseIcon"); } if(size === 0) { element.innerText = Plugin.Resources.getString("NoDiff"); } else { element.innerText = (size > 0 ? "+" : "-") + MemoryAnalyzer.FormattingHelpers.getPrettyPrintSize(size); element.setAttribute("data-plugin-vs-tooltip", Plugin.Resources.getString("HeapSizeDiffLinkTooltip")); } } else { element.classList.remove("BPT-FileLink"); element.classList.add("baselineText"); element.innerText = Plugin.Resources.getString("Baseline"); element.tabIndex = -1; } }; SnapshotTileView.prototype.setupCountDiff = function (element, iconElement) { if(this._comparableSnapshots.length >= 1) { var addedCount = this._model.summaryData.statsAddedObjects; var deletedCount = this._model.summaryData.statsDeletedObjects; var delta = addedCount - deletedCount; if(delta > 0) { iconElement.classList.add("heapIncreaseIcon"); } else if(delta < 0) { iconElement.classList.add("heapDecreaseIcon"); } if(addedCount === 0 && deletedCount === 0) { element.innerText = Plugin.Resources.getString("NoDiff"); } else { var diffText; diffText = "+" + MemoryAnalyzer.FormattingHelpers.getDecimalLocaleString(addedCount, true) + " / " + "-" + MemoryAnalyzer.FormattingHelpers.getDecimalLocaleString(deletedCount, true); element.innerText = diffText; element.setAttribute("data-plugin-vs-tooltip", Plugin.Resources.getString("ObjectsCountDiffLinkTooltip")); } } else { element.classList.remove("BPT-FileLink"); element.classList.add("baselineText"); element.innerText = Plugin.Resources.getString("Baseline"); element.tabIndex = -1; } }; SnapshotTileView.prototype.onDetachedDomNodesClick = function (e) { this._controller.viewSnapshot(this._model.summaryData.id, "Dominators", "isDetachedDomNode"); }; SnapshotTileView.prototype.onSizeClick = function (e) { this._controller.viewSnapshot(this._model.summaryData.id, "Dominators", "retainedSize"); }; SnapshotTileView.prototype.onObjectCountClick = function (e) { this._controller.viewSnapshot(this._model.summaryData.id, "Types", "childrenCount"); }; SnapshotTileView.prototype.diffTo = function (id) { this._controller.compareSnapshots(this._model.summaryData.id, id, "Dominators", "retainedSize"); }; SnapshotTileView.prototype.onDiffClick = function (e) { var toSnapshot = this._comparableSnapshots[this._model.summaryData.id - 2]; if(toSnapshot) { this._controller.compareSnapshots(this._model.summaryData.id, toSnapshot.id, "Dominators", "retainedSizeDiff"); } }; SnapshotTileView.prototype.onObjectDiffClick = function (e, target) { var toSnapshot = this._comparableSnapshots[this._model.summaryData.id - 2]; if(toSnapshot) { this._controller.compareSnapshots(this._model.summaryData.id, toSnapshot.id, "Types", "childrenCountDiff"); } }; return SnapshotTileView; })(Common.Controls.TemplateControl); MemoryAnalyzer.SnapshotTileView = SnapshotTileView; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=snapshotTileView.js.map // snapshotView.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; var SnapshotViewController = (function () { function SnapshotViewController(storageId) { this._storageId = storageId; this.model = new SnapshotViewModel(); this.model.progressText = Plugin.Resources.getString("ProcessingSnapshot"); this.view = new SnapshotView(this, this.model); } Object.defineProperty(SnapshotViewController.prototype, "currentDataViewController", { get: function () { return this.view.currentDataViewController; }, enumerable: true, configurable: true }); SnapshotViewController.prototype.getSnapshotDataViewController = function (viewType) { return new MemoryAnalyzer.SnapshotDataViewController(viewType, this.model.snapshot, this.view, this.model.displayObjectIDs, this.model.showBuiltIns, this.model.displayCircularReferences); }; SnapshotViewController.prototype.giveFeedback = function () { var _this = this; MemoryAnalyzer.Program.internalFeedback.isEnabled().done(function (enabled) { if(enabled) { var viewTypeName = ""; if(_this.view.currentDataViewController) { viewTypeName = Common.Enum.GetName(MemoryAnalyzer.DataViewType, _this.view.currentDataViewController.viewType); } MemoryAnalyzer.Program.shell.save(false).done(function (fileLocation) { MemoryAnalyzer.Program.internalFeedback.sendData(true, "", "", viewTypeName, "", fileLocation); }); } }); }; SnapshotViewController.prototype.loadSnapshot = function (storageId, relativePaths, targetView, sortProperty) { if(!relativePaths || relativePaths.length !== 1) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1012")); } this.setTargetView(targetView, sortProperty); var snapshotPath = MemoryAnalyzer.Program.shell.getSnapshotFullPath(storageId, relativePaths[0]); MemoryAnalyzer.Program.memoryAnalyzerData.processSnapshot(snapshotPath).done(this.onSnapshotProcessingCompleted.bind(this), this.onSnapshotProcessingFailed.bind(this)); }; SnapshotViewController.prototype.setTargetView = function (targetView, sortProperty) { this.model.targetView = targetView; this.model.sortProperty = sortProperty; }; SnapshotViewController.prototype.onSnapshotProcessingCompleted = function (snapshotData) { var snapshot = new MemoryAnalyzer.Snapshot(snapshotData, false); this.model.snapshot = snapshot; MemoryAnalyzer.Program.onIdle(); }; SnapshotViewController.prototype.onSnapshotProcessingFailed = function (error) { if(!error) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1013")); } this.model.latestSnapshotError = error; MemoryAnalyzer.Program.onIdle(); }; SnapshotViewController.prototype.onSnapshotProgress = function (progress) { this.model.progressText = Plugin.Resources.getString(progress.stringId); this.model.progressValue = progress.percentage; }; return SnapshotViewController; })(); MemoryAnalyzer.SnapshotViewController = SnapshotViewController; var SnapshotViewModel = (function (_super) { __extends(SnapshotViewModel, _super); function SnapshotViewModel() { _super.call(this); this._displayCircularReferences = false; this._displayObjectIDs = false; this._latestSnapshotError = null; this._showBuiltIns = false; } Object.defineProperty(SnapshotViewModel.prototype, "displayCircularReferences", { get: function () { return this._displayCircularReferences; }, set: function (v) { if(this._displayCircularReferences !== v) { this._displayCircularReferences = v; this.raisePropertyChanged("displayCircularReferences"); } }, enumerable: true, configurable: true }); Object.defineProperty(SnapshotViewModel.prototype, "displayObjectIDs", { get: function () { return this._displayObjectIDs; }, set: function (v) { if(this._displayObjectIDs !== v) { this._displayObjectIDs = v; this.raisePropertyChanged("displayObjectIDs"); } }, enumerable: true, configurable: true }); Object.defineProperty(SnapshotViewModel.prototype, "filterString", { get: function () { return this._filterString; }, set: function (v) { if(this._filterString !== v) { MemoryAnalyzer.Program.traceWriter.raiseEvent(Common.TraceEvents.Memory_GridFilterUIResponse_Start); this._filterString = v; this.raisePropertyChanged("filterString"); MemoryAnalyzer.Program.traceWriter.raiseEvent(Common.TraceEvents.Memory_GridFilterUIResponse_Stop); } }, enumerable: true, configurable: true }); Object.defineProperty(SnapshotViewModel.prototype, "latestSnapshotError", { get: function () { return this._latestSnapshotError; }, set: function (v) { if(this._latestSnapshotError !== v) { this._latestSnapshotError = v; this.raisePropertyChanged("latestSnapshotError"); MemoryAnalyzer.Program.reportError(v, "SnapshotProcessingFailure"); } }, enumerable: true, configurable: true }); Object.defineProperty(SnapshotViewModel.prototype, "progressText", { get: function () { return this._progressText; }, set: function (v) { if(this._progressText !== v) { this._progressText = v; this.raisePropertyChanged("progressText"); } }, enumerable: true, configurable: true }); Object.defineProperty(SnapshotViewModel.prototype, "progressValue", { get: function () { return this._progressValue; }, set: function (v) { if(this._progressValue !== v) { this._progressValue = v; this.raisePropertyChanged("progressValue"); } }, enumerable: true, configurable: true }); Object.defineProperty(SnapshotViewModel.prototype, "showBuiltIns", { get: function () { return this._showBuiltIns; }, set: function (v) { if(this._showBuiltIns !== v) { this._showBuiltIns = v; this.raisePropertyChanged("showBuiltIns"); } }, enumerable: true, configurable: true }); Object.defineProperty(SnapshotViewModel.prototype, "snapshot", { get: function () { return this._snapshot; }, set: function (v) { if(this._snapshot !== v) { this._snapshot = v; this.raisePropertyChanged("snapshot"); } }, enumerable: true, configurable: true }); Object.defineProperty(SnapshotViewModel.prototype, "sortProperty", { get: function () { return this._sortProperty; }, set: function (v) { this._sortProperty = v; this.raisePropertyChanged("sortProperty"); }, enumerable: true, configurable: true }); Object.defineProperty(SnapshotViewModel.prototype, "targetView", { get: function () { return this._targetView; }, set: function (v) { if(this._targetView !== v) { this._targetView = v; this.raisePropertyChanged("targetView"); } }, enumerable: true, configurable: true }); return SnapshotViewModel; })(MemoryAnalyzer.Controls.ObservableViewModel); MemoryAnalyzer.SnapshotViewModel = SnapshotViewModel; var SnapshotView = (function (_super) { __extends(SnapshotView, _super); function SnapshotView(controller, model) { _super.call(this, "SnapshotTabTemplate"); this._controller = controller; this._model = model; this._snapshotAnalysisView = new SnapshotAnalysisView(this._controller, this._model); this._model.registerPropertyChanged(this); this._snapshotDataNavigation = new Common.Controls.Control(this.findElement("snapshotDataNavigation")); this._snapshotProcessingProgressDiv = this.findElement("snapshotProcessingProgressDiv"); this._progressText = this.findElement("progressText"); this._progressBar = this.findElement("progressBar"); this._snapshotProcessingError = this.findElement("snapshotProcessingError"); this._snapshotProcessingErrorMsg = this.findElement("snapshotProcessingErrorMsg"); this.findElement("snapshotProcessingErrorLabel").innerText = Plugin.Resources.getString("ErrorWhileProcessing"); this.uiUpdateViews(); this.updateProgress(); } Object.defineProperty(SnapshotView.prototype, "currentDataView", { get: function () { var currentTab = this.currentDataViewTab; if(currentTab) { return currentTab.content; } return null; }, enumerable: true, configurable: true }); Object.defineProperty(SnapshotView.prototype, "currentDataViewController", { get: function () { var currentTab = this.currentDataViewTab; if(currentTab) { return currentTab.controller; } return null; }, enumerable: true, configurable: true }); Object.defineProperty(SnapshotView.prototype, "currentDataViewTab", { get: function () { if(this._tabControl && this._tabControl.selectedItem) { return this._tabControl.selectedItem; } return null; }, enumerable: true, configurable: true }); SnapshotView.prototype.switchToDataView = function (viewType) { this._tabControl.selectedItem = this._tabControl.getTab(viewType); }; SnapshotView.prototype.onPropertyChanged = function (propertyName) { var _this = this; switch(propertyName) { case "displayCircularReferences": this.forEachTab(function (tab) { tab.controller.displayCircularReferences = _this._model.displayCircularReferences; }); break; case "displayObjectIDs": this.forEachTab(function (tab) { tab.controller.displayObjectIDs = _this._model.displayObjectIDs; }); break; case "filterString": if(this.currentDataViewController) { this.currentDataViewController.filterString = this._model.filterString; } break; case "latestSnapshotError": this.updateSnapshotError(); break; case "progressText": case "progressValue": this.updateProgress(); break; case "showBuiltIns": this.forEachTab(function (tab) { tab.controller.showBuiltIns = _this._model.showBuiltIns; }); break; case "snapshot": this.uiUpdateViews(); break; case "sortProperty": this.updateSort(); break; case "targetView": this.updateTargetView(); break; } }; SnapshotView.prototype.forEachTab = function (action) { for(var i = 0; i < this._tabControl.length(); i++) { var tab = this._tabControl.getTab(i); action(tab); } }; SnapshotView.prototype.updateProgress = function () { if(this._model.progressText) { this._progressText.innerText = this._model.progressText; } if(this._model.progressValue) { this._progressBar.value = this._model.progressValue; } }; SnapshotView.prototype.updateTargetView = function () { if(this._tabControl) { var title = this._model.targetView; for(var i = 0; i < this._tabControl.length(); i++) { var tabItem = this._tabControl.getTab(i); if(tabItem.title === title) { this._tabControl.selectedItem = tabItem; } } } }; SnapshotView.prototype.updateSort = function () { if(this.currentDataView) { this.currentDataView.sortBy(this._model.sortProperty, "desc"); } }; SnapshotView.prototype.updateSnapshotError = function () { var error = this._model.latestSnapshotError; if(error) { this.showProgress(false); this._snapshotProcessingErrorMsg.innerText = MemoryAnalyzer.ErrorFormatter.format(error); this._snapshotProcessingError.style.display = "block"; } else { this._snapshotProcessingErrorMsg.innerText = ""; this._snapshotProcessingError.style.display = "none"; } }; SnapshotView.prototype.getNewTab = function (dataViewType) { return new MemoryAnalyzer.SnapshotDataViewTab(this._controller.getSnapshotDataViewController(dataViewType)); }; SnapshotView.prototype.uiUpdateViews = function () { var _this = this; this.updateSnapshotError(); if(this._tabControl) { for(var i = 0; i < this._tabControl.length(); i++) { var tabToRemove = this._tabControl.getTab(i); } this._snapshotDataNavigation.removeChild(this._tabControl); } if(this._model.snapshot) { this._snapshotDataNavigation.rootElement.classList.remove("snapshotDataNavigationHidden"); this.showProgress(false); this._tabControl = new MemoryAnalyzer.Controls.TabControl(); this._tabControl.tabsLeftAligned = true; this._tabControl.afterBarContainer.appendChild(this._snapshotAnalysisView); var dataViewTypes = Common.Enum.GetValues(MemoryAnalyzer.DataViewType); for(var i = 0; i < dataViewTypes.length; i++) { var dataViewType = dataViewTypes[i]; var tabItem = this.getNewTab(dataViewType); this._tabControl.addTab(tabItem); } this.updateTargetView(); this.updateSort(); this._snapshotAnalysisView.onTabChanged(); this._tabControl.selectedItemChanged = function () { _this._model.targetView = _this._tabControl.selectedItem.title; _this._snapshotAnalysisView.onTabChanged(); }; this._snapshotDataNavigation.appendChild(this._tabControl); } else { this._snapshotDataNavigation.rootElement.classList.add("snapshotDataNavigationHidden"); this.showProgress(true); } }; SnapshotView.prototype.showProgress = function (show) { if(show) { this._snapshotProcessingProgressDiv.classList.remove("snapshotProcessingProgressDivHidden"); } else { this._snapshotProcessingProgressDiv.classList.add("snapshotProcessingProgressDivHidden"); } }; return SnapshotView; })(Common.Controls.TemplateControl); MemoryAnalyzer.SnapshotView = SnapshotView; var SnapshotAnalysisView = (function (_super) { __extends(SnapshotAnalysisView, _super); function SnapshotAnalysisView(controller, model) { var _this = this; _super.call(this, "AnalysisTemplate"); this._controller = controller; this._model = model; this._model.displayObjectIDs = MemoryAnalyzer.Program.userSettings.displayObjectIDs; this._model.showBuiltIns = MemoryAnalyzer.Program.userSettings.showBuiltIns; var giveFeedbackButton = this.findElement("giveFeedbackButton"); giveFeedbackButton.classList.add("hidden"); MemoryAnalyzer.Program.internalFeedback.isEnabled().done(function (isEnabled) { if(isEnabled) { giveFeedbackButton.classList.remove("hidden"); giveFeedbackButton.addEventListener("click", _this.onGiveFeedbackClick.bind(_this)); } }); this._filterInput = this.findElement("filterInput"); this._filterInput.placeholder = Plugin.Resources.getString("IdentifierFilter"); this._filterInput.setAttribute("aria-label", Plugin.Resources.getString("IdentifierFilter")); this._filterInput.disabled = true; this._filterInput.classList.add("hidden"); this._filterInput.onkeyup = function (e) { if(e.keyCode === Common.KeyCodes.ESCAPE) { _this._filterInput.value = ""; _this._model.filterString = _this._filterInput.value; } }; this._filterInput.oninput = function () { clearTimeout(_this._filterResponseTimeoutHandle); _this._filterResponseTimeoutHandle = setTimeout(function () { _this._model.filterString = _this._filterInput.value; }, 200); }; var settingsMenuButton = this.findElement("settingsMenuButton"); settingsMenuButton.setAttribute("data-plugin-vs-tooltip", Plugin.Resources.getString("SettingsMenuButtonTooltipText")); settingsMenuButton.setAttribute("aria-label", Plugin.Resources.getString("SettingsMenuButtonTooltipText")); this._settingsMenu = new MemoryAnalyzer.Controls.MenuControl(settingsMenuButton); this._settingsMenu.addToggleItem(Plugin.Resources.getString("ShowBuiltIns"), this.toggleShowBuiltins.bind(this), this._model.showBuiltIns, 3); this._settingsMenu.addToggleItem(Plugin.Resources.getString("DisplayObjectIDs"), this.toggleDisplayObjectIDs.bind(this), this._model.displayObjectIDs, 3); this._settingsMenu.addToggleItem(Plugin.Resources.getString("DisplayCircularReferences"), this.toggleDisplayCircularReferences.bind(this), this._model.displayCircularReferences, 3); } SnapshotAnalysisView.prototype.onTabChanged = function () { var currentViewController = this._controller.currentDataViewController; if(currentViewController && currentViewController.isTextFilterSupported) { this._filterInput.disabled = false; this._filterInput.classList.remove("hidden"); this._filterInput.value = currentViewController.filterString || ""; this._filterInput.focus(); } else { this._filterInput.disabled = true; this._filterInput.classList.add("hidden"); } }; SnapshotAnalysisView.prototype.onGiveFeedbackClick = function (e) { this._controller.giveFeedback(); }; SnapshotAnalysisView.prototype.toggleShowBuiltins = function () { this._model.showBuiltIns = !this._model.showBuiltIns; return this._model.showBuiltIns; }; SnapshotAnalysisView.prototype.toggleDisplayCircularReferences = function () { this._model.displayCircularReferences = !this._model.displayCircularReferences; return this._model.displayCircularReferences; }; SnapshotAnalysisView.prototype.toggleDisplayObjectIDs = function () { this._model.displayObjectIDs = !this._model.displayObjectIDs; return this._model.displayObjectIDs; }; return SnapshotAnalysisView; })(Common.Controls.TemplateControl); MemoryAnalyzer.SnapshotAnalysisView = SnapshotAnalysisView; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=snapshotView.js.map // summaryTab.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; var SummaryTab = (function (_super) { __extends(SummaryTab, _super); function SummaryTab(summaryViewController) { _super.call(this); this.title = Plugin.Resources.getString("Summary").toLocaleUpperCase(); this.tooltipString = Plugin.Resources.getString("SummaryTabTooltip"); this.content = summaryViewController.view; } return SummaryTab; })(MemoryAnalyzer.Controls.TabItem); MemoryAnalyzer.SummaryTab = SummaryTab; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=summaryTab.js.map // summaryView.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; var SummaryViewController = (function () { function SummaryViewController(memoryAnalyzer, storageId, isOffline) { this._screenshotHeight = 150; this._screenshotKeepAspectRatio = true; this._screenshotWidth = 200; this._memoryAnalyzer = memoryAnalyzer; this._storageId = storageId; this.model = new SummaryViewModel(isOffline); this.view = new SummaryView(this, this.model); } SummaryViewController._nextIdentifier = 0; SummaryViewController._snapshotChunkSize = 32768; SummaryViewController.prototype.giveFeedback = function () { MemoryAnalyzer.Program.internalFeedback.isEnabled().done(function (enabled) { if(enabled) { MemoryAnalyzer.Program.shell.save(false).done(function (fileLocation) { MemoryAnalyzer.Program.internalFeedback.sendData(true, "", "", "", "", fileLocation); }); } }); }; SummaryViewController.prototype.loadExistingSnapshots = function () { var _this = this; var fileExtension = ".snapjs" + MemoryAnalyzer.SnapshotSummary.fileExtension; var snapshotSummaries = []; var snapshotCount = 0; Plugin.Storage.getFileList(this._storageId, Plugin.Storage.FilePersistence.temporary).done(function (files) { files = files.filter(function (file) { return file.slice(-fileExtension.length) === fileExtension; }); for(var i = 0; i < files.length; i++) { MemoryAnalyzer.SnapshotSummary.load(_this._storageId, files[i], function (snapshotNumber, snapshotSummary) { snapshotSummaries.push(snapshotSummary); snapshotCount++; if(snapshotCount === files.length) { snapshotSummaries = snapshotSummaries.sort(function (a, b) { return a.id - b.id; }); for(var snapshot = 0; snapshot < snapshotSummaries.length; snapshot++) { this.model.snapshotSummaryCollection.add(snapshotSummaries[snapshot]); } } }.bind(_this, i), _this.onSnapshotFailed.bind(_this)); } Plugin.VS.Internal.CodeMarkers.fire(MemoryAnalyzer.CodeMarkerValues.perfBrowserTools_MemoryAnalyzerViewLoaded); MemoryAnalyzer.Program.onIdle(); }, this.onSnapshotFailed.bind(this)); }; SummaryViewController.prototype.save = function () { if(this.model.snapshotSummaryCollection.length > 0) { return MemoryAnalyzer.Program.shell.save(true); } return Plugin.Promise.as(null); }; SummaryViewController.prototype.startGraphCollectorSession = function () { var _this = this; if(!MemoryAnalyzer.Program.shell.isGraphCollectionSupported) { return; } if(!this._graphCollectorSession) { MemoryAnalyzer.Program.shell.startGraphCollection().done(function (newSession) { _this._graphCollectorSession = newSession; _this.model.graphCollectorSession = newSession; _this.view.startGraph(); }, function (err) { MemoryAnalyzer.Program.reportError(err, Plugin.Resources.getErrorString("JSPerf.1064")); }); } }; SummaryViewController.prototype.stopGraphCollectorSession = function () { if(this._graphCollectorSession) { this._graphCollectorSession.stop(); this._graphCollectorSession = null; this.view.stopGraph(); if(this.model.snapshotSummaryCollection.length === 0) { this.view.removeExistingGraph(); } } }; SummaryViewController.prototype.takeSnapshot = function () { var _this = this; if(!this.model.isTakeSnapshotEnabled) { return; } this.model.isTakingSnapshot = true; MemoryAnalyzer.Program.traceWriter.raiseEvent(Common.TraceEvents.Memory_TakeSnapshot_Start); MemoryAnalyzer.Program.shell.createSnapshot().done(function (fileAndPath) { var args = [ SummaryViewController._snapshotChunkSize, _this._screenshotWidth, _this._screenshotHeight, _this._screenshotKeepAspectRatio ]; var takeSnapshotCommand = new MemoryAnalyzer.TakeSnapshotCommand(args, fileAndPath.file); takeSnapshotCommand.completedHandler = function () { var previousSnapshotPath; if(_this.model.snapshotSummaryCollection.length > 0) { var snapshotSummary = _this.model.snapshotSummaryCollection.getItem(_this.model.snapshotSummaryCollection.length - 1); if(snapshotSummary) { previousSnapshotPath = snapshotSummary.snapshotFile.relativePath; } } return fileAndPath.file.close().done(function () { return _this.onSnapshotResult(fileAndPath.relativePath, previousSnapshotPath); }); }; takeSnapshotCommand.errorHandler = function (error) { return fileAndPath.file.close().done(function () { return _this.onSnapshotFailed(error); }); }; _this._memoryAnalyzer.callProxy(takeSnapshotCommand); MemoryAnalyzer.Program.traceWriter.raiseEvent(Common.TraceEvents.Memory_TakeSnapshot_Stop); }, this.onSnapshotFailed.bind(this)); }; SummaryViewController.prototype.cancelPendingSnapshots = function () { if(this._snapshotSummaryPromise) { this._snapshotSummaryPromise.cancel(); this._snapshotSummaryPromise = null; } }; SummaryViewController.prototype.viewSnapshot = function (snapshotId, target, sortProperty) { var foundSnapshotSummary = this.getSnapshotSummary(snapshotId); if(foundSnapshotSummary) { MemoryAnalyzer.Program.traceWriter.raiseEvent(Common.TraceEvents.Memory_ViewSnapshot_Start); this._memoryAnalyzer.showSnapshotTab(foundSnapshotSummary.snapshotFile.relativePath, target, Plugin.Resources.getString("SnapshotNumber", foundSnapshotSummary.id), sortProperty).done(function () { MemoryAnalyzer.Program.traceWriter.raiseEvent(Common.TraceEvents.Memory_ViewSnapshot_Stop); Plugin.VS.Internal.CodeMarkers.fire(MemoryAnalyzer.CodeMarkerValues.perfBrowserTools_MemoryAnalyzerViewLoaded); }); } }; SummaryViewController.prototype.compareSnapshots = function (lastSnapshotId, firstSnapshotId, target, sortProperty) { MemoryAnalyzer.Program.traceWriter.raiseEvent(Common.TraceEvents.Memory_CompareSnapshot_Start); if(lastSnapshotId < firstSnapshotId) { var tempId = lastSnapshotId; lastSnapshotId = firstSnapshotId; firstSnapshotId = tempId; } var snapshotsInfo = []; var lastSnapshotInfo = this.getSnapshotSummary(lastSnapshotId); var firstSnapshotInfo = this.getSnapshotSummary(firstSnapshotId); if(lastSnapshotInfo && firstSnapshotInfo) { for(var i = 0; i < this.model.snapshotSummaryCollection.length; i++) { var s = this.model.snapshotSummaryCollection.getItem(i); if(s.taken >= firstSnapshotInfo.taken && s.taken <= lastSnapshotInfo.taken) { snapshotsInfo.push(s); } } snapshotsInfo = snapshotsInfo.sort(function (a, b) { return a.taken - b.taken; }); } var snapshotFiles = []; for(var i = 0; i < snapshotsInfo.length; i++) { snapshotFiles.push(snapshotsInfo[i].snapshotFile.relativePath); } this._memoryAnalyzer.showDiffSnapshotTab(snapshotFiles, target, Plugin.Resources.getString("SnapshotNumberDiff", lastSnapshotId, firstSnapshotId), sortProperty).done(function () { MemoryAnalyzer.Program.traceWriter.raiseEvent(Common.TraceEvents.Memory_CompareSnapshot_Stop); Plugin.VS.Internal.CodeMarkers.fire(MemoryAnalyzer.CodeMarkerValues.perfBrowserTools_MemoryAnalyzerViewLoaded); }); }; SummaryViewController.prototype.setScreenshotSize = function (targetWidth, targetHeight, keepAspectRatio) { this._screenshotWidth = targetWidth; this._screenshotHeight = targetHeight; this._screenshotKeepAspectRatio = keepAspectRatio; }; SummaryViewController.prototype.createTileView = function (snapshotSummary) { var model = new MemoryAnalyzer.SnapshotTileViewModel(snapshotSummary, this.model.snapshotSummaryCollection); var view = new MemoryAnalyzer.SnapshotTileView(this, model); this.model.snapshotSummaryCollection.registerCollectionChanged(view); return view; }; SummaryViewController.prototype.reset = function () { SummaryViewController._nextIdentifier = 0; this.model.snapshotSummaryCollection.clear(); MemoryAnalyzer.Program.onIdle(); }; SummaryViewController.prototype.removeExistingGraph = function () { this.view.removeExistingGraph(); }; SummaryViewController.prototype.getSnapshotSummary = function (snapshotId) { var foundSnapshotSummary = null; for(var i = 0; i < this.model.snapshotSummaryCollection.length; i++) { var snapshotSummary = this.model.snapshotSummaryCollection.getItem(i); if(snapshotSummary.id === snapshotId) { foundSnapshotSummary = snapshotSummary; break; } } return foundSnapshotSummary; }; SummaryViewController.prototype.onSnapshotResult = function (relativePath, prevSnapshotRelativePath) { var _this = this; var timeTaken = new Date().getTime(); var snapshotPath = MemoryAnalyzer.Program.shell.getSnapshotFullPath(this._storageId, relativePath); var prevSnapshotPath; if(prevSnapshotRelativePath) { prevSnapshotPath = MemoryAnalyzer.Program.shell.getSnapshotFullPath(this._storageId, prevSnapshotRelativePath); } this._snapshotSummaryPromise = MemoryAnalyzer.Program.memoryAnalyzerData.processSnapshotSummary(snapshotPath, prevSnapshotPath).then(function (snapshotSummary) { _this._snapshotSummaryPromise = null; _this.onSnapshotCompleted(relativePath, snapshotSummary, timeTaken); }, function (err) { _this._snapshotSummaryPromise = null; _this.onSnapshotFailed(err); }); }; SummaryViewController.prototype.onSnapshotCompleted = function (relativePath, snapshotSummary, timeTaken) { if(!snapshotSummary) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1014")); } var id = ++SummaryViewController._nextIdentifier; var summary = new MemoryAnalyzer.SnapshotSummary(snapshotSummary, new MemoryAnalyzer.SnapshotFile(this._storageId, relativePath), timeTaken, id); this.model.snapshotSummaryCollection.add(summary); this.model.isTakingSnapshot = false; if(window.console && window.console.log) { window.console.log("Snapshot taken: " + summary.objectsCount + " objects."); } summary.save(function () { Notifications.notify(MemoryAnalyzer.MemoryNotifications.OnSnapshotProcessingCompleted, summary); Plugin.VS.Internal.CodeMarkers.fire(MemoryAnalyzer.CodeMarkerValues.perfBrowserTools_MemoryAnalyzerIdle); }, this.onSnapshotFailed.bind(this)); }; SummaryViewController.prototype.onSnapshotFailed = function (error) { if(!error) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1015")); } error.message = Plugin.Resources.getString("SnapshotCreationFailed", error.message); this.model.latestSnapshotError = error; this.model.isTakingSnapshot = false; Plugin.VS.Internal.CodeMarkers.fire(MemoryAnalyzer.CodeMarkerValues.perfBrowserTools_MemoryAnalyzerViewLoaded); MemoryAnalyzer.Program.onIdle(); }; return SummaryViewController; })(); MemoryAnalyzer.SummaryViewController = SummaryViewController; var SummaryViewModel = (function (_super) { __extends(SummaryViewModel, _super); function SummaryViewModel(isOffline) { _super.call(this); this._warningMessage = ""; this._latestSnapshotError = null; this._isTakingSnapshot = false; this._isAttached = false; this._isRunning = true; this._isOffline = true; this._isStartProfilingPromptVisible = true; this._isTargetCompatible = true; this._isOffline = isOffline; this._snapshotSummaryCollection = new MemoryAnalyzer.Controls.ObservableCollection(); } Object.defineProperty(SummaryViewModel.prototype, "isStartEnabled", { get: function () { return ((this.isOffline && (this.isTargetCompatible || this._snapshotSummaryCollection.length > 0)) || this.isStartProfilingPromptVisible) && this.isAttached && this.isRunning; }, enumerable: true, configurable: true }); Object.defineProperty(SummaryViewModel.prototype, "isStopEnabled", { get: function () { return !this.isOffline && this.isAttached && this.isRunning; }, enumerable: true, configurable: true }); Object.defineProperty(SummaryViewModel.prototype, "snapshotSummaryCollection", { get: function () { return this._snapshotSummaryCollection; }, enumerable: true, configurable: true }); Object.defineProperty(SummaryViewModel.prototype, "isTakeSnapshotEnabled", { get: function () { return !this.isOffline && this.isAttached && this.isRunning && !this.isTakingSnapshot && this.isTargetCompatible; }, enumerable: true, configurable: true }); Object.defineProperty(SummaryViewModel.prototype, "isOffline", { get: function () { return this._isOffline; }, set: function (v) { if(this._isOffline !== v) { this._isOffline = v; if(this._isOffline) { this.isTakingSnapshot = false; } this.raisePropertyChanged("isOffline"); } }, enumerable: true, configurable: true }); Object.defineProperty(SummaryViewModel.prototype, "warningMessage", { get: function () { return this._warningMessage; }, set: function (v) { if(this._warningMessage !== v) { this._warningMessage = v; this.raisePropertyChanged("warningMessage"); } }, enumerable: true, configurable: true }); Object.defineProperty(SummaryViewModel.prototype, "latestSnapshotError", { get: function () { return this._latestSnapshotError; }, set: function (v) { if(this._latestSnapshotError !== v) { this._latestSnapshotError = v; this.raisePropertyChanged("latestSnapshotError"); MemoryAnalyzer.Program.reportError(v, "SnapshotCapturingFailure"); } }, enumerable: true, configurable: true }); Object.defineProperty(SummaryViewModel.prototype, "isTakingSnapshot", { get: function () { return this._isTakingSnapshot; }, set: function (v) { if(this._isTakingSnapshot !== v) { this._isTakingSnapshot = v; this.raisePropertyChanged("isTakingSnapshot"); } }, enumerable: true, configurable: true }); Object.defineProperty(SummaryViewModel.prototype, "isAttached", { get: function () { return this._isAttached; }, set: function (v) { if(this._isAttached !== v) { this._isAttached = v; this.raisePropertyChanged("isAttached"); } }, enumerable: true, configurable: true }); Object.defineProperty(SummaryViewModel.prototype, "isRunning", { get: function () { return this._isRunning; }, set: function (v) { if(this._isRunning !== v) { this._isRunning = v; this.raisePropertyChanged("isRunning"); } }, enumerable: true, configurable: true }); Object.defineProperty(SummaryViewModel.prototype, "isTargetCompatible", { get: function () { return this._isTargetCompatible; }, set: function (v) { if(this._isTargetCompatible !== v) { this._isTargetCompatible = v; this.raisePropertyChanged("isTargetCompatible"); } }, enumerable: true, configurable: true }); Object.defineProperty(SummaryViewModel.prototype, "isStartProfilingPromptVisible", { get: function () { return this._isStartProfilingPromptVisible; }, set: function (v) { if(this._isStartProfilingPromptVisible !== v) { this._isStartProfilingPromptVisible = v; this.raisePropertyChanged("isStartProfilingPromptVisible"); } }, enumerable: true, configurable: true }); SummaryViewModel.prototype.getGraphUpdates = function (updateCallback) { this.graphCollectorSession.getGraphDataUpdate("Heap").done(function (data) { if(!data || data.length === 0) { return; } var newPoints = []; newPoints.push({ Timestamp: data[0].timestamp, Value: data[0].value, ToolTip: null, CustomData: null }); var updatedSeries = [ { DataSource: { CounterId: SummaryView.PrivateBytesCounterId }, NewPoints: newPoints } ]; var updateEventArgs = { Timestamp: data[0].timestamp, UpdatedSeries: updatedSeries }; updateCallback(updateEventArgs); }, function (err) { MemoryAnalyzer.Program.reportError(err, Plugin.Resources.getErrorString("JSPerf.1062")); }); this.graphCollectorSession.getGraphDataUpdate("performancemark").done(function (data) { if(!data || data.length === 0) { return; } var newPoints = []; var maxTimestamp = data[0].timestamp; for(var i = 0; i < data.length; i++) { maxTimestamp = Math.max(maxTimestamp, data[i].timestamp); newPoints.push({ Timestamp: data[i].timestamp, Value: data[i].value, ToolTip: data[i].toolTip, CustomData: null }); } var updatedSeries = [ { DataSource: { CounterId: SummaryView.ProfilerMarkCounterId }, NewPoints: newPoints } ]; var updateEventArgs = { Timestamp: maxTimestamp, UpdatedSeries: updatedSeries }; updateCallback(updateEventArgs); }, function (err) { MemoryAnalyzer.Program.reportError(err, Plugin.Resources.getErrorString("JSPerf.1063")); }); }; return SummaryViewModel; })(MemoryAnalyzer.Controls.ObservableViewModel); MemoryAnalyzer.SummaryViewModel = SummaryViewModel; var SummaryView = (function (_super) { __extends(SummaryView, _super); function SummaryView(controller, model) { var _this = this; _super.call(this, "SummaryTabTemplate"); this._graphUpdateDelayMilliseconds = 100; this._screenshotWidth = 280; this._screenshotHeight = 160; this._screenshotKeepAspectRatio = true; this._controller = controller; this._model = model; this._model.registerPropertyChanged(this); this._model.snapshotSummaryCollection.registerCollectionChanged(this); this._heapGraphContainer = this.findElement("heapOverviewGraph"); this._tilesContainer = this.findElement("tilesContainer"); this._warningSection = this.findElement("warningSection"); this._onSnapshotClickHandler = this.onSnapshotClick.bind(this); var giveFeedbackButton = this.findElement("giveFeedbackButton_Summary"); giveFeedbackButton.classList.add("hidden"); MemoryAnalyzer.Program.internalFeedback.isEnabled().done(function (isEnabled) { if(isEnabled) { giveFeedbackButton.classList.remove("hidden"); giveFeedbackButton.addEventListener("click", _this.onGiveFeedbackClick.bind(_this)); } }); this._takeSnapshotTile = this.findElement("takeSnapshotTile"); if(this._model.isOffline) { this._takeSnapshotTile.style.display = "none"; } else { this._snapshotError = this.findElement("snapshotError"); this._snapshotErrorMsg = this.findElement("snapshotErrorMsg"); this._snapshotProgress = this.findElement("takeSnapshotProgress"); this._snapshotButton = this.findElement("takeSnapshotButton"); this._snapshotLabel = this.findElement("takeSnapshotLabel"); this._snapshotIcon = this.findElement("takeSnapshotIcon"); this._snapshotLabel.innerText = Plugin.Resources.getString("TakeSnapshot"); this._snapshotProgress.innerText = Plugin.Resources.getString("Loading"); this.toggleProgress(this._model.isTakingSnapshot); this.toggleAttached(this._model.isAttached); this.updateTakeSnapshotButton(); this._snapshotButton.addEventListener("click", this._onSnapshotClickHandler); } this._controller.setScreenshotSize(this._screenshotWidth, this._screenshotHeight, this._screenshotKeepAspectRatio); } SummaryView.PrivateBytesCounterId = "PrivateBytes"; SummaryView.ProfilerMarkCounterId = "performancemark"; SummaryView.prototype.onPropertyChanged = function (propertyName) { switch(propertyName) { case "warningMessage": this.showWarningMessage(this._model.warningMessage); break; case "latestSnapshotError": this.showSnapshotError(this._model.latestSnapshotError); break; case "isTakingSnapshot": this.toggleProgress(this._model.isTakingSnapshot); this.updateTakeSnapshotButton(); break; case "isAttached": case "isTargetCompatible": this.toggleAttached(this._model.isAttached); this.updateTakeSnapshotButton(); break; case "isRunning": this.toggleRunning(this._model.isOffline, this._model.isAttached, this._model.isRunning); this.updateTakeSnapshotButton(); break; case "isOffline": this.toggleOffline(this._model.isOffline, this._model.isAttached, this._model.isRunning); this.updateTakeSnapshotButton(); break; } }; SummaryView.prototype.onCollectionChanged = function (eventArgs) { switch(eventArgs.action) { case MemoryAnalyzer.Controls.NotifyCollectionChangedAction.Add: this.createTile(eventArgs.newItems[0]); break; case MemoryAnalyzer.Controls.NotifyCollectionChangedAction.Reset: this.removeSnapshotTiles(); break; } }; SummaryView.prototype.refreshGraph = function () { if(this._graphRenderer) { this._graphRenderer.refresh(); } }; SummaryView.prototype.removeExistingGraph = function () { if(this._graphRenderer) { this._graphRenderer.deinitialize(); } this._heapGraphContainer.innerHTML = ""; this._heapGraphContainer.style.display = "none"; }; SummaryView.prototype.startGraph = function () { var _this = this; var qpcStartTime = Plugin.F12.getQpcTime(); var qpcFrequency = Plugin.F12.getQpcFrequency(); this.removeExistingGraph(); var jsonConfig = { Series: [ { SeriesType: "Line", Legend: Plugin.Resources.getString("HubGraphHeapLegend"), DataSource: { CounterId: SummaryView.PrivateBytesCounterId } }, { SeriesType: "Mark", Legend: "", DataSource: { CounterId: SummaryView.ProfilerMarkCounterId } } ], MinValue: 0, MaxValue: 100, Unit: "", Units: [ { Unit: Plugin.Resources.getString("ByteUnits"), FromValue: Number.MIN_VALUE, ToValue: 1023, Divider: 1, Decimals: 1 }, { Unit: Plugin.Resources.getString("KilobyteUnits"), FromValue: Number.MIN_VALUE, ToValue: 1048575, Divider: 1024, Decimals: 1 }, { Unit: Plugin.Resources.getString("MegabyteUnits"), FromValue: Number.MIN_VALUE, ToValue: 1073741823, Divider: 1048576, Decimals: 1 }, { Unit: Plugin.Resources.getString("GigabyteUnits"), FromValue: Number.MIN_VALUE, ToValue: Number.MAX_VALUE, Divider: 1073741824, Decimals: 1 } ], Axes: null }; var liveGraphConfig = { Title: Plugin.Resources.getString("GraphTitle"), Description: "", JsonConfiguration: JSON.stringify(jsonConfig) }; var liveConfig = { GraphConfigurations: [ liveGraphConfig ], WindowsZoomLevel: { X: 1, Y: 1 }, QpcTimeProperties: { CollectionStartTime: qpcStartTime, Frequency: qpcFrequency } }; var dataManager = { getConfigurations: function (configCallback) { configCallback(liveConfig); }, dataUpdate: function (dataUpdateCallback) { _this._graphUpdateIntervalId = window.setInterval(function () { return _this._model.getGraphUpdates(dataUpdateCallback); }, _this._graphUpdateDelayMilliseconds); } }; var rendererArgs = { swimlane: { leftScale: { isVisible: true, width: 40 }, rightScale: { isVisible: true, width: 40 }, graph: { height: 88 }, minSelectionWidthInPixels: 10, isSelectionEnabled: false, isZoomEnabled: false }, isToolbarRequired: false, dataManager: dataManager, containerId: this._heapGraphContainer.id }; this._graphRenderer = new Microsoft.VisualStudio.DiagnosticsHub.LiveRenderer(rendererArgs); this._graphRenderer.execute(); this._heapGraphContainer.style.display = "-ms-grid"; }; SummaryView.prototype.stopGraph = function () { window.clearInterval(this._graphUpdateIntervalId); }; SummaryView.prototype.onGiveFeedbackClick = function (e) { this._controller.giveFeedback(); }; SummaryView.prototype.createTile = function (snapshotSummary) { var newTile = this._controller.createTileView(snapshotSummary); this._tilesContainer.insertBefore(newTile.rootElement, this._takeSnapshotTile); newTile.rootElement.scrollIntoView(true); newTile.setFocus(); }; SummaryView.prototype.removeSnapshotTiles = function () { while(this._tilesContainer.hasChildNodes()) { this._tilesContainer.removeChild(this._tilesContainer.firstChild); } this._tilesContainer.appendChild(this._takeSnapshotTile); }; SummaryView.prototype.toggleAttached = function (isAttached) { if(!isAttached) { this._controller.cancelPendingSnapshots(); } }; SummaryView.prototype.toggleOffline = function (isOffline, isAttached, isRunning) { this._takeSnapshotTile.style.display = isOffline ? "none" : "block"; if(!isOffline && isAttached && isRunning) { this._controller.startGraphCollectorSession(); } else { this._controller.stopGraphCollectorSession(); } }; SummaryView.prototype.toggleProgress = function (show) { if(this._snapshotProgress && this._snapshotError) { if(show) { this._snapshotLabel.style.display = "none"; this._snapshotIcon.style.display = "none"; this._snapshotProgress.style.display = "block"; this._snapshotError.style.display = "none"; this._snapshotButton.setAttribute("aria-label", Plugin.Resources.getString("Loading")); } else { this._snapshotLabel.style.display = ""; this._snapshotIcon.style.display = ""; this._snapshotProgress.style.display = "none"; this._snapshotButton.setAttribute("aria-label", Plugin.Resources.getString("TakeSnapshot")); } } }; SummaryView.prototype.toggleRunning = function (isOffline, isAttached, isRunning) { if(!isOffline && isAttached && isRunning) { this._controller.startGraphCollectorSession(); } else { this._controller.stopGraphCollectorSession(); } }; SummaryView.prototype.showSnapshotError = function (error) { if(this._snapshotErrorMsg && this._snapshotError) { if(error) { this._snapshotErrorMsg.innerText = MemoryAnalyzer.ErrorFormatter.format(error); this._snapshotError.style.display = "block"; } else { this._snapshotErrorMsg.innerText = ""; this._snapshotError.style.display = "none"; } } }; SummaryView.prototype.showWarningMessage = function (warning) { if(!this._warningSection) { return; } if(warning) { this._warningSection.innerHTML = warning; this._warningSection.style.display = "inline"; } else { this._warningSection.innerHTML = ""; this._warningSection.style.display = "none"; } }; SummaryView.prototype.onSnapshotClick = function (e) { this._controller.takeSnapshot(); }; SummaryView.prototype.updateTakeSnapshotButton = function () { if(this._snapshotButton) { if(this._model.isTakeSnapshotEnabled) { this._snapshotButton.classList.remove("disabled"); this._snapshotButton.disabled = false; } else { if(!this._model.isTakingSnapshot) { this._snapshotButton.classList.add("disabled"); } this._snapshotButton.disabled = true; } } }; return SummaryView; })(Common.Controls.TemplateControl); MemoryAnalyzer.SummaryView = SummaryView; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=summaryView.js.map // CodeMarkerValues.ts var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; (function (CodeMarkerValues) { CodeMarkerValues._map = []; CodeMarkerValues.perfBrowserTools_MemoryAnalyzerViewLoaded = 23589; CodeMarkerValues.perfBrowserTools_MemoryAnalyzerIdle = 23590; CodeMarkerValues.perfBrowserTools_MemoryAnalyzerWindowClose = 23591; CodeMarkerValues.perfBrowserTools_MemoryAnalyzerSessionEnd = 23592; })(MemoryAnalyzer.CodeMarkerValues || (MemoryAnalyzer.CodeMarkerValues = {})); var CodeMarkerValues = MemoryAnalyzer.CodeMarkerValues; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=CodeMarkerValues.js.map // memoryNotifications.ts var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; var MemoryNotifications = (function () { function MemoryNotifications() { } MemoryNotifications.Idle = "MemoryNotifications.Idle"; MemoryNotifications.WindowClose = "MemoryNotifications.WindowClose"; MemoryNotifications.SessionEnd = "MemoryNotifications.SessionEnd"; MemoryNotifications.DetailsViewRowSelected = "MemoryNotifications.DetailsViewRowSelected"; MemoryNotifications.OnSnapshotProcessingCompleted = "MemoryNotifications.OnSnapshotProcessingCompleted"; return MemoryNotifications; })(); MemoryAnalyzer.MemoryNotifications = MemoryNotifications; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=memoryNotifications.js.map // diagnosticsToolWindow.ts var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; var DiagnosticsToolWindowController = (function () { function DiagnosticsToolWindowController(isOffline, diagSession) { var _this = this; this._callbacks = { }; this._pendingMessages = []; this._pendingTimeout = null; this._listeningToMessages = true; this._diagnosticSession = diagSession; if(!isOffline) { this.DiagnosticSession.addEventListener("break", this.onBreakCallback.bind(this)); this.DiagnosticSession.addEventListener("run", this.onRunCallback.bind(this)); this.DiagnosticSession.addEventListener("detach", this.onDetachCallback.bind(this)); this.DiagnosticSession.addEventListener("connect", this.onConnectCallback.bind(this)); this.DiagnosticSession.addEventListener("attach", this.onAttachCallback.bind(this)); window.setImmediate(function () { if(!_this._isAttached) { _this.DiagnosticSession.isAttached().done(function (isAttached) { if(isAttached) { _this.onAttachCallback(); } else { _this.showWarning(Plugin.Resources.getString("WarningNotAttached")); } }, function (err) { _this.showWarning(Plugin.Resources.getString("WarningNotAttached")); }); } }); } } DiagnosticsToolWindowController._uid = 0; Object.defineProperty(DiagnosticsToolWindowController.prototype, "DiagnosticSession", { get: function () { return this._diagnosticSession; }, enumerable: true, configurable: true }); DiagnosticsToolWindowController.prototype.onAttach = function () { }; DiagnosticsToolWindowController.prototype.onDetach = function () { }; DiagnosticsToolWindowController.prototype.onBreak = function () { }; DiagnosticsToolWindowController.prototype.onRun = function () { }; DiagnosticsToolWindowController.prototype.onConnect = function (port) { }; DiagnosticsToolWindowController.prototype.onMessage = function (data) { }; DiagnosticsToolWindowController.prototype.onHandshake = function (connectionInfo) { }; DiagnosticsToolWindowController.prototype.showWarning = function (message) { }; DiagnosticsToolWindowController.prototype.callProxy = function (command) { var _this = this; var uidString = DiagnosticsToolWindowController.getUid(); if(command.executedHandler) { this._callbacks[uidString] = { command: command, callback: command.executedHandler, deleteAfterCallback: true }; } var newArgs = []; if(command.args) { for(var i = 0; i < command.args.length; i++) { var arg = command.args[i]; newArgs.push(arg); } } if(command.dataReceivedHandler) { var callbackUid = DiagnosticsToolWindowController.getUid(); this._callbacks[callbackUid] = { command: command, callback: command.dataReceivedHandler, deleteAfterCallback: false }; newArgs.push({ uid: callbackUid, type: "callback" }); } var jsonObj = { uid: uidString, command: command.name, args: newArgs }; var sendMessageToRemote = function (message) { if(_this._remotePort) { _this._remotePort.postMessage(message); } }; this._pendingMessages.push(jsonObj); if(!this._pendingTimeout) { this._pendingTimeout = window.setImmediate(function () { var message = JSON.stringify(_this._pendingMessages); _this._pendingMessages = []; _this._pendingTimeout = null; sendMessageToRemote(message); }); } }; DiagnosticsToolWindowController.prototype.startListeningToMessages = function () { this._listeningToMessages = true; }; DiagnosticsToolWindowController.prototype.stopListeningToMessages = function () { this._listeningToMessages = false; }; DiagnosticsToolWindowController.getUid = function getUid() { return "uid" + (DiagnosticsToolWindowController._uid++).toString(36); }; DiagnosticsToolWindowController.prototype.fireCallbacks = function (data) { var msgs = JSON.parse(data); for(var i = 0; i < msgs.length; i++) { var obj = msgs[i]; var callback = this._callbacks[obj.uid]; if(callback) { if(obj.args !== undefined) { callback.callback.apply(this, obj.args); } if(callback.deleteAfterCallback || callback.command.hasCompleted) { delete this._callbacks[obj.uid]; } } else if(obj.uid === "scriptError") { Plugin.Diagnostics.reportError(obj.args[0].message, obj.args[0].file, obj.args[0].line, obj.args[0].additionalInfo); } } }; DiagnosticsToolWindowController.prototype.onAttachCallback = function () { if(!this._isAttached) { this._isAttached = true; this.showWarning(null); this.onAttach(); } }; DiagnosticsToolWindowController.prototype.onDetachCallback = function () { this._remotePort = null; this._callbacks = { }; this._pendingMessages = []; this._pendingTimeout = null; this._isAttached = false; this.showWarning(Plugin.Resources.getString("WarningNotAttached")); this.onDetach(); }; DiagnosticsToolWindowController.prototype.onBreakCallback = function () { this.onBreak(); }; DiagnosticsToolWindowController.prototype.onRunCallback = function () { this.onRun(); }; DiagnosticsToolWindowController.prototype.onMessageCallback = function (args) { var _this = this; var data = args.data; var isHandshake = this.processHandshakeMessage(data); if(this._listeningToMessages) { if(data === "DocumentNotYetReady") { window.setTimeout(function () { _this._remotePort.postMessage("InitializeDocument"); }, 100); } else if(!isHandshake) { this.fireCallbacks(data); } this.onMessage(data); } }; DiagnosticsToolWindowController.prototype.onConnectCallback = function (port) { this._remotePort = port; this._remotePort.addEventListener("message", this.onMessageCallback.bind(this)); this.onConnect(port); }; DiagnosticsToolWindowController.prototype.processHandshakeMessage = function (data) { if(data.substr(0, 10) === "Handshake:") { var connectionInfo = JSON.parse(data.substring(10)); this.onHandshake(connectionInfo); return true; } return false; }; return DiagnosticsToolWindowController; })(); MemoryAnalyzer.DiagnosticsToolWindowController = DiagnosticsToolWindowController; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=diagnosticsToolWindow.js.map // memoryAnalyzer.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var DiagnosticsHub = Microsoft.VisualStudio.DiagnosticsHub; var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; var MemoryAnalyzerController = (function (_super) { __extends(MemoryAnalyzerController, _super); function MemoryAnalyzerController(sessionInfo, diagSession) { _super.call(this, sessionInfo.isOffline, diagSession); var isOffline = sessionInfo.isOffline; this._summaryViewController = new MemoryAnalyzer.SummaryViewController(this, sessionInfo.storageId, isOffline); if(isOffline) { this._view = new MemoryAnalyzer.SummaryTab(this.summaryViewController); this.summaryViewController.loadExistingSnapshots(); } else { this._view = new MemoryAnalyzerView(this); this.initCommands(); var hubSession = DiagnosticsHub.getCurrentSession(); if(hubSession) { hubSession.addStateChangedEventListener(this.onDiagnosticsHubStateChanged.bind(this, hubSession)); } } } Object.defineProperty(MemoryAnalyzerController.prototype, "summaryViewController", { get: function () { return this._summaryViewController; }, enumerable: true, configurable: true }); Object.defineProperty(MemoryAnalyzerController.prototype, "view", { get: function () { return this._view; }, enumerable: true, configurable: true }); MemoryAnalyzerController.prototype.clearSummaryTab = function () { this._summaryViewController.reset(); }; MemoryAnalyzerController.prototype.goOffline = function () { if(!this._summaryViewController.model.isOffline) { this.stopListeningToMessages(); this._summaryViewController.model.isOffline = true; } }; MemoryAnalyzerController.prototype.goOnline = function () { if(this._summaryViewController.model.isOffline) { this.startListeningToMessages(); this._summaryViewController.model.isOffline = false; } }; MemoryAnalyzerController.prototype.removeExistingGraph = function () { this._summaryViewController.removeExistingGraph(); }; MemoryAnalyzerController.prototype.takeSnapshot = function () { this._summaryViewController.takeSnapshot(); }; MemoryAnalyzerController.prototype.showWarning = function (message) { if(this._summaryViewController) { this._summaryViewController.model.warningMessage = message; } }; MemoryAnalyzerController.prototype.onAttach = function () { this.DiagnosticSession.loadScriptInProc("../Common/RemoteHelpers.js"); this.DiagnosticSession.loadScriptInProc("Remote.js"); }; MemoryAnalyzerController.prototype.onDetach = function () { this._summaryViewController.model.isAttached = false; this.goOffline(); }; MemoryAnalyzerController.prototype.onBreak = function () { this._summaryViewController.model.isRunning = false; }; MemoryAnalyzerController.prototype.onRun = function () { this._summaryViewController.model.isRunning = true; }; MemoryAnalyzerController.prototype.onHandshake = function (connectionInfo) { this._summaryViewController.model.isAttached = true; if(connectionInfo.docMode < Common.Constants.minimumRequiredDocumentMode) { if(!this._summaryViewController.model.isOffline) { this.showWarning(MemoryAnalyzer.Program.shell.getHostSpecificString("WarningIncompatibleStandardsMode")); } this._summaryViewController.model.isTargetCompatible = false; } else { MemoryAnalyzer.Program.traceWriter.raiseEvent(Common.TraceEvents.Memory_ToolReady_Start); if(!this._summaryViewController.model.isOffline) { this.showWarning(null); } this._summaryViewController.model.isTargetCompatible = true; this._summaryViewController.model.isTakingSnapshot = false; if(!this._summaryViewController.model.isOffline) { this._summaryViewController.reset(); MemoryAnalyzer.Program.shell.closeAllSnapshots(); } else if(this._summaryViewController.model.snapshotSummaryCollection.length === 0) { this._summaryViewController.reset(); MemoryAnalyzer.Program.shell.closeAllSnapshots(); MemoryAnalyzer.Program.shell.resetView(); } var command = new MemoryAnalyzer.RegisterConsoleCallbacksCommand(this.consoleNotifyCallback); this.callProxy(command); MemoryAnalyzer.Program.traceWriter.raiseEvent(Common.TraceEvents.Memory_ToolReady_Stop); } }; MemoryAnalyzerController.prototype.showSnapshotTab = function (relativePath, targetView, tabName, sortProperty) { if(!relativePath) { return Plugin.Promise.as(null); } return MemoryAnalyzer.Program.shell.openSnapshot(relativePath, targetView, tabName, sortProperty); }; MemoryAnalyzerController.prototype.showDiffSnapshotTab = function (snapshotNames, targetView, tabName, sortProperty) { if(!snapshotNames || snapshotNames.length < 2) { return Plugin.Promise.as(null); } return MemoryAnalyzer.Program.shell.openSnapshotDiff(snapshotNames, targetView, tabName, sortProperty); ; }; MemoryAnalyzerController.prototype.updateCommandState = function () { if(Plugin.VS && Plugin.VS.Commands) { Plugin.VS.Commands.setStates({ command: this._takeSnapshotCommand, enabled: this.canTakeSnapshot(), visible: this.canShowTakeSnapshot() }); } }; MemoryAnalyzerController.prototype.consoleNotifyCallback = function (args) { if(!this.summaryViewController.model.isTargetCompatible) { return; } var functionId = args.notifyType; var data = args.message; if(functionId === "takeHeapSnapshot") { this.takeSnapshot(); } }; MemoryAnalyzerController.prototype.canTakeSnapshot = function () { var summaryModel = this._summaryViewController.model; return summaryModel.isAttached && summaryModel.isRunning && !summaryModel.isTakingSnapshot && !summaryModel.isOffline; }; MemoryAnalyzerController.prototype.canShowTakeSnapshot = function () { var summaryModel = this._summaryViewController.model; return summaryModel.isAttached && summaryModel.isRunning && !summaryModel.isOffline; }; MemoryAnalyzerController.prototype.initCommands = function () { if(Plugin.VS && Plugin.VS.Commands) { this._takeSnapshotCommand = Plugin.VS.Commands.bindCommand({ name: "takesnapshotcommand", onexecute: this.onTakeSnapshotCommand.bind(this), enabled: this.canTakeSnapshot(), visible: this.canShowTakeSnapshot() }); } }; MemoryAnalyzerController.prototype.onDiagnosticsHubStateChanged = function (hubSession, args) { if(args.previousState === DiagnosticsHub.SessionState.CollectionStarted && args.currentState === DiagnosticsHub.SessionState.CollectionFinishing) { hubSession.removeStateChangedEventListener(this.onDiagnosticsHubStateChanged.bind(this, hubSession)); var eventCompleteDeferral = args.getDeferral(); var onSaveCompleted = function () { Notifications.notify(MemoryAnalyzer.MemoryNotifications.SessionEnd); MemoryAnalyzer.Program.fireCodeMarker(MemoryAnalyzer.CodeMarkerValues.perfBrowserTools_MemoryAnalyzerSessionEnd); eventCompleteDeferral.complete(); }; this._summaryViewController.save().done(onSaveCompleted, onSaveCompleted); } }; MemoryAnalyzerController.prototype.onTakeSnapshotCommand = function () { this.takeSnapshot(); }; return MemoryAnalyzerController; })(MemoryAnalyzer.DiagnosticsToolWindowController); MemoryAnalyzer.MemoryAnalyzerController = MemoryAnalyzerController; var MemoryAnalyzerView = (function (_super) { __extends(MemoryAnalyzerView, _super); function MemoryAnalyzerView(controller) { _super.call(this); this._controller = controller; this.title = Plugin.Resources.getString("Summary").toLocaleUpperCase(); this.tooltipString = Plugin.Resources.getString("SummaryTabTooltip"); this.content = new MemoryAnalyzer.SummaryTab(this._controller.summaryViewController); this._controller.summaryViewController.model.registerPropertyChanged(this); } MemoryAnalyzerView.prototype.onPropertyChanged = function (propertyName) { var model = this._controller.summaryViewController.model; switch(propertyName) { case "isTakingSnapshot": case "isAttached": case "isRunning": case "isOffline": this._controller.updateCommandState(); break; } }; MemoryAnalyzerView.prototype.onActiveChanged = function () { if(this.active) { var summaryView = this._controller.summaryViewController.view; if(summaryView) { summaryView.refreshGraph(); } } }; return MemoryAnalyzerView; })(MemoryAnalyzer.Controls.TabItem); MemoryAnalyzer.MemoryAnalyzerView = MemoryAnalyzerView; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=memoryAnalyzer.js.map // memoryAnalyzerData.ts var MemoryAnalyzer; (function (MemoryAnalyzer) { (function (Data) { "use strict"; var MemoryAnalyzerData = (function () { function MemoryAnalyzerData(memoryAnalyzerProxy) { this._proxy = memoryAnalyzerProxy; if(!this._proxy) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1065")); } } MemoryAnalyzerData.prototype.processSnapshotSummary = function (snapshotFile, prevSnapshotFile) { if (typeof prevSnapshotFile === "undefined") { prevSnapshotFile = ""; } var _this = this; return new Plugin.Promise(function (completed, error) { _this._proxy.processSnapshotSummary(snapshotFile, prevSnapshotFile, function (localSnapshotSummary) { completed(localSnapshotSummary); }, function (hr) { if(error) { error(MemoryAnalyzerData.GetErrorFromHr(hr)); } }, function () { }); }); }; MemoryAnalyzerData.prototype.processSnapshot = function (snapshotFile) { var _this = this; return new Plugin.Promise(function (completed, error, progress) { _this._proxy.processSnapshot(snapshotFile, function (proxy) { completed(new SnapshotData(proxy)); }, function (hr) { if(error) { error(MemoryAnalyzerData.GetErrorFromHr(hr)); } }, function (progValue) { if(progress) { progress(progValue); } }); }); }; MemoryAnalyzerData.prototype.processSnapshotDiff = function (snapshotFiles) { var _this = this; return new Plugin.Promise(function (completed, error, progress) { _this._proxy.processSnapshotDiff(snapshotFiles, function (proxy) { completed(new SnapshotData(proxy)); }, function (hr) { if(error) { error(MemoryAnalyzerData.GetErrorFromHr(hr)); } }, function (progValue) { if(progress) { progress(progValue); } }); }); }; MemoryAnalyzerData.GetErrorFromHr = function GetErrorFromHr(hr) { if(hr < 0) { hr = 0xFFFFFFFF + hr + 1; } switch(hr) { case 0x8007000E: case 0x89790008: return new Error(Plugin.Resources.getString("ERRoutOfMemory")); case 0x89790001: return new Error(Plugin.Resources.getString("ERRbadHexDigit")); case 0x89790002: return new Error(Plugin.Resources.getString("ERRbadNumber")); case 0x89790003: return new Error(Plugin.Resources.getString("ERRillegalChar")); case 0x89790005: return new Error(Plugin.Resources.getString("ERRnoColon")); case 0x89790006: return new Error(Plugin.Resources.getString("ERRnoRbrack")); case 0x89790007: return new Error(Plugin.Resources.getString("ERRnoRcurly")); case 0x89790009: return new Error(Plugin.Resources.getString("ERRnoStrEnd")); case 0x8979000a: return new Error(Plugin.Resources.getString("ERRsyntax")); case 0x8979000c: return new Error(Plugin.Resources.getString("ERRmissingObjectId")); case 0x8979000d: return new Error(Plugin.Resources.getString("ERRinvalidObjectID")); } return new Error(Plugin.Resources.getString("ERRunknownError", "0x" + hr.toString(16).toUpperCase())); }; return MemoryAnalyzerData; })(); Data.MemoryAnalyzerData = MemoryAnalyzerData; var SnapshotData = (function () { function SnapshotData(proxy) { this._heapObjectCache = { }; this._proxy = proxy; if(!this._proxy) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1066")); } } SnapshotData.prototype.getChildrenForObject = function (objectId, startIndex, maxResult, filter) { if (typeof startIndex === "undefined") { startIndex = 0; } if (typeof maxResult === "undefined") { maxResult = -1; } filter = this.getFilter(filter); var dataSet = this._proxy.getChildrenForObject(objectId, startIndex, maxResult, filter.showBuiltIns, filter.showUnknownSizes, filter.showUnknownTypes); this.performObjectCaching(dataSet); return dataSet; }; SnapshotData.prototype.getDominators = function (startIndex, maxResult, textFilter, filter) { if (typeof startIndex === "undefined") { startIndex = 0; } if (typeof maxResult === "undefined") { maxResult = -1; } if (typeof textFilter === "undefined") { textFilter = ""; } var _this = this; var requestId; return new Plugin.Promise(function (completed, error) { requestId = _this._proxy.getDominators(startIndex, maxResult, textFilter, filter.showBuiltIns, filter.showUnknownSizes, filter.showUnknownTypes, function (dataSetArg) { _this.performObjectCaching(dataSetArg); completed(dataSetArg); }, function (hr) { if(error) { error(MemoryAnalyzerData.GetErrorFromHr(hr)); } }); }, function () { if(typeof requestId !== "undefined") { _this._proxy.cancelRequest(requestId); } }); }; SnapshotData.prototype.getObjectsByType = function (type, startIndex, maxResult, filter) { if (typeof startIndex === "undefined") { startIndex = 0; } if (typeof maxResult === "undefined") { maxResult = -1; } filter = this.getFilter(filter); var dataSet = this._proxy.getObjectsByType(type, startIndex, maxResult, filter.showBuiltIns, filter.showUnknownSizes, filter.showUnknownTypes); this.performObjectCaching(dataSet); return dataSet; }; SnapshotData.prototype.getPathToRoot = function (objectId, parentObjectId, filter) { if (typeof parentObjectId === "undefined") { parentObjectId = 0; } filter = this.getFilter(filter); return this._proxy.getPathToRoot(objectId, parentObjectId, filter.showBuiltIns, filter.showUnknownSizes, filter.showUnknownTypes); }; SnapshotData.prototype.getRootObjects = function (filter) { filter = this.getFilter(filter); var dataSet = this._proxy.getRootObjects(filter.showBuiltIns, filter.showUnknownSizes, filter.showUnknownTypes); this.performObjectCaching(dataSet); return dataSet; }; SnapshotData.prototype.getTypes = function (textFilter, filter) { if (typeof textFilter === "undefined") { textFilter = ""; } var _this = this; filter = this.getFilter(filter); var requestId; return new Plugin.Promise(function (completed, error) { requestId = _this._proxy.getTypes(textFilter, filter.showBuiltIns, filter.showUnknownSizes, filter.showUnknownTypes, function (typesArg) { completed(typesArg); }, function (hr) { if(error) { error(MemoryAnalyzerData.GetErrorFromHr(hr)); } }); }, function () { if(typeof requestId !== "undefined") { _this._proxy.cancelRequest(requestId); } }); }; SnapshotData.prototype.getRetainedDescendants = function (objectId, startIndex, maxResult, filter) { if (typeof startIndex === "undefined") { startIndex = 0; } if (typeof maxResult === "undefined") { maxResult = -1; } filter = this.getFilter(filter); var dataSet = this._proxy.getRetainedDescendants(objectId, startIndex, maxResult, filter.showBuiltIns, filter.showUnknownSizes, filter.showUnknownTypes); this.performObjectCaching(dataSet); return dataSet; }; SnapshotData.prototype.getReferenceTreeItems = function (rootObjectId, objectId, nodeId, includeCircularReferences) { var dataSet = this._proxy.getReferenceTreeItems(rootObjectId, objectId, nodeId || 0, includeCircularReferences); this.performObjectCaching(dataSet); return dataSet; }; SnapshotData.prototype.hasDetachedDomNodes = function () { return this._proxy.hasDetachedDomNodes(); }; SnapshotData.prototype.getFilter = function (filter) { var newFilter = { }; filter = filter || { }; newFilter.showBuiltIns = filter.showBuiltIns || false; newFilter.showUnknownSizes = filter.showUnknownSizes || false; newFilter.showUnknownTypes = filter.showUnknownTypes || false; return newFilter; }; SnapshotData.prototype.performObjectCaching = function (dataSet) { var nodes = dataSet.result; if(nodes && nodes.length > 0) { for(var i = 0; i < nodes.length; i++) { var node = nodes[i]; if(typeof node.object !== "undefined") { var obj = node.object; this._heapObjectCache[obj.objectId] = obj; } else if(typeof node.objectId !== "undefined") { node.object = this._heapObjectCache[node.objectId]; } } } }; return SnapshotData; })(); Data.SnapshotData = SnapshotData; })(MemoryAnalyzer.Data || (MemoryAnalyzer.Data = {})); var Data = MemoryAnalyzer.Data; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=memoryAnalyzerData.js.map // memoryAnalyzerShell.ts var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; var MemoryAnalyzerShell = (function () { function MemoryAnalyzerShell(session) { this._session = session; } Object.defineProperty(MemoryAnalyzerShell.prototype, "session", { get: function () { return this._session; }, enumerable: true, configurable: true }); MemoryAnalyzerShell.prototype.createSnapshot = function () { var _this = this; return new Plugin.Promise(function (completed, failed) { _this._session.getSessionInfo().then(function (sessionInfo) { var relativePath = _this._session.getNewSnapshotRelativePath(); var filePath = sessionInfo.storageId + "\\" + relativePath; return Plugin.Storage.openFile(filePath, { access: Plugin.Storage.FileAccess.write, encoding: "UTF-8", mode: Plugin.Storage.FileMode.append, persistence: Plugin.Storage.FilePersistence.temporary, type: Plugin.Storage.FileType.text }).then(function (file) { completed({ file: file, relativePath: relativePath }); }, function (error) { if(failed) { failed(error); } }); }, function (error) { if(failed) { failed(error); } }); }); }; MemoryAnalyzerShell.prototype.save = function (addToProject) { return this._session.save(addToProject); }; return MemoryAnalyzerShell; })(); MemoryAnalyzer.MemoryAnalyzerShell = MemoryAnalyzerShell; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=memoryAnalyzerShell.js.map // memoryAnalyzerShell.vs.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; var VsMemoryAnalyzerShell = (function (_super) { __extends(VsMemoryAnalyzerShell, _super); function VsMemoryAnalyzerShell(session, sessionInfo) { _super.call(this, session); this.session.addViewTypeEventListener(this.onViewTypeChange.bind(this)); this._sessionInfo = sessionInfo; } VsMemoryAnalyzerShell.prototype.closeAllSnapshots = function () { return Plugin.Promise.as(null); }; VsMemoryAnalyzerShell.prototype.getHostSpecificString = function (resourceId) { var args = []; for (var _i = 0; _i < (arguments.length - 1); _i++) { args[_i] = arguments[_i + 1]; } return Plugin.Resources.getString(resourceId + "VS", args); }; VsMemoryAnalyzerShell.prototype.getSnapshotFullPath = function (storageId, relativePath) { return "%temp%\\ScriptedHost\\" + storageId + "\\" + relativePath; }; VsMemoryAnalyzerShell.prototype.initializeView = function () { switch(this._sessionInfo.sessionType) { case MemoryAnalyzer.Extensions.SessionType.session: var diagSession = new MemoryAnalyzer.Diagnostics.HubDiagnosticSession(); this._view = new VsMemoryAnalyzerShellSessionView(this._sessionInfo, diagSession); break; case MemoryAnalyzer.Extensions.SessionType.snapshot: this._view = new VsMemoryAnalyzerShellSnapshotView(this._sessionInfo); break; case MemoryAnalyzer.Extensions.SessionType.snapshotDiff: this._view = new VsMemoryAnalyzerShellSnapshotDiffView(this._sessionInfo); break; default: throw new Error(Plugin.Resources.getErrorString("JSPerf.1000")); } }; VsMemoryAnalyzerShell.prototype.isGraphCollectionSupported = function () { return false; }; VsMemoryAnalyzerShell.prototype.openSnapshot = function (relativePath, targetView, tabName, sortProperty) { return this.session.openSnapshotDetails(relativePath, targetView, tabName, sortProperty); }; VsMemoryAnalyzerShell.prototype.openSnapshotDiff = function (relativePaths, targetView, tabName, sortProperty) { return this.session.openSnapshotDiff(relativePaths, targetView, tabName, sortProperty); }; VsMemoryAnalyzerShell.prototype.resetView = function () { }; VsMemoryAnalyzerShell.prototype.startGraphCollection = function () { MemoryAnalyzer.Program.reportError(new Error("not implemented"), "startGraphCollection is not implemented"); return null; }; VsMemoryAnalyzerShell.prototype.onViewTypeChange = function (args) { this._view.changeViewType(args.viewType, args.sortProperty); }; return VsMemoryAnalyzerShell; })(MemoryAnalyzer.MemoryAnalyzerShell); MemoryAnalyzer.VsMemoryAnalyzerShell = VsMemoryAnalyzerShell; var VsMemoryAnalyzerShellSessionView = (function (_super) { __extends(VsMemoryAnalyzerShellSessionView, _super); function VsMemoryAnalyzerShellSessionView(sessionInfo, diagSession) { _super.call(this, document.getElementById('mainContainer')); this._controller = new MemoryAnalyzer.MemoryAnalyzerController(sessionInfo, diagSession); this.appendChild(this._controller.view); Plugin.addEventListener("close", this.onClose.bind(this)); } VsMemoryAnalyzerShellSessionView.prototype.changeViewType = function (viewType) { }; VsMemoryAnalyzerShellSessionView.prototype.onClose = function () { this._controller.goOffline(); }; return VsMemoryAnalyzerShellSessionView; })(Common.Controls.Control); MemoryAnalyzer.VsMemoryAnalyzerShellSessionView = VsMemoryAnalyzerShellSessionView; var VsMemoryAnalyzerShellSnapshotView = (function (_super) { __extends(VsMemoryAnalyzerShellSnapshotView, _super); function VsMemoryAnalyzerShellSnapshotView(sessionInfo) { _super.call(this, document.getElementById('mainContainer')); var controller = new MemoryAnalyzer.SnapshotViewController(sessionInfo.storageId); controller.loadSnapshot(sessionInfo.storageId, sessionInfo.filePaths, sessionInfo.targetView, sessionInfo.sortProperty); this._controller = controller; this._snapshotTab = new MemoryAnalyzer.SnapshotTab(controller); this.appendChild(this._snapshotTab); } VsMemoryAnalyzerShellSnapshotView.prototype.changeViewType = function (viewType, sortProperty) { this._controller.setTargetView(viewType, sortProperty); }; return VsMemoryAnalyzerShellSnapshotView; })(Common.Controls.Control); MemoryAnalyzer.VsMemoryAnalyzerShellSnapshotView = VsMemoryAnalyzerShellSnapshotView; var VsMemoryAnalyzerShellSnapshotDiffView = (function (_super) { __extends(VsMemoryAnalyzerShellSnapshotDiffView, _super); function VsMemoryAnalyzerShellSnapshotDiffView(sessionInfo) { _super.call(this, document.getElementById('mainContainer')); var diffController = new MemoryAnalyzer.SnapshotDiffController(sessionInfo.storageId); diffController.diffSnapshots(sessionInfo.storageId, sessionInfo.filePaths, sessionInfo.targetView, sessionInfo.sortProperty); this._diffController = diffController; this._snapshotTab = new MemoryAnalyzer.SnapshotTab(diffController); this.appendChild(this._snapshotTab); } VsMemoryAnalyzerShellSnapshotDiffView.prototype.changeViewType = function (viewType, sortType) { this._diffController.setTargetView(viewType, sortType); }; return VsMemoryAnalyzerShellSnapshotDiffView; })(Common.Controls.Control); MemoryAnalyzer.VsMemoryAnalyzerShellSnapshotDiffView = VsMemoryAnalyzerShellSnapshotDiffView; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=memoryAnalyzerShell.vs.js.map // memoryAnalyzerShell.f12.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; var F12MemoryAnalyzerShell = (function (_super) { __extends(F12MemoryAnalyzerShell, _super); function F12MemoryAnalyzerShell(externalObj, session, sessionInfo) { var _this = this; _super.call(this, session); this._openedDocs = { }; var diagSession = new MemoryAnalyzer.Diagnostics.F12DiagnosticsSession(externalObj); var controller = new MemoryAnalyzer.MemoryAnalyzerController(sessionInfo, diagSession); this._controller = controller; var external = (window.external); external.addEventListener("closing", function () { _this.closeAllSnapshots(); }); } F12MemoryAnalyzerShell.prototype.closeAllSnapshots = function () { for(var tabName in this._openedDocs) { if(this._openedDocs.hasOwnProperty(tabName)) { this._view.removeDoc(this._openedDocs[tabName]); } } this._openedDocs = { }; var filesPaths = []; var summaries = this._controller.summaryViewController.model.snapshotSummaryCollection; for(var i = 0; i < summaries.length; ++i) { var summary = summaries.getItem(i); var snapshotFile = summary.snapshotFile; var filePath = this.getSnapshotFullPath(snapshotFile.storageId, snapshotFile.relativePath); filesPaths.push(filePath); filesPaths.push(filePath + MemoryAnalyzer.SnapshotSummary.fileExtension); } this._controller.clearSummaryTab(); while(filesPaths.length > 0) { var filesPath = filesPaths.pop(); Plugin.F12.deleteFile(filesPath); } return Plugin.Promise.as(null); }; F12MemoryAnalyzerShell.prototype.getHostSpecificString = function (resourceId) { var args = []; for (var _i = 0; _i < (arguments.length - 1); _i++) { args[_i] = arguments[_i + 1]; } return Plugin.Resources.getString(resourceId + "F12", args); }; F12MemoryAnalyzerShell.prototype.getSnapshotFullPath = function (storageId, relativePath) { return "%temp%\\Microsoft\\F12\\perftools\\memory\\" + storageId + "\\" + relativePath; }; F12MemoryAnalyzerShell.prototype.initializeView = function () { this._view = new F12MemoryAnalyzerShellView(this._controller); }; F12MemoryAnalyzerShell.prototype.isGraphCollectionSupported = function () { return true; }; F12MemoryAnalyzerShell.prototype.openSnapshot = function (relativePath, targetView, tabName, sortProperty) { var _this = this; tabName = tabName.toLocaleUpperCase(); return this.session.openSnapshotDetails(relativePath, targetView, tabName, sortProperty).then(function (newSessionInfo) { var doc = _this._openedDocs[tabName]; if(!doc) { var controller = new MemoryAnalyzer.SnapshotViewController(newSessionInfo.storageId); controller.loadSnapshot(newSessionInfo.storageId, newSessionInfo.filePaths, newSessionInfo.targetView, newSessionInfo.sortProperty); doc = { controller: controller, sessionInfo: newSessionInfo, title: tabName, view: new MemoryAnalyzer.SnapshotTab(controller) }; doc.view.title = tabName; _this._openedDocs[tabName] = doc; } doc.controller.setTargetView(newSessionInfo.targetView, newSessionInfo.sortProperty); _this._view.addOrActivateDoc(doc); return Plugin.Promise.as(null); }); }; F12MemoryAnalyzerShell.prototype.openSnapshotDiff = function (relativePaths, targetView, tabName, sortProperty) { var _this = this; tabName = tabName.toLocaleUpperCase(); return this.session.openSnapshotDiff(relativePaths, targetView, tabName, sortProperty).then(function (newSessionInfo) { var doc = _this._openedDocs[tabName]; if(!doc) { var diffController = new MemoryAnalyzer.SnapshotDiffController(newSessionInfo.storageId); diffController.diffSnapshots(newSessionInfo.storageId, newSessionInfo.filePaths, newSessionInfo.targetView, newSessionInfo.sortProperty); doc = { controller: diffController, sessionInfo: newSessionInfo, title: tabName, view: new MemoryAnalyzer.SnapshotTab(diffController) }; doc.view.title = tabName; _this._openedDocs[tabName] = doc; } doc.controller.setTargetView(newSessionInfo.targetView, newSessionInfo.sortProperty); _this._view.addOrActivateDoc(doc); return Plugin.Promise.as(null); }); }; F12MemoryAnalyzerShell.prototype.resetView = function () { this._view.resetView(); }; F12MemoryAnalyzerShell.prototype.startGraphCollection = function () { return MemoryAnalyzer.Program.etwDataCollector.startSession("JavaScriptCollectionAgent.dll", "{37012E99-CDE8-4D9F-B228-CF98BC27B424}"); }; return F12MemoryAnalyzerShell; })(MemoryAnalyzer.MemoryAnalyzerShell); MemoryAnalyzer.F12MemoryAnalyzerShell = F12MemoryAnalyzerShell; var F12MemoryAnalyzerShellView = (function (_super) { __extends(F12MemoryAnalyzerShellView, _super); function F12MemoryAnalyzerShellView(memAnalyzerController) { _super.call(this, "f12ViewTemplate"); this._controller = memAnalyzerController; this._isProfiling = false; var title = this.findElement("title"); title.innerText = Plugin.Resources.getString("F12ToolTitle"); title.setAttribute("aria-label", Plugin.Resources.getString("F12ToolTitle")); this._startButton = this.findElement("startToolbarButton"); this._stopButton = this.findElement("stopToolbarButton"); this._takeSnapshotButton = this.findElement("takeSnapshotToolbarButton"); Common.ButtonHelpers.setupButton(this._startButton, "F12StartButtonTooltip", this.onStartClick.bind(this)); Common.ButtonHelpers.setupButton(this._stopButton, "F12StopButtonTooltip", this.onStopClick.bind(this)); Common.ButtonHelpers.setupButton(this._takeSnapshotButton, "F12SnapshotButtonTooltip", this.onTakeSnapshotClick.bind(this)); this._startProfilingLink = this.findElement("startProfilingMessage"); this._startProfilingLink.innerText = Plugin.Resources.getString("F12StartProfilingMessage"); this._startProfilingLink.addEventListener("click", this.onStartClick.bind(this)); this._model = memAnalyzerController.summaryViewController.model; this._model.registerPropertyChanged(this); this._model.isOffline = true; this._model.isRunning = !Plugin.F12.Debugger.getIsAtBreakpoint(); this._tabControl = new MemoryAnalyzer.Controls.TabControl(); this._tabControl.tabsLeftAligned = true; this._tabControl.addTab(this._controller.view); this._startProfilingPrompt = this.findElement("startProfilingPrompt"); this.updateStartProfilingPrompt(); this.findElement("tabContainer").appendChild(this._tabControl.rootElement); var parentContainer = document.getElementById('mainContainer'); parentContainer.appendChild(this.rootElement); } F12MemoryAnalyzerShellView.prototype.addOrActivateDoc = function (doc) { if(!this._tabControl.containsTab(doc.view)) { this._tabControl.addTab(doc.view); } this._tabControl.selectedItem = doc.view; }; F12MemoryAnalyzerShellView.prototype.onPropertyChanged = function (propertyName) { switch(propertyName) { case "isTakingSnapshot": case "isAttached": case "isRunning": case "isOffline": case "isTargetCompatible": this.updateUIState(); break; case "isStartProfilingPromptVisible": this.updateStartProfilingPrompt(); break; } if(propertyName === "isOffline" && this._model.isOffline && this._isProfiling) { Plugin.F12.Profiler.notifyOnStopProfiling(); this._isProfiling = false; } }; F12MemoryAnalyzerShellView.prototype.removeDoc = function (doc) { this._tabControl.removeTab(doc.view); }; F12MemoryAnalyzerShellView.prototype.resetView = function () { this._model.isStartProfilingPromptVisible = true; }; F12MemoryAnalyzerShellView.prototype.onStartClick = function (event) { if(this._controller && this._model.isOffline && Common.ButtonHelpers.isValidEvent(event)) { MemoryAnalyzer.Program.shell.closeAllSnapshots(); if(this._model.isTargetCompatible) { MemoryAnalyzer.Program.traceWriter.raiseEvent(Common.TraceEvents.Memory_ToolReady_Start); Plugin.F12.Profiler.notifyOnStartProfiling(); this._isProfiling = true; this._controller.showWarning(null); this._controller.goOnline(); MemoryAnalyzer.Program.traceWriter.raiseEvent(Common.TraceEvents.Memory_ToolReady_Stop); } else { this._controller.showWarning(MemoryAnalyzer.Program.shell.getHostSpecificString("WarningIncompatibleStandardsMode")); this._controller.summaryViewController.removeExistingGraph(); } this._model.isStartProfilingPromptVisible = false; this.updateUIState(); } }; F12MemoryAnalyzerShellView.prototype.onStopClick = function (event) { if(this._controller && !this._model.isOffline && Common.ButtonHelpers.isValidEvent(event)) { Plugin.F12.Profiler.notifyOnStopProfiling(); this._isProfiling = false; this._controller.showWarning(null); this._controller.goOffline(); if(this._model.snapshotSummaryCollection.length === 0) { this.resetView(); } this.updateUIState(); } }; F12MemoryAnalyzerShellView.prototype.onTakeSnapshotClick = function (event) { if(this._controller && Common.ButtonHelpers.isValidEvent(event)) { this._controller.takeSnapshot(); this.updateUIState(); } }; F12MemoryAnalyzerShellView.prototype.setButtonState = function (startEnabled, stopEnabled, takeSnapshotEnabled) { Common.ButtonHelpers.changeButtonStatus(this._startButton, startEnabled); Common.ButtonHelpers.changeButtonStatus(this._stopButton, stopEnabled); Common.ButtonHelpers.changeButtonStatus(this._takeSnapshotButton, takeSnapshotEnabled); }; F12MemoryAnalyzerShellView.prototype.updateStartProfilingPrompt = function () { this._startProfilingPrompt.style.display = this._model.isStartProfilingPromptVisible ? "" : "none"; this._tabControl.rootElement.style.display = this._model.isStartProfilingPromptVisible ? "none" : ""; }; F12MemoryAnalyzerShellView.prototype.updateUIState = function () { this._startProfilingLink.style.display = this._model.isStartEnabled ? "" : "none"; this.setButtonState(this._model.isStartEnabled, this._model.isStopEnabled, this._model.isTakeSnapshotEnabled); if(!this._model.isRunning) { Plugin.F12.ErrorDisplay.show(Plugin.Resources.getString("MemoryDisabledAtBreakpoint")); } else { Plugin.F12.ErrorDisplay.close(); } }; return F12MemoryAnalyzerShellView; })(Common.Controls.TemplateControl); MemoryAnalyzer.F12MemoryAnalyzerShellView = F12MemoryAnalyzerShellView; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=memoryAnalyzerShell.f12.js.map // Program.ts var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; (function (HostType) { HostType._map = []; HostType._map[0] = "VS"; HostType.VS = 0; HostType._map[1] = "F12"; HostType.F12 = 1; HostType._map[2] = "Test"; HostType.Test = 2; })(MemoryAnalyzer.HostType || (MemoryAnalyzer.HostType = {})); var HostType = MemoryAnalyzer.HostType; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=Program.js.map // Program.main.ts var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; var ProgramMain = (function () { function ProgramMain() { this._traceWriter = new Common.DefaultTraceWriter(); } Object.defineProperty(ProgramMain.prototype, "etwDataCollector", { get: function () { return this._etwDataCollector; }, enumerable: true, configurable: true }); Object.defineProperty(ProgramMain.prototype, "hostType", { get: function () { return this._hostType; }, enumerable: true, configurable: true }); Object.defineProperty(ProgramMain.prototype, "internalFeedback", { get: function () { return this._internalFeedback; }, enumerable: true, configurable: true }); Object.defineProperty(ProgramMain.prototype, "memoryAnalyzerData", { get: function () { return this._memoryAnalyzerData; }, enumerable: true, configurable: true }); Object.defineProperty(ProgramMain.prototype, "shell", { get: function () { return this._shell; }, enumerable: true, configurable: true }); Object.defineProperty(ProgramMain.prototype, "traceWriter", { get: function () { return this._traceWriter; }, enumerable: true, configurable: true }); Object.defineProperty(ProgramMain.prototype, "userSettings", { get: function () { return this._userSettings; }, enumerable: true, configurable: true }); ProgramMain.prototype.fireCodeMarker = function (codeMarker) { Plugin.VS.Internal.CodeMarkers.fire(codeMarker); }; ProgramMain.prototype.main = function () { var _this = this; if(window.parent && (window.parent).getExternalObj) { this._externalObj = (window.parent).getExternalObj(); } else if(window.external) { this._externalObj = window.external; } if(Plugin.F12) { this._hostType = MemoryAnalyzer.HostType.F12; } else { this._hostType = MemoryAnalyzer.HostType.VS; } Plugin.addEventListener("pluginready", function () { var session; var diagSession; var memAnalyzerProxy; var perfTrace; Plugin.Tooltip.defaultTooltipContentToHTML = false; switch(_this.hostType) { case MemoryAnalyzer.HostType.VS: session = new MemoryAnalyzer.Extensions.HostSessionProxy(); _this._internalFeedback = new MemoryAnalyzer.Extensions.InternalFeedbackProxy(); memAnalyzerProxy = Plugin.VS.Utilities.createExternalObject("MemoryAnalyzerExtension", "{81ACDD7F-96B1-46DC-8971-424AABD93C69}"); perfTrace = Plugin.VS.Utilities.createExternalObject("PerformanceTraceExtension", "{D76A409F-7234-4B71-9BFD-DEF3DC4CCCA6}"); break; case MemoryAnalyzer.HostType.F12: session = new MemoryAnalyzer.Extensions.LocalSession(); _this._internalFeedback = new MemoryAnalyzer.Extensions.NoOperationInternalFeedback(); _this._etwDataCollector = new Common.Data.F12EtwDataCollector(_this._externalObj.etwDataCollector); memAnalyzerProxy = Plugin.F12.Utilities.createExternalObject("MemoryAnalyzerExtension", "{81ACDD7F-96B1-46DC-8971-424AABD93C69}"); perfTrace = Plugin.F12.Utilities.createExternalObject("PerformanceTraceExtension", "{D76A409F-7234-4B71-9BFD-DEF3DC4CCCA6}"); break; default: throw new Error(Plugin.Resources.getErrorString("JSPerf.1027")); } if(perfTrace) { _this._traceWriter = new Common.TraceWriter(perfTrace); } _this._memoryAnalyzerData = new MemoryAnalyzer.Data.MemoryAnalyzerData(memAnalyzerProxy); var userSettingsProxy = new MemoryAnalyzer.Extensions.UserSettingsProxy(); userSettingsProxy.getUserSettings().then(function (userSettings) { _this._userSettings = userSettings; _this._session = session; _this.initializeErrorReporting(); Plugin.addEventListener("close", _this.onClose); session.getSessionInfo().done(function (sessionInfo) { _this._shell = _this.getShell(session, sessionInfo); _this._shell.initializeView(); _this.onIdle(); }); }); }); }; ProgramMain.prototype.initializeErrorReporting = function () { var _this = this; window.onerror = function (e, url, line) { var column; if(arguments && arguments[3] && typeof arguments[3] === 'number') { column = arguments[3]; } _this.reportError(new Error(e), "Unhandled Error", url, line, column); return true; }; }; ProgramMain.prototype.onIdle = function () { Notifications.notify(MemoryAnalyzer.MemoryNotifications.Idle); Plugin.VS.Internal.CodeMarkers.fire(MemoryAnalyzer.CodeMarkerValues.perfBrowserTools_MemoryAnalyzerIdle); }; ProgramMain.prototype.reportError = function (error, additionalInfo, source, line, column) { var _this = this; if(!this.userSettings.disableWER) { var message = (error.message || (error).description); var url = source || "MemoryAnalyzer"; var lineNumber = line || 0; var columnNumber = column || 0; var errorInfo = "Error description: " + message; if((error).number) { errorInfo += "\r\nError number: " + (error).number; } if(source) { errorInfo += "\r\nSource: " + source; } if((error).stack) { var stack = (error).stack; errorInfo += "\r\nError stack: " + stack; if(!message) { var index = stack.indexOf("\n"); if(index > 0) { index = Math.min(index, 50); message = stack.substring(0, index); } } if(typeof source === "undefined") { var matchInfo = stack.match(/(file|res):?([^)]+)\)/); if(matchInfo && matchInfo.length > 2) { url = matchInfo[2]; } } if(typeof line === "undefined") { matchInfo = stack.match(/line ?(\d+)/); if(!matchInfo || matchInfo.length <= 1) { matchInfo = stack.match(/js:?(\d+):/); } if(matchInfo && matchInfo.length > 1) { lineNumber = parseInt(matchInfo[1]); } } } if(additionalInfo) { errorInfo += "\r\nAdditional Info: " + additionalInfo; } Plugin.Diagnostics.reportError(message, url, lineNumber, errorInfo, columnNumber); this.internalFeedback.isEnabled().done(function (enabled) { if(enabled) { _this._session.save(false).done(function (fileLocation) { _this.internalFeedback.sendData(true, "", "", "", errorInfo, fileLocation); }); } }); } }; ProgramMain.prototype.getShell = function (session, sessionInfo) { switch(this.hostType) { case MemoryAnalyzer.HostType.VS: return new MemoryAnalyzer.VsMemoryAnalyzerShell(session, sessionInfo); case MemoryAnalyzer.HostType.F12: return new MemoryAnalyzer.F12MemoryAnalyzerShell(this._externalObj, session, sessionInfo); default: throw new Error(Plugin.Resources.getErrorString("JSPerf.1027")); } }; ProgramMain.prototype.onClose = function () { Notifications.notify(MemoryAnalyzer.MemoryNotifications.WindowClose); Plugin.VS.Internal.CodeMarkers.fire(MemoryAnalyzer.CodeMarkerValues.perfBrowserTools_MemoryAnalyzerWindowClose); }; return ProgramMain; })(); MemoryAnalyzer.ProgramMain = ProgramMain; MemoryAnalyzer.Program = new ProgramMain(); })(MemoryAnalyzer || (MemoryAnalyzer = {})); (MemoryAnalyzer.Program).main(); //@ sourceMappingURL=Program.main.js.map // RemoteCommands.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; var RegisterConsoleCallbacksCommand = (function () { function RegisterConsoleCallbacksCommand(callback) { this._dataReceivedHandler = callback; } Object.defineProperty(RegisterConsoleCallbacksCommand.prototype, "args", { get: function () { return []; }, enumerable: true, configurable: true }); Object.defineProperty(RegisterConsoleCallbacksCommand.prototype, "hasCompleted", { get: function () { return null; }, enumerable: true, configurable: true }); Object.defineProperty(RegisterConsoleCallbacksCommand.prototype, "name", { get: function () { return "registerConsoleCallbacks"; }, enumerable: true, configurable: true }); Object.defineProperty(RegisterConsoleCallbacksCommand.prototype, "dataReceivedHandler", { get: function () { return this._dataReceivedHandler; }, enumerable: true, configurable: true }); Object.defineProperty(RegisterConsoleCallbacksCommand.prototype, "executedHandler", { get: function () { return null; }, enumerable: true, configurable: true }); return RegisterConsoleCallbacksCommand; })(); MemoryAnalyzer.RegisterConsoleCallbacksCommand = RegisterConsoleCallbacksCommand; var MultipartResponseCommand = (function () { function MultipartResponseCommand(name, args) { this._name = name; this._args = args; this._hasCompleted = false; this._currentPartId = 0; this.actualPartCount = 0; this.expectedPartCount = -1; this._parts = { }; this._processedPartCount = 0; this.executedHandler = this.onExecuted.bind(this); this.dataReceivedHandler = this.onDataReceived.bind(this); } Object.defineProperty(MultipartResponseCommand.prototype, "args", { get: function () { return this._args; }, enumerable: true, configurable: true }); Object.defineProperty(MultipartResponseCommand.prototype, "hasCompleted", { get: function () { return this._hasCompleted; }, enumerable: true, configurable: true }); Object.defineProperty(MultipartResponseCommand.prototype, "name", { get: function () { return this._name; }, enumerable: true, configurable: true }); MultipartResponseCommand.prototype.checkCompleted = function () { if(!this.hasCompleted && this.actualPartCount === this.expectedPartCount && this._processedPartCount === this.expectedPartCount) { this._hasCompleted = true; if(this.allPartsReceivedHandler) { this.allPartsReceivedHandler(this._parts); } if(this.completedHandler) { this.completedHandler(this); } } }; MultipartResponseCommand.prototype.onDataReceived = function (part) { var _this = this; if(part.partId === -1) { if(this.errorHandler) { this.errorHandler(new Error(part.data)); } return; } ++this.actualPartCount; this._parts[part.partId] = part.data; if(this.partProcessingHandler) { while(typeof this._parts[this._currentPartId] !== "undefined") { var currentPart = this._parts[this._currentPartId]; this.partProcessingHandler(currentPart).done(function () { _this._processedPartCount++; _this.checkCompleted(); }, function (err) { if(_this.errorHandler) { _this.errorHandler(err); } }); delete this._parts[this._currentPartId]; ++this._currentPartId; } } else { this._processedPartCount++; } this.checkCompleted(); }; MultipartResponseCommand.prototype.onExecuted = function (args) { if(typeof args !== "undefined") { this.expectedPartCount = args; } else { if(this.errorHandler) { this.errorHandler(new Error(Plugin.Resources.getErrorString("JSPerf.1059"))); } } }; return MultipartResponseCommand; })(); MemoryAnalyzer.MultipartResponseCommand = MultipartResponseCommand; var TakeSnapshotCommand = (function (_super) { __extends(TakeSnapshotCommand, _super); function TakeSnapshotCommand(args, file) { var _this = this; _super.call(this, "takeSnapshot", args); this._file = file; this.partProcessingHandler = function (data) { return _this._file.write(data); }; } return TakeSnapshotCommand; })(MultipartResponseCommand); MemoryAnalyzer.TakeSnapshotCommand = TakeSnapshotCommand; })(MemoryAnalyzer || (MemoryAnalyzer = {})); //@ sourceMappingURL=RemoteCommands.js.map var MemoryAnalyzer; (function (MemoryAnalyzer) { "use strict"; var __BROWSERTOOLS_FileReaderReadyState; (function (__BROWSERTOOLS_FileReaderReadyState) { __BROWSERTOOLS_FileReaderReadyState._map = []; __BROWSERTOOLS_FileReaderReadyState.Empty = 0; __BROWSERTOOLS_FileReaderReadyState.Loading = 1; __BROWSERTOOLS_FileReaderReadyState.Done = 2; })(__BROWSERTOOLS_FileReaderReadyState || (__BROWSERTOOLS_FileReaderReadyState = {})); var __BROWSERTOOLS_RemoteCode = (function () { function __BROWSERTOOLS_RemoteCode() { expectedWindowProperty = "__BROWSERTOOLS_MEMORYANALYZER_ADDED"; } __BROWSERTOOLS_RemoteCode.prototype.initialize = function () { browser.addEventListener("beforeScriptExecute", this.onBeforeScriptExecute.bind(this)); this.consoleNotificationQueue = []; var messageHandlers = []; messageHandlers["takeSnapshot"] = this.takeSnapshot.bind(this); messageHandlers["registerConsoleCallbacks"] = this.registerConsoleCallbacks.bind(this); this._remoteHelper = new Common.__BROWSERTOOLS_RemoteHelper(messageHandlers); this._remoteHelper.initialize("MemoryAnalyzerPort", this.initializePage.bind(this), this.onDetach.bind(this)); }; __BROWSERTOOLS_RemoteCode.appendSnapshotPart = function appendSnapshotPart(record, snapshot) { if(!record) { return; } var part = JSON.parse(record); if(!snapshot.version && part.version) { snapshot.version = part.version; } if(part.data) { if(!snapshot.data) { snapshot.data = []; } for(var i = 0; i < part.data.length; ++i) { snapshot.data.push(part.data[i]); } } if(!snapshot.privateBytes && part.privateBytes) { snapshot.privateBytes = part.privateBytes; } if(!snapshot.pointerSize && part.pointerSize) { snapshot.pointerSize = part.pointerSize; } if(!snapshot.base64Image && part.base64Image) { snapshot.base64Image = part.base64Image; } }; __BROWSERTOOLS_RemoteCode.readAndChunk = function readAndChunk(blob, chunkSize, callback) { var reader = new FileReader(); reader.onloadend = function (e) { if(reader.readyState === __BROWSERTOOLS_FileReaderReadyState.Done) { try { var partCount = Math.ceil(blob.size / chunkSize); for(var partId = 0; partId < partCount; ++partId) { var start = partId * chunkSize; var end = Math.min(start + chunkSize, blob.size); var data = (reader.result).substring(start, end); var response = { partId: partId, data: data }; callback(response); } } catch (ex) { var errorResponse = { partId: -1, data: ex.message }; callback(errorResponse); }finally { blob.msClose(); resources.memory.triggerGarbageCollection(); } } }; reader.readAsText(blob); }; __BROWSERTOOLS_RemoteCode.prototype.addRemotePageFunctions = function (realWindow) { (realWindow)[expectedWindowProperty] = browser.createSafeFunction(realWindow, function () { }); }; __BROWSERTOOLS_RemoteCode.prototype.initializeConsole = function (realWindow) { var _this = this; if(realWindow.Console && realWindow.Console.prototype) { if(!realWindow.Console.prototype.takeHeapSnapshot) { realWindow.Console.prototype.takeHeapSnapshot = browser.createSafeFunction(realWindow, function (message) { _this.onConsoleExecute("takeHeapSnapshot", message); }); } } var __BROWSERTOOLS_detachHandler = function () { _this.onDetach(); toolUI.removeEventListener("detach", __BROWSERTOOLS_detachHandler); }; var __BROWSERTOOLS_unloadHandlerSafe = browser.createSafeFunction(realWindow, function () { toolUI.removeEventListener("detach", __BROWSERTOOLS_detachHandler); }); if(realWindow.addEventListener) { realWindow.addEventListener("unload", __BROWSERTOOLS_unloadHandlerSafe); } else { realWindow.attachEvent("onunload", __BROWSERTOOLS_unloadHandlerSafe); } toolUI.addEventListener("detach", __BROWSERTOOLS_detachHandler); }; __BROWSERTOOLS_RemoteCode.prototype.initializeConsoles = function (windowToAttach) { var realWindow = null; try { realWindow = windowToAttach.document.parentWindow; } catch (ex) { return; } this.initializeConsole(realWindow); if(realWindow.frames) { for(var i = 0; i < realWindow.frames.length; i++) { var frame = realWindow.frames[i]; if(frame) { var iframe = dom.getCrossSiteWindow(realWindow, frame); if(iframe) { this.initializeConsoles(iframe); } } } } }; __BROWSERTOOLS_RemoteCode.prototype.initializePage = function () { try { if(browser.document.documentMode >= 10) { this.addRemotePageFunctions(browser.document.parentWindow); this.initializeConsoles(browser); } var connectionInfo = { docMode: browser.document.documentMode, contextInfo: browser.document.parentWindow.location.href }; this._remoteHelper.port.postMessage("Handshake:" + JSON.stringify(connectionInfo)); this._remoteHelper.initializeDocumentTries = 0; } catch (ex) { this.onDocumentNotReady(); } }; __BROWSERTOOLS_RemoteCode.prototype.onBeforeScriptExecute = function (dispatchWindow) { if(dispatchWindow && (dispatchWindow).browserOrWindow) { dispatchWindow = (dispatchWindow).browserOrWindow; } var realWindow = null; try { realWindow = dispatchWindow.document.parentWindow; } catch (ex) { return; } if(realWindow === browser.document.parentWindow && this._remoteHelper.port) { this._remoteHelper.postAllMessages(); this.initializePage(); } }; __BROWSERTOOLS_RemoteCode.prototype.onConsoleExecute = function (functionId, data) { if(!this.notifyCallback) { this.consoleNotificationQueue.push({ notifyType: functionId, message: data }); } else { this.notifyCallback({ notifyType: functionId, message: data }); } }; __BROWSERTOOLS_RemoteCode.prototype.onDetach = function () { this._remoteHelper.initializeDocumentTries = 0; try { var realWindow = browser.document.parentWindow; if(realWindow[expectedWindowProperty]) { delete realWindow[expectedWindowProperty]; } } catch (ex) { } }; __BROWSERTOOLS_RemoteCode.prototype.onDocumentNotReady = function () { if(this._remoteHelper.initializeDocumentTries < this._remoteHelper.initializeDocumentMaxTries) { ++this._remoteHelper.initializeDocumentTries; this._remoteHelper.port.postMessage("DocumentNotYetReady"); } else { this._remoteHelper.errorHandler.onError("Document timed out", "Remote.js", 0); } }; __BROWSERTOOLS_RemoteCode.prototype.registerConsoleCallbacks = function (notifyCallback) { this.notifyCallback = notifyCallback; for(var i = 0; i < this.consoleNotificationQueue.length; i++) { var notification = this.consoleNotificationQueue[i]; this.onConsoleExecute(notification.notifyType, notification.message); } }; __BROWSERTOOLS_RemoteCode.prototype.takeSnapshot = function (chunkSize, targetWidth, targetHeight, keepAspectRatio, callback) { try { var snapshot = resources.memory.getMemoryProfile(); var screenshot = browser.takeVisualSnapshot(targetWidth, targetHeight, keepAspectRatio); var pointerSize = resources.memory.processPointerSize; var privateBytes = resources.memory.processPrivateBytes.toString(); var snapshotPartCount = Math.ceil(snapshot.size / chunkSize); var screenshotPartCount = Math.ceil(screenshot.size / chunkSize); var totalPartCount = snapshotPartCount + screenshotPartCount + 1; var newline = "\r\n"; __BROWSERTOOLS_RemoteCode.readAndChunk(snapshot, chunkSize, callback); var screenshotPartStartId = snapshotPartCount; var screenshotReader = new FileReader(); screenshotReader.onloadend = function (e) { if(screenshotReader.readyState === __BROWSERTOOLS_FileReaderReadyState.Done) { try { var object = { base64Image: screenshotReader.result }; var data = newline + JSON.stringify(object) + newline; var response; for(var chunkId = 0; chunkId < screenshotPartCount; ++chunkId) { var start = chunkId * chunkSize; var end; if(chunkId === screenshotPartCount - 1) { end = data.length; } else { end = (chunkId + 1) * chunkSize; } response = { partId: chunkId + screenshotPartStartId, data: data.substring(start, end) }; callback(response); } } catch (ex) { var errorResponse = { partId: -1, data: ex.message }; callback(errorResponse); }finally { screenshot.msClose(); } } }; screenshotReader.readAsText(screenshot); var clientName = browser.document.parentWindow.navigator.appName; var clientVersion = browser.document.parentWindow.navigator.appVersion; var docMode = browser.document.documentMode; var object = { pointerSize: pointerSize, privateBytes: privateBytes, clientName: clientName, clientVersion: clientVersion, docMode: docMode }; var data = JSON.stringify(object) + newline; var response = { partId: totalPartCount - 1, data: data }; callback(response); return totalPartCount; } catch (ex) { var errorResponse = { partId: -1, data: ex.message }; callback(errorResponse); } }; return __BROWSERTOOLS_RemoteCode; })(); MemoryAnalyzer.__BROWSERTOOLS_RemoteCode = __BROWSERTOOLS_RemoteCode; })(MemoryAnalyzer || (MemoryAnalyzer = {})); var remoteCode = new MemoryAnalyzer.__BROWSERTOOLS_RemoteCode(); remoteCode.initialize(); //@ sourceMappingURL=Remote.js.map .snapshotTilesContainer { -ms-grid-row: 3; color: TRANSPARENT; /*[{plugin-color}]*/ font-size: 9pt; /*[{plugin-font-size}]*/ font-family: "Segoe UI", Arial, sans-serif; /*[{plugin-font-family} , Arial, sans-serif]*/ padding-left: 14px; padding-right: 14px; } .snapshotTilesContainer a:focus { outline: 1px dotted TRANSPARENT; /*[1px dotted {plugin-perftools-focusdots}]*/ } .snapshotTile { position: relative; float: left; } .snapshotTile > .snapshotTileInner { -ms-grid-columns: 1fr; -ms-grid-rows: auto auto auto; box-sizing: border-box; display: -ms-grid; font-size: small; margin: 5px 10px 5px 0px; min-height: 253px; min-width: 272px; position: relative; } .snapshotTileInner > .snapshotTileHeader { background-color: TRANSPARENT; /*[{plugin-memory-snapshot-tile-header}]*/ padding: 5px; padding-left: 10px; -ms-grid-row: 1; width: 100%; position: relative; display: -ms-grid; -ms-grid-columns: auto auto 1fr; -ms-grid-rows: auto; margin-bottom: 5px; } .snapshotTileInner > .snapshotTileHeader > .snapshotTileTitle { padding-top: 1px; display: inline-block; -ms-grid-column: 1; } .snapshotTileInner > .snapshotTileHeader > .snapshotTakenDate { margin-left: 10px; display: inline-block; -ms-grid-column: 2; } .snapshotTileInner > .snapshotTileHeader > .snapshotTileDetachedDomNodeInfo { -ms-flex-align: center; -ms-flex-item-align: center; -ms-grid-column: 3; -ms-grid-column-align: end; display: -ms-flexbox; margin-right: 10px; visibility: hidden; } .snapshotTileInner > .snapshotTileHeader > .snapshotTileDetachedDomNodeInfo > .detachedDomNodeWarning { display: inline-block; height: 18px; width: 18px; } .snapshotTileInner > .snapshotTileHeader > .snapshotTileDetachedDomNodeInfo > .snapshotTileDetachedDomNodeCount { vertical-align: top; } .snapshotTileInner > .snapshotTileGrid { -ms-grid-row: 2; -ms-grid-rows: auto auto; -ms-grid-columns: auto 16px 1fr auto 16px; color: TRANSPARENT; /*[{plugin-link-color}]*/ display: -ms-grid; margin-left: 10px; margin-right: 10px; margin-top: 5px; } .snapshotTileInner > .snapshotTileGrid a { margin-top: 5px; white-space: nowrap; } .snapshotTileInner > .snapshotTileGrid .bottomRow { margin-top: 4px; -ms-grid-row: 2; } .snapshotTileInner > .snapshotTileGrid .rightColumn { -ms-grid-column: 4; } .snapshotTileInner > .snapshotTileGrid .rightalign { -ms-grid-column-align: end; } .snapshotTileInner > .snapshotTileGrid .heapIcon { -ms-grid-column: 2; -ms-grid-row-align: center; margin-left: 3px; } .snapshotTileInner > .snapshotTileGrid .objectsIcon { -ms-grid-column: 5; -ms-grid-row-align: center; margin-left: 3px; } .snapshotTileInner > .snapshotTileGrid .heapDecreaseIcon { background: url('images/status_heap_decrease.png') no-repeat 0px 0px; /*[url({image-heap-decrease}) no-repeat 0px 0px]*/ background-size: 10px 11px; height: 11px; width: 10px; } .snapshotTileInner > .snapshotTileGrid .heapIncreaseIcon { background: url('images/status_heap_increase.png') no-repeat 0px 0px; /*[url({image-heap-increase}) no-repeat 0px 0px]*/ background-size: 10px 11px; height: 11px; width: 10px; } .snapshotTileInner > .snapshotTileGrid .baselineText { color: TRANSPARENT; /*[{plugin-memory-snapshot-tile-baseline-text}]*/ text-decoration: none; } .snapshotTileInner > .snapshotTileImageHolder { -ms-grid-row: 3; display: -ms-grid; -ms-grid-columns: 1fr auto 1fr; margin-top: 10px; margin-bottom: 10px; height: 150px; } .snapshotTileInner > .snapshotTileImageHolder > .snapshotTileImage { -ms-grid-column: 2; max-width: 250px; max-height: 150px; } .snapshotTileTaken > .snapshotTileInner { background-color: TRANSPARENT; /*[{plugin-memory-snapshot-tile}]*/ border: 1px solid TRANSPARENT; /*[1px solid {plugin-memory-snapshot-tile-border}]*/ } .snapshotTileBlank { -ms-grid-columns: 1fr; -ms-grid-rows: auto 1fr; background-color: transparent; border: none; display: -ms-grid; } .snapshotTileBlank > .snapshotError { -ms-grid-row: 1; color: red; /*[{plugin-memory-snapshot-tile-error-text}]*/ display: none; font-weight: 600; margin: 10px; text-align: center; text-transform: none; top: 10%; width: 200px; } .snapshotTileBlank > .snapshotTileInner { -ms-grid-row: 2; background-color: transparent; box-sizing: border-box; display: table; min-height: 150px; min-width: 200px; padding: 0; width: 100%; } .snapshotTileBlank > .snapshotTileInner .takeSnapshotButton { display: table-cell; text-align: center; vertical-align: middle; border-width: 1px; border-style: solid; padding: 0; background-image: none; font-size: 1.0em; font-family: "Segoe UI", Arial, sans-serif; /*[{plugin-font-family} , Arial, sans-serif]*/ background-color: TRANSPARENT; /*[{plugin-memory-snapshot-button}]*/ border-color: TRANSPARENT; /*[{plugin-memory-snapshot-button-border}]*/ color: TRANSPARENT; /*[{plugin-link-color}]*/ } .snapshotTileBlank > .snapshotTileInner .takeSnapshotButton:hover:enabled { background-color: TRANSPARENT; /*[{plugin-memory-snapshot-button-hover}]*/ border-color: TRANSPARENT; /*[{plugin-memory-snapshot-button-border-hover}]*/ color: TRANSPARENT; /*[{plugin-memory-snapshot-button-hover-text}]*/ } .snapshotTileBlank > .snapshotTileInner .takeSnapshotButton:focus:enabled { background-color: TRANSPARENT; /*[{plugin-memory-snapshot-button-hover}]*/ color: TRANSPARENT; /*[{plugin-memory-snapshot-button-hover-text}]*/ } .snapshotTileBlank > .snapshotTileInner .takeSnapshotButton:active:enabled { background-color: TRANSPARENT; /*[{plugin-memory-snapshot-button-active}]*/ border-color: TRANSPARENT; /*[{plugin-memory-snapshot-button-border-active}]*/ color: TRANSPARENT; /*[{plugin-memory-snapshot-button-active-text}]*/ } .snapshotTileBlank > .snapshotTileInner .takeSnapshotButton.disabled { background-color: TRANSPARENT; /*[{plugin-memory-snapshot-button-disabled}]*/ color: TRANSPARENT; /*[{plugin-memory-snapshot-button-disabled-text}]*/ } .snapshotTileBlank > .snapshotTileInner .takeSnapshotButton.disabled .takeSnapshotIcon { background-position-y: -64px; } .snapshotTileBlank > .snapshotTileInner .takeSnapshotButton .snapshotTileTextContainer { -ms-grid-columns: 1fr; -ms-grid-rows: 1fr 1fr; display: -ms-grid; } .snapshotTileBlank > .snapshotTileInner .takeSnapshotButton .snapshotTileTextContainer .takeSnapshotIcon { -ms-grid-column: 1; -ms-grid-column-align: center; -ms-grid-row: 1; -ms-grid-row-align: end; background: url('images/takeSnapshot.png') no-repeat 0px 0px; /*[url({image-snapshot}) no-repeat 0px 0px]*/ background-size: 32px 96px; height: 32px; margin-right: 5px; width: 32px; } .snapshotTileBlank > .snapshotTileInner .takeSnapshotButton .snapshotTileTextContainer .takeSnapshotLabel { -ms-grid-column: 1; -ms-grid-column-align: center; -ms-grid-row: 2; -ms-grid-row-align: start; } .snapshotTileBlank > .snapshotTileInner .takeSnapshotButton progress { width: 50%; margin: auto; display: none; color: TRANSPARENT; /*[{plugin-perftools-progress}]*/ } PNG  IHDRw= pHYs+ cHRMz%u0`:o_FOIDATxڴ1@EQ@3bcr#cOb\``MTcS6Jсa(;>MόWU u.KOzcU$IPfn>^n"2ПeC;/T4!a"w_V0'I^D.U=~\&"W 0Ͳ<ϟvALMqkm5I㱮 }DQdoMQ>mzRE߷}G֢&C=]u|HM.<ߋȭWn…]]пظBo:*:] 7ɪmq%lL]zoSXx~/+IENDB`PNG  IHDR$l gAMA|Q cHRMR@}y<s,٩<9SbL!GĈ 3,F0+7T3IlpX"61"H _qW,d ėrIKst.ښAdp&+g]RәY2EE44432PuoJEzg`̉j- -b8o׿M]9La.+-%Mȧg3YះuAxEK i<:ŹPcu*@~(  ]o0 ~y*s7g%9%(3H*@C`-pn VH@ A1 jPA3hA'8΃Kn`Lg` a!2D!H҇ dAP B Byf*z: @]h ~L CUp΅ p%;56< ?" GxG iE>&2 oQEGlQP UFFuzQ7QcYG4G۠t]nB/o'Я1 xb"1I>Lf3bX} *QYvGĩp( &q x)&gsF|7:~@&h!$&B%pH$D.q#xx8F|K!\H$!i.%L";r3EHK-AFCbH$^RSIrdd 3Rx)-))zR#RsiSiT#Wd2Z2n2l2d)EBaQ6S))T UEMSPgeedɆfȞ!4--VJ;N g%K-sɵݖ{'OwO%)P_RRۥEK/+))U<د8䡔TtAiF쨜\|FyZbU)W9.Kw+YUEUOUjꂚZZZCu:C=^\G}VCEO#OE&^WOs^K[+\kV֔vv[]n>z^^u}XROm`m3h01$:fь|:kG23hbabhrT4ߴw3=3Y-s.q_vǂbgբ⃥%߲rJ*֪jAe0JOY6rvvtXLǎl&I']$NϝM.6.\ι"En2nnn[g=,=t٪E2}4\j5loDŽǞ~q=''Z^utv&vvEv >mяN9-{ LOgsΝK?7s>xOL n\x }N}g/]>uɫ,u[dS@u]7ot.<30tKn]p;;SwSyoEVQP 8w ۊdky~C8Ⱦ걪>-nkhcj;еņͼdT'_T-jT`='Z%SK[LY2,^,B>X0=lȞLV gI=钶.JRo]ݻ_^vΗoُ_!vnN j\+Mi2Xb;FFe?O T*]Xky )@u2|Dt wAk6˫f`>-$]Wr{V;C]Xm\C"_{JHi,sL)SYJR /%$)bxȔ|!4!{$s BnOQ:&H agOQO"_i|n#/W۟D.43] I/v"h1O>V{IV^]R"(Z I=Z3i]h|/y3{9 !}ŁZMjz?Xx׻J{WWW1@zeWf;N҂Z#7YJ*h_ֲJATb=$n1eƬ;tww^ or3d- ufxlQ:^?C֎4rހGaɲ誶aup) bxKYn)bx*KYBdJDRfuDHi47/I =FDV7bJ"_^\% /@x;k4u vB"̜u$9yעGr* fbT,BG>X@V,٩<9SbL!GĈ 3,F0+7T3IlpX"61"H _qW,d ėrIKst.ښAdp&+g]RәY2EE44432PuoJEzg`̉j- -b8o׿M]9La.+-%Mȧg3YះuAxEK i<:ŹPcu*@~(  ]o0 ~y*s7g%9%(3H*@C`-pn VH@ A1 jPA3hA'8΃Kn`Lg` a!2D!H҇ dAP B Byf*z: @]h ~L CUp΅ p%;56< ?" GxG iE>&2 oQEGlQP UFFuzQ7QcYG4G۠t]nB/o'Я1 xb"1I>Lf3bX} *QYvGĩp( &q x)&gsF|7:~@&h!$&B%pH$D.q#xx8F|K!\H$!i.%L";r3EHK-AFCbH$^RSIrdd 3Rx)-))zR#RsiSiT#Wd2Z2n2l2d)EBaQ6S))T UEMSPgeedɆfȞ!4--VJ;N g%K-sɵݖ{'OwO%)P_RRۥEK/+))U<د8䡔TtAiF쨜\|FyZbU)W9.Kw+YUEUOUjꂚZZZCu:C=^\G}VCEO#OE&^WOs^K[+\kV֔vv[]n>z^^u}XROm`m3h01$:fь|:kG23hbabhrT4ߴw3=3Y-s.q_vǂbgբ⃥%߲rJ*֪jAe0JOY6rvvtXLǎl&I']$NϝM.6.\ι"En2nnn[g=,=t٪E2}4\j5loDŽǞ~q=''Z^utv&vvEv >mяN9-{ LOgsΝK?7s>xOL n\x }N}g/]>uɫ,u[dS@u]7ot.<30tKn]p;;SwSyoEV9j0G)5 _\>1j5/5t3jY:/1 .V{7=3CWz@xcж,γep@ϫbР-{ QPx9 Z8C A 5$( qɈ8aC ;GPfo0j֮jm!R&Tn/K-kB5R&!pjm6&ph2|Fl۔w NB|L7FG4#:r5 <#\sTT& Zb6Y5 )}Zb6g&~qiРbŖ@>._kHA9h z Ieh3Sz iѱi]ޡ N_OW9mZ-AѦ%5י"kOMN׎D!о)b2ӼӘ5 #2S;b!R3bM˔s!2AYHC# ]'(SC9ðFZZ2$VZZҶv!pjXiMtД-TM%HI#tmjf vNbu?ᨖM r5Fn!FnG\MlW1ѠM}UT&+<c,9-X DiM5'w33 Z|A!Ma{ :69ОPD2kZlZ^Cz_h z }4Kkq^Cb`yo:`!&k9{ 3 0#-X˦/8СC ;ʔȿlp$68 q/,*EIENDB`PNG  IHDR6l!PAL pHYs   OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FIDATxZ;@ 9++ C\H&M4i]u  l`H?VX(<~*1I0\׊y#1YGI4ǒӾʍw{97+<Ճ.w69̃_K H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FIDATxԽ@0&F5LSMb:R+OGT~%7N"s,`Sfc .`޸E.1Q~ zTzÂ`bQ0GPAXx@' `U9LIENDB`PNG  IHDRA pHYs+ OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FrIDATxҭ0 NBcYɻ (i#{.yO(ZKa{*= Xe&l~Qv`Y셚A?R '8AM{8>XHqIENDB`PNG  IHDR@egAMA a pHYsktEXtSoftwarePaint.NET v3.5.100rAIDATx^qHE3+ *~Yel.] A!(/TDOpg}N6.ك$}AAA޾}ݻw*}իWߘFZ hro&Z.S O=z7?AvF>B62 }3{m4.Q`ӧntGԪ6OםNApBZҫgSه. l]PCfåKDi[Tx#{t6&^K͸ћ%]Qe&G7JsQL@I[hm[oaglw     "~ϟ*Jk+46?A~,/4~ߚٴ@GSm͏nr yqݛ]}ZvS'|/ с@q<^H?cE$`񇢘!^VB[";#:~,8Uc8Omx!{mx!{mȹ/E_).F/P6뷄KHAAAOy?Z)H+IENDB`/* * TabControl styles */ .tabControl { height: 100%; display: -ms-grid; -ms-grid-columns: 1fr; -ms-grid-rows: auto 1fr; box-sizing: border-box; width: 100%; } .tabControl > .tabHeader { -ms-grid-column: 1; -ms-grid-columns: auto 1fr auto; -ms-grid-row: 1; background-color: TRANSPARENT; /*[{plugin-memory-tab-header}]*/ display: -ms-grid; } .tabControl > .tabHeader > .beforeBarContainer { -ms-grid-column: 1; -ms-grid-row: 1; box-sizing: border-box; } .tabControl > .tabHeader > .tabBarContainer { -ms-grid-column: 2; -ms-grid-row: 1; -ms-grid-column-align: end; -ms-grid-row-align: center; box-sizing: border-box; } .tabControl > .tabHeader > .tabBarContainerLeftAlign { -ms-grid-column-align: start; } .tabControl > .tabHeader > .afterBarContainer { -ms-grid-column: 3; -ms-grid-row: 1; box-sizing: border-box; } .tabControl ul.tabBar { list-style-type: none; margin: 0; margin-right: 42px; padding: 0; cursor: default; } .tabControl ul.tabBar li { display: inline-block; margin: 5px 14px 5px 14px; color: TRANSPARENT; /*[{plugin-memory-tab-text}]*/ font-size: 90%; font-family: "Segoe UI", Arial, sans-serif; /*[{plugin-font-family} , Arial, sans-serif]*/ } .tabControl ul.tabBar li:hover { background-color: TRANSPARENT; /*[{plugin-memory-tab-hover}]*/ color: TRANSPARENT; /*[{plugin-memory-tab-hover-text}]*/ cursor: pointer; } .tabControl ul.tabBar li:focus { outline: 1px dotted TRANSPARENT; /*[1px dotted {plugin-perftools-focusdots}]*/ } .tabControl ul.tabBar li.active { background-color: TRANSPARENT; /*[{plugin-memory-tab-hover}]*/ color: TRANSPARENT; /*[{plugin-memory-tab-hover-text}]*/ font-weight: 600; } .tabControl > .tabContentPane { -ms-grid-column: 1; -ms-grid-column-span: 3; -ms-grid-row: 2; box-sizing: border-box; } .tabControl > .tabContentPane > .tabItemContent { display: none; } .tabControl > .tabContentPane > .active { display: block; } { "start_url": "VisualProfiler.html", "domain": "http://microsoft.com", "name": "JavaScript Visual Profiler", "version": "1.1", "f12": { "localized_tab_resource": "F12ToolTitle", "localized_tooltip_id": 3173, "tab_image": "tabIcon.png", "resource_aliases": { "VisualProfiler": { "is_default": true } }, "themed_images": { "f12-image-host-error-alert": { "bitmap_source": "..\\..\\pluginhost\\theme\\i_alerterror.png", "background_color": "plugin-font-editor-background-color" }, "f12-image-host-error-close": { "bitmap_source": "..\\..\\pluginhost\\theme\\closeErrorBox.png", "background_color": "plugin-font-editor-background-color" }, "f12-image-host-error-help": { "bitmap_source": "..\\..\\pluginhost\\theme\\helpErrorBox.png", "background_color": "plugin-font-editor-background-color" }, "f12-image-contextmenu-chartzoom-in": { "bitmap_source": "images\\i_f12_context_chartzoom_in.png", "background_color": "plugin-background-color" }, "f12-image-contextmenu-chartzoom-in-disabled": { "bitmap_source": "images\\i_f12_context_chartzoom_in_disabled.png", "background_color": "plugin-background-color" }, "f12-image-contextmenu-chartzoom-reset": { "bitmap_source": "images\\i_f12_context_chartzoom_reset.png", "background_color": "plugin-background-color" }, "f12-image-contextmenu-chartzoom-reset-disabled": { "bitmap_source": "images\\i_f12_context_chartzoom_reset_disabled.png", "background_color": "plugin-background-color" }, "f12-image-contextmenu-chartselection-clear": { "bitmap_source": "images\\i_f12_context_chartselection_clear.png", "background_color": "plugin-background-color" }, "f12-image-contextmenu-chartselection-clear-disabled": { "bitmap_source": "images\\i_f12_context_chartselection_clear_disabled.png", "background_color": "plugin-background-color" }, "f12-image-toolbar-chartzoom-in": { "bitmap_source": "images\\i_f12_chartzoom_in.png", "background_color": "plugin-background-color" }, "f12-image-toolbar-chartzoom-reset": { "bitmap_source": "images\\i_f12_chartzoom_reset.png", "background_color": "plugin-background-color" }, "f12-image-toolbar-chartselection-clear": { "bitmap_source": "images\\i_f12_chartselection_clear.png", "background_color": "plugin-background-color" }, "f12-image-toolbar-start": { "bitmap_source": "..\\Common\\images\\i_start.png", "background_color": "plugin-background-color" }, "f12-image-toolbar-stop": { "bitmap_source": "..\\Common\\images\\i_stop.png", "background_color": "plugin-background-color" }, "vs-image-icon-tree-expanded": { "bitmap_source": "..\\Common\\images\\itemExpandedIcon.png", "background_color": "plugin-background-color" }, "vs-image-icon-tree-collapsed": { "bitmap_source": "..\\Common\\images\\itemCollapsedIcon.png", "background_color": "plugin-background-color" }, "vs-image-graph-user-mark": { "bitmap_source": "images\\i_usermark.png", "background_color": "plugin-background-color" }, "vs-image-graph-app-event": { "bitmap_source": "images\\i_appevent.png", "background_color": "plugin-background-color" } } }, "file_aliases": { "VisualProfilerExtension": { "path": "timeline.dll" }, "PerformanceTraceExtension": { "path": "PerformanceTrace.dll", "optional": true } }, "vs": { "architecture": "x86", "resource_aliases": { "VisualProfiler": { "path": "Resources\\Resources", "is_default": true } }, "guid_symbols": { "GuidPerfToolHostCmdSet": "5D4B80C3-23AB-4391-9F90-794C201831CE", "GuidPerfToolGridContextMenu": "DB731D4D-421B-4944-9695-28538DD8A563" }, "theme_token_aliases": { "diagnostics-host-border": { "category": "f8a8b2a5-dd35-43f6-a382-fd6a61325c22", "key_type": "BackgroundColor", "name": "Border" }, "diagnostics-host-graph-cursor": { "category": "f8a8b2a5-dd35-43f6-a382-fd6a61325c22", "key_type": "BackgroundColor", "name": "GraphCursor" }, "diagnostics-host-graph-line": { "category": "f8a8b2a5-dd35-43f6-a382-fd6a61325c22", "key_type": "BackgroundColor", "name": "GraphLine" }, "diagnostics-host-graph-scale": { "category": "f8a8b2a5-dd35-43f6-a382-fd6a61325c22", "key_type": "BackgroundColor", "name": "GraphScale" }, "diagnostics-host-ruler-slider": { "category": "f8a8b2a5-dd35-43f6-a382-fd6a61325c22", "key_type": "BackgroundColor", "name": "RulerSlider" }, "diagnostics-host-ruler-slider-active": { "category": "f8a8b2a5-dd35-43f6-a382-fd6a61325c22", "key_type": "BackgroundColor", "name": "RulerSliderActive" }, "diagnostics-host-ruler-tickmark": { "category": "f8a8b2a5-dd35-43f6-a382-fd6a61325c22", "key_type": "BackgroundColor", "name": "RulerTickmark" }, "diagnostics-host-swimlane-border": { "category": "f8a8b2a5-dd35-43f6-a382-fd6a61325c22", "key_type": "BackgroundColor", "name": "SwimlaneBorder" }, "plugin-perftools-detail-pane": { "category": "634eef98-6af2-4f63-8d9f-36351e18b606", "key_type": "BackgroundColor", "name": "DetailPane" }, "plugin-perftools-focusdots": { "category": "634eef98-6af2-4f63-8d9f-36351e18b606", "key_type": "ForegroundColor", "name": "FocusDots" }, "plugin-perftools-grid-column-sizer": { "category": "634eef98-6af2-4f63-8d9f-36351e18b606", "key_type": "BackgroundColor", "name": "GridColumnSizer" }, "plugin-perftools-grid-header-hover": { "category": "634eef98-6af2-4f63-8d9f-36351e18b606", "key_type": "BackgroundColor", "name": "GridHeaderHover" }, "plugin-perftools-grid-header-hover-text": { "category": "634eef98-6af2-4f63-8d9f-36351e18b606", "key_type": "ForegroundColor", "name": "GridHeaderHover" }, "plugin-perftools-grid-header-text": { "category": "634eef98-6af2-4f63-8d9f-36351e18b606", "key_type": "ForegroundColor", "name": "GridHeaderText" }, "plugin-perftools-menu": { "category": "634eef98-6af2-4f63-8d9f-36351e18b606", "key_type": "BackgroundColor", "name": "Menu" }, "plugin-perftools-menu-border": { "category": "634eef98-6af2-4f63-8d9f-36351e18b606", "key_type": "BackgroundColor", "name": "MenuBorder" }, "plugin-perftools-menu-drop-shadow": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "ThreeDLightShadow" }, "plugin-perftools-menu-focus": { "category": "634eef98-6af2-4f63-8d9f-36351e18b606", "key_type": "BackgroundColor", "name": "MenuFocus" }, "plugin-perftools-menu-hover": { "category": "634eef98-6af2-4f63-8d9f-36351e18b606", "key_type": "BackgroundColor", "name": "MenuHover" }, "plugin-perftools-menu-hover-text": { "category": "634eef98-6af2-4f63-8d9f-36351e18b606", "key_type": "ForegroundColor", "name": "MenuHover" }, "plugin-perftools-progress": { "category": "634eef98-6af2-4f63-8d9f-36351e18b606", "key_type": "BackgroundColor", "name": "Progress" }, "plugin-perftools-splitter": { "category": "634eef98-6af2-4f63-8d9f-36351e18b606", "key_type": "BackgroundColor", "name": "Splitter" }, "plugin-perftools-watermark-text": { "category": "634eef98-6af2-4f63-8d9f-36351e18b606", "key_type": "ForegroundColor", "name": "WatermarkText" }, "plugin-responsiveness-graph-border": { "category": "6ADCF200-0249-47F3-B14F-AB041A443E9B", "key_type": "BackgroundColor", "name": "GraphBorder" }, "vs-command-bar-gradient-begin-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "CommandBarGradientBegin" }, "vs-command-bar-mouse-down-background-end-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "CommandBarMouseDownBackgroundEnd" }, "vs-command-bar-mouse-down-border-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "CommandBarMouseDownBorder" }, "vs-command-bar-mouse-over-background-middle1-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "CommandBarMouseOverBackgroundMiddle1" }, "vs-command-bar-selected-border-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "CommandBarSelectedBorder" }, "vs-command-bar-text-inactive-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "CommandBarTextInactive" }, "vs-command-bar-text-selected-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "CommandBarTextSelected" }, "vs-tool-window-text-color": { "category": "624ed9c3-bdfd-41fa-96c3-7c824ea32e3d", "key_type": "BackgroundColor", "name": "ToolWindowText" } }, "themed_images": { "vs-image-contextmenu-chartzoom-in": { "bitmap_source": "images\\i_chartzoom_in.png", "background_color": "plugin-contextmenu-background-color" }, "vs-image-contextmenu-chartzoom-in-disabled": { "bitmap_source": "images\\i_chartzoom_in_disabled.png", "background_color": "plugin-contextmenu-background-color" }, "vs-image-contextmenu-chartzoom-reset": { "bitmap_source": "images\\i_chartzoom_reset.png", "background_color": "plugin-contextmenu-background-color" }, "vs-image-contextmenu-chartzoom-reset-disabled": { "bitmap_source": "images\\i_chartzoom_reset_disabled.png", "background_color": "plugin-contextmenu-background-color" }, "vs-image-contextmenu-chartselection-clear": { "bitmap_source": "images\\i_chartselection_clear.png", "background_color": "plugin-contextmenu-background-color" }, "vs-image-contextmenu-chartselection-clear-disabled": { "bitmap_source": "images\\i_chartselection_clear_disabled.png", "background_color": "plugin-contextmenu-background-color" }, "vs-image-icon-tree-expanded": { "bitmap_source": "..\\Common\\images\\itemExpandedIcon.png", "background_color": "plugin-background-color" }, "vs-image-icon-tree-collapsed": { "bitmap_source": "..\\Common\\images\\itemCollapsedIcon.png", "background_color": "plugin-background-color" }, "vs-image-toolbar-chartzoom-in": { "bitmap_source": "images\\i_chartzoom_in.png", "background_color": "vs-command-bar-gradient-begin-color" }, "vs-image-toolbar-chartzoom-in-disabled": { "bitmap_source": "images\\i_chartzoom_in_disabled.png", "background_color": "vs-command-bar-gradient-begin-color" }, "vs-image-toolbar-chartzoom-reset": { "bitmap_source": "images\\i_chartzoom_reset.png", "background_color": "vs-command-bar-gradient-begin-color" }, "vs-image-toolbar-chartzoom-reset-disabled": { "bitmap_source": "images\\i_chartzoom_reset_disabled.png", "background_color": "vs-command-bar-gradient-begin-color" }, "vs-image-toolbar-chartselection-clear": { "bitmap_source": "images\\i_chartselection_clear.png", "background_color": "vs-command-bar-gradient-begin-color" }, "vs-image-toolbar-chartselection-clear-disabled": { "bitmap_source": "images\\i_chartselection_clear_disabled.png", "background_color": "vs-command-bar-gradient-begin-color" }, "vs-image-graph-user-mark": { "bitmap_source": "images\\i_usermark.png", "background_color": "plugin-background-color" }, "vs-image-graph-app-event": { "bitmap_source": "images\\i_appevent.png", "background_color": "plugin-background-color" } } } }PNG  IHDR@] cHRMz%u0`:o_F pHYsod IDATx^=GA 0(0 H08Vp2GhxDف4[.{y>u~UuUzp8p8p8p8p8p8p8p8-|r}?d$:M͂8^7O `o SsP O,/7'7W!/Mm鿇?RNvZJtQѿT#otHtj>iR.wa(K 3woQsocF_q~kp+ylɦ:g8bllb>|݃w*~+\|4MivQ\@%n7Ჳ*CgDxi)ѕ< S; u1Q*:Uo썩#Ư }h$2zt%e l=N8F>j͠W gV}7`C[T8F_S SoV}7'vVF=R5zͪl;?N? jѹ%<4+hY"@wMWX[a*k\ߡ[ l=wѪ}Ֆ<~O#:6kx; @:vr_puVu-;:t;-#r :՘ΨF*)l iN5VmsacCǏ_Y`ST2gkzaڜ{6&r__xsR0GidϟdM/vM m5T':&.)KBoa 8lN .=DNYB-Ɯ@#8te-+~(ϰ4lwb6µ=UpY5Xtl6icsO'G=,~l0am>هpꤠ:s\' |kj^bIju 묩{EZiձ9J%⪳QCďY`vaVwZ"@yw5".*O_F7˩SЈ9-Sqi^;4mz@uCPֵpӔK S1*즵N kibi z-,EݻŏMk0Zu7Rğ%/<Wd[G9%U@~)OHQܒ+Yud'^ʋ{,&R#K5VS2 ,&$sU^:~lhyghu/@ T8 8$=Jb_\mb Ab>_!5`+cҏ76Tl! ӛyKvlduūO;ƤWMG6,`hɿďB!%f*@fɷ/P)'$s-^+'!DyCI<\-!/R,1leq :T_6 ,\׌s|Lxd cO(fTù}v:8)CSE%yU|^}G6dg H?tTXT9,;ƤɆ3bkJvQi^4Y 李6+AK Mu@ԋ@a5&>WX-Lu$;#)>wgF{p[Vg3?~l#)_34d@uK2g15%gHț_K2Ll`5`*(K-i&7AK)>h$l '#呉,Ru6ǗшP֨/*;oKޒ+G?dPzLzdL`/W~!G1 +L/9 2¾3ҩ)nJ挒j_&:Y9<1GTg%kTO?#6ucX׌Y#st$7=M(ڞ8?֢+NywFO i35]@<עKVM~8/IŀdѪR2Kvb\U; hMj1%;zV0H55Z a@nU;k pШGbZĸ#ߵ8 + xSW(WW0 m?j6Q,Ts2~t6@`MMaf1b7evp`Qࣂ?rQأB1(p8p8p8p8p4h^tS̏IENDB`html, body { -ms-high-contrast-adjust: none; cursor: default; } .mainView { -ms-grid-columns: 1fr; -ms-grid-rows: auto 1fr; display: -ms-grid; height: 100vh; width: 100vw; } .mainView .toolbarContainer { -ms-grid-row: 1; } .mainView .dataViewContainer { -ms-grid-columns: minmax(670px, 1fr); -ms-grid-row: 2; -ms-grid-rows: auto minmax(calc(21em + 200px), 1fr); display: -ms-grid; padding-left: 14px; padding-right: 14px; overflow: auto; } .mainView .dataViewContainer .warningViewContainer { -ms-grid-columns: 1fr auto; -ms-grid-row: 1; display: -ms-grid; } .mainView .dataViewContainer .warningViewContainer .warningView { -ms-grid-column: 1; display: none; padding: 4px 0px 7px 0px; } .mainView .dataViewContainer .warningViewContainer .warningView .warningMessage { background-repeat: no-repeat; background-position-y: -18px; background-image: url('../common/images/i_warning.png'); /*[url({image-warning})]*/ background-size: 18px 54px; color: TRANSPARENT; /*[{plugin-color}]*/ display: inline; height: 18px; padding-left: 21px; width: 18px; } .mainView .dataViewContainer .warningViewContainer .loadFileView { -ms-grid-column: 2; } .mainView .dataViewContainer .detailedViewsContainer { -ms-grid-columns: 1fr; -ms-grid-row: 2; -ms-grid-rows: auto auto auto 1fr; display: -ms-grid; } .mainView .dataViewContainer .detailedViewsContainer .graphRulerViewContainer { -ms-grid-row: 1; } .mainView .dataViewContainer .detailedViewsContainer .cpuViewContainer { -ms-grid-row: 2; margin-top: 15px; } .mainView .dataViewContainer .detailedViewsContainer .frameRateContainer { -ms-grid-row: 3; margin-top: 15px; } .mainView .dataViewContainer .detailedViewsContainer .timelineViewContainer { -ms-grid-row: 4; margin-bottom: 10px; margin-top: 15px; } .mainView .dataViewContainer .detailedViewsContainer .timelineViewContainer .timelineViewGroup { -ms-grid-column: 1; -ms-grid-columns: 1fr max-content; -ms-grid-row: 1; -ms-grid-rows: auto 4px 1fr; display: -ms-grid; height: 100%; width: 100%; } .mainView .dataViewContainer .detailedViewsContainer .timelineViewContainer .timelineViewGroup .timelineLabel { -ms-grid-column: 1; -ms-grid-row: 1; -ms-grid-row-align: end; font-weight: 600; width: 100%; } .mainView .dataViewContainer .detailedViewsContainer .timelineViewContainer .timelineViewGroup .timelineSort { -ms-grid-column: 2; -ms-grid-row: 1; -ms-grid-row-align: center; margin-bottom: 2px; } .mainView .dataViewContainer .detailedViewsContainer .timelineViewContainer .timelineViewGroup .timelineSort .timelineSortLabel { padding-right: 5px; } .mainView .dataViewContainer .detailedViewsContainer .timelineViewContainer .timelineViewGroup .timelineSort .timelineSortSelector { font-family: "Segoe UI", Arial, sans-serif; /*[{plugin-font-family} , Arial, sans-serif]*/ font-size: 12px; /*[{plugin-font-size}]*/ } .mainView .dataViewContainer .detailedViewsContainer .timelineViewContainer .timelineViewGroup .timelineSort .timelineSortSelector option { padding-left: 5px; padding-right: 5px; } .mainView .dataViewContainer .detailedViewsContainer .timelineViewContainer .timelineViewGroup .timelineViewAndDetails { -ms-grid-column-span: 2; -ms-grid-columns: 1fr 3px 280px; -ms-grid-row: 3; -ms-grid-rows: auto 1fr; border-top: 1px solid grey; /*[1px solid {plugin-responsiveness-graph-border}]*/ display: -ms-grid; height: 100%; position: relative; width: 100%; } .mainView .dataViewContainer .detailedViewsContainer .timelineViewContainer .timelineViewGroup .timelineViewAndDetails .timelineEventHeaderLabel { -ms-grid-row-align: center; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; } .mainView .dataViewContainer .detailedViewsContainer .timelineViewContainer .timelineViewGroup .timelineViewAndDetails .timelineEventHeaderDivider { background-color: TRANSPARENT; /*[{plugin-perftools-splitter}]*/ height: 100%; position: relative; width: 3px; } .mainView .dataViewContainer .detailedViewsContainer .timelineViewContainer .timelineViewGroup .timelineViewAndDetails .timelineRuler { -ms-grid-column: 1; -ms-grid-row: 1; border-bottom: 1px solid TRANSPARENT; /*[1px solid {diagnostics-host-border}]*/ } .mainView .dataViewContainer .detailedViewsContainer .timelineViewContainer .timelineViewGroup .timelineViewAndDetails .timelineView { -ms-grid-column: 1; -ms-grid-row: 2; height: 100%; position: relative; width: 100%; } .mainView .dataViewContainer .detailedViewsContainer .timelineViewContainer .timelineViewGroup .timelineViewAndDetails .timelineView .verticalRulerLine { background-color: lightgrey; /*[{diagnostics-host-graph-line}]*/ margin-top: 1px; position: absolute; width: 1px; } .mainView .dataViewContainer .detailedViewsContainer .timelineViewContainer .timelineViewGroup .timelineViewAndDetails .timelineDetailsHeader { -ms-grid-column: 3; -ms-grid-row: 1; color: white; font-weight: 600; overflow: hidden; padding: 0px 10px 0px 10px; text-overflow: ellipsis; white-space: nowrap; } .mainView .dataViewContainer .detailedViewsContainer .timelineViewContainer .timelineViewGroup .timelineViewAndDetails .timelineDetailsHeader span { vertical-align: middle; } .mainView .dataViewContainer .detailedViewsContainer .timelineViewContainer .timelineViewGroup .timelineViewAndDetails .timelineDetailsPaneContainer { -ms-grid-column: 3; -ms-grid-row: 2; } .mainView .dataViewContainer .progressContainer { -ms-grid-row: 2; display: table; height: 100%; width: 100%; } .mainView .dataViewContainer .progressContainer:focus { outline: 0; } .mainView .dataViewContainer .progressContainer .progressContent { display: table-cell; max-width: 300px; text-align: center; vertical-align: middle; } .mainView .dataViewContainer .progressContainer .progressContent .progress { margin-top: 10px; } .eventDetails { background-color: TRANSPARENT; /*[{plugin-perftools-detail-pane}]*/ border-left: 1px solid TRANSPARENT; /*[1px solid {plugin-responsiveness-graph-border}]*/ height: 100%; overflow-y: auto; padding-top: 2px; } .eventDetails .eventDetailsTable { display: table; table-layout: fixed; width: 100%; } .eventDetails .eventRow { display: table-row; } .eventDetails .eventCell { display: table-cell; overflow: hidden; padding: 2px 10px 2px 10px; text-overflow: ellipsis; white-space: nowrap; } .eventDetails .name { width: 140px; } .eventDetails .value { -ms-user-select: text; width: calc(100% - 140px); } .eventDetails .detailSeparator { border-bottom: 1px solid TRANSPARENT; /*[1px solid {plugin-perftools-splitter}]*/ height: 0px; left: 0px; margin: 5px 10px 5px 10px; } .eventDetails .eventDetailsDescription { margin: 5px 10px 10px 10px; } .timelineView > .timelineFocus { height: 0px; width: 100%; } .stackPanel { height: 100%; overflow: auto; position: relative; width: 100%; z-index: 1; } .stackPanel .contentSizer { height: 1px; left: 0; overflow: hidden; position: absolute; top: 0; width: 1px; } .itemContainer { box-sizing: border-box; color: TRANSPARENT; /*[{plugin-color}]*/ font-family: "Segoe UI", Arial, sans-serif; /*[{plugin-font-family} , Arial, sans-serif]*/ font-size: 12px; /*[{plugin-font-size}]*/ height: 1.5em; margin: 0; overflow: hidden; position: absolute; width: 100%; } .itemContainerHover { color: TRANSPARENT; /*[{plugin-treeview-content-mouseover-color}]*/ background-color: TRANSPARENT; /*[{plugin-treeview-content-mouseover-background-color}]*/ } .itemCollapsed { background: url("../Common/images/itemCollapsedIcon.png") no-repeat; /*[url({vs-image-icon-tree-collapsed}) no-repeat]*/ background-size: 10px 10px; height: 10px; left: 0; position: absolute; top: 0.3em; width: 10px; z-index: 100; } .itemExpanded { background: url("../Common/images/itemExpandedIcon.png") no-repeat; /*[url({vs-image-icon-tree-expanded}) no-repeat]*/ background-size: 10px 10px; height: 10px; left: 0; position: absolute; top: 0.3em; width: 10px; z-index: 100; } .itemSelected { color: TRANSPARENT; /*[{plugin-treeview-content-inactive-selected-color}]*/ background-color: TRANSPARENT; /*[{plugin-treeview-content-inactive-selected-background-color}]*/ } .itemSelected .BPT-FileLink, .itemSelected .BPT-FileLink:hover { color: TRANSPARENT; /*[{plugin-treeview-content-inactive-selected-color}]*/ } .itemSelectedActive { color: TRANSPARENT; /*[{plugin-treeview-content-selected-color}]*/ background-color: TRANSPARENT; /*[{plugin-treeview-content-selected-background-color}]*/ } .itemSelectedActive .BPT-FileLink, .itemSelectedActive .BPT-FileLink:hover { color: TRANSPARENT; /*[{plugin-treeview-content-selected-color}]*/ } .eventDataTemplate { -ms-grid-columns: 200px 3px 1fr; -ms-grid-rows: 1fr; display: -ms-grid; } .eventDataTemplate .eventDataTemplateNameCell { -ms-grid-column: 1; -ms-grid-row: 1; position: relative; } .eventDataTemplate .eventDataTemplateNameCell .eventDataTemplateName { left: 20px; margin-right: 20px; overflow: hidden; position: relative; text-overflow: ellipsis; white-space: nowrap; } .eventDataTemplate > .eventDataTemplateDataCell { -ms-flex-align: center; -ms-grid-column: 3; -ms-grid-row: 1; display: -ms-flexbox; height: 100%; overflow: hidden; } .eventDataTemplate > .eventDataTemplateDataCell > .eventBar { flex-shrink: 0; height: 1em; min-width: 3px; top: 0.1em; } .eventDataTemplate > .eventDataTemplateDataCell > .durationText { flex-shrink: 0; margin-left: 5px; } .dataImageDecoding { background: #79d7f2; stroke: #79d7f2; fill: none; opacity: 1; } .dataLoading { background: #0072c6; stroke: #0072c6; fill: none; opacity: 1; } .dataOther { background: #b5b5b5; stroke: #b5b5b5; fill: none; opacity: 1; } .dataRendering { background: #9b4f96; stroke: #9b4f96; fill: none; opacity: 1; } .dataScripting { background: #dd5900; stroke: #dd5900; fill: none; opacity: 1; } .dataScriptingGc { background: #f1ad00; stroke: #f1ad00; fill: none; opacity: 1; } .dataStyling { background: #7fba00; stroke: #7fba00; fill: none; opacity: 1; } .emptyHeader { background-color: TRANSPARENT; /*[{plugin-treeview-content-inactive-selected-background-color}]*/ } .errorGrid { -ms-grid-rows: auto 1fr; display: -ms-grid; } .errorGrid .errorFrown { -ms-grid-row: 1; font-size: 100px; } .errorGrid .errorMessage { -ms-grid-row: 2; font-size: 20px; word-wrap: break-word; } /*From the DOM/Console common "toolwindow.css"*/ .BPT-FileLink, .BPT-HelpLink { color: TRANSPARENT; /*[{plugin-link-color}]*/ /*EnvironmentColors.CommandBarMenuLinkTextColorKey*/ cursor: pointer; } .BPT-FileLink:hover, .BPT-HelpLink:hover { color: TRANSPARENT; /*[{plugin-link-hover-color}]*/ /*EnvironmentColors.CommandBarMenuLinkTextHoverColorKey*/ text-decoration: underline; } /* F12 specific CSS */ .mainView .profilingPrompt { -ms-grid-column-align: center; -ms-grid-columns: 1fr; -ms-grid-row: 2; -ms-grid-row-align: center; -ms-grid-rows: auto 20px auto; display: -ms-grid; } .mainView .profilingPrompt .profilingMessage { -ms-grid-column: 1; -ms-grid-column-align: center; -ms-grid-row: 1; font-size: 14px; font-weight: 500; } .mainView .profilingPrompt progress { -ms-grid-column: 1; -ms-grid-row: 3; } .startToolbarButton { background: url('../Common/images/i_start.png') no-repeat 0px 0px; /*[url({f12-image-toolbar-start}) no-repeat 0px 0px]*/ background-size: 18px 54px; } .stopToolbarButton { background: url('../Common/images/i_stop.png') no-repeat 0px 0px; /*[url({f12-image-toolbar-stop}) no-repeat 0px 0px]*/ background-size: 18px 54px; } .zoomInButton { background: url('images/i_f12_chartzoom_in.png') no-repeat 0px 0px; /*[url({f12-image-toolbar-chartzoom-in}) no-repeat 0px 0px]*/ background-size: 18px 54px; } .resetZoomButton { background: url('images/i_f12_chartzoom_reset.png') no-repeat 0px 0px; /*[url({f12-image-toolbar-chartzoom-reset}) no-repeat 0px 0px]*/ background-size: 18px 54px; } .clearSelectionButton { background: url('images/i_f12_chartselection_clear.png') no-repeat 0px 0px; /*[url({f12-image-toolbar-chartselection-clear}) no-repeat 0px 0px]*/ background-size: 18px 54px; } UI Responsiveness
          // // Copyright (C) Microsoft. All rights reserved. // // hostShell.ts var VisualProfiler; (function (VisualProfiler) { (function (Extensions) { var HostShellProxy = (function () { function HostShellProxy() { this._hostShellProxy = Plugin.Utilities.JSONMarshaler.attachToPublishedObject("Microsoft.VisualStudio.WebClient.Diagnostics.PerformanceToolHost.Package.Extensions.Core.HostShell", { }, true); } HostShellProxy.prototype.setStatusBarText = function (text, highlight) { return this._hostShellProxy._call("setStatusBarText", text, highlight || false); }; return HostShellProxy; })(); Extensions.HostShellProxy = HostShellProxy; var LocalHostShell = (function () { function LocalHostShell() { } LocalHostShell.prototype.setStatusBarText = function (statusText, highlight) { return Plugin.Promise.as(null); }; return LocalHostShell; })(); Extensions.LocalHostShell = LocalHostShell; })(VisualProfiler.Extensions || (VisualProfiler.Extensions = {})); var Extensions = VisualProfiler.Extensions; })(VisualProfiler || (VisualProfiler = {})); //@ sourceMappingURL=hostShell.js.map // userSettings.ts var VisualProfiler; (function (VisualProfiler) { (function (Extensions) { "use strict"; var UserSettingsProxy = (function () { function UserSettingsProxy() { } UserSettingsProxy.prototype.getUserSettings = function () { return new Plugin.Promise(function (completed) { Plugin.Settings.get("JavaScriptPerfTools").done(function (result) { completed(result); }, function (error) { completed({ }); }); }, null); }; return UserSettingsProxy; })(); Extensions.UserSettingsHelper = new UserSettingsProxy(); })(VisualProfiler.Extensions || (VisualProfiler.Extensions = {})); var Extensions = VisualProfiler.Extensions; })(VisualProfiler || (VisualProfiler = {})); //@ sourceMappingURL=userSettings.js.map // TimeSpan.ts var VisualProfiler; (function (VisualProfiler) { "use strict"; var TimeStamp = (function () { function TimeStamp(nsec) { if (typeof nsec === "undefined") { nsec = 0; } this._nsec = nsec; } TimeStamp.nanoSecInMillSec = 1000 * 1000; TimeStamp.nanoSecInSec = 1000 * 1000 * 1000; Object.defineProperty(TimeStamp.prototype, "nsec", { get: function () { return this._nsec; }, enumerable: true, configurable: true }); Object.defineProperty(TimeStamp.prototype, "msec", { get: function () { return this._nsec / TimeStamp.nanoSecInMillSec; }, enumerable: true, configurable: true }); Object.defineProperty(TimeStamp.prototype, "sec", { get: function () { return this._nsec / TimeStamp.nanoSecInSec; }, enumerable: true, configurable: true }); TimeStamp.fromNanoseconds = function fromNanoseconds(nsec) { return new TimeStamp(nsec); }; TimeStamp.fromMilliseconds = function fromMilliseconds(msec) { return new TimeStamp(msec * TimeStamp.nanoSecInMillSec); }; TimeStamp.fromSeconds = function fromSeconds(sec) { return new TimeStamp(sec * TimeStamp.nanoSecInSec); }; TimeStamp.prototype.equals = function (other) { return this._nsec === other.nsec; }; return TimeStamp; })(); VisualProfiler.TimeStamp = TimeStamp; var TimeSpan = (function () { function TimeSpan(begin, end) { if (typeof begin === "undefined") { begin = new TimeStamp(); } if (typeof end === "undefined") { end = new TimeStamp(); } this._begin = begin; this._end = end; if(this._begin.nsec > this._end.nsec) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1042")); } } Object.defineProperty(TimeSpan.prototype, "begin", { get: function () { return this._begin; }, enumerable: true, configurable: true }); Object.defineProperty(TimeSpan.prototype, "end", { get: function () { return this._end; }, enumerable: true, configurable: true }); Object.defineProperty(TimeSpan.prototype, "elapsed", { get: function () { return new TimeStamp(this._end.nsec - this.begin.nsec); }, enumerable: true, configurable: true }); TimeSpan.prototype.equals = function (other) { return this.begin.equals(other.begin) && this.end.equals(other.end); }; return TimeSpan; })(); VisualProfiler.TimeSpan = TimeSpan; })(VisualProfiler || (VisualProfiler = {})); //@ sourceMappingURL=TimeSpan.js.map // DragDirection.ts var VisualProfiler; (function (VisualProfiler) { "use strict"; (function (DragDirection) { DragDirection._map = []; DragDirection._map[0] = "none"; DragDirection.none = 0; DragDirection._map[1] = "left"; DragDirection.left = 1; DragDirection._map[2] = "right"; DragDirection.right = 2; })(VisualProfiler.DragDirection || (VisualProfiler.DragDirection = {})); var DragDirection = VisualProfiler.DragDirection; })(VisualProfiler || (VisualProfiler = {})); //@ sourceMappingURL=DragDirection.js.map // AnimationFrameGraph.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var VisualProfiler; (function (VisualProfiler) { (function (Graph) { "use strict"; (function (AxisPositionType) { AxisPositionType._map = []; AxisPositionType.top = 0; AxisPositionType.middle = 1; AxisPositionType.bottom = 2; })(Graph.AxisPositionType || (Graph.AxisPositionType = {})); var AxisPositionType = Graph.AxisPositionType; (function (ColorSchemeType) { ColorSchemeType._map = []; ColorSchemeType.VizSurfaceGrayDark = 0; ColorSchemeType.VizSurfaceStrongBlueDark = 1; ColorSchemeType.VizSurfaceDarkGoldDark = 2; ColorSchemeType.VizSurfaceChartreuseGreenDark = 3; })(Graph.ColorSchemeType || (Graph.ColorSchemeType = {})); var ColorSchemeType = Graph.ColorSchemeType; (function (ScaleType) { ScaleType._map = []; ScaleType.Left = 0; ScaleType.Right = 1; })(Graph.ScaleType || (Graph.ScaleType = {})); var ScaleType = Graph.ScaleType; var Point2d = (function () { function Point2d(x, y, data, isInView, seriesIndex, xTranslate, yTranslate, xPx, yPx) { if (typeof xTranslate === "undefined") { xTranslate = 0; } if (typeof yTranslate === "undefined") { yTranslate = -1; } this.x = x; this.y = y; this.data = data; this.isInView = isInView; this.seriesIndex = seriesIndex; this.xTranslate = xTranslate; this.yTranslate = yTranslate; this.xPx = xPx; this.yPx = yPx; } return Point2d; })(); Graph.Point2d = Point2d; var Padding = (function () { function Padding(left, top, right, bottom) { this.left = left; this.top = top; this.right = right; this.bottom = bottom; } return Padding; })(); Graph.Padding = Padding; var RectangleDimension = (function (_super) { __extends(RectangleDimension, _super); function RectangleDimension(left, top, right, bottom) { _super.call(this, left, top, right, bottom); if(this.left > this.right || this.top > this.bottom) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1054")); } } Object.defineProperty(RectangleDimension.prototype, "width", { get: function () { return this.right - this.left; }, enumerable: true, configurable: true }); Object.defineProperty(RectangleDimension.prototype, "height", { get: function () { return this.bottom - this.top; }, enumerable: true, configurable: true }); return RectangleDimension; })(Padding); Graph.RectangleDimension = RectangleDimension; var MinMax = (function () { function MinMax(min, max) { this.min = min; this.max = max; } Object.defineProperty(MinMax.prototype, "range", { get: function () { return this.max - this.min; }, enumerable: true, configurable: true }); return MinMax; })(); Graph.MinMax = MinMax; var ChartColorScheme = (function () { function ChartColorScheme(lineColorString, lineFillColorString) { this._lineColorString = "#FF0000"; this._lineFillColorString = "#FF0000"; this._lineColorString = lineColorString; this._lineFillColorString = lineFillColorString; } Object.defineProperty(ChartColorScheme.prototype, "lineColor", { get: function () { return this._lineColorString; }, enumerable: true, configurable: true }); Object.defineProperty(ChartColorScheme.prototype, "lineFillColor", { get: function () { return this._lineFillColorString; }, enumerable: true, configurable: true }); return ChartColorScheme; })(); Graph.ChartColorScheme = ChartColorScheme; var GraphConfigurations = (function () { function GraphConfigurations() { this.chartAxisPadding = new Padding(0, 0, 0, 0); this.chartAxisCount = 5; this.chartAxisIncreaseRatio = 1.1; this.scaleForWhiteSpace = 0.05; this.chartDrawFill = true; this.gridX = new MinMax(0, 0); this.gridY = new MinMax(0, 100); this.axes = []; this.colorSchemeType = ColorSchemeType.VizSurfaceChartreuseGreenDark; this.legendContainerId = "legendDiv"; this.graphHeight = 88; this.headerId = "headerContainer"; this.header = { containerId: "headerContainer", titleConfig: { containerId: "titleContainer", text: "Visual Throughput", isExpanded: true, unit: "FPS" }, legendConfig: { containerId: "legendContainer", data: [] } }; this.graphScaleWidthLeft = 40; this.graphScaleWidthRight = 40; this.leftScaleBorder = 1; this.rightScaleBorder = 1; this.pixelRange = 5; this.graphContainerId = "graphBody"; } return GraphConfigurations; })(); Graph.GraphConfigurations = GraphConfigurations; var AnimationFrameGraph = (function () { function AnimationFrameGraph(config) { this._series = []; this._selectionStartXPercent = 0; this._selectionWidthPercent = 100; this._graphContainerCss = "graphContainer"; this._isExpanded = true; this._tabFocusPointList = []; this._graphConfiguration = new GraphConfigurations(); this._container = document.getElementById(config.containerId); this._graphConfiguration.containerId = config.containerId; if(this._container === null) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1050")); } this._container.className = this._graphContainerCss; this._config = config; this.initialize(); while(this._container.childNodes.length > 0) { this._container.removeChild(this._container.firstChild); } this._container.style.backgroundColor = Plugin.Theme.getValue("plugin-background-color"); this._header = document.createElement("div"); this._header.className = "graph-header"; this._header.id = this._graphConfiguration.header.containerId; this._container.appendChild(this._header); this._body = document.createElement("div"); this._body.className = "graph-body"; this._body.id = this._graphConfiguration.graphContainerId; this._body.style.height = this._graphConfiguration.graphHeight + "px"; this._container.appendChild(this._body); this._graphScaleLeft = new Scale(ScaleType.Left, this._graphConfiguration); this._graphScaleRight = new Scale(ScaleType.Right, this._graphConfiguration); this._canvasDiv = document.createElement("div"); this._canvasDiv.className = "graph-canvas-div"; this._canvasDiv.tabIndex = 0; this._canvasDiv.setAttribute("aria-label", Plugin.Resources.getString("VisualThroughputGraphAriaLabel")); if(this._keyPress) { this._canvasDiv.addEventListener("keydown", this._keyPress, true); } this._body.appendChild(this._canvasDiv); this._canvas = document.createElement("canvas"); this._canvasDiv.appendChild(this._canvas); this._canvas.className = "graph-canvas"; this._canvas.style.background = Plugin.Theme.getValue("plugin-background-color"); this._canvas.addEventListener('mousemove', this.onMouseOver.bind(this)); this._canvas.addEventListener('mouseout', this.onMouseOut.bind(this)); if(!this._container.runtimeStyle.position || this._container.runtimeStyle.position === "static") { this._container.style.position = "relative"; } this._context = this._canvas.getContext("2d"); for(var i = 0; i < this._config.series.length; i++) { this.addSeries(this._config.series[i].legend, this._config.series[i].counterId, this._config.series[i].colorSchemeType); var color = this._series[this._series.length - 1].colorScheme.lineColor; this._graphConfiguration.header.legendConfig.data.push({ color: color, text: this._config.series[i].legend }); } this._axes = new Axes(this._graphConfiguration); var header = new Header(this._graphConfiguration.header); header.title.registerCallback(this.toggleDisplay.bind(this)); header.render(); VisualProfiler.Program.addEventListener(VisualProfiler.ProgramEvents.Resize, this.onResize.bind(this)); this.calculateChartSize(); this._canvasDiv.addEventListener("mousedown", this.startSelection.bind(this)); this._dragHandler = this.drag.bind(this); Plugin.Theme.addEventListener("themechanged", this.onThemeChanged.bind(this)); } Object.defineProperty(AnimationFrameGraph.prototype, "selection", { set: function (value) { if(!value) { return; } var startXPercent = (value.begin.nsec - this._config.xRange.min) / this.xWidth * 100; var widthPercent = value.elapsed.nsec / this.xWidth * 100; this._selectionStartXPercent = startXPercent; this._selectionWidthPercent = widthPercent; this.removeFocus(); this.drawSelection(); this.createPointIndexInfoList(); }, enumerable: true, configurable: true }); AnimationFrameGraph.prototype.render = function () { if(this._graphConfiguration.chartAxisPadding.left <= this._graphConfiguration.chartWidth && this._graphConfiguration.chartAxisPadding.top <= this._graphConfiguration.chartHeight) { this.drawChartBackground(); this._graphScaleLeft.render(); this._graphScaleRight.render(); this._graphConfiguration.chartRect = new RectangleDimension(this._graphConfiguration.chartAxisPadding.left, this._graphConfiguration.chartAxisPadding.top, this._graphConfiguration.chartWidth, this._graphConfiguration.chartHeight); for(var seriesIndex = 0; seriesIndex < this._series.length; seriesIndex++) { var series = this._series[seriesIndex]; series.render(); } this._context.save(); this._context.fillStyle = Plugin.Theme.getValue("plugin-background-color"); this._context.fillRect(0, this._graphConfiguration.chartRect.top, this._graphConfiguration.chartAxisPadding.left, this._graphConfiguration.chartRect.height); this._context.restore(); if(this._axes) { this._axes.render(); } } this.addVerticalRulerLines(); this.createPointIndexInfoList(); }; AnimationFrameGraph.prototype.setViewportRange = function (range) { if(this._graphConfiguration.gridX.max !== range.max || this._graphConfiguration.gridX.min !== range.min) { this.calculateChartSize(); this._graphConfiguration.gridX.min = range.min; this._graphConfiguration.gridX.max = range.max; } this.removeFocus(); this.render(); this._dragDirection = VisualProfiler.DragDirection.none; this.clearSelection(); }; AnimationFrameGraph.prototype.setSeriesDataSource = function (counterId, points) { var seriesData; for(var i = 0; i < this._series.length; i++) { if(this._series[i].counterId === counterId) { this._series[i].data = points ? points : []; for(var j = 0; j < this._series[i].data.length; j++) { var point = this._series[i].data[j]; if(typeof point.data === "undefined" || point.data === null) { point.data = point.y.toFixed(0); } } } } this.calculateYRange(this.getMaxPoint(points)); }; Object.defineProperty(AnimationFrameGraph.prototype, "xWidth", { get: function () { return this._config.xRange.max - this._config.xRange.min; }, enumerable: true, configurable: true }); AnimationFrameGraph.prototype.toggleDisplay = function (visible) { this._body.style.display = visible ? "-ms-grid" : "none"; this._isExpanded = visible; if(this._isExpanded && this.calculateChartSize()) { this.render(); } if(visible) { Notifications.notify(VisualProfiler.ResponsivenessNotifications.GraphExpanded); } else { Notifications.notify(VisualProfiler.ResponsivenessNotifications.GraphCollapsed); } VisualProfiler.Program.triggerResize(); }; AnimationFrameGraph.prototype.onThemeChanged = function (args) { this._container.style.backgroundColor = Plugin.Theme.getValue("plugin-background-color"); this.render(); }; AnimationFrameGraph.prototype.initialize = function () { if(!this._config.axes || this._config.axes.length === 0) { this._graphConfiguration.axes = [ { value: 30 }, { value: 60 } ]; } else { this._graphConfiguration.axes = this._config.axes; } this._graphConfiguration.chartAxisPadding = new Padding(this._graphConfiguration.chartAxisPadding.left, this._graphConfiguration.chartAxisPadding.top, this._graphConfiguration.chartAxisPadding.right, this._graphConfiguration.chartAxisPadding.bottom); if(this._config.xRange) { this._graphConfiguration.gridX = this._config.xRange; } this._graphConfiguration.graphScaleWidthLeft = typeof this._config.leftPadding !== "undefined" ? this._config.leftPadding : this._graphConfiguration.graphScaleWidthLeft; this._graphConfiguration.graphScaleWidthRight = typeof this._config.rightPadding !== "undefined" ? this._config.rightPadding : this._graphConfiguration.graphScaleWidthRight; if(Plugin.Resources.getString("AFG_Title")) { this._graphConfiguration.header.titleConfig.text = Plugin.Resources.getString("AFG_Title"); } if(Plugin.Resources.getString("AFG_Unit")) { this._graphConfiguration.header.titleConfig.unit = Plugin.Resources.getString("AFG_Unit"); } this._graphConfiguration.graphHeight = typeof this._config.height !== "undefined" ? this._config.height : this._graphConfiguration.graphHeight; this._hideCursor = this.hideCursor.bind(this); this._graphConfiguration.leftScaleBorder = typeof this._config.leftScaleBorder !== "undefined" ? this._config.leftScaleBorder : this._graphConfiguration.leftScaleBorder; this._graphConfiguration.rightScaleBorder = typeof this._config.rightScaleBorder !== "undefined" ? this._config.rightScaleBorder : this._graphConfiguration.rightScaleBorder; this._isCursorEnabled = typeof this._config.isCursorEnabled !== "undefined" ? this._config.isCursorEnabled : false; this._keyPress = this.onKeyPress.bind(this); }; AnimationFrameGraph.prototype.onResize = function (evt) { if(this._isExpanded && this.calculateChartSize()) { this.removeFocus(); this.render(); } }; AnimationFrameGraph.prototype.calculateChartSize = function () { var isCalculated = false; if(this._container.offsetWidth > 0 && this._container.offsetHeight > 0) { var canvasWidth = this._container.offsetWidth - this._graphConfiguration.graphScaleWidthLeft - this._graphConfiguration.graphScaleWidthRight - this._graphConfiguration.leftScaleBorder - this._graphConfiguration.rightScaleBorder; var canvasHeight = this._graphConfiguration.graphHeight; this._canvas.height = canvasHeight; this._canvas.width = canvasWidth; this._graphConfiguration.chartWidth = canvasWidth - this._graphConfiguration.chartAxisPadding.right; this._graphConfiguration.chartHeight = canvasHeight - this._graphConfiguration.chartAxisPadding.bottom; isCalculated = true; } return isCalculated; }; AnimationFrameGraph.prototype.clearSelection = function (e) { if(this._dragDirection !== VisualProfiler.DragDirection.none) { return; } this._selectionStartXPercent = 0; this._selectionWidthPercent = 100; this.drawSelection(); this.raiseSelectionChanged(); }; AnimationFrameGraph.prototype.convertToChartAreaPercentage = function (event) { var rect = this._canvas.getBoundingClientRect(); var mouseX = event.clientX - rect.left; return (mouseX) / this._canvasDiv.clientWidth * 100; }; AnimationFrameGraph.prototype.drag = function (event) { var xPercent = this.convertToChartAreaPercentage(event); this._dragDirection = AnimationFrameGraph.getDragDirection(xPercent - this._initialSelectionStartXPercent); this._selectionWidthPercent = Math.abs(xPercent - this._initialSelectionStartXPercent); if(this._dragDirection === VisualProfiler.DragDirection.left) { this._selectionStartXPercent = this._initialSelectionStartXPercent - this._selectionWidthPercent; } this.drawSelection(); this.raiseSelectionChanged(); }; AnimationFrameGraph.prototype.drawChartBackground = function () { this._context.fillStyle = Plugin.Theme.getValue("plugin-background-color"); this._context.fillRect(0, 0, this._canvas.width, this._canvas.height); }; AnimationFrameGraph.prototype.drawSelection = function () { if(!this._leftUnselectedRegion || !this._rightUnselectedRegion) { this.initializeUnselectedRegions(this._selectionStartXPercent); } this._leftUnselectedRegion.style.width = this._selectionStartXPercent + "%"; this._rightUnselectedRegion.style.left = (this._selectionStartXPercent + this._selectionWidthPercent) + "%"; this._rightUnselectedRegion.style.width = (100 - (this._selectionStartXPercent + this._selectionWidthPercent)) + "%"; }; AnimationFrameGraph.prototype.ensureMinSelectionWidth = function () { if(typeof this._selectionStartXPercent === "undefined") { return; } if(Math.abs(this._selectionWidthPercent * this._canvasDiv.clientWidth / 100) < this._config.minSelectionWidthInPixels) { this._selectionWidthPercent = this._config.minSelectionWidthInPixels / this._canvasDiv.clientWidth * 100; switch(this._dragDirection) { case VisualProfiler.DragDirection.right: if(this._selectionStartXPercent + this._selectionWidthPercent > 100) { this._selectionStartXPercent = 100 - this._selectionWidthPercent; } break; case VisualProfiler.DragDirection.left: if(this._selectionStartXPercent - this._selectionWidthPercent < 0) { this._selectionStartXPercent = 0; } else if(this._selectionStartXPercent + this._selectionWidthPercent > 100) { this._selectionStartXPercent = 100 - this._selectionWidthPercent; } else { this._selectionStartXPercent = this._initialSelectionStartXPercent - this._selectionWidthPercent; } break; default: if(this._selectionStartXPercent + (this._selectionWidthPercent / 2) > 100) { this._selectionStartXPercent = 100 - this._selectionWidthPercent; } else if(this._selectionStartXPercent - (this._selectionWidthPercent / 2) < 0) { this._selectionStartXPercent = 0; } else { this._selectionStartXPercent = this._selectionStartXPercent - (this._selectionWidthPercent / 2); } break; } } }; AnimationFrameGraph.prototype.convertChartAreaPercentToDataValue = function (percent) { return Math.round(percent * this.xWidth / 100) + this._config.xRange.min; }; AnimationFrameGraph.prototype.raiseSelectionChanged = function () { if(!this._config.selectionCallback) { return; } var minValue = this.convertChartAreaPercentToDataValue(this._selectionStartXPercent); var maxValue = this.convertChartAreaPercentToDataValue(this._selectionStartXPercent + this._selectionWidthPercent); var begin = VisualProfiler.TimeStamp.fromNanoseconds(minValue); var end = VisualProfiler.TimeStamp.fromNanoseconds(maxValue); var selection = new VisualProfiler.TimeSpan(begin, end); this._config.selectionCallback(selection); }; AnimationFrameGraph.prototype.initializeUnselectedRegions = function (startXPercent) { this._leftUnselectedRegion = this.createUnselectedRegion(0, startXPercent); this._rightUnselectedRegion = this.createUnselectedRegion(startXPercent, 100 - startXPercent); this._canvasDiv.appendChild(this._leftUnselectedRegion); this._canvasDiv.appendChild(this._rightUnselectedRegion); }; AnimationFrameGraph.prototype.calculateYRange = function (point) { if(point) { if(this._graphConfiguration.gridY.min > point.y) { this._graphConfiguration.gridY.min = Math.floor((point.y * this._graphConfiguration.chartAxisIncreaseRatio) / this._graphConfiguration.chartAxisCount) * this._graphConfiguration.chartAxisCount; } if(this._graphConfiguration.gridY.max < point.y + Math.ceil(this._graphConfiguration.gridY.max * this._graphConfiguration.scaleForWhiteSpace)) { this._graphConfiguration.gridY.max = Math.ceil((point.y * this._graphConfiguration.chartAxisIncreaseRatio) / this._graphConfiguration.chartAxisCount) * this._graphConfiguration.chartAxisCount; } } }; AnimationFrameGraph.prototype.addSeries = function (legendText, counterId, colorSchemeType) { this._graphConfiguration.colorSchemeType = typeof colorSchemeType !== "undefined" ? colorSchemeType : this._graphConfiguration.colorSchemeType; var newSeries = new StepLineSeries(this._context, this._graphConfiguration, this._series.length, legendText, counterId); this._series.push(newSeries); var filledLines = 0; for(var i = 0; i < this._series.length; i++) { filledLines++; if(filledLines >= 2) { this._graphConfiguration.chartDrawFill = false; break; } } }; AnimationFrameGraph.prototype.addVerticalRulerLines = function () { if(this._config.getVerticalRulerLinePositions) { var positions = this._config.getVerticalRulerLinePositions(this._canvas.width); for(var i = 0; positions && i < positions.length; ++i) { this.createVerticalRulerLine(positions[i]); } } }; AnimationFrameGraph.prototype.createVerticalRulerLine = function (position) { var x = this._graphConfiguration.chartWidth * position / 100; x = Math.round(x) + 0.5; this._context.save(); this._context.beginPath(); this._context.strokeStyle = Plugin.Theme.getValue("diagnostics-host-graph-line"); this._context.lineWidth = 1; this._context.moveTo(x, 0); this._context.lineTo(x, this._graphConfiguration.chartHeight); this._context.closePath(); this._context.stroke(); this._context.restore(); }; AnimationFrameGraph.prototype.getMaxPoint = function (points) { var max; if(points) { if(points.length > 0) { max = points[0]; } for(var i = 1; i < points.length; i++) { if(points[i].y > max.y) { max = points[i]; } } } return max; }; AnimationFrameGraph.prototype.drawToolTip = function (points, mousePosition) { if(!points || points.length === 0) { return; } var pointsWithMessages = []; for(var i = 0; i < points.length; i++) { if(points[i].data !== null && points[i].data !== undefined && points[i].data !== "undefined" && points[i].data !== "") { pointsWithMessages.push(points[i].data); } } if(pointsWithMessages.length > 0) { var message = ""; var separator = "
          "; var count = pointsWithMessages.length - 1; while(count >= 0) { message = pointsWithMessages[count] + message; if(count > 0) { message = separator + message; } count--; } var config = { content: message, delay: 0 }; Plugin.Tooltip.show(config); } }; AnimationFrameGraph.prototype.getMousePosition = function (evt) { var rect = this._canvas.getBoundingClientRect(); var root = document.documentElement; var mouseX = evt.clientX - rect.left; var mouseY = evt.clientY - rect.top; return new Point2d(mouseX, mouseY, null, null, null, evt.screenX, evt.screenY); }; AnimationFrameGraph.prototype.onMouseOver = function (evt) { var mousePos = this.getMousePosition(evt); if((!this._oldMousePosition || this._oldMousePosition.x !== mousePos.x) && mousePos.x <= this._graphConfiguration.chartWidth - 2 && mousePos.x >= this._graphConfiguration.chartAxisPadding.left && mousePos.y <= this._graphConfiguration.chartHeight && mousePos.y >= this._graphConfiguration.chartAxisPadding.top) { Plugin.Tooltip.dismiss(); var foundPoints = this.getPointsBelowMousePointer(mousePos); if(this._isCursorEnabled) { this.drawCursor(mousePos); } if(foundPoints && foundPoints.length !== 0) { this.drawToolTip(foundPoints, mousePos); } } this._oldMousePosition = mousePos; }; AnimationFrameGraph.prototype.hideCursor = function () { if(this._isCursorEnabled) { var mdiv = AnimationFrameGraph._cursor; if(!mdiv) { mdiv = AnimationFrameGraph._cursor = document.getElementById("mDiv"); } if(mdiv) { mdiv.style.visibility = "hidden"; } } Plugin.Tooltip.dismiss(); }; AnimationFrameGraph.prototype.onMouseOut = function (evt) { var mousePos = this.getMousePosition(evt); if(mousePos.x > this._graphConfiguration.chartWidth - 2 || mousePos.x < this._graphConfiguration.chartAxisPadding.left || mousePos.y > this._graphConfiguration.chartHeight || mousePos.y < this._graphConfiguration.chartAxisPadding.top) { this.hideCursor(); } }; AnimationFrameGraph.prototype.drawCursor = function (point) { var mdiv = AnimationFrameGraph._cursor; if(!mdiv) { mdiv = AnimationFrameGraph._cursor = document.getElementById("mDiv"); } if(!mdiv) { mdiv = document.createElement("div"); mdiv.className = "graph-cursor"; mdiv.id = "mDiv"; mdiv.style.left = point.x.toString() + "px"; mdiv.style.top = this._graphConfiguration.chartAxisPadding.top.toString() + "px"; mdiv.style.height = (this._canvas.height).toString() + "px"; mdiv.style.visibility = "visible"; mdiv.style.zIndex = "2"; this._canvasDiv.appendChild(mdiv); } else { mdiv.style.left = point.x.toString() + "px"; mdiv.style.top = this._graphConfiguration.chartAxisPadding.top.toString() + "px"; mdiv.style.visibility = "visible"; } }; AnimationFrameGraph.prototype.getPointsBelowMousePointer = function (point) { var foundPoints = []; for(var i = 0; i < this._series.length; i++) { var seriesData = this._series[i].renderedPoints; if(seriesData && seriesData.length > 0) { for(var j = 1; j < seriesData.length; j++) { var previousPoint = seriesData[j - 1]; var renderedPoint = seriesData[j]; if(typeof renderedPoint.xPx !== "undefined" && typeof previousPoint.xPx !== "undefined" && point.x < renderedPoint.xPx && point.x >= previousPoint.xPx) { foundPoints.push(previousPoint); break; } } } } return foundPoints; }; AnimationFrameGraph.prototype.startSelection = function (event) { if(event.button === Common.MouseButtons.LEFT_BUTTON) { this.hideCursor(); this.removeFocus(); this._initialSelectionStartXPercent = this._selectionStartXPercent = this.convertToChartAreaPercentage(event); this._selectionWidthPercent = 0; this._dragDirection = AnimationFrameGraph.getDragDirection(this._selectionWidthPercent); this._mouseupHandler = this.stopSelection.bind(this); this._canvasDiv.addEventListener("mousemove", this._dragHandler); this._canvasDiv.addEventListener("mouseup", this._mouseupHandler); this._canvasDiv.setCapture(true); this.drawSelection(); } }; AnimationFrameGraph.prototype.stopSelection = function (event) { this._canvasDiv.removeEventListener("mousemove", this._dragHandler); this._canvasDiv.removeEventListener("mouseup", this._mouseupHandler); this._canvasDiv.releaseCapture(); this.ensureMinSelectionWidth(); this.drawSelection(); this._dragDirection = VisualProfiler.DragDirection.none; this.createPointIndexInfoList(); this.raiseSelectionChanged(); }; AnimationFrameGraph.prototype.createUnselectedRegion = function (xPercent, widthPercent) { var rect = document.createElement("div"); rect.style.height = this._canvasDiv.offsetHeight + "px"; rect.style.width = widthPercent + "%"; rect.style.left = xPercent + "%"; rect.style.top = "0px"; rect.className = "unselected"; rect.addEventListener("mouseover", this._hideCursor); return rect; }; AnimationFrameGraph.getDragDirection = function getDragDirection(selectionWidth) { if(selectionWidth > 0) { return VisualProfiler.DragDirection.right; } else if(selectionWidth < 0) { return VisualProfiler.DragDirection.left; } return VisualProfiler.DragDirection.none; }; AnimationFrameGraph.prototype.onKeyPress = function (evt) { if(this._series && (Common.KeyCodes.ARROW_LEFT === evt.keyCode || Common.KeyCodes.ARROW_RIGHT === evt.keyCode)) { if(Common.KeyCodes.ARROW_LEFT === evt.keyCode) { this._index--; if(this._index < 0) { this._index = this._tabFocusPointList.length - 1; } } else if(Common.KeyCodes.ARROW_RIGHT === evt.keyCode) { this._index++; if(this._index >= this._tabFocusPointList.length) { this._index = 0; } } this.focusPoint(this._tabFocusPointList[this._index]); } else if(Common.KeyCodes.TAB === evt.keyCode) { this.removeFocus(); } }; AnimationFrameGraph.prototype.focusPoint = function (pointInfo) { var isMoved = false; var series = this._series[this._tabFocusPointList[this._index].seriesIndex]; if(series && series.renderedPoints) { var points = series.renderedPoints; var previousPoint = points[this._tabFocusPointList[this._index].pointIndex - 1]; var nextPoint = points[this._tabFocusPointList[this._index].pointIndex]; var divStart; var divEnd; if(previousPoint && nextPoint) { divStart = previousPoint.x - this._selectedTimeRange.min > 0 ? previousPoint.x : this._selectedTimeRange.min; divEnd = this._selectedTimeRange.max - nextPoint.x > 0 ? nextPoint.x : this._selectedTimeRange.max; } if(typeof divEnd !== "undefined" && typeof divStart !== "undefined") { var divs = this._canvasDiv.getElementsByClassName("graph-focus"); while(divs.length > 0) { this._canvasDiv.removeChild(divs[0]); } var focusDiv = document.createElement("div"); focusDiv.classList.add("graph-focus"); focusDiv.style.width = ((divEnd - divStart) / this._graphConfiguration.gridX.range * this._canvasDiv.clientWidth) + "px"; focusDiv.style.left = ((divStart - this._graphConfiguration.gridX.min) / this._graphConfiguration.gridX.range * this._canvasDiv.clientWidth) - 1 + "px"; focusDiv.style.top = previousPoint.yPx - 1 + "px"; var ariaLabel = Plugin.Resources.getString("VisualThroughputStepAriaLabel", previousPoint.y.toString(), Graph.RulerUtilities.formatTime(VisualProfiler.TimeStamp.fromNanoseconds(previousPoint.x), Graph.UnitFormat.fullName)); focusDiv.setAttribute("aria-label", ariaLabel); this._canvasDiv.appendChild(focusDiv); focusDiv.focus(); isMoved = true; } } return isMoved; }; AnimationFrameGraph.prototype.createPointIndexInfoList = function () { var startX = this.convertChartAreaPercentToDataValue(this._selectionStartXPercent); var endX = this.convertChartAreaPercentToDataValue(this._selectionStartXPercent + this._selectionWidthPercent); this._selectedTimeRange = new MinMax(startX, endX); this._tabFocusPointList = this.getPointIndexInfoList(startX, endX); this._index = -1; }; AnimationFrameGraph.prototype.getPointIndexInfoList = function (start, end) { var lists = []; if(this._series) { for(var i = 0; i < this._series.length; i++) { var series = this._series[i]; var seriesPoints = series.renderedPoints; var list = []; for(var j = 0; j < seriesPoints.length; j++) { var seriesPoint = seriesPoints[j]; var required = seriesPoint.x > start && seriesPoint.x <= end; if(!required) { if(seriesPoint.x > end && j > 0 && seriesPoints[j - 1].x < end) { required = true; } } if(required) { list.push({ seriesIndex: i, pointIndex: j }); } } lists.push(list); } } return this.sortPointIndexInfoList(lists); }; AnimationFrameGraph.prototype.sortPointIndexInfoList = function (lists) { var finalList = []; if(lists) { while(!this.areAllListEmpty(lists)) { var smallest = null; var index = null; for(var i = 0; i < lists.length; i++) { var list = lists[i]; if(list.length > 0) { var smallestInList = list[0]; if(smallestInList && (!smallest || this._series[smallestInList.seriesIndex].renderedPoints[smallestInList.pointIndex].x < this._series[smallest.seriesIndex].renderedPoints[smallest.pointIndex].x)) { smallest = smallestInList; index = i; } } } if(smallest) { finalList.push(lists[index].shift()); } } } return finalList; }; AnimationFrameGraph.prototype.areAllListEmpty = function (lists) { var allListEmpty = true; if(lists) { for(var i = 0; i < lists.length; i++) { if(lists[i].length > 0) { allListEmpty = false; break; } } } return allListEmpty; }; AnimationFrameGraph.prototype.removeFocus = function () { this._index = -1; var divs = this._canvasDiv.getElementsByClassName("graph-focus"); for(var i = 0; i < divs.length; i++) { (divs[i]).classList.add("graph-unfocused"); } }; return AnimationFrameGraph; })(); Graph.AnimationFrameGraph = AnimationFrameGraph; var ChartSeries = (function () { function ChartSeries(context, index, legendText, counterId, config) { this.colorSchemes = [ new ChartColorScheme("rgb(198, 198, 198)", "rgba(198, 198, 198, 0.75)"), new ChartColorScheme("rgb(83, 134, 191)", "rgba(83, 134, 191, 0.50)"), new ChartColorScheme("rgb(167, 148, 50)", "rgba(167, 148, 50, 0.25)"), new ChartColorScheme("rgb(158, 202, 0)", "rgba(158, 202, 0, 0.65)"), ]; this.index = index; this.legendText = legendText; this.data = []; this.colorScheme = config.colorSchemeType < this.colorSchemes.length ? this.colorSchemes[config.colorSchemeType] : this.colorSchemes[3]; this.counterId = counterId; this.graphConfiguration = config; this.context = context; } ChartSeries.prototype.getPointsToRender = function (chartRect) { var renderedPoints = new Array(); var seriesPoints = this.data; var seriesIndex = this.index; if(seriesPoints.length > 0) { var startIndex = 0; var endIndex = seriesPoints.length - 1; var startX = this.graphConfiguration.gridX.min; var rangeX = this.graphConfiguration.gridX.range; var endX = this.graphConfiguration.gridX.max; var scaleX = chartRect.width / rangeX; var x = 0; var y = 0; var startPoint = seriesPoints[startIndex]; var hasMovedToStart = false; for(var i = startIndex; i <= endIndex; i++) { var point = seriesPoints[i]; var pointInView = (point.x >= startX && point.x <= endX); var requiresDrawing = pointInView; point.isInView = pointInView; point.seriesIndex = seriesIndex; if(!requiresDrawing) { if((point.x < startX && i < endIndex && seriesPoints[i + 1].x > startX) || (point.x > endX && i > 0 && seriesPoints[i - 1].x < endX)) { requiresDrawing = true; } } if(requiresDrawing) { x = chartRect.left + (point.x - startX) * scaleX; y = this.getYCoordinate(point.y, chartRect.top, chartRect.height); point.xPx = Math.floor(x); point.yPx = Math.floor(y); renderedPoints.push(point); } } if(renderedPoints && renderedPoints.length > 0 && renderedPoints[0].x === seriesPoints[0].x && renderedPoints[0].y === seriesPoints[0].y && renderedPoints[0].x >= startX) { var arr = []; arr.push(new Point2d(seriesPoints[startIndex].x, this.graphConfiguration.gridY.min, seriesPoints[startIndex].x.toString(), false, seriesIndex, 0, 0, chartRect.left + (seriesPoints[startIndex].x - startX) * scaleX, this.getYCoordinate(this.graphConfiguration.gridY.min, chartRect.top, chartRect.height))); renderedPoints = arr.concat(renderedPoints); } } return renderedPoints; }; ChartSeries.prototype.getYCoordinate = function (y, top, height) { return top + ((this.graphConfiguration.gridY.max - y) / this.graphConfiguration.gridY.range) * height; }; return ChartSeries; })(); Graph.ChartSeries = ChartSeries; var StepLineSeries = (function (_super) { __extends(StepLineSeries, _super); function StepLineSeries(context, config, index, legendText, counterId) { _super.call(this, context, index, legendText, counterId, config); } StepLineSeries.prototype.drawLineFill = function (renderedPoints) { if(renderedPoints.length > 0) { var startIndex = 0; var endIndex = renderedPoints.length - 1; var startX = this.graphConfiguration.gridX.min; var rangeX = this.graphConfiguration.gridX.range; var endX = this.graphConfiguration.gridX.max; var scaleX = this.graphConfiguration.chartRect.width / rangeX; var x = 0; var y = 0; var hasMovedToStart = false; this.context.save(); this.context.beginPath(); var previousPoint = renderedPoints[0]; this.context.beginPath(); this.context.fillStyle = this.colorScheme.lineFillColor; this.context.strokeStyle = this.colorScheme.lineColor; for(var i = startIndex; i <= endIndex; i++) { var point = renderedPoints[i]; if(!hasMovedToStart) { this.context.moveTo(point.xPx, point.yPx); hasMovedToStart = true; } else { this.context.lineTo(point.xPx, previousPoint.yPx); this.context.lineTo(point.xPx, point.yPx); } previousPoint = point; } if(this.graphConfiguration.chartDrawFill) { var y = this.getYCoordinate(0, this.graphConfiguration.chartRect.top, this.graphConfiguration.chartRect.height); this.context.lineTo(point.xPx, y); this.context.lineTo(this.graphConfiguration.chartAxisPadding.left, y); this.context.closePath(); this.context.fill(); } else { this.context.stroke(); } this.context.restore(); } }; StepLineSeries.prototype.drawLineSeries = function (renderedPoints) { if(renderedPoints.length > 0) { this.context.save(); if(this.graphConfiguration.chartDrawFill) { this.context.beginPath(); this.context.lineWidth = (this.graphConfiguration.chartRect.height < 100 ? 1 : 2); this.context.fillStyle = this.colorScheme.lineFillColor; this.context.strokeStyle = this.colorScheme.lineColor; var previousPoint = null; for(var i = 0; i < renderedPoints.length; i++) { var rp = renderedPoints[i]; if(i === 0) { this.context.moveTo(renderedPoints[i].xPx, renderedPoints[i].yPx - 0.5); } else { var yPos = this.graphConfiguration.chartHeight - 0.5; if(previousPoint && previousPoint.yPx) { yPos = Math.round(previousPoint.yPx) - 0.5; } this.context.lineTo(rp.xPx, yPos); this.context.lineTo(rp.xPx, Math.round(rp.yPx) - 0.5); } previousPoint = rp; } this.context.stroke(); } this.context.restore(); } }; StepLineSeries.prototype.render = function () { this.renderedPoints = this.getPointsToRender(this.graphConfiguration.chartRect); if(this.renderedPoints && this.renderedPoints.length > 0) { this.drawLineFill(this.renderedPoints); this.drawLineSeries(this.renderedPoints); } }; return StepLineSeries; })(ChartSeries); Graph.StepLineSeries = StepLineSeries; var Axes = (function () { function Axes(config) { this._graphConfiguration = config; this._graphAxes = document.getElementsByClassName("graph-canvas-div")[0]; if(!this._graphAxes) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1050")); } } Axes.prototype.drawAxisLine = function (position, value) { var axisLine = document.createElement("div"); axisLine.className = "graph-axis-line"; this._graphAxes.appendChild(axisLine); var top = 0; switch(position) { case AxisPositionType.top: top = 0; break; case AxisPositionType.middle: var y = Math.floor(this._graphConfiguration.chartAxisPadding.top + ((this._graphConfiguration.gridY.max - value) / this._graphConfiguration.gridY.range) * (this._graphConfiguration.chartHeight - this._graphConfiguration.chartAxisPadding.top)); top = y - (axisLine.offsetHeight / 2); break; case AxisPositionType.bottom: var y = Math.floor(this._graphConfiguration.chartAxisPadding.top + this._graphConfiguration.chartHeight); top = y - axisLine.offsetHeight; break; } axisLine.style.top = top + "px"; }; Axes.prototype.render = function () { var children = this._graphAxes.getElementsByClassName("graph-axis-line"); if(children) { while(children.length > 0) { this._graphAxes.removeChild(children[children.length - 1]); } } if(this._graphConfiguration.axes && this._graphConfiguration.axes.length > 0) { for(var i = 0; i < this._graphConfiguration.axes.length; i++) { var axis = this._graphConfiguration.axes[i]; this.drawAxisLine(AxisPositionType.middle, axis.value); } } else { this.drawAxisLine(AxisPositionType.top, this._graphConfiguration.gridY.max); this.drawAxisLine(AxisPositionType.bottom, this._graphConfiguration.gridY.min); } }; Object.defineProperty(Axes.prototype, "height", { set: function (value) { this._graphAxes.style.height = value + "px"; }, enumerable: true, configurable: true }); return Axes; })(); Graph.Axes = Axes; var Scale = (function () { function Scale(type, config) { this._graphConfiguration = config; this._type = type; this._width = type === ScaleType.Left ? this._graphConfiguration.graphScaleWidthLeft : this._graphConfiguration.graphScaleWidthRight; this._graphScale = document.createElement("div"); this._graphScale.className = type === ScaleType.Left ? "graph-scale-left" : "graph-scale-right"; this._graphScale.style.width = this._width + "px"; if(type === ScaleType.Left) { this._graphScale.style.borderRightWidth = this._graphConfiguration.leftScaleBorder + "px"; } else { this._graphScale.style.borderLeftWidth = this._graphConfiguration.rightScaleBorder + "px"; } var container = document.getElementById(this._graphConfiguration.graphContainerId); container.appendChild(this._graphScale); } Scale.prototype.drawAxisValue = function (position, value) { var axisDiv = document.createElement("div"); axisDiv.className = this._type === ScaleType.Left ? "graph-axis-left" : "graph-axis-right"; axisDiv.innerHTML = value.toString(); this._graphScale.appendChild(axisDiv); var top = 0; switch(position) { case AxisPositionType.top: top = 0; break; case AxisPositionType.middle: var y = Math.floor(this._graphConfiguration.chartAxisPadding.top + ((this._graphConfiguration.gridY.max - value) / this._graphConfiguration.gridY.range) * (this._graphConfiguration.chartHeight - this._graphConfiguration.chartAxisPadding.top)); top = y - (axisDiv.offsetHeight / 2); break; case AxisPositionType.bottom: var y = Math.floor(this._graphConfiguration.chartAxisPadding.top + this._graphConfiguration.chartHeight); top = y - axisDiv.offsetHeight; break; } axisDiv.style.top = top + "px"; }; Scale.prototype.render = function () { while(this._graphScale.childNodes.length > 0) { this._graphScale.removeChild(this._graphScale.firstChild); } if(this._graphConfiguration.axes && this._graphConfiguration.axes.length > 0) { for(var i = 0; i < this._graphConfiguration.axes.length; i++) { var axis = this._graphConfiguration.axes[i]; this.drawAxisValue(AxisPositionType.middle, axis.value); } } else { this.drawAxisValue(AxisPositionType.top, this._graphConfiguration.gridY.max); this.drawAxisValue(AxisPositionType.bottom, this._graphConfiguration.gridY.min); } }; return Scale; })(); Graph.Scale = Scale; var Legend = (function () { function Legend(config) { if(!config || !config.containerId) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1050")); } this._config = config; } Legend.prototype.render = function () { for(var i = 0; i < this._config.data.length; i++) { var legendColorDiv = document.createElement("div"); legendColorDiv.className = "legend-color-div"; var colorDiv = document.createElement("div"); colorDiv.className = "legend-color"; colorDiv.style.backgroundColor = this._config.data[i].color; legendColorDiv.appendChild(colorDiv); var legendTextDiv = document.createElement("div"); legendTextDiv.className = "legend-text-div"; legendTextDiv.innerText = this._config.data[i].text; var individualLegendBox = document.createElement("div"); individualLegendBox.className = "legend-div"; individualLegendBox.appendChild(legendColorDiv); individualLegendBox.appendChild(legendTextDiv); var container = document.getElementById(this._config.containerId); container.appendChild(individualLegendBox); } }; return Legend; })(); Graph.Legend = Legend; var Title = (function () { function Title(config) { this._callbackArr = []; this._focused = false; this._config = config; } Title.prototype.onTabFocus = function () { this._focused = true; }; Title.prototype.onTabBlur = function () { this._focused = false; }; Title.prototype.onKeyPress = function (e) { if(this._focused && Common.KeyCodes.ENTER === e.keyCode) { this.mouseClick(); } }; Title.prototype.mouseClick = function () { this._config.isExpanded = !this._config.isExpanded; this.setAraiLabelAndStylesheet(); for(var i = 0; i < this._callbackArr.length; i++) { this._callbackArr[i](this._config.isExpanded); } }; Title.prototype.setAraiLabelAndStylesheet = function () { if(this._config.isExpanded === null || this._config.isExpanded === undefined || this._config.isExpanded) { this._titleCollapseExpandButton.className = "title-expand-button"; this._titleCollapseExpandButton.setAttribute("aria-label", Plugin.Resources.getString("GraphCollapseAriaLabel")); } else { this._titleCollapseExpandButton.className = "title-collapse-button"; this._titleCollapseExpandButton.setAttribute("aria-label", Plugin.Resources.getString("GraphExpandAriaLabel")); } }; Title.prototype.render = function () { var titleText = document.createElement("div"); titleText.className = "title-text"; var text = ""; if(this._config.text) { text = this._config.text; } if(this._config.unit) { text += " (" + this._config.unit + ")"; } titleText.innerText = text; this._titleCollapseExpandButton = document.createElement("div"); this._titleCollapseExpandButton.setAttribute("role", "button"); this.setAraiLabelAndStylesheet(); this._titleCollapseExpandButton.addEventListener("click", this.mouseClick.bind(this)); this._titleCollapseExpandButton.tabIndex = 0; this._titleCollapseExpandButton.addEventListener("focus", this.onTabFocus.bind(this)); this._titleCollapseExpandButton.addEventListener("blur", this.onTabBlur.bind(this)); this._titleCollapseExpandButton.addEventListener("keypress", this.onKeyPress.bind(this)); var container = document.getElementById(this._config.containerId); container.appendChild(this._titleCollapseExpandButton); container.appendChild(titleText); }; Title.prototype.registerCallback = function (callback) { this._callbackArr.push(callback); }; return Title; })(); Graph.Title = Title; var Header = (function () { function Header(config) { var titleContainer = document.createElement("div"); titleContainer.id = config.titleConfig.containerId; titleContainer.className = "title-container"; var legendContainer = document.createElement("div"); legendContainer.id = config.legendConfig.containerId; legendContainer.className = "legend-container"; var container = document.getElementById(config.containerId); container.appendChild(titleContainer); container.appendChild(legendContainer); this.title = new Title(config.titleConfig); this.legend = new Legend(config.legendConfig); } Header.prototype.render = function () { this.title.render(); this.legend.render(); }; return Header; })(); Graph.Header = Header; })(VisualProfiler.Graph || (VisualProfiler.Graph = {})); var Graph = VisualProfiler.Graph; })(VisualProfiler || (VisualProfiler = {})); //@ sourceMappingURL=AnimationFrameGraph.js.map // StackedBarChart.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var VisualProfiler; (function (VisualProfiler) { "use strict"; var DataSeriesInfo = (function () { function DataSeriesInfo(label, name, cssClass, sortOrder, tooltip) { if(!name || sortOrder === undefined || sortOrder === null) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1044")); } this._label = label; this._name = name; this._cssClass = cssClass; this._sortOrder = sortOrder; this._tooltip = tooltip; } Object.defineProperty(DataSeriesInfo.prototype, "cssClass", { get: function () { return this._cssClass; }, enumerable: true, configurable: true }); Object.defineProperty(DataSeriesInfo.prototype, "label", { get: function () { return this._label; }, enumerable: true, configurable: true }); Object.defineProperty(DataSeriesInfo.prototype, "name", { get: function () { return this._name; }, enumerable: true, configurable: true }); Object.defineProperty(DataSeriesInfo.prototype, "sortOrder", { get: function () { return this._sortOrder; }, enumerable: true, configurable: true }); Object.defineProperty(DataSeriesInfo.prototype, "tooltip", { get: function () { return this._tooltip; }, enumerable: true, configurable: true }); return DataSeriesInfo; })(); VisualProfiler.DataSeriesInfo = DataSeriesInfo; var StackedBarChartPresenter = (function () { function StackedBarChartPresenter(options) { this._data = new Array(); this._dataSeriesInfo = { }; this._maximumYValue = Number.NEGATIVE_INFINITY; this._yAxisValuePadding = 10; this.viewModel = []; this._options = options; this.validateOptions(); this._pixelHorizontalValue = this.xWidth / (this._options.width - this._options.yAxisWidth - this._options.rightPadding); } Object.defineProperty(StackedBarChartPresenter.prototype, "dataSelectionChanged", { set: function (dataSelectionChangedCallback) { this._dataSelectionChanged = dataSelectionChangedCallback; }, enumerable: true, configurable: true }); Object.defineProperty(StackedBarChartPresenter.prototype, "selection", { set: function (value) { if(!value) { return; } var startXPercent = (value.begin.nsec - this._options.minX) / this.xWidth * 100; var widthPercent = value.elapsed.nsec / this.xWidth * 100; if(this._dataSelectionChanged) { this._dataSelectionChanged(startXPercent, widthPercent); } }, enumerable: true, configurable: true }); Object.defineProperty(StackedBarChartPresenter.prototype, "xWidth", { get: function () { return this._options.maxX - this._options.minX; }, enumerable: true, configurable: true }); StackedBarChartPresenter.prototype.addData = function (chartData) { var _this = this; chartData.forEach(function (dataItem) { if(_this._dataSeriesInfo.hasOwnProperty(dataItem.series)) { _this._data.push(dataItem); } else { throw new Error(Plugin.Resources.getErrorString("JSPerf.1043")); } }); this.generateViewModel(); }; StackedBarChartPresenter.prototype.addSeries = function (seriesInfo) { for(var i = 0; i < seriesInfo.length; i++) { var info = seriesInfo[i]; if(this._dataSeriesInfo.hasOwnProperty(info.name)) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1045")); } this._dataSeriesInfo[info.name] = info; } }; StackedBarChartPresenter.prototype.getViewOptions = function () { var yAxisMarks = this.determineYAxisMarkPositions(this._options.yAxisMarkValues); var viewOptions = { ariaDescription: this._options.ariaDescription, ariaLabelCallback: this._options.ariaLabelCallback, height: this._options.height, width: this._options.width, title: this._options.title, yAxisMarks: yAxisMarks, tooltipCallback: this._options.tooltipCallback, displayLegend: this._options.displayLegend, legendData: this._dataSeriesInfo, minSelectionWidthInPixels: this._options.minSelectionWidthInPixels, selectionCallback: this.viewSelectionChanged.bind(this), yAxisWidth: this._options.yAxisWidth, rightPadding: this._options.rightPadding }; return viewOptions; }; StackedBarChartPresenter.prototype.convertChartAreaPercentToDataValue = function (percent) { return Math.round(percent * this.xWidth / 100) + this._options.minX; }; StackedBarChartPresenter.prototype.determineYAxisMarkPositions = function (yAxisMarks) { var result = { }; for(var i = 0; i < yAxisMarks.length; i++) { if(yAxisMarks[i] > this._maximumYValue) { break; } var yPixelPosition = this._options.height - (yAxisMarks[i] / this._pixelVerticalValue); result[yAxisMarks[i]] = yPixelPosition; } return result; }; StackedBarChartPresenter.prototype.determineYAxisScale = function (allBars) { for(var i = 0; i < allBars.length; i++) { var totalStackHeight = 0; var currentBar = allBars[i]; for(var j = 0; j < currentBar.length; j++) { var stackComponent = currentBar[j]; if(stackComponent.height > 0) { totalStackHeight += stackComponent.height; } } this._maximumYValue = Math.max(this._maximumYValue, totalStackHeight); } this._maximumYValue = Math.max(this._options.minYHeight, this._maximumYValue); this._maximumYValue += this._yAxisValuePadding; this._pixelVerticalValue = Math.ceil(this._maximumYValue - this._options.minY) / this._options.height; }; StackedBarChartPresenter.prototype.generateViewModel = function () { var allBars = [ [] ]; var singleBar = []; var barWidthAndMargin = this._options.barWidth + this._options.barGap; var currentXValue = this._options.minX; var prevValue = Number.NEGATIVE_INFINITY; var x = 0; var i = 0; while(i < this._data.length) { var dataItem = this._data[i]; if(dataItem.x < prevValue) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1046")); } if(dataItem.x > this._options.maxX) { break; } prevValue = dataItem.x; var currentXValue = Math.floor(x * this._pixelHorizontalValue + this._options.minX); var currentBarMinValue = currentXValue; var currentBarMaxValue = currentXValue + Math.floor((this._options.barWidth + this._options.barGap) * this._pixelHorizontalValue); if(dataItem.x < currentBarMinValue) { i++; continue; } if(dataItem.x < currentBarMaxValue) { dataItem.x = x; singleBar.push(dataItem); i++; } else { allBars.push(singleBar); singleBar = []; x += barWidthAndMargin; } } allBars.push(singleBar); this.determineYAxisScale(allBars); for(var i = 0; i < allBars.length; i++) { this.generateViewModelForSingleStack(allBars[i]); } }; StackedBarChartPresenter.prototype.generateViewModelForSingleStack = function (dataItems) { if(!dataItems || dataItems.length === 0) { return; } dataItems.sort(this.sortBySeries.bind(this)); var accumulatedHeight = 0; var maxHeightExceeded = false; var singleBarViewModel = []; for(var i = dataItems.length - 1; i >= 0; i--) { var dataItem = dataItems[i]; if(dataItem.height <= 0) { continue; } var barHeight = Math.ceil(dataItem.height / this._pixelVerticalValue); var startY = this._options.height - (barHeight + accumulatedHeight); if(startY < 0) { barHeight = this._options.height - accumulatedHeight; startY = 0; maxHeightExceeded = true; } accumulatedHeight += barHeight; if(this._options.showStackGap && barHeight > 1) { barHeight -= 1; startY += 1; } var rectangle = { x: dataItem.x, y: startY, height: barHeight, width: this._options.barWidth, className: this._dataSeriesInfo[dataItem.series].cssClass, attachedObject: dataItem.attachedObject }; this.viewModel.push(rectangle); if(maxHeightExceeded) { break; } } }; StackedBarChartPresenter.prototype.sortBySeries = function (chartItem1, chartItem2) { return this._dataSeriesInfo[chartItem2.series].sortOrder - this._dataSeriesInfo[chartItem1.series].sortOrder; }; StackedBarChartPresenter.prototype.validateOptions = function () { if(!this._options) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1047")); } if((this._options.minX === undefined || this._options.minX === null) || (this._options.maxX === undefined || this._options.maxX === null) || (this._options.minY === undefined || this._options.minY === null) || (this._options.minX > this._options.maxX) || (!this._options.height || !this._options.width || this._options.height < 0 || this._options.width < 0) || (!this._options.barWidth || this._options.barWidth < 0)) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1048")); } this._options.barGap = this._options.barGap || 0; this._options.showStackGap = this._options.showStackGap || false; this._options.yAxisWidth = this._options.yAxisWidth || 0; this._options.minYHeight = this._options.minYHeight || this._options.minY; }; StackedBarChartPresenter.prototype.viewSelectionChanged = function (startPercent, widthPercent) { if(!this._options.selectionCallback) { return; } var min = this.convertChartAreaPercentToDataValue(startPercent); var max = this.convertChartAreaPercentToDataValue(startPercent + widthPercent); this._options.selectionCallback(min, max); }; return StackedBarChartPresenter; })(); VisualProfiler.StackedBarChartPresenter = StackedBarChartPresenter; var StackedBarChartView = (function (_super) { __extends(StackedBarChartView, _super); function StackedBarChartView() { _super.call(this); this._idCount = 0; this._isCollapsed = false; this._selectedId = -1; this._selectionStartXPercent = 0; this._selectionWidthPercent = 0; this._selectionStartXPercent = 0; this._selectionWidthPercent = 100; } StackedBarChartView._barIdPrefix = "bar"; Object.defineProperty(StackedBarChartView.prototype, "presenter", { set: function (value) { this.unregisterPresenterEvents(); this._presenter = value; this.registerPresenterEvents(); this._viewData = this._presenter.viewModel; this._options = value.getViewOptions(); this._barGraphWidth = this._options.width - this._options.yAxisWidth - this._options.rightPadding; this.drawChart(); }, enumerable: true, configurable: true }); StackedBarChartView.prototype.addYAxisMark = function (yAxis, value, cssClass) { var mark = document.createElement("div"); mark.innerText = value; var yPos = this._options.yAxisMarks[value]; mark.classList.add(cssClass); yAxis.appendChild(mark); yPos -= mark.offsetHeight / 2; yPos = Math.max(yPos, 0); if((yPos + mark.offsetHeight) >= this._options.height) { yPos = this._options.height - mark.offsetHeight; } mark.style.top = yPos + "px"; }; StackedBarChartView.prototype.clearAll = function () { this._leftUnselectedRegion = null; this._rightUnselectedRegion = null; }; StackedBarChartView.prototype.convertPageXToChartAreaPercent = function (pageX) { var rect = this._chartAreaContainer.getBoundingClientRect(); return (pageX - rect.left - this._options.yAxisWidth) / this._barGraphWidth * 100; }; StackedBarChartView.prototype.createContainer = function () { if(!this._chartAreaContainer) { this._chartAreaContainer = document.createElement("div"); this.rootElement.appendChild(this._chartAreaContainer); } else { this._chartAreaContainer.innerHTML = ""; } this._chartAreaContainer.style.width = this._options.width + "px"; this._chartAreaContainer.style.height = this._options.height + "px"; this._chartAreaContainer.classList.add("stackedBarChart"); this._chartAreaContainer.style.display = this._isCollapsed ? "none" : "-ms-grid"; }; StackedBarChartView.prototype.createLegendItem = function (name, className, tooltip) { var legendItem = document.createElement("div"); legendItem.classList.add("legendItem"); var legendColorDiv = document.createElement("div"); legendColorDiv.classList.add("legendColor"); legendColorDiv.classList.add(className); var legendTextSpan = document.createElement("div"); legendTextSpan.classList.add("legendText"); legendTextSpan.innerHTML = name; if(typeof tooltip !== "undefined") { legendItem.setAttribute("data-plugin-vs-tooltip", tooltip); } legendItem.appendChild(legendColorDiv); legendItem.appendChild(legendTextSpan); return legendItem; }; StackedBarChartView.prototype.createYAxisLine = function (axisValue) { var line = document.createElement("div"); line.classList.add("yAxisLine"); line.style.top = axisValue + "px"; return line; }; StackedBarChartView.prototype.createRect = function (x, y, height, width, className) { var rect = document.createElement("div"); rect.id = StackedBarChartView._barIdPrefix + this._idCount; rect.tabIndex = -1; this._idCount++; rect.classList.add(className); rect.style.position = "absolute"; rect.style.left = x + "px"; rect.style.bottom = (this._options.height - y - height) + "px"; rect.style.height = height + "px"; rect.style.width = width + "px"; return rect; }; StackedBarChartView.prototype.createUnselectedRegion = function (xPercent, widthPercent) { var rect = document.createElement("div"); rect.style.height = this._barGraph.offsetHeight + "px"; rect.style.width = widthPercent + "%"; rect.style.left = xPercent + "%"; rect.style.top = "0px"; rect.className = "unselected"; return rect; }; StackedBarChartView.prototype.createVerticalRulerLine = function (xPercent) { var x = this._barGraphWidth * xPercent / 100; var line = document.createElement("div"); line.style.left = x + "px"; line.style.height = "100%"; line.style.top = "0px"; line.className = "verticalRulerLine"; return line; }; StackedBarChartView.prototype.createYAxisDiv = function (cssClass) { var yAxis = document.createElement("div"); yAxis.classList.add(cssClass); yAxis.style.height = this._options.height + "px"; yAxis.style.width = this._options.yAxisWidth + "px"; this._chartAreaContainer.appendChild(yAxis); var finalWidthWithStyling = yAxis.offsetWidth; if(finalWidthWithStyling !== this._options.yAxisWidth) { yAxis.style.width = this._options.yAxisWidth - (finalWidthWithStyling - this._options.yAxisWidth) + "px"; } return yAxis; }; StackedBarChartView.prototype.drag = function (event) { var xPercent = this.convertPageXToChartAreaPercent(event.pageX); this._dragDirection = StackedBarChartView.getDragDirection(xPercent - this._initialSelectionStartXPercent); this._selectionWidthPercent = Math.abs(xPercent - this._initialSelectionStartXPercent); if(this._dragDirection === VisualProfiler.DragDirection.left) { this._selectionStartXPercent = this._initialSelectionStartXPercent - this._selectionWidthPercent; } this.drawSelection(); this.raiseSelectionChanged(); }; StackedBarChartView.prototype.drawChart = function () { if(!this._viewData) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1049")); } this.clearAll(); this.createContainer(); this.drawYAxis(); this.drawHeader(); this.drawLegend(); this.initializeBarGraph(); this.drawHorizontalScaleLines(); this.drawVerticalRulerLines(); this.renderViewData(this._barGraph, this._viewData); this._chartAreaContainer.appendChild(this._barGraph); this.drawSelection(); }; StackedBarChartView.prototype.drawHeader = function () { var _this = this; if(!this._collapseExpandArrow) { this._collapseExpandArrow = document.createElement("div"); this._collapseExpandArrow.setAttribute("role", "button"); this._collapseExpandArrow.tabIndex = 0; this._collapseExpandArrow.addEventListener("click", function () { return _this.toggleExpansion(); }); this._collapseExpandArrow.addEventListener("keypress", function (e) { if(e.keyCode === Common.KeyCodes.ENTER) { _this.toggleExpansion(); _this._collapseExpandArrow.focus(); } }); } if(this._isCollapsed) { this._collapseExpandArrow.classList.add("collapsed"); this._collapseExpandArrow.setAttribute("aria-label", Plugin.Resources.getString("GraphExpandAriaLabel")); } else { this._collapseExpandArrow.classList.add("expanded"); this._collapseExpandArrow.setAttribute("aria-label", Plugin.Resources.getString("GraphCollapseAriaLabel")); } if(!this._header) { this._header = document.createElement("div"); this._header.classList.add("stackedBarChartHeader"); var description = document.createElement("div"); description.classList.add("title"); description.innerText = this._options.title; this._header.appendChild(this._collapseExpandArrow); this._header.appendChild(description); this.rootElement.insertBefore(this._header, this._chartAreaContainer); } }; StackedBarChartView.prototype.drawHorizontalScaleLines = function () { var lineWidth = 1; for(var markValue in this._options.yAxisMarks) { if(!this._options.yAxisMarks.hasOwnProperty(markValue)) { continue; } var yPos = Math.ceil(this._options.yAxisMarks[markValue]); if(yPos >= this._options.height || yPos <= 0) { continue; } var line = this.createYAxisLine(yPos); this._barGraph.appendChild(line); } }; StackedBarChartView.prototype.drawLegend = function () { if(!this._options.displayLegend) { return; } if(!this._legendDiv) { this._legendDiv = document.createElement("div"); this._legendDiv.classList.add("legend"); for(var seriesName in this._options.legendData) { if(!this._options.legendData.hasOwnProperty(seriesName)) { continue; } var dataSeriesItem = this._options.legendData[seriesName]; var legendItem = this.createLegendItem(dataSeriesItem.label, dataSeriesItem.cssClass, dataSeriesItem.tooltip); this._legendDiv.appendChild(legendItem); } this._header.appendChild(this._legendDiv); } }; StackedBarChartView.prototype.drawSelection = function () { if(!this._leftUnselectedRegion || !this._rightUnselectedRegion) { this.initializeUnselectedRegions(this._selectionStartXPercent); } this._leftUnselectedRegion.style.width = this._selectionStartXPercent + "%"; this._rightUnselectedRegion.style.left = (this._selectionStartXPercent + this._selectionWidthPercent) + "%"; this._rightUnselectedRegion.style.width = (100 - (this._selectionStartXPercent + this._selectionWidthPercent)) + "%"; }; StackedBarChartView.prototype.drawVerticalRulerLines = function () { var positions = this._presenter.verticalRulerLinePositions; for(var i = 0; i < positions.length; ++i) { var line = this.createVerticalRulerLine(positions[i]); this._barGraph.appendChild(line); } }; StackedBarChartView.prototype.drawYAxis = function () { var yAxisLeft = this.createYAxisDiv("yAxisLeft"); var yAxisRight = this.createYAxisDiv("yAxisRight"); for(var markValue in this._options.yAxisMarks) { if(!this._options.yAxisMarks.hasOwnProperty(markValue)) { continue; } this.addYAxisMark(yAxisLeft, markValue, "yAxisMarkLeft"); this.addYAxisMark(yAxisRight, markValue, "yAxisMarkRight"); } }; StackedBarChartView.prototype.ensureMinSelectionWidth = function () { if(typeof this._selectionStartXPercent === "undefined") { return; } if(Math.abs(this._selectionWidthPercent * this._barGraphWidth / 100) < this._options.minSelectionWidthInPixels) { this._selectionWidthPercent = this._options.minSelectionWidthInPixels / this._barGraphWidth * 100; switch(this._dragDirection) { case VisualProfiler.DragDirection.right: if(this._selectionStartXPercent + this._selectionWidthPercent > 100) { this._selectionStartXPercent = 100 - this._selectionWidthPercent; } break; case VisualProfiler.DragDirection.left: if(this._selectionStartXPercent - this._selectionWidthPercent < 0) { this._selectionStartXPercent = 0; } else if(this._selectionStartXPercent + this._selectionWidthPercent > 100) { this._selectionStartXPercent = 100 - this._selectionWidthPercent; } else { this._selectionStartXPercent = this._initialSelectionStartXPercent - this._selectionWidthPercent; } break; default: if(this._selectionStartXPercent + (this._selectionWidthPercent / 2) > 100) { this._selectionStartXPercent = 100 - this._selectionWidthPercent; } else if(this._selectionStartXPercent - (this._selectionWidthPercent / 2) < 0) { this._selectionStartXPercent = 0; } else { this._selectionStartXPercent = this._selectionStartXPercent - (this._selectionWidthPercent / 2); } break; } } }; StackedBarChartView.prototype.initializeUnselectedRegions = function (startXPercent) { this._leftUnselectedRegion = this.createUnselectedRegion(0, startXPercent); this._rightUnselectedRegion = this.createUnselectedRegion(startXPercent, 100 - startXPercent); this._barGraph.appendChild(this._leftUnselectedRegion); this._barGraph.appendChild(this._rightUnselectedRegion); }; StackedBarChartView.prototype.initializeBarGraph = function () { var _this = this; this._selectedId = -1; this._idCount = 0; this._barGraph = document.createElement("div"); this._barGraph.classList.add("barGraph"); this._barGraph.tabIndex = 0; this._barGraph.style.height = this._options.height + "px"; this._barGraph.style.width = this._barGraphWidth + "px"; this._barGraph.addEventListener("mousedown", this.startSelection.bind(this)); this._barGraph.addEventListener("keydown", this.onBarGraphKeydown.bind(this)); this._barGraph.addEventListener("focus", function () { _this._selectedId = -1; }); if(this._options.ariaDescription) { this._barGraph.setAttribute("aria-label", this._options.ariaDescription); } this._dragHandler = this.drag.bind(this); }; StackedBarChartView.prototype.onBarBlur = function (event) { var bar = event.currentTarget; bar.classList.remove("focused"); Plugin.Tooltip.dismiss(); }; StackedBarChartView.prototype.onBarFocus = function (objectForLabel, event) { var bar = event.currentTarget; bar.classList.add("focused"); if(this._options.ariaLabelCallback) { var ariaLabel = this._options.ariaLabelCallback(objectForLabel); bar.setAttribute("aria-label", ariaLabel); } }; StackedBarChartView.prototype.onBarGraphKeydown = function (event) { if(event.keyCode === Common.KeyCodes.ARROW_LEFT || event.keyCode === Common.KeyCodes.ARROW_RIGHT) { if(event.keyCode === Common.KeyCodes.ARROW_LEFT) { if((this._selectedId === 0) || (this._selectedId === -1)) { this._selectedId = this._idCount; } this._selectedId--; } else if(event.keyCode === Common.KeyCodes.ARROW_RIGHT) { this._selectedId++; if(this._selectedId === this._idCount) { this._selectedId = 0; } } var bar = (document.getElementById(StackedBarChartView._barIdPrefix + this._selectedId)); bar.focus(); event.preventDefault(); event.stopPropagation(); return false; } return true; }; StackedBarChartView.prototype.onBarKeydown = function (objectForTooltip, event) { if(event.keyCode === Common.KeyCodes.ENTER) { var element = event.currentTarget; var offsetX = window.screenLeft + element.offsetLeft + element.clientWidth; var offsetY = window.screenTop + element.offsetTop; element = element.offsetParent; while(element) { offsetX += element.offsetLeft; offsetY += element.offsetTop; element = element.offsetParent; } this.showTooltip(objectForTooltip, offsetX, offsetY); event.preventDefault(); event.stopPropagation(); return false; } return true; }; StackedBarChartView.prototype.raiseSelectionChanged = function () { if(!this._options.selectionCallback) { return; } this._options.selectionCallback(this._selectionStartXPercent, this._selectionWidthPercent); }; StackedBarChartView.prototype.registerPresenterEvents = function () { this._presenter.dataSelectionChanged = this.setSelection.bind(this); }; StackedBarChartView.prototype.renderViewData = function (container, viewData) { for(var i = 0; i < viewData.length; i++) { var barInfo = viewData[i]; var rectangle = this.createRect(barInfo.x, barInfo.y, barInfo.height, barInfo.width, barInfo.className); rectangle.addEventListener("mouseover", this.showTooltip.bind(this, barInfo.attachedObject)); rectangle.addEventListener("mouseout", Plugin.Tooltip.dismiss); rectangle.addEventListener("keydown", this.onBarKeydown.bind(this, barInfo.attachedObject)); rectangle.addEventListener("focus", this.onBarFocus.bind(this, barInfo.attachedObject)); rectangle.addEventListener("blur", this.onBarBlur.bind(this)); container.appendChild(rectangle); } }; StackedBarChartView.prototype.setSelection = function (startXPercent, widthPercent) { this._selectionStartXPercent = startXPercent; this._selectionWidthPercent = widthPercent; this.drawSelection(); }; StackedBarChartView.prototype.showTooltip = function (objectForTooltip, x, y) { if(!this._options.tooltipCallback) { return; } var toolTipContent; toolTipContent = this._options.tooltipCallback(objectForTooltip); var config = { content: toolTipContent, delay: 0, x: x, y: y, contentContainsHTML: true }; Plugin.Tooltip.show(config); }; StackedBarChartView.prototype.startSelection = function (event) { if(event.button === Common.MouseButtons.LEFT_BUTTON) { this._initialSelectionStartXPercent = this._selectionStartXPercent = this.convertPageXToChartAreaPercent(event.pageX); this._selectionWidthPercent = 0; this._dragDirection = StackedBarChartView.getDragDirection(this._selectionWidthPercent); this._mouseupHandler = this.stopSelection.bind(this); this._chartAreaContainer.addEventListener("mousemove", this._dragHandler); this._chartAreaContainer.addEventListener("mouseup", this._mouseupHandler); this._chartAreaContainer.setCapture(true); this.drawSelection(); } }; StackedBarChartView.prototype.stopSelection = function (event) { this._chartAreaContainer.removeEventListener("mousemove", this._dragHandler); this._chartAreaContainer.removeEventListener("mouseup", this._mouseupHandler); this._chartAreaContainer.releaseCapture(); this.ensureMinSelectionWidth(); this.drawSelection(); this._dragDirection = VisualProfiler.DragDirection.none; this.raiseSelectionChanged(); }; StackedBarChartView.prototype.toggleExpansion = function () { if(this._collapseExpandArrow.classList.contains("expanded")) { this._isCollapsed = true; this._chartAreaContainer.style.display = "none"; this._collapseExpandArrow.classList.remove("expanded"); this._collapseExpandArrow.classList.add("collapsed"); this._collapseExpandArrow.setAttribute("aria-label", Plugin.Resources.getString("GraphExpandAriaLabel")); Notifications.notify(VisualProfiler.ResponsivenessNotifications.GraphCollapsed); } else { this._isCollapsed = false; this.drawChart(); this._collapseExpandArrow.classList.remove("collapsed"); this._collapseExpandArrow.classList.add("expanded"); this._collapseExpandArrow.setAttribute("aria-label", Plugin.Resources.getString("GraphCollapseAriaLabel")); Notifications.notify(VisualProfiler.ResponsivenessNotifications.GraphExpanded); } VisualProfiler.Program.triggerResize(); }; StackedBarChartView.prototype.unregisterPresenterEvents = function () { if(!this._presenter) { return; } this._presenter.dataSelectionChanged = null; }; StackedBarChartView.getDragDirection = function getDragDirection(selectionWidth) { if(selectionWidth > 0) { return VisualProfiler.DragDirection.right; } else if(selectionWidth < 0) { return VisualProfiler.DragDirection.left; } return VisualProfiler.DragDirection.none; }; return StackedBarChartView; })(Common.Controls.Control); VisualProfiler.StackedBarChartView = StackedBarChartView; })(VisualProfiler || (VisualProfiler = {})); //@ sourceMappingURL=StackedBarChart.js.map // DonutChart.ts var VisualProfiler; (function (VisualProfiler) { "use strict"; var DonutChart = (function () { function DonutChart(container, tooltipCallback, addSectorAriaLabelCallback, donutViewConfig) { this._totalValue = 0; this._container = container; this._sectBaseData = []; this._labelOffset = 8; this._pathOpacity = 1; this._renderTooltipCallback = tooltipCallback; this._addSectorAriaLabelCallback = addSectorAriaLabelCallback; this._svgTextFontSize = Plugin.Theme.getValue("plugin-font-size"); this._svgTextFont = Plugin.Theme.getValue("plugin-font-family"); this._svgTextColor = Plugin.Theme.getValue("plugin-color"); if(this._svgTextFontSize.indexOf("px") !== -1) { this._textFontPx = parseInt(this._svgTextFontSize.substring(0, this._svgTextFontSize.indexOf("px"))); } else if(this._svgTextFontSize.indexOf("pt") !== -1) { this._textFontPx = Math.round(parseInt(this._svgTextFontSize.substring(0, this._svgTextFontSize.indexOf("pt"))) / 0.75); } else { this._textFontPx = 0; } this._config = donutViewConfig || { explosionFactor: 2, radius: 55, strokeWidth: 25, minDonutArcAngle: 10, containerWidth: 200, containerHeight: 200, clockwiseRotation: true }; if(typeof this._config.containerWidth === "undefined" || typeof this._config.containerHeight === "undefined") { if((container.style.width !== "" || container.getAttribute("width") !== null) && (container.style.height !== "" || container.getAttribute("height") !== null)) { this._containerWidth = parseInt(container.getAttribute("width") !== null ? container.getAttribute("width") : container.style.width); this._containerHeight = parseInt(container.getAttribute("height") !== null ? container.getAttribute("height") : container.style.height); } else { this._containerWidth = 200; this._containerHeight = 200; } } else { this._containerWidth = this._config.containerWidth; this._containerHeight = this._config.containerHeight; } this._centerX = this._config.containerWidth / 2; this._centerY = this._config.containerHeight / 2; this._div = this.createDivContainer(); this._container.appendChild(this._div); } DonutChart.SvgNS = "http://www.w3.org/2000/svg"; DonutChart.RadiusResizeFactor = 4; DonutChart.WidthResizeFactor = 2.5; Object.defineProperty(DonutChart.prototype, "centerX", { get: function () { return this._centerX; }, enumerable: true, configurable: true }); Object.defineProperty(DonutChart.prototype, "centerY", { get: function () { return this._centerY; }, enumerable: true, configurable: true }); Object.defineProperty(DonutChart.prototype, "containerHeight", { get: function () { return this._config.containerHeight; }, enumerable: true, configurable: true }); Object.defineProperty(DonutChart.prototype, "containerWidth", { get: function () { return this._config.containerWidth; }, enumerable: true, configurable: true }); Object.defineProperty(DonutChart.prototype, "clockwiseRotation", { get: function () { return this._config.clockwiseRotation; }, enumerable: true, configurable: true }); Object.defineProperty(DonutChart.prototype, "explosionFactor", { get: function () { return this._config.explosionFactor; }, enumerable: true, configurable: true }); Object.defineProperty(DonutChart.prototype, "radius", { get: function () { return this._config.radius; }, enumerable: true, configurable: true }); Object.defineProperty(DonutChart.prototype, "strokeWidth", { get: function () { return this._config.strokeWidth; }, enumerable: true, configurable: true }); Object.defineProperty(DonutChart.prototype, "sectors", { get: function () { return this._sectBaseData; }, enumerable: true, configurable: true }); DonutChart.prototype.addSector = function (sectorInfo) { this.addSectorToBaseSeries(sectorInfo); }; DonutChart.prototype.addSectors = function (sectors) { for(var i = 0; i < sectors.length; i++) { this.addSector(sectors[i]); } }; DonutChart.prototype.removeSector = function (sectorInfo) { var index = this.getSectorIndex(sectorInfo); if(index === -1) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1061")); } else { this._totalValue -= sectorInfo.value; this._sectBaseData.splice(index, 1); } }; DonutChart.prototype.removeSectors = function (sectors) { for(var i = 0; i < sectors.length; i++) { this.removeSector(sectors[i]); } }; DonutChart.prototype.render = function () { var donutSectorInfo = this.buildChartData(this._sectBaseData); var donutSectorPoints = this.calculatePoints(donutSectorInfo); this.draw(donutSectorPoints); }; DonutChart.prototype.resetDonutChart = function () { this._totalValue = 0; this._sectBaseData = []; this._container.removeChild(this._svg); this._svg = this.createSVG(); this._container.appendChild(this._svg); }; DonutChart.prototype.addSectorToBaseSeries = function (sector) { this._totalValue += sector.value; this._sectBaseData.push(sector); }; DonutChart.prototype.buildChartData = function (sectBaseData) { var sectDonutData = []; if(sectBaseData.length === 1) { sectDonutData.push({ startAngle: 0, endAngle: 360, percentValue: 100, info: { name: sectBaseData[0].name, cssClass: sectBaseData[0].cssClass, value: sectBaseData[0].value } }); } else { var currAngle = 0; var currValue = 0; var i = 0; var angleReductionFactor = this.getReductionFactor(sectBaseData); for(i = 0; i < sectBaseData.length - 1; i++) { currValue = sectBaseData[i].value; var arcAngle = Math.round(360 * currValue / this._totalValue); var percentValue = parseFloat((100 * currValue / this._totalValue).toFixed(2)); arcAngle = (arcAngle < this._config.minDonutArcAngle) ? this._config.minDonutArcAngle : Math.round(angleReductionFactor * arcAngle); sectDonutData.push({ startAngle: currAngle, endAngle: currAngle + arcAngle - this._config.explosionFactor, percentValue: percentValue, info: { name: sectBaseData[i].name, cssClass: sectBaseData[i].cssClass, value: sectBaseData[i].value } }); currAngle += arcAngle; if(currAngle >= 360) { break; } } if(i === sectBaseData.length - 1 && currAngle < 360) { currValue = sectBaseData[i].value; var arcAngle = 360 - currAngle; var percentValue = parseFloat((100 * currValue / this._totalValue).toFixed(2)); sectDonutData.push({ startAngle: currAngle, endAngle: currAngle + arcAngle - this._config.explosionFactor, percentValue: percentValue, info: { name: sectBaseData[i].name, cssClass: sectBaseData[i].cssClass, value: sectBaseData[i].value } }); currAngle += arcAngle; } } return sectDonutData; }; DonutChart.prototype.calculatePoints = function (sectDonutData) { var radius = this._config.radius; var labelRadius = this._config.radius + (this._config.strokeWidth / 2) + this._labelOffset; var sectDonutPoints = []; var anchor; for(var i = 0; i < sectDonutData.length; i++) { var sAngle = sectDonutData[i].startAngle; var eAngle = sectDonutData[i].endAngle; var midAngle = (sectDonutData.length === 1) ? 0 : (sAngle + eAngle) / 2; var sx = radius * Math.sin(sAngle * Math.PI / 180); var sy = radius * Math.cos(sAngle * Math.PI / 180) * -1; var ex = radius * Math.sin(eAngle * Math.PI / 180); var ey = radius * Math.cos(eAngle * Math.PI / 180) * -1; if(midAngle < 180 && midAngle > 0) { labelRadius = (sectDonutData[i].percentValue > 9) ? labelRadius + (this._textFontPx / 2) : labelRadius; anchor = "start"; } else if(midAngle > 180) { anchor = "end"; } else { anchor = "middle"; } var tx = labelRadius * Math.sin(midAngle * Math.PI / 180); var ty = labelRadius * Math.cos(midAngle * Math.PI / 180) * -1; var largeArcFlag = (eAngle - sAngle) > 180 ? 1 : 0; var sweepFlag = (this._config.clockwiseRotation) ? 1 : 0; sectDonutPoints.push({ startPoint: { x: sx, y: sy }, endPoint: { x: ex, y: ey }, label: { point: { x: tx, y: ty }, anchor: anchor }, percentValue: sectDonutData[i].percentValue, largeArc: largeArcFlag, sweepFlag: sweepFlag, info: sectDonutData[i].info }); } return sectDonutPoints; }; DonutChart.prototype.createDivContainer = function () { var div = document.createElement('div'); div.style.width = "100%"; div.style.height = "100%"; return div; }; DonutChart.prototype.createSVG = function () { var svg = document.createElementNS(DonutChart.SvgNS, "svg"); svg.setAttribute("version", "1.1"); svg.setAttribute("width", this._config.containerWidth + "px"); svg.setAttribute("height", this._config.containerHeight + "px"); svg.setAttribute("focusable", "false"); return svg; }; DonutChart.prototype.createSVGPath = function (cssClass, dAttribute, strokeWidth, sectorDonutPoint) { var _this = this; var path = document.createElementNS(DonutChart.SvgNS, "path"); path.setAttribute("class", cssClass); path.setAttribute("d", dAttribute); path.setAttribute("stroke-width", strokeWidth.toString()); if(this._renderTooltipCallback) { path.onmouseover = function () { return _this.showToolTip(sectorDonutPoint.info, sectorDonutPoint.percentValue); }; path.onmouseout = Plugin.Tooltip.dismiss; } if(this._addSectorAriaLabelCallback) { this._addSectorAriaLabelCallback(sectorDonutPoint.info, sectorDonutPoint.percentValue); } return path; }; DonutChart.prototype.createSVGText = function (xPosition, yPosition, anchor, percentValue) { var text = document.createElementNS(DonutChart.SvgNS, "text"); text.setAttribute("x", xPosition.toString()); text.setAttribute("y", yPosition.toString()); text.setAttribute("text-anchor", anchor); text.setAttribute("style", "fill:" + this._svgTextColor + "; font: " + this._svgTextFontSize + " " + this._svgTextFont + ";"); text.textContent = Plugin.Resources.getString("InclusiveTimeSVGLabelString", Math.floor(percentValue)); return text; }; DonutChart.prototype.draw = function (sectDonutPoints) { if(typeof this._svg !== "undefined") { this._div.removeChild(this._svg); } this._svg = this.createSVG(); if(sectDonutPoints.length === 1) { var i = 0; var dPath = "M " + this._centerX + "," + this._centerY + " M " + (this._centerX + sectDonutPoints[i].startPoint.x) + ", " + (this._centerY + sectDonutPoints[i].startPoint.y) + " A " + this._config.radius + "," + this._config.radius + " 1 " + sectDonutPoints[i].largeArc + ", " + sectDonutPoints[i].sweepFlag + " " + (this._centerX + sectDonutPoints[i].startPoint.x) + "," + (this._centerY + sectDonutPoints[i].startPoint.y + this._config.radius * 2) + " A " + this._config.radius + "," + this._config.radius + " 1 " + sectDonutPoints[i].largeArc + ", " + sectDonutPoints[i].sweepFlag + " " + (this._centerX + sectDonutPoints[i].endPoint.x) + "," + (this._centerY + sectDonutPoints[i].endPoint.y); var arc = this.createSVGPath(sectDonutPoints[i].info.cssClass, dPath, this._config.strokeWidth, sectDonutPoints[i]); this._svg.appendChild(arc); var text = this.createSVGText(this._centerX + sectDonutPoints[i].label.point.x, this._centerY + sectDonutPoints[i].label.point.y, sectDonutPoints[i].label.anchor, sectDonutPoints[i].percentValue); this._svg.appendChild(text); } else if(sectDonutPoints.length > 1) { for(var i = 0; i < sectDonutPoints.length; i++) { var dPath = "M " + this._centerX + "," + this._centerY + " M " + (this._centerX + sectDonutPoints[i].startPoint.x) + ", " + (this._centerY + sectDonutPoints[i].startPoint.y) + " A " + this._config.radius + "," + this._config.radius + " 1 " + sectDonutPoints[i].largeArc + ", " + sectDonutPoints[i].sweepFlag + " " + (this._centerX + sectDonutPoints[i].endPoint.x) + "," + (this._centerY + sectDonutPoints[i].endPoint.y); var arc = this.createSVGPath(sectDonutPoints[i].info.cssClass, dPath, this._config.strokeWidth, sectDonutPoints[i]); this._svg.appendChild(arc); if(sectDonutPoints[i].percentValue > Math.round(this._config.minDonutArcAngle * 100 / 360)) { var text = this.createSVGText(this._centerX + sectDonutPoints[i].label.point.x, this._centerY + sectDonutPoints[i].label.point.y, sectDonutPoints[i].label.anchor, sectDonutPoints[i].percentValue); this._svg.appendChild(text); } } } this._div.appendChild(this._svg); }; DonutChart.prototype.getReductionFactor = function (sectBaseData) { var currAngle = 0; var i = 0; var angleDifference = 0; for(i = 0; i < sectBaseData.length; i++) { currAngle = Math.round(360 * sectBaseData[i].value / this._totalValue); angleDifference += (currAngle < this._config.minDonutArcAngle) ? this._config.minDonutArcAngle - currAngle : 0; } return (1 - angleDifference / 360); }; DonutChart.prototype.getResizedRadius = function (dimension) { return dimension / DonutChart.RadiusResizeFactor; }; DonutChart.prototype.getResizedWidth = function (dimension) { return dimension / DonutChart.WidthResizeFactor; }; DonutChart.prototype.getSectorIndex = function (sector) { for(var i = 0; i < this._sectBaseData.length; i++) { if(this._sectBaseData[i] === sector || (this._sectBaseData[i].name === sector.name && this._sectBaseData[i].cssClass === sector.cssClass && this._sectBaseData[i].value === sector.value)) { return i; } } return -1; }; DonutChart.prototype.resizeDimensions = function () { var smallDimension = (this._config.containerHeight > this._config.containerWidth) ? this._config.containerWidth : this._config.containerHeight; this._config.radius = this.getResizedRadius(smallDimension); this._config.strokeWidth = this.getResizedWidth(this._config.radius); }; DonutChart.prototype.showToolTip = function (sector, percentValue) { var toolTipContent = this._renderTooltipCallback(sector, percentValue); if(toolTipContent !== "" && toolTipContent !== null && typeof toolTipContent !== "undefined") { var config = { content: toolTipContent }; Plugin.Tooltip.show(config); } }; return DonutChart; })(); VisualProfiler.DonutChart = DonutChart; })(VisualProfiler || (VisualProfiler = {})); //@ sourceMappingURL=DonutChart.js.map // ItemContainer.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var VisualProfiler; (function (VisualProfiler) { "use strict"; var ItemContainer = (function (_super) { __extends(ItemContainer, _super); function ItemContainer() { var _this = this; _super.call(this, document.createElement("div")); this.rootElement.id = "itemContainer" + (ItemContainer._idCount++); this.rootElement.className = "itemContainer"; this.rootElement.tabIndex = -1; this.rootElement.addEventListener("focus", this.onFocus.bind(this)); this.rootElement.addEventListener("blur", this.onBlur.bind(this)); this.rootElement.addEventListener("click", this.onClick.bind(this)); this.rootElement.addEventListener("mouseover", function () { _this.rootElement.classList.add("itemContainerHover"); }); this.rootElement.addEventListener("mouseleave", function () { _this.rootElement.classList.remove("itemContainerHover"); }); } ItemContainer._selectedCssClass = "itemSelected"; ItemContainer._selectedActiveCssClass = "itemSelectedActive"; ItemContainer._idCount = 0; Object.defineProperty(ItemContainer.prototype, "id", { get: function () { if(this.item) { return this.item.id; } else { return null; } }, enumerable: true, configurable: true }); Object.defineProperty(ItemContainer.prototype, "isSelected", { get: function () { return this._isSelected; }, set: function (value) { if(this._isSelected !== value) { this._isSelected = value; this.updateStyle(); } }, enumerable: true, configurable: true }); Object.defineProperty(ItemContainer.prototype, "item", { get: function () { return this._item; }, set: function (value) { this._item = value; }, enumerable: true, configurable: true }); Object.defineProperty(ItemContainer.prototype, "template", { get: function () { return this._template; }, set: function (value) { this._template = value; }, enumerable: true, configurable: true }); Object.defineProperty(ItemContainer.prototype, "hasFocus", { get: function () { return this.id !== null && this.id === ItemContainer._focusedContainerId; }, set: function (value) { if(value) { ItemContainer._focusedContainerId = this.id; } else { ItemContainer._focusedContainerId = null; } }, enumerable: true, configurable: true }); ItemContainer.prototype.empty = function () { this.item = null; this._isSelected = null; this.rootElement.classList.remove("itemContainerHover"); }; ItemContainer.prototype.focus = function () { this._isSelected = true; this.hasFocus = true; this.updateStyle(); this.rootElement.focus(); }; ItemContainer.prototype.updateStyle = function () { if(this._isSelected) { if(this.hasFocus) { this.rootElement.classList.add(ItemContainer._selectedActiveCssClass); } else { this.rootElement.classList.add(ItemContainer._selectedCssClass); this.rootElement.classList.remove(ItemContainer._selectedActiveCssClass); } } else { this.rootElement.classList.remove(ItemContainer._selectedCssClass); this.rootElement.classList.remove(ItemContainer._selectedActiveCssClass); } }; ItemContainer.prototype.onBlur = function () { this.hasFocus = false; this.updateStyle(); }; ItemContainer.prototype.onClick = function (e) { if(this.clicked) { this.clicked(); e.stopImmediatePropagation(); } }; ItemContainer.prototype.onFocus = function () { this.hasFocus = true; this.updateStyle(); }; return ItemContainer; })(Common.Controls.Control); VisualProfiler.ItemContainer = ItemContainer; })(VisualProfiler || (VisualProfiler = {})); //@ sourceMappingURL=ItemContainer.js.map // ItemContainerGenerator.ts var VisualProfiler; (function (VisualProfiler) { "use strict"; var ItemContainerGenerator = (function () { function ItemContainerGenerator() { this._itemContainers = { }; this._unusedItemContainers = []; } Object.defineProperty(ItemContainerGenerator.prototype, "count", { get: function () { if(!this._dataSource) { return 0; } return this._dataSource.count; }, enumerable: true, configurable: true }); ItemContainerGenerator.prototype.setDataSource = function (dataSource) { if(this._dataSource !== dataSource) { this._dataSource = dataSource; this._currentIndex = null; this.recycleAll(); } }; ItemContainerGenerator.prototype.startAt = function (index) { if(!this._dataSource) { return; } if(isNaN(index) || index < 0 || index >= this._dataSource.count) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1036")); } this._currentIndex = index; this._dataSource.startAt(this._currentIndex); }; ItemContainerGenerator.prototype.stop = function () { if(!this._dataSource) { return; } this._currentIndex = null; this._dataSource.stop(); }; ItemContainerGenerator.prototype.getNext = function () { if(!this._dataSource) { return null; } if(this._currentIndex === null) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1057")); } var itemContainer = null; if(this._currentIndex < this._dataSource.count) { var item = this._dataSource.getNext(); if(item) { itemContainer = this._itemContainers[this._currentIndex]; if(!itemContainer) { itemContainer = this.getItemContainer(this._currentIndex, item); this._itemContainers[this._currentIndex] = itemContainer; } this._currentIndex += 1; } } return itemContainer; }; ItemContainerGenerator.prototype.getItemContainerFromItemId = function (itemId) { for(var key in this._itemContainers) { var itemContainer = this._itemContainers[key]; if(itemContainer.id === itemId) { return itemContainer; } } return null; }; ItemContainerGenerator.prototype.recycle = function (index) { var itemContainer = this._itemContainers[index]; if(itemContainer) { delete this._itemContainers[index]; itemContainer.empty(); this._unusedItemContainers.push(itemContainer); } }; ItemContainerGenerator.prototype.recycleAll = function () { for(var key in this._itemContainers) { var itemContainer = this._itemContainers[key]; if(itemContainer) { itemContainer.empty(); this._unusedItemContainers.push(itemContainer); } } this._itemContainers = { }; }; ItemContainerGenerator.prototype.getItemContainer = function (itemIndex, item) { var itemContainer; if(this._unusedItemContainers.length > 0) { itemContainer = this._unusedItemContainers.pop(); } else { itemContainer = new VisualProfiler.ItemContainer(); } itemContainer.item = item; return itemContainer; }; return ItemContainerGenerator; })(); VisualProfiler.ItemContainerGenerator = ItemContainerGenerator; })(VisualProfiler || (VisualProfiler = {})); //@ sourceMappingURL=ItemContainerGenerator.js.map // ElementRecyclerFactory.ts var VisualProfiler; (function (VisualProfiler) { "use strict"; var ElementRecyclerFactory = (function () { function ElementRecyclerFactory(container, elementCreator) { this._container = container; this._elementCreator = elementCreator; this._index = null; this._elements = []; this._recycledElements = []; } ElementRecyclerFactory.forDivWithClass = function forDivWithClass(container, className) { return new ElementRecyclerFactory(container, function () { var element = document.createElement("div"); element.className = className; return element; }); }; ElementRecyclerFactory.prototype.start = function () { this._index = 0; }; ElementRecyclerFactory.prototype.getNext = function () { if(this._index === null) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1035")); } var element = this._elements[this._index]; if(!element) { if(this._recycledElements.length > 0) { element = this._recycledElements.pop(); } else { element = this._elementCreator(); } this._elements.push(element); this._container.appendChild(element); } this._index++; return element; }; ElementRecyclerFactory.prototype.stop = function () { if(this._index === null) { return; } for(var i = this._elements.length - 1; i >= this._index; --i) { var element = this._elements.pop(); this._recycledElements.push(element); this._container.removeChild(element); } this._index = null; }; ElementRecyclerFactory.prototype.recycleAll = function () { for(var i = this._elements.length - 1; i >= 0; --i) { var element = this._elements.pop(); this._recycledElements.push(element); this._container.removeChild(element); } }; ElementRecyclerFactory.prototype.removeAll = function () { for(var i = this._elements.length - 1; i >= 0; --i) { var element = this._elements.pop(); this._container.removeChild(element); } this._elements = []; this._recycledElements = []; }; return ElementRecyclerFactory; })(); VisualProfiler.ElementRecyclerFactory = ElementRecyclerFactory; })(VisualProfiler || (VisualProfiler = {})); //@ sourceMappingURL=ElementRecyclerFactory.js.map // StackPanel.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var VisualProfiler; (function (VisualProfiler) { "use strict"; var StackPanel = (function (_super) { __extends(StackPanel, _super); function StackPanel(parentContainer) { _super.call(this, "stackPanelTemplate"); this._parentContainer = parentContainer; this._parentContainer.appendChild(this.rootElement); this._content = this.findElement("content"); this.children = { }; this._requestScrollToOffset = null; this.rootElement.addEventListener("scroll", this.onScroll.bind(this), true); VisualProfiler.Program.addEventListener(VisualProfiler.ProgramEvents.Resize, this.invalidateSizeCache.bind(this)); this._scrollTopCached = null; } Object.defineProperty(StackPanel.prototype, "content", { get: function () { return this._content; }, enumerable: true, configurable: true }); Object.defineProperty(StackPanel.prototype, "parentContainer", { get: function () { return this._parentContainer; }, enumerable: true, configurable: true }); Object.defineProperty(StackPanel.prototype, "rowHeight", { get: function () { if(!this._rowHeight) { var itemContainer = new VisualProfiler.ItemContainer(); this.content.appendChild(itemContainer.rootElement); this._rowHeight = itemContainer.rootElement.offsetHeight; this.content.removeChild(itemContainer.rootElement); } return this._rowHeight; }, enumerable: true, configurable: true }); Object.defineProperty(StackPanel.prototype, "viewportHeight", { get: function () { if(!this._viewportHeight) { this._viewportHeight = Math.floor(this._parentContainer.getBoundingClientRect().height); } return this._viewportHeight; }, enumerable: true, configurable: true }); Object.defineProperty(StackPanel.prototype, "viewportItemsCount", { get: function () { if(this.rowHeight === 0 || isNaN(this.rowHeight)) { return 0; } return Math.floor(this.viewportHeight / this.rowHeight); }, enumerable: true, configurable: true }); Object.defineProperty(StackPanel.prototype, "scrollHeight", { get: function () { return this.rootElement.scrollHeight; }, enumerable: true, configurable: true }); Object.defineProperty(StackPanel.prototype, "scrollTop", { get: function () { if(this._requestScrollToOffset !== null) { var offset = Math.min(this._requestScrollToOffset, this.scrollHeight - this.viewportHeight); offset = Math.max(0, offset); return offset; } return this.scrollTopCached; }, enumerable: true, configurable: true }); Object.defineProperty(StackPanel.prototype, "scrollTopCached", { get: function () { if(this._scrollTopCached === null) { this._scrollTopCached = this.rootElement.scrollTop; } return this._scrollTopCached; }, enumerable: true, configurable: true }); StackPanel.prototype.ensureVisible = function (visibleIndex) { var itemTop = visibleIndex * this.rowHeight; var itemBottom = itemTop + this.rowHeight; var viewportTop = this.scrollTop; var viewportBottom = viewportTop + this.viewportHeight; if(itemTop < viewportTop || itemBottom > viewportBottom) { var scrollToPos; if(itemTop < viewportTop) { scrollToPos = itemTop; } else { scrollToPos = itemBottom - this.viewportHeight; } this.scrollToOffset(scrollToPos); } }; StackPanel.prototype.getScrollViewportOffset = function (itemContainer) { var top = parseInt(itemContainer.rootElement.style.top); var scrollTop = this.scrollTop; var viewportHeight = this.viewportHeight; var viewportOffset = top - scrollTop; if(viewportOffset > 0 && viewportOffset <= viewportHeight - this.rowHeight) { return viewportOffset; } return 0; }; StackPanel.prototype.invalidate = function () { for(var key in this.children) { var itemContainer = this.children[key]; if(itemContainer) { this.templateBinder.unbind(itemContainer); } } this.itemContainerGenerator.recycleAll(); this.children = { }; }; StackPanel.prototype.invalidateSizeCache = function () { this._viewportHeight = null; this._rowHeight = 0; }; StackPanel.prototype.render = function () { if(this._isRendering) { return; } if(!this.templateBinder) { return; } this._isRendering = true; try { this.renderCoreOverride(); if(this._requestScrollToOffset !== null) { if(this.scrollTopCached !== this._requestScrollToOffset) { this._scrollTopCached = null; this.rootElement.scrollTop = this._requestScrollToOffset; } this._requestScrollToOffset = null; } }finally { this._isRendering = false; } }; StackPanel.prototype.renderCoreOverride = function () { var index = 0; this.itemContainerGenerator.startAt(0); var itemContainer = this.itemContainerGenerator.getNext(); while(itemContainer) { this.templateBinder.bind(itemContainer, index++); this.rootElement.appendChild(itemContainer.rootElement); itemContainer = this.itemContainerGenerator.getNext(); } this.itemContainerGenerator.stop(); }; StackPanel.prototype.scrollToIndex = function (visibleIndex, scrollOffset, postponeUntilRender) { if (typeof scrollOffset === "undefined") { scrollOffset = 0; } var position = visibleIndex * this.rowHeight + scrollOffset; this.scrollToOffset(position, postponeUntilRender); }; StackPanel.prototype.scrollToOffset = function (offset, postponeUntilRender) { if(postponeUntilRender) { this._requestScrollToOffset = offset; } else { this._requestScrollToOffset = null; this._scrollTopCached = null; this.rootElement.scrollTop = offset; this._skipNextOnScroll = true; this.render(); } }; StackPanel.prototype.onScroll = function (e) { this._scrollTopCached = null; if(this._skipNextOnScroll) { this._skipNextOnScroll = false; return; } this.render(); Notifications.notify(VisualProfiler.ResponsivenessNotifications.GridScrolled); VisualProfiler.Program.traceWriter.raiseEvent(Common.TraceEvents.Timeline_GridScrolled); }; return StackPanel; })(Common.Controls.TemplateControl); VisualProfiler.StackPanel = StackPanel; })(VisualProfiler || (VisualProfiler = {})); //@ sourceMappingURL=StackPanel.js.map // VirtualizingStackPanel.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var VisualProfiler; (function (VisualProfiler) { "use strict"; var VirtualizingStackPanel = (function (_super) { __extends(VirtualizingStackPanel, _super); function VirtualizingStackPanel(parentContainer) { _super.call(this, parentContainer); this._contentSizer = this.findElement("contentSizer"); this._firstVisibleItemIndex = 0; } Object.defineProperty(VirtualizingStackPanel.prototype, "actualHeight", { get: function () { return this.viewportHeight; }, enumerable: true, configurable: true }); Object.defineProperty(VirtualizingStackPanel.prototype, "scrollHeight", { get: function () { return this.virtualHeight; }, enumerable: true, configurable: true }); Object.defineProperty(VirtualizingStackPanel.prototype, "virtualHeight", { get: function () { return this.rowHeight * this.itemContainerGenerator.count; }, enumerable: true, configurable: true }); VirtualizingStackPanel.prototype.renderCoreOverride = function () { this.updateVirtualHeight(); var visibleItemsCount = Math.ceil(this.getVisibleItemsScrollFraction()); var firstVisibleItemIndexFractional = this.getFirstVisibleItemScrollFraction(); if(firstVisibleItemIndexFractional < this.itemContainerGenerator.count) { var overflowItemsCount = Math.ceil(visibleItemsCount / 4); var newFirstVisibleItemIndexFloor = Math.max(0, Math.floor(firstVisibleItemIndexFractional) - overflowItemsCount); var newFirstVisibleItemIndexCeiling = Math.max(0, Math.ceil(firstVisibleItemIndexFractional) - overflowItemsCount); var newLastVisibleItemIndex = Math.min(this.itemContainerGenerator.count - 1, Math.ceil(this.getFirstVisibleItemScrollFraction()) + visibleItemsCount + overflowItemsCount); for(var i = this._firstVisibleItemIndex; i < newFirstVisibleItemIndexFloor; ++i) { this.removeItemContainerByIndex(i); } for(var i = newLastVisibleItemIndex + 1; i <= this._lastVisibleItemIndex; ++i) { this.removeItemContainerByIndex(i); } this.itemContainerGenerator.startAt(newFirstVisibleItemIndexFloor); var firstChild = this.content.firstChild; for(var i = newFirstVisibleItemIndexFloor; i <= newLastVisibleItemIndex; ++i) { var itemContainer = this.itemContainerGenerator.getNext(); if(!itemContainer) { break; } this.templateBinder.bind(itemContainer, i); itemContainer.rootElement.style.top = (i * this.rowHeight) + "px"; if(this.children[i.toString()] !== itemContainer) { if(!this.content.contains(itemContainer.rootElement)) { this.content.appendChild(itemContainer.rootElement); } this.children[i.toString()] = itemContainer; } } this.itemContainerGenerator.stop(); this._firstVisibleItemIndex = newFirstVisibleItemIndexFloor; this._lastVisibleItemIndex = newLastVisibleItemIndex; } this.removeOrphanElements(); }; VirtualizingStackPanel.prototype.getFirstVisibleItemScrollFraction = function () { return this.scrollTop / this.rowHeight; }; VirtualizingStackPanel.prototype.getVisibleItemsScrollFraction = function () { return this.viewportHeight / this.rowHeight; }; VirtualizingStackPanel.prototype.removeItemContainerByIndex = function (index) { var itemContainer = this.children[index.toString()]; delete this.children[index.toString()]; if(itemContainer) { this.templateBinder.unbind(itemContainer); } this.itemContainerGenerator.recycle(index); }; VirtualizingStackPanel.prototype.removeOrphanElements = function () { var map = { }; for(var key in this.children) { var child = this.children[key]; map[child.rootElement.id] = true; } for(var elementIndex = this.content.children.length - 1; elementIndex >= 0; --elementIndex) { var element = this.content.children[elementIndex]; if(!map[element.id]) { this.content.removeChild(element); } } }; VirtualizingStackPanel.prototype.updateVirtualHeight = function () { this._contentSizer.style.top = this.virtualHeight + "px"; }; return VirtualizingStackPanel; })(VisualProfiler.StackPanel); VisualProfiler.VirtualizingStackPanel = VirtualizingStackPanel; })(VisualProfiler || (VisualProfiler = {})); //@ sourceMappingURL=VirtualizingStackPanel.js.map // Ruler.ts var VisualProfiler; (function (VisualProfiler) { "use strict"; (function (Graph) { (function (TickMarkType) { TickMarkType._map = []; TickMarkType.Big = 0; TickMarkType.Medium = 1; TickMarkType.Small = 2; })(Graph.TickMarkType || (Graph.TickMarkType = {})); var TickMarkType = Graph.TickMarkType; (function (MarkType) { MarkType._map = []; MarkType.LifeCycleEvent = 1; MarkType.UserMark = 2; })(Graph.MarkType || (Graph.MarkType = {})); var MarkType = Graph.MarkType; var RulerConfig = (function () { function RulerConfig(containerId) { this.containerId = "rulerContainer"; this.className = "ruler-container"; this.id = ""; this.doubleSlider = { containerId: "sliderContainer", className: "ruler-body", id: "rulerBody", height: 1.8, events: [ RulerEvents.Filter, RulerEvents.Zoom ], leftSlider: { left: 0, width: 5, className: "ruler-slider" }, rightSlider: { left: 0, width: 5, className: "ruler-slider" }, bar: { className: "ruler-bar", id: "rulerBar", left: 40, right: 40 }, timeRange: new VisualProfiler.TimeSpan(), step: 1, markSeries: [], minimumRangeInPixel: 10, minimumZoomLevelMsec: 50 }; this.header = { containerId: "rulerHeaderContainer", className: "ruler-header", titleConfig: { containerId: "rulerTitleContainer", className: "ruler-title-container", text: "Diagnostic session", isExpanded: true, description: "" }, legendConfig: { containerId: "rulerLegendContainer", className: "ruler-legend-container", data: [] } }; if(containerId) { this.containerId = containerId; } else { throw new Error(Plugin.Resources.getErrorString("JSPerf.1051")); } } return RulerConfig; })(); Graph.RulerConfig = RulerConfig; var RulerEvents = (function () { function RulerEvents() { } Object.defineProperty(RulerEvents, "Filter", { get: function () { return "filterTimeRange"; }, enumerable: true, configurable: true }); Object.defineProperty(RulerEvents, "Zoom", { get: function () { return "zoomTimeRange"; }, enumerable: true, configurable: true }); return RulerEvents; })(); Graph.RulerEvents = RulerEvents; var Ruler = (function () { function Ruler(config) { this._rulerAreaCss = "ruler-area"; if(config && config.containerId) { this._container = document.getElementById(config.containerId); if(this._container) { this._config = config; this.initialize(this._config); } else { throw new Error(Plugin.Resources.getErrorString("JSPerf.1051")); } } else { throw new Error(Plugin.Resources.getErrorString("JSPerf.1050")); } } Ruler.prototype.deinitialize = function () { if(this._doubleSlider) { this._doubleSlider.deinitialize(); } }; Ruler.prototype.focus = function () { this._doubleSlider.focus(); }; Ruler.prototype.initialize = function (object) { for(var property in object) { if(object[property] && (property === "id" || property === "containerId")) { object[property] += RulerUtilities.getRandomNumber(); } else if(typeof object[property] === "object" && property !== "data" && property !== "markSeries") { this.initialize(object[property]); } } }; Ruler.prototype.setTimeRange = function (timespan) { this._doubleSlider.setTimeRange(timespan); }; Ruler.prototype.zoomIn = function () { this._doubleSlider.onZoomIn(); }; Ruler.prototype.resetZoom = function () { this._doubleSlider.onResetZoom(); }; Ruler.prototype.clearSelection = function () { this._doubleSlider.clearSelection(); }; Ruler.prototype.addEventListener = function (eventType, func) { this._doubleSlider.addEventListener(eventType, func); }; Ruler.prototype.removeEventListener = function (eventType, func) { this._doubleSlider.removeEventListener(eventType, func); }; Ruler.prototype.setHandlePosition = function (timeRange) { this._doubleSlider.SliderHandlePosition = timeRange; }; Object.defineProperty(Ruler.prototype, "Series", { get: function () { return this._config.doubleSlider.markSeries; }, enumerable: true, configurable: true }); Ruler.prototype.render = function () { while(this._container.hasChildNodes()) { this._container.removeChild(this._container.firstChild); } this._container.className = this._config.className; this._header = document.createElement("div"); this._header.className = this._config.header.className; this._header.id = this._config.header.containerId; this._container.appendChild(this._header); this._body = document.createElement("div"); this._body.id = this._config.doubleSlider.containerId; this._body.style.height = this._config.doubleSlider.height + "em"; this._container.appendChild(this._body); var i = 0; for(i = 0; i < this._config.doubleSlider.markSeries.length; i++) { var series = this._config.doubleSlider.markSeries[i]; series.index = i; series.type = series.type || MarkType.LifeCycleEvent; this._config.header.legendConfig.data.push({ text: series.label, type: series.type, tooltip: series.tooltip }); } this._config.header.titleConfig.description = RulerUtilities.formatTitleTime(this._config.doubleSlider.timeRange.elapsed, UnitFormat.fullName); var header = new RulerHeader(this._config.header); header.render(); this._doubleSlider = new DoubleSlider(this._config.doubleSlider); this._doubleSlider.render(); }; Ruler.prototype.addMark = function (id, markData) { if(this._doubleSlider) { this._doubleSlider.addMark(id, markData); } }; return Ruler; })(); Graph.Ruler = Ruler; var DoubleSlider = (function () { function DoubleSlider(config) { this._containerOffsetWidth = null; this._focused = false; this._rulerUnselectedCss = "ruler-unselected"; this._rulerBodyCss = "ruler-body"; this._isZoomed = false; this._selectionPixelStartX = 0; this._selectionPixelWidth = 0; this._onResizeHandler = this.onResize.bind(this); if(config && config.containerId) { this._container = document.getElementById(config.containerId); if(this._container) { this._config = config; this.initialize(); } else { throw new Error(Plugin.Resources.getErrorString("JSPerf.1051")); } } else { throw new Error(Plugin.Resources.getErrorString("JSPerf.1050")); } } DoubleSlider.prototype.deinitialize = function () { VisualProfiler.Program.removeEventListener(VisualProfiler.ProgramEvents.Resize, this._onResizeHandler); if(this._scale) { this._scale.deinitialize(); } }; DoubleSlider.prototype.focus = function () { this._container.focus(); }; Object.defineProperty(DoubleSlider.prototype, "containerOffsetWidth", { get: function () { if(this._containerOffsetWidth === null) { this._containerOffsetWidth = this._container.offsetWidth; } return this._containerOffsetWidth; }, enumerable: true, configurable: true }); DoubleSlider.prototype.initialize = function () { this._publisher = new Common.Publisher(this._config.events); VisualProfiler.Program.addEventListener(VisualProfiler.ProgramEvents.Resize, this._onResizeHandler); this._currentTimeRange = this._config.timeRange; this._originalTimeRange = this._currentTimeRange; this._handlePosition = this._currentTimeRange; this.raiseFilterEvent(this._handlePosition, this.getCommandsStatus()); this._tabFocus = this.onTabFocus.bind(this); this._tabBlur = this.onTabBlur.bind(this); this._keyDown = this.onKeyDown.bind(this); this._keyUp = this.onKeyUp.bind(this); this._mouseMoveListener = this.onMouseMove.bind(this); this._mouseUpListener = this.onMouseUp.bind(this); this._startSelection = this.onStartSelection.bind(this); this._onDrag = this.onDrag.bind(this); this._container.addEventListener("mousedown", this._startSelection); }; DoubleSlider.prototype.raiseFilterEvent = function (position, commandsStatus, isIntermittent) { if (typeof isIntermittent === "undefined") { isIntermittent = false; } var args = { type: RulerEvents.Filter, data: { position: position, isIntermittent: isIntermittent, commandsStatus: commandsStatus } }; this._publisher.invokeListener(args); }; DoubleSlider.prototype.raiseZoomEvent = function (selection, commandsStatus) { var args = { type: RulerEvents.Zoom, data: { selection: selection, commandsStatus: commandsStatus } }; this._publisher.invokeListener(args); }; DoubleSlider.prototype.getCommandsStatus = function () { return { isZoomInEnabled: this.getZoomInButtonState(), isResetZoomEnabled: this.getResetZoomButtonState(), isClearSelectionEnabled: this.getClearSelectionButtonState() }; }; DoubleSlider.prototype.getZoomInButtonState = function () { var isEnabled = true; if(this._handlePosition.elapsed.msec < this._config.minimumZoomLevelMsec || this._handlePosition.equals(this._currentTimeRange)) { isEnabled = false; } return isEnabled; }; DoubleSlider.prototype.getResetZoomButtonState = function () { var isEnabled = false; if(!this._originalTimeRange.equals(this._currentTimeRange)) { isEnabled = true; } return isEnabled; }; DoubleSlider.prototype.getClearSelectionButtonState = function () { var isEnabled = false; if(!this._handlePosition.equals(this._currentTimeRange)) { isEnabled = true; } return isEnabled; }; DoubleSlider.prototype.renderRulerBar = function () { this._bar = document.createElement("div"); this._bar.id = this._config.bar.id; this._bar.className = this._config.bar.className; this._bar.style.left = (this._config.bar.left) + "px"; this._bar.style.width = (this.containerOffsetWidth - this._config.bar.left - this._config.bar.right) + "px"; this._container.appendChild(this._bar); }; DoubleSlider.prototype.renderRulerScale = function () { var config = { timeRange: this._currentTimeRange, containerId: this._bar.id, series: this._config.markSeries }; this._scale = new VisualProfiler.Graph.RulerScale(config); this._scale.render(); this.setAriaLabelForRuler(); this.setAriaLabelForSliders(); }; DoubleSlider.prototype.renderLeftSliderHandle = function () { this._lSlider = document.createElement("div"); this._lSlider.className = this._config.leftSlider.className; this._lSlider.style.width = this._config.leftSlider.width + "px"; var sliderLeft = this._config.bar.left - this._config.leftSlider.width; this._lSlider.style.left = sliderLeft + "px"; this._lSlider.tabIndex = 0; this._container.appendChild(this._lSlider); this._config.leftSlider.left = sliderLeft; this._lSlider.addEventListener("mousedown", this.mouseDown.bind(this)); this._lSlider.addEventListener("focus", this._tabFocus); this._lSlider.addEventListener("blur", this._tabBlur); this.setAriaLabelForLeftSlider(); this._lUnselectedRegion = document.createElement("div"); this._lUnselectedRegion.className = this._rulerUnselectedCss; this._lUnselectedRegion.style.width = "0px"; this._lUnselectedRegion.style.left = this._config.bar.left + "px"; this._container.appendChild(this._lUnselectedRegion); }; DoubleSlider.prototype.setAriaLabelForLeftSlider = function () { if(this._lSlider) { this._lSlider.setAttribute("role", "slider"); this._lSlider.setAttribute("aria-label", Plugin.Resources.getString("RulerLeftSliderAriaLabel")); var label = Plugin.Resources.getString("RulerSliderAriaValueText", RulerUtilities.formatTime(this._handlePosition.begin, UnitFormat.fullName), RulerUtilities.formatTime(this._currentTimeRange.begin, UnitFormat.fullName), RulerUtilities.formatTime(this._handlePosition.end, UnitFormat.fullName)); this._lSlider.setAttribute("aria-valuetext", label); this._lSlider.setAttribute("aria-valuenow", this._handlePosition.begin.sec.toString()); this._lSlider.setAttribute("aria-valuemin", this._currentTimeRange.begin.sec.toString()); this._lSlider.setAttribute("aria-valuemax", this._handlePosition.end.sec.toString()); } }; DoubleSlider.prototype.setAriaLabelForRightSlider = function () { if(this._rSlider) { this._rSlider.setAttribute("role", "slider"); this._rSlider.setAttribute("aria-label", Plugin.Resources.getString("RulerRightSliderAriaLabel")); var label = Plugin.Resources.getString("RulerSliderAriaValueText", RulerUtilities.formatTime(this._handlePosition.end, UnitFormat.fullName), RulerUtilities.formatTime(this._handlePosition.begin, UnitFormat.fullName), RulerUtilities.formatTime(this._currentTimeRange.end, UnitFormat.fullName)); this._rSlider.setAttribute("aria-valuetext", label); this._rSlider.setAttribute("aria-valuenow", this._handlePosition.end.sec.toString()); this._rSlider.setAttribute("aria-valuemin", this._handlePosition.begin.sec.toString()); this._rSlider.setAttribute("aria-valuemax", this._currentTimeRange.end.sec.toString()); } }; DoubleSlider.prototype.setAriaLabelForSliders = function () { this.setAriaLabelForLeftSlider(); this.setAriaLabelForRightSlider(); }; DoubleSlider.prototype.renderRightSliderHandle = function () { this._rSlider = document.createElement("div"); this._rSlider.className = this._config.rightSlider.className; this._rSlider.style.width = this._config.rightSlider.width + "px"; var sliderLeft = this.containerOffsetWidth - this._config.bar.right; this._rSlider.style.left = sliderLeft + "px"; this._rSlider.tabIndex = 0; this._container.appendChild(this._rSlider); this._config.rightSlider.left = sliderLeft; this._rSlider.addEventListener("mousedown", this.mouseDown.bind(this)); this._rSlider.addEventListener("focus", this._tabFocus); this._rSlider.addEventListener("blur", this._tabBlur); this.setAriaLabelForRightSlider(); this._rUnselectedRegion = document.createElement("div"); this._rUnselectedRegion.className = this._rulerUnselectedCss; this._rUnselectedRegion.style.width = "0px"; this._rUnselectedRegion.style.left = sliderLeft + "px"; this._container.appendChild(this._rUnselectedRegion); }; DoubleSlider.prototype.onResize = function (e) { this.invalidateSizeCache(); var newRulerBarWidth = this.containerOffsetWidth - this._config.bar.left - this._config.bar.right; this._bar.style.width = newRulerBarWidth + "px"; var lValue = this.convertToPixel(this._handlePosition.begin); var rValue = this.convertToPixel(this._handlePosition.end); var positionChanged = false; if(rValue - lValue < this._config.minimumRangeInPixel) { if(lValue + this._config.minimumRangeInPixel <= newRulerBarWidth) { rValue = lValue + this._config.minimumRangeInPixel; positionChanged = true; } else if(rValue - this._config.minimumRangeInPixel >= 0) { lValue = rValue - this._config.minimumRangeInPixel; positionChanged = true; } } var lSliderLeft = lValue - this._config.leftSlider.width + this._config.bar.left; this._lSlider.style.left = lSliderLeft + "px"; this._config.leftSlider.left = lSliderLeft; this._lUnselectedRegion.style.width = lValue + "px"; var rSliderLeft = rValue + this._config.bar.left; this._rSlider.style.left = rSliderLeft + "px"; this._config.rightSlider.left = rSliderLeft; this._rUnselectedRegion.style.left = rSliderLeft + "px"; this._rUnselectedRegion.style.width = Math.ceil(this.containerOffsetWidth - rSliderLeft - this._config.bar.right) + "px"; if(positionChanged) { this._handlePosition = new VisualProfiler.TimeSpan(this.convertToTime(lValue), this.convertToTime(rValue)); this.raiseFilterEvent(this._handlePosition, this.getCommandsStatus(), true); this.setAriaLabelForSliders(); } }; DoubleSlider.prototype.onTabFocus = function (e) { if(e.srcElement === this._lSlider) { this._currentSlider = this._lSlider; this._lSlider.addEventListener("keydown", this._keyDown, false); this._lSlider.addEventListener("keyup", this._keyUp, false); } else if(e.srcElement === this._rSlider) { this._currentSlider = this._rSlider; this._rSlider.addEventListener("keydown", this._keyDown, false); this._rSlider.addEventListener("keyup", this._keyUp, false); } this._focused = true; }; DoubleSlider.prototype.onTabBlur = function (e) { if(e.srcElement === this._lSlider) { this._lSlider.removeEventListener("keydown", this._keyDown, false); this._lSlider.removeEventListener("keyup", this._keyUp, false); } else if(e.srcElement === this._rSlider) { this._rSlider.removeEventListener("keydown", this._keyDown, false); this._rSlider.removeEventListener("keyup", this._keyUp, false); } this._currentSlider = null; this._focused = false; }; DoubleSlider.prototype.onKeyDown = function (e) { this.handleKeyEvent(e, true); }; DoubleSlider.prototype.onKeyUp = function (e) { this.handleKeyEvent(e, false); }; DoubleSlider.prototype.handleKeyEvent = function (e, isDown) { var isIntermittent = isDown; if(this._focused && e.keyCode === Common.KeyCodes.ARROW_LEFT) { if(e.srcElement === this._lSlider) { this.setHandlePosition(parseFloat(this._lSlider.style.left) - this._config.step, isIntermittent); } else if(e.srcElement === this._rSlider) { this.setHandlePosition(parseFloat(this._rSlider.style.left) - this._config.step, isIntermittent); } } if(this._focused && e.keyCode === Common.KeyCodes.ARROW_RIGHT) { if(e.srcElement === this._lSlider) { this.setHandlePosition(parseFloat(this._lSlider.style.left) + this._config.step, isIntermittent); } else if(e.srcElement === this._rSlider) { this.setHandlePosition(parseFloat(this._rSlider.style.left) + this._config.step, isIntermittent); } } }; DoubleSlider.prototype.mouseDown = function (e) { var rect = this._container.getBoundingClientRect(); var root = document.documentElement; var x = e.clientX - rect.left - root.scrollLeft; if(x >= parseFloat(this._lSlider.style.left) && x <= parseFloat(this._lSlider.style.left) + parseFloat(this._lSlider.style.width)) { this._currentSlider = this._lSlider; } else if(x >= parseFloat(this._rSlider.style.left) && x <= parseFloat(this._rSlider.style.left) + parseFloat(this._rSlider.style.width)) { this._currentSlider = this._rSlider; } if(this._currentSlider) { document.addEventListener("mousemove", this._mouseMoveListener, false); document.addEventListener("mouseup", this._mouseUpListener, false); } return false; }; DoubleSlider.prototype.setHandlePosition = function (position, isIntermittent) { if(this._currentSlider) { var handle; if(this._currentSlider === this._lSlider && (parseFloat(this._rSlider.style.left) - position - this._config.leftSlider.width) >= this._config.minimumRangeInPixel) { if(position >= this._config.bar.left - this._config.leftSlider.width && position <= parseFloat(this._rSlider.style.left) - parseFloat(this._lSlider.style.width)) { this._currentSlider.style.left = position + "px"; this._lUnselectedRegion.style.width = position - this._config.bar.left + "px"; this._config.leftSlider.left = position; handle = new VisualProfiler.TimeSpan(this.convertToTime(position + this._config.leftSlider.width - this._config.bar.left), this._handlePosition.end); } else if(position < this._config.bar.left) { this._currentSlider.style.left = this._config.bar.left - this._config.leftSlider.width + "px"; this._lUnselectedRegion.style.width = "0px"; this._config.leftSlider.left = this._config.bar.left - this._config.leftSlider.width; handle = new VisualProfiler.TimeSpan(this._currentTimeRange.begin, this._handlePosition.end); } } else if(this._currentSlider === this._rSlider && (position - parseFloat(this._lSlider.style.left) - this._config.leftSlider.width) >= this._config.minimumRangeInPixel) { if(position <= this.containerOffsetWidth - this._config.bar.right && position >= parseFloat(this._lSlider.style.left) + parseFloat(this._lSlider.style.width)) { this._currentSlider.style.left = position + "px"; this._rUnselectedRegion.style.left = position + "px"; this._rUnselectedRegion.style.width = Math.ceil(this.containerOffsetWidth - this._config.bar.right - position) + "px"; this._config.rightSlider.left = position; handle = new VisualProfiler.TimeSpan(this._handlePosition.begin, this.convertToTime(position - this._config.bar.left)); } else if(position > this.containerOffsetWidth - this._config.bar.right) { this._currentSlider.style.left = this.containerOffsetWidth - this._config.bar.right + "px"; this._rUnselectedRegion.style.left = this.containerOffsetWidth - this._config.bar.right + "px"; this._rUnselectedRegion.style.width = "0px"; this._config.rightSlider.left = this.containerOffsetWidth - this._config.bar.right; handle = new VisualProfiler.TimeSpan(this._handlePosition.begin, this._currentTimeRange.end); } } if(handle) { this._handlePosition = handle; this.raiseFilterEvent(this._handlePosition, this.getCommandsStatus(), isIntermittent); } else if(!isIntermittent && this._handlePosition) { this.raiseFilterEvent(this._handlePosition, this.getCommandsStatus(), isIntermittent); } this.setAriaLabelForSliders(); } }; DoubleSlider.prototype.convertToTime = function (pixels) { var time = 0; if(this.containerOffsetWidth - this._config.bar.left - this._config.bar.right > 0) { time = this._currentTimeRange.begin.nsec + (pixels * this._currentTimeRange.elapsed.nsec) / (this.containerOffsetWidth - this._config.bar.left - this._config.bar.right); } return new VisualProfiler.TimeStamp(time); }; DoubleSlider.prototype.onMouseMove = function (e) { this.handleMouseEvent(e, true); }; DoubleSlider.prototype.onMouseUp = function (e) { this.handleMouseEvent(e, false); document.removeEventListener("mousemove", this._mouseMoveListener, false); document.removeEventListener("mouseup", this._mouseUpListener, false); if(!this._focused) { this._currentSlider = null; } }; DoubleSlider.prototype.handleMouseEvent = function (e, isMove) { var isIntermittent = isMove; var rect = this._container.getBoundingClientRect(); var root = document.documentElement; var mouseX = e.clientX - rect.left - root.scrollLeft; if(this._currentSlider && (mouseX < parseFloat(this._currentSlider.style.left) || mouseX > parseFloat(this._currentSlider.style.left) + parseFloat(this._currentSlider.style.width))) { this.setHandlePosition(mouseX, isIntermittent); } }; DoubleSlider.getDragDirection = function getDragDirection(selectionWidth) { if(selectionWidth > 0) { return VisualProfiler.DragDirection.right; } else if(selectionWidth < 0) { return VisualProfiler.DragDirection.left; } return VisualProfiler.DragDirection.none; }; DoubleSlider.prototype.checkIfMouseInsideValidSelectionArea = function (event) { var isValid = false; var rect = this._container.getBoundingClientRect(); var mouseX = event.clientX - rect.left - this._bar.offsetLeft; if(mouseX >= 0 && mouseX <= this._bar.clientWidth) { isValid = true; } return isValid; }; DoubleSlider.prototype.getSelectionStartWidth = function (event) { var rect = this._container.getBoundingClientRect(); var mouseX = event.clientX - rect.left - this._bar.offsetLeft; return mouseX; }; DoubleSlider.prototype.drawSelection = function () { this._lUnselectedRegion.style.width = this._selectionPixelStartX + "px"; this._lSlider.style.left = this._selectionPixelStartX - this._config.leftSlider.width + this._bar.offsetLeft + "px"; this._config.leftSlider.left = this._selectionPixelStartX + this._bar.offsetLeft; var left = this._selectionPixelStartX + this._selectionPixelWidth + this._bar.offsetLeft; this._rUnselectedRegion.style.left = left + "px"; this._rUnselectedRegion.style.width = (this._bar.clientWidth - this._selectionPixelStartX - this._selectionPixelWidth) + "px"; this._config.rightSlider.left = left; this._rSlider.style.left = left + "px"; if(this._dragDirection === VisualProfiler.DragDirection.left) { this._lSlider.focus(); } else { this._rSlider.focus(); } this._handlePosition = new VisualProfiler.TimeSpan(this.convertToTime(this._selectionPixelStartX), this.convertToTime(this._selectionPixelStartX + this._selectionPixelWidth)); }; DoubleSlider.prototype.ensureMinSelectionWidth = function () { if(typeof this._selectionPixelStartX === "undefined") { return; } if(Math.abs(this._selectionPixelWidth) < this._config.minimumRangeInPixel) { this._selectionPixelWidth = this._config.minimumRangeInPixel; switch(this._dragDirection) { case VisualProfiler.DragDirection.right: if(this._selectionPixelStartX + this._selectionPixelWidth > this._bar.clientWidth) { this._selectionPixelStartX = this._bar.clientWidth - this._selectionPixelWidth; } break; case VisualProfiler.DragDirection.left: if(this._selectionPixelStartX - this._selectionPixelWidth < 0) { this._selectionPixelStartX = 0; } else if(this._selectionPixelStartX + this._selectionPixelWidth > this._bar.clientWidth) { this._selectionPixelStartX = this._bar.clientWidth - this._selectionPixelWidth; } else { this._selectionPixelStartX = this._initialSelectionPixelStartX - this._selectionPixelWidth; } break; default: if(this._selectionPixelStartX + (this._selectionPixelWidth / 2) > this._bar.clientWidth) { this._selectionPixelStartX = this._bar.clientWidth - this._selectionPixelWidth; } else if(this._selectionPixelStartX - (this._selectionPixelWidth / 2) < 0) { this._selectionPixelStartX = 0; } else { this._selectionPixelStartX = this._selectionPixelStartX - (this._selectionPixelWidth / 2); } break; } } }; DoubleSlider.prototype.onStartSelection = function (event) { if((event.target !== this._lSlider && event.target !== this._rSlider) && this.checkIfMouseInsideValidSelectionArea(event)) { this._initialSelectionPixelStartX = this._selectionPixelStartX = this.getSelectionStartWidth(event); this._selectionPixelWidth = 0; this._dragDirection = DoubleSlider.getDragDirection(this._selectionPixelWidth); this._mouseupHandler = this.onStopSelection.bind(this); this._container.addEventListener("mousemove", this._onDrag); this._container.addEventListener("mouseup", this._mouseupHandler); this._container.setCapture(true); this.drawSelection(); } }; DoubleSlider.prototype.onStopSelection = function (event) { this._container.removeEventListener("mousemove", this._onDrag); this._container.removeEventListener("mouseup", this._mouseupHandler); this._container.releaseCapture(); this.ensureMinSelectionWidth(); this.drawSelection(); this.raiseFilterEvent(this._handlePosition, this.getCommandsStatus()); this.setAriaLabelForSliders(); this._dragDirection = VisualProfiler.DragDirection.none; }; DoubleSlider.prototype.onDrag = function (event) { if(this.checkIfMouseInsideValidSelectionArea(event)) { var xPixels = this.getSelectionStartWidth(event); this._dragDirection = DoubleSlider.getDragDirection(xPixels - this._initialSelectionPixelStartX); this._selectionPixelWidth = Math.abs(xPixels - this._initialSelectionPixelStartX); if(this._dragDirection === VisualProfiler.DragDirection.left) { this._selectionPixelStartX = this._initialSelectionPixelStartX - this._selectionPixelWidth; } this.drawSelection(); this.raiseFilterEvent(this._handlePosition, this.getCommandsStatus()); } }; DoubleSlider.prototype.resetHandlePosition = function () { this._lSlider.style.left = (this._config.bar.left - this._config.leftSlider.width) + "px"; this._config.leftSlider.left = (this._config.bar.left - this._config.leftSlider.width); this._lUnselectedRegion.style.width = "0px"; this._lUnselectedRegion.style.left = this._config.bar.left + "px"; var rSliderLeft = this.containerOffsetWidth - this._config.bar.right; this._rSlider.style.left = rSliderLeft + "px"; this._config.rightSlider.left = rSliderLeft; this._rUnselectedRegion.style.width = "0px"; this._rUnselectedRegion.style.left = rSliderLeft + "px"; }; DoubleSlider.prototype.resetScale = function () { this._scale.timeRange = this._currentTimeRange; this._scale.render(); this.setAriaLabelForRuler(); this.setAriaLabelForSliders(); }; DoubleSlider.prototype.convertToPixel = function (time) { var pixels = 0; if(this._currentTimeRange.elapsed.nsec > 0) { pixels = (time.nsec - this._currentTimeRange.begin.nsec) * (this.containerOffsetWidth - this._config.bar.left - this._config.bar.right) / this._currentTimeRange.elapsed.nsec; } return pixels; }; DoubleSlider.prototype.setAriaLabelForRuler = function () { if(this._container) { var label = Plugin.Resources.getString("RulerAriaLabel", RulerUtilities.formatTime(this._currentTimeRange.begin, UnitFormat.fullName), RulerUtilities.formatTime(this._currentTimeRange.end, UnitFormat.fullName)); this._container.setAttribute("aria-label", label); } }; DoubleSlider.prototype.addEventListener = function (eventType, func) { this._publisher.addEventListener(eventType, func); }; DoubleSlider.prototype.removeEventListener = function (eventType, func) { this._publisher.removeEventListener(eventType, func); }; DoubleSlider.prototype.clearSelection = function () { this._handlePosition = this._currentTimeRange; this.resetHandlePosition(); var commandsStatus = this.getCommandsStatus(); this.raiseZoomEvent(this._currentTimeRange, commandsStatus); this.raiseFilterEvent(this._handlePosition, commandsStatus); this.setAriaLabelForSliders(); }; Object.defineProperty(DoubleSlider.prototype, "SliderHandlePosition", { set: function (position) { if(position && (this._currentTimeRange.begin.nsec <= position.begin.nsec && this._currentTimeRange.end.nsec >= position.end.nsec) && (!this._handlePosition || !this._handlePosition.equals(position))) { this._handlePosition = position; var lSliderLeft = this.convertToPixel(this._handlePosition.begin) + this._config.bar.left - this._config.leftSlider.width; this._lSlider.style.left = lSliderLeft + "px"; this._config.leftSlider.left = lSliderLeft; this._lUnselectedRegion.style.width = lSliderLeft - this._config.bar.left + this._config.leftSlider.width + "px"; this._lUnselectedRegion.style.left = this._config.bar.left + "px"; var rSliderLeft = this.convertToPixel(this._handlePosition.end) + this._config.bar.left; this._rSlider.style.left = rSliderLeft + "px"; this._config.rightSlider.left = rSliderLeft; this._rUnselectedRegion.style.width = Math.ceil(this.containerOffsetWidth - rSliderLeft - this._config.bar.right) + "px"; this._rUnselectedRegion.style.left = rSliderLeft + "px"; this.raiseFilterEvent(this._handlePosition, this.getCommandsStatus()); this.setAriaLabelForSliders(); } }, enumerable: true, configurable: true }); DoubleSlider.prototype.setTimeRange = function (timespan) { this._currentTimeRange = timespan; this.resetScale(); }; DoubleSlider.prototype.onZoomIn = function () { if(this._handlePosition.elapsed.msec >= this._config.minimumZoomLevelMsec) { this._currentTimeRange = this._handlePosition; this.resetHandlePosition(); this.resetScale(); this.raiseZoomEvent(this._currentTimeRange, this.getCommandsStatus()); this.setAriaLabelForRuler(); this.setAriaLabelForSliders(); } }; DoubleSlider.prototype.onResetZoom = function () { this._currentTimeRange = this._originalTimeRange; var newRulerBarWidth = this.containerOffsetWidth - this._config.bar.left - this._config.bar.right; var lValue = this.convertToPixel(this._handlePosition.begin); var rValue = this.convertToPixel(this._handlePosition.end); if(rValue - lValue < this._config.minimumRangeInPixel) { var isNew = false; if(lValue + this._config.minimumRangeInPixel <= newRulerBarWidth) { rValue = lValue + this._config.minimumRangeInPixel; isNew = true; } else if(rValue - this._config.minimumRangeInPixel >= 0) { lValue = rValue - this._config.minimumRangeInPixel; isNew = true; } if(isNew) { this._handlePosition = new VisualProfiler.TimeSpan(this.convertToTime(lValue), this.convertToTime(rValue)); this.raiseFilterEvent(this._handlePosition, this.getCommandsStatus()); } } var lSliderLeft = lValue - this._config.leftSlider.width + this._config.bar.left; this._lSlider.style.left = lSliderLeft + "px"; this._config.leftSlider.left = lSliderLeft; this._lUnselectedRegion.style.width = lValue + "px"; var rSliderLeft = rValue + this._config.bar.left; this._rSlider.style.left = rSliderLeft + "px"; this._config.rightSlider.left = rSliderLeft; this._rUnselectedRegion.style.left = rSliderLeft + "px"; this._rUnselectedRegion.style.width = Math.ceil(this.containerOffsetWidth - rSliderLeft - this._config.bar.right) + "px"; this.resetScale(); this.raiseZoomEvent(this._currentTimeRange, this.getCommandsStatus()); this.setAriaLabelForRuler(); this.setAriaLabelForSliders(); }; DoubleSlider.prototype.invalidateSizeCache = function () { this._containerOffsetWidth = null; if(this._scale) { this._scale.invalidateSizeCache(); } }; DoubleSlider.prototype.render = function () { while(this._container.hasChildNodes()) { this._container.removeChild(this._container.firstChild); } this._container.className = this._config.className = this._rulerBodyCss; this._containerWidth = this.containerOffsetWidth; this._container.tabIndex = 0; this.renderRulerBar(); this.renderRulerScale(); this.renderLeftSliderHandle(); this.renderRightSliderHandle(); this.setAriaLabelForRuler(); }; DoubleSlider.prototype.addMark = function (id, markData) { if(this._scale) { this._scale.addMark(id, markData); } }; return DoubleSlider; })(); Graph.DoubleSlider = DoubleSlider; var MarkData = (function () { function MarkData(time, tooltipCallback) { this.time = time; this.getTooltipContent = tooltipCallback; } return MarkData; })(); Graph.MarkData = MarkData; var AggregatedMarkData = (function () { function AggregatedMarkData() { this._contentUpdateNeeded = true; this.marks = []; } AggregatedMarkData.prototype.updateData = function () { this._content = []; for(var i = 0; i < this.marks.length; i++) { if(this.marks[i].getTooltipContent && typeof this.marks[i].getTooltipContent() !== "undefined") { this._content.push(this.marks[i].getTooltipContent()); } } this._contentUpdateNeeded = false; }; AggregatedMarkData.prototype.getTooltipContent = function () { if(this._contentUpdateNeeded) { this.updateData(); } return this._content.join("\r\n"); }; AggregatedMarkData.prototype.getAriaContent = function () { if(this._contentUpdateNeeded) { this.updateData(); } return this._content.join(", "); }; AggregatedMarkData.prototype.length = function () { return this.marks.length; }; AggregatedMarkData.prototype.push = function (mark) { if(!this.time) { this.time = mark.time; } this.marks.push(mark); this._contentUpdateNeeded = true; }; return AggregatedMarkData; })(); Graph.AggregatedMarkData = AggregatedMarkData; var MarkSeries = (function () { function MarkSeries() { } return MarkSeries; })(); Graph.MarkSeries = MarkSeries; var RulerScale = (function () { function RulerScale(config) { this._containerOffsetWidth = null; this._scaleMainDivClientWidth = null; this._scaleMarksImageHeight = 4; this._rulerScaleTickmarkBigCss = "ruler-scale-tickmark-big"; this._rulerScaleTickmarkMediumCss = "ruler-scale-tickmark-medium"; this._rulerScaleTickmarkSmallCss = "ruler-scale-tickmark-small"; this._rulerScaleMarkImageAppEventCss = "ruler-scale-mark-image-appevent"; this._rulerScaleMarkImageUserMarkCss = "ruler-scale-mark-image-usermark"; this._rulerScaleLabelTextCss = "ruler-scale-label-text"; this._rulerScaleMainCss = "ruler-scale-main"; this._rulerScaleTickmarksCss = "ruler-scale-tickmarks"; this._rulerScaleMarkImagePositionCss = "ruler-scale-mark-image-position"; this._scaleMainDivBorderWidth = 1; this._minimumMarkDistance = 5; this._onResizeHandler = this.onResize.bind(this); if(config && config.containerId && config.timeRange) { this._timeRange = config.timeRange; this._container = document.getElementById(config.containerId); VisualProfiler.Program.addEventListener(VisualProfiler.ProgramEvents.Resize, this._onResizeHandler); this._seriesList = config.series; while(this._container.hasChildNodes()) { this._container.removeChild(this._container.firstChild); } } else { new Error(Plugin.Resources.getErrorString("JSPerf.1050")); } } RulerScale.prototype.deinitialize = function () { VisualProfiler.Program.removeEventListener(VisualProfiler.ProgramEvents.Resize, this._onResizeHandler); }; Object.defineProperty(RulerScale.prototype, "containerOffsetWidth", { get: function () { if(this._containerOffsetWidth === null) { this._containerOffsetWidth = this._container.offsetWidth; } return this._containerOffsetWidth; }, enumerable: true, configurable: true }); Object.defineProperty(RulerScale.prototype, "scaleMainDivClientWidth", { get: function () { if(this._scaleMainDivClientWidth === null) { this._scaleMainDivClientWidth = this._scaleMainDiv.clientWidth; } return this._scaleMainDivClientWidth; }, enumerable: true, configurable: true }); RulerScale.prototype.renderTickMarks = function () { this._scaleBigTickMarkElementsFactory.start(); this._scaleMediumTickMarkElementsFactory.start(); this._scaleSmallTickMarkElementsFactory.start(); this._scaleTickMarkLabelElementsFactory.start(); for(var i = 0; i < this._tickMarkList.length; i++) { var tick; switch(this._tickMarkList[i].type) { case TickMarkType.Big: tick = this._scaleBigTickMarkElementsFactory.getNext(); break; case TickMarkType.Medium: tick = this._scaleMediumTickMarkElementsFactory.getNext(); break; case TickMarkType.Small: tick = this._scaleSmallTickMarkElementsFactory.getNext(); break; } if(tick) { tick.style.left = this.calculateElementPosition(this._tickMarkList[i].value) + "px"; if(TickMarkType.Big === this._tickMarkList[i].type) { var label = this._scaleTickMarkLabelElementsFactory.getNext(); label.innerText = this._tickMarkList[i].label; label.style.left = parseFloat(tick.style.left) + 1 + "px"; } } } this._scaleBigTickMarkElementsFactory.stop(); this._scaleMediumTickMarkElementsFactory.stop(); this._scaleSmallTickMarkElementsFactory.stop(); this._scaleTickMarkLabelElementsFactory.stop(); this.renderMarks(); }; RulerScale.prototype.renderMarks = function () { var _this = this; if(this._scaleTickMarksDiv) { this.createAggregateMarkList(); this._scaleMarkAppEventElementsFactory.start(); this._scaleMarkUserElementsFactory.start(); if(this._data) { for(var j = 0; j < this._data.length; j++) { var mark = this._data[j]; if(mark && mark.time && mark.time.nsec >= this._timeRange.begin.nsec && mark.time.nsec <= this._timeRange.end.nsec) { (function (mark) { mark.type = mark.type || MarkType.LifeCycleEvent; var markDiv; if(!mark.type || mark.type === MarkType.LifeCycleEvent) { markDiv = _this._scaleMarkAppEventElementsFactory.getNext(); } else { markDiv = _this._scaleMarkUserElementsFactory.getNext(); } markDiv.style.left = mark.pixelPosition + "px"; markDiv.onmouseover = function () { return _this.showMarkTooltip(mark); }; markDiv.onmouseout = Plugin.Tooltip.dismiss; markDiv.onfocus = function () { markDiv.setAttribute("aria-label", Plugin.Resources.getString("RulerMarkLabel", mark.getAriaContent())); }; })(mark); } } } this._scaleMarkAppEventElementsFactory.stop(); this._scaleMarkUserElementsFactory.stop(); } }; RulerScale.prototype.createAggregateMarkList = function () { var seriesList = this._seriesList; this._data = []; if(this._seriesList) { for(var i = 0; i < seriesList.length; i++) { var seriesData = seriesList[i].data; if(!seriesData) { seriesData = []; } for(var j = 0; j < seriesData.length; j++) { var dataPoint = seriesData[j]; this.createAggregatedMark(dataPoint, seriesList[i].type); } } } }; RulerScale.prototype.createAggregatedMark = function (dataPoint, type) { var pixelPosition = this.calculateElementPosition(dataPoint.time) - this._scaleMarksImageHeight; var isNewPoint = true; var index = -1; for(var k = 0; k < this._data.length; k++) { if(pixelPosition <= this._data[k].pixelPosition + this._minimumMarkDistance && pixelPosition >= this._data[k].pixelPosition - this._minimumMarkDistance) { this._data[k].push(dataPoint); if(this._data[k].type !== type) { this._data[k].type = MarkType.UserMark; } isNewPoint = false; index = k; break; } } if(isNewPoint) { var data = new AggregatedMarkData(); data.push(dataPoint); data.type = type; data.pixelPosition = pixelPosition; this._data.push(data); index = this._data.length - 1; } return index; }; RulerScale.prototype.showMarkTooltip = function (mark) { var toolTipContent = mark.getTooltipContent(); if(toolTipContent) { var config = { content: toolTipContent }; Plugin.Tooltip.show(config); } }; RulerScale.prototype.createMarkVisual = function (className) { var markDiv = document.createElement("div"); markDiv.tabIndex = 0; markDiv.classList.add(className); markDiv.classList.add(this._rulerScaleMarkImagePositionCss); return markDiv; }; RulerScale.prototype.calculateElementPosition = function (time) { return Math.round((this.scaleMainDivClientWidth * (time.nsec - this._timeRange.begin.nsec) / this._timeRange.elapsed.nsec)); }; RulerScale.prototype.onResize = function () { var _this = this; window.setImmediate(function () { _this.invalidateSizeCache(); _this.render(); }); }; Object.defineProperty(RulerScale.prototype, "timeRange", { set: function (time) { this._timeRange = time; }, enumerable: true, configurable: true }); RulerScale.prototype.invalidateSizeCache = function () { this._containerOffsetWidth = null; this._scaleMainDivClientWidth = null; }; RulerScale.prototype.render = function () { var _this = this; if(this._container) { if(!this._scaleMainDiv) { this._scaleMainDiv = document.createElement("div"); this._scaleMainDiv.className = this._rulerScaleMainCss; VisualProfiler.Program.addEventListener(VisualProfiler.ProgramEvents.Resize, this._onResizeHandler); this._container.appendChild(this._scaleMainDiv); } if(!this._scaleTickMarksDiv) { this._scaleTickMarksDiv = document.createElement("div"); this._scaleTickMarksDiv.className = this._rulerScaleTickmarksCss; this._scaleMainDiv.appendChild(this._scaleTickMarksDiv); this._scaleBigTickMarkElementsFactory = VisualProfiler.ElementRecyclerFactory.forDivWithClass(this._scaleTickMarksDiv, this._rulerScaleTickmarkBigCss); this._scaleMediumTickMarkElementsFactory = VisualProfiler.ElementRecyclerFactory.forDivWithClass(this._scaleTickMarksDiv, this._rulerScaleTickmarkMediumCss); this._scaleSmallTickMarkElementsFactory = VisualProfiler.ElementRecyclerFactory.forDivWithClass(this._scaleTickMarksDiv, this._rulerScaleTickmarkSmallCss); this._scaleTickMarkLabelElementsFactory = VisualProfiler.ElementRecyclerFactory.forDivWithClass(this._scaleTickMarksDiv, this._rulerScaleLabelTextCss); this._scaleMarkAppEventElementsFactory = new VisualProfiler.ElementRecyclerFactory(this._scaleTickMarksDiv, function () { return _this.createMarkVisual(_this._rulerScaleMarkImageAppEventCss); }); this._scaleMarkUserElementsFactory = new VisualProfiler.ElementRecyclerFactory(this._scaleTickMarksDiv, function () { return _this.createMarkVisual(_this._rulerScaleMarkImageUserMarkCss); }); } this._tickMarkList = RulerUtilities.getTickMarksPosition(this._timeRange, this.containerOffsetWidth); this.renderTickMarks(); } }; RulerScale.prototype.addMark = function (id, markData) { if(this._seriesList && id && markData && markData.time && markData.time.nsec >= this._timeRange.begin.nsec && markData.time.nsec <= this._timeRange.end.nsec) { var series; for(var j = 0; j < this._seriesList.length; j++) { if(this._seriesList[j].id === id) { series = this._seriesList[j]; if(!series.data) { series.data = []; } series.data.push(markData); break; } } this.renderMarks(); } }; return RulerScale; })(); Graph.RulerScale = RulerScale; (function (UnitFormat) { UnitFormat._map = []; UnitFormat._map[0] = "italizedAbbreviations"; UnitFormat.italizedAbbreviations = 0; UnitFormat._map[1] = "fullName"; UnitFormat.fullName = 1; })(Graph.UnitFormat || (Graph.UnitFormat = {})); var UnitFormat = Graph.UnitFormat; var RulerUtilities = (function () { function RulerUtilities() { } RulerUtilities.counter = 0; RulerUtilities.OneMillisecond = 1000000; RulerUtilities.OneSecond = 1000 * 1000000; RulerUtilities.OneMinute = 60 * 1000 * 1000000; RulerUtilities.getRandomNumber = function getRandomNumber() { return RulerUtilities.counter++; }; RulerUtilities.getTickMarksPosition = function getTickMarksPosition(timeRange, width) { var rangeNsec = timeRange.elapsed.nsec; var beginNsec = timeRange.begin.nsec; var tickMarkList = []; var intervalDuration = Math.pow(10, Math.floor(Math.log(rangeNsec) / Math.LN10)); var intervalWidth = (width / rangeNsec) * intervalDuration; if(intervalWidth < 100) { if(intervalWidth < 25) { intervalDuration *= 8; } else if(intervalWidth < 50) { intervalDuration *= 4; } else if(intervalWidth < 100) { intervalDuration *= 2; } } else if(intervalWidth > 250) { if(intervalWidth < 400) { intervalDuration /= 2; } else if(intervalWidth < 800) { intervalDuration /= 4; } else if(intervalWidth < 1600) { intervalDuration /= 8; } else { intervalDuration /= 10; } } var smallTickDuration = intervalDuration / 10; var mediumTickDuration = intervalDuration / 2; intervalWidth = (width / rangeNsec) * intervalDuration; if(intervalWidth < 130) { smallTickDuration = intervalDuration / 5; } tickMarkList = RulerUtilities.generateTickMarks(timeRange, beginNsec - (beginNsec % intervalDuration), intervalDuration, mediumTickDuration, smallTickDuration); return tickMarkList; }; RulerUtilities.getVerticalLinePositions = function getVerticalLinePositions(timeRange, width) { var positions = []; var marks = RulerUtilities.getTickMarksPosition(timeRange, width); for(var i = 0; i < marks.length; ++i) { var mark = marks[i]; if(mark.type === TickMarkType.Big) { var position = (mark.value.nsec - timeRange.begin.nsec) / timeRange.elapsed.nsec * 100; positions.push(position); } } return positions; }; RulerUtilities.generateTickMarks = function generateTickMarks(timeRange, start, bigTick, mediumTick, step) { var tickMarkList = []; var beginNsec = timeRange.begin.nsec; var endNsec = timeRange.end.nsec; start = Math.round(VisualProfiler.TimeStamp.fromNanoseconds(start).nsec); bigTick = Math.round(VisualProfiler.TimeStamp.fromNanoseconds(bigTick).nsec); mediumTick = Math.round(VisualProfiler.TimeStamp.fromNanoseconds(mediumTick).nsec); step = Math.round(VisualProfiler.TimeStamp.fromNanoseconds(step).nsec); for(var i = start; i < endNsec; i += step) { if(i > beginNsec) { var tickMarkTime = VisualProfiler.TimeStamp.fromNanoseconds(i); if(!isNaN(i % bigTick) && i % bigTick === 0) { tickMarkList.push({ type: TickMarkType.Big, value: tickMarkTime, label: RulerUtilities.formatTime(tickMarkTime) }); } else if(!isNaN(i % mediumTick) && i % mediumTick === 0) { tickMarkList.push({ type: TickMarkType.Medium, value: tickMarkTime, label: RulerUtilities.formatTime(tickMarkTime) }); } else { tickMarkList.push({ type: TickMarkType.Small, value: tickMarkTime, label: RulerUtilities.formatTime(tickMarkTime) }); } } } return tickMarkList; }; RulerUtilities.formatTime = function formatTime(value, unitFormat) { if (typeof unitFormat === "undefined") { unitFormat = UnitFormat.italizedAbbreviations; } var splitTime = RulerUtilities.getSplittedTime(value); var valueNs = Math.floor(value.nsec); var time = "0"; var nf = RulerUtilities.getNumberFormat(); if(splitTime.minutes) { if(!splitTime.seconds && !splitTime.milliseconds && !splitTime.nanoseconds) { time = splitTime.minString + ":00"; } else if(!splitTime.milliseconds && !splitTime.nanoseconds) { time = splitTime.minString + ":" + splitTime.secString; } else if(!splitTime.nanoseconds) { splitTime.msString = splitTime.msString.replace(/0*$/, ""); time = splitTime.minString + ":" + splitTime.secString + nf.numberDecimalSeparator + splitTime.msString; } else { splitTime.nsString = splitTime.nsString.replace(/0*$/, ""); time = splitTime.minString + ":" + splitTime.secString + nf.numberDecimalSeparator + splitTime.msString + splitTime.nsString; } } else if(splitTime.seconds) { if(!splitTime.milliseconds && !splitTime.nanoseconds) { time = splitTime.secString; } else if(!splitTime.nanoseconds) { splitTime.msString = splitTime.msString.replace(/0*$/, ""); time = splitTime.secString + nf.numberDecimalSeparator + splitTime.msString; } else { splitTime.nsString = splitTime.nsString.replace(/0*$/, ""); time = splitTime.secString + nf.numberDecimalSeparator + splitTime.msString + splitTime.nsString; } } else if(splitTime.milliseconds) { if(!splitTime.nanoseconds) { time = splitTime.msString; } else { splitTime.nsString = splitTime.nsString.replace(/0*$/, ""); time = splitTime.msString + nf.numberDecimalSeparator + splitTime.nsString; } } else if(splitTime.nanoseconds) { splitTime.nsString = splitTime.nsString.replace(/0*$/, ""); time = "0" + nf.numberDecimalSeparator + splitTime.nsString; } var unit = RulerUtilities.getUnit(valueNs, unitFormat); return time + unit; }; RulerUtilities.formatTitleTime = function formatTitleTime(value, unitFormat) { if (typeof unitFormat === "undefined") { unitFormat = UnitFormat.fullName; } var splitTime = RulerUtilities.getSplittedTime(value); var valueNs = Math.floor(value.nsec); var time = "0"; var nf = RulerUtilities.getNumberFormat(); if(splitTime.minutes) { if(!splitTime.seconds) { time = splitTime.minString + ":00"; } else { time = splitTime.minString + ":" + splitTime.secString; } } else if(splitTime.seconds) { if(!splitTime.milliseconds) { time = splitTime.secString; } else { splitTime.msString = splitTime.msString.replace(/0*$/, ""); time = splitTime.secString + nf.numberDecimalSeparator + splitTime.msString; } } else if(splitTime.milliseconds) { if(!splitTime.nanoseconds) { time = splitTime.msString; } else { splitTime.nsString = splitTime.nsString.replace(/0*$/, ""); time = splitTime.msString + nf.numberDecimalSeparator + splitTime.nsString; } } else if(splitTime.nanoseconds) { splitTime.nsString = splitTime.nsString.replace(/0*$/, ""); time = "0" + nf.numberDecimalSeparator + splitTime.nsString; } var unit = RulerUtilities.getUnit(valueNs, unitFormat); return time + unit; }; RulerUtilities.getUnit = function getUnit(valueNs, unitFormat) { var units = this.getUnits(unitFormat); var unit; if(valueNs < RulerUtilities.OneSecond) { unit = units.milliseconds; } else if(valueNs < RulerUtilities.OneMinute) { unit = units.seconds; } else { unit = units.minutes; } return unit; }; RulerUtilities.getUnits = function getUnits(unitFormat) { var unitLabelFormat; if(unitFormat === UnitFormat.fullName) { unitLabelFormat = { milliseconds: " " + Plugin.Resources.getString("MillisecondsLabel"), seconds: " " + Plugin.Resources.getString("SecondsLabel"), minutes: " " + Plugin.Resources.getString("MinutesLabel") }; } else { unitLabelFormat = { milliseconds: Plugin.Resources.getString("MillisecondsAbbreviation"), seconds: Plugin.Resources.getString("SecondsAbbreviation"), minutes: Plugin.Resources.getString("MinutesAbbreviation") }; } return unitLabelFormat; }; RulerUtilities.getSplittedTime = function getSplittedTime(value) { var valueNs = Math.floor(value.nsec); if(valueNs < 0) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1052")); } var nanoseconds = Math.floor(valueNs % RulerUtilities.OneMillisecond); var milliseconds = Math.floor((valueNs - nanoseconds) % RulerUtilities.OneSecond); var seconds = Math.floor((valueNs - nanoseconds - milliseconds) % RulerUtilities.OneMinute); var minutes = Math.floor(valueNs - nanoseconds - milliseconds - seconds); minutes = minutes / RulerUtilities.OneMinute; seconds = seconds / RulerUtilities.OneSecond; milliseconds = milliseconds / RulerUtilities.OneMillisecond; var ns = ""; if(nanoseconds > 999) { ns = nanoseconds.toString().substr(0, 3); } var ms = ""; if(ns || milliseconds) { var ms = milliseconds.toString(); if(seconds) { while(ms.length < 3) { ms = "0" + ms; } } } var sec = ""; if(ns || ms || seconds) { sec = seconds.toString(); if(minutes) { while(sec.length < 2) { sec = "0" + sec; } } } var min = ""; if(minutes) { min = minutes.toString(); } return { minutes: minutes, seconds: seconds, milliseconds: milliseconds, nanoseconds: nanoseconds, nsString: ns, msString: ms, secString: sec, minString: min }; }; RulerUtilities.getNumberFormat = function getNumberFormat() { var nf = Plugin.Culture.NumberFormat; if(!nf) { nf = { numberDecimalSeparator: "." }; } return nf; }; return RulerUtilities; })(); Graph.RulerUtilities = RulerUtilities; var RulerLegend = (function () { function RulerLegend(config) { this._rulerLegendColorDivCss = "ruler-legend-color-div"; this._rulerLegendTextDivCss = "ruler-legend-text-div"; this._rulerLegendDivCss = "ruler-legend-div"; this._rulerScaleLabelImageAppEventCss = "ruler-label-mark-image-appevent"; this._rulerScaleLabelImageUserMarkCss = "ruler-label-mark-image-usermark"; this._rulerScaleMarkImageUserMarkLabel = "User Marks"; this._rulerScaleMarkImageAppEventLabel = "App Lifecycle Events"; if(!config || !config.containerId) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1050")); } this._config = config; } RulerLegend.prototype.render = function () { for(var legendItemIndex = 0; legendItemIndex < this._config.data.length; legendItemIndex++) { var legendItem = this._config.data[legendItemIndex]; this.renderLegendItem(legendItem); } }; RulerLegend.prototype.renderLegendItem = function (legendItemData) { var legendColorDiv = document.createElement("div"); legendColorDiv.className = this._rulerLegendColorDivCss; var label; var className; if(legendItemData.type === MarkType.LifeCycleEvent) { className = this._rulerScaleLabelImageAppEventCss; label = legendItemData.text || this._rulerScaleMarkImageAppEventLabel; } else { className = this._rulerScaleLabelImageUserMarkCss; label = legendItemData.text || this._rulerScaleMarkImageUserMarkLabel; } var colorDiv = document.createElement("div"); colorDiv.className = className; legendColorDiv.appendChild(colorDiv); var legendTextDiv = document.createElement("div"); legendTextDiv.className = this._rulerLegendTextDivCss; legendTextDiv.innerHTML = label; var individualLegendBox = document.createElement("div"); individualLegendBox.className = this._rulerLegendDivCss; individualLegendBox.appendChild(legendColorDiv); individualLegendBox.appendChild(legendTextDiv); if(legendItemData.tooltip) { individualLegendBox.setAttribute("data-plugin-vs-tooltip", legendItemData.tooltip); } var container = document.getElementById(this._config.containerId); container.appendChild(individualLegendBox); }; return RulerLegend; })(); Graph.RulerLegend = RulerLegend; var RulerHeader = (function () { function RulerHeader(config) { this._rulerTitleTextCss = "ruler-title-text"; this._config = config; } RulerHeader.prototype.render = function () { var titleContainer = document.createElement("div"); titleContainer.id = this._config.titleConfig.containerId; titleContainer.className = this._config.titleConfig.className; var titleText = document.createElement("div"); titleText.className = this._rulerTitleTextCss; var text = Plugin.Resources.getString("RulerTitle") || this._config.titleConfig.text || ""; if(this._config.titleConfig.description) { text += ": " + this._config.titleConfig.description; } titleText.innerHTML = text; titleContainer.appendChild(titleText); var legendContainer = document.createElement("div"); legendContainer.id = this._config.legendConfig.containerId; legendContainer.className = this._config.legendConfig.className; var container = document.getElementById(this._config.containerId); container.appendChild(titleContainer); container.appendChild(legendContainer); this.legend = new RulerLegend(this._config.legendConfig); this.legend.render(); }; return RulerHeader; })(); Graph.RulerHeader = RulerHeader; })(VisualProfiler.Graph || (VisualProfiler.Graph = {})); var Graph = VisualProfiler.Graph; })(VisualProfiler || (VisualProfiler = {})); //@ sourceMappingURL=Ruler.js.map // TimeFormattingHelpers.ts var VisualProfiler; (function (VisualProfiler) { "use strict"; var FormattingHelpers = (function () { function FormattingHelpers() { } FormattingHelpers.getPrettyPrintTime = function getPrettyPrintTime(time) { var value; var unitAbbreviation; if(time.nsec === 0) { value = 0; unitAbbreviation = Plugin.Resources.getString("SecondsAbbreviation"); } else if(time.nsec < (1000 * 1000)) { value = parseFloat(time.msec.toPrecision(2)); unitAbbreviation = Plugin.Resources.getString("MillisecondsAbbreviation"); } else if(time.nsec < (1000 * 1000 * 1000)) { value = time.msec; value = Math.floor(value * 100) / 100; unitAbbreviation = Plugin.Resources.getString("MillisecondsAbbreviation"); } else { value = time.sec; value = Math.floor(value * 100) / 100; unitAbbreviation = Plugin.Resources.getString("SecondsAbbreviation"); } return FormattingHelpers.getDecimalLocaleString(value, true) + " " + unitAbbreviation; }; FormattingHelpers.zeroPad = function zeroPad(stringToPad, newLength, padLeft) { var zeros = []; for(var i = stringToPad.length; i < newLength; i++) { zeros.push("0"); } return (padLeft ? (zeros.join("") + stringToPad) : (stringToPad + zeros.join(""))); }; FormattingHelpers.getDecimalLocaleString = function getDecimalLocaleString(numberToConvert, includeGroupSeparators) { var numberString = Math.abs(numberToConvert).toString(); var split = numberString.split(/e/i); numberString = split[0]; var exponent = (split.length > 1 ? parseInt(split[1], 10) : 0); split = numberString.split('.'); numberString = (numberToConvert < 0 ? "-" : "") + split[0]; var right = split.length > 1 ? split[1] : ""; if(exponent > 0) { right = FormattingHelpers.zeroPad(right, exponent, false); numberString += right.slice(0, exponent); right = right.substr(exponent); } else if(exponent < 0) { exponent = -exponent; numberString = FormattingHelpers.zeroPad(numberString, exponent + 1, true); right = numberString.slice(-exponent, numberString.length) + right; numberString = numberString.slice(0, -exponent); } var nf = Plugin.Culture.NumberFormat; if(!nf) { nf = { numberDecimalSeparator: ".", numberGroupSizes: [ 3 ], numberGroupSeparator: "," }; } if(right.length > 0) { right = nf.numberDecimalSeparator + right; } if(includeGroupSeparators === true) { var groupSizes = nf.numberGroupSizes, sep = nf.numberGroupSeparator, curSize = groupSizes[0], curGroupIndex = 1, stringIndex = numberString.length - 1, ret = ""; while(stringIndex >= 0) { if(curSize === 0 || curSize > stringIndex) { if(ret.length > 0) { return numberString.slice(0, stringIndex + 1) + sep + ret + right; } else { return numberString.slice(0, stringIndex + 1) + right; } } if(ret.length > 0) { ret = numberString.slice(stringIndex - curSize + 1, stringIndex + 1) + sep + ret; } else { ret = numberString.slice(stringIndex - curSize + 1, stringIndex + 1); } stringIndex -= curSize; if(curGroupIndex < groupSizes.length) { curSize = groupSizes[curGroupIndex]; curGroupIndex++; } } return numberString.slice(0, stringIndex + 1) + sep + ret + right; } else { return numberString + right; } }; return FormattingHelpers; })(); VisualProfiler.FormattingHelpers = FormattingHelpers; })(VisualProfiler || (VisualProfiler = {})); //@ sourceMappingURL=TimeFormattingHelpers.js.map // RulerView.ts var VisualProfiler; (function (VisualProfiler) { "use strict"; var GlobalRuler = (function () { function GlobalRuler(totalRange) { this._totalRange = totalRange; this._activeRange = this._selection = this._totalRange; this._publisher = new Common.Publisher([ GlobalRuler.SelectionChangedEventType, GlobalRuler.ActiveRangeChangedEventType ]); } GlobalRuler.SelectionChangedEventType = "selectionChanged"; GlobalRuler.ActiveRangeChangedEventType = "activeRangeChanged"; Object.defineProperty(GlobalRuler.prototype, "totalRange", { get: function () { return this._totalRange; }, enumerable: true, configurable: true }); Object.defineProperty(GlobalRuler.prototype, "selection", { get: function () { return this._selection; }, enumerable: true, configurable: true }); Object.defineProperty(GlobalRuler.prototype, "activeRange", { get: function () { return this._activeRange; }, enumerable: true, configurable: true }); GlobalRuler.prototype.setSelection = function (newSelection, isIntermittent) { if (typeof isIntermittent === "undefined") { isIntermittent = false; } if(!this._selection.equals(newSelection) || !isIntermittent) { VisualProfiler.Program.traceWriter.raiseEvent(Common.TraceEvents.Timeline_UserSelectedTimeSlice_Start); var begin = VisualProfiler.TimeStamp.fromNanoseconds(Math.max(newSelection.begin.nsec, this._activeRange.begin.nsec)); var end = VisualProfiler.TimeStamp.fromNanoseconds(Math.min(newSelection.end.nsec, this._activeRange.end.nsec)); this._selection = new VisualProfiler.TimeSpan(begin, end); this._publisher.invokeListener({ type: GlobalRuler.SelectionChangedEventType, data: { isIntermittent: isIntermittent, newSelection: newSelection } }); Notifications.notify(VisualProfiler.ResponsivenessNotifications.UserSelectedTimeslice); VisualProfiler.Program.traceWriter.raiseEvent(Common.TraceEvents.Timeline_UserSelectedTimeSlice_Stop); } }; GlobalRuler.prototype.setActiveRange = function (newRange) { if(!this._activeRange.equals(newRange)) { this._activeRange = newRange; this._publisher.invokeListener({ type: GlobalRuler.ActiveRangeChangedEventType }); } }; GlobalRuler.prototype.addEventListener = function (eventType, func) { this._publisher.addEventListener(eventType, func); }; GlobalRuler.prototype.removeEventListener = function (eventType, func) { this._publisher.removeEventListener(eventType, func); }; return GlobalRuler; })(); VisualProfiler.GlobalRuler = GlobalRuler; var MarkEventModel = (function () { function MarkEventModel(session) { this._session = session; } MarkEventModel.prototype.getMarkEvents = function (timeRange, category) { return this._session.queryMarkEvents(timeRange.begin.nsec, timeRange.end.nsec, category); }; MarkEventModel.prototype.getMarkTooltip = function (mark) { var tooltip = ""; var tooltip = mark.name; if(mark.payload) { var payload = mark.payload.length > 100 ? mark.payload.slice(0, 100) + "..." : mark.payload; if(mark.name === "Navigation") { tooltip = Plugin.Resources.getString("Navigation", payload); } else if(mark.name === "DOMContentLoaded" || mark.name === "Load") { tooltip += " (" + payload + ") "; } else { tooltip = mark.payload; } } tooltip += Plugin.Resources.getString("RulerMarkTooltipLabel", VisualProfiler.FormattingHelpers.getPrettyPrintTime(VisualProfiler.TimeStamp.fromNanoseconds(mark.time))); return tooltip; }; return MarkEventModel; })(); VisualProfiler.MarkEventModel = MarkEventModel; var RulerViewModel = (function () { function RulerViewModel(globalRuler, markEventModel) { this.leftPadding = 40; this.rightPadding = 40; this._globalRuler = globalRuler; this._markEventModel = markEventModel; } RulerViewModel.prototype.getMarks = function (category) { return this._markEventModel.getMarkEvents(this._globalRuler.totalRange, category); }; RulerViewModel.prototype.getMarkTooltip = function (mark) { return this._markEventModel.getMarkTooltip(mark); }; Object.defineProperty(RulerViewModel.prototype, "globalRuler", { get: function () { return this._globalRuler; }, enumerable: true, configurable: true }); RulerViewModel.prototype.setSelectionRange = function (newSelection, isIntermittent) { if (typeof isIntermittent === "undefined") { isIntermittent = false; } this._globalRuler.setSelection(newSelection, isIntermittent); }; RulerViewModel.prototype.setActiveRange = function (newRange) { this._globalRuler.setActiveRange(newRange); }; return RulerViewModel; })(); VisualProfiler.RulerViewModel = RulerViewModel; var RulerView = (function () { function RulerView(containerId) { this._parentContainer = document.getElementById(containerId); if(!this._parentContainer) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1034")); } } Object.defineProperty(RulerView.prototype, "minSelectionWidthInPixels", { set: function (value) { this._minSelectionWidthInPixels = value; }, enumerable: true, configurable: true }); Object.defineProperty(RulerView.prototype, "viewModel", { set: function (model) { this.unregisterViewModelEvents(); this._viewModel = model; this.registerViewModelEvents(); }, enumerable: true, configurable: true }); RulerView.prototype.focus = function () { this._rulerControl.focus(); }; RulerView.prototype.render = function () { var _this = this; this._parentContainer.innerHTML = ""; if(this._rulerControl) { this._rulerControl.deinitialize(); } var rulerConfig = new VisualProfiler.Graph.RulerConfig(this._parentContainer.id); rulerConfig.doubleSlider.timeRange = this._viewModel.globalRuler.totalRange; rulerConfig.doubleSlider.bar.left = this._viewModel.leftPadding; rulerConfig.doubleSlider.bar.right = this._viewModel.rightPadding; if(this._minSelectionWidthInPixels) { rulerConfig.doubleSlider.minimumRangeInPixel = this._minSelectionWidthInPixels; } var lifecycleData = []; var userMarkData = []; var lifecycleMarks = this._viewModel.getMarks(0); for(var markIndex = 0; markIndex < lifecycleMarks.length; markIndex++) { (function (mark) { var markData = new VisualProfiler.Graph.MarkData(VisualProfiler.TimeStamp.fromNanoseconds(mark.time), function () { return _this._viewModel.getMarkTooltip(mark); }); lifecycleData.push(markData); })(lifecycleMarks[markIndex]); } var userMarks = this._viewModel.getMarks(1); for(var markIndex = 0; markIndex < userMarks.length; markIndex++) { (function (mark) { var markData = new VisualProfiler.Graph.MarkData(VisualProfiler.TimeStamp.fromNanoseconds(mark.time), function () { return _this._viewModel.getMarkTooltip(mark); }); userMarkData.push(markData); })(userMarks[markIndex]); } rulerConfig.doubleSlider.markSeries = [ { id: "LifecycleMark", label: Plugin.Resources.getString("RulerLifecycleMarkLabel"), tooltip: Plugin.Resources.getString("LifecycleMarkTooltip"), data: lifecycleData, type: VisualProfiler.Graph.MarkType.LifeCycleEvent }, { id: "UserMark", label: Plugin.Resources.getString("RulerUserMarkLabel"), tooltip: Plugin.Resources.getString("UserMarkTooltip"), data: userMarkData, type: VisualProfiler.Graph.MarkType.UserMark } ]; this._rulerControl = new VisualProfiler.Graph.Ruler(rulerConfig); this._rulerControl.render(); this._rulerControl.addEventListener(VisualProfiler.Graph.RulerEvents.Filter, this.onRulerFilterChange.bind(this)); }; RulerView.prototype.unregisterViewModelEvents = function () { if(this._viewModel) { this._viewModel.globalRuler.removeEventListener(GlobalRuler.SelectionChangedEventType, this.onGlobalRulerSelectionChanged.bind(this)); this._viewModel.globalRuler.removeEventListener(GlobalRuler.ActiveRangeChangedEventType, this.onGlobalRulerActiveRangeChange.bind(this)); } }; RulerView.prototype.registerViewModelEvents = function () { if(this._viewModel) { this._viewModel.globalRuler.addEventListener(GlobalRuler.SelectionChangedEventType, this.onGlobalRulerSelectionChanged.bind(this)); this._viewModel.globalRuler.addEventListener(GlobalRuler.ActiveRangeChangedEventType, this.onGlobalRulerActiveRangeChange.bind(this)); } }; RulerView.prototype.onRulerFilterChange = function (args) { this.adjustSelection(args.data.position, args.data.isIntermittent); }; RulerView.prototype.adjustSelection = function (selection, isIntermittent) { if (typeof isIntermittent === "undefined") { isIntermittent = false; } if(this._viewModel) { this._viewModel.setSelectionRange(selection, isIntermittent); } }; RulerView.prototype.onGlobalRulerActiveRangeChange = function (args) { if(this._viewModel && this._rulerControl) { this._rulerControl.setTimeRange(this._viewModel.globalRuler.activeRange); this._rulerControl.clearSelection(); } }; RulerView.prototype.onGlobalRulerSelectionChanged = function (args) { if(this._viewModel && this._rulerControl) { this._rulerControl.setHandlePosition(this._viewModel.globalRuler.selection); } }; return RulerView; })(); VisualProfiler.RulerView = RulerView; })(VisualProfiler || (VisualProfiler = {})); //@ sourceMappingURL=RulerView.js.map // Divider.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var VisualProfiler; (function (VisualProfiler) { "use strict"; var Divider = (function (_super) { __extends(Divider, _super); function Divider(container, initialOffsetX) { _super.call(this, "dividerTemplate"); this._callbacks = []; this._container = container; this._backdrop = this.findElement("dividerBackdrop"); this._divider = this.findElement("divider"); this._divider.addEventListener("mousedown", this.onMouseDown.bind(this), true); this._container.appendChild(this._backdrop); this._container.appendChild(this._divider); this._minX = 0; this.offsetX = initialOffsetX; this._onMouseMoveHandler = this.onMouseMove.bind(this); this._onMouseUpHandler = this.onMouseUp.bind(this); } Object.defineProperty(Divider.prototype, "height", { set: function (value) { this._divider.style.height = value + "px"; this._backdrop.style.height = value + "px"; }, enumerable: true, configurable: true }); Object.defineProperty(Divider.prototype, "offsetX", { get: function () { return this._divider.offsetLeft; }, set: function (value) { var xPos = value; if(xPos < this._minX) { xPos = this._minX; } else if(xPos > this._maxX) { xPos = this._maxX; } this._divider.style.left = xPos + "px"; }, enumerable: true, configurable: true }); Object.defineProperty(Divider.prototype, "minX", { get: function () { return this._minX; }, set: function (value) { this._minX = value; if(this.offsetX < this._minX) { this.offsetX = this._minX; } }, enumerable: true, configurable: true }); Object.defineProperty(Divider.prototype, "maxX", { get: function () { return this._maxX; }, set: function (value) { this._maxX = value; if(this.offsetX > this._maxX) { this.offsetX = this._maxX; } }, enumerable: true, configurable: true }); Divider.prototype.onMouseDown = function (e) { this._backdrop.style.zIndex = "1000"; this._backdrop.appendChild(this._divider); this._backdrop.setCapture(); this._mouseDownOffset = e.offsetX; this._backdrop.addEventListener("mousemove", this._onMouseMoveHandler, true); this._backdrop.addEventListener("mouseup", this._onMouseUpHandler, true); }; Divider.prototype.onMouseMove = function (e) { this.updateOffsetX(e.pageX); if(this.onMoved) { this.onMoved(this._divider.offsetLeft); } e.stopImmediatePropagation(); e.preventDefault(); }; Divider.prototype.onMouseUp = function (e) { if(this._container.firstChild) { this._container.insertBefore(this._divider, this._container.firstChild); } else { this._container.appendChild(this._divider); } this._backdrop.releaseCapture(); this._backdrop.style.zIndex = "-1"; this._backdrop.removeEventListener("mousemove", this._onMouseMoveHandler, true); this._backdrop.removeEventListener("mouseup", this._onMouseUpHandler, true); this.updateOffsetX(e.pageX); if(this.onMoved) { this.onMoved(this._divider.offsetLeft); } }; Divider.prototype.updateOffsetX = function (pageX) { var x = pageX - this._container.offsetLeft - this._mouseDownOffset; this.offsetX = x; }; return Divider; })(Common.Controls.TemplateControl); VisualProfiler.Divider = Divider; })(VisualProfiler || (VisualProfiler = {})); //@ sourceMappingURL=Divider.js.map // EventsTimelineView.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var VisualProfiler; (function (VisualProfiler) { "use strict"; (function (EventCategory) { EventCategory._map = []; EventCategory._map[0] = "ImageDecoding"; EventCategory.ImageDecoding = 0; EventCategory._map[1] = "GC"; EventCategory.GC = 1; EventCategory._map[2] = "Loading"; EventCategory.Loading = 2; EventCategory._map[3] = "Rendering"; EventCategory.Rendering = 3; EventCategory._map[4] = "Scripting"; EventCategory.Scripting = 4; EventCategory._map[5] = "Styling"; EventCategory.Styling = 5; })(VisualProfiler.EventCategory || (VisualProfiler.EventCategory = {})); var EventCategory = VisualProfiler.EventCategory; var ProfilerEvent = (function () { function ProfilerEvent(interval, category, uiThreadId) { this.details = []; this._interval = interval; this._category = category; this._contextThreadId = ProfilerEvent.getContextThreadId(interval, uiThreadId); this._timeSpan = new VisualProfiler.TimeSpan(VisualProfiler.TimeStamp.fromNanoseconds(interval.begin), VisualProfiler.TimeStamp.fromNanoseconds(interval.end)); this._exclusiveTimeSpan = VisualProfiler.TimeStamp.fromNanoseconds(interval.exclusiveDuration); } Object.defineProperty(ProfilerEvent.prototype, "category", { get: function () { return this._category; }, enumerable: true, configurable: true }); Object.defineProperty(ProfilerEvent.prototype, "childrenCount", { get: function () { return this._interval.childrenCount; }, enumerable: true, configurable: true }); Object.defineProperty(ProfilerEvent.prototype, "contextThreadId", { get: function () { return this._contextThreadId; }, enumerable: true, configurable: true }); Object.defineProperty(ProfilerEvent.prototype, "hasChildren", { get: function () { return this.childrenCount > 0; }, enumerable: true, configurable: true }); Object.defineProperty(ProfilerEvent.prototype, "interval", { get: function () { return this._interval; }, enumerable: true, configurable: true }); Object.defineProperty(ProfilerEvent.prototype, "level", { get: function () { return this._interval.level; }, enumerable: true, configurable: true }); Object.defineProperty(ProfilerEvent.prototype, "id", { get: function () { return this._interval.id; }, enumerable: true, configurable: true }); Object.defineProperty(ProfilerEvent.prototype, "isExpanded", { get: function () { return this._interval.isExpanded; }, enumerable: true, configurable: true }); Object.defineProperty(ProfilerEvent.prototype, "exclusiveDuration", { get: function () { return this._exclusiveTimeSpan; }, enumerable: true, configurable: true }); Object.defineProperty(ProfilerEvent.prototype, "name", { get: function () { if(typeof this._name === "undefined") { this._name = Plugin.Resources.getString(this._interval.name); } return this._name; }, enumerable: true, configurable: true }); Object.defineProperty(ProfilerEvent.prototype, "context", { get: function () { if(!this._context) { this._context = { contextName: this.name + this.getThreadContext() }; } return this._context; }, enumerable: true, configurable: true }); Object.defineProperty(ProfilerEvent.prototype, "timeSpan", { get: function () { return this._timeSpan; }, enumerable: true, configurable: true }); ProfilerEvent.prototype.createDetailInfo = function (name, value, nameLocalizationKey, valueLocalizationKey, fileLink) { var localizedValue; if(valueLocalizationKey) { localizedValue = Plugin.Resources.getString(valueLocalizationKey); } else { localizedValue = value; } var localizedName; if(nameLocalizationKey) { localizedName = Plugin.Resources.getString(nameLocalizationKey); } else { localizedName = name; } var additionalInfo = { propertyName: name, propertyValue: value, localizedName: localizedName, localizedValue: localizedValue }; if(fileLink) { additionalInfo.fileLink = fileLink; } return additionalInfo; }; ProfilerEvent.prototype.getCssClass = function () { switch(this._category) { case EventCategory.GC: return "dataScriptingGc"; case EventCategory.ImageDecoding: return "dataImageDecoding"; case EventCategory.Loading: return "dataLoading"; case EventCategory.Rendering: return "dataRendering"; case EventCategory.Scripting: return "dataScripting"; case EventCategory.Styling: return "dataStyling"; default: throw new Error(Plugin.Resources.getErrorString("JSPerf.1033")); } }; ProfilerEvent.prototype.getDescription = function () { return ""; }; ProfilerEvent.prototype.getDetails = function (sourceInfo) { return []; }; ProfilerEvent.prototype.getEventDetailsRequestInformation = function () { return []; }; ProfilerEvent.prototype.getThreadContext = function () { return this._contextThreadId === null ? "" : " [" + this._contextThreadId + "]"; }; ProfilerEvent.convertBooleanToYesNoLabel = function convertBooleanToYesNoLabel(value) { return value ? "YesLabel" : "NoLabel"; }; ProfilerEvent.convertPropagationStatus = function convertPropagationStatus(propagationStatus) { var result = { preventDefaultCalled: (propagationStatus & 1) != 0, stopImmediatePropagationCalled: (propagationStatus & 2) != 0, stopPropagationCalled: (propagationStatus & 4) != 0 }; return result; }; ProfilerEvent.createElementString = function createElementString(tag, id, cssClass) { var elementValue = ""; var hasAnyElementInfo = false; if(tag !== "") { hasAnyElementInfo = true; elementValue += "<" + tag; } else { elementValue += "<" + Plugin.Resources.getString("UnknownElement"); } if(id !== "") { hasAnyElementInfo = true; elementValue += " id=\"" + id + "\""; } if(cssClass !== "") { hasAnyElementInfo = true; elementValue += " class=\"" + cssClass + "\""; } elementValue += ">"; if(hasAnyElementInfo === false) { elementValue = ""; } return elementValue; }; ProfilerEvent.getContextThreadId = function getContextThreadId(interval, uiThreadId) { if(interval.beginThreadId !== uiThreadId) { return interval.beginThreadId; } if(interval.endThreadId !== uiThreadId) { return interval.endThreadId; } return null; }; ProfilerEvent.createShortenedUrlText = function createShortenedUrlText(url) { if(!ProfilerEvent.isUrl(url)) { return url; } var shortenedText = url; var indexOfHash = shortenedText.indexOf("#"); var indexOfQuestionMark = shortenedText.indexOf("?"); var index = -1; if(indexOfHash > -1 && indexOfQuestionMark > -1) { index = Math.min(indexOfHash, indexOfQuestionMark); } else if(indexOfHash > -1) { index = indexOfHash; } else if(indexOfQuestionMark > -1) { index = indexOfQuestionMark; } if(index > -1) { shortenedText = shortenedText.substring(0, index); } index = shortenedText.lastIndexOf("/"); while(index === (shortenedText.length - 1)) { shortenedText = shortenedText.substring(0, shortenedText.length - 1); index = shortenedText.lastIndexOf("/"); } if(index > -1) { shortenedText = shortenedText.substring(index + 1); } return shortenedText; }; ProfilerEvent.createShortenedUrlTextWithQueryString = function createShortenedUrlTextWithQueryString(url) { if(!url || url.indexOf("data:image") === 0) { return url; } var urlParts = url.split("/"); if(ProfilerEvent.isFile(url)) { return urlParts[urlParts.length - 1]; } if(ProfilerEvent.isUrl(url) && urlParts.length > 3) { return "/" + urlParts.slice(3, urlParts.length).join("/"); } return url; }; ProfilerEvent.isFile = function isFile(url) { return url.match(/^(file|res|ms-appx):/i) ? true : false; }; ProfilerEvent.isUrl = function isUrl(url) { return url.match(/^(https?|file|res|ms-appx):/i) ? true : false; }; ProfilerEvent.prototype.setSourceDetails = function (sourceInfo, additionalInfos) { var shortenedUrl = ProfilerEvent.createShortenedUrlText(sourceInfo.source); var additionalInfo = { propertyName: "SourceLocation", propertyValue: shortenedUrl + " (" + sourceInfo.line + "," + sourceInfo.column + ")", localizedName: Plugin.Resources.getString("SourceLocationLabel"), localizedValue: Plugin.Resources.getString("SourceLocationLink", shortenedUrl, sourceInfo.line, sourceInfo.column), fileLink: sourceInfo }; additionalInfos.push(additionalInfo); if(sourceInfo.name) { additionalInfos.push(this.createDetailInfo("Name", sourceInfo.name, "MethodNameLabel", undefined)); } }; return ProfilerEvent; })(); VisualProfiler.ProfilerEvent = ProfilerEvent; var CssCalculationEvent = (function (_super) { __extends(CssCalculationEvent, _super); function CssCalculationEvent(interval, category, uiThreadId) { _super.call(this, interval, category, uiThreadId); } CssCalculationEvent.prototype.getDescription = function () { return Plugin.Resources.getString("CssCalculationEventDescription"); }; return CssCalculationEvent; })(ProfilerEvent); VisualProfiler.CssCalculationEvent = CssCalculationEvent; var CssParsingEvent = (function (_super) { __extends(CssParsingEvent, _super); function CssParsingEvent(interval, category, uiThreadId) { _super.call(this, interval, category, uiThreadId); } Object.defineProperty(CssParsingEvent.prototype, "context", { get: function () { if(!this._context) { this._context = { contextName: this.name + this.getThreadContext() }; if(this.isStylesheetInline()) { this._context.contextName += " (" + Plugin.Resources.getString("InlineStylesheetLabel") + ")"; } else { var styleUrl = this.getStyleUrl(); this._context.sourceInfo = { name: ProfilerEvent.createShortenedUrlTextWithQueryString(styleUrl), line: 1, column: 1, source: styleUrl }; } } return this._context; }, enumerable: true, configurable: true }); CssParsingEvent.prototype.getDescription = function () { return Plugin.Resources.getString("CssParsingEventDescription"); }; CssParsingEvent.prototype.getDetails = function (sourceInfo) { var result = []; var styleUrl = this.getStyleUrl(); if(styleUrl) { result.push(this.createDetailInfo("StylesheetUrl", styleUrl, "StylesheetUrlLabel", null, { name: ProfilerEvent.createShortenedUrlTextWithQueryString(styleUrl), line: 1, column: 1, source: styleUrl })); } return result; }; CssParsingEvent.prototype.getStyleUrl = function () { var cssParsingInterval = this.interval; if(cssParsingInterval.url) { return cssParsingInterval.url; } return null; }; CssParsingEvent.prototype.isStylesheetInline = function () { var cssParsingInterval = this.interval; return cssParsingInterval.isInline; }; return CssParsingEvent; })(ProfilerEvent); VisualProfiler.CssParsingEvent = CssParsingEvent; var DomEvent = (function (_super) { __extends(DomEvent, _super); function DomEvent(interval, category, uiThreadId) { _super.call(this, interval, category, uiThreadId); } Object.defineProperty(DomEvent.prototype, "context", { get: function () { if(!this._context) { this._context = { contextName: this.name + this.getThreadContext() }; var eventName = this.getEventName(); if(eventName) { this._context.contextName += " ("; this._context.contextName += eventName; this._context.contextName += ")"; } } return this._context; }, enumerable: true, configurable: true }); DomEvent.prototype.getDescription = function () { return Plugin.Resources.getString("DomEventDescription"); }; DomEvent.prototype.getDetails = function (sourceInfo) { var result = []; result.push(this.createDetailInfo("EventName", this.getEventName(), "EventNameLabel", null)); var domEventInterval = this.interval; var endingPropagation = { stopPropagationCalled: false, stopImmediatePropagationCalled: false, preventDefaultCalled: false }; if(domEventInterval.endingPropagationStatus) { endingPropagation = ProfilerEvent.convertPropagationStatus(domEventInterval.endingPropagationStatus); } if(endingPropagation.preventDefaultCalled) { result.push(this.createDetailInfo("DefaultPrevented", domEventInterval.endingPropagationStatus, "DefaultPreventedLabel", ProfilerEvent.convertBooleanToYesNoLabel(endingPropagation.preventDefaultCalled))); } if(endingPropagation.stopImmediatePropagationCalled) { result.push(this.createDetailInfo("stopImmediatePropagation()", domEventInterval.endingPropagationStatus, "ImmediatePropagationStoppedLabel", ProfilerEvent.convertBooleanToYesNoLabel(endingPropagation.stopImmediatePropagationCalled))); } if(endingPropagation.stopPropagationCalled) { result.push(this.createDetailInfo("stopPropagation()", domEventInterval.endingPropagationStatus, "PropagationStoppedLabel", ProfilerEvent.convertBooleanToYesNoLabel(endingPropagation.stopPropagationCalled))); } return result; }; DomEvent.prototype.getEventName = function () { var domEventInterval = this.interval; if(typeof domEventInterval.eventName !== "undefined") { return domEventInterval.eventName; } return null; }; return DomEvent; })(ProfilerEvent); VisualProfiler.DomEvent = DomEvent; var EvaluatingScriptEvent = (function (_super) { __extends(EvaluatingScriptEvent, _super); function EvaluatingScriptEvent(interval, category, uiThreadId) { _super.call(this, interval, category, uiThreadId); } Object.defineProperty(EvaluatingScriptEvent.prototype, "context", { get: function () { if(!this._context) { this._context = { contextName: this.name + this.getThreadContext() }; if(this.isInlineScript()) { this._context.contextName += " (" + Plugin.Resources.getString("InlineScriptLabel") + ")"; } else { var scriptUrl = this.getScriptUrl(); if(scriptUrl) { this._context.sourceInfo = { name: ProfilerEvent.createShortenedUrlTextWithQueryString(scriptUrl), line: 1, column: 1, source: scriptUrl }; } } } return this._context; }, enumerable: true, configurable: true }); EvaluatingScriptEvent.prototype.getDescription = function () { return Plugin.Resources.getString("EvaluatingScriptEventDescription"); }; EvaluatingScriptEvent.prototype.getDetails = function (sourceInfo) { var result = []; var scriptUrl = this.getScriptUrl(); var scriptPreview = this.getScriptPreview(); if(typeof scriptUrl !== "undefined") { var sourceNav; sourceNav = { name: ProfilerEvent.createShortenedUrlTextWithQueryString(scriptUrl), line: 1, column: 1, source: scriptUrl }; result.push(this.createDetailInfo("ScriptUrl", scriptUrl, "ScriptUrlLabel", null, sourceNav)); } if(typeof scriptPreview !== "undefined") { result.push(this.createDetailInfo("ContentPreview", scriptPreview, "ScriptContentPreviewLabel", null)); } return result; }; EvaluatingScriptEvent.prototype.getScriptUrl = function () { var scriptEventInterval = this.interval; return scriptEventInterval.url; }; EvaluatingScriptEvent.prototype.getScriptPreview = function () { var scriptEventInterval = this.interval; var script = scriptEventInterval.inlineScript; if(script) { var oneLinePattern = /(\r\n|\r|\n)\s*/gm; script = script.replace(oneLinePattern, " "); script = script.trim(); } return script; }; EvaluatingScriptEvent.prototype.isInlineScript = function () { var scriptEventInterval = this.interval; if(typeof scriptEventInterval.isInline !== "undefined") { return scriptEventInterval.isInline; } else { return typeof scriptEventInterval.inlineScript !== "undefined"; } }; return EvaluatingScriptEvent; })(ProfilerEvent); VisualProfiler.EvaluatingScriptEvent = EvaluatingScriptEvent; var EventHandlerEvent = (function (_super) { __extends(EventHandlerEvent, _super); function EventHandlerEvent(interval, category, uiThreadId) { _super.call(this, interval, category, uiThreadId); } Object.defineProperty(EventHandlerEvent.prototype, "context", { get: function () { if(!this._context) { this._context = { contextName: this.name + this.getThreadContext(), sourceInfo: this._interval.sourceInfo }; } return this._context; }, enumerable: true, configurable: true }); EventHandlerEvent.prototype.getDescription = function () { return Plugin.Resources.getString("EventHandlerEventDescription"); }; EventHandlerEvent.prototype.getDetails = function (sourceInfo) { var eventHandlerInterval = this.interval; var result = []; if(sourceInfo) { this.setSourceDetails(sourceInfo, result); } var eventPhaseLabelKey; if(eventHandlerInterval.eventPhase) { switch(eventHandlerInterval.eventPhase) { case 1: eventPhaseLabelKey = "CapturingEventPhaseLabel"; break; case 2: eventPhaseLabelKey = "AtTargetEventPhaseLabel"; break; case 3: eventPhaseLabelKey = "BubblingEventPhaseLabel"; break; } result.push(this.createDetailInfo("EventPhase", eventHandlerInterval.eventPhase.toString(), "EventPhaseLabel", eventPhaseLabelKey)); } var endingPropagation = { stopPropagationCalled: false, stopImmediatePropagationCalled: false, preventDefaultCalled: false }; if(eventHandlerInterval.endingPropagationStatus) { endingPropagation = ProfilerEvent.convertPropagationStatus(eventHandlerInterval.endingPropagationStatus); } if(endingPropagation.preventDefaultCalled) { result.push(this.createDetailInfo("DefaultPrevented", eventHandlerInterval.endingPropagationStatus, "DefaultPreventedLabel", ProfilerEvent.convertBooleanToYesNoLabel(endingPropagation.preventDefaultCalled))); } if(endingPropagation.stopImmediatePropagationCalled) { result.push(this.createDetailInfo("stopImmediatePropagation()", eventHandlerInterval.endingPropagationStatus, "ImmediatePropagationStoppedLabel", ProfilerEvent.convertBooleanToYesNoLabel(endingPropagation.stopImmediatePropagationCalled))); } if(endingPropagation.stopPropagationCalled) { result.push(this.createDetailInfo("stopPropagation()", eventHandlerInterval.endingPropagationStatus, "PropagationStoppedLabel", ProfilerEvent.convertBooleanToYesNoLabel(endingPropagation.stopPropagationCalled))); } if(eventHandlerInterval.usesCapture) { result.push(this.createDetailInfo("ListenerUsesCapture", eventHandlerInterval.usesCapture, "ListenerUsesCaptureLabel", ProfilerEvent.convertBooleanToYesNoLabel(eventHandlerInterval.usesCapture))); } var elementValue = ProfilerEvent.createElementString(this.getDDTrackerElementTag(), this.getDDTrackerElementId(), this.getDDTrackerElementClass()); if(elementValue !== "") { result.push(this.createDetailInfo("TargetElement", elementValue, "EventTargetLabel", null)); } return result; }; EventHandlerEvent.prototype.getEventDetailsRequestInformation = function () { var eventDetailsRequest = []; eventDetailsRequest.push({ sourceInfo: this.context.sourceInfo, isSourceRequest: true }); return eventDetailsRequest; }; EventHandlerEvent.prototype.getDDTrackerElementTag = function () { if(typeof this._ddtrackerElementTag === "undefined") { this._ddtrackerElementTag = ""; var ddtrackerInterval = this.interval; if(ddtrackerInterval.element && ddtrackerInterval.element.tag) { this._ddtrackerElementTag = ddtrackerInterval.element.tag.toLowerCase(); } } return this._ddtrackerElementTag; }; EventHandlerEvent.prototype.getDDTrackerElementId = function () { if(typeof this._ddtrackerElementId === "undefined") { this._ddtrackerElementId = ""; var ddtrackerInterval = this.interval; if(ddtrackerInterval.element && ddtrackerInterval.element.id) { this._ddtrackerElementId = ddtrackerInterval.element.id; } } return this._ddtrackerElementId; }; EventHandlerEvent.prototype.getDDTrackerElementClass = function () { if(typeof this._ddtrackerElementClass === "undefined") { this._ddtrackerElementClass = ""; var ddtrackerInterval = this.interval; if(ddtrackerInterval.element && ddtrackerInterval.element.class) { this._ddtrackerElementClass = ddtrackerInterval.element.class; } } return this._ddtrackerElementClass; }; return EventHandlerEvent; })(ProfilerEvent); VisualProfiler.EventHandlerEvent = EventHandlerEvent; var GarbageCollectionEvent = (function (_super) { __extends(GarbageCollectionEvent, _super); function GarbageCollectionEvent(interval, category, uiThreadId) { _super.call(this, interval, category, uiThreadId); } GarbageCollectionEvent.prototype.getDescription = function () { return Plugin.Resources.getString("GarbageCollectionEventDescription"); }; return GarbageCollectionEvent; })(ProfilerEvent); VisualProfiler.GarbageCollectionEvent = GarbageCollectionEvent; var HtmlParsingEvent = (function (_super) { __extends(HtmlParsingEvent, _super); function HtmlParsingEvent(interval, category, uiThreadId) { _super.call(this, interval, category, uiThreadId); } HtmlParsingEvent.prototype.getDescription = function () { return Plugin.Resources.getString("HtmlParsingEventDescription"); }; return HtmlParsingEvent; })(ProfilerEvent); VisualProfiler.HtmlParsingEvent = HtmlParsingEvent; var HtmlSpeculativeDownloadingEvent = (function (_super) { __extends(HtmlSpeculativeDownloadingEvent, _super); function HtmlSpeculativeDownloadingEvent(interval, category, uiThreadId) { _super.call(this, interval, category, uiThreadId); } HtmlSpeculativeDownloadingEvent.prototype.getDescription = function () { return Plugin.Resources.getString("HtmlSpeculativeDownloadingEventDescription"); }; return HtmlSpeculativeDownloadingEvent; })(ProfilerEvent); VisualProfiler.HtmlSpeculativeDownloadingEvent = HtmlSpeculativeDownloadingEvent; var HttpRequestEvent = (function (_super) { __extends(HttpRequestEvent, _super); function HttpRequestEvent(interval, category, uiThreadId) { _super.call(this, interval, category, uiThreadId); } Object.defineProperty(HttpRequestEvent.prototype, "context", { get: function () { if(!this._context) { var httpRequestEventInterval = this.interval; this._context = { contextName: this.name + this.getThreadContext() }; if(typeof httpRequestEventInterval.url !== "undefined") { this._context.contextName += " ("; this._context.contextName += ProfilerEvent.createShortenedUrlTextWithQueryString(httpRequestEventInterval.url); this._context.contextName += ")"; } } return this._context; }, enumerable: true, configurable: true }); HttpRequestEvent.prototype.getDescription = function () { return Plugin.Resources.getString("HttpRequestEventDescription"); }; HttpRequestEvent.prototype.getDetails = function (sourceInfo) { var result = []; var httpRequestEvent = this.interval; if(httpRequestEvent.url) { result.push(this.createDetailInfo("AddressName", httpRequestEvent.url, "AddressNameLabel", null)); } if(httpRequestEvent.statusLine) { result.push(this.createDetailInfo("StatusCode", httpRequestEvent.statusLine, "StatusCodeLabel", null)); } return result; }; HttpRequestEvent.prototype.getEventDetailsRequestInformation = function () { var eventDetailsRequest = []; eventDetailsRequest.push({ isSourceRequest: false }); return eventDetailsRequest; }; return HttpRequestEvent; })(ProfilerEvent); VisualProfiler.HttpRequestEvent = HttpRequestEvent; var ImageDecodedEvent = (function (_super) { __extends(ImageDecodedEvent, _super); function ImageDecodedEvent(interval, category, uiThreadId) { _super.call(this, interval, category, uiThreadId); } Object.defineProperty(ImageDecodedEvent.prototype, "context", { get: function () { if(!this._context) { this._context = { contextName: this.name + this.getThreadContext() }; var imageUrl = this.getImageUrl(); if(imageUrl) { this._context.contextName += " ("; this._context.contextName += ProfilerEvent.createShortenedUrlTextWithQueryString(imageUrl); this._context.contextName += ")"; } } return this._context; }, enumerable: true, configurable: true }); ImageDecodedEvent.prototype.getDescription = function () { return Plugin.Resources.getString("ImageDecodedEventDescription"); }; ImageDecodedEvent.prototype.getDetails = function (sourceInfo) { var result = []; result.push(this.createDetailInfo("ImageUrl", this.getImageUrl(), "ImageUrlLabel", null)); return result; }; ImageDecodedEvent.prototype.getImageUrl = function () { var imageDecodeEventInterval = this.interval; if(typeof imageDecodeEventInterval.url !== "undefined") { return imageDecodeEventInterval.url; } else { return null; } }; return ImageDecodedEvent; })(ProfilerEvent); VisualProfiler.ImageDecodedEvent = ImageDecodedEvent; var LayoutEvent = (function (_super) { __extends(LayoutEvent, _super); function LayoutEvent(interval, category, uiThreadId) { _super.call(this, interval, category, uiThreadId); } LayoutEvent.prototype.getDescription = function () { return Plugin.Resources.getString("LayoutEventDescription"); }; return LayoutEvent; })(ProfilerEvent); VisualProfiler.LayoutEvent = LayoutEvent; var PaintRect = (function () { function PaintRect(paintRect) { this._paintRect = paintRect; } Object.defineProperty(PaintRect.prototype, "bottom", { get: function () { return this._paintRect.bottom; }, enumerable: true, configurable: true }); Object.defineProperty(PaintRect.prototype, "height", { get: function () { return this._paintRect.bottom - this._paintRect.top; }, enumerable: true, configurable: true }); Object.defineProperty(PaintRect.prototype, "left", { get: function () { return this._paintRect.left; }, enumerable: true, configurable: true }); Object.defineProperty(PaintRect.prototype, "right", { get: function () { return this._paintRect.right; }, enumerable: true, configurable: true }); Object.defineProperty(PaintRect.prototype, "top", { get: function () { return this._paintRect.top; }, enumerable: true, configurable: true }); Object.defineProperty(PaintRect.prototype, "width", { get: function () { return this._paintRect.right - this._paintRect.left; }, enumerable: true, configurable: true }); return PaintRect; })(); VisualProfiler.PaintRect = PaintRect; var PaintRectEventBase = (function (_super) { __extends(PaintRectEventBase, _super); function PaintRectEventBase(interval, category, uiThreadId) { _super.call(this, interval, category, uiThreadId); this._paintRect = PaintRectEventBase.getPaintRect(interval); } Object.defineProperty(PaintRectEventBase.prototype, "context", { get: function () { if(!this._context) { this._context = { contextName: this.name + this.getThreadContext() }; if(this._paintRect && this.widthByHeight && this.widthByHeight !== "0x0") { this._context.contextName += " (" + this.widthByHeight + ")"; } } return this._context; }, enumerable: true, configurable: true }); Object.defineProperty(PaintRectEventBase.prototype, "paintRect", { get: function () { return this._paintRect; }, enumerable: true, configurable: true }); Object.defineProperty(PaintRectEventBase.prototype, "widthByHeight", { get: function () { if(this._paintRect) { return this._paintRect.width + "x" + this._paintRect.height; } return null; }, enumerable: true, configurable: true }); PaintRectEventBase.prototype.getDetails = function (sourceInfo) { var result = []; if(this._paintRect && this.widthByHeight && this.widthByHeight !== "0x0") { result.push(this.createDetailInfo("Origin", this._paintRect.left + ", " + this._paintRect.top, "OriginLabel", null)); result.push(this.createDetailInfo("Dimensions", this.widthByHeight, "DimensionsLabel", null)); } return result; }; PaintRectEventBase.getPaintRect = function getPaintRect(interval) { var paintRectInterval = interval; if(typeof paintRectInterval.paintRect !== "undefined" && typeof paintRectInterval.paintRect.top !== "undefined" && typeof paintRectInterval.paintRect.left !== "undefined" && typeof paintRectInterval.paintRect.right !== "undefined" && typeof paintRectInterval.paintRect.bottom !== "undefined") { return new PaintRect(paintRectInterval.paintRect); } return null; }; return PaintRectEventBase; })(ProfilerEvent); VisualProfiler.PaintRectEventBase = PaintRectEventBase; var PaintEvent = (function (_super) { __extends(PaintEvent, _super); function PaintEvent(interval, category, uiThreadId) { _super.call(this, interval, category, uiThreadId); } PaintEvent.prototype.getDescription = function () { return Plugin.Resources.getString("PaintEventDescription"); }; return PaintEvent; })(PaintRectEventBase); VisualProfiler.PaintEvent = PaintEvent; var RenderLayerEvent = (function (_super) { __extends(RenderLayerEvent, _super); function RenderLayerEvent(interval, category, uiThreadId) { _super.call(this, interval, category, uiThreadId); } Object.defineProperty(RenderLayerEvent.prototype, "name", { get: function () { if(typeof this._name === "undefined") { this._name = ""; var elementValue = ProfilerEvent.createElementString(this.getDDTrackerElementTag(), this.getDDTrackerElementId(), this.getDDTrackerElementClass()); if(elementValue) { this._name = elementValue; } else { this._name = Plugin.Resources.getString("RenderLayer"); } } return this._name; }, enumerable: true, configurable: true }); RenderLayerEvent.prototype.getDescription = function () { return Plugin.Resources.getString("RenderLayoutEventDescription"); }; RenderLayerEvent.prototype.getDetails = function () { var result = _super.prototype.getDetails.call(this); var elementValue = ProfilerEvent.createElementString(this.getDDTrackerElementTag(), this.getDDTrackerElementId(), this.getDDTrackerElementClass()); if(elementValue) { result.push(this.createDetailInfo("Element", elementValue, "DDTrackerElementLabel", null)); } return result; }; RenderLayerEvent.prototype.getDDTrackerElementTag = function () { if(typeof this._ddtrackerElementTag === "undefined") { this._ddtrackerElementTag = ""; var ddtrackerInterval = this.interval; if(ddtrackerInterval.element && ddtrackerInterval.element.tag) { this._ddtrackerElementTag = ddtrackerInterval.element.tag.toLowerCase(); } } return this._ddtrackerElementTag; }; RenderLayerEvent.prototype.getDDTrackerElementId = function () { if(typeof this._ddtrackerElementId === "undefined") { this._ddtrackerElementId = ""; var ddtrackerInterval = this.interval; if(ddtrackerInterval.element && ddtrackerInterval.element.id) { this._ddtrackerElementId = ddtrackerInterval.element.id; } } return this._ddtrackerElementId; }; RenderLayerEvent.prototype.getDDTrackerElementClass = function () { if(typeof this._ddtrackerElementClass === "undefined") { this._ddtrackerElementClass = ""; var ddtrackerInterval = this.interval; if(ddtrackerInterval.element && ddtrackerInterval.element.class) { this._ddtrackerElementClass = ddtrackerInterval.element.class; } } return this._ddtrackerElementClass; }; return RenderLayerEvent; })(PaintRectEventBase); VisualProfiler.RenderLayerEvent = RenderLayerEvent; var TimerFiredEvent = (function (_super) { __extends(TimerFiredEvent, _super); function TimerFiredEvent(interval, category, uiThreadId) { _super.call(this, interval, category, uiThreadId); } Object.defineProperty(TimerFiredEvent.prototype, "context", { get: function () { if(!this._context) { var timerFiredEventInterval = this.interval; this._context = { contextName: this.name + this.getThreadContext(), sourceInfo: this._interval.sourceInfo }; } return this._context; }, enumerable: true, configurable: true }); TimerFiredEvent.prototype.getDescription = function () { return Plugin.Resources.getString("TimerFiredEventDescription"); }; TimerFiredEvent.prototype.getDetails = function (sourceInfo) { var result = []; var timerFiredEventInterval = this.interval; if(sourceInfo) { this.setSourceDetails(sourceInfo, result); } var timerTypeValueLabel; switch(timerFiredEventInterval.timerType) { case 0: timerTypeValueLabel = "TimeoutTimerTypeLabel"; break; case 1: timerTypeValueLabel = "IntervalTimerTypeLabel"; break; case 2: timerTypeValueLabel = "ImmediateTimerTypeLabel"; break; case 3: timerTypeValueLabel = "AnimationFrameTimerTypeLabel"; } if(timerFiredEventInterval.timerType !== 3) { result.push(this.createDetailInfo("TimerType", timerFiredEventInterval.timerType, "TimerTypeLabel", timerTypeValueLabel)); } if((timerFiredEventInterval.timerType === 0 || timerFiredEventInterval.timerType === 1) && typeof timerFiredEventInterval.timeoutValue === "number") { result.push(this.createDetailInfo("TimeoutValue", VisualProfiler.FormattingHelpers.getPrettyPrintTime(VisualProfiler.TimeStamp.fromMilliseconds(timerFiredEventInterval.timeoutValue)), "TimeoutLabel", null)); } return result; }; TimerFiredEvent.prototype.getEventDetailsRequestInformation = function () { var eventDetailsRequest = []; eventDetailsRequest.push({ sourceInfo: this.context.sourceInfo, isSourceRequest: true }); return eventDetailsRequest; }; return TimerFiredEvent; })(ProfilerEvent); VisualProfiler.TimerFiredEvent = TimerFiredEvent; var AnimationFrameEvent = (function (_super) { __extends(AnimationFrameEvent, _super); function AnimationFrameEvent(interval, category, uiThreadId) { _super.call(this, interval, category, uiThreadId); } Object.defineProperty(AnimationFrameEvent.prototype, "name", { get: function () { if(typeof this._name === "undefined") { this._name = Plugin.Resources.getString("AnimationFrame"); } return this._name; }, enumerable: true, configurable: true }); AnimationFrameEvent.prototype.getDescription = function () { return Plugin.Resources.getString("AnimationFrameEventDescription"); }; Object.defineProperty(AnimationFrameEvent.prototype, "context", { get: function () { var context = { contextName: this.name + this.getThreadContext(), sourceInfo: this._interval.sourceInfo }; return context; }, enumerable: true, configurable: true }); return AnimationFrameEvent; })(TimerFiredEvent); VisualProfiler.AnimationFrameEvent = AnimationFrameEvent; var WindowsRuntimeEvent = (function (_super) { __extends(WindowsRuntimeEvent, _super); function WindowsRuntimeEvent(interval, category, uiThreadId) { _super.call(this, interval, category, uiThreadId); } Object.defineProperty(WindowsRuntimeEvent.prototype, "context", { get: function () { if(!this._context) { this._context = { contextName: this.name + this.getThreadContext() }; var eventName = this.getEventName(); if(eventName) { this._context.contextName += " ("; this._context.contextName += eventName; this._context.contextName += ")"; } } return this._context; }, enumerable: true, configurable: true }); WindowsRuntimeEvent.prototype.getDescription = function () { return Plugin.Resources.getString("WindowsRuntimeEventDescription"); }; WindowsRuntimeEvent.prototype.getDetails = function (sourceInfo) { var result = []; result.push(this.createDetailInfo("EventName", this.getEventName(), "EventNameLabel", null)); return result; }; WindowsRuntimeEvent.prototype.getEventName = function () { var winRuntimeEventInterval = this.interval; if(typeof winRuntimeEventInterval.eventName !== "undefined") { return winRuntimeEventInterval.eventName; } return null; }; return WindowsRuntimeEvent; })(ProfilerEvent); VisualProfiler.WindowsRuntimeEvent = WindowsRuntimeEvent; var WindowsRuntimeAsyncCallback = (function (_super) { __extends(WindowsRuntimeAsyncCallback, _super); function WindowsRuntimeAsyncCallback(interval, category, uiThreadId) { _super.call(this, interval, category, uiThreadId); } WindowsRuntimeAsyncCallback.prototype.getDescription = function () { return Plugin.Resources.getString("WindowsRuntimeAsyncCallbackDescription"); }; return WindowsRuntimeAsyncCallback; })(ProfilerEvent); VisualProfiler.WindowsRuntimeAsyncCallback = WindowsRuntimeAsyncCallback; var DDTrackerEvent = (function (_super) { __extends(DDTrackerEvent, _super); function DDTrackerEvent(interval, category, uiThreadId) { _super.call(this, interval, category, uiThreadId); } Object.defineProperty(DDTrackerEvent.prototype, "name", { get: function () { if(typeof this._name === "undefined") { this._name = ""; var ddtrackerInterval = this.interval; if(ddtrackerInterval.ddtrackerBaseClass) { switch(ddtrackerInterval.ddtrackerBaseClass) { case "DOM": this._name = Plugin.Resources.getString("DOMAccessEvent"); break; case "Layout": this._name = Plugin.Resources.getString("DDTrackerLayoutDetailHeader"); break; case "CSS": if(ddtrackerInterval.ddtrackerTaskResource == "TASK_Fi") { this._name = Plugin.Resources.getString("CssCalculation"); } else { this._name = Plugin.Resources.getString("DDTrackerStyleComputationDetailHeader"); } break; } } } return this._name; }, enumerable: true, configurable: true }); Object.defineProperty(DDTrackerEvent.prototype, "context", { get: function () { if(!this._context) { this._context = { contextName: "" }; var ddtrackerInterval = this.interval; if(ddtrackerInterval.ddtrackerTaskResource === "TASK_Fi") { this._context.contextName = this._name = Plugin.Resources.getString("CssCalculation"); } else if(ddtrackerInterval.ddtrackerBaseClass === "DOM") { this._context.contextName = this.getDDTrackerTaskName(); } else { this._context.contextName = ProfilerEvent.createElementString(this.getDDTrackerElementTag(), this.getDDTrackerElementId(), this.getDDTrackerElementClass()); if(this.getDDTrackerTaskName() !== "") { if(this._context.contextName === "") { this._context.contextName = this.getDDTrackerTaskName(); } else { this._context.contextName += " (" + this.getDDTrackerTaskName() + ")"; } } this._context.contextName += this.getThreadContext(); } } return this._context; }, enumerable: true, configurable: true }); DDTrackerEvent.prototype.getDetails = function (sourceInfo) { var result = []; var ddtrackerInterval = this.interval; if(ddtrackerInterval.ddtrackerBaseClass) { switch(ddtrackerInterval.ddtrackerBaseClass) { case "DOM": result.push(this.createDetailInfo("Access type", this.getDDTrackerTaskName(), "AccessTypeLabel", null)); break; case "Layout": var layoutMode = this.getDDTrackerTaskName(); if(layoutMode) { result.push(this.createDetailInfo("Category", layoutMode, "LayoutModeLabel", null)); } break; } } var elementValue = ProfilerEvent.createElementString(this.getDDTrackerElementTag(), this.getDDTrackerElementId(), this.getDDTrackerElementClass()); if(elementValue !== "" && elementValue !== "") { result.push(this.createDetailInfo("Element", elementValue, "DDTrackerElementLabel", null)); } return result; }; DDTrackerEvent.prototype.getDescription = function () { if(typeof this._description === "undefined") { this._description = ""; var ddtrackerInterval = this.interval; if(ddtrackerInterval.ddtrackerBaseClass) { switch(ddtrackerInterval.ddtrackerBaseClass) { case "DOM": this._description = Plugin.Resources.getString("DDTrackerDOMDescription"); break; case "Layout": this._description = Plugin.Resources.getString("DDTrackerLayoutDescription"); break; case "CSS": if(ddtrackerInterval.ddtrackerTaskResource == "TASK_Fi") { this._description = Plugin.Resources.getString("CssCalculationEventDescription"); } else { this._description = Plugin.Resources.getString("DDTrackerStyleChangeDescription"); } break; } } } return this._description; }; DDTrackerEvent.prototype.getDDTrackerTaskName = function () { if(typeof this._ddtrackerTaskName === "undefined") { var ddtrackerInterval = this.interval; this._ddtrackerTaskName = ""; if(ddtrackerInterval.ddtrackerBaseClass != "CSS") { if(ddtrackerInterval.ddtrackerTaskString) { this._ddtrackerTaskName = ddtrackerInterval.ddtrackerTaskString; } else if(ddtrackerInterval.ddtrackerTaskResource) { var resourceArgs = [ ddtrackerInterval.ddtrackerTaskResource ]; if(ddtrackerInterval.ddtrackerTaskResourceArgs) { resourceArgs = resourceArgs.concat(ddtrackerInterval.ddtrackerTaskResourceArgs); } this._ddtrackerTaskName = Plugin.Resources.getString.apply(Plugin.Resources, resourceArgs); } } } return this._ddtrackerTaskName; }; DDTrackerEvent.prototype.getDDTrackerElementTag = function () { if(typeof this._ddtrackerElementTag === "undefined") { this._ddtrackerElementTag = ""; var ddtrackerInterval = this.interval; if(ddtrackerInterval.element && ddtrackerInterval.element.tag) { this._ddtrackerElementTag = ddtrackerInterval.element.tag.toLowerCase(); } } return this._ddtrackerElementTag; }; DDTrackerEvent.prototype.getDDTrackerElementId = function () { if(typeof this._ddtrackerElementId === "undefined") { this._ddtrackerElementId = ""; var ddtrackerInterval = this.interval; if(ddtrackerInterval.element && ddtrackerInterval.element.id) { this._ddtrackerElementId = ddtrackerInterval.element.id; } } return this._ddtrackerElementId; }; DDTrackerEvent.prototype.getDDTrackerElementClass = function () { if(typeof this._ddtrackerElementClass === "undefined") { this._ddtrackerElementClass = ""; var ddtrackerInterval = this.interval; if(ddtrackerInterval.element && ddtrackerInterval.element.class) { this._ddtrackerElementClass = ddtrackerInterval.element.class; } } return this._ddtrackerElementClass; }; return DDTrackerEvent; })(ProfilerEvent); VisualProfiler.DDTrackerEvent = DDTrackerEvent; var EventFactory = (function () { function EventFactory() { this._nameToEventMap = { }; this._nameToEventMap["CssCalculation"] = CssCalculationEvent; this._nameToEventMap["CssParsing"] = CssParsingEvent; this._nameToEventMap["DomEvent"] = DomEvent; this._nameToEventMap["EvaluatingScript"] = EvaluatingScriptEvent; this._nameToEventMap["EventHandler"] = EventHandlerEvent; this._nameToEventMap["GarbageCollection"] = GarbageCollectionEvent; this._nameToEventMap["HtmlParsing"] = HtmlParsingEvent; this._nameToEventMap["HtmlSpeculativeDownloading"] = HtmlSpeculativeDownloadingEvent; this._nameToEventMap["HttpRequest"] = HttpRequestEvent; this._nameToEventMap["ImageDecoded"] = ImageDecodedEvent; this._nameToEventMap["Layout"] = LayoutEvent; this._nameToEventMap["Paint"] = PaintEvent; this._nameToEventMap["RenderLayer"] = RenderLayerEvent; this._nameToEventMap["TimerFired"] = TimerFiredEvent; this._nameToEventMap["WindowsRuntimeEvent"] = WindowsRuntimeEvent; this._nameToEventMap["WindowsRuntimeAsyncCallback"] = WindowsRuntimeAsyncCallback; this._nameToEventMap["DDTracker"] = DDTrackerEvent; } EventFactory.prototype.createEvent = function (interval, uiThreadId) { var category = ((EventCategory)[interval.category]); if(interval.name === "TimerFired") { var timerFiredEventInterval = interval; if(timerFiredEventInterval.timerType === 3) { return new AnimationFrameEvent(timerFiredEventInterval, category, uiThreadId); } } var eventType = this._nameToEventMap[interval.name]; if(eventType) { return new eventType(interval, category, uiThreadId); } else { throw new Error(Plugin.Resources.getErrorString("JSPerf.1040")); } }; return EventFactory; })(); VisualProfiler.EventFactory = EventFactory; var EventsTimelineDataSource = (function () { function EventsTimelineDataSource(queryResult, uiThreadId, lowestObservedDocumentMode, eventsFactory) { this._queryResult = queryResult; this._count = this._queryResult.getIntervalsCount(); this._uiThreadId = uiThreadId; this._lowestObservedDocumentMode = lowestObservedDocumentMode; this._data = []; this._dataPrevious = []; this._eventsFactory = eventsFactory; this._currentIndex = null; } EventsTimelineDataSource._prefetchSize = 30; Object.defineProperty(EventsTimelineDataSource.prototype, "count", { get: function () { return this._count; }, enumerable: true, configurable: true }); EventsTimelineDataSource.prototype.collapseIntervalBranch = function (index) { this._queryResult.collapseIntervalBranch(index); this.resetData(); }; EventsTimelineDataSource.prototype.expandIntervalBranch = function (index) { this._queryResult.expandIntervalBranch(index); this.resetData(); }; EventsTimelineDataSource.prototype.getNext = function (skip) { if(this._currentIndex === null) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1057")); } if(this._currentIndex >= this.count) { return null; } var event = this._data[this._currentIndex]; if(!event) { if(!this.fetchFromPrevious(this._currentIndex, EventsTimelineDataSource._prefetchSize)) { this.fetchData(this._currentIndex, EventsTimelineDataSource._prefetchSize); } event = this._data[this._currentIndex]; } this._currentIndex++; if(!isNaN(skip)) { this._currentIndex += skip; } return event; }; EventsTimelineDataSource.prototype.indexOfInterval = function (eventId) { return this._queryResult.indexOfInterval(eventId); }; EventsTimelineDataSource.prototype.getAggregatedDescendantsForEvent = function (eventId) { return this._queryResult.getAggregatedDescendantsForEvent(eventId); }; EventsTimelineDataSource.prototype.startAt = function (index) { if(this._currentIndex !== null) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1058")); } if(isNaN(index) || index < 0 || index >= this.count) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1036")); } this._currentIndex = index; this._data = []; }; EventsTimelineDataSource.prototype.stop = function () { this._currentIndex = null; this._dataPrevious = this._data; this._data = null; }; EventsTimelineDataSource.prototype.fetchData = function (index, max) { var fromIndex = Math.max(0, index - max); var toIndex = Math.min(this._count, index + max) - 1; var intervals = this._queryResult.getIntervals(fromIndex, toIndex); var dataIndex = fromIndex; for(var i = 0; i < intervals.length; i++ , dataIndex++) { if(!this._data[dataIndex]) { var interval = intervals[i]; this._data[dataIndex] = this._eventsFactory.createEvent(interval, this._uiThreadId); } } }; EventsTimelineDataSource.prototype.fetchFromPrevious = function (index, max) { if(this._dataPrevious[index]) { var fromIndex = Math.max(0, index - max); var toIndex = Math.min(this._dataPrevious.length, index + max) - 1; for(var i = fromIndex; i <= toIndex; i++) { var item = this._dataPrevious[i]; if(item) { this._data[i] = item; } } return true; } return false; }; EventsTimelineDataSource.prototype.resetData = function () { this._dataPrevious = []; this._data = []; this._count = this._queryResult.getIntervalsCount(); }; return EventsTimelineDataSource; })(); VisualProfiler.EventsTimelineDataSource = EventsTimelineDataSource; var EventsTimelineModel = (function () { function EventsTimelineModel(session) { this._eventFactory = new EventFactory(); this._session = session; } EventsTimelineModel.prototype.getEvents = function (timeSpan, sort) { var minDuration = 0; var intervalsQuery = this._session.queryEventIntervals(timeSpan.begin.nsec, timeSpan.end.nsec, minDuration, sort); var uiThreadId = this._session.getUIThreadId(); var lowestObservedDocumentMode = this._session.getLowestObservedDocumentMode(); return new EventsTimelineDataSource(intervalsQuery, uiThreadId, lowestObservedDocumentMode, this._eventFactory); }; return EventsTimelineModel; })(); VisualProfiler.EventsTimelineModel = EventsTimelineModel; var EventsTimelineViewModel = (function () { function EventsTimelineViewModel(model, globalRuler, markEventModel) { this._model = model; this._globalRuler = globalRuler; this._markEventModel = markEventModel; this._globalRuler.addEventListener(VisualProfiler.GlobalRuler.SelectionChangedEventType, this.onRulerSelectionChanged.bind(this)); this.timeSpan = this._globalRuler.totalRange; } Object.defineProperty(EventsTimelineViewModel.prototype, "selectedEvent", { get: function () { return this._selectedEvent; }, set: function (event) { if(this._selectedEvent !== event) { this._selectedEvent = event; if(this.selectedEventChanged) { this.selectedEventChanged(this._selectedEvent); } Notifications.notify(VisualProfiler.ResponsivenessNotifications.GridRowSelected); } }, enumerable: true, configurable: true }); Object.defineProperty(EventsTimelineViewModel.prototype, "sort", { set: function (value) { if(this._sort !== value) { this._sort = value; this._isDataSourceInvalid = true; } }, enumerable: true, configurable: true }); Object.defineProperty(EventsTimelineViewModel.prototype, "timeSpan", { get: function () { return this._timeSpan; }, set: function (value) { if((value === undefined && this._timeSpan !== undefined) || (value !== undefined && this._timeSpan === undefined) || (value !== undefined && this._timeSpan !== undefined && !value.equals(this._timeSpan))) { this._timeSpan = value; this._isDataSourceInvalid = true; if(this.timeSpanChanged) { this.timeSpanChanged(); } } }, enumerable: true, configurable: true }); EventsTimelineViewModel.prototype.getEventDetails = function (event) { var detailsRequests = event.getEventDetailsRequestInformation(); if(!detailsRequests || detailsRequests.length === 0) { return event.getDetails(); } var result = []; for(var i = 0; i < detailsRequests.length; i++) { var detailRequest = detailsRequests[i]; if(detailRequest.isSourceRequest) { var sourceRequest = detailRequest; try { var sourceDetails = sourceRequest.sourceInfo; result = result.concat(event.getDetails(sourceDetails)); } catch (e) { } } else { result = result.concat(event.getDetails()); } } return result; }; EventsTimelineViewModel.prototype.getEvents = function () { if(this._isDataSourceInvalid) { this._dataSource = this._model.getEvents(this._timeSpan, this._sort); this._isDataSourceInvalid = false; } return this._dataSource; }; EventsTimelineViewModel.prototype.getMarks = function (category) { return this._markEventModel.getMarkEvents(this._globalRuler.totalRange, category); }; EventsTimelineViewModel.prototype.getMarkTooltip = function (mark) { return this._markEventModel.getMarkTooltip(mark); }; EventsTimelineViewModel.prototype.getVerticalRulerLinePositions = function (viewWidth) { return VisualProfiler.Graph.RulerUtilities.getVerticalLinePositions(this._timeSpan, viewWidth); }; EventsTimelineViewModel.prototype.onRulerSelectionChanged = function (args) { this.timeSpan = new VisualProfiler.TimeSpan(this._globalRuler.selection.begin, this._globalRuler.selection.end); }; return EventsTimelineViewModel; })(); VisualProfiler.EventsTimelineViewModel = EventsTimelineViewModel; var EventDataTooltip = (function (_super) { __extends(EventDataTooltip, _super); function EventDataTooltip(event) { _super.call(this, "eventDataTooltip"); var durationExcluve = this.findElement("durationExc"); var durationInclusive = this.findElement("durationInc"); var startTime = this.findElement("startTime"); durationExcluve.innerText = Plugin.Resources.getString("DurationLabelExclusive", VisualProfiler.FormattingHelpers.getPrettyPrintTime(event.exclusiveDuration)); durationInclusive.innerText = Plugin.Resources.getString("DurationLabelInclusive", VisualProfiler.FormattingHelpers.getPrettyPrintTime(event.timeSpan.elapsed)); startTime.innerText = Plugin.Resources.getString("StartTimeLabel", VisualProfiler.FormattingHelpers.getPrettyPrintTime(event.timeSpan.begin)); } return EventDataTooltip; })(Common.Controls.TemplateControl); VisualProfiler.EventDataTooltip = EventDataTooltip; var EventDataTemplate = (function (_super) { __extends(EventDataTemplate, _super); function EventDataTemplate() { _super.call(this, "eventDataTemplate"); this._bar = this.findElement("bar"); this._durationText = this.findElement("durationText"); this._eventDataTemplateNameCell = this.findElement("eventDataTemplateNameCell"); this._eventData = this.findElement("eventData"); this._eventName = this.findElement("eventName"); this._expander = this.findElement("expander"); this._expander.addEventListener("click", this.onExpansionClicked.bind(this)); this._bar.addEventListener("mouseover", this.showBarTooltip.bind(this)); this._bar.addEventListener("mouseout", Plugin.Tooltip.dismiss); this._eventName.addEventListener("mouseover", this.showEventNameTooltip.bind(this)); this._eventName.addEventListener("mouseout", Plugin.Tooltip.dismiss); this.rootElement.addEventListener("dblclick", this.onRootElementDblClicked.bind(this)); } EventDataTemplate.IndentationInPixels = 20; EventDataTemplate._collapsedCssClass = "itemCollapsed"; EventDataTemplate._expandedCssClass = "itemExpanded"; EventDataTemplate.prototype.updateEvent = function (event, parentTimeSpan) { if(this._event !== event || !this._parentTimeSpan || !this._parentTimeSpan.equals(parentTimeSpan)) { this._event = event; this._parentTimeSpan = parentTimeSpan; this.updateUi(); } }; EventDataTemplate.prototype.collapse = function () { if(this._event && this._event.hasChildren) { if(!this._expander.classList.contains(EventDataTemplate._collapsedCssClass)) { this.onExpansionClicked(null); return true; } } return false; }; EventDataTemplate.prototype.expand = function () { if(this._event && this._event.hasChildren) { if(!this._expander.classList.contains(EventDataTemplate._expandedCssClass)) { this.onExpansionClicked(null); return true; } } return false; }; EventDataTemplate.prototype.getContextSpan = function (sourceInfo) { var spanContainer = document.createElement("span"); var contextLink = document.createElement("span"); contextLink.innerText = sourceInfo.name; if(sourceInfo.source !== "") { contextLink.className = "BPT-FileLink"; EventDataTemplate.setSourceNavHandler(spanContainer, sourceInfo, false); } spanContainer.innerHTML += " ("; spanContainer.appendChild(contextLink); spanContainer.innerHTML += ")"; return spanContainer; }; EventDataTemplate.setSourceNavHandler = function setSourceNavHandler(element, sourceInfo, keyboardNavigable) { element.onclick = EventDataTemplate.contextMouseHandler.bind(this, sourceInfo); if(keyboardNavigable) { element.tabIndex = 0; element.onkeydown = EventDataTemplate.contextKeyHandler.bind(this, sourceInfo); } }; EventDataTemplate.contextKeyHandler = function contextKeyHandler(sourceInfo, evt) { if((evt.keyCode === Common.KeyCodes.ENTER || evt.keyCode === Common.KeyCodes.SPACE) && !evt.ctrlKey && !evt.altKey && !evt.shiftKey) { EventDataTemplate.navigateToSource(sourceInfo.source, sourceInfo.line, sourceInfo.column); } }; EventDataTemplate.contextMouseHandler = function contextMouseHandler(sourceInfo) { EventDataTemplate.navigateToSource(sourceInfo.source, sourceInfo.line, sourceInfo.column); }; EventDataTemplate.navigateToSource = function navigateToSource(unshortenedUrl, line, column) { Plugin.Host.showDocument(unshortenedUrl, line, column).done(function () { }, function (err) { VisualProfiler.Program.hostShell.setStatusBarText(Plugin.Resources.getString("UnableToNavigateToSource"), true); }); }; EventDataTemplate.prototype.onExpansionClicked = function (e) { if(e) { e.stopImmediatePropagation(); } if(this.expansionToggledCallback) { this.expansionToggledCallback(); } }; EventDataTemplate.prototype.onRootElementDblClicked = function (e) { if(e) { if(e.srcElement && e.srcElement === this._expander) { e.stopImmediatePropagation(); return; } } this.onExpansionClicked(e); }; EventDataTemplate.prototype.showBarTooltip = function () { if(this._event) { var toolTipControl = new EventDataTooltip(this._event); var config = { content: toolTipControl.rootElement.innerHTML, contentContainsHTML: true }; Plugin.Tooltip.show(config); } }; EventDataTemplate.prototype.showEventNameTooltip = function (mouseEvent) { if(this._event) { var eventDiv = mouseEvent.currentTarget; var tooltip = this._eventName.textContent; if(eventDiv.offsetWidth < eventDiv.scrollWidth) { var config = { content: tooltip }; Plugin.Tooltip.show(config); } } }; EventDataTemplate.prototype.updateUi = function () { var event = this._event; this._eventDataTemplateNameCell.style.marginLeft = (event.level * EventDataTemplate.IndentationInPixels) + "px"; EventDataTemplate.setExpanderCss(this._expander, event); this._eventName.innerText = event.context.contextName; var sourceInfo = event.context.sourceInfo; if(sourceInfo) { var srcSpan = this.getContextSpan(sourceInfo); this._eventName.appendChild(srcSpan); } var left = (event.timeSpan.begin.nsec - this._parentTimeSpan.begin.nsec) / this._parentTimeSpan.elapsed.nsec * 100; var width = event.timeSpan.elapsed.nsec / this._parentTimeSpan.elapsed.nsec * 100; this._bar.style.marginLeft = left + "%"; this._bar.style.width = width + "%"; EventDataTemplate.setBarCss(this._bar, event); this._durationText.innerText = VisualProfiler.FormattingHelpers.getPrettyPrintTime(event.timeSpan.elapsed); if(!event.exclusiveDuration.equals(event.timeSpan.elapsed)) { this._durationText.innerText += " (" + VisualProfiler.FormattingHelpers.getPrettyPrintTime(event.exclusiveDuration) + ")"; } }; EventDataTemplate.setBarCss = function setBarCss(bar, event) { bar.className = "eventBar " + event.getCssClass(); }; EventDataTemplate.setExpanderCss = function setExpanderCss(expander, event) { if(event.hasChildren) { if(!event.isExpanded) { expander.classList.remove(EventDataTemplate._expandedCssClass); expander.classList.add(EventDataTemplate._collapsedCssClass); } else { expander.classList.remove(EventDataTemplate._collapsedCssClass); expander.classList.add(EventDataTemplate._expandedCssClass); } } else { expander.classList.remove(EventDataTemplate._expandedCssClass); expander.classList.remove(EventDataTemplate._collapsedCssClass); } }; return EventDataTemplate; })(Common.Controls.TemplateControl); VisualProfiler.EventDataTemplate = EventDataTemplate; var EventDetailsView = (function (_super) { __extends(EventDetailsView, _super); function EventDetailsView(event, details, descendants) { _super.call(this, "eventDetailsTemplate"); this._inclusiveSeparator = this.findElement("inclusiveTimeDetailSeparator"); if(event === null) { var description = this.findElement("eventDetailsDescription"); var separator = this.findElement("detailSeparator"); description.innerText = Plugin.Resources.getString("SelectAnEventDescription"); separator.style.display = "none"; this._inclusiveSeparator.style.display = "none"; } else { this._details = details; this._event = event; this._aggregatedDescendants = descendants; this.displayCommonFields(); this.displayEventSpecificFields(); this.displayInclusiveTimeSummary(); var cells = this.findElementsByClassName("eventCell"); for(var cellIndex = 0; cellIndex < cells.length; cellIndex++) { var cell = cells[cellIndex]; (function (value) { cell.addEventListener("mouseover", function (mouseEvent) { return EventDetailsView.showCellTooltip(mouseEvent, value); }); cell.addEventListener("mouseout", Plugin.Tooltip.dismiss); })(cell.innerText); } } } EventDetailsView.showCellTooltip = function showCellTooltip(mouseEvent, text) { var div = mouseEvent.currentTarget; if(div.offsetWidth < div.scrollWidth) { var config = { content: text }; Plugin.Tooltip.show(config); } }; EventDetailsView.prototype.createDiv = function (value) { var classNames = []; for (var _i = 0; _i < (arguments.length - 1); _i++) { classNames[_i] = arguments[_i + 1]; } var div = document.createElement("div"); div.innerText = value; if(classNames) { for(var index = 0; index < classNames.length; index++) { div.classList.add(classNames[index]); } } return div; }; EventDetailsView.prototype.displayCommonFields = function () { var durationLabelExc = this.findElement("durationLabelExc"); var durationValueExc = this.findElement("durationValueExc"); var durationLabelInc = this.findElement("durationLabelInc"); var durationValueInc = this.findElement("durationValueInc"); var startTimeLabel = this.findElement("startTimeLabel"); var startTimeValue = this.findElement("startTimeValue"); var threadContextLabel = this.findElement("threadContextLabel"); var threadContextValue = this.findElement("threadContextValue"); var description = this.findElement("eventDetailsDescription"); durationLabelExc.innerText = Plugin.Resources.getString("DurationLabelExclusive", ""); durationValueExc.innerText = VisualProfiler.FormattingHelpers.getPrettyPrintTime(this._event.exclusiveDuration); durationLabelInc.innerText = Plugin.Resources.getString("DurationLabelInclusive", ""); durationValueInc.innerText = VisualProfiler.FormattingHelpers.getPrettyPrintTime(this._event.timeSpan.elapsed); startTimeLabel.innerText = Plugin.Resources.getString("StartTimeLabel", ""); startTimeValue.innerText = VisualProfiler.FormattingHelpers.getPrettyPrintTime(this._event.timeSpan.begin); threadContextLabel.innerText = Plugin.Resources.getString("ThreadContextLabel", ""); threadContextValue.innerText = this.getThreadContext(); description.innerText = this._event.getDescription(); }; EventDetailsView.prototype.displayInclusiveTimeSummary = function () { if(this._aggregatedDescendants.length <= 1) { this._inclusiveSeparator.style.display = "none"; return; } if(typeof this._donutChart === "undefined") { var donutContainer = this.findElement("inclusiveTimeBreakDownDetails"); this._donutChart = new VisualProfiler.DonutChartView(donutContainer); } var eventCount = this._donutChart.addData(this._aggregatedDescendants); if(eventCount > 1) { this._donutChart.render(); } else { this._inclusiveSeparator.style.display = "none"; } }; EventDetailsView.prototype.displayEventSpecificFields = function () { if(!this._details) { return; } var additionalDetailsContainer = this.findElement("additionalDetails"); for(var i = 0; i < this._details.length; i++) { var detail = this._details[i]; if(detail.fileLink && detail.fileLink.source === "") { continue; } var nameDiv = this.createDiv(detail.localizedName + ":", "eventCell", "name"); var valueDiv = this.createDiv(detail.localizedValue, "eventCell", "value"); if(detail.fileLink) { valueDiv.className += " BPT-FileLink"; valueDiv.setAttribute("role", "link"); valueDiv.addEventListener("mouseover", this.showSourceTip.bind(this, detail.fileLink.source)); EventDataTemplate.setSourceNavHandler(valueDiv, detail.fileLink, true); } var additionalDetailsLabelValuePair = this.createDiv("", "eventRow"); additionalDetailsLabelValuePair.appendChild(nameDiv); additionalDetailsLabelValuePair.appendChild(valueDiv); additionalDetailsContainer.appendChild(additionalDetailsLabelValuePair); } }; EventDetailsView.prototype.showSourceTip = function (source, evt) { Plugin.Tooltip.show(source); evt.stopImmediatePropagation(); }; EventDetailsView.prototype.getThreadContext = function () { var threadId = this._event.contextThreadId; if(threadId !== null) { return threadId.toString(); } return Plugin.Resources.getString("UIThreadContext"); }; return EventDetailsView; })(Common.Controls.TemplateControl); VisualProfiler.EventDetailsView = EventDetailsView; var EventsTimelineListControl = (function (_super) { __extends(EventsTimelineListControl, _super); function EventsTimelineListControl(rootElement) { var _this = this; _super.call(this, rootElement); this._selectedItemVisibleIndex = -1; this._onAriaExpandedModifiedHandler = this.onAriaExpandedModified.bind(this); this.rootElement.tabIndex = 0; this.rootElement.addEventListener("keydown", this.onKeyDown.bind(this)); this._panel = new VisualProfiler.VirtualizingStackPanel(this.rootElement); this._panel.templateBinder = this; this._itemContainerGenerator = new VisualProfiler.ItemContainerGenerator(); this._panel.itemContainerGenerator = this._itemContainerGenerator; this._columnsCssRule = this.getColumnsCssRule(); VisualProfiler.Program.addEventListener(VisualProfiler.ProgramEvents.Resize, function () { _this._columnsCssRule = _this.getColumnsCssRule(); _this.invalidateSizeCache.bind(_this); if(_this._viewModel) { _this.setDivderBounds(); _this.resizeColumns(_this._divider.offsetX); } }); this._divider = new VisualProfiler.Divider(this._panel.rootElement, this.eventNameColumnWidth); this._divider.minX = 150; this._divider.onMoved = function (offsetX) { _this.resizeColumns(offsetX); VisualProfiler.Program.triggerResize(); }; this.setDivderBounds(); this._verticalRulerLineElementsFactory = VisualProfiler.ElementRecyclerFactory.forDivWithClass(this.rootElement, "verticalRulerLine"); this.rootElement.setAttribute("aria-label", Plugin.Resources.getString("EventsTimelineAriaLabel")); this.invalidateSizeCache(); } Object.defineProperty(EventsTimelineListControl.prototype, "dataColumnLeft", { get: function () { var columns = this._columnsCssRule.style.msGridColumns.split(' '); return parseInt(columns[0]) + parseInt(columns[1]); }, enumerable: true, configurable: true }); Object.defineProperty(EventsTimelineListControl.prototype, "dataColumnWidth", { get: function () { if(this._dataColumnWidth === null) { var panelScrollBarWidth = this._panel.rootElement.offsetWidth - this._panel.rootElement.clientWidth; this._dataColumnWidth = this.rootElement.offsetWidth - this.dataColumnLeft - panelScrollBarWidth; } return this._dataColumnWidth; }, enumerable: true, configurable: true }); Object.defineProperty(EventsTimelineListControl.prototype, "dataSource", { get: function () { return this._dataSource; }, set: function (value) { if(this._dataSource !== value) { var selectionViewportOffset = 0; if(this._selectedItem && this._itemContainerGenerator) { var selectedItemContainer = this._itemContainerGenerator.getItemContainerFromItemId(this._selectedItem.id); if(selectedItemContainer) { selectionViewportOffset = this._panel.getScrollViewportOffset(selectedItemContainer); } } this._dataSource = value; if(this._selectedItem) { this._selectedItemVisibleIndex = this.getVisibleIndexOfItem(this._selectedItem); if(this._selectedItemVisibleIndex < 0) { this.selectedItem = null; this._panel.scrollToOffset(0, true); } else { this._panel.scrollToIndex(this._selectedItemVisibleIndex, -selectionViewportOffset, true); } } else { this._panel.scrollToOffset(0, true); } this._itemContainerGenerator.setDataSource(value); this._panel.invalidate(); } }, enumerable: true, configurable: true }); Object.defineProperty(EventsTimelineListControl.prototype, "eventNameColumnWidth", { get: function () { var columns = this._columnsCssRule.style.msGridColumns.split(' '); return parseInt(columns[0]); }, enumerable: true, configurable: true }); Object.defineProperty(EventsTimelineListControl.prototype, "itemContainerGenerator", { get: function () { return this._itemContainerGenerator; }, enumerable: true, configurable: true }); Object.defineProperty(EventsTimelineListControl.prototype, "offsetLeft", { get: function () { if(this._offsetLeft === null) { this._offsetLeft = this.rootElement.offsetLeft; } return this._offsetLeft; }, enumerable: true, configurable: true }); Object.defineProperty(EventsTimelineListControl.prototype, "offsetTop", { get: function () { if(this._offsetTop === null) { this._offsetTop = this.rootElement.offsetTop; } return this._offsetTop; }, enumerable: true, configurable: true }); Object.defineProperty(EventsTimelineListControl.prototype, "selectedItem", { get: function () { return this._selectedItem; }, set: function (value) { if(this._selectedItem !== value || (this._selectedItem && value && this._selectedItem.id !== value.id)) { var itemContainer = this.getSelectedItemContainer(); if(itemContainer) { itemContainer.isSelected = false; } this._selectedItem = value; if(this._selectedItem) { this._selectedItemVisibleIndex = this.getVisibleIndexOfItem(this._selectedItem); } else { this._selectedItemVisibleIndex = -1; } var itemContainer = this.getSelectedItemContainer(true); if(itemContainer) { this.setItemContainerAriaLabel(itemContainer); itemContainer.focus(); } if(this._selectedItemVisibleIndex >= 0) { this._panel.ensureVisible(this._selectedItemVisibleIndex); } if(this.selectedItemChanged) { this.selectedItemChanged(this._selectedItem); } } }, enumerable: true, configurable: true }); Object.defineProperty(EventsTimelineListControl.prototype, "timeSpan", { set: function (value) { this._timeSpan = value; }, enumerable: true, configurable: true }); Object.defineProperty(EventsTimelineListControl.prototype, "viewModel", { set: function (value) { this._viewModel = value; }, enumerable: true, configurable: true }); EventsTimelineListControl.prototype.bind = function (itemContainer, itemIndex) { var event = itemContainer.item; if(!itemContainer.template) { itemContainer.template = new EventDataTemplate(); itemContainer.rootElement.tabIndex = -1; itemContainer.rootElement.appendChild(itemContainer.template.rootElement); } itemContainer.rootElement.setAttribute("data-id", itemContainer.id.toString()); (itemContainer.template).updateEvent(event, this._timeSpan); itemContainer.rootElement.removeEventListener("DOMAttrModified", this._onAriaExpandedModifiedHandler); if(event.hasChildren) { itemContainer.rootElement.setAttribute("aria-expanded", event.isExpanded ? "true" : "false"); (itemContainer.template).expansionToggledCallback = this.onExpansionToggled.bind(this, itemContainer, itemIndex); itemContainer.rootElement.addEventListener("DOMAttrModified", this._onAriaExpandedModifiedHandler); } else { itemContainer.rootElement.removeAttribute("aria-expanded"); } itemContainer.clicked = this.onItemSelected.bind(this, itemContainer); itemContainer.isSelected = this._selectedItem && itemContainer.id === this._selectedItem.id; }; EventsTimelineListControl.prototype.invalidateSizeCache = function () { this._dataColumnWidth = null; this._offsetLeft = null; this._offsetTop = null; this._panel.invalidateSizeCache(); }; EventsTimelineListControl.prototype.render = function () { this.invalidate(); }; EventsTimelineListControl.prototype.renderVerticalRulerLines = function () { var positions = this._viewModel.getVerticalRulerLinePositions(this.dataColumnWidth); this._verticalRulerLineElementsFactory.start(); for(var i = 0; i < positions.length; ++i) { var line = this._verticalRulerLineElementsFactory.getNext(); var x = this.dataColumnWidth * positions[i] / 100 + this.dataColumnLeft; this.positionVerticalRulerLine(line, x, this._panel.viewportHeight); } this._verticalRulerLineElementsFactory.stop(); }; EventsTimelineListControl.prototype.unbind = function (itemContainer) { var template = itemContainer.template; if(template) { template.expansionToggledCallback = null; } itemContainer.clicked = null; itemContainer.rootElement.removeAttribute("aria-label"); itemContainer.rootElement.removeEventListener("DOMAttrModified", this._onAriaExpandedModifiedHandler); }; EventsTimelineListControl.prototype.positionVerticalRulerLine = function (line, x, height) { line.style.left = x + "px"; line.style.height = height + "px"; line.style.top = "0px"; }; EventsTimelineListControl.prototype.getColumnsCssRule = function () { return EventsTimelineView.getCssRule("VisualProfiler.css", ".eventDataTemplate"); }; EventsTimelineListControl.prototype.getItemContainerFromItem = function (item, scrollIfNeeded) { var itemContainer = this._itemContainerGenerator.getItemContainerFromItemId(item.id); if(!itemContainer && scrollIfNeeded) { this.scrollToItem(item); itemContainer = this._itemContainerGenerator.getItemContainerFromItemId(item.id); } return itemContainer; }; EventsTimelineListControl.prototype.getSelectedItemContainer = function (scrollIfNeeded) { if(this.selectedItem) { return this.getItemContainerFromItem(this.selectedItem, scrollIfNeeded); } return null; }; EventsTimelineListControl.prototype.getVisibleIndexOfItem = function (item) { return this._dataSource.indexOfInterval(item.id); }; EventsTimelineListControl.prototype.invalidate = function () { this._panel.invalidate(); this._panel.render(); this.updateDividerHeight(); var panelScrollBarShown = this._panel.virtualHeight > this._panel.viewportHeight; if(panelScrollBarShown !== this._panelScrollBarShown) { this._panelScrollBarShown = panelScrollBarShown; this.invalidateSizeCache(); } }; EventsTimelineListControl.prototype.onAriaExpandedModified = function (event) { if(event.attrName === "aria-expanded") { var element = event.target; var itemId = parseInt(element.getAttribute("data-id")); var itemContainer = this._itemContainerGenerator.getItemContainerFromItemId(itemId); if(itemContainer) { var itemTemplate = itemContainer.template; if(event.newValue === "true") { itemTemplate.expand(); } else { itemTemplate.collapse(); } } } }; EventsTimelineListControl.prototype.onKeyDown = function (event) { var handled = true; switch(event.keyCode) { case Common.KeyCodes.ARROW_UP: if(this._selectedItemVisibleIndex < 0) { this.setSelectedItemVisibleIndex(0); } else { this.selectPreviousItem(); } break; case Common.KeyCodes.ARROW_DOWN: if(this._selectedItemVisibleIndex < 0) { this.setSelectedItemVisibleIndex(0); } else { this.selectNextItem(); } break; case Common.KeyCodes.PAGE_UP: this.selectPageUp(); break; case Common.KeyCodes.PAGE_DOWN: this.selectPageDown(); break; case Common.KeyCodes.HOME: this.selectHome(); break; case Common.KeyCodes.END: this.selectEnd(); break; case Common.KeyCodes.ARROW_RIGHT: var selectedItemContainer = this.getSelectedItemContainer(); if(selectedItemContainer) { if(!(selectedItemContainer.template).expand() && (selectedItemContainer.item).hasChildren) { this.selectNextItem(); } } break; case Common.KeyCodes.ARROW_LEFT: var selectedItemContainer = this.getSelectedItemContainer(); if(selectedItemContainer) { if(!(selectedItemContainer.template).collapse() && (selectedItemContainer.item).level > 0) { this.selectPreviousItem(); } } break; case Common.KeyCodes.PLUS: var selectedItemContainer = this.getSelectedItemContainer(); if(selectedItemContainer) { (selectedItemContainer.template).expand(); } break; case Common.KeyCodes.MINUS: var selectedItemContainer = this.getSelectedItemContainer(); if(selectedItemContainer) { (selectedItemContainer.template).collapse(); } break; default: handled = false; } if(handled) { event.preventDefault(); event.stopPropagation(); } }; EventsTimelineListControl.prototype.onItemSelected = function (itemContainer) { this.selectedItem = itemContainer.item; itemContainer.focus(); }; EventsTimelineListControl.prototype.onExpansionToggled = function (itemContainer, itemIndex) { var event = itemContainer.item; if(event.isExpanded) { this._dataSource.collapseIntervalBranch(itemIndex); } else { this._dataSource.expandIntervalBranch(itemIndex); } this.selectedItem = event; this.invalidate(); var selectedItemContainer = this.getSelectedItemContainer(); if(selectedItemContainer) { selectedItemContainer.focus(); } }; EventsTimelineListControl.prototype.resizeColumns = function (offsetX) { this._dataColumnWidth = null; this.updateColumnWidth(offsetX); if(this.dataColumnWidthChanged) { this.dataColumnWidthChanged(); } this.renderVerticalRulerLines(); }; EventsTimelineListControl.prototype.scrollToItem = function (item) { var visibleIndex = this.getVisibleIndexOfItem(item); if(visibleIndex >= 0) { this._panel.ensureVisible(visibleIndex); } }; EventsTimelineListControl.prototype.selectEnd = function () { if(this._selectedItemVisibleIndex < 0) { return; } this.setSelectedItemVisibleIndex(this._itemContainerGenerator.count - 1); }; EventsTimelineListControl.prototype.selectHome = function () { if(this._selectedItemVisibleIndex < 0) { return; } this.setSelectedItemVisibleIndex(0); }; EventsTimelineListControl.prototype.selectPreviousItem = function () { if(this._selectedItemVisibleIndex < 0) { return; } this.setSelectedItemVisibleIndex(this._selectedItemVisibleIndex - 1); }; EventsTimelineListControl.prototype.selectPageDown = function () { if(this._selectedItemVisibleIndex < 0) { return; } this.setSelectedItemVisibleIndex(this._selectedItemVisibleIndex + this._panel.viewportItemsCount); }; EventsTimelineListControl.prototype.selectPageUp = function () { if(this._selectedItemVisibleIndex < 0) { return; } this.setSelectedItemVisibleIndex(this._selectedItemVisibleIndex - this._panel.viewportItemsCount); }; EventsTimelineListControl.prototype.selectNextItem = function () { if(this._selectedItemVisibleIndex < 0) { return; } this.setSelectedItemVisibleIndex(this._selectedItemVisibleIndex + 1); }; EventsTimelineListControl.prototype.setDivderBounds = function () { var containerWidth = this._panel.rootElement.offsetWidth; this._divider.maxX = containerWidth / 2; }; EventsTimelineListControl.prototype.setItemContainerAriaLabel = function (itemContainer) { if(itemContainer) { var event = itemContainer.item; if(event) { var ariaLabel = event.name; ariaLabel += " , " + Plugin.Resources.getString("StartTimeLabel", VisualProfiler.FormattingHelpers.getPrettyPrintTime(event.timeSpan.begin)); ariaLabel += " , " + Plugin.Resources.getString("DurationLabelInclusive", VisualProfiler.FormattingHelpers.getPrettyPrintTime(event.timeSpan.elapsed)); if(!event.timeSpan.elapsed.equals(event.exclusiveDuration)) { ariaLabel += " , " + Plugin.Resources.getString("DurationLabelExclusive", VisualProfiler.FormattingHelpers.getPrettyPrintTime(event.exclusiveDuration)); } ariaLabel += " , " + Plugin.Resources.getString("ThreadContextLabel", event.contextThreadId || Plugin.Resources.getString("UIThreadContext")); var additionalInfo = this._viewModel.getEventDetails(event); for(var i = 0; i < additionalInfo.length; i++) { ariaLabel += " , " + additionalInfo[i].localizedName + ": " + additionalInfo[i].localizedValue; } ariaLabel += " , " + event.getDescription(); itemContainer.rootElement.setAttribute("aria-label", ariaLabel); } else { itemContainer.rootElement.removeAttribute("aria-label"); } } }; EventsTimelineListControl.prototype.setSelectedItemVisibleIndex = function (newVisibleIndex) { var itemContainer = null; var totalVisibleCount = this._itemContainerGenerator.count; if(newVisibleIndex < 0) { newVisibleIndex = 0; } if(newVisibleIndex >= totalVisibleCount) { newVisibleIndex = totalVisibleCount - 1; } if(this._selectedItemVisibleIndex >= 0 && this._selectedItemVisibleIndex === newVisibleIndex) { itemContainer = this.getSelectedItemContainer(); } else { if(newVisibleIndex >= 0 && newVisibleIndex < totalVisibleCount) { this._itemContainerGenerator.startAt(newVisibleIndex); itemContainer = this._itemContainerGenerator.getNext(); this._itemContainerGenerator.stop(); if(itemContainer) { var item = itemContainer.item; if(!itemContainer.rootElement.parentElement) { this._itemContainerGenerator.recycle(newVisibleIndex); } this.selectedItem = item; } } } return itemContainer; }; EventsTimelineListControl.prototype.updateColumnWidth = function (offsetX) { if(offsetX === null || typeof offsetX === "undefined") { offsetX = this._divider.offsetX; } var columns = this._columnsCssRule.style.msGridColumns.split(' '); columns[0] = offsetX + "px"; this._columnsCssRule.style.msGridColumns = columns.join(' '); }; EventsTimelineListControl.prototype.updateDividerHeight = function () { var height = Math.max(this._panel.virtualHeight, this._panel.actualHeight); this._divider.height = height; }; return EventsTimelineListControl; })(Common.Controls.Control); VisualProfiler.EventsTimelineListControl = EventsTimelineListControl; var EventsTimelineView = (function (_super) { __extends(EventsTimelineView, _super); function EventsTimelineView(parentContainerId) { var _this = this; _super.call(this, "timelineViewTemplate"); this._parentContainer = document.getElementById(parentContainerId); if(!this._parentContainer) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1034")); } this._eventDetailsHeaderClass = "emptyHeader"; this._eventDetailsTitle = this.findElement("eventDetailsTitle"); this._timelineDetailsHeader = this.findElement("timelineDetailsHeader"); this._timelineDetailsPaneContainer = this.findElement("timelineDetailsPaneContainer"); this._timelineViewAndDetailsContainer = this.findElement("timelineViewAndDetails"); this._timelineLabel = this.findElement("timelineLabel"); var timelineSortLabel = this.findElement("timelineSortLabel"); this._timelineSortSelector = this.findElement("timelineSortSelector"); var timelineSortDuration = this.findElement("timelineSortDuration"); var timelineSortStartTime = this.findElement("timelineSortStartTime"); this._timelineView = this.findElement("timelineView"); this._timelineLabel.innerText = Plugin.Resources.getString("TimelineLabel"); timelineSortLabel.innerText = Plugin.Resources.getString("TimelineSortLabel"); timelineSortLabel.setAttribute("for", this._timelineSortSelector.id); this._timelineSortSelector.addEventListener("mouseover", function () { return EventsTimelineView.showTooltip("TimelineSortTooltip"); }); this._timelineSortSelector.addEventListener("mouseout", Plugin.Tooltip.dismiss); this._timelineSortSelector.addEventListener("change", this.onSortChanged.bind(this)); timelineSortDuration.innerText = Plugin.Resources.getString("TimelineSortDuration"); timelineSortStartTime.innerText = Plugin.Resources.getString("TimelineSortStartTime"); this._listControl = new EventsTimelineListControl(this._timelineView); this._listControl.dataColumnWidthChanged = this.onListControlDataColumnWidthChanged.bind(this); this._parentContainer.appendChild(this.rootElement); this._onResizeHandler = function () { _this._columnsCssRule = _this.getColumnsCssRule(); _this._listControl.invalidateSizeCache(); _this.updateDetailsDivider(); _this.render(); }; this.registerResizeEvent(); this._eventHeaderDivider = this.findElement("timelineEventHeaderDivider"); this._eventHeaderDivider.style.left = this._listControl.eventNameColumnWidth + "px"; this._eventHeaderLabel = this.findElement("timelineEventHeaderLabel"); this._eventHeaderLabel.innerText = Plugin.Resources.getString("EventHeaderLabel"); this._eventHeaderLabel.style.width = this._listControl.eventNameColumnWidth + "px"; this._rulerContainer = this.findElement("timelineRuler"); this._columnsCssRule = this.getColumnsCssRule(); this._eventDetailsDivider = new VisualProfiler.Divider(this._timelineViewAndDetailsContainer, 0); this._eventDetailsDivider.onMoved = this.onResizeDetails.bind(this); } Object.defineProperty(EventsTimelineView.prototype, "viewModel", { set: function (value) { this.unregisterViewModelEvents(); this._viewModel = value; this.createRuler(); this.updateDetailsPane(null); this.updateDetailsDivider(); this.registerViewModelEvents(); }, enumerable: true, configurable: true }); EventsTimelineView.prototype.render = function () { if(this._viewModel) { try { this.unregisterResizeEvent(); this._viewModel.sort = parseInt(this._timelineSortSelector.value); var dataSource = this._viewModel.getEvents(); var timeSpan = this._viewModel.timeSpan; this.updateTimelineLabel(timeSpan); this._listControl.dataSource = dataSource; this._listControl.timeSpan = timeSpan; this._listControl.viewModel = this._viewModel; this._listControl.selectedItemChanged = this.onSelectedEventChanged.bind(this); this._listControl.render(); this.setRulerRect(); this._rulerScale.timeRange = timeSpan; this._rulerScale.render(); this._listControl.renderVerticalRulerLines(); }finally { this.registerResizeEvent(); } } }; EventsTimelineView.prototype.createRuler = function () { var _this = this; var lifecycleData = []; var userMarkData = []; if(this._rulerScale) { this._rulerScale.deinitialize(); } var lifecycleMarks = this._viewModel.getMarks(0); for(var markIndex = 0; markIndex < lifecycleMarks.length; markIndex++) { (function (mark) { var markData = new VisualProfiler.Graph.MarkData(VisualProfiler.TimeStamp.fromNanoseconds(mark.time), function () { return _this._viewModel.getMarkTooltip(mark); }); lifecycleData.push(markData); })(lifecycleMarks[markIndex]); } var userMarks = this._viewModel.getMarks(1); for(var markIndex = 0; markIndex < userMarks.length; markIndex++) { (function (mark) { var markData = new VisualProfiler.Graph.MarkData(VisualProfiler.TimeStamp.fromNanoseconds(mark.time), function () { return _this._viewModel.getMarkTooltip(mark); }); userMarkData.push(markData); })(userMarks[markIndex]); } this._rulerScale = new VisualProfiler.Graph.RulerScale({ containerId: this._rulerContainer.id, timeRange: new VisualProfiler.TimeSpan(), series: [ { id: "LifecycleMark", label: Plugin.Resources.getString("RulerLifecycleMarkLabel"), data: lifecycleData, type: VisualProfiler.Graph.MarkType.LifeCycleEvent }, { id: "UserMark", label: Plugin.Resources.getString("RulerUserMarkLabel"), data: userMarkData, type: VisualProfiler.Graph.MarkType.UserMark } ] }); }; EventsTimelineView.prototype.getColumnsCssRule = function () { return EventsTimelineView.getCssRule("VisualProfiler.css", ".mainView .dataViewContainer .detailedViewsContainer .timelineViewContainer .timelineViewGroup .timelineViewAndDetails"); }; EventsTimelineView.prototype.onResizeDetails = function (offsetX) { this.updateColumnWidth(offsetX); VisualProfiler.Program.triggerResize(); }; EventsTimelineView.prototype.onSelectedEventChanged = function (event) { this._viewModel.selectedEvent = event; }; EventsTimelineView.prototype.onListControlDataColumnWidthChanged = function () { this._eventHeaderDivider.style.left = this._listControl.eventNameColumnWidth + "px"; this._eventHeaderLabel.style.width = this._listControl.eventNameColumnWidth + "px"; this.setRulerRect(); this._rulerScale.render(); }; EventsTimelineView.prototype.onSortChanged = function (e) { VisualProfiler.Program.traceWriter.raiseEvent(Common.TraceEvents.Timeline_GridSort_Start); this.render(); Notifications.notify(VisualProfiler.ResponsivenessNotifications.SortFinishedOnGrid); VisualProfiler.Program.traceWriter.raiseEvent(Common.TraceEvents.Timeline_GridSort_Stop); }; EventsTimelineView.prototype.onTimeSpanChanged = function () { this.render(); Notifications.notify(VisualProfiler.ResponsivenessNotifications.GridUpdatedForTimeSelection); VisualProfiler.Program.traceWriter.raiseEvent(Common.TraceEvents.Timeline_GridUpdatedForTimeSelection); }; EventsTimelineView.prototype.onViewModelSelectionChanged = function (event) { this._listControl.selectedItem = event; this.updateDetailsPane(event); }; EventsTimelineView.prototype.registerResizeEvent = function () { VisualProfiler.Program.addEventListener(VisualProfiler.ProgramEvents.Resize, this._onResizeHandler); }; EventsTimelineView.prototype.registerViewModelEvents = function () { if(this._viewModel) { this._viewModel.timeSpanChanged = this.onTimeSpanChanged.bind(this); this._viewModel.selectedEventChanged = this.onViewModelSelectionChanged.bind(this); } }; EventsTimelineView.prototype.setDetailsDividerBounds = function () { var containerWidth = this._timelineViewAndDetailsContainer.offsetWidth; this._eventDetailsDivider.minX = containerWidth / 2; this._eventDetailsDivider.maxX = containerWidth; }; EventsTimelineView.prototype.setRulerRect = function () { var rulerMarginLeft = this._listControl.dataColumnLeft + "px"; var rulerWidth = this._listControl.dataColumnWidth + "px"; if(this._rulerContainer.style.marginLeft !== rulerMarginLeft || this._rulerContainer.style.width !== rulerWidth) { this._rulerContainer.style.marginLeft = rulerMarginLeft; this._rulerContainer.style.width = rulerWidth; this._rulerScale.invalidateSizeCache(); } }; EventsTimelineView.prototype.updateDetailsPane = function (event) { var detailsView; this._timelineDetailsHeader.classList.remove(this._eventDetailsHeaderClass); if(event === null) { this._eventDetailsTitle.innerText = ""; this._eventDetailsHeaderClass = "emptyHeader"; detailsView = new EventDetailsView(null, null, null); } else { this._eventDetailsTitle.innerText = event.name; this._eventDetailsHeaderClass = event.getCssClass(); var details = this._viewModel.getEventDetails(event); var sectorData = this._viewModel.getEvents().getAggregatedDescendantsForEvent(event.id); detailsView = new EventDetailsView(event, details, sectorData); } this._timelineDetailsHeader.classList.add(this._eventDetailsHeaderClass); this._timelineDetailsPaneContainer.innerHTML = ""; this._timelineDetailsPaneContainer.appendChild(detailsView.rootElement); Notifications.notify(VisualProfiler.ResponsivenessNotifications.DetailsPaneLoaded); }; EventsTimelineView.prototype.updateColumnWidth = function (offsetX) { if(offsetX === null || typeof offsetX === "undefined") { offsetX = this._eventDetailsDivider.offsetX; } var columns = this._columnsCssRule.style.msGridColumns.split(' '); columns[2] = (this._timelineViewAndDetailsContainer.clientWidth - offsetX) + "px"; this._columnsCssRule.style.msGridColumns = columns.join(' '); }; EventsTimelineView.prototype.updateDetailsDivider = function () { this.setDetailsDividerBounds(); this._eventDetailsDivider.offsetX = this._timelineView.offsetWidth; this.updateColumnWidth(this._eventDetailsDivider.offsetX + 3); }; EventsTimelineView.prototype.updateTimelineLabel = function (timeSpan) { this._timelineLabel.innerText = Plugin.Resources.getString("TimelineLabel") + ": " + VisualProfiler.Graph.RulerUtilities.formatTitleTime(timeSpan.elapsed); }; EventsTimelineView.prototype.unregisterResizeEvent = function () { VisualProfiler.Program.removeEventListener(VisualProfiler.ProgramEvents.Resize, this._onResizeHandler); }; EventsTimelineView.prototype.unregisterViewModelEvents = function () { if(this._viewModel) { this._viewModel.timeSpanChanged = null; this._viewModel.selectedEventChanged = null; } }; EventsTimelineView.getCssRule = function getCssRule(styleSheetName, selectorName) { var styleSheet = document.styleSheets[styleSheetName]; if(styleSheet) { for(var i = 0; i < styleSheet.rules.length; ++i) { var rule = styleSheet.rules[i]; if(rule && rule.selectorText === selectorName) { return rule; } } } return null; }; EventsTimelineView.showTooltip = function showTooltip(resourceId) { var config = { content: Plugin.Resources.getString(resourceId) }; Plugin.Tooltip.show(config); }; return EventsTimelineView; })(Common.Controls.TemplateControl); VisualProfiler.EventsTimelineView = EventsTimelineView; })(VisualProfiler || (VisualProfiler = {})); //@ sourceMappingURL=EventsTimelineView.js.map // CpuUsageView.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var VisualProfiler; (function (VisualProfiler) { "use strict"; var CpuUsageModel = (function () { function CpuUsageModel(session) { this._session = session; } CpuUsageModel.prototype.getCpuUsage = function (duration, granularity) { return this._session.queryCPUUsage(duration.begin.nsec, duration.end.nsec, granularity); }; return CpuUsageModel; })(); VisualProfiler.CpuUsageModel = CpuUsageModel; var CpuUsageViewModel = (function () { function CpuUsageViewModel(model, globalRuler) { this.barGap = 1; this.barWidth = 4; this.rightPadding = 40; this.yAxisWidth = 34; this._model = model; this._globalRuler = globalRuler; this._globalRuler.addEventListener(VisualProfiler.GlobalRuler.ActiveRangeChangedEventType, this.onActiveRangeChanged.bind(this)); this._globalRuler.addEventListener(VisualProfiler.GlobalRuler.SelectionChangedEventType, this.onSelectionChanged.bind(this)); } Object.defineProperty(CpuUsageViewModel.prototype, "activeRange", { get: function () { return this._globalRuler.activeRange; }, enumerable: true, configurable: true }); Object.defineProperty(CpuUsageViewModel.prototype, "bucketWidth", { get: function () { return this.barGap + this.barWidth; }, enumerable: true, configurable: true }); Object.defineProperty(CpuUsageViewModel.prototype, "selection", { get: function () { return this._selection; }, set: function (value) { this._selection = value; this._globalRuler.setSelection(value, false); }, enumerable: true, configurable: true }); Object.defineProperty(CpuUsageViewModel.prototype, "granularity", { get: function () { var graphDuration = this.activeRange.elapsed.nsec; if(graphDuration <= 0 || this.viewWidth <= 0) { return 0; } return Math.floor(this.bucketWidth / this.viewWidth * graphDuration); }, enumerable: true, configurable: true }); CpuUsageViewModel.prototype.getCpuUsage = function () { var granularity = this.granularity; if(granularity <= 0) { return []; } var cpuData = this._model.getCpuUsage(this.activeRange, this.granularity); var chartData = cpuData.map(function (CpuUsage) { return { x: CpuUsage.time, height: CpuUsage.utilization, series: CpuUsage.category, attachedObject: CpuUsage }; }); return chartData; }; CpuUsageViewModel.prototype.getSeries = function () { var seriesInfo = []; seriesInfo.push(this.createDataSeriesInfo("Loading_Category", "LoadingLegendTooltip", "dataLoading", 1)); seriesInfo.push(this.createDataSeriesInfo("Scripting_Category", "ScriptingLegendTooltip", "dataScripting", 2)); seriesInfo.push(this.createDataSeriesInfo("GC_Category", "GCLegendTooltip", "dataScriptingGc", 3)); seriesInfo.push(this.createDataSeriesInfo("Styling_Category", "StylingLegendTooltip", "dataStyling", 4)); seriesInfo.push(this.createDataSeriesInfo("Rendering_Category", "RenderingLegendTooltip", "dataRendering", 5)); seriesInfo.push(this.createDataSeriesInfo("ImageDecoding_Category", "ImageDecodingLegendTooltip", "dataImageDecoding", 6)); seriesInfo.push(this.createDataSeriesInfo("Unknown_Category", "UnknownLegendTooltip", "dataOther", 7)); return seriesInfo; }; CpuUsageViewModel.prototype.getVerticalRulerLinePositions = function () { return VisualProfiler.Graph.RulerUtilities.getVerticalLinePositions(this.activeRange, this.viewWidth); }; CpuUsageViewModel.prototype.createDataSeriesInfo = function (categoryName, tooltipResource, cssClass, sortOrder) { return new VisualProfiler.DataSeriesInfo(Plugin.Resources.getString(categoryName), categoryName, cssClass, sortOrder, Plugin.Resources.getString(tooltipResource)); }; CpuUsageViewModel.prototype.onActiveRangeChanged = function (args) { if(this.activeRangeChanged) { this.activeRangeChanged(); } }; CpuUsageViewModel.prototype.onSelectionChanged = function (args) { var newSelection = args.data.newSelection; if(this._selection && this._selection.equals(newSelection)) { return; } if(this.selectionChanged) { this.selectionChanged(newSelection); } }; return CpuUsageViewModel; })(); VisualProfiler.CpuUsageViewModel = CpuUsageViewModel; var CpuUsageView = (function (_super) { __extends(CpuUsageView, _super); function CpuUsageView(containerId) { var _this = this; _super.call(this, "cpuUsageView"); this._minWidth = 200; this._resizeRenderDelay = 50; var parentContainer = document.getElementById(containerId); if(!containerId) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1034")); } var resizeTimerId; VisualProfiler.Program.addEventListener(VisualProfiler.ProgramEvents.Resize, function () { clearTimeout(resizeTimerId); resizeTimerId = setTimeout(function () { if(_this.viewModel) { _this.render(); } }, _this._resizeRenderDelay); }); parentContainer.appendChild(this.rootElement); } Object.defineProperty(CpuUsageView.prototype, "chartPresenter", { get: function () { return this._chartPresenter; }, enumerable: true, configurable: true }); Object.defineProperty(CpuUsageView.prototype, "minSelectionWidthInPixels", { set: function (value) { this._minSelectionWidthInPixels = value; }, enumerable: true, configurable: true }); Object.defineProperty(CpuUsageView.prototype, "viewModel", { get: function () { return this._viewModel; }, set: function (model) { this.unregisterViewModelEvents(); this.reset(); this._viewModel = model; this.registerViewModelEvents(); }, enumerable: true, configurable: true }); CpuUsageView.prototype.render = function () { this.setWidth(); this.setupChart(); this.showSelection(); }; CpuUsageView.prototype.setupChart = function () { var options = CpuUsageView.getChartOptions(this._viewModel, this.onChartSelectionChanged.bind(this), CpuUsageView.createTooltip, CpuUsageView.createAriaLabel, this._minSelectionWidthInPixels || 10); this._chartPresenter = new VisualProfiler.StackedBarChartPresenter(options); this.addSeries(); this.addVerticalRulerLines(); this.addCpuData(); if(!this._chart) { this._chart = new VisualProfiler.StackedBarChartView(); this.appendChild(this._chart); } this._chart.presenter = this._chartPresenter; }; CpuUsageView.prototype.addCpuData = function () { var chartData = this._viewModel.getCpuUsage(); this._chartPresenter.addData(chartData); }; CpuUsageView.prototype.addSeries = function () { this._chartPresenter.addSeries(this._viewModel.getSeries()); }; CpuUsageView.prototype.addVerticalRulerLines = function () { this._chartPresenter.verticalRulerLinePositions = this._viewModel.getVerticalRulerLinePositions(); }; CpuUsageView.prototype.onActiveRangeChanged = function () { this.render(); }; CpuUsageView.prototype.onChartSelectionChanged = function (minValue, maxValue) { var begin = VisualProfiler.TimeStamp.fromNanoseconds(minValue); var end = VisualProfiler.TimeStamp.fromNanoseconds(maxValue); this._viewModel.selection = new VisualProfiler.TimeSpan(begin, end); }; CpuUsageView.prototype.onRulerSelectionChanged = function (selection) { this._viewModel.selection = selection; this.showSelection(); }; CpuUsageView.prototype.registerViewModelEvents = function () { if(this._viewModel) { this._viewModel.activeRangeChanged = this.onActiveRangeChanged.bind(this); this._viewModel.selectionChanged = this.onRulerSelectionChanged.bind(this); } }; CpuUsageView.prototype.reset = function () { if(this._chart) { this.removeChild(this._chart); this._chart = null; } }; CpuUsageView.prototype.setWidth = function () { this._viewModel.viewWidth = Math.max(this.rootElement.offsetWidth, this._minWidth) - this._viewModel.yAxisWidth - this._viewModel.rightPadding; }; CpuUsageView.prototype.showSelection = function () { this._chartPresenter.selection = this._viewModel.selection; }; CpuUsageView.prototype.unregisterViewModelEvents = function () { if(this._viewModel) { this._viewModel.activeRangeChanged = null; this._viewModel.selectionChanged = null; } }; CpuUsageView.getChartOptions = function getChartOptions(viewModel, selectionCallback, tooltipCallback, ariaLabelCallback, minSelectionWidthInPixels) { return { ariaDescription: Plugin.Resources.getString("CPUGraphAriaLabel"), height: 88, width: viewModel.viewWidth + viewModel.yAxisWidth + viewModel.rightPadding, title: Plugin.Resources.getString("CPUChartTitle"), minX: viewModel.activeRange.begin.nsec, maxX: viewModel.activeRange.end.nsec, minY: 0, minYHeight: 100, yAxisMarkValues: [ 100, 200 ], barWidth: viewModel.barWidth, barGap: viewModel.barGap, showStackGap: true, minSelectionWidthInPixels: minSelectionWidthInPixels, selectionCallback: selectionCallback, tooltipCallback: tooltipCallback, ariaLabelCallback: ariaLabelCallback, displayLegend: true, yAxisWidth: viewModel.yAxisWidth, rightPadding: viewModel.rightPadding }; }; CpuUsageView.createTooltip = function createTooltip(CpuUsage) { var tip = "
          " + Plugin.Resources.getString("CPUTooltipCategoryLabel") + ": " + Plugin.Resources.getString(CpuUsage.category) + "
          "; tip += "
          " + Plugin.Resources.getString("CPUTooltipUtilizationLabel") + ": " + ((Math.round(CpuUsage.utilization * 100) / 100)).toLocaleString(undefined, { minimumFractionDigits: 2 }) + "%
          "; return tip; }; CpuUsageView.createAriaLabel = function createAriaLabel(CpuUsage) { var percentageUtilization = ((Math.round(CpuUsage.utilization * 100) / 100)).toLocaleString(undefined, { minimumFractionDigits: 2 }); var formattedTime = VisualProfiler.FormattingHelpers.getPrettyPrintTime(VisualProfiler.TimeStamp.fromNanoseconds(CpuUsage.time)); return Plugin.Resources.getString("CPUBarAriaLabel", Plugin.Resources.getString(CpuUsage.category), percentageUtilization, formattedTime); }; return CpuUsageView; })(Common.Controls.TemplateControl); VisualProfiler.CpuUsageView = CpuUsageView; })(VisualProfiler || (VisualProfiler = {})); //@ sourceMappingURL=CpuUsageView.js.map // FrameRateView.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var VisualProfiler; (function (VisualProfiler) { "use strict"; var FrameRateModel = (function () { function FrameRateModel(session) { this._session = session; } FrameRateModel.prototype.getFrameRate = function (from, to) { return this._session.queryFrameRate(from, to); }; return FrameRateModel; })(); VisualProfiler.FrameRateModel = FrameRateModel; var FrameRateViewModel = (function () { function FrameRateViewModel(model, globalRuler) { this.leftPadding = 34; this.rightPadding = 34; this.leftScaleBorder = 1; this.rightScaleBorder = 1; this._model = model; this._globalRuler = globalRuler; this.updateActiveRange(this._globalRuler.totalRange); this._globalRuler.addEventListener(VisualProfiler.GlobalRuler.ActiveRangeChangedEventType, this.onActiveRangeChanged.bind(this)); this._globalRuler.addEventListener(VisualProfiler.GlobalRuler.SelectionChangedEventType, this.onSelectionChanged.bind(this)); } Object.defineProperty(FrameRateViewModel.prototype, "totalScaleWidth", { get: function () { return this.leftPadding + this.rightPadding + this.leftScaleBorder + this.rightScaleBorder; }, enumerable: true, configurable: true }); FrameRateViewModel.prototype.getFrameRatePoints = function () { var result = []; var frameRates = this._model.getFrameRate(this.activeRange.begin.nsec, this.activeRange.end.nsec); for(var i = 0; i < frameRates.length; i++) { var frameRate = frameRates[i]; result.push(new VisualProfiler.Graph.Point2d(frameRate.time, Math.floor(frameRate.fps))); } return result; }; FrameRateViewModel.prototype.getVerticalRulerLinePositions = function (width) { return VisualProfiler.Graph.RulerUtilities.getVerticalLinePositions(this.activeRange, width); }; FrameRateViewModel.prototype.setSelection = function (selection) { this._selection = selection; this._globalRuler.setSelection(selection, false); }; FrameRateViewModel.prototype.onActiveRangeChanged = function (args) { this.updateActiveRange(this._globalRuler.activeRange); }; FrameRateViewModel.prototype.onSelectionChanged = function (args) { var newSelection = args.data.newSelection; if(this._selection && this._selection.equals(newSelection)) { return; } if(this.selectionChanged) { this.selectionChanged(newSelection); } }; FrameRateViewModel.prototype.updateActiveRange = function (newTimeRange) { if(!this.activeRange || !this.activeRange.equals(newTimeRange)) { this.activeRange = newTimeRange; if(this.activeRangeChanged) { this.activeRangeChanged(); } } }; return FrameRateViewModel; })(); VisualProfiler.FrameRateViewModel = FrameRateViewModel; var FrameRateView = (function (_super) { __extends(FrameRateView, _super); function FrameRateView(containerId) { _super.call(this, "frameRateView"); this._frameRateControl = this.findElement("frameRateControl"); var parentContainer = document.getElementById(containerId); if(!containerId) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1034")); } parentContainer.appendChild(this.rootElement); } Object.defineProperty(FrameRateView.prototype, "minSelectionWidthInPixels", { set: function (value) { this._minSelectionWidthInPixels = value; }, enumerable: true, configurable: true }); Object.defineProperty(FrameRateView.prototype, "viewModel", { set: function (model) { this.unregisterViewModelEvents(); this._viewModel = model; this.setupGraph(); this.registerViewModelEvents(); }, enumerable: true, configurable: true }); FrameRateView.prototype.render = function () { this._frameRatePresenter.render(); }; FrameRateView.prototype.setupGraph = function () { var _this = this; var fpsText = Plugin.Resources.getString("AFG_Unit"); var fpsLegendText = Plugin.Resources.getString("AFG_Legend"); var graphConfig = { containerId: this._frameRateControl.id, series: [ { legend: fpsLegendText, counterId: "fps", colorSchemeType: VisualProfiler.Graph.ColorSchemeType.VizSurfaceChartreuseGreenDark } ], xRange: new VisualProfiler.Graph.MinMax(this._viewModel.activeRange.begin.nsec, this._viewModel.activeRange.end.nsec), axes: [ { label: "30 " + fpsText, value: 30 }, { label: "60 " + fpsText, value: 60 } ], leftPadding: this._viewModel.leftPadding, rightPadding: this._viewModel.rightPadding, minSelectionWidthInPixels: this._minSelectionWidthInPixels, selectionCallback: this.onChartSelectionChanged.bind(this), getVerticalRulerLinePositions: function (width) { return _this._viewModel.getVerticalRulerLinePositions(width); }, height: 58, leftScaleBorder: this._viewModel.leftScaleBorder, rightScaleBorder: this._viewModel.rightScaleBorder }; this._frameRatePresenter = new VisualProfiler.Graph.AnimationFrameGraph(graphConfig); var points = this._viewModel.getFrameRatePoints(); this._frameRatePresenter.setSeriesDataSource("fps", points); }; FrameRateView.prototype.unregisterViewModelEvents = function () { if(this._viewModel) { this._viewModel.activeRangeChanged = null; this._viewModel.selectionChanged = null; } }; FrameRateView.prototype.registerViewModelEvents = function () { if(this._viewModel) { this._viewModel.activeRangeChanged = this.onActiveRangeChanged.bind(this); this._viewModel.selectionChanged = this.onRulerSelectionChanged.bind(this); } }; FrameRateView.prototype.onActiveRangeChanged = function () { if(this._frameRatePresenter) { this._frameRatePresenter.setViewportRange(new VisualProfiler.Graph.MinMax(this._viewModel.activeRange.begin.nsec, this._viewModel.activeRange.end.nsec)); } }; FrameRateView.prototype.onChartSelectionChanged = function (selection) { this._viewModel.setSelection(selection); }; FrameRateView.prototype.onRulerSelectionChanged = function (selection) { this._viewModel.setSelection(selection); this._frameRatePresenter.selection = selection; }; return FrameRateView; })(Common.Controls.TemplateControl); VisualProfiler.FrameRateView = FrameRateView; })(VisualProfiler || (VisualProfiler = {})); //@ sourceMappingURL=FrameRateView.js.map // ToolbarView.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var VisualProfiler; (function (VisualProfiler) { "use strict"; var ToolbarViewModel = (function () { function ToolbarViewModel(controller) { this._controller = controller; this._startProfilingEnabled = true; this._stopProfilingEnabled = false; this._zoomInEnabled = false; this._resetZoomEnabled = false; this._clearSelectionEnabled = false; this._firstZoomSelection = null; this._eventManager = new Plugin.Utilities.EventManager(); } ToolbarViewModel.ClearSelectionEnabledChangedEventType = "clearSelectionEnabledChanged"; ToolbarViewModel.MinimumZoomLevelInMs = 10; ToolbarViewModel.ResetZoomEnabledChangedEventType = "resetZoomEnabledChanged"; ToolbarViewModel.StartProfilingEnabledChangedEventType = "startProfilingEnabledChanged"; ToolbarViewModel.StopProfilingEnabledChangedEventType = "stopProfilingEnabledChanged"; ToolbarViewModel.ZoomInEnabledChangedEventType = "zoomInEnabledChanged"; Object.defineProperty(ToolbarViewModel.prototype, "clearSelectionEnabled", { get: function () { return this._clearSelectionEnabled; }, set: function (value) { if(value !== this._clearSelectionEnabled) { this._clearSelectionEnabled = value; this._eventManager.dispatchEvent(ToolbarViewModel.ClearSelectionEnabledChangedEventType, { enabled: this._clearSelectionEnabled }); } }, enumerable: true, configurable: true }); Object.defineProperty(ToolbarViewModel.prototype, "isAtBreakpoint", { get: function () { return this._isAtBreakpoint; }, set: function (isAtBreakpoint) { this._isAtBreakpoint = isAtBreakpoint; this._eventManager.dispatchEvent(ToolbarViewModel.StartProfilingEnabledChangedEventType, { enabled: this.startProfilingEnabled }); }, enumerable: true, configurable: true }); Object.defineProperty(ToolbarViewModel.prototype, "resetZoomEnabled", { get: function () { return this._resetZoomEnabled; }, set: function (value) { if(value !== this._resetZoomEnabled) { this._resetZoomEnabled = value; this._eventManager.dispatchEvent(ToolbarViewModel.ResetZoomEnabledChangedEventType, { enabled: this._resetZoomEnabled }); } }, enumerable: true, configurable: true }); Object.defineProperty(ToolbarViewModel.prototype, "startProfilingEnabled", { get: function () { return this._startProfilingEnabled && !this._isAtBreakpoint; }, set: function (value) { if(value !== this._startProfilingEnabled) { this._startProfilingEnabled = value; this._eventManager.dispatchEvent(ToolbarViewModel.StartProfilingEnabledChangedEventType, { enabled: this.startProfilingEnabled }); } }, enumerable: true, configurable: true }); Object.defineProperty(ToolbarViewModel.prototype, "stopProfilingEnabled", { get: function () { return this._stopProfilingEnabled; }, set: function (value) { if(value !== this._stopProfilingEnabled) { this._stopProfilingEnabled = value; this._eventManager.dispatchEvent(ToolbarViewModel.StopProfilingEnabledChangedEventType, { enabled: this._stopProfilingEnabled }); } }, enumerable: true, configurable: true }); Object.defineProperty(ToolbarViewModel.prototype, "zoomInEnabled", { get: function () { return this._zoomInEnabled; }, set: function (value) { if(value !== this._zoomInEnabled) { this._zoomInEnabled = value; this._eventManager.dispatchEvent(ToolbarViewModel.ZoomInEnabledChangedEventType, { enabled: this._zoomInEnabled }); } }, enumerable: true, configurable: true }); ToolbarViewModel.prototype.addEventListener = function (eventType, func) { this._eventManager.addEventListener(eventType, func); }; ToolbarViewModel.prototype.clearSelection = function () { if(this._globalRuler) { this._globalRuler.setSelection(this._globalRuler.activeRange); } }; ToolbarViewModel.prototype.removeEventListener = function (eventType, func) { this._eventManager.removeEventListener(eventType, func); }; ToolbarViewModel.prototype.resetZoom = function () { if(this._globalRuler) { this._globalRuler.setActiveRange(this._globalRuler.totalRange); this._globalRuler.setSelection(this._firstZoomSelection); this._firstZoomSelection = null; } Notifications.notify(VisualProfiler.ResponsivenessNotifications.ResetZoomFinished); }; ToolbarViewModel.prototype.setGlobalRuler = function (globalRuler) { if(this._globalRuler) { this._globalRuler.removeEventListener(VisualProfiler.GlobalRuler.ActiveRangeChangedEventType, this.onActiveRangeChanged.bind(this)); this._globalRuler.removeEventListener(VisualProfiler.GlobalRuler.SelectionChangedEventType, this.onSelectionChanged.bind(this)); } this._globalRuler = globalRuler; if(this._globalRuler) { this._globalRuler.addEventListener(VisualProfiler.GlobalRuler.ActiveRangeChangedEventType, this.onActiveRangeChanged.bind(this)); this._globalRuler.addEventListener(VisualProfiler.GlobalRuler.SelectionChangedEventType, this.onSelectionChanged.bind(this)); } }; ToolbarViewModel.prototype.startProfiling = function () { var _this = this; this.clearSelectionEnabled = false; this.resetZoomEnabled = false; this.startProfilingEnabled = false; this.stopProfilingEnabled = false; this.zoomInEnabled = false; this._controller.startProfiling().done(function () { _this.stopProfilingEnabled = true; }, function (err) { _this.startProfilingEnabled = true; VisualProfiler.Program.reportError(err, Plugin.Resources.getErrorString("JSPerf.1067")); }); }; ToolbarViewModel.prototype.stopProfiling = function () { var _this = this; this.clearSelectionEnabled = false; this.resetZoomEnabled = false; this.startProfilingEnabled = false; this.stopProfilingEnabled = false; this.zoomInEnabled = false; this._controller.stopProfiling().done(function () { _this.startProfilingEnabled = true; }, function (err) { _this.startProfilingEnabled = true; VisualProfiler.Program.reportError(err, Plugin.Resources.getErrorString("JSPerf.1068")); }); }; ToolbarViewModel.prototype.zoomIn = function () { VisualProfiler.Program.traceWriter.raiseEvent(Common.TraceEvents.Timeline_Zoom_Start); if(this._globalRuler) { if(this._firstZoomSelection === null) { this._firstZoomSelection = this._globalRuler.selection; } this._globalRuler.setActiveRange(this._globalRuler.selection); this.clearSelection(); } Notifications.notify(VisualProfiler.ResponsivenessNotifications.ZoomInFinished); VisualProfiler.Program.traceWriter.raiseEvent(Common.TraceEvents.Timeline_Zoom_Stop); }; ToolbarViewModel.prototype.onActiveRangeChanged = function (args) { this.resetZoomEnabled = !this._globalRuler.activeRange.equals(this._globalRuler.totalRange); }; ToolbarViewModel.prototype.onSelectionChanged = function (args) { var clearSelectionAllowed = !args.data.newSelection.equals(this._globalRuler.activeRange); this.clearSelectionEnabled = clearSelectionAllowed; this.zoomInEnabled = clearSelectionAllowed && (args.data.newSelection.elapsed.msec > ToolbarViewModel.MinimumZoomLevelInMs); }; return ToolbarViewModel; })(); VisualProfiler.ToolbarViewModel = ToolbarViewModel; var BaseToolbarView = (function (_super) { __extends(BaseToolbarView, _super); function BaseToolbarView(templateName, setTooltip) { var _this = this; _super.call(this, templateName); this._zoomInButton = this.findElement("zoomInButton"); this._resetZoomButton = this.findElement("resetZoomButton"); this._clearSelectionButton = this.findElement("clearSelectionButton"); this._onClearSelectionStatusChanged = function () { return _this.updateUi(); }; this._onResetZoomStatusChanged = function () { return _this.updateUi(); }; this._onZoomInStatusChanged = function () { return _this.updateUi(); }; Common.ButtonHelpers.setupButton(this._clearSelectionButton, setTooltip ? "ToolbarButtonClearSelection" : null, this.onClearSelectionClick.bind(this)); Common.ButtonHelpers.setupButton(this._resetZoomButton, setTooltip ? "ToolbarButtonResetZoom" : null, this.onResetZoomClick.bind(this)); Common.ButtonHelpers.setupButton(this._zoomInButton, setTooltip ? "ToolbarButtonZoomIn" : null, this.onZoomInClick.bind(this)); } Object.defineProperty(BaseToolbarView.prototype, "viewModel", { get: function () { return this._viewModel; }, set: function (model) { this.unregisterViewModelEvents(); this._viewModel = model; this.registerViewModelEvents(); this.updateUi(); }, enumerable: true, configurable: true }); BaseToolbarView.prototype.registerViewModelEvents = function () { if(this._viewModel) { this._viewModel.addEventListener(ToolbarViewModel.ClearSelectionEnabledChangedEventType, this._onClearSelectionStatusChanged); this._viewModel.addEventListener(ToolbarViewModel.ResetZoomEnabledChangedEventType, this._onResetZoomStatusChanged); this._viewModel.addEventListener(ToolbarViewModel.ZoomInEnabledChangedEventType, this._onZoomInStatusChanged); } }; BaseToolbarView.prototype.updateUi = function () { Common.ButtonHelpers.changeButtonStatus(this._clearSelectionButton, this._viewModel.clearSelectionEnabled); Common.ButtonHelpers.changeButtonStatus(this._resetZoomButton, this._viewModel.resetZoomEnabled); Common.ButtonHelpers.changeButtonStatus(this._zoomInButton, this._viewModel.zoomInEnabled); }; BaseToolbarView.prototype.unregisterViewModelEvents = function () { if(this._viewModel) { this._viewModel.removeEventListener(ToolbarViewModel.ClearSelectionEnabledChangedEventType, this._onClearSelectionStatusChanged); this._viewModel.removeEventListener(ToolbarViewModel.ResetZoomEnabledChangedEventType, this._onResetZoomStatusChanged); this._viewModel.removeEventListener(ToolbarViewModel.ZoomInEnabledChangedEventType, this._onZoomInStatusChanged); } }; BaseToolbarView.prototype.onClearSelectionClick = function (event) { if(this._viewModel && (event.type === "click" || event.keyCode === Common.KeyCodes.ENTER || event.keyCode === Common.KeyCodes.SPACE)) { this._viewModel.clearSelection(); } }; BaseToolbarView.prototype.onResetZoomClick = function (event) { if(this._viewModel && (event.type === "click" || event.keyCode === Common.KeyCodes.ENTER || event.keyCode === Common.KeyCodes.SPACE)) { this._viewModel.resetZoom(); } }; BaseToolbarView.prototype.onZoomInClick = function (event) { if(this._viewModel && (event.type === "click" || event.keyCode === Common.KeyCodes.ENTER || event.keyCode === Common.KeyCodes.SPACE)) { this._viewModel.zoomIn(); } }; return BaseToolbarView; })(Common.Controls.TemplateControl); VisualProfiler.BaseToolbarView = BaseToolbarView; var F12ToolbarView = (function (_super) { __extends(F12ToolbarView, _super); function F12ToolbarView(containerId) { var _this = this; _super.call(this, "f12ToolbarViewTemplate", true); this.findElement("title").innerText = Plugin.Resources.getString("F12ToolTitle"); this._startButton = this.findElement("startToolbarButton"); this._stopButton = this.findElement("stopToolbarButton"); this._onStartButtonStatusChanged = function () { return _this.updateUi(); }; this._onStopButtonStatusChanged = function () { return _this.updateUi(); }; Common.ButtonHelpers.setupButton(this._startButton, "F12StartButtonTooltip", this.onStartClick.bind(this)); Common.ButtonHelpers.setupButton(this._stopButton, "F12StopButtonTooltip", this.onStopClick.bind(this)); var parentContainer = document.getElementById(containerId); if(!containerId) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1034")); } parentContainer.appendChild(this.rootElement); } F12ToolbarView.prototype.registerViewModelEvents = function () { _super.prototype.registerViewModelEvents.call(this); if(this.viewModel) { this.viewModel.addEventListener(ToolbarViewModel.StartProfilingEnabledChangedEventType, this._onStartButtonStatusChanged); this.viewModel.addEventListener(ToolbarViewModel.StopProfilingEnabledChangedEventType, this._onStopButtonStatusChanged); } }; F12ToolbarView.prototype.updateUi = function () { _super.prototype.updateUi.call(this); Common.ButtonHelpers.changeButtonStatus(this._startButton, this.viewModel.startProfilingEnabled); Common.ButtonHelpers.changeButtonStatus(this._stopButton, this.viewModel.stopProfilingEnabled); }; F12ToolbarView.prototype.unregisterViewModelEvents = function () { _super.prototype.unregisterViewModelEvents.call(this); if(this.viewModel) { this.viewModel.removeEventListener(ToolbarViewModel.StartProfilingEnabledChangedEventType, this._onStartButtonStatusChanged); this.viewModel.removeEventListener(ToolbarViewModel.StopProfilingEnabledChangedEventType, this._onStopButtonStatusChanged); } }; F12ToolbarView.prototype.onStartClick = function (event) { if(this.viewModel && (event.type === "click" || event.keyCode === Common.KeyCodes.ENTER || event.keyCode === Common.KeyCodes.SPACE)) { this.viewModel.startProfiling(); } }; F12ToolbarView.prototype.onStopClick = function (event) { if(this.viewModel && (event.type === "click" || event.keyCode === Common.KeyCodes.ENTER || event.keyCode === Common.KeyCodes.SPACE)) { this.viewModel.stopProfiling(); } }; return F12ToolbarView; })(BaseToolbarView); VisualProfiler.F12ToolbarView = F12ToolbarView; var VSToolbarView = (function (_super) { __extends(VSToolbarView, _super); function VSToolbarView(containerId) { _super.call(this, "toolbarViewTemplate", false); (this.findElement("clearSelectionText")).innerText = Plugin.Resources.getString("ToolbarButtonClearSelection"); (this.findElement("resetZoomText")).innerText = Plugin.Resources.getString("ToolbarButtonResetZoom"); (this.findElement("zoomInText")).innerText = Plugin.Resources.getString("ToolbarButtonZoomIn"); var parentContainer = document.getElementById(containerId); if(!containerId) { throw new Error(Plugin.Resources.getErrorString("JSPerf.1034")); } parentContainer.appendChild(this.rootElement); } return VSToolbarView; })(BaseToolbarView); VisualProfiler.VSToolbarView = VSToolbarView; })(VisualProfiler || (VisualProfiler = {})); //@ sourceMappingURL=ToolbarView.js.map // DonutChartView.ts var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var VisualProfiler; (function (VisualProfiler) { "use strict"; var DonutChartView = (function (_super) { __extends(DonutChartView, _super); function DonutChartView(container) { _super.call(this, container); this.rootElement.tabIndex = 0; this._eventFactory = new VisualProfiler.EventFactory(); this._interval = { begin: 0, beginThreadId: 0, category: "", childrenCount: 0, end: 0, endThreadId: 0, exclusiveDuration: 0, id: -1, isExpanded: false, level: -1, name: "" }; this.initializeEventGroup(); var config = { explosionFactor: 2, radius: 55, strokeWidth: 25, minDonutArcAngle: 10, containerWidth: 250, containerHeight: 200, clockwiseRotation: true }; this._donutChart = new VisualProfiler.DonutChart(this.rootElement, this.onRenderSectorTooltip.bind(this), this.addSectorAriaLabel.bind(this), config); this.rootElement.setAttribute("aria-label", Plugin.Resources.getString("InclusiveTimeAriaLabel")); } DonutChartView.prototype.addData = function (info) { var sectors = this.buildSectors(info); this._donutChart.addSectors(sectors); return sectors.length; }; DonutChartView.prototype.render = function () { this.addHeaderElement(); this._donutChart.render(); }; DonutChartView.prototype.addHeaderElement = function () { var header = Plugin.Resources.getString("InclusiveTimeDetailsHeader"); var div = document.createElement('div'); var span = document.createElement('span'); span.style.color = Plugin.Theme.getValue("plugin-color"); span.style.fontFamily = Plugin.Theme.getValue("plugin-font-family"); span.style.fontSize = Plugin.Theme.getValue("plugin-font-size"); span.style.marginLeft = "10px"; span.innerText = header; div.appendChild(span); this.rootElement.insertBefore(div, this.rootElement.firstChild); }; DonutChartView.prototype.addSectorAriaLabel = function (sectorInfo, percent) { var onAddSectorAriaLabel = this.rootElement.getAttribute("aria-label"); var timeStamp = VisualProfiler.FormattingHelpers.getPrettyPrintTime(new VisualProfiler.TimeStamp(sectorInfo.value)); onAddSectorAriaLabel += " " + Plugin.Resources.getString("DonutSectorAriaLabel", sectorInfo.name, percent, timeStamp); this.rootElement.setAttribute("aria-label", onAddSectorAriaLabel); }; DonutChartView.prototype.buildSectors = function (info) { var sectors = []; for(var i = 0; i < info.length; i++) { this._interval.category = info[i].category; this._interval.name = info[i].name; if(info[i].name === "DDTracker" && typeof info[i].ddTrackerProp !== "undefined") { this._interval.ddtrackerTaskString = info[i].ddTrackerProp.ddtrackerTaskString; this._interval.ddtrackerTaskResource = info[i].ddTrackerProp.ddtrackerTaskResource; this._interval.ddtrackerTaskResourceArgs = info[i].ddTrackerProp.ddtrackerTaskResourceArgs; this._interval.ddtrackerBaseClass = info[i].ddTrackerProp.ddtrackerBaseClass; } var event = this._eventFactory.createEvent(this._interval, 0); sectors.push({ name: event.name, cssClass: this.getCssClass(info[i].category), value: info[i].value }); } sectors = this.groupEventTypes(sectors); this.sortEventsByValue(sectors); return sectors; }; DonutChartView.prototype.getCssClass = function (category) { switch(category) { case "Loading": return "dataLoading"; case "Scripting": return "dataScripting"; case "GC": return "dataScriptingGc"; case "Styling": return "dataStyling"; case "Rendering": return "dataRendering"; case "ImageDecoding": return "dataImageDecoding"; case "Unknown": return "dataOther"; default: throw new Error(Plugin.Resources.getErrorString("JSPerf.1033")); } }; DonutChartView.prototype.groupEventTypes = function (sectors) { var group; var groupMap = { }; for(var i = 0; i < sectors.length; i++) { var sector = sectors[i]; var groupEventName = this._eventGroupsMap[sector.name]; if(typeof groupEventName !== "undefined") { group = groupMap[groupEventName]; if(typeof group === "undefined") { groupMap[groupEventName] = sector; } else { if(sector.name === groupEventName) { groupMap[groupEventName] = sector; sector.value += group.value; } else { group.value += sector.value; } } } else { groupMap[sector.name] = sector; } } var groupedSectors = []; for(var key in groupMap) { groupedSectors.push(groupMap[key]); } return groupedSectors; }; DonutChartView.prototype.initializeEventGroup = function () { this._eventGroupsMap = { }; this._eventGroupsMap[Plugin.Resources.getString("DomEvent")] = Plugin.Resources.getString("DomEvent"); this._eventGroupsMap[Plugin.Resources.getString("EventHandler")] = Plugin.Resources.getString("DomEvent"); this._eventGroupsMap[Plugin.Resources.getString("Layout")] = Plugin.Resources.getString("Layout"); this._eventGroupsMap[Plugin.Resources.getString("DDTrackerLayoutDetailHeader")] = Plugin.Resources.getString("Layout"); this._eventGroupsMap[Plugin.Resources.getString("CssCalculation")] = Plugin.Resources.getString("CssCalculation"); this._eventGroupsMap[Plugin.Resources.getString("DDTrackerStyleComputationDetailHeader")] = Plugin.Resources.getString("CssCalculation"); this._eventGroupsMap[Plugin.Resources.getString("Paint")] = Plugin.Resources.getString("Paint"); this._eventGroupsMap[Plugin.Resources.getString("RenderLayer")] = Plugin.Resources.getString("Paint"); }; DonutChartView.prototype.onRenderSectorTooltip = function (sectorInfo, percent) { var timeStamp = VisualProfiler.FormattingHelpers.getPrettyPrintTime(new VisualProfiler.TimeStamp(sectorInfo.value)); return Plugin.Resources.getString("SectorTooltipFormat", sectorInfo.name, VisualProfiler.FormattingHelpers.getDecimalLocaleString(percent, false), timeStamp); }; DonutChartView.prototype.sortEventsByValue = function (sectors) { sectors.sort(function (sector1, sector2) { return sector2.value - sector1.value; }); }; return DonutChartView; })(Common.Controls.Control); VisualProfiler.DonutChartView = DonutChartView; })(VisualProfiler || (VisualProfiler = {})); //@ sourceMappingURL=DonutChartView.js.map // codeMarkerValues.ts var VisualProfiler; (function (VisualProfiler) { "use strict"; (function (CodeMarkerValues) { CodeMarkerValues._map = []; CodeMarkerValues.perfBrowserTools_VisualProfilerResultsLoaded = 23573; })(VisualProfiler.CodeMarkerValues || (VisualProfiler.CodeMarkerValues = {})); var CodeMarkerValues = VisualProfiler.CodeMarkerValues; })(VisualProfiler || (VisualProfiler = {})); //@ sourceMappingURL=codeMarkerValues.js.map // responsivenessNotifications.ts var VisualProfiler; (function (VisualProfiler) { "use strict"; var ResponsivenessNotifications = (function () { function ResponsivenessNotifications() { } ResponsivenessNotifications.DetailsPaneLoaded = "ResponsivenessNotifications.DetailsPaneLoaded"; ResponsivenessNotifications.GraphCollapsed = "ResponsivenessNotifications.GraphCollapsed"; ResponsivenessNotifications.GraphExpanded = "ResponsivenessNotifications.GraphExpanded"; ResponsivenessNotifications.GridRowSelected = "ResponsivenessNotifications.GridRowSelected"; ResponsivenessNotifications.GridScrolled = "ResponsivenessNotifications.GridScrolled"; ResponsivenessNotifications.GridUpdatedForTimeSelection = "ResponsivenessNotifications.GridUpdatedForTimeSelection"; ResponsivenessNotifications.ResetZoomFinished = "ResponsivenessNotifications.ResetZoomFinished"; ResponsivenessNotifications.ResultsLoaded = "ResponsivenessNotifications.ResultsLoaded"; ResponsivenessNotifications.SortFinishedOnGrid = "ResponsivenessNotifications.SortFinishedOnGrid"; ResponsivenessNotifications.UserSelectedTimeslice = "ResponsivenessNotifications.UserSelectedTimeslice"; ResponsivenessNotifications.ZoomInFinished = "ResponsivenessNotifications.ZoomInFinished"; return ResponsivenessNotifications; })(); VisualProfiler.ResponsivenessNotifications = ResponsivenessNotifications; })(VisualProfiler || (VisualProfiler = {})); //@ sourceMappingURL=responsivenessNotifications.js.map // Program.ts var VisualProfiler; (function (VisualProfiler) { "use strict"; (function (HostType) { HostType._map = []; HostType._map[0] = "VS"; HostType.VS = 0; HostType._map[1] = "F12"; HostType.F12 = 1; HostType._map[2] = "Test"; HostType.Test = 2; })(VisualProfiler.HostType || (VisualProfiler.HostType = {})); var HostType = VisualProfiler.HostType; var ProgramEvents = (function () { function ProgramEvents() { } ProgramEvents.Resize = "resize"; ProgramEvents.Initialized = "initialized"; return ProgramEvents; })(); VisualProfiler.ProgramEvents = ProgramEvents; })(VisualProfiler || (VisualProfiler = {})); //@ sourceMappingURL=Program.js.map // Program.main.ts var VisualProfiler; (function (VisualProfiler) { "use strict"; var ProgramMain = (function () { function ProgramMain() { this._eventManager = new Plugin.Utilities.EventManager(); this._traceWriter = new Common.DefaultTraceWriter(); } Object.defineProperty(ProgramMain.prototype, "dataWarehouse", { get: function () { return this._dataWarehouse; }, enumerable: true, configurable: true }); Object.defineProperty(ProgramMain.prototype, "etwDataCollector", { get: function () { return this._etwDataCollector; }, enumerable: true, configurable: true }); Object.defineProperty(ProgramMain.prototype, "hostType", { get: function () { return this._hostType; }, enumerable: true, configurable: true }); Object.defineProperty(ProgramMain.prototype, "hostShell", { get: function () { return this._hostShell; }, enumerable: true, configurable: true }); Object.defineProperty(ProgramMain.prototype, "traceWriter", { get: function () { return this._traceWriter; }, enumerable: true, configurable: true }); Object.defineProperty(ProgramMain.prototype, "userSettings", { get: function () { return this._userSettings; }, enumerable: true, configurable: true }); ProgramMain.prototype.addEventListener = function (eventType, func) { if(eventType === VisualProfiler.ProgramEvents.Initialized && this._visualProfilerController) { var event = new Event(); event.controller = this._visualProfilerController; func(event); } else { this._eventManager.addEventListener(eventType, func); } }; ProgramMain.prototype.fireCodeMarker = function (codeMarker) { if(Plugin.VS && Plugin.VS.Internal && Plugin.VS.Internal.CodeMarkers) { Plugin.VS.Internal.CodeMarkers.fire(codeMarker); } }; ProgramMain.prototype.getHostSpecificString = function (resourceId) { var args = []; for (var _i = 0; _i < (arguments.length - 1); _i++) { args[_i] = arguments[_i + 1]; } var _resourceId = resourceId + Common.Enum.GetName(VisualProfiler.HostType, this._hostType); return Plugin.Resources.getString(_resourceId, args); }; ProgramMain.prototype.main = function () { var _this = this; if(window.parent && (window.parent).getExternalObj) { this._externalObj = (window.parent).getExternalObj(); } else if(window.external) { this._externalObj = window.external; } if(Plugin.F12) { this._hostType = VisualProfiler.HostType.F12; } else { this._hostType = VisualProfiler.HostType.VS; } Plugin.addEventListener("pluginready", function () { Plugin.Tooltip.defaultTooltipContentToHTML = false; if(Plugin.VS && Plugin.VS.Keyboard) { Plugin.VS.Keyboard.setZoomState(false); } var perfTrace; switch(_this.hostType) { case VisualProfiler.HostType.VS: _this._hostShell = new VisualProfiler.Extensions.HostShellProxy(); _this._dataWarehouse = Plugin.VS.Utilities.createExternalObject("VisualProfilerExtension", "{F7110708-A58E-471F-B9C1-CF5D5549F5E5}"); perfTrace = Plugin.VS.Utilities.createExternalObject("PerformanceTraceExtension", "{D76A409F-7234-4B71-9BFD-DEF3DC4CCCA6}"); break; case VisualProfiler.HostType.F12: _this._hostShell = new VisualProfiler.Extensions.LocalHostShell(); _this._dataWarehouse = Plugin.F12.Utilities.createExternalObject("VisualProfilerExtension", "{F7110708-A58E-471F-B9C1-CF5D5549F5E5}"); _this._etwDataCollector = new Common.Data.F12EtwDataCollector(_this._externalObj.etwDataCollector); perfTrace = Plugin.F12.Utilities.createExternalObject("PerformanceTraceExtension", "{D76A409F-7234-4B71-9BFD-DEF3DC4CCCA6}"); break; default: throw new Error(Plugin.Resources.getErrorString("JSPerf.1056")); } if(perfTrace) { _this._traceWriter = new Common.TraceWriter(perfTrace); } VisualProfiler.Extensions.UserSettingsHelper.getUserSettings().then(function (userSettings) { _this._userSettings = userSettings; _this.initializeErrorReporting(); window.addEventListener("resize", _this.triggerResize.bind(_this)); _this._visualProfilerController = new VisualProfiler.VisualProfilerController(); _this._eventManager.dispatchEvent(VisualProfiler.ProgramEvents.Initialized, { controller: _this._visualProfilerController }); }); }); }; ProgramMain.prototype.initializeErrorReporting = function () { var _this = this; window.onerror = function (e, url, line) { var column; if(arguments && arguments[3] && typeof arguments[3] === 'number') { column = arguments[3]; } _this.reportError(new Error(e), "Unhandled Error", url, line, column); return true; }; }; ProgramMain.prototype.removeEventListener = function (eventType, func) { this._eventManager.removeEventListener(eventType, func); }; ProgramMain.prototype.reportError = function (error, additionalInfo, source, line, column) { if(!this.userSettings.disableWER) { var message = (error.message || (error).description); var url = source || "Visual Profiler"; var lineNumber = line || 0; var columnNumber = column || 0; var errorInfo = "Error description: " + message; if((error).number) { errorInfo += "\r\nError number: " + (error).number; } if(source) { errorInfo += "\r\nSource: " + source; } if((error).stack) { var stack = (error).stack; errorInfo += "\r\nError stack: " + stack; if(!message) { var index = stack.indexOf("\n"); if(index > 0) { index = Math.min(index, 50); message = stack.substring(0, index); } } if(typeof source === "undefined") { var matchInfo = stack.match(/(file|res):?([^)]+)\)/); if(matchInfo && matchInfo.length > 2) { url = matchInfo[2]; } } if(typeof line === "undefined") { matchInfo = stack.match(/line ?(\d+)/); if(!matchInfo || matchInfo.length <= 1) { matchInfo = stack.match(/js:?(\d+):/); } if(matchInfo && matchInfo.length > 1) { lineNumber = parseInt(matchInfo[1]); } } } if(additionalInfo) { errorInfo += "\r\nAdditional Info: " + additionalInfo; } Plugin.Diagnostics.reportError(message, url, lineNumber, errorInfo, columnNumber); } }; ProgramMain.prototype.triggerResize = function () { this._eventManager.dispatchEvent(VisualProfiler.ProgramEvents.Resize); }; return ProgramMain; })(); VisualProfiler.ProgramMain = ProgramMain; VisualProfiler.Program = new ProgramMain(); })(VisualProfiler || (VisualProfiler = {})); (VisualProfiler.Program).main(); //@ sourceMappingURL=Program.main.js.map // VisualProfiler.ts var DiagnosticsHub = Microsoft.VisualStudio.DiagnosticsHub; var VisualProfiler; (function (VisualProfiler) { "use strict"; var VisualProfilerController = (function () { function VisualProfilerController() { var _this = this; this._toolbarViewModel = new VisualProfiler.ToolbarViewModel(this); this._view = new VisualProfilerView(this, this._toolbarViewModel); if(VisualProfiler.Program.hostType === VisualProfiler.HostType.F12) { Plugin.F12.addEventListener("activated", function () { return _this.onToolActivated(); }); this.onToolActivated(); var external = (window.external); external.addEventListener("detach", function () { _this._toolbarViewModel.stopProfiling(); }); external.addEventListener("closing", function () { if(_this._session) { _this._session.close(); _this._session = null; } _this.deleteEtlFile(); }); } var hubDataWarehouse = DiagnosticsHub.DataWarehouse.getDataWarehouseService(); hubDataWarehouse.getAllDataSourceInfos(function (result) { var etlPath; for(var i = 0; i < result.length; i++) { var dataSource = result[i]; if(dataSource.type == DiagnosticsHub.DataWarehouse.DataSourceInfoType.File && dataSource.identity == DiagnosticsHub.DataWarehouse.DataSourceIdentity.EtlFile) { etlPath = dataSource.path; break; } } if(etlPath) { _this._view.setEtlPath(etlPath, false); } }); } VisualProfilerController.prototype.initializeSession = function (etlFilePath, isUserSpecifiedFile) { var _this = this; return new Plugin.Promise(function (completed, errorCallback, progressCallback) { _this._etlFilePath = etlFilePath; _this._isUserSpecifiedFile = isUserSpecifiedFile; VisualProfiler.Program.dataWarehouse.createSession(etlFilePath, function (session) { _this._session = session; var totalDuration = session.getTotalDuration(); _this._globalRuler = new VisualProfiler.GlobalRuler(new VisualProfiler.TimeSpan(VisualProfiler.TimeStamp.fromNanoseconds(totalDuration.begin), VisualProfiler.TimeStamp.fromNanoseconds(totalDuration.end))); _this._toolbarViewModel.setGlobalRuler(_this._globalRuler); var markEventModel = new VisualProfiler.MarkEventModel(session); _this._graphRulerViewModel = new VisualProfiler.RulerViewModel(_this._globalRuler, markEventModel); var cpuUsageModel = new VisualProfiler.CpuUsageModel(session); _this._cpuUsageViewModel = new VisualProfiler.CpuUsageViewModel(cpuUsageModel, _this._globalRuler); var frameRateModel = new VisualProfiler.FrameRateModel(session); _this._frameRateViewModel = new VisualProfiler.FrameRateViewModel(frameRateModel, _this._globalRuler); var eventTimelineModel = new VisualProfiler.EventsTimelineModel(session); _this._eventTimelineViewModel = new VisualProfiler.EventsTimelineViewModel(eventTimelineModel, _this._globalRuler, markEventModel); _this._frameRateViewModel.leftPadding = _this._cpuUsageViewModel.yAxisWidth = _this._graphRulerViewModel.leftPadding = 34; _this._frameRateViewModel.rightPadding = _this._cpuUsageViewModel.rightPadding = _this._graphRulerViewModel.rightPadding = 34; var lowestObservedDocumentMode = session.getLowestObservedDocumentMode(); if(completed) { completed({ cpuUsageViewModel: _this._cpuUsageViewModel, eventsTimelineViewModel: _this._eventTimelineViewModel, frameRateViewModel: _this._frameRateViewModel, globalRuler: _this._globalRuler, graphRulerViewModel: _this._graphRulerViewModel, lowestObservedDocumentMode: lowestObservedDocumentMode, toolbarViewModel: _this._toolbarViewModel }); } }, function (err) { if(errorCallback) { errorCallback(new Error(err.toString())); } }, function (progress) { if(progressCallback) { progressCallback(progress); } }); }); }; VisualProfilerController.prototype.startProfiling = function () { var _this = this; if(!this._collectionSession) { return this.closeSession().then(function () { return VisualProfiler.Program.etwDataCollector.startSession("JavaScriptCollectionAgent.dll", "{8A4373D6-07CA-476E-876F-21E303CB7CF5}").then(function (s) { Plugin.F12.Profiler.notifyOnStartProfiling(); _this._collectionSession = s; _this._view.onProfilingStarted(); }, function (err) { _this._view.onProfilingStartFailed(err); throw err; }); }); } return Plugin.Promise.as(null); }; VisualProfilerController.prototype.stopProfiling = function () { var _this = this; if(this._collectionSession) { this._view.onProfilingStopping(); return this._collectionSession.stop().then(function (file) { Plugin.F12.Profiler.notifyOnStopProfiling(); _this._collectionSession = null; return _this._view.setEtlPath(file, false); }, function (err) { _this._collectionSession = null; _this._view.onProfilingStopFailed(err); throw err; }); } return Plugin.Promise.as(null); }; VisualProfilerController.prototype.closeSession = function () { var _this = this; if(this._session) { return new Plugin.Promise(function (completedCallback, errorCallback) { _this._session.closeAsync(function () { _this._session = null; _this.deleteEtlFile(); if(completedCallback) { completedCallback(); } }, function (errorCode) { _this._session = null; if(errorCallback) { errorCallback(new Error(errorCode.toString())); } }); }); } return Plugin.Promise.as(null); }; VisualProfilerController.prototype.deleteEtlFile = function () { if(Plugin.F12 && this._etlFilePath && !this._isUserSpecifiedFile) { var files = this._etlFilePath.split("|"); for(var i = 0; i < files.length; i++) { var etlFile = files[i]; if(etlFile) { Plugin.F12.deleteFile(etlFile); } } this._etlFilePath = null; } }; VisualProfilerController.prototype.onToolActivated = function () { var isAtBreakpoint = Plugin.F12.Debugger.getIsAtBreakpoint(); this._toolbarViewModel.isAtBreakpoint = isAtBreakpoint; }; return VisualProfilerController; })(); VisualProfiler.VisualProfilerController = VisualProfilerController; var VisualProfilerView = (function () { function VisualProfilerView(controller, viewModel) { this._controller = controller; this._mainContainer = new Common.Controls.Control(document.getElementById("mainContainer")); this._mainView = new Common.Controls.TemplateControl("mainViewTemplate"); this._warningView = this._mainView.findElement("warningView"); this._warningView.style.display = "none"; this._warningMessage = this._mainView.findElement("warningMessage"); var loadFileView = this._mainView.findElement("loadFileView"); if(VisualProfiler.Program.userSettings.allowBrowseForETLFile) { loadFileView.style.display = "block"; } else { loadFileView.style.display = "none"; } this._inputFile = this._mainView.findElement("inputFile"); this._processButton = this._mainView.findElement("processButton"); this._startProfilingFailed = false; this._profilingInProgress = false; this._dataViewContainer = this._mainView.findElement("dataViewContainer"); this._mainContainer.appendChild(this._mainView); this._detailedViewsContainer = this._mainView.findElement("detailedViewsContainer"); this._detailedViewsContainer.style.display = "none"; var progressText = this._mainView.findElement("progressText"); progressText.innerText = Plugin.Resources.getString("AnalyzeDataStatus"); this._progress = this._mainView.findElement("progress"); this._progressContainer = this._mainView.findElement("progressContainer"); this._progressContainer.setAttribute("aria-label", Plugin.Resources.getString("AnalyzeDataStatus")); this._progressContainer.style.display = "none"; if(VisualProfiler.Program.hostType === VisualProfiler.HostType.F12) { this.setupF12SpecificUI(); } else { this._toolbarView = new VisualProfiler.VSToolbarView(this._mainView.findElement("toolbarViewContainer").id); } this.model = viewModel; this._toolbarView.viewModel = this.model; var cpuViewContainer = this._mainView.findElement("cpuViewContainer"); var frameRateContainer = this._mainView.findElement("frameRateContainer"); this._graphRulerView = new VisualProfiler.RulerView(this._mainView.findElement("graphRulerView").id); this._cpuUsageView = new VisualProfiler.CpuUsageView(cpuViewContainer.id); this._frameRateView = new VisualProfiler.FrameRateView(frameRateContainer.id); this._eventsTimelineView = new VisualProfiler.EventsTimelineView(this._mainView.findElement("timelineViewContainer").id); this._graphRulerView.minSelectionWidthInPixels = VisualProfilerView._minSelectionWidthInPixels; this._cpuUsageView.minSelectionWidthInPixels = VisualProfilerView._minSelectionWidthInPixels; this._frameRateView.minSelectionWidthInPixels = VisualProfilerView._minSelectionWidthInPixels; this.setupSelectionContextMenu(cpuViewContainer, frameRateContainer); this._processButton.onclick = this.onProcessButtonClick.bind(this); } VisualProfilerView._minSelectionWidthInPixels = 10; Object.defineProperty(VisualProfilerView.prototype, "model", { get: function () { return this._model; }, set: function (value) { if(this._model && VisualProfiler.Program.hostType === VisualProfiler.HostType.F12) { this._model.removeEventListener(VisualProfiler.ToolbarViewModel.StartProfilingEnabledChangedEventType, this._onStartButtonStatusChanged); this._model.removeEventListener(VisualProfiler.ToolbarViewModel.StopProfilingEnabledChangedEventType, this._onStopButtonStatusChanged); } this._model = value; if(VisualProfiler.Program.hostType === VisualProfiler.HostType.F12) { this._model.addEventListener(VisualProfiler.ToolbarViewModel.StartProfilingEnabledChangedEventType, this._onStartButtonStatusChanged); this._model.addEventListener(VisualProfiler.ToolbarViewModel.StopProfilingEnabledChangedEventType, this._onStopButtonStatusChanged); } }, enumerable: true, configurable: true }); VisualProfilerView.prototype.setEtlPath = function (etlPath, isUserSpecifiedFile) { var _this = this; var progressSoFar = 0; var progressStageNumber = 0; this._progress.value = 0; this._progress.max = 100; VisualProfiler.Program.traceWriter.raiseEvent(Common.TraceEvents.Timeline_LoadGraphs_Start); this._warningView.style.display = "none"; this._detailedViewsContainer.style.display = "none"; this._progressContainer.style.display = ""; return this._controller.initializeSession(etlPath, isUserSpecifiedFile).then(function (result) { _this._detailedViewsContainer.style.display = ""; _this._progressContainer.style.display = "none"; if(result.lowestObservedDocumentMode < Common.Constants.minimumRequiredDocumentMode) { _this._warningMessage.innerText = VisualProfiler.Program.getHostSpecificString("WarningIncompatibleStandardsMode"); _this._warningView.style.display = "block"; } _this._graphRulerView.viewModel = result.graphRulerViewModel; _this._graphRulerView.render(); _this._cpuUsageView.viewModel = result.cpuUsageViewModel; _this._cpuUsageView.render(); _this._frameRateView.viewModel = result.frameRateViewModel; _this._frameRateView.render(); _this._eventsTimelineView.viewModel = result.eventsTimelineViewModel; _this._eventsTimelineView.render(); window.setImmediate(function () { VisualProfiler.Program.triggerResize(); _this._graphRulerView.focus(); }); VisualProfiler.Program.fireCodeMarker(VisualProfiler.CodeMarkerValues.perfBrowserTools_VisualProfilerResultsLoaded); Notifications.notify(VisualProfiler.ResponsivenessNotifications.ResultsLoaded); VisualProfiler.Program.traceWriter.raiseEvent(Common.TraceEvents.Timeline_LoadGraphs_Stop); }, function (error) { _this._progressContainer.style.display = "none"; _this._profilingPrompt.style.display = ""; _this.setProfilingLinkText(Plugin.Resources.getString("F12StartProfilingMessage")); _this.showError(new Error(Plugin.Resources.getString("GenericDataProcessingError", error.message))); VisualProfiler.Program.reportError(error, Plugin.Resources.getString("GenericDataProcessingError")); }, function (progress) { if(progressStageNumber !== progress.currentStage) { progressStageNumber = progress.currentStage; progressSoFar = _this._progress.value; } var stagePrecentage = (progress.value / progress.max) * 100; var stageTotalContribution = stagePrecentage / progress.totalStages; _this._progress.value = progressSoFar + stageTotalContribution; }); }; VisualProfilerView.prototype.onProfilingStarted = function () { if(VisualProfiler.Program.hostType === VisualProfiler.HostType.F12) { this._startProfilingFailed = false; this._profilingInProgress = true; this._dataViewContainer.style.display = "none"; this._profilingPrompt.style.display = ""; this.setProfilingLinkText(Plugin.Resources.getString("F12StopProfilingMessage")); this._profilingProgress.style.display = "block"; } }; VisualProfilerView.prototype.onProfilingStartFailed = function (err) { if(VisualProfiler.Program.hostType === VisualProfiler.HostType.F12) { this._startProfilingFailed = true; this._profilingInProgress = false; this._profilingProgress.style.display = "none"; this._dataViewContainer.style.display = "none"; this._profilingPrompt.style.display = ""; this.setProfilingLinkText(Plugin.Resources.getString("F12StartProfilingMessage")); var helpUrl = err.message === "-2147221164" ? "http://go.microsoft.com/fwlink/?LinkID=306020" : null; this.showError(new Error(Plugin.Resources.getString("GenericDataProcessingError", err.message)), helpUrl); } }; VisualProfilerView.prototype.onProfilingStopping = function () { if(VisualProfiler.Program.hostType === VisualProfiler.HostType.F12) { this._profilingInProgress = false; this._profilingProgress.style.display = "none"; this._dataViewContainer.style.display = ""; this._profilingPrompt.style.display = "none"; this._detailedViewsContainer.style.display = "none"; this._progress.value = 0; this._progressContainer.style.display = ""; this._progressContainer.focus(); } }; VisualProfilerView.prototype.onProfilingStopFailed = function (err) { if(VisualProfiler.Program.hostType === VisualProfiler.HostType.F12) { this._dataViewContainer.style.display = "none"; this._profilingPrompt.style.display = ""; this.setProfilingLinkText(Plugin.Resources.getString("F12StartProfilingMessage")); this.showError(new Error(Plugin.Resources.getString("GenericDataProcessingError", err.message))); } }; VisualProfilerView.prototype.onProcessButtonClick = function () { if(!this._inputFile.value) { return; } this.setEtlPath(this._inputFile.value, true); }; VisualProfilerView.prototype.onProfilingLinkClick = function (event) { if(this._controller && (event.type === "click" || event.keyCode === Common.KeyCodes.ENTER || event.keyCode === Common.KeyCodes.SPACE)) { if(this._profilingInProgress) { this.model.stopProfiling(); } else { this._startProfilingFailed = false; this.model.startProfiling(); } } }; VisualProfilerView.prototype.setProfilingLinkText = function (linkText) { this._profilingLink.innerText = linkText; this._profilingLink.setAttribute("aria-label", linkText); }; VisualProfilerView.prototype.setupF12SpecificUI = function () { var _this = this; this._toolbarView = new VisualProfiler.F12ToolbarView(this._mainView.findElement("toolbarViewContainer").id); this._profilingPrompt = this._mainView.findElement("profilingPrompt"); this._profilingLink = this._mainView.findElement("profilingLink"); this._profilingProgress = this._mainView.findElement("profilingProgress"); this._profilingProgress.style.display = "none"; this.setProfilingLinkText(Plugin.Resources.getString("F12StartProfilingMessage")); var clickHandler = this.onProfilingLinkClick.bind(this); this._profilingLink.addEventListener("click", clickHandler); this._profilingLink.addEventListener("keydown", clickHandler); this._dataViewContainer.style.display = "none"; this._onStartButtonStatusChanged = function (event) { if(!_this._profilingInProgress) { _this.updateF12profilingLinkState(!_this.model.isAtBreakpoint); } }; this._onStopButtonStatusChanged = function (event) { if(_this._profilingInProgress) { _this.updateF12profilingLinkState(!_this.model.isAtBreakpoint); } }; }; VisualProfilerView.prototype.setupSelectionContextMenu = function () { var _this = this; var elements = []; for (var _i = 0; _i < (arguments.length - 0); _i++) { elements[_i] = arguments[_i + 0]; } var enabledIcons = { }; var disabledIcons = { }; if(VisualProfiler.Program.hostType === VisualProfiler.HostType.F12) { enabledIcons["zoomin"] = "f12-image-contextmenu-chartzoom-in"; enabledIcons["resetZoom"] = "f12-image-contextmenu-chartzoom-reset"; enabledIcons["clearSelection"] = "f12-image-contextmenu-chartselection-clear"; disabledIcons["zoomin"] = "f12-image-contextmenu-chartzoom-in-disabled"; disabledIcons["resetZoom"] = "f12-image-contextmenu-chartzoom-reset-disabled"; disabledIcons["clearSelection"] = "f12-image-contextmenu-chartselection-clear-disabled"; } else { enabledIcons["zoomin"] = "vs-image-contextmenu-chartzoom-in"; enabledIcons["resetZoom"] = "vs-image-contextmenu-chartzoom-reset"; enabledIcons["clearSelection"] = "vs-image-contextmenu-chartselection-clear"; disabledIcons["zoomin"] = "vs-image-contextmenu-chartzoom-in-disabled"; disabledIcons["resetZoom"] = "vs-image-contextmenu-chartzoom-reset-disabled"; disabledIcons["clearSelection"] = "vs-image-contextmenu-chartselection-clear-disabled"; } var zoomInMenuItem = { callback: function () { if(_this.model) { _this.model.zoomIn(); } }, disabled: function () { return _this.model ? !_this.model.zoomInEnabled : true; }, iconEnabled: enabledIcons["zoomin"], iconDisabled: disabledIcons["zoomin"], label: Plugin.Resources.getString("ToolbarButtonZoomIn"), type: Plugin.ContextMenu.MenuItemType.command }; var resetZoomMenuItem = { callback: function () { if(_this.model) { _this.model.resetZoom(); } }, disabled: function () { return _this.model ? !_this.model.resetZoomEnabled : true; }, iconEnabled: enabledIcons["resetZoom"], iconDisabled: disabledIcons["resetZoom"], label: Plugin.Resources.getString("ToolbarButtonResetZoom"), type: Plugin.ContextMenu.MenuItemType.command }; var clearSelectionMenuItem = { callback: function () { if(_this.model) { _this.model.clearSelection(); } }, disabled: function () { return _this.model ? !_this.model.clearSelectionEnabled : true; }, iconEnabled: enabledIcons["clearSelection"], iconDisabled: disabledIcons["clearSelection"], label: Plugin.Resources.getString("ToolbarButtonClearSelection"), type: Plugin.ContextMenu.MenuItemType.command }; this._selectionActionContextMenu = Plugin.ContextMenu.create([ zoomInMenuItem, resetZoomMenuItem, clearSelectionMenuItem ]); for(var index = 0; index < elements.length; index++) { this._selectionActionContextMenu.attach(elements[index]); } }; VisualProfilerView.prototype.showError = function (error, helpUrl) { if(VisualProfiler.Program.hostType === VisualProfiler.HostType.F12) { Plugin.F12.ErrorDisplay.show(error.message, null, helpUrl); } else { var errorView = new Common.Controls.TemplateControl("errorViewTemplate"); var errorMessageDiv = errorView.findElement("errorMessage"); errorMessageDiv.innerText = error.message; this._mainContainer.removeChild(this._mainView); this._mainContainer.appendChild(errorView); } }; VisualProfilerView.prototype.updateF12profilingLinkState = function (enabled) { if(enabled) { this._profilingLink.style.display = ""; if(!this._startProfilingFailed) { Plugin.F12.ErrorDisplay.close(); } } else { this._profilingLink.style.display = "none"; Plugin.F12.ErrorDisplay.show(Plugin.Resources.getString("MemoryDisabledAtBreakpoint")); } }; return VisualProfilerView; })(); VisualProfiler.VisualProfilerView = VisualProfilerView; })(VisualProfiler || (VisualProfiler = {})); //@ sourceMappingURL=VisualProfiler.js.map PNG  IHDRVΎW pHYs+ OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FIDATxڤ ῎ A'r=8 E *PH/ J-U/U9j}!tn݆h腠a1D$ NL&L &j'"hN v붿?@H("!huaN1/Bքc?wTIENDB`PNG  IHDR$l gAMA|Q cHRMR@}y<s,٩<9SbL!GĈ 3,F0+7T3IlpX"61"H _qW,d ėrIKst.ښAdp&+g]RәY2EE44432PuoJEzg`̉j- -b8o׿M]9La.+-%Mȧg3YះuAxEK i<:ŹPcu*@~(  ]o0 ~y*s7g%9%(3H*@C`-pn VH@ A1 jPA3hA'8΃Kn`Lg` a!2D!H҇ dAP B Byf*z: @]h ~L CUp΅ p%;56< ?" GxG iE>&2 oQEGlQP UFFuzQ7QcYG4G۠t]nB/o'Я1 xb"1I>Lf3bX} *QYvGĩp( &q x)&gsF|7:~@&h!$&B%pH$D.q#xx8F|K!\H$!i.%L";r3EHK-AFCbH$^RSIrdd 3Rx)-))zR#RsiSiT#Wd2Z2n2l2d)EBaQ6S))T UEMSPgeedɆfȞ!4--VJ;N g%K-sɵݖ{'OwO%)P_RRۥEK/+))U<د8䡔TtAiF쨜\|FyZbU)W9.Kw+YUEUOUjꂚZZZCu:C=^\G}VCEO#OE&^WOs^K[+\kV֔vv[]n>z^^u}XROm`m3h01$:fь|:kG23hbabhrT4ߴw3=3Y-s.q_vǂbgբ⃥%߲rJ*֪jAe0JOY6rvvtXLǎl&I']$NϝM.6.\ι"En2nnn[g=,=t٪E2}4\j5loDŽǞ~q=''Z^utv&vvEv >mяN9-{ LOgsΝK?7s>xOL n\x }N}g/]>uɫ,u[dS@u]7ot.<30tKn]p;;SwSyoEV_|IS=@FcDUp?n Q|-, 0R+m>HB!O։>8UMZ78qYB8y$ܧPC> K0RiE壆m>/!΂j+JE\umƃYVTzVI6i6,A@0@m"'\״0?ooyp d퀵gkt3K7Ìt3K7Ìt3K7Ìt3K7Ìt3K7Ìt3K7ÌAjFa[e hNB/䱫H'U);>t)tpP =q1zh.kq@#6::qP95*=Z U$Ը ;dN+XiS6TȉP[Ǩ\#A9|O') :Q ƕyR?D6ʋAb|<@] kt3V#֞fnyfnyfnyfnyfnyfny89 "OG{IENDB`PNG  IHDR$l gAMA|Q cHRMR@}y<s,٩<9SbL!GĈ 3,F0+7T3IlpX"61"H _qW,d ėrIKst.ښAdp&+g]RәY2EE44432PuoJEzg`̉j- -b8o׿M]9La.+-%Mȧg3YះuAxEK i<:ŹPcu*@~(  ]o0 ~y*s7g%9%(3H*@C`-pn VH@ A1 jPA3hA'8΃Kn`Lg` a!2D!H҇ dAP B Byf*z: @]h ~L CUp΅ p%;56< ?" GxG iE>&2 oQEGlQP UFFuzQ7QcYG4G۠t]nB/o'Я1 xb"1I>Lf3bX} *QYvGĩp( &q x)&gsF|7:~@&h!$&B%pH$D.q#xx8F|K!\H$!i.%L";r3EHK-AFCbH$^RSIrdd 3Rx)-))zR#RsiSiT#Wd2Z2n2l2d)EBaQ6S))T UEMSPgeedɆfȞ!4--VJ;N g%K-sɵݖ{'OwO%)P_RRۥEK/+))U<د8䡔TtAiF쨜\|FyZbU)W9.Kw+YUEUOUjꂚZZZCu:C=^\G}VCEO#OE&^WOs^K[+\kV֔vv[]n>z^^u}XROm`m3h01$:fь|:kG23hbabhrT4ߴw3=3Y-s.q_vǂbgբ⃥%߲rJ*֪jAe0JOY6rvvtXLǎl&I']$NϝM.6.\ι"En2nnn[g=,=t٪E2}4\j5loDŽǞ~q=''Z^utv&vvEv >mяN9-{ LOgsΝK?7s>xOL n\x }N}g/]>uɫ,u[dS@u]7ot.<30tKn]p;;SwSyoEV}\>?}cdgMO}{|_N#fYئr3 #~pAsƐh~Ƹ\ &C8=-1 ^(b(NׄbPwduTEviX# PhTLɒ7F9:z*fג\jS f&S(^?2UByYZXbΟN^́ $wR5]S/l/bRzr!,Oڡ24;Vpjj8`U.]FCWvc!LCH-ߵ>IOYQ4ũB6N/@yxpjuU'ԘLCU*0$gZP cj ߫bq 2b///ϯGְª~ue[X`!Ouwl,Ygl! a|ș1UiISL U:>cLUb(5 5|MM꨸#el*}vGQ1)(-@S1)M]S ^z4#@dT u U/41ACUzQbnd.S f:Sh3Z4c5 Bz{{kFwYO0\/lzR:*&MR-6tA0>>CSYiGR ⏻Mua@?4kJYt.kfC6:3y1+xŬ Hb2MMqPJ?EP:d8`Y U#TP#a{Qjȋ|2P c2/S9\zIENDB`PNG  IHDR$l gAMA|Q cHRMR@}y<s,٩<9SbL!GĈ 3,F0+7T3IlpX"61"H _qW,d ėrIKst.ښAdp&+g]RәY2EE44432PuoJEzg`̉j- -b8o׿M]9La.+-%Mȧg3YះuAxEK i<:ŹPcu*@~(  ]o0 ~y*s7g%9%(3H*@C`-pn VH@ A1 jPA3hA'8΃Kn`Lg` a!2D!H҇ dAP B Byf*z: @]h ~L CUp΅ p%;56< ?" GxG iE>&2 oQEGlQP UFFuzQ7QcYG4G۠t]nB/o'Я1 xb"1I>Lf3bX} *QYvGĩp( &q x)&gsF|7:~@&h!$&B%pH$D.q#xx8F|K!\H$!i.%L";r3EHK-AFCbH$^RSIrdd 3Rx)-))zR#RsiSiT#Wd2Z2n2l2d)EBaQ6S))T UEMSPgeedɆfȞ!4--VJ;N g%K-sɵݖ{'OwO%)P_RRۥEK/+))U<د8䡔TtAiF쨜\|FyZbU)W9.Kw+YUEUOUjꂚZZZCu:C=^\G}VCEO#OE&^WOs^K[+\kV֔vv[]n>z^^u}XROm`m3h01$:fь|:kG23hbabhrT4ߴw3=3Y-s.q_vǂbgբ⃥%߲rJ*֪jAe0JOY6rvvtXLǎl&I']$NϝM.6.\ι"En2nnn[g=,=t٪E2}4\j5loDŽǞ~q=''Z^utv&vvEv >mяN9-{ LOgsΝK?7s>xOL n\x }N}g/]>uɫ,u[dS@u]7ot.<30tKn]p;;SwSyoEV"M .# pVf!F.#A B:5[H;@3sfLMZҒ.>@!U$pүXw&fKbaf YBgT\'eٖ Su(Yp_?tM<iFQ.JbnJ:ԙf^CUtbnC^t׳A(w)u+].>aGzQs$M,a2}Xm:E%z,Ű'~7-JucaZO[.wlt(F`y1VŬ H>fl.rW\D :f ZQ8zWTRuJ? 5=,K]P%/BA} ~YIENDB`PNG  IHDR((mgAMA|Q cHRMR@}y<s,٩<9SbL!GĈ 3,F0+7T3IlpX"61"H _qW,d ėrIKst.ښAdp&+g]RәY2EE44432PuoJEzg`̉j- -b8o׿M]9La.+-%Mȧg3YះuAxEK i<:ŹPcu*@~(  ]o0 ~y*s7g%9%(3H*@C`-pn VH@ A1 jPA3hA'8΃Kn`Lg` a!2D!H҇ dAP B Byf*z: @]h ~L CUp΅ p%;56< ?" GxG iE>&2 oQEGlQP UFFuzQ7QcYG4G۠t]nB/o'Я1 xb"1I>Lf3bX} *QYvGĩp( &q x)&gsF|7:~@&h!$&B%pH$D.q#xx8F|K!\H$!i.%L";r3EHK-AFCbH$^RSIrdd 3Rx)-))zR#RsiSiT#Wd2Z2n2l2d)EBaQ6S))T UEMSPgeedɆfȞ!4--VJ;N g%K-sɵݖ{'OwO%)P_RRۥEK/+))U<د8䡔TtAiF쨜\|FyZbU)W9.Kw+YUEUOUjꂚZZZCu:C=^\G}VCEO#OE&^WOs^K[+\kV֔vv[]n>z^^u}XROm`m3h01$:fь|:kG23hbabhrT4ߴw3=3Y-s.q_vǂbgբ⃥%߲rJ*֪jAe0JOY6rvvtXLǎl&I']$NϝM.6.\ι"En2nnn[g=,=t٪E2}4\j5loDŽǞ~q=''Z^utv&vvEv >mяN9-{ LOgsΝK?7s>xOL n\x }N}g/]>uɫ,u[dS@u]7ot.<30tKn]p;;SwSyoEV@KiH2܏;}0N.wv2Mz_ZJyy3N,τ#e]ƻA73<^4"f}#ZJU,Or@ טpQ'^?   4o` /T(%t?%r \s"?e1>c<,:GDzR;Z/B1680$sb| jߘYiCH;-05*9 (hHjrn5GiP m Fi fp51(mچ\*J[6A&h(?e+mچܪ_i 6<^J[I|1a=m y !")]S­= ooxa w*Ff rd| \ZIݧv{^ 9A䵆|[$횏`/ŸLzvIENDB`PNG  IHDR((mgAMA|Q cHRMR@}y<s,٩<9SbL!GĈ 3,F0+7T3IlpX"61"H _qW,d ėrIKst.ښAdp&+g]RәY2EE44432PuoJEzg`̉j- -b8o׿M]9La.+-%Mȧg3YះuAxEK i<:ŹPcu*@~(  ]o0 ~y*s7g%9%(3H*@C`-pn VH@ A1 jPA3hA'8΃Kn`Lg` a!2D!H҇ dAP B Byf*z: @]h ~L CUp΅ p%;56< ?" GxG iE>&2 oQEGlQP UFFuzQ7QcYG4G۠t]nB/o'Я1 xb"1I>Lf3bX} *QYvGĩp( &q x)&gsF|7:~@&h!$&B%pH$D.q#xx8F|K!\H$!i.%L";r3EHK-AFCbH$^RSIrdd 3Rx)-))zR#RsiSiT#Wd2Z2n2l2d)EBaQ6S))T UEMSPgeedɆfȞ!4--VJ;N g%K-sɵݖ{'OwO%)P_RRۥEK/+))U<د8䡔TtAiF쨜\|FyZbU)W9.Kw+YUEUOUjꂚZZZCu:C=^\G}VCEO#OE&^WOs^K[+\kV֔vv[]n>z^^u}XROm`m3h01$:fь|:kG23hbabhrT4ߴw3=3Y-s.q_vǂbgբ⃥%߲rJ*֪jAe0JOY6rvvtXLǎl&I']$NϝM.6.\ι"En2nnn[g=,=t٪E2}4\j5loDŽǞ~q=''Z^utv&vvEv >mяN9-{ LOgsΝK?7s>xOL n\x }N}g/]>uɫ,u[dS@u]7ot.<30tKn]p;;SwSyoEV,٩<9SbL!GĈ 3,F0+7T3IlpX"61"H _qW,d ėrIKst.ښAdp&+g]RәY2EE44432PuoJEzg`̉j- -b8o׿M]9La.+-%Mȧg3YះuAxEK i<:ŹPcu*@~(  ]o0 ~y*s7g%9%(3H*@C`-pn VH@ A1 jPA3hA'8΃Kn`Lg` a!2D!H҇ dAP B Byf*z: @]h ~L CUp΅ p%;56< ?" GxG iE>&2 oQEGlQP UFFuzQ7QcYG4G۠t]nB/o'Я1 xb"1I>Lf3bX} *QYvGĩp( &q x)&gsF|7:~@&h!$&B%pH$D.q#xx8F|K!\H$!i.%L";r3EHK-AFCbH$^RSIrdd 3Rx)-))zR#RsiSiT#Wd2Z2n2l2d)EBaQ6S))T UEMSPgeedɆfȞ!4--VJ;N g%K-sɵݖ{'OwO%)P_RRۥEK/+))U<د8䡔TtAiF쨜\|FyZbU)W9.Kw+YUEUOUjꂚZZZCu:C=^\G}VCEO#OE&^WOs^K[+\kV֔vv[]n>z^^u}XROm`m3h01$:fь|:kG23hbabhrT4ߴw3=3Y-s.q_vǂbgբ⃥%߲rJ*֪jAe0JOY6rvvtXLǎl&I']$NϝM.6.\ι"En2nnn[g=,=t٪E2}4\j5loDŽǞ~q=''Z^utv&vvEv >mяN9-{ LOgsΝK?7s>xOL n\x }N}g/]>uɫ,u[dS@u]7ot.<30tKn]p;;SwSyoEVbH.("*!6* boߜvݍǽ93s3wf"N5r"6XN (ކD"ĵJ#:D+q$K\am&%bD狠F`t-4ךDgmtz^/ 3&;(crȒ A#F`eL\ϠxF|ߟt~\DV\dk*9H`@$$UfՊqDJӴf1hGԩD&Ljr~\PU Bugh.JkPF,٩<9SbL!GĈ 3,F0+7T3IlpX"61"H _qW,d ėrIKst.ښAdp&+g]RәY2EE44432PuoJEzg`̉j- -b8o׿M]9La.+-%Mȧg3YះuAxEK i<:ŹPcu*@~(  ]o0 ~y*s7g%9%(3H*@C`-pn VH@ A1 jPA3hA'8΃Kn`Lg` a!2D!H҇ dAP B Byf*z: @]h ~L CUp΅ p%;56< ?" GxG iE>&2 oQEGlQP UFFuzQ7QcYG4G۠t]nB/o'Я1 xb"1I>Lf3bX} *QYvGĩp( &q x)&gsF|7:~@&h!$&B%pH$D.q#xx8F|K!\H$!i.%L";r3EHK-AFCbH$^RSIrdd 3Rx)-))zR#RsiSiT#Wd2Z2n2l2d)EBaQ6S))T UEMSPgeedɆfȞ!4--VJ;N g%K-sɵݖ{'OwO%)P_RRۥEK/+))U<د8䡔TtAiF쨜\|FyZbU)W9.Kw+YUEUOUjꂚZZZCu:C=^\G}VCEO#OE&^WOs^K[+\kV֔vv[]n>z^^u}XROm`m3h01$:fь|:kG23hbabhrT4ߴw3=3Y-s.q_vǂbgբ⃥%߲rJ*֪jAe0JOY6rvvtXLǎl&I']$NϝM.6.\ι"En2nnn[g=,=t٪E2}4\j5loDŽǞ~q=''Z^utv&vvEv >mяN9-{ LOgsΝK?7s>xOL n\x }N}g/]>uɫ,u[dS@u]7ot.<30tKn]p;;SwSyoEV{|^{dJDH4KDFjooPa crggg+`ZYi8t6|Lp Z`ry'|7?Am"4saV`<'Q >X -}^!]g(<lTPG`^5K@k}t!!du)H.3L![ɫ93 t&]g qZS9PF)j𖁦~Y_!m$Úl/vyBPº;c`Y=DnY0ښR S|~ vlN%mAS)U<Πo's0= s!kWh2;U<Πp8:UNcզiKት2;U<ΠPn.NcvNnt΀uեOkGE -̺QPM[hfѾ HVXE5O E MOG)U<ΠN>ʹiSׁ꣗ZkJU<748 )ZLw{ W<@ṝ']XHHT_ۋUށ0кqe$ELTG!aetKOPpk0z@9xІBj۠gE|nˠp0J㌘({)hM =1|_yI!o4+( bym&ev|!o@vry" 5)]Zk8Et yCxu]DXI!t,٩<9SbL!GĈ 3,F0+7T3IlpX"61"H _qW,d ėrIKst.ښAdp&+g]RәY2EE44432PuoJEzg`̉j- -b8o׿M]9La.+-%Mȧg3YះuAxEK i<:ŹPcu*@~(  ]o0 ~y*s7g%9%(3H*@C`-pn VH@ A1 jPA3hA'8΃Kn`Lg` a!2D!H҇ dAP B Byf*z: @]h ~L CUp΅ p%;56< ?" GxG iE>&2 oQEGlQP UFFuzQ7QcYG4G۠t]nB/o'Я1 xb"1I>Lf3bX} *QYvGĩp( &q x)&gsF|7:~@&h!$&B%pH$D.q#xx8F|K!\H$!i.%L";r3EHK-AFCbH$^RSIrdd 3Rx)-))zR#RsiSiT#Wd2Z2n2l2d)EBaQ6S))T UEMSPgeedɆfȞ!4--VJ;N g%K-sɵݖ{'OwO%)P_RRۥEK/+))U<د8䡔TtAiF쨜\|FyZbU)W9.Kw+YUEUOUjꂚZZZCu:C=^\G}VCEO#OE&^WOs^K[+\kV֔vv[]n>z^^u}XROm`m3h01$:fь|:kG23hbabhrT4ߴw3=3Y-s.q_vǂbgբ⃥%߲rJ*֪jAe0JOY6rvvtXLǎl&I']$NϝM.6.\ι"En2nnn[g=,=t٪E2}4\j5loDŽǞ~q=''Z^utv&vvEv >mяN9-{ LOgsΝK?7s>xOL n\x }N}g/]>uɫ,u[dS@u]7ot.<30tKn]p;;SwSyoEV@d&5AB^p~\€;(op~\„Npu߇GP Vw>)sWK I}iFr*, R"4XJKd7ϛ"tIENDB`PNG  IHDR((mgAMA|Q cHRMR@}y<s,٩<9SbL!GĈ 3,F0+7T3IlpX"61"H _qW,d ėrIKst.ښAdp&+g]RәY2EE44432PuoJEzg`̉j- -b8o׿M]9La.+-%Mȧg3YះuAxEK i<:ŹPcu*@~(  ]o0 ~y*s7g%9%(3H*@C`-pn VH@ A1 jPA3hA'8΃Kn`Lg` a!2D!H҇ dAP B Byf*z: @]h ~L CUp΅ p%;56< ?" GxG iE>&2 oQEGlQP UFFuzQ7QcYG4G۠t]nB/o'Я1 xb"1I>Lf3bX} *QYvGĩp( &q x)&gsF|7:~@&h!$&B%pH$D.q#xx8F|K!\H$!i.%L";r3EHK-AFCbH$^RSIrdd 3Rx)-))zR#RsiSiT#Wd2Z2n2l2d)EBaQ6S))T UEMSPgeedɆfȞ!4--VJ;N g%K-sɵݖ{'OwO%)P_RRۥEK/+))U<د8䡔TtAiF쨜\|FyZbU)W9.Kw+YUEUOUjꂚZZZCu:C=^\G}VCEO#OE&^WOs^K[+\kV֔vv[]n>z^^u}XROm`m3h01$:fь|:kG23hbabhrT4ߴw3=3Y-s.q_vǂbgբ⃥%߲rJ*֪jAe0JOY6rvvtXLǎl&I']$NϝM.6.\ι"En2nnn[g=,=t٪E2}4\j5loDŽǞ~q=''Z^utv&vvEv >mяN9-{ LOgsΝK?7s>xOL n\x }N}g/]>uɫ,u[dS@u]7ot.<30tKn]p;;SwSyoEVߧY;{|ӳ{<+HRyMODDOx#D8#F700z.꠆>8#BJ|ay>@*k0ۆZ.3B`a wPo^'#\N$ q; _ ͠%$܇tFq`'JSji+n›졏N$b]qp]Қ>=AHMw58Q NКʁ'rq8+Dw6  0'w T[SyA"ooƎJԩ`q,<kU83(T)w{Օ] uM]Bٱ q&yPocզikk6;V<ΠPfAεj{㰮i}jQ!&*%k3ѱ Hb+ҍ6vT&)e8 YSyab6ӋWeqǢNT/5po ipPSΕML w2c½VkQ.3)h<<+O%hZ5Bu 7TꙪNlӍ_D E.,OqF(8 NCR \e|6 ^ zI ptV< y֤#Y+g:w&,ґry!OrlOevl!o@vry# 5)]ZkVLEtg YC<AHF7r7S}tu q ^g8d .3XO}Rw>8#+(I9tGIqu[8#5'|w?#~5<ȱ܂*8#*o; if*  f>IENDB`PNG  IHDRVΎW pHYs+ OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FIDATxڬ0 @WN  pNPN/汗|/Ѷ-)"#Qm' 8EBcߣ-fKc+ 0) { var htmlElement = elements[0]; if(this._manifest && this._manifest.f12 && typeof this._manifest.f12.localized_tab_resource === "string") { htmlElement.setAttribute("aria-label", Plugin.Resources.getString(this._manifest.f12.localized_tab_resource, "")); } } }; PluginHost.prototype.addHostCss = function () { var style = document.createElement("link"); style.type = "text/css"; style.setAttribute("data-plugin-theme", "true"); style.setAttribute("data-plugin-theme-href", Host.Impl.Theme._hostFilePrefix + "theme/f12.css"); (document.head || document.body).appendChild(style); var elements = document.getElementsByTagName("html"); if(elements.length > 0) { (elements[0]).classList.add(PluginHost._f12ClassName); } document.addEventListener("focusin", function () { Host.ExternalApis.notifyOnBrowserActivated(); }, true); }; PluginHost.prototype.loadManifest = function () { var manifestFile = Host.Impl.Storage.readPluginFile("manifest.json"); return JSON.parse(manifestFile); }; PluginHost.prototype.onLoaded = function () { var _this = this; Common.blockBrowserAccelerators(); this.addHostCss(); this._manifest = this.loadManifest(); this._f12Extensions = new Host.Impl.F12Extensions(); (Plugin).F12 = this._f12Extensions; this.loadModule("plugin.host.diagnostics").triggerInitialized(this._manifest); this.loadModule("plugin.host.theme").triggerInitialized(this._manifest); this.loadModule("plugin.host.culture").triggerInitialized(this._manifest); this.loadModule("plugin.host.resources").triggerInitialized(this._manifest); this.getFileAliasesService().initialize(this._manifest); this.addAriaTabName(); window.setTimeout(function () { _this.loadModule("plugin.host.core").setControlReady(_this._manifest); }, 0); }; PluginHost.prototype.createNewActivityLogService = function () { return new Host.Impl.ActivityLog(); }; PluginHost.prototype.createNewCodeMarkersService = function () { return new Host.Impl.CodeMarkers(); }; PluginHost.prototype.createNewContextMenuService = function () { return new Host.Impl.ContextMenu(); }; PluginHost.prototype.createNewCoreService = function () { return new Host.Impl.Core(); }; PluginHost.prototype.createNewCultureService = function () { return new Host.Impl.Culture(); }; PluginHost.prototype.createNewDiagnosticsService = function () { return new Host.Impl.Diagnostics(); }; PluginHost.prototype.getFileAliasesService = function () { if(!this._filealiases) { this._filealiases = new Host.Impl.FileAliases(); } return this._filealiases; }; PluginHost.prototype.createNewHostService = function () { return new Host.Impl.Host(); }; PluginHost.prototype.createNewOutputService = function () { return new Host.Impl.Output(); }; PluginHost.prototype.createNewResourcesService = function () { return new Host.Impl.Resources(); }; PluginHost.prototype.createNewSettingsService = function () { return new Host.Impl.Settings(); }; PluginHost.prototype.createNewStorageService = function () { return new Host.Impl.Storage(); }; PluginHost.prototype.createNewThemeService = function () { return new Host.Impl.Theme(); }; PluginHost.prototype.createNewTooltipService = function () { return new Host.Impl.Tooltip(); }; PluginHost.prototype.loadModule = function (name) { var res = this._modules[name]; if(typeof res === 'function') { this._modules[name] = res = res(); } return res; }; PluginHost.prototype.triggerContextMenuEvent = function (type, event) { this.loadModule("plugin.host.contextmenu").triggerContextMenuEvent(type, event); }; return PluginHost; })(); Host.PluginHost = PluginHost; })(F12.Host || (F12.Host = {})); var Host = F12.Host; })(F12 || (F12 = {})); var F12; (function (F12) { (function (Host) { var App = (function () { function App() { } App.main = function main() { App.pluginHost = new Host.PluginHost(); }; return App; })(); Host.App = App; })(F12.Host || (F12.Host = {})); var Host = F12.Host; })(F12 || (F12 = {})); F12.Host.App.main(); var loadModule = F12.Host.App.pluginHost.loadModule.bind(F12.Host.App.pluginHost); var F12; (function (F12) { (function (Host) { (function (Impl) { var ErrorAlert = (function () { function ErrorAlert(parentElement, anchorElement) { var _this = this; this._resizeDebounceLastDate = null; this._resizeEventListener = function () { }; this._anchorElement = null; var box = document.createElement("div"); box.id = "f12HostErrorBox"; box.className = "f12HostErrorContainer"; box.tabIndex = 0; box.innerHTML = '
          '; this._errorBoxElement = box; this._anchorElement = anchorElement; parentElement.appendChild(box); this._resizeEventListener = this.resize.bind(this, false); var errorHelp = document.getElementById("f12HostErrorHelp"); errorHelp.addEventListener("click", function () { return _this.showHelpLink(); }); var errorClose = document.getElementById("f12HostErrorClose"); errorClose.addEventListener("click", function () { return _this.close(); }); this._resizeDebounceLastDate = new Date(); } ErrorAlert._resizeDebounceThreshold = 100; Object.defineProperty(ErrorAlert.prototype, "messageText", { get: function () { return this._messageText; }, enumerable: true, configurable: true }); Object.defineProperty(ErrorAlert.prototype, "helpUri", { get: function () { return this._helpUri; }, enumerable: true, configurable: true }); Object.defineProperty(ErrorAlert.prototype, "isShown", { get: function () { return (this._errorBoxElement.style.display === "block"); }, enumerable: true, configurable: true }); ErrorAlert.prototype.show = function (message, timeout, helpUri) { var _this = this; window.addEventListener("resize", this._resizeEventListener); this._messageText = message; this._helpUri = null; var errorMessage = document.getElementById("f12HostErrorMessage"); errorMessage.innerText = message; if(typeof timeout === "number" && timeout > 0) { this._timeoutId = window.setTimeout(function () { return _this.close(); }, timeout); } else { this._timeoutId = null; } var errorHelp = document.getElementById("f12HostErrorHelp"); if(typeof helpUri === "string" && helpUri.length > 0) { this._helpUri = helpUri; errorHelp.style.display = "block"; } else { this._helpUri = null; errorHelp.style.display = "none"; } this._errorBoxElement.style.display = "block"; this.resize(true); }; ErrorAlert.prototype.close = function () { if(this._timeoutId) { window.clearTimeout(this._timeoutId); this._timeoutId = null; } window.removeEventListener("resize", this._resizeEventListener); this._errorBoxElement.style.display = "none"; this._messageText = null; this._helpUri = null; }; ErrorAlert.prototype.resize = function (force) { var dateNow = new Date(); if(force || (dateNow - this._resizeDebounceLastDate) > ErrorAlert._resizeDebounceThreshold) { this.setupPosition(); this._resizeDebounceLastDate = dateNow; } }; ErrorAlert.prototype.setupPosition = function () { var widthOfErrorContainer = this._errorBoxElement.offsetWidth; var widthOfWindow = window.innerWidth; var heightOfErrorContainer = this._errorBoxElement.offsetHeight; var heightOfWindow = window.innerHeight; var left = (widthOfWindow - widthOfErrorContainer) / 2; var top = heightOfWindow; if(this._anchorElement && this._anchorElement.style.display !== "none") { top = this._anchorElement.getBoundingClientRect().top; } var shadowHeight = parseInt(window.getComputedStyle(this._errorBoxElement).boxShadow); if(isNaN(shadowHeight)) { shadowHeight = 0; } top = top - heightOfErrorContainer - shadowHeight; this._errorBoxElement.style.top = top + "px"; this._errorBoxElement.style.left = left + "px"; }; ErrorAlert.prototype.showHelpLink = function () { if(typeof this._helpUri === "string" && this._helpUri.length > 0) { (Plugin).F12.openBrowser(this._helpUri); } }; return ErrorAlert; })(); Impl.ErrorAlert = ErrorAlert; })(Host.Impl || (Host.Impl = {})); var Impl = Host.Impl; })(F12.Host || (F12.Host = {})); var Host = F12.Host; })(F12 || (F12 = {})); var F12; (function (F12) { (function (Host) { Host.ExternalApis = ((window).__externalApis) || (window.external) || { }; })(F12.Host || (F12.Host = {})); var Host = F12.Host; })(F12 || (F12 = {})); var F12; (function (F12) { (function (Host) { var EventManager = (function () { function EventManager() { this._listeners = { }; } EventManager.prototype.addEventListener = function (name, callback) { if(!this._listeners.hasOwnProperty(name)) { this._listeners[name] = []; } this._listeners[name].push(callback); if(this._queuedEvents && this._queuedEvents[name]) { var data = this._queuedEvents[name]; this._queuedEvents[name] = null; this.dispatchEvent(name, data); } }; EventManager.prototype.removeEventListener = function (name, callback) { if(this._listeners.hasOwnProperty(name)) { var newListeners = []; for(var i = 0; i < this._listeners[name].length; i++) { if(this._listeners[name][i] !== callback) { newListeners.push(callback); } } this._listeners[name] = newListeners; } }; EventManager.prototype.dispatchEvent = function (eventName, data, queueIfNoListeners) { var callbacks = this._listeners[eventName]; if(callbacks) { var e = document.createEvent("Event"); if(data) { for(var prop in data) { if(data.hasOwnProperty(prop)) { e[prop] = data[prop]; } } } for(var i = 0; i < callbacks.length; i++) { callbacks[i](e); } } else if(queueIfNoListeners) { if(!this._queuedEvents) { this._queuedEvents = { }; } this._queuedEvents[eventName] = data; } }; return EventManager; })(); Host.EventManager = EventManager; })(F12.Host || (F12.Host = {})); var Host = F12.Host; })(F12 || (F12 = {})); var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var F12; (function (F12) { (function (Host) { (function (controlCommands) { controlCommands._map = []; controlCommands.none = 0; controlCommands.portCreated = 1; controlCommands.portClosed = 2; controlCommands.portConnected = 3; controlCommands.controlInitialized = 4; controlCommands.hostReady = 5; controlCommands.event = 6; controlCommands.error = 7; controlCommands.initiateShutdown = 8; controlCommands.shutdownComplete = 9; })(Host.controlCommands || (Host.controlCommands = {})); var controlCommands = Host.controlCommands; ; (function (ScriptedHostPortState) { ScriptedHostPortState._map = []; ScriptedHostPortState.connected = 0; ScriptedHostPortState.disconnected = 1; ScriptedHostPortState.closed = 2; })(Host.ScriptedHostPortState || (Host.ScriptedHostPortState = {})); var ScriptedHostPortState = Host.ScriptedHostPortState; ; var CustomEvent = (function () { function CustomEvent() { this.supportedForProcessing = false; this.NONE = 0; this.CAPTURING_PHASE = 1; this.AT_TARGET = 2; this.BUBBLING_PHASE = 3; } Object.defineProperty(CustomEvent.prototype, "currentTarget", { get: function () { return this.target; }, enumerable: true, configurable: true }); Object.defineProperty(CustomEvent.prototype, "defaultPrevented", { get: function () { return this._preventDefaultCalled; }, enumerable: true, configurable: true }); Object.defineProperty(CustomEvent.prototype, "isTrusted", { get: function () { return false; }, enumerable: true, configurable: true }); CustomEvent.prototype.stopPropagation = function () { }; CustomEvent.prototype.preventDefault = function () { this._preventDefaultCalled = true; }; CustomEvent.prototype.stopImmediatePropagation = function () { this._stopImmediatePropagationCalled = true; }; CustomEvent.prototype.initEvent = function (eventTypeArg, canBubbleArg, cancelableArg) { }; return CustomEvent; })(); Host.CustomEvent = CustomEvent; var DelayControlReadyToken = (function () { function DelayControlReadyToken(manager, tokenId) { this.manager = manager; this.tokenId = tokenId; } DelayControlReadyToken.prototype.unblockControlReadyEvent = function () { this.manager.unblockControlReadyEvent(this.tokenId); }; return DelayControlReadyToken; })(); Host.DelayControlReadyToken = DelayControlReadyToken; var BeforeControlReadyEventArgs = (function (_super) { __extends(BeforeControlReadyEventArgs, _super); function BeforeControlReadyEventArgs(manager) { _super.call(this); this.manager = manager; } BeforeControlReadyEventArgs.prototype.delayControlReadyEvent = function () { var tokenId = this.manager.delayControlReadyEvent(); return new DelayControlReadyToken(this.manager, tokenId); }; return BeforeControlReadyEventArgs; })(CustomEvent); Host.BeforeControlReadyEventArgs = BeforeControlReadyEventArgs; var PortMessageEventArgs = (function (_super) { __extends(PortMessageEventArgs, _super); function PortMessageEventArgs(message, replyRequested, port, messageId) { _super.call(this); this.message = message; this.replyRequested = replyRequested; this.port = port; this.messageId = messageId; } PortMessageEventArgs.prototype.reply = function (message) { this.port.reply(this.messageId, message); }; PortMessageEventArgs.prototype.reportError = function (error) { this.port.reportError(this.messageId, error); }; return PortMessageEventArgs; })(CustomEvent); Host.PortMessageEventArgs = PortMessageEventArgs; var CustomEventTarget = (function () { function CustomEventTarget() { } CustomEventTarget.prototype.addEventListener = function (type, listener, useCapture) { this.listeners = this.listeners || { }; var eventListeners = (this.listeners[type] = this.listeners[type] || []); for(var i = 0, len = eventListeners.length; i < len; i++) { var l = eventListeners[i]; if(l.listener === listener) { return; } } eventListeners.push({ listener: listener }); }; CustomEventTarget.prototype.removeEventListener = function (type, listener, useCapture) { var listeners = this.listeners && this.listeners[type]; if(listeners) { for(var i = 0, len = listeners.length; i < len; i++) { var l = listeners[i]; if(l.listener === listener) { listeners.splice(i, 1); if(listeners.length === 0) { delete this.listeners[type]; } break; } } } }; CustomEventTarget.prototype.dispatchEvent = function (eventArg) { return false; }; CustomEventTarget.prototype.dispatchEventInternal = function (type, eventArg) { var listeners = this.listeners && this.listeners[type]; if(listeners) { var eventValue = eventArg; listeners = listeners.slice(0, listeners.length); for(var i = 0, len = listeners.length; i < len; i++) { listeners[i].listener(this, eventValue); } return eventValue.defaultPrevented || false; } return false; }; return CustomEventTarget; })(); Host.CustomEventTarget = CustomEventTarget; var Port = (function (_super) { __extends(Port, _super); function Port(manager, name, portId) { _super.call(this); this.manager = manager; this.portName = name; this.portId = portId; this.portState = ScriptedHostPortState.disconnected; } Object.defineProperty(Port.prototype, "state", { get: function () { return this.portState; }, enumerable: true, configurable: true }); Object.defineProperty(Port.prototype, "name", { get: function () { return this.portName; }, enumerable: true, configurable: true }); Object.defineProperty(Port.prototype, "id", { get: function () { return this.portId; }, enumerable: true, configurable: true }); Port.prototype.connect = function () { if(this.portState !== ScriptedHostPortState.disconnected) { return; } this.manager.registerPort(this); }; Port.prototype.postMessage = function (message) { if(this.portState !== ScriptedHostPortState.connected) { return; } this.manager.postPortMessage(this.portId, message); }; Port.prototype.close = function () { if(this.portState === ScriptedHostPortState.closed) { return; } this.portState = ScriptedHostPortState.closed; this.manager.unregisterPort(this); this.manager = null; this.dispatchEventInternal("close", document.createEvent("Event")); }; Port.prototype.processMessage = function (messageId, message, replyRequested) { if(this.portState === ScriptedHostPortState.connected) { var eventArgs = new PortMessageEventArgs(message, replyRequested, this, messageId); this.dispatchEventInternal("message", eventArgs); } }; Port.prototype.processConnect = function () { if(this.portState === ScriptedHostPortState.closed) { return; } this.portState = ScriptedHostPortState.connected; this.dispatchEventInternal("connected", document.createEvent("Event")); }; Port.prototype.processDisconnect = function () { if(this.portState === ScriptedHostPortState.closed) { return; } this.portState = ScriptedHostPortState.disconnected; }; Port.prototype.reply = function (messageId, message) { if(this.portState === ScriptedHostPortState.closed) { return; } this.manager.postMessageReply(this.portId, messageId, message); }; Port.prototype.reportError = function (messageId, error) { if(this.portState === ScriptedHostPortState.closed) { return; } this.manager.postMessageErrorReply(this.portId, messageId, error); }; return Port; })(CustomEventTarget); Host.Port = Port; var PortMarshaller = (function (_super) { __extends(PortMarshaller, _super); function PortMarshaller(port, extension) { _super.call(this); this._port = port; this._extension = extension; this._isInitialized = false; if(typeof extension.initialize === "function") { extension.initialize(this); } this._port.addEventListener("connected", this.onConnected.bind(this)); this._port.addEventListener("message", this.onMessage.bind(this)); } PortMarshaller.prototype.onConnected = function (source, eventArgs) { if(!this._isInitialized) { this._isInitialized = true; } this.dispatchEvent("PortConnected"); }; PortMarshaller.prototype.onMessage = function (source, eventArgs) { try { var message = eventArgs.message; var request = JSON.parse(message); var methodName = request.method; var method = this._extension[methodName]; if(typeof method === "function") { var callResult = method.apply(this._extension, request.args); if(eventArgs.replyRequested) { if(callResult && typeof callResult.then === "function") { callResult.then(function (promiseResult) { var result = { result: promiseResult }; eventArgs.reply(JSON.stringify(result)); }, function (error) { eventArgs.reportError(error); }); } else { var result = { result: callResult || "" }; eventArgs.reply(JSON.stringify(result)); } } } else { throw new Error("Unknown method: " + methodName); } } catch (ex) { if(eventArgs.replyRequested) { eventArgs.reportError(ex); } } }; PortMarshaller.prototype.fireEvent = function (eventName, eventArgs) { var response = { eventName: eventName, arg: eventArgs }; this._port.postMessage(JSON.stringify(response)); }; return PortMarshaller; })(Host.EventManager); Host.PortMarshaller = PortMarshaller; var CommunicationManager = (function (_super) { __extends(CommunicationManager, _super); function CommunicationManager(postMessageToPlugin) { _super.call(this); this.lastMessageId = 0; this.lastPortId = 1; this.registeredPorts = { }; this.registeredPortNames = { }; this.pendingRemotePorts = { }; this.controlReadyWaitTaskList = { length: 0 }; this.lastDelayControlReadyTokenId = 0; this.postMessageToPlugin = postMessageToPlugin; } CommunicationManager.defaultPort = 0; CommunicationManager.messageHeaderDelimiter = '$'; CommunicationManager.prototype.connectPort = function (portName) { if(!this.registeredPortNames[portName]) { throw new Error("ConnectPort: Port does not exist."); } var localPort = this.registeredPortNames[portName]; if(localPort.state !== ScriptedHostPortState.disconnected) { throw new Error("ConnectPort: Port state is unexpected."); } var portMessageArgs = [ localPort.id, localPort.name ]; this.postMessageInternal(CommunicationManager.defaultPort, controlCommands.portConnected, portMessageArgs); localPort.processConnect(); }; CommunicationManager.prototype.disconnectPort = function (id) { if(!this.registeredPorts[id]) { throw new Error("DisconnectPort: Port does not exist."); } var localPort = this.registeredPorts[id]; if(localPort.state !== ScriptedHostPortState.connected) { throw new Error("DisconnectPort: Port state is unexpected."); } localPort.processDisconnect(); }; CommunicationManager.prototype.disconnectPorts = function () { for(var p in this.registeredPorts) { var port = this.registeredPorts[p]; if(port && port.portId) { port.processDisconnect(); } } }; CommunicationManager.prototype.postMessageInternal = function (portId, command, args, payload, replyId) { var header = { msgId: ++this.lastMessageId, portId: portId }; if(typeof replyId === 'number') { header.replyId = replyId; } header.command = command; if(args) { header.args = args; } var message = JSON.stringify(header); if(typeof payload === 'string') { message += CommunicationManager.messageHeaderDelimiter + payload; } this.postMessageToPlugin(message); }; CommunicationManager.prototype.fireControlReady = function () { this.postMessageInternal(CommunicationManager.defaultPort, controlCommands.hostReady); this.dispatchEventInternal("ControlReady", document.createEvent("Event")); }; CommunicationManager.prototype.processMessage = function (message) { var messageHeaderDelimiterIndex = message.indexOf(CommunicationManager.messageHeaderDelimiter); var controlHeader; var payload = null; if(messageHeaderDelimiterIndex < 0) { controlHeader = message; } else { controlHeader = message.substring(0, messageHeaderDelimiterIndex); payload = message.substring(messageHeaderDelimiterIndex + 1); } var header = JSON.parse(controlHeader); if(header.portId > CommunicationManager.defaultPort) { if(this.registeredPorts[header.portId]) { this.registeredPorts[header.portId].processMessage(header.msgId, payload, header.replyRequested); } else { throw new Error("OnMessage: Unknown portId: " + header.portId); } } else { switch(header.command) { case controlCommands.controlInitialized: this.pendingRemotePorts = { }; this.disconnectPorts(); this.controlReadyWaitTaskList = { length: 0 }; this.dispatchEventInternal("BeforeControlReady", new BeforeControlReadyEventArgs(this)); if(this.controlReadyWaitTaskList.length === 0) { this.fireControlReady(); } break; case controlCommands.portCreated: if(!header.args || header.args.Length <= 0) { throw new Error("OnMessage: Invalid message header for command PortCreated."); } var newPortName = header.args[0]; if(typeof newPortName !== 'string' || newPortName.length <= 0) { throw new Error("OnMessage: Invalid message header for command PortCreated."); } if(this.registeredPortNames[newPortName]) { this.connectPort(newPortName); } else { if(this.pendingRemotePorts[newPortName]) { throw new Error("Received connect event for the same port more than once."); } if(!this.pendingRemotePorts[newPortName]) { this.pendingRemotePorts[newPortName] = { }; } } break; case controlCommands.portClosed: if(!header.args || header.args.Length <= 0) { throw new Error("OnMessage: Invalid message header for command PortClosed."); } var existingPortName = header.args[0]; if(typeof existingPortName !== 'string' || existingPortName.length <= 0) { throw new Error("OnMessage: Invalid message header for command PortClosed."); } if(this.registeredPortNames[existingPortName]) { var port = this.registeredPortNames[existingPortName]; this.disconnectPort(port._portId); } else { if(!this.pendingRemotePorts[existingPortName]) { throw new Error("Received close event before a create event."); } delete this.pendingRemotePorts[existingPortName]; } break; case controlCommands.shutdownComplete: this.dispatchEventInternal("ControlShutdown", document.createEvent("Event")); break; default: throw new Error("OnMessage: Unexpected command: " + header.command); } } }; CommunicationManager.prototype.delayControlReadyEvent = function () { var tokenId = this.lastDelayControlReadyTokenId++; this.controlReadyWaitTaskList[tokenId] = true; this.controlReadyWaitTaskList.length++; return tokenId; }; CommunicationManager.prototype.unblockControlReadyEvent = function (tokenId) { if(this.controlReadyWaitTaskList[tokenId]) { this.controlReadyWaitTaskList[tokenId] = null; this.controlReadyWaitTaskList.length--; if(this.controlReadyWaitTaskList.length === 0) { this.fireControlReady(); } } }; CommunicationManager.prototype.registerPort = function (port) { var _this = this; if(this.registeredPorts[port.id]) { throw new Error("RegisterPort: Port already exists."); } if(!this.registeredPortNames[port.name]) { throw new Error("RegisterPort: Port name is not listed."); } this.registeredPorts[port.id] = port; this.registeredPortNames[port.name] = port; if(this.pendingRemotePorts[port.name]) { window.setImmediate(function () { if(_this.pendingRemotePorts[port.name]) { delete _this.pendingRemotePorts[port.name]; _this.connectPort(port.name); } }); } }; CommunicationManager.prototype.unregisterPort = function (port) { if(!this.registeredPorts[port.id]) { throw new Error("UnregisterPort: Port does not exist."); } if(!this.registeredPortNames[port.name]) { throw new Error("UnregisterPort: Port name does not exist."); } delete this.registeredPorts[port.id]; delete this.registeredPortNames[port.name]; this.pendingRemotePorts[port.name] = { }; this.postMessageInternal(CommunicationManager.defaultPort, controlCommands.portClosed, [ port.id ]); }; CommunicationManager.prototype.postPortMessage = function (portId, message) { this.postMessageInternal(portId, controlCommands.none, null, message); }; CommunicationManager.prototype.postMessageReply = function (portId, orignalMessageId, message) { this.postMessageInternal(portId, controlCommands.none, null, message, orignalMessageId); }; CommunicationManager.prototype.postMessageErrorReply = function (portId, orignalMessageId, error) { this.postMessageInternal(portId, controlCommands.error, [ { message: error.message, stack: error.stack } ], null, orignalMessageId); }; CommunicationManager.prototype.createPort = function (name) { var portId = this.lastPortId++; var port = new Port(this, name, portId); this.registeredPortNames[name] = { }; return port; }; CommunicationManager.prototype.fireEvent = function (eventName, eventArgs) { if(typeof eventName !== 'string' || eventName.length <= 0) { throw new Error("Invalid eventName"); } if(eventName.indexOf(CommunicationManager.messageHeaderDelimiter) > 0) { throw new Error("eventName cannot contain " + CommunicationManager.messageHeaderDelimiter); } this.postMessageInternal(CommunicationManager.defaultPort, controlCommands.event, [ eventName, eventArgs ]); }; CommunicationManager.prototype.initiateShutdown = function () { this.postMessageInternal(CommunicationManager.defaultPort, controlCommands.initiateShutdown); }; return CommunicationManager; })(CustomEventTarget); Host.CommunicationManager = CommunicationManager; })(F12.Host || (F12.Host = {})); var Host = F12.Host; })(F12 || (F12 = {})); var F12; (function (F12) { (function (Host) { (function (Impl) { (function (ResourceLocation) { ResourceLocation._map = []; ResourceLocation.Local = 2; ResourceLocation.Host = 3; })(Impl.ResourceLocation || (Impl.ResourceLocation = {})); var ResourceLocation = Impl.ResourceLocation; var Storage = (function () { function Storage() { } Storage._storageDispatch = F12.Host.ExternalApis.storage; Storage.prototype.closeFile = function (streamId) { return new Plugin.Promise(function (complete, error) { try { Storage._storageDispatch.closeFile(streamId); complete(); } catch (ex) { error(ex); } }); }; Storage.prototype.deleteFile = function (path) { return new Plugin.Promise(function (complete, error) { try { Storage._storageDispatch.deleteFile(path); complete(); } catch (ex) { error(ex); } }); }; Storage.prototype.fileDialog = function (mode, dialogOptions, fileOptions) { return new Plugin.Promise(function (complete, error) { try { var streamId = null; switch(mode) { case Plugin.Storage.FileDialogMode.open: streamId = Storage._storageDispatch.showOpenFileDialog(dialogOptions.name, null, dialogOptions.extensions); break; case Plugin.Storage.FileDialogMode.save: streamId = Storage._storageDispatch.showSaveFileDialog(dialogOptions.name, null, dialogOptions.extensions); break; default: throw new Error("Invalid dialog mode"); } complete(streamId); } catch (ex) { error(ex); } }); }; Storage.prototype.getFileList = function (path, persistence, index, count) { persistence = persistence || Plugin.Storage.FilePersistence.temporary; index = index || 0; count = count || 0; return new Plugin.Promise(function (complete, error) { try { var fileNames = Storage._storageDispatch.getFileList(path, persistence, index, count); complete(fileNames); } catch (ex) { error(ex); } }); }; Storage.prototype.openFile = function (path, options) { return new Plugin.Promise(function (complete, error) { try { var streamId = Storage._storageDispatch.openFile(path, options.access, options.encoding, options.mode, options.persistence, options.type || Plugin.Storage.FileType.text); complete(streamId); } catch (ex) { error(ex); } }); }; Storage.prototype.seek = function (streamId, offset, origin) { return new Plugin.Promise(function (complete, error) { try { var newPosition = Storage._storageDispatch.seek(streamId, offset, origin); complete(newPosition); } catch (ex) { error(ex); } }); }; Storage.prototype.read = function (streamId, count, type) { return new Plugin.Promise(function (complete, error) { try { var data; switch(type) { case Plugin.Storage.FileType.binary: data = Storage._storageDispatch.readBinaryToByteArray(streamId, count); break; case Plugin.Storage.FileType.text: data = Storage._storageDispatch.readText(streamId, count); break; default: throw new Error("Unsupported File Type"); } complete(data); } catch (ex) { error(ex); } }); }; Storage.prototype.write = function (streamId, data, offset, count, type) { return new Plugin.Promise(function (complete, error) { try { switch(type) { case Plugin.Storage.FileType.binary: Storage._storageDispatch.writeBinaryFromByteArray(streamId, data, offset, count); break; case Plugin.Storage.FileType.text: Storage._storageDispatch.writeText(streamId, data, offset, count); break; default: throw new Error("Unsupported File Type"); } complete(); } catch (ex) { error(ex); } }); }; Storage.getPluginRelativePath = function getPluginRelativePath(absolutePath) { var linkToCss = document.createElement("a"); linkToCss.href = absolutePath; var fileAbs = linkToCss.pathname.replace(/\//g, "\\"); linkToCss.href = document.location.href; var currentAbs = linkToCss.pathname.replace(/\//g, "\\"); var filePath = fileAbs.substr(0, fileAbs.lastIndexOf("\\")); var rootPath = currentAbs.substr(0, currentAbs.lastIndexOf("\\")); var fileParts = filePath.split("\\"); var rootParts = rootPath.split("\\"); var relativeParts = []; var length = Math.max(fileParts.length, rootParts.length); var common = 0; for(var i = 0; i < length; i++) { if(fileParts[i] === rootParts[i]) { common++; } else { break; } } if(rootParts.length > common) { for(var i = common; i < rootParts.length; i++) { relativeParts.push(".."); } } if(fileParts.length > common) { for(var i = common; i < fileParts.length; i++) { relativeParts.push(fileParts[i]); } } relativeParts.push(fileAbs.substr(fileAbs.lastIndexOf("\\") + 1)); return relativeParts.join("/"); }; Storage.getResourceIdFromRelativePath = function getResourceIdFromRelativePath(path) { var resourceId = path.replace(/\\/g, "/"); if(resourceId.length > 0 && resourceId[0] === "/") { resourceId = resourceId.substr(1); } return resourceId; }; Storage.readHostFile = function readHostFile(fileName) { try { return Storage._storageDispatch.readResourceText(fileName, ResourceLocation.Host); } catch (ex) { return null; } }; Storage.readPluginFile = function readPluginFile(fileName, asBase64) { try { if(!asBase64) { return Storage._storageDispatch.readResourceText(fileName, ResourceLocation.Local); } else { return Storage._storageDispatch.readResourceBinaryToBase64(fileName, ResourceLocation.Local); } } catch (ex) { return null; } }; Storage.readEntireFile = function readEntireFile(fileName, options, asBase64) { return new Plugin.Promise(function (complete, error) { try { var streamId = null; var data = null; streamId = Storage._storageDispatch.openFile(fileName, Plugin.Storage.FileAccess.read, options.encoding, options.mode, options.persistence, options.type); if(!asBase64) { data = Storage._storageDispatch.readText(streamId, 0); } else { data = Storage._storageDispatch.readBinaryToBase64(streamId, 0); } if(streamId != null) { Storage._storageDispatch.closeFile(streamId); streamId = null; } complete(data); } catch (ex) { error(ex); }finally { if(streamId != null) { Storage._storageDispatch.closeFile(streamId); } } }); }; Storage.writeEntireFile = function writeEntireFile(fileName, data, options, asBase64) { var streamId = null; try { streamId = Storage._storageDispatch.openFile(fileName, Plugin.Storage.FileAccess.write, options.encoding, options.mode, options.persistence, options.type); if(!asBase64) { Storage._storageDispatch.writeText(streamId, data, 0, 0); } else { Storage._storageDispatch.writeBinaryFromBase64(streamId, data, 0, 0); } } catch (ex) { }finally { if(streamId != null) { Storage._storageDispatch.closeFile(streamId); } } }; return Storage; })(); Impl.Storage = Storage; })(Host.Impl || (Host.Impl = {})); var Impl = Host.Impl; })(F12.Host || (F12.Host = {})); var Host = F12.Host; })(F12 || (F12 = {})); var F12; (function (F12) { (function (Host) { (function (Impl) { var Core = (function () { function Core() { var _this = this; this._loadedScriptExtensions = { }; this._communicationManager = new Host.CommunicationManager(this.postMessageToPlugin.bind(this)); this._communicationManager.addEventListener("BeforeControlReady", function (e) { return _this.onBeforeControlReady(e); }); } Core.prototype.loadExtensions = function (manifest) { if(manifest) { var scriptExtensionKey = manifest.f12 || manifest.webhost; if(scriptExtensionKey && scriptExtensionKey.published_objects) { var scriptExtensions = scriptExtensionKey.published_objects; for(var key in scriptExtensions) { var extensionInfo = scriptExtensions[key]; if(extensionInfo.path) { var path = scriptExtensions[key].path.replace(/\//g, "\\"); var data = Impl.Storage.readPluginFile(path); if(data) { try { eval(data); } catch (ex) { Impl.Diagnostics.reportHostError("Invalid host extension at: " + path); break; } var publishedObject = null; try { publishedObject = eval("new " + key + "()"); } catch (ex) { Impl.Diagnostics.reportHostError("Invalid published object class name: " + key); break; } if(!publishedObject) { Impl.Diagnostics.reportHostError("Invalid published object: " + key); break; } this.publishExtension(key, publishedObject); } } else { Impl.Diagnostics.reportHostError("Invalid host extension: " + key); } } } } }; Core.prototype.publishExtension = function (name, publishedObject) { var port = this._communicationManager.createPort(name); var extension = new Host.PortMarshaller(port, publishedObject); this._loadedScriptExtensions[name] = extension; port.connect(); }; Core.prototype.onBeforeControlReady = function (e) { this._delayToken = e.delayControlReadyEvent(); }; Core.prototype.hostDescription = function () { return "F12 Developer Tools"; }; Core.prototype.postMessage = function (message) { var _this = this; window.setTimeout(function () { _this._communicationManager.processMessage(message); }, 0); }; Core.prototype.postMessageToPlugin = function (message) { if(this.messageReceived) { this.messageReceived(message); } }; Core.prototype.setControlReady = function (manifest) { this.loadExtensions(manifest); this._communicationManager.unblockControlReadyEvent(this._delayToken); }; Core.prototype.setMessageCallback = function (callback) { this.messageReceived = callback; }; return Core; })(); Impl.Core = Core; })(Host.Impl || (Host.Impl = {})); var Impl = Host.Impl; })(F12.Host || (F12.Host = {})); var Host = F12.Host; })(F12 || (F12 = {})); var F12; (function (F12) { (function (Host) { (function (Impl) { var Resources = (function (_super) { __extends(Resources, _super); function Resources() { _super.call(this); } Resources._utilitiesDispatch = F12.Host.ExternalApis.utilities; Resources.prototype.loadResources = function (manifest) { var resourceMap = { }; var defaultAlias = null; if(manifest) { var isNativeStringTable = (manifest.f12 && manifest.f12.resource_aliases); var aliases = (isNativeStringTable ? manifest.f12.resource_aliases : manifest.resource_aliases); if(aliases) { for(var alias in aliases) { var map = Resources._utilitiesDispatch.getStringTableResources(alias); resourceMap[alias] = map; if(aliases[alias].is_default) { defaultAlias = alias; } } } } return { ResourceMap: resourceMap, DefaultAlias: defaultAlias, GenericError: "An error has occurred" }; }; Resources.prototype.triggerInitialized = function (manifest) { this._loadedResources = this.loadResources(manifest); this.dispatchEvent("resourcesinitialized", this._loadedResources, true); }; Resources.prototype.triggerChanged = function () { this.dispatchEvent("resourceschanged", this._loadedResources); }; return Resources; })(Host.EventManager); Impl.Resources = Resources; })(Host.Impl || (Host.Impl = {})); var Impl = Host.Impl; })(F12.Host || (F12.Host = {})); var Host = F12.Host; })(F12 || (F12 = {})); var F12; (function (F12) { (function (Host) { (function (Impl) { var Theme = (function (_super) { __extends(Theme, _super); function Theme() { var _this = this; _super.call(this); F12.Host.ExternalApis.addEventListener("syscolorchanged", function () { _this.updateTheme(); }); } Theme._hostFilePrefix = "F12HOSTFILE__"; Theme._themeFile = "light"; Theme._highContrastThemeFile = "highContrast"; Theme._rgbRegEx = /[^0-9]+/g; Theme.prototype.addImagesToThemeMap = function (themeMap, images, shouldApplyTheme) { for(var key in images) { var imageData = null; if(images[key].bitmap_source) { var imageId = Impl.Storage.getResourceIdFromRelativePath(images[key].bitmap_source); var backgroundColor = themeMap[images[key].background_color]; if(shouldApplyTheme && backgroundColor) { this._conversionElement = this._conversionElement || document.createElement("div"); this._conversionElement.style.backgroundColor = backgroundColor; var parts = this._conversionElement.style.backgroundColor.split(","); F12.Tools.Utility.Assert.IsTrue(parts.length === 3, "Unexpected number of RGB parts when adding images to the theme map."); var rgbParts = []; for(var i = 0; i < 3; i++) { rgbParts.push(parseInt(parts[i].replace(Theme._rgbRegEx, ''), 10)); } var fileName = Impl.Storage._storageDispatch.getResourceFileName(imageId, Impl.ResourceLocation.Local); imageData = F12.Host.ExternalApis.utilities.getThemedImage(fileName, rgbParts[0], rgbParts[1], rgbParts[2]); } if(!imageData) { imageData = Impl.Storage.readPluginFile(imageId, true); } if(imageData) { imageData = "data:image/png;base64," + imageData; themeMap[key] = imageData; } } } }; Theme.prototype.loadTheme = function (manifest, isHighContrast) { var themeMap = { }; var cssText = Impl.Storage.readHostFile("theme/plugin.css"); if(isHighContrast) { var themeText = Impl.Storage.readHostFile("theme/" + Theme._highContrastThemeFile + ".json"); var replacementMap = F12.Host.ExternalApis.utilities.getHighContrastReplacements(); for(var key in replacementMap) { themeText = themeText.replace(new RegExp(key, "g"), replacementMap[key]); } themeMap = JSON.parse(themeText); } else { var themeText = Impl.Storage.readHostFile("theme/" + Theme._themeFile + ".json"); themeMap = JSON.parse(themeText); } if(manifest) { if(manifest.f12 && manifest.f12.themed_images) { var images = manifest.f12.themed_images; this.addImagesToThemeMap(themeMap, images, isHighContrast); } } return { PluginCss: cssText, themeMap: themeMap }; }; Theme.prototype.updateTheme = function () { if(F12.Host.ExternalApis.utilities.isHighContrast() && this._manifest) { var highContrastTheme = this.loadTheme(this._manifest, true); this.dispatchEvent("themechanged", highContrastTheme, true); } else { this.dispatchEvent("themechanged", this._loadedTheme, true); } }; Theme.prototype.fireThemeReady = function () { this.dispatchEvent("themeReady"); }; Theme.prototype.getCssFile = function (name) { if(name.indexOf(Theme._hostFilePrefix) === 0) { name = name.substr(Theme._hostFilePrefix.length); return new Plugin.Promise(function (complete, error) { complete(Impl.Storage.readHostFile(name)); }); } var relativePath = Impl.Storage.getPluginRelativePath(name); return new Plugin.Promise(function (complete, error) { complete(Impl.Storage.readPluginFile(relativePath)); }); }; Theme.prototype.triggerInitialized = function (manifest) { this._manifest = manifest; this._loadedTheme = this.loadTheme(manifest, false); if(F12.Host.ExternalApis.utilities.isHighContrast()) { var highContrastTheme = this.loadTheme(manifest, true); this.dispatchEvent("themeinitialize", highContrastTheme, true); } else { this.dispatchEvent("themeinitialize", this._loadedTheme, true); } }; Theme.prototype.triggerChanged = function () { this.dispatchEvent("themechanged", this._loadedTheme); }; return Theme; })(Host.EventManager); Impl.Theme = Theme; })(Host.Impl || (Host.Impl = {})); var Impl = Host.Impl; })(F12.Host || (F12.Host = {})); var Host = F12.Host; })(F12 || (F12 = {})); var F12; (function (F12) { (function (Host) { (function (Impl) { var Culture = (function (_super) { __extends(Culture, _super); function Culture() { _super.call(this); } Culture.prototype.loadCulture = function (manifest) { var culture = (window.external).utilities.getCultureInfo(); culture.numberFormat.currencyGroupSizes = this.convertPatternToArray(culture.numberFormat.currencyGroupSizes); culture.numberFormat.numberGroupSizes = this.convertPatternToArray(culture.numberFormat.numberGroupSizes); culture.numberFormat.percentGroupSizes = this.convertPatternToArray(culture.numberFormat.percentGroupSizes); culture.direction = "ltr"; return culture; }; Culture.prototype.convertPatternToArray = function (pattern) { var group = []; var parts = pattern.split(";"); for(var i = 0; i < parts.length; i++) { group.push(parseInt(parts[i], 10)); } return group; }; Culture.prototype.triggerInitialized = function (manifest) { this._loadedCulture = this.loadCulture(manifest); this.dispatchEvent("cultureinitialize", this._loadedCulture, true); }; Culture.prototype.triggerChanged = function () { this.dispatchEvent("culturechanged", this._loadedCulture); }; return Culture; })(Host.EventManager); Impl.Culture = Culture; })(Host.Impl || (Host.Impl = {})); var Impl = Host.Impl; })(F12.Host || (F12.Host = {})); var Host = F12.Host; })(F12 || (F12 = {})); var F12; (function (F12) { (function (Host) { (function (Impl) { var ContextMenu = (function (_super) { __extends(ContextMenu, _super); function ContextMenu() { var _this = this; _super.call(this); this.isListening = false; this.addEventListener("dismiss", function () { _this.dismiss(); }); } ContextMenu._isContextMenuActive = false; ContextMenu.utilitiesDispatch = F12.Host.ExternalApis.utilities; ContextMenu.prototype.triggerDismiss = function (manifest) { this.dispatchEvent("dismiss"); }; ContextMenu.prototype.adjustShowCoordinates = function (coordinates) { return coordinates; }; ContextMenu.prototype.callback = function (id) { var event = { name: "contextmenuclicked", id: id }; document.parentWindow.postMessage(event, document.URL); return null; }; ContextMenu.prototype.canCreatePopup = function (hasSubmenu) { if(hasSubmenu) { return false; } return true; }; ContextMenu.prototype.disableZoom = function () { }; ContextMenu.prototype.dismiss = function () { F12.Host.ExternalApis.popup.closePopup(); ContextMenu._isContextMenuActive = false; var popup = F12.Host.ExternalApis.popup.browser; if(popup !== null && this.isListening) { popup.Document.parentWindow.removeEventListener("message", this.onMessageFromPopup); F12.Host.ExternalApis.popup.removeAllEventListeners(); popup.Document.getElementById("contextmenu").style.display = "none"; this.dispatchEvent("contextmenudismissed", { id: this.menuId }); this.isListening = false; } return null; }; ContextMenu.prototype.dismissCurrent = function (ignoreDismissForRoot) { if(!ignoreDismissForRoot) { var event = { name: "contextmenudismissed" }; document.parentWindow.postMessage(event, document.URL); } return null; }; ContextMenu.prototype.dismissSubmenus = function (currentCoordinates) { return null; }; ContextMenu.prototype.fireContentReady = function () { var element = document.getElementById("contextmenu"); element.focus(); return null; }; ContextMenu.prototype.show = function (menuId, ariaLabel, contextMenus, positionInfo) { var _this = this; this.contextMenus = contextMenus; this.menuId = menuId; this.currentDisplayInfo = ContextMenu.adjustCoordinates(positionInfo.clientCoordinates.X, positionInfo.clientCoordinates.Y, positionInfo.width, positionInfo.height); var isPluginReady = F12.Host.ExternalApis.popup.browser ? true : false; F12.Host.ExternalApis.popup.createPopup(true, this.currentDisplayInfo.screenX, this.currentDisplayInfo.screenY, this.currentDisplayInfo.width, this.currentDisplayInfo.height, function () { var popupDoc = F12.Host.ExternalApis.popup.browser.Document; var body = popupDoc.body; var tooltip = popupDoc.getElementById("plugin-vs-tooltip"); if(tooltip) { tooltip.style.display = "none"; } if(ariaLabel && ariaLabel.length !== 0) { var ul = popupDoc.getElementById("contextmenu"); if(ul) { ul.setAttribute("aria-label", ariaLabel); } } _this.isListening = true; popupDoc.parentWindow.addEventListener("message", _this.onMessageFromPopup, false); F12.Host.ExternalApis.popup.addEventListener("click", function (event) { _this.handleMouseClick(event); }); F12.Host.ExternalApis.popup.addEventListener("dismisspopup", function () { _this.dismiss(); }); var initScript = "F12.Host.App.pluginHost.triggerContextMenuEvent('contextmenuinitialized', { contextMenus: '" + contextMenus.innerHTML + "' , id: '" + _this.menuId + "'});"; if(!isPluginReady) { initScript = "Plugin.addEventListener('pluginready', function () { " + initScript + " });"; } var scriptElement = popupDoc.getElementById("data-plugin-initscript"); if(scriptElement) { body.removeChild(scriptElement); } scriptElement = popupDoc.createElement("script"); scriptElement.id = "data-plugin-initscript"; scriptElement.type = "text/javascript"; scriptElement.innerHTML = initScript; body.appendChild(scriptElement); ContextMenu._isContextMenuActive = true; }); return null; }; ContextMenu.prototype.triggerContextMenuEvent = function (type, event) { this.dispatchEvent(type, event); }; ContextMenu.prototype.onMessageFromPopup = function (event) { var popup = F12.Host.ExternalApis.popup.browser; if(popup) { var popupUrl = popup.Document.URL.toLowerCase(); var endIndex = popupUrl.indexOf("f12resources.dll"); if(event.origin.toLowerCase() !== popupUrl.substring(0, endIndex + 16)) { return; } switch(event.data.name) { case "contextmenuclicked": F12.Host.App.pluginHost.triggerContextMenuEvent(event.data.name, { Id: event.data.id }); break; case "contextmenudismissed": F12.Host.App.pluginHost.triggerContextMenuEvent("dismiss"); break; } } }; ContextMenu.isContextMenuActive = function isContextMenuActive() { return ContextMenu._isContextMenuActive; }; ContextMenu.adjustCoordinates = function adjustCoordinates(clientX, clientY, width, height, useOffset) { var yOffset = useOffset ? 18 : 0; var scaleFactor = screen.deviceXDPI / screen.logicalXDPI; var screenPoint = ContextMenu.utilitiesDispatch.getClientToScreenPoint(clientX * scaleFactor, clientY * scaleFactor); var x = screenPoint.x; var y = screenPoint.y; var scaledWidth = Math.ceil(width * scaleFactor); var scaledHeight = Math.ceil(height * scaleFactor); var screenTop = ContextMenu.utilitiesDispatch.getMonitorTopFromCoord(x, y); var screenLeft = ContextMenu.utilitiesDispatch.getMonitorLeftFromCoord(x, y); var screenRight = ContextMenu.utilitiesDispatch.getMonitorRightFromCoord(x, y); var screenBottom = ContextMenu.utilitiesDispatch.getMonitorBottomFromCoord(x, y); y += yOffset * scaleFactor; var distToScreenRight = screenRight - (x + scaledWidth); if(distToScreenRight < 0) { x += distToScreenRight; var distToScreenLeft = x - screenLeft; if(distToScreenLeft < 0) { x -= distToScreenLeft; } } var distToScreenBottom = screenBottom - (y + height); if(distToScreenBottom < 0) { y -= ((yOffset * scaleFactor) + scaledHeight); var distToScreenTop = y - screenTop; if(distToScreenTop > distToScreenBottom) { if(distToScreenTop < 0) { y -= distToScreenTop; } } } return { screenX: x, screenY: y, width: scaledWidth, height: scaledHeight }; }; ContextMenu.prototype.handleMouseClick = function (event) { var isClickOutsidePopup = ((event.x < this.currentDisplayInfo.screenX || event.x > this.currentDisplayInfo.screenX + this.currentDisplayInfo.width) || (event.y < this.currentDisplayInfo.screenY || event.y > this.currentDisplayInfo.screenY + this.currentDisplayInfo.height)); if(isClickOutsidePopup) { this.dismiss(); } }; return ContextMenu; })(Host.EventManager); Impl.ContextMenu = ContextMenu; })(Host.Impl || (Host.Impl = {})); var Impl = Host.Impl; })(F12.Host || (F12.Host = {})); var Host = F12.Host; })(F12 || (F12 = {})); var F12; (function (F12) { (function (Host) { (function (Impl) { var Tooltip = (function () { function Tooltip() { this.isFirstShow = true; this.styleHTML = ""; } Tooltip._utilitiesDispatch = F12.Host.ExternalApis.utilities; Tooltip.prototype.getDblClickTime = function () { return Tooltip._utilitiesDispatch.getDoubleClickTime(); }; Tooltip.prototype.canCreatePopup = function () { return true; }; Tooltip.prototype.getScreenSizeForXY = function (screenX, screenY) { var scaleFactor = screen.deviceXDPI / screen.logicalXDPI; var x = screenX * scaleFactor; var y = screenY * scaleFactor; var screenTop = Impl.ContextMenu.utilitiesDispatch.getMonitorTopFromCoord(x, y); var screenLeft = Impl.ContextMenu.utilitiesDispatch.getMonitorLeftFromCoord(x, y); var screenRight = Impl.ContextMenu.utilitiesDispatch.getMonitorRightFromCoord(x, y); var screenBottom = Impl.ContextMenu.utilitiesDispatch.getMonitorBottomFromCoord(x, y); return { "Width": screenRight - screenLeft, "Height": screenBottom - screenTop }; }; Tooltip.prototype.hostContentInPopup = function (displayParameters) { var _this = this; if(!Impl.ContextMenu.isContextMenuActive()) { var currentDisplayInfo = Impl.ContextMenu.adjustCoordinates(displayParameters.clientCoordinates.X, displayParameters.clientCoordinates.Y, displayParameters.contentSize.Width, displayParameters.contentSize.Height, true); F12.Host.ExternalApis.popup.createPopup(false, currentDisplayInfo.screenX, currentDisplayInfo.screenY, currentDisplayInfo.width, currentDisplayInfo.height, function () { var popupDoc = F12.Host.ExternalApis.popup.browser.Document; var tooltipContent; F12.Host.ExternalApis.popup.addEventListener("click", function (event) { _this.dismissPopup(); }); if(_this.isFirstShow) { var doc = document.implementation.createHTMLDocument("Tooltip Document"); doc.documentElement.innerHTML = displayParameters.content; tooltipContent = doc.getElementById("plugin-vs-tooltip").outerHTML; var styleNodes = document.head.querySelectorAll("style, link[type='text/css']"); for(var i = 0; i < styleNodes.length; i++) { _this.styleHTML += (styleNodes[i]).outerHTML; } _this.isFirstShow = false; } else { tooltipContent = displayParameters.content; } var popupStyleNodes = popupDoc.head.querySelectorAll("style, link[type='text/css']"); for(var i = 0; i < popupStyleNodes.length; i++) { if(popupStyleNodes[i].id !== "pluginPopupWindowDefault") { popupDoc.head.removeChild(popupStyleNodes[i]); } } popupDoc.head.innerHTML = popupDoc.head.innerHTML + _this.styleHTML; popupDoc.getElementById("plugin-vs-tooltip").outerHTML = tooltipContent; }); } }; Tooltip.prototype.dismissPopup = function () { var popup = F12.Host.ExternalApis.popup.browser; if(popup) { var tooltip = popup.Document.getElementById("plugin-vs-tooltip"); if(tooltip) { tooltip.style.display = "none"; } if(!F12.Host.Impl.ContextMenu.isContextMenuActive()) { F12.Host.ExternalApis.popup.removeAllEventListeners(); F12.Host.ExternalApis.popup.closePopup(); if(popup.Document.head) { var popupStyleNodes = popup.Document.head.querySelectorAll("style, link[type='text/css']"); for(var i = 0; i < popupStyleNodes.length; i++) { if(popupStyleNodes[i].id !== "pluginCss" && popupStyleNodes[i].id !== "pluginPopupWindowDefault" && popupStyleNodes[i].getAttribute("data-plugin-theme-href") !== "F12HOSTFILE__theme/f12.css") { popup.Document.head.removeChild(popupStyleNodes[i]); } } } } } }; return Tooltip; })(); Impl.Tooltip = Tooltip; })(Host.Impl || (Host.Impl = {})); var Impl = Host.Impl; })(F12.Host || (F12.Host = {})); var Host = F12.Host; })(F12 || (F12 = {})); var F12; (function (F12) { (function (Host) { (function (Impl) { var ActivityLog = (function () { function ActivityLog() { } ActivityLog.prototype.logEntry = function (entryType, message) { console.log("ActivityLog: " + entryType + ", " + message); }; return ActivityLog; })(); Impl.ActivityLog = ActivityLog; })(Host.Impl || (Host.Impl = {})); var Impl = Host.Impl; })(F12.Host || (F12.Host = {})); var Host = F12.Host; })(F12 || (F12 = {})); var F12; (function (F12) { (function (Host) { (function (Impl) { var CodeMarkers = (function () { function CodeMarkers() { if(!(Plugin).detect) { (Plugin).detect = { }; } } CodeMarkers.prototype.fireCodeMarker = function (marker) { window.msWriteProfilerMark("F12:" + marker); }; return CodeMarkers; })(); Impl.CodeMarkers = CodeMarkers; })(Host.Impl || (Host.Impl = {})); var Impl = Host.Impl; })(F12.Host || (F12.Host = {})); var Host = F12.Host; })(F12 || (F12 = {})); var F12; (function (F12) { (function (Host) { (function (Impl) { var Host = (function () { function Host() { } Host.prototype.showDocument = function (documentPath, line, col) { return (Plugin).F12.Debugger.showDocument(documentPath, line, col); }; Host.prototype.supportsAllowSetForeground = function () { return true; }; Host.prototype.allowSetForeground = function (processId) { return F12.Host.ExternalApis.allowSetForeground(processId); }; return Host; })(); Impl.Host = Host; })(Host.Impl || (Host.Impl = {})); var Impl = Host.Impl; })(F12.Host || (F12.Host = {})); var Host = F12.Host; })(F12 || (F12 = {})); var F12; (function (F12) { (function (Host) { (function (Impl) { var Output = (function () { function Output() { } Output.prototype.log = function (message) { console.log("Output.log: " + message); }; return Output; })(); Impl.Output = Output; })(Host.Impl || (Host.Impl = {})); var Impl = Host.Impl; })(F12.Host || (F12.Host = {})); var Host = F12.Host; })(F12 || (F12 = {})); var F12; (function (F12) { (function (Host) { (function (Impl) { var Diagnostics = (function () { function Diagnostics() { this._pluginName = "Plugin"; } Diagnostics._utilitiesDispatch = F12.Host.ExternalApis.utilities; Diagnostics.prototype.reportError = function (message, url, lineNumber, additionalInfo, columnNumber) { if(!message) { message = ""; } if(!url) { url = ""; } if(typeof lineNumber !== "string") { lineNumber = ("" + lineNumber); } if(!columnNumber) { columnNumber = "0"; } if(typeof columnNumber !== "string") { columnNumber = ("" + columnNumber); } var info = ""; if(additionalInfo) { info = ("" + additionalInfo); } return Diagnostics._utilitiesDispatch.reportError(this._pluginName, message, url, lineNumber, columnNumber, info); }; Diagnostics.prototype.terminate = function () { }; Diagnostics.reportHostError = function reportHostError(message, additionalInfo) { this.reportError("Host Error - " + message, "plugin.f12.js", "", additionalInfo); }; Diagnostics.prototype.triggerInitialized = function (manifest) { if(manifest && manifest.name) { this._pluginName = manifest.name; } }; return Diagnostics; })(); Impl.Diagnostics = Diagnostics; })(Host.Impl || (Host.Impl = {})); var Impl = Host.Impl; })(F12.Host || (F12.Host = {})); var Host = F12.Host; })(F12 || (F12 = {})); var F12; (function (F12) { (function (Host) { (function (Impl) { (function (SettingsScope) { SettingsScope._map = []; SettingsScope.user = 0; SettingsScope.config = 1; })(Impl.SettingsScope || (Impl.SettingsScope = {})); var SettingsScope = Impl.SettingsScope; var Settings = (function () { function Settings() { } Settings.defaultFileName = "settings.json"; Settings.prototype.getSettingsData = function () { var _this = this; if(this._loadedData) { return Plugin.Promise.wrap(this._loadedData); } var options = { access: Plugin.Storage.FileAccess.read, encoding: "UTF-8", mode: Plugin.Storage.FileMode.openOrCreate, share: Plugin.Storage.FileShare.none, persistence: Plugin.Storage.FilePersistence.permanent, type: Plugin.Storage.FileType.text }; return Impl.Storage.readEntireFile(Settings.defaultFileName, options).then(function (fileText) { var data = null; if(fileText) { data = JSON.parse(fileText); } if(!data) { data = { }; } if(!data[SettingsScope.user]) { data[SettingsScope.user] = { }; } if(!data[SettingsScope.config]) { data[SettingsScope.config] = { }; } _this._loadedData = data; return _this._loadedData; }); }; Settings.prototype.setSettingsData = function (data) { var options = { access: Plugin.Storage.FileAccess.write, encoding: "UTF-8", mode: Plugin.Storage.FileMode.createNew, share: Plugin.Storage.FileShare.none, persistence: Plugin.Storage.FilePersistence.permanent, type: Plugin.Storage.FileType.text }; var fileText = JSON.stringify(data); Impl.Storage.writeEntireFile(Settings.defaultFileName, fileText, options); this._loadedData = data; }; Settings.prototype.getSettingsInfoFromCollection = function (collection) { var scope = SettingsScope.user; var name = collection || ""; if(collection.indexOf(":") == 1) { if(collection[0].toLowerCase() === "c") { scope = SettingsScope.config; } name = (collection.substr(2) || ""); } return { scope: scope, name: name }; }; Settings.prototype.getScopedData = function (collection) { var info = this.getSettingsInfoFromCollection(collection); return this.getSettingsData().then(function (data) { var scopedData = data[info.scope]; if(info.name) { if(!scopedData[info.name]) { scopedData[info.name] = { }; } scopedData = scopedData[info.name]; } return scopedData; }); }; Settings.prototype.get = function (collection, requestedProperties) { if(!collection || typeof collection !== "string") { collection = ""; } if(!requestedProperties) { requestedProperties = []; } return this.getScopedData(collection).then(function (scopedData) { if(requestedProperties.length === 0) { requestedProperties = Object.getOwnPropertyNames(scopedData); } var result = { }; for(var i = 0; i < requestedProperties.length; i++) { var key = requestedProperties[i]; if(scopedData.hasOwnProperty(key)) { result[key] = scopedData[key]; } else { result[key] = null; } } return result; }); }; Settings.prototype.set = function (collection, toSet) { var _this = this; if(!collection || typeof collection !== "string") { collection = ""; } if(!toSet) { toSet = { }; } this.getScopedData(collection).done(function (scopedData) { for(var key in toSet) { if(toSet.hasOwnProperty(key)) { scopedData[key] = toSet[key]; } } _this.setSettingsData(_this._loadedData); }); }; return Settings; })(); Impl.Settings = Settings; })(Host.Impl || (Host.Impl = {})); var Impl = Host.Impl; })(F12.Host || (F12.Host = {})); var Host = F12.Host; })(F12 || (F12 = {})); var F12; (function (F12) { (function (Host) { (function (Impl) { var FileAliases = (function () { function FileAliases() { } FileAliases.prototype.initialize = function (manifest) { this._fileAliasMap = { }; if(manifest) { var aliases = manifest.file_aliases; if(aliases) { for(var alias in aliases) { if(aliases.hasOwnProperty(alias)) { this._fileAliasMap[alias] = aliases[alias]; } } } } }; FileAliases.prototype.getPath = function (fileAlias) { if(!this._fileAliasMap || !this._fileAliasMap[fileAlias]) { return null; } return this._fileAliasMap[fileAlias].path; }; return FileAliases; })(); Impl.FileAliases = FileAliases; })(Host.Impl || (Host.Impl = {})); var Impl = Host.Impl; })(F12.Host || (F12.Host = {})); var Host = F12.Host; })(F12 || (F12 = {})); var Common; (function (Common) { "use strict"; var ErrorHandling = (function () { function ErrorHandling() { } ErrorHandling.stackRegex = new RegExp(".* at ([^(]+) \(.*/23/([^:]+):([0-9]+):([0-9]+)\)", "gim"); ErrorHandling.ReportErrorGivenStack = function ReportErrorGivenStack(error) { var message = error.message; var stack = (error).stack; var firstCloseParen = stack.indexOf(")"); if(firstCloseParen > 0) { stack = stack.substr(0, firstCloseParen + 1); } var result = ErrorHandling.stackRegex.exec(stack); if(result) { var file = result[3]; var line = parseInt(result[4], 10); var column = parseInt(result[5], 10); window.reportError(message, file, line, (error).stack, column); } }; return ErrorHandling; })(); Common.ErrorHandling = ErrorHandling; })(Common || (Common = {})); window.reportError = function (message, file, line, additionalInfo, column) { message = message || ""; file = file || ""; line = line || 0; additionalInfo = additionalInfo || ""; column = column || 0; if(isDebugBuild) { var externalObj; if(window.parent.getExternalObj) { externalObj = window.parent.getExternalObj(); } else if(window.external) { externalObj = window.external; } if(externalObj) { var component = (window.errorComponent ? window.errorComponent : "Common"); console.error(([ component, message, file, line, column ]).join("\r\n")); if(window.errorDisplayHandler) { window.errorDisplayHandler(message, file, line, additionalInfo, column); } } } if(Plugin && Plugin.Diagnostics && Plugin.Diagnostics.reportError) { Plugin.Diagnostics.reportError(message, file, line, additionalInfo, column); } }; window.onerror = function (message, file, line) { var column = 0; if(arguments && arguments[3] && typeof arguments[3] === 'number') { column = arguments[3]; } window.reportError(message, file, line, "", column); return true; }; var isDebugBuild = false; var F12; (function (F12) { (function (Tools) { (function (Utility) { var Assert = (function () { function Assert() { } Assert.IsTrue = function IsTrue(condition, message) { if(!condition) { message = message ? "Internal error. " + message : "Internal error. Unexpectedly false."; Assert.Fail(message); } }; Assert.IsFalse = function IsFalse(condition, message) { if(condition) { message = message ? "Internal error. " + message : "Internal error. Unexpectedly true."; Assert.Fail(message); } }; Assert.IsNull = function IsNull(value, message) { if(value !== null) { message = message ? "Internal error. " + message : "Internal error. Unexpectedly not null."; message += " '" + value + "'"; Assert.Fail(message); } }; Assert.IsUndefined = function IsUndefined(value, message) { if(value !== undefined) { message = message ? "Internal error. " + message : "Internal error. Unexpectedly not undefined."; message += " '" + value + "'"; Assert.Fail(message); } }; Assert.HasValue = function HasValue(value, message) { if(value === null || value === undefined) { message = message ? "Internal error. " + message : "Internal error. Unexpectedly null or undefined."; Assert.Fail(message); } }; Assert.AreEqual = function AreEqual(value1, value2, message) { if(value1 !== value2) { message = message ? "Internal error. " + message : "Internal error. Unexpectedly not equal."; message += " '" + value1 + "' !== '" + value2 + "'."; Assert.Fail(message); } }; Assert.AreNotEqual = function AreNotEqual(value1, value2, message) { if(value1 === value2) { message = message ? "Internal error. " + message : "Internal error. Unexpectedly equal."; message += " '" + value1 + "' === '" + value2 + "'."; Assert.Fail(message); } }; Assert.Fail = function Fail(message) { var error = new Error(message + "\n"); try { throw error; } catch (e) { if(Common && Common.ErrorHandling) { Common.ErrorHandling.ReportErrorGivenStack(e); } throw e; } }; return Assert; })(); Utility.Assert = Assert; })(Tools.Utility || (Tools.Utility = {})); var Utility = Tools.Utility; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); var F12; (function (F12) { (function (Tools) { (function (RPC) { var JsonRPCEndpoint = (function () { function JsonRPCEndpoint(identifier, jsonRpcMethodReceive, jsonRpcNotificationReceive, postMessage, onMessageCapture) { var _this = this; this._ourIdentifier = identifier; this._nextId = 0; this._promiseTable = { }; this._jsonRpcMethodReceive = jsonRpcMethodReceive; this._jsonRpcNotificationReceive = jsonRpcNotificationReceive; this._postMessage = postMessage; if(!Date.now) { Date.now = function now() { return +(new Date()); }; } this._startTime = Date.now(); onMessageCapture(function (data) { _this.onMessage(data); }); } JsonRPCEndpoint.prototype.jsonRpcMethodCall = function (method, params, completed, error, identification) { var id = this._ourIdentifier + "|" + this._nextId; this._nextId++; this._promiseTable[id] = { completed: completed, error: error }; var message = JSON.stringify({ id: id, method: method, params: params }); this.logTraffic(message); return this._postMessage(message, identification); }; JsonRPCEndpoint.prototype.jsonRpcNotification = function (method, params, identification) { var id = this._ourIdentifier + "|" + "NULL"; var message = JSON.stringify({ id: id, method: method, params: params }); this.logTraffic(message); this._postMessage(message, identification); }; JsonRPCEndpoint.prototype.logTraffic = function (data) { if(isDebugBuild) { var paddedTimestamp = (" " + (Date.now() - this._startTime) / 1000).slice(-9); __rpcLog.push(paddedTimestamp + " | " + data); if(__rpcLog.length > 100) { __rpcLog.shift(); } } }; JsonRPCEndpoint.prototype.onMessage = function (data) { var _this = this; this.logTraffic(data.data); var result = JSON.parse(data.data); var idSplit = (result.id).split("|"); Tools.Utility.Assert.AreEqual(idSplit.length, 2); if(idSplit[1] === "NULL") { Tools.Utility.Assert.AreNotEqual(idSplit[0], this._ourIdentifier, "Can't notify ourselves"); this._jsonRpcNotificationReceive(result.method, result.params); } else if(idSplit[0] === this._ourIdentifier) { Tools.Utility.Assert.HasValue(this._promiseTable[result.id]); if(result.error) { Tools.Utility.Assert.IsUndefined(result.data, "Can't have both data and error"); this._promiseTable[result.id].error(result.error); } else { this._promiseTable[result.id].completed(result.data); } delete this._promiseTable[result.id]; } else { this._jsonRpcMethodReceive(result.method, result.params, function (data, error) { var message; if(data !== null && data !== undefined) { Tools.Utility.Assert.IsUndefined(error, "Can't have both data and error"); message = JSON.stringify({ id: result.id, data: data }); } else { Tools.Utility.Assert.HasValue(error, "RPC call returned no value, but no error object either"); message = JSON.stringify({ id: result.id, error: error }); } _this._postMessage(message); }); } }; return JsonRPCEndpoint; })(); RPC.JsonRPCEndpoint = JsonRPCEndpoint; })(Tools.RPC || (Tools.RPC = {})); var RPC = Tools.RPC; })(F12.Tools || (F12.Tools = {})); var Tools = F12.Tools; })(F12 || (F12 = {})); if(isDebugBuild) { var __rpcLog = []; } var F12; (function (F12) { (function (Host) { (function (Impl) { (function (PluginId) { PluginId._map = []; PluginId.None = -1; PluginId.Header = 0; PluginId.Network = 1; PluginId.Profiler = 2; PluginId.Compat = 3; PluginId.Console = 4; PluginId.Dom = 5; PluginId.Debugger = 6; PluginId.Emulation = 7; PluginId.Resources = 8; PluginId.Memory = 9; PluginId.VisualProfiler = 10; })(Impl.PluginId || (Impl.PluginId = {})); var PluginId = Impl.PluginId; ; var Communications = (function (_super) { __extends(Communications, _super); function Communications() { _super.call(this); this._methodHandlers = { }; this._rpc = new F12.Tools.RPC.JsonRPCEndpoint("F12_RPC_CLIENT_" + F12.Host.ExternalApis.pluginId, this.jsonRpcMethodReceive.bind(this), this.jsonRpcNotificationReceive.bind(this), function (data, identification) { if(identification !== undefined && identification !== null) { return F12.Host.ExternalApis.sendJsonMessage(identification, data); } }, function (onMessage) { F12.Host.ExternalApis.addEventListener("jsonmessage", function (data) { onMessage({ data: data }); }); }); } Communications.prototype.registerMethodHandler = function (method, callback) { if(this._methodHandlers.hasOwnProperty(method)) { throw new Error("There is already a handler registered for the '" + method + "' method."); } this._methodHandlers[method] = callback; }; Communications.prototype.unregisterMethodHandler = function (method, callback) { if(this._methodHandlers.hasOwnProperty(method)) { delete this._methodHandlers[method]; } }; Communications.prototype.jsonRpcMethodCall = function (pluginId, method, params, activate) { var _this = this; var promise = new Plugin.Promise(function (completed, error) { _this._rpc.jsonRpcMethodCall(method, params, completed, error, pluginId); if(activate) { F12.Host.ExternalApis.activateTab(pluginId); } }); return promise; }; Communications.prototype.directInvoke = function (method, params) { if(this._methodHandlers.hasOwnProperty(method)) { var handler = this._methodHandlers[method]; if(params) { handler.apply(handler, params); } else { handler.apply(handler); } } }; Communications.prototype.fireEvent = function (event, id, params) { if (typeof params === "undefined") { params = []; } this._rpc.jsonRpcNotification(event, params, id); }; Communications.prototype.jsonRpcMethodReceive = function (method, params, response) { var result; if(this._methodHandlers.hasOwnProperty(method)) { var handler = this._methodHandlers[method]; if(params) { result = handler.apply(handler, params); } else { result = handler.apply(handler); } response(result, undefined); } response(null, new Error("There was no method handler registered for the '" + method + "' method.")); }; Communications.prototype.jsonRpcNotificationReceive = function (event, params) { this.dispatchEvent(event, params, false); }; return Communications; })(Host.EventManager); Impl.Communications = Communications; })(Host.Impl || (Host.Impl = {})); var Impl = Host.Impl; })(F12.Host || (F12.Host = {})); var Host = F12.Host; })(F12 || (F12 = {})); var F12; (function (F12) { (function (Host) { (function (Impl) { var Utilities = (function () { function Utilities() { } Utilities.prototype.createExternalObject = function (fileAlias, clsid) { var fileAliases = Host.App.pluginHost.getFileAliasesService(); var relativePath = fileAliases.getPath(fileAlias); if(!relativePath) { return undefined; } return F12.Host.ExternalApis.utilities.loadExtension(relativePath, clsid); }; return Utilities; })(); Impl.Utilities = Utilities; var Debugger = (function () { function Debugger(communications) { this._communications = communications; } Debugger.prototype.notifyOnBreak = function (isWorker) { F12.Host.ExternalApis.notifyOnBreak(isWorker); }; Debugger.prototype.notifyOnRun = function () { F12.Host.ExternalApis.notifyOnRun(); }; Debugger.prototype.getIsAtBreakpoint = function () { return F12.Host.ExternalApis.isAtBreakpoint; }; Debugger.prototype.getIsAtBreakpointInWorker = function () { return F12.Host.ExternalApis.isAtBreakpointInWorker; }; Debugger.prototype.executeBreakModeCommand = function (script) { if(this.getIsAtBreakpoint()) { return this._communications.jsonRpcMethodCall(Impl.PluginId.Debugger, "breakModeCommand", [ script ]); } return new Plugin.Promise(function (completed) { completed(false); }); }; Debugger.prototype.addToWatch = function (name) { return this._communications.jsonRpcMethodCall(Impl.PluginId.Debugger, "addToWatch", [ name ], true); }; Debugger.prototype.showDocument = function (documentPath, oneBasedLine, oneBasedColumn, mimeType) { if (typeof oneBasedLine === "undefined") { oneBasedLine = 1; } if (typeof oneBasedColumn === "undefined") { oneBasedColumn = 1; } if (typeof mimeType === "undefined") { mimeType = ""; } return this._communications.jsonRpcMethodCall(Impl.PluginId.Debugger, "showDocument", [ documentPath, oneBasedLine || 1, oneBasedColumn || 1, mimeType ], true); }; return Debugger; })(); Impl.Debugger = Debugger; var Profiler = (function () { function Profiler(communications) { this._communications = communications; } Profiler.prototype.notifyOnStartProfiling = function () { if(F12.Host.ExternalApis.isAtBreakpoint) { throw new Error("Cannot call notifyOnStartProfiling while at a breakpoint."); } return F12.Host.ExternalApis.notifyOnStartProfiling(); }; Profiler.prototype.notifyOnStopProfiling = function () { if(F12.Host.ExternalApis.isAtBreakpoint) { throw new Error("Cannot call notifyOnStopProfiling while at a breakpoint."); } return F12.Host.ExternalApis.notifyOnStopProfiling(); }; Profiler.prototype.getIsProfiling = function () { return F12.Host.ExternalApis.isProfiling; }; return Profiler; })(); Impl.Profiler = Profiler; var ErrorDisplay = (function () { function ErrorDisplay() { } Object.defineProperty(ErrorDisplay.prototype, "messageText", { get: function () { return (this._display ? this._display.messageText : null); }, enumerable: true, configurable: true }); Object.defineProperty(ErrorDisplay.prototype, "helpUri", { get: function () { return (this._display ? this._display.helpUri : null); }, enumerable: true, configurable: true }); Object.defineProperty(ErrorDisplay.prototype, "isShown", { get: function () { return (this._display ? this._display.isShown : false); }, enumerable: true, configurable: true }); ErrorDisplay.prototype.show = function (message, timeout, helpUri, anchorElement) { if(!this._display) { this._display = new Impl.ErrorAlert(document.body, anchorElement); } this._display.show(message, timeout, helpUri); }; ErrorDisplay.prototype.close = function () { if(this._display) { this._display.close(); } }; ErrorDisplay.prototype.resize = function (force) { if(this._display) { this._display.resize(force); } }; return ErrorDisplay; })(); Impl.ErrorDisplay = ErrorDisplay; var F12Extensions = (function (_super) { __extends(F12Extensions, _super); function F12Extensions() { var _this = this; _super.call(this); F12.Host.ExternalApis.addEventListener("browsershortcut", function (e) { _this.dispatchEvent("browsershortcut", e, false); }); F12.Host.ExternalApis.addEventListener("keydown", function (e) { _this.dispatchEvent("keydown", e, false); }); F12.Host.ExternalApis.addEventListener("hostinfochanged", function (e) { _this.dispatchEvent("hostinfochanged", e, false); }); F12.Host.ExternalApis.addEventListener("profilingstarted", function (e) { _this.dispatchEvent("profilingstarted", e, false); }); F12.Host.ExternalApis.addEventListener("profilingstopped", function (e) { _this.dispatchEvent("profilingstopped", e, false); }); F12.Host.ExternalApis.addEventListener("consolestateshown", function (e) { _this.dispatchEvent("consolestateshown", e, false); }); F12.Host.ExternalApis.addEventListener("consolestatehidden", function (e) { _this.dispatchEvent("consolestatehidden", e, false); }); F12.Host.ExternalApis.addEventListener("activated", function () { _this.dispatchEvent("activated", null, false); }); F12.Host.ExternalApis.addEventListener("deactivated", function () { _this.dispatchEvent("deactivated", null, false); }); if(F12.Host.ExternalApis.pluginId === Impl.PluginId.Debugger) { F12.Host.ExternalApis.addEventListener("showdocument", function (e) { _this.Communications.directInvoke("showDocument", [ e.url, e.oneBasedLine, e.oneBasedColumn ]); }); } } F12Extensions.prototype.bringPluginToForeground = function () { F12.Host.ExternalApis.bringToolToForeground(); }; F12Extensions.prototype.getDoubleClickTime = function () { return F12.Host.ExternalApis.utilities.getDoubleClickTime(); }; F12Extensions.prototype.setRegEntryForF12 = function (name, value) { F12.Host.ExternalApis.utilities.setRegEntryForF12(name, value); }; F12Extensions.prototype.getRegEntryForF12 = function (name, value) { return F12.Host.ExternalApis.utilities.getRegEntryForF12(name); }; F12Extensions.prototype.getQpcFrequency = function () { return F12.Host.ExternalApis.utilities.getQpcFrequency(); }; F12Extensions.prototype.getQpcTime = function () { return F12.Host.ExternalApis.utilities.getQpcTime(); }; F12Extensions.prototype.getInspectElementId = function () { return F12.Host.ExternalApis.inspectElementId; }; F12Extensions.prototype.setInspectElementId = function (elementId) { F12.Host.ExternalApis.inspectElementId = elementId; }; F12Extensions.prototype.activateTab = function (pluginId) { F12.Host.ExternalApis.activateTab(pluginId); }; F12Extensions.prototype.notifyOnToolActivated = function () { F12.Host.ExternalApis.notifyOnToolActivated(); }; F12Extensions.prototype.openBrowser = function (url) { F12.Host.ExternalApis.openBrowser(url); }; F12Extensions.prototype.getProcessId = function () { return F12.Host.ExternalApis.getProcessId(); }; F12Extensions.prototype.getRemoteProcessId = function () { return F12.Host.ExternalApis.getRemoteProcessId(); }; F12Extensions.prototype.takeForeground = function () { return F12.Host.ExternalApis.takeForeground(); }; F12Extensions.prototype.setForeground = function (hwnd) { return F12.Host.ExternalApis.setForeground(hwnd); }; F12Extensions.prototype.allowSetForeground = function (pid) { return F12.Host.ExternalApis.allowSetForeground(pid); }; F12Extensions.prototype.getHostInfo = function () { return F12.Host.ExternalApis.hostInfo; }; F12Extensions.prototype.getIsShowingConsole = function () { return F12.Host.ExternalApis.isShowingConsole; }; F12Extensions.prototype.setConsoleClientArea = function (left, top, right, bottom) { F12.Host.ExternalApis.setConsoleClientArea(left, top, right, bottom); }; F12Extensions.prototype.showHideConsole = function () { F12.Host.ExternalApis.showHideConsole(); }; F12Extensions.prototype.notifyOnKeydown = function (keyCode, keyFlags) { return F12.Host.ExternalApis.notifyOnKeydown(keyCode, keyFlags); }; F12Extensions.prototype.deleteFile = function (path) { F12.Host.ExternalApis.storage.deleteFile(path); }; Object.defineProperty(F12Extensions.prototype, "Communications", { get: function () { if(typeof this._communications === "undefined") { this._communications = new Impl.Communications(); } return this._communications; }, enumerable: true, configurable: true }); Object.defineProperty(F12Extensions.prototype, "Utilities", { get: function () { if(typeof this._utilities === "undefined") { this._utilities = new Utilities(); } return this._utilities; }, enumerable: true, configurable: true }); Object.defineProperty(F12Extensions.prototype, "Debugger", { get: function () { if(typeof this._debugger === "undefined") { this._debugger = new Debugger(this.Communications); } return this._debugger; }, enumerable: true, configurable: true }); Object.defineProperty(F12Extensions.prototype, "Profiler", { get: function () { if(typeof this._profiler === "undefined") { this._profiler = new Profiler(this.Communications); } return this._profiler; }, enumerable: true, configurable: true }); Object.defineProperty(F12Extensions.prototype, "ErrorDisplay", { get: function () { if(typeof this._errorDisplay === "undefined") { this._errorDisplay = new ErrorDisplay(); } return this._errorDisplay; }, enumerable: true, configurable: true }); return F12Extensions; })(Host.EventManager); Impl.F12Extensions = F12Extensions; })(Host.Impl || (Host.Impl = {})); var Impl = Host.Impl; })(F12.Host || (F12.Host = {})); var Host = F12.Host; })(F12 || (F12 = {})); var Common; (function (Common) { "use strict"; var Keys = (function () { function Keys() { } Keys.c = "c"; Keys.DEL = "Del"; Keys.DOWN = "Down"; Keys.END = "End"; Keys.ENTER = "Enter"; Keys.F10 = "F10"; Keys.HOME = "Home"; Keys.LEFT = "Left"; Keys.RIGHT = "Right"; Keys.SPACEBAR = "Spacebar"; Keys.UP = "Up"; return Keys; })(); Common.Keys = Keys; (function (KeyCodes) { KeyCodes._map = []; KeyCodes.BACKSPACE = 8; KeyCodes.TAB = 9; KeyCodes.ENTER = 13; KeyCodes.SHIFT = 16; KeyCodes.CONTROL = 17; KeyCodes.ALT = 18; KeyCodes.CAPS_LOCK = 20; KeyCodes.ESCAPE = 27; KeyCodes.SPACE = 32; KeyCodes.PAGE_UP = 33; KeyCodes.PAGE_DOWN = 34; KeyCodes.END = 35; KeyCodes.HOME = 36; KeyCodes.ARROW_LEFT = 37; KeyCodes.ARROW_FIRST = 37; KeyCodes.ARROW_UP = 38; KeyCodes.ARROW_RIGHT = 39; KeyCodes.ARROW_DOWN = 40; KeyCodes.ARROW_LAST = 40; KeyCodes.INSERT = 45; KeyCodes.DELETE = 46; KeyCodes.A = 65; KeyCodes.B = 66; KeyCodes.C = 67; KeyCodes.D = 68; KeyCodes.E = 69; KeyCodes.F = 70; KeyCodes.G = 71; KeyCodes.H = 72; KeyCodes.I = 73; KeyCodes.J = 74; KeyCodes.K = 75; KeyCodes.L = 76; KeyCodes.M = 77; KeyCodes.N = 78; KeyCodes.O = 79; KeyCodes.P = 80; KeyCodes.Q = 81; KeyCodes.R = 82; KeyCodes.S = 83; KeyCodes.T = 84; KeyCodes.U = 85; KeyCodes.V = 86; KeyCodes.W = 87; KeyCodes.X = 88; KeyCodes.Y = 89; KeyCodes.Z = 90; KeyCodes.CONTEXTMENU = 93; KeyCodes.MULTIPLY = 106; KeyCodes.PLUS = 107; KeyCodes.MINUS = 109; KeyCodes.F1 = 112; KeyCodes.F2 = 113; KeyCodes.F3 = 114; KeyCodes.F4 = 115; KeyCodes.F5 = 116; KeyCodes.F6 = 117; KeyCodes.F7 = 118; KeyCodes.F8 = 119; KeyCodes.F9 = 120; KeyCodes.F10 = 121; KeyCodes.F11 = 122; KeyCodes.F12 = 123; KeyCodes.COMMA = 188; KeyCodes.PERIOD = 190; })(Common.KeyCodes || (Common.KeyCodes = {})); var KeyCodes = Common.KeyCodes; (function (MouseButtons) { MouseButtons._map = []; MouseButtons.LEFT_BUTTON = 0; MouseButtons.MIDDLE_BUTTON = 1; MouseButtons.RIGHT_BUTTON = 2; })(Common.MouseButtons || (Common.MouseButtons = {})); var MouseButtons = Common.MouseButtons; (function (KeyFlags) { KeyFlags._map = []; KeyFlags.KeyFlags_None = 0x0; KeyFlags.KeyFlags_Shift = 0x1; KeyFlags.KeyFlags_Ctrl = 0x2; KeyFlags.KeyFlags_Alt = 0x4; })(Common.KeyFlags || (Common.KeyFlags = {})); var KeyFlags = Common.KeyFlags; function blockBrowserAccelerators() { document.addEventListener("keydown", function (e) { return preventIEKeys(e); }); document.addEventListener("contextmenu", function (e) { e.preventDefault(); e.stopPropagation(); return false; }); window.addEventListener("mousewheel", function (e) { if(e.ctrlKey) { e.preventDefault(); e.stopPropagation(); return false; } }); } Common.blockBrowserAccelerators = blockBrowserAccelerators; function HasAnyOfAltCtrlShiftKeyFlags(e) { return e.shiftKey || e.ctrlKey || e.altKey; } Common.HasAnyOfAltCtrlShiftKeyFlags = HasAnyOfAltCtrlShiftKeyFlags; function preventIEKeys(e) { if(e.keyCode === Common.KeyCodes.F5 || e.keyCode === Common.KeyCodes.F6 || (e.keyCode === Common.KeyCodes.F10 && e.shiftKey) || (e.keyCode === Common.KeyCodes.F && e.ctrlKey)) { e.preventDefault(); e.stopPropagation(); return false; } return true; } Common.preventIEKeys = preventIEKeys; })(Common || (Common = {})); var Plugin; (function (Plugin) { (function (VS) { (function (ActivityLog) { "use strict"; var host = loadModule("plugin.host.activitylog"); var EntryType; (function (EntryType) { EntryType._map = []; EntryType.ALE_ERROR = 1; EntryType.ALE_WARNING = 2; EntryType.ALE_INFORMATION = 3; })(EntryType || (EntryType = {})); function doLog(entryType, message, args) { host.logEntry(entryType, Plugin.Utilities.formatString(message, args)); } function info(message) { var args = []; for (var _i = 0; _i < (arguments.length - 1); _i++) { args[_i] = arguments[_i + 1]; } doLog(EntryType.ALE_INFORMATION, message, args); } ActivityLog.info = info; function warn(message) { var args = []; for (var _i = 0; _i < (arguments.length - 1); _i++) { args[_i] = arguments[_i + 1]; } doLog(EntryType.ALE_WARNING, message, args); } ActivityLog.warn = warn; function error(message) { var args = []; for (var _i = 0; _i < (arguments.length - 1); _i++) { args[_i] = arguments[_i + 1]; } doLog(EntryType.ALE_ERROR, message, args); } ActivityLog.error = error; })(VS.ActivityLog || (VS.ActivityLog = {})); var ActivityLog = VS.ActivityLog; })(Plugin.VS || (Plugin.VS = {})); var VS = Plugin.VS; })(Plugin || (Plugin = {})); var Plugin; (function (Plugin) { (function (VS) { (function (Internal) { (function (CodeMarkers) { "use strict"; var host = loadModule("plugin.host.codemarkers"); function verifyMarker(marker) { if(typeof marker !== 'number' || !isFinite(marker)) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.6000")); } return marker; } function fire(marker) { host.fireCodeMarker(verifyMarker(marker)); } CodeMarkers.fire = fire; })(Internal.CodeMarkers || (Internal.CodeMarkers = {})); var CodeMarkers = Internal.CodeMarkers; })(VS.Internal || (VS.Internal = {})); var Internal = VS.Internal; })(Plugin.VS || (Plugin.VS = {})); var VS = Plugin.VS; })(Plugin || (Plugin = {})); var Plugin; (function (Plugin) { "use strict"; var host = loadModule("plugin.host.core"); var controlCommands; (function (controlCommands) { controlCommands._map = []; controlCommands.none = 0; controlCommands.portCreated = 1; controlCommands.portClosed = 2; controlCommands.portConnected = 3; controlCommands.controlInitialized = 4; controlCommands.hostReady = 5; controlCommands.event = 6; controlCommands.error = 7; controlCommands.initiateShutdown = 8; controlCommands.shutdownComplete = 9; })(controlCommands || (controlCommands = {})); ; (function (Utilities) { var EventImpl = (function () { function EventImpl(type, additionalProperties, target) { this.type = type; this.timeStamp = Date.now(); this.target = target; var eventObject = this; if(additionalProperties && typeof additionalProperties === "object") { Object.getOwnPropertyNames(additionalProperties).forEach(function (name) { var pd = Object.getOwnPropertyDescriptor(additionalProperties, name); Object.defineProperty(eventObject, name, pd); }); } } Object.defineProperty(EventImpl.prototype, "bubbles", { get: function () { return false; }, enumerable: true, configurable: true }); Object.defineProperty(EventImpl.prototype, "cancelable", { get: function () { return false; }, enumerable: true, configurable: true }); Object.defineProperty(EventImpl.prototype, "currentTarget", { get: function () { return this.target; }, enumerable: true, configurable: true }); Object.defineProperty(EventImpl.prototype, "defaultPrevented", { get: function () { return !!this._preventDefaultsCalled; }, enumerable: true, configurable: true }); Object.defineProperty(EventImpl.prototype, "trusted", { get: function () { return false; }, enumerable: true, configurable: true }); Object.defineProperty(EventImpl.prototype, "isTrusted", { get: function () { return false; }, enumerable: true, configurable: true }); Object.defineProperty(EventImpl.prototype, "CAPTURING_PHASE", { get: function () { return EventImpl.CAPTURING_PHASE; }, enumerable: true, configurable: true }); Object.defineProperty(EventImpl.prototype, "AT_TARGET", { get: function () { return EventImpl.AT_TARGET; }, enumerable: true, configurable: true }); Object.defineProperty(EventImpl.prototype, "BUBBLING_PHASE", { get: function () { return EventImpl.BUBBLING_PHASE; }, enumerable: true, configurable: true }); EventImpl.prototype.preventDefault = function () { this._preventDefaultsCalled = true; }; EventImpl.prototype.stopImmediatePropagation = function () { this._stopImmediatePropagationCalled = true; }; EventImpl.prototype.stopPropagation = function () { }; EventImpl.prototype.initEvent = function (eventTypeArg, canBubbleArg, cancelableArg) { }; EventImpl.supportForProcessing = false; EventImpl.NONE = 0; EventImpl.CAPTURING_PHASE = 1; EventImpl.AT_TARGET = 2; EventImpl.BUBBLING_PHASE = 3; return EventImpl; })(); EventImpl.prototype.eventPhase = 0; EventImpl.prototype.detail = null; var EventManager = (function () { function EventManager() { } EventManager.prototype.addEventListener = function (type, listener) { this.listeners = this.listeners || { }; var eventListeners = (this.listeners[type] = this.listeners[type] || []); for(var i = 0, len = eventListeners.length; i < len; i++) { var l = eventListeners[i]; if(l.listener === listener) { return; } } eventListeners.push({ listener: listener }); }; EventManager.prototype.dispatchEvent = function (type, eventArg) { var listeners = this.listeners && this.listeners[type]; var oneventAttribute = this.target && this.target["on" + type]; if(listeners || typeof oneventAttribute === "function") { var eventValue = new EventImpl(type, eventArg, this.target); if(listeners) { listeners = listeners.slice(0, listeners.length); for(var i = 0, len = listeners.length; i < len && !eventValue._stopImmediatePropagationCalled; i++) { listeners[i].listener(eventValue); } } if(typeof oneventAttribute === "function") { oneventAttribute(eventValue); } return eventValue.defaultPrevented || false; } return false; }; EventManager.prototype.removeEventListener = function (type, listener) { var listeners = this.listeners && this.listeners[type]; if(listeners) { for(var i = 0, len = listeners.length; i < len; i++) { var l = listeners[i]; if(l.listener === listener) { listeners.splice(i, 1); if(listeners.length === 0) { delete this.listeners[type]; } break; } } } }; EventManager.prototype.setTarget = function (value) { this.target = value; }; return EventManager; })(); Utilities.EventManager = EventManager; function marshalHostError(hostErrorObject) { var error = new Error(hostErrorObject.message + "\r\n" + hostErrorObject.stack); error.innerError = hostErrorObject.innerError; error.source = hostErrorObject.source; error.helpLink = hostErrorObject.helpLink; return error; } Utilities.marshalHostError = marshalHostError; function formatString(message, optionalParams) { var currentParameterIndex = 0; var currentSubstringIndex = 0; var result = ""; message = "" + message; while(currentSubstringIndex < message.length) { var replacementIndex = message.indexOf("%", currentSubstringIndex); if(replacementIndex === -1 || replacementIndex === message.length - 1) { result += message.substring(currentSubstringIndex); currentSubstringIndex = message.length; } else { result += message.substring(currentSubstringIndex, replacementIndex); currentSubstringIndex = replacementIndex + 1; var argumentValue = optionalParams[currentParameterIndex]; switch(message[currentSubstringIndex]) { case "d": case "i": if(typeof argumentValue !== "undefined") { if(typeof argumentValue === "number") { argumentValue = argumentValue >= 0 ? Math.floor(argumentValue) : Math.ceil(argumentValue); } else { argumentValue = parseInt(argumentValue); } if(argumentValue !== ~~argumentValue) { argumentValue = 0; } } result += argumentValue; currentParameterIndex++; currentSubstringIndex++; break; case "f": if(argumentValue === null) { argumentValue = 0; } else if(typeof argumentValue !== "undefined") { argumentValue = parseFloat(argumentValue); } result += argumentValue; currentParameterIndex++; currentSubstringIndex++; break; case "s": case "o": if(typeof argumentValue !== "undefined") { argumentValue = "" + argumentValue; } result += argumentValue; currentParameterIndex++; currentSubstringIndex++; break; case "%": result += "%"; currentSubstringIndex++; break; default: result += "%"; break; } } } for(var i = currentParameterIndex; i < optionalParams.length; i++) { result += optionalParams[i]; } return result; } Utilities.formatString = formatString; })(Plugin.Utilities || (Plugin.Utilities = {})); var Utilities = Plugin.Utilities; var defaultPort = 0; var headerDelimiter = "$"; var lastMessageId = 0; var awaitingResultList = []; var globalEventManager = new Utilities.EventManager(); var logger; (function (logger) { var messages = []; var domInitialized = false; function logMessageLocally(message) { if(!domInitialized) { messages.push(message); return; } else { var messagesDiv = document.getElementById("pluginMessages"); if(messagesDiv) { messagesDiv.innerHTML += "
          " + message; } } } if(document.body) { domInitialized = true; } else { globalEventManager.addEventListener("load", function () { domInitialized = true; if(messages) { for(var i = 0; i < messages.length; i++) { logMessageLocally(messages[i]); } messages = null; } ; }); } function log(message) { logMessageLocally(message); } logger.log = log; function logError(message) { log("Error: " + message); } logger.logError = logError; })(logger || (logger = {})); (function (PortState) { PortState._map = []; PortState._map[0] = "connected"; PortState.connected = 0; PortState._map[1] = "disconnected"; PortState.disconnected = 1; PortState._map[2] = "closed"; PortState.closed = 2; })(Plugin.PortState || (Plugin.PortState = {})); var PortState = Plugin.PortState; var PortImpl = (function () { function PortImpl(name) { this.name = name; this.eventManager = new Utilities.EventManager(); this.eventManager.setTarget(this); this._state = PortState.disconnected; } Object.defineProperty(PortImpl.prototype, "state", { get: function () { return this._state; }, enumerable: true, configurable: true }); PortImpl.prototype.removeEventListener = function (type, listener, useCapture) { this.eventManager.removeEventListener(type, listener); }; PortImpl.prototype.addEventListener = function (type, listener, useCapture) { this.eventManager.addEventListener(type, listener); }; PortImpl.prototype.dispatchEvent = function (evt) { return this.eventManager.dispatchEvent(evt); }; PortImpl.prototype.connect = function () { if(this._state !== PortState.disconnected) { return false; } var port = this; var cookie = portManager.registerPort(this.name, function onConnect() { if(port._state !== PortState.disconnected) { return; } port._state = PortState.connected; var eventArgs = { port: port }; port.eventManager.dispatchEvent("connect", eventArgs); }, function onDisconnect() { if(port._state !== PortState.connected) { return; } port._state = PortState.disconnected; }, function onMessage(message) { if(port._state !== PortState.connected) { return; } var eventArgs = { data: message }; port.eventManager.dispatchEvent("message", eventArgs); }); this._cookie = cookie; return true; }; PortImpl.prototype.postMessage = function (message) { if(this._state !== PortState.connected) { return; } portManager.postMessage(this._cookie, message); }; PortImpl.prototype.sendMessage = function (message) { if(this._state !== PortState.connected) { return; } return portManager.sendMessage(this._cookie, message); }; PortImpl.prototype.close = function () { if(this._state === PortState.closed) { return; } this._state = PortState.closed; portManager.unregisterPort(this._cookie); var eventArgs = { }; this.eventManager.dispatchEvent("close", eventArgs); }; return PortImpl; })(); var portManager; (function (portManager) { var registeredPorts = { }; var portNameLookupList = { }; var portIdLookupList = { }; var lastPortIndex = 1; function createPort(name) { if(typeof name !== "string" || name.length <= 0) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.1001")); } if(portNameLookupList[name]) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.1002") + "\r\n" + name); } return new PortImpl(name); } portManager.createPort = createPort; function registerPort(name, onConnect, onDisconnect, onMessage) { if(typeof name !== "string" || name.length <= 0) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.1001")); } if(portNameLookupList[name]) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.1002") + "\r\n" + name); } if(typeof onConnect !== "function") { throw new Error(Plugin.Resources.getErrorString("JSPlugin.1003")); } if(typeof onDisconnect !== "function") { throw new Error(Plugin.Resources.getErrorString("JSPlugin.1004")); } if(typeof onMessage !== "function") { throw new Error(Plugin.Resources.getErrorString("JSPlugin.1005")); } var cookie = ++lastPortIndex; registeredPorts[cookie] = portNameLookupList[name] = { id: null, name: name, onConnect: onConnect, onDisconnect: onDisconnect, onMessage: onMessage }; postMessageInternal(defaultPort, controlCommands.portCreated, [ name ]); return cookie; } portManager.registerPort = registerPort; function unregisterPort(cookie) { var entry = registeredPorts[cookie]; if(entry) { delete registeredPorts[cookie]; if(entry.name) { delete portNameLookupList[entry.name]; } if(entry.id) { delete portIdLookupList[entry.id]; } postMessageInternal(defaultPort, controlCommands.portClosed, [ entry.name ]); } } portManager.unregisterPort = unregisterPort; function postMessage(cookie, message) { if(!registeredPorts[cookie] || registeredPorts[cookie].id === null) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.1006")); } postMessageInternal(registeredPorts[cookie].id, controlCommands.none, null, message); } portManager.postMessage = postMessage; function sendMessage(cookie, message) { if(!registeredPorts[cookie] || registeredPorts[cookie].id === null) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.1006")); } return sendMessageInternal(registeredPorts[cookie].id, controlCommands.none, null, message); } portManager.sendMessage = sendMessage; function processPortConnectedMessage(id, name) { var entry = portNameLookupList[name]; if(entry) { entry.id = id; portIdLookupList[id] = entry; entry.onConnect(); } else { logger.logError("JSPlugin.1010\r\n" + name); } } portManager.processPortConnectedMessage = processPortConnectedMessage; function processPortClosedMessage(id) { var entry = portIdLookupList[id]; if(entry) { entry.onDisconnect(); } else { logger.logError("JSPlugin.1011\r\n" + id); } } portManager.processPortClosedMessage = processPortClosedMessage; function processMessage(id, message) { var entry = portIdLookupList[id]; if(entry) { entry.onMessage(message); } else { logger.logError("JSPlugin.1012\r\n" + id); } } portManager.processMessage = processMessage; })(portManager || (portManager = {})); function postMessageInternal(portId, command, args, payload, expectResult) { if(lastMessageId >= Infinity) { lastMessageId = 0; } var header = { msgId: ++lastMessageId, portId: portId }; if(command) { header.command = command; } if(args) { header.args = args; } if(expectResult) { header.replyRequested = true; } var message = JSON.stringify(header); if(payload) { message += headerDelimiter + payload; } var result; if(expectResult) { result = new Plugin.Promise(function (complete, error) { awaitingResultList[header.msgId] = { onComplete: complete, onError: error }; }); } host.postMessage(message); return result; } function sendMessageInternal(portId, command, args, payload) { return postMessageInternal(portId, command, args, payload, true); } function marshalHostError(hostErrorObject) { var error = new Error(hostErrorObject.message + "\r\n" + hostErrorObject.stack); error.innerError = hostErrorObject.innerError; error.source = hostErrorObject.source; error.helpLink = hostErrorObject.helpLink; return error; } var InitializationState; (function (InitializationState) { var isHostReady = false; var isDOMLoaded = false; function checkAndFirePluginReady() { if(isHostReady && isDOMLoaded) { globalEventManager.dispatchEvent("pluginready", { }); } } window.addEventListener("DOMContentLoaded", function () { isDOMLoaded = true; checkAndFirePluginReady(); }); function setHostReady() { globalEventManager.dispatchEvent("hostready", { }); isHostReady = true; checkAndFirePluginReady(); } InitializationState.setHostReady = setHostReady; })(InitializationState || (InitializationState = {})); host.messageReceived = function (message) { if(typeof message === "string") { var separatorIndex = message.indexOf(headerDelimiter); if(separatorIndex === -1) { separatorIndex = message.length; } var headerText = message.substr(0, separatorIndex); var header; try { header = JSON.parse(headerText); } catch (e) { logger.logError("JSPlugin.1013"); } var payload = message.substr(separatorIndex + 1); var eventArgs; var i; var port; var portList; var portListItem; if(header.replyId > 0) { var entry = awaitingResultList[header.replyId]; if(entry) { delete awaitingResultList[header.replyId]; switch(header.command) { case controlCommands.none: entry.onComplete(payload); break; case controlCommands.error: if(!header.args || !header.args.length) { logger.logError("JSPlugin.1014"); } entry.onError(header.args[0]); break; default: logger.logError("JSPlugin.1015"); entry.onError(new Error(Plugin.Resources.getErrorString("JSPlugin.1015"))); break; } } else if(header.command === controlCommands.error) { if(header.args && header.args[0]) { throw marshalHostError(header.args[0]); } else { throw new Error(Plugin.Resources.getErrorString("JSPlugin.1007")); } } } else if(header.portId > defaultPort && header.command === controlCommands.none) { portManager.processMessage(header.portId, payload); } else { switch(header.command) { case controlCommands.hostReady: InitializationState.setHostReady(); break; case controlCommands.portClosed: if(!header.args || !header.args.length) { logger.logError("JSPlugin.1016"); } var closedPortId = header.args[0]; if(typeof closedPortId !== "number") { logger.logError("JSPlugin.1016"); return; } portManager.processPortClosedMessage(closedPortId); break; case controlCommands.portConnected: if(!header.args || !header.args.length) { logger.logError("JSPlugin.1017"); } var connectedPortId = header.args[0]; var connectedPortName = header.args[1]; if(typeof connectedPortId !== "number" || typeof connectedPortName !== "string") { logger.logError("JSPlugin.1017"); return; } portManager.processPortConnectedMessage(connectedPortId, connectedPortName); break; case controlCommands.event: if(!header.args || !header.args.length) { logger.logError("JSPlugin.1018"); } var eventName = header.args[0]; eventArgs = header.args[1]; if(typeof eventName !== "string") { logger.logError("JSPlugin.1018"); } globalEventManager.dispatchEvent(eventName, eventArgs); break; case controlCommands.initiateShutdown: globalEventManager.dispatchEvent("close", eventArgs); postMessageInternal(defaultPort, controlCommands.shutdownComplete); break; default: var error; if(header.args && header.args.length) { error = marshalHostError(header.args[0]); } else { error = new Error(Plugin.Resources.getErrorString("JSPlugin.1007")); } throw error; } } } }; function attachToPublishedObject(name, objectDefinition, messageHandler, closeHandler, createOnFirstUse) { if(typeof name !== "string") { throw new Error(Plugin.Resources.getErrorString("JSPlugin.1008")); } if(typeof messageHandler !== "function") { throw new Error(Plugin.Resources.getErrorString("JSPlugin.1009")); } var interfacePortName = name; var interfaceObject = objectDefinition || { }; var pendingMessages = []; var portConnectInitiated = false; interfaceObject._forceConnect = function () { if(!portConnectInitiated) { port.connect(); portConnectInitiated = true; } }; interfaceObject._postMessage = function (message) { pendingMessages.push({ message: message }); interfaceObject._forceConnect(); }; interfaceObject._sendMessage = function (message) { var result = new Plugin.Promise(function (complete, error) { pendingMessages.push({ message: message, onComplete: complete, onError: error }); }); interfaceObject._forceConnect(); return result; }; var port = portManager.createPort(interfacePortName); port.addEventListener("connect", function onConnect(e) { port.removeEventListener("connect", onConnect); port.addEventListener("message", function (eventArg) { var serializedMessage = eventArg.data; messageHandler(serializedMessage); }); if(typeof closeHandler === "function") { port.addEventListener("close", closeHandler); } interfaceObject._postMessage = function (message) { return port.postMessage(message); }; interfaceObject._sendMessage = function (message) { return port.sendMessage(message); }; pendingMessages.forEach(function (m) { if(m.onComplete) { port.sendMessage(m.message).done(function (callbackMessage) { m.onComplete(callbackMessage); }, function (error) { m.onError(error); }); } else { port.postMessage(m.message); } }); pendingMessages = null; }); if(!createOnFirstUse) { interfaceObject._forceConnect(); } return interfaceObject; } Plugin.attachToPublishedObject = attachToPublishedObject; function _logError(message) { logger.logError(message); } Plugin._logError = _logError; function addEventListener(type, listener) { globalEventManager.addEventListener(type, listener); } Plugin.addEventListener = addEventListener; function removeEventListener(type, listener) { globalEventManager.removeEventListener(type, listener); } Plugin.removeEventListener = removeEventListener; function createPort(name) { return portManager.createPort(name); } Plugin.createPort = createPort; globalEventManager.setTarget(Plugin); window.addEventListener("load", function () { globalEventManager.dispatchEvent("load", { }); }); globalEventManager.addEventListener("load", function () { var elements = document.getElementsByTagName("*"); for(var i = 0; i < elements.length; i++) { if(elements[i].nodeName === "INPUT" || elements[i].nodeName === "TEXTAREA") { (elements[i]).className += " selectElement"; } else { (elements[i]).className += " selectNone"; } } }); document.oncontextmenu = function () { return false; }; document.ondragstart = function () { return false; }; postMessageInternal(defaultPort, controlCommands.controlInitialized); })(Plugin || (Plugin = {})); var Plugin; (function (Plugin) { (function (Culture) { "use strict"; var host = loadModule("plugin.host.culture"); Culture.dir = ""; Culture.lang = ""; Culture.formatRegion = ""; Culture.DateTimeFormat = { }; Culture.NumberFormat = { }; var domInitialized = false; var eventManager = new Plugin.Utilities.EventManager(); eventManager.setTarget({ }); host.addEventListener("cultureinitialize", function (eventArgs) { if(!setCultureInfoAndAttributes(eventArgs.language, eventArgs.direction, eventArgs.formatRegion, eventArgs.dateTimeFormat, eventArgs.numberFormat)) { Plugin.addEventListener("load", function () { return setCultureInfoAndAttributes(eventArgs.language, eventArgs.direction, eventArgs.formatRegion, eventArgs.dateTimeFormat, eventArgs.numberFormat); }); } }); host.addEventListener("culturechanged", function (eventArgs) { setCultureInfoAndAttributes(eventArgs.language, eventArgs.direction, eventArgs.formatRegion, eventArgs.dateTimeFormat, eventArgs.numberFormat); eventManager.dispatchEvent("culturechanged"); }); function setCultureInfoAndAttributes(language, direction, _formatRegion, dateTimeFormat, numberFormat) { Culture.lang = language; Culture.dir = direction; Culture.formatRegion = _formatRegion; Culture.DateTimeFormat = dateTimeFormat; Culture.NumberFormat = numberFormat; if(!domInitialized) { var htmlTags = document.getElementsByTagName("html"); if(htmlTags.length > 0) { domInitialized = true; htmlTags[0].dir = Culture.dir; htmlTags[0].lang = Culture.lang; eventManager.dispatchEvent("cultureinitialize"); } else { return false; } } return true; } function addEventListener(type, listener) { eventManager.addEventListener(type, listener); } Culture.addEventListener = addEventListener; function removeEventListener(type, listener) { eventManager.removeEventListener(type, listener); } Culture.removeEventListener = removeEventListener; })(Plugin.Culture || (Plugin.Culture = {})); var Culture = Plugin.Culture; })(Plugin || (Plugin = {})); var Plugin; (function (Plugin) { (function (Diagnostics) { "use strict"; var host = loadModule("plugin.host.diagnostics"); function onerror(message, uri, lineNumber, columnNumber) { reportError(message, uri, lineNumber, [], columnNumber); terminate(); return true; } Diagnostics.onerror = onerror; window.onerror = onerror; function reportError(error, uri, lineNumber, additionalInfo, columnNumber) { var message; var lineNumberText; var columnNumberText; if(error instanceof Error) { message = error.message ? error.message.toString() : null; uri = null; lineNumberText = null; columnNumberText = null; additionalInfo = "Error number: " + (error).number; additionalInfo += "\r\nStack: " + (error).stack; } else { message = error ? error.toString() : null; uri = uri ? uri.toString() : null; lineNumberText = lineNumber ? lineNumber.toString() : null; columnNumberText = columnNumber ? columnNumber.toString() : null; additionalInfo = additionalInfo ? additionalInfo.toString() : null; } return host.reportError(message, uri, lineNumberText, additionalInfo, columnNumberText); } Diagnostics.reportError = reportError; function terminate() { host.terminate(); } Diagnostics.terminate = terminate; })(Plugin.Diagnostics || (Plugin.Diagnostics = {})); var Diagnostics = Plugin.Diagnostics; })(Plugin || (Plugin = {})); var Plugin; (function (Plugin) { (function (Host) { "use strict"; var host = loadModule("plugin.host"); function showDocument(documentPath, line, col) { return host.showDocument("" + documentPath, +line, +col); } Host.showDocument = showDocument; ; function supportsAllowSetForeground() { return host.supportsAllowSetForeground(); } Host.supportsAllowSetForeground = supportsAllowSetForeground; function allowSetForeground(processId) { return host.allowSetForeground(processId); } Host.allowSetForeground = allowSetForeground; ; })(Plugin.Host || (Plugin.Host = {})); var Host = Plugin.Host; })(Plugin || (Plugin = {})); var Plugin; (function (Plugin) { (function (Utilities) { (function (JSONMarshaler) { "use strict"; function attachToPublishedObject(name, objectDefinition, createOnFirstUse) { var eventManager = new Plugin.Utilities.EventManager(); var interfaceObject = Plugin.attachToPublishedObject(name, objectDefinition, function onMessage(serializedMessage) { if(typeof serializedMessage === "string") { var message = JSON.parse(serializedMessage); if(typeof message.eventName === "string") { eventManager.dispatchEvent(message.eventName, message.arg); } else { Plugin._logError("JSPlugin.2000"); } } else { Plugin._logError("JSPlugin.2001"); } }, function onClose(error) { Plugin._logError("JSPlugin.2002\r\n" + name); }, createOnFirstUse); eventManager.setTarget(interfaceObject); interfaceObject._post = function (name) { var args = []; for (var _i = 0; _i < (arguments.length - 1); _i++) { args[_i] = arguments[_i + 1]; } var message = { method: name, args: args.length ? args : undefined }; this._postMessage(JSON.stringify(message)); }; interfaceObject._call = function (name) { var message = { method: name, args: arguments.length > 1 ? Array.prototype.slice.call(arguments, 1) : undefined }; return this._sendMessage(JSON.stringify(message)).then(function (responseText) { var response = JSON.parse(responseText); return response.result; }); }; if(createOnFirstUse) { interfaceObject.addEventListener = function (type, listener) { interfaceObject._forceConnect(); eventManager.addEventListener(type, listener); interfaceObject.addEventListener = eventManager.addEventListener.bind(eventManager); }; } else { interfaceObject.addEventListener = eventManager.addEventListener.bind(eventManager); } interfaceObject.removeEventListener = eventManager.removeEventListener.bind(eventManager); return interfaceObject; } JSONMarshaler.attachToPublishedObject = attachToPublishedObject; })(Utilities.JSONMarshaler || (Utilities.JSONMarshaler = {})); var JSONMarshaler = Utilities.JSONMarshaler; })(Plugin.Utilities || (Plugin.Utilities = {})); var Utilities = Plugin.Utilities; })(Plugin || (Plugin = {})); var Plugin; (function (Plugin) { "use strict"; var host = loadModule("plugin.host.output"); function log(message) { var optionalParams = []; for (var _i = 0; _i < (arguments.length - 1); _i++) { optionalParams[_i] = arguments[_i + 1]; } host.log(Plugin.Utilities.formatString(message, optionalParams)); } Plugin.log = log; })(Plugin || (Plugin = {})); var Plugin; (function (Plugin) { (function (Resources) { "use strict"; var host = loadModule("plugin.host.resources"); var defaultAlias = "Resources"; var error = "An error has occurred. Please try the operation again. You can search for the error online: "; var resourceMap = { }; var formatRegEx = /\{{2}|\{(\d+)\}|\}{2}|\{|\}/g; function processResourceChangeEvent(eventArgs) { if(typeof eventArgs.GenericError !== "string" || eventArgs.GenericError === "") { throw new Error(Plugin.Resources.getErrorString("JSPlugin.3000")); } error = eventArgs.GenericError; var resources = eventArgs.ResourceMap; if(!resources) { Plugin._logError("JSPlugin.3001"); return; } resourceMap = resources; var defaultResource = eventArgs.DefaultAlias; if(defaultResource) { defaultAlias = defaultResource; } } host.addEventListener("resourcesinitialized", processResourceChangeEvent); host.addEventListener("resourceschanged", processResourceChangeEvent); function format(resourceId, format, args) { return format.replace(formatRegEx, function (match, index) { var replacer; switch(match) { case "{{": replacer = "{"; break; case "}}": replacer = "}"; break; case "{": case "}": throw new Error(Plugin.Resources.getErrorString("JSPlugin.3002")); default: var argsIndex = parseInt(index); if(args && args.length - 1 >= argsIndex) { replacer = args[argsIndex]; } else { throw new Error(Plugin.Resources.getErrorString("JSPlugin.3003") + " (resourceId = " + resourceId + ")"); } break; } if(typeof replacer === "undefined" || replacer === null) { replacer = ""; } if(typeof replacer !== "string") { replacer = replacer.toString(); } return replacer; }); } function getString(resourceId) { var args = []; for (var _i = 0; _i < (arguments.length - 1); _i++) { args[_i] = arguments[_i + 1]; } if(typeof resourceId !== "string" || resourceId === "") { throw new Error(Plugin.Resources.getErrorString("JSPlugin.3004")); } var fileName = defaultAlias; var key = ""; var value = ""; var idParts = resourceId.split("/"); switch(idParts.length) { case 1: key = idParts[0]; break; case 3: fileName = idParts[1]; key = idParts[2]; break; default: throw new Error(Plugin.Resources.getErrorString("JSPlugin.3004")); } if(!resourceMap[fileName] || !resourceMap[fileName][key]) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.3005")); } value = resourceMap[fileName][key]; if(args.length > 0) { value = format(resourceId, value, args); } return value; } Resources.getString = getString; function getErrorString(errorId) { if(typeof errorId !== "string" || errorId === "") { throw new Error(error + "JSPlugin.3006"); } return error + errorId; } Resources.getErrorString = getErrorString; function addEventListener(name, callback) { host.addEventListener(name, callback); } Resources.addEventListener = addEventListener; function removeEventListener(name, callback) { host.removeEventListener(name, callback); } Resources.removeEventListener = removeEventListener; })(Plugin.Resources || (Plugin.Resources = {})); var Resources = Plugin.Resources; })(Plugin || (Plugin = {})); var Plugin; (function (Plugin) { (function (Storage) { "use strict"; var host = loadModule("plugin.host.storage"); var TypeScriptFix; (function (FileAccess) { FileAccess._map = []; FileAccess.read = 1; FileAccess.write = 2; FileAccess.readWrite = 3; })(Storage.FileAccess || (Storage.FileAccess = {})); var FileAccess = Storage.FileAccess; (function (FileDialogMode) { FileDialogMode._map = []; FileDialogMode.open = 0; FileDialogMode.save = 1; })(Storage.FileDialogMode || (Storage.FileDialogMode = {})); var FileDialogMode = Storage.FileDialogMode; (function (FileMode) { FileMode._map = []; FileMode.createNew = 1; FileMode.create = 2; FileMode.open = 3; FileMode.openOrCreate = 4; FileMode.truncate = 5; FileMode.append = 6; })(Storage.FileMode || (Storage.FileMode = {})); var FileMode = Storage.FileMode; (function (FileShare) { FileShare._map = []; FileShare.none = 0; FileShare.read = 1; FileShare.write = 2; FileShare.readWrite = 3; FileShare.delete = 4; })(Storage.FileShare || (Storage.FileShare = {})); var FileShare = Storage.FileShare; (function (FileType) { FileType._map = []; FileType.binary = 0; FileType.text = 1; })(Storage.FileType || (Storage.FileType = {})); var FileType = Storage.FileType; (function (FilePersistence) { FilePersistence._map = []; FilePersistence.permanent = 0; FilePersistence.temporary = 1; })(Storage.FilePersistence || (Storage.FilePersistence = {})); var FilePersistence = Storage.FilePersistence; (function (SeekOrigin) { SeekOrigin._map = []; SeekOrigin.begin = 0; SeekOrigin.current = 1; SeekOrigin.end = 2; })(Storage.SeekOrigin || (Storage.SeekOrigin = {})); var SeekOrigin = Storage.SeekOrigin; var HostFile = (function () { function HostFile(streamId, options) { this.maxBuffer = 32 * 1024; this.streamId = streamId; this.options = options; } HostFile.prototype.close = function () { return host.closeFile(this.streamId); }; HostFile.prototype.read = function (count) { if(!isNullOrUndefined(count) && !isInteger(count)) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.7005")); } if(isNullOrUndefined(count)) { var concatStart; if(this.options.type === FileType.binary) { concatStart = []; } else { concatStart = ""; } return this.readAllHelper(concatStart); } else { return host.read(this.streamId, count, this.options.type); } }; HostFile.prototype.seek = function (offset, origin) { if(!isInteger(offset)) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.7000")); } if(isNullOrUndefined(origin)) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.7001")); } return host.seek(this.streamId, offset, origin); }; HostFile.prototype.write = function (data, offset, count) { if(typeof data !== "string" && !(data instanceof Array)) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.7002")); } if(!isNullOrUndefined(offset) && !isInteger(offset)) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.7000")); } offset = offset || 0; if(!isNullOrUndefined(count) && !isInteger(count)) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.7007")); } count = count || data.length; return host.write(this.streamId, data, offset, count, this.options.type); }; HostFile.prototype.readAllHelper = function (content) { var _this = this; return host.read(this.streamId, this.maxBuffer, this.options.type).then(function (result) { if(result === null || result.length === 0) { return content; } else { return _this.readAllHelper(content.concat(result)); } }); }; return HostFile; })(); function getFileList(path, persistence, index, count) { if(!isNullOrUndefined(path) && typeof path !== "string") { throw new Error(Plugin.Resources.getErrorString("JSPlugin.7003")); } if(!isNullOrUndefined(index) && !isInteger(index)) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.7008")); } if(!isNullOrUndefined(count) && !isInteger(count)) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.7005")); } return host.getFileList(path, persistence, index, count); } Storage.getFileList = getFileList; function createFile(path, options) { if(!isNullOrUndefined(path) && typeof path !== "string") { throw new Error(Plugin.Resources.getErrorString("JSPlugin.7006")); } var fileOptions = getDefaultFileOptions(options); fileOptions.mode = FileMode.createNew; return host.openFile(path, fileOptions).then(function (streamId) { return new HostFile(streamId, fileOptions); }); } Storage.createFile = createFile; function openFile(path, options) { if(typeof path !== "string" || path === "") { throw new Error(Plugin.Resources.getErrorString("JSPlugin.7003")); } var fileOptions = getDefaultFileOptions(options); return host.openFile(path, fileOptions).then(function (streamId) { return new HostFile(streamId, fileOptions); }); } Storage.openFile = openFile; function openFileDialog(dialogOptions, fileOptions) { var openDialogOptions = getDefaultFileDialogOptions(dialogOptions); var openFileOptions = getDefaultFileOptions(fileOptions); return host.fileDialog(Plugin.Storage.FileDialogMode.open, openDialogOptions, openFileOptions).then(function (streamId) { if(streamId !== null && streamId !== "") { return new HostFile(streamId, openFileOptions); } }); } Storage.openFileDialog = openFileDialog; function saveFileDialog(dialogOptions, fileOptions) { var saveDialogOptions = getDefaultFileDialogOptions(dialogOptions); var saveFileOptions = getDefaultFileOptions(fileOptions); saveFileOptions.mode = FileMode.openOrCreate; return host.fileDialog(Plugin.Storage.FileDialogMode.save, saveDialogOptions, saveFileOptions).then(function (streamId) { if(streamId !== null && streamId !== "") { return new HostFile(streamId, saveFileOptions); } }); } Storage.saveFileDialog = saveFileDialog; function getDefaultFileOptions(options) { var fileOptions = { access: FileAccess.readWrite, encoding: "UTF-8", mode: FileMode.open, persistence: FilePersistence.temporary, share: FileShare.none, type: FileType.text }; if(options) { fileOptions.access = isNullOrUndefined(options.access) ? fileOptions.access : options.access; fileOptions.encoding = options.encoding || fileOptions.encoding; fileOptions.mode = isNullOrUndefined(options.mode) ? fileOptions.mode : options.mode; fileOptions.persistence = isNullOrUndefined(options.persistence) ? fileOptions.persistence : options.persistence; fileOptions.share = isNullOrUndefined(options.share) ? fileOptions.share : options.share; fileOptions.type = isNullOrUndefined(options.type) ? fileOptions.type : options.type; } return fileOptions; } function getDefaultFileDialogOptions(options) { var dialogOptions = { name: "", extensions: [], extensionsIndex: 0, initialDirectory: "", title: "" }; if(options) { dialogOptions.name = options.name || dialogOptions.name; dialogOptions.extensions = options.extensions || dialogOptions.extensions; dialogOptions.extensionsIndex = options.extensionsIndex || dialogOptions.extensionsIndex; dialogOptions.initialDirectory = options.initialDirectory || dialogOptions.initialDirectory; dialogOptions.title = options.title || dialogOptions.title; } return dialogOptions; } function isInteger(value) { return ((parseFloat(value) === parseInt(value)) && !isNaN(value)); } function isNullOrUndefined(value) { return (value === null || typeof value === "undefined"); } })(Plugin.Storage || (Plugin.Storage = {})); var Storage = Plugin.Storage; })(Plugin || (Plugin = {})); var Plugin; (function (Plugin) { (function (Settings) { "use strict"; var host = loadModule("plugin.host.settings"); function get(collection, requestedProperties) { return host.get(collection, requestedProperties); } Settings.get = get; ; function set(collection, toSet) { return host.set(collection, toSet); } Settings.set = set; ; })(Plugin.Settings || (Plugin.Settings = {})); var Settings = Plugin.Settings; })(Plugin || (Plugin = {})); var Plugin; (function (Plugin) { (function (Theme) { "use strict"; var host = loadModule("plugin.host.theme"); var domInitialized = false; var isInitial = false; var tokenMap = { }; var pluginCss; var tempElement; var rgbaRegEx = /[^0-9]+/g; var declarationRegEx = /^(\s*)([\w\-]+)\s*:\s*([^;^\{\*]+|url\([^\)]+\));\s*\/\*\s*\[([^\[\]]+)\]\s*\*\/(.*)$/gm; var tokenRegEx = /\{\s*([\{\}\w\-]*)(\s+rgba\s*\(([^\)]+)\))?\s*\}/gm; var undefinedRegEx = /undefined|null/; var eventManager = new Plugin.Utilities.EventManager(); eventManager.setTarget(host); host.addEventListener("themeinitialize", function (eventArgs) { pluginCss = eventArgs.PluginCss; if(!pluginCss) { Plugin._logError("JSPlugin.4000"); return; } updateTheme(eventArgs.themeMap, true); eventManager.dispatchEvent("themeinitialize"); }); host.addEventListener("themechanged", function (eventArgs) { updateTheme(eventArgs.themeMap, false); eventManager.dispatchEvent("themechanged"); }); function updateTheme(themeMap, isFirst) { tokenMap = themeMap; if(!tokenMap) { Plugin._logError("JSPlugin.4001"); return; } isInitial = isFirst; processCssFiles(); _cssHelpers.processImages(document); } function getValue(key) { if(!tokenMap[key]) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.4002")); } return tokenMap[key]; } Theme.getValue = getValue; function processCssFiles() { if(!pluginCss) { return; } var pluginStyle = document.createElement("style"); pluginStyle.type = "text/css"; pluginStyle.innerHTML = tokenReplaceContents(pluginCss); var firstNode = document.head.firstChild; if(firstNode) { document.head.insertBefore(pluginStyle, firstNode); if((firstNode).id === "pluginCss") { document.head.removeChild(firstNode); } } else { document.head.firstChild = pluginStyle; } pluginStyle.id = "pluginCss"; var cssThemeFiles = (document.querySelectorAll("[data-plugin-theme='true']")); if(isInitial && cssThemeFiles.length === 0) { host.fireThemeReady(); return; } for(var i = 0; i < cssThemeFiles.length; i++) { var styleNode = cssThemeFiles[i]; var href = (!styleNode.href ? styleNode.getAttribute("data-plugin-theme-href") : styleNode.href); var fireThemeReady = (isInitial && (i === cssThemeFiles.length - 1)); _cssHelpers.processCssFileContents(href, document, styleNode, fireThemeReady); } } (function (_cssHelpers) { function processCssFileContents(href, targetDoc, refNode, fireThemeReady) { return host.getCssFile(href).done(function (contents) { if(contents) { contents = tokenReplaceContents(contents); var newStyle = targetDoc.createElement("style"); newStyle.setAttribute("data-plugin-theme", "true"); newStyle.setAttribute("data-plugin-theme-href", href); newStyle.type = "text/css"; newStyle.innerHTML = contents; if(refNode) { if(!refNode.parentNode) { return; } targetDoc.head.insertBefore(newStyle, refNode); targetDoc.head.removeChild(refNode); newStyle.id = refNode.id; } else { targetDoc.head.appendChild(newStyle); } } if(fireThemeReady) { host.fireThemeReady(); } }, function (e) { if(fireThemeReady) { host.fireThemeReady(); } Plugin._logError("JSPlugin.4003\r\n" + e.message + "\r\n" + (e).stack); }); } _cssHelpers.processCssFileContents = processCssFileContents; function processImages(targetDoc) { var images = targetDoc.querySelectorAll("[data-plugin-theme-src]"); for(var i = 0; i < images.length; i++) { images[i].src = getValue(images[i].getAttribute("data-plugin-theme-src")); } } _cssHelpers.processImages = processImages; })(Theme._cssHelpers || (Theme._cssHelpers = {})); var _cssHelpers = Theme._cssHelpers; function tokenReplaceContents(contents) { return contents.replace(declarationRegEx, function (declaration, indent, property, defaultValue, replacer, suffix) { var replaceCount = 0; var newValue = replacer.replace(tokenRegEx, function (tokenMatch, token, rgbaMatch, rgba) { replaceCount++; var colorValue = tokenMap[token]; if(rgbaMatch) { tempElement = tempElement || document.createElement("div"); tempElement.style.backgroundColor = colorValue; var parts = tempElement.style.backgroundColor.split(","); if(parts.length === 3) { var rgbParts = []; for(var i = 0; i < 3; i++) { rgbParts.push(parseInt(parts[i].replace(rgbaRegEx, ''), 10)); } tempElement.style.backgroundColor = "rgba(" + rgbParts.join(", ") + ", " + rgba + ")"; colorValue = tempElement.style.backgroundColor; } } return colorValue; }); if(newValue.match(undefinedRegEx) || replaceCount === 0) { newValue = defaultValue; } return indent + property + ": " + newValue + ";" + suffix; }); } function addEventListener(type, listener) { return eventManager.addEventListener(type, listener); } Theme.addEventListener = addEventListener; function removeEventListener(type, listener) { return eventManager.removeEventListener(type, listener); } Theme.removeEventListener = removeEventListener; })(Plugin.Theme || (Plugin.Theme = {})); var Theme = Plugin.Theme; })(Plugin || (Plugin = {})); var Plugin; (function (Plugin) { (function (Tooltip) { "use strict"; ; ; ; Tooltip.defaultTooltipContentToHTML = true; var host = loadModule("plugin.host.tooltip"); var tooltipOffsetY = 15; var defaultDelay; var hasShownTooltipPopup = false; var tooltipObject = null; var tooltipReset = true; var scheduledShow; var scheduledDismiss; var mousePosition = { clientX: 0, clientY: 0, screenX: 0, screenY: 0 }; var popupMeasureContainer; function canCreatePopup() { return host.canCreatePopup(); } function invalidatePopupTooltipDocumentCache() { hasShownTooltipPopup = false; } Tooltip.invalidatePopupTooltipDocumentCache = invalidatePopupTooltipDocumentCache; function hostContentInPopup(displayParameters) { var useCachedDocument = (hasShownTooltipPopup && ((typeof displayParameters.useCachedDocument === 'undefined') || (typeof displayParameters.useCachedDocument === 'boolean' && displayParameters.useCachedDocument))); if(!useCachedDocument) { var dir = Plugin.Culture.dir; var lang = Plugin.Culture.lang; var docTypeTag = ""; var htmlAttributes = "xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"" + lang + "\" dir=\"" + dir + "\" style=\"overflow: hidden\""; var htmlOpenTag = ""; var headOpenTag = ""; var modeTag = ""; var charSetTag = ""; var headCloseTag = ""; var preContentHTML = docTypeTag + htmlOpenTag + headOpenTag + modeTag + charSetTag; var styles = document.head.querySelectorAll("style, link[type='text/css']"); for(var i = 0; i < styles.length; i++) { var styleElement = styles[i]; var node = document.createElement(styleElement.nodeName); var attributes = styleElement.attributes; for(var j = 0; j < attributes.length; j++) { if(attributes[j].specified) { node.setAttribute(attributes[j].nodeName, attributes[j].nodeValue); } } node.innerHTML = styleElement.innerHTML; preContentHTML += node.outerHTML; } var bodyOpenTag = ""; preContentHTML += headCloseTag + bodyOpenTag; var bodyCloseTag = ""; var finalHTML = preContentHTML + displayParameters.content + bodyCloseTag; displayParameters.content = finalHTML; } if(!hasShownTooltipPopup) { hasShownTooltipPopup = true; } host.hostContentInPopup(displayParameters); } ; function dismissPopup() { host.dismissPopup(); } ; function resetTooltip(tooltip) { if(tooltip) { var contentDiv = tooltip["contentDiv"]; contentDiv.innerHTML = ""; tooltip["parent"] = null; tooltipReset = true; } } function dismissTooltip(reset) { var parent = null; if(scheduledShow) { clearTimeout(scheduledShow); scheduledShow = null; } if(scheduledDismiss) { clearTimeout(scheduledDismiss); scheduledDismiss = null; } if(tooltipObject) { parent = tooltipObject.parent; var usingPopup = canCreatePopup(); if(usingPopup) { dismissPopup(); } else { if(document.body.contains(tooltipObject)) { document.body.removeChild(tooltipObject); } tooltipObject.style.display = "none"; } if(typeof reset === "undefined" || reset) { resetTooltip(tooltipObject); } } __n("TooltipDismiss", tooltipObject, parent, (typeof reset === "undefined" || reset)); } function dismissTooltipOfParent(element, reset) { if(tooltipObject && tooltipObject.parent === element) { dismissTooltip(reset); } } function createOuterTooltipDiv() { var tooltip = document.createElement("div"); tooltip.setAttribute("id", "plugin-vs-tooltip"); return tooltip; } function createNestedCellDiv() { var nestedCellDiv = document.createElement("div"); nestedCellDiv.setAttribute("id", "plugin-vs-tooltip-nested-cell"); return nestedCellDiv; } function createContentDiv() { var contentDiv = document.createElement("div"); contentDiv.setAttribute("id", "plugin-vs-tooltip-content"); return contentDiv; } function createPopupMeasureContainer() { var measureContainer = document.createElement("div"); measureContainer["style"]["position"] = "absolute"; measureContainer["style"]["display"] = "none"; document.body.appendChild(measureContainer); return measureContainer; } function createTooltip() { var outerMostDiv = createOuterTooltipDiv(); var nestedCellDiv = createNestedCellDiv(); outerMostDiv.appendChild(nestedCellDiv); var contentDiv = createContentDiv(); nestedCellDiv.appendChild(contentDiv); outerMostDiv["contentDiv"] = contentDiv; return outerMostDiv; } function createBlankTooltip() { if(!tooltipReset) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.4004")); } var tooltip = tooltipObject; if(tooltip === null) { tooltip = tooltipObject = createTooltip(); tooltip.contentDiv.addEventListener("mouseover", function () { tooltip.style.display = "none"; __n("TooltipDismiss", tooltip, tooltip.parent, false); }); } return tooltip; } var htmlEncodingDiv = null; function htmlEncode(content) { if(!htmlEncodingDiv) { htmlEncodingDiv = document.createElement("div"); } htmlEncodingDiv.innerText = content; return htmlEncodingDiv.innerHTML; } function createNewTooltipFromContent(config) { var tooltip = createBlankTooltip(); var pContent = tooltip["contentDiv"]; if(pContent) { var hasValidContainsHTMLProperty = typeof config.contentContainsHTML === 'boolean'; var containsHTML = hasValidContainsHTMLProperty ? config.contentContainsHTML : Plugin.Tooltip.defaultTooltipContentToHTML; if(typeof config.content === "string") { pContent.innerHTML = containsHTML ? config.content : htmlEncode(config.content); Plugin.Theme._cssHelpers.processImages(pContent); } else if(config.content) { pContent.innerText = config.content; } } return tooltip; } function createNewTooltipFromString(contentString) { var tooltip = createBlankTooltip(); if(tooltip && contentString) { var pContent = tooltip["contentDiv"]; if(pContent) { pContent.innerText = contentString; } } return tooltip; } function adjustXPosForClientRight(x, width) { var distToClientRight = document.documentElement.clientWidth - (x + width); if(distToClientRight < 0) { x = document.documentElement.clientWidth - (width + 1); } return x; } function adjustYPosForClientBottom(y, height, yOffset) { var distToClientBottom = document.documentElement.clientHeight - (y + height); if(distToClientBottom < 0) { y -= (height + 2 * yOffset + 1); if(y < 0) { y = 0; } } return y; } function styleBoxSizingIsBorderBox(style) { var boxSizingMode = style["box-sizing"]; return ((typeof boxSizingMode === "string") && (boxSizingMode.toLowerCase() === "border-box")); } function convertOffsetHeightToHeight(offsetHeight, style) { if(styleBoxSizingIsBorderBox(style)) { return offsetHeight; } var topBorderWidth = parseInt(style["border-top-width"], 10); var bottomBorderWidth = parseInt(style["border-bottom-width"], 10); var topPadding = parseInt(style["padding-top"], 10); var bottomPadding = parseInt(style["padding-bottom"], 10); return (offsetHeight - (topBorderWidth + bottomBorderWidth + topPadding + bottomPadding)); } function convertOffsetWidthToWidth(offsetWidth, style) { if(styleBoxSizingIsBorderBox(style)) { return offsetWidth; } var leftBorderWidth = parseInt(style["border-right-width"], 10); var rightBorderWidth = parseInt(style["border-left-width"], 10); var leftPadding = parseInt(style["padding-left"], 10); var rightPadding = parseInt(style["padding-right"], 10); return (offsetWidth - (leftBorderWidth + rightBorderWidth + leftPadding + rightPadding)); } function setLeftTopWidthHeight(element, settings) { if(settings.width) { element.style.width = settings.width; } if(settings.height) { element.style.height = settings.height; } if(settings.left) { element.style.left = settings.left; } if(settings.top) { element.style.top = settings.top; } } function propertyIsFiniteNumber(obj, propName) { return (typeof obj[propName] === 'number' && isFinite(obj[propName])); } function areValidScreenBounds(bounds) { return bounds != null && propertyIsFiniteNumber(bounds, "Width") && propertyIsFiniteNumber(bounds, "Height"); } function showTooltipImmediate(args) { if(args.tooltip) { var useMousePosX = (typeof args.position === 'undefined') || (typeof args.position.clientX !== 'number'); var clientX = useMousePosX ? mousePosition.clientX : args.position.clientX; var offsetFactor = 0; var useMousePosY = (typeof args.position === 'undefined') || (typeof args.position.clientY !== 'number'); var clientY = useMousePosY ? mousePosition.clientY : args.position.clientY; if(useMousePosY) { offsetFactor = 1; } args.duration = (typeof args.duration === "number") ? args.duration : ((defaultDelay || (defaultDelay = host.getDblClickTime())) * 10); var layoutScreenX = -500; var layoutScreenY = -500; var usingPopup = canCreatePopup(); if(usingPopup) { if(!popupMeasureContainer) { popupMeasureContainer = createPopupMeasureContainer(); } var currentScreenBounds = host.getScreenSizeForXY(window.screenX + clientX, window.screenY + clientY); if(areValidScreenBounds(currentScreenBounds)) { layoutScreenX = -currentScreenBounds.Width; layoutScreenY = -currentScreenBounds.Height; popupMeasureContainer.style.display = "inline"; popupMeasureContainer.style.top = layoutScreenY + "px"; popupMeasureContainer.style.left = layoutScreenX + "px"; popupMeasureContainer.style["min-width"] = currentScreenBounds.Width + "px"; popupMeasureContainer.style["min-height"] = currentScreenBounds.Height + "px"; } } setLeftTopWidthHeight(args.tooltip, { left: layoutScreenX + "px", top: layoutScreenY + "px", width: "auto", height: "auto" }); if(usingPopup) { popupMeasureContainer.appendChild(args.tooltip); } else { document.body.appendChild(args.tooltip); } args.tooltip.style.display = "table"; var width = args.tooltip.offsetWidth; var height = args.tooltip.offsetHeight; if(usingPopup) { popupMeasureContainer.style.display = "none"; } var yOffset = (offsetFactor * tooltipOffsetY); if(!usingPopup) { clientY += yOffset; } var style = window.getComputedStyle(args.tooltip); if(usingPopup) { setLeftTopWidthHeight(args.tooltip, { left: "0px", top: "0px", width: (convertOffsetWidthToWidth(width, style) + 1) + "px", height: (convertOffsetHeightToHeight(height, style) + 1) + "px" }); width += 1; height += 1; var popupArgs = { content: args.tooltip.outerHTML, clientCoordinates: { X: clientX, Y: clientY }, contentSize: { Width: width, Height: height }, ensureNotUnderMouseCursor: true, placementTargetIsMouseRect: useMousePosY, useCachedDocument: args.useCachedDocument }; hostContentInPopup(popupArgs); args.tooltip.style.display = "none"; popupMeasureContainer.removeChild(args.tooltip); } else { clientX = adjustXPosForClientRight(clientX, width); clientY = adjustYPosForClientBottom(clientY, height, yOffset); clientX += window.pageXOffset; clientY += window.pageYOffset; setLeftTopWidthHeight(args.tooltip, { left: clientX + "px", top: clientY + "px", width: (convertOffsetWidthToWidth(width, style) + 1) + "px", height: (convertOffsetHeightToHeight(height, style) + 1) + "px" }); } } scheduledShow = null; if(args.duration > 0) { scheduledDismiss = setTimeout(function () { dismissTooltip(false); scheduledDismiss = null; }, args.duration); } if(!usingPopup) { __n("TooltipShow", args.tooltip, clientX, clientY, width, height, args.duration, scheduledDismiss); } } function scheduleShowTooltip(tooltip, delay, duration, position, useCachedDocument) { if(!tooltip) { return null; } delay = (typeof delay === "number") ? delay : (defaultDelay || (defaultDelay = host.getDblClickTime())); useCachedDocument = (typeof useCachedDocument !== 'undefined' ? useCachedDocument : hasShownTooltipPopup); if(delay <= 0) { showTooltipImmediate({ tooltip: tooltip, duration: duration, position: position, useCachedDocument: useCachedDocument }); return null; } var timeout = setTimeout(function () { showTooltipImmediate({ tooltip: tooltip, duration: duration, position: position, useCachedDocument: useCachedDocument }); }, delay); __n("TooltipShowScheduled", tooltip, delay); return timeout; } function showTooltip(config, parent) { dismissTooltip(); var useCachedDocument = hasShownTooltipPopup; var tooltip = null; var options = { }; if(config && typeof config === "object") { var tooltipContent; if(useCachedDocument && (typeof config.useCachedDocument === 'boolean')) { useCachedDocument = config.useCachedDocument; } if(config.resource) { if(config.content || config.content === "") { try { tooltip = createNewTooltipFromString(Plugin.Resources.getString(config.resource)); } catch (e) { } } else { tooltip = createNewTooltipFromString(Plugin.Resources.getString(config.resource)); } } if(!tooltip && (config.content || config.content === "")) { tooltip = createNewTooltipFromContent(config); } if(!tooltip) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.4005")); } options = config; } else { tooltip = createNewTooltipFromString(config); } if(!tooltip) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.4006")); } tooltip.parent = parent; tooltipObject = tooltip; tooltipReset = false; scheduledShow = scheduleShowTooltip(tooltip, options.delay, options.duration, { clientX: options.x, clientY: options.y }, useCachedDocument); } function initializeElementTooltip(element) { if(!element || !element.addEventListener) { Plugin._logError("JSPlugin.4007"); return; } function hasChild(element, childCandidate) { var currentParent = childCandidate ? childCandidate.parentNode : null; while(currentParent && currentParent !== document.body) { if(currentParent === element) { return true; } currentParent = currentParent.parentNode; } return false; } function onMouseOver(e) { var currentTarget = e.currentTarget; if(!currentTarget.hasAttribute("data-plugin-vs-tooltip")) { currentTarget.removeEventListener("mouseover", onMouseOver); currentTarget.removeEventListener("mouseout", onMouseOut); currentTarget.removeEventListener("mousedown", onMouseDown); currentTarget.__plugin_tooltip_initialized = false; return; } if(tooltipObject && !tooltipReset && tooltipObject.parent && ((tooltipObject.parent === e.currentTarget) || (tooltipObject.parent === e.target) || (hasChild(tooltipObject.parent, e.target) && hasChild(e.currentTarget, tooltipObject.parent)))) { return; } var tooltipConfigStr = currentTarget.getAttribute("data-plugin-vs-tooltip"); var config; if((typeof tooltipConfigStr === "string") && (tooltipConfigStr.length > 0) && (tooltipConfigStr[0] === "{")) { config = JSON.parse(tooltipConfigStr); } else { config = tooltipConfigStr; } showTooltip(config, e.currentTarget); } ; element.addEventListener("mouseover", onMouseOver, true); function onMouseOut(e) { if(e.relatedTarget && (e.currentTarget !== e.relatedTarget) && !hasChild(e.currentTarget, e.relatedTarget)) { dismissTooltipOfParent(e.currentTarget); } } ; element.addEventListener("mouseout", onMouseOut); function onMouseDown(e) { dismissTooltipOfParent(e.currentTarget, false); } ; element.addEventListener("mousedown", onMouseDown); (element).__plugin_tooltip_initialized = true; } Tooltip.initializeElementTooltip = initializeElementTooltip; document.addEventListener("DOMContentLoaded", function () { var withTooltipData = document.querySelectorAll("[data-plugin-vs-tooltip]"); for(var i = 0; i < withTooltipData.length; i++) { initializeElementTooltip(withTooltipData[i]); } }, false); document.addEventListener("mouseout", function (e) { if(!e.relatedTarget || (e.relatedTarget).nodeName === "HTML") { dismissTooltip(); } }, false); document.addEventListener("mouseover", function (e) { var tooltipConfig; if(!(e.target).__plugin_tooltip_initialized && (e.target).hasAttribute("data-plugin-vs-tooltip")) { initializeElementTooltip(e.target); } }, true); document.addEventListener("mousemove", function (e) { mousePosition.screenX = e.screenX; mousePosition.screenY = e.screenY; mousePosition.clientX = e.clientX; mousePosition.clientY = e.clientY; }, false); function show(config) { showTooltip(config, null); } Tooltip.show = show; function dismiss(reset) { dismissTooltip(reset); } Tooltip.dismiss = dismiss; })(Plugin.Tooltip || (Plugin.Tooltip = {})); var Tooltip = Plugin.Tooltip; })(Plugin || (Plugin = {})); var Plugin; (function (Plugin) { (function (ContextMenu) { "use strict"; var host = loadModule("plugin.host.contextmenu"); var TypeScriptFix; var urlRegEx = /url\(['"]?([^'"]*)['"]?\)/gm; var iconIsTokenRegEx = /^[^\:\.]*$/; (function (MenuItemType) { MenuItemType._map = []; MenuItemType.checkbox = 0; MenuItemType.command = 1; MenuItemType.radio = 2; MenuItemType.separator = 3; })(ContextMenu.MenuItemType || (ContextMenu.MenuItemType = {})); var MenuItemType = ContextMenu.MenuItemType; var contextMenuStorage = new Object(); var contextMenuContainer = document.createElement("div"); contextMenuContainer.id = "plugin-contextmenu-container"; Plugin.addEventListener("load", function () { return document.body.appendChild(contextMenuContainer); }); var currentTargetId; var activeElement; var shouldShowInline = false; function dismissAll() { if(!Plugin.ContextMenu.canCreatePopup()) { for(var key in contextMenuStorage) { if(contextMenuStorage.hasOwnProperty(key)) { contextMenuStorage[key].dismiss(); } } } else { host.dismiss(); } shouldShowInline = false; } ContextMenu.dismissAll = dismissAll; function getAbsoluteOffset(target) { var aggregateOffsetTop = target.offsetTop; var aggregateOffsetLeft = target.offsetLeft; while(target = target.offsetParent) { aggregateOffsetTop += target.offsetTop; aggregateOffsetLeft += target.offsetLeft; } return { left: aggregateOffsetLeft, top: aggregateOffsetTop }; } function coordinatesAreOutsideOfVisibleClientArea(x, y) { return (x < 0 || y < 0 || x > document.documentElement.clientWidth || y > document.documentElement.clientHeight); } function determineVisibleTargetWidth(target, absoluteCoordinates) { var targetRight = absoluteCoordinates.left + target.offsetWidth; var visibleWindowAbsolute = { left: window.pageXOffset, top: window.pageYOffset, right: window.pageXOffset + window.document.documentElement.clientWidth, bottom: window.pageYOffset + window.document.documentElement.clientHeight }; var isEntirelyOnScreen = ((absoluteCoordinates.left >= visibleWindowAbsolute.left) && (targetRight <= visibleWindowAbsolute.right)); if(isEntirelyOnScreen) { return target.offsetWidth; } if((targetRight < visibleWindowAbsolute.left) || (absoluteCoordinates.left > visibleWindowAbsolute.right)) { return 0; } if((absoluteCoordinates.left < visibleWindowAbsolute.left) && (targetRight <= visibleWindowAbsolute.right)) { return (target.offsetWidth - (visibleWindowAbsolute.left - absoluteCoordinates.left)); } if((targetRight > visibleWindowAbsolute.right) && (absoluteCoordinates.left >= visibleWindowAbsolute.left)) { return (target.offsetWidth - (targetRight - visibleWindowAbsolute.right)); } return window.document.documentElement.clientWidth; } function determineVisibleTargetHeight(target, absoluteCoordinates) { var targetBottom = absoluteCoordinates.top + target.offsetHeight; var visibleWindowAbsolute = { left: window.pageXOffset, top: window.pageYOffset, right: window.pageXOffset + window.document.documentElement.clientWidth, bottom: window.pageYOffset + window.document.documentElement.clientHeight }; var isEntirelyOnScreen = ((absoluteCoordinates.top >= visibleWindowAbsolute.top) && (targetBottom <= visibleWindowAbsolute.bottom)); if(isEntirelyOnScreen) { return target.offsetHeight; } if((targetBottom < visibleWindowAbsolute.top) || (absoluteCoordinates.top > visibleWindowAbsolute.bottom)) { return 0; } if((absoluteCoordinates.top < visibleWindowAbsolute.top) && (targetBottom <= visibleWindowAbsolute.bottom)) { return (target.offsetHeight - (visibleWindowAbsolute.top - absoluteCoordinates.top)); } if((targetBottom > visibleWindowAbsolute.bottom) && (absoluteCoordinates.top >= visibleWindowAbsolute.top)) { return (target.offsetHeight - (targetBottom - visibleWindowAbsolute.bottom)); } return window.document.documentElement.clientHeight; } function handleContextMenuShow(target, clientX, clientY) { var id; var zoomX = 1; var zoomY = 1; if(screen.deviceXDPI && Plugin.ContextMenu.canCreatePopup()) { zoomX = screen.deviceXDPI / screen.systemXDPI; zoomY = screen.deviceYDPI / screen.systemYDPI; } if(!target) { return false; } var originalTarget = target; while(target.parentElement) { id = target.getAttribute("data-plugin-contextmenu"); if(id !== null) { var contextMenu = contextMenuStorage[id]; var coordinates = { X: clientX * zoomX, Y: clientY * zoomY }; if(typeof (host.adjustShowCoordinates) === "function") { coordinates = host.adjustShowCoordinates(coordinates); } if(coordinates.X === 0 && coordinates.Y === 0) { var absoluteOffset = getAbsoluteOffset(originalTarget); var onscreenWidth = determineVisibleTargetWidth(originalTarget, absoluteOffset); var onscreenHeight = determineVisibleTargetHeight(originalTarget, absoluteOffset); if(onscreenWidth === 0 || onscreenHeight === 0) { coordinates.X = coordinates.Y = 0; } else { var midPointX = onscreenWidth / 2; var midPointY = onscreenHeight / 2; if(absoluteOffset.left < window.pageXOffset || originalTarget.offsetWidth > window.document.documentElement.clientWidth) { coordinates.X = midPointX * zoomX; } else { coordinates.X = ((absoluteOffset.left - window.pageXOffset) + midPointX) * zoomX; } if(absoluteOffset.top < window.pageYOffset || originalTarget.offsetHeight > window.document.documentElement.clientHeight) { coordinates.Y = midPointY * zoomY; } else { coordinates.Y = ((absoluteOffset.top - window.pageYOffset) + midPointY) * zoomY; } } } if(coordinatesAreOutsideOfVisibleClientArea(coordinates.X, coordinates.Y)) { coordinates.X = coordinates.Y = 0; } contextMenu.show(coordinates.X, coordinates.Y, 0, target.id); return true; } target = target.parentElement; if(!target) { return false; } } return false; } document.addEventListener("keydown", function (event) { if(event.key === "F10" && event.shiftKey && !event.altKey && !event.ctrlKey) { var element = document.activeElement; if(handleContextMenuShow(element, 0, 0)) { event.preventDefault(); } } }, false); document.addEventListener("contextmenu", function (event) { handleContextMenuShow(event.target, event.clientX, event.clientY); event.preventDefault(); }, false); document.addEventListener("click", function (event) { dismissAll(); }, false); window.addEventListener("resize", function (event) { if(!Plugin.ContextMenu.canCreatePopup()) { dismissAll(); } }, false); function stopPropagation(event) { event.stopPropagation(); event.preventDefault(); } ; var DisposableEventListener = (function () { function DisposableEventListener(target, type, listener, useCapture) { this.target = target; this.type = type; this.listener = listener; this.useCapture = useCapture; } DisposableEventListener.prototype.install = function () { this.target.addEventListener(this.type, this.listener, this.useCapture); }; DisposableEventListener.prototype.uninstall = function () { this.target.removeEventListener(this.type, this.listener, this.useCapture); }; return DisposableEventListener; })(); var HostContextMenu = (function () { function HostContextMenu(menuItems, id, ariaLabel, cssClass, callback, parentMenu, parentMenuId) { this.disposableEventListeners = []; if(menuItems === null || typeof (menuItems) === "undefined" || menuItems.length === 0) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.5006")); } if(typeof (id) !== "string" && !isNullOrEmpty(id)) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.5015")); } this.id = !isNullOrEmpty(id) ? id : generateId("plugin-contextmenu"); this.ariaLabel = ariaLabel; if(!isNullOrEmpty(contextMenuStorage[this.id])) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.5007")); } if(typeof (cssClass) !== "string" && !isNullOrEmpty(cssClass)) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.5016")); } this.callback = callback; this.eventManager = new Plugin.Utilities.EventManager(); this.eventManager.setTarget(this); var contextMenu = document.createElement("ul"); contextMenu.id = this.id; if(!isNullOrEmpty(parentMenu)) { var fireShowEvent = function (eventManager) { return function (event) { eventManager.dispatchEvent("show"); }; }; this.addDisposableEventListener(parentMenu, "show", fireShowEvent(this.eventManager)); contextMenu.setAttribute("plugin-contextmenu-parent", parentMenuId); } contextMenu.className = "plugin-contextmenu"; if(!isNullOrEmpty(cssClass)) { contextMenu.classList.add(cssClass); } var tabIndex = 1; for(var item in menuItems) { if(!menuItems.hasOwnProperty(item)) { continue; } var contextMenuItem = document.createElement("li"); contextMenuItem.className = "menuitem"; if(menuItems[item].type !== MenuItemType.separator) { contextMenuItem.setAttribute("tabIndex", tabIndex.toString()); tabIndex++; } var role = ""; switch(menuItems[item].type) { case MenuItemType.checkbox: role = "menuitemcheckbox"; break; case MenuItemType.command: role = "menuitem"; break; case MenuItemType.separator: role = "separator"; break; case MenuItemType.radio: role = "menuitemradio"; break; } contextMenuItem.setAttribute("role", role); var itemId = menuItems[item].id; contextMenuItem.id = !isNullOrEmpty(itemId) ? itemId : generateId("plugin-contextmenuitem"); var mainDiv = document.createElement("div"); mainDiv.className = "main"; var label = menuItems[item].label; var isEmpty = isNullOrEmpty(label); if((isEmpty && (menuItems[item].type !== MenuItemType.separator)) || ((typeof (label) !== "string") && !isEmpty)) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.5018")); } if(!isEmpty) { mainDiv.innerText = label; } contextMenuItem.appendChild(mainDiv); var enabledIcon = menuItems[item].iconEnabled; if(!isNullOrEmpty(enabledIcon) && typeof (enabledIcon) !== "string") { throw new Error(Plugin.Resources.getErrorString("JSPlugin.5019")); } var disabledIcon = menuItems[item].iconDisabled; if(!isNullOrEmpty(disabledIcon) && typeof (disabledIcon) !== "string") { throw new Error(Plugin.Resources.getErrorString("JSPlugin.5020")); } var iconImg = document.createElement("img"); iconImg.className = "icon"; iconImg.style.display = "none"; contextMenuItem.appendChild(iconImg); var shortcut = menuItems[item].accessKey; if(!isNullOrEmpty(shortcut) && typeof (shortcut) !== "string") { throw new Error(Plugin.Resources.getErrorString("JSPlugin.5021")); } var shortcutDiv = document.createElement("div"); shortcutDiv.className = "shortcut"; if(!isNullOrEmpty(shortcut)) { shortcutDiv.innerText = shortcut; } contextMenuItem.appendChild(shortcutDiv); var menuItemCallback = menuItems[item].callback; if(isNullOrEmpty(menuItemCallback)) { menuItemCallback = this.callback; } if((typeof (menuItemCallback) !== "function") && (menuItems[item].type !== MenuItemType.separator)) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.5017")); } var passCallbackToClickEvent = function (callback) { return function (event) { var item = event.currentTarget; if(callback && !item.classList.contains("disabled") && isNullOrEmpty(item.getAttribute("data-plugin-contextmenu"))) { var type; switch(item.getAttribute("data-plugin-contextmenu-item-type")) { case "checkbox": type = MenuItemType.checkbox; break; case "command": type = MenuItemType.command; break; case "separator": type = MenuItemType.separator; break; case "radio": type = MenuItemType.radio; break; default: throw new Error(Plugin.Resources.getErrorString("JSPlugin.5008")); } var contextMenuItem = { id: item.id, callback: callback, label: (item.getElementsByClassName("main")[0]).innerText, type: type, iconEnabled: (item.getElementsByClassName("icon")[0]).src, iconDisabled: "", accessKey: (item.getElementsByClassName("shortcut")[0]).innerText, hidden: function () { return false; }, disabled: function () { return false; }, checked: function () { return item.getAttribute("aria-checked") === "true"; }, cssClass: item.className, submenu: null }; callback((item.parentNode).id, contextMenuItem, currentTargetId); dismissAll(); } else { stopPropagation(event); } }; }; this.addDisposableEventListener(contextMenuItem, "click", passCallbackToClickEvent(menuItemCallback), false); this.addDisposableEventListener(contextMenuItem, "contextmenu", passCallbackToClickEvent(menuItemCallback), false); var passMenuItemCallbacksToShowEvent = function (isHidden, isDisabled, isChecked, iconEnabled, iconDisabled, type, item) { return function (event) { if(typeof (isHidden) === "function" && isHidden()) { item.classList.add("hidden"); } else { item.classList.remove("hidden"); } var icon; if(typeof (isDisabled) === "function" && isDisabled()) { item.classList.add("disabled"); item.setAttribute("aria-disabled", "true"); icon = iconDisabled; } else { item.classList.remove("disabled"); item.removeAttribute("aria-disabled"); icon = iconEnabled; } var iconImg = item.getElementsByClassName("icon")[0]; switch(type) { case MenuItemType.checkbox: item.removeAttribute("aria-checked"); if(typeof (isChecked) === "function" && isChecked()) { var backgroundSrc = getComputedStyle(iconImg).getPropertyValue("background-image"); backgroundSrc = backgroundSrc.replace(urlRegEx, function (urlMatch, src) { return src; }); iconImg.src = backgroundSrc; item.setAttribute("aria-checked", "true"); iconImg.style.display = "block"; } else { item.setAttribute("aria-checked", "false"); iconImg.style.display = "none"; } break; case MenuItemType.command: if(!isNullOrEmpty(icon)) { if(iconIsTokenRegEx.test(icon)) { iconImg.setAttribute("data-plugin-theme-src", icon); } else { iconImg.src = icon; iconImg.removeAttribute("data-plugin-theme-src"); } iconImg.style.display = "block"; } else { iconImg.style.display = "none"; } break; } }; }; var isHidden = menuItems[item].hidden; if(!isNullOrEmpty(isHidden) && typeof (isHidden) !== "function") { throw new Error(Plugin.Resources.getErrorString("JSPlugin.5023")); } var isDisabled = menuItems[item].disabled; if(!isNullOrEmpty(isDisabled) && typeof (isDisabled) !== "function") { throw new Error(Plugin.Resources.getErrorString("JSPlugin.5024")); } var isChecked = menuItems[item].checked; if(!isNullOrEmpty(isChecked) && typeof (isChecked) !== "function") { throw new Error(Plugin.Resources.getErrorString("JSPlugin.5025")); } this.addDisposableEventListener(this, "show", passMenuItemCallbacksToShowEvent(isHidden, isDisabled, isChecked, menuItems[item].iconEnabled, menuItems[item].iconDisabled, menuItems[item].type, contextMenuItem)); var itemCssClass = menuItems[item].cssClass; if(!isNullOrEmpty(itemCssClass) && typeof (itemCssClass) !== "string") { throw new Error(Plugin.Resources.getErrorString("JSPlugin.5022")); } if(!isNullOrEmpty(itemCssClass)) { contextMenuItem.classList.add(itemCssClass); } var submenu = menuItems[item].submenu; var isSubmenuNullOrUndefined = (typeof (submenu) === "undefined" || submenu === null); if(!isSubmenuNullOrUndefined && !Array.isArray(submenu)) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.5026")); } if(!isSubmenuNullOrUndefined) { var submenuId = generateId("plugin-contextsubmenu"); var menu = new HostContextMenu(submenu, submenuId, null, cssClass, menuItemCallback, this, this.id); var arrowDiv = document.createElement("div"); arrowDiv.className = "arrow"; contextMenuItem.setAttribute("data-plugin-contextmenu", submenuId); contextMenuItem.appendChild(arrowDiv); } var deactivateSiblingSubmenus = function (currentTarget) { if(getComputedStyle(currentTarget.parentElement).getPropertyValue("display") !== "none") { var siblings = currentTarget.parentElement.querySelectorAll("[data-plugin-contextmenu]"); for(var i = 0; i < siblings.length; i++) { var sibling = siblings[i]; if(sibling !== currentTarget) { if(typeof (sibling.className) !== "undefined") { sibling.classList.remove("active"); submenuId = sibling.getAttribute("data-plugin-contextmenu"); submenu = document.getElementById(submenuId); submenu.style.display = "none"; } } } } }; this.addDisposableEventListener(contextMenuItem, "mouseover", function (event) { var currentTarget = event.currentTarget; if(shouldFocusMenuItem(currentTarget)) { currentTarget.focus(); } else { deactivateSiblingSubmenus(event.currentTarget); } showSubmenu(currentTarget); }, false); this.addDisposableEventListener(contextMenuItem, "mouseout", handleContextMenuItemMouseOut, false); this.addDisposableEventListener(contextMenuItem, "focus", function (event) { deactivateSiblingSubmenus(event.currentTarget); }, false); this.addDisposableEventListener(contextMenuItem, "keydown", onMenuItemKeyDown, false); switch(menuItems[item].type) { case MenuItemType.checkbox: iconImg.classList.add("checkbox"); contextMenuItem.setAttribute("data-plugin-contextmenu-item-type", "checkbox"); break; case MenuItemType.command: contextMenuItem.setAttribute("data-plugin-contextmenu-item-type", "command"); break; case MenuItemType.radio: throw new Error("Not implemented"); break; case MenuItemType.separator: mainDiv.classList.add("hr"); contextMenuItem.setAttribute("data-plugin-contextmenu-item-type", "separator"); break; default: throw new Error(Plugin.Resources.getErrorString("JSPlugin.5008")); } contextMenu.appendChild(contextMenuItem); } this.addDisposableEventListener(contextMenu, "click", stopPropagation, false); this.addDisposableEventListener(contextMenu, "contextmenu", stopPropagation, false); var fireDismiss = function (contextMenu, id) { return function (event) { if(id === event.id) { contextMenu.eventManager.dispatchEvent("dismiss"); if(activeElement) { activeElement.focus(); } } }; }; host.addEventListener("contextmenudismissed", fireDismiss(this, this.id)); contextMenuContainer.appendChild(contextMenu); contextMenuStorage[contextMenu.id] = this; this.addDisposableEventListener(contextMenu, "keydown", onContextMenuKeyDown, false); } HostContextMenu.prototype.attach = function (element) { if(isNullOrEmpty(this.id)) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.5010")); } element.setAttribute("data-plugin-contextmenu", this.id); }; HostContextMenu.prototype.detach = function (element) { if(isNullOrEmpty(this.id)) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.5010")); } if(element.getAttribute("data-plugin-contextmenu") === this.id) { element.removeAttribute("data-plugin-contextmenu"); } }; HostContextMenu.prototype.dismiss = function () { if(isNullOrEmpty(this.id)) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.5010")); } if(!Plugin.ContextMenu.canCreatePopup()) { var contextMenu = document.getElementById(this.id); if(contextMenu.style.display !== "none") { document.getElementById(this.id).style.display = "none"; this.eventManager.dispatchEvent("dismiss"); if(activeElement) { activeElement.focus(); } } } else { host.dismiss(); } }; HostContextMenu.prototype.dispose = function () { if(isNullOrEmpty(this.id)) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.5010")); } this.disposableEventListeners.forEach(function (listener) { listener.uninstall(); }); this.disposableEventListeners = []; var nodeList = (document.querySelectorAll("[data-plugin-contextmenu=" + this.id + "]")); for(var i = 0; i < nodeList.length; i++) { nodeList[i].removeAttribute("data-plugin-contextmenu"); } removeContextMenuFromStorage(this.id); this.id = null; this.callback = null; }; HostContextMenu.prototype.show = function (xPosition, yPosition, widthOffset, targetId) { if(isNullOrEmpty(this.id)) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.5010")); } if(!isFiniteNumber(xPosition) || !isFiniteNumber(yPosition)) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.5012")); } if(!isFiniteNumber(widthOffset) && !isNullOrEmpty(widthOffset)) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.5013")); } if(typeof (targetId) !== "string" && !isNullOrEmpty(targetId)) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.5014")); } dismissAll(); currentTargetId = targetId; activeElement = document.activeElement; var offset = widthOffset || 0; var element = document.getElementById(this.id); for(var i = 0; i < element.children.length; i++) { (element.children[i]).classList.remove("active"); } this.eventManager.dispatchEvent("show"); adjustMenuItemWidth(element); _positionHelpers.show(element, this.ariaLabel, xPosition, yPosition, 0, offset, null, positionContextMenuInsideAirspace, host.show.bind(host)); }; HostContextMenu.prototype.addEventListener = function (type, listener) { if(isNullOrEmpty(this.id)) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.5010")); } this.eventManager.addEventListener(type, listener); }; HostContextMenu.prototype.removeEventListener = function (type, listener) { if(isNullOrEmpty(this.id)) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.5010")); } this.eventManager.removeEventListener(type, listener); }; HostContextMenu.prototype.dispatchEvent = function (evt) { if(isNullOrEmpty(this.id)) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.5010")); } return this.eventManager.dispatchEvent(evt.type); }; HostContextMenu.prototype.addDisposableEventListener = function (target, type, listener, useCapture) { var disposableListener = new DisposableEventListener(target, type, listener, useCapture); disposableListener.install(); this.disposableEventListeners.push(disposableListener); }; return HostContextMenu; })(); function adjustMenuItemWidth(element) { var maxWidth = 0; var shortcuts = element.querySelectorAll(".shortcut"); for(var i = 0; i < shortcuts.length; i++) { var shortcut = shortcuts[i]; element.style.display = "block"; var width = parseInt(getComputedStyle(shortcut).getPropertyValue("width")); element.style.display = "none"; maxWidth = (width > maxWidth) ? width : maxWidth; } var menuItemMainDivs = element.querySelectorAll(".main"); maxWidth += 50; for(var i = 0; i < menuItemMainDivs.length; i++) { (menuItemMainDivs[i]).style.paddingRight = maxWidth + "px"; } } function removeContextMenuFromStorage(id) { var menu = document.getElementById(id); contextMenuContainer.removeChild(menu); delete contextMenuStorage[id]; var submenuItems = menu.querySelectorAll("[data-plugin-contextmenu]"); for(var i = 0; i < submenuItems.length; i++) { removeContextMenuFromStorage((submenuItems[i]).getAttribute("data-plugin-contextmenu")); } } function create(menuItems, id, ariaLabel, cssClass, callback) { return new HostContextMenu(menuItems, id, ariaLabel, cssClass, callback); } ContextMenu.create = create; function canCreatePopup() { return host.canCreatePopup() && !shouldShowInline; } ContextMenu.canCreatePopup = canCreatePopup; ; (function (_positionHelpers) { function show(element, ariaLabel, xPosition, yPosition, elementOffsetTop, widthOffset, displayType, tryAdjustCoordinates, showOutsideOfAirspace) { var nodeList = element.querySelectorAll("[data-plugin-contextmenu]"); shouldShowInline = shouldShowInline || (nodeList.length > 0 && !host.canCreatePopup(true)); Plugin.Theme._cssHelpers.processImages(element); var display = displayType || "block"; element.style.display = display; var height = element.offsetHeight; var width = element.offsetWidth; element.style.display = "none"; var scrollOffsetTop = window.pageYOffset; var scrollOffsetLeft = window.pageXOffset; var viewPortHeight = document.documentElement.clientHeight; var viewPortWidth = document.documentElement.clientWidth; var positionInfo = { clientCoordinates: { X: xPosition, Y: yPosition }, width: width, height: height, viewPortWidth: viewPortWidth, viewPortHeight: viewPortHeight, scrollOffsetLeft: scrollOffsetLeft, scrollOffsetTop: scrollOffsetTop, elementOffsetTop: elementOffsetTop, widthOffset: widthOffset }; if(Plugin.ContextMenu.canCreatePopup()) { showOutsideOfAirspace(element.id, ariaLabel, contextMenuContainer, positionInfo); return; } var adjustedPositionInfo = positionInfo; if(yPosition + height > viewPortHeight || xPosition + width > viewPortWidth) { if(typeof (tryAdjustCoordinates) === "function") { adjustedPositionInfo = tryAdjustCoordinates(positionInfo); } } element.style.left = adjustedPositionInfo.clientCoordinates.X + scrollOffsetLeft + "px"; element.style.top = adjustedPositionInfo.clientCoordinates.Y + scrollOffsetTop + "px"; element.style.display = display; element.setAttribute("tabindex", "0"); element.focus(); __n("ContextMenuShow", adjustedPositionInfo.clientCoordinates.X + scrollOffsetLeft, adjustedPositionInfo.clientCoordinates.Y + scrollOffsetTop, adjustedPositionInfo.width, adjustedPositionInfo.height); } _positionHelpers.show = show; })(ContextMenu._positionHelpers || (ContextMenu._positionHelpers = {})); var _positionHelpers = ContextMenu._positionHelpers; function positionContextMenuInsideAirspace(positionInfo) { var y = positionInfo.clientCoordinates.Y; var yMirror = positionInfo.clientCoordinates.Y - positionInfo.height; if(positionInfo.clientCoordinates.Y + positionInfo.height > positionInfo.viewPortHeight && yMirror >= 0) { y = yMirror; } var x = positionInfo.clientCoordinates.X; var xMirror = positionInfo.clientCoordinates.X - (positionInfo.width + positionInfo.widthOffset); if(positionInfo.clientCoordinates.X + positionInfo.width > positionInfo.viewPortWidth && xMirror >= 0) { x = xMirror; } positionInfo.clientCoordinates.Y = y; positionInfo.clientCoordinates.X = x; return positionInfo; } function generateId(prefix) { if(isNullOrEmpty(prefix)) { throw new Error(Plugin.Resources.getErrorString("JSPlugin.5009")); } function getHexDigits(count) { var random = ""; while(random.length < count) { random += Math.floor(Math.random() * 65536).toString(16); } return random.substr(0, count); } return prefix + "-" + getHexDigits(8) + "-" + getHexDigits(4) + "-" + getHexDigits(4) + "-" + getHexDigits(4) + "-" + getHexDigits(12); } function isNullOrEmpty(value) { return (value === null || typeof (value) === "undefined" || value === ""); } function isFiniteNumber(value) { return (isFinite(value) && (typeof (value) === "number")); } function handlePopupMenuItemClick(event) { var target = event.currentTarget; if(!target.classList.contains("disabled") && isNullOrEmpty(target.getAttribute("data-plugin-contextmenu"))) { host.callback(target.id); } stopPropagation(event); } function popupDeactivateSiblingSubmenus(currentTarget) { if(!currentTarget.classList.contains("active")) { var coordinates = { X: 1, Y: currentTarget.offsetTop + 1 }; host.dismissSubmenus(coordinates); var siblings = (currentTarget.parentNode).querySelectorAll("[data-plugin-contextmenu]"); for(var i = 0; i < siblings.length; i++) { var sibling = siblings[i]; if(sibling !== this) { sibling.classList.remove("active"); } } } } function popupShowSubmenu(currentTarget) { if(!currentTarget.classList.contains("active")) { var submenuId = currentTarget.getAttribute("data-plugin-contextmenu"); if(submenuId !== null && typeof (submenuId) !== "undefined") { var submenu = document.getElementById(submenuId); currentTarget.classList.add("active"); adjustMenuItemWidth(submenu); _positionHelpers.show(submenu, null, 0, 0, currentTarget.offsetTop, 0, null, null, host.show.bind(host)); } } } function handlePopupMenuItemMouseOver(event) { var currentTarget = event.currentTarget; if(shouldFocusMenuItem(currentTarget)) { currentTarget.focus(); } else { popupDeactivateSiblingSubmenus(event.currentTarget); } popupShowSubmenu(currentTarget); } function handleContextMenuItemMouseOut(event) { var currentTarget = event.currentTarget; currentTarget.classList.remove("active"); currentTarget.blur(); } function handlePopupMenuItemFocus(event) { popupDeactivateSiblingSubmenus(event.currentTarget); } host.addEventListener("contextmenufocused", function (event) { focusActiveMenuItem("contextmenu"); }); host.addEventListener("contextmenuinitialized", function (event) { contextMenuContainer.innerHTML = event.contextMenus; var contextmenu = document.getElementById("contextmenu"); contextmenu.innerHTML = document.getElementById(event.id).innerHTML; if(event.ariaLabel && event.ariaLabel.length !== 0) { contextmenu.setAttribute("aria-label", event.ariaLabel); } contextmenu.addEventListener("click", stopPropagation, false); contextmenu.addEventListener("contextmenu", stopPropagation, false); contextmenu.addEventListener("keydown", onContextMenuKeyDown, false); var menuItems = contextmenu.getElementsByClassName("menuitem"); for(var i = 0; i < menuItems.length; i++) { menuItems[i].addEventListener("mouseover", handlePopupMenuItemMouseOver, false); menuItems[i].addEventListener("mouseout", handleContextMenuItemMouseOut, false); menuItems[i].addEventListener("focus", handlePopupMenuItemFocus, false); menuItems[i].addEventListener("click", handlePopupMenuItemClick, false); menuItems[i].addEventListener("contextmenu", handlePopupMenuItemClick, false); menuItems[i].addEventListener("keydown", onMenuItemKeyDown, false); menuItems[i].addEventListener("DOMAttrModified", onAttrModified, false); } contextmenu.style.display = "block"; contextmenu.setAttribute("tabindex", "0"); host.disableZoom(); host.fireContentReady(); }); host.addEventListener("contextmenuclicked", function (event) { var contextmenuItem = document.getElementById(event.Id); if(contextmenuItem) { contextmenuItem.click(); } }); host.addEventListener("contextmenuopened", function (event) { __n("ContextMenuShow", event.x, event.y, event.width, event.height); }); function shouldFocusMenuItem(element) { var allowDisabledItemNavigation = element.parentElement.classList.contains("allowDisabledItemNavigation"); var isDisabled = element.classList.contains("disabled"); var isHidden = element.classList.contains("hidden"); return ((allowDisabledItemNavigation || !isDisabled) && !isHidden && element.hasAttribute("tabindex")); } ; function getMenuItemStartIndex(target, currentTarget, menuItems) { var startIndex = 0; if(target !== currentTarget) { for(var i = 0; i < menuItems.length; i++) { var element = menuItems[i]; if(element === target) { startIndex = i + 1; break; } } } return startIndex; } function getPreviousMenuItem(startIndex, menuItems) { var elementToFocus; for(var i = startIndex - 2; i >= 0; i--) { var element = menuItems[i]; if(shouldFocusMenuItem(element)) { elementToFocus = element; break; } } if(!elementToFocus) { for(var i = menuItems.length - 1; i > startIndex - 1; i--) { var element = menuItems[i]; if(shouldFocusMenuItem(element)) { elementToFocus = element; break; } } } return elementToFocus; } ; function getNextMenuItem(startIndex, menuItems) { var elementToFocus; for(var i = startIndex; i < menuItems.length; i++) { var element = menuItems[i]; if(shouldFocusMenuItem(element)) { elementToFocus = element; break; } } if(!elementToFocus) { for(var i = 0; i < startIndex - 1; i++) { var element = menuItems[i]; if(shouldFocusMenuItem(element)) { elementToFocus = element; break; } } } return elementToFocus; } ; function handleDismissCurrent(currentTarget, ignoreDismissForRoot) { if(Plugin.ContextMenu.canCreatePopup()) { host.dismissCurrent(ignoreDismissForRoot); return; } var isRoot = !currentTarget.hasAttribute("plugin-contextmenu-parent"); if(ignoreDismissForRoot && isRoot) { return; } contextMenuStorage[currentTarget.id].dismiss(); if(!isRoot) { focusActiveMenuItem(currentTarget.getAttribute("plugin-contextmenu-parent")); } } ; function focusActiveMenuItem(menuId) { var menu = document.getElementById(menuId); menu.focus(); var menuItems = menu.getElementsByClassName("menuitem"); for(var i = 0; i < menuItems.length; i++) { var element = menuItems[i]; if(element.classList.contains("active")) { element.classList.remove("active"); element.focus(); } } } ; function showSubmenu(currentTarget) { if(!currentTarget.classList.contains("active")) { var submenuId = currentTarget.getAttribute("data-plugin-contextmenu"); if(submenuId !== null && typeof (submenuId) !== "undefined") { currentTarget.classList.add("active"); var submenu = document.getElementById(submenuId); submenu.style.zIndex = (parseInt(getComputedStyle(currentTarget.parentElement).getPropertyValue("z-index")) + 1).toString(); var parentWidth = parseInt(getComputedStyle(currentTarget.parentElement).getPropertyValue("width")); var xPosition = parentWidth + parseInt(getComputedStyle(currentTarget.parentElement).getPropertyValue("left")) - window.pageXOffset; var yPosition = currentTarget.offsetTop + parseInt(getComputedStyle(currentTarget.parentElement).getPropertyValue("top")) - window.pageYOffset; var parentWidthOffset = parentWidth - 3; adjustMenuItemWidth(submenu); _positionHelpers.show(submenu, null, xPosition, yPosition, currentTarget.offsetTop, parentWidthOffset, null, positionContextMenuInsideAirspace, host.show.bind(host)); } } } ; function onMenuItemKeyDown(event) { var target = event.target; switch(event.keyCode) { case 13: showSubmenu(target); target.click(); event.preventDefault(); event.stopImmediatePropagation(); break; case 39: showSubmenu(target); event.preventDefault(); event.stopImmediatePropagation(); break; } } ; function onContextMenuKeyDown(event) { var elementToFocus; var target = event.target; var currentTarget = event.currentTarget; var menuItems = currentTarget.getElementsByClassName("menuitem"); var startIndex = getMenuItemStartIndex(target, currentTarget, menuItems); switch(event.keyCode) { case 9: if(!event.shiftKey) { elementToFocus = getNextMenuItem(startIndex, menuItems); } else { elementToFocus = getPreviousMenuItem(startIndex, menuItems); } event.preventDefault(); break; case 18: dismissAll(); break; case 27: handleDismissCurrent(currentTarget, false); event.preventDefault(); break; case 35: elementToFocus = getPreviousMenuItem(0, menuItems); event.preventDefault(); break; case 36: elementToFocus = getNextMenuItem(0, menuItems); event.preventDefault(); break; case 37: handleDismissCurrent(currentTarget, true); event.preventDefault(); break; case 38: elementToFocus = getPreviousMenuItem(startIndex, menuItems); event.preventDefault(); break; case 40: elementToFocus = getNextMenuItem(startIndex, menuItems); event.preventDefault(); break; case 93: dismissAll(); event.preventDefault(); break; } if(elementToFocus) { elementToFocus.focus(); } } ; function onAttrModified(event) { if(event.attrName === "aria-checked" && event.attrChange === 1) { handlePopupMenuItemClick(event); } } ; })(Plugin.ContextMenu || (Plugin.ContextMenu = {})); var ContextMenu = Plugin.ContextMenu; })(Plugin || (Plugin = {})); (function baseInit(global, undefined) { "use strict"; function initializeProperties(target, members) { var keys = Object.keys(members); var properties; var i, len; for (i = 0, len = keys.length; i < len; i++) { var key = keys[i]; var enumerable = key.charCodeAt(0) !== /*_*/95; var member = members[key]; if (member && typeof member === 'object') { if (member.value !== undefined || typeof member.get === 'function' || typeof member.set === 'function') { if (member.enumerable === undefined) { member.enumerable = enumerable; } properties = properties || {}; properties[key] = member; continue; } } if (!enumerable) { properties = properties || {}; properties[key] = { value: member, enumerable: enumerable, configurable: true, writable: true } continue; } target[key] = member; } if (properties) { Object.defineProperties(target, properties); } } (function (rootNamespace) { // Create the rootNamespace in the global namespace if (!global[rootNamespace]) { global[rootNamespace] = Object.create(Object.prototype); } // Cache the rootNamespace we just created in a local variable var _rootNamespace = global[rootNamespace]; if (!_rootNamespace.Namespace) { _rootNamespace.Namespace = Object.create(Object.prototype); } function defineWithParent(parentNamespace, name, members) { /// /// /// Defines a new namespace with the specified name under the specified parent namespace. /// /// /// The parent namespace. /// /// /// The name of the new namespace. /// /// /// The members of the new namespace. /// /// /// The newly-defined namespace. /// /// var currentNamespace = parentNamespace, namespaceFragments = name.split("."); for (var i = 0, len = namespaceFragments.length; i < len; i++) { var namespaceName = namespaceFragments[i]; if (!currentNamespace[namespaceName]) { Object.defineProperty(currentNamespace, namespaceName, { value: {}, writable: false, enumerable: true, configurable: true } ); } currentNamespace = currentNamespace[namespaceName]; } if (members) { initializeProperties(currentNamespace, members); } return currentNamespace; } function define(name, members) { /// /// /// Defines a new namespace with the specified name. /// /// /// The name of the namespace. This could be a dot-separated name for nested namespaces. /// /// /// The members of the new namespace. /// /// /// The newly-defined namespace. /// /// return defineWithParent(global, name, members); } // Establish members of the "PluginUtilities.Namespace" namespace Object.defineProperties(_rootNamespace.Namespace, { defineWithParent: { value: defineWithParent, writable: true, enumerable: true, configurable: true }, define: { value: define, writable: true, enumerable: true, configurable: true } }); })("PluginUtilities"); (function (PluginUtilities) { function define(constructor, instanceMembers, staticMembers) { /// /// /// Defines a class using the given constructor and the specified instance members. /// /// /// A constructor function that is used to instantiate this class. /// /// /// The set of instance fields, properties, and methods made available on the class. /// /// /// The set of static fields, properties, and methods made available on the class. /// /// /// The newly-defined class. /// /// constructor = constructor || function () { }; PluginUtilities.Utilities.markSupportedForProcessing(constructor); if (instanceMembers) { initializeProperties(constructor.prototype, instanceMembers); } if (staticMembers) { initializeProperties(constructor, staticMembers); } return constructor; } function derive(baseClass, constructor, instanceMembers, staticMembers) { /// /// /// Creates a sub-class based on the supplied baseClass parameter, using prototypal inheritance. /// /// /// The class to inherit from. /// /// /// A constructor function that is used to instantiate this class. /// /// /// The set of instance fields, properties, and methods to be made available on the class. /// /// /// The set of static fields, properties, and methods to be made available on the class. /// /// /// The newly-defined class. /// /// if (baseClass) { constructor = constructor || function () { }; var basePrototype = baseClass.prototype; constructor.prototype = Object.create(basePrototype); PluginUtilities.Utilities.markSupportedForProcessing(constructor); Object.defineProperty(constructor.prototype, "constructor", { value: constructor, writable: true, configurable: true, enumerable: true }); if (instanceMembers) { initializeProperties(constructor.prototype, instanceMembers); } if (staticMembers) { initializeProperties(constructor, staticMembers); } return constructor; } else { return define(constructor, instanceMembers, staticMembers); } } function mix(constructor) { /// /// /// Defines a class using the given constructor and the union of the set of instance members /// specified by all the mixin objects. The mixin parameter list is of variable length. /// /// /// A constructor function that is used to instantiate this class. /// /// /// The newly-defined class. /// /// constructor = constructor || function () { }; var i, len; for (i = 1, len = arguments.length; i < len; i++) { initializeProperties(constructor.prototype, arguments[i]); } return constructor; } // Establish members of "PluginUtilities.Class" namespace PluginUtilities.Namespace.define("PluginUtilities.Class", { define: define, derive: derive, mix: mix }); })(PluginUtilities); })(this); (function baseUtilsInit(global, PluginUtilities) { "use strict"; var hasWinRT = !!global.Windows; var strings = { get notSupportedForProcessing() { return PluginUtilities.Resources._getPluginUtilitiesString("base/notSupportedForProcessing").value; } }; function nop(v) { return v; } function getMemberFiltered(name, root, filter) { return name.split(".").reduce(function (currentNamespace, name) { if (currentNamespace) { return filter(currentNamespace[name]); } return null; }, root); } // Establish members of "PluginUtilities.Utilities" namespace PluginUtilities.Namespace.define("PluginUtilities.Utilities", { // Used for mocking in tests _setHasWinRT: { value: function (value) { hasWinRT = value; }, configurable: false, writable: false, enumerable: false }, /// Determine if WinRT is accessible in this script context. hasWinRT: { get: function () { return hasWinRT; }, configurable: false, enumerable: true }, _getMemberFiltered: getMemberFiltered, getMember: function (name, root) { /// /// /// Gets the leaf-level type or namespace specified by the name parameter. /// /// /// The name of the member. /// /// /// The root to start in. Defaults to the global object. /// /// /// The leaf-level type or namespace in the specified parent namespace. /// /// if (!name) { return null; } return getMemberFiltered(name, root || global, nop); }, ready: function (callback, async) { /// /// /// Ensures that the specified function executes only after the DOMContentLoaded event has fired /// for the current page. /// /// A promise that completes after DOMContentLoaded has occurred. /// /// A function that executes after DOMContentLoaded has occurred. /// /// /// If true, the callback should be executed asynchronously. /// /// return new PluginUtilities.Promise(function (c, e) { function complete() { if (callback) { try { callback(); c(); } catch (err) { e(err); } } else { c(); } } var readyState = PluginUtilities.Utilities.testReadyState; if (!readyState) { if (global.document) { readyState = document.readyState; } else { readyState = "complete"; } } if (readyState === "complete" || (global.document && document.body !== null)) { if (async) { msSetImmediate(complete); } else { complete(); } } else { global.addEventListener("DOMContentLoaded", complete, false); } }); }, /// Determines if strict declarative processing is enabled in this script context. strictProcessing: { get: function () { return true; }, configurable: false, enumerable: true, }, markSupportedForProcessing: { value: function (func) { /// /// /// Marks a function as being compatible with declarative processing, such as PluginUtilities.UI.processAll /// or PluginUtilities.Binding.processAll. /// /// /// The function to be marked as compatible with declarative processing. /// /// /// The input function. /// /// func.supportedForProcessing = true; return func; }, configurable: false, writable: false, enumerable: true }, requireSupportedForProcessing: { value: function (value) { /// /// /// Asserts that the value is compatible with declarative processing, such as PluginUtilities.UI.processAll /// or PluginUtilities.Binding.processAll. If it is not compatible an exception will be thrown. /// /// /// The value to be tested for compatibility with declarative processing. If the /// value is a function it must be marked with a property 'supportedForProcessing' /// with a value of true. /// /// /// The input value. /// /// var supportedForProcessing = true; if (value === global) { supportedForProcessing = false; } else if (value instanceof Function && !value.supportedForProcessing) { supportedForProcessing = false; } if (supportedForProcessing) { return value; } throw new PluginUtilities.ErrorFromName("PluginUtilities.Utilities.requireSupportedForProcessing", PluginUtilities.Resources._formatString(strings.notSupportedForProcessing, value)); }, configurable: false, writable: false, enumerable: true }, }); PluginUtilities.Namespace.define("PluginUtilities", { validation: false, strictProcessing: { value: function () { /// /// /// Strict processing is always enforced, this method has no effect. /// /// }, configurable: false, writable: false, enumerable: false }, }); })(this, PluginUtilities); (function logInit() { "use strict"; var spaceR = /\s+/g; var typeR = /^(error|warn|info|log)$/; function format(message, tag, type) { /// /// /// Adds tags and type to a logging message. /// /// The message to be formatted. /// The tag(s) to be applied to the message. Multiple tags should be separated by spaces. /// The type of the message. /// The formatted message. /// var m = message; if (typeof (m) === "function") { m = m(); } return ((type && typeR.test(type)) ? ("") : (type ? (type + ": ") : "")) + (tag ? tag.replace(spaceR, ":") + ": " : "") + m; } function defAction(message, tag, type) { var m = PluginUtilities.Utilities.formatLog(message, tag, type); console[(type && typeR.test(type)) ? type : "log"](m); } function escape(s) { // \s (whitespace) is used as separator, so don't escape it return s.replace(/[-[\]{}()*+?.,\\^$|#]/g, "\\$&"); } PluginUtilities.Namespace.define("PluginUtilities.Utilities", { startLog: function (options) { /// /// /// Configures a logger that writes messages containing the specified tags from PluginUtilities.log to console.log. /// /// The tags for messages to log. Multiple tags should be separated by spaces. /// /// /// /// Configure a logger to write PluginUtilities.log output. /// /// /// May contain .type, .tags, .excludeTags and .action properties. /// - .type is a required tag. /// - .excludeTags is a space-separated list of tags, any of which will result in a message not being logged. /// - .tags is a space-separated list of tags, any of which will result in a message being logged. /// - .action is a function that, if present, will be called with the log message, tags and type. The default is to log to the console. /// /// options = options || {}; if (typeof options === "string") { options = { tags: options }; } var el = options.type && new RegExp("^(" + escape(options.type).replace(spaceR, " ").split(" ").join("|") + ")$"); var not = options.excludeTags && new RegExp("(^|\\s)(" + escape(options.excludeTags).replace(spaceR, " ").split(" ").join("|") + ")(\\s|$)", "i"); var has = options.tags && new RegExp("(^|\\s)(" + escape(options.tags).replace(spaceR, " ").split(" ").join("|") + ")(\\s|$)", "i"); var action = options.action || defAction; if (!el && !not && !has && !PluginUtilities.log) { PluginUtilities.log = action; return; } var result = function (message, tag, type) { if (!((el && !el.test(type)) // if the expected log level is not satisfied || (not && not.test(tag)) // if any of the excluded categories exist || (has && !has.test(tag)))) { // if at least one of the included categories doesn't exist action(message, tag, type); } result.next && result.next(message, tag, type); }; result.next = PluginUtilities.log; PluginUtilities.log = result; }, stopLog: function () { /// /// /// Removes the previously set up logger. /// /// delete PluginUtilities.log; }, formatLog: format }); })(); (function eventsInit(PluginUtilities, undefined) { "use strict"; function createEventProperty(name) { var eventPropStateName = "_on" + name + "state"; return { get: function () { var state = this[eventPropStateName]; return state && state.userHandler; }, set: function (handler) { var state = this[eventPropStateName]; if (handler) { if (!state) { state = { wrapper: function (evt) { return state.userHandler(evt); }, userHandler: handler }; Object.defineProperty(this, eventPropStateName, { value: state, enumerable: false, writable: true, configurable: true }); this.addEventListener(name, state.wrapper, false); } state.userHandler = handler; } else if (state) { this.removeEventListener(name, state.wrapper, false); this[eventPropStateName] = null; } }, enumerable: true } } function createEventProperties(events) { /// /// /// Creates an object that has one property for each name passed to the function. /// /// /// A variable list of property names. /// /// /// The object with the specified properties. The names of the properties are prefixed with 'on'. /// /// var props = {}; for (var i = 0, len = arguments.length; i < len; i++) { var name = arguments[i]; props["on" + name] = createEventProperty(name); } return props; } var EventMixinEvent = PluginUtilities.Class.define( function EventMixinEvent_ctor(type, detail, target) { this.detail = detail; this.target = target; this.timeStamp = Date.now(); this.type = type; }, { bubbles: { value: false, writable: false }, cancelable: { value: false, writable: false }, currentTarget: { get: function () { return this.target; } }, defaultPrevented: { get: function () { return this._preventDefaultCalled; } }, trusted: { value: false, writable: false }, eventPhase: { value: 0, writable: false }, target: null, timeStamp: null, type: null, preventDefault: function () { this._preventDefaultCalled = true; }, stopImmediatePropagation: function () { this._stopImmediatePropagationCalled = true; }, stopPropagation: function () { } }, { supportedForProcessing: false, } ); var eventMixin = { _listeners: null, addEventListener: function (type, listener, useCapture) { /// /// /// Adds an event listener to the control. /// /// /// The type (name) of the event. /// /// /// The listener to invoke when the event gets raised. /// /// /// if true initiates capture, otherwise false. /// /// useCapture = useCapture || false; this._listeners = this._listeners || {}; var eventListeners = (this._listeners[type] = this._listeners[type] || []); for (var i = 0, len = eventListeners.length; i < len; i++) { var l = eventListeners[i]; if (l.useCapture === useCapture && l.listener === listener) { return; } } eventListeners.push({ listener: listener, useCapture: useCapture }); }, dispatchEvent: function (type, details) { /// /// /// Raises an event of the specified type and with the specified additional properties. /// /// /// The type (name) of the event. /// /// /// The set of additional properties to be attached to the event object when the event is raised. /// /// /// true if preventDefault was called on the event. /// /// var listeners = this._listeners && this._listeners[type]; if (listeners) { var eventValue = new EventMixinEvent(type, details, this); // Need to copy the array to protect against people unregistering while we are dispatching listeners = listeners.slice(0, listeners.length); for (var i = 0, len = listeners.length; i < len && !eventValue._stopImmediatePropagationCalled; i++) { listeners[i].listener(eventValue); } return eventValue.defaultPrevented || false; } return false; }, removeEventListener: function (type, listener, useCapture) { /// /// /// Removes an event listener from the control. /// /// /// The type (name) of the event. /// /// /// The listener to remove. /// /// /// Specifies whether to initiate capture. /// /// useCapture = useCapture || false; var listeners = this._listeners && this._listeners[type]; if (listeners) { for (var i = 0, len = listeners.length; i < len; i++) { var l = listeners[i]; if (l.listener === listener && l.useCapture === useCapture) { listeners.splice(i, 1); if (listeners.length === 0) { delete this._listeners[type]; } // Only want to remove one element for each call to removeEventListener break; } } } } }; PluginUtilities.Namespace.define("PluginUtilities.Utilities", { _createEventProperty: createEventProperty, createEventProperties: createEventProperties, eventMixin: eventMixin }); })(PluginUtilities); (function promiseInit(global, undefined) { "use strict"; global.Debug && (global.Debug.setNonUserCodeExceptions = true); var ListenerType = PluginUtilities.Class.mix(PluginUtilities.Class.define(null, { /*empty*/ }, { supportedForProcessing: false }), PluginUtilities.Utilities.eventMixin); var promiseEventListeners = new ListenerType(); // make sure there is a listeners collection so that we can do a more trivial check below promiseEventListeners._listeners = {}; var errorET = "error"; var canceledName = "Canceled"; var tagWithStack = false; var tag = { promise: 0x01, thenPromise: 0x02, errorPromise: 0x04, exceptionPromise: 0x08, completePromise: 0x10, }; tag.all = tag.promise | tag.thenPromise | tag.errorPromise | tag.exceptionPromise | tag.completePromise; // // Global error counter, for each error which enters the system we increment this once and then // the error number travels with the error as it traverses the tree of potential handlers. // // When someone has registered to be told about errors (PluginUtilities.Promise.callonerror) promises // which are in error will get tagged with a ._errorId field. This tagged field is the // contract by which nested promises with errors will be identified as chaining for the // purposes of the callonerror semantics. If a nested promise in error is encountered without // a ._errorId it will be assumed to be foreign and treated as an interop boundary and // a new error id will be minted. // var error_number = 1; // // The state machine has a interesting hiccup in it with regards to notification, in order // to flatten out notification and avoid recursion for synchronous completion we have an // explicit set of *_notify states which are responsible for notifying their entire tree // of children. They can do this because they know that immediate children are always // ThenPromise instances and we can therefore reach into their state to access the // _listeners collection. // // So, what happens is that a Promise will be fulfilled through the _completed or _error // messages at which point it will enter a *_notify state and be responsible for to move // its children into an (as appropriate) success or error state and also notify that child's // listeners of the state transition, until leaf notes are reached. // var state_created, // -> working state_working, // -> error | error_notify | success | success_notify | canceled | waiting state_waiting, // -> error | error_notify | success | success_notify | waiting_canceled state_waiting_canceled, // -> error | error_notify | success | success_notify | canceling state_canceled, // -> error | error_notify | success | success_notify | canceling state_canceling, // -> error_notify state_success_notify, // -> success state_success, // -> . state_error_notify, // -> error state_error; // -> . // Noop function, used in the various states to indicate that they don't support a given // message. Named with the somewhat cute name '_' because it reads really well in the states. function _() { } // Initial state // state_created = { name: "created", enter: function (promise) { promise._setState(state_working); }, cancel: _, done: _, then: _, _completed: _, _error: _, _notify: _, _progress: _, _setCompleteValue: _, _setErrorValue: _ }; // Ready state, waiting for a message (completed/error/progress), able to be canceled // state_working = { name: "working", enter: _, cancel: function (promise) { promise._setState(state_canceled); }, done: done, then: then, _completed: completed, _error: error, _notify: _, _progress: progress, _setCompleteValue: setCompleteValue, _setErrorValue: setErrorValue }; // Waiting state, if a promise is completed with a value which is itself a promise // (has a then() method) it signs up to be informed when that child promise is // fulfilled at which point it will be fulfilled with that value. // state_waiting = { name: "waiting", enter: function (promise) { var waitedUpon = promise._value; var error = function (value) { if (waitedUpon._errorId) { promise._chainedError(value, waitedUpon); } else { // Because this is an interop boundary we want to indicate that this // error has been handled by the promise infrastructure before we // begin a new handling chain. // callonerror(promise, value, detailsForHandledError, waitedUpon, error); promise._error(value); } }; error.handlesOnError = true; waitedUpon.then( promise._completed.bind(promise), error, promise._progress.bind(promise) ); }, cancel: function (promise) { promise._setState(state_waiting_canceled); }, done: done, then: then, _completed: completed, _error: error, _notify: _, _progress: progress, _setCompleteValue: setCompleteValue, _setErrorValue: setErrorValue }; // Waiting canceled state, when a promise has been in a waiting state and receives a // request to cancel its pending work it will forward that request to the child promise // and then waits to be informed of the result. This promise moves itself into the // canceling state but understands that the child promise may instead push it to a // different state. // state_waiting_canceled = { name: "waiting_canceled", enter: function (promise) { // Initiate a transition to canceling. Triggering a cancel on the promise // that we are waiting upon may result in a different state transition // before the state machine pump runs again. promise._setState(state_canceling); var waitedUpon = promise._value; if (waitedUpon.cancel) { waitedUpon.cancel(); } }, cancel: _, done: done, then: then, _completed: completed, _error: error, _notify: _, _progress: progress, _setCompleteValue: setCompleteValue, _setErrorValue: setErrorValue }; // Canceled state, moves to the canceling state and then tells the promise to do // whatever it might need to do on cancelation. // state_canceled = { name: "canceled", enter: function (promise) { // Initiate a transition to canceling. The _cancelAction may change the state // before the state machine pump runs again. promise._setState(state_canceling); promise._cancelAction(); }, cancel: _, done: done, then: then, _completed: completed, _error: error, _notify: _, _progress: progress, _setCompleteValue: setCompleteValue, _setErrorValue: setErrorValue }; // Canceling state, commits to the promise moving to an error state with an error // object whose 'name' and 'message' properties contain the string "Canceled" // state_canceling = { name: "canceling", enter: function (promise) { var error = new Error(canceledName); error.name = error.message; promise._value = error; promise._setState(state_error_notify); }, cancel: _, done: _, then: _, _completed: _, _error: _, _notify: _, _progress: _, _setCompleteValue: _, _setErrorValue: _ }; // Success notify state, moves a promise to the success state and notifies all children // state_success_notify = { name: "complete_notify", enter: function (promise) { promise.done = CompletePromise.prototype.done; promise.then = CompletePromise.prototype.then; if (promise._listeners) { var queue = [promise]; var p; while (queue.length) { p = queue.pop(); p._state._notify(p, queue); } } promise._setState(state_success); }, cancel: _, done: null, /*error to get here */ then: null, /*error to get here */ _completed: _, _error: _, _notify: notifySuccess, _progress: _, _setCompleteValue: _, _setErrorValue: _ }; // Success state, moves a promise to the success state and does NOT notify any children. // Some upstream promise is owning the notification pass. // state_success = { name: "success", enter: function (promise) { promise.done = CompletePromise.prototype.done; promise.then = CompletePromise.prototype.then; promise._cleanupAction(); }, cancel: _, done: null, /*error to get here */ then: null, /*error to get here */ _completed: _, _error: _, _notify: notifySuccess, _progress: _, _setCompleteValue: _, _setErrorValue: _ }; // Error notify state, moves a promise to the error state and notifies all children // state_error_notify = { name: "error_notify", enter: function (promise) { promise.done = ErrorPromise.prototype.done; promise.then = ErrorPromise.prototype.then; if (promise._listeners) { var queue = [promise]; var p; while (queue.length) { p = queue.pop(); p._state._notify(p, queue); } } promise._setState(state_error); }, cancel: _, done: null, /*error to get here*/ then: null, /*error to get here*/ _completed: _, _error: _, _notify: notifyError, _progress: _, _setCompleteValue: _, _setErrorValue: _ }; // Error state, moves a promise to the error state and does NOT notify any children. // Some upstream promise is owning the notification pass. // state_error = { name: "error", enter: function (promise) { promise.done = ErrorPromise.prototype.done; promise.then = ErrorPromise.prototype.then; promise._cleanupAction(); }, cancel: _, done: null, /*error to get here*/ then: null, /*error to get here*/ _completed: _, _error: _, _notify: notifyError, _progress: _, _setCompleteValue: _, _setErrorValue: _ }; // // The statemachine implementation follows a very particular pattern, the states are specified // as static stateless bags of functions which are then indirected through the state machine // instance (a Promise). As such all of the functions on each state have the promise instance // passed to them explicitly as a parameter and the Promise instance members do a little // dance where they indirect through the state and insert themselves in the argument list. // // We could instead call directly through the promise states however then every caller // would have to remember to do things like pumping the state machine to catch state transitions. // var PromiseStateMachine = PluginUtilities.Class.define(null, { _listeners: null, _nextState: null, _state: null, _value: null, cancel: function () { /// /// /// Attempts to cancel the fulfillment of a promised value. If the promise hasn't /// already been fulfilled and cancellation is supported, the promise enters /// the error state with a value of Error("Canceled"). /// /// this._state.cancel(this); this._run(); }, done: function Promise_done(onComplete, onError, onProgress) { /// /// /// Allows you to specify the work to be done on the fulfillment of the promised value, /// the error handling to be performed if the promise fails to fulfill /// a value, and the handling of progress notifications along the way. /// /// After the handlers have finished executing, this function throws any error that would have been returned /// from then() as a promise in the error state. /// /// /// The function to be called if the promise is fulfilled successfully with a value. /// The fulfilled value is passed as the single argument. If the value is null, /// the fulfilled value is returned. The value returned /// from the function becomes the fulfilled value of the promise returned by /// then(). If an exception is thrown while executing the function, the promise returned /// by then() moves into the error state. /// /// /// The function to be called if the promise is fulfilled with an error. The error /// is passed as the single argument. If it is null, the error is forwarded. /// The value returned from the function is the fulfilled value of the promise returned by then(). /// /// /// the function to be called if the promise reports progress. Data about the progress /// is passed as the single argument. Promises are not required to support /// progress. /// /// this._state.done(this, onComplete, onError, onProgress); }, then: function Promise_then(onComplete, onError, onProgress) { /// /// /// Allows you to specify the work to be done on the fulfillment of the promised value, /// the error handling to be performed if the promise fails to fulfill /// a value, and the handling of progress notifications along the way. /// /// /// The function to be called if the promise is fulfilled successfully with a value. /// The value is passed as the single argument. If the value is null, the value is returned. /// The value returned from the function becomes the fulfilled value of the promise returned by /// then(). If an exception is thrown while this function is being executed, the promise returned /// by then() moves into the error state. /// /// /// The function to be called if the promise is fulfilled with an error. The error /// is passed as the single argument. If it is null, the error is forwarded. /// The value returned from the function becomes the fulfilled value of the promise returned by then(). /// /// /// The function to be called if the promise reports progress. Data about the progress /// is passed as the single argument. Promises are not required to support /// progress. /// /// /// The promise whose value is the result of executing the complete or /// error function. /// /// return this._state.then(this, onComplete, onError, onProgress); }, _chainedError: function (value, context) { var result = this._state._error(this, value, detailsForChainedError, context); this._run(); return result; }, _completed: function (value) { var result = this._state._completed(this, value); this._run(); return result; }, _error: function (value) { var result = this._state._error(this, value, detailsForError); this._run(); return result; }, _progress: function (value) { this._state._progress(this, value); }, _setState: function (state) { this._nextState = state; }, _setCompleteValue: function (value) { this._state._setCompleteValue(this, value); this._run(); }, _setChainedErrorValue: function (value, context) { var result = this._state._setErrorValue(this, value, detailsForChainedError, context); this._run(); return result; }, _setExceptionValue: function (value) { var result = this._state._setErrorValue(this, value, detailsForException); this._run(); return result; }, _run: function () { while (this._nextState) { this._state = this._nextState; this._nextState = null; this._state.enter(this); } } }, { supportedForProcessing: false }); // // Implementations of shared state machine code. // function completed(promise, value) { var targetState; if (value && typeof value === "object" && typeof value.then === "function") { targetState = state_waiting; } else { targetState = state_success_notify; } promise._value = value; promise._setState(targetState); } function createErrorDetails(exception, error, promise, id, parent, handler) { return { exception: exception, error: error, promise: promise, handler: handler, id: id, parent: parent }; } function detailsForHandledError(promise, errorValue, context, handler) { var exception = context._isException; var errorId = context._errorId; return createErrorDetails( exception ? errorValue : null, exception ? null : errorValue, promise, errorId, context, handler ); } function detailsForChainedError(promise, errorValue, context) { var exception = context._isException; var errorId = context._errorId; setErrorInfo(promise, errorId, exception); return createErrorDetails( exception ? errorValue : null, exception ? null : errorValue, promise, errorId, context ); } function detailsForError(promise, errorValue) { var errorId = ++error_number; setErrorInfo(promise, errorId); return createErrorDetails( null, errorValue, promise, errorId ); } function detailsForException(promise, exceptionValue) { var errorId = ++error_number; setErrorInfo(promise, errorId, true); return createErrorDetails( exceptionValue, null, promise, errorId ); } function done(promise, onComplete, onError, onProgress) { pushListener(promise, { c: onComplete, e: onError, p: onProgress }); } function error(promise, value, onerrorDetails, context) { promise._value = value; callonerror(promise, value, onerrorDetails, context); promise._setState(state_error_notify); } function notifySuccess(promise, queue) { var value = promise._value; var listeners = promise._listeners; if (!listeners) { return; } promise._listeners = null; var i, len; for (i = 0, len = Array.isArray(listeners) ? listeners.length : 1; i < len; i++) { var listener = len === 1 ? listeners : listeners[i]; var onComplete = listener.c; var target = listener.promise; if (target) { try { target._setCompleteValue(onComplete ? onComplete(value) : value); } catch (ex) { target._setExceptionValue(ex); } if (target._state !== state_waiting && target._listeners) { queue.push(target); } } else { CompletePromise.prototype.done.call(promise, onComplete); } } } function notifyError(promise, queue) { var value = promise._value; var listeners = promise._listeners; if (!listeners) { return; } promise._listeners = null; var i, len; for (i = 0, len = Array.isArray(listeners) ? listeners.length : 1; i < len; i++) { var listener = len === 1 ? listeners : listeners[i]; var onError = listener.e; var target = listener.promise; if (target) { try { if (onError) { if (!onError.handlesOnError) { callonerror(target, value, detailsForHandledError, promise, onError); } target._setCompleteValue(onError(value)) } else { target._setChainedErrorValue(value, promise); } } catch (ex) { target._setExceptionValue(ex); } if (target._state !== state_waiting && target._listeners) { queue.push(target); } } else { ErrorPromise.prototype.done.call(promise, null, onError); } } } function callonerror(promise, value, onerrorDetailsGenerator, context, handler) { if (promiseEventListeners._listeners[errorET]) { if (value instanceof Error && value.message === canceledName) { return; } promiseEventListeners.dispatchEvent(errorET, onerrorDetailsGenerator(promise, value, context, handler)); } } function progress(promise, value) { var listeners = promise._listeners; if (listeners) { var i, len; for (i = 0, len = Array.isArray(listeners) ? listeners.length : 1; i < len; i++) { var listener = len === 1 ? listeners : listeners[i]; var onProgress = listener.p; if (onProgress) { try { onProgress(value); } catch (ex) { } } if (!(listener.c || listener.e) && listener.promise) { listener.promise._progress(value); } } } } function pushListener(promise, listener) { var listeners = promise._listeners; if (listeners) { // We may have either a single listener (which will never be wrapped in an array) // or 2+ listeners (which will be wrapped). Since we are now adding one more listener // we may have to wrap the single listener before adding the second. listeners = Array.isArray(listeners) ? listeners : [listeners]; listeners.push(listener); } else { listeners = listener; } promise._listeners = listeners; } // The difference beween setCompleteValue()/setErrorValue() and complete()/error() is that setXXXValue() moves // a promise directly to the success/error state without starting another notification pass (because one // is already ongoing). function setErrorInfo(promise, errorId, isException) { promise._isException = isException || false; promise._errorId = errorId; } function setErrorValue(promise, value, onerrorDetails, context) { promise._value = value; callonerror(promise, value, onerrorDetails, context); promise._setState(state_error); } function setCompleteValue(promise, value) { var targetState; if (value && typeof value === "object" && typeof value.then === "function") { targetState = state_waiting; } else { targetState = state_success; } promise._value = value; promise._setState(targetState); } function then(promise, onComplete, onError, onProgress) { var result = new ThenPromise(promise); pushListener(promise, { promise: result, c: onComplete, e: onError, p: onProgress }); return result; } // // Internal implementation detail promise, ThenPromise is created when a promise needs // to be returned from a then() method. // var ThenPromise = PluginUtilities.Class.derive(PromiseStateMachine, function (creator) { if (tagWithStack && (tagWithStack === true || (tagWithStack & tag.thenPromise))) { this._stack = PluginUtilities.Promise._getStack(); } this._creator = creator; this._setState(state_created); this._run(); }, { _creator: null, _cancelAction: function () { if (this._creator) { this._creator.cancel(); } }, _cleanupAction: function () { this._creator = null; } }, { supportedForProcessing: false } ); // // Slim promise implementations for already completed promises, these are created // under the hood on synchronous completion paths as well as by PluginUtilities.Promise.wrap // and PluginUtilities.Promise.wrapError. // var ErrorPromise = PluginUtilities.Class.define( function ErrorPromise_ctor(value) { if (tagWithStack && (tagWithStack === true || (tagWithStack & tag.errorPromise))) { this._stack = PluginUtilities.Promise._getStack(); } this._value = value; callonerror(this, value, detailsForError); }, { cancel: function () { /// /// /// Attempts to cancel the fulfillment of a promised value. If the promise hasn't /// already been fulfilled and cancellation is supported, the promise enters /// the error state with a value of Error("Canceled"). /// /// }, done: function ErrorPromise_done(unused, onError) { /// /// /// Allows you to specify the work to be done on the fulfillment of the promised value, /// the error handling to be performed if the promise fails to fulfill /// a value, and the handling of progress notifications along the way. /// /// After the handlers have finished executing, this function throws any error that would have been returned /// from then() as a promise in the error state. /// /// /// The function to be called if the promise is fulfilled successfully with a value. /// The fulfilled value is passed as the single argument. If the value is null, /// the fulfilled value is returned. The value returned /// from the function becomes the fulfilled value of the promise returned by /// then(). If an exception is thrown while executing the function, the promise returned /// by then() moves into the error state. /// /// /// The function to be called if the promise is fulfilled with an error. The error /// is passed as the single argument. If it is null, the error is forwarded. /// The value returned from the function is the fulfilled value of the promise returned by then(). /// /// /// the function to be called if the promise reports progress. Data about the progress /// is passed as the single argument. Promises are not required to support /// progress. /// /// var value = this._value; if (onError) { try { if (!onError.handlesOnError) { callonerror(null, value, detailsForHandledError, this, onError); } var result = onError(value); if (result && typeof result === "object" && typeof result.done === "function") { // If a promise is returned we need to wait on it. result.done(); } return; } catch (ex) { value = ex; } } if (value instanceof Error && value.message === canceledName) { // suppress cancel return; } // force the exception to be thrown asyncronously to avoid any try/catch blocks // msSetImmediate(function () { throw value; }); }, then: function ErrorPromise_then(unused, onError) { /// /// /// Allows you to specify the work to be done on the fulfillment of the promised value, /// the error handling to be performed if the promise fails to fulfill /// a value, and the handling of progress notifications along the way. /// /// /// The function to be called if the promise is fulfilled successfully with a value. /// The value is passed as the single argument. If the value is null, the value is returned. /// The value returned from the function becomes the fulfilled value of the promise returned by /// then(). If an exception is thrown while this function is being executed, the promise returned /// by then() moves into the error state. /// /// /// The function to be called if the promise is fulfilled with an error. The error /// is passed as the single argument. If it is null, the error is forwarded. /// The value returned from the function becomes the fulfilled value of the promise returned by then(). /// /// /// The function to be called if the promise reports progress. Data about the progress /// is passed as the single argument. Promises are not required to support /// progress. /// /// /// The promise whose value is the result of executing the complete or /// error function. /// /// // If the promise is already in a error state and no error handler is provided // we optimize by simply returning the promise instead of creating a new one. // if (!onError) { return this; } var result; var value = this._value; try { if (!onError.handlesOnError) { callonerror(null, value, detailsForHandledError, this, onError); } result = new CompletePromise(onError(value)); } catch (ex) { // If the value throw from the error handler is the same as the value // provided to the error handler then there is no need for a new promise. // if (ex === value) { result = this; } else { result = new ExceptionPromise(ex); } } return result; } }, { supportedForProcessing: false } ); var ExceptionPromise = PluginUtilities.Class.derive(ErrorPromise, function ExceptionPromise_ctor(value) { if (tagWithStack && (tagWithStack === true || (tagWithStack & tag.exceptionPromise))) { this._stack = PluginUtilities.Promise._getStack(); } this._value = value; callonerror(this, value, detailsForException); }, { /* empty */ }, { supportedForProcessing: false } ); var CompletePromise = PluginUtilities.Class.define( function CompletePromise_ctor(value) { if (tagWithStack && (tagWithStack === true || (tagWithStack & tag.completePromise))) { this._stack = PluginUtilities.Promise._getStack(); } if (value && typeof value === "object" && typeof value.then === "function") { var result = new ThenPromise(null); result._setCompleteValue(value); return result; } this._value = value; }, { cancel: function () { /// /// /// Attempts to cancel the fulfillment of a promised value. If the promise hasn't /// already been fulfilled and cancellation is supported, the promise enters /// the error state with a value of Error("Canceled"). /// /// }, done: function CompletePromise_done(onComplete) { /// /// /// Allows you to specify the work to be done on the fulfillment of the promised value, /// the error handling to be performed if the promise fails to fulfill /// a value, and the handling of progress notifications along the way. /// /// After the handlers have finished executing, this function throws any error that would have been returned /// from then() as a promise in the error state. /// /// /// The function to be called if the promise is fulfilled successfully with a value. /// The fulfilled value is passed as the single argument. If the value is null, /// the fulfilled value is returned. The value returned /// from the function becomes the fulfilled value of the promise returned by /// then(). If an exception is thrown while executing the function, the promise returned /// by then() moves into the error state. /// /// /// The function to be called if the promise is fulfilled with an error. The error /// is passed as the single argument. If it is null, the error is forwarded. /// The value returned from the function is the fulfilled value of the promise returned by then(). /// /// /// the function to be called if the promise reports progress. Data about the progress /// is passed as the single argument. Promises are not required to support /// progress. /// /// if (!onComplete) { return; } try { var result = onComplete(this._value); if (result && typeof result === "object" && typeof result.done === "function") { result.done(); } } catch (ex) { // force the exception to be thrown asynchronously to avoid any try/catch blocks msSetImmediate(function () { throw ex; }); } }, then: function CompletePromise_then(onComplete) { /// /// /// Allows you to specify the work to be done on the fulfillment of the promised value, /// the error handling to be performed if the promise fails to fulfill /// a value, and the handling of progress notifications along the way. /// /// /// The function to be called if the promise is fulfilled successfully with a value. /// The value is passed as the single argument. If the value is null, the value is returned. /// The value returned from the function becomes the fulfilled value of the promise returned by /// then(). If an exception is thrown while this function is being executed, the promise returned /// by then() moves into the error state. /// /// /// The function to be called if the promise is fulfilled with an error. The error /// is passed as the single argument. If it is null, the error is forwarded. /// The value returned from the function becomes the fulfilled value of the promise returned by then(). /// /// /// The function to be called if the promise reports progress. Data about the progress /// is passed as the single argument. Promises are not required to support /// progress. /// /// /// The promise whose value is the result of executing the complete or /// error function. /// /// try { // If the value returned from the completion handler is the same as the value // provided to the completion handler then there is no need for a new promise. // var newValue = onComplete ? onComplete(this._value) : this._value; return newValue === this._value ? this : new CompletePromise(newValue); } catch (ex) { return new ExceptionPromise(ex); } } }, { supportedForProcessing: false } ); // // Promise is the user-creatable PluginUtilities.Promise object. // function timeout(timeoutMS) { var id; return new PluginUtilities.Promise( function (c) { if (timeoutMS) { id = setTimeout(c, timeoutMS); } else { msSetImmediate(c); } }, function () { if (id) { clearTimeout(id); } } ); } function timeoutWithPromise(timeout, promise) { var cancelPromise = function () { promise.cancel(); } var cancelTimeout = function () { timeout.cancel(); } timeout.then(cancelPromise); promise.then(cancelTimeout, cancelTimeout); return promise; } var staticCanceledPromise; var Promise = PluginUtilities.Class.derive(PromiseStateMachine, function Promise_ctor(init, oncancel) { /// /// /// A promise provides a mechanism to schedule work to be done on a value that /// has not yet been computed. It is a convenient abstraction for managing /// interactions with asynchronous APIs. /// /// /// The function that is called during construction of the promise. The function /// is given three arguments (complete, error, progress). Inside this function /// you should add event listeners for the notifications supported by this value. /// /// /// The function to call if a consumer of this promise wants /// to cancel its undone work. Promises are not required to /// support cancellation. /// /// if (tagWithStack && (tagWithStack === true || (tagWithStack & tag.promise))) { this._stack = PluginUtilities.Promise._getStack(); } this._oncancel = oncancel; this._setState(state_created); this._run(); try { var complete = this._completed.bind(this); var error = this._error.bind(this); var progress = this._progress.bind(this); init(complete, error, progress); } catch (ex) { this._setExceptionValue(ex); } }, { _oncancel: null, _cancelAction: function () { if (this._oncancel) { try { this._oncancel(); } catch (ex) { } } }, _cleanupAction: function () { this._oncancel = null; } }, { addEventListener: function Promise_addEventListener(eventType, listener, capture) { /// /// /// Adds an event listener to the control. /// /// /// The type (name) of the event. /// /// /// The listener to invoke when the event is raised. /// /// /// Specifies whether or not to initiate capture. /// /// promiseEventListeners.addEventListener(eventType, listener, capture); }, any: function Promise_any(values) { /// /// /// Returns a promise that is fulfilled when one of the input promises /// has been fulfilled. /// /// /// An array that contains promise objects or objects whose property /// values include promise objects. /// /// /// A promise that on fulfillment yields the value of the input (complete or error). /// /// return new Promise( function (complete, error, progress) { var keys = Object.keys(values); var errors = Array.isArray(values) ? [] : {}; if (keys.length === 0) { complete(); } var canceled = 0; keys.forEach(function (key) { Promise.as(values[key]).then( function () { complete({ key: key, value: values[key] }); }, function (e) { if (e instanceof Error && e.name === canceledName) { if ((++canceled) === keys.length) { complete(PluginUtilities.Promise.cancel); } return; } error({ key: key, value: values[key] }); } ); }); }, function () { var keys = Object.keys(values); keys.forEach(function (key) { var promise = Promise.as(values[key]); if (typeof promise.cancel === "function") { promise.cancel(); } }); } ); }, as: function Promise_as(value) { /// /// /// Returns a promise. If the object is already a promise it is returned; /// otherwise the object is wrapped in a promise. /// /// /// The value to be treated as a promise. /// /// /// A promise. /// /// if (value && typeof value === "object" && typeof value.then === "function") { return value; } return new CompletePromise(value); }, /// /// Canceled promise value, can be returned from a promise completion handler /// to indicate cancelation of the promise chain. /// cancel: { get: function () { return (staticCanceledPromise = staticCanceledPromise || new ErrorPromise(new PluginUtilities.ErrorFromName(canceledName))); } }, dispatchEvent: function Promise_dispatchEvent(eventType, details) { /// /// /// Raises an event of the specified type and properties. /// /// /// The type (name) of the event. /// /// /// The set of additional properties to be attached to the event object. /// /// /// Specifies whether preventDefault was called on the event. /// /// return promiseEventListeners.dispatchEvent(eventType, details); }, is: function Promise_is(value) { /// /// /// Determines whether a value fulfills the promise contract. /// /// /// A value that may be a promise. /// /// /// true if the specified value is a promise, otherwise false. /// /// return value && typeof value === "object" && typeof value.then === "function"; }, join: function Promise_join(values) { /// /// /// Creates a promise that is fulfilled when all the values are fulfilled. /// /// /// An object whose fields contain values, some of which may be promises. /// /// /// A promise whose value is an object with the same field names as those of the object in the values parameter, where /// each field value is the fulfilled value of a promise. /// /// return new Promise( function (complete, error, progress) { var keys = Object.keys(values); var errors = Array.isArray(values) ? [] : {}; var results = Array.isArray(values) ? [] : {}; var undefineds = 0; var pending = keys.length; var argDone = function (key) { if ((--pending) === 0) { var errorCount = Object.keys(errors).length; if (errorCount === 0) { complete(results); } else { var canceledCount = 0; keys.forEach(function (key) { var e = errors[key]; if (e instanceof Error && e.name === canceledName) { canceledCount++; } }); if (canceledCount === errorCount) { complete(PluginUtilities.Promise.cancel); } else { error(errors); } } } else { progress({ Key: key, Done: true }); } }; keys.forEach(function (key) { var value = values[key]; if (value === undefined) { undefineds++; } else { Promise.then(value, function (value) { results[key] = value; argDone(key); }, function (value) { errors[key] = value; argDone(key); } ); } }); pending -= undefineds; if (pending === 0) { complete(results); return; } }, function () { Object.keys(values).forEach(function (key) { var promise = Promise.as(values[key]); if (typeof promise.cancel === "function") { promise.cancel(); } }); } ); }, removeEventListener: function Promise_removeEventListener(eventType, listener, capture) { /// /// /// Removes an event listener from the control. /// /// /// The type (name) of the event. /// /// /// The listener to remove. /// /// /// Specifies whether or not to initiate capture. /// /// promiseEventListeners.removeEventListener(eventType, listener, capture); }, supportedForProcessing: false, then: function Promise_then(value, onComplete, onError, onProgress) { /// /// /// A static version of the promise instance method then(). /// /// /// the value to be treated as a promise. /// /// /// The function to be called if the promise is fulfilled with a value. /// If it is null, the promise simply /// returns the value. The value is passed as the single argument. /// /// /// The function to be called if the promise is fulfilled with an error. The error /// is passed as the single argument. /// /// /// The function to be called if the promise reports progress. Data about the progress /// is passed as the single argument. Promises are not required to support /// progress. /// /// /// A promise whose value is the result of executing the provided complete function. /// /// return Promise.as(value).then(onComplete, onError, onProgress); }, thenEach: function Promise_thenEach(values, onComplete, onError, onProgress) { /// /// /// Performs an operation on all the input promises and returns a promise /// that has the shape of the input and contains the result of the operation /// that has been performed on each input. /// /// /// A set of values (which could be either an array or an object) of which some or all are promises. /// /// /// The function to be called if the promise is fulfilled with a value. /// If the value is null, the promise returns the value. /// The value is passed as the single argument. /// /// /// The function to be called if the promise is fulfilled with an error. The error /// is passed as the single argument. /// /// /// The function to be called if the promise reports progress. Data about the progress /// is passed as the single argument. Promises are not required to support /// progress. /// /// /// A promise that is the result of calling Promise.join on the values parameter. /// /// var result = Array.isArray(values) ? [] : {}; Object.keys(values).forEach(function (key) { result[key] = Promise.as(values[key]).then(onComplete, onError, onProgress); }); return Promise.join(result); }, timeout: function Promise_timeout(time, promise) { /// /// /// Creates a promise that is fulfilled after a timeout. /// /// /// The timeout period in milliseconds. If this value is zero or not specified /// msSetImmediate is called, otherwise setTimeout is called. /// /// /// A promise that will be canceled if it doesn't complete before the /// timeout has expired. /// /// /// A promise that is completed asynchronously after the specified timeout. /// /// var to = timeout(time); return promise ? timeoutWithPromise(to, promise) : to; }, wrap: function Promise_wrap(value) { /// /// /// Wraps a non-promise value in a promise. You can use this function if you need /// to pass a value to a function that requires a promise. /// /// /// Some non-promise value to be wrapped in a promise. /// /// /// A promise that is successfully fulfilled with the specified value /// /// return new CompletePromise(value); }, wrapError: function Promise_wrapError(error) { /// /// /// Wraps a non-promise error value in a promise. You can use this function if you need /// to pass an error to a function that requires a promise. /// /// /// A non-promise error value to be wrapped in a promise. /// /// /// A promise that is in an error state with the specified value. /// /// return new ErrorPromise(error); }, _veryExpensiveTagWithStack: { get: function () { return tagWithStack; }, set: function (value) { tagWithStack = value; } }, _veryExpensiveTagWithStack_tag: tag, _getStack: function () { if (Debug.debuggerEnabled) { try { throw new Error(); } catch (e) { return e.stack; } } }, } ); Object.defineProperties(Promise, PluginUtilities.Utilities.createEventProperties(errorET)); var SignalPromise = PluginUtilities.Class.derive(PromiseStateMachine, function (cancel) { this._oncancel = cancel; this._setState(state_created); this._run(); }, { _cancelAction: function () { this._oncancel && this._oncancel(); }, _cleanupAction: function () { this._oncancel = null; } }, { supportedForProcessing: false } ); var Signal = PluginUtilities.Class.define( function Signal_ctor(oncancel) { this._promise = new SignalPromise(oncancel); }, { promise: { get: function () { return this._promise; } }, cancel: function Signal_cancel() { this._promise.cancel(); }, complete: function Signal_complete(value) { this._promise._completed(value); }, error: function Signal_error(value) { this._promise._error(value); }, progress: function Signal_progress(value) { this._promise._progress(value); } }, { supportedForProcessing: false, } ); // Publish PluginUtilities.Promise // PluginUtilities.Namespace.define("PluginUtilities", { Promise: Promise, _Signal: Signal }); Plugin.Promise = Promise; }(this)); (function errorsInit(global, undefined) { "use strict"; PluginUtilities.Namespace.define("PluginUtilities", { // ErrorFromName establishes a simple pattern for returning error codes. // ErrorFromName: PluginUtilities.Class.derive(Error, function (name, message) { /// /// /// Creates an Error object with the specified name and message properties. /// /// The name of this error. The name is meant to be consumed programmatically and should not be localized. /// The message for this error. The message is meant to be consumed by humans and should be localized. /// Error instance with .name and .message properties populated /// this.name = name; this.message = message || name; }, { /* empty */ }, { supportedForProcessing: false, }) }); })(this);// This file is included at the end of the plugin.f12.js file so that // we can trigger the host onload event after daytona has initialized F12.Host.App.pluginHost.onLoaded(); Popup
            PNG  IHDRtv pHYsod OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FIDATxء0 aϓ2$H,uB ز9?yݓdfyv|~玳M ( (\P1ҼhZwK^]Ö({]A=^.rPFz\ֽr=`r=`r=`r=`3C[1#;3C[1#;ЧRU..E<[&{O ( (zRr|pCIENDB`html { overflow: hidden; -ms-content-zooming:none; } html, body { -ms-high-contrast-adjust: none; scrollbar-3dlight-color: inherit !important; scrollbar-darkshadow-color: inherit !important; scrollbar-highlight-color: inherit !important; scrollbar-shadow-color: inherit !important; scrollbar-track-color: inherit !important; scrollbar-arrow-color: inherit !important; scrollbar-face-color: inherit !important; } #plugin-vs-tooltip { z-index: 9999999; -ms-high-contrast-adjust: none; background-color: #FFFFFF; /*[{plugin-tooltip-background-color}]*/ color: TRANSPARENT ; /*[{plugin-tooltip-text-color}]*/ border: thin solid TRANSPARENT; /*[thin solid {plugin-tooltip-border-color}]*/ padding: 0 5px 1px 5px; } #plugin-vs-tooltip > #plugin-vs-tooltip-nested-cell, #plugin-vs-tooltip > #plugin-vs-tooltip-nested-cell > #plugin-vs-tooltip-content { background-color: #FFFFFF; /*[{plugin-tooltip-background-color}]*/ color: TRANSPARENT; /*[{plugin-tooltip-text-color}]*/ } .f12HostErrorContainer { display: none; background: TRANSPARENT; /*[{plugin-contextmenu-background-color}]*/ color: TRANSPARENT; /*[{plugin-font-editor-color}]*/ width: 40em; min-height: 54px; border: 1px solid TRANSPARENT; /*[1px solid {plugin-contextmenu-active-border-color}]*/ border-top: 6px solid TRANSPARENT; /*[6px solid {plugin-highlight-background-color}]*/ padding-top: 12px; padding-left: 1em; padding-right: 6px; position: absolute; box-shadow: 2px 2px 2px TRANSPARENT; /*[2px 2px 2px {plugin-textbox-border-color rgba(0.5)}]*/ z-index: 1010; } .f12HostErrorInnerContainer { display: -ms-grid; -ms-grid-columns: 1fr auto auto; -ms-grid-rows: 1fr; } .f12HostCmdIcon { width: 29px; height: 22px; background-repeat: no-repeat; background-position: 0 0; cursor: pointer; float: right; background-size: 116px 22px; } .f12HostCmdIcon:hover { background-position: -58px 0; } .f12HostCmdIcon > disabled { background-position: -87px 0; } .f12HostCmdIcon > selected { background-position: -29px 0; } #f12HostErrorMessage { -ms-grid-row: 1; -ms-grid-column: 1; height: 3.75em; overflow: auto; font-family: "Segoe UI", Arial, sans-serif; /*[{plugin-font-family} , Arial, sans-serif]*/ line-height: 1.3em; margin-top: 3px; background-image: url("../pluginhost/theme/i_alerterror.png"); /*[url({f12-image-host-error-alert})]*/ background-repeat: no-repeat; background-size: 24px 24px; background-position: 0px 4px; padding-left: 32px; } #f12HostErrorHelp { -ms-grid-row: 1; -ms-grid-column: 2; background-image: url("../pluginhost/theme/helpErrorBox.png"); /*[url({f12-image-host-error-help})]*/ } #f12HostErrorClose { -ms-grid-row: 1; -ms-grid-column: 3; background-image: url("../pluginhost/theme/closeErrorBox.png"); /*[url({f12-image-host-error-close})]*/ } .plugin-contextmenu .menuitem, .plugin-contextmenu li[data-plugin-contextmenu-item-type=separator]:focus, .plugin-contextmenu li[data-plugin-contextmenu-item-type=separator]:active { margin: 0; padding: 1px; border: none; background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA9JREFUeNpivn79OkCAAQAFGgKJahd4MAAAAABJRU5ErkJggg==) 27px repeat-y; /*[transparent url(plugin-contextmenu-menuitem-background-image) 27px repeat-y]*/ } .plugin-contextmenu .menuitem:focus, .plugin-contextmenu .menuitem:active, .plugin-contextmenu .active { border: solid 1px #78AEE4; /*[solid 1px {plugin-contextmenu-active-border-color}]*/ background-color: #f9f9fa; /*[{plugin-contextmenu-active-color}]*/ padding: 0; background-position-x: 26px; } .plugin-contextmenu .disabled:active, .plugin-contextmenu .disabled:focus { background-color: #E1E1E1; /*[{plugin-contextmenu-inactive-background-color}]*/ border: solid 1px #AEAEAE; /*[solid 1px {plugin-contextmenu-inactive-border-color}]*/ color: #6D6D6D; /*[{plugin-contextmenu-inactive-text-color}]*/ } .plugin-contextmenu .menuitem .icon { width: 20px; height: 20px; top: 0; margin: 0 16px 0 0; } .plugin-contextmenu .menuitem .main { margin-left: 27px; padding: 2px 0 2px 5px; } .plugin-contextmenu .menuitem .checkbox { background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAOJJREFUeNpi/P//PwM1ARMDlcEINJAFm+DBe69xxtTTm3fBtLS6MoO9kigjRS788+ELw+SmIoaa7CiG49u2Ue7l2X1NDC9fviAvDLcumAN2EQwcWL2c4dSxg2C2o6sXg6WXF3aNoISNjpPSsv8rKir+d3Fx/b/n7L3/S7cdB/NhYgfuvgJjbHqxRoqqrinD/t3bGO7evcPQUZ7O8OIFxJvc3DwMFZ0zSfcyyDsgb4EAyNCvXyFer+yaxcAiwENeGMaV18MNBYG0onpwUiErHSIbysEjAHc1MYBxtLQZAQYCBBgALn5ztQPAh0IAAAAASUVORK5CYII=); /*[url({plugin-contextmenu-checkbox-icon})]*/ border: solid 1px #25A1DB; /*[solid 1px {plugin-contextmenu-checkbox-border-color}]*/ background-color: #C0DDEA; /*[{plugin-contextmenu-checkbox-background-color}]*/ } .plugin-contextmenu .menuitem:active .checkbox, .plugin-contextmenu .menuitem:focus .checkbox { border: none; border-right: solid 1px #78AEE4; /*[solid 1px {plugin-contextmenu-active-border-color}]*/ background-color: #f9f9fa; /*[{plugin-contextmenu-active-color}]*/ } .plugin-contextmenu .menuitem .hr, .plugin-contextmenu .menuitem:active .hr, .plugin-contextmenu .menuitem:focus .hr { height: 1px; background-color: #cdd0d6; /*[{plugin-contextmenu-separator-color}]*/ padding: 0; border: none; } .plugin-contextmenu .menuitem:active .shortcut, .plugin-contextmenu .menuitem:focus .shortcut { top: 3px; right: -1px; } .plugin-contextmenu .menuitem .arrow { top: 2px; } .plugin-contextmenu .menuitem:active .arrow, .plugin-contextmenu .menuitem:focus .arrow, .plugin-contextmenu .active .arrow { top: 1px; right: 7px; } PNG  IHDRtv pHYsod OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FIDATxر @ Fᛇ2MAI2B UVH`!a?Rlkfݟ/S?~m ( ('A{ﶭAyU :ưmf5E`FQ3QӠp5\ Wz=X UMTyC*o!,f4bF@=,0\@Y\@P@P@}]IENDB`{ "plugin-font-family": "\"Segoe UI\"", "plugin-font-size": "12px", "plugin-font-weight": "normal", "plugin-color": "#1E1E1E", "plugin-contextmenu-active-color": "#D0E1F2", "plugin-contextmenu-background-color": "#F0F0F0", "plugin-contextmenu-border-color": "#979797", "plugin-contextmenu-color": "#000000", "plugin-contextmenu-hover-color": "#D0E1F2", "plugin-contextmenu-hover-text-color": "#000000", "plugin-contextmenu-inactive-text-color": "#6D6D6D", "plugin-contextmenu-separator-color": "#D7D7D7", "plugin-contextmenu-active-border-color": "#78AEE4", "plugin-contextmenu-inactive-border-color": "#AEAEAE", "plugin-contextmenu-inactive-background-color": "#E1E1E1", "plugin-contextmenu-checkbox-border-color": "#25A1DB", "plugin-contextmenu-checkbox-background-color": "#C0DDEA", "plugin-contextmenu-checkbox-icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAOJJREFUeNpi/P//PwM1ARMDlcEINJAFm+DBe69xxtTTm3fBtLS6MoO9kigjRS788+ELw+SmIoaa7CiG49u2Ue7l2X1NDC9fviAvDLcumAN2EQwcWL2c4dSxg2C2o6sXg6WXF3aNoISNjpPSsv8rKir+d3Fx/b/n7L3/S7cdB/NhYgfuvgJjbHqxRoqqrinD/t3bGO7evcPQUZ7O8OIFxJvc3DwMFZ0zSfcyyDsgb4EAyNCvXyFer+yaxcAiwENeGMaV18MNBYG0onpwUiErHSIbysEjAHc1MYBxtLQZAQYCBBgALn5ztQPAh0IAAAAASUVORK5CYII=", "plugin-contextmenu-menuitem-background-image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA9JREFUeNpivn79OkCAAQAFGgKJahd4MAAAAABJRU5ErkJggg==", "plugin-background-color": "#FFFFFF", "plugin-inactive-color": "#A2A4A5" , "plugin-link-color": "#0E70C0", "plugin-link-hover-color": "#007ACC", "plugin-link-active-color": "#007ACC", "plugin-link-active-selected-color": "#007ACC", "plugin-highlight-color": "#1E1E1E", "plugin-highlight-background-color": "#3399FF", "plugin-table-border-color": "#F0F0F0", "plugin-scrollbar-background-color": "#E8E8EC", "plugin-scrollbar-face-color": "#D0D1D7", "plugin-select-option-background-color": "#FFFFFF", "plugin-select-option-color": "#1E1E1E", "plugin-select-option-checked-background-color": "rgba(0, 122, 204, 0.2)", "plugin-select-option-checked-border-color": "rgba(0, 122, 204, 0.2)", "plugin-select-option-checked-foreground-color": "#1E1E1E", "plugin-select-option-hover-background-color": "#D9D9D9", "plugin-select-option-hover-border-color": "#D9D9D9", "plugin-select-option-hover-foreground-color": "#1E1E1E", "plugin-select-border-color": "#CCCEDB", "plugin-select-background-color": "#FFFFFF", "plugin-select-foreground-color": "#1E1E1E", "plugin-select-hover-background-color": "#FFFFFF", "plugin-select-hover-border-color": "#007ACC", "plugin-select-hover-foreground-color": "#1E1E1E", "plugin-textbox-disabled-background-color": "#EFEFF2", "plugin-textbox-color": "#1E1E1E", "plugin-textbox-background-color": "#FFFFFF", "plugin-textbox-border-color": "#ADADAD", "plugin-tooltip-background-color": "#FFFFFF", "plugin-tooltip-border-color": "#767676", "plugin-tooltip-text-color": "#575757", "plugin-treeview-content-inactive-selected-background-color": "#D9D9D9", "plugin-treeview-content-inactive-selected-color": "#1E1E1E", "plugin-treeview-content-selected-background-color": "#CCE4F5", "plugin-treeview-content-selected-color": "#1E1E1E", "plugin-treeview-content-selected-border-color": "#3399FF", "plugin-treeview-content-background-color": "#FC9DEF5", "plugin-treeview-content-mouseover-background-color": "#E2E2E2", "plugin-treeview-content-mouseover-color": "#1E1E1E", "plugin-searchcontrol-clear-hover-color": "#EA2E35", "plugin-searchcontrol-selection-color": "#3399FF", "plugin-searchcontrol-unfocused-watermark-text-color": "#717171", "plugin-searchcontrol-unfocused-background-color": "#FFFFFF", "plugin-searchcontrol-unfocused-border-color": "#CCCEDB", "plugin-searchcontrol-mouseover-watermark-text-color": "#1E1E1E", "plugin-searchcontrol-mouseover-background-background-color": "#FFFFFF", "plugin-searchcontrol-mouseover-background-foreground-color": "#1E1E1E", "plugin-searchcontrol-mouseover-border-color": "#007ACC", "vs-combo-box-popup-background-begin-color": "#E7E8EC", "vs-combo-box-popup-border-color": "#CCCEDB", "vs-command-bar-gradient-begin-color": "#EFEFF2", "vs-command-bar-menu-separator-color": "#CCCEDB", "vs-command-bar-mouse-down-background-begin-color": "#007ACC", "vs-command-bar-mouse-down-background-end-color": "#007ACC", "vs-command-bar-mouse-down-border-color": "#007ACC", "vs-command-bar-mouse-over-background-begin-color": "#FEFEFE", "vs-command-bar-mouse-over-background-middle1-color": "#FEFEFE", "vs-command-bar-options-background-color": "#EFEFF2", "vs-command-bar-selected-border-color": "#3399FF", "vs-command-bar-text-inactive-color": "#A2A4A5", "vs-command-bar-text-selected-color": "#1E1E1E", "vs-designer-selection-dots-color": "#999999", "vs-drop-down-background-color": "#FCFCFC", "vs-drop-down-border-color": "#DBDDE6", "vs-drop-down-button-mouse-over-background-color": "#DEDFE8", "vs-drop-down-disabled-text-color": "#A2A4A5", "vs-drop-down-mouse-over-background-begin-color": "#FFFFFF", "vs-drop-down-mouse-over-border-color": "#DBDDE6", "vs-drop-down-mouse-over-text-color": "#1E1E1E", "vs-drop-down-popup-background-begin-color": "#E7E8EC", "vs-drop-down-text-color": "#1E1E1E", "vs-drop-shadow-background-color": "#000000", "vs-file-tab-button-hover-selected-active-border-color": "#1C97EA", "vs-file-tab-hot-gradient-bottom-color": "#1C97EA", "vs-file-tab-hot-text-color": "#FFFFFF", "vs-file-tab-selected-gradient-bottom-color": "#007ACC", "vs-file-tab-selected-text-color": "#FFFFFF", "vs-file-tab-text-color": "#1E1E1E", "vs-horizontal-resize-grip-color": "#CCCEDB", "vs-main-window-button-down-color": "#007ACC", "vs-main-window-button-down-glyph-color": "#FFFFFF", "vs-main-window-button-hover-active-color": "#FFFFFF", "vs-tool-window-background-color": "#F6F6F6", "vs-tool-window-text-color": "#1E1E1E", "vs-toolbox-background-color": "#F6F6F6", "vs-tree-view-selected-item-inactive-color": "#CCCEDB", "f12-header-background-color": "#1E1E1E", "f12-header-background-inactive-color": "#B1B1B1", "f12-header-tab-selected-background-color": "#007ACC", "f12-header-tab-hover-background-color": "#414141", "f12-toolbar-background-color": "#FFFFFF", "f12-toolbar-button-border-hover-color":"transparent", "f12-toolbar-button-hover-color": "#D9EBF7", "f12-toolbar-button-hover-text-color": "#1E1E1E", "f12-toolbar-button-pressed-color": "#B2D7F0", "f12-toolbar-button-selected-border-color": "#3399FF", "f12-toolbar-button-selected-color": "#F0F7FC", "f12-toolbar-button-selected-text-color": "#1E1E1E", "f12-toolbar-border-color": "#E5E6ED", "f12-intellisense-hover-color": "#1E1E1E", "f12-intellisense-hover-background-color": "#D9D9D9", "f12-intellisense-checked-color": "#1E1E1E", "f12-intellisense-checked-background-color": "rgba(0, 122, 204, 0.2)", "diagnostics-host-border": "#CCCEDB", "diagnostics-host-graph-cursor": "#717171", "diagnostics-host-graph-line": "#CCCEDB", "diagnostics-host-graph-scale": "#CCCEDB", "diagnostics-host-ruler-slider": "#1E1E1E", "diagnostics-host-ruler-slider-active": "#007ACC", "diagnostics-host-ruler-tickmark": "#CCCEDB", "diagnostics-host-swimlane-border": "#CCCEDB", "plugin-memory-drop-down-button": "#EEEEEE", "plugin-memory-drop-down-button-focus": "#F0F7FC", "plugin-memory-drop-down-button-focus-border": "#3399FF", "plugin-memory-drop-down-button-hover": "#D9EBF7", "plugin-memory-snapshot-button": "#FFFFFF", "plugin-memory-snapshot-button-active": "#B2D7F0", "plugin-memory-snapshot-button-active-text": "#FFFFFF", "plugin-memory-snapshot-button-border": "#CCCEDB", "plugin-memory-snapshot-button-border-active": "#B2D7F0", "plugin-memory-snapshot-button-border-hover": "#D9EBF7", "plugin-memory-snapshot-button-disabled": "#EFEFF2", "plugin-memory-snapshot-button-disabled-text": "#999999", "plugin-memory-snapshot-button-hover": "#D9EBF7", "plugin-memory-snapshot-button-hover-text": "#0E70C0", "plugin-memory-snapshot-diff-added-text": "#4E8400", "plugin-memory-snapshot-diff-modified-text": "#00829C", "plugin-memory-snapshot-messages-border": "#E5E6ED", "plugin-memory-snapshot-tile": "#FFFFFF", "plugin-memory-snapshot-tile-baseline-text": "#999999", "plugin-memory-snapshot-tile-border": "#D4D4D4", "plugin-memory-snapshot-tile-error-text": "#FF0000", "plugin-memory-snapshot-tile-header": "#EFEFF2", "plugin-memory-tab-header": "#EEEEEE", "plugin-memory-tab-text": "#444444", "plugin-memory-tab-hover": "#EEEEEE", "plugin-memory-tab-hover-text": "#007ACC", "plugin-perftools-detail-pane": "#f9f9f9", "plugin-perftools-focusdots": "#999999", "plugin-perftools-grid-column-sizer": "#CCCEDB", "plugin-perftools-grid-header-hover": "#E5F1FA", "plugin-perftools-grid-header-hover-text": "#717171", "plugin-perftools-grid-header-text": "#717171", "plugin-perftools-menu": "#F9FAFC", "plugin-perftools-menu-border": "#3399FF", "plugin-perftools-menu-drop-shadow": "#ADADAD", "plugin-perftools-menu-focus": "#CCE4F5", "plugin-perftools-menu-focus-text": "#1E1E1E", "plugin-perftools-menu-hover": "#e2e2e2", "plugin-perftools-menu-hover-text": "#1E1E1E", "plugin-perftools-progress": "#3399FF", "plugin-perftools-splitter": "#CCCEDB", "plugin-perftools-watermark-text": "#717171", "plugin-responsiveness-graph-border": "#CCCEDB", "plugin-subheading-color": "#717171", "plugin-font-console": "\"Consolas\"", "plugin-font-console-color": "#1E1E1E", "plugin-font-console-background-color": "#FFFFFF", "plugin-font-console-output-color": "#1E1E1E", "plugin-font-console-output-background-color": "#FFFFFF", "plugin-font-console-input-color": "#0000FF", "plugin-font-console-input-background-color": "#FFFFFF", "plugin-font-console-info-color": "#006400", "plugin-font-console-info-background-color": "#FFFFFF", "plugin-font-console-warning-color": "#606060", "plugin-font-console-warning-background-color": "#FFFFFF", "plugin-font-console-error-color": "#FF0000", "plugin-font-console-error-background-color": "#FFFFFF", "plugin-font-editor": "\"Consolas\"", "plugin-font-editor-color": "#1E1E1E", "plugin-font-editor-background-color": "#FFFFFF", "plugin-font-editor-selected-background-color": "#007ACC", "plugin-font-editor-selected-border-color": "#B6B6B6", "plugin-font-editor-keyword-color": "#0000FF", "plugin-font-editor-keyword-background-color": "#FFFFFF", "plugin-font-editor-string-color": "#A31515", "plugin-font-editor-string-background-color": "#FFFFFF", "plugin-font-editor-number-color": "#A31515", "plugin-font-editor-number-background-color": "#FFFFFF", "plugin-font-editor-regexp-color": "#811F3F", "plugin-font-editor-regexp-background-color": "#FFFFFF", "plugin-font-editor-symbol-color": "#2B91AF", "plugin-font-editor-symbol-background-color": "#FFFFFF", "plugin-font-editor-identifier-color": "#001188", "plugin-font-editor-literal-color": "#E00000", "plugin-font-editor-comment-color": "#006400", "plugin-font-editor-html-tag-color": "#0000FF", "plugin-font-editor-html-tag-background-color": "#FFFFFF", "plugin-font-editor-html-element-color": "#800000", "plugin-font-editor-html-element-background-color": "#FFFFFF", "plugin-font-editor-html-comment-color": "#006400", "plugin-font-editor-html-comment-background-color": "#FFFFFF", "plugin-font-editor-html-attribute-name-color": "#FF0000", "plugin-font-editor-html-attribute-name-background-color": "#FFFFFF", "plugin-font-editor-html-attribute-value-color": "#0000FF", "plugin-font-editor-html-attribute-value-background-color": "#FFFFFF", "plugin-font-editor-html-operator-color": "#006400", "plugin-font-editor-html-operator-background-color": "#FFFFFF", "plugin-font-editor-css-name-color": "#FF0000", "plugin-font-editor-css-name-background-color": "#FFFFFF", "plugin-font-editor-css-value-color": "#0000FF", "plugin-font-editor-css-value-background-color": "#FFFFFF", "plugin-font-editor-css-selector-color": "#880000", "plugin-font-editor-css-selector-background-color": "#FFFFFF", "plugin-font-editor-margin-color": "#2B91AF", "plugin-font-editor-margin-background-color": "#E6E7E8", "plugin-font-editor-instruction-pointer-background-color": "#FFEE62", "plugin-font-editor-breakpoint-background-color": "#963A46", "plugin-font-editor-erroradornment-color": "#FFFFFF", "plugin-font-editor-erroradornment-background-color": "#BA141A", "plugin-font-editor-search-result-background-color": "#F6B94D", "plugin-font-editor-current-statement-color": "#B800B8", "plugin-font-editor-current-statement-background-color": "#FFE3FF", "plugin-editor-scrollbar-marker-instruction-pointer-color" : "#FF8C00", "plugin-editor-scrollbar-marker-breakpoint-color" : "#BA141A", "plugin-editor-scrollbar-marker-active-frame-color" : "#00B294", "plugin-editor-scrollbar-marker-search-result-color" : "#0072C6", "plugin-debugger-grid-row-hover-background-color" : "#E2E2E2", "plugin-debugger-grid-row-selected-background-color" : "#007ACC", "plugin-debugger-grid-active-splitter-color" : "#E5E6ED", "plugin-debugger-tab-color" : "#555555", "plugin-debugger-tab-area-background-color" : "#EEEEEE", "plugin-debugger-button-active-background-color" : "#33C1FF", "plugin-debugger-button-toggled-on-background-color" : "#D2E6FA", "plugin-debugger-button-toggled-on-border-color" : "#3399FF", "plugin-debugger-watch-font-color" : "#2B91AF", "plugin-debugger-watch-overlay-color" : "#FFFFFF", "plugin-debugger-filepicker-background-color" : "#F9FAFC", "plugin-tab-header-background-color": "#EEEEEE", "plugin-tab-header-active-background-color": "#EEEEEE", "plugin-tab-header-hover-background-color": "#EEEEEE", "plugin-tab-header-color": "#555555", "plugin-tab-header-active-color": "#007acc", "plugin-tab-header-hover-color": "#007acc", "plugin-breadcrumb-border-color": "#CCCEDB", "plugin-breadcrumb-background-color": "#EEEEEE", "plugin-breadcrumb-hover-color": "#1E1E1E", "plugin-breadcrumb-hover-background-color": "#A8CFF7", "plugin-breadcrumb-selected-color": "#FFFFFF", "plugin-breadcrumb-selected-background-color": "#3399FF", "plugin-breadcrumb-tooltip-color": "#575757", "plugin-breadcrumb-tooltip-background-color": "#ffffff", "plugin-breadcrumb-tooltip-border-color": "#767676" } { "plugin-font-family": "\"Segoe UI\"", "plugin-font-size": "12px", "plugin-font-weight": "normal", "plugin-color": "", "plugin-contextmenu-active-color": "", "plugin-contextmenu-background-color": "", "plugin-contextmenu-border-color": "", "plugin-contextmenu-color": "", "plugin-contextmenu-hover-color": "", "plugin-contextmenu-hover-text-color": "", "plugin-contextmenu-inactive-text-color": "", "plugin-contextmenu-separator-color": "", "plugin-contextmenu-active-border-color": "", "plugin-contextmenu-inactive-border-color": "", "plugin-contextmenu-inactive-background-color": "", "plugin-contextmenu-checkbox-border-color": "", "plugin-contextmenu-checkbox-background-color": "", "plugin-contextmenu-checkbox-icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAMBJREFUeNpi/P//PwM1ARMDlcEQNpCRkfE/LtzW1vZ/0qRJ2AMfFCnYMEgKG1ZWVv4PAsbGxv+x6iPVwIMHD/5ft27df4hbKDQQ6iowTbKB3Nzc/1lYWFAMvHTpEtx1JBu4f/9+sPeYmJjAmt3c3FBcR7KBaWlpYAM2btz4X1RU9P/Dhw9RXEdWGB4+fBhs6M+fPzFcR5aB6urqcMPQXUd2LLe0tGB1HdkGsrGx/e/q6sKaJrHpYxwtvgafgQABBgA5A/UQRbg4MQAAAABJRU5ErkJggg==", "plugin-contextmenu-menuitem-background-image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC", "plugin-background-color": "", "plugin-inactive-color": "", "plugin-link-color": "", "plugin-link-hover-color": "", "plugin-link-active-color": "", "plugin-link-active-selected-color": "", "plugin-highlight-color": "", "plugin-highlight-background-color": "", "plugin-table-border-color": "", "plugin-scrollbar-background-color": "", "plugin-scrollbar-face-color": "", "plugin-select-option-background-color": "", "plugin-select-option-color": "", "plugin-select-option-checked-background-color": "", "plugin-select-option-checked-border-color": "", "plugin-select-option-checked-foreground-color": "", "plugin-select-option-hover-background-color": "", "plugin-select-option-hover-border-color": "", "plugin-select-option-hover-foreground-color": "", "plugin-select-border-color": "", "plugin-select-background-color": "", "plugin-select-foreground-color": "", "plugin-select-hover-background-color": "", "plugin-select-hover-border-color": "", "plugin-select-hover-foreground-color": "", "plugin-textbox-disabled-background-color": "", "plugin-textbox-color": "", "plugin-textbox-background-color": "", "plugin-textbox-border-color": "", "plugin-tooltip-background-color": "", "plugin-tooltip-border-color": "", "plugin-tooltip-text-color": "", "plugin-treeview-content-inactive-selected-background-color": "", "plugin-treeview-content-inactive-selected-color": "", "plugin-treeview-content-selected-background-color": "", "plugin-treeview-content-selected-color": "", "plugin-treeview-content-selected-border-color": "", "plugin-treeview-content-background-color": "", "plugin-treeview-content-mouseover-color": "", "plugin-treeview-content-mouseover-background-color": "", "plugin-searchcontrol-clear-hover-color": "", "plugin-searchcontrol-selection-color": "", "plugin-searchcontrol-unfocused-watermark-text-color": "", "plugin-searchcontrol-unfocused-background-color": "", "plugin-searchcontrol-unfocused-border-color": "", "plugin-searchcontrol-mouseover-watermark-text-color": "", "plugin-searchcontrol-mouseover-background-background-color": "", "plugin-searchcontrol-mouseover-background-foreground-color": "", "plugin-searchcontrol-mouseover-border-color": "", "vs-combo-box-popup-background-begin-color": "", "vs-combo-box-popup-border-color": "", "vs-command-bar-gradient-begin-color": "", "vs-command-bar-menu-separator-color": "", "vs-command-bar-mouse-down-background-begin-color": "", "vs-command-bar-mouse-down-background-end-color": "", "vs-command-bar-mouse-down-border-color": "", "vs-command-bar-mouse-over-background-begin-color": "", "vs-command-bar-mouse-over-background-middle1-color": "", "vs-command-bar-options-background-color": "", "vs-command-bar-selected-border-color": "", "vs-command-bar-text-inactive-color": "", "vs-command-bar-text-selected-color": "", "vs-designer-selection-dots-color": "", "vs-drop-down-background-color": "", "vs-drop-down-border-color": "", "vs-drop-down-button-mouse-over-background-color": "", "vs-drop-down-disabled-text-color": "", "vs-drop-down-mouse-over-background-begin-color": "", "vs-drop-down-mouse-over-border-color": "", "vs-drop-down-mouse-over-text-color": "", "vs-drop-down-popup-background-begin-color": "", "vs-drop-down-text-color": "", "vs-drop-shadow-background-color": "", "vs-file-tab-button-hover-selected-active-border-color": "", "vs-file-tab-hot-gradient-bottom-color": "", "vs-file-tab-hot-text-color": "", "vs-file-tab-selected-gradient-bottom-color": "", "vs-file-tab-selected-text-color": "", "vs-file-tab-text-color": "", "vs-horizontal-resize-grip-color": "", "vs-main-window-button-down-color": "", "vs-main-window-button-down-glyph-color": "", "vs-main-window-button-hover-active-color": "", "vs-tool-window-background-color": "", "vs-tool-window-text-color": "", "vs-toolbox-background-color": "", "vs-tree-view-selected-item-inactive-color": "", "f12-header-background-color": "#1E1E1E", "f12-header-background-inactive-color": "#1E1E1E", "f12-header-tab-selected-background-color": "#007ACC", "f12-header-tab-hover-background-color": "#414141", "f12-toolbar-background-color": "", "f12-toolbar-button-border-hover-color":"", "f12-toolbar-button-hover-color": "", "f12-toolbar-button-hover-text-color": "", "f12-toolbar-button-pressed-color": "", "f12-toolbar-border-color": "", "f12-toolbar-button-selected-border-color": "", "f12-toolbar-button-selected-text-color": "", "f12-toolbar-button-selected-color": "", "f12-intellisense-hover-color": "", "f12-intellisense-hover-background-color": "", "f12-intellisense-checked-color": "", "f12-intellisense-checked-background-color": "", "diagnostics-host-border": "", "diagnostics-host-graph-cursor": "", "diagnostics-host-graph-line": "", "diagnostics-host-graph-scale": "", "diagnostics-host-ruler-slider": "", "diagnostics-host-ruler-slider-active": "", "diagnostics-host-ruler-tickmark": "", "diagnostics-host-swimlane-border": "", "plugin-memory-drop-down-button": "", "plugin-memory-drop-down-button-focus": "", "plugin-memory-drop-down-button-focus-border": "", "plugin-memory-drop-down-button-hover": "", "plugin-memory-snapshot-button": "", "plugin-memory-snapshot-button-active": "", "plugin-memory-snapshot-button-active-text": "", "plugin-memory-snapshot-button-border": "", "plugin-memory-snapshot-button-border-active": "", "plugin-memory-snapshot-button-border-hover": "", "plugin-memory-snapshot-button-disabled": "", "plugin-memory-snapshot-button-disabled-text": "", "plugin-memory-snapshot-button-hover": "", "plugin-memory-snapshot-button-hover-text": "", "plugin-memory-snapshot-diff-added-text": "", "plugin-memory-snapshot-diff-modified-text": "", "plugin-memory-snapshot-messages-border": "", "plugin-memory-snapshot-tile": "", "plugin-memory-snapshot-tile-baseline-text": "", "plugin-memory-snapshot-tile-border": "", "plugin-memory-snapshot-tile-error-text": "", "plugin-memory-snapshot-tile-header": "", "plugin-memory-tab-header": "", "plugin-memory-tab-text": "", "plugin-memory-tab-hover": "", "plugin-memory-tab-hover-text": "", "plugin-perftools-detail-pane": "", "plugin-perftools-focusdots": "", "plugin-perftools-grid-column-sizer": "", "plugin-perftools-grid-header-hover": "", "plugin-perftools-grid-header-hover-text": "", "plugin-perftools-grid-header-text": "", "plugin-perftools-menu": "", "plugin-perftools-menu-border": "", "plugin-perftools-menu-drop-shadow": "", "plugin-perftools-menu-focus": "", "plugin-perftools-menu-focus-text": "", "plugin-perftools-menu-hover": "", "plugin-perftools-menu-hover-text": "", "plugin-perftools-progress": "", "plugin-perftools-splitter": "", "plugin-perftools-watermark-text": "", "plugin-responsiveness-graph-border": "", "plugin-subheading-color": "", "plugin-font-console": "\"Consolas\"", "plugin-font-console-color": "", "plugin-font-console-background-color": "", "plugin-font-console-output-color": "", "plugin-font-console-output-background-color": "", "plugin-font-console-input-color": "", "plugin-font-console-input-background-color": "", "plugin-font-console-info-color": "", "plugin-font-console-info-background-color": "", "plugin-font-console-warning-color": "", "plugin-font-console-warning-background-color": "", "plugin-font-console-error-color": "", "plugin-font-console-error-background-color": "", "plugin-font-editor": "\"Consolas\"", "plugin-font-editor-color": "", "plugin-font-editor-background-color": "", "plugin-font-editor-selected-background-color": "", "plugin-font-editor-selected-border-color": "", "plugin-font-editor-keyword-color": "", "plugin-font-editor-keyword-background-color": "", "plugin-font-editor-string-color": "", "plugin-font-editor-string-background-color": "", "plugin-font-editor-number-color": "", "plugin-font-editor-number-background-color": "", "plugin-font-editor-regexp-color": "", "plugin-font-editor-regexp-background-color": "", "plugin-font-editor-symbol-color": "", "plugin-font-editor-symbol-background-color": "", "plugin-font-editor-identifier-color": "", "plugin-font-editor-literal-color": "", "plugin-font-editor-comment-color": "", "plugin-font-editor-html-tag-color": "", "plugin-font-editor-html-tag-background-color": "", "plugin-font-editor-html-element-color": "", "plugin-font-editor-html-element-background-color": "", "plugin-font-editor-html-comment-color": "", "plugin-font-editor-html-comment-background-color": "", "plugin-font-editor-html-attribute-name-color": "", "plugin-font-editor-html-attribute-name-background-color": "", "plugin-font-editor-html-attribute-value-color": "", "plugin-font-editor-html-attribute-value-background-color": "", "plugin-font-editor-html-operator-color": "", "plugin-font-editor-html-operator-background-color": "", "plugin-font-editor-css-name-color": "", "plugin-font-editor-css-name-background-color": "", "plugin-font-editor-css-value-color": "", "plugin-font-editor-css-value-background-color": "", "plugin-font-editor-css-selector-color": "", "plugin-font-editor-css-selector-background-color": "", "plugin-font-editor-margin-color": "", "plugin-font-editor-margin-background-color": "", "plugin-font-editor-instruction-pointer-background-color": "", "plugin-font-editor-breakpoint-background-color": "", "plugin-font-editor-erroradornment-color": "", "plugin-font-editor-erroradornment-background-color": "", "plugin-font-editor-search-result-background-color": "", "plugin-font-editor-current-statement-color": "", "plugin-font-editor-current-statement-background-color": "", "plugin-editor-scrollbar-marker-instruction-pointer-color" : "", "plugin-editor-scrollbar-marker-breakpoint-color" : "", "plugin-editor-scrollbar-marker-active-frame-color" : "", "plugin-editor-scrollbar-marker-search-result-color" : "", "plugin-debugger-grid-row-hover-background-color" : "", "plugin-debugger-grid-row-selected-background-color" : "", "plugin-debugger-grid-active-splitter-color": "", "plugin-debugger-tab-color" : "", "plugin-debugger-tab-area-background-color" : "", "plugin-debugger-button-active-background-color" : "", "plugin-debugger-button-toggled-on-background-color" : "", "plugin-debugger-button-toggled-on-border-color" : "", "plugin-debugger-watch-font-color" : "", "plugin-debugger-watch-overlay-color" : "#888888", "plugin-debugger-filepicker-background-color" : "", "plugin-tab-header-background-color": "", "plugin-tab-header-active-background-color": "", "plugin-tab-header-hover-background-color": "", "plugin-tab-header-color": "", "plugin-tab-header-active-color": "", "plugin-tab-header-hover-color": "", "plugin-breadcrumb-border-color": "", "plugin-breadcrumb-background-color": "", "plugin-breadcrumb-hover-color": "", "plugin-breadcrumb-hover-background-color": "", "plugin-breadcrumb-selected-color": "", "plugin-breadcrumb-selected-background-color": "", "plugin-breadcrumb-tooltip-color": "", "plugin-breadcrumb-tooltip-background-color": "", "plugin-breadcrumb-tooltip-border-color": "" } /* CSS file for the plugin's base styles and themes (light / dark / high contrast) Light theme values are used as defaults but token replacement occurs to provide the correct property for the active theme. Tokens must appear as comments on the same line as the property to replace and are in the following format: [] - indicates token replacement will occur for this css declaration {} - indicates the token value to replace. Anything inside the square brackets ([]) that is not a token will remain as is Example: border-right: 1px solid #8591A2; /*[1px solid {plugin-background-color}] Base plugin tokens available to all hosts: plugin-background-color plugin-color plugin-contextmenu-active-color plugin-contextmenu-background-color plugin-contextmenu-border-color plugin-contextmenu-color plugin-contextmenu-hover-color plugin-contextmenu-hover-text-color plugin-contextmenu-icon-checkbox plugin-contextmenu-inactive-text-color plugin-contextmenu-separator-color plugin-font-family plugin-font-size plugin-font-weight plugin-highlight-background-color plugin-highlight-color plugin-inactive-color plugin-link-color plugin-link-active-color plugin-link-hover-color plugin-scrollbar-arrow-color plugin-scrollbar-background-color plugin-scrollbar-face-color plugin-select-option-background-color plugin-select-option-color plugin-select-option-checked-background-color plugin-select-option-checked-border-color plugin-select-option-checked-foreground-color plugin-select-option-hover-background-color plugin-select-option-hover-border-color plugin-select-option-hover-foreground-color plugin-select-border-color plugin-select-background-color plugin-select-foreground-color plugin-select-hover-background-color plugin-select-hover-border-color plugin-select-hover-foreground-color plugin-table-border-color plugin-table-header-background-color plugin-table-header-color plugin-textbox-border-color plugin-textbox-background-color plugin-textbox-color plugin-textbox-disabled-background-color plugin-textbox-disabled-border-color plugin-textbox-disabled-color plugin-treeview-content-background-color plugin-treeview-content-color plugin-treeview-content-inactive-selected-color plugin-treeview-content-mouseover-background-color plugin-treeview-content-mouseover-color plugin-treeview-content-inactive-selected-color plugin-treeview-content-selected-background-color plugin-treeview-content-selected-border-color plugin-treeview-content-selected-color VS host also has access to all VS themed color key tokens (EnvironmentColors) and category specific tokens. http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.platformui.environmentcolors_properties Please see product documentation for instructions on how to add these tokens to the plugin manifest. */ /* HTML and body styles */ html, body { font-family: "Segoe UI", Arial, sans-serif; /*[{plugin-font-family, Arial, sans-serif}]*/ font-size: 9pt; /*[{plugin-font-size}]*/ font-weight: normal; /*[{plugin-font-weight}]*/ color: #1E1E1E; /*[{plugin-color}]*/ background-color: #F6F6F6; /*[{plugin-background-color}]*/ scrollbar-3dlight-color: #E8E8EC; /*[{plugin-scrollbar-background-color}]*/ scrollbar-darkshadow-color: #E8E8EC; /*[{plugin-scrollbar-background-color}]*/ scrollbar-highlight-color: #E8E8EC; /*[{plugin-scrollbar-background-color}]*/ scrollbar-shadow-color: #E8E8EC; /*[{plugin-scrollbar-background-color}]*/ scrollbar-track-color: #E8E8EC; /*[{plugin-scrollbar-background-color}]*/ scrollbar-arrow-color: #868999; /*[{plugin-scrollbar-arrow-color}]*/ scrollbar-face-color: #D0D1D7; /*[{plugin-scrollbar-face-color}]*/ } /* Select styles */ select { color: #1E1E1E; /*[{plugin-select-foreground-color}]*/ background-color: #FFFFFF; /*[{plugin-select-background-color}]*/ font: normal 9pt "Segoe UI", Arial, sans-serif; /*[{plugin-font-weight} {plugin-font-size} {plugin-font-family}, Arial, sans-serif]*/ border: 1px solid #CCCEDB; /*[1px solid {plugin-select-border-color}]*/ } select:hover { color: #1E1E1E; /*[{plugin-select-hover-foreground-color}]*/ background-color: #FFFFFF; /*[{plugin-select-hover-background-color}]*/ border: 1px solid #007ACC; /*[1px solid {plugin-select-hover-border-color}]*/ } select[multiple], select option { color: #1E1E1E; /*[{plugin-select-option-color}]*/ background-color: #F6F6F6; /*[{plugin-select-option-background-color}]*/ } select option:hover { color: #1E1E1E; /*[{plugin-select-option-hover-foreground-color}]*/ background-color: #C9DEF5; /*[{plugin-select-option-hover-background-color}]*/ border: 1px solid #C9DEF5; /*[1px solid {plugin-select-option-hover-border-color}]*/ } select option:checked { color: #1E1E1E; /*[{plugin-select-option-checked-foreground-color}]*/ background-color: #C9DEF5; /*[{plugin-select-option-checked-background-color}]*/ border: 1px solid #C9DEF5; /*[1px solid {plugin-select-option-checked-border-color}]*/ } /* Input styles */ input { font: normal 9pt "Segoe UI", Arial, sans-serif; /*[{plugin-font-weight} {plugin-font-size} {plugin-font-family}, Arial, sans-serif]*/ color: #1E1E1E; /*[{plugin-textbox-color}]*/ background-color: #FFFFFF; /*[{plugin-textbox-background-color}]*/ border: 1px solid #DBDDE6; /*[1px solid {plugin-textbox-border-color}]*/ padding: 0 3px; } input:disabled { color: #A2A4A5; /*[{plugin-textbox-disabled-color}]*/ background-color: #FFFFFF; /*[{plugin-textbox-disabled-background-color}]*/ border: 1px solid #DBDDE6; /*[1px solid {plugin-textbox-disabled-border-color}]*/ } input[type="checkbox"], input[type="radio"] { border: none; background-color: inherit; margin-right: 4px; vertical-align: middle; } input[type="file"], input[type="image"] { border: none; background-color: inherit; padding: 0; } /* TextArea styles */ textarea { font-family: "Segoe UI", Arial, sans-serif; /*[{plugin-font-family}, Arial, sans-serif]*/ font-size: 9pt; /*[{plugin-font-size}]*/ font-weight: normal; /*[{plugin-font-weight}]*/ color: #1E1E1E; /*[{plugin-color}]*/ background-color: #F6F6F6; /*[{plugin-textbox-background-color}]*/ border: 1px solid #DBDDE6; /*[1px solid {plugin-textbox-border-color}]*/ padding: 0 3px; } /* Button styles */ button, input[type="button"], input[type="reset"], input[type="submit"] { color: #000000; background-image: -ms-linear-gradient(top, #F0F0F0 0%, #E5E5E5 100%); border: 1px solid #ACACAC; font-family: "Segoe UI", Arial, sans-serif; /*[{plugin-font-family}, Arial, sans-serif]*/ font-size: 9pt; /*[{plugin-font-size}]*/ font-weight: normal; /*[{plugin-font-weight}]*/ min-width: 73px; padding: 1px 19px 2px 19px; } button:hover, input[type="button"]:hover, input[type="reset"]:hover, input[type="submit"]:hover { background-image: -ms-linear-gradient(top, #ECF4FC 0%, #DCECFC 100%); border: 1px solid #7EB4EA; } button:focus, input[type="button"]:focus, input[type="reset"]:focus, input[type="submit"]:focus { border: 1px solid #569DE5; } button:active, input[type="button"]:active, input[type="reset"]:active, input[type="submit"]:active { background-image: -ms-linear-gradient(top, #DAECFC 0%, #C4E0FC 100%); border: 1px solid #569DE5; } button[disabled], input[type="button"][disabled], input[type="reset"][disabled], input[type="submit"][disabled] { color: #838383; background: #F4F4F4 none; border: 1px solid #B1B1B2; } /* Other form styles */ fieldset { border: 1px solid #DBDDE6; /*[1px solid {plugin-textbox-border-color}]*/ } /* Link styles */ a, a:link, a:visited, a:focus { color: #0E70C0; /*[{plugin-link-color}]*/ text-decoration: none; } a:hover { color: #0E70C0; /*[{plugin-link-hover-color}]*/ text-decoration: underline; } a:active { color: #0E70C0; /*[{plugin-link-active-color}]*/ } /* Table styles */ th { color: #1E1E1E; /*[{plugin-table-header-color}]*/ background-color: #EFEFE2; /*[{plugin-table-header-background-color}]*/ } td, th { border-color: #F0F0F0; /*[{plugin-table-border-color}]*/ } /* Disabled styles */ :disabled { color: #A2A4A5; /*[{plugin-inactive-color}]*/ } /* Highlight styles Use this class when you have a highlighted item, for example a highlighted row in a grid */ .plugin-highlight { color: #FFFFFF; /*[{plugin-highlight-color}]*/ background-color: #3399FF; /*[{plugin-highlight-background-color}]*/ } /* Tooltip styles This class will be included automatically on all tooltips In VS tooltips aren't, by default, themed, so we just copy the WPF tooltip defaults, which is what VS uses for its tooltips. We set its initial display style to none and its initial position to (-500,-500) just to ensure that when we insert it into the document (for measuring) it isn't visible until we have done the layout and calculated its final position. */ #plugin-vs-tooltip { display: none; position: absolute; top: -500px; left: -500px; color: #575757; background-color: #F1F2F7; border: thin solid #767676; padding: 1px 5px 4px 5px; line-height: normal; } #plugin-vs-tooltip > #plugin-vs-tooltip-nested-cell { display: table-cell; vertical-align: middle; color: #575757; background-color: #F1F2F7; } #plugin-vs-tooltip > #plugin-vs-tooltip-nested-cell > #plugin-vs-tooltip-content { color: #575757; background-color: #F1F2F7; } /* Selection styles */ .selectNone { -ms-user-select: none; } .selectElement { -ms-user-select: element; } /* Context Menu styles */ ul.plugin-contextmenu { background-color: #e9e8ea; /*[{plugin-contextmenu-background-color}]*/ border: thin solid #cdd0d6; /*[thin solid {plugin-contextmenu-border-color}]*/ color: #1E1E1E; /*[{plugin-contextmenu-color}]*/ padding: 1px 2px 2px 2px; margin: 0; position: absolute; display: none; outline: none; z-index: 100; white-space: nowrap; -ms-high-contrast-adjust: none; line-height: normal; } .plugin-contextmenu .menuitem { position: relative; cursor: default; outline: none; list-style: none; margin-top: 1px; } .plugin-contextmenu .menuitem:focus { background-color: #f9f9fa; /*[{plugin-contextmenu-hover-color}]*/ color: #1E1E1E; /*[{plugin-contextmenu-hover-text-color}]*/ } .plugin-contextmenu .menuitem:active, .plugin-contextmenu .active { background-color: #f9f9fa; /*[{plugin-contextmenu-active-color}]*/ color: #1E1E1E; /*[{plugin-contextmenu-hover-text-color}]*/ } .plugin-contextmenu .disabled:hover, .plugin-contextmenu .disabled:active, .plugin-contextmenu .disabled:focus, .plugin-contextmenu .disabled { background-color: #e9e8ea; /*[{plugin-contextmenu-background-color}]*/ color: #a2a4a5; /*[{plugin-contextmenu-inactive-text-color}]*/ } .plugin-contextmenu .menuitem .icon { margin: 0 10px 0 6px; background-color: transparent; width: 16px; height: 16px; position: absolute; top: 4px; left: 0; } .plugin-contextmenu .menuitem .checkbox { background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/PbtGwMpgAWIfXx8iFS9ZcsWJgYSAQuctW7tejzqgoIDIQx8Nrx69QqobvKUyciC+DSsXLUSSIaHhROlAWj8/v37HB2dxMTEiNKA1Xh0DR2dHUBHvwIDrMajhBIQJCUmnTp1EmI2VuPRNQDNA5oKNBvIxmo8Fj/ATcVqPLoNEEvwxyALZlziBySnJUZSkzdAgAEAfm84vuieuk0AAAAASUVORK5CYII=); /*[url({plugin-contextmenu-icon-checkbox})]*/ } .plugin-contextmenu .hidden { display: none; } .plugin-contextmenu .disabled { color: #a2a4a5; /*[{plugin-contextmenu-inactive-text-color}]*/ } .plugin-contextmenu .menuitem .main { margin-left: 32px; padding: 4px 0 5px 0; } .plugin-contextmenu .menuitem .shortcut { min-width: 25px; position: absolute; padding-right: 25px; top: 4px; right: 0; } .plugin-contextmenu .menuitem .arrow { width: 5px; height: 7px; position: absolute; top: 4px; right: 8px; overflow: visible; } .plugin-contextmenu .menuitem .arrow:before, .plugin-contextmenu .menuitem.disabled:hover .arrow:before, .plugin-contextmenu .menuitem.disabled:active .arrow:before, .plugin-contextmenu .menuitem.disabled:focus .arrow:before, .plugin-contextmenu .menuitem.disabled .arrow:before { content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAHCAYAAADAp4fuAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFZJREFUeNpiWL5i5X8gYEDGTKdOnmCYOXP2fwYkwAQibt68ztDXP+E/iiAIPHn8iGHChIn/UQSFhIQZCgryGUFsFhAhIyvHUFRYwAg3dMaMWRi2AwQYAAcRMJwq3CX+AAAAAElFTkSuQmCC); } .plugin-contextmenu .menuitem:hover .arrow:before, .plugin-contextmenu .menuitem:active .arrow:before, .plugin-contextmenu .menuitem:focus .arrow:before, .plugin-contextmenu .active .arrow:before { content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAHCAYAAADAp4fuAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFRJREFUeNpiKNzy6D8QMCBjBoaqM/+DltxGkWACCjOsu/aRwXrmDZASMGCCMY49+spgP/vmfxRBdRF2hoOp6oxwQSs5boYbhTqMMAUM6JaAMECAAQDqqjmrw1gHVwAAAABJRU5ErkJggg==); } .plugin-contextmenu .menuitem .hr, .plugin-contextmenu .menuitem:hover .hr, .plugin-contextmenu .menuitem:active .hr, .plugin-contextmenu .menuitem:focus .hr, .plugin-contextmenu .active .hr { height: 1px; background-color: #cdd0d6; /*[{plugin-contextmenu-separator-color}]*/ padding: 0; } PNG  IHDR00W pHYs+ cHRMz%u0`:o_FIDATxm0?x.u'2 PD$:HFY6{J1w>#il `t ťSNqE;D )GKOm*5 I}gȓ(GP ;@LnT~6 Ĥ~0,BFAMM37vsS{YwYM彙cP}Z'""gOcMB\cRE"QzlD}k VϠԷ`B?kY;(ܷz&E̅+m-~@7`hj+ڵ  a(h ]Q\ބqs0xI*"as!kikQ%*JH}-,}NJ:s؁`>?v#w;ճ_|]S]jwt:Nt:Nt:Ntݻ3S䳩9|轀^!_#"?!LU{Cty|Ol"҇xD@AT_Ut#QrU :^v>]MO?xgtMo|ʿ}X%"6=At Tdk9ѧ|ձ7n; /x+ή])O$Jڢq4pSi2~P?ѭSp;pFŅZнTة97GMO/I|Miu.2N_ڕǯiGWS_y27/_ٕbEGŮEzq ǐUdI*U$-jI-C:WGx7Xe+:Z=Ezq ǐP٫>#**Stdᘈl?t;wQVbGŦ+FI$\ G٫>}#**f؟g "g E:8YuC(AW]}/֪zףT.ɾU\嬶:7,:FHVa7E)c n/OV?E9c5vj=?otU@}~~]9V= `/z4]%6h$DվxڌGnjUh=~l_*[@}fŷ >rV+{+qFE{$֓cȂCNI;a*6榮Ǣm鿲,<)u"CU327uOHc,< jNKVɂcYP9t\7Vɂι%辚X"@9[l'*YP;w~v]IଟgΨ0:[k_TS=!78xir&$ʖ&TdoH#wwߙδf ~] ww!=;{E?*HtrEEdCNV&_\H[)f($aFp׃=V;*85Grtt^Q?)A/Im&BGB:Y>GnO{svT*N-ŨvKon4: UfD>Ncs/y&/=H4N6{+;X 6?6yӽxv}*xWHjWouASVo_>.<xz-EF#Jdr_tƻZy'U#B u?U g"U{Q9V)Q(IuvSįBۋTٷpCESwXƹU*J΢)r 8 MOr|L )@O SmJ4f?OQbVv' r`'\e;~0BMo_9ܫǘ/hgo uט7-l V=[״VYg:C_ 0s w{u^gh7Y[lט:Ѷ#:vMEzs:Yhf~7-5쎵X/{LE7yi6~|bw{S7ʯwqEbω]'M<X,Gn5;'v-mb| Dqį\cNfxpK= %1ri- G9}ab|~u_SQaۧ:~7WcJuģ)(#]DjwZx4?)~4>}~GOz?w|*űC2!1U߂g|s_ ?Xt&TWOS`Xb-=[B~\{-{}P?uo @.~$d%mA_lVy~mZ׭E8Ft:Nx 77> nn'G.'G.'G.'G.'G.'G.'G.'G.'G.'Gy˨.v޺jDclYv5ȩ]aͰж*vQmYv51,vԮfXh[](ɶ,v[] rjWz`3,ݮFd[]h-ݮ9+v=]fk%YlbRKfkBNUfnN9愛nNXlbR V*6XRSUلnN9愛n6GV*6Xi&/ejTl6v)TUl6愛nN9愛Q&/e`bK/M_ 9UM9愛nN9z`sT`[]im]v51,vԮfXh[](ɶ,v[] rjWz`3,ݮFd[]h-ݮ9+v=VnW#J-ݮF4ƖnWvt:Nt:Nt:=n:IENDB`{ "start_url": "network.html", "domain": "http://microsoft.com", "name": "Network", "version": "1.0", "f12": { "localized_tooltip_id": 4001, "tab_image": "tabIcon.png", "resource_aliases" : { } } }PNG  IHDR@] cHRMz%u0`:o_F pHYsod $IDATx^?޶ Ha t xxu, ف7 r.Wx p,!;sPwK$|Ō4)Qy4 `0 `0 `>}z=Z|=FXBj]zkso@eIOPǨi$<&.A؎Tuʚ~~ ɹB`N=>p6@yǠ~>C꽿E6sa_=B$Gǃx O/"/5cir@TǏOSV#oPO)Ιq!jџPO)d˧>乑' KcSAp,{ Ĭl{y擅81"4| «7 ԑnJ\s u%y~(7IC]\c9E /N@> p$ui3J8@z@ mUQyyv^ȶh0?83|\@G 'M J${y/7ucAN!9jbXa^P,/Xk/n͹5)Uס Z qZLq=gm >M OĶm> ;׋; PrE8kUFr?< PFūз?Xu-V7U\T>_xuEf/bT{/ϻe]}` k/iv0!;k,KwEκKwFY@=5hs b ?{QT cY&Wم5+Hm_,"vrE&3*ΆdOD<9^&Qq6ѡfq3{+D0bCMAӶ̓swg/*&\ѡ6 lfT\@ho0 ŷvytpWu8JSd;`LH|UxQS>7ߋ,EEb!9q 7| &^d;a917~Zqz[h6asbnӿ✮ ^/ӛx2Qq1-̃9)kp}ꍾևal\6?ûo!^3C0%a퇇ӶAzxfT\ L]u;pΒH=|X{aϗ+'R-bs]ˏe w=O""d:*EiwpQ64W?# ̎)"W?#Z?+]_ "d>*ܸR-ހγX?*9XVZ |{)1֏`֟V3epf?`rDPA|*~T\sH ϟn}g'a `Yj18+2NPgT\s$R- ໜ ՛BZ ;ΊcggEUxti?՟brD"$_ @؍@8e+pX|R/0'VmXr}{nb+pv \3WNo@M/$72P r@oe[k2P NPi2P6l|rq/ybaLcs3[7T8vӯ[n +k̦ 䀘ʸ<L`AA?a3?P;DGA}?<Sn(%|u|/nqOs]>?cL.i;GM ~okԿz=m ֦ςBw!.A.O"@@Ax\rлŲ*hOJ+ ❶ RnsEke Q7wH//,+ ❶ c;:O'CNYbP'^i=h#ۜ6Lm??*cABkSqO8o!#D._zOc iyMů@^M<\ [|Y|乑VE) t 8en(AӶYk) ~!a](/6u 7޾\Cyɭ;Q΋}-~)H/?5x?+q][2\}۹?5 ,ԑzwn5z~tW"3ԑzrԑzwn9S{ gImspSP9nI.Txi!Tu