import { RendererOptions } from '@vue/runtime-core' ; export const svgNS = 'http://www.w3.org/2000/svg' ; const doc = ( typeof document !== 'undefined' ? document : null ) as Document ; const staticTemplateCache = new Map < string , DocumentFragment > ( ) ; export const nodeOps = { insert : ( child , parent , anchor ) => { parent . insertBefore ( child , anchor || null ) ; } , remove : child => { const parent = child . parentNode ; if ( parent ) { parent . removeChild ( child ) ; } } , createElement : ( tag , isSVG , is , props ) : Element => { const el = isSVG ? doc . createElementNS ( svgNS , tag ) : doc . createElement ( tag , is ? { is } : undefined ) ; if ( tag === 'select' && props && props . multiple != null ) { ; ( el as HTMLSelectElement ) . setAttribute ( 'multiple' , props . multiple ) ; } return el ; } , createText : text => doc . createTextNode ( text ) , createComment : text => doc . createComment ( text ) , setText : ( node , text ) => { node . nodeValue = text ; } , setElementText : ( el , text ) => { el . textContent = text ; } , parentNode : node => node . parentNode as Element | null , nextSibling : node => node . nextSibling , querySelector : selector => doc . querySelector ( selector ) , setScopeId ( el , id ) { el . setAttribute ( id , '' ) ; } , cloneNode ( el ) { const cloned = el . cloneNode ( true ) ; if ( `_value` in el ) { ; ( cloned as any ) . _value = ( el as any ) . _value ; } return cloned ; } , insertStaticContent ( content , parent , anchor , isSVG ) { const before = anchor ? anchor . previousSibling : parent . lastChild ; let template = staticTemplateCache . get ( content ) ; if ( ! template ) { const t = doc . createElement ( 'template' ) ; t . innerHTML = isSVG ? `<svg>${ content }</svg>` : content ; template = t . content ; if ( isSVG ) { const wrapper = template . firstChild ! ; while ( wrapper . firstChild ) { template . appendChild ( wrapper . firstChild ) ; } template . removeChild ( wrapper ) ; } staticTemplateCache . set ( content , template ) ; } parent . insertBefore ( template . cloneNode ( true ) , anchor ) ; return [ before ? before . nextSibling ! : parent . firstChild ! , anchor ? anchor . previousSibling ! : parent . lastChild ! ] ; } } ;