1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5265],{25265:(e,o,t)=>{t.r(o),t.d(o,{default:()=>x});var r=t(95155),n=t(92836),a=t(91611),l=t(4634),i=t(12115),c=t(30049),d=t(49289),m=t(28220),s=t(24285),g=t(12675),u=e=>{var{theme:o,settings:t={},styles:r=[]}=e,a={".cm-gutters":{}},l={};t.background&&(l.backgroundColor=t.background),t.backgroundImage&&(l.backgroundImage=t.backgroundImage),t.foreground&&(l.color=t.foreground),t.fontSize&&(l.fontSize=t.fontSize),(t.background||t.foreground)&&(a["&"]=l),t.fontFamily&&(a["&.cm-editor .cm-scroller"]={fontFamily:t.fontFamily}),t.gutterBackground&&(a[".cm-gutters"].backgroundColor=t.gutterBackground),t.gutterForeground&&(a[".cm-gutters"].color=t.gutterForeground),t.gutterBorder&&(a[".cm-gutters"].borderRightColor=t.gutterBorder),t.caret&&(a[".cm-content"]={caretColor:t.caret},a[".cm-cursor, .cm-dropCursor"]={borderLeftColor:t.caret});var i={};t.gutterActiveForeground&&(i.color=t.gutterActiveForeground),t.lineHighlight&&(a[".cm-activeLine"]={backgroundColor:t.lineHighlight},i.backgroundColor=t.lineHighlight),a[".cm-activeLineGutter"]=i,t.selection&&(a["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:t.selection+" !important"}),t.selectionMatch&&(a["& .cm-selectionMatch"]={backgroundColor:t.selectionMatch});var c=n.Lz.theme(a,{dark:"dark"===o}),m=d.cr.define(r);return[c,(0,d.y9)(m)]};let h=[{name:"groq",loader:()=>Promise.all([t.e(2751),t.e(2398)]).then(t.bind(t,72398)).then(({javascriptLanguage:e})=>e)},{name:"javascript",loader:()=>Promise.all([t.e(2751),t.e(2398)]).then(t.bind(t,72398)).then(({javascript:e})=>e({jsx:!1}))},{name:"jsx",loader:()=>Promise.all([t.e(2751),t.e(2398)]).then(t.bind(t,72398)).then(({javascript:e})=>e({jsx:!0}))},{name:"typescript",loader:()=>Promise.all([t.e(2751),t.e(2398)]).then(t.bind(t,72398)).then(({javascript:e})=>e({jsx:!1,typescript:!0}))},{name:"tsx",loader:()=>Promise.all([t.e(2751),t.e(2398)]).then(t.bind(t,72398)).then(({javascript:e})=>e({jsx:!0,typescript:!0}))},{name:"php",loader:()=>Promise.all([t.e(2751),t.e(2398),t.e(136),t.e(2555)]).then(t.bind(t,82555)).then(({php:e})=>e())},{name:"sql",loader:()=>Promise.all([t.e(2751),t.e(2904)]).then(t.bind(t,72904)).then(({sql:e})=>e())},{name:"mysql",loader:()=>Promise.all([t.e(2751),t.e(2904)]).then(t.bind(t,72904)).then(({sql:e,MySQL:o})=>e({dialect:o}))},{name:"json",loader:()=>Promise.all([t.e(2751),t.e(6752)]).then(t.bind(t,76752)).then(({json:e})=>e())},{name:"markdown",loader:()=>Promise.all([t.e(2751),t.e(2398),t.e(136),t.e(609)]).then(t.bind(t,70609)).then(({markdown:e})=>e())},{name:"java",loader:()=>Promise.all([t.e(2751),t.e(1735)]).then(t.bind(t,41735)).then(({java:e})=>e())},{name:"html",loader:()=>Promise.all([t.e(2751),t.e(2398),t.e(136)]).then(t.bind(t,136)).then(({html:e})=>e())},{name:"csharp",loader:()=>t.e(2404).then(t.bind(t,62404)).then(({csharp:e})=>d.Tg.define(e))},{name:"sh",loader:()=>t.e(8108).then(t.bind(t,18108)).then(({shell:e})=>d.Tg.define(e))},{name:"css",loader:()=>t.e(1533).then(t.bind(t,31533)).then(({css:e})=>d.Tg.define(e))},{name:"scss",loader:()=>t.e(1533).then(t.bind(t,31533)).then(({css:e})=>d.Tg.define(e))},{name:"sass",loader:()=>Promise.all([t.e(1533),t.e(1144)]).then(t.bind(t,98763)).then(({sass:e})=>d.Tg.define(e))},{name:"ruby",loader:()=>t.e(8318).then(t.bind(t,58318)).then(({ruby:e})=>d.Tg.define(e))},{name:"python",loader:()=>t.e(5124).then(t.bind(t,85124)).then(({python:e})=>d.Tg.define(e))},{name:"xml",loader:()=>t.e(1179).then(t.bind(t,51179)).then(({xml:e})=>d.Tg.define(e))},{name:"yaml",loader:()=>t.e(1125).then(t.bind(t,81125)).then(({yaml:e})=>d.Tg.define(e))},{name:"golang",loader:()=>t.e(6048).then(t.bind(t,86048)).then(({go:e})=>d.Tg.define(e))},{name:"text",loader:()=>{}},{name:"batch",loader:()=>{}}];function f(e){return"neutral"!==e.tone&&"suggest"!==e.tone?e.tone:"neutral"===e.tone?"default":"primary"}let b="cm-highlight-line",p=m.Pe.define(),k=m.Pe.define(),A=m.sU.define({create:()=>n.NZ.none,update(e,o){for(let t of(e=e.map(o.changes),o.effects))t.is(p)&&(e=e.update({add:[_.range(t.value)]})),t.is(k)&&(e=e.update({filter:e=>e!==t.value}));return e},toJSON(e,o){let t=[],r=e.iter();for(;r.value;){let e=o.doc.lineAt(r.from).number;t.includes(e)||t.push(e),r.next()}return t}
1,fromJSON(e,o){let t=o.doc.lines,r=e.filter(e=>e<=t).map(e=>_.range(o.doc.line(e).from));r.sort((e,o)=>e.from-o.from);try{return n.NZ.none.update({add:r})}catch(e){return console.error(e),n.NZ.none}},provide:e=>n.Lz.decorations.from(e)}),_=n.NZ.line({class:b}),y={highlight:A},N=e=>{let o=function(e){let{themeCtx:o}=e,t=f(o),r={color:o.theme.color.dark[t]},a={color:o.theme.color.light[t]};return n.Lz.baseTheme({".cm-lineNumbers":{cursor:"default"},".cm-line.cm-line":{position:"relative"},[`.${b}::before`]:{position:"absolute",top:0,bottom:0,left:0,right:0,zIndex:-3,content:"''",boxSizing:"border-box"},[`&dark .${b}::before`]:{background:(0,s.B3)(r.color.muted.caution.pressed.bg,.5)},[`&light .${b}::before`]:{background:(0,s.B3)(a.color.muted.caution.pressed.bg,.75)}})}({themeCtx:e.theme});return[A,e.readOnly?[]:(0,n.$K)({domEventHandlers:{mousedown:(o,t)=>{let r=o.state.doc.lineAt(t.from),n=!1;return o.state.field(A).between(r.from,r.to,(e,o,t)=>{if(t)return n=!0,!1}),n?o.dispatch({effects:k.of(r.from)}):o.dispatch({effects:p.of(r.from)}),e?.onHighlightChange&&e.onHighlightChange(o.state.toJSON(y).highlight),!0}}}),o]},x=(0,i.forwardRef)(function(e,o){let{basicSetup:t,highlightLines:d,languageMode:m,onHighlightChange:b,readOnly:A,value:_,...x}=e,v=(0,a.GG)(),B=function(){let e=(0,a.DP)();return(0,i.useMemo)(()=>{let{code:o}=e.sanity.fonts,{base:t,card:r,dark:n,syntax:a}=e.sanity.color;return u({theme:n?"dark":"light",settings:{background:r.enabled.bg,foreground:r.enabled.code.fg,lineHighlight:r.enabled.bg,fontFamily:o.family,caret:t.focusRing,selection:(0,s.B3)(t.focusRing,.2),selectionMatch:(0,s.B3)(t.focusRing,.4),gutterBackground:r.disabled.bg,gutterForeground:r.disabled.code.fg,gutterActiveForeground:r.enabled.fg},styles:[{tag:[g._A.heading,g._A.heading2,g._A.heading3,g._A.heading4,g._A.heading5,g._A.heading6],color:r.enabled.fg},{tag:g._A.angleBracket,color:r.enabled.code.fg},{tag:g._A.atom,color:a.keyword},{tag:g._A.attributeName,color:a.attrName},{tag:g._A.bool,color:a.boolean},{tag:g._A.bracket,color:r.enabled.code.fg},{tag:g._A.className,color:a.className},{tag:g._A.comment,color:a.comment},{tag:g._A.definition(g._A.typeName),color:a.function},{tag:[g._A.definition(g._A.variableName),g._A.function(g._A.variableName),g._A.className,g._A.attributeName],color:a.function},{tag:[g._A.function(g._A.propertyName),g._A.propertyName],color:a.function},{tag:g._A.keyword,color:a.keyword},{tag:g._A.null,color:a.number},{tag:g._A.number,color:a.number},{tag:g._A.meta,color:r.enabled.code.fg},{tag:g._A.operator,color:a.operator},{tag:g._A.propertyName,color:a.property},{tag:[g._A.string,g._A.special(g._A.brace)],color:a.string},{tag:g._A.tagName,color:a.className},{tag:g._A.typeName,color:a.keyword}]})},[e])}(),[C,P]=(0,i.useState)(void 0),z=function(){let e=(0,a.GG)();return(0,i.useMemo)(()=>{let o=f(e),t={color:e.theme.color.dark[o]},r={color:e.theme.color.light[o]};return n.Lz.baseTheme({"&.cm-editor":{height:"100%"},"&.cm-editor.cm-focused":{outline:"none"},"&.cm-editor.cm-focused .cm-matchingBracket":{backgroundColor:"transparent"},"&.cm-editor.cm-focused .cm-nonmatchingBracket":{backgroundColor:"transparent"},"&dark.cm-editor.cm-focused .cm-matchingBracket":{outline:`1px solid ${t.color.base.border}`},"&dark.cm-editor.cm-focused .cm-nonmatchingBracket":{outline:`1px solid ${t.color.base.border}`},"&light.cm-editor.cm-focused .cm-matchingBracket":{outline:`1px solid ${r.color.base.border}`},"&light.cm-editor.cm-focused .cm-nonmatchingBracket":{outline:`1px solid ${r.color.base.border}`},"& .cm-lineNumbers .cm-gutterElement":{minWidth:"32px !important",padding:"0 8px !important"},"& .cm-gutter.cm-foldGutter":{width:"0px !important"},"&dark .cm-gutters":{color:`${(0,s.B3)(t.color.card.enabled.code.fg,.5)} !important`,borderRight:`1px solid ${(0,s.B3)(t.color.base.border,.5)}`},"&light .cm-gutters":{color:`${(0,s.B3)(r.color.card.enabled.code.fg,.5)} !important`,borderRight:`1px solid ${(0,s.B3)(r.color.base.border,.5)}`}})},[e])}(),$=function(e){let{fontSize:o}=e,t=(0,a.DP)();return(0,i.useMemo)(()=>{let{code:e}=t.sanity.fonts,{fontSize:r,lineHeight:l}=e.sizes[o]||e.sizes[2];return n.Lz.baseTheme({"&":{fontSize:(0,a.D0)(r)},"& .cm-scroller":{lineHeight:`${l/r} !important`}})},[o,t])}({fontSize:1}),w=function(e){let o=(0,i.useContext)(c.Zy),[t,r]=(0,i.useState)();return(0,i.useEffect)(()=>{let t=[...o?.codeModes??[],...h].find(o=>o.name===e);t?.loader||console.warn(`Found no codeMode for language mode ${e}, syntax highlighting will be disabled.`);let n=!0;return Promise.resolve(t?.loader()).then(e=>{n&&r(e)}).catch(o=>{console.error(`Failed to load language mode ${e}`,o),n&&r(void 0)}),()=>{n=!1}},[e,o]),t}(m),M=(0,i.useMemo)(()=>N({onHighlightChange:b,readOnly:A,theme:v}),[b,A,v]),S=(0,i.useMemo)(()=>{let e=[z,$,M,n.Lz.lineWrapping];return w?[...e,w]:e},[$,M,w,z]);(0,i.useEffect)(()=>{C&&function(e,o){let t=e.state.doc,r=Array.from({length:t.lines},(e,o)=>o+1);e.dispatch({effects:r.map(e=>{let r=t.line(e);return o?.includes(e)?p.of(r.from):k.of(r.from)})})}(C,d??[])},[C,d,_]);let T=(0,i.useMemo)(()=>({json:{doc:_??"",selection:{main:0,ranges:[{anchor:0,head:0}]},highlight:d??[]},fields:y}),[]),F=(0,i.useCallback)(e=>{P(e)},[]),L=(0,i.useMemo)(()=>t??{highlightActiveLine:!1},[t]);return(0,r.jsx)(l.Ay,{...x,value:_,ref:o,extensions:S,theme:B,onCreateEditor:F,initialState:T,basicSetup:L})})}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.