"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[123],{1123:function(e,t,n){var i=n(709),r=n.n(i),l=n(4344),o=n(6396),s=n(6662);function a(e,t,n){const i=function(e,t){if(!t)return c(e,(e=>!e.isDeprecated));return c(c(e.map((e=>({proximity:p(u(e.text),t),entry:e}))),(e=>e.proximity<=2)),(e=>!e.entry.isDeprecated)).sort(((e,t)=>(e.entry.isDeprecated?1:0)-(t.entry.isDeprecated?1:0)||e.proximity-t.proximity||e.entry.text.length-t.entry.text.length)).map((e=>e.entry))}(n,u(t.string));if(!i)return;const r=null!==t.type&&/"|\w/.test(t.string[0])?t.start:t.end;return{list:i,from:{line:e.line,ch:r},to:{line:e.line,ch:t.end}}}function c(e,t){const n=e.filter(t);return 0===n.length?e:n}function u(e){return e.toLowerCase().replaceAll(/\W/g,"")}function p(e,t){let n=function(e,t){let n,i;const r=[],l=e.length,o=t.length;for(n=0;n<=l;n++)r[n]=[n];for(i=1;i<=o;i++)r[0][i]=i;for(n=1;n<=l;n++)for(i=1;i<=o;i++){const l=e[n-1]===t[i-1]?0:1;r[n][i]=Math.min(r[n-1][i]+1,r[n][i-1]+1,r[n-1][i-1]+l),n>1&&i>1&&e[n-1]===t[i-2]&&e[n-2]===t[i-1]&&(r[n][i]=Math.min(r[n][i],r[n-2][i-2]+l))}return r[l][o]}(t,e);return e.length>t.length&&(n-=e.length-t.length-1,n+=0===e.indexOf(t)?0:.5),n}r().registerHelper("hint","graphql-variables",((e,t)=>{const n=e.getCursor(),i=e.getTokenAt(n),c=function(e,t,n){const i="Invalid"===t.state.kind?t.state.prevState:t.state,{kind:r,step:c}=i;if("Document"===r&&0===c)return a(e,t,[{text:"{"}]);const{variableToType:u}=n;if(!u)return;const p=function(e,t){const n={type:null,fields:null};return(0,s.A)(t,(t=>{switch(t.kind){case"Variable":n.type=e[t.name];break;case"ListValue":{const e=n.type?(0,l.yl)(n.type):void 0;n.type=e instanceof l.KT?e.ofType:null;break}case"ObjectValue":{const e=n.type?(0,l.MR)(n.type):void 0;n.fields=e instanceof l.zP?e.getFields():null;break}case"ObjectField":{const e=t.name&&n.fields?n.fields[t.name]:null;n.type=null==e?void 0:e.type;break}}})),n}(u,t.state);if("Document"===r||"Variable"===r&&0===c)return a(e,t,Object.keys(u).map((e=>({text:`"${e}": `,type:u[e]}))));if(("ObjectValue"===r||"ObjectField"===r&&0===c)&&p.fields)return a(e,t,Object.keys(p.fields).map((e=>p.fields[e])).map((e=>({text:`"${e.name}": `,type:e.type,description:e.description}))));if("StringValue"===r||"NumberValue"===r||"BooleanValue"===r||"NullValue"===r||"ListValue"===r&&1===c||"ObjectField"===r&&2===c||"Variable"===r&&2===c){const n=p.type?(0,l.MR)(p.type):void 0;if(n instanceof l.zP)return a(e,t,[{text:"{"}]);if(n instanceof l.Zb)return a(e,t,n.getValues().map((e=>({text:`"${e.name}"`,type:n,description:e.description}))));if(n===o.kk)return a(e,t,[{text:"true",type:o.kk,description:"Not false."},{text:"false",type:o.kk,description:"Not true."}])}}(n,i,t);return(null==c?void 0:c.list)&&c.list.length>0&&(c.from=r().Pos(c.from.line,c.from.ch),c.to=r().Pos(c.to.line,c.to.ch),r().signal(e,"hasCompletion",e,c,i)),c}))},6662:function(e,t,n){function i(e,t){const n=[];let i=e;for(;null==i?void 0:i.kind;)n.push(i),i=i.prevState;for(let e=n.length-1;e>=0;e--)t(n[e])}n.d(t,{A:function(){return i}})}}]);
//# sourceMappingURL=123.js.map