import{o as e}from"./chunk-6hGRweTZ.js";import{t}from"./codemirror-mxAyinHX.js";import{a as n,i as r}from"./definition-C7QrKMH2.js";import{a as i,i as a,n as o,o as s,r as c,t as l}from"./SchemaReference-DSzhn1RO.js";import"./info-addon-B6CsxfLw.js";e(t()).default.registerHelper(`info`,`graphql`,(e,t)=>{if(!t.schema||!e.state)return;let{kind:n,step:r}=e.state,i=s(t.schema,e.state);if(n===`Field`&&r===0&&i.fieldDef||n===`AliasedField`&&r===2&&i.fieldDef||n===`ObjectField`&&r===0&&i.fieldDef){let e=document.createElement(`div`);e.className=`CodeMirror-info-header`,u(e,i,t);let n=document.createElement(`div`);return n.append(e),_(n,t,i.fieldDef),n}if(n===`Directive`&&r===1&&i.directiveDef){let e=document.createElement(`div`);e.className=`CodeMirror-info-header`,f(e,i,t);let n=document.createElement(`div`);return n.append(e),_(n,t,i.directiveDef),n}if(n===`Argument`&&r===0&&i.argDef){let e=document.createElement(`div`);e.className=`CodeMirror-info-header`,p(e,i,t);let n=document.createElement(`div`);return n.append(e),_(n,t,i.argDef),n}if(n===`EnumValue`&&i.enumValue?.description){let e=document.createElement(`div`);e.className=`CodeMirror-info-header`,m(e,i,t);let n=document.createElement(`div`);return n.append(e),_(n,t,i.enumValue),n}if(n===`NamedType`&&i.type&&i.type.description){let e=document.createElement(`div`);e.className=`CodeMirror-info-header`,g(e,i,t,i.type);let n=document.createElement(`div`);return n.append(e),_(n,t,i.type),n}});function u(e,t,n){d(e,t,n),h(e,t,n,t.type)}function d(e,t,n){y(e,t.fieldDef?.name||``,`field-name`,n,a(t))}function f(e,t,n){y(e,`@`+(t.directiveDef?.name||``),`directive-name`,n,o(t))}function p(e,t,n){y(e,t.argDef?.name||``,`arg-name`,n,l(t)),h(e,t,n,t.inputType)}function m(e,t,n){let r=t.enumValue?.name||``;g(e,t,n,t.inputType),y(e,`.`),y(e,r,`enum-value`,n,c(t))}function h(e,t,a,o){let s=document.createElement(`span`);s.className=`type-name-pill`,o instanceof n?(g(s,t,a,o.ofType),y(s,`!`)):o instanceof r?(y(s,`[`),g(s,t,a,o.ofType),y(s,`]`)):y(s,o?.name||``,`type-name`,a,i(t,o)),e.append(s)}function g(e,t,a,o){o instanceof n?(g(e,t,a,o.ofType),y(e,`!`)):o instanceof r?(y(e,`[`),g(e,t,a,o.ofType),y(e,`]`)):y(e,o?.name||``,`type-name`,a,i(t,o))}function _(e,t,n){let{description:r}=n;if(r){let n=document.createElement(`div`);n.className=`info-description`,t.renderDescription?n.innerHTML=t.renderDescription(r):n.append(document.createTextNode(r)),e.append(n)}v(e,t,n)}function v(e,t,n){let r=n.deprecationReason;if(r){let n=document.createElement(`div`);n.className=`info-deprecation`,e.append(n);let i=document.createElement(`span`);i.className=`info-deprecation-label`,i.append(document.createTextNode(`Deprecated`)),n.append(i);let a=document.createElement(`div`);a.className=`info-deprecation-reason`,t.renderDescription?a.innerHTML=t.renderDescription(r):a.append(document.createTextNode(r)),n.append(a)}}function y(e,t,n=``,r={onClick:null},i=null){if(n){let{onClick:a}=r,o;a?(o=document.createElement(`a`),o.href=`javascript:void 0`,o.addEventListener(`click`,e=>{e.preventDefault(),a(i,e)})):o=document.createElement(`span`),o.className=n,o.append(document.createTextNode(t)),e.append(o)}else e.append(document.createTextNode(t))}
//# sourceMappingURL=info-C2K7F8NV.js.map