payload-live-preview 2.1.2 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/README.md +191 -62
  2. package/dist/adapters/astro/index.d.ts +7 -7
  3. package/dist/adapters/astro/index.js +1 -1
  4. package/dist/adapters/astro/index.js.map +1 -1
  5. package/dist/adapters/astro/middleware-entry.d.ts +3 -3
  6. package/dist/adapters/astro/middleware-entry.js +1 -1
  7. package/dist/adapters/astro/middleware-entry.js.map +1 -1
  8. package/dist/adapters/nextjs/index.d.ts +2 -2
  9. package/dist/adapters/nextjs/index.js +1 -1
  10. package/dist/adapters/nextjs/index.js.map +1 -1
  11. package/dist/adapters/nuxt/index.d.ts +4 -4
  12. package/dist/adapters/nuxt/index.js +1 -1
  13. package/dist/adapters/nuxt/index.js.map +1 -1
  14. package/dist/adapters/nuxt/module.d.ts +1 -1
  15. package/dist/adapters/react/index.d.ts +2 -2
  16. package/dist/adapters/react/index.js +1 -1
  17. package/dist/adapters/react/index.js.map +1 -1
  18. package/dist/adapters/sveltekit/index.d.ts +5 -5
  19. package/dist/adapters/sveltekit/index.js +1 -1
  20. package/dist/adapters/sveltekit/index.js.map +1 -1
  21. package/dist/adapters/vue/index.d.ts +2 -2
  22. package/dist/adapters/vue/index.js +1 -1
  23. package/dist/adapters/vue/index.js.map +1 -1
  24. package/dist/annotate.d.ts +22 -15
  25. package/dist/annotate.js +1 -1
  26. package/dist/annotate.js.map +1 -1
  27. package/dist/client.cjs +1 -1
  28. package/dist/client.cjs.map +1 -1
  29. package/dist/client.d.cts +114 -114
  30. package/dist/client.d.ts +114 -114
  31. package/dist/client.js +1 -1
  32. package/dist/client.js.map +1 -1
  33. package/dist/codegen-cli.js +1 -1
  34. package/dist/codegen-cli.js.map +1 -1
  35. package/dist/codegen.cjs +1 -1
  36. package/dist/codegen.cjs.map +1 -1
  37. package/dist/codegen.d.cts +14 -16
  38. package/dist/codegen.d.ts +14 -16
  39. package/dist/codegen.js +1 -1
  40. package/dist/codegen.js.map +1 -1
  41. package/dist/core.cjs +1 -1
  42. package/dist/core.cjs.map +1 -1
  43. package/dist/core.d.cts +178 -172
  44. package/dist/core.d.ts +178 -172
  45. package/dist/core.js +1 -1
  46. package/dist/core.js.map +1 -1
  47. package/dist/doctor-cli.d.ts +1 -1
  48. package/dist/doctor-cli.js +1 -1
  49. package/dist/doctor-cli.js.map +1 -1
  50. package/dist/doctor.d.ts +15 -2
  51. package/dist/doctor.js +1 -1
  52. package/dist/doctor.js.map +1 -1
  53. package/dist/{document-session-DWi9H3Qk.d.ts → document-session-Bkd181PV.d.ts} +3 -2
  54. package/dist/{fragment-endpoint-B2qcRw5T.d.ts → fragment-endpoint-DGGLIijM.d.ts} +1 -1
  55. package/dist/fragment.cjs.map +1 -1
  56. package/dist/fragment.d.cts +3 -3
  57. package/dist/fragment.d.ts +3 -3
  58. package/dist/fragment.js.map +1 -1
  59. package/dist/index.cjs +1 -1
  60. package/dist/index.cjs.map +1 -1
  61. package/dist/index.d.cts +183 -177
  62. package/dist/index.d.ts +183 -177
  63. package/dist/index.js +1 -1
  64. package/dist/index.js.map +1 -1
  65. package/dist/lean.cjs +1 -1
  66. package/dist/lean.cjs.map +1 -1
  67. package/dist/lean.js +1 -1
  68. package/dist/lean.js.map +1 -1
  69. package/dist/lexical.cjs +1 -1
  70. package/dist/lexical.cjs.map +1 -1
  71. package/dist/lexical.js +1 -1
  72. package/dist/lexical.js.map +1 -1
  73. package/dist/{locals-B1mF3aTb.d.ts → locals-zz2gi9dj.d.ts} +1 -1
  74. package/dist/{middleware-BGobLN9P.d.ts → middleware-CI-UTf6R.d.ts} +2 -2
  75. package/dist/{options-Cm8fC7dj.d.ts → options-CnYybG51.d.ts} +8 -0
  76. package/dist/plugins.cjs +1 -1
  77. package/dist/plugins.cjs.map +1 -1
  78. package/dist/plugins.d.cts +3 -3
  79. package/dist/plugins.d.ts +3 -3
  80. package/dist/plugins.js +1 -1
  81. package/dist/plugins.js.map +1 -1
  82. package/dist/{probe-DGPDsnbj.d.ts → probe-D-IHg9dF.d.ts} +3 -3
  83. package/dist/structural.cjs +2 -2
  84. package/dist/structural.cjs.map +1 -1
  85. package/dist/structural.d.cts +27 -27
  86. package/dist/structural.d.ts +27 -27
  87. package/dist/structural.js +2 -2
  88. package/dist/structural.js.map +1 -1
  89. package/package.json +11 -6
package/dist/lexical.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";function e(e,t){if(!function(){try{const e=globalThis.process?.env;return void 0!==e&&"production"!==e.NODE_ENV}catch{return!1}}())return;const r=globalThis,n=r.__payloadLivePreviewDeprecationsWarned??=/* @__PURE__ */new Set;if(!n.has(e)){n.add(e);try{console.warn(`[payload-live-preview] ${t}`)}catch{}}}var t=/* @__PURE__ */Symbol.for("payload-live-preview.trusted-types");function r(e){const r=function(){const e=function(){const e=globalThis,r=e[t];if(void 0!==r)return r;const n={};return e[t]=n,n}();if(void 0!==e.override)return e.override;if(void 0!==e.auto)return e.auto;const r=function(){const e=globalThis.trustedTypes;if("object"==typeof e&&null!==e)return"function"==typeof e.createPolicy?e:void 0}();try{e.auto=void 0===r?null:r.createPolicy("payload-live-preview",{createHTML:e=>e})}catch{e.auto=null}return e.auto}();return null===r?e:r.createHTML(e)}var n=/* @__PURE__ */new Set(["http:","https:","mailto:","tel:"]),o=/^(?:\.{1,2}\/|[a-zA-Z0-9_-]+\/?)/,i=/^[\\/]{2}/,a=/[\t\n\r]/g,s=/[\s\u0000-\u001f\u180e\u2000-\u2029]/g,l=/^([a-z][a-z0-9+.-]*):/i;function isSafeUrl(e){if("string"!=typeof e)return!1;const t=e.trim().replace(a,"");if(0===t.length)return!1;if(t.startsWith("#")||t.startsWith("?"))return!0;if(i.test(t))return!0;if(t.startsWith("/"))return!0;try{const e=new URL(t);return n.has(e.protocol)}catch{return o.test(t)&&!function(e){const t=l.exec(e.replace(s,""))?.[1];return void 0!==t&&!n.has(`${t.toLowerCase()}:`)}(t)}}function isExternalHttpUrl(e){const t=e.trim().replace(a,"");return/^https?:\/\//i.test(t)||i.test(t)}var c=/* @__PURE__ */new Set;function u(e){c.has(e)||(c.add(e),function(e){try{console.warn(e)}catch{}}(`[live-preview] LP0409: the strict sanitizer removed \`${e}\` from written markup; the 1.x default (\`sanitizerPolicy: 'compat'\`) kept it. ${function(e){return e.startsWith("data-payload-")?"A binding inside CMS content is refused by design — an editor could otherwise aim a write at any element on the page (docs/security.md)":"id"===e||"name"===e?"CMS content that can name an element can shadow a global of that name — DOM clobbering, refused by design (docs/security.md)":"Put it on an element the template owns, or set `sanitizerPolicy: 'compat'` to keep every `data-*` as 1.x did"}(e)}.`))}var d=/* @__PURE__ */new Set(["p","br","strong","b","em","i","u","s","strike","mark","small","h1","h2","h3","h4","h5","h6","ul","ol","li","dl","dt","dd","blockquote","code","pre","kbd","samp","var","a","span","div","section","article","aside","header","footer","nav","figure","figcaption","img","picture","source","audio","video","sub","sup","hr","time","abbr","cite","q","table","thead","tbody","tfoot","tr","th","td","caption","colgroup","col"]),p=/* @__PURE__ */new Set(["input","button","textarea","select","option","label"]),f=/* @__PURE__ */new Set(["script","style","iframe","object","embed","link","meta","base","form","input","button","select","textarea","svg","math","template","frame","frameset","noframes","noscript"]),m=/* @__PURE__ */new Set(["id","class","lang","dir","title","role","tabindex"]),h="aria-",g="data-",b={a:/* @__PURE__ */new Set(["href","target","rel","download","hreflang","type"]),img:/* @__PURE__ */new Set(["src","srcset","sizes","alt","width","height","loading","decoding"]),picture:/* @__PURE__ */new Set([]),source:/* @__PURE__ */new Set(["src","srcset","sizes","type","media"]),audio:/* @__PURE__ */new Set(["src","controls","autoplay","loop","muted","preload"]),video:/* @__PURE__ */new Set(["src","poster","controls","autoplay","loop","muted","preload","width","height","playsinline"]),time:/* @__PURE__ */new Set(["datetime"]),abbr:/* @__PURE__ */new Set(["title"]),q:/* @__PURE__ */new Set(["cite"]),blockquote:/* @__PURE__ */new Set(["cite"]),table:/* @__PURE__ */new Set(["summary"]),th:/* @__PURE__ */new Set(["colspan","rowspan","scope","headers","abbr"]),td:/* @__PURE__ */new Set(["colspan","rowspan","headers"]),col:/* @__PURE__ */new Set(["span"]),colgroup:/* @__PURE__ */new Set(["span"]),ol:/* @__PURE__ */new Set(["start","reversed","type"]),li:/* @__PURE__ */new Set(["value"]),code:/* @__PURE__ */new Set(["class"]),pre:/* @__PURE__ */new Set(["class"])},y=/* @__PURE__ */new Set(["href","src","cite","poster"]),$=class extends Error{name="SanitizerEnvironmentError"},v=/* @__PURE__ */new Set(["id","name","data-payload-key","data-payload-morph","data-payload-nested-key","data-payload-nested-template"]),w=/* @__PURE__ */Symbol.for("payload-live-preview.sanitizer-document");function sanitizeHtml(t,n){return function(t,n,o){const i=o?.document??S();if(!i)throw"undefined"!=typeof __INLINE_BUILD__&&__INLINE_BUILD__?new Error("sanitizeHtml needs a DOM"):new $("sanitizeHtml needs a DOM; pass one per call during SSR: { document } (linkedom, jsdom).");if(""===t)return"";const a=function(e,t){const r=e?.policy??t??"strict";if(!e){const e=/* @__PURE__ */new Map;for(const[t,r]of Object.entries(b))e.set(t,r);return{allowedTags:d,attrByTag:e,allowFormControls:!1,templateMode:!1,mode:r,allowedData:/* @__PURE__ */new Set}}const n=new Set(d);if(e.additionalAllowedTags?.forEach(e=>n.add(e)),!0===e.allowFormControls)for(const e of p)n.add(e);const o=/* @__PURE__ */new Map;for(const[e,t]of Object.entries(b))o.set(e,t);for(const[t,r]of Object.entries(e.additionalAllowedAttributes??{})){const e=new Set(o.get(t));for(const t of r)e.add(t);o.set(t,e)}return{allowedTags:n,attrByTag:o,allowFormControls:!0===e.allowFormControls,templateMode:!0===e.templateMode,mode:r,allowedData:new Set(e.allowedDataAttributes?.map(e=>e.toLowerCase()))}}(o,void 0);let s=t;for(let e=0;e<6;e+=1){const e=i.createElement("template");e.innerHTML=r(s),k(e.content,a);const t=e.innerHTML;if(t===s)return t;s=t}return e("sanitizer-unsettled",`sanitizeHtml: the output did not settle after ${String(6)} passes, so it returned an empty string (ADR 0016).`),""}(t,0,n)}function S(){if("undefined"==typeof __INLINE_BUILD__||!__INLINE_BUILD__){const e=globalThis[w];if(e)return e}if("undefined"!=typeof document)return document}function k(e,t){for(const r of Array.from(e.childNodes))1===r.nodeType?H(r,t):8===r.nodeType&&r.remove()}function H(e,t){const r=e.tagName.toLowerCase();if(!f.has(r)||t.allowFormControls&&p.has(r)){if(!t.allowedTags.has(r))return k(e,t),void e.replaceWith(...e.childNodes);!function(e,t,r){const n=r.attrByTag.get(t);for(const t of Array.from(e.attributes)){const o=t.name.toLowerCase();if(o.startsWith("on")||"style"===o)e.removeAttribute(t.name);else if("is"!==o){if("strict"===r.mode){if(r.templateMode&&v.has(o))continue;if("id"===o||"name"===o||o.startsWith("data-payload-")){e.removeAttribute(t.name),"name"===o&&!0!==n?.has(o)||u(o);continue}if(o.startsWith(g)){r.allowedData.has(o)||(e.removeAttribute(t.name),u(o));continue}if(m.has(o)||o.startsWith(h))continue}else if(m.has(o)||o.startsWith(h)||o.startsWith(g))continue;n?.has(o)?y.has(o)&&!isSafeUrl(t.value)?e.removeAttribute(t.name):"srcset"!==o||T(t.value)||e.removeAttribute(t.name):e.removeAttribute(t.name)}else e.setAttribute("is","")}}(e,r,t),"a"===r&&function(e){const t=e.getAttribute("href");null!==t&&isExternalHttpUrl(t)&&(e.setAttribute("rel","noopener noreferrer"),e.hasAttribute("target")||e.setAttribute("target","_blank"))}(e),k(e,t)}else e.remove()}function T(e){for(const t of e.split(",")){const e=t.trim();if(0===e.length)continue;const[r=e]=e.split(/\s/,1);if(!isSafeUrl(r)||!isSafeUrl(e))return!1}return!0}var x=Object.freeze({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"}),A=/[&<>"'/`=]/g;function escapeHtml(e){return e.replace(A,e=>x[e])}var _=Object.freeze({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"}),C=/[&<>"']/g;function escapeHtmlAttribute(e){return e.replace(C,e=>_[e])}var L={BOLD:1,ITALIC:2,STRIKETHROUGH:4,UNDERLINE:8,CODE:16,SUBSCRIPT:32,SUPERSCRIPT:64,HIGHLIGHT:128},U={1:"left",2:"center",3:"right",4:"justify"},z=/* @__PURE__ */new Set(["left","center","right","justify","start","end"]);function I(e){const t=e.format;return"string"==typeof t&&z.has(t)?t:"number"==typeof t?U[t]:void 0}function D(e){const t=e.indent;return"number"==typeof t&&t>0?t:0}function E(e){return"rtl"===e.direction?' dir="rtl"':"ltr"===e.direction?' dir="ltr"':""}function B(e){const t=I(e),r=D(e),n=[];return void 0!==t&&n.push(`lp-align-${t}`),r>0&&n.push(`lp-indent-${String(r)}`),0===n.length?"":` class="${n.join(" ")}"`}var M=/* @__PURE__ */new Set(["h1","h2","h3","h4","h5","h6"]);function N(e){return"object"==typeof e&&null!==e?e:void 0}function j(e){return N(e)}function R(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-").toLowerCase()}function O(e){return"string"==typeof e&&e.length>0?e:void 0}var W=' target="_blank" rel="noopener noreferrer"',P=(e,t)=>{const r=t.renderChildren(e.children??[]),n=N(e.fields),o=function(e,t){if("internal"===t?.linkType)return function(e){const t=N(N(e)?.value),r=t?.url;if("string"==typeof r&&r.length>0)return r;const n=t?.slug;return"string"==typeof n&&n.length>0?`/${n}`:void 0}(t.doc);const r=t?.url??e.url;return"string"==typeof r&&r.length>0?r:void 0}(e,n);if(void 0===o||!isSafeUrl(o))return r;const i="string"==typeof e.title?` title="${escapeHtml(e.title)}"`:"";return`<a href="${escapeHtmlAttribute(o)}"${function(e,t,r){if(!0===t?.newTab||isExternalHttpUrl(r))return W;const n="string"==typeof e.target?e.target:"";return""===n?"":"_blank"===n?W:` target="${escapeHtml(n)}"`}(e,n,o)}${i}>${r}</a>`};function q(e){if("string"==typeof e.text)return e.text;if(!e.children)return"";let t="";for(const r of e.children)t+=q(r);return t}function F(e){return`${"number"==typeof e.width?` width="${String(e.width)}"`:""}${"number"==typeof e.height?` height="${String(e.height)}"`:""}`}function G(e){return"string"==typeof e.mimeType?` type="${escapeHtmlAttribute(e.mimeType)}"`:""}var K=/* @__PURE__ */new Map;function Z(e,t){K.set(e,t)}function V(e){return K.get(e)}function J(e,t,r,n){const o=N(e.fields)??{},i="string"==typeof o.blockType?o.blockType:"",a=R(i),s=""===a?n:`${n} ${n}--${a}`;if(""!==i){const e=V(i)??V(a);if(e)return e(o,{renderChildren:t.renderChildren});t.onUnrenderedBlock?.(i,s)}return`<${r} class="${s}"></${r}>`}function Q(e,t){return"number"==typeof t&&t>1?` ${e}="${String(t)}"`:""}var X={text:e=>{let t=escapeHtml("string"==typeof e.text?e.text:"");const r="number"==typeof e.format?e.format:0;return 0!==(r&L.CODE)&&(t=`<code>${t}</code>`),0!==(r&L.BOLD)&&(t=`<strong>${t}</strong>`),0!==(r&L.ITALIC)&&(t=`<em>${t}</em>`),0!==(r&L.UNDERLINE)&&(t=`<u>${t}</u>`),0!==(r&L.STRIKETHROUGH)&&(t=`<s>${t}</s>`),0!==(r&L.SUBSCRIPT)&&(t=`<sub>${t}</sub>`),0!==(r&L.SUPERSCRIPT)&&(t=`<sup>${t}</sup>`),0!==(r&L.HIGHLIGHT)&&(t=`<mark>${t}</mark>`),t},paragraph:(e,t)=>{const r=t.renderChildren(e.children??[]);return`<p${E(e)}${B(e)}>${r}</p>`},heading:(e,t)=>{const r="string"==typeof e.tag?e.tag.toLowerCase():"h2",n=M.has(r)?r:"h2",o=t.renderChildren(e.children??[]);return`<${n}${E(e)}${B(e)}>${o}</${n}>`},list:(e,t)=>{const r="string"==typeof e.listType?e.listType:"bullet",n="number"===r?"ol":"ul",o="number"===r&&"number"==typeof e.start&&e.start>1?` start="${String(e.start)}"`:"",i="check"===r?' role="list"':"",a=t.renderChildren(e.children??[]);return`<${n}${E(e)}${B(e)}${o}${i}>${a}</${n}>`},listitem:(e,t)=>{const r=t.renderChildren(e.children??[]);if("boolean"==typeof e.checked)return`<li role="checkbox" aria-checked="${e.checked?"true":"false"}"${B(e)}>${r}</li>`;const n="number"==typeof e.value?` value="${escapeHtml(String(e.value))}"`:"";return`<li${E(e)}${B(e)}${n}>${r}</li>`},link:P,autolink:P,quote:(e,t)=>{const r=t.renderChildren(e.children??[]);return`<blockquote${E(e)}${B(e)}>${r}</blockquote>`},code:e=>{const t=R("string"==typeof e.language?e.language:"");return`<pre><code${""===t?"":` class="language-${t}"`}>${escapeHtml(q(e))}</code></pre>`},"code-highlight":e=>{const t="string"==typeof e.text?e.text:"";return`<span${"string"==typeof e.highlightType?` class="token-${R(e.highlightType)}"`:""}>${escapeHtml(t)}</span>`},linebreak:()=>"<br>",horizontalrule:()=>"<hr>",tab:()=>"\t",upload:e=>{const t=j(e.value);if(void 0===t)return"";const r=t.url;if("string"!=typeof r||!isSafeUrl(r))return"";const n="string"==typeof t.mimeType?t.mimeType:"";return n.startsWith("video/")?function(e,t){return`<video controls${F(e)}><source src="${escapeHtmlAttribute(t)}"${G(e)}></video>`}(t,r):n.startsWith("audio/")?function(e,t){return`<audio controls><source src="${escapeHtmlAttribute(t)}"${G(e)}></audio>`}(t,r):""===n||n.startsWith("image/")?function(e,t){const r="string"==typeof e.alt?escapeHtml(e.alt):"";return`<img src="${escapeHtmlAttribute(t)}" alt="${r}"${F(e)} loading="lazy" decoding="async">`}(t,r):function(e,t){const r="string"==typeof e.filename?escapeHtml(e.filename):escapeHtml(t);return`<a href="${escapeHtmlAttribute(t)}" target="_blank" rel="noopener noreferrer">${r}</a>`}(t,r)},relationship:e=>{const t="string"==typeof e.relationTo?e.relationTo:"",r=N(e.value),n=escapeHtml((r&&function(e){const t=O(e.title)??O(e.name)??O(e.slug);return void 0!==t?t:void 0===e.id?void 0:String(e.id)}(r))??`#${t}`),o=R(t),i=""===o?' class="lp-relation"':` class="lp-relation lp-relation--${o}"`,a=r?.url;return"string"==typeof a&&isSafeUrl(a)?`<a href="${escapeHtmlAttribute(a)}"${i}>${n}</a>`:`<span${i}>${n}</span>`},block:(e,t)=>J(e,t,"div","lp-block"),inlineBlock:(e,t)=>J(e,t,"span","lp-inline-block"),table:(e,t)=>`<table${E(e)}><tbody>${t.renderChildren(e.children??[])}</tbody></table>`,tablerow:(e,t)=>`<tr>${t.renderChildren(e.children??[])}</tr>`,tablecell:(e,t)=>{const r="number"==typeof e.headerState?e.headerState:0,n=3&r?"th":"td";return`<${n}${1===r?' scope="col"':2===r?' scope="row"':""}${Q("colspan",e.colSpan)}${Q("rowspan",e.rowSpan)}>${t.renderChildren(e.children??[])}</${n}>`}},Y=/* @__PURE__ */new Map;function ee(e){return Y.get(e)??X[e]}var te=!1;function re(e){if("object"!=typeof e||null===e)return!1;if(!("root"in e))return!1;const t=e.root;return"object"==typeof t&&null!==t&&"children"in t&&Array.isArray(t.children)}function ne(e,t){const r=ee(e.type);return r?r(e,t):void 0!==e.children?t.renderChildren(e.children):""}function oe(e){if("string"==typeof e.text)return e.text;if("linebreak"===e.type)return"\n";if(void 0===e.children)return"";let t="";for(const r of e.children)t+=oe(r);return t}function ie(e,t){const r=e[t];return"string"==typeof r&&r.length>0?r:void 0}function ae(e,t){const r=ie(e,t);return void 0!==r&&isSafeUrl(r)?r:void 0}function se(e){const t=ie(e,"caption");return void 0!==t?`<figcaption>${escapeHtml(t)}</figcaption>`:""}var le=(e,t)=>{const r=R(ie(e,"importance")??"info"),n=ie(e,"title"),o=ie(e,"text"),i=function(e){const t=e.body??e.content;if("object"!=typeof t||null===t)return;const r=t.root;return r&&Array.isArray(r.children)?r.children:void 0}(e);return`<aside class="lp-block-callout lp-block-callout--${r}">${void 0!==n?`<strong>${escapeHtml(n)}</strong>`:""}${void 0!==i?t.renderChildren(i):void 0!==o?`<p>${escapeHtml(o)}</p>`:""}</aside>`},ce=e=>{const t=j(e.image),r=t?.url??ae(e,"imageUrl");if(void 0===r||!isSafeUrl(r))return"";const n=t?.alt??ie(e,"alt")??"";return`<figure class="lp-block-image"><img src="${escapeHtmlAttribute(r)}" alt="${escapeHtmlAttribute(n)}"${function(e){return`${"number"==typeof e?.width?` width="${String(e.width)}"`:""}${"number"==typeof e?.height?` height="${String(e.height)}"`:""}`}(t)} loading="lazy" decoding="async">${se(e)}</figure>`},ue=e=>{const t=j(e.video),r=t?.url??ae(e,"videoUrl");if(void 0===r||!isSafeUrl(r))return"";const n=t?.mimeType??ie(e,"mimeType"),o=void 0!==n?` type="${escapeHtmlAttribute(n)}"`:"",i=ae(e,"poster");return`<figure class="lp-block-video"><video controls${void 0!==i?` poster="${escapeHtmlAttribute(i)}"`:""}><source src="${escapeHtmlAttribute(r)}"${o}></video>${se(e)}</figure>`},de=e=>{const t=ie(e,"code")??ie(e,"content");if(void 0===t)return"";const r=R(ie(e,"language")??""),n=""===r?"":` class="language-${r}"`;return`<figure class="lp-block-code">${se(e)}<pre><code${n}>${escapeHtml(t)}</code></pre></figure>`},pe=e=>{const t=ie(e,"label")??ie(e,"text"),r=ae(e,"href")??ae(e,"url");if(void 0===t||void 0===r)return"";const n=ie(e,"lead"),o=void 0!==n?`<p class="lp-block-cta__lead">${escapeHtml(n)}</p>`:"",i=[fe(t,r,!0)],a=ie(e,"secondaryLabel"),s=ae(e,"secondaryHref");return void 0!==a&&void 0!==s&&i.push(fe(a,s,!1)),`<div class="lp-block-cta">${o}<div class="lp-block-cta__actions">${i.join("")}</div></div>`};function fe(e,t,r){const n=isExternalHttpUrl(t)?' target="_blank" rel="noopener noreferrer"':"";return`<a class="lp-block-cta__button lp-block-cta__button--${r?"primary":"secondary"}" href="${escapeHtmlAttribute(t)}"${n}>${escapeHtml(e)}</a>`}exports.TextFormat=L,exports.isLexicalContent=re,exports.lexicalToHtml=function(e,t={}){if(!re(e))return"";const r=function(e){const t={renderChildren:e=>{let r="";for(const n of e)r+=ne(n,t);return r},resolveAlignment:I,resolveIndent:D,onUnrenderedBlock:e};return t}(t.onUnrenderedBlock).renderChildren(e.root.children);return!1===t.sanitize?r:void 0!==t.document?sanitizeHtml(r,{document:t.document}):!0===t.requireDocument||void 0!==S()?sanitizeHtml(r):(function(){if(!te){te=!0;try{console.warn('[live-preview] lexicalToHtml() has no sanitizer document and returned unsanitised HTML; pass { document } (linkedom, jsdom) per call. 3.0 throws here instead: opt in now with { requireDocument: true }. See "HTML sanitization" in docs/security.md.')}catch{}}}(),r)},exports.lexicalToPlainText=function(e){return re(e)?e.root.children.map(oe).join("\n").trim():""},exports.lookupBlockRenderer=V,exports.lookupLexicalNode=ee,exports.registerBlockRenderer=Z,exports.registerDefaultBlocks=function(){Z("callout",le),Z("image-block",ce),Z("imageBlock",ce),Z("image",ce),Z("video-block",ue),Z("videoBlock",ue),Z("video",ue),Z("code-block",de),Z("codeBlock",de),Z("code",de),Z("cta-block",pe),Z("ctaBlock",pe),Z("cta",pe)},exports.registerLexicalNode=function(e,t){Y.set(e,t)},exports.registeredBlockTypes=function(){return[...K.keys()]},exports.setSanitizerDocument=function setSanitizerDocument(t){e("set-sanitizer-document","`setSanitizerDocument()` is removed in 3.0: pass the document per call, `sanitizeHtml(html, { document })` or `lexicalToHtml(content, { document })` (ADR 0026)."),globalThis[w]=t??void 0};
1
+ "use strict";function e(e,t){if(!function(){try{const e=globalThis.process?.env;return void 0!==e&&"production"!==e.NODE_ENV}catch{return!1}}())return;const r=globalThis,n=r.__payloadLivePreviewDeprecationsWarned??=/* @__PURE__ */new Set;if(!n.has(e)){n.add(e);try{console.warn(`[payload-live-preview] ${t}`)}catch{}}}var t=/* @__PURE__ */Symbol.for("payload-live-preview.trusted-types");function r(e){const r=function(){const e=function(){const e=globalThis,r=e[t];if(void 0!==r)return r;const n={};return e[t]=n,n}();if(void 0!==e.override)return e.override;if(void 0!==e.auto)return e.auto;const r=function(){const e=globalThis.trustedTypes;if("object"==typeof e&&null!==e)return"function"==typeof e.createPolicy?e:void 0}();try{e.auto=void 0===r?null:r.createPolicy("payload-live-preview",{createHTML:e=>e})}catch{e.auto=null}return e.auto}();return null===r?e:r.createHTML(e)}var n=/* @__PURE__ */new Set(["http:","https:","mailto:","tel:"]),o=/^(?:\.{1,2}\/|[a-zA-Z0-9_-]+\/?)/,i=/^[\\/]{2}/,a=/[\t\n\r]/g,s=/[\s\u0000-\u001f\u180e\u2000-\u2029]/g,l=/^([a-z][a-z0-9+.-]*):/i;function isSafeUrl(e){if("string"!=typeof e)return!1;const t=e.trim().replace(a,"");if(0===t.length)return!1;if(t.startsWith("#")||t.startsWith("?"))return!0;if(i.test(t))return!0;if(t.startsWith("/"))return!0;try{const e=new URL(t);return n.has(e.protocol)}catch{return o.test(t)&&!function(e){const t=l.exec(e.replace(s,""))?.[1];return void 0!==t&&!n.has(`${t.toLowerCase()}:`)}(t)}}function isExternalHttpUrl(e){const t=e.trim().replace(a,"");return/^https?:\/\//i.test(t)||i.test(t)}var c=/* @__PURE__ */new Set;function u(e){c.has(e)||(c.add(e),function(e){try{console.warn(e)}catch{}}(`[live-preview] LP0409: the strict sanitizer removed \`${e}\` from written markup; the 1.x default (\`sanitizerPolicy: 'compat'\`) kept it. ${function(e){return e.startsWith("data-payload-")?"A binding inside CMS content is refused by design — an editor could otherwise aim a write at any element on the page (docs/security.md)":"id"===e||"name"===e?"CMS content that can name an element can shadow a global of that name — DOM clobbering, refused by design (docs/security.md)":"Put it on an element the template owns, or set `sanitizerPolicy: 'compat'` to keep every `data-*` as 1.x did"}(e)}.`))}var d=/* @__PURE__ */new Set(["p","br","strong","b","em","i","u","s","strike","mark","small","h1","h2","h3","h4","h5","h6","ul","ol","li","dl","dt","dd","blockquote","code","pre","kbd","samp","var","a","span","div","section","article","aside","header","footer","nav","figure","figcaption","img","picture","source","audio","video","sub","sup","hr","time","abbr","cite","q","table","thead","tbody","tfoot","tr","th","td","caption","colgroup","col"]),p=/* @__PURE__ */new Set(["input","button","textarea","select","option","label"]),f=/* @__PURE__ */new Set(["script","style","iframe","object","embed","link","meta","base","form","input","button","select","textarea","svg","math","template","frame","frameset","noframes","noscript"]),m=/* @__PURE__ */new Set(["id","class","lang","dir","title","role","tabindex"]),h="aria-",g="data-",b={a:/* @__PURE__ */new Set(["href","target","rel","download","hreflang","type"]),img:/* @__PURE__ */new Set(["src","srcset","sizes","alt","width","height","loading","decoding"]),picture:/* @__PURE__ */new Set([]),source:/* @__PURE__ */new Set(["src","srcset","sizes","type","media"]),audio:/* @__PURE__ */new Set(["src","controls","autoplay","loop","muted","preload"]),video:/* @__PURE__ */new Set(["src","poster","controls","autoplay","loop","muted","preload","width","height","playsinline"]),time:/* @__PURE__ */new Set(["datetime"]),abbr:/* @__PURE__ */new Set(["title"]),q:/* @__PURE__ */new Set(["cite"]),blockquote:/* @__PURE__ */new Set(["cite"]),table:/* @__PURE__ */new Set(["summary"]),th:/* @__PURE__ */new Set(["colspan","rowspan","scope","headers","abbr"]),td:/* @__PURE__ */new Set(["colspan","rowspan","headers"]),col:/* @__PURE__ */new Set(["span"]),colgroup:/* @__PURE__ */new Set(["span"]),ol:/* @__PURE__ */new Set(["start","reversed","type"]),li:/* @__PURE__ */new Set(["value"]),code:/* @__PURE__ */new Set(["class"]),pre:/* @__PURE__ */new Set(["class"])},y=/* @__PURE__ */new Set(["href","src","cite","poster"]),$=class extends Error{name="SanitizerEnvironmentError"},v=/* @__PURE__ */new Set(["id","name","data-payload-key","data-payload-morph","data-payload-nested-key","data-payload-nested-template"]),w=/* @__PURE__ */Symbol.for("payload-live-preview.sanitizer-document");function sanitizeHtml(t,n){return function(t,n,o){const i=o?.document??H();if(!i)throw S();if(""===t)return"";const a=function(e,t){const r=e?.policy??t??"strict";if(!e){const e=/* @__PURE__ */new Map;for(const[t,r]of Object.entries(b))e.set(t,r);return{allowedTags:d,attrByTag:e,allowFormControls:!1,templateMode:!1,mode:r,allowedData:/* @__PURE__ */new Set}}const n=new Set(d);if(e.additionalAllowedTags?.forEach(e=>n.add(e)),!0===e.allowFormControls)for(const e of p)n.add(e);const o=/* @__PURE__ */new Map;for(const[e,t]of Object.entries(b))o.set(e,t);for(const[t,r]of Object.entries(e.additionalAllowedAttributes??{})){const e=new Set(o.get(t));for(const t of r)e.add(t);o.set(t,e)}return{allowedTags:n,attrByTag:o,allowFormControls:!0===e.allowFormControls,templateMode:!0===e.templateMode,mode:r,allowedData:new Set(e.allowedDataAttributes?.map(e=>e.toLowerCase()))}}(o,void 0);let s=t;for(let e=0;e<6;e+=1){const e=i.createElement("template");e.innerHTML=r(s);const t=e.content;T(t,a);const n=k(t);if(n===s)return n;s=n}return e("sanitizer-unsettled",`sanitizeHtml: the output did not settle after ${String(6)} passes, so it returned an empty string (ADR 0016).`),""}(t,0,n)}function S(){return"undefined"!=typeof __INLINE_BUILD__&&__INLINE_BUILD__?new Error("sanitizeHtml needs a DOM"):new $("sanitizeHtml needs a DOM; pass one per call during SSR: { document } (linkedom, jsdom).")}function k(e){const t=e.ownerDocument?.createElement("div");if(void 0===t)throw S();const r=e.firstChild;if(t.append(e),t.firstChild!==r)throw S();return t.innerHTML}function H(){if("undefined"==typeof __INLINE_BUILD__||!__INLINE_BUILD__){const e=globalThis[w];if(e)return e}if("undefined"!=typeof document)return document}function T(e,t){for(const r of Array.from(e.childNodes))1===r.nodeType?x(r,t):8===r.nodeType&&r.remove()}function x(e,t){const r=e.tagName.toLowerCase();if(!f.has(r)||t.allowFormControls&&p.has(r)){if(!t.allowedTags.has(r))return T(e,t),void e.replaceWith(...e.childNodes);!function(e,t,r){const n=r.attrByTag.get(t);for(const t of Array.from(e.attributes)){const o=t.name.toLowerCase();if(o.startsWith("on")||"style"===o)e.removeAttribute(t.name);else if("is"!==o){if("strict"===r.mode){if(r.templateMode&&v.has(o))continue;if("id"===o||"name"===o||o.startsWith("data-payload-")){e.removeAttribute(t.name),"name"===o&&!0!==n?.has(o)||u(o);continue}if(o.startsWith(g)){r.allowedData.has(o)||(e.removeAttribute(t.name),u(o));continue}if(m.has(o)||o.startsWith(h))continue}else if(m.has(o)||o.startsWith(h)||o.startsWith(g))continue;n?.has(o)?y.has(o)&&!isSafeUrl(t.value)?e.removeAttribute(t.name):"srcset"!==o||A(t.value)||e.removeAttribute(t.name):e.removeAttribute(t.name)}else e.setAttribute("is","")}}(e,r,t),"a"===r&&function(e){const t=e.getAttribute("href");null!==t&&isExternalHttpUrl(t)&&(e.setAttribute("rel","noopener noreferrer"),e.hasAttribute("target")||e.setAttribute("target","_blank"))}(e),T(e,t)}else e.remove()}function A(e){for(const t of e.split(",")){const e=t.trim();if(0===e.length)continue;const[r=e]=e.split(/\s/,1);if(!isSafeUrl(r)||!isSafeUrl(e))return!1}return!0}var C=Object.freeze({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"}),_=/[&<>"'/`=]/g;function escapeHtml(e){return e.replace(_,e=>C[e])}var L=Object.freeze({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"}),U=/[&<>"']/g;function escapeHtmlAttribute(e){return e.replace(U,e=>L[e])}var z={BOLD:1,ITALIC:2,STRIKETHROUGH:4,UNDERLINE:8,CODE:16,SUBSCRIPT:32,SUPERSCRIPT:64,HIGHLIGHT:128},D={1:"left",2:"center",3:"right",4:"justify"},I=/* @__PURE__ */new Set(["left","center","right","justify","start","end"]);function E(e){const t=e.format;return"string"==typeof t&&I.has(t)?t:"number"==typeof t?D[t]:void 0}function B(e){const t=e.indent;return"number"==typeof t&&t>0?t:0}function M(e){return"rtl"===e.direction?' dir="rtl"':"ltr"===e.direction?' dir="ltr"':""}function N(e){const t=E(e),r=B(e),n=[];return void 0!==t&&n.push(`lp-align-${t}`),r>0&&n.push(`lp-indent-${String(r)}`),0===n.length?"":` class="${n.join(" ")}"`}var j=/* @__PURE__ */new Set(["h1","h2","h3","h4","h5","h6"]);function R(e){return"object"==typeof e&&null!==e?e:void 0}function O(e){return R(e)}function W(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-").toLowerCase()}function P(e){return"string"==typeof e&&e.length>0?e:void 0}var q=' target="_blank" rel="noopener noreferrer"',F=(e,t)=>{const r=t.renderChildren(e.children??[]),n=R(e.fields),o=function(e,t){if("internal"===t?.linkType)return function(e){const t=R(R(e)?.value),r=t?.url;if("string"==typeof r&&r.length>0)return r;const n=t?.slug;return"string"==typeof n&&n.length>0?`/${n}`:void 0}(t.doc);const r=t?.url??e.url;return"string"==typeof r&&r.length>0?r:void 0}(e,n);if(void 0===o||!isSafeUrl(o))return r;const i="string"==typeof e.title?` title="${escapeHtml(e.title)}"`:"";return`<a href="${escapeHtmlAttribute(o)}"${function(e,t,r){if(!0===t?.newTab||isExternalHttpUrl(r))return q;const n="string"==typeof e.target?e.target:"";return""===n?"":"_blank"===n?q:` target="${escapeHtml(n)}"`}(e,n,o)}${i}>${r}</a>`};function G(e){if("string"==typeof e.text)return e.text;if(!e.children)return"";let t="";for(const r of e.children)t+=G(r);return t}function K(e){return`${"number"==typeof e.width?` width="${String(e.width)}"`:""}${"number"==typeof e.height?` height="${String(e.height)}"`:""}`}function Z(e){return"string"==typeof e.mimeType?` type="${escapeHtmlAttribute(e.mimeType)}"`:""}var V=/* @__PURE__ */new Map;function J(e,t){V.set(e,t)}function Q(e){return V.get(e)}function X(e,t,r,n){const o=R(e.fields)??{},i="string"==typeof o.blockType?o.blockType:"",a=W(i),s=""===a?n:`${n} ${n}--${a}`;if(""!==i){const e=Q(i)??Q(a);if(e)return e(o,{renderChildren:t.renderChildren});t.onUnrenderedBlock?.(i,s)}return`<${r} class="${s}"></${r}>`}function Y(e,t){return"number"==typeof t&&t>1?` ${e}="${String(t)}"`:""}var ee={text:e=>{let t=escapeHtml("string"==typeof e.text?e.text:"");const r="number"==typeof e.format?e.format:0;return 0!==(r&z.CODE)&&(t=`<code>${t}</code>`),0!==(r&z.BOLD)&&(t=`<strong>${t}</strong>`),0!==(r&z.ITALIC)&&(t=`<em>${t}</em>`),0!==(r&z.UNDERLINE)&&(t=`<u>${t}</u>`),0!==(r&z.STRIKETHROUGH)&&(t=`<s>${t}</s>`),0!==(r&z.SUBSCRIPT)&&(t=`<sub>${t}</sub>`),0!==(r&z.SUPERSCRIPT)&&(t=`<sup>${t}</sup>`),0!==(r&z.HIGHLIGHT)&&(t=`<mark>${t}</mark>`),t},paragraph:(e,t)=>{const r=t.renderChildren(e.children??[]);return`<p${M(e)}${N(e)}>${r}</p>`},heading:(e,t)=>{const r="string"==typeof e.tag?e.tag.toLowerCase():"h2",n=j.has(r)?r:"h2",o=t.renderChildren(e.children??[]);return`<${n}${M(e)}${N(e)}>${o}</${n}>`},list:(e,t)=>{const r="string"==typeof e.listType?e.listType:"bullet",n="number"===r?"ol":"ul",o="number"===r&&"number"==typeof e.start&&e.start>1?` start="${String(e.start)}"`:"",i="check"===r?' role="list"':"",a=t.renderChildren(e.children??[]);return`<${n}${M(e)}${N(e)}${o}${i}>${a}</${n}>`},listitem:(e,t)=>{const r=t.renderChildren(e.children??[]);if("boolean"==typeof e.checked)return`<li role="checkbox" aria-checked="${e.checked?"true":"false"}"${N(e)}>${r}</li>`;const n="number"==typeof e.value?` value="${escapeHtml(String(e.value))}"`:"";return`<li${M(e)}${N(e)}${n}>${r}</li>`},link:F,autolink:F,quote:(e,t)=>{const r=t.renderChildren(e.children??[]);return`<blockquote${M(e)}${N(e)}>${r}</blockquote>`},code:e=>{const t=W("string"==typeof e.language?e.language:"");return`<pre><code${""===t?"":` class="language-${t}"`}>${escapeHtml(G(e))}</code></pre>`},"code-highlight":e=>{const t="string"==typeof e.text?e.text:"";return`<span${"string"==typeof e.highlightType?` class="token-${W(e.highlightType)}"`:""}>${escapeHtml(t)}</span>`},linebreak:()=>"<br>",horizontalrule:()=>"<hr>",tab:()=>"\t",upload:e=>{const t=O(e.value);if(void 0===t)return"";const r=t.url;if("string"!=typeof r||!isSafeUrl(r))return"";const n="string"==typeof t.mimeType?t.mimeType:"";return n.startsWith("video/")?function(e,t){return`<video controls${K(e)}><source src="${escapeHtmlAttribute(t)}"${Z(e)}></video>`}(t,r):n.startsWith("audio/")?function(e,t){return`<audio controls><source src="${escapeHtmlAttribute(t)}"${Z(e)}></audio>`}(t,r):""===n||n.startsWith("image/")?function(e,t){const r="string"==typeof e.alt?escapeHtml(e.alt):"";return`<img src="${escapeHtmlAttribute(t)}" alt="${r}"${K(e)} loading="lazy" decoding="async">`}(t,r):function(e,t){const r="string"==typeof e.filename?escapeHtml(e.filename):escapeHtml(t);return`<a href="${escapeHtmlAttribute(t)}" target="_blank" rel="noopener noreferrer">${r}</a>`}(t,r)},relationship:e=>{const t="string"==typeof e.relationTo?e.relationTo:"",r=R(e.value),n=escapeHtml((r&&function(e){const t=P(e.title)??P(e.name)??P(e.slug);return void 0!==t?t:void 0===e.id?void 0:String(e.id)}(r))??`#${t}`),o=W(t),i=""===o?' class="lp-relation"':` class="lp-relation lp-relation--${o}"`,a=r?.url;return"string"==typeof a&&isSafeUrl(a)?`<a href="${escapeHtmlAttribute(a)}"${i}>${n}</a>`:`<span${i}>${n}</span>`},block:(e,t)=>X(e,t,"div","lp-block"),inlineBlock:(e,t)=>X(e,t,"span","lp-inline-block"),table:(e,t)=>`<table${M(e)}><tbody>${t.renderChildren(e.children??[])}</tbody></table>`,tablerow:(e,t)=>`<tr>${t.renderChildren(e.children??[])}</tr>`,tablecell:(e,t)=>{const r="number"==typeof e.headerState?e.headerState:0,n=3&r?"th":"td";return`<${n}${1===r?' scope="col"':2===r?' scope="row"':""}${Y("colspan",e.colSpan)}${Y("rowspan",e.rowSpan)}>${t.renderChildren(e.children??[])}</${n}>`}},te=/* @__PURE__ */new Map;function re(e){return te.get(e)??ee[e]}var ne=!1;function oe(e){if("object"!=typeof e||null===e)return!1;if(!("root"in e))return!1;const t=e.root;return"object"==typeof t&&null!==t&&"children"in t&&Array.isArray(t.children)}function ie(e,t){const r=re(e.type);return r?r(e,t):void 0!==e.children?t.renderChildren(e.children):""}function ae(e){if("string"==typeof e.text)return e.text;if("linebreak"===e.type)return"\n";if(void 0===e.children)return"";let t="";for(const r of e.children)t+=ae(r);return t}function se(e,t){const r=e[t];return"string"==typeof r&&r.length>0?r:void 0}function le(e,t){const r=se(e,t);return void 0!==r&&isSafeUrl(r)?r:void 0}function ce(e){const t=se(e,"caption");return void 0!==t?`<figcaption>${escapeHtml(t)}</figcaption>`:""}var ue=(e,t)=>{const r=W(se(e,"importance")??"info"),n=se(e,"title"),o=se(e,"text"),i=function(e){const t=e.body??e.content;if("object"!=typeof t||null===t)return;const r=t.root;return r&&Array.isArray(r.children)?r.children:void 0}(e);return`<aside class="lp-block-callout lp-block-callout--${r}">${void 0!==n?`<strong>${escapeHtml(n)}</strong>`:""}${void 0!==i?t.renderChildren(i):void 0!==o?`<p>${escapeHtml(o)}</p>`:""}</aside>`},de=e=>{const t=O(e.image),r=t?.url??le(e,"imageUrl");if(void 0===r||!isSafeUrl(r))return"";const n=t?.alt??se(e,"alt")??"";return`<figure class="lp-block-image"><img src="${escapeHtmlAttribute(r)}" alt="${escapeHtmlAttribute(n)}"${function(e){return`${"number"==typeof e?.width?` width="${String(e.width)}"`:""}${"number"==typeof e?.height?` height="${String(e.height)}"`:""}`}(t)} loading="lazy" decoding="async">${ce(e)}</figure>`},pe=e=>{const t=O(e.video),r=t?.url??le(e,"videoUrl");if(void 0===r||!isSafeUrl(r))return"";const n=t?.mimeType??se(e,"mimeType"),o=void 0!==n?` type="${escapeHtmlAttribute(n)}"`:"",i=le(e,"poster");return`<figure class="lp-block-video"><video controls${void 0!==i?` poster="${escapeHtmlAttribute(i)}"`:""}><source src="${escapeHtmlAttribute(r)}"${o}></video>${ce(e)}</figure>`},fe=e=>{const t=se(e,"code")??se(e,"content");if(void 0===t)return"";const r=W(se(e,"language")??""),n=""===r?"":` class="language-${r}"`;return`<figure class="lp-block-code">${ce(e)}<pre><code${n}>${escapeHtml(t)}</code></pre></figure>`},me=e=>{const t=se(e,"label")??se(e,"text"),r=le(e,"href")??le(e,"url");if(void 0===t||void 0===r)return"";const n=se(e,"lead"),o=void 0!==n?`<p class="lp-block-cta__lead">${escapeHtml(n)}</p>`:"",i=[he(t,r,!0)],a=se(e,"secondaryLabel"),s=le(e,"secondaryHref");return void 0!==a&&void 0!==s&&i.push(he(a,s,!1)),`<div class="lp-block-cta">${o}<div class="lp-block-cta__actions">${i.join("")}</div></div>`};function he(e,t,r){const n=isExternalHttpUrl(t)?' target="_blank" rel="noopener noreferrer"':"";return`<a class="lp-block-cta__button lp-block-cta__button--${r?"primary":"secondary"}" href="${escapeHtmlAttribute(t)}"${n}>${escapeHtml(e)}</a>`}exports.TextFormat=z,exports.isLexicalContent=oe,exports.lexicalToHtml=function(e,t={}){if(!oe(e))return"";const r=function(e){const t={renderChildren:e=>{let r="";for(const n of e)r+=ie(n,t);return r},resolveAlignment:E,resolveIndent:B,onUnrenderedBlock:e};return t}(t.onUnrenderedBlock).renderChildren(e.root.children);return!1===t.sanitize?r:void 0!==t.document?sanitizeHtml(r,{document:t.document}):!0===t.requireDocument||void 0!==H()?sanitizeHtml(r):(function(){if(!ne){ne=!0;try{console.warn('[live-preview] lexicalToHtml() has no sanitizer document and returned unsanitised HTML; pass { document } (linkedom, jsdom) per call. 3.0 throws here instead: opt in now with { requireDocument: true }. See "HTML sanitization" in docs/security.md.')}catch{}}}(),r)},exports.lexicalToPlainText=function(e){return oe(e)?e.root.children.map(ae).join("\n").trim():""},exports.lookupBlockRenderer=Q,exports.lookupLexicalNode=re,exports.registerBlockRenderer=J,exports.registerDefaultBlocks=function(){J("callout",ue),J("image-block",de),J("imageBlock",de),J("image",de),J("video-block",pe),J("videoBlock",pe),J("video",pe),J("code-block",fe),J("codeBlock",fe),J("code",fe),J("cta-block",me),J("ctaBlock",me),J("cta",me)},exports.registerLexicalNode=function(e,t){te.set(e,t)},exports.registeredBlockTypes=function(){return[...V.keys()]},exports.setSanitizerDocument=function setSanitizerDocument(t){e("set-sanitizer-document","`setSanitizerDocument()` is removed in 3.0: pass the document per call, `sanitizeHtml(html, { document })` or `lexicalToHtml(content, { document })` (ADR 0026)."),globalThis[w]=t??void 0};
2
2
  //# sourceMappingURL=lexical.cjs.map