'use strict';var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(b,h,e){b instanceof String&&(b=String(b));for(var k=b.length,g=0;gc.line&&document.querySelector&&(d=a.display.wrapper.querySelector(".CodeMirror-dialog"))&&d.getBoundingClientRect().bottom-4>a.cursorCoords(c,"window").top&&((t=d).style.opacity=.4)}))};y(a,'Search: (Use /re/ syntax for regexp search)',g,h,function(c,d){var f=b.keyName(c),e=b.keyMap[a.getOption("keyMap")][f];e||(e= a.getOption("extraKeys")[f]);if("findNext"==e||"findPrev"==e||"findPersistentNext"==e||"findPersistentPrev"==e)b.e_stop(c),p(a,k(a),d),a.execCommand(e);else if("find"==e||"findPersistent"==e)b.e_stop(c),h(d,c)});f&&g&&(p(a,d,g),q(a,c))}else r(a,'Search: (Use /re/ syntax for regexp search)',"Search for:",g,function(b){b&& !d.query&&a.operation(function(){p(a,d,b);d.posFrom=d.posTo=a.getCursor();q(a,c)})})}function q(a,c,e){a.operation(function(){var f=k(a),d=l(a,f.query,c?f.posFrom:f.posTo);if(!d.find(c)&&(d=l(a,f.query,c?b.Pos(a.lastLine()):b.Pos(a.firstLine(),0)),!d.find(c)))return;a.setSelection(d.from(),d.to());a.scrollIntoView({from:d.from(),to:d.to()},20);f.posFrom=d.from();f.posTo=d.to();e&&e(d.from(),d.to())})}function n(a){a.operation(function(){var b=k(a);if(b.lastQuery=b.query)b.query=b.queryText=null,a.removeOverlay(b.overlay), b.annotate&&(b.annotate.clear(),b.annotate=null)})}function w(a,b,e){a.operation(function(){for(var c=l(a,b);c.findNext();)if("string"!=typeof b){var d=a.getRange(c.from(),c.to()).match(b);c.replace(e.replace(/\$(\d)/g,function(a,b){return d[b]}))}else c.replace(e)})}function x(a,b){if(!a.getOption("readOnly")){var c=a.getSelection()||k(a).lastQuery,e=''+(b?"Replace all:":"Replace:")+"";r(a,e+' (Use /re/ syntax for regexp search)', e,c,function(c){c&&(c=v(c),r(a,'With: ',"Replace with:","",function(e){e=u(e);if(b)w(a,c,e);else{n(a);var d=l(a,c,a.getCursor("from")),f=function(){var b=d.from(),h;if(!(h=d.findNext())&&(d=l(a,c),!(h=d.findNext())||b&&d.from().line==b.line&&d.from().ch==b.ch))return;a.setSelection(d.from(),d.to());a.scrollIntoView({from:d.from(),to:d.to()});z(a,'Replace? ', "Replace?",[function(){g(h)},f,function(){w(a,c,e)}])},g=function(a){d.replace("string"==typeof c?e:e.replace(/\$(\d)/g,function(b,c){return a[c]}));f()};f()}}))})}}b.commands.find=function(a){n(a);m(a)};b.commands.findPersistent=function(a){n(a);m(a,!1,!0)};b.commands.findPersistentNext=function(a){m(a,!1,!0,!0)};b.commands.findPersistentPrev=function(a){m(a,!0,!0,!0)};b.commands.findNext=m;b.commands.findPrev=function(a){m(a,!0)};b.commands.clearSearch=n;b.commands.replace=x;b.commands.replaceAll= function(a){x(a,!0)}});