@panphora/clayjs 1.20.0 → 1.22.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.
Files changed (130) hide show
  1. package/dist/all.js +1 -1
  2. package/dist/clay-dom.js +1 -1
  3. package/dist/clay-events.js +1 -1
  4. package/dist/clay-internals.js +1 -1
  5. package/dist/clay-options.js +1 -1
  6. package/dist/clay-router.js +1 -1
  7. package/dist/clay-ui.js +1 -1
  8. package/dist/clay-utils.js +1 -1
  9. package/dist/clay.js +1 -1
  10. package/dist/clay.standalone.js +7865 -8022
  11. package/dist/m/{c-JOH753EJ.js → c-26KVJS6J.js} +1 -1
  12. package/dist/m/{c-ZE46QDIH.js → c-3TLG3OLG.js} +1 -1
  13. package/dist/m/{c-RT3C74GY.js → c-4OGEVKR3.js} +1 -1
  14. package/dist/m/{c-Y33LUUIQ.js → c-4PHDUV3H.js} +1 -1
  15. package/dist/m/{c-SJPD46ZO.js → c-4RFZROCF.js} +4 -4
  16. package/dist/m/{c-XQSXKIKM.js → c-4TWARTLS.js} +1 -1
  17. package/dist/m/{c-S5IEIZCN.js → c-5AQYL27I.js} +1 -1
  18. package/dist/m/{c-OJYM642Q.js → c-5FKRZNJV.js} +1 -1
  19. package/dist/m/{c-CJFDLD43.js → c-6KBKYLPO.js} +1 -1
  20. package/dist/m/{c-DHXPDLW6.js → c-6PBXRWDX.js} +1 -1
  21. package/dist/m/{c-BRLCTNMC.js → c-6RC66MYY.js} +1 -1
  22. package/dist/m/{c-PIVIYLTY.js → c-6UEFPHHE.js} +1 -1
  23. package/dist/m/{c-YQUJ74R3.js → c-BV6FQQXM.js} +1 -1
  24. package/dist/m/{c-YSB6JKV2.js → c-DEAFCHDO.js} +2 -2
  25. package/dist/m/{c-NLZ5AN4L.js → c-DKFSOJCV.js} +1 -1
  26. package/dist/m/c-DP4X4JID.js +1 -0
  27. package/dist/m/{c-LIBE4HPD.js → c-DZBZ57EE.js} +1 -1
  28. package/dist/m/c-ECY5AZMH.js +1 -0
  29. package/dist/m/{c-VAK7SG37.js → c-EUGJVHDD.js} +1 -1
  30. package/dist/m/{c-GPGYKER7.js → c-F5AER2ID.js} +1 -1
  31. package/dist/m/{c-RG6XUZFA.js → c-FAXQU7MQ.js} +1 -1
  32. package/dist/m/{c-XD5MOROJ.js → c-FLBUYV3P.js} +1 -1
  33. package/dist/m/{c-NFR673TL.js → c-FMCPQ4VT.js} +2 -2
  34. package/dist/m/{c-VBLFAQD2.js → c-FNIGX4FI.js} +1 -1
  35. package/dist/m/{c-BTLFLLML.js → c-FWFJUU3T.js} +1 -1
  36. package/dist/m/{c-2VB555FG.js → c-GPTKI7AQ.js} +1 -1
  37. package/dist/m/{c-EZ7B5AZT.js → c-GY4ODHO2.js} +1 -1
  38. package/dist/m/{c-5734MF2P.js → c-H6DXQEH2.js} +1 -1
  39. package/dist/m/{c-Z32V4MHK.js → c-HAVGDXAL.js} +1 -1
  40. package/dist/m/{c-D3E4WJ4M.js → c-HDWZEJHM.js} +49 -32
  41. package/dist/m/{c-W23KVGUO.js → c-HWR6GMGK.js} +1 -1
  42. package/dist/m/{c-BJ7YQ5QZ.js → c-IHUWUKIU.js} +1 -1
  43. package/dist/m/{c-AL4RBJF2.js → c-ILGQ3UXQ.js} +1 -1
  44. package/dist/m/{c-W3K23S72.js → c-IWTTOC2V.js} +1 -1
  45. package/dist/m/c-JFST6QE7.js +1 -0
  46. package/dist/m/{c-FNVQAACK.js → c-KE33W4RE.js} +1 -1
  47. package/dist/m/c-KV7R47FR.js +1 -0
  48. package/dist/m/{c-LPUJXRXW.js → c-L7K5EXU2.js} +1 -1
  49. package/dist/m/{c-3YH6JSIL.js → c-LF6HNVPU.js} +1 -1
  50. package/dist/m/{c-MIL4B2JQ.js → c-MRURHLKV.js} +1 -1
  51. package/dist/m/{c-LQU7TXIH.js → c-N33TPVTL.js} +1 -1
  52. package/dist/m/{c-EOCZ2YVL.js → c-NBNRLZXO.js} +1 -1
  53. package/dist/m/{c-JUE7B4OX.js → c-NLWEZYKJ.js} +1 -1
  54. package/dist/m/{c-DDDOKPI6.js → c-NNNR7OXA.js} +1 -1
  55. package/dist/m/{c-E4IBSAQM.js → c-OI2BYWVV.js} +1 -1
  56. package/dist/m/{c-SBSMJIPC.js → c-P3WATEDR.js} +1 -1
  57. package/dist/m/{c-ZJLU56DV.js → c-PCEMXY2K.js} +1 -1
  58. package/dist/m/{c-3GJ4XARY.js → c-PWBJVHA4.js} +1 -1
  59. package/dist/m/{c-67ILSNPR.js → c-Q5KAQJAG.js} +1 -1
  60. package/dist/m/{c-U5X57T4L.js → c-QHVCUTJV.js} +1 -1
  61. package/dist/m/{c-GKEATME6.js → c-QJFYVCJO.js} +1 -1
  62. package/dist/m/{c-VY6XRBOW.js → c-QTC6VGA4.js} +1 -1
  63. package/dist/m/{c-44B5ODN7.js → c-TMT5TL65.js} +2 -2
  64. package/dist/m/{c-OABVRYOT.js → c-TV7JHSRL.js} +1 -1
  65. package/dist/m/{c-SO63UGPQ.js → c-UWT4CXQ4.js} +1 -1
  66. package/dist/m/{c-EFD6QNTE.js → c-VFES2BP5.js} +1 -1
  67. package/dist/m/{c-UXEVJ63W.js → c-VIW5X35H.js} +1 -1
  68. package/dist/m/{c-EOCKLMKX.js → c-WWE67K5Y.js} +1 -1
  69. package/dist/m/{c-J3BXFTZS.js → c-XDVAZDUE.js} +1 -1
  70. package/dist/m/{c-K76AUL4I.js → c-XZJ5IK6Q.js} +1 -1
  71. package/dist/m/{c-2ZZBC45O.js → c-Z7RJANGO.js} +1 -1
  72. package/dist/m/{c-I2IFKJX2.js → c-ZAHTFCXQ.js} +1 -1
  73. package/dist/m/{c-GVPNDIKJ.js → c-ZKELCT4T.js} +1 -1
  74. package/dist/m/{c-7SXYQCN4.js → c-ZO6VL2SC.js} +1 -1
  75. package/dist/m/{c-M4FSPNQ2.js → c-ZYEJLZEY.js} +1 -1
  76. package/dist/m/core/{autosave-VPORYJSE.js → autosave-GI3WNJYN.js} +1 -1
  77. package/dist/m/core/{conflict-notice-JMAZLVRX.js → conflict-notice-CEI3XY6A.js} +1 -1
  78. package/dist/m/core/{save-AOJBDSOK.js → save-OJ5NSLS7.js} +1 -1
  79. package/dist/m/core/{save-core-IOCMXO5L.js → save-core-DX3RFVO3.js} +1 -1
  80. package/dist/m/core/{unsaved-warning-U5VUJFOE.js → unsaved-warning-HGYH7O4H.js} +1 -1
  81. package/dist/m/internals/{index-HDRANDWE.js → index-V4WC44FU.js} +1 -1
  82. package/dist/m/loader-V6VI46HU.js +1 -0
  83. package/dist/m/{manifest-3AEF5191.js → manifest-83C18DED.js} +1 -1
  84. package/dist/m/{manifest-edit-29A26F22.js → manifest-edit-B28C1985.js} +1 -1
  85. package/dist/m/manifest.json +567 -567
  86. package/dist/m/page/{editor-EY2WAAGB.js → editor-BQEPCJLG.js} +2 -2
  87. package/dist/m/plugins/ai-edit-45A2J6LC.js +6 -0
  88. package/dist/m/plugins/cms-IFTKWF4S.js +2235 -0
  89. package/dist/m/plugins/{derive-FRE5JJQE.js → derive-QVI3LI3A.js} +1 -1
  90. package/dist/m/plugins/{indicator-4VDXWYTD.js → indicator-IPZJ35K6.js} +1 -1
  91. package/dist/m/plugins/{live-5EZN2EYP.js → live-GPQXSXSM.js} +1 -1
  92. package/dist/m/plugins/menu-UN3KRCOF.js +1 -0
  93. package/dist/m/plugins/{page-LVW5DWA4.js → page-BAVLWCP6.js} +2 -2
  94. package/dist/m/plugins/{page-view-5KQ76IJB.js → page-view-P3UGJFDZ.js} +1 -1
  95. package/dist/m/plugins/{people-C7TVBBMR.js → people-Z4RGVQAV.js} +1 -1
  96. package/dist/m/plugins/{quickcrop-BQ5YYFCH.js → quickcrop-E34PUYA3.js} +2 -2
  97. package/dist/m/plugins/{richclay-KLGETK77.js → richclay-S4NVJYIK.js} +2 -2
  98. package/dist/m/plugins/{source-CCEUM3OR.js → source-KVN6YNTY.js} +1 -1
  99. package/dist/m/plugins/{upgrade-NW556WJD.js → upgrade-KTSICB22.js} +1 -1
  100. package/dist/m/plugins/{wire-VRYPY6EJ.js → wire-SYVIBNSE.js} +1 -1
  101. package/dist/m/{reader-core-2GXY7SHY.js → reader-core-RUIFH32Y.js} +2 -2
  102. package/dist/m/sync/{live-sync-SKPMFYOO.js → live-sync-RGQMMWK2.js} +1 -1
  103. package/dist/m/ui/{index-QNIPDHXQ.js → index-EZGLEM5P.js} +1 -1
  104. package/dist/m/vendor/{sap-core.vendor-RN4ZVY4X.js → sap-core.vendor-OA5SKL7Q.js} +1 -1
  105. package/dist/offline-manifest.json +463 -469
  106. package/docs/guide.md +16 -8
  107. package/entries/sap.js +1 -1
  108. package/package.json +2 -2
  109. package/src/loader-logic.js +4 -1
  110. package/src/plugins/ai-edit.js +6 -17
  111. package/src/plugins/cms.js +3 -6
  112. package/src/plugins/menu/style.js +59 -31
  113. package/src/plugins/menu.js +131 -28
  114. package/src/ui/bevel.js +1 -1
  115. package/src/ui/skins/cms.js +1 -1
  116. package/src/ui/skins/quickcrop.js +1 -1
  117. package/src/ui/skins/richclay.js +1 -1
  118. package/src/vendor/hypercms.vendor.js +16 -69
  119. package/src/vendor/sap-core.vendor.js +1 -1
  120. package/dist/m/c-FSWRGBVQ.js +0 -1
  121. package/dist/m/c-HMYWIHFG.js +0 -1
  122. package/dist/m/c-M6FNQCTQ.js +0 -1
  123. package/dist/m/c-WFMRX5RZ.js +0 -1
  124. package/dist/m/loader-DZZLUBVB.js +0 -1
  125. package/dist/m/plugins/ai-edit-J5VLSW5I.js +0 -6
  126. package/dist/m/plugins/cms-LRAOZHT7.js +0 -2293
  127. package/dist/m/plugins/menu-KGWKT6CS.js +0 -1
  128. package/src/ui/skins/cms-toggle.js +0 -15
  129. /package/dist/m/plugins/{quickcrop-BQ5YYFCH.js.LEGAL.txt → quickcrop-E34PUYA3.js.LEGAL.txt} +0 -0
  130. /package/dist/m/plugins/{richclay-KLGETK77.js.LEGAL.txt → richclay-S4NVJYIK.js.LEGAL.txt} +0 -0
@@ -1,4 +1,4 @@
1
- import{d as Ae,h as Ve,i as qe}from"./c-TRS6TM6O.js";import{a as Ne,b as Pe}from"./c-CSNE5EIF.js";import{a as Ie,b as Oe}from"./c-PZ4XEPUP.js";import"./c-SFKI6OLM.js";import"./c-Q3XOWZEV.js";import{e as ke,f as Ke,g as W,h as Ue,l as re,m as $e,n as p}from"./c-BJ7YQ5QZ.js";import"./c-4JZDZFF6.js";import{b as U,c as Z,e as l,f as Ye}from"./c-VAK7SG37.js";import{b as He}from"./c-MHI3GYKF.js";import"./c-RHMPKZZ7.js";import{b as T,c as Fe}from"./c-NUHP2XDB.js";import{a as We,q as V}from"./c-NLZ5AN4L.js";import"./c-4ASQPRQL.js";import"./c-GQ6F6IDK.js";import"./c-I2SCCUEW.js";import"./c-5VYOWDTI.js";import{f as Te}from"./c-GSRLXYWL.js";import"./c-X5LNHET5.js";import"./c-WYFDLITL.js";import"./c-UGHH4MB3.js";import"./c-LA2BW7UY.js";import"./c-GVPNDIKJ.js";import"./c-ATKAOH23.js";import"./c-EK63G3CG.js";import"./c-NQJRVJ56.js";import"./c-XGH4GS2T.js";import"./c-IJUK2GPW.js";import{f as _e}from"./c-3O7OBDCM.js";import"./c-BPF2NSPV.js";import"./c-P7KNDG34.js";import"./c-CYWLPPUS.js";import"./c-N7JPUPGC.js";import"./c-EGTIAL6P.js";import"./c-XQXZAO7N.js";import"./c-S7LK4KUE.js";import"./c-VG5XIN4T.js";import"./c-2YYDMLNZ.js";import"./c-HA6INT6J.js";import"./c-ICMAOOGK.js";import"./c-WRBKEJD4.js";import"./c-VHNSBD2M.js";var E="light-dark(#D08A1E, #E3A33F)",lt=5e3,st=4e3,dt=500,ct={"another-tab":"in another tab","another-person":"by someone else","an-agent":"by an agent"},pt='<svg viewBox="0 0 12 12" width="12" height="12" aria-hidden="true"><path d="M2.5 9.5h7" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="square"/></svg>',F=(e,t)=>`${e} ${t}${e===1?"":"s"}`,ut="This spot changed again. Review the latest edit or download your copy.",ft="A data value can't be put back from here. Download your copy to keep yours.",m="hidden",P=!1,S=[],J=new Set,M=new Set,h=null,Ee=0,I=null,v=null,le=null,u=null,R=!1,Y=!1,ve=!1,G=new Map,se=0,ae=!1,te=!1,b=null,j=null,L=null,Se=0,D=!1,de=0,ce=null,ne=null,k=[],x=[],oe=!1,pe=null,ue=null,s=null,B=null,q=new Map,z=()=>window.clay?.conflicts||null,Qe=()=>k.reduce((e,t)=>e+t.conflicts.length,0)+x.length,Le=()=>{let e=window.clay?.undo;return e&&typeof e.kept=="function"?e:null},fe=()=>z()?.list().filter(e=>!e.claimedBy&&e.kind!=="apply-incomplete")??[],De=()=>z()?.list().filter(e=>!e.claimedBy&&e.kind==="apply-incomplete")??[];function ze(){return I?"upgraded":h?"refused":fe().length?"replaced":De().length?"failed":k.length||x.length?"recovered":null}function f(e,t,n){let o=Fe(e,t,n);return t[0]==="all:initial"&&T(o,"color-scheme","inherit"),o.setAttribute("clay",ke),o}function _(e,t){return q.set(t,e),e}function ie(){if(!s)return;let e=window.visualViewport,t=e?Math.max(0,window.innerHeight-e.height-e.offsetTop):0;T(s,"bottom",`calc(${16+t}px + env(safe-area-inset-bottom,0px))`),ne&&T(ne,"max-height",`${Math.max(160,(e?.height||window.innerHeight)-32)}px`)}function ht(){s=f("div",["all:initial","position:fixed","left:50%","transform:translateX(-50%)","z-index:2147483001","display:none","flex-direction:column","align-items:center","max-width:calc(100vw - 24px)",`font:14px/1.5 ${U}`,`color:${l.ink}`,"text-align:left"]),s.setAttribute("data-clay-conflict",""),document.body.appendChild(s),window.visualViewport?.addEventListener("resize",ie),window.visualViewport?.addEventListener("scroll",ie)}function d(){if(ae)return;ae=!0;let e=()=>{ae=!1,w()};typeof requestAnimationFrame=="function"?requestAnimationFrame(e):setTimeout(e,16)}function w(){te&&(te=!1,h&&!V()&&(h=null));let e=ze();if(e?m==="hidden"&&(m="bar"):(m="hidden",P=!1,J.clear(),M.clear(),S=[],y(),ce=null,D=!1),!s){if(m==="hidden"&&!b||!document.body)return;ht()}!s.isConnected&&document.body&&document.body.appendChild(s);let t=document.activeElement,n=null;for(let[a,r]of q)r===t&&(n=a);let o=B?B.scrollTop:0;q=new Map,B=null,ne=null,s.replaceChildren(),b?s.append(wt(b)):m==="bar"?s.append(yt(e)):m==="panel"&&s.append(xt(e)),T(s,"display",b||m!=="hidden"?"flex":"none"),B&&(B.scrollTop=o);let i=L||n;i&&q.has(i)&&q.get(i).focus({preventScroll:!0}),b||(L=null),ie(),He(s)}function Xe(){return f("span",["all:initial","display:inline-block","flex:none","width:8px","height:8px","border-radius:50%",`background:${E}`])}function Ze(){return ct[h?.changedBy]||null}function gt(e,t){if(e==="upgraded")return I;if(e==="refused"){let n=Ze();return!n&&h.afterTimeout?"This page changed elsewhere, possibly by your own save that timed out. Your edits here are safe.":`This page changed ${n||"elsewhere"}. Your edits here are safe.`}return e==="failed"?"A sync update did not finish. Your edits here are safe.":e==="recovered"?`${F(t,"change")} replaced before this page loaded ${t===1?"is":"are"} still here.`:`Another edit replaced ${F(t,"change")}.`}function mt(e,t){return e==="upgraded"?I:e==="refused"?`This page changed ${Ze()||"elsewhere"}`:e==="failed"?"A sync update did not finish":e==="recovered"?`${F(t,"change")} kept from before this page loaded`:`Another edit replaced ${F(t,"change")}`}function wt(e){let t=re("div",["display:block",`border-left:3px solid ${l.teal}`,"padding:10px 14px","width:max-content","max-width:calc(100vw - 24px)"]);return t.setAttribute("role","status"),t.textContent=e,t}function yt(e){let t=e==="failed"?De().length:e==="recovered"?Qe():fe().length,n=re("div",["display:flex","flex-wrap:wrap","align-items:center","gap:10px 12px","padding:8px 8px 8px 14px","width:max-content","max-width:calc(100vw - 24px)"]),o=gt(e,t);return o!==ce&&(n.setAttribute("role",e==="refused"?"alert":"status"),ce=o),n.append(Xe(),p("span",[],o)),e==="upgraded"?(n.append(_(W("Reload",{variant:"primary",onClick:()=>window.location.reload()}),"reload")),n):(n.append(_(W("Review",{onClick:Dt}),"review")),n)}function $(e,t,{variant:n="default",onClick:o,push:i=!1}={}){let r=window.innerWidth<480?["flex:1 1 100%",...n==="primary"?["order:-1"]:[]]:i?["margin-left:auto"]:[];return _(W(e,{variant:n,onClick:o,extra:r}),t)}function A(e){return p("div",["display:block","padding:0 16px 12px",`color:${l["ink-2"]}`,"font-size:13.5px"],e)}function xt(e){let t=e==="replaced"?fe():e==="failed"?De():[],n=e==="refused"?fe():t,o=e==="recovered"?Qe():t.length;if(J.size)for(let c of t)J.has(c.id)||M.add(c.id);for(let c of[...M])t.some(N=>N.id===c)||M.delete(c);let i=mt(e,o),a=Math.max(160,(window.visualViewport?.height||window.innerHeight)-32),r=re("div",["display:flex","flex-direction:column","width:520px","max-width:calc(100vw - 24px)",`max-height:${a}px`]);ne=r,r.setAttribute("role","dialog"),r.setAttribute("aria-label",i);let g=f("div",["all:initial","display:flex","align-items:center","gap:8px","padding:12px 12px 8px 16px",`font:14px/1.5 ${U}`,`color:${l.ink}`]),K=_(p("b",["font-weight:600","font-size:14.5px","outline:none"],i),"title");K.setAttribute("tabindex","-1"),g.append(Xe(),K),e==="replaced"&&M.size&&g.append(p("span",[`font:600 10.5px/1 ${Z}`,"letter-spacing:.12em","text-transform:uppercase","padding:3px 6px",`color:color-mix(in srgb, ${l.brass} 80%, ${l.ink})`,`background:${l["brass-soft"]}`],`${M.size} new`));let X=f("span",["all:initial","display:inline-flex","margin-left:auto"]),Be=_(Ue(pt,{label:"Minimize",onClick:Je}),"minimize");if(Be.title="Minimize to the bar. Nothing is accepted until you choose.",X.append(Be),g.append(X),r.append(g),e==="recovered")return Et(r),r;if(e==="refused"){if(r.append(A("Your edits here are safe and not saved yet; nothing will be overwritten until you choose. Their version is not on this page, so there is no list of edits to compare. Keep yours, which saves over theirs, or accept theirs, which reloads the page and drops your unsaved edits.")),n.length&&r.append(A(`${F(n.length,"earlier replaced edit")} ${n.length===1?"is":"are"} also held in this tab. Download my copy includes them.`)),R&&r.append(A("That did not save either. Your edits here are still here.")),D&&r.append(A("Something changed on the page after your first press, so nothing was dropped. Press Accept theirs again if you still want their version.")),v){let c=f("div",["all:initial","display:block","margin:0 16px 12px","padding:8px 10px",`border-left:3px solid ${E}`,`background:color-mix(in srgb, ${E} 14%, transparent)`,`color:${l.ink}`,`font:13px/1.5 ${U}`]);c.append(f("b",["all:initial","font:inherit","font-weight:700","color:inherit"],"This drops your unsaved edits."),document.createTextNode(" Download your copy first if you might want them. Press again to confirm.")),r.append(c)}}else e==="upgraded"?r.append(A("Its layout and code changed with it, so this page stops here. Reload to see the new version.")):e==="failed"?r.append(A("Part of an update from elsewhere could not be applied, so this page may be missing some of it. Your edits here are safe. Download a copy of the page as you had it, or accept to keep the page as it is.")):r.append(A("The page is showing the other edit. This stays until you choose. You can also save a copy of the page as you had it."));let O=f("div",["all:initial","display:flex","flex-wrap:wrap","gap:8px","padding:0 16px 14px"]);if(e==="upgraded")return O.append($("Reload","reload",{variant:"primary",onClick:()=>window.location.reload(),push:!0})),r.append(O),S=[],r;let at=$(ve?"Try again":Y?"Downloaded":"Download my copy","download",{onClick:Bt});if(O.append(at),e==="refused"){let c=$(u==="overwrite"?"Saving\u2026":R?"Try again":"Keep mine","keep",{onClick:Pt});c.setDisabled(u==="overwrite"),O.append(c,$(v?"Yes, drop my edits":"Accept theirs","accept",{variant:"primary",onClick:Ft,push:!0}))}else{if(e==="replaced"){let c=z().hasPendingApply(),N=$(c?"Finishing the incoming edit\u2026":u==="revert"?"Putting back\u2026":"Revert to mine","revert",{onClick:Mt});N.setDisabled(c||u==="revert"),O.append(N)}O.append($("Accept theirs","accept",{variant:"primary",onClick:zt,push:!0}))}if(r.append(O),e==="replaced")if(P)r.append(vt(t));else{let c=f("div",["all:initial","display:flex","align-items:center","gap:8px",`border-top:1px solid ${l.line}`,"padding:8px 10px 8px 16px",`color:${l.muted}`,`font:13px/1.5 ${U}`]),N=f("span",["all:initial","display:inline-flex","margin-left:auto"]);N.append(_(W("See the edits",{small:!0,onClick:et}),"list")),c.append(f("span",["all:initial","font:inherit","color:inherit"],F(t.length,"edit")),N),r.append(c)}S=n.map(c=>c.id);for(let c of t)J.add(c.id);return r}function vt(e){let t=$e(["flex:1 1 auto","margin:0 16px 12px","min-height:0","overflow:auto",`background:${l.sunk}`,`border:1px solid ${l["line-2"]}`]),n=f("div",["all:initial","position:sticky","top:0","z-index:1","display:flex","align-items:center","gap:8px","padding:8px 12px",`background:${l.sunk}`,`border-bottom:1px solid ${l["line-2"]}`,`color:${l.muted}`,`font:600 10.5px/1 ${Z}`,"letter-spacing:.12em","text-transform:uppercase"]),o=f("span",["all:initial","display:inline-flex","margin-left:auto"]);return o.append(_(W("Hide",{small:!0,variant:"quiet",onClick:et}),"list")),n.append(f("span",["all:initial","font:inherit","color:inherit","letter-spacing:inherit","text-transform:inherit"],"Replaced edits"),o),t.append(n),e.forEach((i,a)=>t.append(St(i,a))),B=t,t}function Me(e){let t=e.context?.label||e.name||(e.context?.kind==="entry"?"Entry":"Edit");return e.context?.field?`${t} \xB7 ${e.context.field}`:t}var bt={"content-changed":"the page changed there","structure-changed":"the structure changed there","target-detached":"that part of the page is gone","duplicate-id":"another part of the page now has the same id",protected:"that region keeps its own history",unsupported:"this kind of step cannot be put back"},kt=e=>bt[e]||"the page changed there";function $t(e,t){let n=Array.isArray(e)?e:[];for(let o of n){if(!o||o.kind!=="text"&&o.kind!=="value")continue;let i=t==="redo"?o.after:o.before;if(typeof i=="string"&&i)return{text:i,id:o.target?.id??null}}for(let o of n){if(!o||o.kind!=="add"&&o.kind!=="remove")continue;let i=Array.isArray(o.nodes)?o.nodes.find(a=>typeof a?.html=="string"&&a.html):null;if(i)return{text:Ie(i.html).replace(/\s+/g," ").trim(),id:o.parent?.id??null}}for(let o of n){if(!o)continue;let i=t==="redo"?o.after:o.before;if(typeof i=="string"&&i)return{text:i,id:o.target?.id??null}}return{text:"",id:null}}function Tt(e){if(e==null||typeof document>"u")return"";let t=window.CSS?.escape?window.CSS.escape(String(e)):String(e).replace(/["\\]/g,"\\$&"),n=null;try{n=document.querySelector(`[data-id="${t}"]`)}catch{return""}if(!n)return"";let o=n.matches?.("input, textarea, select")?n.value:null;return(typeof o=="string"?o:n.textContent??"").replace(/\s+/g," ").trim()}function At(e){let t=e?.payload&&typeof e.payload=="object"?e.payload:{},n=String(e?.key??""),o={id:e?.id,revision:e?.revision,record:e,kind:e?.kind??"conflict"};if(n.startsWith("app:"))return{...o,name:typeof t.label=="string"&&t.label?t.label:n.slice(4),sentence:"",yours:typeof t.text=="string"?t.text:"",now:""};let i=t.direction==="redo"?"redo":"undo",g=((Array.isArray(t.context)?t.context:[]).find(X=>typeof X?.label=="string"&&X.label)??null)?.label||typeof t.label=="string"&&t.label||"Edit",K=$t(t.steps,i);return{...o,name:g,sentence:`The ${i} of "${g}" was not applied because ${kt(t.code)}.`,yours:K.text,now:K.id==null?"":Tt(K.id)}}function Ct(e){let t=Le();if(!e.record||typeof t?.reviewActionsFor!="function")return[];try{return(t.reviewActionsFor(e.record)||[]).filter(n=>n&&typeof n.run=="function"&&n.label)}catch{return[]}}var Ge=e=>({before:"",hit:e,after:"",cutBefore:!1,cutAfter:!1});function je(e){let t=p("div",["display:block","padding:8px 12px 10px"]),n=p("div",["display:flex","align-items:center","gap:8px","font-size:12.5px","font-weight:600",`color:${l["ink-2"]}`,"margin-bottom:4px"]);if(n.append(p("span",[],Me(e))),t.append(n),e.sentence&&t.append(p("div",["display:block","font-size:13px",`color:${l["ink-2"]}`],e.sentence)),e.yours){let i=p("div",["display:grid","grid-template-columns:44px 1fr","gap:3px 10px","align-items:start",`font:12.5px/1.5 ${Z}`,...e.sentence?["margin-top:4px"]:[]]);i.append(...he("Yours",Ge(e.yours),{mine:!0})),e.now&&i.append(...he("Now",Ge(e.now),{mine:!1})),t.append(i)}let o=f("div",["all:initial","display:flex","flex-wrap:wrap","gap:8px","margin-top:8px"]);return Ct(e).forEach((i,a)=>{let r=$(i.label,`run:${e.id}:${a}`,{onClick:()=>Nt(e,i,r)});o.append(r)}),o.append($(pe===e.id?"Copied":"Copy",`copy:${e.id}`,{onClick:()=>It(e)})),o.append($("Dismiss",`dismiss:${e.id}`,{onClick:()=>tt(e)})),t.append(o),t}function Et(e){e.append(A(k.length?"These copies were replaced before this page loaded. The page never puts them back on its own. Copy or download the ones you want; dismiss one when you no longer need it.":"These copies were kept because an undo could not be put back or the page set them aside. The page never puts them back on its own. Copy or download the ones you want; dismiss one when you no longer need it.")),oe&&e.append(A("That action did not run. The copy is still here."));let t=$e(["flex:1 1 auto","margin:0 16px 12px","min-height:0","overflow:auto",`background:${l.sunk}`,`border:1px solid ${l["line-2"]}`]);for(let o of k)for(let i of o.conflicts)t.append(je(i));for(let o of x)t.append(je(o));B=t,e.append(t);let n=f("div",["all:initial","display:flex","flex-wrap:wrap","gap:8px","padding:0 16px 14px"]);(k.some(o=>o.root)||x.length)&&n.append($(Y?"Downloaded":"Download my copy","download",{onClick:Ot})),e.append(n),S=[]}function he(e,t,{mine:n}){let o=[p("span",[`color:${l.faint}`,`font-family:${U}`],e)],i=p("span",["display:-webkit-box","-webkit-line-clamp:2","-webkit-box-orient:vertical","overflow:hidden","overflow-wrap:anywhere",...n?[`color:${l.ink}`]:[`color:${l.muted}`]]),a=(t.cutBefore?"\u2026":"")+t.before+t.hit+t.after+(t.cutAfter?"\u2026":"");i.title=a,t.before&&i.append(p("span",[`color:${l.faint}`],(t.cutBefore?"\u2026":"")+t.before));let r=p("span",n?[`background:color-mix(in srgb, ${E} 18%, transparent)`,"padding:0 4px"]:t.before||t.after?["text-decoration:underline",`text-decoration-color:color-mix(in srgb, ${E} 70%, transparent)`,"text-underline-offset:3px"]:[],t.hit||"(empty)");return i.append(r),t.after&&i.append(p("span",[`color:${l.faint}`],t.after+(t.cutAfter?"\u2026":""))),o.push(i),o}function St(e,t){let n=Oe(e),o=p("div",["display:block","padding:8px 12px 10px",...t?[`border-top:1px solid ${l.line}`]:[]]),i=p("div",["display:flex","align-items:center","gap:4px","font-size:12.5px","font-weight:600",`color:${l["ink-2"]}`,"margin-bottom:4px"]);if(i.append(p("span",[],n.name)),n.target&&n.target.isConnected&&i.append(_(Rt(n),`eye:${e.id}`)),o.append(i),n.sentence&&o.append(p("div",["display:block","font-size:13px",`color:${l["ink-2"]}`],n.sentence)),G.has(e.id)&&o.append(p("div",["display:block","font-size:13px","margin-top:4px",`color:${E}`],G.get(e.id))),n.yours){let a=p("div",["display:grid","grid-template-columns:44px 1fr","gap:3px 10px","align-items:start",`font:12.5px/1.5 ${Z}`,...n.sentence?["margin-top:4px"]:[]]);a.append(...he("Yours",n.yours,{mine:!0})),n.now&&a.append(...he("Now",n.now,{mine:!1})),o.append(a)}return o}function Rt(e){let t=["all:initial","color-scheme:inherit","box-sizing:border-box","cursor:pointer","display:inline-grid","place-items:center","width:22px","height:20px",`color:${l.ink}`],n=f("button",t);n.type="button",n.innerHTML=Ye.conflictEye,Ke(n.firstElementChild,16),n.setAttribute("aria-label",`Show ${e.name} on page`),n.title="Show on page";let o=i=>{n.style.cssText="";for(let a of[...t,...i]){let r=a.indexOf(":");n.style.setProperty(a.slice(0,r),a.slice(r+1),"important")}};return n.addEventListener("pointerenter",()=>o([`background:color-mix(in srgb, ${E} 16%, transparent)`])),n.addEventListener("pointerleave",()=>o([])),n.addEventListener("focus",()=>o([`outline:2px solid ${l.brass}`,"outline-offset:1px"])),n.addEventListener("blur",()=>o([])),n.addEventListener("click",()=>Lt(e.target)),n}var C=null,ge=null,me=null;function we(){clearTimeout(ge),window.removeEventListener("scroll",ee,!0),window.removeEventListener("resize",ee),C?.remove(),C=null,me=null}function ee(){if(!C||!me)return;let e=me.getBoundingClientRect();T(C,"left",`${e.left}px`),T(C,"top",`${e.top}px`),T(C,"width",`${e.width}px`),T(C,"height",`${e.height}px`)}function Lt(e){if(we(),!e||!e.isConnected)return;let n=!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches?"instant":"smooth",o=s?.getBoundingClientRect().top??0,i=s&&o>0?Math.max(0,window.innerHeight-o):0;if(!i)e.scrollIntoView?.({block:"center",behavior:n});else{e.scrollIntoView?.({block:"center",behavior:"instant"});let a=e.getBoundingClientRect(),r=window.innerHeight-i,g=a.height>r-24?a.top-12:a.top+a.height/2-r/2;window.scrollBy?.({top:g,behavior:n})}me=e,C=f("div",["all:initial","color-scheme:inherit","position:fixed","pointer-events:none","z-index:2147483001",`outline:2px solid ${E}`,"outline-offset:3px",`background:color-mix(in srgb, ${E} 14%, transparent)`]),document.body.appendChild(C),ee(),window.addEventListener("scroll",ee,!0),window.addEventListener("resize",ee),ge=setTimeout(we,2500)}function Dt(){I||(m="panel",L="title",w())}function Je(){we(),m="bar",y(),L="review",w()}function et(){P=!P,P&&M.clear(),w()}function zt(){let e=z(),t=S.filter(n=>{let o=e?.get(n);return o&&!o.claimedBy});e&&t.length&&e.acknowledge(t,{reason:"accepted"}),m=ze()?"bar":"hidden",L="review",d()}async function Mt(){let e=z();if(u||!e||e.hasPendingApply())return;let t=S.filter(r=>{let g=e.get(r);return g&&!g.claimedBy});if(!t.length)return;u="revert",w();let n=!0,o=r=>{n=!!s?.contains(r.target)};document.addEventListener("focus",o,!0);let i;try{let{revertConflicts:r}=await import("./c-LIBE4HPD.js");i=await r(t)}catch(r){console.error("[clay] Revert to mine did not finish",r),i={revertedIds:[],blockedIds:t,saveResult:null}}finally{document.removeEventListener("focus",o,!0)}u=null;for(let r of i.blockedIds)G.set(r,z()?.get(r)?.kind==="json"?ft:ut);m=ze()?"bar":"hidden",L=n?"review":null;let a=i.saveResult&&(i.saveResult.ok||i.saveResult.msg==="Save already in progress");i.revertedIds.length&&a?be(`Put back ${F(i.revertedIds.length,"change")}. Saving.`):w()}var Q=null;async function Bt(){let e=z(),t=h?e?.list()??[]:S.map(o=>e?.get(o)).filter(Boolean),n=await Pe(t,{refused:!!h});ve=!n,Y=n,clearTimeout(Q),n&&(Q=setTimeout(()=>{Y=!1,d()},1200)),w()}async function H(){let e=null;if(Ae())try{e=await Ve()}catch{e=null}let t=Le(),n=null;if(t)try{n=await t.kept()}catch{n=null}let o=!1;if(e?.ok?(k=e.records,o=!0):!Ae()&&k.length&&(k=[],o=!0),n?.ok){let i=(Array.isArray(n.records)?n.records:[]).filter(r=>r&&r.supported!==!1).map(At);i.length===x.length&&i.every((r,g)=>r.id===x[g].id&&r.revision===x[g].revision)||(o=!0),x=i}else n&&x.length&&(x=[],o=!0);o&&d()}async function _t(e){try{return await navigator.clipboard.writeText(e),!0}catch{}let t=document.createElement("textarea");t.value=e,t.setAttribute("clay",ke),t.style.setProperty("position","fixed","important"),t.style.setProperty("opacity","0","important"),document.body?.append(t),t.select();let n=!1;try{n=document.execCommand?.("copy")===!0}catch{}return t.remove(),n}async function It(e){let t=e.record?e.yours:`${Me(e)}
1
+ import{d as Ae,h as Ve,i as qe}from"./c-TRS6TM6O.js";import{a as Ne,b as Pe}from"./c-CSNE5EIF.js";import{a as Ie,b as Oe}from"./c-PZ4XEPUP.js";import"./c-SFKI6OLM.js";import"./c-Q3XOWZEV.js";import{e as ke,f as Ke,g as W,h as Ue,l as re,m as $e,n as p}from"./c-IHUWUKIU.js";import"./c-4JZDZFF6.js";import{b as U,c as Z,e as l,f as Ye}from"./c-EUGJVHDD.js";import{b as He}from"./c-MHI3GYKF.js";import"./c-RHMPKZZ7.js";import{b as T,c as Fe}from"./c-NUHP2XDB.js";import{a as We,q as V}from"./c-DKFSOJCV.js";import"./c-4ASQPRQL.js";import"./c-GQ6F6IDK.js";import"./c-I2SCCUEW.js";import"./c-5VYOWDTI.js";import{f as Te}from"./c-GSRLXYWL.js";import"./c-X5LNHET5.js";import"./c-WYFDLITL.js";import"./c-UGHH4MB3.js";import"./c-LA2BW7UY.js";import"./c-ZKELCT4T.js";import"./c-ATKAOH23.js";import"./c-EK63G3CG.js";import"./c-NQJRVJ56.js";import"./c-XGH4GS2T.js";import"./c-IJUK2GPW.js";import{f as _e}from"./c-3O7OBDCM.js";import"./c-BPF2NSPV.js";import"./c-P7KNDG34.js";import"./c-CYWLPPUS.js";import"./c-N7JPUPGC.js";import"./c-EGTIAL6P.js";import"./c-XQXZAO7N.js";import"./c-S7LK4KUE.js";import"./c-VG5XIN4T.js";import"./c-2YYDMLNZ.js";import"./c-HA6INT6J.js";import"./c-ICMAOOGK.js";import"./c-WRBKEJD4.js";import"./c-VHNSBD2M.js";var E="light-dark(#D08A1E, #E3A33F)",lt=5e3,st=4e3,dt=500,ct={"another-tab":"in another tab","another-person":"by someone else","an-agent":"by an agent"},pt='<svg viewBox="0 0 12 12" width="12" height="12" aria-hidden="true"><path d="M2.5 9.5h7" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="square"/></svg>',F=(e,t)=>`${e} ${t}${e===1?"":"s"}`,ut="This spot changed again. Review the latest edit or download your copy.",ft="A data value can't be put back from here. Download your copy to keep yours.",m="hidden",P=!1,S=[],J=new Set,M=new Set,h=null,Ee=0,I=null,v=null,le=null,u=null,R=!1,Y=!1,ve=!1,G=new Map,se=0,ae=!1,te=!1,b=null,j=null,L=null,Se=0,D=!1,de=0,ce=null,ne=null,k=[],x=[],oe=!1,pe=null,ue=null,s=null,B=null,q=new Map,z=()=>window.clay?.conflicts||null,Qe=()=>k.reduce((e,t)=>e+t.conflicts.length,0)+x.length,Le=()=>{let e=window.clay?.undo;return e&&typeof e.kept=="function"?e:null},fe=()=>z()?.list().filter(e=>!e.claimedBy&&e.kind!=="apply-incomplete")??[],De=()=>z()?.list().filter(e=>!e.claimedBy&&e.kind==="apply-incomplete")??[];function ze(){return I?"upgraded":h?"refused":fe().length?"replaced":De().length?"failed":k.length||x.length?"recovered":null}function f(e,t,n){let o=Fe(e,t,n);return t[0]==="all:initial"&&T(o,"color-scheme","inherit"),o.setAttribute("clay",ke),o}function _(e,t){return q.set(t,e),e}function ie(){if(!s)return;let e=window.visualViewport,t=e?Math.max(0,window.innerHeight-e.height-e.offsetTop):0;T(s,"bottom",`calc(${16+t}px + env(safe-area-inset-bottom,0px))`),ne&&T(ne,"max-height",`${Math.max(160,(e?.height||window.innerHeight)-32)}px`)}function ht(){s=f("div",["all:initial","position:fixed","left:50%","transform:translateX(-50%)","z-index:2147483001","display:none","flex-direction:column","align-items:center","max-width:calc(100vw - 24px)",`font:14px/1.5 ${U}`,`color:${l.ink}`,"text-align:left"]),s.setAttribute("data-clay-conflict",""),document.body.appendChild(s),window.visualViewport?.addEventListener("resize",ie),window.visualViewport?.addEventListener("scroll",ie)}function d(){if(ae)return;ae=!0;let e=()=>{ae=!1,w()};typeof requestAnimationFrame=="function"?requestAnimationFrame(e):setTimeout(e,16)}function w(){te&&(te=!1,h&&!V()&&(h=null));let e=ze();if(e?m==="hidden"&&(m="bar"):(m="hidden",P=!1,J.clear(),M.clear(),S=[],y(),ce=null,D=!1),!s){if(m==="hidden"&&!b||!document.body)return;ht()}!s.isConnected&&document.body&&document.body.appendChild(s);let t=document.activeElement,n=null;for(let[a,r]of q)r===t&&(n=a);let o=B?B.scrollTop:0;q=new Map,B=null,ne=null,s.replaceChildren(),b?s.append(wt(b)):m==="bar"?s.append(yt(e)):m==="panel"&&s.append(xt(e)),T(s,"display",b||m!=="hidden"?"flex":"none"),B&&(B.scrollTop=o);let i=L||n;i&&q.has(i)&&q.get(i).focus({preventScroll:!0}),b||(L=null),ie(),He(s)}function Xe(){return f("span",["all:initial","display:inline-block","flex:none","width:8px","height:8px","border-radius:50%",`background:${E}`])}function Ze(){return ct[h?.changedBy]||null}function gt(e,t){if(e==="upgraded")return I;if(e==="refused"){let n=Ze();return!n&&h.afterTimeout?"This page changed elsewhere, possibly by your own save that timed out. Your edits here are safe.":`This page changed ${n||"elsewhere"}. Your edits here are safe.`}return e==="failed"?"A sync update did not finish. Your edits here are safe.":e==="recovered"?`${F(t,"change")} replaced before this page loaded ${t===1?"is":"are"} still here.`:`Another edit replaced ${F(t,"change")}.`}function mt(e,t){return e==="upgraded"?I:e==="refused"?`This page changed ${Ze()||"elsewhere"}`:e==="failed"?"A sync update did not finish":e==="recovered"?`${F(t,"change")} kept from before this page loaded`:`Another edit replaced ${F(t,"change")}`}function wt(e){let t=re("div",["display:block",`border-left:3px solid ${l.teal}`,"padding:10px 14px","width:max-content","max-width:calc(100vw - 24px)"]);return t.setAttribute("role","status"),t.textContent=e,t}function yt(e){let t=e==="failed"?De().length:e==="recovered"?Qe():fe().length,n=re("div",["display:flex","flex-wrap:wrap","align-items:center","gap:10px 12px","padding:8px 8px 8px 14px","width:max-content","max-width:calc(100vw - 24px)"]),o=gt(e,t);return o!==ce&&(n.setAttribute("role",e==="refused"?"alert":"status"),ce=o),n.append(Xe(),p("span",[],o)),e==="upgraded"?(n.append(_(W("Reload",{variant:"primary",onClick:()=>window.location.reload()}),"reload")),n):(n.append(_(W("Review",{onClick:Dt}),"review")),n)}function $(e,t,{variant:n="default",onClick:o,push:i=!1}={}){let r=window.innerWidth<480?["flex:1 1 100%",...n==="primary"?["order:-1"]:[]]:i?["margin-left:auto"]:[];return _(W(e,{variant:n,onClick:o,extra:r}),t)}function A(e){return p("div",["display:block","padding:0 16px 12px",`color:${l["ink-2"]}`,"font-size:13.5px"],e)}function xt(e){let t=e==="replaced"?fe():e==="failed"?De():[],n=e==="refused"?fe():t,o=e==="recovered"?Qe():t.length;if(J.size)for(let c of t)J.has(c.id)||M.add(c.id);for(let c of[...M])t.some(N=>N.id===c)||M.delete(c);let i=mt(e,o),a=Math.max(160,(window.visualViewport?.height||window.innerHeight)-32),r=re("div",["display:flex","flex-direction:column","width:520px","max-width:calc(100vw - 24px)",`max-height:${a}px`]);ne=r,r.setAttribute("role","dialog"),r.setAttribute("aria-label",i);let g=f("div",["all:initial","display:flex","align-items:center","gap:8px","padding:12px 12px 8px 16px",`font:14px/1.5 ${U}`,`color:${l.ink}`]),K=_(p("b",["font-weight:600","font-size:14.5px","outline:none"],i),"title");K.setAttribute("tabindex","-1"),g.append(Xe(),K),e==="replaced"&&M.size&&g.append(p("span",[`font:600 10.5px/1 ${Z}`,"letter-spacing:.12em","text-transform:uppercase","padding:3px 6px",`color:color-mix(in srgb, ${l.brass} 80%, ${l.ink})`,`background:${l["brass-soft"]}`],`${M.size} new`));let X=f("span",["all:initial","display:inline-flex","margin-left:auto"]),Be=_(Ue(pt,{label:"Minimize",onClick:Je}),"minimize");if(Be.title="Minimize to the bar. Nothing is accepted until you choose.",X.append(Be),g.append(X),r.append(g),e==="recovered")return Et(r),r;if(e==="refused"){if(r.append(A("Your edits here are safe and not saved yet; nothing will be overwritten until you choose. Their version is not on this page, so there is no list of edits to compare. Keep yours, which saves over theirs, or accept theirs, which reloads the page and drops your unsaved edits.")),n.length&&r.append(A(`${F(n.length,"earlier replaced edit")} ${n.length===1?"is":"are"} also held in this tab. Download my copy includes them.`)),R&&r.append(A("That did not save either. Your edits here are still here.")),D&&r.append(A("Something changed on the page after your first press, so nothing was dropped. Press Accept theirs again if you still want their version.")),v){let c=f("div",["all:initial","display:block","margin:0 16px 12px","padding:8px 10px",`border-left:3px solid ${E}`,`background:color-mix(in srgb, ${E} 14%, transparent)`,`color:${l.ink}`,`font:13px/1.5 ${U}`]);c.append(f("b",["all:initial","font:inherit","font-weight:700","color:inherit"],"This drops your unsaved edits."),document.createTextNode(" Download your copy first if you might want them. Press again to confirm.")),r.append(c)}}else e==="upgraded"?r.append(A("Its layout and code changed with it, so this page stops here. Reload to see the new version.")):e==="failed"?r.append(A("Part of an update from elsewhere could not be applied, so this page may be missing some of it. Your edits here are safe. Download a copy of the page as you had it, or accept to keep the page as it is.")):r.append(A("The page is showing the other edit. This stays until you choose. You can also save a copy of the page as you had it."));let O=f("div",["all:initial","display:flex","flex-wrap:wrap","gap:8px","padding:0 16px 14px"]);if(e==="upgraded")return O.append($("Reload","reload",{variant:"primary",onClick:()=>window.location.reload(),push:!0})),r.append(O),S=[],r;let at=$(ve?"Try again":Y?"Downloaded":"Download my copy","download",{onClick:Bt});if(O.append(at),e==="refused"){let c=$(u==="overwrite"?"Saving\u2026":R?"Try again":"Keep mine","keep",{onClick:Pt});c.setDisabled(u==="overwrite"),O.append(c,$(v?"Yes, drop my edits":"Accept theirs","accept",{variant:"primary",onClick:Ft,push:!0}))}else{if(e==="replaced"){let c=z().hasPendingApply(),N=$(c?"Finishing the incoming edit\u2026":u==="revert"?"Putting back\u2026":"Revert to mine","revert",{onClick:Mt});N.setDisabled(c||u==="revert"),O.append(N)}O.append($("Accept theirs","accept",{variant:"primary",onClick:zt,push:!0}))}if(r.append(O),e==="replaced")if(P)r.append(vt(t));else{let c=f("div",["all:initial","display:flex","align-items:center","gap:8px",`border-top:1px solid ${l.line}`,"padding:8px 10px 8px 16px",`color:${l.muted}`,`font:13px/1.5 ${U}`]),N=f("span",["all:initial","display:inline-flex","margin-left:auto"]);N.append(_(W("See the edits",{small:!0,onClick:et}),"list")),c.append(f("span",["all:initial","font:inherit","color:inherit"],F(t.length,"edit")),N),r.append(c)}S=n.map(c=>c.id);for(let c of t)J.add(c.id);return r}function vt(e){let t=$e(["flex:1 1 auto","margin:0 16px 12px","min-height:0","overflow:auto",`background:${l.sunk}`,`border:1px solid ${l["line-2"]}`]),n=f("div",["all:initial","position:sticky","top:0","z-index:1","display:flex","align-items:center","gap:8px","padding:8px 12px",`background:${l.sunk}`,`border-bottom:1px solid ${l["line-2"]}`,`color:${l.muted}`,`font:600 10.5px/1 ${Z}`,"letter-spacing:.12em","text-transform:uppercase"]),o=f("span",["all:initial","display:inline-flex","margin-left:auto"]);return o.append(_(W("Hide",{small:!0,variant:"quiet",onClick:et}),"list")),n.append(f("span",["all:initial","font:inherit","color:inherit","letter-spacing:inherit","text-transform:inherit"],"Replaced edits"),o),t.append(n),e.forEach((i,a)=>t.append(St(i,a))),B=t,t}function Me(e){let t=e.context?.label||e.name||(e.context?.kind==="entry"?"Entry":"Edit");return e.context?.field?`${t} \xB7 ${e.context.field}`:t}var bt={"content-changed":"the page changed there","structure-changed":"the structure changed there","target-detached":"that part of the page is gone","duplicate-id":"another part of the page now has the same id",protected:"that region keeps its own history",unsupported:"this kind of step cannot be put back"},kt=e=>bt[e]||"the page changed there";function $t(e,t){let n=Array.isArray(e)?e:[];for(let o of n){if(!o||o.kind!=="text"&&o.kind!=="value")continue;let i=t==="redo"?o.after:o.before;if(typeof i=="string"&&i)return{text:i,id:o.target?.id??null}}for(let o of n){if(!o||o.kind!=="add"&&o.kind!=="remove")continue;let i=Array.isArray(o.nodes)?o.nodes.find(a=>typeof a?.html=="string"&&a.html):null;if(i)return{text:Ie(i.html).replace(/\s+/g," ").trim(),id:o.parent?.id??null}}for(let o of n){if(!o)continue;let i=t==="redo"?o.after:o.before;if(typeof i=="string"&&i)return{text:i,id:o.target?.id??null}}return{text:"",id:null}}function Tt(e){if(e==null||typeof document>"u")return"";let t=window.CSS?.escape?window.CSS.escape(String(e)):String(e).replace(/["\\]/g,"\\$&"),n=null;try{n=document.querySelector(`[data-id="${t}"]`)}catch{return""}if(!n)return"";let o=n.matches?.("input, textarea, select")?n.value:null;return(typeof o=="string"?o:n.textContent??"").replace(/\s+/g," ").trim()}function At(e){let t=e?.payload&&typeof e.payload=="object"?e.payload:{},n=String(e?.key??""),o={id:e?.id,revision:e?.revision,record:e,kind:e?.kind??"conflict"};if(n.startsWith("app:"))return{...o,name:typeof t.label=="string"&&t.label?t.label:n.slice(4),sentence:"",yours:typeof t.text=="string"?t.text:"",now:""};let i=t.direction==="redo"?"redo":"undo",g=((Array.isArray(t.context)?t.context:[]).find(X=>typeof X?.label=="string"&&X.label)??null)?.label||typeof t.label=="string"&&t.label||"Edit",K=$t(t.steps,i);return{...o,name:g,sentence:`The ${i} of "${g}" was not applied because ${kt(t.code)}.`,yours:K.text,now:K.id==null?"":Tt(K.id)}}function Ct(e){let t=Le();if(!e.record||typeof t?.reviewActionsFor!="function")return[];try{return(t.reviewActionsFor(e.record)||[]).filter(n=>n&&typeof n.run=="function"&&n.label)}catch{return[]}}var Ge=e=>({before:"",hit:e,after:"",cutBefore:!1,cutAfter:!1});function je(e){let t=p("div",["display:block","padding:8px 12px 10px"]),n=p("div",["display:flex","align-items:center","gap:8px","font-size:12.5px","font-weight:600",`color:${l["ink-2"]}`,"margin-bottom:4px"]);if(n.append(p("span",[],Me(e))),t.append(n),e.sentence&&t.append(p("div",["display:block","font-size:13px",`color:${l["ink-2"]}`],e.sentence)),e.yours){let i=p("div",["display:grid","grid-template-columns:44px 1fr","gap:3px 10px","align-items:start",`font:12.5px/1.5 ${Z}`,...e.sentence?["margin-top:4px"]:[]]);i.append(...he("Yours",Ge(e.yours),{mine:!0})),e.now&&i.append(...he("Now",Ge(e.now),{mine:!1})),t.append(i)}let o=f("div",["all:initial","display:flex","flex-wrap:wrap","gap:8px","margin-top:8px"]);return Ct(e).forEach((i,a)=>{let r=$(i.label,`run:${e.id}:${a}`,{onClick:()=>Nt(e,i,r)});o.append(r)}),o.append($(pe===e.id?"Copied":"Copy",`copy:${e.id}`,{onClick:()=>It(e)})),o.append($("Dismiss",`dismiss:${e.id}`,{onClick:()=>tt(e)})),t.append(o),t}function Et(e){e.append(A(k.length?"These copies were replaced before this page loaded. The page never puts them back on its own. Copy or download the ones you want; dismiss one when you no longer need it.":"These copies were kept because an undo could not be put back or the page set them aside. The page never puts them back on its own. Copy or download the ones you want; dismiss one when you no longer need it.")),oe&&e.append(A("That action did not run. The copy is still here."));let t=$e(["flex:1 1 auto","margin:0 16px 12px","min-height:0","overflow:auto",`background:${l.sunk}`,`border:1px solid ${l["line-2"]}`]);for(let o of k)for(let i of o.conflicts)t.append(je(i));for(let o of x)t.append(je(o));B=t,e.append(t);let n=f("div",["all:initial","display:flex","flex-wrap:wrap","gap:8px","padding:0 16px 14px"]);(k.some(o=>o.root)||x.length)&&n.append($(Y?"Downloaded":"Download my copy","download",{onClick:Ot})),e.append(n),S=[]}function he(e,t,{mine:n}){let o=[p("span",[`color:${l.faint}`,`font-family:${U}`],e)],i=p("span",["display:-webkit-box","-webkit-line-clamp:2","-webkit-box-orient:vertical","overflow:hidden","overflow-wrap:anywhere",...n?[`color:${l.ink}`]:[`color:${l.muted}`]]),a=(t.cutBefore?"\u2026":"")+t.before+t.hit+t.after+(t.cutAfter?"\u2026":"");i.title=a,t.before&&i.append(p("span",[`color:${l.faint}`],(t.cutBefore?"\u2026":"")+t.before));let r=p("span",n?[`background:color-mix(in srgb, ${E} 18%, transparent)`,"padding:0 4px"]:t.before||t.after?["text-decoration:underline",`text-decoration-color:color-mix(in srgb, ${E} 70%, transparent)`,"text-underline-offset:3px"]:[],t.hit||"(empty)");return i.append(r),t.after&&i.append(p("span",[`color:${l.faint}`],t.after+(t.cutAfter?"\u2026":""))),o.push(i),o}function St(e,t){let n=Oe(e),o=p("div",["display:block","padding:8px 12px 10px",...t?[`border-top:1px solid ${l.line}`]:[]]),i=p("div",["display:flex","align-items:center","gap:4px","font-size:12.5px","font-weight:600",`color:${l["ink-2"]}`,"margin-bottom:4px"]);if(i.append(p("span",[],n.name)),n.target&&n.target.isConnected&&i.append(_(Rt(n),`eye:${e.id}`)),o.append(i),n.sentence&&o.append(p("div",["display:block","font-size:13px",`color:${l["ink-2"]}`],n.sentence)),G.has(e.id)&&o.append(p("div",["display:block","font-size:13px","margin-top:4px",`color:${E}`],G.get(e.id))),n.yours){let a=p("div",["display:grid","grid-template-columns:44px 1fr","gap:3px 10px","align-items:start",`font:12.5px/1.5 ${Z}`,...n.sentence?["margin-top:4px"]:[]]);a.append(...he("Yours",n.yours,{mine:!0})),n.now&&a.append(...he("Now",n.now,{mine:!1})),o.append(a)}return o}function Rt(e){let t=["all:initial","color-scheme:inherit","box-sizing:border-box","cursor:pointer","display:inline-grid","place-items:center","width:22px","height:20px",`color:${l.ink}`],n=f("button",t);n.type="button",n.innerHTML=Ye.conflictEye,Ke(n.firstElementChild,16),n.setAttribute("aria-label",`Show ${e.name} on page`),n.title="Show on page";let o=i=>{n.style.cssText="";for(let a of[...t,...i]){let r=a.indexOf(":");n.style.setProperty(a.slice(0,r),a.slice(r+1),"important")}};return n.addEventListener("pointerenter",()=>o([`background:color-mix(in srgb, ${E} 16%, transparent)`])),n.addEventListener("pointerleave",()=>o([])),n.addEventListener("focus",()=>o([`outline:2px solid ${l.brass}`,"outline-offset:1px"])),n.addEventListener("blur",()=>o([])),n.addEventListener("click",()=>Lt(e.target)),n}var C=null,ge=null,me=null;function we(){clearTimeout(ge),window.removeEventListener("scroll",ee,!0),window.removeEventListener("resize",ee),C?.remove(),C=null,me=null}function ee(){if(!C||!me)return;let e=me.getBoundingClientRect();T(C,"left",`${e.left}px`),T(C,"top",`${e.top}px`),T(C,"width",`${e.width}px`),T(C,"height",`${e.height}px`)}function Lt(e){if(we(),!e||!e.isConnected)return;let n=!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches?"instant":"smooth",o=s?.getBoundingClientRect().top??0,i=s&&o>0?Math.max(0,window.innerHeight-o):0;if(!i)e.scrollIntoView?.({block:"center",behavior:n});else{e.scrollIntoView?.({block:"center",behavior:"instant"});let a=e.getBoundingClientRect(),r=window.innerHeight-i,g=a.height>r-24?a.top-12:a.top+a.height/2-r/2;window.scrollBy?.({top:g,behavior:n})}me=e,C=f("div",["all:initial","color-scheme:inherit","position:fixed","pointer-events:none","z-index:2147483001",`outline:2px solid ${E}`,"outline-offset:3px",`background:color-mix(in srgb, ${E} 14%, transparent)`]),document.body.appendChild(C),ee(),window.addEventListener("scroll",ee,!0),window.addEventListener("resize",ee),ge=setTimeout(we,2500)}function Dt(){I||(m="panel",L="title",w())}function Je(){we(),m="bar",y(),L="review",w()}function et(){P=!P,P&&M.clear(),w()}function zt(){let e=z(),t=S.filter(n=>{let o=e?.get(n);return o&&!o.claimedBy});e&&t.length&&e.acknowledge(t,{reason:"accepted"}),m=ze()?"bar":"hidden",L="review",d()}async function Mt(){let e=z();if(u||!e||e.hasPendingApply())return;let t=S.filter(r=>{let g=e.get(r);return g&&!g.claimedBy});if(!t.length)return;u="revert",w();let n=!0,o=r=>{n=!!s?.contains(r.target)};document.addEventListener("focus",o,!0);let i;try{let{revertConflicts:r}=await import("./c-DZBZ57EE.js");i=await r(t)}catch(r){console.error("[clay] Revert to mine did not finish",r),i={revertedIds:[],blockedIds:t,saveResult:null}}finally{document.removeEventListener("focus",o,!0)}u=null;for(let r of i.blockedIds)G.set(r,z()?.get(r)?.kind==="json"?ft:ut);m=ze()?"bar":"hidden",L=n?"review":null;let a=i.saveResult&&(i.saveResult.ok||i.saveResult.msg==="Save already in progress");i.revertedIds.length&&a?be(`Put back ${F(i.revertedIds.length,"change")}. Saving.`):w()}var Q=null;async function Bt(){let e=z(),t=h?e?.list()??[]:S.map(o=>e?.get(o)).filter(Boolean),n=await Pe(t,{refused:!!h});ve=!n,Y=n,clearTimeout(Q),n&&(Q=setTimeout(()=>{Y=!1,d()},1200)),w()}async function H(){let e=null;if(Ae())try{e=await Ve()}catch{e=null}let t=Le(),n=null;if(t)try{n=await t.kept()}catch{n=null}let o=!1;if(e?.ok?(k=e.records,o=!0):!Ae()&&k.length&&(k=[],o=!0),n?.ok){let i=(Array.isArray(n.records)?n.records:[]).filter(r=>r&&r.supported!==!1).map(At);i.length===x.length&&i.every((r,g)=>r.id===x[g].id&&r.revision===x[g].revision)||(o=!0),x=i}else n&&x.length&&(x=[],o=!0);o&&d()}async function _t(e){try{return await navigator.clipboard.writeText(e),!0}catch{}let t=document.createElement("textarea");t.value=e,t.setAttribute("clay",ke),t.style.setProperty("position","fixed","important"),t.style.setProperty("opacity","0","important"),document.body?.append(t),t.select();let n=!1;try{n=document.execCommand?.("copy")===!0}catch{}return t.remove(),n}async function It(e){let t=e.record?e.yours:`${Me(e)}
2
2
 
3
3
  Yours:
4
4
  ${e.yours}
@@ -1 +1 @@
1
- import{e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p}from"./c-BJ7YQ5QZ.js";import{a}from"./c-4JZDZFF6.js";import"./c-VAK7SG37.js";import{a as b,b as c}from"./c-MHI3GYKF.js";import"./c-NUHP2XDB.js";import"./c-VHNSBD2M.js";export{d as RUNTIME_ONLY,i as bevelBox,f as bevelButton,h as bevelCornerClose,g as bevelIconButton,o as bevelInput,k as bevelSurface,m as bevelText,l as bevelWell,a as pageScheme,n as paintInput,c as paintLook,e as protectIcon,j as restyleBox,p as setShown,b as uiLook};
1
+ import{e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p}from"./c-IHUWUKIU.js";import{a}from"./c-4JZDZFF6.js";import"./c-EUGJVHDD.js";import{a as b,b as c}from"./c-MHI3GYKF.js";import"./c-NUHP2XDB.js";import"./c-VHNSBD2M.js";export{d as RUNTIME_ONLY,i as bevelBox,f as bevelButton,h as bevelCornerClose,g as bevelIconButton,o as bevelInput,k as bevelSurface,m as bevelText,l as bevelWell,a as pageScheme,n as paintInput,c as paintLook,e as protectIcon,j as restyleBox,p as setShown,b as uiLook};
@@ -1 +1 @@
1
- import{d as A,e as I}from"./c-XGH4GS2T.js";import{f as b,j as T}from"./c-3O7OBDCM.js";import{c as M}from"./c-BPF2NSPV.js";var B=15e3,P=12e4,K=15e3,V=4e3,W=5e3,U=50,y=new Set(["sent","acked"]),R=new Set(["done","error","cancelled"]),j="wire",a=new Map,k=new Set,f=null,g=null,D=0,h=null;function Q(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`page-${Date.now()}-${Math.random().toString(16).slice(2)}`}function H(e){return new URL(e,window.location.origin).href}function N(){let e=M();return typeof e=="string"&&e!==""?e:null}function w(e){return{id:e.id,type:e.type,state:e.state,helper:e.helper,text:e.text,result:e.result,error:e.error,errorCode:e.errorCode,errorDetails:e.errorDetails,errorSource:e.errorSource,startedAt:e.startedAt}}function m(e,t){let n=w(e);for(let r of k)try{r(n,t||null)}catch(s){console.error("clay.wire: a listener threw",s)}document.dispatchEvent(new CustomEvent("clay:wire-state",{detail:n}))}function Y(e,t){e.state!==t&&(e.state=t,m(e))}function v(e,t,n,{cancelFirst:r=!1,errorCode:s=null}={}){clearTimeout(e.timer),e.timer=setTimeout(()=>{e.timer=null,r&&z(e),l(e,"error",n,{errorCode:s,errorSource:"client"})},t)}function q(e){clearTimeout(e.timer),e.timer=null}function Z(){if(!(a.size<=U))for(let[e,t]of a){if(a.size<=U)break;!y.has(t.state)&&t.state!=="landing"&&a.delete(e)}}function ee(){if(g)return g;let e=N(),t=`/_/wire/subscribe?page-url=${encodeURIComponent(window.location.href)}`+(e?`&token=${encodeURIComponent(e)}`:"");return f=new EventSource(H(t)),f.onmessage=n=>{let r;try{r=JSON.parse(n.data)}catch{return}te(r)},f.onerror=()=>{},g=new Promise(n=>{let r=!1,s=()=>{r||(r=!0,n())};f.onopen=s,setTimeout(s,2e3)}),g}function L(){for(let e of a.values())if(y.has(e.state))return;f&&(f.close(),f=null,g=null)}function te(e){if(!e||typeof e.id!="string")return;let t=a.get(e.id);if(!(!t||!y.has(t.state)))switch(e.type){case"wire/ack":e.payload?.mode==="jsonl"&&Number.isFinite(e.payload.budgetMs)&&e.payload.budgetMs>0?(t.structured=!0,v(t,e.payload.budgetMs+K,"the helper did not finish within its execution budget",{cancelFirst:!0,errorCode:"helper_timeout"})):v(t,P,"the agent stopped responding"),Y(t,"acked");break;case"wire/status":t.structured||v(t,P,"the agent stopped responding"),t.text=typeof e.text=="string"?e.text:"",t.state="acked",ne(t,e),m(t,e);break;case"wire/done":t.result=Object.prototype.hasOwnProperty.call(e,"payload")?e.payload:null,t.document==="edit"?ie(t):l(t,"done",null);break;case"wire/error":re(t,e);break;default:break}}function ne(e,t){if(!e.onStatus||typeof t.text!="string")return;let n={text:t.text};t.payload&&typeof t.payload=="object"&&Object.prototype.hasOwnProperty.call(t.payload,"progress")&&(n.progress=t.payload.progress);try{e.onStatus(n)}catch(r){console.error("clay.wire: an onStatus listener threw",r)}}function re(e,t){let n=t.payload,r=n&&typeof n=="object"&&!Array.isArray(n)&&(n.source==="application"||n.source==="host")&&typeof n.code=="string"&&n.code,s=typeof t.text=="string"&&t.text?t.text:"the handler reported an error";if(!r){l(e,"error",s);return}let i=n.source==="host"&&n.code==="helper_cancelled"?"cancelled":"error";l(e,i,s,{errorCode:n.code,errorDetails:Object.prototype.hasOwnProperty.call(n,"details")?n.details:null,errorSource:n.source})}function oe(){h||(h=e=>{if(e.detail?.source!=="peer"){for(let t of a.values())if(t.state==="landing"){l(t,"done",null);return}}},document.addEventListener("clay:sync-applied",h))}function se(){D>0||!h||(document.removeEventListener("clay:sync-applied",h),h=null)}function ie(e){R.has(e.state)||e.state==="landing"||(q(e),e.state="landing",D++,oe(),e.landingTimer=setTimeout(()=>{l(e,"done",null)},V),m(e),L())}function l(e,t,n,r={}){if(R.has(e.state))return;let s=e.state==="landing";if(q(e),clearTimeout(e.landingTimer),e.landingTimer=null,e.abort?.abort(),s&&(D--,se()),e.error=n,Object.prototype.hasOwnProperty.call(r,"errorCode")&&(e.errorCode=r.errorCode),Object.prototype.hasOwnProperty.call(r,"errorDetails")&&(e.errorDetails=r.errorDetails),Object.prototype.hasOwnProperty.call(r,"errorSource")&&(e.errorSource=r.errorSource),e.state=t,e.signal&&e.signalHandler&&(e.signal.removeEventListener("abort",e.signalHandler),e.signalHandler=null),ue(e),m(e),L(),Z(),e.settle){let i=e.settle;e.settle=null,i(w(e))}}var C=0,$=null,E=null;function ae(){return E||(E=import("./core/save-AOJBDSOK.js")),E}async function le(e){if(!b||e.holdsSave)return;let t=await ae();e.state==="sent"&&($=t,e.holdsSave=!0,!(C++>0)&&t.suspendAutosave())}function ue(e){e.holdsSave&&(e.holdsSave=!1,!(--C>0)&&(C=0,$?.resumeAutosave()))}var c=null,de=()=>!c||c.admitted,ce=(e,t,n)=>Object.assign(new Error(`clay.wire: ${e}`),{code:t,pending:n});function O(e){return e.document!=="edit"||e.generation===T().generation&&de()?!0:(l(e,"error","the page changed mode before this request went out",{errorCode:"stale-document",errorSource:"client"}),!1)}function _e(){return{id:"clay:wire",order:900,prepare(e={}){let t={admitted:e.initial===!0};return c=t,{enable(){c===t&&(t.admitted=!0)},quiesce(){if(c!==t)return;t.admitted=!1;let n=[...a.values()].filter(r=>r.document==="edit"&&(r.holdsSave||y.has(r.state))).map(r=>r.id);if(n.length)throw ce("a request on this page has not settled","pending-input",n)},resume(){c===t&&(t.admitted=!0)},dispose(){c===t&&(c=null)}}}}}function fe(e,t){return new Promise(n=>{let r=!1,s=()=>{r||(r=!0,document.removeEventListener(e,s),n())};document.addEventListener(e,s),setTimeout(s,t)})}async function pe(){if(!b)return;let e=window.clay;if(!e||typeof e.save!="function")return;let{isSaveInProgress:t}=await import("./core/save-core-IOCMXO5L.js"),{savesHeld:n,saveHoldReason:r}=await import("./core/save-AOJBDSOK.js");if(n())throw new Error(r());let s=Date.now()+W;for(let i=0;i<3;i++){t()&&await fe("clay:save-saved",Math.max(0,s-Date.now()));let u=await e.save();if(u?.ok||u?.msgType==="skipped"&&!t())return;if(u?.msgType==="error"||u?.msgType==="unknown")throw new Error(`could not save this page first: ${u.msg||u.msgType}`);if(Date.now()>=s)break}throw new Error("could not save this page before sending")}async function F(e,t){let n={"Content-Type":"application/json","Page-URL":window.location.href},r=N();r&&(n["Save-Token"]=r);let s=await fetch(H("/_/wire/send"),{method:"POST",headers:n,body:JSON.stringify(e),signal:t}),i=null;try{i=await s.json()}catch{i=null}return{ok:s.ok,status:s.status,reply:i}}function he(e,t={}){let n=typeof t.id=="string"&&t.id?t.id:Q(),r=typeof t.type=="string"&&t.type?t.type:"wire/request",s=Object.prototype.hasOwnProperty.call(t,"helper"),i=s&&typeof t.helper=="string"&&t.helper?t.helper:null,u=t.document===void 0?i?"none":"edit":t.document;if(s&&!i)return _(n,r,null,"helper must be a nonempty string","invalid_helper");if(u!=="edit"&&u!=="none")return _(n,r,i,'document must be "edit" or "none"',"invalid_document");if(a.has(n))return _(n,r,i,"a request with this id is already on the wire","duplicate_request");let o={id:n,type:r,state:"sent",helper:i,document:u,structured:!1,onStatus:typeof t.onStatus=="function"?t.onStatus:null,text:"",result:null,error:null,errorCode:null,errorDetails:null,errorSource:null,startedAt:Date.now(),timer:null,landingTimer:null,abort:typeof AbortController=="function"?new AbortController:null,holdsSave:!1,generation:T().generation,settle:null,signal:t.signal&&typeof t.signal.addEventListener=="function"?t.signal:null,signalHandler:null};return o.done=new Promise(d=>{o.settle=d}),a.set(n,o),m(o),o.signal&&(o.signalHandler=()=>x(n),o.signal.addEventListener("abort",o.signalHandler,{once:!0}),o.signal.aborted&&o.signalHandler()),(async()=>{if(o.state!=="sent")return;if(o.helper){let X=await I(j);if(o.state!=="sent")return;if(!X){l(o,"error","this host does not support named wire helpers",{errorCode:"helper_protocol_unsupported",errorSource:"client"});return}}if(!O(o)||o.document==="edit"&&(await le(o),o.state!=="sent"||!O(o)||(await pe(),o.state!=="sent")||!O(o)))return;if(await ee(),o.state!=="sent"){L();return}v(o,B,"the agent never answered",o.helper?{cancelFirst:!0,errorCode:"ack_timeout"}:void 0);let d={type:o.type,id:o.id,text:t.text,payload:e};o.helper&&(d.helper=o.helper),(o.helper||t.document!==void 0)&&(d.document=o.document);let{ok:G,status:J,reply:S}=await F(d,o.abort?.signal);if(o.state!=="sent")return;if(!G){l(o,"error",`the wire refused this request (${J})`);return}let p=S&&S.refused;if(p&&typeof p.code=="string"&&p.code){l(o,"error",p.message||"the handler refused this request",{errorCode:p.code,errorSource:p.source==="application"?"application":"host",errorDetails:null});return}(!S||S.delivered===0)&&l(o,"error",o.helper?`The local program "${o.helper}" is not connected to this file.`:"No program is connected to this file.")})().catch(d=>{l(o,"error",d&&d.message?d.message:String(d))}),{id:n,get state(){return o.state},done:o.done,cancel:()=>x(n)}}function _(e,t,n,r,s){let i={id:e,type:t,state:"error",helper:n,text:"",result:null,error:r,errorCode:s,errorDetails:null,errorSource:"client",startedAt:Date.now()};return{id:e,get state(){return i.state},done:Promise.resolve(w(i)),cancel:()=>!1}}function x(e){let t=a.get(e);return!t||!y.has(t.state)?!1:(z(t),l(t,"cancelled",null),!0)}function z(e){F({type:"wire/cancel",id:e.id}).catch(()=>{})}function ye(e){let t=a.get(e);return t?w(t):void 0}function ge(){return[...a.values()].map(w)}function we(){for(let e of a.values())if(y.has(e.state))return!0;return!1}function me(e){return typeof e!="function"?()=>{}:(k.add(e),()=>k.delete(e))}async function Se(){let e=await A({fresh:!0});if(!e.extensions.includes(j))return[];let t=e.document?.helpers;return Array.isArray(t)?t.filter(n=>n&&typeof n.name=="string"&&["ready","denied","unavailable"].includes(n.state)).map(({name:n,state:r})=>({name:n,state:r})):[]}var ve={send:he,cancel:x,get:ye,list:ge,isBusy:we,on:me,helpers:Se},ke=ve;export{_e as a,ve as b,ke as c};
1
+ import{d as A,e as I}from"./c-XGH4GS2T.js";import{f as b,j as T}from"./c-3O7OBDCM.js";import{c as M}from"./c-BPF2NSPV.js";var B=15e3,P=12e4,K=15e3,V=4e3,W=5e3,U=50,y=new Set(["sent","acked"]),R=new Set(["done","error","cancelled"]),j="wire",a=new Map,k=new Set,f=null,g=null,D=0,h=null;function Q(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`page-${Date.now()}-${Math.random().toString(16).slice(2)}`}function H(e){return new URL(e,window.location.origin).href}function N(){let e=M();return typeof e=="string"&&e!==""?e:null}function w(e){return{id:e.id,type:e.type,state:e.state,helper:e.helper,text:e.text,result:e.result,error:e.error,errorCode:e.errorCode,errorDetails:e.errorDetails,errorSource:e.errorSource,startedAt:e.startedAt}}function m(e,t){let n=w(e);for(let r of k)try{r(n,t||null)}catch(s){console.error("clay.wire: a listener threw",s)}document.dispatchEvent(new CustomEvent("clay:wire-state",{detail:n}))}function Y(e,t){e.state!==t&&(e.state=t,m(e))}function v(e,t,n,{cancelFirst:r=!1,errorCode:s=null}={}){clearTimeout(e.timer),e.timer=setTimeout(()=>{e.timer=null,r&&z(e),l(e,"error",n,{errorCode:s,errorSource:"client"})},t)}function q(e){clearTimeout(e.timer),e.timer=null}function Z(){if(!(a.size<=U))for(let[e,t]of a){if(a.size<=U)break;!y.has(t.state)&&t.state!=="landing"&&a.delete(e)}}function ee(){if(g)return g;let e=N(),t=`/_/wire/subscribe?page-url=${encodeURIComponent(window.location.href)}`+(e?`&token=${encodeURIComponent(e)}`:"");return f=new EventSource(H(t)),f.onmessage=n=>{let r;try{r=JSON.parse(n.data)}catch{return}te(r)},f.onerror=()=>{},g=new Promise(n=>{let r=!1,s=()=>{r||(r=!0,n())};f.onopen=s,setTimeout(s,2e3)}),g}function L(){for(let e of a.values())if(y.has(e.state))return;f&&(f.close(),f=null,g=null)}function te(e){if(!e||typeof e.id!="string")return;let t=a.get(e.id);if(!(!t||!y.has(t.state)))switch(e.type){case"wire/ack":e.payload?.mode==="jsonl"&&Number.isFinite(e.payload.budgetMs)&&e.payload.budgetMs>0?(t.structured=!0,v(t,e.payload.budgetMs+K,"the helper did not finish within its execution budget",{cancelFirst:!0,errorCode:"helper_timeout"})):v(t,P,"the agent stopped responding"),Y(t,"acked");break;case"wire/status":t.structured||v(t,P,"the agent stopped responding"),t.text=typeof e.text=="string"?e.text:"",t.state="acked",ne(t,e),m(t,e);break;case"wire/done":t.result=Object.prototype.hasOwnProperty.call(e,"payload")?e.payload:null,t.document==="edit"?ie(t):l(t,"done",null);break;case"wire/error":re(t,e);break;default:break}}function ne(e,t){if(!e.onStatus||typeof t.text!="string")return;let n={text:t.text};t.payload&&typeof t.payload=="object"&&Object.prototype.hasOwnProperty.call(t.payload,"progress")&&(n.progress=t.payload.progress);try{e.onStatus(n)}catch(r){console.error("clay.wire: an onStatus listener threw",r)}}function re(e,t){let n=t.payload,r=n&&typeof n=="object"&&!Array.isArray(n)&&(n.source==="application"||n.source==="host")&&typeof n.code=="string"&&n.code,s=typeof t.text=="string"&&t.text?t.text:"the handler reported an error";if(!r){l(e,"error",s);return}let i=n.source==="host"&&n.code==="helper_cancelled"?"cancelled":"error";l(e,i,s,{errorCode:n.code,errorDetails:Object.prototype.hasOwnProperty.call(n,"details")?n.details:null,errorSource:n.source})}function oe(){h||(h=e=>{if(e.detail?.source!=="peer"){for(let t of a.values())if(t.state==="landing"){l(t,"done",null);return}}},document.addEventListener("clay:sync-applied",h))}function se(){D>0||!h||(document.removeEventListener("clay:sync-applied",h),h=null)}function ie(e){R.has(e.state)||e.state==="landing"||(q(e),e.state="landing",D++,oe(),e.landingTimer=setTimeout(()=>{l(e,"done",null)},V),m(e),L())}function l(e,t,n,r={}){if(R.has(e.state))return;let s=e.state==="landing";if(q(e),clearTimeout(e.landingTimer),e.landingTimer=null,e.abort?.abort(),s&&(D--,se()),e.error=n,Object.prototype.hasOwnProperty.call(r,"errorCode")&&(e.errorCode=r.errorCode),Object.prototype.hasOwnProperty.call(r,"errorDetails")&&(e.errorDetails=r.errorDetails),Object.prototype.hasOwnProperty.call(r,"errorSource")&&(e.errorSource=r.errorSource),e.state=t,e.signal&&e.signalHandler&&(e.signal.removeEventListener("abort",e.signalHandler),e.signalHandler=null),ue(e),m(e),L(),Z(),e.settle){let i=e.settle;e.settle=null,i(w(e))}}var C=0,$=null,E=null;function ae(){return E||(E=import("./core/save-OJ5NSLS7.js")),E}async function le(e){if(!b||e.holdsSave)return;let t=await ae();e.state==="sent"&&($=t,e.holdsSave=!0,!(C++>0)&&t.suspendAutosave())}function ue(e){e.holdsSave&&(e.holdsSave=!1,!(--C>0)&&(C=0,$?.resumeAutosave()))}var c=null,de=()=>!c||c.admitted,ce=(e,t,n)=>Object.assign(new Error(`clay.wire: ${e}`),{code:t,pending:n});function O(e){return e.document!=="edit"||e.generation===T().generation&&de()?!0:(l(e,"error","the page changed mode before this request went out",{errorCode:"stale-document",errorSource:"client"}),!1)}function _e(){return{id:"clay:wire",order:900,prepare(e={}){let t={admitted:e.initial===!0};return c=t,{enable(){c===t&&(t.admitted=!0)},quiesce(){if(c!==t)return;t.admitted=!1;let n=[...a.values()].filter(r=>r.document==="edit"&&(r.holdsSave||y.has(r.state))).map(r=>r.id);if(n.length)throw ce("a request on this page has not settled","pending-input",n)},resume(){c===t&&(t.admitted=!0)},dispose(){c===t&&(c=null)}}}}}function fe(e,t){return new Promise(n=>{let r=!1,s=()=>{r||(r=!0,document.removeEventListener(e,s),n())};document.addEventListener(e,s),setTimeout(s,t)})}async function pe(){if(!b)return;let e=window.clay;if(!e||typeof e.save!="function")return;let{isSaveInProgress:t}=await import("./core/save-core-DX3RFVO3.js"),{savesHeld:n,saveHoldReason:r}=await import("./core/save-OJ5NSLS7.js");if(n())throw new Error(r());let s=Date.now()+W;for(let i=0;i<3;i++){t()&&await fe("clay:save-saved",Math.max(0,s-Date.now()));let u=await e.save();if(u?.ok||u?.msgType==="skipped"&&!t())return;if(u?.msgType==="error"||u?.msgType==="unknown")throw new Error(`could not save this page first: ${u.msg||u.msgType}`);if(Date.now()>=s)break}throw new Error("could not save this page before sending")}async function F(e,t){let n={"Content-Type":"application/json","Page-URL":window.location.href},r=N();r&&(n["Save-Token"]=r);let s=await fetch(H("/_/wire/send"),{method:"POST",headers:n,body:JSON.stringify(e),signal:t}),i=null;try{i=await s.json()}catch{i=null}return{ok:s.ok,status:s.status,reply:i}}function he(e,t={}){let n=typeof t.id=="string"&&t.id?t.id:Q(),r=typeof t.type=="string"&&t.type?t.type:"wire/request",s=Object.prototype.hasOwnProperty.call(t,"helper"),i=s&&typeof t.helper=="string"&&t.helper?t.helper:null,u=t.document===void 0?i?"none":"edit":t.document;if(s&&!i)return _(n,r,null,"helper must be a nonempty string","invalid_helper");if(u!=="edit"&&u!=="none")return _(n,r,i,'document must be "edit" or "none"',"invalid_document");if(a.has(n))return _(n,r,i,"a request with this id is already on the wire","duplicate_request");let o={id:n,type:r,state:"sent",helper:i,document:u,structured:!1,onStatus:typeof t.onStatus=="function"?t.onStatus:null,text:"",result:null,error:null,errorCode:null,errorDetails:null,errorSource:null,startedAt:Date.now(),timer:null,landingTimer:null,abort:typeof AbortController=="function"?new AbortController:null,holdsSave:!1,generation:T().generation,settle:null,signal:t.signal&&typeof t.signal.addEventListener=="function"?t.signal:null,signalHandler:null};return o.done=new Promise(d=>{o.settle=d}),a.set(n,o),m(o),o.signal&&(o.signalHandler=()=>x(n),o.signal.addEventListener("abort",o.signalHandler,{once:!0}),o.signal.aborted&&o.signalHandler()),(async()=>{if(o.state!=="sent")return;if(o.helper){let X=await I(j);if(o.state!=="sent")return;if(!X){l(o,"error","this host does not support named wire helpers",{errorCode:"helper_protocol_unsupported",errorSource:"client"});return}}if(!O(o)||o.document==="edit"&&(await le(o),o.state!=="sent"||!O(o)||(await pe(),o.state!=="sent")||!O(o)))return;if(await ee(),o.state!=="sent"){L();return}v(o,B,"the agent never answered",o.helper?{cancelFirst:!0,errorCode:"ack_timeout"}:void 0);let d={type:o.type,id:o.id,text:t.text,payload:e};o.helper&&(d.helper=o.helper),(o.helper||t.document!==void 0)&&(d.document=o.document);let{ok:G,status:J,reply:S}=await F(d,o.abort?.signal);if(o.state!=="sent")return;if(!G){l(o,"error",`the wire refused this request (${J})`);return}let p=S&&S.refused;if(p&&typeof p.code=="string"&&p.code){l(o,"error",p.message||"the handler refused this request",{errorCode:p.code,errorSource:p.source==="application"?"application":"host",errorDetails:null});return}(!S||S.delivered===0)&&l(o,"error",o.helper?`The local program "${o.helper}" is not connected to this file.`:"No program is connected to this file.")})().catch(d=>{l(o,"error",d&&d.message?d.message:String(d))}),{id:n,get state(){return o.state},done:o.done,cancel:()=>x(n)}}function _(e,t,n,r,s){let i={id:e,type:t,state:"error",helper:n,text:"",result:null,error:r,errorCode:s,errorDetails:null,errorSource:"client",startedAt:Date.now()};return{id:e,get state(){return i.state},done:Promise.resolve(w(i)),cancel:()=>!1}}function x(e){let t=a.get(e);return!t||!y.has(t.state)?!1:(z(t),l(t,"cancelled",null),!0)}function z(e){F({type:"wire/cancel",id:e.id}).catch(()=>{})}function ye(e){let t=a.get(e);return t?w(t):void 0}function ge(){return[...a.values()].map(w)}function we(){for(let e of a.values())if(y.has(e.state))return!0;return!1}function me(e){return typeof e!="function"?()=>{}:(k.add(e),()=>k.delete(e))}async function Se(){let e=await A({fresh:!0});if(!e.extensions.includes(j))return[];let t=e.document?.helpers;return Array.isArray(t)?t.filter(n=>n&&typeof n.name=="string"&&["ready","denied","unavailable"].includes(n.state)).map(({name:n,state:r})=>({name:n,state:r})):[]}var ve={send:he,cancel:x,get:ye,list:ge,isBusy:we,on:me,helpers:Se},ke=ve;export{_e as a,ve as b,ke as c};
@@ -1,3 +1,3 @@
1
1
  import{b as U}from"./c-ATKAOH23.js";import{a as oe,g as ie,h as C}from"./c-EK63G3CG.js";import{a as ne,b as re,c as M}from"./c-NQJRVJ56.js";import{d as w}from"./c-XGH4GS2T.js";import{c as V,e as q,g as Z}from"./c-IJUK2GPW.js";import{b as R,f as N}from"./c-3O7OBDCM.js";import{c as X}from"./c-BPF2NSPV.js";import{g as Y}from"./c-N7JPUPGC.js";import{a as k,g as Q,h as ee,i as te}from"./c-EGTIAL6P.js";var D=null,ae=null,A=null;function we(e){let t=e?.document?.maxBytes;return Number.isSafeInteger(t)&&t>0?t:null}function se(e){return D=we(e),ae=e?.document?.maxBytesMeasures==="file"?"file":null,D}var Ae=/<script\b[^>]*\bmerge=(["'])page\1[^>]*>[\s\S]*?<\/script\s*>/i;function F(e,t=ae){if(t!=="file"||typeof e!="string")return e;let n=Ae.exec(e);if(!n)return e;let o=n.index,s=o+n[0].length,r=e.lastIndexOf(`
2
2
  `,o-1)+1,l=e.indexOf(`
3
- `,s),c=l===-1?e.length:l+1;return!/\S/.test(e.slice(r,o))&&!/\S/.test(e.slice(s,c))&&(o=r,s=c),e.slice(0,o)+e.slice(s)}function B(e,t){let n=new TextEncoder().encode(e).byteLength,o=Number.isSafeInteger(t)&&t>0;return{bytes:n,maxBytes:o?t:null,state:o?n>t?"over":n>=Math.ceil(t*.8)?"near":"ok":"unknown"}}function le(){return D}function P({fresh:e=!1}={}){return e?(A=w({fresh:!0}).then(se),A):(A||(A=w().then(se)),A)}function vt({fresh:e=!1}={}){return P({fresh:e}).then(t=>({maxBytes:t}))}async function yt(e){let t=await P();return B(F(e),t)}function ue(e){let t=new CustomEvent("clay:save-size",{detail:e});document.dispatchEvent(t),(e.state==="near"||e.state==="over")&&import("./c-PIVIYLTY.js").then(n=>n.start(t),()=>{})}var L="/_/clayjs/",Te=/[\u0000-\u001F\u007F]/,be=/^[\t\n\f\r ]|[\t\n\f\r ]$/,Oe=/^https:\/\/clayjs\.com\/v(\d+)\/([\s\S]*)$/,Ee=/^https:\/\/clayjs\.com\/(\d+)\.(\d+)\.(\d+)\/([\s\S]*)$/,ce=/^\/_\/clayjs\/(\d+)\.(\d+)\.(\d+)\/([\s\S]*)$/,$e=/%2e|%2f|%5c/i;function Re(e){if(typeof e!="string")return null;let t=/^(\d+)\.\d+\.\d+$/.exec(e);return t?t[1]:null}function ke(e){if(typeof e!="string"||e==="")return null;try{return new URL(e).origin}catch{return null}}function Me(e){let t=e.indexOf("#"),n=t<0?"":e.slice(t),o=t<0?e:e.slice(0,t),s=o.indexOf("?"),r=s<0?"":o.slice(s);return{head:s<0?o:o.slice(0,s),search:r,hash:n}}function Pe(e){if(e===""||e.includes("\\")||$e.test(e))return null;let t=e.split("/"),n=[];for(let o of t){if(o===""||o==="."||o==="..")return null;let s;try{s=decodeURIComponent(o)}catch{return null}if(s.includes("/")||s.includes("\\")||s==="."||s==="..")return null;n.push(s)}return n.join("/")}function T(e,{documentURL:t}={}){if(typeof e!="string"||e===""||be.test(e)||Te.test(e))return null;let{head:n,search:o,hash:s}=Me(e),r=null,l=null,c=null,u=null,i=Oe.exec(n);if(i&&(r="rolling",c=i[1],u=i[2]),r||(i=Ee.exec(n),i&&(r="exact",l=`${i[1]}.${i[2]}.${i[3]}`,c=i[1],u=i[4])),r||(i=ce.exec(n),i&&(r="local",l=`${i[1]}.${i[2]}.${i[3]}`,c=i[1],u=i[4])),!r){let d=ke(t);d&&n.startsWith(`${d}/`)&&(i=ce.exec(n.slice(d.length)),i&&(r="local",l=`${i[1]}.${i[2]}.${i[3]}`,c=i[1],u=i[4]))}if(!r)return null;let a=Pe(u);return a===null?null:{kind:r,major:c,version:l,rawPath:u,path:a,search:o,hash:s}}function Le(e,t){let n=e&&typeof e=="object"?e[t]:null;return n&&typeof n.files=="object"&&n.files?n.files:null}function je(e){return!e||typeof e!="object"?[]:Array.isArray(e.entries)?e.entries.filter(t=>t&&typeof t=="object"):[]}function Ie(e,t,n){if(!n)return!0;let o=Le(n,t);return!!(o&&Object.hasOwn(o,e.path))}function fe(e,{descriptor:t,releases:n,documentURL:o,aliases:s}={}){let r=T(e,{documentURL:o});if(!r||r.kind!=="local")return e;let l=je(t),c=Re(r.version);for(let u of l){if(u.local!==e||typeof u.original!="string")continue;let i=n?.[r.version]?.aliases??s;if(i&&typeof i=="object"&&!r.search&&!r.hash&&Object.hasOwn(i,u.original)&&i[u.original]===r.path)return u.original;let a=T(u.original);if(a&&!(a.kind!=="rolling"&&a.kind!=="exact")&&a.rawPath===r.rawPath&&a.search===r.search&&a.hash===r.hash&&!(a.kind==="rolling"?a.major!==c:a.version!==r.version)&&Ie(r,r.version,n))return a.kind==="exact"?u.original:`https://clayjs.com/v${a.major}/${r.rawPath}${r.search}${r.hash}`}for(let u of l){if(typeof u.original!="string")continue;let i=T(u.original);if(i&&!(i.kind!=="rolling"&&i.kind!=="exact")&&i.rawPath===r.rawPath&&!(i.kind==="rolling"?i.major!==c:i.version!==r.version))return i.kind==="rolling"?`https://clayjs.com/v${i.major}/${r.rawPath}${r.search}${r.hash}`:`https://clayjs.com/${i.version}/${r.rawPath}${r.search}${r.hash}`}return`https://clayjs.com/${r.version}/${r.rawPath}${r.search}${r.hash}`}var _e=Object.freeze({"https://cdn.jsdelivr.net/npm/overtype@2.6.1/dist/overtype.min.js":"compat/overtype-2.6.1.min.js","https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js":"compat/highlight-11.9.0.min.js","https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,300;0,400;0,500;0,600;1,400;1,500&family=IBM+Plex+Sans:wght@400;500;600&display=swap":"fonts/ibm-plex.css"}),J="clay-runtime-map",Ne=new Set(["stylesheet","preload","modulepreload"]),de=null,H=null;function Ue(e){let t;try{t=JSON.parse(e)}catch{return null}return!t||typeof t!="object"||t.schema!==1?null:t}function Ce(){if(typeof document>"u")return null;let e=document.getElementById(J);if(!e)return null;let t=e.textContent??"";return t===de||(de=t,H=Ue(t)),H}var De=`script[src*="${L}"], link[href*="${L}"], #${J}`;function he(e){if(e.querySelector(De))return!0;for(let t of e.querySelectorAll("template"))if(he(t.content))return!0;return!1}function Fe(e){let t=[],n=[e];for(;n.length;){let o=n.pop();for(let s of o.children??[])t.push(s),n.push(s),s.content&&n.push(s.content)}return t}function Be(e){return e.tagName==="SCRIPT"&&e.hasAttribute("src")?"src":e.tagName!=="LINK"||!e.hasAttribute("href")?null:(e.getAttribute("rel")??"").toLowerCase().split(/\s+/).some(n=>Ne.has(n))?"href":null}function He(e){if(!e||!he(e))return;let t=[],n=!1;for(let r of Fe(e)){if(r.getAttribute("id")===J){r.remove();continue}let l=Be(r);l&&(t.push({element:r,name:l}),!n&&(r.getAttribute(l)??"").includes(L)&&(n=!0))}if(!n)return;let o=location.href,s=Ce();for(let{element:r,name:l}of t){let c=r.getAttribute(l),u=T(c,{documentURL:o});!u||u.kind!=="local"||r.setAttribute(l,fe(c,{descriptor:s,documentURL:o,aliases:_e}))}}te(He);var y=!1,E=null,pe="/_/save",ze=12e3,me=6e4,Ge=1024*1024,Se="text/plain;charset=UTF-8",j=null,$=!1,G=new Map;function Ft(e,t){t==null?G.delete(e):G.set(e,String(t))}async function Bt(e,t){$=!!e;try{return await t()}finally{$=!1}}function Ht(){return y}function Jt(){return y?null:(y=!0,E={reserved:!0},E)}function zt(e){!e||E!==e||(E=null,y=!1)}function Gt(){return $}var I=[],_=[];function Kt(e){return I.push(e),()=>{let t=I.indexOf(e);t>=0&&I.splice(t,1)}}function Wt(e){return _.push(e),()=>{let t=_.indexOf(e);t>=0&&_.splice(t,1)}}function Ke(e){for(let t of I)try{t(e)}catch(n){console.error("clayjs: onSaveAttempt hook failed:",n)}}function We(e){for(let t of _)try{t(e)}catch(n){console.error("clayjs: onSaveOutcome hook failed:",n)}}function ge(e){return{ok:!0,msg:e.msg??"Saved",msgType:e.msgType||"success",code:e.code??null,etag:e.etag??null}}var b=[],Xe=8,v=null;function Xt(){return v!==null}function ve(){let e=window.crypto?.randomUUID?.();if(e)return e;if(window.crypto?.getRandomValues){let n=new Uint8Array(16);return window.crypto.getRandomValues(n),Array.from(n,o=>o.toString(16).padStart(2,"0")).join("")}let t=()=>Math.random().toString(36).slice(2,12).padEnd(10,"0");return`${Date.now().toString(36)}-${t()}${t()}${t()}`}function Ye(e){b.push(e),b.length>Xe&&b.shift()}function Ve(e){return typeof e=="string"&&e!==""&&b.includes(e)}function Yt(){b.length=0,v=null}function K(e){let t=e.name==="AbortError",n=!t&&e.status===412,o=!t&&!n&&e.code==="save-already-applied";return{ok:!1,msg:t?"Server not responding":e.message||"Save failed",msgType:t||o?"unknown":n?"conflict":"error",code:t?"timeout":n?"conflict":e.code??null,changedBy:n?e.changedBy??null:null,afterTimeout:n&&v!==null,conflictEtag:n?e.etag??null:null,status:Number.isInteger(e.status)?e.status:null,hadTimeout:t||e.hadTimeout===!0,reason:e.reason??null,retryAfter:e.retryAfter??null,saveOutcome:e.saveOutcome??null,etag:null}}function O(e){return{ok:!1,msg:e,msgType:"skipped",code:null,etag:null}}function qe(e){let t=new Error(`This document is ${e.bytes} bytes; this host saves at most ${e.maxBytes}`);return t.code="save-too-large",{...K(t),sent:!1,size:e}}var S=null;function Ze(e){return S?null:(S={kind:e},S)}function Qe(e){S===e&&(S=null)}function et(){return S?S.kind:null}function tt(){return{ok:!1,msg:"Invalid page conversion metadata",msgType:"error",code:"invalid-header",etag:null}}var nt=3,rt=/^(?:(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), \d{2} (?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} \d{2}:\d{2}:\d{2} GMT|(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), \d{2}-(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-\d{2} \d{2}:\d{2}:\d{2} GMT|(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (?: \d|\d{2}) \d{2}:\d{2}:\d{2} \d{4})$/;function ot(e){if(e==null)return null;let t=String(e).trim();if(!t)return null;if(/^-?\d+$/.test(t))return Math.max(0,Math.min(3600,Number(t)));if(!rt.test(t))return null;let n=Date.parse(t);return Number.isNaN(n)?null:Math.max(0,Math.min(3600,Math.round((n-Date.now())/1e3)))}var it=/^[0-9a-f]{64}$/,st=/^[A-Za-z0-9-]{1,64}$/;function at(e){if(e==null)return{header:null};if(typeof e!="object")return{invalid:!0};let{source:t,base:n,epoch:o}=e;return typeof n!="string"||!it.test(n)?{invalid:!0}:t==="file"?o!=null?{invalid:!0}:{header:`v1; source=file; base=${n}`}:t==="room"?typeof o!="string"||!st.test(o)?{invalid:!0}:{header:`v1; source=room; base=${n}; epoch=${o}`}:{invalid:!0}}function lt(e,t,n,o,s,r=!1,l=null){let c=X(),u=c?`${pe}/${c}`:pe,i={method:"POST",credentials:c?"omit":"same-origin",signal:n,headers:{"Document-URL":window.location.href,"Page-URL":window.location.href,"Save-Trigger":t?"user":"auto","Save-ID":o,[oe]:String(1)},body:ut(e)};for(let[a,d]of G)i.headers[a]=d;return typeof i.body!="string"&&(i.headers["Content-Type"]=Se),l&&(i.headers["Page-Conversion"]=l),s&&(i.headers["If-Match"]=s),r&&e.length<me&&new Blob([e]).size<me&&(i.keepalive=!0),{url:ct(u),options:i}}function ut(e){if(e.length<Ge)return e;if(j&&j.content===e)return j.blob;let t=new Blob([e],{type:Se});return j={content:e,blob:t},t}function ye(){let e=ne();return re()&&e?e:null}function ct(e){let t=window.location.origin;return!t||t==="null"?e:new URL(e,t).href}function z(e,t){let n=JSON.stringify(t);return{ok:e>=200&&e<300,status:e,statusText:e===200?"OK":"Insufficient Storage",text:()=>Promise.resolve(n)}}function ft(e){let t=Y();return t?Promise.resolve().then(()=>{try{return t(e),z(200,{msg:"Saved in this browser",msgType:"success"})}catch(n){return z(507,{msg:"Couldn't save in this browser. Storage is full or turned off.",msgType:"error",code:n.code||"draft-storage"})}}):Promise.resolve(z(503,{msg:"Saving in this browser is not ready yet",msgType:"error",code:"draft-not-ready"}))}function dt(e,t,n,{captureId:o=null,conversionHeader:s=null,attempts:r=[]}={}){let l=new AbortController,c=setTimeout(()=>l.abort(),ze),u=q(),i=Z(),a=u||i,d=$;$=!1;let{url:m,options:x}=lt(e,a,l.signal,t,n,d,s);return Ye(t),R||(r.some(f=>f.saveId===t&&f.etag===(n??null))||r.push({saveId:t,etag:n??null}),Ke({captureId:o,saveId:t,html:e,etag:n??null})),(R?ft(e):fetch(m,x)).then(f=>f.text().then(p=>{let h={};if(p)try{h=JSON.parse(p)}catch{if(f.ok)throw new Error("Server sent a response that was not JSON")}if(!f.ok){let g=new Error(h.msg||h.error||`HTTP ${f.status}: ${f.statusText}`);throw g.code=f.status===413?"save-too-large":h.code??null,g.status=f.status,g.changedBy=h.changedBy??null,g.etag=h.etag??null,g.saveId=h.saveId??null,g.reason=typeof h.reason=="string"?h.reason:null,g.saveOutcome=h.saveOutcome??null,g.retryAfter=ot(f.headers?.get?.("Retry-After")),g}return M(h.etag??null),v=null,h})).catch(f=>{throw console.error("Failed to save page:",f),f.name==="AbortError"&&(v={saveId:t,etag:n}),a&&V(),f}).finally(()=>{clearTimeout(c)})}async function ht(){let e=v;if(!e)return{landed:null,resend:!1};let n=(await w({fresh:!0})).document,o=typeof n?.etag=="string"&&n.etag?n.etag:null;return o?n.saveId&&n.saveId===e.saveId?(M(o),v=null,{landed:{msg:"Saved",msgType:"success",etag:o},resend:!1}):(n.saveId&&(v=null),{landed:null,resend:!!e.etag,etag:e.etag}):{landed:null,resend:!1}}async function pt(e,{captureId:t=null,conversionHeader:n=null,attempts:o=[]}={}){let s=ve(),r=ye(),l=!1,c=!1,u=0,i=t??k();for(;;)try{return await dt(e,s,r,{captureId:t,conversionHeader:n,attempts:o})}catch(a){if(l&&(a.hadTimeout=!0),a.name==="AbortError"){if(l)throw a;let{landed:d,resend:m,etag:x}=await ht();if(d)return d;if(!m)throw a;r=x,l=!0;continue}if(a.status===412&&!c&&Ve(a.saveId)){M(a.etag??null),v=null,s=ve(),r=ye(),c=!0;continue}if(a.code==="page-converting"&&u<nt){if(k()!==i||(u+=1,await new Promise(d=>setTimeout(d,Math.max(0,a.retryAfter??1)*1e3)),k()!==i))throw a;continue}throw a}}function W(e,t,n,o,s=null,r=0,l=null){return e=ie(e,Math.max(C(),r)),new Promise(c=>{let u=[],i=Q(s),a=()=>l!==null&&E===l,d=()=>{a()||(y=!1)},m=(p,h=!1)=>{h&&U(e,t??null,i),ee(s),We({captureId:t??null,result:p,attempts:u,sent:u.length>0}),typeof n=="function"&&n(p),c(p)};if(!N&&!window.clay?.testMode)return m(O("Not in edit mode"));if(y&&!a())return m(O("Save already in progress"));let x=at(o);if(x.invalid)return m(tt());if(y=!0,window.clay?.testMode){setTimeout(()=>{d(),m(ge({msg:"Test mode: save skipped"}))},0);return}P();let f=B(F(e),le());if(ue(f),f.state==="over")return d(),m(qe(f));pt(e,{captureId:t,conversionHeader:x.header,attempts:u}).then(ge,K).then(p=>{d(),p.code==="save-too-large"&&!p.size&&(p.size=f),p.ok&&U(e,t??null,i),m(p)})})}function mt(e,t=()=>{}){return W(e,null,t,null)}function Vt(e,t,n=()=>{},{conversion:o,capture:s=null,pageFormatFloor:r,lane:l=null}={}){return W(e,t,n,o,s,r,l)}function qt({html:e,captureId:t,conversion:n}){return W(e,t??null,void 0,n)}function Zt(e,t=()=>{}){return new Promise(n=>{let o=null,s=r=>{Qe(o),typeof t=="function"&&t(r),n(r)};if(!N)return s(O("Not in edit mode"));if(et())return s(O("Another document operation is in progress"));if(y)return s(O("Save already in progress"));if(R)return s(!1);o=Ze("replace"),fetch(new URL(e,window.location.href).href).then(r=>{if(!r.ok)throw new Error(`Template fetch failed: HTTP ${r.status} ${r.statusText}`);return r.text()}).then(r=>mt(r)).then(s).catch(r=>{console.error("Failed to fetch template:",r),s(K(r))})})}var xe=null;function Qt(e){xe=e}function en(){return xe}export{P as a,vt as b,yt as c,Ft as d,Bt as e,Ht as f,Jt as g,zt as h,Gt as i,Kt as j,Wt as k,Xt as l,ve as m,Yt as n,Ze as o,Qe as p,et as q,lt as r,mt as s,Vt as t,qt as u,Zt as v,Qt as w,en as x};
3
+ `,s),c=l===-1?e.length:l+1;return!/\S/.test(e.slice(r,o))&&!/\S/.test(e.slice(s,c))&&(o=r,s=c),e.slice(0,o)+e.slice(s)}function B(e,t){let n=new TextEncoder().encode(e).byteLength,o=Number.isSafeInteger(t)&&t>0;return{bytes:n,maxBytes:o?t:null,state:o?n>t?"over":n>=Math.ceil(t*.8)?"near":"ok":"unknown"}}function le(){return D}function P({fresh:e=!1}={}){return e?(A=w({fresh:!0}).then(se),A):(A||(A=w().then(se)),A)}function vt({fresh:e=!1}={}){return P({fresh:e}).then(t=>({maxBytes:t}))}async function yt(e){let t=await P();return B(F(e),t)}function ue(e){let t=new CustomEvent("clay:save-size",{detail:e});document.dispatchEvent(t),(e.state==="near"||e.state==="over")&&import("./c-6UEFPHHE.js").then(n=>n.start(t),()=>{})}var L="/_/clayjs/",Te=/[\u0000-\u001F\u007F]/,be=/^[\t\n\f\r ]|[\t\n\f\r ]$/,Oe=/^https:\/\/clayjs\.com\/v(\d+)\/([\s\S]*)$/,Ee=/^https:\/\/clayjs\.com\/(\d+)\.(\d+)\.(\d+)\/([\s\S]*)$/,ce=/^\/_\/clayjs\/(\d+)\.(\d+)\.(\d+)\/([\s\S]*)$/,$e=/%2e|%2f|%5c/i;function Re(e){if(typeof e!="string")return null;let t=/^(\d+)\.\d+\.\d+$/.exec(e);return t?t[1]:null}function ke(e){if(typeof e!="string"||e==="")return null;try{return new URL(e).origin}catch{return null}}function Me(e){let t=e.indexOf("#"),n=t<0?"":e.slice(t),o=t<0?e:e.slice(0,t),s=o.indexOf("?"),r=s<0?"":o.slice(s);return{head:s<0?o:o.slice(0,s),search:r,hash:n}}function Pe(e){if(e===""||e.includes("\\")||$e.test(e))return null;let t=e.split("/"),n=[];for(let o of t){if(o===""||o==="."||o==="..")return null;let s;try{s=decodeURIComponent(o)}catch{return null}if(s.includes("/")||s.includes("\\")||s==="."||s==="..")return null;n.push(s)}return n.join("/")}function T(e,{documentURL:t}={}){if(typeof e!="string"||e===""||be.test(e)||Te.test(e))return null;let{head:n,search:o,hash:s}=Me(e),r=null,l=null,c=null,u=null,i=Oe.exec(n);if(i&&(r="rolling",c=i[1],u=i[2]),r||(i=Ee.exec(n),i&&(r="exact",l=`${i[1]}.${i[2]}.${i[3]}`,c=i[1],u=i[4])),r||(i=ce.exec(n),i&&(r="local",l=`${i[1]}.${i[2]}.${i[3]}`,c=i[1],u=i[4])),!r){let d=ke(t);d&&n.startsWith(`${d}/`)&&(i=ce.exec(n.slice(d.length)),i&&(r="local",l=`${i[1]}.${i[2]}.${i[3]}`,c=i[1],u=i[4]))}if(!r)return null;let a=Pe(u);return a===null?null:{kind:r,major:c,version:l,rawPath:u,path:a,search:o,hash:s}}function Le(e,t){let n=e&&typeof e=="object"?e[t]:null;return n&&typeof n.files=="object"&&n.files?n.files:null}function je(e){return!e||typeof e!="object"?[]:Array.isArray(e.entries)?e.entries.filter(t=>t&&typeof t=="object"):[]}function Ie(e,t,n){if(!n)return!0;let o=Le(n,t);return!!(o&&Object.hasOwn(o,e.path))}function fe(e,{descriptor:t,releases:n,documentURL:o,aliases:s}={}){let r=T(e,{documentURL:o});if(!r||r.kind!=="local")return e;let l=je(t),c=Re(r.version);for(let u of l){if(u.local!==e||typeof u.original!="string")continue;let i=n?.[r.version]?.aliases??s;if(i&&typeof i=="object"&&!r.search&&!r.hash&&Object.hasOwn(i,u.original)&&i[u.original]===r.path)return u.original;let a=T(u.original);if(a&&!(a.kind!=="rolling"&&a.kind!=="exact")&&a.rawPath===r.rawPath&&a.search===r.search&&a.hash===r.hash&&!(a.kind==="rolling"?a.major!==c:a.version!==r.version)&&Ie(r,r.version,n))return a.kind==="exact"?u.original:`https://clayjs.com/v${a.major}/${r.rawPath}${r.search}${r.hash}`}for(let u of l){if(typeof u.original!="string")continue;let i=T(u.original);if(i&&!(i.kind!=="rolling"&&i.kind!=="exact")&&i.rawPath===r.rawPath&&!(i.kind==="rolling"?i.major!==c:i.version!==r.version))return i.kind==="rolling"?`https://clayjs.com/v${i.major}/${r.rawPath}${r.search}${r.hash}`:`https://clayjs.com/${i.version}/${r.rawPath}${r.search}${r.hash}`}return`https://clayjs.com/${r.version}/${r.rawPath}${r.search}${r.hash}`}var _e=Object.freeze({"https://cdn.jsdelivr.net/npm/overtype@2.6.1/dist/overtype.min.js":"compat/overtype-2.6.1.min.js","https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js":"compat/highlight-11.9.0.min.js","https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,300;0,400;0,500;0,600;1,400;1,500&family=IBM+Plex+Sans:wght@400;500;600&display=swap":"fonts/ibm-plex.css"}),J="clay-runtime-map",Ne=new Set(["stylesheet","preload","modulepreload"]),de=null,H=null;function Ue(e){let t;try{t=JSON.parse(e)}catch{return null}return!t||typeof t!="object"||t.schema!==1?null:t}function Ce(){if(typeof document>"u")return null;let e=document.getElementById(J);if(!e)return null;let t=e.textContent??"";return t===de||(de=t,H=Ue(t)),H}var De=`script[src*="${L}"], link[href*="${L}"], #${J}`;function he(e){if(e.querySelector(De))return!0;for(let t of e.querySelectorAll("template"))if(he(t.content))return!0;return!1}function Fe(e){let t=[],n=[e];for(;n.length;){let o=n.pop();for(let s of o.children??[])t.push(s),n.push(s),s.content&&n.push(s.content)}return t}function Be(e){return e.tagName==="SCRIPT"&&e.hasAttribute("src")?"src":e.tagName!=="LINK"||!e.hasAttribute("href")?null:(e.getAttribute("rel")??"").toLowerCase().split(/\s+/).some(n=>Ne.has(n))?"href":null}function He(e){if(!e||!he(e))return;let t=[],n=!1;for(let r of Fe(e)){if(r.getAttribute("id")===J){r.remove();continue}let l=Be(r);l&&(t.push({element:r,name:l}),!n&&(r.getAttribute(l)??"").includes(L)&&(n=!0))}if(!n)return;let o=location.href,s=Ce();for(let{element:r,name:l}of t){let c=r.getAttribute(l),u=T(c,{documentURL:o});!u||u.kind!=="local"||r.setAttribute(l,fe(c,{descriptor:s,documentURL:o,aliases:_e}))}}te(He);var y=!1,E=null,pe="/_/save",ze=12e3,me=6e4,Ge=1024*1024,Se="text/plain;charset=UTF-8",j=null,$=!1,G=new Map;function Ft(e,t){t==null?G.delete(e):G.set(e,String(t))}async function Bt(e,t){$=!!e;try{return await t()}finally{$=!1}}function Ht(){return y}function Jt(){return y?null:(y=!0,E={reserved:!0},E)}function zt(e){!e||E!==e||(E=null,y=!1)}function Gt(){return $}var I=[],_=[];function Kt(e){return I.push(e),()=>{let t=I.indexOf(e);t>=0&&I.splice(t,1)}}function Wt(e){return _.push(e),()=>{let t=_.indexOf(e);t>=0&&_.splice(t,1)}}function Ke(e){for(let t of I)try{t(e)}catch(n){console.error("clayjs: onSaveAttempt hook failed:",n)}}function We(e){for(let t of _)try{t(e)}catch(n){console.error("clayjs: onSaveOutcome hook failed:",n)}}function ge(e){return{ok:!0,msg:e.msg??"Saved",msgType:e.msgType||"success",code:e.code??null,etag:e.etag??null}}var b=[],Xe=8,v=null;function Xt(){return v!==null}function ve(){let e=window.crypto?.randomUUID?.();if(e)return e;if(window.crypto?.getRandomValues){let n=new Uint8Array(16);return window.crypto.getRandomValues(n),Array.from(n,o=>o.toString(16).padStart(2,"0")).join("")}let t=()=>Math.random().toString(36).slice(2,12).padEnd(10,"0");return`${Date.now().toString(36)}-${t()}${t()}${t()}`}function Ye(e){b.push(e),b.length>Xe&&b.shift()}function Ve(e){return typeof e=="string"&&e!==""&&b.includes(e)}function Yt(){b.length=0,v=null}function K(e){let t=e.name==="AbortError",n=!t&&e.status===412,o=!t&&!n&&e.code==="save-already-applied";return{ok:!1,msg:t?"Server not responding":e.message||"Save failed",msgType:t||o?"unknown":n?"conflict":"error",code:t?"timeout":n?"conflict":e.code??null,changedBy:n?e.changedBy??null:null,afterTimeout:n&&v!==null,conflictEtag:n?e.etag??null:null,status:Number.isInteger(e.status)?e.status:null,hadTimeout:t||e.hadTimeout===!0,reason:e.reason??null,retryAfter:e.retryAfter??null,saveOutcome:e.saveOutcome??null,etag:null}}function O(e){return{ok:!1,msg:e,msgType:"skipped",code:null,etag:null}}function qe(e){let t=new Error(`This document is ${e.bytes} bytes; this host saves at most ${e.maxBytes}`);return t.code="save-too-large",{...K(t),sent:!1,size:e}}var S=null;function Ze(e){return S?null:(S={kind:e},S)}function Qe(e){S===e&&(S=null)}function et(){return S?S.kind:null}function tt(){return{ok:!1,msg:"Invalid page conversion metadata",msgType:"error",code:"invalid-header",etag:null}}var nt=3,rt=/^(?:(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), \d{2} (?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} \d{2}:\d{2}:\d{2} GMT|(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), \d{2}-(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-\d{2} \d{2}:\d{2}:\d{2} GMT|(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (?: \d|\d{2}) \d{2}:\d{2}:\d{2} \d{4})$/;function ot(e){if(e==null)return null;let t=String(e).trim();if(!t)return null;if(/^-?\d+$/.test(t))return Math.max(0,Math.min(3600,Number(t)));if(!rt.test(t))return null;let n=Date.parse(t);return Number.isNaN(n)?null:Math.max(0,Math.min(3600,Math.round((n-Date.now())/1e3)))}var it=/^[0-9a-f]{64}$/,st=/^[A-Za-z0-9-]{1,64}$/;function at(e){if(e==null)return{header:null};if(typeof e!="object")return{invalid:!0};let{source:t,base:n,epoch:o}=e;return typeof n!="string"||!it.test(n)?{invalid:!0}:t==="file"?o!=null?{invalid:!0}:{header:`v1; source=file; base=${n}`}:t==="room"?typeof o!="string"||!st.test(o)?{invalid:!0}:{header:`v1; source=room; base=${n}; epoch=${o}`}:{invalid:!0}}function lt(e,t,n,o,s,r=!1,l=null){let c=X(),u=c?`${pe}/${c}`:pe,i={method:"POST",credentials:c?"omit":"same-origin",signal:n,headers:{"Document-URL":window.location.href,"Page-URL":window.location.href,"Save-Trigger":t?"user":"auto","Save-ID":o,[oe]:String(1)},body:ut(e)};for(let[a,d]of G)i.headers[a]=d;return typeof i.body!="string"&&(i.headers["Content-Type"]=Se),l&&(i.headers["Page-Conversion"]=l),s&&(i.headers["If-Match"]=s),r&&e.length<me&&new Blob([e]).size<me&&(i.keepalive=!0),{url:ct(u),options:i}}function ut(e){if(e.length<Ge)return e;if(j&&j.content===e)return j.blob;let t=new Blob([e],{type:Se});return j={content:e,blob:t},t}function ye(){let e=ne();return re()&&e?e:null}function ct(e){let t=window.location.origin;return!t||t==="null"?e:new URL(e,t).href}function z(e,t){let n=JSON.stringify(t);return{ok:e>=200&&e<300,status:e,statusText:e===200?"OK":"Insufficient Storage",text:()=>Promise.resolve(n)}}function ft(e){let t=Y();return t?Promise.resolve().then(()=>{try{return t(e),z(200,{msg:"Saved in this browser",msgType:"success"})}catch(n){return z(507,{msg:"Couldn't save in this browser. Storage is full or turned off.",msgType:"error",code:n.code||"draft-storage"})}}):Promise.resolve(z(503,{msg:"Saving in this browser is not ready yet",msgType:"error",code:"draft-not-ready"}))}function dt(e,t,n,{captureId:o=null,conversionHeader:s=null,attempts:r=[]}={}){let l=new AbortController,c=setTimeout(()=>l.abort(),ze),u=q(),i=Z(),a=u||i,d=$;$=!1;let{url:m,options:x}=lt(e,a,l.signal,t,n,d,s);return Ye(t),R||(r.some(f=>f.saveId===t&&f.etag===(n??null))||r.push({saveId:t,etag:n??null}),Ke({captureId:o,saveId:t,html:e,etag:n??null})),(R?ft(e):fetch(m,x)).then(f=>f.text().then(p=>{let h={};if(p)try{h=JSON.parse(p)}catch{if(f.ok)throw new Error("Server sent a response that was not JSON")}if(!f.ok){let g=new Error(h.msg||h.error||`HTTP ${f.status}: ${f.statusText}`);throw g.code=f.status===413?"save-too-large":h.code??null,g.status=f.status,g.changedBy=h.changedBy??null,g.etag=h.etag??null,g.saveId=h.saveId??null,g.reason=typeof h.reason=="string"?h.reason:null,g.saveOutcome=h.saveOutcome??null,g.retryAfter=ot(f.headers?.get?.("Retry-After")),g}return M(h.etag??null),v=null,h})).catch(f=>{throw console.error("Failed to save page:",f),f.name==="AbortError"&&(v={saveId:t,etag:n}),a&&V(),f}).finally(()=>{clearTimeout(c)})}async function ht(){let e=v;if(!e)return{landed:null,resend:!1};let n=(await w({fresh:!0})).document,o=typeof n?.etag=="string"&&n.etag?n.etag:null;return o?n.saveId&&n.saveId===e.saveId?(M(o),v=null,{landed:{msg:"Saved",msgType:"success",etag:o},resend:!1}):(n.saveId&&(v=null),{landed:null,resend:!!e.etag,etag:e.etag}):{landed:null,resend:!1}}async function pt(e,{captureId:t=null,conversionHeader:n=null,attempts:o=[]}={}){let s=ve(),r=ye(),l=!1,c=!1,u=0,i=t??k();for(;;)try{return await dt(e,s,r,{captureId:t,conversionHeader:n,attempts:o})}catch(a){if(l&&(a.hadTimeout=!0),a.name==="AbortError"){if(l)throw a;let{landed:d,resend:m,etag:x}=await ht();if(d)return d;if(!m)throw a;r=x,l=!0;continue}if(a.status===412&&!c&&Ve(a.saveId)){M(a.etag??null),v=null,s=ve(),r=ye(),c=!0;continue}if(a.code==="page-converting"&&u<nt){if(k()!==i||(u+=1,await new Promise(d=>setTimeout(d,Math.max(0,a.retryAfter??1)*1e3)),k()!==i))throw a;continue}throw a}}function W(e,t,n,o,s=null,r=0,l=null){return e=ie(e,Math.max(C(),r)),new Promise(c=>{let u=[],i=Q(s),a=()=>l!==null&&E===l,d=()=>{a()||(y=!1)},m=(p,h=!1)=>{h&&U(e,t??null,i),ee(s),We({captureId:t??null,result:p,attempts:u,sent:u.length>0}),typeof n=="function"&&n(p),c(p)};if(!N&&!window.clay?.testMode)return m(O("Not in edit mode"));if(y&&!a())return m(O("Save already in progress"));let x=at(o);if(x.invalid)return m(tt());if(y=!0,window.clay?.testMode){setTimeout(()=>{d(),m(ge({msg:"Test mode: save skipped"}))},0);return}P();let f=B(F(e),le());if(ue(f),f.state==="over")return d(),m(qe(f));pt(e,{captureId:t,conversionHeader:x.header,attempts:u}).then(ge,K).then(p=>{d(),p.code==="save-too-large"&&!p.size&&(p.size=f),p.ok&&U(e,t??null,i),m(p)})})}function mt(e,t=()=>{}){return W(e,null,t,null)}function Vt(e,t,n=()=>{},{conversion:o,capture:s=null,pageFormatFloor:r,lane:l=null}={}){return W(e,t,n,o,s,r,l)}function qt({html:e,captureId:t,conversion:n}){return W(e,t??null,void 0,n)}function Zt(e,t=()=>{}){return new Promise(n=>{let o=null,s=r=>{Qe(o),typeof t=="function"&&t(r),n(r)};if(!N)return s(O("Not in edit mode"));if(et())return s(O("Another document operation is in progress"));if(y)return s(O("Save already in progress"));if(R)return s(!1);o=Ze("replace"),fetch(new URL(e,window.location.href).href).then(r=>{if(!r.ok)throw new Error(`Template fetch failed: HTTP ${r.status} ${r.statusText}`);return r.text()}).then(r=>mt(r)).then(s).catch(r=>{console.error("Failed to fetch template:",r),s(K(r))})})}var xe=null;function Qt(e){xe=e}function en(){return xe}export{P as a,vt as b,yt as c,Ft as d,Bt as e,Ht as f,Jt as g,zt as h,Gt as i,Kt as j,Wt as k,Xt as l,ve as m,Yt as n,Ze as o,Qe as p,et as q,lt as r,mt as s,Vt as t,qt as u,Zt as v,Qt as w,en as x};
@@ -1,4 +1,4 @@
1
- import{b as K}from"./c-67ILSNPR.js";import{c as O}from"./c-W4JCVLAB.js";import{d as g}from"./c-44B5ODN7.js";import{I as C,m as y}from"./c-QIXT3Q7C.js";import"./c-VHNSBD2M.js";var z=`
1
+ import{b as K}from"./c-Q5KAQJAG.js";import{c as O}from"./c-W4JCVLAB.js";import{d as g}from"./c-TMT5TL65.js";import{I as C,m as y}from"./c-QIXT3Q7C.js";import"./c-VHNSBD2M.js";var z=`
2
2
  :where(article[data-page], .page-shell) { --page-board-lane: 274px; --page-board-gap: 14px; --page-board-radius: 8px; --page-board-panel: 360px; }
3
3
  .page-editor .page-board { margin-block: 1.1em 1.5em; font-size: 15px; line-height: 1.4; white-space: normal; }
4
4
  :is(.page-board, .page-board-panel) .i { flex: none; width: 16px; height: 16px; }
@@ -1 +1 @@
1
- import{a as d}from"./c-KQ7E3PYY.js";import{d as h,h as p,v as g}from"./c-44B5ODN7.js";import{N as u,b as l,ea as c,m,na as f}from"./c-QIXT3Q7C.js";import"./c-VHNSBD2M.js";var{TextSelection:b}=l;function T(r,t){let e=p(r.state.doc),n=e.findIndex(o=>o.node.attrs.id===t);if(n<0)return h(r,"That link's block is gone"),null;let s=[];for(let o=e[n].up;o>=0;o=e[o].up)e[o].node.type===m.nodes.toggle&&!e[o].open&&s.push(e[o].node.attrs.id);let i=r.state.tr.setSelection(b.create(r.state.doc,e[n].at+1)).setMeta("addToHistory",!1);return r.dispatch(g(i,s).scrollIntoView()),e[n]}var a=class{constructor(t,e){this.node=t,this.view=e,this.doc=e.state.doc;let n=e.dom.ownerDocument;this.dom=n.createElement("div"),this.dom.className="page-toc",this.dom.contentEditable="false",this.dom.setAttribute("role","group"),this.dom.setAttribute("aria-label","Table of contents"),this.dom.addEventListener("mousedown",s=>{s.target.closest?.("a")&&s.preventDefault()}),this.dom.addEventListener("click",s=>{let i=s.target.closest?.("a");if(!i)return;s.preventDefault();let o=d(i.getAttribute("href"));o!==null&&T(this.view,o)}),this.render()}update(t){return this.node=t,this.view.state.doc!==this.doc&&(this.doc=this.view.state.doc,this.render()),!0}render(){let t=c(this.node.attrs,f(u(this.doc)));this.dom.innerHTML!==t&&(this.dom.innerHTML=t)}stopEvent(t){return!!t.target.closest?.("a")}ignoreMutation(){return!0}};function I(){return{id:"toc",nodeViews:{toc:(r,t)=>new a(r,t)},css:null,dispose(){}}}export{a as TocView,I as createFeature,T as followTocLink};
1
+ import{a as d}from"./c-KQ7E3PYY.js";import{d as h,h as p,v as g}from"./c-TMT5TL65.js";import{N as u,b as l,ea as c,m,na as f}from"./c-QIXT3Q7C.js";import"./c-VHNSBD2M.js";var{TextSelection:b}=l;function T(r,t){let e=p(r.state.doc),n=e.findIndex(o=>o.node.attrs.id===t);if(n<0)return h(r,"That link's block is gone"),null;let s=[];for(let o=e[n].up;o>=0;o=e[o].up)e[o].node.type===m.nodes.toggle&&!e[o].open&&s.push(e[o].node.attrs.id);let i=r.state.tr.setSelection(b.create(r.state.doc,e[n].at+1)).setMeta("addToHistory",!1);return r.dispatch(g(i,s).scrollIntoView()),e[n]}var a=class{constructor(t,e){this.node=t,this.view=e,this.doc=e.state.doc;let n=e.dom.ownerDocument;this.dom=n.createElement("div"),this.dom.className="page-toc",this.dom.contentEditable="false",this.dom.setAttribute("role","group"),this.dom.setAttribute("aria-label","Table of contents"),this.dom.addEventListener("mousedown",s=>{s.target.closest?.("a")&&s.preventDefault()}),this.dom.addEventListener("click",s=>{let i=s.target.closest?.("a");if(!i)return;s.preventDefault();let o=d(i.getAttribute("href"));o!==null&&T(this.view,o)}),this.render()}update(t){return this.node=t,this.view.state.doc!==this.doc&&(this.doc=this.view.state.doc,this.render()),!0}render(){let t=c(this.node.attrs,f(u(this.doc)));this.dom.innerHTML!==t&&(this.dom.innerHTML=t)}stopEvent(t){return!!t.target.closest?.("a")}ignoreMutation(){return!0}};function I(){return{id:"toc",nodeViews:{toc:(r,t)=>new a(r,t)},css:null,dispose(){}}}export{a as TocView,I as createFeature,T as followTocLink};
@@ -1 +1 @@
1
- import{Q as e,g as i}from"../c-NLZ5AN4L.js";import"../c-4ASQPRQL.js";import"../c-GQ6F6IDK.js";import"../c-I2SCCUEW.js";import{a as p}from"../c-5VYOWDTI.js";import"../c-GSRLXYWL.js";import"../c-X5LNHET5.js";import{a as f,b as m}from"../c-WYFDLITL.js";import"../c-UGHH4MB3.js";import{a as d}from"../c-LA2BW7UY.js";import"../c-GVPNDIKJ.js";import"../c-ATKAOH23.js";import"../c-EK63G3CG.js";import"../c-NQJRVJ56.js";import"../c-XGH4GS2T.js";import{c}from"../c-IJUK2GPW.js";import{f as a}from"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import"../c-EGTIAL6P.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-VG5XIN4T.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import{s as n,v as o}from"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";function y(){d.onAnyChange({debounce:0,omitChangeDetails:!0,require:"autosave"},()=>{i()&&e.noteActivity()})}function A(){document.addEventListener("input",t=>{t.target.closest(f)&&(t.isTrusted&&!o(n(t.target),"dirty")&&c(),i()&&e.noteActivity())},!0)}function g(){let t=v=>{if(!e.pending())return;let r=v.target;if(!r||typeof r.closest!="function")return;let s=r.closest("input, textarea, select, [contenteditable]");s&&(o(n(s),"dirty")||i()&&e.noteActivity())};document.addEventListener("input",t,!0),document.addEventListener("compositionupdate",t,!0)}var l=!1;function u(){l||document.documentElement.matches(m)&&a&&(l=!0,p(!0),y(),A(),g())}u();var C=u;function L(){return{id:"clay:autosave",order:20,prepare(t={}){return t.initial===!0?{enable(){},quiesce(){},resume(){},dispose(){}}:{enable:u,quiesce(){},resume(){},dispose(){}}}}}export{C as default,u as init,L as modeParticipant};
1
+ import{Q as e,g as i}from"../c-DKFSOJCV.js";import"../c-4ASQPRQL.js";import"../c-GQ6F6IDK.js";import"../c-I2SCCUEW.js";import{a as p}from"../c-5VYOWDTI.js";import"../c-GSRLXYWL.js";import"../c-X5LNHET5.js";import{a as f,b as m}from"../c-WYFDLITL.js";import"../c-UGHH4MB3.js";import{a as d}from"../c-LA2BW7UY.js";import"../c-ZKELCT4T.js";import"../c-ATKAOH23.js";import"../c-EK63G3CG.js";import"../c-NQJRVJ56.js";import"../c-XGH4GS2T.js";import{c}from"../c-IJUK2GPW.js";import{f as a}from"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import"../c-EGTIAL6P.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-VG5XIN4T.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import{s as n,v as o}from"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";function y(){d.onAnyChange({debounce:0,omitChangeDetails:!0,require:"autosave"},()=>{i()&&e.noteActivity()})}function A(){document.addEventListener("input",t=>{t.target.closest(f)&&(t.isTrusted&&!o(n(t.target),"dirty")&&c(),i()&&e.noteActivity())},!0)}function g(){let t=v=>{if(!e.pending())return;let r=v.target;if(!r||typeof r.closest!="function")return;let s=r.closest("input, textarea, select, [contenteditable]");s&&(o(n(s),"dirty")||i()&&e.noteActivity())};document.addEventListener("input",t,!0),document.addEventListener("compositionupdate",t,!0)}var l=!1;function u(){l||document.documentElement.matches(m)&&a&&(l=!0,p(!0),y(),A(),g())}u();var C=u;function L(){return{id:"clay:autosave",order:20,prepare(t={}){return t.initial===!0?{enable(){},quiesce(){},resume(){},dispose(){}}:{enable:u,quiesce(){},resume(){},dispose(){}}}}}export{C as default,u as init,L as modeParticipant};
@@ -1 +1 @@
1
- import{a as s}from"../c-VKEDWYDF.js";import{q as u}from"../c-NLZ5AN4L.js";import"../c-4ASQPRQL.js";import"../c-GQ6F6IDK.js";import"../c-I2SCCUEW.js";import"../c-5VYOWDTI.js";import"../c-GSRLXYWL.js";import"../c-X5LNHET5.js";import"../c-WYFDLITL.js";import"../c-UGHH4MB3.js";import"../c-LA2BW7UY.js";import"../c-GVPNDIKJ.js";import"../c-ATKAOH23.js";import"../c-EK63G3CG.js";import"../c-NQJRVJ56.js";import"../c-XGH4GS2T.js";import"../c-IJUK2GPW.js";import{f as d}from"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import{b as a}from"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import"../c-EGTIAL6P.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-VG5XIN4T.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";var c=()=>window.clay?.conflicts||null,o=!1,i=null,r=null;function e(n){o||(o=!0,m(),import("../c-K76AUL4I.js").then(t=>{i=t,t.start(n)},t=>{console.error("clayjs: the conflict notice could not be downloaded; it will try again on the next conflict",t),o=!1,l()}))}function l(){r||=new AbortController;let{signal:n}=r;document.addEventListener("clay:sync-conflicts-changed",p,{signal:n}),document.addEventListener("clay:save-conflict",g,{signal:n}),document.addEventListener("clay:document-upgraded",h,{signal:n}),document.addEventListener("clay:undo-kept",y,{signal:n})}function m(){r?.abort(),r=null}function p(n){c()?.size&&e(n)}function g(n){e(n)}function h(n){e(n)}function y(n){n?.detail?.ok===!0&&e(n)}var v="conflicts",E="undo",f=n=>a.local.get(n)?.count>0;function w(){f(E)&&e(null),f(v)&&import("../c-OIDRZKAF.js").then(n=>{!o&&n.pendingConflicts()>0&&e(null)},()=>{})}function b(){let n=(c()?.list?.()??[]).filter(t=>!t.claimedBy).map(t=>t.id);return n.length?n:u()?["save"]:[]}function x(){return{id:"clay:conflict-notice",order:960,prepare(n={}){return{enable(){n.initial!==!0&&!i&&!o&&l()},quiesce(){let t=b();if(t.length)throw Object.assign(new Error("clay.conflict-notice: a conflict here is still unresolved"),{code:"conflict",pending:t})},resume(){},dispose(){m(),o=!1,i?.stop?.(),i=null}}}}}s(()=>{d&&(c()?.size?e(null):(l(),w()))});export{x as conflictNoticeParticipant,x as modeParticipant};
1
+ import{a as s}from"../c-VKEDWYDF.js";import{q as u}from"../c-DKFSOJCV.js";import"../c-4ASQPRQL.js";import"../c-GQ6F6IDK.js";import"../c-I2SCCUEW.js";import"../c-5VYOWDTI.js";import"../c-GSRLXYWL.js";import"../c-X5LNHET5.js";import"../c-WYFDLITL.js";import"../c-UGHH4MB3.js";import"../c-LA2BW7UY.js";import"../c-ZKELCT4T.js";import"../c-ATKAOH23.js";import"../c-EK63G3CG.js";import"../c-NQJRVJ56.js";import"../c-XGH4GS2T.js";import"../c-IJUK2GPW.js";import{f as d}from"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import{b as a}from"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import"../c-EGTIAL6P.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-VG5XIN4T.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";var c=()=>window.clay?.conflicts||null,o=!1,i=null,r=null;function e(n){o||(o=!0,m(),import("../c-XZJ5IK6Q.js").then(t=>{i=t,t.start(n)},t=>{console.error("clayjs: the conflict notice could not be downloaded; it will try again on the next conflict",t),o=!1,l()}))}function l(){r||=new AbortController;let{signal:n}=r;document.addEventListener("clay:sync-conflicts-changed",p,{signal:n}),document.addEventListener("clay:save-conflict",g,{signal:n}),document.addEventListener("clay:document-upgraded",h,{signal:n}),document.addEventListener("clay:undo-kept",y,{signal:n})}function m(){r?.abort(),r=null}function p(n){c()?.size&&e(n)}function g(n){e(n)}function h(n){e(n)}function y(n){n?.detail?.ok===!0&&e(n)}var v="conflicts",E="undo",f=n=>a.local.get(n)?.count>0;function w(){f(E)&&e(null),f(v)&&import("../c-OIDRZKAF.js").then(n=>{!o&&n.pendingConflicts()>0&&e(null)},()=>{})}function b(){let n=(c()?.list?.()??[]).filter(t=>!t.claimedBy).map(t=>t.id);return n.length?n:u()?["save"]:[]}function x(){return{id:"clay:conflict-notice",order:960,prepare(n={}){return{enable(){n.initial!==!0&&!i&&!o&&l()},quiesce(){let t=b();if(t.length)throw Object.assign(new Error("clay.conflict-notice: a conflict here is still unresolved"),{code:"conflict",pending:t})},resume(){},dispose(){m(),o=!1,i?.stop?.(),i=null}}}}}s(()=>{d&&(c()?.size?e(null):(l(),w()))});export{x as conflictNoticeParticipant,x as modeParticipant};
@@ -1 +1 @@
1
- import{A as C,B as D,C as E,D as F,E as G,F as H,G as I,H as J,I as K,J as L,K as M,L as N,M as O,N as P,O as Q,P as R,Q as S,R as T,S as U,T as V,U as W,d as f,e as g,f as h,g as i,h as j,i as k,j as l,k as m,l as n,m as o,n as p,o as q,p as r,q as s,r as t,s as u,t as v,u as w,v as x,w as y,x as z,y as A,z as B}from"../c-NLZ5AN4L.js";import{a as e}from"../c-4ASQPRQL.js";import"../c-GQ6F6IDK.js";import"../c-I2SCCUEW.js";import"../c-5VYOWDTI.js";import"../c-GSRLXYWL.js";import"../c-X5LNHET5.js";import"../c-WYFDLITL.js";import"../c-UGHH4MB3.js";import"../c-LA2BW7UY.js";import{b as c,c as d}from"../c-GVPNDIKJ.js";import"../c-ATKAOH23.js";import"../c-EK63G3CG.js";import"../c-NQJRVJ56.js";import"../c-XGH4GS2T.js";import"../c-IJUK2GPW.js";import"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import{J as b,q as a}from"../c-EGTIAL6P.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-VG5XIN4T.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";export{e as SLICED_SAVE_MIN_BYTES,l as acceptedReceipt,a as addDocumentTransform,m as adoptEntryBaseline,h as autosaveIsSuspended,S as autosaveScheduler,L as baselineSettled,x as closeSavePermit,t as conflictResolvedBySync,M as currentPaintSignature,W as default,H as flushSave,C as getLastSavedBytes,A as getLastSavedContents,B as getLastSavedDirty,b as getPageContents,y as getUnsavedChanges,o as holdAllSaves,V as init,U as initHyperclaySaveButton,T as initSaveKeyboardShortcut,d as inspectSaveSize,s as isSaveConflicted,n as modeParticipant,w as openSavePermit,p as releaseAllSaves,Q as releaseBootSettle,J as replacePageWith,g as resumeAutosave,u as saveGeneration,r as saveHoldReason,c as saveLimits,I as saveOverwritingConflict,F as savePage,G as savePageForce,K as savePageSoon,R as savePageThrottled,k as saveSession,i as savesAdmitted,q as savesHeld,N as schedulePaintHeal,j as sessionParked,D as setLastSavedBaselines,E as setLastSavedContents,v as setSaveGeneration,z as setUnsavedChanges,P as styleAdoptionPending,O as styleAdoptionsSettled,f as suspendAutosave};
1
+ import{A as C,B as D,C as E,D as F,E as G,F as H,G as I,H as J,I as K,J as L,K as M,L as N,M as O,N as P,O as Q,P as R,Q as S,R as T,S as U,T as V,U as W,d as f,e as g,f as h,g as i,h as j,i as k,j as l,k as m,l as n,m as o,n as p,o as q,p as r,q as s,r as t,s as u,t as v,u as w,v as x,w as y,x as z,y as A,z as B}from"../c-DKFSOJCV.js";import{a as e}from"../c-4ASQPRQL.js";import"../c-GQ6F6IDK.js";import"../c-I2SCCUEW.js";import"../c-5VYOWDTI.js";import"../c-GSRLXYWL.js";import"../c-X5LNHET5.js";import"../c-WYFDLITL.js";import"../c-UGHH4MB3.js";import"../c-LA2BW7UY.js";import{b as c,c as d}from"../c-ZKELCT4T.js";import"../c-ATKAOH23.js";import"../c-EK63G3CG.js";import"../c-NQJRVJ56.js";import"../c-XGH4GS2T.js";import"../c-IJUK2GPW.js";import"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import{J as b,q as a}from"../c-EGTIAL6P.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-VG5XIN4T.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";export{e as SLICED_SAVE_MIN_BYTES,l as acceptedReceipt,a as addDocumentTransform,m as adoptEntryBaseline,h as autosaveIsSuspended,S as autosaveScheduler,L as baselineSettled,x as closeSavePermit,t as conflictResolvedBySync,M as currentPaintSignature,W as default,H as flushSave,C as getLastSavedBytes,A as getLastSavedContents,B as getLastSavedDirty,b as getPageContents,y as getUnsavedChanges,o as holdAllSaves,V as init,U as initHyperclaySaveButton,T as initSaveKeyboardShortcut,d as inspectSaveSize,s as isSaveConflicted,n as modeParticipant,w as openSavePermit,p as releaseAllSaves,Q as releaseBootSettle,J as replacePageWith,g as resumeAutosave,u as saveGeneration,r as saveHoldReason,c as saveLimits,I as saveOverwritingConflict,F as savePage,G as savePageForce,K as savePageSoon,R as savePageThrottled,k as saveSession,i as savesAdmitted,q as savesHeld,N as schedulePaintHeal,j as sessionParked,D as setLastSavedBaselines,E as setLastSavedContents,v as setSaveGeneration,z as setUnsavedChanges,P as styleAdoptionPending,O as styleAdoptionsSettled,f as suspendAutosave};
@@ -1 +1 @@
1
- import{d as g,e as h,f as i,g as j,h as k,i as l,j as m,k as n,l as o,m as p,n as q,o as r,p as s,q as t,r as u,s as v,t as w,u as x,v as y,w as z,x as A}from"../c-GVPNDIKJ.js";import{a as d}from"../c-ATKAOH23.js";import{b as e,h as f}from"../c-EK63G3CG.js";import"../c-NQJRVJ56.js";import"../c-XGH4GS2T.js";import"../c-IJUK2GPW.js";import"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import{J as c,k as a,q as b}from"../c-EGTIAL6P.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-VG5XIN4T.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";export{e as PAGE_FORMAT_META,b as addDocumentTransform,u as buildSaveRequest,r as claimDocumentOperation,A as exitSave,c as getPageContents,i as isSaveInProgress,l as keepaliveHeld,f as knownPageFormatFloor,p as mintSaveId,d as onSaveAccepted,m as onSaveAttempt,n as onSaveOutcome,a as onSnapshot,t as operationKind,s as releaseDocumentOperation,k as releaseSaveLane,y as replacePageWith,j as reserveSaveLane,q as resetSaveAttempts,w as saveCapturedHtml,x as saveConversion,o as saveFateIsUnknown,v as saveHtml,z as setExitSave,g as setSaveHeader,h as withKeepalive};
1
+ import{d as g,e as h,f as i,g as j,h as k,i as l,j as m,k as n,l as o,m as p,n as q,o as r,p as s,q as t,r as u,s as v,t as w,u as x,v as y,w as z,x as A}from"../c-ZKELCT4T.js";import{a as d}from"../c-ATKAOH23.js";import{b as e,h as f}from"../c-EK63G3CG.js";import"../c-NQJRVJ56.js";import"../c-XGH4GS2T.js";import"../c-IJUK2GPW.js";import"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import{J as c,k as a,q as b}from"../c-EGTIAL6P.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-VG5XIN4T.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";export{e as PAGE_FORMAT_META,b as addDocumentTransform,u as buildSaveRequest,r as claimDocumentOperation,A as exitSave,c as getPageContents,i as isSaveInProgress,l as keepaliveHeld,f as knownPageFormatFloor,p as mintSaveId,d as onSaveAccepted,m as onSaveAttempt,n as onSaveOutcome,a as onSnapshot,t as operationKind,s as releaseDocumentOperation,k as releaseSaveLane,y as replacePageWith,j as reserveSaveLane,q as resetSaveAttempts,w as saveCapturedHtml,x as saveConversion,o as saveFateIsUnknown,v as saveHtml,z as setExitSave,g as setSaveHeader,h as withKeepalive};
@@ -1 +1 @@
1
- import{a,b,c}from"../c-NLZ5AN4L.js";import"../c-4ASQPRQL.js";import"../c-GQ6F6IDK.js";import"../c-I2SCCUEW.js";import"../c-5VYOWDTI.js";import"../c-GSRLXYWL.js";import"../c-X5LNHET5.js";import"../c-WYFDLITL.js";import"../c-UGHH4MB3.js";import"../c-LA2BW7UY.js";import"../c-GVPNDIKJ.js";import"../c-ATKAOH23.js";import"../c-EK63G3CG.js";import"../c-NQJRVJ56.js";import"../c-XGH4GS2T.js";import"../c-IJUK2GPW.js";import"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import"../c-EGTIAL6P.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-VG5XIN4T.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";export{c as bytesUnsaved,b as hasUnsavedChanges,a as reloadAfterDiscard};
1
+ import{a,b,c}from"../c-DKFSOJCV.js";import"../c-4ASQPRQL.js";import"../c-GQ6F6IDK.js";import"../c-I2SCCUEW.js";import"../c-5VYOWDTI.js";import"../c-GSRLXYWL.js";import"../c-X5LNHET5.js";import"../c-WYFDLITL.js";import"../c-UGHH4MB3.js";import"../c-LA2BW7UY.js";import"../c-ZKELCT4T.js";import"../c-ATKAOH23.js";import"../c-EK63G3CG.js";import"../c-NQJRVJ56.js";import"../c-XGH4GS2T.js";import"../c-IJUK2GPW.js";import"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import"../c-EGTIAL6P.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-VG5XIN4T.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";export{c as bytesUnsaved,b as hasUnsavedChanges,a as reloadAfterDiscard};
@@ -1 +1 @@
1
- import{f as t,s as n,v as i}from"../c-GVPNDIKJ.js";import"../c-ATKAOH23.js";import"../c-EK63G3CG.js";import"../c-NQJRVJ56.js";import"../c-XGH4GS2T.js";import"../c-IJUK2GPW.js";import"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import{F as o,q as a,s as e}from"../c-EGTIAL6P.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-VG5XIN4T.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import{w as r}from"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";var s=window.clay=window.clay||{};s.internals={captureSnapshot:e,captureForSave:o,addDocumentTransform:a,region:r,save:{saveHtml:n,replacePageWith:i,isSaveInProgress:t}};var l=s.internals;export{l as default};
1
+ import{f as t,s as n,v as i}from"../c-ZKELCT4T.js";import"../c-ATKAOH23.js";import"../c-EK63G3CG.js";import"../c-NQJRVJ56.js";import"../c-XGH4GS2T.js";import"../c-IJUK2GPW.js";import"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import{F as o,q as a,s as e}from"../c-EGTIAL6P.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-VG5XIN4T.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import{w as r}from"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";var s=window.clay=window.clay||{};s.internals={captureSnapshot:e,captureForSave:o,addDocumentTransform:a,region:r,save:{saveHtml:n,replacePageWith:i,isSaveInProgress:t}};var l=s.internals;export{l as default};
@@ -0,0 +1 @@
1
+ import{f as W}from"./c-46XYM55L.js";import{a as J}from"./c-RS77ODLY.js";import"./c-7SWMYKAI.js";import{b as V}from"./c-FILLTJA7.js";import{a as $}from"./c-VKEDWYDF.js";import"./c-UGHH4MB3.js";import"./c-LA2BW7UY.js";import"./c-IJUK2GPW.js";import{b as F}from"./c-CYWLPPUS.js";import{i as H}from"./c-VG5XIN4T.js";import{a as G}from"./c-2YYDMLNZ.js";import{c as B,l as z}from"./c-HA6INT6J.js";import"./c-ICMAOOGK.js";import"./c-WRBKEJD4.js";import"./c-VHNSBD2M.js";var X={always:["lib/mutation.js","core/preserve-authored.js","core/edit-mode.js","core/mode-key.js","core/stale-host-notice.js","core/page-data.js"],editOnly:["core/snapshot.js","core/persist.js","core/admin-attrs.js","core/save-core.js","core/save.js","core/conflict-notice.js","core/recovery.js","core/unsaved-warning.js","core/autosave.js","attrs/save-freeze.js","attrs/onaftersave.js","attrs/refetch-on-save.js","attrs/add-from.js","lib/cache-bust.js"]},w={richclay:{path:"plugins/richclay.js",editOnly:!0,default:!0},indicator:{path:"plugins/indicator.js",editOnly:!0,default:!1},sync:{path:"sync/live-sync.js",editOnly:!1,default:!1},live:{path:"plugins/live.js",editOnly:!1,default:!1},page:{path:"plugins/page.js",editOnly:!0,default:!1},"page-view":{path:"plugins/page-view.js",editOnly:!1,default:!1,internal:!0},sortable:{path:"plugins/sortable.js",editOnly:!0,default:!1},undo:{path:"plugins/undo.js",editOnly:!0,default:!1},unsent:{path:"plugins/unsent.js",editOnly:!0,default:!1},cms:{path:"plugins/cms.js",editOnly:!1,default:!1},quickcrop:{path:"plugins/quickcrop.js",editOnly:!1,default:!1},upload:{path:"plugins/upload.js",editOnly:!0,default:!1},people:{path:"plugins/people.js",editOnly:!1,default:!1},menu:{path:"plugins/menu.js",editOnly:!1,default:!1},wire:{path:"plugins/wire.js",editOnly:!1,default:!1},message:{path:"plugins/message.js",editOnly:!1,default:!1},like:{path:"plugins/like.js",editOnly:!1,default:!1},"ai-edit":{path:"plugins/ai-edit.js",editOnly:!0,default:!1},demo:{path:"plugins/demo.js",editOnly:!1,default:!1},source:{path:"plugins/source.js",editOnly:!0,default:!0},"visitor-drafts":{path:"plugins/visitor-drafts.js",ownerPath:"plugins/visitor-drafts-owner.js",editOnly:!1,default:!1},"bind-text":{path:"plugins/bind-text.js",editOnly:!0,default:!1},derive:{path:"plugins/derive.js",editOnly:!1,default:!1},upgrade:{path:"plugins/upgrade.js",editOnly:!1,default:!1}},b={"core/is-edit-mode.js":()=>import("./core/is-edit-mode-GCX6767E.js"),"core/draft-mode.js":()=>import("./core/draft-mode-WSQAT67S.js"),"lib/region-policy.js":()=>import("./lib/region-policy-KWBPROWF.js"),"lib/mutation.js":()=>import("./reader-core-RUIFH32Y.js").then(t=>t.core["lib/mutation.js"]),"core/edit-mode.js":()=>import("./reader-core-RUIFH32Y.js").then(t=>t.core["core/edit-mode.js"]),"core/mode-key.js":()=>import("./reader-core-RUIFH32Y.js").then(t=>t.core["core/mode-key.js"]),"core/stale-host-notice.js":()=>import("./reader-core-RUIFH32Y.js").then(t=>t.core["core/stale-host-notice.js"]),"core/page-data.js":()=>import("./reader-core-RUIFH32Y.js").then(t=>t.core["core/page-data.js"]),"core/preserve-authored.js":()=>import("./reader-core-RUIFH32Y.js").then(t=>t.core["core/preserve-authored.js"]),"core/snapshot.js":()=>import("./core/snapshot-O7II2AGG.js"),"core/save-core.js":()=>import("./core/save-core-DX3RFVO3.js"),"core/save.js":()=>import("./core/save-OJ5NSLS7.js"),"core/conflict-notice.js":()=>import("./core/conflict-notice-CEI3XY6A.js"),"core/recovery.js":()=>import("./core/recovery-DRFZRJED.js"),"core/unsaved-warning.js":()=>import("./core/unsaved-warning-HGYH7O4H.js"),"core/persist.js":()=>import("./core/persist-3OPWJKZS.js"),"core/admin-attrs.js":()=>import("./core/admin-attrs-ZG7R5V3E.js"),"core/autosave.js":()=>import("./core/autosave-GI3WNJYN.js"),"attrs/save-freeze.js":()=>import("./attrs/save-freeze-MTFVVYV5.js"),"attrs/onaftersave.js":()=>import("./attrs/onaftersave-OKSWEJQF.js"),"attrs/refetch-on-save.js":()=>import("./attrs/refetch-on-save-DPGJJMGN.js"),"attrs/add-from.js":()=>import("./attrs/add-from-T5LJXFFI.js"),"lib/cache-bust.js":()=>import("./lib/cache-bust-NH7VBWHO.js"),"plugins/richclay.js":()=>import("./plugins/richclay-S4NVJYIK.js"),"plugins/indicator.js":()=>import("./plugins/indicator-IPZJ35K6.js"),"sync/live-sync.js":()=>import("./sync/live-sync-RGQMMWK2.js"),"plugins/live.js":()=>import("./plugins/live-GPQXSXSM.js"),"plugins/page.js":()=>import("./plugins/page-BAVLWCP6.js"),"plugins/page-view.js":()=>import("./plugins/page-view-P3UGJFDZ.js"),"plugins/sortable.js":()=>import("./plugins/sortable-WJZZBM7R.js"),"plugins/undo.js":()=>import("./plugins/undo-3JEYK5QY.js"),"plugins/unsent.js":()=>import("./plugins/unsent-OA4RGBUT.js"),"plugins/cms.js":()=>import("./plugins/cms-IFTKWF4S.js"),"plugins/quickcrop.js":()=>import("./plugins/quickcrop-E34PUYA3.js"),"plugins/upload.js":()=>import("./plugins/upload-TTCQRIM5.js"),"plugins/people.js":()=>import("./plugins/people-Z4RGVQAV.js"),"plugins/menu.js":()=>import("./plugins/menu-UN3KRCOF.js"),"plugins/wire.js":()=>import("./plugins/wire-SYVIBNSE.js"),"plugins/message.js":()=>import("./plugins/message-LQ6EDH4V.js"),"plugins/like.js":()=>import("./plugins/like-EV7MTZ56.js"),"plugins/ai-edit.js":()=>import("./plugins/ai-edit-45A2J6LC.js"),"plugins/demo.js":()=>import("./plugins/demo-42BSYQ7T.js"),"plugins/visitor-drafts.js":()=>import("./plugins/visitor-drafts-2AWNT23K.js"),"plugins/visitor-drafts-owner.js":()=>import("./plugins/visitor-drafts-owner-MZP45XSG.js"),"plugins/bind-text.js":()=>import("./plugins/bind-text-NX46N5UV.js"),"plugins/source.js":()=>import("./plugins/source-KVN6YNTY.js"),"plugins/derive.js":()=>import("./plugins/derive-QVI3LI3A.js"),"plugins/upgrade.js":()=>import("./plugins/upgrade-KTSICB22.js")},ie=["visitor-drafts","richclay","indicator","sortable","undo","unsent","quickcrop","upload","people","menu","upgrade","cms","page-view","sync","live","page","message","like","wire","ai-edit","demo","derive","bind-text","source"],re={cms:["quickcrop","upload","menu"],"ai-edit":["wire"],page:["live","sync","upload"]},ae={page:["richclay"]},ce=new Set(["source","sortable","menu","upgrade"]);function K(t,e,o,s){let u=t.get(e);if(u)for(let n of u.split(",")){let r=n.trim();if(r){if(!w[r]||w[r].internal){console.warn(`clayjs: unknown plugin "${r}"`);continue}s(o,r)}}}var le=["sync","live","page","upload","quickcrop","cms","people","menu","upgrade","wire","ai-edit","demo","source"],ue=["attrs/refetch-on-save.js","core/conflict-notice.js"],de="https://hyperclay.com/templates/";function P(t,e,{isDraftMode:o=!1,hasSap:s=!1,hasVariants:u=!1,canEdit:n=!1,templateSource:r=null}={}){let g=[...X.always];e&&g.push(...X.editOnly);let m=new Set;K(t,"plugins",m,(i,l)=>i.add(l));let a=new Set;K(t,"exclude",a,(i,l)=>i.add(l));let d=new Set(m);for(let[i,l]of Object.entries(w))l.default&&d.add(i);s&&d.add("derive"),u&&(e||n)&&d.add("menu"),a.has("wire")&&d.delete("ai-edit"),!e&&!o&&d.has("page")&&d.add("page-view");for(let i of[...d])if(!a.has(i)&&!(w[i].editOnly&&!e))for(let l of re[i]||[])d.add(l);for(let i of a)d.delete(i);if(o){for(let i of le)d.delete(i);for(let i of ue){let l=g.indexOf(i);l>-1&&g.splice(l,1)}d.add("visitor-drafts")}!o&&n&&!a.has("upgrade")&&r&&r.startsWith(de)&&d.add("upgrade");for(let[i,l]of Object.entries(ae))if(d.has(i))for(let v of l)m.has(v)||d.delete(v);let c=[],h=[];for(let i of ie){if(!d.has(i))continue;let l=w[i];l.editOnly&&!e||(ce.has(i)?h:c).push(l.ownerPath&&!o?l.ownerPath:l.path)}return{core:g,plugins:c,late:h}}var C="data-deleted-at",R=(t,e)=>window.clay?.undo?.commit?window.clay.undo.commit(t,e):e(),Q=(t,e)=>t.dispatchEvent(new CustomEvent(e,{bubbles:!0})),I=Object.assign((t,{at:e=new Date().toISOString()}={})=>(R("Move to Trash",()=>t.setAttribute(C,e)),Q(t,"clay:trashed"),{undo:()=>I.restore(t)}),{is:t=>!!t.getAttribute(C),restore(t){R("Restore",()=>t.removeAttribute(C)),Q(t,"clay:restored")},purge(t){R("Delete forever",()=>t.remove())}});var Y=50,pe=1e3,fe='[clay~="no-snapshot"], [no-snapshot], [snapshot-remove]',k=0,ge=t=>{let e=t.nodeType===1?t:t.parentElement;if(!e)return"a detached node";let o=e.localName;return e.id?o+="#"+e.id:e.classList.length&&(o+="."+[...e.classList].slice(0,2).join(".")),"<"+o+">"};function me(t){let e=window.clay?.region?.resolveRegionPolicy;if(!e)return null;let o=s=>!!s&&!s.closest(fe)&&e(s).dirtyTracked;for(let s of t){if(s.type==="attributes"&&z(s.attributeName,s.target))continue;let u=s.target.nodeType===1?s.target:s.target.parentElement;if(o(u)&&!(s.type==="childList"&&![...s.addedNodes,...s.removedNodes].some(n=>n.nodeType!==1||o(n))))return s.target}return null}function _(t){let e=window.clay,o=e.Mutation,s=new Set,u=(y,p)=>{s.has(y)||(s.add(y),console.warn("clay.effect: "+p))},n=!1,r=!1,g=0,m=0;k&&e.isEditMode&&console.warn("clay.effect: an effect was created inside another effect, so a new one starts on every run. Create effects once, in clay.start.");let a=()=>{let y=Date.now();y-g>pe&&(g=y,m=0),++m>Y&&u("loop",`this effect ran more than ${Y} times in a second. Something keeps changing the document, often a timer or async callback the effect started.`)},d=()=>{if(n=!1,r)return;let y=null;o.pause(),k++;try{e.isEditMode===!0&&(a(),s.has("saved")||(y=new MutationObserver(()=>{}),y.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,characterData:!0})));let p=t();p&&typeof p.then=="function"&&(v(),console.error("clay.effect: fn returned a promise. It must be synchronous, so this effect was stopped."))}catch(p){console.error("clay.effect:",p)}finally{k--,o.resume();let p=y?y.takeRecords():[];if(y?.disconnect(),p.length){let O=me(p);O&&u("saved",`this effect changed ${ge(O)}, which is saved with the file. Effect writes never mark the page unsaved, so a merge can leave it dirty with no save scheduled. Draw derived values inside clay="no-dirty" or clay="editor-ui".`)}}},c=()=>{n||r||(n=!0,queueMicrotask(d))},h=["undo","redo"],i=()=>{for(let y of h)e.undo?.on?.(y,c)},l=o.onAnyChange({debounce:0,require:"observed"},c);document.addEventListener("clay:sync-applied",c),document.addEventListener("clay:modechange",i),i();let v=()=>{r=!0,l(),document.removeEventListener("clay:sync-applied",c),document.removeEventListener("clay:modechange",i);for(let y of h)e.undo?.off?.(y,c)};return c(),v}Object.defineProperty(_,"running",{get:()=>k>0});var he={overtype:()=>import("./c-PQ5LK6QE.js"),marked:()=>import("./c-XN6MBKI6.js"),highlight:()=>import("./c-33JJ6CBX.js"),"highlight/bash":()=>import("./c-KI7M4AY3.js"),"highlight/css":()=>import("./c-H4LG442Q.js"),"highlight/javascript":()=>import("./c-VDSS4K3Z.js"),"highlight/json":()=>import("./c-NRPJEVJS.js"),"highlight/python":()=>import("./c-5YIHJ3TJ.js"),"highlight/xml":()=>import("./c-WN5AY3OZ.js"),uimotion:()=>import("./c-B5CS55WR.js")};function ye(t){let e=new Map;function o(s){return Object.hasOwn(t,s)?(e.has(s)||e.set(s,t[s]().catch(u=>{throw e.delete(s),u})),e.get(s)):Promise.reject(new Error(`clay.assets: no asset named "${s}"`))}return{load:o,names:()=>Object.keys(t)}}var Z=ye(he);function L(t,e){if(!t||!e)return t;let o={...e,...t};for(let s of["entries","imports","bootImports"])o[s]={...e[s],...t[s]};return o}var je="plugins/page.js";function M(t,e,{isEditMode:o=!1,isDraftMode:s=!1,hasSapJs:u=!1}={},n=document){if(!t?.entries)return 0;let r=[...e];for(let c of e)for(let h of t.bootImports?.[c]??[])u&&h==="vendor/sap-core.vendor.js"||r.push(h);o&&!s&&r.push(...t.editBootImports??[]),o&&!s&&e.includes(je)&&r.push(...t.editorBootImports??[]);let g=new Set,m=c=>{if(!(!c||g.has(c))){g.add(c);for(let h of t.imports?.[c]??[])m(h)}};for(let c of r)m(t.entries[c]);let a=new Set([...n.querySelectorAll('link[rel="modulepreload"]')].map(c=>c.href)),d=0;for(let c of g){let h=new URL(c,t.base).href;if(a.has(h))continue;let i=n.createElement("link");i.rel="modulepreload",i.href=h,i.setAttribute("clay","no-save"),n.head.append(i),d++}return d}var E=Object.fromEntries(Object.entries(w).flatMap(([t,e])=>e.ownerPath?[[e.path,t],[e.ownerPath,t]]:[[e.path,t]])),j={},ee=new Set;function se(t){ee.has(t)||(ee.add(t),document.dispatchEvent(new CustomEvent("clay:plugin-ready",{detail:{plugin:E[t]}})))}var ve=(t,e,o,s)=>()=>t().then(u=>(M(L(e,u),[...o.core,...o.plugins,...o.late],{isEditMode:!0,hasSapJs:s}),u));function we(){return new Promise(t=>$(t))}function A(){let t=document.querySelector('meta[name="hyper-source"]');return t?t.getAttribute("content"):null}async function He(t,e,o,s=null,u=null,n=null){W(),(await b["core/draft-mode.js"]()).noteBootParams(e),await we();let g=await b["core/is-edit-mode.js"](),{isEditMode:m,isDraftMode:a,isOwner:d,siteVisibility:c,canEdit:h}=g;m&&!a&&import("./core/host-permission-6EVJGNPL.js").then(f=>f.checkHostPermission()).catch(()=>{}),window.__hyperclayEditMode=m;let i=await b["lib/region-policy.js"](),l=!!document.querySelector("[sap]"),v=document.querySelectorAll("head style[clay-variant]").length>=2,y=!!document.querySelector('script[src*="sap.js"]');G.holdSettle=l&&m;let p=P(e,m,{isDraftMode:a,hasSap:l,hasVariants:v,canEdit:h,templateSource:A()});p.plugins.includes("plugins/demo.js")&&g.commitModeFacts({destination:"demo"}),M(L(s,u),[...p.core,...p.plugins],{isEditMode:m,isDraftMode:a,hasSapJs:y}),(m||a)&&!u&&n&&n().then(f=>M(L(s,f),[...p.core,...p.plugins],{isEditMode:m,isDraftMode:a,hasSapJs:y})).catch(()=>{});let O,oe=new Promise(f=>{O=f}),ne={sync:p.plugins.includes("sync/live-sync.js")};for(let f of p.core)j[f]=await b[f](),j[f].install?.();if(Se(j,{isDraftMode:a,isOwner:d,siteVisibility:c},i),te(j),document.documentElement.getAttribute("clay-mode-switch")==="live"){let f=P(e,!0,{isDraftMode:a,hasSap:l,hasVariants:v,canEdit:h,templateSource:A()});j["core/edit-mode.js"].noteLiveSwitch({edit:f,view:P(e,!1,{isDraftMode:a,hasSap:l,hasVariants:v,canEdit:h,templateSource:A()}),loaded:j,modules:b,attach:(S,D)=>{N(S,D);let T=E[S],x=window.clay.plugins;T&&Array.isArray(x)&&!x.includes(T)&&(window.clay.plugins=Object.freeze([...x,T]))},attachEditCore:te,announce:se,loadEditHints:n?ve(n,s,f,y):null,late:oe})}await j["core/edit-mode.js"].activateInitialMode(),window.clay.plugins=Object.freeze([...p.plugins,...p.late].map(f=>E[f]));let U=m?p:P(e,!0,{isDraftMode:a,hasSap:l,hasVariants:v,canEdit:h,templateSource:A()});window.clay.editPlugins=Object.freeze([...U.plugins,...U.late].map(f=>E[f]));for(let f of p.plugins){let S;try{S=await b[f]()}catch(D){console.error(`clayjs: plugin "${f}" failed to load, continuing without it:`,D);continue}j[f]=S,f==="plugins/page-view.js"&&S.start(ne),N(f,S,j)}await Promise.allSettled(p.plugins.map(f=>j[f]?.ready).filter(Boolean)),l&&Oe(j),Ee(g),o(window.clay),document.dispatchEvent(new CustomEvent("clay:ready",{detail:{clay:window.clay}})),p.late.length?be(p.late,g).then(O,O):O()}var q=(t,e)=>w[E[t]]?.editOnly&&!e.startsAtImport();async function be(t,e){try{await window.clay.page?.ready}catch{}for(let o of t)if(!q(o,e))try{let s=await b[o]();if(q(o,e)||(j[o]=s,N(o,s,j),await s.ready,q(o,e)))continue;se(o)}catch(s){console.error(`clayjs: plugin "${o}" failed to load, continuing without it:`,s),document.dispatchEvent(new CustomEvent("clay:plugin-failed",{detail:{plugin:E[o]}}))}}function Oe(t){let e=t["core/save.js"],o=null;try{o=e?e.currentPaintSignature():null}catch(s){console.error("clayjs: could not read the page's painted values:",s)}try{window.Sap&&typeof window.Sap.mount=="function"&&window.Sap.mount()}catch(s){console.error("clayjs: the derive engine failed to mount:",s)}finally{e?.releaseBootSettle()}e&&o!=null&&e.schedulePaintHeal(o)}function Se(t,{isDraftMode:e,isOwner:o,siteVisibility:s},u){let n=window.clay,r=t["lib/mutation.js"],g=t["core/edit-mode.js"];Object.assign(n,{toggleEditMode:g.toggleEditMode,setMode:g.setMode,modeLifecycle:g.modeLifecycle,isDraftMode:e,isOwner:o,siteVisibility:s,Mutation:r.default,region:u.windowRegionShape});for(let a of["mode","isEditMode","canEdit"])Object.defineProperty(n,a,{get:()=>g[a],enumerable:!0,configurable:!0});n.assets=Z;let m=t["core/page-data.js"];n.readData=m.readData,n.writeData=m.writeData,n.ephemeral=B,n.storage=F,n.host={get versions(){return import("./c-ZRXJD4G6.js").then(a=>a.hostVersions())}},n.trash=I,n.derived=H,n.effect=_,n.style=J,n.morph=(a,d,c)=>V().then(({morph:h})=>h(a,d,c))}function te(t){let e=window.clay,o=t["core/save.js"];if(o){let r=o.savePage||o.default;r.force=o.savePageForce,r.overwrite=o.saveOverwritingConflict,r.flush=o.flushSave,r.soon=o.savePageSoon,r.limits=o.saveLimits,r.inspect=o.inspectSaveSize,e.save!==r&&typeof e.save?.replace=="function"&&(r.replace=e.save.replace),e.save!==r&&(e.save=r)}e.hasUnsavedChanges=t["core/unsaved-warning.js"]?.hasUnsavedChanges??e.hasUnsavedChanges??(()=>!1);let s=t["core/snapshot.js"];s&&(e.getHTML||(e.getHTML=s.getPageContents),e.addDocumentTransform||(e.addDocumentTransform=s.addDocumentTransform),e.onSnapshot||(e.onSnapshot=s.onSnapshot));let u=t["lib/cache-bust.js"];u&&!e.cacheBust&&(e.cacheBust=u.default);let n=t["core/recovery.js"];n&&!e.recovery&&(e.recovery=n.recovery)}function N(t,e,o=j){let s=window.clay;t==="plugins/undo.js"?s.undo=e.undo||e.default:t==="plugins/unsent.js"?s.unsent=e.unsent:t==="sync/live-sync.js"?(s.morph=e.morph,s.conflicts=e.conflicts,o["core/page-data.js"].setPageDataLiveSync(e.liveSync)):t==="plugins/live.js"?s.live=e.live:t==="plugins/page.js"?s.page=e.page:t==="plugins/upgrade.js"?(s.save=s.save||{},s.save.replace=e.replace):t==="plugins/cms.js"?s.cms=e.cms||e.default:t==="plugins/upload.js"?s.upload=e.upload||e.default:t==="plugins/people.js"?(s.people=e.people,s.author=e.author,Object.defineProperty(s,"me",{get:e.currentMe,configurable:!0,enumerable:!0})):t==="plugins/message.js"?s.message=e.message:t==="plugins/like.js"?s.like=e.like:t==="plugins/wire.js"?s.wire=e.wire||e.default:t==="plugins/ai-edit.js"?s.aiEdit=e.aiEdit||e.default:t==="plugins/demo.js"?s.demo=e.demo:t==="plugins/richclay.js"?s.RichClay=e.RichClay||e.default:t==="plugins/quickcrop.js"?s.quickcrop=e.quickcrop||e.default:t==="plugins/sortable.js"?s.sortable=e.sortable:t==="plugins/source.js"?s.source=e.source||e.default:t==="plugins/visitor-drafts.js"||t==="plugins/visitor-drafts-owner.js"?s.visitorDrafts=e.visitorDrafts:t==="plugins/bind-text.js"&&(s.bindText=e.bindText)}function Ee(t){t.isEditMode||document.addEventListener("click",e=>{e.target.closest?.("[trigger-save]")&&(t.isEditMode||(console.info("clayjs: you're not the owner of this page; changes stay local"),document.dispatchEvent(new CustomEvent("clay:view-save-attempt"))))})}export{He as boot,Oe as mountDerivedEngine};
@@ -1 +1 @@
1
- export default {"version":"1.20.0","entries":{"options/options.js":"options/options-55LQHSJ4.js","route/route.js":"route/route-62CHXL5B.js","ui/index.js":"ui/index-QNIPDHXQ.js","utils/index.js":"utils/index-4TJCVLT7.js","vendor/sap-core.vendor.js":"vendor/sap-core.vendor-RN4ZVY4X.js","plugins/derive.js":"plugins/derive-FRE5JJQE.js","plugins/upgrade.js":"plugins/upgrade-NW556WJD.js","dom/all.js":"dom/all-APS5ZSKP.js","dom/dom-helpers.js":"dom/dom-helpers-L7OSR6S4.js","events/index.js":"events/index-B6TGDYMG.js","internals/index.js":"internals/index-HDRANDWE.js","plugins/menu.js":"plugins/menu-KGWKT6CS.js","plugins/wire.js":"plugins/wire-VRYPY6EJ.js","plugins/message.js":"plugins/message-LQ6EDH4V.js","plugins/like.js":"plugins/like-EV7MTZ56.js","plugins/demo.js":"plugins/demo-42BSYQ7T.js","plugins/visitor-drafts.js":"plugins/visitor-drafts-2AWNT23K.js","plugins/visitor-drafts-owner.js":"plugins/visitor-drafts-owner-MZP45XSG.js","plugins/page-view.js":"plugins/page-view-5KQ76IJB.js","plugins/cms.js":"plugins/cms-LRAOZHT7.js","plugins/quickcrop.js":"plugins/quickcrop-BQ5YYFCH.js","plugins/people.js":"plugins/people-C7TVBBMR.js","sync/live-sync.js":"sync/live-sync-SKPMFYOO.js","plugins/live.js":"plugins/live-5EZN2EYP.js","loader.js":"loader-DZZLUBVB.js","reader-core.js":"reader-core-2GXY7SHY.js","lib/mutation.js":"reader-core-2GXY7SHY.js","core/preserve-authored.js":"reader-core-2GXY7SHY.js","core/edit-mode.js":"reader-core-2GXY7SHY.js","core/mode-key.js":"reader-core-2GXY7SHY.js","core/stale-host-notice.js":"reader-core-2GXY7SHY.js","core/page-data.js":"reader-core-2GXY7SHY.js"},"imports":{"options/options-55LQHSJ4.js":["c-7SWMYKAI.js","c-LA2BW7UY.js","c-IJUK2GPW.js","c-VG5XIN4T.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-LA2BW7UY.js":["c-IJUK2GPW.js","c-VG5XIN4T.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-VG5XIN4T.js":["c-2YYDMLNZ.js"],"c-HA6INT6J.js":["c-WRBKEJD4.js"],"c-ICMAOOGK.js":["c-WRBKEJD4.js"],"route/route-62CHXL5B.js":["c-VHNSBD2M.js"],"ui/index-QNIPDHXQ.js":["c-W23KVGUO.js","c-BRLCTNMC.js","c-QHWJ5ZIJ.js","c-RG6XUZFA.js","c-UL2YUY52.js","c-QY7F6EN6.js","c-CJFDLD43.js","c-BJ7YQ5QZ.js","c-4JZDZFF6.js","c-VAK7SG37.js","c-MHI3GYKF.js","c-2AZDZWCK.js","c-46XYM55L.js","c-NUHP2XDB.js","c-VKEDWYDF.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-W23KVGUO.js":["c-BRLCTNMC.js","c-QHWJ5ZIJ.js","c-RG6XUZFA.js","c-UL2YUY52.js","c-BJ7YQ5QZ.js","c-VAK7SG37.js","c-VKEDWYDF.js"],"c-BRLCTNMC.js":["c-QHWJ5ZIJ.js","c-CJFDLD43.js","c-BJ7YQ5QZ.js","c-NUHP2XDB.js"],"c-QHWJ5ZIJ.js":["c-4JZDZFF6.js","c-46XYM55L.js"],"c-CJFDLD43.js":["c-BJ7YQ5QZ.js","c-VAK7SG37.js","c-MHI3GYKF.js","c-NUHP2XDB.js"],"c-BJ7YQ5QZ.js":["c-VAK7SG37.js","c-NUHP2XDB.js"],"c-RG6XUZFA.js":["c-QY7F6EN6.js","c-BJ7YQ5QZ.js","c-VAK7SG37.js","c-MHI3GYKF.js","c-NUHP2XDB.js"],"c-QY7F6EN6.js":["c-ICMAOOGK.js"],"utils/index-4TJCVLT7.js":["c-UL2YUY52.js","c-GQ6F6IDK.js","c-P7KNDG34.js","c-VHNSBD2M.js"],"vendor/sap-core.vendor-RN4ZVY4X.js":["c-VHNSBD2M.js"],"plugins/derive-FRE5JJQE.js":["c-VHNSBD2M.js"],"plugins/upgrade-NW556WJD.js":["c-3G2DGZUP.js","c-VHNSBD2M.js"],"dom/all-APS5ZSKP.js":["c-VHNSBD2M.js"],"dom/dom-helpers-L7OSR6S4.js":["c-XQXZAO7N.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-XQXZAO7N.js":["c-WRBKEJD4.js"],"events/index-B6TGDYMG.js":["c-LA2BW7UY.js","c-IJUK2GPW.js","c-VG5XIN4T.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"internals/index-HDRANDWE.js":["c-GVPNDIKJ.js","c-ATKAOH23.js","c-EK63G3CG.js","c-NQJRVJ56.js","c-XGH4GS2T.js","c-IJUK2GPW.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-EGTIAL6P.js","c-XQXZAO7N.js","c-S7LK4KUE.js","c-VG5XIN4T.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-GVPNDIKJ.js":["c-ATKAOH23.js","c-EK63G3CG.js","c-NQJRVJ56.js","c-XGH4GS2T.js","c-IJUK2GPW.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-N7JPUPGC.js","c-EGTIAL6P.js"],"c-NQJRVJ56.js":["c-XGH4GS2T.js","c-3O7OBDCM.js","c-BPF2NSPV.js"],"c-XGH4GS2T.js":["c-3O7OBDCM.js","c-BPF2NSPV.js"],"c-3O7OBDCM.js":["c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js"],"c-BPF2NSPV.js":["c-HA6INT6J.js"],"c-EGTIAL6P.js":["c-XQXZAO7N.js","c-S7LK4KUE.js","c-VG5XIN4T.js","c-HA6INT6J.js","c-ICMAOOGK.js"],"plugins/menu-KGWKT6CS.js":["c-D3E4WJ4M.js","c-AQLFEATB.js","c-QY7F6EN6.js","c-RVMWGXEJ.js","c-MHI3GYKF.js","c-RHMPKZZ7.js","c-VKEDWYDF.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"plugins/wire-VRYPY6EJ.js":["c-I2IFKJX2.js","c-XGH4GS2T.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-HA6INT6J.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-I2IFKJX2.js":["c-XGH4GS2T.js","c-3O7OBDCM.js","c-BPF2NSPV.js"],"plugins/message-LQ6EDH4V.js":["c-VHNSBD2M.js"],"plugins/like-EV7MTZ56.js":["c-VHNSBD2M.js"],"plugins/demo-42BSYQ7T.js":["c-JAX2667S.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"plugins/visitor-drafts-2AWNT23K.js":["c-Y6F2FORL.js","c-QY7F6EN6.js","c-MTQHWQC3.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"plugins/visitor-drafts-owner-MZP45XSG.js":["c-MTQHWQC3.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-HA6INT6J.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"plugins/page-view-5KQ76IJB.js":["c-DHXPDLW6.js","c-L4WQSC27.js","c-XGH4GS2T.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-HA6INT6J.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-DHXPDLW6.js":["c-XGH4GS2T.js","c-3O7OBDCM.js"],"plugins/cms-LRAOZHT7.js":["c-JAX2667S.js","c-OJYM642Q.js","c-BJ7YQ5QZ.js","c-4JZDZFF6.js","c-VAK7SG37.js","c-MHI3GYKF.js","c-NUHP2XDB.js","c-VHNSBD2M.js"],"c-OJYM642Q.js":["c-BJ7YQ5QZ.js","c-4JZDZFF6.js"],"plugins/quickcrop-BQ5YYFCH.js":["c-CJFDLD43.js","c-OJYM642Q.js","c-BJ7YQ5QZ.js","c-4JZDZFF6.js","c-VAK7SG37.js","c-MHI3GYKF.js","c-NUHP2XDB.js","c-VHNSBD2M.js"],"plugins/people-C7TVBBMR.js":["c-RVMWGXEJ.js","c-XGH4GS2T.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-HA6INT6J.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"sync/live-sync-SKPMFYOO.js":["c-AL4RBJF2.js","c-DHXPDLW6.js","c-LZJPNR2W.js","c-FILLTJA7.js","c-5VYOWDTI.js","c-GSRLXYWL.js","c-WYFDLITL.js","c-LA2BW7UY.js","c-ATKAOH23.js","c-EK63G3CG.js","c-NQJRVJ56.js","c-XGH4GS2T.js","c-IJUK2GPW.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-EGTIAL6P.js","c-XQXZAO7N.js","c-S7LK4KUE.js","c-VG5XIN4T.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-AL4RBJF2.js":["c-DHXPDLW6.js","c-LZJPNR2W.js","c-FILLTJA7.js","c-5VYOWDTI.js","c-GSRLXYWL.js","c-LA2BW7UY.js","c-ATKAOH23.js","c-EK63G3CG.js","c-NQJRVJ56.js","c-XGH4GS2T.js","c-IJUK2GPW.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-EGTIAL6P.js","c-VG5XIN4T.js","c-HA6INT6J.js","c-ICMAOOGK.js"],"c-GSRLXYWL.js":["c-WYFDLITL.js","c-LA2BW7UY.js","c-3O7OBDCM.js","c-ICMAOOGK.js"],"plugins/live-5EZN2EYP.js":["c-UXEVJ63W.js","c-JKZJIUIP.js","c-TCCA5BZN.js","c-3LDGIBMN.js","c-57XDY6HC.js","c-LZJPNR2W.js","c-NLZ5AN4L.js","c-4ASQPRQL.js","c-GQ6F6IDK.js","c-I2SCCUEW.js","c-5VYOWDTI.js","c-GSRLXYWL.js","c-X5LNHET5.js","c-WYFDLITL.js","c-UGHH4MB3.js","c-LA2BW7UY.js","c-GVPNDIKJ.js","c-ATKAOH23.js","c-EK63G3CG.js","c-NQJRVJ56.js","c-XGH4GS2T.js","c-IJUK2GPW.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-EGTIAL6P.js","c-XQXZAO7N.js","c-S7LK4KUE.js","c-VG5XIN4T.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-UXEVJ63W.js":["c-JKZJIUIP.js","c-TCCA5BZN.js","c-3LDGIBMN.js","c-57XDY6HC.js","c-LZJPNR2W.js","c-NLZ5AN4L.js","c-I2SCCUEW.js","c-GVPNDIKJ.js","c-ATKAOH23.js","c-EK63G3CG.js","c-NQJRVJ56.js","c-XGH4GS2T.js","c-3O7OBDCM.js","c-EGTIAL6P.js"],"c-NLZ5AN4L.js":["c-4ASQPRQL.js","c-GQ6F6IDK.js","c-I2SCCUEW.js","c-5VYOWDTI.js","c-GSRLXYWL.js","c-X5LNHET5.js","c-UGHH4MB3.js","c-LA2BW7UY.js","c-GVPNDIKJ.js","c-EK63G3CG.js","c-NQJRVJ56.js","c-IJUK2GPW.js","c-3O7OBDCM.js","c-N7JPUPGC.js","c-EGTIAL6P.js","c-VG5XIN4T.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js"],"c-X5LNHET5.js":["c-3O7OBDCM.js"],"loader-DZZLUBVB.js":["c-46XYM55L.js","c-RS77ODLY.js","c-7SWMYKAI.js","c-FILLTJA7.js","c-VKEDWYDF.js","c-UGHH4MB3.js","c-LA2BW7UY.js","c-IJUK2GPW.js","c-CYWLPPUS.js","c-VG5XIN4T.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-RS77ODLY.js":["c-7SWMYKAI.js","c-UGHH4MB3.js","c-LA2BW7UY.js"],"reader-core-2GXY7SHY.js":["c-NUHP2XDB.js","c-TWCXBWS3.js","c-VKEDWYDF.js","c-LA2BW7UY.js","c-XGH4GS2T.js","c-IJUK2GPW.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-VG5XIN4T.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-TWCXBWS3.js":["c-LA2BW7UY.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-VHNSBD2M.js"]},"bootImports":{"plugins/derive.js":["vendor/sap-core.vendor.js"]}};
1
+ export default {"version":"1.22.0","entries":{"options/options.js":"options/options-55LQHSJ4.js","route/route.js":"route/route-62CHXL5B.js","ui/index.js":"ui/index-EZGLEM5P.js","utils/index.js":"utils/index-4TJCVLT7.js","vendor/sap-core.vendor.js":"vendor/sap-core.vendor-OA5SKL7Q.js","plugins/derive.js":"plugins/derive-QVI3LI3A.js","plugins/upgrade.js":"plugins/upgrade-KTSICB22.js","dom/all.js":"dom/all-APS5ZSKP.js","dom/dom-helpers.js":"dom/dom-helpers-L7OSR6S4.js","events/index.js":"events/index-B6TGDYMG.js","internals/index.js":"internals/index-V4WC44FU.js","plugins/menu.js":"plugins/menu-UN3KRCOF.js","plugins/wire.js":"plugins/wire-SYVIBNSE.js","plugins/message.js":"plugins/message-LQ6EDH4V.js","plugins/like.js":"plugins/like-EV7MTZ56.js","plugins/demo.js":"plugins/demo-42BSYQ7T.js","plugins/visitor-drafts.js":"plugins/visitor-drafts-2AWNT23K.js","plugins/visitor-drafts-owner.js":"plugins/visitor-drafts-owner-MZP45XSG.js","plugins/page-view.js":"plugins/page-view-P3UGJFDZ.js","plugins/cms.js":"plugins/cms-IFTKWF4S.js","plugins/quickcrop.js":"plugins/quickcrop-E34PUYA3.js","plugins/people.js":"plugins/people-Z4RGVQAV.js","sync/live-sync.js":"sync/live-sync-RGQMMWK2.js","plugins/live.js":"plugins/live-GPQXSXSM.js","loader.js":"loader-V6VI46HU.js","reader-core.js":"reader-core-RUIFH32Y.js","lib/mutation.js":"reader-core-RUIFH32Y.js","core/preserve-authored.js":"reader-core-RUIFH32Y.js","core/edit-mode.js":"reader-core-RUIFH32Y.js","core/mode-key.js":"reader-core-RUIFH32Y.js","core/stale-host-notice.js":"reader-core-RUIFH32Y.js","core/page-data.js":"reader-core-RUIFH32Y.js"},"imports":{"options/options-55LQHSJ4.js":["c-7SWMYKAI.js","c-LA2BW7UY.js","c-IJUK2GPW.js","c-VG5XIN4T.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-LA2BW7UY.js":["c-IJUK2GPW.js","c-VG5XIN4T.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-VG5XIN4T.js":["c-2YYDMLNZ.js"],"c-HA6INT6J.js":["c-WRBKEJD4.js"],"c-ICMAOOGK.js":["c-WRBKEJD4.js"],"route/route-62CHXL5B.js":["c-VHNSBD2M.js"],"ui/index-EZGLEM5P.js":["c-HWR6GMGK.js","c-6RC66MYY.js","c-QHWJ5ZIJ.js","c-FAXQU7MQ.js","c-UL2YUY52.js","c-QY7F6EN6.js","c-6KBKYLPO.js","c-IHUWUKIU.js","c-4JZDZFF6.js","c-EUGJVHDD.js","c-MHI3GYKF.js","c-2AZDZWCK.js","c-46XYM55L.js","c-NUHP2XDB.js","c-VKEDWYDF.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-HWR6GMGK.js":["c-6RC66MYY.js","c-QHWJ5ZIJ.js","c-FAXQU7MQ.js","c-UL2YUY52.js","c-IHUWUKIU.js","c-EUGJVHDD.js","c-VKEDWYDF.js"],"c-6RC66MYY.js":["c-QHWJ5ZIJ.js","c-6KBKYLPO.js","c-IHUWUKIU.js","c-NUHP2XDB.js"],"c-QHWJ5ZIJ.js":["c-4JZDZFF6.js","c-46XYM55L.js"],"c-6KBKYLPO.js":["c-IHUWUKIU.js","c-EUGJVHDD.js","c-MHI3GYKF.js","c-NUHP2XDB.js"],"c-IHUWUKIU.js":["c-EUGJVHDD.js","c-NUHP2XDB.js"],"c-FAXQU7MQ.js":["c-QY7F6EN6.js","c-IHUWUKIU.js","c-EUGJVHDD.js","c-MHI3GYKF.js","c-NUHP2XDB.js"],"c-QY7F6EN6.js":["c-ICMAOOGK.js"],"utils/index-4TJCVLT7.js":["c-UL2YUY52.js","c-GQ6F6IDK.js","c-P7KNDG34.js","c-VHNSBD2M.js"],"vendor/sap-core.vendor-OA5SKL7Q.js":["c-VHNSBD2M.js"],"plugins/derive-QVI3LI3A.js":["c-VHNSBD2M.js"],"plugins/upgrade-KTSICB22.js":["c-3G2DGZUP.js","c-VHNSBD2M.js"],"dom/all-APS5ZSKP.js":["c-VHNSBD2M.js"],"dom/dom-helpers-L7OSR6S4.js":["c-XQXZAO7N.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-XQXZAO7N.js":["c-WRBKEJD4.js"],"events/index-B6TGDYMG.js":["c-LA2BW7UY.js","c-IJUK2GPW.js","c-VG5XIN4T.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"internals/index-V4WC44FU.js":["c-ZKELCT4T.js","c-ATKAOH23.js","c-EK63G3CG.js","c-NQJRVJ56.js","c-XGH4GS2T.js","c-IJUK2GPW.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-EGTIAL6P.js","c-XQXZAO7N.js","c-S7LK4KUE.js","c-VG5XIN4T.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-ZKELCT4T.js":["c-ATKAOH23.js","c-EK63G3CG.js","c-NQJRVJ56.js","c-XGH4GS2T.js","c-IJUK2GPW.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-N7JPUPGC.js","c-EGTIAL6P.js"],"c-NQJRVJ56.js":["c-XGH4GS2T.js","c-3O7OBDCM.js","c-BPF2NSPV.js"],"c-XGH4GS2T.js":["c-3O7OBDCM.js","c-BPF2NSPV.js"],"c-3O7OBDCM.js":["c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js"],"c-BPF2NSPV.js":["c-HA6INT6J.js"],"c-EGTIAL6P.js":["c-XQXZAO7N.js","c-S7LK4KUE.js","c-VG5XIN4T.js","c-HA6INT6J.js","c-ICMAOOGK.js"],"plugins/menu-UN3KRCOF.js":["c-HDWZEJHM.js","c-AQLFEATB.js","c-QY7F6EN6.js","c-RVMWGXEJ.js","c-MHI3GYKF.js","c-RHMPKZZ7.js","c-VKEDWYDF.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"plugins/wire-SYVIBNSE.js":["c-ZAHTFCXQ.js","c-XGH4GS2T.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-HA6INT6J.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-ZAHTFCXQ.js":["c-XGH4GS2T.js","c-3O7OBDCM.js","c-BPF2NSPV.js"],"plugins/message-LQ6EDH4V.js":["c-VHNSBD2M.js"],"plugins/like-EV7MTZ56.js":["c-VHNSBD2M.js"],"plugins/demo-42BSYQ7T.js":["c-JAX2667S.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"plugins/visitor-drafts-2AWNT23K.js":["c-Y6F2FORL.js","c-QY7F6EN6.js","c-MTQHWQC3.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"plugins/visitor-drafts-owner-MZP45XSG.js":["c-MTQHWQC3.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-HA6INT6J.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"plugins/page-view-P3UGJFDZ.js":["c-6PBXRWDX.js","c-L4WQSC27.js","c-XGH4GS2T.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-HA6INT6J.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-6PBXRWDX.js":["c-XGH4GS2T.js","c-3O7OBDCM.js"],"plugins/cms-IFTKWF4S.js":["c-JAX2667S.js","c-5FKRZNJV.js","c-IHUWUKIU.js","c-4JZDZFF6.js","c-EUGJVHDD.js","c-MHI3GYKF.js","c-NUHP2XDB.js","c-VHNSBD2M.js"],"c-5FKRZNJV.js":["c-IHUWUKIU.js","c-4JZDZFF6.js"],"plugins/quickcrop-E34PUYA3.js":["c-6KBKYLPO.js","c-5FKRZNJV.js","c-IHUWUKIU.js","c-4JZDZFF6.js","c-EUGJVHDD.js","c-MHI3GYKF.js","c-NUHP2XDB.js","c-VHNSBD2M.js"],"plugins/people-Z4RGVQAV.js":["c-RVMWGXEJ.js","c-XGH4GS2T.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-HA6INT6J.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"sync/live-sync-RGQMMWK2.js":["c-ILGQ3UXQ.js","c-6PBXRWDX.js","c-LZJPNR2W.js","c-FILLTJA7.js","c-5VYOWDTI.js","c-GSRLXYWL.js","c-WYFDLITL.js","c-LA2BW7UY.js","c-ATKAOH23.js","c-EK63G3CG.js","c-NQJRVJ56.js","c-XGH4GS2T.js","c-IJUK2GPW.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-EGTIAL6P.js","c-XQXZAO7N.js","c-S7LK4KUE.js","c-VG5XIN4T.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-ILGQ3UXQ.js":["c-6PBXRWDX.js","c-LZJPNR2W.js","c-FILLTJA7.js","c-5VYOWDTI.js","c-GSRLXYWL.js","c-LA2BW7UY.js","c-ATKAOH23.js","c-EK63G3CG.js","c-NQJRVJ56.js","c-XGH4GS2T.js","c-IJUK2GPW.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-EGTIAL6P.js","c-VG5XIN4T.js","c-HA6INT6J.js","c-ICMAOOGK.js"],"c-GSRLXYWL.js":["c-WYFDLITL.js","c-LA2BW7UY.js","c-3O7OBDCM.js","c-ICMAOOGK.js"],"plugins/live-GPQXSXSM.js":["c-VIW5X35H.js","c-JKZJIUIP.js","c-TCCA5BZN.js","c-3LDGIBMN.js","c-57XDY6HC.js","c-LZJPNR2W.js","c-DKFSOJCV.js","c-4ASQPRQL.js","c-GQ6F6IDK.js","c-I2SCCUEW.js","c-5VYOWDTI.js","c-GSRLXYWL.js","c-X5LNHET5.js","c-WYFDLITL.js","c-UGHH4MB3.js","c-LA2BW7UY.js","c-ZKELCT4T.js","c-ATKAOH23.js","c-EK63G3CG.js","c-NQJRVJ56.js","c-XGH4GS2T.js","c-IJUK2GPW.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-EGTIAL6P.js","c-XQXZAO7N.js","c-S7LK4KUE.js","c-VG5XIN4T.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-VIW5X35H.js":["c-JKZJIUIP.js","c-TCCA5BZN.js","c-3LDGIBMN.js","c-57XDY6HC.js","c-LZJPNR2W.js","c-DKFSOJCV.js","c-I2SCCUEW.js","c-ZKELCT4T.js","c-ATKAOH23.js","c-EK63G3CG.js","c-NQJRVJ56.js","c-XGH4GS2T.js","c-3O7OBDCM.js","c-EGTIAL6P.js"],"c-DKFSOJCV.js":["c-4ASQPRQL.js","c-GQ6F6IDK.js","c-I2SCCUEW.js","c-5VYOWDTI.js","c-GSRLXYWL.js","c-X5LNHET5.js","c-UGHH4MB3.js","c-LA2BW7UY.js","c-ZKELCT4T.js","c-EK63G3CG.js","c-NQJRVJ56.js","c-IJUK2GPW.js","c-3O7OBDCM.js","c-N7JPUPGC.js","c-EGTIAL6P.js","c-VG5XIN4T.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js"],"c-X5LNHET5.js":["c-3O7OBDCM.js"],"loader-V6VI46HU.js":["c-46XYM55L.js","c-RS77ODLY.js","c-7SWMYKAI.js","c-FILLTJA7.js","c-VKEDWYDF.js","c-UGHH4MB3.js","c-LA2BW7UY.js","c-IJUK2GPW.js","c-CYWLPPUS.js","c-VG5XIN4T.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-RS77ODLY.js":["c-7SWMYKAI.js","c-UGHH4MB3.js","c-LA2BW7UY.js"],"reader-core-RUIFH32Y.js":["c-NUHP2XDB.js","c-TWCXBWS3.js","c-VKEDWYDF.js","c-LA2BW7UY.js","c-XGH4GS2T.js","c-IJUK2GPW.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-VG5XIN4T.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-TWCXBWS3.js":["c-LA2BW7UY.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-VHNSBD2M.js"]},"bootImports":{"plugins/derive.js":["vendor/sap-core.vendor.js"]}};