@panphora/clayjs 1.21.0 → 1.23.0
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.
- package/dist/all.js +1 -1
- package/dist/clay-dom.js +1 -1
- package/dist/clay-events.js +1 -1
- package/dist/clay-internals.js +1 -1
- package/dist/clay-options.js +1 -1
- package/dist/clay-router.js +1 -1
- package/dist/clay-ui.js +1 -1
- package/dist/clay-utils.js +1 -1
- package/dist/clay.js +1 -1
- package/dist/clay.standalone.js +8871 -8629
- package/dist/m/attrs/{save-freeze-MTFVVYV5.js → save-freeze-JZHKRQLR.js} +1 -1
- package/dist/m/{c-OABVRYOT.js → c-24PMUJIV.js} +1 -1
- package/dist/m/{c-EOCZ2YVL.js → c-2AYVYEI4.js} +1 -1
- package/dist/m/{c-UXEVJ63W.js → c-2L6O5PDS.js} +1 -1
- package/dist/m/{c-VBLFAQD2.js → c-2RYOGUQM.js} +1 -1
- package/dist/m/{c-LDUNOR57.js → c-2Z22FCFK.js} +13 -25
- package/dist/m/{c-NLZ5AN4L.js → c-2ZVOEU4M.js} +1 -1
- package/dist/m/{c-BJPZCWAV.js → c-37NAONZA.js} +1 -1
- package/dist/m/{c-ZE46QDIH.js → c-3TLG3OLG.js} +1 -1
- package/dist/m/{c-CSNE5EIF.js → c-4PO3YGDC.js} +1 -1
- package/dist/m/{c-OJYM642Q.js → c-5FKRZNJV.js} +1 -1
- package/dist/m/{c-SO63UGPQ.js → c-5OJ7YF2N.js} +1 -1
- package/dist/m/{c-CAWNFER6.js → c-5TIZ2I64.js} +1 -1
- package/dist/m/{c-7SXYQCN4.js → c-5WMXEKFH.js} +1 -1
- package/dist/m/{c-XQSXKIKM.js → c-6RDOKLN7.js} +1 -1
- package/dist/m/{c-BRLCTNMC.js → c-6TYGD5AB.js} +1 -1
- package/dist/m/c-A4IP6MBC.js +1 -0
- package/dist/m/{c-I2IFKJX2.js → c-ALDVFPWL.js} +1 -1
- package/dist/m/{c-LV5MABYD.js → c-AYVGD6A6.js} +1 -1
- package/dist/m/{c-LQU7TXIH.js → c-B6O7AJYG.js} +1 -1
- package/dist/m/{c-SBSMJIPC.js → c-BCGWJYXW.js} +1 -1
- package/dist/m/{c-RT3C74GY.js → c-BGKAT2FL.js} +1 -1
- package/dist/m/{c-N7Y52HJH.js → c-BXYSDKAN.js} +1 -1
- package/dist/m/c-CRPIDGXC.js +78 -0
- package/dist/m/c-CUMXGHVD.js +1 -0
- package/dist/m/{c-67ILSNPR.js → c-DTMZ3ZHI.js} +1 -1
- package/dist/m/{c-EZ7B5AZT.js → c-ELYIIYRS.js} +1 -1
- package/dist/m/{c-VAK7SG37.js → c-EUGJVHDD.js} +1 -1
- package/dist/m/{c-67LGZ52V.js → c-FCSZ3DC5.js} +1 -1
- package/dist/m/{c-JUE7B4OX.js → c-FQGHR32O.js} +1 -1
- package/dist/m/{c-ZJLU56DV.js → c-G4PWUDD5.js} +1 -1
- package/dist/m/{c-CJFDLD43.js → c-G6COVIZB.js} +1 -1
- package/dist/m/c-GBTVCJXC.js +1 -0
- package/dist/m/c-GC2HICFJ.js +1 -0
- package/dist/m/{c-44B5ODN7.js → c-HCNWJE4A.js} +2 -2
- package/dist/m/{c-BJ7YQ5QZ.js → c-IHUWUKIU.js} +1 -1
- package/dist/m/{c-LIBE4HPD.js → c-JCOQVZYS.js} +1 -1
- package/dist/m/{c-RG6XUZFA.js → c-JGHEACGK.js} +1 -1
- package/dist/m/{c-3GJ4XARY.js → c-JGLX6TBK.js} +1 -1
- package/dist/m/c-JNRKHYWO.js +1 -0
- package/dist/m/{c-PIVIYLTY.js → c-KDXIJEEF.js} +1 -1
- package/dist/m/{c-NFR673TL.js → c-L4KMT7FO.js} +2 -2
- package/dist/m/{c-E4IBSAQM.js → c-LCYPMULG.js} +1 -1
- package/dist/m/{c-SJPD46ZO.js → c-LIGQYZ7M.js} +4 -4
- package/dist/m/{c-U5X57T4L.js → c-LKIWEPAV.js} +1 -1
- package/dist/m/{c-EDSPKYMA.js → c-LUXAB2XI.js} +1 -1
- package/dist/m/{c-YSB6JKV2.js → c-LWIDDWAR.js} +2 -2
- package/dist/m/c-MPSKIU2I.js +1 -0
- package/dist/m/{c-DHXPDLW6.js → c-NK33MMYF.js} +1 -1
- package/dist/m/{c-GPGYKER7.js → c-NQLWOHLH.js} +1 -1
- package/dist/m/{c-LPUJXRXW.js → c-NTHUTABN.js} +1 -1
- package/dist/m/{c-Y33LUUIQ.js → c-NW54NHKE.js} +1 -1
- package/dist/m/{c-3AXJDL2P.js → c-OG6GFSUX.js} +1 -1
- package/dist/m/{c-MTQHWQC3.js → c-OKEGUICD.js} +1 -1
- package/dist/m/c-OPONJ2UK.js +128 -0
- package/dist/m/{c-3YH6JSIL.js → c-OWQWOGYI.js} +1 -1
- package/dist/m/{c-FDAXZ2PM.js → c-P6Q2ZTFQ.js} +1 -1
- package/dist/m/c-PKCCHJ5X.js +1 -0
- package/dist/m/c-PWJSJEJU.js +1 -0
- package/dist/m/{c-2ZZBC45O.js → c-PXLTUYZC.js} +1 -1
- package/dist/m/c-QEN6HZCA.js +1 -0
- package/dist/m/{c-JOH753EJ.js → c-QGAPG7OM.js} +1 -1
- package/dist/m/{c-W23KVGUO.js → c-QIR5CAKM.js} +1 -1
- package/dist/m/{c-GKEATME6.js → c-QM5LXRDT.js} +1 -1
- package/dist/m/c-QUGCKMWF.js +1 -0
- package/dist/m/{c-FNVQAACK.js → c-QYYUVLVG.js} +1 -1
- package/dist/m/c-RO73MKKR.js +1 -0
- package/dist/m/c-SBCBXKOZ.js +26 -0
- package/dist/m/{c-J3BXFTZS.js → c-SGRIYOAJ.js} +1 -1
- package/dist/m/c-SKF5HL4I.js +4 -0
- package/dist/m/{c-W3K23S72.js → c-SRPC3VBE.js} +1 -1
- package/dist/m/{c-K76AUL4I.js → c-T5NK2TVY.js} +1 -1
- package/dist/m/{c-EFD6QNTE.js → c-TANBH7FI.js} +1 -1
- package/dist/m/{c-5734MF2P.js → c-THGQQDYY.js} +1 -1
- package/dist/m/{c-YQUJ74R3.js → c-TSBVMWAH.js} +1 -1
- package/dist/m/{c-VY6XRBOW.js → c-UD5JZTDL.js} +1 -1
- package/dist/m/{c-M4FSPNQ2.js → c-UDGEFWNU.js} +1 -1
- package/dist/m/{c-ZSCBEB7I.js → c-UHUNXWKN.js} +1 -1
- package/dist/m/{c-BTLFLLML.js → c-VIRFF5HG.js} +1 -1
- package/dist/m/{c-2VB555FG.js → c-VYJ7O4RI.js} +1 -1
- package/dist/m/{c-TUGVINJR.js → c-W5E5P2TZ.js} +1 -1
- package/dist/m/{c-EOCKLMKX.js → c-W7IPVCAA.js} +1 -1
- package/dist/m/{c-5FEU5MMY.js → c-WJ5DRBHT.js} +1 -1
- package/dist/m/{c-V2J5C5MT.js → c-WQZTI5P2.js} +1 -1
- package/dist/m/c-X5WC4PX5.js +1 -0
- package/dist/m/{c-GVPNDIKJ.js → c-XCFQEWW6.js} +2 -2
- package/dist/m/c-XLQ3BDMM.js +1 -0
- package/dist/m/{c-XD5MOROJ.js → c-XX75FFNL.js} +1 -1
- package/dist/m/{c-JHJR5BQX.js → c-YK2L436K.js} +1 -1
- package/dist/m/{c-MEWUGR4D.js → c-YYMZWQLR.js} +1 -1
- package/dist/m/core/{admin-attrs-ZG7R5V3E.js → admin-attrs-U7IJNYBG.js} +1 -1
- package/dist/m/core/{autosave-VPORYJSE.js → autosave-F5YQCKVL.js} +1 -1
- package/dist/m/core/{conflict-notice-JMAZLVRX.js → conflict-notice-42H4ASLA.js} +1 -1
- package/dist/m/core/{persist-3OPWJKZS.js → persist-CJXIL7D4.js} +1 -1
- package/dist/m/core/{save-AOJBDSOK.js → save-ESPSQPLV.js} +1 -1
- package/dist/m/core/{save-core-IOCMXO5L.js → save-core-6SQHOR6W.js} +1 -1
- package/dist/m/core/snapshot-FJP5IJL3.js +1 -0
- package/dist/m/core/{unsaved-warning-U5VUJFOE.js → unsaved-warning-HNQVTA2D.js} +1 -1
- package/dist/m/internals/{index-HDRANDWE.js → index-NRPNDTSA.js} +1 -1
- package/dist/m/loader-FBDE2UAB.js +1 -0
- package/dist/m/manifest-1D2F5CA5.js +1 -0
- package/dist/m/manifest-edit-F7CC5CFD.js +1 -0
- package/dist/m/manifest.json +1139 -1069
- package/dist/m/page/{editor-EY2WAAGB.js → editor-OSKOW6RS.js} +2 -2
- package/dist/m/plugins/ai-edit-VV4QTINH.js +6 -0
- package/dist/m/plugins/cms-H7DTMUQX.js +2235 -0
- package/dist/m/plugins/{indicator-4VDXWYTD.js → indicator-WVPGMOZ7.js} +1 -1
- package/dist/m/plugins/{live-5EZN2EYP.js → live-DCUBKXY4.js} +1 -1
- package/dist/m/plugins/menu-Q4MFFQ6E.js +1 -0
- package/dist/m/plugins/{page-LVW5DWA4.js → page-OAWUJQEL.js} +2 -2
- package/dist/m/plugins/{page-view-5KQ76IJB.js → page-view-DZ26ZDDQ.js} +1 -1
- package/dist/m/plugins/{people-C7TVBBMR.js → people-5XRNRP5U.js} +1 -1
- package/dist/m/plugins/{quickcrop-BQ5YYFCH.js → quickcrop-WWF5I422.js} +2 -2
- package/dist/m/plugins/{richclay-KLGETK77.js → richclay-PGOOJ4OK.js} +2 -2
- package/dist/m/plugins/{sortable-WJZZBM7R.js → sortable-266HY6TR.js} +1 -1
- package/dist/m/plugins/{source-CCEUM3OR.js → source-6BKMK4PO.js} +1 -1
- package/dist/m/plugins/{upgrade-NW556WJD.js → upgrade-BNZVFHMZ.js} +1 -1
- package/dist/m/plugins/visitor-drafts-2AUYKAIJ.js +20 -0
- package/dist/m/plugins/{visitor-drafts-owner-MZP45XSG.js → visitor-drafts-owner-Z5B2OQBR.js} +1 -1
- package/dist/m/plugins/visitor-menu-4LQMKLPP.js +1 -0
- package/dist/m/plugins/{wire-VRYPY6EJ.js → wire-W2EV36KZ.js} +1 -1
- package/dist/m/{reader-core-2GXY7SHY.js → reader-core-POFQCKRV.js} +2 -2
- package/dist/m/sync/{live-sync-SKPMFYOO.js → live-sync-XGUPHI3I.js} +1 -1
- package/dist/m/ui/{index-QNIPDHXQ.js → index-VGYAKAKI.js} +1 -1
- package/dist/offline-manifest.json +666 -606
- package/docs/guide.md +38 -27
- package/package.json +2 -2
- package/src/core/save-replace.js +5 -2
- package/src/core/serialize-steps.js +10 -2
- package/src/core/snapshot.js +37 -1
- package/src/core/upgrade-run.js +16 -2
- package/src/loader-logic.js +10 -3
- package/src/plugins/ai-edit.js +6 -17
- package/src/plugins/cms.js +3 -6
- package/src/plugins/menu/dom-items.js +45 -0
- package/src/plugins/menu/looks.js +32 -0
- package/src/plugins/menu/shell-style.js +143 -0
- package/src/plugins/menu/shell.js +398 -0
- package/src/plugins/menu/style.js +15 -116
- package/src/plugins/menu/variants.js +56 -10
- package/src/plugins/menu/visitor.js +78 -0
- package/src/plugins/menu.js +21 -313
- package/src/plugins/visitor-drafts/inert.js +1 -0
- package/src/plugins/visitor-drafts/intro-style.js +6 -0
- package/src/plugins/visitor-drafts/intro.js +77 -25
- package/src/plugins/visitor-drafts/owner-chip.js +18 -23
- package/src/plugins/visitor-drafts/prompt.js +2 -2
- package/src/plugins/visitor-drafts/store.js +58 -5
- package/src/plugins/visitor-drafts.js +1 -0
- package/src/plugins/visitor-menu.js +13 -0
- package/src/sync/live-sync.js +2 -1
- package/src/sync/page-relay.js +2 -2
- package/src/ui/bevel.js +1 -1
- package/src/ui/page-colour.js +17 -9
- package/src/ui/skins/cms.js +1 -1
- package/src/ui/skins/quickcrop.js +1 -1
- package/src/ui/skins/richclay.js +1 -1
- package/src/vendor/hypercms.vendor.js +16 -69
- package/dist/m/c-AL4RBJF2.js +0 -1
- package/dist/m/c-DDDOKPI6.js +0 -3
- package/dist/m/c-EGTIAL6P.js +0 -1
- package/dist/m/c-FSWRGBVQ.js +0 -1
- package/dist/m/c-HDWZEJHM.js +0 -183
- package/dist/m/c-HMYWIHFG.js +0 -1
- package/dist/m/c-JH5FF4NL.js +0 -20
- package/dist/m/c-M6FNQCTQ.js +0 -1
- package/dist/m/c-MHI3GYKF.js +0 -1
- package/dist/m/c-MIL4B2JQ.js +0 -1
- package/dist/m/c-S5IEIZCN.js +0 -1
- package/dist/m/c-VSPAFOKU.js +0 -1
- package/dist/m/c-WFMRX5RZ.js +0 -1
- package/dist/m/core/snapshot-O7II2AGG.js +0 -1
- package/dist/m/loader-ZVPK4ZN3.js +0 -1
- package/dist/m/manifest-5498AFD3.js +0 -1
- package/dist/m/manifest-edit-62A5A00F.js +0 -1
- package/dist/m/plugins/ai-edit-J5VLSW5I.js +0 -6
- package/dist/m/plugins/cms-LRAOZHT7.js +0 -2293
- package/dist/m/plugins/menu-DM2JHPSR.js +0 -1
- package/dist/m/plugins/visitor-drafts-2AWNT23K.js +0 -20
- package/src/ui/skins/cms-toggle.js +0 -15
- /package/dist/m/plugins/{quickcrop-BQ5YYFCH.js.LEGAL.txt → quickcrop-WWF5I422.js.LEGAL.txt} +0 -0
- /package/dist/m/plugins/{richclay-KLGETK77.js.LEGAL.txt → richclay-PGOOJ4OK.js.LEGAL.txt} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as Me,b as ue,c as Re,d as de,e as pe}from"../c-HDWZEJHM.js";import{a as Z}from"../c-AQLFEATB.js";import{b as Le}from"../c-QY7F6EN6.js";import{b as Ne,c as Qe}from"../c-RVMWGXEJ.js";import{d as Se}from"../c-MHI3GYKF.js";import{a as Ae,b as Ce}from"../c-RHMPKZZ7.js";import{a as ke}from"../c-VKEDWYDF.js";import{b as ie,c as ce,f as Ee,g as xe}from"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import"../c-HA6INT6J.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";var $e='<svg xmlns="http://www.w3.org/2000/svg" viewBox="-45.87 -57.96 100.26 60.98" fill="currentColor" aria-hidden="true" focusable="false"><path fill-rule="evenodd" d="M44.35 -4.56Q40.03 -0.52 34.69 -0.39Q29.34 -0.25 24.81 -0.14Q20.27 -0.02 15.6 0Q10.93 0.02 6.41 0Q1.89 -0.02 -2.79 -0.02Q-7.48 -0.02 -12.11 -0.14Q-16.73 -0.25 -21.64 -0.27Q-26.55 -0.3 -31.72 -2.25Q-36.88 -4.2 -39.87 -9.12Q-42.87 -14.03 -42.8 -19.61Q-42.74 -25.18 -40.43 -29.94Q-38.12 -34.69 -34.82 -38.78Q-31.52 -42.87 -27.25 -45.6Q-22.98 -48.33 -18.35 -50.59Q-13.73 -52.85 -8.7 -53.88Q-3.68 -54.91 1.32 -54.93Q6.32 -54.96 11.44 -54.56Q16.55 -54.16 21.35 -52.2Q26.16 -50.24 30.69 -48.01Q35.22 -45.78 38.99 -42.18Q42.76 -38.59 45.67 -34.37Q48.59 -30.15 49.99 -24.87Q51.39 -19.59 50.04 -14.09Q48.68 -8.6 44.35 -4.56ZM0.66 -30.49C0.5 -28.73 -0.88 -27.42 -2.42 -27.57C-3.96 -27.71 -5.08 -29.25 -4.91 -31.01C-4.75 -32.77 -3.36 -34.08 -1.83 -33.94C-0.29 -33.79 0.83 -32.25 0.66 -30.49ZM13.61 -29.28C13.44 -27.52 12.06 -26.21 10.52 -26.35C8.98 -26.5 7.87 -28.04 8.03 -29.8C8.2 -31.56 9.58 -32.87 11.12 -32.73C12.66 -32.58 13.77 -31.04 13.61 -29.28ZM-1.23 -17.71Q-0.62 -17.35 -0.03 -17.08Q0.56 -16.81 1.15 -16.54Q1.73 -16.28 2.4 -16Q3.07 -15.72 3.87 -15.6Q4.66 -15.48 5.4 -15.55Q6.13 -15.62 6.77 -15.79Q7.41 -15.96 7.97 -16.23Q8.53 -16.5 9 -16.91Q9.46 -17.32 9.73 -17.9Q9.99 -18.47 10.08 -19.12Q10.17 -19.77 10.08 -20.42Q9.99 -21.06 9.45 -21.32Q8.91 -21.58 8.27 -21.38Q7.63 -21.17 6.99 -20.91Q6.36 -20.65 5.7 -20.61Q5.04 -20.56 4.33 -20.73Q3.62 -20.9 2.92 -21.14Q2.23 -21.39 1.54 -21.68Q0.85 -21.97 0.16 -22.27Q-0.52 -22.56 -1.22 -22.79Q-1.92 -23.03 -2.49 -22.61Q-3.05 -22.19 -3.23 -21.5Q-3.4 -20.81 -3.2 -20.09Q-3.01 -19.38 -3.02 -19.15Q-3.02 -18.93 -2.42 -18.5Q-1.83 -18.06 -1.23 -17.71Z"/></svg>';var Pe=new Set(["top-left","top-right","bottom-left","bottom-right"]),Je=4,Te="menu-corner";function et(t,n,f,x){return`${n<x/2?"top":"bottom"}-${t<f/2?"left":"right"}`}function tt(t,n){let[f,x]=t.split("-");if(n==="ArrowUp")f="top";else if(n==="ArrowDown")f="bottom";else if(n==="ArrowLeft")x="left";else if(n==="ArrowRight")x="right";else return null;return`${f}-${x}`}function nt(t){let n=null;try{n=t?t.get(Te):null}catch{}return Pe.has(n)?n:"top-right"}function ot(t){let n=document.createElement("div");n.className="clay-menu-spots",n.setAttribute("clay","editor-ui"),n.setAttribute("aria-hidden","true");for(let f of Pe){let x=document.createElement("span");x.className="clay-menu-spot",x.dataset.to=f,n.append(x)}return t.append(n),n}function Oe({dock:t,container:n=document.body,grip:f,storage:x,onMove:p,onDragStart:$}){function l(r,{remember:m=!0}={}){if(t.dataset.corner=r,m)try{x&&x.set(Te,r)}catch{}p&&p(r)}l(nt(x),{remember:!1}),f.addEventListener("keydown",r=>{let m=tt(t.dataset.corner,r.key);m&&(r.preventDefault(),m!==t.dataset.corner&&l(m))});let o=null;f.addEventListener("pointerdown",r=>{if(r.button!==0||r.isPrimary===!1)return;let m=t.getBoundingClientRect();if(o={id:r.pointerId,x:r.clientX,y:r.clientY,dx:r.clientX-m.left,dy:r.clientY-m.top,w:m.width,h:m.height,moving:!1,spots:null,near:null},f.setPointerCapture)try{f.setPointerCapture(r.pointerId)}catch{}}),f.addEventListener("pointermove",r=>{if(!o||r.pointerId!==o.id)return;if(!o.moving){if(Math.hypot(r.clientX-o.x,r.clientY-o.y)<Je)return;o.moving=!0,t.setAttribute("data-dragging",""),o.spots=ot(n),o.spots.style.setProperty("color-scheme",getComputedStyle(t).colorScheme),$&&$()}let m=r.clientX-o.dx,k=r.clientY-o.dy;Object.assign(t.style,{left:`${m}px`,top:`${k}px`,right:"auto",bottom:"auto"}),o.near=et(m+o.w/2,k+o.h/2,window.innerWidth,window.innerHeight);for(let Q of o.spots.children)Q.toggleAttribute("data-near",Q.dataset.to===o.near)});let y=r=>m=>{if(!o||m.pointerId!==o.id)return;let{moving:k,near:Q,spots:s}=o;if(o=null,!!k){s.remove(),t.removeAttribute("data-dragging");for(let c of["left","top","right","bottom"])t.style.removeProperty(c);r&&Q?l(Q):l(t.dataset.corner,{remember:!1})}};return f.addEventListener("pointerup",y(!0)),f.addEventListener("pointercancel",y(!1)),f.addEventListener("lostpointercapture",y(!1)),{setCorner:l}}var qe=()=>/mac|iphone|ipad|ipod/i.test(navigator.userAgentData&&navigator.userAgentData.platform||navigator.platform||navigator.userAgent||""),at=()=>/Win/.test(navigator.userAgentData&&navigator.userAgentData.platform||navigator.platform||navigator.userAgent||""),De=()=>qe()?"Show in Finder":at()?"Show in Explorer":"Show in folder",te=(t,n)=>qe()?t:n;var ne="menu-resume",rt=5e3,T=()=>window.clay||{},Ie=()=>T().storage&&T().storage.session,fe=t=>{let n=T().editPlugins;return Array.isArray(n)&&n.includes(t)};function Ue(t,n=rt){return new Promise(f=>{let x=Date.now(),p=()=>{let $=t();$||Date.now()-x>=n?f($||null):setTimeout(p,50)};p()})}function Be({addItem:t,note:n,currentMode:f}){let x=new Map;async function p(s,c){if(f()==="edit")return c();let M=Ie();M&&M.set(ne,s);let S;try{S=await T().setMode?.("edit")}catch(P){S={ok:!1,message:P&&P.message}}if(!(S&&S.ok!==!1&&S.reloading)){if(M&&M.remove(ne),!S||S.ok===!1){let P=S?Z(S):"Couldn't switch modes.";P&&n(P);return}return c()}}function $(s,c){return x.set(s,c),()=>p(s,c)}let l={canUndo:!1,canRedo:!1},o=!1;function y(){if(!fe("undo"))return;let s=f()==="edit"&&T().undo;!o&&s&&typeof s.canUndo=="boolean"&&(l={canUndo:s.canUndo,canRedo:!!s.canRedo}),t({id:"clay.undo",pair:[{id:"clay.undo.undo",label:"Undo",keys:te("\u2318Z","Ctrl+Z"),disabled:!(s&&l.canUndo),run:()=>T().undo?.undo()},{id:"clay.undo.redo",label:"Redo",keys:te("\u2318\u21E7Z","Ctrl+Shift+Z"),disabled:!(s&&l.canRedo),run:()=>T().undo?.redo()}]})}document.addEventListener("clay:undo-change",s=>{let c=s.detail||{};o=!0,l={canUndo:!!c.canUndo,canRedo:!!c.canRedo},y()}),document.addEventListener("clay:modechange",y),y(),fe("ai-edit")&&t({id:"clay.ai",label:"Ask AI\u2026",keys:te("\u2318J","Ctrl+J"),run:$("ai",async()=>{let s=await Ue(()=>T().aiEdit);s&&await s.open(document.body)||n("Ask AI isn't available on this page right now.")})}),fe("cms")&&T().cms?.hasRules?.(document)&&t({id:"clay.cms",label:"Open the CMS (Edit content)",run:$("cms",async()=>{let s=await Ue(()=>T().cms),c=null;try{c=s?await s.open():{ok:!1}}catch{c={ok:!1}}c&&c.ok===!1&&n("Couldn't open the CMS. Try again.")})}),t({id:"clay.download",label:"Download a copy",run:async()=>{let s=null;try{if(typeof T().getHTML=="function")s=T().getHTML();else{let c=await fetch(location.href,{cache:"no-store",credentials:"same-origin"});c.ok&&(s=await c.text())}}catch{}typeof s=="string"&&/^https?:$/.test(location.protocol)&&(s=s.replace(/(^|[^\w./:-])\/_\/uploads\//g,`$1${location.origin}/_/uploads/`)),(typeof s!="string"||!await Ce({html:s,name:`${Ae()}.html`}))&&n("Couldn't build the download. Try again.")}});async function r(s){let c=null;try{let M=await fetch(s,{method:"POST",credentials:"same-origin",headers:{"Document-URL":location.href}});if(c=await M.json().catch(()=>null),M.ok&&c?.ok!==!1){typeof c?.href=="string"&&window.open(c.href,"_blank","noopener");return}}catch{}n(typeof c?.message=="string"&&c.message?c.message:"Couldn't do that. Try again.")}let m=(s,c,M)=>{M?.href?t({id:s,label:c,href:M.href}):M?.post&&t({id:s,label:c,run:()=>r(M.post)})};import("../c-ZRXJD4G6.js").then(({hostActions:s})=>s()).then(s=>{m("clay.code","Open the code editor",s.codeEditor),m("clay.duplicate","Duplicate as a new page",s.duplicate),m("clay.export","Export as zip",s.export),m("clay.reveal",De(),s.reveal),m("clay.versions","Version history\u2026",s.versions)}).catch(()=>{});let k=Ie(),Q=k&&k.get(ne);if(Q){k.remove(ne);let s=x.get(Q);s&&f()==="edit"&&s()}return{inEditMode:p,resumable:$,refresh:y}}var st='<svg viewBox="0 0 256 256" aria-hidden="true" focusable="false"><path d="M205.66 194.34a8 8 0 0 1-11.32 11.32L128 139.31l-66.34 66.35a8 8 0 0 1-11.32-11.32L116.69 128 50.34 61.66a8 8 0 0 1 11.32-11.32L128 116.69l66.34-66.35a8 8 0 0 1 11.32 11.32L139.31 128Z"/></svg>',lt=3,oe=(t,n,f)=>`${t} ${t===1?n:f}`;function me(t){let n=document.createElement("span");n.className="clay-avatar",n.setAttribute("aria-hidden","true");let f=Ne(t.id);return n.style.setProperty("color",f),n.style.setProperty("border-color",f),n.style.setProperty("background","var(--bevel-surface)"),n.textContent=Qe(t.name),n}function _e({root:t,capsule:n,addItem:f,removeItem:x,closeMenu:p,note:$}){let l={supported:!1,people:[],anonymous:0},o=null,y=null,r=null,m=!1,k=()=>window.clay&&window.clay.people,Q=()=>window.clay&&window.clay.me||null,s=()=>{try{return!!k()?.canRename?.()}catch{return!1}},c=()=>l.people.length+l.anonymous,M=()=>document.documentElement.hasAttribute("clay-menu-roster");function S({restore:C=!0}={}){o&&(o.remove(),o=null,m=!1,r?.setAttribute("aria-expanded","false"),C&&y&&y.isConnected&&y.focus(),y=null)}function P(){let C=Q();if(!C||!C.name)return null;let w=document.createElement("div");w.className="clay-people-me";let A=document.createElement("span");A.className="clay-people-me-label",A.textContent="Your edits are signed as";let N=document.createElement("div");if(N.className="clay-people-me-row",w.append(A,N),m){let h=document.createElement("input");h.className="clay-people-input",h.type="text",h.value=C.name,h.setAttribute("aria-label","Your name"),h.maxLength=120;let g=document.createElement("button");g.type="button",g.className="clay-menu-btn clay-menu-btn-small clay-menu-btn-primary",g.textContent="Save";let i=()=>{try{k().rename(h.value)}catch(a){$(a&&a.code==="not-renamable"?"This name comes from your account, so it can't be changed here.":"Use a name of 1 to 120 characters that isn't an email address."),h.focus();return}m=!1,R(),o?.querySelector(".clay-people-me .clay-menu-btn")?.focus()};g.addEventListener("click",i),h.addEventListener("keydown",a=>{a.key==="Enter"&&(a.preventDefault(),i())}),N.append(h,g),queueMicrotask(()=>{h.isConnected&&(h.focus(),h.select())})}else{let h=document.createElement("span");if(h.className="clay-people-me-name",h.textContent=C.name,N.append(me(C),h),s()){let g=document.createElement("button");g.type="button",g.className="clay-menu-btn clay-menu-btn-small",g.textContent="Change",g.addEventListener("click",()=>{m=!0,R()}),N.append(g)}}return w}function R(){if(!o)return;let C=c();o.textContent="";let w=document.createElement("div");w.className="clay-people-head";let A=document.createElement("h3");A.className="clay-people-title",A.textContent="Who's here";let N=document.createElement("span");N.className="clay-people-sum",N.textContent=oe(C,"person","people");let h=document.createElement("button");if(h.type="button",h.className="clay-people-close",h.setAttribute("aria-label","Close"),h.innerHTML=st,h.addEventListener("click",()=>S()),w.append(A,N,h),o.append(w),l.people.length){let i=document.createElement("ul");i.className="clay-people-list";for(let a of l.people){let v=document.createElement("li");v.className="clay-people-row";let L=document.createElement("span");L.className="clay-people-who";let z=document.createElement("strong");if(z.textContent=a.name,a.you){let K=document.createElement("span");K.textContent="(you)",z.append(K)}L.append(z),v.append(me(a),L),i.append(v)}o.append(i)}if(l.anonymous>0){let i=document.createElement("p");i.className="clay-people-anon",i.textContent=l.anonymous===1?"1 other person is here without a shared name.":`${l.anonymous} others are here without a shared name.`,o.append(i)}let g=P();g&&o.append(g)}function I(C){if(p(),o){S();return}y=C,o=document.createElement("div"),o.className="clay-people",o.setAttribute("role","dialog"),o.setAttribute("aria-label","Who's here"),o.addEventListener("keydown",w=>{w.key==="Escape"&&(w.preventDefault(),w.stopPropagation(),m?(m=!1,R(),o.querySelector(".clay-people-me .clay-menu-btn")?.focus()):S())}),R(),t.append(o),r?.setAttribute("aria-expanded",C===r?"true":"false"),o.querySelector(".clay-people-close").focus()}function H(){if(!(M()&&l.supported&&c()>1)){r?.remove(),r=null;return}r||(r=document.createElement("button"),r.type="button",r.className="clay-roster",r.setAttribute("aria-haspopup","dialog"),r.setAttribute("aria-expanded",o?"true":"false"),r.addEventListener("click",()=>I(r)),t.insertBefore(r,n));let w=l.people.slice(0,lt),A=c()-w.length,N=document.createElement("span");N.className="clay-roster-faces";for(let g of w)N.append(me(g));r.textContent="",r.append(N),A>0&&r.append(oe(A,"other","others"));let h=w.map(g=>g.name);r.setAttribute("aria-label",`Who's here: ${h.join(", ")}${A>0?`${h.length?" and ":""}${oe(A,"other","others")}`:""}`)}let O=null;function B(){let C=c();if(l.supported&&(C>1||s())){let w=C>1?`Who's here (${oe(C,"person","people")})`:"Who's here";w!==O&&(O=w,f({id:"clay.people",label:w,run:()=>I(n.querySelector(".clay-menu-goo"))}))}else O!==null&&x("clay.people"),O=null,S({restore:!1});if(H(),o&&!m){let w=t.getRootNode().activeElement,A=w&&o.contains(w)?w.classList[0]:null;R(),A&&o.querySelector(`.${A}`)?.focus()}}return document.addEventListener("click",C=>{o&&!C.composedPath().includes(t)&&S({restore:!1})}),document.addEventListener("clay:people",()=>{m||B()}),import("../c-FTWGYI5E.js").then(({presence:C})=>{C.subscribe(w=>{l=w||l,B()})}).catch(()=>{}),{close:S}}var re="not all",ae="variants-choose",ye="clay.variants.keep",it="Change the page look",ct="Keep one page look",ut='<svg viewBox="0 0 6 10" aria-hidden="true" focusable="false"><rect x="4" width="2" height="2"/><rect x="2" y="2" width="2" height="2"/><rect y="4" width="2" height="2"/><rect x="2" y="6" width="2" height="2"/><rect x="4" y="8" width="2" height="2"/></svg>',dt='<svg viewBox="0 0 6 10" aria-hidden="true" focusable="false"><rect width="2" height="2"/><rect x="2" y="2" width="2" height="2"/><rect x="4" y="4" width="2" height="2"/><rect x="2" y="6" width="2" height="2"/><rect y="8" width="2" height="2"/></svg>',F=()=>[...document.querySelectorAll("head style[clay-variant]")],V=t=>t.getAttribute("clay-variant"),D=()=>F().map(V);function _(){let t=F(),n=t.find(f=>f.getAttribute("media")!==re);return n?V(n):t.length?V(t[0]):null}function He(t,n){let f=window.clay&&window.clay.undo;f&&typeof f.commit=="function"?f.commit(t,n):n(),!document.documentElement.hasAttribute("autosave")&&typeof window.clay?.save=="function"&&window.clay.save()}async function pt(){let t=await import("../core/save-AOJBDSOK.js");for(;!t.baselineSettled();)await new Promise(n=>document.addEventListener("clay:baseline-settled",n,{once:!0}))}function ft(t){let n=t.map(f=>`Variant ${f}`);return n.length<2?n.join(""):`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`}function Ve({root:t,capsule:n,addItem:f,removeItem:x,note:p,currentMode:$}){let l=null,o=null,y=null,r=null,m=null,k=()=>$()==="edit",Q=()=>l??_(),s=()=>window.clay&&window.clay.storage&&window.clay.storage.session;function c(){let i=_();l!==null&&l===i&&(l=null),y?.remove(),y=null;for(let v of F()){if(!v.sheet)continue;let L=v.getAttribute("media")!==re;v.sheet.disabled=L&&(V(v)!==i||l!==null)}if(l===null)return;let a=F().find(v=>V(v)===l);if(!a)return l=null,c();y=document.createElement("style"),y.setAttribute("clay","editor-ui"),y.dataset.clayVariantPreview=l,y.textContent=a.textContent,a.after(y)}function M(){document.dispatchEvent(new CustomEvent("clay:variant-change",{detail:{active:_(),shown:Q()}}))}function S(i){return k()?D().includes(i)?(o=l=null,He(it,()=>{for(let a of F())V(a)===i?a.removeAttribute("media"):a.getAttribute("media")!==re&&a.setAttribute("media",re)}),A(),{ok:!0}):{ok:!1,code:"unknown-variant"}:{ok:!1,code:"not-editing"}}function P(i){return i!==null&&!D().includes(i)?{ok:!1,code:"unknown-variant"}:(l=i,A(),{ok:!0})}function R(i){o=l=null,He(ct,()=>{for(let a of F())V(a)===i?(a.removeAttribute("clay-variant"),a.removeAttribute("media"),a.sheet&&(a.sheet.disabled=!1)):a.remove()}),A()}function I(){if(!k())return Promise.resolve({ok:!1,code:"not-editing"});let i=_(),a=D().filter(L=>L!==i);if(!a.length)return Promise.resolve({ok:!1,code:"unknown-variant"});let v=`Keep Variant ${i} and delete ${ft(a)}? The switcher goes away. Version history still has them.`;return import("../c-FSWRGBVQ.js").then(L=>L.consent(v)).then(()=>(R(i),{ok:!0}),()=>({ok:!1,code:"cancelled"}))}async function H(){let i=l,a=window.clay;if(i===null||!a||typeof a.setMode!="function")return;s()?.set(ae,i);let v;try{v=await a.setMode("edit")}catch(L){v={ok:!1,message:L&&L.message}}if(!(v&&v.reloading)&&v&&v.ok===!1){s()?.remove(ae);let L=Z(v);L&&p(L)}}async function O(){let i=s(),a=i?.get(ae);a!=null&&(i.remove(ae),!(!k()||!D().includes(a))&&(o=l=a,A(),await pt(),!(o!==a||!g())&&(o=null,k()&&D().includes(a)&&S(a))))}function B(i){let a=D(),v=a[(a.indexOf(Q())+i+a.length)%a.length];k()?S(v):P(v)}function C(){let i=document.createElement("div");i.className="clay-variants",i.setAttribute("role","group"),i.setAttribute("aria-label","Page look"),i.innerHTML=`<button type="button" class="clay-variants-step" data-step="-1" aria-label="Previous look">${ut}</button><span class="clay-variants-name" aria-live="polite"></span><button type="button" class="clay-variants-step" data-step="1" aria-label="Next look">${dt}</button><button type="button" class="clay-menu-btn clay-menu-btn-small clay-menu-btn-primary clay-variants-use" hidden>Use this look</button><button type="button" class="clay-menu-btn clay-menu-btn-small clay-variants-keep" hidden>Keep</button>`;for(let a of i.querySelectorAll(".clay-variants-step"))a.addEventListener("click",()=>B(Number(a.dataset.step)));return i.querySelector(".clay-variants-use").addEventListener("click",H),i.querySelector(".clay-variants-keep").addEventListener("click",()=>I()),i}function w(){let i=D();if(m=N(),i.length<2){r?.remove(),r=null,x(ye);return}r||(r=C()),r.isConnected||t.insertBefore(r,t.querySelector(".clay-roster")??n);let a=Q(),v=r.querySelector(".clay-variants-name");v.textContent=`Variant ${a} `;let L=document.createElement("small");L.textContent=`(${i.indexOf(a)+1}/${i.length})`,v.append(L),r.querySelector(".clay-variants-use").hidden=k()||l===null,r.querySelector(".clay-variants-keep").hidden=!k(),k()?f({id:ye,label:`Keep Variant ${_()}, remove the others\u2026`,run:()=>I()}):x(ye)}function A(){c(),w(),M()}let N=()=>`${D().join(",")}|${_()}|${Q()}`,h=null,g=()=>window.clay?.variants===h;document.addEventListener("clay:modechange",()=>{g()&&(k()?(l=o,O()):o=null,A())}),document.addEventListener("clay:sync-applied",()=>{g()&&A()}),document.addEventListener("clay:undo-change",()=>{g()&&N()!==m&&A()}),h=window.clay.variants={list:()=>{let i=_();return D().map(a=>({name:a,label:`Variant ${a}`,active:a===i}))},get active(){return _()},get shown(){return Q()},preview:P,choose:S,keep:I},D().length>=2&&(k()&&O(),A())}var mt=!0,We="1",j=8,yt='<svg viewBox="0 0 10 10" aria-hidden="true" focusable="false"><path d="M1 0 5 4l4-4 1 1-4 4 4 4-1 1-4-4-4 4-1-1 4-4-4-4z"/></svg>',ht=6e3,bt=12,gt='<svg viewBox="0 0 6 12" aria-hidden="true" focusable="false"><rect width="2" height="2"/><rect x="4" width="2" height="2"/><rect y="5" width="2" height="2"/><rect x="4" y="5" width="2" height="2"/><rect y="10" width="2" height="2"/><rect x="4" y="10" width="2" height="2"/></svg>',Ze=[["clay.undo","clay.cms","clay.ai","clay.code"],["seo","clay.variants.keep","clay.share","clay.people"],["clay.duplicate","clay.download","clay.export","clay.reveal"],["clay.versions"],null,["upgrade"]],wt=new Set(Ze.flat().filter(Boolean)),W=()=>window.clay&&typeof window.clay.mode=="string"?window.clay.mode:xe;function vt(){let t=document.querySelectorAll("[clay-menu-slot]");return t.length>1&&console.warn("[clay] This page has more than one clay-menu-slot. The menu uses the first."),t[0]||null}function Et(){let t=document.querySelector("style[clay-menu-skin]");return t?t.getAttribute("clay-menu-skin")!==We?(console.warn(`[clay] This runtime reads clay-menu-skin="${We}". The menu keeps its default look.`),null):t.textContent:null}function xt(){if(document.querySelector('clay-editor-ui[data-clay-ui="menu"]'))return;let t=vt(),n=!!t,f=n?Et():null,x=n&&t.hasAttribute("no-edit-switch"),p=document.createElement("div");p.className="clay-menu-dock",p.setAttribute("clay","editor-ui"),p.setAttribute("part","dock"),n&&(p.dataset.embedded=""),p.dataset.corner="top-right",p.innerHTML=`<div class="clay-menu" part="capsule" clay="editor-ui"><button type="button" class="clay-menu-grip" aria-label="Move the menu. Drag it, or use the arrow keys to move it to another corner.">${gt}</button><button type="button" class="clay-menu-edit" part="edit" role="switch" aria-checked="false"><span class="clay-menu-track" aria-hidden="true"><span class="clay-menu-thumb"></span></span><span class="clay-menu-label">Edit</span></button><span class="clay-menu-divider" aria-hidden="true"></span><button type="button" class="clay-menu-goo" part="button" aria-haspopup="menu" aria-expanded="false" aria-label="Clay menu">${$e}</button></div><div class="clay-menu-list" part="list" role="menu" aria-label="Clay menu" hidden></div><div class="clay-menu-note" part="note" role="status" hidden></div>`;let $=p.querySelector(".clay-menu-grip"),l=p.querySelector(".clay-menu-edit"),o=p.querySelector(".clay-menu-goo"),y=p.querySelector(".clay-menu-list"),r=p.querySelector(".clay-menu-note"),m=new Map;if(n){$.hidden=!0;let e=t.querySelector("template[clay-menu-icon]");e&&o.replaceChildren(e.content.cloneNode(!0));let u=t.getAttribute("clay-menu-label");u&&(o.setAttribute("aria-label",u),o.title=u,y.setAttribute("aria-label",u)),x&&(l.hidden=!0,p.querySelector(".clay-menu-divider").hidden=!0)}let k=n&&typeof y.showPopover=="function";k&&y.setAttribute("popover","manual");function Q(){let e=o.getBoundingClientRect(),{offsetWidth:u,offsetHeight:d}=y,b=Math.max(j,Math.min(e.right-u,window.innerWidth-u-j)),E=e.bottom+j,U=E+d>window.innerHeight-j?Math.max(j,e.top-d-j):E;y.style.left=`${Math.round(b)}px`,y.style.top=`${Math.round(U)}px`}let s=()=>p.getRootNode().activeElement||null,c=()=>!y.hidden;function M(e){y.hidden=!e,o.setAttribute("aria-expanded",e?"true":"false"),k&&(e?(y.showPopover(),Q()):y.matches(":popover-open")&&y.hidePopover())}let S=()=>[...y.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')];function P(e){let u=S();u.length&&u[(e+u.length)%u.length].focus()}function R(){c()&&M(!1)}let I=null,H=null;function O(){c()||(H?.close({restore:!1}),I?.refresh(),N(),M(!0))}function B(e){let u=e.href&&!e.disabled,d=document.createElement(u?"a":"button");if(u?(d.href=e.href,d.target="_blank",d.rel="noopener"):d.type="button",d.setAttribute("role","menuitem"),d.setAttribute("part",e.quiet?"item quiet":"item"),d.dataset.menuId=e.id,e.badge&&e.id==="upgrade"){let b=document.createElement("span");b.className="clay-menu-upgrade",b.textContent=e.label,d.append(b)}else d.textContent=e.label;if(e.keys){let b=document.createElement("kbd");b.textContent=e.keys,d.append(b)}return e.disabled&&d.setAttribute("aria-disabled","true"),d.addEventListener("click",()=>{e.disabled||(R(),e.run&&e.run({anchor:o}))}),d}function C(e){if(e.text){let u=document.createElement("p");return u.className="clay-menu-version",u.setAttribute("part","text"),u.dataset.menuId=e.id,u.textContent=e.label,u}if(e.pair){let u=document.createElement("div");u.className="clay-menu-pair",u.dataset.menuId=e.id;for(let d of e.pair)u.append(B(d));return u}return e.dismiss?w(e):B(e)}function w(e){let u=document.createElement("div");u.className="clay-menu-row",u.dataset.menuId=e.id;let d=document.createElement("button");return d.type="button",d.setAttribute("role","menuitem"),d.setAttribute("part","dismiss"),d.dataset.menuId=`${e.id}.dismiss`,d.setAttribute("aria-label",e.dismiss.label),d.title=e.dismiss.label,d.innerHTML=yt,d.addEventListener("click",()=>{i(e.id),e.dismiss.run?.()}),u.append(B(e),d),u}function A(){let e=b=>[...m.values()].filter(E=>E.section===b),u=[...m.keys()].filter(b=>!wt.has(b)&&!m.get(b).section),d=Ze.map(b=>(b||u).map(E=>m.get(E)).filter(Boolean));return[e("start"),...d,e("end")].filter(b=>b.length)}function N(){let e=s(),u=e&&y.contains(e)?e.dataset.menuId:null;y.textContent="",A().forEach((E,U)=>{if(U){let q=document.createElement("div");q.className="clay-menu-sep",q.setAttribute("role","separator"),q.setAttribute("part","separator"),y.append(q)}for(let q of E)y.append(C(q))});let d=o.querySelector(".clay-menu-dot"),b=[...m.values()].some(E=>E.badge);if(b&&!d){let E=document.createElement("span");E.className="clay-menu-dot",E.setAttribute("aria-hidden","true"),o.append(E)}else!b&&d&&d.remove();if(u){let E=S().find(U=>U.dataset.menuId===u);E?E.focus():P(0)}}let h=({id:e,label:u,run:d,badge:b,keys:E,disabled:U,href:q})=>({id:e,href:typeof q=="string"?q:"",label:String(u??""),run:typeof d=="function"?d:null,badge:!!b,keys:E?String(E):"",disabled:!!U});function g({id:e,label:u,run:d,badge:b,keys:E,disabled:U,text:q,pair:ve,href:Ge,section:le,quiet:Xe,dismiss:ee}={}){if(!e)return null;let Y=h({id:e,label:u,run:d,badge:b,keys:E,disabled:U,href:Ge});return q&&(Y.text=!0),Array.isArray(ve)&&(Y.pair=ve.map(h)),(le==="start"||le==="end")&&(Y.section=le),Xe&&(Y.quiet=!0),ee&&(Y.dismiss={label:String(ee.label||"Dismiss"),run:typeof ee.run=="function"?ee.run:null}),m.set(e,Y),N(),e}function i(e){m.delete(e)&&N()}function a(e){e&&(r.textContent=e,r.hidden=!1,clearTimeout(v),v=setTimeout(()=>{r.hidden=!0,r.textContent=""},ht))}let v=0,L=!1,z=()=>{p.hidden=!ce&&W()!=="edit"};function K(){l.setAttribute("aria-checked",W()==="edit"?"true":"false"),x&&g({id:"clay.mode",label:W()==="edit"?"View mode":"Edit mode",section:"start",run:()=>l.click()})}K(),document.addEventListener("clay:modechange",K),l.addEventListener("click",async()=>{if(L)return;let e=l.getAttribute("aria-checked"),u=s()===l,d=W()==="edit"?"view":"edit";L=!0,l.setAttribute("aria-busy","true"),l.disabled=!0;let b;try{b=await window.clay?.setMode?.(d)}catch(E){b={ok:!1,message:E&&E.message}}if(!(b&&b.reloading))if(L=!1,l.removeAttribute("aria-busy"),l.disabled=!1,u&&l.isConnected&&!s()&&document.activeElement===document.body&&l.focus(),b&&b.ok===!1){l.setAttribute("aria-checked",e);let E=Z(b);E&&a(E)}else K()}),o.addEventListener("click",()=>{c()?R():O()}),document.addEventListener("click",e=>{c()&&!e.composedPath().includes(p)&&R()}),p.addEventListener("keydown",e=>{if(e.key==="Escape"){if(!c())return;e.preventDefault(),R(),o.focus();return}if(e.target===o&&(e.key==="Enter"||e.key===" ")){e.preventDefault(),c()?R():(O(),P(0));return}if(!c())return;if(e.key==="Enter"&&y.contains(e.target)){e.preventDefault(),e.target.click();return}let u=S();if(!u.length)return;let d=u.indexOf(s());e.key==="ArrowDown"?(e.preventDefault(),P(d<0?0:d+1)):e.key==="ArrowUp"&&(e.preventDefault(),P(d<0?u.length-1:d-1))});let he=document,G=null,X=null;function se(e){p.dataset.corner.startsWith("top")?p.style.top=`${Math.round(e.getBoundingClientRect().bottom)+bt}px`:p.style.removeProperty("top")}let je=()=>{X?se(X):p.style.removeProperty("top")};function be(){if(!p.isConnected)return;let e=he.querySelector(".clay-intro");if(e!==X){if(G&&(G.disconnect(),G=null),X=e,!e){p.style.removeProperty("top");return}typeof ResizeObserver=="function"&&(G=new ResizeObserver(()=>se(e)),G.observe(e)),se(e)}}let J=document.createElement("style");J.id="clay-menu-vars",J.setAttribute("clay","editor-ui"),document.head.append(J);function ge(){let e=p.getBoundingClientRect();J.textContent=`:root { --clay-menu-width: ${Math.ceil(e.width)}px; --clay-menu-height: ${Math.ceil(e.height)}px; }`}let ze=Le({name:"menu",content:p,css:n?[ue,f??de,pe]:[ue,Re,de,pe],parent:t||document.body,attributes:{"clay-mode-toggle":""}});n?(window.addEventListener("resize",R),window.addEventListener("scroll",()=>{k&&c()&&Q()},{capture:!0,passive:!0})):(Oe({dock:p,container:ze.shadow,grip:$,storage:window.clay.storage&&window.clay.storage.local,onMove:je,onDragStart:()=>{R(),H?.close({restore:!1})}}),ge(),typeof ResizeObserver=="function"&&new ResizeObserver(ge).observe(p),new MutationObserver(be).observe(he.body,{childList:!0}),be()),f||Se(p,p.querySelector(".clay-menu"),Me);let we=()=>import("../c-5FEU5MMY.js").then(e=>e.open({returnFocus:o}));if(I=Be({addItem:g,note:a,currentMode:W}),H=_e({root:p,capsule:p.querySelector(".clay-menu"),addItem:g,removeItem:i,closeMenu:R,note:a}),Ve({root:p,capsule:p.querySelector(".clay-menu"),addItem:g,removeItem:i,note:a,currentMode:W}),mt){g({id:"seo",label:"SEO settings\u2026",run:we});let e=window.clay.storage&&window.clay.storage.session;e&&e.get("reopen-seo")===!0&&(e.remove("reopen-seo"),we().catch(()=>{}))}Fe=z,W()!=="edit"&&import("../core/host-permission-6EVJGNPL.js").then(e=>e.checkHostPermission()).catch(()=>{}),window.clay.menu={addItem:g,removeItem:i,open:O,close:R,note:a,embedded:n,button:o},document.dispatchEvent(new CustomEvent("clay:menu-ready"))}var Ke=!1,Fe=null,kt=()=>(ce||Ee)&&!ie;function Ye(){Ke||!kt()||(Ke=!0,xt())}ie||(ke(Ye),document.addEventListener("clay:capabilitychange",()=>{Ye(),Fe?.()}));
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import{b as Je,c as Ze}from"../c-Y6F2FORL.js";import{b as Ke}from"../c-QY7F6EN6.js";import{a as Xe,b as Ye,c as Ge,d as Qe}from"../c-MTQHWQC3.js";import{b as Ve,f as Fe,h as Ee}from"../c-3O7OBDCM.js";import{d as qe}from"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import{d as le,f as _e,h as ze,j as K}from"../c-N7JPUPGC.js";import"../c-HA6INT6J.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";var Gt=Object.defineProperty,Qt=(e,t)=>{for(var r in t)Gt(e,r,{get:t[r],enumerable:!0})},gt=["textContent","innerText","innerHTML","outerHTML","value","checked","selected","disabled","readOnly","type","tagName","nodeName","nodeType","nodeValue","childElementCount","id","className","classList","baseURI","offsetWidth","offsetHeight","clientWidth","clientHeight","scrollWidth","scrollHeight","dataset","currentSrc","duration","paused","title","documentURI","contentType"],er=new Set(gt),tr=new Set(["textContent","innerText","innerHTML","value","checked","selected","disabled","readOnly","type","id","className","title"]),wt=new Set(["tagName","nodeName","nodeType","nodeValue","childElementCount","classList","baseURI","documentURI","contentType","offsetWidth","offsetHeight","clientWidth","clientHeight","scrollWidth","scrollHeight","currentSrc","duration","paused","dataset"]),et=new Set(["checked","selected","disabled","readOnly","paused"]);function rr(e,t){return t==null?et.has(e)?!1:"":et.has(e)?t==="false"?!1:!!t:t}var D={};Qt(D,{EmptyListInsert:()=>Y,MAX_RULE_DEPTH:()=>de,MaxRuleDepthExceeded:()=>Re,NoRulesTag:()=>lr,RuleTargetReadOnly:()=>At,RulesParseError:()=>Le,ShapeMismatch:()=>bt,UnknownRulesVersion:()=>vt,WriteNotRoundTripped:()=>or,WriteRefused:()=>Et,WriteRejected:()=>ir});var Le=class extends Error{constructor(e,t){super(e),this.name="RulesParseError",this.cause=t}},vt=class extends Error{constructor(e){super(`unknown rules version: ${e}. Library supports "1".`),this.name="UnknownRulesVersion",this.version=e}},de=20,Re=class extends Error{constructor(e){super(`rule depth exceeded ${de} at path: ${e.join(".")}`),this.name="MaxRuleDepthExceeded",this.path=e}},bt=class extends Error{constructor(e){super(`shape mismatch: ${e.length} field(s) failed validation`),this.name="ShapeMismatch",this.mismatches=e}},Y=class extends Error{constructor(e,t){super(t?`cannot add items to empty list at "${e.join(".")}" \u2014 ${t}`:`cannot add items to empty list at "${e.join(".")}" \u2014 no sibling to clone as template. Seed the list with a hidden item first.`),this.name="EmptyListInsert",this.path=e}},At=class extends Error{constructor(e){super(`cannot write to read-only DOM property "${e}"`),this.name="RuleTargetReadOnly",this.target=e}},Et=class extends Error{constructor(e){super(`write refused: ${e.length} write(s) broke the content-only policy`),this.name="WriteRefused",this.refusals=e}};function nr(e){return e.reduce((t,r)=>typeof r=="number"?`${t}[${r}]`:t?`${t}.${r}`:String(r),"")||"(root)"}var or=class extends Error{constructor(e){super(`write did not round-trip at "${nr(e)}"`),this.name="WriteNotRoundTripped",this.path=e}},lr=class extends Error{constructor(e){super(`no <script data-rules-name~="${e}"> rules tag in this document`),this.name="NoRulesTag",this.token=e}},ir=class extends Error{constructor(e,t){super(`write rejected: ${e.length} unknown key(s), ${t.length} rule(s) with no matching element`),this.name="WriteRejected",this.unknownKeys=e,this.unmatched=t}};function _(e){let t=0,r=null,o=-1;for(let n=0;n<e.length;n++){let l=e[n];l==="\\"?n++:r?l===r&&(r=null):l==='"'||l==="'"?r=l:l==="["||l==="("?t++:l==="]"||l===")"?t>0&&t--:l==="@"&&t===0&&(o=n)}return o}function ar(e){let t=_(e);return t===-1?{selector:e,prop:null}:{selector:e.slice(0,t),prop:e.slice(t+1)||null}}function xt(e){let t=0,r=null,o=-1,n=!1;for(let l=0;l<e.length;l++){let s=e[l];s==="\\"?l++:r?s===r&&(r=null):s==='"'||s==="'"?r=s:s==="["||s==="("?t++:s==="]"||s===")"?t>0&&t--:t===0&&s===">"?o=l:t===0&&s===","&&(n=!0)}return n||o===-1||!sr(e,o+1)?null:e.slice(0,o).trim()||null}function sr(e,t){let r=t,o=e.replace(/\s+$/,"").length;for(;r<o&&/\s/.test(e[r]);)r++;let n=0,l=null;for(;r<o;r++){let s=e[r];if(s==="\\")r++;else if(l)s===l&&(l=null);else if(s==='"'||s==="'")l=s;else if(s==="["||s==="(")n++;else if(s==="]"||s===")")n>0&&n--;else if(n===0&&(s==="+"||s==="~"||/\s/.test(s)))return!1}return!0}var ur=/^--[A-Za-z0-9_-]+$/;function Ce(e){return typeof e=="string"&&ur.test(e)}function Tt(e){let t=[],r=[],o=null,n=0;for(let l=0;l<e.length;l++){let s=e[l];if(o){s==="\\"?l++:s===o&&(o=null);continue}if(s==="/"&&e[l+1]==="*"){let i=e.indexOf("*/",l+2);l=i===-1?e.length:i+1;continue}s==='"'||s==="'"?o=s:s==="("?r.push(")"):s==="["?r.push("]"):s==="{"?r.push("}"):(s===")"||s==="]"||s==="}")&&r[r.length-1]===s?r.pop():s===";"&&r.length===0&&(t.push(e.slice(n,l)),n=l+1)}return t.push(e.slice(n)),t}function cr(e){let t="",r=null;for(let o=0;o<e.length;o++){let n=e[o];if(r){t+=n,n==="\\"&&o+1<e.length?t+=e[++o]:n===r&&(r=null);continue}if(n==="/"&&e[o+1]==="*"){let l=e.indexOf("*/",o+2);o=l===-1?e.length:l+1,t+=" ";continue}(n==='"'||n==="'")&&(r=n),t+=n}return t}function Ot(e){e=cr(e);let t=e.indexOf(":");if(t===-1)return null;let r=e.slice(0,t).trim(),o=e.slice(t+1).trim(),n=/!\s*important\s*$/i.exec(o);return n&&(o=o.slice(0,n.index).trim()),{name:r,value:o,important:!!n}}function $e(e,t){if(e==null)return null;let r=null;for(let o of Tt(String(e))){let n=Ot(o);!n||n.name!==t||(!r||n.important||!r.important)&&(r=n)}return r?r.value:null}function fr(e,t,r){let o=e==null?"":String(e),n=r==null||r==="",l=Tt(o),s=l.map(Ot),i=s.some(d=>d&&d.name===t&&d.important),a=[],u=!1;l.forEach((d,p)=>{let A=s[p];if(!A||A.name!==t){a.push(d);return}if(n||u)return;let f=/^\s*/.exec(d)[0];a.push(`${f}${t}: ${r}${i?" !important":""}`),u=!0});let c=a.join(";");if(!n&&!u){let d=c.trimEnd();c=d===""?`${t}: ${r}`:`${d}${d.endsWith(";")?" ":"; "}${t}: ${r}`}return c.trim()===""?null:c}function kt(e,t,r,o){let n=e.attr(t,"style");if(($e(n,r)??"")===o)return;let l=fr(n,r,o);l==null?e.removeAttr(t,"style"):e.attr(t,"style",l)}function se(e,t,r,o={}){if(Object.prototype.hasOwnProperty.call(o,"exclude")&&e.semanticExclude===!1)throw new Error("This adapter does not support semantic exclude queries; omit exclude or use the DOM adapter.");return xe(e,t,r,{depth:0,path:[]},o)}function xe(e,t,r,o,n){if(o.depth>de)throw new Re(o.path);if(typeof r=="string")return dr(e,t,r,o,n);if(Array.isArray(r)){let[l,s]=r,i=e.find(t,l,n);return St(n,o,i),i.map((a,u)=>xe(e,a,s,{depth:o.depth+1,path:[...o.path,u]},n))}if(typeof r=="object"&&r!==null){let l={};for(let[s,i]of Object.entries(r))l[s]=xe(e,t,i,{depth:o.depth+1,path:[...o.path,s]},n);return l}return null}function dr(e,t,r,o,n){if(r.endsWith("[]")){let i=r.slice(0,-2),a=e.find(t,i,n);return St(n,o,a),a.map(u=>e.text(u))}if(r.startsWith("@"))return tt(e,t,r.slice(1));let l=_(r);if(l!==-1){let i=r.slice(0,l),a=r.slice(l+1),u=i?e.find(t,i,n):[t];return u.length===0?null:tt(e,u[0],a)}if(r===".")return e.text(t);let s=e.find(t,r,n);return s.length===0?null:e.text(s[0])}function St(e,t,r){if(typeof e.onRowsRead=="function")try{e.onRowsRead(t.path.slice(),r)}catch(o){console.warn(`[hyper-html-api] onRowsRead threw at "${t.path.join(".")||"(root)"}"`,o)}}function tt(e,t,r){if(Ce(r))return $e(e.attr(t,"style"),r);if(er.has(r)){let n=e.prop(t,r);return n==null?null:String(n)}return e.attr(t,r)??null}function pr(e,t,r,o){let n=e.length,l=t.length,s=new Array(n).fill(-1);if(o){let h=new Set;for(let y=0;y<n;y++){let w=o[y];!(w>=0&&w<l)||h.has(w)||(s[y]=w,h.add(w))}}if(n===0||l===0)return s;let i=e.map(h=>rt(h,r)),a=t.map(h=>rt(h,r)),u=new Array(l).fill(!1);for(let h of s)h>=0&&(u[h]=!0);let c=new Map;a.forEach((h,y)=>{u[y]||c.set(h,c.has(h)?-1:y)});let d=new Map;i.forEach((h,y)=>{s[y]>=0||d.set(h,(d.get(h)||0)+1)}),i.forEach((h,y)=>{if(s[y]>=0||d.get(h)!==1)return;let w=c.get(h);w===void 0||w===-1||u[w]||(s[y]=w,u[w]=!0)});let p=[];for(let h=0;h<n;h++)s[h]<0&&p.push(h);let A=[];for(let h=0;h<l;h++)u[h]||A.push(h);if(p.length===0||A.length===0)return s;let f=n*l+1,m=hr(e,t,r),g=(h,y)=>m(h,y)*f+Math.abs(h-y);for(let[h,y]of mr(p,A,g))s[h]=y;return s}var Nt=e=>typeof e=="object"&&e!==null;function rt(e,t){if(!Nt(t))return e==null?" null":String(e);let r=Object.keys(t);return JSON.stringify(r.map(o=>{let n=JSON.stringify(e?.[o]);return n===void 0?" undef":n}))}function hr(e,t,r){if(!Nt(r))return(i,a)=>e[i]===t[a]?0:1;let o=Object.keys(r),n=i=>o.map(a=>JSON.stringify(i?.[a])),l=e.map(n),s=t.map(n);return(i,a)=>{let u=l[i],c=s[a],d=0;for(let p=0;p<o.length;p++)u[p]!==c[p]&&d++;return d}}function mr(e,t,r){return e.length<=t.length?nt(e,t,r,!1):nt(t,e,(o,n)=>r(n,o),!0)}function nt(e,t,r,o){let n=e.length,l=t.length,s=[];for(let d=0;d<=n;d++)s.push(new Float64Array(l+1).fill(1/0));let i=[];for(let d=0;d<=n;d++)i.push(new Uint8Array(l+1));for(let d=0;d<=l;d++)s[n][d]=0;for(let d=n-1;d>=0;d--)for(let p=l-1;p>=0;p--){let A=r(e[d],t[p])+s[d+1][p+1],f=s[d][p+1];A<=f?(s[d][p]=A,i[d][p]=1):s[d][p]=f}let a=[],u=0,c=0;for(;u<n&&c<l;)i[u][c]&&(a.push(o?[t[c],e[u]]:[e[u],t[c]]),u++),c++;return a}function Lt(e,t,r,o,n,l,s,i={}){let a=e.find(t,r,i);if(n.length===0){a.forEach(T=>e.remove(T)),Te(i,"onRowsApplied",l.path,[]);return}let u=n.length>a.length,c=a[0]||null;if(u&&!c&&(c=vr(e,t,r,i),!c))throw new Y(l.path);let d=a.map(T=>wr(e,T,o,i)),p=null;if(u&&c){p=e.clone(c),i.templateAttr&&e.removeAttr(p,i.templateAttr);let T=e.stripIds(p);T>0&&console.warn(`[hyper-html-api] stripped ${T} id attribute(s) from cloned template at "${l.path.join(".")||"(root)"}"`)}let A=pr(n,d,o,yr(e,a,n,l,i)),f=a.length>0?e.parent(a[0]):xr(e,t,r,c,l,i),m=a.length>0?Rt(e,f,a[0]):0,g=kr(e,a),h=new Set,y=[],w=n.map((T,O)=>{let x=A[O];if(x>=0)return h.add(x),y.push(!1),a[x];y.push(!0);let S=e.clone(p);return e.stripIds(S),S});a.forEach((T,O)=>{h.has(O)||e.remove(T)}),g?Or(e,f,m,w,y):Sr(e,w,y,f,m),gr(e,w,o,n,l,s,i),Te(i,"onRowsApplied",l.path,w)}function Te(e,t,r,o){if(typeof e[t]=="function")try{return e[t](r.slice(),o)}catch(n){console.warn(`[hyper-html-api] ${t} threw at "${r.join(".")||"(root)"}"`,n);return}}function yr(e,t,r,o,n){let l=Te(n,"identifyRows",o.path,r);if(!Array.isArray(l))return null;let s=new Array(r.length).fill(-1),i=new Set,a=new Map(t.map((u,c)=>[e.identity(u),c]));for(let u=0;u<r.length;u++){if(!l[u])continue;let c=a.get(e.identity(l[u]));c===void 0||i.has(c)||(s[u]=c,i.add(c))}return s}function gr(e,t,r,o,n,l,s){t.forEach((i,a)=>{if(r===null){let u=o[a],c=u==null?"":String(u);e.text(i)!==c&&e.text(i,c)}else{let u=l(e,i,r,o[a],{depth:n.depth+1,path:[...n.path,a]},s);u&&u!==i&&(t[a]=u)}})}function wr(e,t,r,o){return r===null?e.text(t):se(e,t,r,o.onRowsRead?{...o,onRowsRead:void 0}:o)}function Rt(e,t,r){let o=e.children(t);for(let n=0;n<o.length;n++)if(e.sameNode(o[n],r))return n;return-1}function vr(e,t,r,o){if(!o.templateAttr)return null;let n=/^\s*:scope\s*>\s*/.test(r),l=new RegExp(":not\\(\\["+o.templateAttr.replace(/[.*+?^${}()|[\]\\-]/g,"\\$&")+"\\]\\)","g"),s=r.replace(/^\s*:scope\s*>\s*/,"").replace(l,""),i=n?br(s):0,a=xt(s),u=t;for(;u;){let c=e.find(u,s,{includeRulesTag:!1,templateAttr:null});for(let d of c)if(e.attr(d,o.templateAttr)!=null&&!(n&&!Er(e,t,d,i))&&!(a&&!e.matches(e.parent(d),a)))return d;u=e.parent(u)}return null}function br(e){let t=0,r=null,o=1;for(let n=0;n<e.length;n++){let l=e[n];if(l==="\\")n++;else if(r)l===r&&(r=null);else if(l==='"'||l==="'")r=l;else if(l==="["||l==="(")t++;else if(l==="]"||l===")")t>0&&t--;else if(t===0&&l===">")o++;else{if(t===0&&(l==="+"||l==="~"))return null;if(t===0&&/\s/.test(l)){if(!Ar(e,n))return null;for(;n+1<e.length&&/\s/.test(e[n+1]);)n++}}}return o}function Ar(e,t){let r=t;for(;r<e.length&&/\s/.test(e[r]);)r++;let o=t>0?e[t-1]:"",n=r<e.length?e[r]:"";return ot(o)||ot(n)}function ot(e){return e===">"||e==="+"||e==="~"}function Er(e,t,r,o){if(o===null)return!0;let n=r;for(let a=0;a<o;a++)if(n=e.parent(n),!n)return!1;let l=e.prop(t,"tagName");if(!l)return!0;let s=e.prop(n,"tagName");if(!s||String(s).toLowerCase()!==String(l).toLowerCase())return!1;let i=new Set(lt(e,n));return lt(e,t).every(a=>i.has(a))}function lt(e,t){let r=e.attr(t,"class");return r?String(r).split(/\s+/).filter(Boolean):[]}function xr(e,t,r,o,n,l){let s=e.parent(o);if(s&&Tr(e,t,s)&&!at(e,s,l))return s;let i=xt(r);if(!i)throw new Y(n.path,`the list selector "${r}" names no container to hold the new rows \u2014 write it as "container > row" (for example "ol.comments > li") so the cloned row lands in the list`);let a=(i===":scope"?e.prop(t,"tagName")?[t]:[]:e.find(t,i,l)).filter(u=>!at(e,u,l));if(a.length===0)throw new Y(n.path,`no container matching "${i}" inside this context to hold the new rows`);if(a.length>1)throw new Y(n.path,`"${i}" matches ${a.length} containers inside this context, so the new rows have no single destination`);return a[0]}function Tr(e,t,r){let o=r;for(;o;){if(e.sameNode(o,t))return!0;o=e.parent(o)}return e.parent(t)?!1:e.find(t,"*",{includeRulesTag:!0,templateAttr:null}).some(n=>e.sameNode(n,r))}var it=["no-data","editor-ui"];function at(e,t,r){let o=t;for(;o;){if(r.templateAttr&&e.attr(o,r.templateAttr)!=null||it.some(l=>e.attr(o,l)!=null))return!0;let n=e.attr(o,"clay");if(n&&n.split(/\s+/).some(l=>it.includes(l)))return!0;o=e.parent(o)}return!1}function Or(e,t,r,o,n){let l=e.children(t),s=l.map(a=>e.identity(a)),i=!1;o.forEach((a,u)=>{let c=e.identity(a),d=r+u;if(s[d]===c)return;if(!n[u]){let A=s.indexOf(c);A!==-1&&(s.splice(A,1),l.splice(A,1))}let p=Math.min(d,l.length);p<l.length?e.insertBefore(l[p],a):l.length?i?e.insertAfter(l[l.length-1],a):(e.insertAt(t,a,d),i=!0):e.insertAt(t,a,0),s.splice(p,0,c),l.splice(p,0,a)})}function kr(e,t){if(t.length<=1)return!0;let r=e.parent(t[0]);if(!r)return!1;let o=new Map(e.children(r).map((l,s)=>[e.identity(l),s])),n=[];for(let l of t){let s=o.get(e.identity(l));if(s===void 0)return!1;n.push(s)}return n.sort((l,s)=>l-s),n[n.length-1]-n[0]===n.length-1}function Sr(e,t,r,o,n){let l=null,s=n;for(let i=0;i<t.length;i++){if(!r[i]){l=t[i];continue}let a=l?e.parent(l):o;if(!a)continue;let u=l?Rt(e,a,l)+1:s++;e.insertAt(a,t[i],u),l=t[i]}}function ue(e,t,r,o,n={}){if(Object.prototype.hasOwnProperty.call(n,"exclude")&&e.semanticExclude===!1)throw new Error("This adapter does not support semantic exclude queries; omit exclude or use the DOM adapter.");let l=[];if(Oe(r,o,[],l),l.length)throw new bt(l);ce(e,t,r,o,{depth:0,path:[]},n)}function ce(e,t,r,o,n,l={}){if(n.depth>de)throw new Re(n.path);if(o===void 0)return t;if(typeof r=="string")return Nr(e,t,r,o,n,l);if(Array.isArray(r)){let[s,i]=r;return Lt(e,t,s,i,o,n,ce,l),t}if(typeof r=="object"&&r!==null){for(let[s,i]of Object.entries(r)){let a=ce(e,t,i,o==null?o:o[s],{depth:n.depth+1,path:[...n.path,s]},l);a&&a!==t&&(t=a)}return t}return t}function Nr(e,t,r,o,n,l){if(r.endsWith("[]")){let a=r.slice(0,-2);return Lt(e,t,a,null,o,n,ce,l),t}if(r.startsWith("@"))return ut(e,t,r.slice(1),o);let s=_(r);if(s!==-1){let a=r.slice(0,s),u=r.slice(s+1),c=a?e.find(t,a,l):[t];return c.length===0||ut(e,c[0],u,o),t}if(r===".")return st(e,t,o),t;let i=e.find(t,r,l);return i.length===0||st(e,i[0],o),t}function st(e,t,r){let o=r==null?"":String(r);e.text(t)!==o&&e.text(t,o)}function Lr(e,t,r,o){if(e.styleVar){e.styleVar(t,r,o);return}kt(e,t,r,o)}function ut(e,t,r,o){if(Ce(r))return Lr(e,t,r,o==null?"":String(o).trim()),t;if(wt.has(r)){let n=e.prop(t,r);if(n===o||n!=null&&o!=null&&String(n)===String(o))return t;throw new At(r)}if(r==="outerHTML"){let n=o==null?"":String(o);return e.replaceWith(t,n)}if(tr.has(r)){let n=rr(r,o);return e.prop(t,r)!==n&&e.prop(t,r,n),t}if(o==null)e.attr(t,r)!=null&&e.removeAttr(t,r);else{let n=String(o);e.attr(t,r)!==n&&e.attr(t,r,n)}return t}function Oe(e,t,r,o){if(t!==void 0){if(typeof e=="string"){if(e.endsWith("[]")){Array.isArray(t)?t.forEach((n,l)=>{typeof n=="object"&&n!==null&&o.push({path:Z([...r,l]),expected:"scalar",got:J(n)})}):o.push({path:Z(r),expected:"array",got:J(t)});return}t!==null&&typeof t=="object"&&o.push({path:Z(r),expected:"scalar",got:J(t)});return}if(Array.isArray(e)){if(!Array.isArray(t)){o.push({path:Z(r),expected:"array",got:J(t)});return}let n=e[1];t.forEach((l,s)=>Oe(n,l,[...r,s],o));return}if(typeof e=="object"&&e!==null){if(t===null||Array.isArray(t)||typeof t!="object"){o.push({path:Z(r),expected:"object",got:J(t)});return}for(let[n,l]of Object.entries(e))Oe(l,t[n],[...r,n],o)}}}function J(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function Z(e){return e.join(".")}function Rr(e){try{return JSON.parse(e)}catch(t){throw new Le(`Invalid strict JSON: ${t.message}`,t)}}function Ct(e){try{return JSON.parse(e)}catch{}let t={BRACE_OPEN:"{",BRACE_CLOSE:"}",BRACKET_OPEN:"[",BRACKET_CLOSE:"]",COLON:":",COMMA:",",STRING:"STRING",SELECTOR:"SELECTOR",IDENTIFIER:"IDENTIFIER",NUMBER:"NUMBER",BOOLEAN:"BOOLEAN"};function r(n){let l=[],s=0;for(;s<n.length;){let i=n[s];if(/\s/.test(i)){s++;continue}if("{}".includes(i)){l.push({type:i,value:i}),s++;continue}if(i==="["){let d=!1,p=s+1;for(;p<n.length&&/\s/.test(n[p]);)p++;if(p<n.length&&/[a-zA-Z_]/.test(n[p])&&(d=!0),!d){l.push({type:i,value:i}),s++;continue}}if(i==="]"){l.push({type:i,value:i}),s++;continue}if(i===":"){l.push({type:t.COLON,value:i}),s++;continue}if(i===","){l.push({type:t.COMMA,value:i}),s++;continue}if(i==='"'||i==="'"){let d=i,p=s+1;for(;p<n.length&&n[p]!==d;)n[p]==="\\"&&p++,p++;l.push({type:t.STRING,value:n.substring(s+1,p),quoted:!0,sourceQuote:d}),s=p+1;continue}let a=s,u;for(;a<n.length&&!/[{},]/.test(n[a]);)if(n[a]===":"){let d=[":first",":last",":nth-child",":nth-of-type",":first-child",":last-child",":first-of-type",":last-of-type",":only-child",":only-of-type",":hover",":focus",":active",":visited",":disabled",":enabled",":checked",":empty",":root",":target",":not",":before",":after",":nth-last-child",":nth-last-of-type"],p=!1;for(let A of d){let f=A.substring(1);if(n.substring(a+1,a+1+f.length)===f){p=!0,a+=f.length;break}}if(!p)break}else if(n[a]==="["){for(a++;a<n.length&&n[a]!=="]";){if(n[a]==='"'||n[a]==="'"){let d=n[a];for(a++;a<n.length&&n[a]!==d;)n[a]==="\\"&&a++,a++}a++}a<n.length&&n[a]==="]"&&a++}else a++;u=n.substring(s,a);let c=t.IDENTIFIER;/^-?\d+(\.\d+)?$/.test(u)?c=t.NUMBER:u==="true"||u==="false"||u==="null"?c=t.BOOLEAN:/^[.#@\[]|[.#@\[]| /.test(u)&&(c=t.SELECTOR),l.push({type:c,value:u,quoted:!1}),s=a}return l}function o(n){let l="";for(let s=0;s<n.length;s++){let i=n[s];if("{}".includes(i.type)||"[]".includes(i.type)){l+=i.value;continue}if(i.type===t.COLON){l+=i.value;continue}if(i.type===t.COMMA){let a=n[s+1];if(a&&(a.type==="}"||a.type==="]"))continue;l+=i.value;continue}if(i.type===t.STRING&&i.quoted){let a=i.value;i.sourceQuote==="'"&&(a=a.replace(/\\'/g,"'"),a=a.replace(/(\\*)"/g,(u,c)=>c.length%2===0?c+'\\"':u)),l+=`"${a}"`;continue}if(i.type===t.NUMBER||i.type===t.BOOLEAN){l+=i.value;continue}if(i.type===t.SELECTOR||i.type===t.IDENTIFIER){l+=`"${i.value}"`;continue}l+=`"${i.value}"`}return l}try{let n=r(e),l=o(n);return JSON.parse(l)}catch(n){throw new Le("Invalid extraction rules syntax: "+n.message,n)}}var Cr="1",ct=/^[a-zA-Z0-9_-]+$/;function Ie(e,t,r){let o;if(r===void 0)o="script[data-rules-name]";else{if(typeof r!="string"||!ct.test(r))throw new Error(`hyper-html-api: invalid rules token ${JSON.stringify(r)} (must match ${ct})`);o=`script[data-rules-name~="${r}"]`}let n=e.find(t,o,{includeRulesTag:!0});if(n.length===0)return null;r!==void 0&&n.length>1&&console.warn(`hyper-html-api: ${n.length} rules tags match data-rules-name~="${r}"; using the first.`);let l=n[0],s=e.attr(l,"data-rules-version");if(s!==Cr)throw new vt(s);return{rules:Ct(e.text(l)),tagNode:l}}var Me=Object.freeze({data:Object.freeze({tokens:["no-data"],bundles:["editor-ui"]}),save:Object.freeze({tokens:["no-save"],bundles:["editor-ui"]}),snapshot:Object.freeze({tokens:["no-snapshot"],bundles:["editor-ui"]}),watch:Object.freeze({tokens:["no-watch"],bundles:["editor-ui"]}),undo:Object.freeze({tokens:["no-undo"],bundles:["editor-ui"]}),history:Object.freeze({tokens:[],bundles:["editor-ui"]})}),$r=Object.freeze({"editor-ui":Object.freeze(["no-data","no-save","no-snapshot","no-watch","no-undo"])}),Ir=Object.freeze(["no-save","no-snapshot","no-trigger-autosave","no-dirty","no-watch","no-undo","no-data","freeze","editor-ui","live"]);function fe(e,t){if(!e||e.nodeType!==1)return!1;let r=e.getAttribute?.("clay");return!!(r&&r.split(/\s+/).includes(t)||e.hasAttribute?.(t))}function $t(e,t){if(fe(e,t))return!0;for(let[r,o]of Object.entries($r))if(o.includes(t)&&fe(e,r))return!0;return!1}function ke(e){let t=Me[e];if(!t)throw new Error(`Unknown region capability: ${e}`);return[...t.tokens,...t.bundles].flatMap(r=>[`[clay~="${r}"]`,`[${r}]`]).join(", ")}function Mr(e,t){let r=e&&e.nodeType===1?e:e?.parentElement;for(;r&&r.nodeType===1;){let o=Me[t];if(!o)throw new Error(`Unknown region capability: ${t}`);if(o.tokens.some(n=>$t(r,n))||o.bundles.some(n=>fe(r,n)))return r;r=r.parentElement}return null}function jr(e,t){return!!Mr(e,t)}var je=Object.freeze({refusedRuleForms:["innerHTML","outerHTML"],refusedTargets:["script","style","template","noscript","iframe","object","embed","xmp","plaintext","noembed","noframes","meta","link","base","animate","set","animatemotion","animatetransform"],refusedAttributes:["style","srcdoc","is","http-equiv","sandbox","allow","nonce","integrity","charset","htmlclaytoken","htmlclayid","data-rules-name","data-rules-version","clay","contenteditable",...Ir],refusedAttributePrefixes:["on"],urlAttributes:["href","src","srcset","action","formaction","poster","cite","data","ping","background","longdesc","usemap","xlink:href","manifest","codebase","icon"],refusedSchemes:["javascript","vbscript","data"],customPropertyValues:Object.freeze({maxLength:200,refusedCharacters:[";","{","}","<",">","\\"],refusedFunctions:["url","src","image","image-set","-webkit-image-set","cross-fade","element","expression","paint"]})}),Dr=new Set(["textContent","innerText"]);function Pr(e){let t=String(e).replace(/^[\u0000- ]+|[\u0000- ]+$/g,"").replace(/[\t\n\r]/g,"").match(/^([a-zA-Z][a-zA-Z0-9+.-]*):/);return t?t[1].toLowerCase():null}var Hr=/^[^\t\n\f\r "'>/=\u0000-\u001f\u007f]+$/;function Wr(e,t,r=je){if(!Hr.test(String(e)))return`attribute name ${JSON.stringify(String(e))} is not valid`;let o=String(e).toLowerCase();if(r.refusedAttributePrefixes.some(n=>o.startsWith(n)))return`attribute "${o}" can run script`;if(r.refusedAttributes.includes(o))return`attribute "${o}" is not content`;if(r.urlAttributes.includes(o)&&t!=null){let n=o==="srcset"?String(t).split(",").map(l=>l.trim().split(/\s+/)[0]).filter(Boolean):[String(t)];for(let l of n){let s=Pr(l);if(s&&r.refusedSchemes.includes(s))return`"${s}:" URLs are not allowed in "${o}"`}}return null}function De(e,t){let r=e.prop(t,"tagName");return r?String(r).toLowerCase():""}function Br(e,t){let r=De(e,t)||"node",o=e.attr(t,"id");return o?`<${r}#${o}>`:`<${r}>`}function Ur(e,t,r){let o=t;for(;o;){let n=De(e,o);if(n&&r.refusedTargets.includes(n))return n;o=e.parent(o)}return null}function It(e,t){return e.find(t,"script[data-rules-name]",{includeRulesTag:!0,templateAttr:null}).length>0}function qr(e,t){return De(e,t)==="script"&&e.attr(t,"data-rules-name")!=null?!0:It(e,t)}function _r(e){if(/[\u0000-\u001f\u007f]/.test(e))return"control characters are not allowed in a custom property value";let t=[],r=null;for(let o=0;o<e.length;o++){let n=e[o];if(r){n===r&&(r=null);continue}if(n==='"'||n==="'")r=n;else{if(n==="/"&&e[o+1]==="*")return"comments are not allowed in a custom property value";if(n==="(")t.push(")");else if(n==="[")t.push("]");else if((n===")"||n==="]")&&t.pop()!==n)return`"${n}" does not close anything in this custom property value`}}return r?"a custom property value must close its quotes":t.length?"a custom property value must close its brackets":null}function zr(e,t=je){let r=t.customPropertyValues,o=String(e);if(o.length>r.maxLength)return`custom property values are limited to ${r.maxLength} characters`;let n=r.refusedCharacters.find(a=>o.includes(a));if(n)return`${JSON.stringify(n)} is not allowed in a custom property value`;let l=_r(o);if(l)return l;let s=o.toLowerCase(),i=r.refusedFunctions.find(a=>new RegExp(`(^|[^a-z0-9_-])${a.replace(/[-]/g,"\\-")}\\s*\\(`).test(s));return i?`"${i}()" is not allowed in a custom property value`:null}function ft(e,t=je){let r=[],o=(i,a)=>(r.push({target:Br(e,i),reason:a}),!1),n=i=>{let a=Ur(e,i,t);return a?o(i,`inside <${a}>, which is not content`):!0},l=i=>n(i)?It(e,i)?o(i,"a text write here would delete the data rules tag"):!0:!1,s=(i,a,u)=>{if(!n(i))return!1;let c=Wr(a,u,t);return c?o(i,c):!0};return{...e,text(i,a){if(a===void 0)return e.text(i);l(i)&&e.text(i,a)},attr(i,a,u){if(u===void 0)return e.attr(i,a);s(i,a,u)&&e.attr(i,a,u)},removeAttr(i,a){s(i,a,null)&&e.removeAttr(i,a)},styleVar(i,a,u){if(($e(e.attr(i,"style"),a)??"")!==u&&n(i)){if(!Ce(a))return o(i,`"${a}" is not a custom property`);if(u!==""){let c=zr(u,t);if(c)return o(i,c)}kt(e,i,a,u)}},prop(i,a,u){if(u===void 0)return e.prop(i,a);if(t.refusedRuleForms.includes(a))return o(i,`"@${a}" writes HTML, only text is allowed`);if(Dr.has(a)){l(i)&&e.prop(i,a,u);return}s(i,a==="className"?"class":a,u)&&e.prop(i,a,u)},remove(i){if(qr(e,i)){o(i,"removing this would delete the data rules tag");return}e.remove(i)},replaceWith(i,a){return a===e.prop(i,"outerHTML")||o(i,'"@outerHTML" writes HTML, only text is allowed'),i},refusals:r,assertClean(){if(r.length)throw new Et(r.slice())}}}function X(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function dt(e){return e.reduce((t,r)=>typeof r=="number"?`${t}[${r}]`:t?`${t}.${r}`:r,"")}function Vr(e,t,r,o,n={}){let l=[],s=[];function i(u,c,d){if(Array.isArray(u)){let[,p]=u;if(!Array.isArray(c)||!X(p))return;c.forEach((A,f)=>i(p,A,[...d,f]));return}if(!(!X(u)||!X(c)))for(let p of Object.keys(c))Object.prototype.hasOwnProperty.call(u,p)?i(u[p],c[p],[...d,p]):l.push(dt([...d,p]))}function a(u,c,d,p){if(d!==void 0){if(typeof c=="string"){if(c.endsWith("[]")||c==="."||c.startsWith("@"))return;let A=_(c),f=A===-1?c:c.slice(0,A);if(!f)return;e.find(u,f,n).length===0&&s.push({path:dt(p),selector:f});return}if(!Array.isArray(c)&&X(c)&&X(d))for(let[A,f]of Object.entries(c))a(u,f,d[A],[...p,A])}}return i(r,o,[]),a(t,r,o,[]),{unknownKeys:l,unmatched:s}}function pt(e,t,r){if(r&&typeof r=="object")return{rules:r,tagNode:null};if(typeof r=="string"){let o=t&&t.ownerDocument?t.ownerDocument:t;return Ie(e,o,r)}return null}var Fr=/:(?:focus(?:-within|-visible)?|hover|active|visited|defined)\b/i;function Kr(e,t){if(!/^(INPUT|TEXTAREA|SELECT|OPTION)$/.test(e.tagName||""))return;let r=(e.getAttribute?.("type")||"").toLowerCase();"value"in e&&"value"in t&&e.tagName!=="OPTION"&&r!=="checkbox"&&r!=="radio"&&r!=="file"&&(t.value=e.value),e.tagName==="INPUT"&&(r==="checkbox"||r==="radio")&&(t.checked=e.checked),e.tagName==="OPTION"&&(t.selected=e.selected),"indeterminate"in e&&"indeterminate"in t&&(t.indeterminate=e.indeterminate)}function ht(e,t,r,o){if(o)return!!e.closest?.(t);let n=e;for(;n?.nodeType===1;){if(n.matches(t))return!0;if(n===r)break;n=n.parentElement}return!1}function mt(e,t,r,o,n,l){return(l?jr(e,t):ht(e,r,n,!1))||!!(o&&(l&&e!==n?e.matches(o):ht(e,o,n,l)))}function Jr(e,t){let r=Me[t];return r.tokens.some(o=>$t(e,o))||r.bundles.some(o=>fe(e,o))}var Zr=new Set(["INPUT","TEXTAREA","SELECT","OPTION"]);function Mt(e,t,r,o){if(e.nodeType===1&&o(e)){r.dropped.push(t);return}r.cloneToLive.set(t,e),r.liveToClone.set(e,t);let n=e,l=t;if(e.nodeType===1){if(Zr.has(e.tagName)&&r.controls.push(e,t),e.tagName==="TEMPLATE"){for(;t.firstChild;)t.removeChild(t.firstChild);n=e.content,l=t.content,r.cloneToLive.set(l,n),r.liveToClone.set(n,l)}}else if(e.nodeType!==11)return;let s=l.firstChild;for(let i=n.firstChild;i&&s;i=i.nextSibling)Mt(i,s,r,o),s=s.nextSibling}function ie(e,{capability:t="data",exclude:r=null,inherit:o=!0,provenance:n=null}={}){if(!e)throw new TypeError("createContentView requires a DOM context");let l=e.nodeType===9?e:e.ownerDocument;if(!l?.implementation?.createHTMLDocument)throw new TypeError("createContentView requires an HTML DOM implementation");let s=l.implementation.createHTMLDocument(""),i=n||new WeakMap,a=new WeakMap,u=e.nodeType===9?e.documentElement:e;r&&s.documentElement.matches(r);let c=ke(t),d=o?f=>Jr(f,t)||!!(r&&f.matches(r)):f=>mt(f,t,c,r,u,!1),p=null;if(u.nodeType!==1||!mt(u,t,c,r,u,o)){p=s.importNode(u,!0);let f={cloneToLive:i,liveToClone:a,dropped:[],controls:[]};Mt(u,p,f,d);for(let m of f.dropped)m.remove();for(let m=0;m<f.controls.length;m+=2)Kr(f.controls[m],f.controls[m+1])}e.nodeType===9&&p&&(s.replaceChild(p,s.documentElement),a.set(e,s),i.set(s,e));let A=f=>{if(Fr.test(f))throw new Error(`Filtered content queries do not support stateful selector: ${f}`)};return{root:p,document:s,capability:t,selector:ke(t),cloneToLive:i,liveToClone:a,original(f){return i.get(f)||null},cloneOf(f){return a.get(f)||null},query(f,m=p){return A(f),Array.from(m.querySelectorAll(f),g=>i.get(g)||g)},text(f=p){return(f===p?p:a.get(f))?.textContent||""},html(f=p){return(f===p?p:a.get(f))?.innerHTML??""},clone(f=p){let m=f===p?p:a.get(f);return m?s.importNode(m,!0):null}}}function jt(e){return e&&e.nodeType===1&&e.tagName==="SCRIPT"&&e.hasAttribute&&e.hasAttribute("data-rules-name")}function Xr(e){return e?(e.nodeType===9||e.nodeType,e):null}function yt(e,t,r){!e||e.nodeType!==1||(t==="value"&&e.tagName==="INPUT"?e.value=r===null?"":r:t==="checked"&&e.tagName==="INPUT"?e.checked=r!==null:t==="selected"&&e.tagName==="OPTION"&&(e.selected=r!==null))}function Dt(e,t){e&&e.tagName==="TEXTAREA"&&(e.value=t)}function Pt(e){if(!e||e.nodeType!==1)return;let t=[e,...e.querySelectorAll?e.querySelectorAll("textarea, input, option"):[]];for(let r of t)if(r.tagName==="TEXTAREA")r.value=r.defaultValue;else if(r.tagName==="INPUT"){let o=r.type;o!=="file"&&o!=="checkbox"&&o!=="radio"&&(r.value=r.defaultValue),r.checked=r.defaultChecked}else r.tagName==="OPTION"&&(r.selected=r.defaultSelected)}var N={semanticExclude:!0,find(e,t,r={}){let o=Xr(e);if(!o||!o.querySelectorAll)return[];let n=Array.from(o.querySelectorAll(t));r.includeRulesTag||(n=n.filter(i=>!jt(i)));let l=[];r.skip&&l.push(r.skip);let s=r.templateAttr===null?null:r.templateAttr||"cms-template";if(s&&l.push("["+s+"]"),l.length){let i=l.join(", ");n=n.filter(a=>!a.closest||!a.closest(i))}return n},parent(e){return e?e.parentElement:null},children(e){return e?Array.from(e.children):[]},matches(e,t){return!!(e&&e.matches)&&e.matches(t)},text(e,t){if(t===void 0)return(e.textContent||"").trim();e.textContent=t,Dt(e,t)},attr(e,t,r){if(r===void 0)return e.hasAttribute&&e.hasAttribute(t)?e.getAttribute(t):null;e.setAttribute(t,r),yt(e,t,r)},removeAttr(e,t){e&&e.removeAttribute&&e.removeAttribute(t),yt(e,t,null)},prop(e,t,r){if(r===void 0){let o=e?e[t]:void 0;return o!==void 0?o:null}e[t]=r},clone(e){let t=e.cloneNode(!0);return Pt(t),t},insertAt(e,t,r){let o=e.children[r]||null;e.insertBefore(t,o)},insertBefore(e,t){e.parentNode.insertBefore(t,e)},insertAfter(e,t){e.parentNode.insertBefore(t,e.nextSibling)},identity(e){return e||null},remove(e){e&&e.parentNode&&e.parentNode.removeChild(e)},replaceWith(e,t){if(!e||!e.parentNode)throw new Error("dom.replaceWith: node has no parent");let r=e.ownerDocument.createElement("template");r.innerHTML=t;let o=r.content.firstElementChild;if(!o)throw new Error("dom.replaceWith: html did not parse to an element");return e.parentNode.replaceChild(o,e),o},stripIds(e){let t=0;return e.id&&(e.removeAttribute("id"),t++),(e.querySelectorAll?e.querySelectorAll("[id]"):[]).forEach(r=>{r.removeAttribute("id"),t++}),t},sameNode(e,t){return e===t}};function H(e,t={}){if(t.exclude===null)return N;let r=[ke("data"),t.exclude].filter(Boolean).join(", "),o=e.nodeType===9?e:e.ownerDocument||e,n=e.nodeType===9?e.documentElement:e;if(!t._write&&!n?.matches?.(r)&&!n?.querySelector?.(r)&&!o?.querySelector?.(r))return N;let l=e.nodeType===9||!e.isConnected?e:e.ownerDocument,s=e.nodeType===9?e:e.ownerDocument,i=null,a=()=>i||(i=ie(l,{capability:"data",exclude:t.exclude||null})),u=f=>{let m=a();return f===e?m.cloneOf(e):m.cloneOf(f)||f},c=f=>i?.original(f)||f,d=(f,m)=>{a().liveToClone.set(f,m),a().cloneToLive.set(m,f);let g=f.childNodes||[],h=m.childNodes||[];for(let y=0;y<Math.min(g.length,h.length);y++)d(g[y],h[y])},p=(f,m,g,h)=>{let y=Array.from(f.childNodes).filter(x=>i.cloneOf(x)),w=y[0];for(;w&&y.includes(w);)w=w.nextSibling;for(let x of y)x.remove();if(g==="innerHTML"){let x=s.createElement("template");x.innerHTML=h;for(let S of Array.from(x.content.childNodes))f.insertBefore(S,w||null)}else f.insertBefore(s.createTextNode(h),w||null),Dt(f,h);let T=ie(f,{capability:"data",exclude:t.exclude||null});m.replaceChildren(...Array.from(T.root?.childNodes||[]));let O=x=>{let S=T.original(x);S&&(i.liveToClone.set(S,x),i.cloneToLive.set(x,S));for(let F of Array.from(x.childNodes||[]))O(F)};for(let x of Array.from(m.childNodes))O(x)},A={...N,find(f,m,g={}){let h=u(f);if(!h?.querySelectorAll)return[];let y=a().query(m,h);g.includeRulesTag||(y=y.filter(O=>!jt(O)));let w=[];g.skip&&w.push(g.skip);let T=g.templateAttr===null?null:g.templateAttr||"cms-template";if(T&&w.push(`[${T}]`),w.length){let O=w.join(", ");y=y.filter(x=>!x.closest?.(O))}return y},parent(f){let m=u(f)?.parentElement;return m?c(m):null},children(f){return Array.from(u(f)?.children||[],c)},text(f,m){if(m===void 0){let y=c(f);return!y?.matches?.(r)&&!y?.querySelector?.(r)?N.text(y):(u(f)?.textContent||"").trim()}let g=c(f);if(!g?.matches?.(r)&&!g?.querySelector?.(r)&&!i){N.text(g,m);return}let h=a().cloneOf(g);h?p(g,h,"textContent",m):N.text(g,m)},attr(f,m,g){let h=c(f);if(g===void 0)return N.attr(h,m);N.attr(h,m,g);let y=i?.cloneOf(h);y&&(N.attr(y,m,g),ie(h,{capability:"data",exclude:t.exclude||null}).root===null&&(y.remove(),i.liveToClone.delete(h),i.cloneToLive.delete(y)))},removeAttr(f,m){let g=c(f);N.removeAttr(g,m);let h=i?.cloneOf(g);h&&N.removeAttr(h,m)},prop(f,m,g){let h=c(f);if(g===void 0)return m==="innerHTML"||m==="outerHTML"||m==="textContent"||m==="innerText"?N.prop(u(h),m):N.prop(h,m);let y=m==="innerHTML"||m==="textContent"||m==="innerText",w=y?a().cloneOf(h):i?.cloneOf(h);w&&y?p(h,w,m,g):(N.prop(h,m,g),w&&N.prop(w,m,g))},clone(f){let m=u(f);if(m===f)return N.clone(f);let g=s.importNode(m,!0);return Pt(g),g},insertAt(f,m,g){let h=c(f),y=A.children(h)[g]||(()=>{for(let O=h.children.length-1;O>=0;O--){let x=h.children[O];if(a().cloneOf(x))return x.nextElementSibling}return h.firstElementChild})(),w=c(m);h.insertBefore(w,y||null);let T=a().cloneOf(h);if(T){let O=a().cloneOf(w);O||(O=s.importNode(w,!0),d(w,O));let x=Array.from(T.children);T.insertBefore(O,x[g]||null)}},insertBefore(f,m){let g=c(f),h=c(m);g.parentNode.insertBefore(h,g);let y=a().cloneOf(g.parentNode);if(y){let w=a().cloneOf(h);w||(w=s.importNode(h,!0),d(h,w));let T=a().cloneOf(g);T?T.before(w):y.appendChild(w)}},insertAfter(f,m){let g=c(f),h=c(m);g.parentNode.insertBefore(h,g.nextSibling);let y=a().cloneOf(g.parentNode);if(y){let w=a().cloneOf(h);w||(w=s.importNode(h,!0),d(h,w));let T=a().cloneOf(g);T?T.after(w):y.appendChild(w)}},identity(f){return c(f)||null},remove(f){let m=c(f),g=a().cloneOf(m);N.remove(m),g&&N.remove(g)},replaceWith(f,m){let g=c(f),h=a().cloneOf(g),y=N.replaceWith(g,m);if(h){let w=ie(y,{capability:"data",exclude:t.exclude||null});if(!w.root)h.remove();else{h.replaceWith(w.root);let T=O=>{let x=w.original(O);x&&(i.liveToClone.set(x,O),i.cloneToLive.set(O,x));for(let S of Array.from(O.childNodes||[]))T(S)};T(w.root)}}return y}};return A}var ae=N,pe={extract:(e,t,r={})=>se(H(e,r),e,t,r),apply:(e,t,r,o={})=>ue(H(e,{...o,_write:!0}),e,t,r,o),findRulesIn:(e,t)=>Ie(ae,e,t),findRules:(e,t)=>pt(ae,e,t),bind:(e,t,r={})=>{let o=pt(ae,e,t);if(!o){let n=typeof t=="string"?`data-rules-name~="${t}"`:"the provided rules object";throw new Error(`hyper-html-api: could not resolve rules for ${n}`)}return{...o,get:()=>se(H(e,r),e,o.rules,r),set:n=>ue(H(e,{...r,_write:!0}),e,o.rules,n,r)}},parseStrict:Rr,parseRelaxed:Ct,ruleAttrIndex:_,splitRule:ar,errors:D,DOM_PROPERTIES:gt},Se=e=>!!e&&typeof e.nodeType=="number";function Ht(e){let t=e&&e.ownerDocument?e.ownerDocument:e,r=Ie(ae,t,"api");if(!r)throw new D.NoRulesTag("api");return r.rules}function Yr(e){if(e.nodeType===9)return e;let t=e.ownerDocument?.documentElement;if(t?.contains(e))return t;let r=e;for(;r.parentNode;)r=r.parentNode;return r}function Gr(e){if(e.nodeType!==11||!e.host)return e.cloneNode(!0);let t=e.ownerDocument.createDocumentFragment();for(let r of e.childNodes)t.appendChild(r.cloneNode(!0));return t}function Qr(e,t){let r=[];for(;t!==e;){let o=t.parentNode;r.push(Array.prototype.indexOf.call(o.childNodes,t)),t=o}return r.reverse()}function en(e,t){return t.reduce((r,o)=>r.childNodes[o],e)}function q(e,t){let r=e.querySelectorAll?Array.from(e.querySelectorAll(t)):[];return e.matches?.(t)&&r.unshift(e),r}function tn(e,t){let r=q(e,"option"),o=q(t,"option");r.forEach((a,u)=>o[u].selected=a.selected);let n=q(e,"input"),l=q(t,"input");n.forEach((a,u)=>{let c=a.type.toLowerCase();c!=="file"&&(l[u].value=a.value),(c==="checkbox"||c==="radio")&&(l[u].checked=a.checked)});let s=q(e,"textarea"),i=q(t,"textarea");s.forEach((a,u)=>i[u].value=a.value)}function Ne(e,t){if(t!==void 0){if(typeof e=="string"){if(e.endsWith("[]"))return;let r=e.startsWith("@")?0:_(e);if(r===-1)return;let o=e.slice(r+1);if(wt.has(o))throw new D.RuleTargetReadOnly(o);return}if(Array.isArray(e)){if(!Array.isArray(t))return;t.forEach(r=>Ne(e[1],r));return}if(e&&typeof e=="object"&&t&&typeof t=="object"&&!Array.isArray(t))for(let[r,o]of Object.entries(e))Ne(o,t[r])}}function rn(e,t,r){let o={templateAttr:"cms-template"},n=Yr(e),l=Qr(n,e),s=Gr(n);tn(n,s);let i=en(s,l),a=H(s,{...o,_write:!0}),u=Vr(a,i,t,r,o);if(u.unknownKeys.length||u.unmatched.length)throw new D.WriteRejected(u.unknownKeys,u.unmatched);let c=ft(a);ue(c,i,t,r,o),c.assertClean(),Ne(t,r);let d=ft(H(n,{...o,_write:!0}));ue(d,e,t,r,o),d.assertClean()}function nn(e){if(!(e instanceof Error))return e;let t=e.name||"Error";try{e.code=t}catch{Object.defineProperty(e,"code",{value:t,configurable:!0,enumerable:!0})}return e instanceof D.WriteRefused?e.details=e.refusals:e instanceof D.WriteRejected?e.details={unknownKeys:e.unknownKeys,unmatched:e.unmatched}:e instanceof D.ShapeMismatch?e.details=e.mismatches:Array.isArray(e.path)?e.details={path:e.path}:typeof e.target=="string"?e.details={target:e.target}:e.token!==void 0?e.details={token:e.token}:e.version!==void 0?e.details={version:e.version}:e.details={},e}function G(e,t){let r=Se(e)?e:document,o=Se(e)?t:e;return o===void 0?se(H(r),r,Ht(r)):pe.bind(r,o).get()}function Q(e,t,r){try{if(!Se(e))throw new Error("hyper-html-api: applyData(root, data, source?) needs a DOM root as the first argument.");let o=r===void 0?Ht(e):pe.bind(e,r).rules;rn(e,o,t)}catch(o){throw nn(o)}return e}var qt="clay:visitor-drafts:",Wt=1;function W(e=window.location.pathname){let r=String(e||"/").replace(/\/{2,}/g,"/").match(/^(.*?\/[^/]+\.(?:html|htmlclay))(?:\/|$)/i),o=r?r[1]:"/";return o.toLowerCase()==="/index.html"?"/":o}var He=e=>qt+e,_t=(e,t=W())=>`${qt}${e}@${t}`;function ge(){try{return window.localStorage}catch{return null}}var j=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);function on(e){let t=[];for(let r of e.matchAll(/([^.[\]]+)|\[(\d+)\]/g))t.push(r[2]!==void 0?Number(r[2]):r[1]);return t}function ln(e,t){let r=on(t),o=e;for(let n=0;n<r.length-1;n++)if(o=o?.[r[n]],o==null||typeof o!="object")return;o&&typeof o=="object"&&delete o[r[r.length-1]]}function P(e,t){return Array.isArray(e)?Array.isArray(t)&&t.length===e.length&&e.every((r,o)=>P(r,t[o])):j(e)?j(t)&&Object.keys(e).every(r=>P(e[r],t[r])):e===t}function z(e,t){return P(e,t)&&P(t,e)}var V=e=>Array.isArray(e)&&e.every(t=>j(t)&&(typeof t.id=="string"||typeof t.id=="number"))&&new Set(e.map(t=>t.id)).size===e.length;function he(e,t,r=!1){if(j(e)&&j(t)){let o={...e};for(let n of Object.keys(t))n in e?o[n]=he(e[n],t[n]):r||(o[n]=t[n]);return o}if(V(e)&&V(t)){let o=new Map(t.map(n=>[n.id,n]));return e.map(n=>o.has(n.id)?he(n,o.get(n.id)):n)}return e}var Bt=(e,t)=>e.length===t.length&&e.every((r,o)=>r===t[o]);function an(e,t,r){let o=d=>new Map(d.map(p=>[p.id,p])),n=o(e),l=o(t),s=o(r),i=d=>d.filter(p=>n.has(p.id)&&l.has(p.id)&&s.has(p.id)).map(p=>p.id),a=i(e);if(!Bt(a,i(t))||!Bt(a,i(r)))return null;for(let[d,p]of n)if(l.has(d)&&!s.has(d)&&!z(l.get(d),p)||!l.has(d)&&s.has(d)&&!z(s.get(d),p))return null;let u=!1,c=[];for(let d of t){if(n.has(d.id)&&!s.has(d.id))continue;if(!s.has(d.id)){c.push(d);continue}let p=me(n.get(d.id),d,s.get(d.id),!0);u||=p.conflict,c.push(p.value)}return r.forEach((d,p)=>{if(n.has(d.id)||l.has(d.id))return;let A=0;for(let f=p-1;f>=0;f--){let m=c.findIndex(g=>g.id===r[f].id);if(m!==-1){A=m+1;break}}c.splice(A,0,d)}),{value:c,conflict:u}}function me(e,t,r,o){if(z(t,r)||z(r,e))return{value:t,conflict:!1};if(z(t,e))return{value:r,conflict:!1};if(j(t)&&j(r)){let n={},l=!1;for(let s of new Set([...Object.keys(t),...Object.keys(r)])){let i=me(j(e)?e[s]:void 0,t[s],r[s],o);l||=i.conflict,i.value!==void 0&&(n[s]=i.value)}return{value:n,conflict:l}}if(o&&V(e)&&V(t)&&V(r)){let n=an(e,t,r);if(n)return n}return{value:t,conflict:!0}}function ye(e,t=new Map){if(Array.isArray(e)){if(V(e))for(let r of e)t.set(r.id,(t.get(r.id)||0)+1);for(let r of e)ye(r,t)}else if(j(e))for(let r of Object.values(e))ye(r,t);return t}function sn(e,t,r){let o=me(e,t,r,!0),n=ye(t);for(let[l,s]of ye(o.value))if(s>1&&s>(n.get(l)||0))return me(e,t,r,!1);return o}function Pe(e,t){K(!0),e.dispatchEvent(new CustomEvent("clay:drafts-store-failed",{detail:{error:t}}));let r=new Error("Couldn't save in this browser. Storage is full or turned off.");return r.code="draft-storage",r}var Ut=e=>{try{return String(JSON.parse(e)?.savedAt??"")}catch{return""}};function zt(e,{path:t=W(),storage:r=ge()}={}){let o=He(e),n=_t(e,t),l=n+":legacy";try{let s=r?.getItem(n),i=r?.getItem(o);if(i==null){let d=r?.getItem(o+":ui");return d!=null&&r.getItem(n+":ui")==null&&r.getItem(n+":ui-legacy")==null&&(r.setItem(n+":ui",d),r.setItem(n+":ui-legacy","1")),"none"}let a=Ut(i),u=r.getItem(l);if(u===a)return"none";let c=r.getItem(n);if(c!==s)return"none";if(c==null||u!=null&&Ut(c)===u?r.setItem(n,i):c!==i&&(r.setItem(n+":conflict",i),console.warn("visitor-drafts: an older tab changed this draft after it moved; its copy was kept under",n+":conflict")),u==null){let d=r.getItem(o+":ui");d!=null&&r.getItem(n+":ui")==null&&r.setItem(n+":ui",d)}return r.setItem(l,a),"copied"}catch{return"failed"}}function Vt({doc:e=document,storage:t=ge(),now:r=()=>new Date,path:o=W(),fallback:n=null}={}){let l=le(e),s=_t(l,o),i=pe.findRulesIn(e,"api").rules,a=null,u=null,c=null,d=!1;function p(){try{if(!t)return null;let b=t.getItem(s);return b==null&&n?t.getItem(n):b}catch{return null}}function A(b){try{let v=JSON.parse(b);if(j(v)&&v.v===Wt&&j(v.data))return v}catch{}return null}function f(){let b=p();return b==null?null:{raw:b,record:A(b)}}function m(){return G(e,i)}function g(){let b=window.clay?.getHTML;return typeof b!="function"?m():G(new DOMParser().parseFromString(b.call(window.clay),"text/html"),i)}function h(){try{if(typeof t.keys=="function")return t.keys();let b=[];for(let v=0;v<t.length;v++)b.push(t.key(v));return b}catch{return[]}}function y(){try{return JSON.stringify(g())}catch{return null}}function w(b,{keepSlot:v=!1}={}){let k=h().find(M=>M.startsWith(s+":unreadable:")&&t.getItem(M)===b);if(k){if(c=null,!v)try{t.removeItem(s)}catch{}return k}let L=s+":unreadable:"+r().toISOString();try{t.setItem(L,b)}catch{return c=b,console.warn("visitor-drafts: this browser's saved copy no longer fits the page, and there is no room to keep it aside; nothing will be saved over it"),null}if(c=null,!v)try{t.removeItem(s)}catch{}return console.warn(v?"visitor-drafts: part of this browser's saved copy no longer fits the page; the original was kept under":"visitor-drafts: this browser's saved copy no longer fits the page; it was kept under",L),L}function T(b){let v=he(JSON.parse(JSON.stringify(b)),m(),!0),k=[];for(let L=0;L<4;L++){let M=e.cloneNode(!0);try{Q(M,v,i)}catch(C){let be=C?.details?.unknownKeys??C?.unknownKeys;if(Array.isArray(be)&&be.length){for(let U of be)ln(v,U);continue}let Ae=Object.keys(v).filter(U=>{try{return Q(e.cloneNode(!0),{[U]:v[U]},i),!1}catch{return!0}});if(!Ae.length)return null;for(let U of Ae)delete v[U];k.push(...Ae);continue}let oe=G(M,i),B=Object.keys(v).filter(C=>!P(v[C],oe[C]));if(!B.length)return{data:v,dropped:k};for(let C of B)delete v[C];k.push(...B)}return null}function O(b){let v=w(b);return v||(a=b),u=m(),v?{restored:!1,hadDraft:!0,parked:!0}:{restored:!1,hadDraft:!0,parked:!1,blocked:!0}}function x(){let b=f();if(!b)return u=m(),{restored:!1,hadDraft:!1};if(!b.record)return O(b.raw);let v=T(b.record.data);if(!v||!Object.keys(v.data).length)return O(b.raw);if(Q(e,v.data,i),a=b.raw,u=m(),v.dropped.length){let k=w(b.raw,{keepSlot:!0});return{restored:!0,hadDraft:!0,data:v.data,partial:!0,parked:!!k,blocked:!k}}return{restored:!0,hadDraft:!0,data:v.data}}function S(){if(d)return!1;try{return!P(g(),u)}catch{return!0}}function F(b){let v=s+":conflict";try{t.setItem(v,b)}catch(k){throw Pe(e,k)}console.warn("visitor-drafts: another tab changed the same thing; its copy was kept under",v)}function we(b){let v=p(),k=v==null?null:A(v);if(!k)return{data:b,stored:null};let L=b;if(v!==a){let M=sn(u,b,k.data);M.conflict&&F(v),L=M.value}return L=he(L,k.data),{data:L,stored:z(L,k.data)?v:null}}function re(b){let v=T(b);if(!v||!Object.keys(v.data).length)return null;Q(e,v.data,i);try{window.Sap?.refresh?.()}catch{}return e.dispatchEvent(new CustomEvent("clay:drafts-restored",{detail:{restored:!0,hadDraft:!0,parked:!1,external:!0}})),v.data}function ne(b){if(d)return null;if(c!=null&&w(c,{keepSlot:!0})===null)throw Pe(e,new Error("an earlier saved copy could not be kept aside"));let v=G(new DOMParser().parseFromString(b,"text/html"),i),k=p();if(P(v,u)&&(k===a||k==null))return K(!1),e.dispatchEvent(new CustomEvent("clay:drafts-saved",{detail:{data:v,unchanged:!0}})),v;let{data:L,stored:M}=we(v),oe=M??JSON.stringify({v:Wt,savedAt:r().toISOString(),data:L});if(!M)try{if(!t)throw new Error("no storage");t.setItem(s,oe)}catch(C){throw Pe(e,C)}let B=Object.keys(v).filter(C=>!P(v[C],L[C]));return B.length&&re(Object.fromEntries(B.map(C=>[C,L[C]]))),a=oe,u=L,K(!1),e.dispatchEvent(new CustomEvent("clay:drafts-saved",{detail:{data:L}})),L}function E(){try{return ne(window.clay.getHTML()),!0}catch{return!1}}function R(){return d||!S()?!0:E()}function I(){if(d)return!1;let b=p();if(b==null||b===a||S())return!1;let v=A(b),k=v&&re(v.data);return k?(a=b,u={...u,...k},!0):!1}function ve(){d=!0,c=null,K(!1);try{t.removeItem(s)}catch{}}return{slot:l,key:s,rules:i,read:f,restore:x,write:ne,writeLive:E,flush:R,changed:S,adoptExternal:I,park:w,clear:ve,snapshot:y}}function Ft(e,t){let r=`${e}:ui`,o=()=>({v:1,prompt:{},intro:{done:null},src:null}),n=o();try{let l=JSON.parse(t?.getItem(r)||"null");l&&typeof l=="object"&&l.v===1&&(n={...o(),...l})}catch{}return{get:()=>n,save(){try{t?.setItem(r,JSON.stringify(n))}catch{}},reset(){n=o();try{t?.removeItem(r)}catch{}}}}var un=/^[a-z0-9][a-z0-9-]{0,39}$/;function Kt(e,t=window.location.search){let r=e.get(),o=null;try{o=new URLSearchParams(t).get("src")}catch{}return!r.src&&o&&un.test(o)&&(r.src=o,e.save()),r.src}function Jt(e,t=window.location){let r=W(t.pathname);return`/_/download${r==="/"?"":r}?as=htmlclay${e?`&src=${encodeURIComponent(e)}`:""}`}var cn=`<aside class="hcp" id="hcp" hidden aria-label="Download this app" data-hcp-state="tab" data-hcp-reason="open" sap-ignore clay="editor-ui">
|
|
2
|
-
<section class="hcp-card" id="hcp-card" role="dialog" aria-modal="false" aria-labelledby="hcp-title">
|
|
3
|
-
<button type="button" class="hcp-x" data-hcp="minimize" aria-label="Minimize"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="square" aria-hidden="true"><path d="M5 12h14"/></svg></button>
|
|
4
|
-
<div class="hcp-kicker">Free download</div>
|
|
5
|
-
<h2 class="hcp-title" id="hcp-title"><span data-hcp-for="use">Your work is saved in this browser only.</span><span data-hcp-for="open">This app is free to keep.</span><span data-hcp-for="return">Your work is saved in this browser only.</span><span data-hcp-for="error">Your work isn't being saved in this browser.</span></h2>
|
|
6
|
-
<p class="hcp-body"><span data-hcp-for="open">Download it as one file and use it on your computer, no account needed.</span><span data-hcp-for="use">Download the file to keep it on your computer for good.</span><span data-hcp-for="return">Download the file to keep it on your computer for good.</span><span data-hcp-for="error">Storage is full or turned off here. Download the file to keep what you've done.</span></p>
|
|
7
|
-
<div class="hcp-file">
|
|
8
|
-
<svg width="20" height="20" viewBox="0 0 256 256" fill="currentColor" aria-hidden="true"><path d="M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"/></svg>
|
|
9
|
-
<div><b class="hcp-name" data-hcp-name>This app</b><small>One file with the whole app and your work in it</small></div>
|
|
10
|
-
</div>
|
|
11
|
-
<div class="hcp-actions">
|
|
12
|
-
<a class="hcp-btn hcp-btn--primary" data-hcp-link href="/_/download?as=htmlclay"><span><svg width="16" height="16" viewBox="0 0 256 256" fill="currentColor" aria-hidden="true"><path d="M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"/></svg>Download free</span></a>
|
|
13
|
-
</div>
|
|
14
|
-
<div class="hcp-foot"><button type="button" class="hcp-quiet" data-hcp="dismiss">Don’t show again</button></div>
|
|
15
|
-
</section>
|
|
16
|
-
<div class="hcp-dock">
|
|
17
|
-
<button type="button" class="hcp-btn hcp-tab" data-hcp="open" aria-controls="hcp-card" aria-expanded="false" aria-label="This app is free to keep"><span><svg width="16" height="16" viewBox="0 0 256 256" fill="currentColor" aria-hidden="true"><path d="M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"/></svg><span class="hcp-tab__label">This app is free to keep</span><span class="hcp-tab__mini">Keep</span></span></button>
|
|
18
|
-
<button type="button" class="hcp-x" data-hcp="minimize" aria-label="Minimize download notice"><svg width="12" height="12" viewBox="0 0 12 12" fill="currentColor" aria-hidden="true"><path d="M1.4 0 6 4.6 10.6 0 12 1.4 7.4 6 12 10.6 10.6 12 6 7.4 1.4 12 0 10.6 4.6 6 0 1.4z"/></svg></button>
|
|
19
|
-
</div>
|
|
20
|
-
</aside>`;async function Zt({memory:e,appName:t,link:r}){let{PROMPT_CSS:o}=await import("../c-SGIA4IEQ.js"),l=document.querySelector('clay-editor-ui[data-clay-ui="download-prompt"]')?.shadowRoot.getElementById("hcp");if(!l){let E=document.createElement("template");E.innerHTML=cn,l=E.content.firstElementChild,Ke({name:"download-prompt",content:l,css:[o],attributes:{"sap-ignore":""}})}let s=e.get();(!s.prompt||typeof s.prompt!="object")&&(s.prompt={});let i=s.prompt,a=3,u=2500,c=/^(INPUT|TEXTAREA|SELECT)$/,d="#hcp, .clay-intro, .clay-owner",p=l.querySelector("[data-hcp-link]");p.href=r,t&&(l.querySelector("[data-hcp-name]").textContent=t);let A=l.querySelector("[data-hcp=open]");function f(E,R){l.hidden=!1,l.setAttribute("data-hcp-state",E),R&&l.setAttribute("data-hcp-reason",R),A.setAttribute("aria-expanded",E==="card"?"true":"false"),(E==="card"||E==="mini")&&(i.shown=!0,e.save(),l.setAttribute("data-hcp-arrived","")),S()}function m(E){return E&&!l.contains(E)&&!E.closest(d)&&(c.test(E.tagName)||E.isContentEditable)}let g=null;function h(E){clearTimeout(g),g=setTimeout(()=>{if(i.shown||i.dismissed||l.getAttribute("data-hcp-state")!=="tab")return;let R=document.activeElement;if(m(R)){let I=R.getBoundingClientRect(),ve=Math.min(360,innerWidth-32);if(innerWidth<700||I.right>innerWidth-ve-32&&I.bottom>innerHeight-380)return}f("card",E)},u)}let y=[];function w(E){l.contains(E.target)||!m(E.target)||(y.indexOf(E.target)<0&&y.push(E.target),i.uses=Math.max(i.uses||0,y.length),i.shown||e.save(),y.length>=a&&h("use"))}function T(E){m(E.target)&&(l.getAttribute("data-hcp-state")==="card"&&f(i.shown?"mini":"tab"),innerWidth<700&&l.setAttribute("data-hcp-typing",""))}function O(){setTimeout(()=>{m(document.activeElement)||l.removeAttribute("data-hcp-typing")},50)}let x=0;function S(){x||(x=requestAnimationFrame(()=>{x=0;let R=Ze(innerWidth-24,I=>l.contains(I)||I.closest("[data-hcp-preview], .clay-owner"))+"px";l.style.getPropertyValue("--hcp-lift")!==R&&l.style.setProperty("--hcp-lift",R),Je()}))}async function F(){let E=window.clay&&window.clay.getHTML;if(typeof E!="function"||typeof URL>"u"||typeof URL.createObjectURL!="function")return!1;let R=location.pathname.split("/").filter(Boolean).pop()||"index.html";try{let{downloadHtml:I}=await import("../c-3TWCKFOP.js");return await I({html:E(),name:R.replace(/\.html$/,".htmlclay")})}catch{return!1}}l.addEventListener("click",async E=>{let R=E.target.closest("[data-hcp]");if(R){let I=R.getAttribute("data-hcp");I==="open"?(f("card","open"),p.focus()):I==="minimize"?(f("mini"),A.focus()):I==="dismiss"&&(l.getAttribute("data-hcp-reason")==="error"?(f("mini"),A.focus()):(i.dismissed=!0,f("mini"),A.focus()));return}if(E.target.closest("[data-hcp-link]")){if(l.getAttribute("data-hcp-reason")==="error"&&(E.preventDefault(),!await F())){l.querySelector(".hcp-body [data-hcp-for='error']").textContent="The download could not be made. Keep this page open and try Download free again.";return}i.downloaded=!0,i.shown=!0,e.save()}}),l.addEventListener("animationend",E=>{(E.animationName==="hcp-arrive"||E.animationName==="hcp-arrive-fade")&&l.setAttribute("data-hcp-arrived","")}),l.addEventListener("keydown",E=>{E.key==="Escape"&&l.getAttribute("data-hcp-state")==="card"&&(f("mini"),A.focus())});function we(){f("card","error")}function re(){l.getAttribute("data-hcp-reason")==="error"&&l.setAttribute("data-hcp-reason","use")}let ne={set:f,root:l,showError:we,clearError:re};return document.addEventListener("input",w,!0),document.addEventListener("change",w,!0),document.addEventListener("focusin",T),document.addEventListener("focusout",O),addEventListener("scroll",S,{passive:!0}),addEventListener("resize",S),document.addEventListener("transitionend",S,!0),l.addEventListener("transitionend",S),f(i.shown||i.dismissed?"mini":"tab"),!i.shown&&(i.uses||0)>=a&&h("return"),ne}var $=null,te=null,Be=Xe,Ue=null,Xt=Promise.resolve();function Yt(){return import("../c-LDUNOR57.js").then(e=>e.mountOwnerChip()).catch(e=>(console.warn("visitor-drafts: the owner chip did not load",e),null))}function fn(e){return e.template?import("../c-JH5FF4NL.js").then(t=>t.mountIntro(e)).catch(t=>(console.warn("visitor-drafts: the intro did not load",t),null)):Promise.resolve(null)}var ee=le(),We=document.querySelector('script[data-rules-name~="api"]');if(Ve&&ee&&We){let e=W(),t=zt(ee,{path:e});$=Vt({path:e,fallback:t==="failed"?He(ee):null}),_e(a=>$.write(a));let r=$.restore();te={restored:r.restored,hadDraft:r.hadDraft,parked:!!r.parked,...r.partial&&{partial:!0},...r.blocked&&{blocked:!0}},document.dispatchEvent(new CustomEvent("clay:drafts-restored",{detail:te}));let o=Ft($.key,ge());Ue=Kt(o),Be=Jt(Ue);let n=document.querySelector('meta[name="application-name"]')?.content?.trim()||document.title.split(/:|\s\|\s/)[0].trim()||"This app",l=document.querySelector("template[visitor-intro]"),s=()=>{Xt=Zt({memory:o,appName:n,link:Be}).then(a=>fn({memory:o,template:l,appName:n,hadDraft:r.hadDraft}).then(()=>a)).then(a=>(document.addEventListener("clay:drafts-store-failed",()=>a.showError()),document.addEventListener("clay:drafts-saved",()=>a.clearError()),(Ee?Yt():Promise.resolve(null)).then(()=>a)))};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",s,{once:!0}):s(),ze(()=>$.flush()),window.addEventListener("storage",a=>{a.key===$.key&&$.adoptExternal()});let i=()=>$.flush();document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&i()}),window.addEventListener("pagehide",i)}else if(!ee||!We){let e=[];ee||e.push('a visitor-drafts="<slot>" attribute on <html>'),We||e.push('a <script data-rules-name~="api"> rules tag'),console.warn(`visitor-drafts: this page keeps no draft (missing ${e.join(" and ")})`)}else Ee&&Fe&&!qe()&&(Xt=Yt());var Bn=$?{active:!0,slot:$.slot,key:$.key,hasDraft:()=>!!$.read(),restored:()=>te,saveNow:()=>$.writeLive(),reset(){return $.clear(),window.location.reload(),!0},onRestore(e){return te?(e(te),!0):(document.addEventListener("clay:drafts-restored",t=>e(t.detail),{once:!0}),!1)},editOriginal:Ye,backToDraft:Ge,downloadUrl:()=>Be,source:Ue}:Qe();export{Xt as ready,Bn as visitorDrafts};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// The CMS's "Edit content" toggle in Bevel's button face. HyperCMS pins the toggle's fill
|
|
2
|
-
// to an opaque neutral (#0a0a0a or #fafafa) and exposes --hcms-toggle-bg and
|
|
3
|
-
// --hcms-toggle-color for authors; on a dark page Bevel's dark bottom-right edge vanished
|
|
4
|
-
// into the near-black fill and the button read as pressed in. Hand-written, not
|
|
5
|
-
// generated: the generated CMS skin may only pin the vendor's --mirk-* tokens.
|
|
6
|
-
import { TOKENS } from "../bevel.js";
|
|
7
|
-
|
|
8
|
-
export const ROOTS = ["[data-hcms-toggle-host]"];
|
|
9
|
-
|
|
10
|
-
export const CSS = `@layer clay-skin{
|
|
11
|
-
[data-hcms-toggle-host]{--hcms-toggle-bg:${TOKENS.face} !important;--hcms-toggle-color:${TOKENS.ink} !important}
|
|
12
|
-
[data-hcms-toggle-host] :is(.hcms-toggle__main, .hcms-toggle__arrow){border-color:${TOKENS["edge-hi"]} ${TOKENS["edge-lo"]} ${TOKENS["edge-lo"]} ${TOKENS["edge-hi"]} !important}
|
|
13
|
-
[data-hcms-toggle-host] :is(.hcms-toggle__main, .hcms-toggle__arrow):hover:not(:active){--hcms-toggle-bg:color-mix(in srgb, ${TOKENS.face}, ${TOKENS["edge-hi"]} 45%) !important}
|
|
14
|
-
[data-hcms-toggle-host] :is(.hcms-toggle__main, .hcms-toggle__arrow):active{border-color:${TOKENS["edge-lo"]} ${TOKENS["edge-hi"]} ${TOKENS["edge-hi"]} ${TOKENS["edge-lo"]} !important}
|
|
15
|
-
}`;
|
|
File without changes
|
|
File without changes
|