@aws-amplify/amplify-appsync-simulator
Version:
An AppSync Simulator to test AppSync API.
2 lines • 4.16 kB
JavaScript
(self.webpackChunk_aws_amplify_amplify_graphiql_explorer=self.webpackChunk_aws_amplify_amplify_graphiql_explorer||[]).push([[2],{1002:(e,n,t)=>{!function(e){"use strict";var n={},t=/[^\s\u00a0]/,l=e.Pos,i=e.cmpPos;function o(e){var n=e.search(t);return-1==n?0:n}function a(e,n,t){return/\bstring\b/.test(e.getTokenTypeAt(l(n.line,0)))&&!/^[\'\"\`]/.test(t)}function r(e,n){var t=e.getMode();return!1!==t.useInnerComments&&t.innerMode?e.getModeAt(n):t}e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension("toggleComment",(function(e){e||(e=n);for(var t=this,i=1/0,o=this.listSelections(),a=null,r=o.length-1;r>=0;r--){var m=o[r].from(),c=o[r].to();m.line>=i||(c.line>=i&&(c=l(i,0)),i=m.line,null==a?t.uncomment(m,c,e)?a="un":(t.lineComment(m,c,e),a="line"):"un"==a?t.uncomment(m,c,e):t.lineComment(m,c,e))}})),e.defineExtension("lineComment",(function(e,i,m){m||(m=n);var c=this,s=r(c,e),g=c.getLine(e.line);if(null!=g&&!a(c,e,g)){var f=m.lineComment||s.lineComment;if(f){var h=Math.min(0!=i.ch||i.line==e.line?i.line+1:i.line,c.lastLine()+1),u=null==m.padding?" ":m.padding,d=m.commentBlankLines||e.line==i.line;c.operation((function(){if(m.indent){for(var n=null,i=e.line;i<h;++i){var a=-1===(r=c.getLine(i)).search(t)?r:r.slice(0,o(r));(null==n||n.length>a.length)&&(n=a)}for(i=e.line;i<h;++i){var r=c.getLine(i),s=n.length;(d||t.test(r))&&(r.slice(0,s)!=n&&(s=o(r)),c.replaceRange(n+f+u,l(i,0),l(i,s)))}}else for(i=e.line;i<h;++i)(d||t.test(c.getLine(i)))&&c.replaceRange(f+u,l(i,0))}))}else(m.blockCommentStart||s.blockCommentStart)&&(m.fullLines=!0,c.blockComment(e,i,m))}})),e.defineExtension("blockComment",(function(e,o,a){a||(a=n);var m=this,c=r(m,e),s=a.blockCommentStart||c.blockCommentStart,g=a.blockCommentEnd||c.blockCommentEnd;if(s&&g){if(!/\bcomment\b/.test(m.getTokenTypeAt(l(e.line,0)))){var f=Math.min(o.line,m.lastLine());f!=e.line&&0==o.ch&&t.test(m.getLine(f))&&--f;var h=null==a.padding?" ":a.padding;e.line>f||m.operation((function(){if(0!=a.fullLines){var n=t.test(m.getLine(f));m.replaceRange(h+g,l(f)),m.replaceRange(s+h,l(e.line,0));var r=a.blockCommentLead||c.blockCommentLead;if(null!=r)for(var u=e.line+1;u<=f;++u)(u!=f||n)&&m.replaceRange(r+h,l(u,0))}else{var d=0==i(m.getCursor("to"),o),p=!m.somethingSelected();m.replaceRange(g,o),d&&m.setSelection(p?o:m.getCursor("from"),o),m.replaceRange(s,e)}}))}}else(a.lineComment||c.lineComment)&&0!=a.fullLines&&m.lineComment(e,o,a)})),e.defineExtension("uncomment",(function(e,i,o){o||(o=n);var a,m=this,c=r(m,e),s=Math.min(0!=i.ch||i.line==e.line?i.line:i.line-1,m.lastLine()),g=Math.min(e.line,s),f=o.lineComment||c.lineComment,h=[],u=null==o.padding?" ":o.padding;e:if(f){for(var d=g;d<=s;++d){var p=m.getLine(d),C=p.indexOf(f);if(C>-1&&!/comment/.test(m.getTokenTypeAt(l(d,C+1)))&&(C=-1),-1==C&&t.test(p))break e;if(C>-1&&t.test(p.slice(0,C)))break e;h.push(p)}if(m.operation((function(){for(var e=g;e<=s;++e){var n=h[e-g],t=n.indexOf(f),i=t+f.length;t<0||(n.slice(i,i+u.length)==u&&(i+=u.length),a=!0,m.replaceRange("",l(e,t),l(e,i)))}})),a)return!0}var v=o.blockCommentStart||c.blockCommentStart,k=o.blockCommentEnd||c.blockCommentEnd;if(!v||!k)return!1;var b=o.blockCommentLead||c.blockCommentLead,L=m.getLine(g),x=L.indexOf(v);if(-1==x)return!1;var R=s==g?L:m.getLine(s),O=R.indexOf(k,s==g?x+v.length:0),T=l(g,x+1),_=l(s,O+1);if(-1==O||!/comment/.test(m.getTokenTypeAt(T))||!/comment/.test(m.getTokenTypeAt(_))||m.getRange(T,_,"\n").indexOf(k)>-1)return!1;var y=L.lastIndexOf(v,e.ch),S=-1==y?-1:L.slice(0,e.ch).indexOf(k,y+v.length);if(-1!=y&&-1!=S&&S+k.length!=e.ch)return!1;S=R.indexOf(k,i.ch);var E=R.slice(i.ch).lastIndexOf(v,S-i.ch);return y=-1==S||-1==E?-1:i.ch+E,(-1==S||-1==y||y==i.ch)&&(m.operation((function(){m.replaceRange("",l(s,O-(u&&R.slice(O-u.length,O)==u?u.length:0)),l(s,O+k.length));var e=x+v.length;if(u&&L.slice(e,e+u.length)==u&&(e+=u.length),m.replaceRange("",l(g,x),l(g,e)),b)for(var n=g+1;n<=s;++n){var i=m.getLine(n),o=i.indexOf(b);if(-1!=o&&!t.test(i.slice(0,o))){var a=o+b.length;u&&i.slice(a,a+u.length)==u&&(a+=u.length),m.replaceRange("",l(n,o),l(n,a))}}})),!0)}))}(t(8355))}}]);
//# sourceMappingURL=2.36ab9d3f.chunk.js.map