UNPKG

@popeindustries/lit-html

Version:

Seamlessly and efficiently use @popeindustries/lit-html-server rendered HTML to hydrate lit-html templates in the browser

7 lines (6 loc) 928 B
/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause */import{html as S,svg as h}from"./lit-html.js";const s=Symbol.for(""),m=t=>{if(t?.r===s)return t?._$litStatic$},y=t=>({_$litStatic$:t,r:s}),w=t=>{if(t._$litStatic$!==void 0)return t._$litStatic$;throw new Error(`Value passed to 'literal' function must be a 'literal' result: ${t}. Use 'unsafeStatic' to pass non-literal values, but take care to ensure page security.`)},V=(t,...e)=>({_$litStatic$:e.reduce((n,o,r)=>n+w(o)+t[r+1],t[0]),r:s}),$=new Map,p=t=>(e,...n)=>{const o=n.length;let r,a;const c=[],u=[];let i=0,d=!1,l;for(;i<o;){for(l=e[i];i<o&&(a=n[i],(r=m(a))!==void 0);)l+=r+e[++i],d=!0;u.push(a),c.push(l),i++}if(i===o&&c.push(e[o]),d){const f=c.join("$$lit$$");e=$.get(f),e===void 0&&(c.raw=c,$.set(f,e=c)),n=u}return t(e,...n)},_=p(S),b=p(h);export{_ as html,V as literal,b as svg,y as unsafeStatic,p as withStatic};