@panphora/clayjs 1.21.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 (122) 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 +7698 -7969
  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-5FEU5MMY.js → c-HAVGDXAL.js} +1 -1
  40. package/dist/m/{c-W23KVGUO.js → c-HWR6GMGK.js} +1 -1
  41. package/dist/m/{c-BJ7YQ5QZ.js → c-IHUWUKIU.js} +1 -1
  42. package/dist/m/{c-AL4RBJF2.js → c-ILGQ3UXQ.js} +1 -1
  43. package/dist/m/{c-W3K23S72.js → c-IWTTOC2V.js} +1 -1
  44. package/dist/m/c-JFST6QE7.js +1 -0
  45. package/dist/m/{c-FNVQAACK.js → c-KE33W4RE.js} +1 -1
  46. package/dist/m/c-KV7R47FR.js +1 -0
  47. package/dist/m/{c-LPUJXRXW.js → c-L7K5EXU2.js} +1 -1
  48. package/dist/m/{c-3YH6JSIL.js → c-LF6HNVPU.js} +1 -1
  49. package/dist/m/{c-MIL4B2JQ.js → c-MRURHLKV.js} +1 -1
  50. package/dist/m/{c-LQU7TXIH.js → c-N33TPVTL.js} +1 -1
  51. package/dist/m/{c-EOCZ2YVL.js → c-NBNRLZXO.js} +1 -1
  52. package/dist/m/{c-JUE7B4OX.js → c-NLWEZYKJ.js} +1 -1
  53. package/dist/m/{c-DDDOKPI6.js → c-NNNR7OXA.js} +1 -1
  54. package/dist/m/{c-E4IBSAQM.js → c-OI2BYWVV.js} +1 -1
  55. package/dist/m/{c-SBSMJIPC.js → c-P3WATEDR.js} +1 -1
  56. package/dist/m/{c-ZJLU56DV.js → c-PCEMXY2K.js} +1 -1
  57. package/dist/m/{c-3GJ4XARY.js → c-PWBJVHA4.js} +1 -1
  58. package/dist/m/{c-67ILSNPR.js → c-Q5KAQJAG.js} +1 -1
  59. package/dist/m/{c-U5X57T4L.js → c-QHVCUTJV.js} +1 -1
  60. package/dist/m/{c-GKEATME6.js → c-QJFYVCJO.js} +1 -1
  61. package/dist/m/{c-VY6XRBOW.js → c-QTC6VGA4.js} +1 -1
  62. package/dist/m/{c-44B5ODN7.js → c-TMT5TL65.js} +2 -2
  63. package/dist/m/{c-OABVRYOT.js → c-TV7JHSRL.js} +1 -1
  64. package/dist/m/{c-SO63UGPQ.js → c-UWT4CXQ4.js} +1 -1
  65. package/dist/m/{c-EFD6QNTE.js → c-VFES2BP5.js} +1 -1
  66. package/dist/m/{c-UXEVJ63W.js → c-VIW5X35H.js} +1 -1
  67. package/dist/m/{c-EOCKLMKX.js → c-WWE67K5Y.js} +1 -1
  68. package/dist/m/{c-J3BXFTZS.js → c-XDVAZDUE.js} +1 -1
  69. package/dist/m/{c-K76AUL4I.js → c-XZJ5IK6Q.js} +1 -1
  70. package/dist/m/{c-2ZZBC45O.js → c-Z7RJANGO.js} +1 -1
  71. package/dist/m/{c-I2IFKJX2.js → c-ZAHTFCXQ.js} +1 -1
  72. package/dist/m/{c-GVPNDIKJ.js → c-ZKELCT4T.js} +1 -1
  73. package/dist/m/{c-7SXYQCN4.js → c-ZO6VL2SC.js} +1 -1
  74. package/dist/m/{c-M4FSPNQ2.js → c-ZYEJLZEY.js} +1 -1
  75. package/dist/m/core/{autosave-VPORYJSE.js → autosave-GI3WNJYN.js} +1 -1
  76. package/dist/m/core/{conflict-notice-JMAZLVRX.js → conflict-notice-CEI3XY6A.js} +1 -1
  77. package/dist/m/core/{save-AOJBDSOK.js → save-OJ5NSLS7.js} +1 -1
  78. package/dist/m/core/{save-core-IOCMXO5L.js → save-core-DX3RFVO3.js} +1 -1
  79. package/dist/m/core/{unsaved-warning-U5VUJFOE.js → unsaved-warning-HGYH7O4H.js} +1 -1
  80. package/dist/m/internals/{index-HDRANDWE.js → index-V4WC44FU.js} +1 -1
  81. package/dist/m/loader-V6VI46HU.js +1 -0
  82. package/dist/m/{manifest-5498AFD3.js → manifest-83C18DED.js} +1 -1
  83. package/dist/m/{manifest-edit-62A5A00F.js → manifest-edit-B28C1985.js} +1 -1
  84. package/dist/m/manifest.json +553 -553
  85. package/dist/m/page/{editor-EY2WAAGB.js → editor-BQEPCJLG.js} +2 -2
  86. package/dist/m/plugins/ai-edit-45A2J6LC.js +6 -0
  87. package/dist/m/plugins/cms-IFTKWF4S.js +2235 -0
  88. package/dist/m/plugins/{indicator-4VDXWYTD.js → indicator-IPZJ35K6.js} +1 -1
  89. package/dist/m/plugins/{live-5EZN2EYP.js → live-GPQXSXSM.js} +1 -1
  90. package/dist/m/plugins/{menu-DM2JHPSR.js → menu-UN3KRCOF.js} +1 -1
  91. package/dist/m/plugins/{page-LVW5DWA4.js → page-BAVLWCP6.js} +2 -2
  92. package/dist/m/plugins/{page-view-5KQ76IJB.js → page-view-P3UGJFDZ.js} +1 -1
  93. package/dist/m/plugins/{people-C7TVBBMR.js → people-Z4RGVQAV.js} +1 -1
  94. package/dist/m/plugins/{quickcrop-BQ5YYFCH.js → quickcrop-E34PUYA3.js} +2 -2
  95. package/dist/m/plugins/{richclay-KLGETK77.js → richclay-S4NVJYIK.js} +2 -2
  96. package/dist/m/plugins/{source-CCEUM3OR.js → source-KVN6YNTY.js} +1 -1
  97. package/dist/m/plugins/{upgrade-NW556WJD.js → upgrade-KTSICB22.js} +1 -1
  98. package/dist/m/plugins/{wire-VRYPY6EJ.js → wire-SYVIBNSE.js} +1 -1
  99. package/dist/m/{reader-core-2GXY7SHY.js → reader-core-RUIFH32Y.js} +2 -2
  100. package/dist/m/sync/{live-sync-SKPMFYOO.js → live-sync-RGQMMWK2.js} +1 -1
  101. package/dist/m/ui/{index-QNIPDHXQ.js → index-EZGLEM5P.js} +1 -1
  102. package/dist/offline-manifest.json +442 -448
  103. package/docs/guide.md +2 -2
  104. package/package.json +2 -2
  105. package/src/loader-logic.js +4 -1
  106. package/src/plugins/ai-edit.js +6 -17
  107. package/src/plugins/cms.js +3 -6
  108. package/src/ui/bevel.js +1 -1
  109. package/src/ui/skins/cms.js +1 -1
  110. package/src/ui/skins/quickcrop.js +1 -1
  111. package/src/ui/skins/richclay.js +1 -1
  112. package/src/vendor/hypercms.vendor.js +16 -69
  113. package/dist/m/c-FSWRGBVQ.js +0 -1
  114. package/dist/m/c-HMYWIHFG.js +0 -1
  115. package/dist/m/c-M6FNQCTQ.js +0 -1
  116. package/dist/m/c-WFMRX5RZ.js +0 -1
  117. package/dist/m/loader-ZVPK4ZN3.js +0 -1
  118. package/dist/m/plugins/ai-edit-J5VLSW5I.js +0 -6
  119. package/dist/m/plugins/cms-LRAOZHT7.js +0 -2293
  120. package/src/ui/skins/cms-toggle.js +0 -15
  121. /package/dist/m/plugins/{quickcrop-BQ5YYFCH.js.LEGAL.txt → quickcrop-E34PUYA3.js.LEGAL.txt} +0 -0
  122. /package/dist/m/plugins/{richclay-KLGETK77.js.LEGAL.txt → richclay-S4NVJYIK.js.LEGAL.txt} +0 -0
@@ -1,4 +1,4 @@
1
- import{a as ot,b as rt,c as it}from"../c-CJFDLD43.js";import{a as nt}from"../c-OJYM642Q.js";import{g as et}from"../c-BJ7YQ5QZ.js";import"../c-4JZDZFF6.js";import"../c-VAK7SG37.js";import"../c-MHI3GYKF.js";import"../c-NUHP2XDB.js";import"../c-VHNSBD2M.js";var qt=":root{--qc-surface:#f7f2ea;--qc-surface-hover:#efe7d8;--qc-border:#cdbfa6;--qc-text:#2b241b;--qc-text-hover:#463c2e;--qc-on-dark:#efe7d8;--qc-overlay:rgba(43,36,27,.6);--qc-dim:rgba(0,0,0,.55);--qc-radius:8px;--qc-crop-line:#fff;--qc-font:ui-sans-serif,system-ui,sans-serif;}.qc-css-probe{position:absolute;}.qc-backdrop{position:fixed;inset:0;background:var(--qc-overlay);display:grid;place-items:center;z-index:1000;animation:qc-fade .15s ease;}@keyframes qc-fade{from{opacity:0}}.qc-modal{background:var(--qc-surface);border:1px solid var(--qc-border);border-radius:var(--qc-radius);padding:16px;max-width:92vw;font-family:var(--qc-font);}.qc-bar{display:flex;justify-content:flex-end;gap:10px;margin-top:12px;}.qc-btn{font:inherit;font-family:var(--qc-font);font-size:.85rem;padding:.3rem .75rem;border:1px solid var(--qc-border);border-radius:6px;background:var(--qc-surface);color:var(--qc-text);cursor:pointer;}.qc-btn:hover{background:var(--qc-surface-hover);}.qc-btn-primary{background:var(--qc-text);border-color:var(--qc-text);color:var(--qc-on-dark);font-weight:600;}.qc-btn-primary:hover{background:var(--qc-text-hover);border-color:var(--qc-text-hover);}.qc-stage{position:relative;line-height:0;user-select:none;-webkit-user-select:none;touch-action:none;}.qc-stage img{display:block;max-width:100%;pointer-events:none;}.qc-dim{position:absolute;inset:0;background:var(--qc-dim);pointer-events:none;}.qc-box{position:absolute;cursor:move;outline:1px solid var(--qc-crop-line);background:linear-gradient(var(--qc-crop-line),var(--qc-crop-line)) 0 33.33%/100% 1px no-repeat,linear-gradient(var(--qc-crop-line),var(--qc-crop-line)) 0 66.66%/100% 1px no-repeat,linear-gradient(var(--qc-crop-line),var(--qc-crop-line)) 33.33% 0/1px 100% no-repeat,linear-gradient(var(--qc-crop-line),var(--qc-crop-line)) 66.66% 0/1px 100% no-repeat;background-blend-mode:overlay;}.qc-handle{position:absolute;box-sizing:border-box;width:28px;height:28px;border:7px solid transparent;background:var(--qc-crop-line);background-clip:padding-box;border-radius:9px;}.qc-nw{left:-14px;top:-14px;cursor:nwse-resize;}.qc-ne{right:-14px;top:-14px;cursor:nesw-resize;}.qc-sw{left:-14px;bottom:-14px;cursor:nesw-resize;}.qc-se{right:-14px;bottom:-14px;cursor:nwse-resize;}.qc-mount{line-height:0;}",gt=["image/jpeg","image/png","image/webp"];var _=!1;function L(t,n="",e=""){let r=document.createElement(t);return n&&(r.className=n),e&&(r.textContent=e),r}function D(t,n,e){t.style.setProperty(n,e,"important")}function vt(t){return String(t).replace(/[&<>"']/g,n=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[n])}function K(){if(document.querySelector("style[data-quickcrop]"))return;let t=L("div","qc-css-probe");t.style.display="none",document.body.append(t);let n=getComputedStyle(t).position==="absolute";if(t.remove(),n)return;let e=document.createElement("style");e.setAttribute("data-quickcrop",""),e.setAttribute("save-remove",""),e.setAttribute("snapshot-remove",""),e.textContent=qt,document.head.append(e)}var Y={open({content:t,confirmLabel:n,onConfirm:e,onCancel:r}){K();let i=L("div","qc-backdrop");i.setAttribute("save-remove",""),i.setAttribute("snapshot-remove","");let m=L("div","qc-modal"),u=L("div","qc-bar"),f=L("button","qc-btn qc-btn-primary",n);f.type="button",u.append(f),m.append(t,u),i.append(m),document.body.append(i);let E=q=>{q.key==="Escape"&&r()};return document.addEventListener("keydown",E),f.onclick=()=>e(),i.onclick=q=>{q.target===i&&r()},f.focus(),{close(){document.removeEventListener("keydown",E),i.remove()}}}};function at(t){return!!t&&typeof t=="object"&&typeof t.open=="function"&&typeof t.close=="function"&&typeof t.onYes=="function"&&"html"in t}var xt='<svg viewBox="0 0 134 134" xmlns="http://www.w3.org/2000/svg"><path class="micromodal__close-bg" d="M132 132.5 1 1.5h131v131Z"/><path d="M83 27l24 24M107 27L83 51" stroke="#fff" stroke-width="6"/></svg>';function ct(t){let n=()=>t.isShowing&&!!document.querySelector(".micromodal-parent");return{fit(){if(n())return null;let e=window.innerWidth>=640?128:80;return{width:Math.max(120,Math.min(550,window.innerWidth-32)-4-e),height:Math.max(120,window.innerHeight-220)}},open(e){if(n())return Y.open(e);let{content:r,confirmLabel:i,onConfirm:m,onCancel:u}=e;K();let f=!1,E=C=>{f||(f=!0,document.removeEventListener("keydown",q,!0),C())},q=C=>{C.key==="Escape"&&(C.stopPropagation(),u())};return t.html='<div class="qc-mount"></div>',t.yes=vt(i),t.no="",t.closeHtml=xt,t.disableFocus=!0,t.onOpen(()=>{document.querySelector(".micromodal__content .qc-mount")?.append(r),document.querySelector(".micromodal-parent .micromodal__yes")?.focus(),document.addEventListener("keydown",q,!0)}),t.onYes(()=>(E(m),!0)),t.onNo(()=>{E(u)}),t.open(),{close(){f||(f=!0,document.removeEventListener("keydown",q,!0),t.close())}}}}}function yt(t){if(t==="builtin")return Y;if(t&&typeof t=="object"){if(at(t))return ct(t);if(typeof t.open=="function")return t;throw new TypeError('quickcrop: modal must be "auto", "builtin", a themodal instance, or an adapter with open()')}if(t==="auto")return at(window.themodal)?ct(window.themodal):Y;throw new TypeError('quickcrop: modal must be "auto", "builtin", a themodal instance, or an adapter with open()')}function wt(t,n={}){let{aspect:e=null,type:r,quality:i=.92,maxWidth:m=null,maxHeight:u=null,minSize:f=40,labels:E={},modal:q="auto"}=n,{confirm:C="Crop"}=E;if(!(t instanceof Blob))return Promise.reject(new TypeError("quickcrop: expected a File or Blob"));if(_)return Promise.reject(new Error("quickcrop: already open"));let S;try{S=yt(q)}catch(R){return Promise.reject(R)}_=!0;let A=r||(gt.includes(t.type)?t.type:"image/png"),F=URL.createObjectURL(t),a=new Image;return new Promise((R,z)=>{a.onerror=()=>{URL.revokeObjectURL(F),_=!1,z(new Error("quickcrop: could not decode image"))};function h(){let U=S.fit?S.fit():null,mt=Math.max(1,Math.min(U?.width??window.innerWidth*.86,a.naturalWidth)),ut=Math.max(1,U?.height??window.innerHeight*.72),N=Math.min(mt/a.naturalWidth,ut/a.naturalHeight,1),M=Math.max(1,Math.round(a.naturalWidth*N)),g=Math.max(1,Math.round(a.naturalHeight*N)),$=Math.min(f,M,g);K();let v=L("div","qc-stage");D(a,"width",M+"px"),D(a,"height",g+"px");let Q=L("div","qc-dim"),B=L("div","qc-box");for(let o of["nw","ne","sw","se"])B.appendChild(L("div","qc-handle qc-"+o));v.append(a,Q,B);let c,p;e?(c=Math.min(M,g*e),p=c/e,p>g&&(p=g,c=p*e)):(c=M,p=g);let y=(M-c)/2,w=(g-p)/2;Z();function Z(){D(B,"left",y+"px"),D(B,"top",w+"px"),D(B,"width",c+"px"),D(B,"height",p+"px"),D(Q,"clip-path",`polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 0, ${y}px ${w}px, ${y}px ${w+p}px, ${y+c}px ${w+p}px, ${y+c}px ${w}px, ${y}px ${w}px)`)}let T=(o,b,d)=>Math.max(b,Math.min(d,o));v.addEventListener("pointerdown",o=>{let b=o.target.closest(".qc-handle"),d=o.target===B;if(!b&&!d)return;o.preventDefault(),v.setPointerCapture(o.pointerId);let s={px:o.clientX,py:o.clientY,x:y,y:w,w:c,h:p},l=b&&[...b.classList].find(W=>/^qc-(nw|ne|sw|se)$/.test(W))?.slice(3),x=W=>{if(!l)y=T(s.x+(W.clientX-s.px),0,M-c),w=T(s.y+(W.clientY-s.py),0,g-p);else{let O=l.includes("w")?s.x+s.w:s.x,H=l.includes("n")?s.y+s.h:s.y,P=l.includes("e"),X=l.includes("s"),G=v.getBoundingClientRect(),J=Math.abs(W.clientX-(G.left+O)),V=Math.abs(W.clientY-(G.top+H));if(e){let tt=Math.min(P?M-O:O,(X?g-H:H)*e),bt=Math.min(Math.max($,$*e),tt);c=T(Math.max(J,V*e),bt,tt),p=c/e}else c=T(J,$,P?M-O:O),p=T(V,$,X?g-H:H);y=P?O:O-c,w=X?H:H-p}Z()},k=()=>{v.removeEventListener("pointermove",x),v.removeEventListener("pointerup",k),v.removeEventListener("pointercancel",k)};v.addEventListener("pointermove",x),v.addEventListener("pointerup",k),v.addEventListener("pointercancel",k)});function ft(){let o=a.naturalWidth/M,b=a.naturalHeight/g,d=Math.round(c*o),s=Math.round(p*b),l=1;m&&d>m&&(l=m/d),u&&s*l>u&&(l=u/s),d*l*s*l>16777216&&(l=Math.sqrt(16777216/(d*s)));let x=document.createElement("canvas");x.width=Math.max(1,Math.round(d*l)),x.height=Math.max(1,Math.round(s*l));let k=x.getContext("2d");if(!k)throw new Error("quickcrop: crop too large for a canvas");return A==="image/jpeg"&&(k.fillStyle="#fff",k.fillRect(0,0,x.width,x.height)),k.imageSmoothingQuality="high",k.drawImage(a,y*o,w*b,c*o,p*b,0,0,x.width,x.height),x}let j=!1,I=()=>j?!1:(j=!0,ht.close(),URL.revokeObjectURL(F),_=!1,!0),ht=S.open({content:v,confirmLabel:C,onConfirm(){if(j)return;let o,b;try{o=ft(),b=o.toDataURL(A,i)}catch(d){I()&&z(d);return}I()&&o.toBlob(d=>{if(!d){z(new Error("quickcrop: image encoding failed"));return}R({blob:d,dataURL:b,width:o.width,height:o.height})},A,i)},onCancel(){I()&&R(null)}})}a.onload=()=>{try{h()}catch(U){URL.revokeObjectURL(F),_=!1,z(U)}},a.src=F})}var pt=wt;var st=[".qc-stage",".qc-backdrop"],dt=`@layer clay-skin{
1
+ import{a as ot,b as rt,c as it}from"../c-6KBKYLPO.js";import{a as nt}from"../c-5FKRZNJV.js";import{g as et}from"../c-IHUWUKIU.js";import"../c-4JZDZFF6.js";import"../c-EUGJVHDD.js";import"../c-MHI3GYKF.js";import"../c-NUHP2XDB.js";import"../c-VHNSBD2M.js";var qt=":root{--qc-surface:#f7f2ea;--qc-surface-hover:#efe7d8;--qc-border:#cdbfa6;--qc-text:#2b241b;--qc-text-hover:#463c2e;--qc-on-dark:#efe7d8;--qc-overlay:rgba(43,36,27,.6);--qc-dim:rgba(0,0,0,.55);--qc-radius:8px;--qc-crop-line:#fff;--qc-font:ui-sans-serif,system-ui,sans-serif;}.qc-css-probe{position:absolute;}.qc-backdrop{position:fixed;inset:0;background:var(--qc-overlay);display:grid;place-items:center;z-index:1000;animation:qc-fade .15s ease;}@keyframes qc-fade{from{opacity:0}}.qc-modal{background:var(--qc-surface);border:1px solid var(--qc-border);border-radius:var(--qc-radius);padding:16px;max-width:92vw;font-family:var(--qc-font);}.qc-bar{display:flex;justify-content:flex-end;gap:10px;margin-top:12px;}.qc-btn{font:inherit;font-family:var(--qc-font);font-size:.85rem;padding:.3rem .75rem;border:1px solid var(--qc-border);border-radius:6px;background:var(--qc-surface);color:var(--qc-text);cursor:pointer;}.qc-btn:hover{background:var(--qc-surface-hover);}.qc-btn-primary{background:var(--qc-text);border-color:var(--qc-text);color:var(--qc-on-dark);font-weight:600;}.qc-btn-primary:hover{background:var(--qc-text-hover);border-color:var(--qc-text-hover);}.qc-stage{position:relative;line-height:0;user-select:none;-webkit-user-select:none;touch-action:none;}.qc-stage img{display:block;max-width:100%;pointer-events:none;}.qc-dim{position:absolute;inset:0;background:var(--qc-dim);pointer-events:none;}.qc-box{position:absolute;cursor:move;outline:1px solid var(--qc-crop-line);background:linear-gradient(var(--qc-crop-line),var(--qc-crop-line)) 0 33.33%/100% 1px no-repeat,linear-gradient(var(--qc-crop-line),var(--qc-crop-line)) 0 66.66%/100% 1px no-repeat,linear-gradient(var(--qc-crop-line),var(--qc-crop-line)) 33.33% 0/1px 100% no-repeat,linear-gradient(var(--qc-crop-line),var(--qc-crop-line)) 66.66% 0/1px 100% no-repeat;background-blend-mode:overlay;}.qc-handle{position:absolute;box-sizing:border-box;width:28px;height:28px;border:7px solid transparent;background:var(--qc-crop-line);background-clip:padding-box;border-radius:9px;}.qc-nw{left:-14px;top:-14px;cursor:nwse-resize;}.qc-ne{right:-14px;top:-14px;cursor:nesw-resize;}.qc-sw{left:-14px;bottom:-14px;cursor:nesw-resize;}.qc-se{right:-14px;bottom:-14px;cursor:nwse-resize;}.qc-mount{line-height:0;}",gt=["image/jpeg","image/png","image/webp"];var _=!1;function L(t,n="",e=""){let r=document.createElement(t);return n&&(r.className=n),e&&(r.textContent=e),r}function D(t,n,e){t.style.setProperty(n,e,"important")}function vt(t){return String(t).replace(/[&<>"']/g,n=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[n])}function K(){if(document.querySelector("style[data-quickcrop]"))return;let t=L("div","qc-css-probe");t.style.display="none",document.body.append(t);let n=getComputedStyle(t).position==="absolute";if(t.remove(),n)return;let e=document.createElement("style");e.setAttribute("data-quickcrop",""),e.setAttribute("save-remove",""),e.setAttribute("snapshot-remove",""),e.textContent=qt,document.head.append(e)}var Y={open({content:t,confirmLabel:n,onConfirm:e,onCancel:r}){K();let i=L("div","qc-backdrop");i.setAttribute("save-remove",""),i.setAttribute("snapshot-remove","");let m=L("div","qc-modal"),u=L("div","qc-bar"),f=L("button","qc-btn qc-btn-primary",n);f.type="button",u.append(f),m.append(t,u),i.append(m),document.body.append(i);let E=q=>{q.key==="Escape"&&r()};return document.addEventListener("keydown",E),f.onclick=()=>e(),i.onclick=q=>{q.target===i&&r()},f.focus(),{close(){document.removeEventListener("keydown",E),i.remove()}}}};function at(t){return!!t&&typeof t=="object"&&typeof t.open=="function"&&typeof t.close=="function"&&typeof t.onYes=="function"&&"html"in t}var xt='<svg viewBox="0 0 134 134" xmlns="http://www.w3.org/2000/svg"><path class="micromodal__close-bg" d="M132 132.5 1 1.5h131v131Z"/><path d="M83 27l24 24M107 27L83 51" stroke="#fff" stroke-width="6"/></svg>';function ct(t){let n=()=>t.isShowing&&!!document.querySelector(".micromodal-parent");return{fit(){if(n())return null;let e=window.innerWidth>=640?128:80;return{width:Math.max(120,Math.min(550,window.innerWidth-32)-4-e),height:Math.max(120,window.innerHeight-220)}},open(e){if(n())return Y.open(e);let{content:r,confirmLabel:i,onConfirm:m,onCancel:u}=e;K();let f=!1,E=C=>{f||(f=!0,document.removeEventListener("keydown",q,!0),C())},q=C=>{C.key==="Escape"&&(C.stopPropagation(),u())};return t.html='<div class="qc-mount"></div>',t.yes=vt(i),t.no="",t.closeHtml=xt,t.disableFocus=!0,t.onOpen(()=>{document.querySelector(".micromodal__content .qc-mount")?.append(r),document.querySelector(".micromodal-parent .micromodal__yes")?.focus(),document.addEventListener("keydown",q,!0)}),t.onYes(()=>(E(m),!0)),t.onNo(()=>{E(u)}),t.open(),{close(){f||(f=!0,document.removeEventListener("keydown",q,!0),t.close())}}}}}function yt(t){if(t==="builtin")return Y;if(t&&typeof t=="object"){if(at(t))return ct(t);if(typeof t.open=="function")return t;throw new TypeError('quickcrop: modal must be "auto", "builtin", a themodal instance, or an adapter with open()')}if(t==="auto")return at(window.themodal)?ct(window.themodal):Y;throw new TypeError('quickcrop: modal must be "auto", "builtin", a themodal instance, or an adapter with open()')}function wt(t,n={}){let{aspect:e=null,type:r,quality:i=.92,maxWidth:m=null,maxHeight:u=null,minSize:f=40,labels:E={},modal:q="auto"}=n,{confirm:C="Crop"}=E;if(!(t instanceof Blob))return Promise.reject(new TypeError("quickcrop: expected a File or Blob"));if(_)return Promise.reject(new Error("quickcrop: already open"));let S;try{S=yt(q)}catch(R){return Promise.reject(R)}_=!0;let A=r||(gt.includes(t.type)?t.type:"image/png"),F=URL.createObjectURL(t),a=new Image;return new Promise((R,z)=>{a.onerror=()=>{URL.revokeObjectURL(F),_=!1,z(new Error("quickcrop: could not decode image"))};function h(){let U=S.fit?S.fit():null,mt=Math.max(1,Math.min(U?.width??window.innerWidth*.86,a.naturalWidth)),ut=Math.max(1,U?.height??window.innerHeight*.72),N=Math.min(mt/a.naturalWidth,ut/a.naturalHeight,1),M=Math.max(1,Math.round(a.naturalWidth*N)),g=Math.max(1,Math.round(a.naturalHeight*N)),$=Math.min(f,M,g);K();let v=L("div","qc-stage");D(a,"width",M+"px"),D(a,"height",g+"px");let Q=L("div","qc-dim"),B=L("div","qc-box");for(let o of["nw","ne","sw","se"])B.appendChild(L("div","qc-handle qc-"+o));v.append(a,Q,B);let c,p;e?(c=Math.min(M,g*e),p=c/e,p>g&&(p=g,c=p*e)):(c=M,p=g);let y=(M-c)/2,w=(g-p)/2;Z();function Z(){D(B,"left",y+"px"),D(B,"top",w+"px"),D(B,"width",c+"px"),D(B,"height",p+"px"),D(Q,"clip-path",`polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 0, ${y}px ${w}px, ${y}px ${w+p}px, ${y+c}px ${w+p}px, ${y+c}px ${w}px, ${y}px ${w}px)`)}let T=(o,b,d)=>Math.max(b,Math.min(d,o));v.addEventListener("pointerdown",o=>{let b=o.target.closest(".qc-handle"),d=o.target===B;if(!b&&!d)return;o.preventDefault(),v.setPointerCapture(o.pointerId);let s={px:o.clientX,py:o.clientY,x:y,y:w,w:c,h:p},l=b&&[...b.classList].find(W=>/^qc-(nw|ne|sw|se)$/.test(W))?.slice(3),x=W=>{if(!l)y=T(s.x+(W.clientX-s.px),0,M-c),w=T(s.y+(W.clientY-s.py),0,g-p);else{let O=l.includes("w")?s.x+s.w:s.x,H=l.includes("n")?s.y+s.h:s.y,P=l.includes("e"),X=l.includes("s"),G=v.getBoundingClientRect(),J=Math.abs(W.clientX-(G.left+O)),V=Math.abs(W.clientY-(G.top+H));if(e){let tt=Math.min(P?M-O:O,(X?g-H:H)*e),bt=Math.min(Math.max($,$*e),tt);c=T(Math.max(J,V*e),bt,tt),p=c/e}else c=T(J,$,P?M-O:O),p=T(V,$,X?g-H:H);y=P?O:O-c,w=X?H:H-p}Z()},k=()=>{v.removeEventListener("pointermove",x),v.removeEventListener("pointerup",k),v.removeEventListener("pointercancel",k)};v.addEventListener("pointermove",x),v.addEventListener("pointerup",k),v.addEventListener("pointercancel",k)});function ft(){let o=a.naturalWidth/M,b=a.naturalHeight/g,d=Math.round(c*o),s=Math.round(p*b),l=1;m&&d>m&&(l=m/d),u&&s*l>u&&(l=u/s),d*l*s*l>16777216&&(l=Math.sqrt(16777216/(d*s)));let x=document.createElement("canvas");x.width=Math.max(1,Math.round(d*l)),x.height=Math.max(1,Math.round(s*l));let k=x.getContext("2d");if(!k)throw new Error("quickcrop: crop too large for a canvas");return A==="image/jpeg"&&(k.fillStyle="#fff",k.fillRect(0,0,x.width,x.height)),k.imageSmoothingQuality="high",k.drawImage(a,y*o,w*b,c*o,p*b,0,0,x.width,x.height),x}let j=!1,I=()=>j?!1:(j=!0,ht.close(),URL.revokeObjectURL(F),_=!1,!0),ht=S.open({content:v,confirmLabel:C,onConfirm(){if(j)return;let o,b;try{o=ft(),b=o.toDataURL(A,i)}catch(d){I()&&z(d);return}I()&&o.toBlob(d=>{if(!d){z(new Error("quickcrop: image encoding failed"));return}R({blob:d,dataURL:b,width:o.width,height:o.height})},A,i)},onCancel(){I()&&R(null)}})}a.onload=()=>{try{h()}catch(U){URL.revokeObjectURL(F),_=!1,z(U)}},a.src=F})}var pt=wt;var st=[".qc-stage",".qc-backdrop"],dt=`@layer clay-skin{
2
2
  :is(.qc-stage, .qc-backdrop),:is(.qc-stage, .qc-backdrop) *{--qc-surface:light-dark(#FFFCF6, #11131E) !important;--qc-text:light-dark(#2B241B, #ECEAF2) !important;--qc-border:light-dark(#D8C8AF, #353B52) !important;--qc-radius:0px !important;--qc-font:system-ui,-apple-system,"Segoe UI",sans-serif !important;--qc-surface-hover:light-dark(#F4ECDF, #1A1D2C) !important;--qc-text-hover:color-mix(in srgb, light-dark(#2B241B, #ECEAF2), light-dark(#FDF8F0, #0B0C13) 12%) !important;--qc-on-dark:light-dark(#FDF8F0, #0B0C13) !important;--qc-overlay:color-mix(in srgb, light-dark(#FDF8F0, #0B0C13) 70%, transparent) !important;--qc-dim:rgba(0,0,0,.55) !important;--qc-crop-line:#fff !important}
3
3
  .qc-stage{margin-inline:auto !important;inline-size:fit-content !important;background:light-dark(#F4ECDF, #1A1D2C) !important}
4
4
  .qc-stage img{display:block !important;max-inline-size:100% !important}
@@ -23,4 +23,4 @@ import{a as ot,b as rt,c as it}from"../c-CJFDLD43.js";import{a as nt}from"../c-O
23
23
  .qc-backdrop[hidden]{display:none !important}
24
24
  .qc-bar[hidden]{display:none !important}
25
25
  }`;var lt=844;nt("quickcrop",dt,{roots:st});function kt(t){return!!t&&typeof t=="object"&&typeof t.open=="function"&&typeof t.close=="function"&&typeof t.onYes=="function"&&"html"in t}var Et={fit(){let t=document.documentElement.clientWidth;return{width:Math.max(120,Math.min(lt,t-32)-2-44),height:Math.max(120,window.innerHeight-Math.min(96,window.innerHeight*.1)-200)}},open({content:t,confirmLabel:n,onConfirm:e,onCancel:r}){let{root:i,overlay:m,panel:u,heading:f,body:E,footer:q,close:C}=it({zIndex:"2147483001",width:`${lt}px`,closable:!0,titled:!0});f.textContent="Crop image",u.setAttribute("aria-label","Crop image"),E.append(t);let S=et(n,{variant:"primary",onClick:()=>e()});q.append(S),C.addEventListener("click",()=>r()),u.addEventListener("submit",h=>h.preventDefault());let A=!1;m.addEventListener("mousedown",h=>{A=h.target===m}),m.addEventListener("click",h=>{A&&h.target===m&&r(),A=!1});let F=h=>{if(h.key==="Tab"){h.stopPropagation(),rt(u,h);return}h.key==="Escape"&&(h.stopPropagation(),r())};document.addEventListener("keydown",F,!0);let a=document.body.style.overflow;document.body.style.overflow="hidden";let R=!1,z=()=>{R||(R=!0,document.removeEventListener("keydown",F,!0),document.body.style.overflow=a,i.remove())};return ot.set(i,()=>{z(),r()}),i.setAttribute("aria-hidden","false"),document.body.append(i),S.focus(),{close:z}}};function Mt(t,n={}){let e=n.modal??"auto",r=e==="auto"||kt(e);return pt(t,r?{...n,modal:Et}:n)}var Bt=Mt;export{Et as bevelCropAdapter,Bt as default,Mt as quickcrop};
26
- /*! For license information please see quickcrop-BQ5YYFCH.js.LEGAL.txt */
26
+ /*! For license information please see quickcrop-E34PUYA3.js.LEGAL.txt */
@@ -1,4 +1,4 @@
1
- import{a as bo}from"../c-OJYM642Q.js";import"../c-BJ7YQ5QZ.js";import"../c-4JZDZFF6.js";import"../c-VAK7SG37.js";import"../c-MHI3GYKF.js";import"../c-NUHP2XDB.js";import{k as yo}from"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import"../c-HA6INT6J.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";var vo=[".richclay-toolbar",".richclay-float",".richclay-dialog"],xo=`@layer clay-skin{
1
+ import{a as bo}from"../c-5FKRZNJV.js";import"../c-IHUWUKIU.js";import"../c-4JZDZFF6.js";import"../c-EUGJVHDD.js";import"../c-MHI3GYKF.js";import"../c-NUHP2XDB.js";import{k as yo}from"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import"../c-HA6INT6J.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";var vo=[".richclay-toolbar",".richclay-float",".richclay-dialog"],xo=`@layer clay-skin{
2
2
  :is(.richclay-toolbar, .richclay-float, .richclay-dialog),:is(.richclay-toolbar, .richclay-float, .richclay-dialog) *{--richclay-surface:light-dark(#FFFCF6, #11131E) !important;--richclay-surface-alt:light-dark(#F4ECDF, #1A1D2C) !important;--richclay-text:light-dark(#2B241B, #ECEAF2) !important;--richclay-muted:light-dark(#6B5942, #8A90AB) !important;--richclay-border:light-dark(#D8C8AF, #353B52) !important;--richclay-accent:light-dark(#8F6310, #D9A445) !important;--richclay-accent-ink:light-dark(#FDF8F0, #0B0C13) !important;--richclay-focus:light-dark(#8F6310, #D9A445) !important;--richclay-danger:light-dark(#A83A2C, #FF5566) !important;--richclay-radius:0px !important;--richclay-control-size:32px !important;--richclay-shadow:0 1px 2px rgba(0,0,0,.12),0 10px 28px -12px rgba(0,0,0,.35) !important}
3
3
  :is(.richclay-toolbar, .richclay-float, .richclay-dialog){font-family:system-ui,-apple-system,"Segoe UI",sans-serif !important}
4
4
  :where(.richclay-float, .richclay-dialog):is(.richclay-toolbar, .richclay-float, .richclay-dialog){color:light-dark(#2B241B, #ECEAF2) !important;background:light-dark(#FFFCF6, #11131E) !important;border:1px solid light-dark(#D8C8AF, #353B52) !important}
@@ -514,4 +514,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
514
514
  }
515
515
  }
516
516
  `,te=typeof globalThis<"u"?globalThis:self;te&&!te.Squire&&(te.Squire=ca),te&&!te.DOMPurify&&(te.DOMPurify=Wa),Ql(gs);var ys=Ki.autoInit(),bs=Ki;return _o(hr)})();window.__hyperclayNoAutoExport||(window.hyperclay=window.hyperclay||{},window.hyperclay.RichClay=Qe.default,window.RichClay=window.RichClay||Qe.default,window.h=window.hyperclay);var gt=Qe.default,rc=Qe.default;bo("richclay",xo,{roots:vo});var Xe=null,Co=(v,st)=>Object.assign(new Error(`clay:richclay: ${v}`),{code:st}),Vs=v=>v?v.signal?.aborted?!0:typeof v.isCurrent=="function"&&!v.isCurrent():!1,Gs=v=>({root:v,win:v.ownerDocument?.defaultView||window,admitted:!1,stopWatch:null,subscriber:null}),wo=v=>[...v.root.querySelectorAll(gt.selector)];function So(v){for(let st of gt.init(wo(v)))st.reattach()}function Zs(v){let st=()=>So(v);return{enable(){if(v.admitted)return;v.admitted=!0,So(v),v.stopWatch=gt.watch(v.win);let at=v.root.ownerDocument||document;v.subscriber={target:at,type:"clay:sync-applied",handler:st},at.addEventListener(v.subscriber.type,st)},quiesce(){v.admitted=!1,v.stopWatch&&(v.stopWatch(),v.stopWatch=null)},resume(){v.admitted||(v.admitted=!0,v.stopWatch=gt.watch(v.win))},dispose(){v.admitted=!1,v.stopWatch&&(v.stopWatch(),v.stopWatch=null);let at=v.subscriber;v.subscriber=null,at&&at.target.removeEventListener(at.type,at.handler);for(let Je of wo(v))gt.stripElement(Je);Xe===v&&(Xe=null)}}}function Ys(v=document){return{id:"clay:richclay",order:310,async prepare(st={}){if(st.initial===!0)return Qs();if(typeof gt.watch!="function"||typeof gt.stripElement!="function")throw Co("this vendor build has no watchable lifecycle","unsupported-plugin");if(Vs(st))throw Co("prepared for a stale generation","stale-document");let at=gt.autoInit?.();return typeof at=="function"&&at(),Zs(Xe||(Xe=Gs(v)))}}}async function Qs(){let v=await Js;return{enable(){},quiesce:()=>v?.quiesce(),resume:()=>v?.resume(),dispose:()=>v?.dispose()}}async function Xs(){if(!yo())return null;let v=await Ys().prepare();return v.enable(),v}var Js=Xs();var fc=gt;export{gt as RichClay,fc as default,Xs as init,Ys as modeParticipant,Js as ready,Ys as richclayParticipant};
517
- /*! For license information please see richclay-KLGETK77.js.LEGAL.txt */
517
+ /*! For license information please see richclay-S4NVJYIK.js.LEGAL.txt */
@@ -1 +1 @@
1
- import"../c-GVPNDIKJ.js";import{a as d}from"../c-ATKAOH23.js";import"../c-EK63G3CG.js";import"../c-NQJRVJ56.js";import"../c-XGH4GS2T.js";import"../c-IJUK2GPW.js";import{k as p}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 g={installed:!1,refused:null,sourceBytes:null,paired:0,unresolved:0,unmatchedLive:0,unmatchedSource:0,attrDiffs:0,saves:0,reprints:0,lastReprint:null,partialReprints:0,lastPartialReprint:null,lastRenderMs:null,lastBytes:null,refreshes:0,timing:{fetch:null,model:null,pair:null,refresh:null}},n=null,c=null,i=null,u=p(),s=0,r=null,a=!1,o=null;function v(){return o??=import("../c-JOH753EJ.js").catch(e=>{throw o=null,e}),o}function f(e,t,l){typeof e=="string"&&(i=Object.freeze({bytes:e,etag:t??null,seq:l??null}))}function h(){if(r)return r;let e=s,t=c;return r=v().then(l=>(n=l,e!==s?(r=null,null):l.start({context:t,latest:()=>i}))).catch(l=>(r=null,console.info("clayjs: source map off ("+(l&&l.message?l.message:l)+"); saves use the full serialization"),null)).then(l=>(e===s&&(a=!0),l)),r}function x(){return!u||a?null:h()}function m(){s++,u=!1,a=!1,r=null,c=null,n&&n.release()}d((e,t)=>{f(e,i?i.etag:null,i?i.seq:null),n&&!n.installed()&&n.adoptAccepted(e,t)});document.addEventListener("clay:sync-applied",e=>{let t=e&&e.detail;!t||t.source!=="disk"||typeof t.html!="string"||(f(t.html,t.etag,t.seq),n&&!n.installed()&&n.adoptAccepted(t.html,null))});function y(e,t,l={}){return n?n.renderSave(e,t,l):t}var A={get ready(){return u?h():null},stats:()=>n?n.stats():{...g},text:()=>n?n.text():null,locate:e=>n?n.locateLive(e):null,unpaired:()=>n?n.unpaired():null,ensureForSave:x,get repairGeneration(){return n?n.repairGeneration():0}};function L(){return{id:"clay:source",order:30,prepare(e={}){let t=e&&e.represented;if(t&&(c={represented:t},f(t.bytes,t.etag,t.seq)),e&&e.initial===!0)return u=!0,{enable(){},quiesce(){},resume(){},dispose:m};let l=++s;return u=!1,a=!1,r=null,{enable(){l===s&&(u=!0)},quiesce(){},resume(){l===s&&(u=!0)},dispose(){l===s&&m()}}}}}var R=A;export{R as default,L as modeParticipant,y as renderSave,A as source,L as sourceParticipant};
1
+ import"../c-ZKELCT4T.js";import{a as d}from"../c-ATKAOH23.js";import"../c-EK63G3CG.js";import"../c-NQJRVJ56.js";import"../c-XGH4GS2T.js";import"../c-IJUK2GPW.js";import{k as p}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 g={installed:!1,refused:null,sourceBytes:null,paired:0,unresolved:0,unmatchedLive:0,unmatchedSource:0,attrDiffs:0,saves:0,reprints:0,lastReprint:null,partialReprints:0,lastPartialReprint:null,lastRenderMs:null,lastBytes:null,refreshes:0,timing:{fetch:null,model:null,pair:null,refresh:null}},n=null,c=null,i=null,u=p(),s=0,r=null,a=!1,o=null;function v(){return o??=import("../c-26KVJS6J.js").catch(e=>{throw o=null,e}),o}function f(e,t,l){typeof e=="string"&&(i=Object.freeze({bytes:e,etag:t??null,seq:l??null}))}function h(){if(r)return r;let e=s,t=c;return r=v().then(l=>(n=l,e!==s?(r=null,null):l.start({context:t,latest:()=>i}))).catch(l=>(r=null,console.info("clayjs: source map off ("+(l&&l.message?l.message:l)+"); saves use the full serialization"),null)).then(l=>(e===s&&(a=!0),l)),r}function x(){return!u||a?null:h()}function m(){s++,u=!1,a=!1,r=null,c=null,n&&n.release()}d((e,t)=>{f(e,i?i.etag:null,i?i.seq:null),n&&!n.installed()&&n.adoptAccepted(e,t)});document.addEventListener("clay:sync-applied",e=>{let t=e&&e.detail;!t||t.source!=="disk"||typeof t.html!="string"||(f(t.html,t.etag,t.seq),n&&!n.installed()&&n.adoptAccepted(t.html,null))});function y(e,t,l={}){return n?n.renderSave(e,t,l):t}var A={get ready(){return u?h():null},stats:()=>n?n.stats():{...g},text:()=>n?n.text():null,locate:e=>n?n.locateLive(e):null,unpaired:()=>n?n.unpaired():null,ensureForSave:x,get repairGeneration(){return n?n.repairGeneration():0}};function L(){return{id:"clay:source",order:30,prepare(e={}){let t=e&&e.represented;if(t&&(c={represented:t},f(t.bytes,t.etag,t.seq)),e&&e.initial===!0)return u=!0,{enable(){},quiesce(){},resume(){},dispose:m};let l=++s;return u=!1,a=!1,r=null,{enable(){l===s&&(u=!0)},quiesce(){},resume(){l===s&&(u=!0)},dispose(){l===s&&m()}}}}}var R=A;export{R as default,L as modeParticipant,y as renderSave,A as source,L as sourceParticipant};
@@ -1 +1 @@
1
- import{a as f,b as v}from"../c-3G2DGZUP.js";import"../c-VHNSBD2M.js";var T="hha:upgrade-check:",V=1440*60*1e3,S="upgrade-dismissed",M="A new version of this template is available.";function b(e,t){let n=e.querySelector(`meta[name="${t}"]`),r=n?n.getAttribute("content"):null;return r&&r.trim()?r.trim():null}function P(e){try{let t=globalThis.localStorage.getItem(e);return t?JSON.parse(t):null}catch{return null}}function j(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}async function x(e){let t=globalThis.crypto&&globalThis.crypto.subtle;if(!t)return null;let n=await t.digest("SHA-256",e);return[...new Uint8Array(n)].map(r=>r.toString(16).padStart(2,"0")).join("")}async function L(e,t){try{let n=await e(t,{credentials:"omit"});return n.ok?n:null}catch{return null}}async function N(e,t,{fetchFn:n,now:r}){let o=new URL(e);o.pathname=o.pathname.replace(/\.html$/,".json");let a=`${T}${o.href}:${t}`,u=P(a);if(u&&typeof u.checkedAt=="number"&&r-u.checkedAt<V)return{latest:u.latest,latestUrl:o};let i=await L(n,o.href);if(!i)return{latest:null,latestUrl:o};let c=null;try{c=await i.json()}catch{return{latest:null,latestUrl:o}}return j(a,{checkedAt:r,latest:c}),{latest:c,latestUrl:o}}function A({doc:e,loc:t}){let n=typeof window<"u"&&window.clay||{};if(!n.canEdit||n.isDraftMode)return null;let r=b(e,"hyper-source"),o=b(e,"hyper-version");if(!r||!o)return null;let a;try{a=new URL(r,t?t.href:void 0)}catch{return null}return!a.pathname.endsWith(".html")||t&&a.origin===t.origin&&a.pathname===t.pathname?null:{source:a,currentVersion:o}}async function C({doc:e=document,loc:t=location,fetchFn:n=(o,a)=>fetch(o,a),now:r=Date.now()}={}){let o=A({doc:e,loc:t});if(!o)return{status:"none",version:null,update:null};let{source:a,currentVersion:u}=o,i=($,R=null)=>({status:$,version:u,update:R}),c=new URL(a.href);c.pathname=c.pathname.replace(/\.html$/,".json");let{latest:s}=await N(a.href,u,{fetchFn:n,now:r});if(!s||typeof s!="object"||typeof s.version!="string"||!f(s.version)||!f(u))return i("unknown");if(!v(s.version,u))return i("current");let h=typeof window<"u"&&window.clay||{},w=h.storage&&h.storage.local;if(w&&w.get(S)===s.version||typeof s.html!="string"||!s.html)return i("unknown");let m=new URL(s.html,c).href,y=await L(n,m);if(!y)return i("unknown");let g;try{g=await y.arrayBuffer()}catch{return i("unknown")}let d=await x(g);return!d||d!==String(s.sha256||"").toLowerCase()?i("unknown"):i("update",{version:s.version,html:m,sha256:d,latestUrl:c.href})}async function H(e){return(await C(e)).update}async function k(e,t){let n=window.clay;if(await I(n),!p(n)||!t)return;let r=e==="current"?`This doc is at latest version (${t})`:`Version ${t}`;n.menu.addItem({id:"upgrade",label:r,text:!0})}function O(e){let t=window.clay,n=t&&t.storage&&t.storage.local;n&&n.set(S,e)}function D(e){return!!(e&&Array.isArray(e.plugins)&&e.plugins.includes("menu"))}function p(e){return!!(e&&e.menu&&typeof e.menu.addItem=="function")}function I(e){return p(e)||!D(e)?Promise.resolve():new Promise(t=>{let n=r=>{!r.detail||r.detail.plugin!=="menu"||(document.removeEventListener("clay:plugin-ready",n),document.removeEventListener("clay:plugin-failed",n),t())};document.addEventListener("clay:plugin-ready",n),document.addEventListener("clay:plugin-failed",n)})}async function q(e,t=typeof window<"u"?window.clay:null){let n=()=>document.dispatchEvent(new CustomEvent("clay:upgrade-requested",{detail:e}));return await I(t),p(t)?(t.menu.addItem({id:"upgrade",label:`Upgrade to version ${e.version}`,badge:!0,run:n}),"menu"):t&&typeof t.toastPersistent=="function"?(t.toastPersistent(M,"info",{actions:[{label:"Upgrade",onClick:n},{label:"Not now",onClick:()=>O(e.version)}]}),"notice"):null}var U=!1;async function E(e={}){if(U)return null;U=!0;let t=window.clay;await Promise.resolve(t&&t.loaded&&t.loaded.ui).catch(()=>{});let n=A({doc:e.doc||document,loc:e.loc||location});n&&k("checking",n.currentVersion);let{status:r,version:o,update:a}=await C(e).catch(()=>({status:"unknown",version:n&&n.currentVersion,update:null}));return a?(await q(a),a):(r!=="none"&&await k(r,o),null)}async function J(e,t){return(await import("../c-U5X57T4L.js")).replace(e,t)}function B(e){import("../c-DDDOKPI6.js").then(t=>t.start(e.detail)).catch(t=>console.error("clayjs: the upgrade could not start:",t))}var l=typeof window<"u"?window.clay:null;if(l&&l.canEdit&&!l.isDraftMode){document.addEventListener("clay:upgrade-requested",B);let e=l.ready;e&&typeof e.then=="function"?e.then(()=>E(),()=>{}):E()}export{q as announce,C as checkUpdate,H as findUpdate,J as replace,E as start};
1
+ import{a as f,b as v}from"../c-3G2DGZUP.js";import"../c-VHNSBD2M.js";var T="hha:upgrade-check:",V=1440*60*1e3,S="upgrade-dismissed",M="A new version of this template is available.";function b(e,t){let n=e.querySelector(`meta[name="${t}"]`),r=n?n.getAttribute("content"):null;return r&&r.trim()?r.trim():null}function P(e){try{let t=globalThis.localStorage.getItem(e);return t?JSON.parse(t):null}catch{return null}}function j(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}async function x(e){let t=globalThis.crypto&&globalThis.crypto.subtle;if(!t)return null;let n=await t.digest("SHA-256",e);return[...new Uint8Array(n)].map(r=>r.toString(16).padStart(2,"0")).join("")}async function L(e,t){try{let n=await e(t,{credentials:"omit"});return n.ok?n:null}catch{return null}}async function N(e,t,{fetchFn:n,now:r}){let o=new URL(e);o.pathname=o.pathname.replace(/\.html$/,".json");let a=`${T}${o.href}:${t}`,u=P(a);if(u&&typeof u.checkedAt=="number"&&r-u.checkedAt<V)return{latest:u.latest,latestUrl:o};let i=await L(n,o.href);if(!i)return{latest:null,latestUrl:o};let c=null;try{c=await i.json()}catch{return{latest:null,latestUrl:o}}return j(a,{checkedAt:r,latest:c}),{latest:c,latestUrl:o}}function A({doc:e,loc:t}){let n=typeof window<"u"&&window.clay||{};if(!n.canEdit||n.isDraftMode)return null;let r=b(e,"hyper-source"),o=b(e,"hyper-version");if(!r||!o)return null;let a;try{a=new URL(r,t?t.href:void 0)}catch{return null}return!a.pathname.endsWith(".html")||t&&a.origin===t.origin&&a.pathname===t.pathname?null:{source:a,currentVersion:o}}async function C({doc:e=document,loc:t=location,fetchFn:n=(o,a)=>fetch(o,a),now:r=Date.now()}={}){let o=A({doc:e,loc:t});if(!o)return{status:"none",version:null,update:null};let{source:a,currentVersion:u}=o,i=($,R=null)=>({status:$,version:u,update:R}),c=new URL(a.href);c.pathname=c.pathname.replace(/\.html$/,".json");let{latest:s}=await N(a.href,u,{fetchFn:n,now:r});if(!s||typeof s!="object"||typeof s.version!="string"||!f(s.version)||!f(u))return i("unknown");if(!v(s.version,u))return i("current");let h=typeof window<"u"&&window.clay||{},w=h.storage&&h.storage.local;if(w&&w.get(S)===s.version||typeof s.html!="string"||!s.html)return i("unknown");let m=new URL(s.html,c).href,y=await L(n,m);if(!y)return i("unknown");let g;try{g=await y.arrayBuffer()}catch{return i("unknown")}let d=await x(g);return!d||d!==String(s.sha256||"").toLowerCase()?i("unknown"):i("update",{version:s.version,html:m,sha256:d,latestUrl:c.href})}async function H(e){return(await C(e)).update}async function k(e,t){let n=window.clay;if(await I(n),!p(n)||!t)return;let r=e==="current"?`This doc is at latest version (${t})`:`Version ${t}`;n.menu.addItem({id:"upgrade",label:r,text:!0})}function O(e){let t=window.clay,n=t&&t.storage&&t.storage.local;n&&n.set(S,e)}function D(e){return!!(e&&Array.isArray(e.plugins)&&e.plugins.includes("menu"))}function p(e){return!!(e&&e.menu&&typeof e.menu.addItem=="function")}function I(e){return p(e)||!D(e)?Promise.resolve():new Promise(t=>{let n=r=>{!r.detail||r.detail.plugin!=="menu"||(document.removeEventListener("clay:plugin-ready",n),document.removeEventListener("clay:plugin-failed",n),t())};document.addEventListener("clay:plugin-ready",n),document.addEventListener("clay:plugin-failed",n)})}async function q(e,t=typeof window<"u"?window.clay:null){let n=()=>document.dispatchEvent(new CustomEvent("clay:upgrade-requested",{detail:e}));return await I(t),p(t)?(t.menu.addItem({id:"upgrade",label:`Upgrade to version ${e.version}`,badge:!0,run:n}),"menu"):t&&typeof t.toastPersistent=="function"?(t.toastPersistent(M,"info",{actions:[{label:"Upgrade",onClick:n},{label:"Not now",onClick:()=>O(e.version)}]}),"notice"):null}var U=!1;async function E(e={}){if(U)return null;U=!0;let t=window.clay;await Promise.resolve(t&&t.loaded&&t.loaded.ui).catch(()=>{});let n=A({doc:e.doc||document,loc:e.loc||location});n&&k("checking",n.currentVersion);let{status:r,version:o,update:a}=await C(e).catch(()=>({status:"unknown",version:n&&n.currentVersion,update:null}));return a?(await q(a),a):(r!=="none"&&await k(r,o),null)}async function J(e,t){return(await import("../c-QHVCUTJV.js")).replace(e,t)}function B(e){import("../c-NNNR7OXA.js").then(t=>t.start(e.detail)).catch(t=>console.error("clayjs: the upgrade could not start:",t))}var l=typeof window<"u"?window.clay:null;if(l&&l.canEdit&&!l.isDraftMode){document.addEventListener("clay:upgrade-requested",B);let e=l.ready;e&&typeof e.then=="function"?e.then(()=>E(),()=>{}):E()}export{q as announce,C as checkUpdate,H as findUpdate,J as replace,E as start};
@@ -1 +1 @@
1
- import{a,b,c}from"../c-I2IFKJX2.js";import"../c-XGH4GS2T.js";import"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import"../c-HA6INT6J.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";export{c as default,a as modeParticipant,b as wire,a as wireParticipant};
1
+ import{a,b,c}from"../c-ZAHTFCXQ.js";import"../c-XGH4GS2T.js";import"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import"../c-HA6INT6J.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";export{c as default,a as modeParticipant,b as wire,a as wireParticipant};
@@ -1,4 +1,4 @@
1
- import{b as D,c as W}from"./c-NUHP2XDB.js";import{g as z}from"./c-TWCXBWS3.js";import{a as m}from"./c-VKEDWYDF.js";import{b as F}from"./c-LA2BW7UY.js";import{e as H}from"./c-XGH4GS2T.js";import"./c-IJUK2GPW.js";import{a as S,b as f,c as r,f as u,g as n,h as b,j as T,o as q}from"./c-3O7OBDCM.js";import{c as j,e as $}from"./c-BPF2NSPV.js";import"./c-P7KNDG34.js";import"./c-CYWLPPUS.js";import"./c-N7JPUPGC.js";import"./c-VG5XIN4T.js";import"./c-2YYDMLNZ.js";import"./c-HA6INT6J.js";import{d as U,s as V}from"./c-ICMAOOGK.js";import"./c-WRBKEJD4.js";import{a as k}from"./c-VHNSBD2M.js";var C={};k(C,{activateInitialMode:()=>Ee,canEdit:()=>r,default:()=>Le,init:()=>N,isEditMode:()=>u,isOwner:()=>b,mode:()=>n,modeLifecycle:()=>be,noteLiveSwitch:()=>xe,setMode:()=>y,setPageTypeOnPageLoad:()=>X,toggleEditMode:()=>Y});var A=!1,ve=e=>{if(typeof e?.id=="string"&&e.id.startsWith("clay:"))throw new TypeError(`clay.modeLifecycle: the id "${e.id}" is reserved`);return q(e)},be={register:ve,canWrite:()=>T().phase==="idle"&&u,get state(){return Object.freeze(T())}},L=null,G=()=>L||=import("./c-J3BXFTZS.js").catch(()=>L=null),M=null,xe=e=>{M=e};async function Ee(){if(u)try{await(await G()).activateInitial()}catch(e){console.error("clayjs: the mode lifecycle failed to start:",e)}}var p=null;async function y(e){if(e!=="edit"&&e!=="view")throw new TypeError(`clay.setMode: unknown mode "${e}"`);if(p)return p.target===e?p.promise:{ok:!1,mode:n,code:"busy"};if(e===n&&!L)return{ok:!0,mode:n,changed:!1};if(f)return{ok:!1,mode:n,code:"not-allowed"};let t=ke(e);p={target:e,promise:t};try{return await t}finally{p?.promise===t&&(p=null)}}async function ke(e){let t=typeof window<"u"?window.clay?._requestHostMode:void 0;if(typeof t=="function"&&e!==n){let o;try{o=await t(e)}catch{return{ok:!1,mode:n,code:"host-failed"}}if(o?.reason!=="host-unsupported")return o?.ok?(A=!0,{ok:!0,mode:e,changed:!0,reloading:!0}):{ok:!1,mode:n,code:o?.reason||"host-refused"}}return e==="edit"&&n!=="edit"?Se():!r&&!(e==="view"&&n==="edit")?{ok:!1,mode:n,code:"not-allowed"}:J(e)}async function Se(){let e=location.pathname,{checkHostPermission:t}=await import("./core/host-permission-6EVJGNPL.js"),o=await t({fresh:!0});return location.pathname!==e?{ok:!1,mode:n,code:"cancelled"}:o===!1?{ok:!1,mode:n,code:"permission-denied"}:r?J("edit"):{ok:!1,mode:n,code:"not-allowed"}}async function J(e){if(M){let t=await G(),o=t&&await t.switchMode(e,M);if(o)return o}if(e===n)return{ok:!0,mode:n,changed:!1};if(n==="edit"){let t;try{t=await window.clay?.save?.flush?.()}catch(o){return{ok:!1,mode:n,code:"save-failed",state:o?.state}}if(t&&t.state&&t.state!=="saved"&&t.state!=="clean")return{ok:!1,mode:n,code:"save-failed",state:t.state}}return A=!0,S({mode:e,canEdit:r,internal:!0}),location.reload(),{ok:!0,mode:e,changed:!0,reloading:!0}}function Te(){let e=new URL(window.location.href);e.searchParams.set("editmode","true"),window.location.href=e.toString()}var Y=()=>f?Te():y(n==="edit"?"view":"edit");function De(){!r||f||window.addEventListener("pagehide",()=>{A||S({mode:n,canEdit:r,internal:!1})})}function B(){r?document.documentElement.setAttribute("canedit","true"):document.documentElement.removeAttribute("canedit")}function X(){m(()=>{document.documentElement.setAttribute("editmode",u?"true":"false"),document.documentElement.setAttribute("pageowner",b?"true":"false"),B(),document.addEventListener("clay:capabilitychange",B),f?document.documentElement.setAttribute("draftmode","true"):document.documentElement.removeAttribute("draftmode")})}function N(){X(),De()}N();var Le={init:N,setMode:y,toggleEditMode:Y,isEditMode:u,isOwner:b,canEdit:r,mode:n};var ae={};var Q=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),Me=Q?"\u2318\u21E7E":"Ctrl+Shift+E",Ae=`.clay-mode-note {
1
+ import{b as D,c as W}from"./c-NUHP2XDB.js";import{g as z}from"./c-TWCXBWS3.js";import{a as m}from"./c-VKEDWYDF.js";import{b as F}from"./c-LA2BW7UY.js";import{e as H}from"./c-XGH4GS2T.js";import"./c-IJUK2GPW.js";import{a as S,b as f,c as r,f as u,g as n,h as b,j as T,o as q}from"./c-3O7OBDCM.js";import{c as j,e as $}from"./c-BPF2NSPV.js";import"./c-P7KNDG34.js";import"./c-CYWLPPUS.js";import"./c-N7JPUPGC.js";import"./c-VG5XIN4T.js";import"./c-2YYDMLNZ.js";import"./c-HA6INT6J.js";import{d as U,s as V}from"./c-ICMAOOGK.js";import"./c-WRBKEJD4.js";import{a as k}from"./c-VHNSBD2M.js";var C={};k(C,{activateInitialMode:()=>Ee,canEdit:()=>r,default:()=>Le,init:()=>N,isEditMode:()=>u,isOwner:()=>b,mode:()=>n,modeLifecycle:()=>be,noteLiveSwitch:()=>xe,setMode:()=>y,setPageTypeOnPageLoad:()=>X,toggleEditMode:()=>Y});var A=!1,ve=e=>{if(typeof e?.id=="string"&&e.id.startsWith("clay:"))throw new TypeError(`clay.modeLifecycle: the id "${e.id}" is reserved`);return q(e)},be={register:ve,canWrite:()=>T().phase==="idle"&&u,get state(){return Object.freeze(T())}},L=null,G=()=>L||=import("./c-XDVAZDUE.js").catch(()=>L=null),M=null,xe=e=>{M=e};async function Ee(){if(u)try{await(await G()).activateInitial()}catch(e){console.error("clayjs: the mode lifecycle failed to start:",e)}}var p=null;async function y(e){if(e!=="edit"&&e!=="view")throw new TypeError(`clay.setMode: unknown mode "${e}"`);if(p)return p.target===e?p.promise:{ok:!1,mode:n,code:"busy"};if(e===n&&!L)return{ok:!0,mode:n,changed:!1};if(f)return{ok:!1,mode:n,code:"not-allowed"};let t=ke(e);p={target:e,promise:t};try{return await t}finally{p?.promise===t&&(p=null)}}async function ke(e){let t=typeof window<"u"?window.clay?._requestHostMode:void 0;if(typeof t=="function"&&e!==n){let o;try{o=await t(e)}catch{return{ok:!1,mode:n,code:"host-failed"}}if(o?.reason!=="host-unsupported")return o?.ok?(A=!0,{ok:!0,mode:e,changed:!0,reloading:!0}):{ok:!1,mode:n,code:o?.reason||"host-refused"}}return e==="edit"&&n!=="edit"?Se():!r&&!(e==="view"&&n==="edit")?{ok:!1,mode:n,code:"not-allowed"}:J(e)}async function Se(){let e=location.pathname,{checkHostPermission:t}=await import("./core/host-permission-6EVJGNPL.js"),o=await t({fresh:!0});return location.pathname!==e?{ok:!1,mode:n,code:"cancelled"}:o===!1?{ok:!1,mode:n,code:"permission-denied"}:r?J("edit"):{ok:!1,mode:n,code:"not-allowed"}}async function J(e){if(M){let t=await G(),o=t&&await t.switchMode(e,M);if(o)return o}if(e===n)return{ok:!0,mode:n,changed:!1};if(n==="edit"){let t;try{t=await window.clay?.save?.flush?.()}catch(o){return{ok:!1,mode:n,code:"save-failed",state:o?.state}}if(t&&t.state&&t.state!=="saved"&&t.state!=="clean")return{ok:!1,mode:n,code:"save-failed",state:t.state}}return A=!0,S({mode:e,canEdit:r,internal:!0}),location.reload(),{ok:!0,mode:e,changed:!0,reloading:!0}}function Te(){let e=new URL(window.location.href);e.searchParams.set("editmode","true"),window.location.href=e.toString()}var Y=()=>f?Te():y(n==="edit"?"view":"edit");function De(){!r||f||window.addEventListener("pagehide",()=>{A||S({mode:n,canEdit:r,internal:!1})})}function B(){r?document.documentElement.setAttribute("canedit","true"):document.documentElement.removeAttribute("canedit")}function X(){m(()=>{document.documentElement.setAttribute("editmode",u?"true":"false"),document.documentElement.setAttribute("pageowner",b?"true":"false"),B(),document.addEventListener("clay:capabilitychange",B),f?document.documentElement.setAttribute("draftmode","true"):document.documentElement.removeAttribute("draftmode")})}function N(){X(),De()}N();var Le={init:N,setMode:y,toggleEditMode:Y,isEditMode:u,isOwner:b,canEdit:r,mode:n};var ae={};var Q=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),Me=Q?"\u2318\u21E7E":"Ctrl+Shift+E",Ae=`.clay-mode-note {
2
2
  position: fixed;
3
3
  right: calc(16px + env(safe-area-inset-right, 0px));
4
4
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
@@ -74,4 +74,4 @@ import{b as D,c as W}from"./c-NUHP2XDB.js";import{g as z}from"./c-TWCXBWS3.js";i
74
74
  right: calc(16px + env(safe-area-inset-right, 0px));
75
75
  max-width: none;
76
76
  }
77
- }`,Z=new WeakSet;function ee(e){import("./c-B4VYNXTQ.js").then(({mountEditorUI:t})=>{Z.has(e)||t({name:"mode-note",content:e,css:[Ae]})})}function te(e){Z.add(e),e.getRootNode().host?.remove()}function oe(e){return y(e).then(t=>{t.ok||import("./c-QHIWXHRO.js").then(({modeRefusalText:o})=>{let i=o(t);i&&(typeof window.clay?.toast=="function"?window.clay.toast(i,"error"):typeof window.clay?.menu?.note=="function"?window.clay.menu.note(i):re(i))})})}function Ne(e){(r||n==="edit")&&(!(Q?e.metaKey:e.ctrlKey)||!e.shiftKey||e.altKey||e.code!=="KeyE"||e.isComposing||(e.preventDefault(),oe(n==="edit"?"view":"edit")))}var Ce="In view mode, so edits won't be saved.",Re=":is(input, textarea, select):is([persist], [clay-persist])",R="[editmode\\:contenteditable], [viewmode\\:readonly], [viewmode\\:disabled]",a=null;function ne(e){if(!e.isConnected)return!1;let t=V(e);return t.persist===U.FULL&&!t.extension}function ie(e){let t=e?.nodeType===1?e:e?.parentElement;if(!t)return null;let o=t.closest(Re)||t.closest(R)||(t.isContentEditable?t:null);return o&&ne(o)?o:null}var Pe=e=>e.isContentEditable||e.matches("input, textarea, select")&&!e.readOnly&&!e.disabled,P=()=>r&&n==="view";function Ie(e){P()&&ie(e.target)&&I()}function Oe(e){if(!P()||e.defaultPrevented||e.isComposing||e.ctrlKey||e.metaKey||e.altKey||!(e.key.length===1&&e.key!==" ")&&e.key!=="Backspace"&&e.key!=="Delete")return;let t=e.target;if(t?.nodeType!==1||Pe(t)||t!==document.body&&!t.closest(R))return;ie(t===document.body?document.getSelection()?.anchorNode:t)?.matches(R)&&I()}function _e(e){if(!P())return;let t=e.target?.closest?.("[viewmode\\:disabled]");t&&ne(t)&&I()}function I(){a||(console.warn('clayjs: this tab is in view mode, so edits made here are not saved. clay.setMode("edit") switches; a page that must edit as soon as it opens declares <html opens-in="edit">.'),document.querySelector('clay-editor-ui[data-clay-ui="mode-note"]')?.remove(),a=document.createElement("div"),a.setAttribute("clay","editor-ui"),a.setAttribute("role","alert"),a.className="clay-mode-note clay-view-notice",a.innerHTML='<span></span><button type="button" class="clay-view-notice__edit">Switch to edit</button>',a.querySelector("span").textContent=Ce,a.querySelector("button").addEventListener("click",()=>oe("edit")),ee(a))}function Ke(){n==="view"||!a||(te(a),a=null)}function re(e){let t=document.createElement("div");t.setAttribute("clay","editor-ui"),t.setAttribute("role","status"),t.className="clay-mode-note",t.innerHTML=`<span>This page opens in view mode. Press <kbd>${Me}</kbd> to edit.</span><button type="button" aria-label="Dismiss">\xD7</button>`,e&&(t.querySelector("span").textContent=e);let o=()=>te(t);t.querySelector("button").addEventListener("click",o),addEventListener("keydown",i=>{i.key==="Escape"&&o()},{once:!0}),setTimeout(o,12e3),ee(t)}f||(document.addEventListener("keydown",Ne),document.addEventListener("input",Ie,!0),document.addEventListener("pointerdown",_e,!0),window.addEventListener("keydown",Oe),document.addEventListener("clay:modechange",Ke),m(()=>{if(!r||n!=="view"||document.querySelector("[clay-mode-toggle]"))return;(t=>{let o=window.clay?.ready;window.clay?.storage||typeof o?.then!="function"?queueMicrotask(t):o.then(t,()=>{})})(()=>{if(window.clay?.menu||window.clay?.plugins?.includes?.("menu"))return;let t=window.clay?.storage?.local;!t||t.get("mode-note")||(t.set("mode-note",!0),re())})}));var O={};k(O,{whenShown:()=>Ve});var je="This page can't be edited: the app serving it is out of date. Update HTML Clay to 1.9.0 or newer.",s=null,d=null;function h(){if(!s)return;let e=window.visualViewport,t=e?Math.max(0,window.innerHeight-e.height-e.offsetTop):0;D(s,"bottom",`calc(${16+t}px + env(safe-area-inset-bottom,0px))`)}function $e(){s&&(D(s,"display","none"),window.visualViewport?.removeEventListener("resize",h),window.visualViewport?.removeEventListener("scroll",h))}function qe(){s=d.bevelSurface("div",["position:fixed","left:50%","transform:translateX(-50%)","z-index:2147483001","display:flex","align-items:center","gap:10px 12px","width:max-content","max-width:calc(100vw - 24px)","flex-wrap:wrap","padding:8px 8px 8px 14px","text-align:left",`color-scheme:${d.pageScheme()}`]),s.setAttribute("clay",d.RUNTIME_ONLY),s.setAttribute("data-clay-stale-host",""),s.setAttribute("role","alert");let e=W("span",["all:initial","color-scheme:inherit","display:inline-block","flex:none","width:8px","height:8px","border-radius:50%",`background:${d.TOKENS.ox}`]);e.setAttribute("clay",d.RUNTIME_ONLY);let t=d.bevelButton("Dismiss",{small:!0,variant:"quiet",onClick:$e});t.setAttribute("aria-label","Dismiss this message"),s.append(e,d.bevelText("span",[],je),t),document.body.appendChild(s),h(),d.paintLook(s,{background:d.TOKENS.surface}),window.visualViewport?.addEventListener("resize",h),window.visualViewport?.addEventListener("scroll",h)}async function Ue(){if(!$()||u)return;let[e,t]=await Promise.all([import("./c-2ZZBC45O.js"),import("./c-ZE46QDIH.js")]);d={...e,TOKENS:t.TOKENS},qe()}var se=Promise.resolve();m(()=>{se=Ue()});var Ve=()=>se;var K={};k(K,{createPageDataApi:()=>le,readData:()=>Ge,setPageDataLiveSync:()=>Ye,writeData:()=>Je});var Fe="data-read",ze="data-write";function x(e,t,o){let i=new Error(t);return i.code=e,i.details=o,i}async function ce(e){if(typeof e.json=="function")return e.json();let t=await e.text();return t?JSON.parse(t):null}async function He(e){let t={};try{t=await ce(e)||{}}catch{}let o=t.message||t.error||e.statusText||`Request failed (${e.status})`,i=new Error(o);return i.status=e.status,i.error=t.error,i.details=t.details,i}function We(e){let t=e.headers?.get?.("ETag");return typeof t=="string"&&t?t:null}function Be(e,t){let o=`${t.origin}${t.pathname}`;return e!==void 0?`${o}?data=${encodeURIComponent(JSON.stringify(e))}`:`${t.origin}/_/api${t.pathname}`}async function de(){let{isDraftMode:e}=await import("./core/is-edit-mode-GCX6767E.js");return e?x("DataUnavailableInDraft","Page data is kept in this browser for this visitor."):null}function le({supports:e=H,token:t=j,fetchImpl:o=(...g)=>fetch(...g),getLocation:i=()=>window.location,eventTarget:ue=document,loadWriteModules:fe,syncTimeoutMs:me,httpTimeoutMs:pe}={}){let g=null,w=null;function we(c){g=c}async function ye(c){let v=await de();if(v)throw v;if(!await e(Fe))throw x("DataReadUnsupported","This host does not support reading page data.");let l;try{l=await o(Be(c,i()),{method:"GET",credentials:"same-origin",cache:"no-store",redirect:"error"})}catch(E){throw Object.assign(x("DataReadFailed",E?.message||"Could not read page data."),{cause:E})}if(!l.ok)throw await He(l);return{data:await ce(l),etag:We(l)}}function he(){return w||(w=import("./c-YQUJ74R3.js").then(({createPageDataWrite:c})=>c({supports:e,token:t,fetchImpl:o,getLocation:i,eventTarget:ue,getLiveSync:()=>g,loadWriteModules:fe,syncTimeoutMs:me,httpTimeoutMs:pe})).catch(c=>{throw w=null,c}),w)}async function ge(c,v){let l=await de();if(l)throw l;if(!await e(ze))throw x("DataWriteUnsupported","This host does not support writing page data.");return(await he()).writeData(c,v)}return{readData:ye,writeData:ge,setLiveSync:we}}var _=le(),Ge=_.readData,Je=_.writeData,Ye=_.setLiveSync;var lt={"lib/mutation.js":F,"core/preserve-authored.js":z,"core/edit-mode.js":C,"core/mode-key.js":ae,"core/stale-host-notice.js":O,"core/page-data.js":K};export{lt as core};
77
+ }`,Z=new WeakSet;function ee(e){import("./c-B4VYNXTQ.js").then(({mountEditorUI:t})=>{Z.has(e)||t({name:"mode-note",content:e,css:[Ae]})})}function te(e){Z.add(e),e.getRootNode().host?.remove()}function oe(e){return y(e).then(t=>{t.ok||import("./c-QHIWXHRO.js").then(({modeRefusalText:o})=>{let i=o(t);i&&(typeof window.clay?.toast=="function"?window.clay.toast(i,"error"):typeof window.clay?.menu?.note=="function"?window.clay.menu.note(i):re(i))})})}function Ne(e){(r||n==="edit")&&(!(Q?e.metaKey:e.ctrlKey)||!e.shiftKey||e.altKey||e.code!=="KeyE"||e.isComposing||(e.preventDefault(),oe(n==="edit"?"view":"edit")))}var Ce="In view mode, so edits won't be saved.",Re=":is(input, textarea, select):is([persist], [clay-persist])",R="[editmode\\:contenteditable], [viewmode\\:readonly], [viewmode\\:disabled]",a=null;function ne(e){if(!e.isConnected)return!1;let t=V(e);return t.persist===U.FULL&&!t.extension}function ie(e){let t=e?.nodeType===1?e:e?.parentElement;if(!t)return null;let o=t.closest(Re)||t.closest(R)||(t.isContentEditable?t:null);return o&&ne(o)?o:null}var Pe=e=>e.isContentEditable||e.matches("input, textarea, select")&&!e.readOnly&&!e.disabled,P=()=>r&&n==="view";function Ie(e){P()&&ie(e.target)&&I()}function Oe(e){if(!P()||e.defaultPrevented||e.isComposing||e.ctrlKey||e.metaKey||e.altKey||!(e.key.length===1&&e.key!==" ")&&e.key!=="Backspace"&&e.key!=="Delete")return;let t=e.target;if(t?.nodeType!==1||Pe(t)||t!==document.body&&!t.closest(R))return;ie(t===document.body?document.getSelection()?.anchorNode:t)?.matches(R)&&I()}function _e(e){if(!P())return;let t=e.target?.closest?.("[viewmode\\:disabled]");t&&ne(t)&&I()}function I(){a||(console.warn('clayjs: this tab is in view mode, so edits made here are not saved. clay.setMode("edit") switches; a page that must edit as soon as it opens declares <html opens-in="edit">.'),document.querySelector('clay-editor-ui[data-clay-ui="mode-note"]')?.remove(),a=document.createElement("div"),a.setAttribute("clay","editor-ui"),a.setAttribute("role","alert"),a.className="clay-mode-note clay-view-notice",a.innerHTML='<span></span><button type="button" class="clay-view-notice__edit">Switch to edit</button>',a.querySelector("span").textContent=Ce,a.querySelector("button").addEventListener("click",()=>oe("edit")),ee(a))}function Ke(){n==="view"||!a||(te(a),a=null)}function re(e){let t=document.createElement("div");t.setAttribute("clay","editor-ui"),t.setAttribute("role","status"),t.className="clay-mode-note",t.innerHTML=`<span>This page opens in view mode. Press <kbd>${Me}</kbd> to edit.</span><button type="button" aria-label="Dismiss">\xD7</button>`,e&&(t.querySelector("span").textContent=e);let o=()=>te(t);t.querySelector("button").addEventListener("click",o),addEventListener("keydown",i=>{i.key==="Escape"&&o()},{once:!0}),setTimeout(o,12e3),ee(t)}f||(document.addEventListener("keydown",Ne),document.addEventListener("input",Ie,!0),document.addEventListener("pointerdown",_e,!0),window.addEventListener("keydown",Oe),document.addEventListener("clay:modechange",Ke),m(()=>{if(!r||n!=="view"||document.querySelector("[clay-mode-toggle]"))return;(t=>{let o=window.clay?.ready;window.clay?.storage||typeof o?.then!="function"?queueMicrotask(t):o.then(t,()=>{})})(()=>{if(window.clay?.menu||window.clay?.plugins?.includes?.("menu"))return;let t=window.clay?.storage?.local;!t||t.get("mode-note")||(t.set("mode-note",!0),re())})}));var O={};k(O,{whenShown:()=>Ve});var je="This page can't be edited: the app serving it is out of date. Update HTML Clay to 1.9.0 or newer.",s=null,d=null;function h(){if(!s)return;let e=window.visualViewport,t=e?Math.max(0,window.innerHeight-e.height-e.offsetTop):0;D(s,"bottom",`calc(${16+t}px + env(safe-area-inset-bottom,0px))`)}function $e(){s&&(D(s,"display","none"),window.visualViewport?.removeEventListener("resize",h),window.visualViewport?.removeEventListener("scroll",h))}function qe(){s=d.bevelSurface("div",["position:fixed","left:50%","transform:translateX(-50%)","z-index:2147483001","display:flex","align-items:center","gap:10px 12px","width:max-content","max-width:calc(100vw - 24px)","flex-wrap:wrap","padding:8px 8px 8px 14px","text-align:left",`color-scheme:${d.pageScheme()}`]),s.setAttribute("clay",d.RUNTIME_ONLY),s.setAttribute("data-clay-stale-host",""),s.setAttribute("role","alert");let e=W("span",["all:initial","color-scheme:inherit","display:inline-block","flex:none","width:8px","height:8px","border-radius:50%",`background:${d.TOKENS.ox}`]);e.setAttribute("clay",d.RUNTIME_ONLY);let t=d.bevelButton("Dismiss",{small:!0,variant:"quiet",onClick:$e});t.setAttribute("aria-label","Dismiss this message"),s.append(e,d.bevelText("span",[],je),t),document.body.appendChild(s),h(),d.paintLook(s,{background:d.TOKENS.surface}),window.visualViewport?.addEventListener("resize",h),window.visualViewport?.addEventListener("scroll",h)}async function Ue(){if(!$()||u)return;let[e,t]=await Promise.all([import("./c-Z7RJANGO.js"),import("./c-3TLG3OLG.js")]);d={...e,TOKENS:t.TOKENS},qe()}var se=Promise.resolve();m(()=>{se=Ue()});var Ve=()=>se;var K={};k(K,{createPageDataApi:()=>le,readData:()=>Ge,setPageDataLiveSync:()=>Ye,writeData:()=>Je});var Fe="data-read",ze="data-write";function x(e,t,o){let i=new Error(t);return i.code=e,i.details=o,i}async function ce(e){if(typeof e.json=="function")return e.json();let t=await e.text();return t?JSON.parse(t):null}async function He(e){let t={};try{t=await ce(e)||{}}catch{}let o=t.message||t.error||e.statusText||`Request failed (${e.status})`,i=new Error(o);return i.status=e.status,i.error=t.error,i.details=t.details,i}function We(e){let t=e.headers?.get?.("ETag");return typeof t=="string"&&t?t:null}function Be(e,t){let o=`${t.origin}${t.pathname}`;return e!==void 0?`${o}?data=${encodeURIComponent(JSON.stringify(e))}`:`${t.origin}/_/api${t.pathname}`}async function de(){let{isDraftMode:e}=await import("./core/is-edit-mode-GCX6767E.js");return e?x("DataUnavailableInDraft","Page data is kept in this browser for this visitor."):null}function le({supports:e=H,token:t=j,fetchImpl:o=(...g)=>fetch(...g),getLocation:i=()=>window.location,eventTarget:ue=document,loadWriteModules:fe,syncTimeoutMs:me,httpTimeoutMs:pe}={}){let g=null,w=null;function we(c){g=c}async function ye(c){let v=await de();if(v)throw v;if(!await e(Fe))throw x("DataReadUnsupported","This host does not support reading page data.");let l;try{l=await o(Be(c,i()),{method:"GET",credentials:"same-origin",cache:"no-store",redirect:"error"})}catch(E){throw Object.assign(x("DataReadFailed",E?.message||"Could not read page data."),{cause:E})}if(!l.ok)throw await He(l);return{data:await ce(l),etag:We(l)}}function he(){return w||(w=import("./c-BV6FQQXM.js").then(({createPageDataWrite:c})=>c({supports:e,token:t,fetchImpl:o,getLocation:i,eventTarget:ue,getLiveSync:()=>g,loadWriteModules:fe,syncTimeoutMs:me,httpTimeoutMs:pe})).catch(c=>{throw w=null,c}),w)}async function ge(c,v){let l=await de();if(l)throw l;if(!await e(ze))throw x("DataWriteUnsupported","This host does not support writing page data.");return(await he()).writeData(c,v)}return{readData:ye,writeData:ge,setLiveSync:we}}var _=le(),Ge=_.readData,Je=_.writeData,Ye=_.setLiveSync;var lt={"lib/mutation.js":F,"core/preserve-authored.js":z,"core/edit-mode.js":C,"core/mode-key.js":ae,"core/stale-host-notice.js":O,"core/page-data.js":K};export{lt as core};
@@ -1 +1 @@
1
- import{a,b as c,c as d,d as e,e as f,f as g,g as h}from"../c-AL4RBJF2.js";import{e as b}from"../c-DHXPDLW6.js";import"../c-LZJPNR2W.js";import"../c-FILLTJA7.js";import"../c-5VYOWDTI.js";import"../c-GSRLXYWL.js";import"../c-WYFDLITL.js";import"../c-LA2BW7UY.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{e as LiveSync,d as REMOTE_WINS_SELECTOR,c as SYNC_IGNORE_SELECTOR,b as WIRE_PROFILES,a as conflicts,h as default,f as liveSync,g as morph};
1
+ import{a,b as c,c as d,d as e,e as f,f as g,g as h}from"../c-ILGQ3UXQ.js";import{e as b}from"../c-6PBXRWDX.js";import"../c-LZJPNR2W.js";import"../c-FILLTJA7.js";import"../c-5VYOWDTI.js";import"../c-GSRLXYWL.js";import"../c-WYFDLITL.js";import"../c-LA2BW7UY.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{e as LiveSync,d as REMOTE_WINS_SELECTOR,c as SYNC_IGNORE_SELECTOR,b as WIRE_PROFILES,a as conflicts,h as default,f as liveSync,g as morph};
@@ -1 +1 @@
1
- import{a as r,b as l,c as m,d as c}from"../c-W23KVGUO.js";import{b as d}from"../c-BRLCTNMC.js";import"../c-QHWJ5ZIJ.js";import{a as s,b as n,c as o}from"../c-RG6XUZFA.js";import"../c-UL2YUY52.js";import"../c-QY7F6EN6.js";import"../c-CJFDLD43.js";import"../c-BJ7YQ5QZ.js";import"../c-4JZDZFF6.js";import"../c-VAK7SG37.js";import"../c-MHI3GYKF.js";import{a}from"../c-2AZDZWCK.js";import{f as i}from"../c-46XYM55L.js";import"../c-NUHP2XDB.js";import"../c-VKEDWYDF.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";i();var t=window.clay=window.clay||{};t.toast=o;t.toastPersistent=s;t.ask=r;t.confirm=l;t.tell=m;t.snippet=c;t.modal=d;typeof window.toast>"u"&&(window.toast=o);typeof window.toastPersistent>"u"&&(window.toastPersistent=s);a.toasts=!0;a.savedToast=!!t.saveToast;Object.defineProperty(t,"saveToast",{get:()=>a.savedToast,set:e=>{a.savedToast=!!e},enumerable:!0,configurable:!0});document.addEventListener("clay:save-saved",e=>{n("Couldn't save"),n("Offline, not saved"),e.detail?.msgType==="warning"?o(e.detail.msg||"Saved","warning"):(!a.chip||a.savedToast)&&o(e.detail?.msg||"Saved","success")});document.addEventListener("clay:save-error",()=>s("Couldn't save","error"));document.addEventListener("clay:save-offline",()=>s("Offline, not saved","warning"));document.addEventListener("clay:live-notice",e=>{e.detail?.code==="save-uncertain"&&s(e.detail.message,"warning"),e.detail?.code==="op-too-large"&&o(e.detail.message,"warning")});export{r as ask,l as consent,c as snippet,m as tell,d as themodal,o as toast,s as toastPersistent};
1
+ import{a as r,b as l,c as m,d as c}from"../c-HWR6GMGK.js";import{b as d}from"../c-6RC66MYY.js";import"../c-QHWJ5ZIJ.js";import{a as s,b as n,c as o}from"../c-FAXQU7MQ.js";import"../c-UL2YUY52.js";import"../c-QY7F6EN6.js";import"../c-6KBKYLPO.js";import"../c-IHUWUKIU.js";import"../c-4JZDZFF6.js";import"../c-EUGJVHDD.js";import"../c-MHI3GYKF.js";import{a}from"../c-2AZDZWCK.js";import{f as i}from"../c-46XYM55L.js";import"../c-NUHP2XDB.js";import"../c-VKEDWYDF.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";i();var t=window.clay=window.clay||{};t.toast=o;t.toastPersistent=s;t.ask=r;t.confirm=l;t.tell=m;t.snippet=c;t.modal=d;typeof window.toast>"u"&&(window.toast=o);typeof window.toastPersistent>"u"&&(window.toastPersistent=s);a.toasts=!0;a.savedToast=!!t.saveToast;Object.defineProperty(t,"saveToast",{get:()=>a.savedToast,set:e=>{a.savedToast=!!e},enumerable:!0,configurable:!0});document.addEventListener("clay:save-saved",e=>{n("Couldn't save"),n("Offline, not saved"),e.detail?.msgType==="warning"?o(e.detail.msg||"Saved","warning"):(!a.chip||a.savedToast)&&o(e.detail?.msg||"Saved","success")});document.addEventListener("clay:save-error",()=>s("Couldn't save","error"));document.addEventListener("clay:save-offline",()=>s("Offline, not saved","warning"));document.addEventListener("clay:live-notice",e=>{e.detail?.code==="save-uncertain"&&s(e.detail.message,"warning"),e.detail?.code==="op-too-large"&&o(e.detail.message,"warning")});export{r as ask,l as consent,c as snippet,m as tell,d as themodal,o as toast,s as toastPersistent};