@panphora/clayjs 1.24.0 → 1.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all.js +1 -1
- package/dist/clay-dom.js +1 -1
- package/dist/clay-events.js +1 -1
- package/dist/clay-internals.js +1 -1
- package/dist/clay-options.js +1 -1
- package/dist/clay-router.js +1 -1
- package/dist/clay-ui.js +1 -1
- package/dist/clay-utils.js +1 -1
- package/dist/clay.js +1 -1
- package/dist/clay.standalone.js +16610 -14400
- package/dist/m/attrs/{refetch-on-save-DPGJJMGN.js → refetch-on-save-5CBFUJUF.js} +1 -1
- package/dist/m/attrs/save-freeze-MH3AOD56.js +1 -0
- package/dist/m/c-277QP5ET.js +1 -0
- package/dist/m/{c-SXGEWPFC.js → c-3E2IK5HU.js} +1 -1
- package/dist/m/{c-A4L7APIU.js → c-4AE2A2LK.js} +1 -1
- package/dist/m/{c-DZPO22O3.js → c-4Q6QIODW.js} +1 -1
- package/dist/m/{c-RO73MKKR.js → c-52OC3OH3.js} +1 -1
- package/dist/m/{c-VNAYHV2J.js → c-5PZYDWTW.js} +1 -1
- package/dist/m/c-5Q5XBN56.js +1 -0
- package/dist/m/c-5SZ6KFR5.js +1 -0
- package/dist/m/{c-ZRGEN6QQ.js → c-AI3H6ETU.js} +2 -2
- package/dist/m/{c-7V6MGMX2.js → c-BCWYEG6P.js} +1 -1
- package/dist/m/{c-A7N5TNSL.js → c-BJ2RRQBQ.js} +1 -1
- package/dist/m/{c-CTGRDT6E.js → c-C6YZNU6E.js} +1 -1
- package/dist/m/{c-DLBX4JCJ.js → c-C7SUMNMI.js} +1 -1
- package/dist/m/c-CITLTVQ4.js +4 -0
- package/dist/m/{c-TWOXQQKV.js → c-CL5LSATX.js} +1 -1
- package/dist/m/c-CU33V6RW.js +4 -0
- package/dist/m/{c-2R4OBWIP.js → c-D62HRSZK.js} +1 -1
- package/dist/m/{c-DD26VXAP.js → c-DT7E76Z2.js} +1 -1
- package/dist/m/{c-54ZZZYUN.js → c-EAV7A6BT.js} +1 -1
- package/dist/m/{c-RBPZNU2D.js → c-EQ5NBOGA.js} +1 -1
- package/dist/m/{c-KQKKIVLW.js → c-FBOO2UY3.js} +1 -1
- package/dist/m/{c-RTSRGGTP.js → c-FJDTDGDA.js} +1 -1
- package/dist/m/{c-MQKSKQHG.js → c-FKTALXNV.js} +1 -1
- package/dist/m/{c-GNIVHLEJ.js → c-GDNZEOOZ.js} +1 -1
- package/dist/m/{c-SUXHUL7U.js → c-GEAG5XAK.js} +1 -1
- package/dist/m/{c-UM7VZDTW.js → c-GY4BREDT.js} +1 -1
- package/dist/m/{c-4PO3YGDC.js → c-HGG7M2S3.js} +1 -1
- package/dist/m/c-HKSLOVU4.js +1 -0
- package/dist/m/{c-KJHVB2KG.js → c-HXGNH6GY.js} +1 -1
- package/dist/m/{c-FLEIU6CG.js → c-IESDKFO6.js} +1 -1
- package/dist/m/{c-SNVDWMM3.js → c-IJHF4IO6.js} +1 -1
- package/dist/m/{c-SGGGCIVD.js → c-IL5IVTOG.js} +1 -1
- package/dist/m/c-JB5YU57S.js +1 -0
- package/dist/m/{c-MP6S4AZU.js → c-JD2VFAYG.js} +2 -2
- package/dist/m/{c-CV4T65JE.js → c-JWW6BHWD.js} +3 -3
- package/dist/m/{c-GM7OA6EJ.js → c-K4M76VPM.js} +1 -1
- package/dist/m/{c-RXTPKCMC.js → c-KU3PX7LL.js} +1 -1
- package/dist/m/{c-2PVGJFI5.js → c-KYTVZT4D.js} +1 -1
- package/dist/m/{c-RJKKRWHW.js → c-M7ITYKMF.js} +1 -1
- package/dist/m/c-MFB74XVN.js +3 -0
- package/dist/m/c-MOP5KBWZ.js +1 -0
- package/dist/m/{c-YB3CDTDZ.js → c-MUM53J5J.js} +1 -1
- package/dist/m/{c-YK2L436K.js → c-MV7TEUTD.js} +1 -1
- package/dist/m/{c-LA2BW7UY.js → c-MZCOGNZL.js} +1 -1
- package/dist/m/{c-YGGO2G2L.js → c-N4GEJMXW.js} +1 -1
- package/dist/m/{c-NQAPWM7O.js → c-NADLYVAH.js} +1 -1
- package/dist/m/{c-RS77ODLY.js → c-NL4I4KNG.js} +1 -1
- package/dist/m/{c-6UPEKW6O.js → c-O2QZDVZ2.js} +1 -1
- package/dist/m/{c-LTSPHVAK.js → c-OBMZASYQ.js} +1 -1
- package/dist/m/{c-LUXAB2XI.js → c-ORLPQFNU.js} +1 -1
- package/dist/m/c-P73XPAOA.js +1 -0
- package/dist/m/{c-PWJSJEJU.js → c-PNZIJFG7.js} +1 -1
- package/dist/m/{c-ZKKAF4UT.js → c-PRZNJUYZ.js} +2 -2
- package/dist/m/{c-Q6VNQDJE.js → c-Q2CB57UG.js} +1 -1
- package/dist/m/{c-TWCXBWS3.js → c-QCDVDZIR.js} +1 -1
- package/dist/m/{c-P5NKFRL4.js → c-QDVG4NAZ.js} +1 -1
- package/dist/m/c-QWB53KRW.js +1 -0
- package/dist/m/{c-GNI7WHKF.js → c-RGAALCDU.js} +1 -1
- package/dist/m/c-RHPHMTF2.js +2 -0
- package/dist/m/{c-BULK5J4M.js → c-RWJ3OSCP.js} +1 -1
- package/dist/m/{c-5FXEKU4Y.js → c-SEVOS4UE.js} +1 -1
- package/dist/m/{c-PMRRMT72.js → c-SFYTKRU7.js} +1 -1
- package/dist/m/{c-47IBJGPQ.js → c-SFZRY6RT.js} +1 -1
- package/dist/m/{c-QENKN7QI.js → c-SGG6MUXW.js} +1 -1
- package/dist/m/c-SMLAJASY.js +1 -0
- package/dist/m/{c-VSEUFJAO.js → c-SUAC5RSG.js} +1 -1
- package/dist/m/{c-6RGEQNVV.js → c-SXZYVXD6.js} +1 -1
- package/dist/m/{c-ZFO5RW6G.js → c-TCFVG3I4.js} +1 -1
- package/dist/m/{c-PZRWZZRO.js → c-TLQINES7.js} +2 -2
- package/dist/m/c-U4TWEIKZ.js +1 -0
- package/dist/m/{c-FZRZPIFS.js → c-U65PREMC.js} +1 -1
- package/dist/m/{c-7YETSAVY.js → c-U7F66I64.js} +1 -1
- package/dist/m/{c-WOELSNWS.js → c-UD4VDBGJ.js} +1 -1
- package/dist/m/{c-VI3BJHCM.js → c-V2FPBRO6.js} +1 -1
- package/dist/m/{c-2OIKXOY6.js → c-V4B3RUWB.js} +1 -1
- package/dist/m/{c-O5ARALMJ.js → c-V5L6HWVL.js} +1 -1
- package/dist/m/c-VMXCX52Q.js +1 -0
- package/dist/m/{c-PVJMJL3P.js → c-VO6RSFCO.js} +1 -1
- package/dist/m/c-WDFQ7PBU.js +1 -0
- package/dist/m/{c-OG6GFSUX.js → c-WGQVSKKC.js} +1 -1
- package/dist/m/c-WSTUCBHV.js +1 -0
- package/dist/m/{c-EY5KDUZF.js → c-WVCT3ITX.js} +1 -1
- package/dist/m/{c-SE3SIY7Y.js → c-X3V4RWMA.js} +1 -1
- package/dist/m/{c-HIX5H5L7.js → c-XHZIKRCV.js} +1 -1
- package/dist/m/{c-2BLVA6IN.js → c-XQTERKQA.js} +1 -1
- package/dist/m/{c-A5ZBFICF.js → c-YFO6ZJLQ.js} +1 -1
- package/dist/m/{c-PD5AKHY3.js → c-YX2MC7YL.js} +1 -1
- package/dist/m/{c-OYHI67B6.js → c-YYGUHSZR.js} +1 -1
- package/dist/m/{c-YYMZWQLR.js → c-Z2OZFX3N.js} +1 -1
- package/dist/m/{c-AT7GLQGV.js → c-ZEA3DCG3.js} +1 -1
- package/dist/m/{c-75N3KG35.js → c-ZJG6C2WL.js} +1 -1
- package/dist/m/{c-FVPNX2GO.js → c-ZORVIXUR.js} +1 -1
- package/dist/m/{c-FV46ZKGX.js → c-ZPI7M5U5.js} +1 -1
- package/dist/m/core/{admin-attrs-5UGMYCKW.js → admin-attrs-ZI6K6UGM.js} +1 -1
- package/dist/m/core/{autosave-4P66VXX7.js → autosave-BSM2ABJL.js} +1 -1
- package/dist/m/core/{conflict-notice-BAR23OWH.js → conflict-notice-7EQLDYPA.js} +1 -1
- package/dist/m/core/draft-mode-M5XNYBMY.js +1 -0
- package/dist/m/core/{host-permission-3HE4CFD6.js → host-permission-5BYP24GC.js} +1 -1
- package/dist/m/core/{is-edit-mode-GK7IFFMT.js → is-edit-mode-73OXKK5H.js} +1 -1
- package/dist/m/core/{persist-AIJGTKKI.js → persist-2SZO3PCE.js} +1 -1
- package/dist/m/core/{recovery-LPB6X72P.js → recovery-VZF7RJZF.js} +1 -1
- package/dist/m/core/{save-FV4ZCKBI.js → save-K6Q47J2X.js} +1 -1
- package/dist/m/core/{save-core-K7XFAWQ4.js → save-core-U3Z44XBO.js} +1 -1
- package/dist/m/core/{site-edits-TEQORBJU.js → site-edits-CFMF6GHD.js} +1 -1
- package/dist/m/core/{snapshot-FJP5IJL3.js → snapshot-PWCHYFL6.js} +1 -1
- package/dist/m/core/unsaved-warning-2WRZLJH5.js +1 -0
- package/dist/m/events/{index-B6TGDYMG.js → index-YKQIBZE5.js} +1 -1
- package/dist/m/internals/index-FSLC4M7J.js +1 -0
- package/dist/m/lib/{cache-bust-NH7VBWHO.js → cache-bust-BL4KUQAJ.js} +1 -1
- package/dist/m/loader-RC54UV7H.js +1 -0
- package/dist/m/manifest-3B84C829.js +1 -0
- package/dist/m/manifest-edit-1CB79AD4.js +1 -0
- package/dist/m/manifest.json +1215 -1129
- package/dist/m/options/{options-55LQHSJ4.js → options-LKIZ7YTG.js} +1 -1
- package/dist/m/page/{editor-KAZDJNND.js → editor-PKSPJ2XJ.js} +2 -2
- package/dist/m/plugins/{ai-edit-CUKQQWJX.js → ai-edit-3LG6MGS3.js} +1 -1
- package/dist/m/plugins/{cms-JANMGPHM.js → cms-T2HLI7JG.js} +16 -16
- package/dist/m/plugins/{demo-JIR7DXJA.js → demo-LMCMBILC.js} +1 -1
- package/dist/m/plugins/{derive-QVI3LI3A.js → derive-7DR5TUDH.js} +1 -1
- package/dist/m/plugins/{indicator-DAKZGAWI.js → indicator-CTKX4EY7.js} +1 -1
- package/dist/m/plugins/{live-UAJGWRNP.js → live-IFLL6YN5.js} +1 -1
- package/dist/m/plugins/{menu-BFJ644YX.js → menu-YJZ3JWBC.js} +1 -1
- package/dist/m/plugins/page-GTDPYGE4.js +2 -0
- package/dist/m/plugins/{page-view-OYN7Z5TS.js → page-view-NMCCU6MF.js} +1 -1
- package/dist/m/plugins/{people-VBDR5Y22.js → people-6WIWCZEG.js} +1 -1
- package/dist/m/plugins/{richclay-CBLZRFB4.js → richclay-L3BZMX4I.js} +3 -3
- package/dist/m/plugins/sortable-365SRRL3.js +1 -0
- package/dist/m/plugins/{source-ZXDD7F6X.js → source-7LSGOV46.js} +1 -1
- package/dist/m/plugins/{undo-5JI5G7CQ.js → undo-UES4KS7B.js} +1 -1
- package/dist/m/plugins/{upgrade-6B6QS3NR.js → upgrade-MMPZUCDM.js} +1 -1
- package/dist/m/plugins/{upload-DNJNW6H3.js → upload-NZET3DNQ.js} +1 -1
- package/dist/m/plugins/visitor-drafts-V5YB7XDH.js +20 -0
- package/dist/m/plugins/{visitor-drafts-owner-VIAZC3CF.js → visitor-drafts-owner-TLECTYWS.js} +1 -1
- package/dist/m/plugins/{visitor-menu-ZHKWIKKY.js → visitor-menu-QDV2MYJN.js} +1 -1
- package/dist/m/plugins/wire-3YGUO3GE.js +1 -0
- package/dist/m/{reader-core-F6RY3V64.js → reader-core-VR7EL4WV.js} +2 -2
- package/dist/m/sync/live-sync-XMXXZS3G.js +1 -0
- package/dist/m/vendor/sap-core.vendor-JANUQULT.js +7 -0
- package/dist/offline-manifest.json +724 -664
- package/docs/guide.md +1 -0
- package/entries/clay-data.js +1 -1
- package/entries/sap.js +6 -5
- package/package.json +2 -2
- package/src/core/draft-mode.js +11 -0
- package/src/core/save-core.js +16 -17
- package/src/core/save.js +1 -1
- package/src/core/unsaved-warning.js +2 -2
- package/src/lib/dirty-gate.js +19 -0
- package/src/lib/idb-error-code.js +20 -0
- package/src/loader.js +2 -0
- package/src/plugins/menu/visitor.js +33 -1
- package/src/plugins/page.js +19 -5
- package/src/plugins/sortable.js +7 -0
- package/src/plugins/visitor-drafts/commit.js +350 -0
- package/src/plugins/visitor-drafts/idb.js +227 -0
- package/src/plugins/visitor-drafts/prompt.js +23 -3
- package/src/plugins/visitor-drafts/recovery-menu.js +118 -0
- package/src/plugins/visitor-drafts/recovery.js +64 -0
- package/src/plugins/visitor-drafts/session.js +393 -0
- package/src/plugins/visitor-drafts/store.js +247 -27
- package/src/plugins/visitor-drafts.js +177 -28
- package/src/sync/live-sync.js +1 -1
- package/src/sync/wire-profile.js +9 -4
- package/src/vendor/hyper-html-api-data.vendor.js +1 -1
- package/src/vendor/hyper-html-api-upgrade.vendor.js +2 -2
- package/src/vendor/hypercms.vendor.js +16 -16
- package/src/vendor/richclay.vendor.js +1 -1
- package/src/vendor/sap-core.vendor.js +6 -5
- package/src/vendor/sap-ownership.vendor.js +181 -11
- package/tool-generation/system.md +1 -1
- package/dist/m/attrs/save-freeze-JZHKRQLR.js +0 -1
- package/dist/m/c-234RSEIW.js +0 -1
- package/dist/m/c-2YIJ6ZA6.js +0 -1
- package/dist/m/c-H2H7TI6O.js +0 -1
- package/dist/m/c-HSNGLIFB.js +0 -3
- package/dist/m/c-JMDKPBMC.js +0 -4
- package/dist/m/c-LO4C4J77.js +0 -1
- package/dist/m/c-N7JPUPGC.js +0 -1
- package/dist/m/c-NEXFVJIT.js +0 -1
- package/dist/m/c-R23UHMXG.js +0 -1
- package/dist/m/c-T527QHOB.js +0 -1
- package/dist/m/c-V2U3F4QX.js +0 -1
- package/dist/m/c-VG5XIN4T.js +0 -1
- package/dist/m/c-YINHPF4V.js +0 -1
- package/dist/m/core/draft-mode-WSQAT67S.js +0 -1
- package/dist/m/core/unsaved-warning-FF63QGKI.js +0 -1
- package/dist/m/internals/index-AX4CG7B2.js +0 -1
- package/dist/m/loader-5IA5OJ3J.js +0 -1
- package/dist/m/manifest-98258645.js +0 -1
- package/dist/m/manifest-edit-ABF56000.js +0 -1
- package/dist/m/plugins/page-ZBIYHGK4.js +0 -2
- package/dist/m/plugins/sortable-HDOQ6GAC.js +0 -1
- package/dist/m/plugins/visitor-drafts-A5FDQ2G7.js +0 -20
- package/dist/m/plugins/wire-XOT7XKJL.js +0 -1
- package/dist/m/sync/live-sync-M2PP2IWY.js +0 -1
- package/dist/m/vendor/sap-core.vendor-OA5SKL7Q.js +0 -6
- /package/dist/m/plugins/{richclay-CBLZRFB4.js.LEGAL.txt → richclay-L3BZMX4I.js.LEGAL.txt} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var Ze=Object.defineProperty,Ge=(e,t)=>{for(var r in t)Ze(e,r,{get:t[r],enumerable:!0})},Oe=["textContent","innerText","innerHTML","outerHTML","value","checked","selected","disabled","readOnly","type","tagName","nodeName","nodeType","nodeValue","childElementCount","id","className","classList","baseURI","offsetWidth","offsetHeight","clientWidth","clientHeight","scrollWidth","scrollHeight","dataset","currentSrc","duration","paused","title","documentURI","contentType"],Qe=new Set(Oe),Ye=new Set(["textContent","innerText","innerHTML","value","checked","selected","disabled","readOnly","type","id","className","title"]),Ne=new Set(["tagName","nodeName","nodeType","nodeValue","childElementCount","classList","baseURI","documentURI","contentType","offsetWidth","offsetHeight","clientWidth","clientHeight","scrollWidth","scrollHeight","currentSrc","duration","paused","dataset"]),ue=new Set(["checked","selected","disabled","readOnly","paused"]);function et(e,t){return t==null?ue.has(e)?!1:"":ue.has(e)?t==="false"?!1:!!t:t}var O={};Ge(O,{CodecRefused:()=>ot,EmptyListInsert:()=>M,MAX_RULE_DEPTH:()=>W,MaxRuleDepthExceeded:()=>Z,NoRulesTag:()=>nt,RuleTargetReadOnly:()=>Re,RulesParseError:()=>R,ShapeMismatch:()=>Se,UnknownCodec:()=>ke,UnknownRulesVersion:()=>$e,WriteNotRoundTripped:()=>rt,WriteRefused:()=>Ce,WriteRejected:()=>lt});var R=class extends Error{constructor(e,t){super(e),this.name="RulesParseError",this.cause=t}},$e=class extends Error{constructor(e){super(`unknown rules version: ${e}. Library supports "1" and "2".`),this.name="UnknownRulesVersion",this.version=e}},W=20,Z=class extends Error{constructor(e){super(`rule depth exceeded ${W} at path: ${e.join(".")}`),this.name="MaxRuleDepthExceeded",this.path=e}},Se=class extends Error{constructor(e){super(`shape mismatch: ${e.length} field(s) failed validation`),this.name="ShapeMismatch",this.mismatches=e}},M=class extends Error{constructor(e,t){super(t?`cannot add items to empty list at "${e.join(".")}" \u2014 ${t}`:`cannot add items to empty list at "${e.join(".")}" \u2014 no sibling to clone as template. Seed the list with a hidden item first.`),this.name="EmptyListInsert",this.path=e}},Re=class extends Error{constructor(e){super(`cannot write to read-only DOM property "${e}"`),this.name="RuleTargetReadOnly",this.target=e}},Ce=class extends Error{constructor(e){super(`write refused: ${e.length} write(s) broke the content-only policy`),this.name="WriteRefused",this.refusals=e}};function tt(e){return e.reduce((t,r)=>typeof r=="number"?`${t}[${r}]`:t?`${t}.${r}`:String(r),"")||"(root)"}var rt=class extends Error{constructor(e){super(`write did not round-trip at "${tt(e)}"`),this.name="WriteNotRoundTripped",this.path=e}},nt=class extends Error{constructor(e){super(`no <script data-rules-name~="${e}"> rules tag in this document`),this.name="NoRulesTag",this.token=e}},lt=class extends Error{constructor(e,t){super(`write rejected: ${e.length} unknown key(s), ${t.length} rule(s) with no matching element`),this.name="WriteRejected",this.unknownKeys=e,this.unmatched=t}},ke=class extends Error{constructor(e){super(`unknown codec "${e}": no codec by that name is given to this call`),this.name="UnknownCodec",this.code="unknown-codec",this.codec=e}},ot=class extends Error{constructor(e,t){super(t),this.name="CodecRefused",this.code=e}};function C(e){let t=0,r=null,l=-1;for(let n=0;n<e.length;n++){let o=e[n];o==="\\"?n++:r?o===r&&(r=null):o==='"'||o==="'"?r=o:o==="["||o==="("?t++:o==="]"||o===")"?t>0&&t--:o==="@"&&t===0&&(l=n)}return l}var ae="[*]";function $(e){let t=C(e),r=t===-1?e:e.slice(0,t),l=r.endsWith(ae),n={selector:l?r.slice(0,-ae.length):r,prop:t===-1?null:e.slice(t+1)||null};return l&&(n.all=!0),n}function je(e){let t=0,r=null,l=-1,n=!1;for(let o=0;o<e.length;o++){let a=e[o];a==="\\"?o++:r?a===r&&(r=null):a==='"'||a==="'"?r=a:a==="["||a==="("?t++:a==="]"||a===")"?t>0&&t--:t===0&&a===">"?l=o:t===0&&a===","&&(n=!0)}return n||l===-1||!it(e,l+1)?null:e.slice(0,l).trim()||null}function it(e,t){let r=t,l=e.replace(/\s+$/,"").length;for(;r<l&&/\s/.test(e[r]);)r++;let n=0,o=null;for(;r<l;r++){let a=e[r];if(a==="\\")r++;else if(o)a===o&&(o=null);else if(a==='"'||a==="'")o=a;else if(a==="["||a==="(")n++;else if(a==="]"||a===")")n>0&&n--;else if(n===0&&(a==="+"||a==="~"||/\s/.test(a)))return!1}return!0}var ut=/^codec\(([a-z][a-z0-9-]*)\)$/;function G(e){if(typeof e!="string")return null;let t=C(e);if(t===-1)return null;let r=ut.exec(e.slice(t+1));if(!r)return null;let{selector:l,all:n}=$(e);if(n)throw new R("A @codec(name) rule cannot use [*].");return{selector:l,name:r[1]}}var at=/^--[A-Za-z0-9_-]+$/;function Q(e){return typeof e=="string"&&at.test(e)}function Le(e){let t=[],r=[],l=null,n=0;for(let o=0;o<e.length;o++){let a=e[o];if(l){a==="\\"?o++:a===l&&(l=null);continue}if(a==="/"&&e[o+1]==="*"){let i=e.indexOf("*/",o+2);o=i===-1?e.length:i+1;continue}a==='"'||a==="'"?l=a:a==="("?r.push(")"):a==="["?r.push("]"):a==="{"?r.push("}"):(a===")"||a==="]"||a==="}")&&r[r.length-1]===a?r.pop():a===";"&&r.length===0&&(t.push(e.slice(n,o)),n=o+1)}return t.push(e.slice(n)),t}function st(e){let t="",r=null;for(let l=0;l<e.length;l++){let n=e[l];if(r){t+=n,n==="\\"&&l+1<e.length?t+=e[++l]:n===r&&(r=null);continue}if(n==="/"&&e[l+1]==="*"){let o=e.indexOf("*/",l+2);l=o===-1?e.length:o+1,t+=" ";continue}(n==='"'||n==="'")&&(r=n),t+=n}return t}function Me(e){e=st(e);let t=e.indexOf(":");if(t===-1)return null;let r=e.slice(0,t).trim(),l=e.slice(t+1).trim(),n=/!\s*important\s*$/i.exec(l);return n&&(l=l.slice(0,n.index).trim()),{name:r,value:l,important:!!n}}function Y(e,t){if(e==null)return null;let r=null;for(let l of Le(String(e))){let n=Me(l);!n||n.name!==t||(!r||n.important||!r.important)&&(r=n)}return r?r.value:null}function ct(e,t,r){let l=e==null?"":String(e),n=r==null||r==="",o=Le(l),a=o.map(Me),i=a.some(d=>d&&d.name===t&&d.important),u=[],s=!1;o.forEach((d,p)=>{let v=a[p];if(!v||v.name!==t){u.push(d);return}if(n||s)return;let f=/^\s*/.exec(d)[0];u.push(`${f}${t}: ${r}${i?" !important":""}`),s=!0});let c=u.join(";");if(!n&&!s){let d=c.trimEnd();c=d===""?`${t}: ${r}`:`${d}${d.endsWith(";")?" ":"; "}${t}: ${r}`}return c.trim()===""?null:c}function Ie(e,t,r,l){let n=e.attr(t,"style");if((Y(n,r)??"")===l)return;let o=ct(n,r,l);o==null?e.removeAttr(t,"style"):e.attr(t,"style",o)}var se=/^[a-z][a-z0-9-]*$/,ee=new Map;function ft(e,t){if(typeof e!="string"||!se.test(e))throw new Error(`hyper-html-api: invalid codec name ${JSON.stringify(e)} (must match ${se})`);if(!t||typeof t.read!="function"||typeof t.write!="function"||typeof t.same!="function")throw new Error(`hyper-html-api: codec "${e}" needs read, write and same functions`);ee.set(e,t)}function dt(e){return ee.get(e)??null}function pt(){return Object.fromEntries(ee)}var ht='The @codec(name) rule form needs a rules tag with data-rules-version="2".',mt="A @codec(name) rule must be the value of a top level key.";function We(e,t){let r=G(e);return r?{...r,codec:t.codecs[r.name]}:null}function te(e,t={}){let r=t.version??"1",l=t.codecs??{};n(e,0);function n(o,a){if(!(a>W)){if(typeof o=="string"){let i=G(o);if(!i)return;if(r!=="2")throw new R(ht);if(a!==1)throw new R(mt);if(!Object.prototype.hasOwnProperty.call(l,i.name))throw new ke(i.name);return}if(Array.isArray(o)){n(o[1],a+1);return}if(o&&typeof o=="object")for(let i of Object.values(o))n(i,a+1)}}}function q(e,t,r,l={}){if(Object.prototype.hasOwnProperty.call(l,"exclude")&&e.semanticExclude===!1)throw new Error("This adapter does not support semantic exclude queries; omit exclude or use the DOM adapter.");return te(r,l),_(e,t,r,{depth:0,path:[]},l)}function _(e,t,r,l,n){if(l.depth>W)throw new Z(l.path);if(typeof r=="string")return yt(e,t,r,l,n);if(Array.isArray(r)){let[o,a]=r,i=e.find(t,o,n);return De(n,l,i),i.map((u,s)=>_(e,u,a,{depth:l.depth+1,path:[...l.path,s]},n))}if(typeof r=="object"&&r!==null){let o={};for(let[a,i]of Object.entries(r))o[a]=_(e,t,i,{depth:l.depth+1,path:[...l.path,a]},n);return o}return null}function yt(e,t,r,l,n){if(r.endsWith("[]")){let c=r.slice(0,-2),d=e.find(t,c,n);return De(n,l,d),d.map(p=>e.text(p))}let o=We(r,n);if(o)return gt(e,t,o,n);if(r.startsWith("@"))return z(e,t,r.slice(1));let a=C(r);if(a!==-1){let{selector:c,all:d}=$(r),p=r.slice(a+1),v=c?e.find(t,c,n):[t];return d&&n.allMatches?v.map(f=>z(e,f,p)):v.length===0?null:z(e,v[0],p)}if(r===".")return e.text(t);let{selector:i,all:u}=$(r),s=e.find(t,i,n);return u&&n.allMatches?s.map(c=>e.text(c)):s.length===0?null:e.text(s[0])}function gt(e,t,{selector:r,codec:l},n){let o=r?e.find(t,r,n):[t];return o.length===0?null:l.read(e,o[0],{query:n.query,view:n.view,region:n.region})}function De(e,t,r){if(typeof e.onRowsRead=="function")try{e.onRowsRead(t.path.slice(),r)}catch(l){console.warn(`[hyper-html-api] onRowsRead threw at "${t.path.join(".")||"(root)"}"`,l)}}function z(e,t,r){if(Q(r))return Y(e.attr(t,"style"),r);if(Qe.has(r)){let n=e.prop(t,r);return n==null?null:String(n)}return e.attr(t,r)??null}function wt(e,t,r,l){let n=e.length,o=t.length,a=new Array(n).fill(-1);if(l){let h=new Set;for(let y=0;y<n;y++){let w=l[y];!(w>=0&&w<o)||h.has(w)||(a[y]=w,h.add(w))}}if(n===0||o===0)return a;let i=e.map(h=>ce(h,r)),u=t.map(h=>ce(h,r)),s=new Array(o).fill(!1);for(let h of a)h>=0&&(s[h]=!0);let c=new Map;u.forEach((h,y)=>{s[y]||c.set(h,c.has(h)?-1:y)});let d=new Map;i.forEach((h,y)=>{a[y]>=0||d.set(h,(d.get(h)||0)+1)}),i.forEach((h,y)=>{if(a[y]>=0||d.get(h)!==1)return;let w=c.get(h);w===void 0||w===-1||s[w]||(a[y]=w,s[w]=!0)});let p=[];for(let h=0;h<n;h++)a[h]<0&&p.push(h);let v=[];for(let h=0;h<o;h++)s[h]||v.push(h);if(p.length===0||v.length===0)return a;let f=n*o+1,m=vt(e,t,r),g=(h,y)=>m(h,y)*f+Math.abs(h-y);for(let[h,y]of At(p,v,g))a[h]=y;return a}var Pe=e=>typeof e=="object"&&e!==null;function ce(e,t){if(!Pe(t))return e==null?" null":String(e);let r=Object.keys(t);return JSON.stringify(r.map(l=>{let n=JSON.stringify(e?.[l]);return n===void 0?" undef":n}))}function vt(e,t,r){if(!Pe(r))return(i,u)=>e[i]===t[u]?0:1;let l=Object.keys(r),n=i=>l.map(u=>JSON.stringify(i?.[u])),o=e.map(n),a=t.map(n);return(i,u)=>{let s=o[i],c=a[u],d=0;for(let p=0;p<l.length;p++)s[p]!==c[p]&&d++;return d}}function At(e,t,r){return e.length<=t.length?fe(e,t,r,!1):fe(t,e,(l,n)=>r(n,l),!0)}function fe(e,t,r,l){let n=e.length,o=t.length,a=[];for(let d=0;d<=n;d++)a.push(new Float64Array(o+1).fill(1/0));let i=[];for(let d=0;d<=n;d++)i.push(new Uint8Array(o+1));for(let d=0;d<=o;d++)a[n][d]=0;for(let d=n-1;d>=0;d--)for(let p=o-1;p>=0;p--){let v=r(e[d],t[p])+a[d+1][p+1],f=a[d][p+1];v<=f?(a[d][p]=v,i[d][p]=1):a[d][p]=f}let u=[],s=0,c=0;for(;s<n&&c<o;)i[s][c]&&(u.push(l?[t[c],e[s]]:[e[s],t[c]]),s++),c++;return u}function qe(e,t,r,l,n,o,a,i={}){let u=e.find(t,r,i);if(n.length===0){u.forEach(A=>e.remove(A)),V(i,"onRowsApplied",o.path,[]);return}let s=n.length>u.length,c=u[0]||null;if(s&&!c&&(c=xt(e,t,r,i),!c))throw new M(o.path);let d=u.map(A=>Et(e,A,l,i)),p=null;if(s&&c){p=e.clone(c),i.templateAttr&&e.removeAttr(p,i.templateAttr);let A=e.stripIds(p);A>0&&console.warn(`[hyper-html-api] stripped ${A} id attribute(s) from cloned template at "${o.path.join(".")||"(root)"}"`)}let v=wt(n,d,l,bt(e,u,n,o,i)),f=u.length>0?e.parent(u[0]):St(e,t,r,c,o,i),m=u.length>0?Be(e,f,u[0]):0,g=kt(e,u),h=new Set,y=[],w=n.map((A,T)=>{let b=v[T];if(b>=0)return h.add(b),y.push(!1),u[b];y.push(!0);let x=e.clone(p);return e.stripIds(x),x});u.forEach((A,T)=>{h.has(T)||e.remove(A)}),g?Ct(e,f,m,w,y):jt(e,w,y,f,m),Tt(e,w,l,n,o,a,i),V(i,"onRowsApplied",o.path,w)}function V(e,t,r,l){if(typeof e[t]=="function")try{return e[t](r.slice(),l)}catch(n){console.warn(`[hyper-html-api] ${t} threw at "${r.join(".")||"(root)"}"`,n);return}}function bt(e,t,r,l,n){let o=V(n,"identifyRows",l.path,r);if(!Array.isArray(o))return null;let a=new Array(r.length).fill(-1),i=new Set,u=new Map(t.map((s,c)=>[e.identity(s),c]));for(let s=0;s<r.length;s++){if(!o[s])continue;let c=u.get(e.identity(o[s]));c===void 0||i.has(c)||(a[s]=c,i.add(c))}return a}function Tt(e,t,r,l,n,o,a){t.forEach((i,u)=>{if(r===null){let s=l[u],c=s==null?"":String(s);e.text(i)!==c&&e.text(i,c)}else{let s=o(e,i,r,l[u],{depth:n.depth+1,path:[...n.path,u]},a);s&&s!==i&&(t[u]=s)}})}function Et(e,t,r,l){return r===null?e.text(t):q(e,t,r,l.onRowsRead?{...l,onRowsRead:void 0}:l)}function Be(e,t,r){let l=e.children(t);for(let n=0;n<l.length;n++)if(e.sameNode(l[n],r))return n;return-1}function xt(e,t,r,l){if(!l.templateAttr)return null;let n=/^\s*:scope\s*>\s*/.test(r),o=new RegExp(":not\\(\\["+l.templateAttr.replace(/[.*+?^${}()|[\]\\-]/g,"\\$&")+"\\]\\)","g"),a=r.replace(/^\s*:scope\s*>\s*/,"").replace(o,""),i=n?Ot(a):0,u=je(a),s=t;for(;s;){let c=e.find(s,a,{includeRulesTag:!1,templateAttr:null});for(let d of c)if(e.attr(d,l.templateAttr)!=null&&!(n&&!$t(e,t,d,i))&&!(u&&!e.matches(e.parent(d),u)))return d;s=e.parent(s)}return null}function Ot(e){let t=0,r=null,l=1;for(let n=0;n<e.length;n++){let o=e[n];if(o==="\\")n++;else if(r)o===r&&(r=null);else if(o==='"'||o==="'")r=o;else if(o==="["||o==="(")t++;else if(o==="]"||o===")")t>0&&t--;else if(t===0&&o===">")l++;else{if(t===0&&(o==="+"||o==="~"))return null;if(t===0&&/\s/.test(o)){if(!Nt(e,n))return null;for(;n+1<e.length&&/\s/.test(e[n+1]);)n++}}}return l}function Nt(e,t){let r=t;for(;r<e.length&&/\s/.test(e[r]);)r++;let l=t>0?e[t-1]:"",n=r<e.length?e[r]:"";return de(l)||de(n)}function de(e){return e===">"||e==="+"||e==="~"}function $t(e,t,r,l){if(l===null)return!0;let n=r;for(let u=0;u<l;u++)if(n=e.parent(n),!n)return!1;let o=e.prop(t,"tagName");if(!o)return!0;let a=e.prop(n,"tagName");if(!a||String(a).toLowerCase()!==String(o).toLowerCase())return!1;let i=new Set(pe(e,n));return pe(e,t).every(u=>i.has(u))}function pe(e,t){let r=e.attr(t,"class");return r?String(r).split(/\s+/).filter(Boolean):[]}function St(e,t,r,l,n,o){let a=e.parent(l);if(a&&Rt(e,t,a)&&!me(e,a,o))return a;let i=je(r);if(!i)throw new M(n.path,`the list selector "${r}" names no container to hold the new rows \u2014 write it as "container > row" (for example "ol.comments > li") so the cloned row lands in the list`);let u=(i===":scope"?e.prop(t,"tagName")?[t]:[]:e.find(t,i,o)).filter(s=>!me(e,s,o));if(u.length===0)throw new M(n.path,`no container matching "${i}" inside this context to hold the new rows`);if(u.length>1)throw new M(n.path,`"${i}" matches ${u.length} containers inside this context, so the new rows have no single destination`);return u[0]}function Rt(e,t,r){let l=r;for(;l;){if(e.sameNode(l,t))return!0;l=e.parent(l)}return e.parent(t)?!1:e.find(t,"*",{includeRulesTag:!0,templateAttr:null}).some(n=>e.sameNode(n,r))}var he=["no-data","editor-ui"];function me(e,t,r){let l=t;for(;l;){if(r.templateAttr&&e.attr(l,r.templateAttr)!=null||he.some(o=>e.attr(l,o)!=null))return!0;let n=e.attr(l,"clay");if(n&&n.split(/\s+/).some(o=>he.includes(o)))return!0;l=e.parent(l)}return!1}function Ct(e,t,r,l,n){let o=e.children(t),a=o.map(u=>e.identity(u)),i=!1;l.forEach((u,s)=>{let c=e.identity(u),d=r+s;if(a[d]===c)return;if(!n[s]){let v=a.indexOf(c);v!==-1&&(a.splice(v,1),o.splice(v,1))}let p=Math.min(d,o.length);p<o.length?e.insertBefore(o[p],u):o.length?i?e.insertAfter(o[o.length-1],u):(e.insertAt(t,u,d),i=!0):e.insertAt(t,u,0),a.splice(p,0,c),o.splice(p,0,u)})}function kt(e,t){if(t.length<=1)return!0;let r=e.parent(t[0]);if(!r)return!1;let l=new Map(e.children(r).map((o,a)=>[e.identity(o),a])),n=[];for(let o of t){let a=l.get(e.identity(o));if(a===void 0)return!1;n.push(a)}return n.sort((o,a)=>o-a),n[n.length-1]-n[0]===n.length-1}function jt(e,t,r,l,n){let o=null,a=n;for(let i=0;i<t.length;i++){if(!r[i]){o=t[i];continue}let u=o?e.parent(o):l;if(!u)continue;let s=o?Be(e,u,o)+1:a++;e.insertAt(u,t[i],s),o=t[i]}}function B(e,t,r,l,n={}){if(Object.prototype.hasOwnProperty.call(n,"exclude")&&e.semanticExclude===!1)throw new Error("This adapter does not support semantic exclude queries; omit exclude or use the DOM adapter.");te(r,n);let o=[];if(F(r,l,[],o),o.length)throw new Se(o);H(e,t,r,l,{depth:0,path:[]},n)}function H(e,t,r,l,n,o={}){if(n.depth>W)throw new Z(n.path);if(l===void 0)return t;if(typeof r=="string")return Lt(e,t,r,l,n,o);if(Array.isArray(r)){let[a,i]=r;return qe(e,t,a,i,l,n,H,o),t}if(typeof r=="object"&&r!==null){for(let[a,i]of Object.entries(r)){let u=H(e,t,i,l==null?l:l[a],{depth:n.depth+1,path:[...n.path,a]},o);u&&u!==t&&(t=u)}return t}return t}function Lt(e,t,r,l,n,o){if(r.endsWith("[]")){let d=r.slice(0,-2);return qe(e,t,d,null,l,n,H,o),t}let a=We(r,o);if(a){let d=a.selector?e.find(t,a.selector,o):[t];return d.length&&a.codec.write(e,d[0],l,{query:o.query}),t}if(r.startsWith("@"))return ge(e,t,r.slice(1),l);let i=C(r);if(i!==-1){let{selector:d,all:p}=$(r),v=r.slice(i+1),f=d?e.find(t,d,o):[t];for(let m of p?f:f.slice(0,1))ge(e,m,v,l);return t}if(r===".")return ye(e,t,l),t;let{selector:u,all:s}=$(r),c=e.find(t,u,o);for(let d of s?c:c.slice(0,1))ye(e,d,l);return t}function ye(e,t,r){let l=r==null?"":String(r);e.text(t)!==l&&e.text(t,l)}function Mt(e,t,r,l){if(e.styleVar){e.styleVar(t,r,l);return}Ie(e,t,r,l)}function ge(e,t,r,l){if(Q(r))return Mt(e,t,r,l==null?"":String(l).trim()),t;if(Ne.has(r)){let n=e.prop(t,r);if(n===l||n!=null&&l!=null&&String(n)===String(l))return t;throw new Re(r)}if(r==="outerHTML"){let n=l==null?"":String(l);return e.replaceWith(t,n)}if(Ye.has(r)){let n=et(r,l);return e.prop(t,r)!==n&&e.prop(t,r,n),t}if(l==null)e.attr(t,r)!=null&&e.removeAttr(t,r);else{let n=String(l);e.attr(t,r)!==n&&e.attr(t,r,n)}return t}function F(e,t,r,l){if(t!==void 0){if(typeof e=="string"){if(G(e))return;if(e.endsWith("[]")){Array.isArray(t)?t.forEach((n,o)=>{typeof n=="object"&&n!==null&&l.push({path:j([...r,o]),expected:"scalar",got:k(n)})}):l.push({path:j(r),expected:"array",got:k(t)});return}t!==null&&typeof t=="object"&&l.push({path:j(r),expected:"scalar",got:k(t)});return}if(Array.isArray(e)){if(!Array.isArray(t)){l.push({path:j(r),expected:"array",got:k(t)});return}let n=e[1];t.forEach((o,a)=>F(n,o,[...r,a],l));return}if(typeof e=="object"&&e!==null){if(t===null||Array.isArray(t)||typeof t!="object"){l.push({path:j(r),expected:"object",got:k(t)});return}for(let[n,o]of Object.entries(e))F(o,t[n],[...r,n],l)}}}function k(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function j(e){return e.join(".")}function It(e){try{return JSON.parse(e)}catch(t){throw new R(`Invalid strict JSON: ${t.message}`,t)}}function He(e){try{return JSON.parse(e)}catch{}let t={BRACE_OPEN:"{",BRACE_CLOSE:"}",BRACKET_OPEN:"[",BRACKET_CLOSE:"]",COLON:":",COMMA:",",STRING:"STRING",SELECTOR:"SELECTOR",IDENTIFIER:"IDENTIFIER",NUMBER:"NUMBER",BOOLEAN:"BOOLEAN"};function r(n){let o=[],a=0;for(;a<n.length;){let i=n[a];if(/\s/.test(i)){a++;continue}if("{}".includes(i)){o.push({type:i,value:i}),a++;continue}if(i==="["){let d=!1,p=a+1;for(;p<n.length&&/\s/.test(n[p]);)p++;if(p<n.length&&/[a-zA-Z_]/.test(n[p])&&(d=!0),!d){o.push({type:i,value:i}),a++;continue}}if(i==="]"){o.push({type:i,value:i}),a++;continue}if(i===":"){o.push({type:t.COLON,value:i}),a++;continue}if(i===","){o.push({type:t.COMMA,value:i}),a++;continue}if(i==='"'||i==="'"){let d=i,p=a+1;for(;p<n.length&&n[p]!==d;)n[p]==="\\"&&p++,p++;o.push({type:t.STRING,value:n.substring(a+1,p),quoted:!0,sourceQuote:d}),a=p+1;continue}let u=a,s;for(;u<n.length&&!/[{},]/.test(n[u]);)if(n[u]===":"){let d=[":first",":last",":nth-child",":nth-of-type",":first-child",":last-child",":first-of-type",":last-of-type",":only-child",":only-of-type",":hover",":focus",":active",":visited",":disabled",":enabled",":checked",":empty",":root",":target",":not",":before",":after",":nth-last-child",":nth-last-of-type"],p=!1;for(let v of d){let f=v.substring(1);if(n.substring(u+1,u+1+f.length)===f){p=!0,u+=f.length;break}}if(!p)break}else if(n[u]==="["){for(u++;u<n.length&&n[u]!=="]";){if(n[u]==='"'||n[u]==="'"){let d=n[u];for(u++;u<n.length&&n[u]!==d;)n[u]==="\\"&&u++,u++}u++}u<n.length&&n[u]==="]"&&u++}else u++;s=n.substring(a,u);let c=t.IDENTIFIER;/^-?\d+(\.\d+)?$/.test(s)?c=t.NUMBER:s==="true"||s==="false"||s==="null"?c=t.BOOLEAN:/^[.#@\[]|[.#@\[]| /.test(s)&&(c=t.SELECTOR),o.push({type:c,value:s,quoted:!1}),a=u}return o}function l(n){let o="";for(let a=0;a<n.length;a++){let i=n[a];if("{}".includes(i.type)||"[]".includes(i.type)){o+=i.value;continue}if(i.type===t.COLON){o+=i.value;continue}if(i.type===t.COMMA){let u=n[a+1];if(u&&(u.type==="}"||u.type==="]"))continue;o+=i.value;continue}if(i.type===t.STRING&&i.quoted){let u=i.value;i.sourceQuote==="'"&&(u=u.replace(/\\'/g,"'"),u=u.replace(/(\\*)"/g,(s,c)=>c.length%2===0?c+'\\"':s)),o+=`"${u}"`;continue}if(i.type===t.NUMBER||i.type===t.BOOLEAN){o+=i.value;continue}if(i.type===t.SELECTOR||i.type===t.IDENTIFIER){o+=`"${i.value}"`;continue}o+=`"${i.value}"`}return o}try{let n=r(e),o=l(n);return JSON.parse(o)}catch(n){throw new R("Invalid extraction rules syntax: "+n.message,n)}}var Wt=["1","2"],we=/^[a-zA-Z0-9_-]+$/;function re(e,t,r){let l;if(r===void 0)l="script[data-rules-name]";else{if(typeof r!="string"||!we.test(r))throw new Error(`hyper-html-api: invalid rules token ${JSON.stringify(r)} (must match ${we})`);l=`script[data-rules-name~="${r}"]`}let n=e.find(t,l,{includeRulesTag:!0});if(n.length===0)return null;r!==void 0&&n.length>1&&console.warn(`hyper-html-api: ${n.length} rules tags match data-rules-name~="${r}"; using the first.`);let o=n[0],a=e.attr(o,"data-rules-version");if(!Wt.includes(a))throw new $e(a);return{rules:He(e.text(o)),tagNode:o,version:a}}var ne=Object.freeze({data:Object.freeze({tokens:["no-data"],bundles:["editor-ui"]}),save:Object.freeze({tokens:["no-save"],bundles:["editor-ui"]}),snapshot:Object.freeze({tokens:["no-snapshot"],bundles:["editor-ui"]}),watch:Object.freeze({tokens:["no-watch"],bundles:["editor-ui"]}),undo:Object.freeze({tokens:["no-undo"],bundles:["editor-ui"]}),history:Object.freeze({tokens:[],bundles:["editor-ui"]})}),Dt=Object.freeze({"editor-ui":Object.freeze(["no-data","no-save","no-snapshot","no-watch","no-undo"])}),Pt=Object.freeze(["no-save","no-snapshot","no-trigger-autosave","no-dirty","no-watch","no-undo","no-data","freeze","editor-ui","live"]);function U(e,t){if(!e||e.nodeType!==1)return!1;let r=e.getAttribute?.("clay");return!!(r&&r.split(/\s+/).includes(t)||e.hasAttribute?.(t))}function Ue(e,t){if(U(e,t))return!0;for(let[r,l]of Object.entries(Dt))if(l.includes(t)&&U(e,r))return!0;return!1}function J(e){let t=ne[e];if(!t)throw new Error(`Unknown region capability: ${e}`);return[...t.tokens,...t.bundles].flatMap(r=>[`[clay~="${r}"]`,`[${r}]`]).join(", ")}function qt(e,t){let r=e&&e.nodeType===1?e:e?.parentElement;for(;r&&r.nodeType===1;){let l=ne[t];if(!l)throw new Error(`Unknown region capability: ${t}`);if(l.tokens.some(n=>Ue(r,n))||l.bundles.some(n=>U(r,n)))return r;r=r.parentElement}return null}function Bt(e,t){return!!qt(e,t)}var le=Object.freeze({refusedRuleForms:["innerHTML","outerHTML"],refusedTargets:["script","style","template","noscript","iframe","object","embed","xmp","plaintext","noembed","noframes","meta","link","base","animate","set","animatemotion","animatetransform"],refusedAttributes:["style","srcdoc","is","http-equiv","sandbox","allow","nonce","integrity","charset","htmlclaytoken","htmlclayid","data-rules-name","data-rules-version","clay","contenteditable",...Pt],refusedAttributePrefixes:["on"],urlAttributes:["href","src","srcset","action","formaction","poster","cite","data","ping","background","longdesc","usemap","xlink:href","manifest","codebase","icon"],refusedSchemes:["javascript","vbscript","data"],customPropertyValues:Object.freeze({maxLength:200,refusedCharacters:[";","{","}","<",">","\\"],refusedFunctions:["url","src","image","image-set","-webkit-image-set","cross-fade","element","expression","paint"]})}),Ht=new Set(["textContent","innerText"]);function Ut(e){let t=String(e).replace(/^[\u0000- ]+|[\u0000- ]+$/g,"").replace(/[\t\n\r]/g,"").match(/^([a-zA-Z][a-zA-Z0-9+.-]*):/);return t?t[1].toLowerCase():null}var zt=/^[^\t\n\f\r "'>/=\u0000-\u001f\u007f]+$/;function _t(e,t,r=le){if(!zt.test(String(e)))return`attribute name ${JSON.stringify(String(e))} is not valid`;let l=String(e).toLowerCase();if(r.refusedAttributePrefixes.some(n=>l.startsWith(n)))return`attribute "${l}" can run script`;if(r.refusedAttributes.includes(l))return`attribute "${l}" is not content`;if(r.urlAttributes.includes(l)&&t!=null){let n=l==="srcset"?String(t).split(",").map(o=>o.trim().split(/\s+/)[0]).filter(Boolean):[String(t)];for(let o of n){let a=Ut(o);if(a&&r.refusedSchemes.includes(a))return`"${a}:" URLs are not allowed in "${l}"`}}return null}function oe(e,t){let r=e.prop(t,"tagName");return r?String(r).toLowerCase():""}function Vt(e,t){let r=oe(e,t)||"node",l=e.attr(t,"id");return l?`<${r}#${l}>`:`<${r}>`}function Ft(e,t,r){let l=t;for(;l;){let n=oe(e,l);if(n&&r.refusedTargets.includes(n))return n;l=e.parent(l)}return null}function ze(e,t){return e.find(t,"script[data-rules-name]",{includeRulesTag:!0,templateAttr:null}).length>0}function Jt(e,t){return oe(e,t)==="script"&&e.attr(t,"data-rules-name")!=null?!0:ze(e,t)}function Kt(e){if(/[\u0000-\u001f\u007f]/.test(e))return"control characters are not allowed in a custom property value";let t=[],r=null;for(let l=0;l<e.length;l++){let n=e[l];if(r){n===r&&(r=null);continue}if(n==='"'||n==="'")r=n;else{if(n==="/"&&e[l+1]==="*")return"comments are not allowed in a custom property value";if(n==="(")t.push(")");else if(n==="[")t.push("]");else if((n===")"||n==="]")&&t.pop()!==n)return`"${n}" does not close anything in this custom property value`}}return r?"a custom property value must close its quotes":t.length?"a custom property value must close its brackets":null}function Xt(e,t=le){let r=t.customPropertyValues,l=String(e);if(l.length>r.maxLength)return`custom property values are limited to ${r.maxLength} characters`;let n=r.refusedCharacters.find(u=>l.includes(u));if(n)return`${JSON.stringify(n)} is not allowed in a custom property value`;let o=Kt(l);if(o)return o;let a=l.toLowerCase(),i=r.refusedFunctions.find(u=>new RegExp(`(^|[^a-z0-9_-])${u.replace(/[-]/g,"\\-")}\\s*\\(`).test(a));return i?`"${i}()" is not allowed in a custom property value`:null}function ve(e,t=le){let r=[],l=(i,u)=>(r.push({target:Vt(e,i),reason:u}),!1),n=i=>{let u=Ft(e,i,t);return u?l(i,`inside <${u}>, which is not content`):!0},o=i=>n(i)?ze(e,i)?l(i,"a text write here would delete the data rules tag"):!0:!1,a=(i,u,s)=>{if(!n(i))return!1;let c=_t(u,s,t);return c?l(i,c):!0};return{...e,text(i,u){if(u===void 0)return e.text(i);o(i)&&e.text(i,u)},attr(i,u,s){if(s===void 0)return e.attr(i,u);a(i,u,s)&&e.attr(i,u,s)},removeAttr(i,u){a(i,u,null)&&e.removeAttr(i,u)},styleVar(i,u,s){if((Y(e.attr(i,"style"),u)??"")!==s&&n(i)){if(!Q(u))return l(i,`"${u}" is not a custom property`);if(s!==""){let c=Xt(s,t);if(c)return l(i,c)}Ie(e,i,u,s)}},prop(i,u,s){if(s===void 0)return e.prop(i,u);if(t.refusedRuleForms.includes(u))return l(i,`"@${u}" writes HTML, only text is allowed`);if(Ht.has(u)){o(i)&&e.prop(i,u,s);return}a(i,u==="className"?"class":u,s)&&e.prop(i,u,s)},remove(i){if(Jt(e,i)){l(i,"removing this would delete the data rules tag");return}e.remove(i)},replaceWith(i,u){return u===e.prop(i,"outerHTML")||l(i,'"@outerHTML" writes HTML, only text is allowed'),i},refusals:r,assertClean(){if(r.length)throw new Ce(r.slice())}}}function L(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Ae(e){return e.reduce((t,r)=>typeof r=="number"?`${t}[${r}]`:t?`${t}.${r}`:r,"")}function Zt(e,t,r,l,n={}){te(r,n);let o=[],a=[];function i(s,c,d){if(Array.isArray(s)){let[,p]=s;if(!Array.isArray(c)||!L(p))return;c.forEach((v,f)=>i(p,v,[...d,f]));return}if(!(!L(s)||!L(c)))for(let p of Object.keys(c))Object.prototype.hasOwnProperty.call(s,p)?i(s[p],c[p],[...d,p]):o.push(Ae([...d,p]))}function u(s,c,d,p){if(d!==void 0){if(typeof c=="string"){if(c.endsWith("[]")||c==="."||c.startsWith("@"))return;let{selector:v}=$(c);if(!v)return;e.find(s,v,n).length===0&&a.push({path:Ae(p),selector:v});return}if(!Array.isArray(c)&&L(c)&&L(d))for(let[v,f]of Object.entries(c))u(s,f,d[v],[...p,v])}}return i(r,l,[]),u(t,r,l,[]),{unknownKeys:o,unmatched:a}}function be(e,t,r){if(r&&typeof r=="object")return{rules:r,tagNode:null,version:"1"};if(typeof r=="string"){let l=t&&t.ownerDocument?t.ownerDocument:t;return re(e,l,r)}return null}var Gt=/:(?:focus(?:-within|-visible)?|hover|active|visited|defined)\b/i;function Qt(e,t){if(!/^(INPUT|TEXTAREA|SELECT|OPTION)$/.test(e.tagName||""))return;let r=(e.getAttribute?.("type")||"").toLowerCase();"value"in e&&"value"in t&&e.tagName!=="OPTION"&&r!=="checkbox"&&r!=="radio"&&r!=="file"&&(t.value=e.value),e.tagName==="INPUT"&&(r==="checkbox"||r==="radio")&&(t.checked=e.checked),e.tagName==="OPTION"&&(t.selected=e.selected),"indeterminate"in e&&"indeterminate"in t&&(t.indeterminate=e.indeterminate)}function Te(e,t,r,l){if(l)return!!e.closest?.(t);let n=e;for(;n?.nodeType===1;){if(n.matches(t))return!0;if(n===r)break;n=n.parentElement}return!1}function Ee(e,t,r,l,n,o){return(o?Bt(e,t):Te(e,r,n,!1))||!!(l&&(o&&e!==n?e.matches(l):Te(e,l,n,o)))}function Yt(e,t){let r=ne[t];return r.tokens.some(l=>Ue(e,l))||r.bundles.some(l=>U(e,l))}var er=new Set(["INPUT","TEXTAREA","SELECT","OPTION"]);function _e(e,t,r,l){if(e.nodeType===1&&l(e)){r.dropped.push(t);return}r.cloneToLive.set(t,e),r.liveToClone.set(e,t);let n=e,o=t;if(e.nodeType===1){if(er.has(e.tagName)&&r.controls.push(e,t),e.tagName==="TEMPLATE"){for(;t.firstChild;)t.removeChild(t.firstChild);n=e.content,o=t.content,r.cloneToLive.set(o,n),r.liveToClone.set(n,o)}}else if(e.nodeType!==11)return;let a=o.firstChild;for(let i=n.firstChild;i&&a;i=i.nextSibling)_e(i,a,r,l),a=a.nextSibling}function D(e,{capability:t="data",exclude:r=null,inherit:l=!0,provenance:n=null}={}){if(!e)throw new TypeError("createContentView requires a DOM context");let o=e.nodeType===9?e:e.ownerDocument;if(!o?.implementation?.createHTMLDocument)throw new TypeError("createContentView requires an HTML DOM implementation");let a=o.implementation.createHTMLDocument(""),i=n||new WeakMap,u=new WeakMap,s=e.nodeType===9?e.documentElement:e;r&&a.documentElement.matches(r);let c=J(t),d=l?f=>Yt(f,t)||!!(r&&f.matches(r)):f=>Ee(f,t,c,r,s,!1),p=null;if(s.nodeType!==1||!Ee(s,t,c,r,s,l)){p=a.importNode(s,!0);let f={cloneToLive:i,liveToClone:u,dropped:[],controls:[]};_e(s,p,f,d);for(let m of f.dropped)m.remove();for(let m=0;m<f.controls.length;m+=2)Qt(f.controls[m],f.controls[m+1])}e.nodeType===9&&p&&(a.replaceChild(p,a.documentElement),u.set(e,a),i.set(a,e));let v=f=>{if(Gt.test(f))throw new Error(`Filtered content queries do not support stateful selector: ${f}`)};return{root:p,document:a,capability:t,selector:J(t),cloneToLive:i,liveToClone:u,original(f){return i.get(f)||null},cloneOf(f){return u.get(f)||null},query(f,m=p){return v(f),Array.from(m.querySelectorAll(f),g=>i.get(g)||g)},text(f=p){return(f===p?p:u.get(f))?.textContent||""},html(f=p){return(f===p?p:u.get(f))?.innerHTML??""},clone(f=p){let m=f===p?p:u.get(f);return m?a.importNode(m,!0):null}}}function Ve(e){return e&&e.nodeType===1&&e.tagName==="SCRIPT"&&e.hasAttribute&&e.hasAttribute("data-rules-name")}function tr(e){return e?(e.nodeType===9||e.nodeType,e):null}function xe(e,t,r){!e||e.nodeType!==1||(t==="value"&&e.tagName==="INPUT"?e.value=r===null?"":r:t==="checked"&&e.tagName==="INPUT"?e.checked=r!==null:t==="selected"&&e.tagName==="OPTION"&&(e.selected=r!==null))}function Fe(e,t){e&&e.tagName==="TEXTAREA"&&(e.value=t)}function Je(e){if(!e||e.nodeType!==1)return;let t=[e,...e.querySelectorAll?e.querySelectorAll("textarea, input, option"):[]];for(let r of t)if(r.tagName==="TEXTAREA")r.value=r.defaultValue;else if(r.tagName==="INPUT"){let l=r.type;l!=="file"&&l!=="checkbox"&&l!=="radio"&&(r.value=r.defaultValue),r.checked=r.defaultChecked}else r.tagName==="OPTION"&&(r.selected=r.defaultSelected)}var E={semanticExclude:!0,find(e,t,r={}){let l=tr(e);if(!l||!l.querySelectorAll)return[];let n=Array.from(l.querySelectorAll(t));r.includeRulesTag||(n=n.filter(i=>!Ve(i)));let o=[];r.skip&&o.push(r.skip);let a=r.templateAttr===null?null:r.templateAttr||"cms-template";if(a&&o.push("["+a+"]"),o.length){let i=o.join(", ");n=n.filter(u=>!u.closest||!u.closest(i))}return n},parent(e){return e?e.parentElement:null},children(e){return e?Array.from(e.children):[]},matches(e,t){return!!(e&&e.matches)&&e.matches(t)},text(e,t){if(t===void 0)return(e.textContent||"").trim();e.textContent=t,Fe(e,t)},attr(e,t,r){if(r===void 0)return e.hasAttribute&&e.hasAttribute(t)?e.getAttribute(t):null;e.setAttribute(t,r),xe(e,t,r)},removeAttr(e,t){e&&e.removeAttribute&&e.removeAttribute(t),xe(e,t,null)},prop(e,t,r){if(r===void 0){let l=e?e[t]:void 0;return l!==void 0?l:null}e[t]=r},clone(e){let t=e.cloneNode(!0);return Je(t),t},insertAt(e,t,r){let l=e.children[r]||null;e.insertBefore(t,l)},insertBefore(e,t){e.parentNode.insertBefore(t,e)},insertAfter(e,t){e.parentNode.insertBefore(t,e.nextSibling)},identity(e){return e||null},remove(e){e&&e.parentNode&&e.parentNode.removeChild(e)},replaceWith(e,t){if(!e||!e.parentNode)throw new Error("dom.replaceWith: node has no parent");let r=e.ownerDocument.createElement("template");r.innerHTML=t;let l=r.content.firstElementChild;if(!l)throw new Error("dom.replaceWith: html did not parse to an element");return e.parentNode.replaceChild(l,e),l},stripIds(e){let t=0;return e.id&&(e.removeAttribute("id"),t++),(e.querySelectorAll?e.querySelectorAll("[id]"):[]).forEach(r=>{r.removeAttribute("id"),t++}),t},sameNode(e,t){return e===t}};function N(e,t={}){if(t.exclude===null)return E;let r=[J("data"),t.exclude].filter(Boolean).join(", "),l=e.nodeType===9?e:e.ownerDocument||e,n=e.nodeType===9?e.documentElement:e;if(!t._write&&!n?.matches?.(r)&&!n?.querySelector?.(r)&&!l?.querySelector?.(r))return E;let o=e.nodeType===9||!e.isConnected?e:e.ownerDocument,a=e.nodeType===9?e:e.ownerDocument,i=null,u=()=>i||(i=D(o,{capability:"data",exclude:t.exclude||null})),s=f=>{let m=u();return f===e?m.cloneOf(e):m.cloneOf(f)||f},c=f=>i?.original(f)||f,d=(f,m)=>{u().liveToClone.set(f,m),u().cloneToLive.set(m,f);let g=f.childNodes||[],h=m.childNodes||[];for(let y=0;y<Math.min(g.length,h.length);y++)d(g[y],h[y])},p=(f,m,g,h)=>{let y=Array.from(f.childNodes).filter(b=>i.cloneOf(b)),w=y[0];for(;w&&y.includes(w);)w=w.nextSibling;for(let b of y)b.remove();if(g==="innerHTML"){let b=a.createElement("template");b.innerHTML=h;for(let x of Array.from(b.content.childNodes))f.insertBefore(x,w||null)}else f.insertBefore(a.createTextNode(h),w||null),Fe(f,h);let A=D(f,{capability:"data",exclude:t.exclude||null});m.replaceChildren(...Array.from(A.root?.childNodes||[]));let T=b=>{let x=A.original(b);x&&(i.liveToClone.set(x,b),i.cloneToLive.set(b,x));for(let Xe of Array.from(b.childNodes||[]))T(Xe)};for(let b of Array.from(m.childNodes))T(b)},v={...E,find(f,m,g={}){let h=s(f);if(!h?.querySelectorAll)return[];let y=u().query(m,h);g.includeRulesTag||(y=y.filter(T=>!Ve(T)));let w=[];g.skip&&w.push(g.skip);let A=g.templateAttr===null?null:g.templateAttr||"cms-template";if(A&&w.push(`[${A}]`),w.length){let T=w.join(", ");y=y.filter(b=>!b.closest?.(T))}return y},parent(f){let m=s(f)?.parentElement;return m?c(m):null},children(f){return Array.from(s(f)?.children||[],c)},text(f,m){if(m===void 0){let y=c(f);return!y?.matches?.(r)&&!y?.querySelector?.(r)?E.text(y):(s(f)?.textContent||"").trim()}let g=c(f);if(!g?.matches?.(r)&&!g?.querySelector?.(r)&&!i){E.text(g,m);return}let h=u().cloneOf(g);h?p(g,h,"textContent",m):E.text(g,m)},attr(f,m,g){let h=c(f);if(g===void 0)return E.attr(h,m);E.attr(h,m,g);let y=i?.cloneOf(h);y&&(E.attr(y,m,g),D(h,{capability:"data",exclude:t.exclude||null}).root===null&&(y.remove(),i.liveToClone.delete(h),i.cloneToLive.delete(y)))},removeAttr(f,m){let g=c(f);E.removeAttr(g,m);let h=i?.cloneOf(g);h&&E.removeAttr(h,m)},prop(f,m,g){let h=c(f);if(g===void 0)return m==="innerHTML"||m==="outerHTML"||m==="textContent"||m==="innerText"?E.prop(s(h),m):E.prop(h,m);let y=m==="innerHTML"||m==="textContent"||m==="innerText",w=y?u().cloneOf(h):i?.cloneOf(h);w&&y?p(h,w,m,g):(E.prop(h,m,g),w&&E.prop(w,m,g))},clone(f){let m=s(f);if(m===f)return E.clone(f);let g=a.importNode(m,!0);return Je(g),g},insertAt(f,m,g){let h=c(f),y=v.children(h)[g]||(()=>{for(let T=h.children.length-1;T>=0;T--){let b=h.children[T];if(u().cloneOf(b))return b.nextElementSibling}return h.firstElementChild})(),w=c(m);h.insertBefore(w,y||null);let A=u().cloneOf(h);if(A){let T=u().cloneOf(w);T||(T=a.importNode(w,!0),d(w,T));let b=Array.from(A.children);A.insertBefore(T,b[g]||null)}},insertBefore(f,m){let g=c(f),h=c(m);g.parentNode.insertBefore(h,g);let y=u().cloneOf(g.parentNode);if(y){let w=u().cloneOf(h);w||(w=a.importNode(h,!0),d(h,w));let A=u().cloneOf(g);A?A.before(w):y.appendChild(w)}},insertAfter(f,m){let g=c(f),h=c(m);g.parentNode.insertBefore(h,g.nextSibling);let y=u().cloneOf(g.parentNode);if(y){let w=u().cloneOf(h);w||(w=a.importNode(h,!0),d(h,w));let A=u().cloneOf(g);A?A.after(w):y.appendChild(w)}},identity(f){return c(f)||null},remove(f){let m=c(f),g=u().cloneOf(m);E.remove(m),g&&E.remove(g)},replaceWith(f,m){let g=c(f),h=u().cloneOf(g),y=E.replaceWith(g,m);if(h){let w=D(y,{capability:"data",exclude:t.exclude||null});if(!w.root)h.remove();else{h.replaceWith(w.root);let A=T=>{let b=w.original(T);b&&(i.liveToClone.set(b,T),i.cloneToLive.set(T,b));for(let x of Array.from(T.childNodes||[]))A(x)};A(w.root)}}return y}};return v}var P=E,I=e=>({codecs:pt(),...e}),ie={extract:(e,t,r={})=>q(N(e,r),e,t,I(r)),apply:(e,t,r,l={})=>B(N(e,{...l,_write:!0}),e,t,r,I(l)),findRulesIn:(e,t)=>re(P,e,t),findRules:(e,t)=>be(P,e,t),bind:(e,t,r={})=>{let l=be(P,e,t);if(!l){let o=typeof t=="string"?`data-rules-name~="${t}"`:"the provided rules object";throw new Error(`hyper-html-api: could not resolve rules for ${o}`)}let n=I({version:l.version,...r});return{...l,get:()=>q(N(e,r),e,l.rules,n),set:o=>B(N(e,{...r,_write:!0}),e,l.rules,o,n)}},codecs:{register:ft,get:dt},parseStrict:It,parseRelaxed:He,ruleAttrIndex:C,splitRule:$,errors:O,DOM_PROPERTIES:Oe},K=e=>!!e&&typeof e.nodeType=="number";function Ke(e){let t=e&&e.ownerDocument?e.ownerDocument:e,r=re(P,t,"api");if(!r)throw new O.NoRulesTag("api");return{rules:r.rules,version:r.version}}function rr(e){if(e.nodeType===9)return e;let t=e.ownerDocument?.documentElement;if(t?.contains(e))return t;let r=e;for(;r.parentNode;)r=r.parentNode;return r}function nr(e){if(e.nodeType!==11||!e.host)return e.cloneNode(!0);let t=e.ownerDocument.createDocumentFragment();for(let r of e.childNodes)t.appendChild(r.cloneNode(!0));return t}function lr(e,t){let r=[];for(;t!==e;){let l=t.parentNode;r.push(Array.prototype.indexOf.call(l.childNodes,t)),t=l}return r.reverse()}function or(e,t){return t.reduce((r,l)=>r.childNodes[l],e)}function S(e,t){let r=e.querySelectorAll?Array.from(e.querySelectorAll(t)):[];return e.matches?.(t)&&r.unshift(e),r}function ir(e,t){let r=S(e,"option"),l=S(t,"option");r.forEach((u,s)=>l[s].selected=u.selected);let n=S(e,"input"),o=S(t,"input");n.forEach((u,s)=>{let c=u.type.toLowerCase();c!=="file"&&(o[s].value=u.value),(c==="checkbox"||c==="radio")&&(o[s].checked=u.checked)});let a=S(e,"textarea"),i=S(t,"textarea");a.forEach((u,s)=>i[s].value=u.value)}function X(e,t){if(t!==void 0){if(typeof e=="string"){if(e.endsWith("[]"))return;let r=e.startsWith("@")?0:C(e);if(r===-1)return;let l=e.slice(r+1);if(Ne.has(l))throw new O.RuleTargetReadOnly(l);return}if(Array.isArray(e)){if(!Array.isArray(t))return;t.forEach(r=>X(e[1],r));return}if(e&&typeof e=="object"&&t&&typeof t=="object"&&!Array.isArray(t))for(let[r,l]of Object.entries(e))X(l,t[r])}}function ur(e,t,r,l){let n=I({templateAttr:"cms-template",version:l}),o=rr(e),a=lr(o,e),i=nr(o);ir(o,i);let u=or(i,a),s=N(i,{...n,_write:!0}),c=Zt(s,u,t,r,n);if(c.unknownKeys.length||c.unmatched.length)throw new O.WriteRejected(c.unknownKeys,c.unmatched);let d=ve(s);B(d,u,t,r,n),d.assertClean(),X(t,r);let p=ve(N(o,{...n,_write:!0}));B(p,e,t,r,n),p.assertClean()}function ar(e){if(!(e instanceof Error))return e;let t=e instanceof O.UnknownCodec||e instanceof O.CodecRefused?e.code:e.name||"Error";try{e.code=t}catch{Object.defineProperty(e,"code",{value:t,configurable:!0,enumerable:!0})}return e instanceof O.WriteRefused?e.details=e.refusals:e instanceof O.WriteRejected?e.details={unknownKeys:e.unknownKeys,unmatched:e.unmatched}:e instanceof O.ShapeMismatch?e.details=e.mismatches:Array.isArray(e.path)?e.details={path:e.path}:typeof e.target=="string"?e.details={target:e.target}:e.token!==void 0?e.details={token:e.token}:e.version!==void 0?e.details={version:e.version}:e.details={},e}function sr(e,t){let r=K(e)?e:document,l=K(e)?t:e;if(l===void 0){let{rules:n,version:o}=Ke(r);return q(N(r),r,n,I({version:o}))}return ie.bind(r,l).get()}function cr(e,t,r){try{if(!K(e))throw new Error("hyper-html-api: applyData(root, data, source?) needs a DOM root as the first argument.");let{rules:l,version:n}=r===void 0?Ke(e):ie.bind(e,r);ur(e,l,t,n)}catch(l){throw ar(l)}return e}var fr={engine:ie,extractData:sr,applyData:cr},dr=fr;export{ie as a,sr as b,cr as c,dr as d};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as x}from"./c-QY7F6EN6.js";import{a as w}from"./c-
|
|
1
|
+
import{b as x}from"./c-QY7F6EN6.js";import{a as w}from"./c-EAV7A6BT.js";import"./c-I2SCCUEW.js";import"./c-EQ5NBOGA.js";import"./c-C7SUMNMI.js";import"./c-BPF2NSPV.js";import"./c-P7KNDG34.js";import"./c-CYWLPPUS.js";import"./c-U4TWEIKZ.js";import"./c-HA6INT6J.js";import"./c-ICMAOOGK.js";import"./c-WRBKEJD4.js";import"./c-VHNSBD2M.js";var S=`.clay-upload {
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-wrap: wrap;
|
|
4
4
|
align-items: center;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as h}from"./c-
|
|
1
|
+
import{C as h}from"./c-AI3H6ETU.js";import"./c-OH2FPYSY.js";import"./c-RETTCOWO.js";import"./c-VHNSBD2M.js";var u=(t,s)=>{let l=-1;return t.forEach((n,a,c)=>{n.attrs.id===s&&(l=c)}),l};function k(t,s,l){let n=t.state,a=u(n.doc,s);if(a<0)return!1;let c=0;for(let e=0;e<a;e++)c+=n.doc.child(e).nodeSize;let r=n.doc.child(a);return t.dispatch(h(n.tr.setNodeMarkup(c,null,{...r.attrs,...l}))),!0}function E(t,s){let l=u(t.state.doc,s);if(l<0)return!1;let n=t.dom.parentElement,a=n.ownerDocument,c=0;for(let o=0;o<l;o++)c+=t.state.doc.child(o).nodeSize;let r=a.createElement("div");r.className="blockeditor-link",r.dataset.mode="alt";let e=a.createElement("input");e.className="blockeditor-link-input",e.type="text",e.value=t.state.doc.child(l).attrs.alt||"",e.placeholder="Describe the image",e.setAttribute("aria-label","Alt text"),r.append(e);let d=t.nodeDOM(c)?.getBoundingClientRect?.(),p=n.getBoundingClientRect();d&&(r.style.setProperty("--blockeditor-pop-x",`${d.left-p.left}px`),r.style.setProperty("--blockeditor-pop-y",`${d.bottom-p.top+6}px`)),n.append(r);let f=!1,i=(o,b=!0)=>{if(f)return;f=!0;let m=e.value.trim();r.remove();let x=u(t.state.doc,s);o&&x>=0&&m!==t.state.doc.child(x).attrs.alt&&k(t,s,{alt:m}),b&&t.focus()};return e.addEventListener("keydown",o=>{o.key==="Enter"?(o.preventDefault(),i(!0)):o.key==="Escape"&&(o.preventDefault(),o.stopPropagation(),i(!1))}),e.addEventListener("blur",()=>i(!0,!1)),e.focus(),!0}export{E as openAltEditor,k as setImageAttrs};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as A,b as m,c as n}from"./c-
|
|
1
|
+
import{a as A,b as m,c as n}from"./c-QCDVDZIR.js";import{a as c}from"./c-VKEDWYDF.js";import{f as i}from"./c-C7SUMNMI.js";import{b as l,r as d}from"./c-PNZIJFG7.js";var f="[editmode\\:onclick]";function b(){d(o=>{o.querySelectorAll(f).forEach(t=>{let e=t.getAttribute("onclick");e!==null&&(t.setAttribute("inert-onclick",e),t.removeAttribute("onclick"),n(t,l(t)??t))})})}function p(){i&&c(()=>{E()})}function E(o=document){o.querySelectorAll(f).forEach(t=>{let e=t.getAttribute("inert-onclick");e&&(t.setAttribute("onclick",e),t.removeAttribute("inert-onclick"))})}function D(){document.querySelectorAll(f).forEach(o=>{let t=o.getAttribute("onclick");t&&(o.setAttribute("inert-onclick",t),o.removeAttribute("onclick")),n(o)})}function q(){b(),p()}var O="[viewmode\\:disabled]",S="[viewmode\\:readonly]",u=[[O,"disabled"],[S,"readonly"]];function k(){d(o=>{for(let[t,e]of u)o.querySelectorAll(t).forEach(r=>{if(r.hasAttribute(e))return;let a=l(r),s=a?m(a,e):null;r.setAttribute(e,s===null?"":s),n(r,a??r)})})}function h(){i&&c(()=>{x()})}function x(o=document){for(let[t,e]of u)o.querySelectorAll(t).forEach(r=>{A(r),r.removeAttribute(e)})}function M(){for(let[o,t]of u)document.querySelectorAll(o).forEach(e=>{let r=m(e,t);r===null?e.removeAttribute(t):e.setAttribute(t,r),n(e)})}function P(){k(),h()}export{f as a,E as b,D as c,q as d,O as e,S as f,x as g,M as h,P as i};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as E,b as S,c as P}from"./c-Q6BG3ZLO.js";import{i as A,j as q}from"./c-
|
|
1
|
+
import{a as E,b as S,c as P}from"./c-Q6BG3ZLO.js";import{i as A,j as q}from"./c-JWW6BHWD.js";import"./c-GO635CRU.js";import"./c-V2V5FKXX.js";import"./c-DT7E76Z2.js";import"./c-C6YZNU6E.js";import"./c-7K4SCQB7.js";import"./c-WMRJKQ2V.js";import{C as T}from"./c-AI3H6ETU.js";import{d as x}from"./c-OH2FPYSY.js";import"./c-FSQXFG5T.js";import{b as k}from"./c-RETTCOWO.js";import"./c-WCG6AKA7.js";import"./c-57XDY6HC.js";import"./c-VHNSBD2M.js";var R=/^[A-Za-z0-9_-]{8,64}$/,D="@",F=100;function _({view:o=null}={}){if(!o)return{run:()=>({ok:!1,code:"not-editing"}),dispose(){}};let f=o.dom.ownerDocument,y=()=>globalThis.clay?.people??null,l=null;function d(t){let e=o.state;if(!e.selection.empty)return null;let r=e.selection.head;if(r<=t.from||r-t.from>F+1||r>e.doc.content.size)return null;let n=e.doc.resolve(t.from);return!n.parent.isTextblock||n.parent.type.spec.code||r>n.end()||r<n.start()||n.parentOffset&&!/\s/.test(e.doc.textBetween(t.from-1,t.from,"",`
|
|
2
2
|
`))||e.doc.textBetween(t.from,t.from+1)!==D?null:{head:r,query:e.doc.textBetween(t.from+1,r)}}function $(t){try{let e=o.dom.parentElement?.getBoundingClientRect?.()??{left:0,top:0},r=o.coordsAtPos(t.from);return{x:Math.max(8,r.left-e.left),y:r.bottom+6-e.top}}catch{return null}}function h(t){let e=t.picker.activeId();e?o.dom.setAttribute("aria-activedescendant",e):o.dom.getAttribute("aria-activedescendant")?.startsWith(t.picker.el.id)&&o.dom.removeAttribute("aria-activedescendant")}function m(t){t.picker.show(S(E(t.saved,t.allowed),t.query),$(t)),h(t)}function i(){let t=l;if(t){l=null;for(let[e,r,n,s]of t.listen)e.removeEventListener(r,n,s);o.dom.getAttribute("aria-activedescendant")?.startsWith(`${t.picker.el.id}-`)&&o.dom.removeAttribute("aria-activedescendant"),t.picker.destroy()}}function p(){let t=l;if(!t||o.composing)return;let e=d(t);if(!e)return i();t.query=e.query,m(t)}async function g(t){let e=l;if(!e)return{ok:!1,code:"not-editing"};let r=e.picker.personAt(t),n=d(e);if(!(r&&n&&n.query===e.query&&R.test(String(r.id??""))&&String(r.name??"").trim()))return i(),{ok:!1,code:r?"stale-target":"no-person"};let c=String(r.name).trim();return i(),A(o,()=>{let u=d(e);if(!u||u.query!==e.query)return{ok:!1,code:"stale-target"};let a=o.state.tr.insertText(c,e.from,u.head);return a.addMark(e.from,e.from+c.length,x.marks.mention.create({id:r.id})),a.insertText(" ",e.from+c.length),a.setSelection(k.TextSelection.create(a.doc,e.from+c.length+1)),o.dispatch(T(a)),o.focus(),{ok:!0,id:r.id,label:c}})}function B(t){let e=l;if(!e||q(t,o))return;let r=()=>{t.preventDefault(),t.stopPropagation()};t.key==="ArrowDown"||t.key==="ArrowUp"?(r(),e.picker.move(t.key==="ArrowDown"?1:-1),h(e)):t.key==="Enter"?(r(),g(e.picker.index())):(t.key==="Escape"||t.key==="Tab")&&(r(),i())}function I(t){let e=y()?.available;e&&Promise.resolve().then(()=>e()).then(r=>{l===t&&(t.allowed=Array.isArray(r)?r:null,m(t))}).catch(()=>{})}function M(t){i();let e=P({document:f,onPick:c=>g(c)}),r={from:t,picker:e,query:"",allowed:null,saved:[],listen:[]};try{r.saved=y()?.list?.()??[]}catch{r.saved=[]}l=r;let n=(c,u,a,b)=>{c.addEventListener(u,a,b),r.listen.push([c,u,a,b])};n(f,"keydown",c=>B(c),!0),n(o.dom,"input",()=>p()),n(o.dom,"keyup",()=>p()),n(o.dom,"compositionend",()=>p()),n(f,"mousedown",c=>{r.picker.el.contains(c.target)||i()},!0),(o.dom.parentElement??f.body).appendChild(e.el);let s=d(r);return s?(r.query=s.query,m(r),I(r),{ok:!0,picker:!0}):(i(),{ok:!1,code:"stale-target"})}return{async run(t={}){let e=Number.isInteger(t?.from)?t.from:null;if(e===null){let r=o.state,n=r.selection.$from;if(!r.selection.empty||!n.parent.isTextblock||n.parent.type.spec.code)return{ok:!1,code:"stale-target"};e=r.selection.from;let s=o.state.tr.insertText(D);s.setSelection(k.TextSelection.create(s.doc,e+1)),o.dispatch(s)}return M(e)},dispose(){i()}}}export{_ as createFeature};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./c-4Q6QIODW.js";import"./c-MFB74XVN.js";import"./c-LD6UVV5R.js";import"./c-PGSBXHUE.js";import"./c-KU3PX7LL.js";import"./c-EQ5NBOGA.js";import"./c-IJUK2GPW.js";import"./c-C7SUMNMI.js";import"./c-BPF2NSPV.js";import"./c-P7KNDG34.js";import"./c-CYWLPPUS.js";import"./c-U4TWEIKZ.js";import"./c-PNZIJFG7.js";import"./c-XQXZAO7N.js";import"./c-S7LK4KUE.js";import"./c-MOP5KBWZ.js";import"./c-2YYDMLNZ.js";import"./c-HA6INT6J.js";import"./c-ICMAOOGK.js";import"./c-WRBKEJD4.js";import"./c-VHNSBD2M.js";export{a as replace};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{c as E}from"./c-Q6BG3ZLO.js";import{i as x,j as I}from"./c-
|
|
1
|
+
import{c as E}from"./c-Q6BG3ZLO.js";import{i as x,j as I}from"./c-JWW6BHWD.js";import"./c-GO635CRU.js";import"./c-V2V5FKXX.js";import"./c-DT7E76Z2.js";import"./c-C6YZNU6E.js";import"./c-7K4SCQB7.js";import"./c-WMRJKQ2V.js";import{C}from"./c-AI3H6ETU.js";import{A,d as f,x as y}from"./c-OH2FPYSY.js";import"./c-FSQXFG5T.js";import"./c-RETTCOWO.js";import"./c-WCG6AKA7.js";import"./c-57XDY6HC.js";import"./c-VHNSBD2M.js";var D=`
|
|
2
2
|
[data-blockeditor-heading]{display:block}
|
|
3
3
|
[data-blockeditor-heading]>span[data-blockeditor-icon]{display:inline-block;font-size:34px;line-height:1;margin-block-end:.2em}
|
|
4
4
|
[data-blockeditor-heading]>img[data-blockeditor-cover]{display:block;width:100%;height:180px;object-fit:cover;border-radius:var(--blockeditor-image-radius, 6px);margin-block-end:.6em}
|
|
5
5
|
[data-blockeditor-heading]>h1{font-family:var(--blockeditor-font-display);font-size:var(--blockeditor-h1-size);font-weight:var(--blockeditor-h1-weight);letter-spacing:var(--blockeditor-h1-tracking);line-height:var(--blockeditor-h1-line);color:var(--blockeditor-ink-strong);margin-block:0 .6em}
|
|
6
|
-
`,v=null,P=()=>v??=import("./c-
|
|
6
|
+
`,v=null,P=()=>v??=import("./c-XHZIKRCV.js").catch(r=>{throw v=null,r});function z(r){let t=typeof r=="string"?r:"";return!t.trim()||typeof Intl>"u"||typeof Intl.Segmenter!="function"||[...new Intl.Segmenter("en",{granularity:"grapheme"}).segment(t)].length!==1?!1:[...t].length<=32&&new TextEncoder().encode(t).length<=128}function S(r){let t=0;for(let a=0;a<r.childCount;a++){let i=r.child(a);if(i.type===f.nodes.heading&&i.attrs.level===1&&i.attrs.parent==null)return{index:a,at:t,node:i};t+=i.nodeSize}return null}function L(r,t){let a=r.createElement("img");return a.setAttribute("data-blockeditor-cover",""),a.setAttribute("src",t.pageCoverSrc),a.setAttribute("alt",t.pageCoverAlt??""),a.setAttribute("style",`object-position:${t.pageCoverX}% ${t.pageCoverY}%`),a}var m=class{constructor(t,a){this.node=t,this.decorated=!!(t.attrs.pageIcon||t.attrs.pageCoverSrc);let i=a.dom.ownerDocument,u=i.createElement(`h${t.attrs.level}`);if(u.setAttribute("data-id",t.attrs.id),this.dom=this.contentDOM=u,!this.decorated)return;let l=i.createElement("header");if(l.setAttribute("data-id",t.attrs.id),l.setAttribute("data-blockeditor-heading","1"),u.removeAttribute("data-id"),t.attrs.pageCoverSrc&&l.append(L(i,t.attrs)),t.attrs.pageIcon){let s=i.createElement("span");s.setAttribute("data-blockeditor-icon",""),s.setAttribute("aria-hidden","true"),s.textContent=t.attrs.pageIcon,l.append(s)}l.append(u),this.dom=l}update(t){return this.decorated!==!!(t.attrs.pageIcon||t.attrs.pageCoverSrc)||!t.sameMarkup(this.node)?!1:(this.node=t,!0)}ignoreMutation(t){return!this.contentDOM.contains(t.target)}};function W({view:r=null}={}){if(!r)return{run:()=>({ok:!1,code:"not-editing"}),dispose(){}};let t=r.dom.ownerDocument,a=null,i=null;function u(){try{let o=r.dom.parentElement?.getBoundingClientRect?.()??{left:0,top:0},e=r.coordsAtPos(r.state.selection.from);return{x:Math.max(8,e.left-o.left),y:e.bottom+6-o.top}}catch{return null}}function l(o){let e=o.picker.activeId();e?r.dom.setAttribute("aria-activedescendant",e):r.dom.getAttribute("aria-activedescendant")?.startsWith(o.picker.el.id)&&r.dom.removeAttribute("aria-activedescendant")}function s(){let o=i;if(o){i=null;for(let[e,n,p,d]of o.listen)e.removeEventListener(n,p,d);r.dom.getAttribute("aria-activedescendant")?.startsWith(`${o.picker.el.id}-`)&&r.dom.removeAttribute("aria-activedescendant"),o.picker.destroy()}}function j(o,e){let n=S(r.state.doc);if((n?n.node.attrs.id:null)!==o.owner)return{ok:!1,code:"stale-target"};let d=r.state.tr;if(n)d.setNodeMarkup(n.at,null,{...n.node.attrs,pageIcon:e});else{let c=r.state.doc.maybeChild(0);d.insert(0,f.nodes.heading.create({id:A(),pos:y(null,c?.attrs.pos??null),parent:null,level:1,pageIcon:e}))}return r.dispatch(C(d)),{ok:!0,icon:e}}async function k(o){let e=i;if(!e)return{ok:!1,code:"not-editing"};let n=e.picker.personAt(o);return s(),n?z(n.char)?x(r,()=>j(e,n.char)):{ok:!1,code:"invalid-icon"}:{ok:!1,code:"no-emoji"}}function w(o){let e=i;if(!e||I(o,r))return;let n=()=>{o.preventDefault(),o.stopPropagation()};o.key==="ArrowDown"||o.key==="ArrowUp"?(n(),e.picker.move(o.key==="ArrowDown"?1:-1),l(e)):o.key==="Enter"?(n(),k(e.picker.index())):(o.key==="Escape"||o.key==="Tab")&&(n(),s())}async function M(o){s();let e={owner:S(r.state.doc)?.node.attrs.id??null,picker:null,listen:[]};e.picker=E({document:t,label:"Choose a page icon",empty:"No emoji found",onPick:c=>k(c)}),i=e;let n=(c,g,h,b)=>{c.addEventListener(g,h,b),e.listen.push([c,g,h,b])};n(t,"keydown",c=>w(c),!0),n(r.dom,"input",()=>s()),n(t,"mousedown",c=>{e.picker.el.contains(c.target)||s()},!0),(r.dom.parentElement??t.body).appendChild(e.picker.el);let p,d;try{let c=await P();d=c.filterEmoji,a??=c.emojiLibrary(),p=await a()}catch(c){return s(),{ok:!1,code:"unavailable",error:c}}return i!==e?{ok:!1,code:"not-editing"}:(e.picker.show(d(p,o?.query),u()),l(e),{ok:!0,picker:!0})}return{nodeViews:{heading:(o,e)=>new m(o,e)},css:D,async run(o){return M(o)},dispose(){s()}}}export{W as createFeature,z as isIconGlyph,S as titleOf};
|