@jxsuite/studio 6.0.0 → 6.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/2020-va2wwra4.js +4 -0
- package/dist/chunks/adapter-f93pafd7.js +4 -0
- package/dist/chunks/{cf-account-picker-bb2yq946.js → cf-account-picker-af1h381v.js} +3 -3
- package/dist/chunks/cf-settings-125tdm0w.js +4 -0
- package/dist/chunks/components-ax2f1fnn.js +4 -0
- package/dist/chunks/content-source-108aqtk1.js +4 -0
- package/dist/chunks/{convert-to-repeater-vqkt7s3s.js → convert-to-repeater-ry5rmppr.js} +3 -3
- package/dist/chunks/editor-pfgdmkb0.js +4 -0
- package/dist/chunks/entry-commands-t0k1q0kx.js +4 -0
- package/dist/chunks/{extension-sections-8beq9ac3.js → extension-sections-6mwh2hf8.js} +3 -3
- package/dist/chunks/file-ops-meej5mqf.js +4 -0
- package/dist/chunks/files-44vp8a2s.js +4 -0
- package/dist/chunks/format-host-7q1petb9.js +4 -0
- package/dist/chunks/fs-events-h2mwnxaz.js +4 -0
- package/dist/chunks/git-panel-zngbymvd.js +4 -0
- package/dist/chunks/{grid-view-ca10def6.js → grid-view-sx9vynsp.js} +15 -15
- package/dist/chunks/icons-p44xhjf0.js +4 -0
- package/dist/chunks/iframe-host-qk3ycq87.js +4 -0
- package/dist/chunks/{index-9ydfe04y.js → index-2veqmnhr.js} +3 -3
- package/dist/chunks/index-wkyfjeqz.js +4 -0
- package/dist/chunks/{javascript-d9pqgc2p.js → javascript-8nbvs12s.js} +3 -3
- package/dist/chunks/jsonMode-s8kt9dsj.js +13 -0
- package/dist/chunks/jx-validate-psgd7vsx.js +4 -0
- package/dist/chunks/layers-panel-1kq2jyfk.js +4 -0
- package/dist/chunks/layers-xd92fg8d.js +4 -0
- package/dist/chunks/lit-html-ac4cwwr4.js +4 -0
- package/dist/chunks/media-picker-0svzkdyb.js +4 -0
- package/dist/chunks/menu-5c55ea3d.js +4 -0
- package/dist/chunks/{monaco-binding-62dtmgbf.js → monaco-binding-z6r70pdt.js} +3 -3
- package/dist/chunks/monaco-buffer-fz6gq5y7.js +4 -0
- package/dist/chunks/monaco-setup-q4axkgj7.js +4 -0
- package/dist/chunks/notify-0xgtn8q1.js +4 -0
- package/dist/chunks/platform-v1qctbe6.js +4 -0
- package/dist/chunks/publish-panel-ym1fmgq5.js +4 -0
- package/dist/chunks/quick-search-a54e6t5n.js +4 -0
- package/dist/chunks/references-gmqp82fs.js +4 -0
- package/dist/chunks/right-panel-v7t9awbk.js +4 -0
- package/dist/chunks/section-registry-vhyf3zsr.js +4 -0
- package/dist/chunks/studio-0bhx5hz6.js +5 -0
- package/dist/chunks/studio-0k1ddnyy.js +6 -0
- package/dist/chunks/studio-1b04pd0j.js +64 -0
- package/dist/chunks/{studio-sxc0zvpt.js → studio-1q1sh2ax.js} +3 -3
- package/dist/chunks/studio-4dwbj6gb.js +5 -0
- package/dist/chunks/studio-4tanh828.js +5 -0
- package/dist/chunks/{studio-fqq890ap.js → studio-55h4mstj.js} +3 -3
- package/dist/chunks/studio-5tnvjkz4.js +5 -0
- package/dist/chunks/studio-60dqgb0c.js +5 -0
- package/dist/chunks/studio-61dp09qg.js +9 -0
- package/dist/chunks/studio-63epcrj2.js +5 -0
- package/dist/chunks/studio-74k29dy9.js +5 -0
- package/dist/chunks/{studio-qa73881a.js → studio-7vg6jcd3.js} +4 -4
- package/dist/chunks/studio-7zx31knw.js +9 -0
- package/dist/chunks/studio-8bxk97km.js +5 -0
- package/dist/chunks/{studio-edbtvcd1.js → studio-8grwxtqk.js} +4 -4
- package/dist/chunks/studio-933e30n4.js +5 -0
- package/dist/chunks/{studio-rr4xkv81.js → studio-98wnwhbg.js} +4 -4
- package/dist/chunks/studio-9mccjwjh.js +14 -0
- package/dist/chunks/studio-a2ke1e4t.js +5 -0
- package/dist/chunks/studio-e3a2a6v3.js +4 -0
- package/dist/chunks/{studio-pwqfmt4p.js → studio-e81q1vb9.js} +4 -4
- package/dist/chunks/{studio-7pgy3xaf.js → studio-epgrmqqm.js} +4 -4
- package/dist/chunks/studio-g1shz58g.js +5 -0
- package/dist/chunks/studio-gf0fz03c.js +5 -0
- package/dist/chunks/studio-gjtpe62q.js +6 -0
- package/dist/chunks/{studio-tzegmy4w.js → studio-gkskhg7m.js} +4 -4
- package/dist/chunks/studio-gx4dnjzd.js +5 -0
- package/dist/chunks/{studio-8xcwewjq.js → studio-h46vtzk8.js} +4 -4
- package/dist/chunks/studio-j03zga3y.js +9 -0
- package/dist/chunks/{studio-4r0sjtx8.js → studio-jhpxeckz.js} +4 -4
- package/dist/chunks/{studio-zd4kayn2.js → studio-k01r7ykp.js} +4 -4
- package/dist/chunks/{studio-03wwfvyt.js → studio-kggey1jt.js} +4 -4
- package/dist/chunks/{studio-hnvnfbdv.js → studio-kk7h30ne.js} +6 -6
- package/dist/chunks/{studio-01qza1n3.js → studio-kt1zqney.js} +4 -4
- package/dist/chunks/{studio-r3kaka4d.js → studio-m3cwhvye.js} +4 -4
- package/dist/chunks/{studio-evwgp1ym.js → studio-mcayt6hz.js} +4 -4
- package/dist/chunks/{studio-5vy2wfm5.js → studio-myjcghv3.js} +4 -4
- package/dist/chunks/studio-n8bxwc3y.js +4 -0
- package/dist/chunks/{studio-ztvcxm3w.js → studio-ngm8gvpb.js} +4 -4
- package/dist/chunks/{studio-01kbbqg3.js → studio-nj5a01jy.js} +196 -196
- package/dist/chunks/{studio-xkfs0dp2.js → studio-pcgz8heb.js} +4 -4
- package/dist/chunks/{studio-0bbxhhce.js → studio-pre0skq6.js} +4 -4
- package/dist/chunks/{studio-n78gjfy8.js → studio-qcsq0t15.js} +4 -4
- package/dist/chunks/studio-qkstvve9.js +5 -0
- package/dist/chunks/studio-qv1pwd3c.js +5 -0
- package/dist/chunks/{studio-rmn2dz59.js → studio-rc6dvxjb.js} +5 -5
- package/dist/chunks/{studio-st75kn99.js → studio-rv11kfwa.js} +7 -7
- package/dist/chunks/studio-s8dmmz66.js +5 -0
- package/dist/chunks/studio-sp5xzbj4.js +6 -0
- package/dist/chunks/{studio-tmeq6mjb.js → studio-szsjbj0g.js} +4 -4
- package/dist/chunks/studio-t1xzawhr.js +16 -0
- package/dist/chunks/{studio-mk00zd5d.js → studio-t6b6qe31.js} +4 -4
- package/dist/chunks/{studio-bftp4n4b.js → studio-tdcprbqb.js} +4 -4
- package/dist/chunks/{studio-ge5fqjth.js → studio-vrmcjf9g.js} +5 -5
- package/dist/chunks/studio-vyc0b4he.js +10 -0
- package/dist/chunks/{studio-semd1s8s.js → studio-w0cgf6jg.js} +4 -4
- package/dist/chunks/{studio-gp02nqnw.js → studio-w3hskzqk.js} +4 -4
- package/dist/chunks/{studio-1wvfxkyy.js → studio-wszjyh0j.js} +4 -4
- package/dist/chunks/studio-xgrgcdyh.js +9 -0
- package/dist/chunks/{studio-y7jehjrp.js → studio-xz2yxfcb.js} +4 -4
- package/dist/chunks/{studio-aje966s9.js → studio-y6n42tgs.js} +4 -4
- package/dist/chunks/{studio-yr04mv2j.js → studio-yb560vxr.js} +4 -4
- package/dist/chunks/{studio-tp642n5g.js → studio-yn9f8vtx.js} +4 -4
- package/dist/chunks/studio-yw05w8f0.js +7 -0
- package/dist/chunks/{studio-cbr9czkn.js → studio-z16sgavc.js} +4 -4
- package/dist/chunks/studio-zey7zsdw.js +12 -0
- package/dist/chunks/{studio-1q6amtph.js → studio-zyqn40w4.js} +4 -4
- package/dist/chunks/tsMode-2frah6h1.js +14 -0
- package/dist/chunks/workspace-zt81g1ms.js +4 -0
- package/dist/chunks/ws-client-n2bh4hkf.js +4 -0
- package/dist/iframe-entry.js +13 -13
- package/dist/manifest.json +62 -62
- package/dist/studio.js +87 -87
- package/dist/workers/ts.worker.js +3 -3
- package/package.json +10 -10
- package/src/canvas/canvas-render.ts +4 -1
- package/src/canvas/canvas-utils.ts +73 -15
- package/src/canvas/iframe-host.ts +67 -21
- package/src/canvas/iframe-inline-edit.ts +22 -4
- package/src/canvas/iframe-interaction.ts +7 -1
- package/src/canvas/iframe-protocol.ts +3 -0
- package/src/canvas/iframe-render.ts +5 -2
- package/src/commands/defaults.ts +4 -1
- package/src/commands/live-context.ts +3 -1
- package/src/editor/shortcuts.ts +55 -27
- package/src/files/media-paths.ts +3 -1
- package/src/new-project/add-repo-modal.ts +459 -59
- package/src/panels/editors.ts +3 -1
- package/src/panels/style-panel.ts +36 -11
- package/src/platforms/cloud.ts +95 -18
- package/src/platforms/devserver.ts +47 -12
- package/src/publish/pages-service.ts +7 -0
- package/src/publish/publish-panel.ts +16 -2
- package/src/studio.ts +14 -2
- package/src/surfaces/add-repo.json +721 -224
- package/src/surfaces/add-repo.ts +196 -31
- package/src/surfaces/library-pane.ts +6 -0
- package/src/surfaces/rail.json +126 -73
- package/src/surfaces/rail.ts +31 -5
- package/src/tabs/typing.ts +31 -0
- package/src/types.ts +42 -3
- package/src/utils/edit-display.ts +30 -1
- package/src/utils/project-dir.ts +24 -0
- package/src/workspace/workspace.ts +7 -0
- package/dist/chunks/2020-cs2sb9t1.js +0 -4
- package/dist/chunks/adapter-y5gdq19c.js +0 -4
- package/dist/chunks/cf-settings-20dznc3j.js +0 -4
- package/dist/chunks/components-q037dya7.js +0 -4
- package/dist/chunks/content-source-t0q184js.js +0 -4
- package/dist/chunks/editor-j5sq149q.js +0 -4
- package/dist/chunks/entry-commands-fxzgcc4k.js +0 -4
- package/dist/chunks/file-ops-2n77759h.js +0 -4
- package/dist/chunks/files-fjy7zpxt.js +0 -4
- package/dist/chunks/format-host-wj3mf3n8.js +0 -4
- package/dist/chunks/fs-events-7kcgn4e9.js +0 -4
- package/dist/chunks/git-panel-7z2mpt2d.js +0 -4
- package/dist/chunks/icons-qbh8akb1.js +0 -4
- package/dist/chunks/iframe-host-a0zjd6xp.js +0 -4
- package/dist/chunks/index-m0x5ztax.js +0 -4
- package/dist/chunks/jsonMode-800yvbem.js +0 -13
- package/dist/chunks/jx-validate-zc9zp77s.js +0 -4
- package/dist/chunks/layers-p677nrh5.js +0 -4
- package/dist/chunks/layers-panel-y4w1dq90.js +0 -4
- package/dist/chunks/lit-html-cfn61dn7.js +0 -4
- package/dist/chunks/media-picker-xg7yjpz9.js +0 -4
- package/dist/chunks/menu-fpekzj6w.js +0 -4
- package/dist/chunks/monaco-buffer-nn4dtx27.js +0 -4
- package/dist/chunks/monaco-setup-tj13ndtm.js +0 -4
- package/dist/chunks/notify-ahs57a2z.js +0 -4
- package/dist/chunks/platform-v9xyfkbx.js +0 -4
- package/dist/chunks/publish-panel-xtbfgg2r.js +0 -4
- package/dist/chunks/quick-search-d3a6m7j3.js +0 -4
- package/dist/chunks/references-99ws0b0m.js +0 -4
- package/dist/chunks/right-panel-31vbk5xp.js +0 -4
- package/dist/chunks/section-registry-b2yzp9sw.js +0 -4
- package/dist/chunks/studio-1a99w39s.js +0 -5
- package/dist/chunks/studio-3ck2a5c4.js +0 -10
- package/dist/chunks/studio-4fde4a0x.js +0 -5
- package/dist/chunks/studio-4jj9gme2.js +0 -6
- package/dist/chunks/studio-4m50vh74.js +0 -16
- package/dist/chunks/studio-4xppwncr.js +0 -4
- package/dist/chunks/studio-5d7wfmnp.js +0 -5
- package/dist/chunks/studio-5e9zsamh.js +0 -9
- package/dist/chunks/studio-5gs9th4b.js +0 -5
- package/dist/chunks/studio-7qvs7v0m.js +0 -5
- package/dist/chunks/studio-84rtc120.js +0 -5
- package/dist/chunks/studio-aekhcdzw.js +0 -7
- package/dist/chunks/studio-aqmph6k4.js +0 -5
- package/dist/chunks/studio-c6zdm25z.js +0 -9
- package/dist/chunks/studio-capk0583.js +0 -9
- package/dist/chunks/studio-chdmwwzw.js +0 -5
- package/dist/chunks/studio-cp1gbff9.js +0 -14
- package/dist/chunks/studio-cqmtbg2p.js +0 -5
- package/dist/chunks/studio-e47215hh.js +0 -5
- package/dist/chunks/studio-fbx6twps.js +0 -6
- package/dist/chunks/studio-fthwn4kf.js +0 -5
- package/dist/chunks/studio-g8dsj3d2.js +0 -6
- package/dist/chunks/studio-gjknvzam.js +0 -9
- package/dist/chunks/studio-hjbg8d5y.js +0 -12
- package/dist/chunks/studio-nbxqcgvf.js +0 -5
- package/dist/chunks/studio-t1eedsyx.js +0 -4
- package/dist/chunks/studio-vavmwshr.js +0 -5
- package/dist/chunks/studio-x5g1xk77.js +0 -5
- package/dist/chunks/studio-x92tgnee.js +0 -64
- package/dist/chunks/studio-xg1942as.js +0 -5
- package/dist/chunks/studio-zev8ssp1.js +0 -5
- package/dist/chunks/tsMode-k9s9fcag.js +0 -14
- package/dist/chunks/workspace-5vmgsagj.js +0 -4
- package/dist/chunks/ws-client-0ja08haa.js +0 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{qt,wi,Zt,Dr,Us}from"./studio-cqmtbg2p.js";import{ge,Q,v,k}from"./studio-fqq890ap.js";import{vi,q,Ol,ot,yi,li,Se,fa,oo,He,Dx,bp,Ml,xv,m,u,ci}from"./studio-x5g1xk77.js";import{te}from"./studio-ery42sqr.js";import{ne}from"./studio-cp1gbff9.js";import{Pw,Eu,fd,Tu}from"./studio-zev8ssp1.js";import{Zi,T,R}from"./studio-7qvs7v0m.js";import{fc,mb,Lu,Gf,FE,I1}from"./studio-xg1942as.js";import{pr}from"./studio-4m50vh74.js";import{HE}from"./studio-qa73881a.js";import{Tw,cb,sa,y1,CE}from"./studio-84rtc120.js";import{D}from"./studio-tp642n5g.js";import{Ae}from"./studio-evwgp1ym.js";import{me}from"./studio-0bbxhhce.js";var kw=["string","number","boolean","array","object","reference"],Sw=["","image","date","color"];function zf(e){if(e.$ref)return"reference";return e.type||"string"}function uc(e){if(e.type==="array"&&e.items?.format)return e.items.format;return e.format||""}function Ms(e,r){switch(e){case"number":return{type:"number"};case"boolean":return{type:"boolean"};case"array":return r?{items:{format:r,type:"string"},type:"array"}:{items:{type:"string"},type:"array"};case"object":return{properties:{},required:[],type:"object"};case"reference":return{$ref:"#/content/"};default:return r?{format:r,type:"string"}:{type:"string"}}}var U={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSchemaBuilder",$description:'The `schema-builder` form control (specs/extensions.md §9.1): the visual editor for a JSON Schema object, drawn as one card per property. A descriptor names it with `"ui": { "<prop>": { "control": "schema-builder" } }`, and `ui/schema-form.ts` mounts it into the empty host its own document announces for that field. The adapter (`surfaces/schema-builder.ts`) hands in the fields already classified and every draft the reader is part-way through typing; `ui/form-controls.ts` decides what a field may be renamed to and what reaches the host\'s `onChange`. Nothing here reads a schema: a document that re-derived a field\'s type while drawing would be a second opinion about what one module already owns. **The card is `surfaces/settings-defs.json`\'s, part for part.** Data Shapes edits the project\'s `$defs` and this edits a content type\'s `schema`; they are the same object with the same six controls per row, so the row vocabulary — `card`, `field-row`, `field-label`, `field-name`, `field-type`, `field-format`, `field-required`, `field-delete`, `nested`, `nested-card`, `nested-add-name`/`-type`/`-button`, `ref-target`, `add-form` — is ONE vocabulary, and the row views it is drawn from are that surface\'s own types rather than a second declaration of them. What differs is only what encloses it: Data Shapes carries the two-column chrome that chooses WHICH shape is being edited, and this one is handed the object to edit.',tagName:"div",attributes:{part:"builder"},style:{$description:"What `.schema-builder`, `.schema-field-list`, `.schema-field-card`, `.schema-field-row`, `.schema-field-nested`, `.schema-field-name-input`, `.schema-nested-add`, `.schema-nested-add-name` and `.schema-add-field` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer — the same translation `surfaces/settings-defs.json` carries, because it is the same card. Two values could not come with them. `.schema-field-card--nested` read `var(--spectrum-gray-300, #444)`, and the caption was an `sp-field-label` at whatever size Spectrum drew it; a document is mounted in the pane rather than inside `<sp-theme>`, so both would have taken their hard-coded fallback every time. The nested card takes the studio layer's `--border`, and the caption says what it is in the type ramp instead.",display:"block",'& [part="fields"]':{display:"flex",flexDirection:"column",gap:"4px",marginBottom:"12px"},'& [part="card"], & [part="nested-card"]':{border:"1px solid var(--border)",borderRadius:"var(--radius)",padding:"6px 10px"},'& [part="field-row"]':{display:"flex",alignItems:"center",gap:"8px"},'& [part="field-label"]':{$description:"The field's name in words: a caption on the row rather than a label for a control, since the raw key beside it is what the reader edits and what carries the accessible name.",flex:"none",minWidth:"84px",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)",overflowWrap:"anywhere"},'& [part="field-name"]':{flex:"1",maxWidth:"140px"},'& [part="nested"]':{marginLeft:"16px",marginTop:"6px",paddingLeft:"8px",borderLeft:"2px solid var(--border)",display:"flex",flexDirection:"column",gap:"4px"},'& [part="ref-target"]':{display:"flex",marginTop:"6px",maxWidth:"220px"},'& [part="nested-add"]':{display:"flex",alignItems:"center",gap:"6px",padding:"4px 0"},'& [part="nested-add-name"]':{flex:"1",maxWidth:"120px"},'& [part="add-form"]':{display:"flex",alignItems:"center",gap:"8px",padding:"8px 0"}},children:[{tagName:"div",attributes:{part:"fields"},children:[{$prototype:"Array",items:{$ref:"#/state/fields"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"card","data-field":"${$map.item.key}"},children:[{tagName:"div",attributes:{part:"field-row"},children:[{tagName:"span",attributes:{part:"field-label"},textContent:"${$map.item.label}"},{tagName:"jx-textfield",attributes:{part:"field-name"},$props:{label:"Name for ${$map.item.label}",size:"sm",value:{$ref:"$map/item/name"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameField"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-select",attributes:{part:"field-type"},$props:{label:"Type for ${$map.item.label}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/type"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setType"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"field-format"},$props:{label:"Format for ${$map.item.label}",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"$map/item/format"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFormat"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",$description:"Whether the object requires this field. The word on screen is the name: `Req` is slotted rather than passed as `label`, because the kit's switch wraps its control in the label the slot lands in, and a second name would be announced over the top of it. Which row it belongs to is the tooltip's job instead, which is what `hint` is.",attributes:{part:"field-required"},$props:{hint:"Require ${$map.item.label}",size:"sm",checked:{$ref:"$map/item/required"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setRequired"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Req"}]},{tagName:"jx-action-button",attributes:{part:"field-delete"},$props:{label:"Delete ${$map.item.label}",hint:"Delete ${$map.item.label}",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeField"},value:[{$ref:"$map/item/key"}]}]}}]},{tagName:"div",attributes:{part:"extra-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/extra"},cases:{reference:{tagName:"div",attributes:{part:"ref-target"},children:[{tagName:"jx-select",attributes:{part:"ref-target-select"},$props:{label:"Target for ${$map.item.label}",size:"sm",options:{$ref:"#/state/targets"},value:{$ref:"$map/item/refTarget"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setTarget"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}]},nested:{tagName:"div",attributes:{part:"nested"},children:[{$prototype:"Array",items:{$ref:"$map/item/children"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"nested-card","data-nested":"${$map.item.key}"},children:[{tagName:"div",attributes:{part:"field-row"},children:[{tagName:"jx-textfield",attributes:{part:"field-name"},$props:{label:"Name for ${$map.item.parent}.${$map.item.key}",size:"sm",value:{$ref:"$map/item/name"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameNested"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-select",attributes:{part:"field-type"},$props:{label:"Type for ${$map.item.parent}.${$map.item.key}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/type"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedType"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"field-format"},$props:{label:"Format for ${$map.item.parent}.${$map.item.key}",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"$map/item/format"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedFormat"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",attributes:{part:"field-required"},$props:{hint:"Require ${$map.item.parent}.${$map.item.key}",size:"sm",checked:{$ref:"$map/item/required"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedRequired"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Req"}]},{tagName:"jx-action-button",attributes:{part:"field-delete"},$props:{label:"Delete ${$map.item.parent}.${$map.item.key}",hint:"Delete ${$map.item.parent}.${$map.item.key}",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeNested"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"}]}]}}]}]}},{tagName:"div",attributes:{part:"nested-add"},children:[{tagName:"jx-textfield",attributes:{part:"nested-add-name"},$props:{label:"New field in ${$map.item.label}",placeholder:"field name",size:"sm",value:{$ref:"$map/item/draftName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editDraftName"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/addNested"},value:[{$ref:"$map/item/key"}]}]}}]}},{tagName:"jx-select",attributes:{part:"nested-add-type"},$props:{label:"Type of the new field in ${$map.item.label}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/draftType"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editDraftType"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",attributes:{part:"nested-add-button"},$props:{label:"Add a field to ${$map.item.label}",hint:"Add a field to ${$map.item.label}",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/addNested"},value:[{$ref:"$map/item/key"}]}]}}]}]}}}]}}]},{tagName:"div",attributes:{part:"add-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/addState"},cases:{closed:{tagName:"jx-action-button",attributes:{part:"add-open"},$props:{label:"Add Field",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAdd"},value:[]}]},children:[{tagName:"span",textContent:"Add Field"}]},open:{tagName:"div",attributes:{part:"add-form"},children:[{tagName:"jx-textfield",attributes:{part:"add-name"},$props:{label:"New field name",placeholder:"Field name",size:"sm",value:{$ref:"#/state/addName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddName"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/confirmAdd"},value:[]}],Escape:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/cancelAdd"},value:[]}]}}]}},{tagName:"jx-select",attributes:{part:"add-type"},$props:{label:"Type of the new field",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"#/state/addType"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddType"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"add-format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/addHasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"add-format"},$props:{label:"Format of the new field",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"#/state/addFormat"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddFormat"},value:[{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",attributes:{part:"add-required"},$props:{hint:"Require the new field",size:"sm",checked:{$ref:"#/state/addRequired"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddRequired"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Required"}]},{tagName:"jx-button",attributes:{part:"add-confirm"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirmAdd"},value:[]}]},children:[{tagName:"span",textContent:"Add"}]},{tagName:"jx-button",attributes:{part:"add-cancel"},$props:{size:"sm",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancelAdd"},value:[]}]},children:[{tagName:"span",textContent:"Cancel"}]}]}}}]};T("schema-builder",U);function be(){return{addFormat:"",addHasFormat:!0,addName:"",addRequired:!1,addState:"closed",addType:"string",fields:[],formatOptions:[],targets:[],typeOptions:[]}}function Y(e,r){e.textContent="";let t=v({...be(),...r}),a=null,n=!0,s=!1,l=()=>R("schema-builder",t,e).then((o)=>{if(n=!1,s)return o.dispose(),o.root;return a=o,o.root}),p=l();return{dispose(){s=!0,a?.dispose(),a=null,e.textContent=""},host:e,ready:p,update(o){if(t.addFormat=o.addFormat,t.addHasFormat=o.addHasFormat,t.addName=o.addName,t.addRequired=o.addRequired,t.addState=o.addState,t.addType=o.addType,t.fields=o.fields,t.formatOptions=o.formatOptions,t.targets=o.targets,t.typeOptions=o.typeOptions,s||n||a!==null&&e.contains(a.root))return;a?.dispose(),a=null,n=!0,e.textContent="",l()}}}var G={$schema:"https://jxsuite.com/schema/v1",$id:"StudioReferenceField",$description:'The `reference` form control — site-architecture.md §6.1\'s `{ "$ref": "#/content/x" }` and site-architecture.md §7.4\'s entry picker. Registered once and dispatched to by `ui/schema-form.ts` for any property whose `$ref` names a collection, so the settings forms, the entry editor and an array-of-objects cell all draw the same control without any of them knowing it exists. `ui/form-controls.ts` decides which of the three states the field is in and what each gesture commits; nothing here reads a schema or lists a directory. The three states are drawn as three different controls on purpose: a picker while the entries are known, a TEXT field while they are not — a failed read leaves the value editable with the reason beside it, because swapping it for an empty dropdown would present "no entries" and "could not find out" as the same screen — and a disabled picker saying so while the read is in flight.',tagName:"div",attributes:{part:"reference",role:"none"},style:{$description:"The five `.reference-*` rules from `styles/inspector.css`, keyed on `part` and re-pointed at the studio token layer. Two values could not come with them. The note read `var(--spectrum-font-size-50, 11px)`, which resolves only inside `<sp-theme>` — this document is mounted in a settings pane, an entry editor or a frontmatter card, all outside that element, so it would silently have taken its hard-coded fallback every time. And `.reference-missing` coloured ONE row of the dropdown red; the kit's select offers a row a face, a swatch and a border style but no tone, so the dangling entry says what it is in words (\"— not found\") and the colour is not replaced by a second channel. The 6px gap comes onto the kit's spacing scale.",display:"flex",flex:"1",minWidth:"0",alignItems:"center",gap:"var(--jx-space-2)",'& [part="picker"], & [part="text"]':{flex:"1",minWidth:"0"},'& [part="note"]':{margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",lineHeight:"1.4"},'& [part="note"][data-tone="danger"]':{$description:"A listing that failed is a FAULT rather than a fact about the project, and the two notes this control draws are otherwise the same sentence in the same place.",color:"var(--danger)"},'& [part="retry"]':{flex:"none"}},children:[{tagName:"div",attributes:{part:"control-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/kind"},cases:{picker:{$description:"The collection's entries. The empty row is `\"\"` rather than a sentinel, because the kit's select treats the empty string as a legal value a reader can arrow to; a dangling reference is kept in the list and marked, since blanking the field would delete the evidence and the value in one repaint. While the read is in flight the same control is disabled and offers one row saying so.",tagName:"jx-select",attributes:{part:"picker"},$props:{size:"sm",label:{$ref:"#/state/label"},options:{$ref:"#/state/options"},value:{$ref:"#/state/value"},disabled:{$ref:"#/state/disabled"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/choose"},value:[{$ref:"event#/target/value"}]}]}},text:{$description:"The id as the string it is: what a reader gets when the choices could not be listed, and when the control was named by a `ui.control` override on a property that references nothing. Refusing to draw anything would lose the value that is already there.",tagName:"jx-textfield",attributes:{part:"text"},$props:{size:"sm",label:{$ref:"#/state/label"},value:{$ref:"#/state/value"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/edit"},value:[{$ref:"event#/target/value"}]}]}}}},{tagName:"div",attributes:{part:"note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasNote"},cases:{true:{tagName:"p",attributes:{part:"note","data-tone":"${state.noteTone}",role:"status"},textContent:"${state.note}"}}},{tagName:"div",attributes:{part:"retry-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/canRetry"},cases:{true:{$description:"Offered only where there is something to try again — a listing that failed. It used to be offered only where the HOST passed a repaint hook, because a template control cannot draw a second frame of its own and a button that cannot do the thing it is named after is worse than its absence. A mounted control redraws itself, so the condition is now the failure rather than the host.",tagName:"jx-action-button",attributes:{part:"retry"},$props:{size:"sm",quiet:!0,label:"Retry listing entries"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/retry"},value:[]}]},children:[{tagName:"span",textContent:"Retry"}]}}}]};T("reference-field",G);function ve(){return{canRetry:!1,disabled:!0,hasNote:!1,kind:"picker",label:"",note:"",noteTone:"dim",options:[],value:""}}function K(e,r){e.textContent="";let t=v({...ve(),...r}),a=null,n=!0,s=!1,l=()=>R("reference-field",t,e).then((o)=>{if(n=!1,s)return o.dispose(),o.root;return a=o,o.root}),p=l();return{dispose(){s=!0,a?.dispose(),a=null,e.textContent=""},host:e,ready:p,update(o){if(t.canRetry=o.canRetry,t.disabled=o.disabled,t.hasNote=o.hasNote,t.kind=o.kind,t.label=o.label,t.note=o.note,t.noteTone=o.noteTone,t.options=o.options,t.value=o.value,s||n||a!==null&&e.contains(a.root))return;a?.dispose(),a=null,n=!0,e.textContent="",l()}}}var X={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSecretField",$description:'The `secret` form control (specs/extensions.md §9.1, §13): one password field whose VALUE goes to the platform\'s secret store and never to project.json. A descriptor names it with `"ui": { "<field>": { "control": "secret" } }`, and `ui/schema-form.ts` mounts it into the empty host its own document announces for that field. **A surface never renders back the secret it describes, and this document is where that is visible rather than remembered**: the only thing bound to the field\'s value is `#/state/shown`, a scope path whose whole purpose is to hold nothing. What the field is worth is said in the placeholder instead — the env NAME the store gave it, which is the only half of a secret a screen may carry. `ui/form-controls.ts` decides everything else: whether the host has a secret store at all, what the placeholder says, what a commit is worth and what the field persists.',tagName:"div",attributes:{part:"secret",role:"none"},style:{$description:"`.secret-field` carried no rule anywhere — it was one of `check-styles.ts`'s ALLOWED_ORPHANS, a class emitted only so a test could find the control — so there is nothing to translate and the wrapper takes no box of its own. The field takes the width of the control host the form drew, which is the flex item; a kit field is inline-flex by default and would otherwise sit at its intrinsic width in a row sized for it.",display:"contents",'& [part="field"]':{width:"100%"}},children:[{$description:"`autocomplete: new-password` because this is a place to PUT a secret rather than to prove one: without it a password manager offers to fill the field with a credential belonging to whatever site the reader last logged in to, and the offer is the manager's own UI drawn over an editor. The value binding is `#/state/shown` and nothing else ever writes to it — see the document description.",tagName:"jx-textfield",attributes:{part:"field"},$props:{type:"password",size:"sm",autocomplete:"new-password",label:{$ref:"#/state/label"},placeholder:{$ref:"#/state/placeholder"},disabled:{$ref:"#/state/disabled"},value:{$ref:"#/state/shown"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commit"},value:[{$ref:"event#/target/value"}]}],description:"The change bubbles out of the field's own input, so what the reader typed is read off the event rather than off the element — and it is read here, handed to the flow, and never written back onto the scope."}}]};T("secret-field",X);function xe(){return{disabled:!0,label:"",placeholder:"Not set"}}function Z(e,r){e.textContent="";let t=v({...xe(),...r,shown:""}),a=null,n=!0,s=!1,l=()=>R("secret-field",t,e).then((o)=>{if(n=!1,s)return o.dispose(),o.root;return a=o,o.root}),p=l();return{clear(){t.shown=" ",t.shown=""},dispose(){s=!0,a?.dispose(),a=null,e.textContent=""},host:e,ready:p,update(o){if(t.disabled=o.disabled,t.label=o.label,t.placeholder=o.placeholder,s||n||a!==null&&e.contains(a.root))return;a?.dispose(),a=null,n=!0,e.textContent="",l()}}}var Fe=kw.map((e)=>({label:e,value:e})),Ne=Sw.map((e)=>({label:e||"(none)",value:e})),j={format:"",name:"",required:!1,type:"string"},ee=[],re=" ";function Te(e){let r=e.resolvePointer("#/$context/content"),t=r&&typeof r==="object"&&!Array.isArray(r)?Object.keys(r):[],a=t.join(" ");if(a!==re)re=a,ee=t.map((n)=>({label:n,value:n}));return ee}function N(e){return e==="string"||e==="array"}function ie(e){return e&&typeof e==="object"&&!Array.isArray(e)?e:{properties:{},required:[],type:"object"}}function Ee(e){let r=JSON.parse(JSON.stringify(ie(e)));return r.type??="object",r.properties??={},r.required??=[],r}function A(e){return`name:${e}`}function H(e){return`required:${e}`}function V(e,r){return`${e} ${r}`}function O(e,r,t){return e.echo?.id===r?e.echo.value:t}function ke(e,r,t,a,n){let s=V(r,t),l=zf(a);return{format:uc(a),hasFormat:N(l),key:t,name:O(e,A(s),t),parent:r,required:O(e,H(s),n),type:l}}function Ce(e,r,t,a,n){let s=zf(t),l=s==="object",p=e.drafts.get(r),o=t.required??[];return{children:l?Object.entries(t.properties??{}).map(([w,g])=>ke(e,r,w,g,o.includes(w))):[],draftName:p?.name??"",draftType:p?.type??"string",extra:s==="reference"&&n?"reference":l?"nested":"none",format:uc(t),hasFormat:N(s),key:r,label:Ml(r),name:O(e,A(r),r),refTarget:t.$ref?t.$ref.replace(/^#\/[^/]+\//,""):"",required:O(e,H(r),a),type:s}}function ae(e,r,t){let a={};for(let[n,s]of Object.entries(e))a[n===r?t:n]=s,delete e[n];Object.assign(e,a)}function M(e,r,t){e.required??=[];let a=e.required.indexOf(r);if(t&&a===-1)e.required.push(r);if(!t&&a!==-1)e.required.splice(a,1)}function Re(e,r){let t=r,a=null,n={add:{...j},addOpen:!1,drafts:new Map,echo:null},s=()=>a??ie(t.value),l=()=>{let i=s(),d=i.required??[],c=Te(t.ctx);return{addFormat:n.add.format,addHasFormat:N(n.add.type),addName:n.add.name,addRequired:n.add.required,addState:n.addOpen?"open":"closed",addType:n.add.type,fields:Object.entries(i.properties??{}).map(([f,h])=>Ce(n,f,h,d.includes(f),c.length>0)),formatOptions:Ne,targets:c,typeOptions:Fe}},p=()=>F.update(l()),o=(i,d)=>{n.echo={id:i,value:d},p()},w=()=>{n.echo=null,p()},g=(i)=>{let d=Ee(s());if(!i(d)){w();return}a=d,n.echo=null,t.onChange(d),p()},y=(i,d)=>i.properties[d],x=(i)=>{let d=n.drafts.get(i);if(!d)d={name:"",type:"string"},n.drafts.set(i,d);return d},F=Y(e,{addNested(i){let d=x(i),c=xv(d.name.trim());if(!c)return;g((f)=>{let h=y(f,i);if(!h)return!1;return h.properties??={},h.properties[c]=Ms(d.type||"string"),d.name="",!0})},cancelAdd(){n.addOpen=!1,n.add={...j},p()},confirmAdd(){let i=xv(n.add.name.trim());if(!i)return;let{format:d,required:c,type:f}=n.add;n.addOpen=!1,n.add={...j},g((h)=>{if(h.properties[i]=Ms(f,d||void 0),c)M(h,i,!0);return!0})},editAddFormat(i){n.add.format=i,p()},editAddName(i){n.add.name=i,p()},editAddRequired(i){n.add.required=i,p()},editAddType(i){n.add.type=i,p()},editDraftName(i,d){x(i).name=d,p()},editDraftType(i,d){x(i).type=d,p()},openAdd(){n.addOpen=!0,n.add={...j},p()},removeField(i){g((d)=>{if(!d.properties[i])return!1;return delete d.properties[i],d.required=d.required.filter((c)=>c!==i),!0})},removeNested(i,d){g((c)=>{let f=y(c,i);if(!f?.properties?.[d])return!1;if(delete f.properties[d],f.required)f.required=f.required.filter((h)=>h!==d);return!0})},renameField(i,d){o(A(i),d);let c=xv(d.trim());g((f)=>{if(!f.properties[i]||!c||c===i||f.properties[c])return!1;return ae(f.properties,i,c),f.required=f.required.map((h)=>h===i?c:h),!0})},renameNested(i,d,c){o(A(V(i,d)),c);let f=xv(c.trim());g((h)=>{let b=y(h,i);if(!b?.properties?.[d]||!f||f===d||b.properties[f])return!1;if(ae(b.properties,d,f),b.required)b.required=b.required.map((C)=>C===d?f:C);return!0})},setFormat(i,d){g((c)=>{let f=c.properties[i];if(!f)return!1;return c.properties[i]=Ms(f.type||"string",d||void 0),!0})},setNestedFormat(i,d,c){g((f)=>{let h=y(f,i),b=h?.properties?.[d];if(!h?.properties||!b)return!1;return h.properties[d]=Ms(b.type||"string",c||void 0),!0})},setNestedRequired(i,d,c){o(H(V(i,d)),c),g((f)=>{let h=y(f,i);if(!h)return!1;return M(h,d,c),!0})},setNestedType(i,d,c){g((f)=>{let h=y(f,i),b=h?.properties?.[d];if(!h?.properties||!b)return!1;let C=N(c)?uc(b):void 0;return h.properties[d]=Ms(c,C||void 0),!0})},setRequired(i,d){o(H(i),d),g((c)=>{if(!c.properties[i])return!1;return M(c,i,d),!0})},setTarget(i,d){g((c)=>{if(!c.properties[i])return!1;return c.properties[i]={$ref:`#/content/${d}`},!0})},setType(i,d){g((c)=>{let f=c.properties[i];if(!f)return!1;let h=N(d)?uc(f):void 0;return c.properties[i]=Ms(d,h||void 0),!0})}});return p(),{dispose:()=>F.dispose(),update(i){t=i,a=null,n.echo=null,p()}}}var je={mount:Re};Pw("schema-builder",je);function oe(e){return typeof e==="string"&&e?e:null}function De(e,r){let t=r,a=()=>{let s=oe(t.value);n.update({disabled:!t.ctx.commitSecret,label:t.key,placeholder:s?`Stored as ${s}`:"Not set"})},n=Z(e,{commit(s){let{commitSecret:l}=t.ctx;if(!l||!s)return;n.clear();let{key:p,onChange:o}=t,w=oe(t.value);Promise.resolve(l(p,s)).then((g)=>{if(typeof g==="string"&&g&&g!==w)o(g)})}});return a(),{dispose:()=>n.dispose(),update(s){t=s,a()}}}var qe={mount:De};Pw("secret",qe);var E=new Map,P=new Map,S=new Map;function B(e){if(e===void 0)E.clear(),P.clear(),S.clear();else E.delete(e),P.delete(e),S.delete(e)}function Oe(e){let r=E.get(e);if(r)return r;let t=(me("t0q184js"),import("./content-source-t0q184js.js")).then((a)=>a.listCollectionEntryIds(e));return E.set(e,t),t}function g1(e,r){let t=P.get(e);if(t)return t;let a=Oe(e),n=S.get(e);if(n){if(r)n.add(r);return null}S.set(e,new Set(r?[r]:[]));let s=(l)=>{if(E.get(e)!==a)return;let p=S.get(e);S.delete(e),P.set(e,l);for(let o of p??[])o()};return a.then((l)=>s({ids:l}),(l)=>s({error:te(l)})),null}function Pe(e,r){let t=typeof e.value==="string"?e.value:"",a={canRetry:!1,disabled:!1,hasNote:!1,label:e.key,note:"",noteTone:"dim",options:[],value:t},n=Eu(e.schema);if(n===null)return{...a,hasNote:!0,kind:"text",note:'No collection referenced — add "$ref": "#/content/<type>" to this field.'};let s=g1(n,r);if(s===null)return{...a,disabled:!0,kind:"picker",options:[{label:"Loading…",value:t}]};if("error"in s)return{...a,canRetry:!0,hasNote:!0,kind:"text",note:`Could not list ${n} entries — ${s.error}`,noteTone:"danger"};let l=t!==""&&!s.ids.includes(t);return{...a,hasNote:s.ids.length===0,kind:"picker",note:s.ids.length===0?`No ${n} entries yet.`:"",options:[{label:"—",value:""},...l?[{label:`${t} — not found`,value:t}]:[],...s.ids.map((p)=>({label:p,value:p}))]}}function Le(e,r){let t=r,a=!1,n=()=>{if(!a)s.update(Pe(t,n))},s=K(e,{choose(l){t.onChange(l===""?void 0:l)},edit(l){t.onChange(l.trim()||void 0)},retry(){let l=Eu(t.schema);if(l!==null)B(l);n()}});return n(),{dispose(){a=!0,s.dispose()},update(l){t=l,n()}}}var Me={mount:Le};Pw("reference",Me);var se={$schema:"https://jxsuite.com/schema/v1",$id:"StudioEntryEditor",$description:"The Entry editor (site-architecture.md §7.4) — one content entry's fields, in a pane, as a Jx document over the kit. The adapter (`surfaces/entry-editor.ts`) hands in a projection; `content/entry-editor.ts` decides everything in it — which collection the file belongs to, which record its fields live in, which required keys are absent and what a draft flag commits into. The FORM is an island: a schema is `ui/schema-form.ts`'s subject, so this document renders an empty `fields` node and the flow places the element that engine hands back (studio-ui-guidelines.md §9.3, §9.4). That is the whole of the difference between this and the card the lit version drew, and it is why the engine converting in batch 7 is what unblocked this one.",tagName:"div",attributes:{part:"entry","data-jx-region":"${state.region}"},style:{$description:"What `.entry-editor`, `.entry-editor-header`, `.entry-editor-collection`, `.entry-draft-switch`, `.entry-editor-fields`, `.entry-editor-note` and `.entry-editor-empty` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. This editor was the only emitter of all seven, so those rules are dead in the stylesheet from here; a central sweep removes them rather than this change, which owns no stylesheet. Every `--spectrum-font-size-*` reference is gone rather than renamed: those names resolve only inside `<sp-theme>`, and a pane editor is mounted outside it, so each would silently have taken its hard-coded fallback.",height:"100%",padding:"var(--jx-space-5)",overflowY:"auto",background:"var(--bg-panel)",'& [part="header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-4)",marginBottom:"var(--jx-space-5)"},'& [part="name"]':{margin:"0",fontSize:"var(--jx-text-lg)",fontWeight:"600",color:"var(--fg)"},'& [part="collection"]':{padding:"1px var(--jx-space-3)",borderRadius:"var(--radius)",background:"var(--bg)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="draft"]':{$description:"Pushed to the far end of the header rather than placed there: the heading and the collection chip are both content-width, so `margin-left: auto` is what keeps the switch on the right edge whatever the entry is called.",marginLeft:"auto"},'& [part="fields"]':{$description:"The schema form's host is `display: contents`, so its rows are the flex items of THIS box — which is why the column lives here and not inside the engine.",display:"flex",flexDirection:"column"},'& [part="note"]':{margin:"0 0 var(--jx-space-4)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"},'& [part="empty"]':{display:"flex",maxWidth:"46ch",flexDirection:"column",alignItems:"flex-start",gap:"var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"}},children:[{tagName:"div",attributes:{part:"stage-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/stage"},cases:{entry:{tagName:"div",attributes:{part:"body",role:"none"},style:{display:"contents"},children:[{tagName:"div",attributes:{part:"header"},children:[{tagName:"h3",attributes:{part:"name"},textContent:"${state.name}"},{tagName:"span",attributes:{part:"collection"},textContent:"${state.collection}"},{tagName:"div",attributes:{part:"draft-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/draftAxis"},cases:{shown:{$description:"No `label`: the slotted word is on screen and carries the name, so an aria-label would be read twice. The tooltip is `hint`, which is what DRAFT_MEANING has always been.",tagName:"jx-switch",attributes:{part:"draft"},$props:{checked:{$ref:"#/state/draft"},hint:"${state.draftHint}",size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setDraft"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Draft"}]}}}]},{tagName:"div",attributes:{part:"note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/noteState"},cases:{shown:{tagName:"p",attributes:{part:"note"},textContent:"${state.note}"}}},{$description:"An island: `ui/schema-form.ts` draws this entry's fields into this node, and nothing in this document knows what a schema is.",tagName:"div",attributes:{part:"fields","data-jx-region":"${state.fieldsRegion}"}}]},empty:{$description:"The mode is reachable from the palette and from `__jxAutomation` on any tab, so this state is real: it names the reason and the fix rather than drawing an empty form.",tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",attributes:{part:"empty-line"},textContent:"${state.emptyLine}"},{tagName:"p",attributes:{part:"note"},children:[{tagName:"span",textContent:"A collection is a "},{tagName:"code",textContent:"content"},{tagName:"span",textContent:" entry in "},{tagName:"code",textContent:"project.json"},{tagName:"span",textContent:" whose "},{tagName:"code",textContent:"source"},{tagName:"span",textContent:" directory contains this file and which declares a "},{tagName:"code",textContent:"schema"},{tagName:"span",textContent:"."}]},{tagName:"jx-action-button",attributes:{part:"content-types"},$props:{label:"Content types",size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openContentTypes"},value:[]}]},children:[{tagName:"span",textContent:"Content types…"}]}]}}}]};T("entry-editor",se);function de(e,r){e.region=r.region,e.fieldsRegion=r.fieldsRegion,e.stage=r.stage,e.name=r.name,e.collection=r.collection,e.draftAxis=r.draftAxis,e.draft=r.draft,e.draftHint=r.draftHint,e.noteState=r.noteState,e.note=r.note,e.emptyLine=r.emptyLine}function Be(e){let t=e?.attributes?.part;return typeof t==="string"?t:""}function le(e,r,t,a){e.replaceChildren();let n=v({collection:"",draft:!1,draftAxis:"hidden",draftHint:"",emptyLine:"",fieldsRegion:"",name:"",note:"",noteState:"hidden",openContentTypes:t.openContentTypes,region:"",setDraft:t.setDraft,stage:"empty"});de(n,r);let s=null,l=!1,p=R("entry-editor",n,e,{onNodeCreated:(o,w,g)=>{if(o instanceof HTMLElement&&Be(g)==="fields")a.fieldsSlot(o)}}).then((o)=>{if(l)return o.dispose(),o.root;return s=o,o.root});return{attached:()=>{if(l)return!1;let o=s?.root;return o===void 0?!0:o instanceof HTMLElement&&e.contains(o)},dispose(){l=!0,s?.dispose(),s=null},ready:p,update:(o)=>de(n,o)}}function ce(e){return e.doc.sourceFormat==null&&e.doc.mode!=="content"}function Wf(e){return ce(e)?e.doc.document:e.doc.content?.frontmatter??{}}function ze(e,r,t){let a=e.doc.document,n=Object.hasOwn(a,r)?Ae(a[r]):void 0,s=t===void 0||t===null||t==="";if(s)delete a[r];else a[r]=t;let l=s?void 0:Ae(t);vi({forward:{key:r,op:"set-key",path:[],value:l},inverse:{key:r,op:"set-key",path:[],value:n}}),e.doc.dirty=!0,HE()}function z(e,r,t){if(ce(e))ze(e,r,t);else Ol(e,r,t)}function pe(e,r){q(e,(t)=>{for(let[a,n]of Object.entries(r))z(t,a,n)})}var fe="entry",Ie=[fe],L=new Map;function I(e){return L.get(e)??null}function b1(e,r){let t=I(e);return t!==null&&t.tabId===r.id&&t.wrap.isConnected&&t.surface.attached()}function lb(e){let r=L.get(e);if(!r)return;r.scope.stop(),r.surface.dispose(),L.delete(e)}function _(e,r){q(e,(t)=>z(t,fc,r))}function xE(e){let r=sa(e.documentPath),t=Wf(e);if(!r||!Gf(r.schema,t))return null;let a=Lu(t);return{draft:a,text:a?"Draft":"Published",title:a?mb:"Not marked a draft."}}function _e(e){return{fieldKeyPrefix:`entry:${e.id}`,resolvePointer:(r,t)=>Tu(r,{projectConfig:D?.projectConfig??{},scope:t})}}function We(e,r){let t={};for(let a of CE(e.schema,r))t[a]="Required — this entry does not have one.";return t}function Je(e){return`${e.documentPath??"This document"} is not an entry of any content collection, so there is no schema to draw a form from.`}function ue(e,r,t){let a=Zi(e,"entry"),n=Zi(e,"entry/fields");if(!t)return{collection:"",draft:!1,draftAxis:"hidden",draftHint:mb,emptyLine:Je(r),fieldsRegion:n,name:"",note:"",noteState:"hidden",region:a,stage:"empty"};let s=Wf(r),l=Lu(s);return{collection:t.name,draft:l,draftAxis:Gf(t.schema,s)?"shown":"hidden",draftHint:mb,emptyLine:"",fieldsRegion:n,name:r.documentPath?.split("/").pop()??"Untitled",note:mb,noteState:l?"shown":"hidden",region:a,stage:"entry"}}function _E(e,r){let{paneId:t,wrap:a}=e;if(b1(t,r))return;lb(t);let n=null,s=null,l=()=>{if(n!==null&&I(t)===n)o()},p=(y)=>{if(!s||!y)return;let x=Wf(r),F=fd(`entry:${t}`,y.schema,x,{context:_e(r),errors:We(y,x),onChange:(i)=>pe(r,i),rerender:l});if(F.parentNode!==s)s.replaceChildren(F)},o=()=>{let y=sa(r.documentPath);if(!y)s=null;n?.surface.update(ue(t,r,y)),p(y)},w=ge(),g=le(a,ue(t,r,sa(r.documentPath)),{openContentTypes:()=>{ne()?.run("settings.open",{section:"content"})},setDraft:(y)=>_(r,y)},{fieldsSlot:(y)=>{s=y,p(sa(r.documentPath))}});n={paneId:t,scope:w,surface:g,tabId:r.id,wrap:a},L.set(t,n),w.run(()=>{Q(()=>{if(I(t)!==n)return;r.doc.document,r.doc.content?.frontmatter,D?.projectConfig?.content,o()})})}async function W(e){let{openFileInTab:r}=await (me("fjy7zpxt"),import("./files-fjy7zpxt.js"));await r(e);for(let[t,a]of m.tabs.entries()){if(a.documentPath!==e)continue;for(let n of Ie)if(!a.capabilities.modes.includes(n))a.capabilities.modes.unshift(n);return a.session.ui.canvasMode=fe,a.session.ui.preview=!1,ci(t),a}return null}function J(){return cb().map((e)=>e.name)}async function Ue(e){let r=y1(e.schema),t=(e.def.format?wi(e.def.format)?.name:void 0)??Zt(`untitled${e.ext}`)?.name??Dr()?.name;if(e.ext===".json"||t===void 0)return pr(r,null);return Us(t,{...r,children:[]},{frontmatter:Object.keys(r).length>0,mode:"roundtrip"})}async function Ew(e,r={}){let t=Tw(e);if(!t)return k.error(`No content collection named "${e}" to create an entry in.`,{detail:"A collection needs a `content` entry in project.json whose `source` is a directory. A collection whose source names a single file (a CSV catalogue) has rows, not entry files.",source:"Content"}),null;await qt().catch(()=>{});let a;try{a=await Ue(t)}catch(o){return k.error(`Could not prepare a new ${t.name} entry.`,{detail:te(o),path:t.dir,source:"Content"}),null}let n=r.dir,s=n!==void 0&&bp(n)?.name===t.name?n:t.dir;if(s.includes(Dx))return k.error(`"${t.name}" is a localized collection.`,{detail:`Its entries live in one directory per language (${t.dir}). Open the folder for the language you are writing in and create the entry there.`,path:t.dir,source:"Content"}),null;let{createFileIn:l}=await (me("fjy7zpxt"),import("./files-fjy7zpxt.js")),p=await l({content:a,dir:s,format:{ext:t.ext,kind:"fixed"},source:"Content",suggestedName:"untitled",title:`New ${t.name} entry`});if(p===null)return null;return B(t.name),await W(p),p}function he(){let e=u.value;return e&&sa(e.documentPath)?e:null}function Ye(){return[{args:Se({collection:fa(J,"The content collection the entry is created in.")}),category:"File",id:"content.newEntry",level:"project",menus:["palette"],group:"1_file",requires:"a project with a directory-backed content collection",when:(e)=>e.project.open,enablement:()=>J().length>0,undo:"project",run:async(e,r)=>{let t=J();await Ew(li("content.newEntry",r,"collection",t))},title:"New Entry"},{args:Se({path:He("Project-relative path of the entry file to open.")}),category:"File",id:"content.openEntry",level:"project",menus:["context/file","palette"],group:"1_file",requires:"an open project",when:(e)=>e.project.open,run:async(e,r)=>{await W(ot("content.openEntry",r,"path"))},title:"Open Entry Form"},{args:Se({draft:oo("True marks the open entry a draft; false marks it published. Written as a `draft` field on the entry.")}),category:"Document",id:"content.setDraft",level:"document",menus:["context/tab","palette"],group:"3_document",requires:"a content entry open",when:(e)=>e.document.open,enablement:()=>he()!==null,undo:"document",run:(e,r)=>{let t=he();if(!t)throw Error("content.setDraft: the active document is not a content entry");_(t,yi("content.setDraft",r,"draft"))},title:"Set Draft"},{args:Se({include:oo("True lists entries marked `draft: true` alongside the rest.")}),category:"View",id:"content.setIncludeDrafts",level:"project",menus:["palette"],group:"2_view",requires:"an open project",when:(e)=>e.project.open,run:async(e,r)=>{FE(yi("content.setIncludeDrafts",r,"include")),await I1()},title:"Include Drafts"}]}function v1(e){e.registerAll(Ye())}
|
|
2
|
-
export{
|
|
1
|
+
import{Kt,_i,Qt,Fo,Zs}from"./studio-5tnvjkz4.js";import{ge,Q,y,C}from"./studio-55h4mstj.js";import{wi,q,Gl,rt,xi,di,ke,Ca,sr,He,Kx,Op,Kl,Fy,m,u,ui}from"./studio-a2ke1e4t.js";import{te}from"./studio-ery42sqr.js";import{ne}from"./studio-9mccjwjh.js";import{Qw,Hu,Ed,Bu}from"./studio-63epcrj2.js";import{Qi,T,I}from"./studio-g1shz58g.js";import{Ec,Ib,Wu,lm,tT,qS}from"./studio-qkstvve9.js";import{yo}from"./studio-t1xzawhr.js";import{iT}from"./studio-7vg6jcd3.js";import{Vw,Cb,ga,PS,HE}from"./studio-qv1pwd3c.js";import{D}from"./studio-yn9f8vtx.js";import{Oe}from"./studio-mcayt6hz.js";import{me}from"./studio-pre0skq6.js";var Hw=["string","number","boolean","array","object","reference"],Bw=["","image","date","color"];function im(e){if(e.$ref)return"reference";return e.type||"string"}function Sc(e){if(e.type==="array"&&e.items?.format)return e.items.format;return e.format||""}function Ws(e,r){switch(e){case"number":return{type:"number"};case"boolean":return{type:"boolean"};case"array":return r?{items:{format:r,type:"string"},type:"array"}:{items:{type:"string"},type:"array"};case"object":return{properties:{},required:[],type:"object"};case"reference":return{$ref:"#/content/"};default:return r?{format:r,type:"string"}:{type:"string"}}}var U={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSchemaBuilder",$description:'The `schema-builder` form control (specs/extensions.md §9.1): the visual editor for a JSON Schema object, drawn as one card per property. A descriptor names it with `"ui": { "<prop>": { "control": "schema-builder" } }`, and `ui/schema-form.ts` mounts it into the empty host its own document announces for that field. The adapter (`surfaces/schema-builder.ts`) hands in the fields already classified and every draft the reader is part-way through typing; `ui/form-controls.ts` decides what a field may be renamed to and what reaches the host\'s `onChange`. Nothing here reads a schema: a document that re-derived a field\'s type while drawing would be a second opinion about what one module already owns. **The card is `surfaces/settings-defs.json`\'s, part for part.** Data Shapes edits the project\'s `$defs` and this edits a content type\'s `schema`; they are the same object with the same six controls per row, so the row vocabulary — `card`, `field-row`, `field-label`, `field-name`, `field-type`, `field-format`, `field-required`, `field-delete`, `nested`, `nested-card`, `nested-add-name`/`-type`/`-button`, `ref-target`, `add-form` — is ONE vocabulary, and the row views it is drawn from are that surface\'s own types rather than a second declaration of them. What differs is only what encloses it: Data Shapes carries the two-column chrome that chooses WHICH shape is being edited, and this one is handed the object to edit.',tagName:"div",attributes:{part:"builder"},style:{$description:"What `.schema-builder`, `.schema-field-list`, `.schema-field-card`, `.schema-field-row`, `.schema-field-nested`, `.schema-field-name-input`, `.schema-nested-add`, `.schema-nested-add-name` and `.schema-add-field` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer — the same translation `surfaces/settings-defs.json` carries, because it is the same card. Two values could not come with them. `.schema-field-card--nested` read `var(--spectrum-gray-300, #444)`, and the caption was an `sp-field-label` at whatever size Spectrum drew it; a document is mounted in the pane rather than inside `<sp-theme>`, so both would have taken their hard-coded fallback every time. The nested card takes the studio layer's `--border`, and the caption says what it is in the type ramp instead.",display:"block",'& [part="fields"]':{display:"flex",flexDirection:"column",gap:"4px",marginBottom:"12px"},'& [part="card"], & [part="nested-card"]':{border:"1px solid var(--border)",borderRadius:"var(--radius)",padding:"6px 10px"},'& [part="field-row"]':{display:"flex",alignItems:"center",gap:"8px"},'& [part="field-label"]':{$description:"The field's name in words: a caption on the row rather than a label for a control, since the raw key beside it is what the reader edits and what carries the accessible name.",flex:"none",minWidth:"84px",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)",overflowWrap:"anywhere"},'& [part="field-name"]':{flex:"1",maxWidth:"140px"},'& [part="nested"]':{marginLeft:"16px",marginTop:"6px",paddingLeft:"8px",borderLeft:"2px solid var(--border)",display:"flex",flexDirection:"column",gap:"4px"},'& [part="ref-target"]':{display:"flex",marginTop:"6px",maxWidth:"220px"},'& [part="nested-add"]':{display:"flex",alignItems:"center",gap:"6px",padding:"4px 0"},'& [part="nested-add-name"]':{flex:"1",maxWidth:"120px"},'& [part="add-form"]':{display:"flex",alignItems:"center",gap:"8px",padding:"8px 0"}},children:[{tagName:"div",attributes:{part:"fields"},children:[{$prototype:"Array",items:{$ref:"#/state/fields"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"card","data-field":"${$map.item.key}"},children:[{tagName:"div",attributes:{part:"field-row"},children:[{tagName:"span",attributes:{part:"field-label"},textContent:"${$map.item.label}"},{tagName:"jx-textfield",attributes:{part:"field-name"},$props:{label:"Name for ${$map.item.label}",size:"sm",value:{$ref:"$map/item/name"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameField"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-select",attributes:{part:"field-type"},$props:{label:"Type for ${$map.item.label}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/type"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setType"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"field-format"},$props:{label:"Format for ${$map.item.label}",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"$map/item/format"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFormat"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",$description:"Whether the object requires this field. The word on screen is the name: `Req` is slotted rather than passed as `label`, because the kit's switch wraps its control in the label the slot lands in, and a second name would be announced over the top of it. Which row it belongs to is the tooltip's job instead, which is what `hint` is.",attributes:{part:"field-required"},$props:{hint:"Require ${$map.item.label}",size:"sm",checked:{$ref:"$map/item/required"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setRequired"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Req"}]},{tagName:"jx-action-button",attributes:{part:"field-delete"},$props:{label:"Delete ${$map.item.label}",hint:"Delete ${$map.item.label}",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeField"},value:[{$ref:"$map/item/key"}]}]}}]},{tagName:"div",attributes:{part:"extra-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/extra"},cases:{reference:{tagName:"div",attributes:{part:"ref-target"},children:[{tagName:"jx-select",attributes:{part:"ref-target-select"},$props:{label:"Target for ${$map.item.label}",size:"sm",options:{$ref:"#/state/targets"},value:{$ref:"$map/item/refTarget"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setTarget"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}]},nested:{tagName:"div",attributes:{part:"nested"},children:[{$prototype:"Array",items:{$ref:"$map/item/children"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"nested-card","data-nested":"${$map.item.key}"},children:[{tagName:"div",attributes:{part:"field-row"},children:[{tagName:"jx-textfield",attributes:{part:"field-name"},$props:{label:"Name for ${$map.item.parent}.${$map.item.key}",size:"sm",value:{$ref:"$map/item/name"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameNested"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-select",attributes:{part:"field-type"},$props:{label:"Type for ${$map.item.parent}.${$map.item.key}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/type"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedType"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"field-format"},$props:{label:"Format for ${$map.item.parent}.${$map.item.key}",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"$map/item/format"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedFormat"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",attributes:{part:"field-required"},$props:{hint:"Require ${$map.item.parent}.${$map.item.key}",size:"sm",checked:{$ref:"$map/item/required"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedRequired"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Req"}]},{tagName:"jx-action-button",attributes:{part:"field-delete"},$props:{label:"Delete ${$map.item.parent}.${$map.item.key}",hint:"Delete ${$map.item.parent}.${$map.item.key}",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeNested"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"}]}]}}]}]}},{tagName:"div",attributes:{part:"nested-add"},children:[{tagName:"jx-textfield",attributes:{part:"nested-add-name"},$props:{label:"New field in ${$map.item.label}",placeholder:"field name",size:"sm",value:{$ref:"$map/item/draftName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editDraftName"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/addNested"},value:[{$ref:"$map/item/key"}]}]}}]}},{tagName:"jx-select",attributes:{part:"nested-add-type"},$props:{label:"Type of the new field in ${$map.item.label}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/draftType"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editDraftType"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",attributes:{part:"nested-add-button"},$props:{label:"Add a field to ${$map.item.label}",hint:"Add a field to ${$map.item.label}",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/addNested"},value:[{$ref:"$map/item/key"}]}]}}]}]}}}]}}]},{tagName:"div",attributes:{part:"add-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/addState"},cases:{closed:{tagName:"jx-action-button",attributes:{part:"add-open"},$props:{label:"Add Field",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAdd"},value:[]}]},children:[{tagName:"span",textContent:"Add Field"}]},open:{tagName:"div",attributes:{part:"add-form"},children:[{tagName:"jx-textfield",attributes:{part:"add-name"},$props:{label:"New field name",placeholder:"Field name",size:"sm",value:{$ref:"#/state/addName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddName"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/confirmAdd"},value:[]}],Escape:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/cancelAdd"},value:[]}]}}]}},{tagName:"jx-select",attributes:{part:"add-type"},$props:{label:"Type of the new field",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"#/state/addType"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddType"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"add-format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/addHasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"add-format"},$props:{label:"Format of the new field",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"#/state/addFormat"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddFormat"},value:[{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",attributes:{part:"add-required"},$props:{hint:"Require the new field",size:"sm",checked:{$ref:"#/state/addRequired"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddRequired"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Required"}]},{tagName:"jx-button",attributes:{part:"add-confirm"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirmAdd"},value:[]}]},children:[{tagName:"span",textContent:"Add"}]},{tagName:"jx-button",attributes:{part:"add-cancel"},$props:{size:"sm",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancelAdd"},value:[]}]},children:[{tagName:"span",textContent:"Cancel"}]}]}}}]};T("schema-builder",U);function be(){return{addFormat:"",addHasFormat:!0,addName:"",addRequired:!1,addState:"closed",addType:"string",fields:[],formatOptions:[],targets:[],typeOptions:[]}}function Y(e,r){e.textContent="";let t=y({...be(),...r}),n=null,a=!0,s=!1,l=()=>I("schema-builder",t,e).then((o)=>{if(a=!1,s)return o.dispose(),o.root;return n=o,o.root}),p=l();return{dispose(){s=!0,n?.dispose(),n=null,e.textContent=""},host:e,ready:p,update(o){if(t.addFormat=o.addFormat,t.addHasFormat=o.addHasFormat,t.addName=o.addName,t.addRequired=o.addRequired,t.addState=o.addState,t.addType=o.addType,t.fields=o.fields,t.formatOptions=o.formatOptions,t.targets=o.targets,t.typeOptions=o.typeOptions,s||a||n!==null&&e.contains(n.root))return;n?.dispose(),n=null,a=!0,e.textContent="",l()}}}var G={$schema:"https://jxsuite.com/schema/v1",$id:"StudioReferenceField",$description:'The `reference` form control — site-architecture.md §6.1\'s `{ "$ref": "#/content/x" }` and site-architecture.md §7.4\'s entry picker. Registered once and dispatched to by `ui/schema-form.ts` for any property whose `$ref` names a collection, so the settings forms, the entry editor and an array-of-objects cell all draw the same control without any of them knowing it exists. `ui/form-controls.ts` decides which of the three states the field is in and what each gesture commits; nothing here reads a schema or lists a directory. The three states are drawn as three different controls on purpose: a picker while the entries are known, a TEXT field while they are not — a failed read leaves the value editable with the reason beside it, because swapping it for an empty dropdown would present "no entries" and "could not find out" as the same screen — and a disabled picker saying so while the read is in flight.',tagName:"div",attributes:{part:"reference",role:"none"},style:{$description:"The five `.reference-*` rules from `styles/inspector.css`, keyed on `part` and re-pointed at the studio token layer. Two values could not come with them. The note read `var(--spectrum-font-size-50, 11px)`, which resolves only inside `<sp-theme>` — this document is mounted in a settings pane, an entry editor or a frontmatter card, all outside that element, so it would silently have taken its hard-coded fallback every time. And `.reference-missing` coloured ONE row of the dropdown red; the kit's select offers a row a face, a swatch and a border style but no tone, so the dangling entry says what it is in words (\"— not found\") and the colour is not replaced by a second channel. The 6px gap comes onto the kit's spacing scale.",display:"flex",flex:"1",minWidth:"0",alignItems:"center",gap:"var(--jx-space-2)",'& [part="picker"], & [part="text"]':{flex:"1",minWidth:"0"},'& [part="note"]':{margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",lineHeight:"1.4"},'& [part="note"][data-tone="danger"]':{$description:"A listing that failed is a FAULT rather than a fact about the project, and the two notes this control draws are otherwise the same sentence in the same place.",color:"var(--danger)"},'& [part="retry"]':{flex:"none"}},children:[{tagName:"div",attributes:{part:"control-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/kind"},cases:{picker:{$description:"The collection's entries. The empty row is `\"\"` rather than a sentinel, because the kit's select treats the empty string as a legal value a reader can arrow to; a dangling reference is kept in the list and marked, since blanking the field would delete the evidence and the value in one repaint. While the read is in flight the same control is disabled and offers one row saying so.",tagName:"jx-select",attributes:{part:"picker"},$props:{size:"sm",label:{$ref:"#/state/label"},options:{$ref:"#/state/options"},value:{$ref:"#/state/value"},disabled:{$ref:"#/state/disabled"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/choose"},value:[{$ref:"event#/target/value"}]}]}},text:{$description:"The id as the string it is: what a reader gets when the choices could not be listed, and when the control was named by a `ui.control` override on a property that references nothing. Refusing to draw anything would lose the value that is already there.",tagName:"jx-textfield",attributes:{part:"text"},$props:{size:"sm",label:{$ref:"#/state/label"},value:{$ref:"#/state/value"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/edit"},value:[{$ref:"event#/target/value"}]}]}}}},{tagName:"div",attributes:{part:"note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasNote"},cases:{true:{tagName:"p",attributes:{part:"note","data-tone":"${state.noteTone}",role:"status"},textContent:"${state.note}"}}},{tagName:"div",attributes:{part:"retry-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/canRetry"},cases:{true:{$description:"Offered only where there is something to try again — a listing that failed. It used to be offered only where the HOST passed a repaint hook, because a template control cannot draw a second frame of its own and a button that cannot do the thing it is named after is worse than its absence. A mounted control redraws itself, so the condition is now the failure rather than the host.",tagName:"jx-action-button",attributes:{part:"retry"},$props:{size:"sm",quiet:!0,label:"Retry listing entries"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/retry"},value:[]}]},children:[{tagName:"span",textContent:"Retry"}]}}}]};T("reference-field",G);function ve(){return{canRetry:!1,disabled:!0,hasNote:!1,kind:"picker",label:"",note:"",noteTone:"dim",options:[],value:""}}function K(e,r){e.textContent="";let t=y({...ve(),...r}),n=null,a=!0,s=!1,l=()=>I("reference-field",t,e).then((o)=>{if(a=!1,s)return o.dispose(),o.root;return n=o,o.root}),p=l();return{dispose(){s=!0,n?.dispose(),n=null,e.textContent=""},host:e,ready:p,update(o){if(t.canRetry=o.canRetry,t.disabled=o.disabled,t.hasNote=o.hasNote,t.kind=o.kind,t.label=o.label,t.note=o.note,t.noteTone=o.noteTone,t.options=o.options,t.value=o.value,s||a||n!==null&&e.contains(n.root))return;n?.dispose(),n=null,a=!0,e.textContent="",l()}}}var X={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSecretField",$description:'The `secret` form control (specs/extensions.md §9.1, §13): one password field whose VALUE goes to the platform\'s secret store and never to project.json. A descriptor names it with `"ui": { "<field>": { "control": "secret" } }`, and `ui/schema-form.ts` mounts it into the empty host its own document announces for that field. **A surface never renders back the secret it describes, and this document is where that is visible rather than remembered**: the only thing bound to the field\'s value is `#/state/shown`, a scope path whose whole purpose is to hold nothing. What the field is worth is said in the placeholder instead — the env NAME the store gave it, which is the only half of a secret a screen may carry. `ui/form-controls.ts` decides everything else: whether the host has a secret store at all, what the placeholder says, what a commit is worth and what the field persists.',tagName:"div",attributes:{part:"secret",role:"none"},style:{$description:"`.secret-field` carried no rule anywhere — it was one of `check-styles.ts`'s ALLOWED_ORPHANS, a class emitted only so a test could find the control — so there is nothing to translate and the wrapper takes no box of its own. The field takes the width of the control host the form drew, which is the flex item; a kit field is inline-flex by default and would otherwise sit at its intrinsic width in a row sized for it.",display:"contents",'& [part="field"]':{width:"100%"}},children:[{$description:"`autocomplete: new-password` because this is a place to PUT a secret rather than to prove one: without it a password manager offers to fill the field with a credential belonging to whatever site the reader last logged in to, and the offer is the manager's own UI drawn over an editor. The value binding is `#/state/shown` and nothing else ever writes to it — see the document description.",tagName:"jx-textfield",attributes:{part:"field"},$props:{type:"password",size:"sm",autocomplete:"new-password",label:{$ref:"#/state/label"},placeholder:{$ref:"#/state/placeholder"},disabled:{$ref:"#/state/disabled"},value:{$ref:"#/state/shown"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commit"},value:[{$ref:"event#/target/value"}]}],description:"The change bubbles out of the field's own input, so what the reader typed is read off the event rather than off the element — and it is read here, handed to the flow, and never written back onto the scope."}}]};T("secret-field",X);function xe(){return{disabled:!0,label:"",placeholder:"Not set"}}function Z(e,r){e.textContent="";let t=y({...xe(),...r,shown:""}),n=null,a=!0,s=!1,l=()=>I("secret-field",t,e).then((o)=>{if(a=!1,s)return o.dispose(),o.root;return n=o,o.root}),p=l();return{clear(){t.shown=" ",t.shown=""},dispose(){s=!0,n?.dispose(),n=null,e.textContent=""},host:e,ready:p,update(o){if(t.disabled=o.disabled,t.label=o.label,t.placeholder=o.placeholder,s||a||n!==null&&e.contains(n.root))return;n?.dispose(),n=null,a=!0,e.textContent="",l()}}}var Se=Hw.map((e)=>({label:e,value:e})),Fe=Bw.map((e)=>({label:e||"(none)",value:e})),R={format:"",name:"",required:!1,type:"string"},ee=[],re=" ";function Ne(e){let r=e.resolvePointer("#/$context/content"),t=r&&typeof r==="object"&&!Array.isArray(r)?Object.keys(r):[],n=t.join(" ");if(n!==re)re=n,ee=t.map((a)=>({label:a,value:a}));return ee}function N(e){return e==="string"||e==="array"}function ie(e){return e&&typeof e==="object"&&!Array.isArray(e)?e:{properties:{},required:[],type:"object"}}function Te(e){let r=JSON.parse(JSON.stringify(ie(e)));return r.type??="object",r.properties??={},r.required??=[],r}function j(e){return`name:${e}`}function A(e){return`required:${e}`}function M(e,r){return`${e} ${r}`}function H(e,r,t){return e.echo?.id===r?e.echo.value:t}function Ee(e,r,t,n,a){let s=M(r,t),l=im(n);return{format:Sc(n),hasFormat:N(l),key:t,name:H(e,j(s),t),parent:r,required:H(e,A(s),a),type:l}}function Ce(e,r,t,n,a){let s=im(t),l=s==="object",p=e.drafts.get(r),o=t.required??[];return{children:l?Object.entries(t.properties??{}).map(([w,g])=>Ee(e,r,w,g,o.includes(w))):[],draftName:p?.name??"",draftType:p?.type??"string",extra:s==="reference"&&a?"reference":l?"nested":"none",format:Sc(t),hasFormat:N(s),key:r,label:Kl(r),name:H(e,j(r),r),refTarget:t.$ref?t.$ref.replace(/^#\/[^/]+\//,""):"",required:H(e,A(r),n),type:s}}function ae(e,r,t){let n={};for(let[a,s]of Object.entries(e))n[a===r?t:a]=s,delete e[a];Object.assign(e,n)}function L(e,r,t){e.required??=[];let n=e.required.indexOf(r);if(t&&n===-1)e.required.push(r);if(!t&&n!==-1)e.required.splice(n,1)}function Re(e,r){let t=r,n=null,a={add:{...R},addOpen:!1,drafts:new Map,echo:null},s=()=>n??ie(t.value),l=()=>{let i=s(),d=i.required??[],c=Ne(t.ctx);return{addFormat:a.add.format,addHasFormat:N(a.add.type),addName:a.add.name,addRequired:a.add.required,addState:a.addOpen?"open":"closed",addType:a.add.type,fields:Object.entries(i.properties??{}).map(([f,h])=>Ce(a,f,h,d.includes(f),c.length>0)),formatOptions:Fe,targets:c,typeOptions:Se}},p=()=>F.update(l()),o=(i,d)=>{a.echo={id:i,value:d},p()},w=()=>{a.echo=null,p()},g=(i)=>{let d=Te(s());if(!i(d)){w();return}n=d,a.echo=null,t.onChange(d),p()},b=(i,d)=>i.properties[d],x=(i)=>{let d=a.drafts.get(i);if(!d)d={name:"",type:"string"},a.drafts.set(i,d);return d},F=Y(e,{addNested(i){let d=x(i),c=Fy(d.name.trim());if(!c)return;g((f)=>{let h=b(f,i);if(!h)return!1;return h.properties??={},h.properties[c]=Ws(d.type||"string"),d.name="",!0})},cancelAdd(){a.addOpen=!1,a.add={...R},p()},confirmAdd(){let i=Fy(a.add.name.trim());if(!i)return;let{format:d,required:c,type:f}=a.add;a.addOpen=!1,a.add={...R},g((h)=>{if(h.properties[i]=Ws(f,d||void 0),c)L(h,i,!0);return!0})},editAddFormat(i){a.add.format=i,p()},editAddName(i){a.add.name=i,p()},editAddRequired(i){a.add.required=i,p()},editAddType(i){a.add.type=i,p()},editDraftName(i,d){x(i).name=d,p()},editDraftType(i,d){x(i).type=d,p()},openAdd(){a.addOpen=!0,a.add={...R},p()},removeField(i){g((d)=>{if(!d.properties[i])return!1;return delete d.properties[i],d.required=d.required.filter((c)=>c!==i),!0})},removeNested(i,d){g((c)=>{let f=b(c,i);if(!f?.properties?.[d])return!1;if(delete f.properties[d],f.required)f.required=f.required.filter((h)=>h!==d);return!0})},renameField(i,d){o(j(i),d);let c=Fy(d.trim());g((f)=>{if(!f.properties[i]||!c||c===i||f.properties[c])return!1;return ae(f.properties,i,c),f.required=f.required.map((h)=>h===i?c:h),!0})},renameNested(i,d,c){o(j(M(i,d)),c);let f=Fy(c.trim());g((h)=>{let v=b(h,i);if(!v?.properties?.[d]||!f||f===d||v.properties[f])return!1;if(ae(v.properties,d,f),v.required)v.required=v.required.map((k)=>k===d?f:k);return!0})},setFormat(i,d){g((c)=>{let f=c.properties[i];if(!f)return!1;return c.properties[i]=Ws(f.type||"string",d||void 0),!0})},setNestedFormat(i,d,c){g((f)=>{let h=b(f,i),v=h?.properties?.[d];if(!h?.properties||!v)return!1;return h.properties[d]=Ws(v.type||"string",c||void 0),!0})},setNestedRequired(i,d,c){o(A(M(i,d)),c),g((f)=>{let h=b(f,i);if(!h)return!1;return L(h,d,c),!0})},setNestedType(i,d,c){g((f)=>{let h=b(f,i),v=h?.properties?.[d];if(!h?.properties||!v)return!1;let k=N(c)?Sc(v):void 0;return h.properties[d]=Ws(c,k||void 0),!0})},setRequired(i,d){o(A(i),d),g((c)=>{if(!c.properties[i])return!1;return L(c,i,d),!0})},setTarget(i,d){g((c)=>{if(!c.properties[i])return!1;return c.properties[i]={$ref:`#/content/${d}`},!0})},setType(i,d){g((c)=>{let f=c.properties[i];if(!f)return!1;let h=N(d)?Sc(f):void 0;return c.properties[i]=Ws(d,h||void 0),!0})}});return p(),{dispose:()=>F.dispose(),update(i){t=i,n=null,a.echo=null,p()}}}var je={mount:Re};Qw("schema-builder",je);function oe(e){return typeof e==="string"&&e?e:null}function Ae(e,r){let t=r,n=()=>{let s=oe(t.value);a.update({disabled:!t.ctx.commitSecret,label:t.key,placeholder:s?`Stored as ${s}`:"Not set"})},a=Z(e,{commit(s){let{commitSecret:l}=t.ctx;if(!l||!s)return;a.clear();let{key:p,onChange:o}=t,w=oe(t.value);Promise.resolve(l(p,s)).then((g)=>{if(typeof g==="string"&&g&&g!==w)o(g)})}});return n(),{dispose:()=>a.dispose(),update(s){t=s,n()}}}var De={mount:Ae};Qw("secret",De);var E=new Map,O=new Map,S=new Map;function V(e){if(e===void 0)E.clear(),O.clear(),S.clear();else E.delete(e),O.delete(e),S.delete(e)}function qe(e){let r=E.get(e);if(r)return r;let t=(me("108aqtk1"),import("./content-source-108aqtk1.js")).then((n)=>n.listCollectionEntryIds(e));return E.set(e,t),t}function NS(e,r){let t=O.get(e);if(t)return t;let n=qe(e),a=S.get(e);if(a){if(r)a.add(r);return null}S.set(e,new Set(r?[r]:[]));let s=(l)=>{if(E.get(e)!==n)return;let p=S.get(e);S.delete(e),O.set(e,l);for(let o of p??[])o()};return n.then((l)=>s({ids:l}),(l)=>s({error:te(l)})),null}function Pe(e,r){let t=typeof e.value==="string"?e.value:"",n={canRetry:!1,disabled:!1,hasNote:!1,label:e.key,note:"",noteTone:"dim",options:[],value:t},a=Hu(e.schema);if(a===null)return{...n,hasNote:!0,kind:"text",note:'No collection referenced — add "$ref": "#/content/<type>" to this field.'};let s=NS(a,r);if(s===null)return{...n,disabled:!0,kind:"picker",options:[{label:"Loading…",value:t}]};if("error"in s)return{...n,canRetry:!0,hasNote:!0,kind:"text",note:`Could not list ${a} entries — ${s.error}`,noteTone:"danger"};let l=t!==""&&!s.ids.includes(t);return{...n,hasNote:s.ids.length===0,kind:"picker",note:s.ids.length===0?`No ${a} entries yet.`:"",options:[{label:"—",value:""},...l?[{label:`${t} — not found`,value:t}]:[],...s.ids.map((p)=>({label:p,value:p}))]}}function Le(e,r){let t=r,n=!1,a=()=>{if(!n)s.update(Pe(t,a))},s=K(e,{choose(l){t.onChange(l===""?void 0:l)},edit(l){t.onChange(l.trim()||void 0)},retry(){let l=Hu(t.schema);if(l!==null)V(l);a()}});return a(),{dispose(){n=!0,s.dispose()},update(l){t=l,a()}}}var Me={mount:Le};Qw("reference",Me);var se={$schema:"https://jxsuite.com/schema/v1",$id:"StudioEntryEditor",$description:"The Entry editor (site-architecture.md §7.4) — one content entry's fields, in a pane, as a Jx document over the kit. The adapter (`surfaces/entry-editor.ts`) hands in a projection; `content/entry-editor.ts` decides everything in it — which collection the file belongs to, which record its fields live in, which required keys are absent and what a draft flag commits into. The FORM is an island: a schema is `ui/schema-form.ts`'s subject, so this document renders an empty `fields` node and the flow places the element that engine hands back (studio-ui-guidelines.md §9.3, §9.4). That is the whole of the difference between this and the card the lit version drew, and it is why the engine converting in batch 7 is what unblocked this one.",tagName:"div",attributes:{part:"entry","data-jx-region":"${state.region}"},style:{$description:"What `.entry-editor`, `.entry-editor-header`, `.entry-editor-collection`, `.entry-draft-switch`, `.entry-editor-fields`, `.entry-editor-note` and `.entry-editor-empty` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. This editor was the only emitter of all seven, so those rules are dead in the stylesheet from here; a central sweep removes them rather than this change, which owns no stylesheet. Every `--spectrum-font-size-*` reference is gone rather than renamed: those names resolve only inside `<sp-theme>`, and a pane editor is mounted outside it, so each would silently have taken its hard-coded fallback.",height:"100%",padding:"var(--jx-space-5)",overflowY:"auto",background:"var(--bg-panel)",'& [part="header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-4)",marginBottom:"var(--jx-space-5)"},'& [part="name"]':{margin:"0",fontSize:"var(--jx-text-lg)",fontWeight:"600",color:"var(--fg)"},'& [part="collection"]':{padding:"1px var(--jx-space-3)",borderRadius:"var(--radius)",background:"var(--bg)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="draft"]':{$description:"Pushed to the far end of the header rather than placed there: the heading and the collection chip are both content-width, so `margin-left: auto` is what keeps the switch on the right edge whatever the entry is called.",marginLeft:"auto"},'& [part="fields"]':{$description:"The schema form's host is `display: contents`, so its rows are the flex items of THIS box — which is why the column lives here and not inside the engine.",display:"flex",flexDirection:"column"},'& [part="note"]':{margin:"0 0 var(--jx-space-4)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"},'& [part="empty"]':{display:"flex",maxWidth:"46ch",flexDirection:"column",alignItems:"flex-start",gap:"var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"}},children:[{tagName:"div",attributes:{part:"stage-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/stage"},cases:{entry:{tagName:"div",attributes:{part:"body",role:"none"},style:{display:"contents"},children:[{tagName:"div",attributes:{part:"header"},children:[{tagName:"h3",attributes:{part:"name"},textContent:"${state.name}"},{tagName:"span",attributes:{part:"collection"},textContent:"${state.collection}"},{tagName:"div",attributes:{part:"draft-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/draftAxis"},cases:{shown:{$description:"No `label`: the slotted word is on screen and carries the name, so an aria-label would be read twice. The tooltip is `hint`, which is what DRAFT_MEANING has always been.",tagName:"jx-switch",attributes:{part:"draft"},$props:{checked:{$ref:"#/state/draft"},hint:"${state.draftHint}",size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setDraft"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Draft"}]}}}]},{tagName:"div",attributes:{part:"note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/noteState"},cases:{shown:{tagName:"p",attributes:{part:"note"},textContent:"${state.note}"}}},{$description:"An island: `ui/schema-form.ts` draws this entry's fields into this node, and nothing in this document knows what a schema is.",tagName:"div",attributes:{part:"fields","data-jx-region":"${state.fieldsRegion}"}}]},empty:{$description:"The mode is reachable from the palette and from `__jxAutomation` on any tab, so this state is real: it names the reason and the fix rather than drawing an empty form.",tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",attributes:{part:"empty-line"},textContent:"${state.emptyLine}"},{tagName:"p",attributes:{part:"note"},children:[{tagName:"span",textContent:"A collection is a "},{tagName:"code",textContent:"content"},{tagName:"span",textContent:" entry in "},{tagName:"code",textContent:"project.json"},{tagName:"span",textContent:" whose "},{tagName:"code",textContent:"source"},{tagName:"span",textContent:" directory contains this file and which declares a "},{tagName:"code",textContent:"schema"},{tagName:"span",textContent:"."}]},{tagName:"jx-action-button",attributes:{part:"content-types"},$props:{label:"Content types",size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openContentTypes"},value:[]}]},children:[{tagName:"span",textContent:"Content types…"}]}]}}}]};T("entry-editor",se);function de(e,r){e.region=r.region,e.fieldsRegion=r.fieldsRegion,e.stage=r.stage,e.name=r.name,e.collection=r.collection,e.draftAxis=r.draftAxis,e.draft=r.draft,e.draftHint=r.draftHint,e.noteState=r.noteState,e.note=r.note,e.emptyLine=r.emptyLine}function Be(e){let t=e?.attributes?.part;return typeof t==="string"?t:""}function le(e,r,t,n){e.replaceChildren();let a=y({collection:"",draft:!1,draftAxis:"hidden",draftHint:"",emptyLine:"",fieldsRegion:"",name:"",note:"",noteState:"hidden",openContentTypes:t.openContentTypes,region:"",setDraft:t.setDraft,stage:"empty"});de(a,r);let s=null,l=!1,p=I("entry-editor",a,e,{onNodeCreated:(o,w,g)=>{if(o instanceof HTMLElement&&Be(g)==="fields")n.fieldsSlot(o)}}).then((o)=>{if(l)return o.dispose(),o.root;return s=o,o.root});return{attached:()=>{if(l)return!1;let o=s?.root;return o===void 0?!0:o instanceof HTMLElement&&e.contains(o)},dispose(){l=!0,s?.dispose(),s=null},ready:p,update:(o)=>de(a,o)}}function ce(e){return e.doc.sourceFormat==null&&e.doc.mode!=="content"}function rm(e){return ce(e)?e.doc.document:e.doc.content?.frontmatter??{}}function ze(e,r,t){let n=e.doc.document,a=Object.hasOwn(n,r)?Oe(n[r]):void 0,s=t===void 0||t===null||t==="";if(s)delete n[r];else n[r]=t;let l=s?void 0:Oe(t);wi({forward:{key:r,op:"set-key",path:[],value:l},inverse:{key:r,op:"set-key",path:[],value:a}}),e.doc.dirty=!0,iT()}function B(e,r,t){if(ce(e))ze(e,r,t);else Gl(e,r,t)}function pe(e,r){q(e,(t)=>{for(let[n,a]of Object.entries(r))B(t,n,a)})}var fe="entry",Ie=[fe],P=new Map;function z(e){return P.get(e)??null}function OS(e,r){let t=z(e);return t!==null&&t.tabId===r.id&&t.wrap.isConnected&&t.surface.attached()}function Sb(e){let r=P.get(e);if(!r)return;r.scope.stop(),r.surface.dispose(),P.delete(e)}function _(e,r){q(e,(t)=>B(t,Ec,r))}function FE(e){let r=ga(e.documentPath),t=rm(e);if(!r||!lm(r.schema,t))return null;let n=Wu(t);return{draft:n,text:n?"Draft":"Published",title:n?Ib:"Not marked a draft."}}function _e(e){return{fieldKeyPrefix:`entry:${e.id}`,resolvePointer:(r,t)=>Bu(r,{projectConfig:D?.projectConfig??{},scope:t})}}function We(e,r){let t={};for(let n of HE(e.schema,r))t[n]="Required — this entry does not have one.";return t}function Je(e){return`${e.documentPath??"This document"} is not an entry of any content collection, so there is no schema to draw a form from.`}function ue(e,r,t){let n=Qi(e,"entry"),a=Qi(e,"entry/fields");if(!t)return{collection:"",draft:!1,draftAxis:"hidden",draftHint:Ib,emptyLine:Je(r),fieldsRegion:a,name:"",note:"",noteState:"hidden",region:n,stage:"empty"};let s=rm(r),l=Wu(s);return{collection:t.name,draft:l,draftAxis:lm(t.schema,s)?"shown":"hidden",draftHint:Ib,emptyLine:"",fieldsRegion:a,name:r.documentPath?.split("/").pop()??"Untitled",note:Ib,noteState:l?"shown":"hidden",region:n,stage:"entry"}}function jE(e,r){let{paneId:t,wrap:n}=e;if(OS(t,r))return;Sb(t);let a=null,s=null,l=()=>{if(a!==null&&z(t)===a)o()},p=(b)=>{if(!s||!b)return;let x=rm(r),F=Ed(`entry:${t}`,b.schema,x,{context:_e(r),errors:We(b,x),onChange:(i)=>pe(r,i),rerender:l});if(F.parentNode!==s)s.replaceChildren(F)},o=()=>{let b=ga(r.documentPath);if(!b)s=null;a?.surface.update(ue(t,r,b)),p(b)},w=ge(),g=le(n,ue(t,r,ga(r.documentPath)),{openContentTypes:()=>{ne()?.run("settings.open",{section:"content"})},setDraft:(b)=>_(r,b)},{fieldsSlot:(b)=>{s=b,p(ga(r.documentPath))}});a={paneId:t,scope:w,surface:g,tabId:r.id,wrap:n},P.set(t,a),w.run(()=>{Q(()=>{if(z(t)!==a)return;r.doc.document,r.doc.content?.frontmatter,D?.projectConfig?.content,o()})})}async function W(e){let{openFileInTab:r}=await (me("44vp8a2s"),import("./files-44vp8a2s.js"));await r(e);for(let[t,n]of m.tabs.entries()){if(n.documentPath!==e)continue;for(let a of Ie)if(!n.capabilities.modes.includes(a))n.capabilities.modes.unshift(a);return n.session.ui.canvasMode=fe,n.session.ui.preview=!1,ui(t),n}return null}function J(){return Cb().map((e)=>e.name)}async function Ue(e){let r=PS(e.schema),t=(e.def.format?_i(e.def.format)?.name:void 0)??Qt(`untitled${e.ext}`)?.name??Fo()?.name;if(e.ext===".json"||t===void 0)return yo(r,null);return Zs(t,{...r,children:[]},{frontmatter:Object.keys(r).length>0,mode:"roundtrip"})}async function Ww(e,r={}){let t=Vw(e);if(!t)return C.error(`No content collection named "${e}" to create an entry in.`,{detail:"A collection needs a `content` entry in project.json whose `source` is a directory. A collection whose source names a single file (a CSV catalogue) has rows, not entry files.",source:"Content"}),null;await Kt().catch(()=>{});let n;try{n=await Ue(t)}catch(o){return C.error(`Could not prepare a new ${t.name} entry.`,{detail:te(o),path:t.dir,source:"Content"}),null}let a=r.dir,s=a!==void 0&&Op(a)?.name===t.name?a:t.dir;if(s.includes(Kx))return C.error(`"${t.name}" is a localized collection.`,{detail:`Its entries live in one directory per language (${t.dir}). Open the folder for the language you are writing in and create the entry there.`,path:t.dir,source:"Content"}),null;let{createFileIn:l}=await (me("44vp8a2s"),import("./files-44vp8a2s.js")),p=await l({content:n,dir:s,format:{ext:t.ext,kind:"fixed"},source:"Content",suggestedName:"untitled",title:`New ${t.name} entry`});if(p===null)return null;return V(t.name),await W(p),p}function he(){let e=u.value;return e&&ga(e.documentPath)?e:null}function Ye(){return[{args:ke({collection:Ca(J,"The content collection the entry is created in.")}),category:"File",id:"content.newEntry",level:"project",menus:["palette"],group:"1_file",requires:"a project with a directory-backed content collection",when:(e)=>e.project.open,enablement:()=>J().length>0,undo:"project",run:async(e,r)=>{let t=J();await Ww(di("content.newEntry",r,"collection",t))},title:"New Entry"},{args:ke({path:He("Project-relative path of the entry file to open.")}),category:"File",id:"content.openEntry",level:"project",menus:["context/file","palette"],group:"1_file",requires:"an open project",when:(e)=>e.project.open,run:async(e,r)=>{await W(rt("content.openEntry",r,"path"))},title:"Open Entry Form"},{args:ke({draft:sr("True marks the open entry a draft; false marks it published. Written as a `draft` field on the entry.")}),category:"Document",id:"content.setDraft",level:"document",menus:["context/tab","palette"],group:"3_document",requires:"a content entry open",when:(e)=>e.document.open,enablement:()=>he()!==null,undo:"document",run:(e,r)=>{let t=he();if(!t)throw Error("content.setDraft: the active document is not a content entry");_(t,xi("content.setDraft",r,"draft"))},title:"Set Draft"},{args:ke({include:sr("True lists entries marked `draft: true` alongside the rest.")}),category:"View",id:"content.setIncludeDrafts",level:"project",menus:["palette"],group:"2_view",requires:"an open project",when:(e)=>e.project.open,run:async(e,r)=>{tT(xi("content.setIncludeDrafts",r,"include")),await qS()},title:"Include Drafts"}]}function AS(e){e.registerAll(Ye())}
|
|
2
|
+
export{Hw,Bw,im,Sc,Ws,NS,rm,OS,Sb,FE,jE,Ww,AS};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=079FB09F00ABCA9364756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-z16sgavc.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{ae}from"./studio-pre0skq6.js";var it=ae(function(Br){Object.defineProperty(Br,"__esModule",{value:!0});Br.regexpCode=Br.getEsmExportName=Br.getProperty=Br.safeStringify=Br.stringify=Br.strConcat=Br.addCodeArg=Br.str=Br._=Br.nil=Br._Code=Br.Name=Br.IDENTIFIER=Br._CodeOrName=void 0;class pt{}Br._CodeOrName=pt;Br.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Ve extends pt{constructor(e){super();if(!Br.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}Br.Name=Ve;class Y extends pt{constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,r)=>`${t}${r}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,r)=>{if(r instanceof Ve)t[r.str]=(t[r.str]||0)+1;return t},{})}}Br._Code=Y;Br.nil=new Y("");function Gr(e,...t){let r=[e[0]],s=0;while(s<t.length)sr(r,t[s]),r.push(e[++s]);return new Y(r)}Br._=Gr;var rr=new Y("+");function Jr(e,...t){let r=[ot(e[0])],s=0;while(s<t.length)r.push(rr),sr(r,t[s]),r.push(rr,ot(e[++s]));return Na(r),new Y(r)}Br.str=Jr;function sr(e,t){if(t instanceof Y)e.push(...t._items);else if(t instanceof Ve)e.push(t);else e.push(Ia(t))}Br.addCodeArg=sr;function Na(e){let t=1;while(t<e.length-1){if(e[t]===rr){let r=Ra(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function Ra(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof Ve||e[e.length-1]!=='"')return;if(typeof t!="string")return`${e.slice(0,-1)}${t}"`;if(t[0]==='"')return e.slice(0,-1)+t.slice(1);return}if(typeof t=="string"&&t[0]==='"'&&!(e instanceof Ve))return`"${e}${t.slice(1)}`;return}function qa(e,t){return t.emptyStr()?e:e.emptyStr()?t:Jr`${e}${t}`}Br.strConcat=qa;function Ia(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:ot(Array.isArray(e)?e.join(","):e)}function ja(e){return new Y(ot(e))}Br.stringify=ja;function ot(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Br.safeStringify=ot;function Ta(e){return typeof e=="string"&&Br.IDENTIFIER.test(e)?new Y(`.${e}`):Gr`[${e}]`}Br.getProperty=Ta;function Ca(e){if(typeof e=="string"&&Br.IDENTIFIER.test(e))return new Y(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}Br.getEsmExportName=Ca;function Da(e){return new Y(e.toString())}Br.regexpCode=Da});var ar=ae(function(Xr){Object.defineProperty(Xr,"__esModule",{value:!0});Xr.ValueScope=Xr.ValueScopeName=Xr.Scope=Xr.varKinds=Xr.UsedValueState=void 0;var T=it();class Qr extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var yt;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(yt||(Xr.UsedValueState=yt={}));Xr.varKinds={const:new T.Name("const"),let:new T.Name("let"),var:new T.Name("var")};class or{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof T.Name?e:this.name(e)}name(e){return new T.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if(((r=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||r===void 0?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}Xr.Scope=or;class ir extends T.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=T._`.${new T.Name(t)}[${r}]`}}Xr.ValueScopeName=ir;var Wa=T._`\n`;class Zr extends or{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Wa:T.nil}}get(){return this._scope}name(e){return new ir(e,this._newName(e))}value(e,t){var r;if(t.ref===void 0)throw Error("CodeGen: ref must be passed in value");let s=this.toName(e),{prefix:n}=s,o=(r=t.key)!==null&&r!==void 0?r:t.ref,i=this._values[n];if(i){let u=i.get(o);if(u)return u}else i=this._values[n]=new Map;i.set(o,s);let a=this._scope[n]||(this._scope[n]=[]),c=a.length;return a[c]=t.ref,s.setValue(t,{property:n,itemIndex:c}),s}getValue(e,t){let r=this._values[e];if(!r)return;return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(r)=>{if(r.scopePath===void 0)throw Error(`CodeGen: name "${r}" has no value`);return T._`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,(s)=>{if(s.value===void 0)throw Error(`CodeGen: name "${s}" has no value`);return s.value.code},t,r)}_reduceValues(e,t,r={},s){let n=T.nil;for(let o in e){let i=e[o];if(!i)continue;let a=r[o]=r[o]||new Map;i.forEach((c)=>{if(a.has(c))return;a.set(c,yt.Started);let u=t(c);if(u){let l=this.opts.es5?Xr.varKinds.var:Xr.varKinds.const;n=T._`${n}${l} ${c} = ${u};${this.opts._n}`}else if(u=s===null||s===void 0?void 0:s(c))n=T._`${n}${u}${this.opts._n}`;else throw new Qr(c);a.set(c,yt.Completed)})}return n}}Xr.ValueScope=Zr});var Dt=ae(function(L){Object.defineProperty(L,"__esModule",{value:!0});L.or=L.and=L.not=L.CodeGen=L.operators=L.varKinds=L.ValueScopeName=L.ValueScope=L.Scope=L.Name=L.regexpCode=L.stringify=L.getProperty=L.nil=L.strConcat=L.str=L._=void 0;var w=it(),A=ar(),ye=it();Object.defineProperty(L,"_",{enumerable:!0,get:function(){return ye._}});Object.defineProperty(L,"str",{enumerable:!0,get:function(){return ye.str}});Object.defineProperty(L,"strConcat",{enumerable:!0,get:function(){return ye.strConcat}});Object.defineProperty(L,"nil",{enumerable:!0,get:function(){return ye.nil}});Object.defineProperty(L,"getProperty",{enumerable:!0,get:function(){return ye.getProperty}});Object.defineProperty(L,"stringify",{enumerable:!0,get:function(){return ye.stringify}});Object.defineProperty(L,"regexpCode",{enumerable:!0,get:function(){return ye.regexpCode}});Object.defineProperty(L,"Name",{enumerable:!0,get:function(){return ye.Name}});var Et=ar();Object.defineProperty(L,"Scope",{enumerable:!0,get:function(){return Et.Scope}});Object.defineProperty(L,"ValueScope",{enumerable:!0,get:function(){return Et.ValueScope}});Object.defineProperty(L,"ValueScopeName",{enumerable:!0,get:function(){return Et.ValueScopeName}});Object.defineProperty(L,"varKinds",{enumerable:!0,get:function(){return Et.varKinds}});L.operators={GT:new w._Code(">"),GTE:new w._Code(">="),LT:new w._Code("<"),LTE:new w._Code("<="),EQ:new w._Code("==="),NEQ:new w._Code("!=="),NOT:new w._Code("!"),OR:new w._Code("||"),AND:new w._Code("&&"),ADD:new w._Code("+")};class _e{optimizeNodes(){return this}optimizeNames(e,t){return this}}class es extends _e{constructor(e,t,r){super();this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?A.varKinds.var:this.varKind,s=this.rhs===void 0?"":` = ${this.rhs}`;return`${r} ${this.name}${s};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=Ue(this.rhs,e,t);return this}get names(){return this.rhs instanceof w._CodeOrName?this.rhs.names:{}}}class lr extends _e{constructor(e,t,r){super();this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof w.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=Ue(this.rhs,e,t),this}get names(){let e=this.lhs instanceof w.Name?{}:{...this.lhs.names};return wt(e,this.rhs)}}class ts extends lr{constructor(e,t,r,s){super(e,r,s);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class rs extends _e{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class ss extends _e{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class ns extends _e{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class os extends _e{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=Ue(this.code,e,t),this}get names(){return this.code instanceof w._CodeOrName?this.code.names:{}}}class bt extends _e{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;while(t--){let r=e[t].optimizeNodes();if(Array.isArray(r))e.splice(t,1,...r);else if(r)e[t]=r;else e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,s=r.length;while(s--){let n=r[s];if(n.optimizeNames(e,t))continue;Ya(e,n.names),r.splice(s,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>Te(e,t.names),{})}}class ge extends bt{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class is extends bt{}class at extends ge{}at.kind="else";class pe extends ge{constructor(e,t){super(t);this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);if(this.else)t+="else "+this.else.render(e);return t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let r=t.optimizeNodes();t=this.else=Array.isArray(r)?new at(r):r}if(t){if(e===!1)return t instanceof pe?t:t.nodes;if(this.nodes.length)return this;return new pe(ds(e),t instanceof pe?[t]:t.nodes)}if(e===!1||!this.nodes.length)return;return this}optimizeNames(e,t){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,t),!(super.optimizeNames(e,t)||this.else))return;return this.condition=Ue(this.condition,e,t),this}get names(){let e=super.names;if(wt(e,this.condition),this.else)Te(e,this.else.names);return e}}pe.kind="if";class ze extends ge{}ze.kind="for";class as extends ze{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iteration=Ue(this.iteration,e,t),this}get names(){return Te(super.names,this.iteration.names)}}class cs extends ze{constructor(e,t,r,s){super();this.varKind=e,this.name=t,this.from=r,this.to=s}render(e){let t=e.es5?A.varKinds.var:this.varKind,{name:r,from:s,to:n}=this;return`for(${t} ${r}=${s}; ${r}<${n}; ${r}++)`+super.render(e)}get names(){let e=wt(super.names,this.from);return wt(e,this.to)}}class cr extends ze{constructor(e,t,r,s){super();this.loop=e,this.varKind=t,this.name=r,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iterable=Ue(this.iterable,e,t),this}get names(){return Te(super.names,this.iterable.names)}}class _t extends ge{constructor(e,t,r){super();this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}_t.kind="func";class gt extends bt{render(e){return"return "+super.render(e)}}gt.kind="return";class us extends ge{render(e){let t="try"+super.render(e);if(this.catch)t+=this.catch.render(e);if(this.finally)t+=this.finally.render(e);return t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var r,s;return super.optimizeNames(e,t),(r=this.catch)===null||r===void 0||r.optimizeNames(e,t),(s=this.finally)===null||s===void 0||s.optimizeNames(e,t),this}get names(){let e=super.names;if(this.catch)Te(e,this.catch.names);if(this.finally)Te(e,this.finally.names);return e}}class $t extends ge{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}$t.kind="catch";class vt extends ge{render(e){return"finally"+super.render(e)}}vt.kind="finally";class ls{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
2
|
+
`:""},this._extScope=e,this._scope=new A.Scope({parent:e}),this._nodes=[new is]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,s){let n=this._scope.toName(t);if(r!==void 0&&s)this._constants[n.str]=r;return this._leafNode(new es(e,n,r)),n}const(e,t,r){return this._def(A.varKinds.const,e,t,r)}let(e,t,r){return this._def(A.varKinds.let,e,t,r)}var(e,t,r){return this._def(A.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new lr(e,t,r))}add(e,t){return this._leafNode(new ts(e,L.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==w.nil)this._leafNode(new os(e));return this}object(...e){let t=["{"];for(let[r,s]of e){if(t.length>1)t.push(",");if(t.push(r),r!==s||this.opts.es5)t.push(":"),w.addCodeArg(t,s)}return t.push("}"),new w._Code(t)}if(e,t,r){if(this._blockNode(new pe(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new pe(e))}else(){return this._elseNode(new at)}endIf(){return this._endBlockNode(pe,at)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new as(e),t)}forRange(e,t,r,s,n=this.opts.es5?A.varKinds.var:A.varKinds.let){let o=this._scope.toName(e);return this._for(new cs(n,o,t,r),()=>s(o))}forOf(e,t,r,s=A.varKinds.const){let n=this._scope.toName(e);if(this.opts.es5){let o=t instanceof w.Name?t:this.var("_arr",t);return this.forRange("_i",0,w._`${o}.length`,(i)=>{this.var(n,w._`${o}[${i}]`),r(n)})}return this._for(new cr("of",s,n,t),()=>r(n))}forIn(e,t,r,s=this.opts.es5?A.varKinds.var:A.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,w._`Object.keys(${t})`,r);let n=this._scope.toName(e);return this._for(new cr("in",s,n,t),()=>r(n))}endFor(){return this._endBlockNode(ze)}label(e){return this._leafNode(new rs(e))}break(e){return this._leafNode(new ss(e))}return(e){let t=new gt;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(gt)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let s=new us;if(this._blockNode(s),this.code(e),t){let n=this.name("e");this._currNode=s.catch=new $t(n),t(n)}if(r)this._currNode=s.finally=new vt,this.code(r);return this._endBlockNode($t,vt)}throw(e){return this._leafNode(new ns(e))}block(e,t){if(this._blockStarts.push(this._nodes.length),e)this.code(e).endBlock(t);return this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||e!==void 0&&r!==e)throw Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=w.nil,r,s){if(this._blockNode(new _t(e,t,r)),s)this.code(s).endFunc();return this}endFunc(){return this._endBlockNode(_t)}optimize(e=1){while(e-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof pe))throw Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}}L.CodeGen=ls;function Te(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function wt(e,t){return t instanceof w._CodeOrName?Te(e,t.names):e}function Ue(e,t,r){if(e instanceof w.Name)return s(e);if(!n(e))return e;return new w._Code(e._items.reduce((o,i)=>{if(i instanceof w.Name)i=s(i);if(i instanceof w._Code)o.push(...i._items);else o.push(i);return o},[]));function s(o){let i=r[o.str];if(i===void 0||t[o.str]!==1)return o;return delete t[o.str],i}function n(o){return o instanceof w._Code&&o._items.some((i)=>i instanceof w.Name&&t[i.str]===1&&r[i.str]!==void 0)}}function Ya(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function ds(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:w._`!${ur(e)}`}L.not=ds;var ec=fs(L.operators.AND);function tc(...e){return e.reduce(ec)}L.and=tc;var rc=fs(L.operators.OR);function sc(...e){return e.reduce(rc)}L.or=sc;function fs(e){return(t,r)=>t===w.nil?r:r===w.nil?t:w._`${ur(t)} ${e} ${ur(r)}`}function ur(e){return e instanceof w.Name?e:w._`(${e})`}});var on=ae(function(Es){Object.defineProperty(Es,"__esModule",{value:!0});Es.checkStrictMode=Es.getErrorPath=Es.Type=Es.useFunc=Es.setEvaluated=Es.evaluatedPropsToName=Es.mergeEvaluated=Es.eachItem=Es.unescapeJsonPointer=Es.escapeJsonPointer=Es.escapeFragment=Es.unescapeFragment=Es.schemaRefOrVal=Es.schemaHasRulesButRef=Es.schemaHasRules=Es.checkUnknownRules=Es.alwaysValidSchema=Es.toHash=void 0;var b=Dt(),ys=it();function ac(e){let t={};for(let r of e)t[r]=!0;return t}Es.toHash=ac;function cc(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return _s(e,t),!gs(t,e.self.RULES.all)}Es.alwaysValidSchema=cc;function _s(e,t=e.schema){let{opts:r,self:s}=e;if(!r.strictSchema)return;if(typeof t==="boolean")return;let n=s.RULES.keywords;for(let o in t)if(!n[o])ws(e,`unknown keyword: "${o}"`)}Es.checkUnknownRules=_s;function gs(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}Es.schemaHasRules=gs;function uc(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}Es.schemaHasRulesButRef=uc;function lc({topSchemaRef:e,schemaPath:t},r,s,n){if(!n){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return b._`${r}`}return b._`${e}${t}${b.getProperty(s)}`}Es.schemaRefOrVal=lc;function dc(e){return $s(decodeURIComponent(e))}Es.unescapeFragment=dc;function fc(e){return encodeURIComponent(fr(e))}Es.escapeFragment=fc;function fr(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}Es.escapeJsonPointer=fr;function $s(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}Es.unescapeJsonPointer=$s;function hc(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}Es.eachItem=hc;function ps({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:s}){return(n,o,i,a)=>{let c=i===void 0?o:i instanceof b.Name?(o instanceof b.Name?e(n,o,i):t(n,o,i),i):o instanceof b.Name?(t(n,i,o),o):r(o,i);return a===b.Name&&!(c instanceof b.Name)?s(n,c):c}}Es.mergeEvaluated={props:ps({mergeNames:(e,t,r)=>e.if(b._`${r} !== true && ${t} !== undefined`,()=>{e.if(b._`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,b._`${r} || {}`).code(b._`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if(b._`${r} !== true`,()=>{if(t===!0)e.assign(r,!0);else e.assign(r,b._`${r} || {}`),hr(e,r,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:vs}),items:ps({mergeNames:(e,t,r)=>e.if(b._`${r} !== true && ${t} !== undefined`,()=>e.assign(r,b._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if(b._`${r} !== true`,()=>e.assign(r,t===!0?!0:b._`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function vs(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",b._`{}`);if(t!==void 0)hr(e,r,t);return r}Es.evaluatedPropsToName=vs;function hr(e,t,r){Object.keys(r).forEach((s)=>e.assign(b._`${t}${b.getProperty(s)}`,!0))}Es.setEvaluated=hr;var ms={};function pc(e,t){return e.scopeValue("func",{ref:t,code:ms[t.code]||(ms[t.code]=new ys._Code(t.code))})}Es.useFunc=pc;var dr;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(dr||(Es.Type=dr={}));function mc(e,t,r){if(e instanceof b.Name){let s=t===dr.Num;return r?s?b._`"[" + ${e} + "]"`:b._`"['" + ${e} + "']"`:s?b._`"/" + ${e}`:b._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?b.getProperty(e).toString():"/"+fr(e)}Es.getErrorPath=mc;function ws(e,t,r=e.opts.strictSchema){if(!r)return;if(t=`strict mode: ${t}`,r===!0)throw Error(t);e.self.logger.warn(t)}Es.checkStrictMode=ws});var Pl=ae(function(Ss){Object.defineProperty(Ss,"__esModule",{value:!0});var q=Dt(),jc={data:new q.Name("data"),valCxt:new q.Name("valCxt"),instancePath:new q.Name("instancePath"),parentData:new q.Name("parentData"),parentDataProperty:new q.Name("parentDataProperty"),rootData:new q.Name("rootData"),dynamicAnchors:new q.Name("dynamicAnchors"),vErrors:new q.Name("vErrors"),errors:new q.Name("errors"),this:new q.Name("this"),self:new q.Name("self"),scope:new q.Name("scope"),json:new q.Name("json"),jsonPos:new q.Name("jsonPos"),jsonLen:new q.Name("jsonLen"),jsonPart:new q.Name("jsonPart")};Ss.default=jc});var ct=ae(function(ks){Object.defineProperty(ks,"__esModule",{value:!0});ks.extendErrors=ks.resetErrorsCount=ks.reportExtraError=ks.reportError=ks.keyword$DataError=ks.keywordError=void 0;var E=Dt(),$e=on(),H=Pl();ks.keywordError={message:({keyword:e})=>E.str`must pass "${e}" keyword validation`};ks.keyword$DataError={message:({keyword:e,schemaType:t})=>t?E.str`"${e}" keyword must be ${t} ($data)`:E.str`"${e}" keyword is invalid ($data)`};function Cc(e,t=ks.keywordError,r,s){let{it:n}=e,{gen:o,compositeRule:i,allErrors:a}=n,c=Os(e,t,r);if(s!==null&&s!==void 0?s:i||a)Ps(o,c);else xs(n,E._`[${c}]`)}ks.reportError=Cc;function Dc(e,t=ks.keywordError,r){let{it:s}=e,{gen:n,compositeRule:o,allErrors:i}=s,a=Os(e,t,r);if(Ps(n,a),!(o||i))xs(s,H.default.vErrors)}ks.reportExtraError=Dc;function Ac(e,t){e.assign(H.default.errors,t),e.if(E._`${H.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(E._`${H.default.vErrors}.length`,t),()=>e.assign(H.default.vErrors,null)))}ks.resetErrorsCount=Ac;function Mc({gen:e,keyword:t,schemaValue:r,data:s,errsCount:n,it:o}){if(n===void 0)throw Error("ajv implementation error");let i=e.name("err");e.forRange("i",n,H.default.errors,(a)=>{if(e.const(i,E._`${H.default.vErrors}[${a}]`),e.if(E._`${i}.instancePath === undefined`,()=>e.assign(E._`${i}.instancePath`,E.strConcat(H.default.instancePath,o.errorPath))),e.assign(E._`${i}.schemaPath`,E.str`${o.errSchemaPath}/${t}`),o.opts.verbose)e.assign(E._`${i}.schema`,r),e.assign(E._`${i}.data`,s)})}ks.extendErrors=Mc;function Ps(e,t){let r=e.const("err",t);e.if(E._`${H.default.vErrors} === null`,()=>e.assign(H.default.vErrors,E._`[${r}]`),E._`${H.default.vErrors}.push(${r})`),e.code(E._`${H.default.errors}++`)}function xs(e,t){let{gen:r,validateName:s,schemaEnv:n}=e;if(n.$async)r.throw(E._`new ${e.ValidationError}(${t})`);else r.assign(E._`${s}.errors`,t),r.return(!1)}var Ce={keyword:new E.Name("keyword"),schemaPath:new E.Name("schemaPath"),params:new E.Name("params"),propertyName:new E.Name("propertyName"),message:new E.Name("message"),schema:new E.Name("schema"),parentSchema:new E.Name("parentSchema")};function Os(e,t,r){let{createErrors:s}=e.it;if(s===!1)return E._`{}`;return Fc(e,t,r)}function Fc(e,t,r={}){let{gen:s,it:n}=e,o=[Vc(n,r),zc(e,r)];return Uc(e,t,o),s.object(...o)}function Vc({errorPath:e},{instancePath:t}){let r=t?E.str`${e}${$e.getErrorPath(t,$e.Type.Str)}`:e;return[H.default.instancePath,E.strConcat(H.default.instancePath,r)]}function zc({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:s}){let n=s?t:E.str`${t}/${e}`;if(r)n=E.str`${n}${$e.getErrorPath(r,$e.Type.Str)}`;return[Ce.schemaPath,n]}function Uc(e,{params:t,message:r},s){let{keyword:n,data:o,schemaValue:i,it:a}=e,{opts:c,propertyName:u,topSchemaRef:l,schemaPath:f}=a;if(s.push([Ce.keyword,n],[Ce.params,typeof t=="function"?t(e):t||E._`{}`]),c.messages)s.push([Ce.message,typeof r=="function"?r(e):r]);if(c.verbose)s.push([Ce.schema,i],[Ce.parentSchema,E._`${l}${f}`],[H.default.data,o]);if(u)s.push([Ce.propertyName,u])}});var Cs=ae(function(js){Object.defineProperty(js,"__esModule",{value:!0});js.boolOrEmptySchema=js.topBoolOrEmptySchema=void 0;var Rs=ct(),qs=Dt(),Jc=Pl(),Bc={message:"boolean schema is false"};function Wc(e){let{gen:t,schema:r,validateName:s}=e;if(r===!1)Is(e,!1);else if(typeof r=="object"&&r.$async===!0)t.return(Jc.default.data);else t.assign(qs._`${s}.errors`,null),t.return(!0)}js.topBoolOrEmptySchema=Wc;function Qc(e,t){let{gen:r,schema:s}=e;if(s===!1)r.var(t,!1),Is(e);else r.var(t,!0)}js.boolOrEmptySchema=Qc;function Is(e,t){let{gen:r,data:s}=e;Rs.reportError({gen:r,keyword:"false schema",data:s,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},Bc,void 0,t)}});var mr=ae(function(Ds){Object.defineProperty(Ds,"__esModule",{value:!0});Ds.getRules=Ds.isJSONType=void 0;var Xc=["string","number","integer","boolean","null","object","array"],Yc=new Set(Xc);function eu(e){return typeof e=="string"&&Yc.has(e)}Ds.isJSONType=eu;function tu(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}Ds.getRules=tu});var yr=ae(function(Vs){Object.defineProperty(Vs,"__esModule",{value:!0});Vs.shouldUseRule=Vs.shouldUseGroup=Vs.schemaHasRulesForType=void 0;function su({schema:e,self:t},r){let s=t.RULES.types[r];return s&&s!==!0&&Ms(e,s)}Vs.schemaHasRulesForType=su;function Ms(e,t){return t.rules.some((r)=>Fs(e,r))}Vs.shouldUseGroup=Ms;function Fs(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some((s)=>e[s]!==void 0))}Vs.shouldUseRule=Fs});var ut=ae(function(Js){Object.defineProperty(Js,"__esModule",{value:!0});Js.reportTypeError=Js.checkDataTypes=Js.checkDataType=Js.coerceAndCheckDataType=Js.getJSONTypes=Js.getSchemaTypes=Js.DataType=void 0;var Us=mr(),Ks=yr(),Hs=ct(),_=Dt(),Pt=on(),Ke;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Ke||(Js.DataType=Ke={}));function iu(e){let t=Ls(e.type);if(t.includes("null")){if(e.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(e.nullable===!0)t.push("null")}return t}Js.getSchemaTypes=iu;function Ls(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(Us.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}Js.getJSONTypes=Ls;function au(e,t){let{gen:r,data:s,opts:n}=e,o=cu(t,n.coerceTypes),i=t.length>0&&!(o.length===0&&t.length===1&&Ks.schemaHasRulesForType(e,t[0]));if(i){let a=gr(t,s,n.strictNumbers,Ke.Wrong);r.if(a,()=>{if(o.length)uu(e,t,o);else $r(e)})}return i}Js.coerceAndCheckDataType=au;var Gs=new Set(["string","number","integer","boolean","null"]);function cu(e,t){return t?e.filter((r)=>Gs.has(r)||t==="array"&&r==="array"):[]}function uu(e,t,r){let{gen:s,data:n,opts:o}=e,i=s.let("dataType",_._`typeof ${n}`),a=s.let("coerced",_._`undefined`);if(o.coerceTypes==="array")s.if(_._`${i} == 'object' && Array.isArray(${n}) && ${n}.length == 1`,()=>s.assign(n,_._`${n}[0]`).assign(i,_._`typeof ${n}`).if(gr(t,n,o.strictNumbers),()=>s.assign(a,n)));s.if(_._`${a} !== undefined`);for(let u of r)if(Gs.has(u)||u==="array"&&o.coerceTypes==="array")c(u);s.else(),$r(e),s.endIf(),s.if(_._`${a} !== undefined`,()=>{s.assign(n,a),lu(e,a)});function c(u){switch(u){case"string":s.elseIf(_._`${i} == "number" || ${i} == "boolean"`).assign(a,_._`"" + ${n}`).elseIf(_._`${n} === null`).assign(a,_._`""`);return;case"number":s.elseIf(_._`${i} == "boolean" || ${n} === null
|
|
3
|
+
|| (${i} == "string" && ${n} && ${n} == +${n})`).assign(a,_._`+${n}`);return;case"integer":s.elseIf(_._`${i} === "boolean" || ${n} === null
|
|
4
|
+
|| (${i} === "string" && ${n} && ${n} == +${n} && !(${n} % 1))`).assign(a,_._`+${n}`);return;case"boolean":s.elseIf(_._`${n} === "false" || ${n} === 0 || ${n} === null`).assign(a,!1).elseIf(_._`${n} === "true" || ${n} === 1`).assign(a,!0);return;case"null":s.elseIf(_._`${n} === "" || ${n} === 0 || ${n} === false`),s.assign(a,null);return;case"array":s.elseIf(_._`${i} === "string" || ${i} === "number"
|
|
5
|
+
|| ${i} === "boolean" || ${n} === null`).assign(a,_._`[${n}]`)}}}function lu({gen:e,parentData:t,parentDataProperty:r},s){e.if(_._`${t} !== undefined`,()=>e.assign(_._`${t}[${r}]`,s))}function _r(e,t,r,s=Ke.Correct){let n=s===Ke.Correct?_.operators.EQ:_.operators.NEQ,o;switch(e){case"null":return _._`${t} ${n} null`;case"array":o=_._`Array.isArray(${t})`;break;case"object":o=_._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=i(_._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=i();break;default:return _._`typeof ${t} ${n} ${e}`}return s===Ke.Correct?o:_.not(o);function i(a=_.nil){return _.and(_._`typeof ${t} == "number"`,a,r?_._`isFinite(${t})`:_.nil)}}Js.checkDataType=_r;function gr(e,t,r,s){if(e.length===1)return _r(e[0],t,r,s);let n,o=Pt.toHash(e);if(o.array&&o.object){let i=_._`typeof ${t} != "object"`;n=o.null?i:_._`!${t} || ${i}`,delete o.null,delete o.array,delete o.object}else n=_.nil;if(o.number)delete o.integer;for(let i in o)n=_.and(n,_r(i,t,r,s));return n}Js.checkDataTypes=gr;var du={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?_._`{type: ${e}}`:_._`{type: ${t}}`};function $r(e){let t=fu(e);Hs.reportError(t,du)}Js.reportTypeError=$r;function fu(e){let{gen:t,data:r,schema:s}=e,n=Pt.schemaRefOrVal(e,s,"type");return{gen:t,keyword:"type",data:r,schema:s.type,schemaCode:n,schemaValue:n,parentSchema:s,params:{},it:e}}});var Ys=ae(function(Zs){Object.defineProperty(Zs,"__esModule",{value:!0});Zs.assignDefaults=void 0;var W=Dt(),Qs=on();function $u(e,t){let{properties:r,items:s}=e.schema;if(t==="object"&&r)for(let n in r)Ws(e,n,r[n].default);else if(t==="array"&&Array.isArray(s))s.forEach((n,o)=>Ws(e,o,n.default))}Zs.assignDefaults=$u;function Ws(e,t,r){let{gen:s,compositeRule:n,data:o,opts:i}=e;if(r===void 0)return;let a=W._`${o}${W.getProperty(t)}`;if(n){Qs.checkStrictMode(e,`default is ignored for: ${a}`);return}let c=W._`${a} === undefined`;if(i.useDefaults==="empty")c=W._`${c} || ${a} === null || ${a} === ""`;s.if(c,W._`${a} = ${W.stringify(r)}`)}});var Q=ae(function(sn){Object.defineProperty(sn,"__esModule",{value:!0});sn.validateUnion=sn.validateArray=sn.usePattern=sn.callValidateCode=sn.schemaProperties=sn.allSchemaProperties=sn.noPropertyInData=sn.propertyInData=sn.isOwnProperty=sn.hasPropFunc=sn.reportMissingProp=sn.checkMissingProp=sn.checkReportMissingProp=void 0;var S=Dt(),He=on(),ve=Pl(),en=on();function vu(e,t){let{gen:r,data:s,it:n}=e;r.if(wr(r,s,t,n.opts.ownProperties),()=>{e.setParams({missingProperty:S._`${t}`},!0),e.error()})}sn.checkReportMissingProp=vu;function wu({gen:e,data:t,it:{opts:r}},s,n){return S.or(...s.map((o)=>S.and(wr(e,t,o,r.ownProperties),S._`${n} = ${o}`)))}sn.checkMissingProp=wu;function Eu(e,t){e.setParams({missingProperty:t},!0),e.error()}sn.reportMissingProp=Eu;function tn(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:S._`Object.prototype.hasOwnProperty`})}sn.hasPropFunc=tn;function vr(e,t,r){return S._`${tn(e)}.call(${t}, ${r})`}sn.isOwnProperty=vr;function bu(e,t,r,s){let n=S._`${t}${S.getProperty(r)} !== undefined`;return s?S._`${n} && ${vr(e,t,r)}`:n}sn.propertyInData=bu;function wr(e,t,r,s){let n=S._`${t}${S.getProperty(r)} === undefined`;return s?S.or(n,S.not(vr(e,t,r))):n}sn.noPropertyInData=wr;function rn(e){return e?Object.keys(e).filter((t)=>t!=="__proto__"):[]}sn.allSchemaProperties=rn;function Su(e,t){return rn(t).filter((r)=>!He.alwaysValidSchema(e,t[r]))}sn.schemaProperties=Su;function Pu({schemaCode:e,data:t,it:{gen:r,topSchemaRef:s,schemaPath:n,errorPath:o},it:i},a,c,u){let l=u?S._`${e}, ${t}, ${s}${n}`:t,f=[[ve.default.instancePath,S.strConcat(ve.default.instancePath,o)],[ve.default.parentData,i.parentData],[ve.default.parentDataProperty,i.parentDataProperty],[ve.default.rootData,ve.default.rootData]];if(i.opts.dynamicRef)f.push([ve.default.dynamicAnchors,ve.default.dynamicAnchors]);let g=S._`${l}, ${r.object(...f)}`;return c!==S.nil?S._`${a}.call(${c}, ${g})`:S._`${a}(${g})`}sn.callValidateCode=Pu;var xu=S._`new RegExp`;function Ou({gen:e,it:{opts:t}},r){let s=t.unicodeRegExp?"u":"",{regExp:n}=t.code,o=n(r,s);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:S._`${n.code==="new RegExp"?xu:en.useFunc(e,n)}(${r}, ${s})`})}sn.usePattern=Ou;function ku(e){let{gen:t,data:r,keyword:s,it:n}=e,o=t.name("valid");if(n.allErrors){let a=t.let("valid",!0);return i(()=>t.assign(a,!1)),a}return t.var(o,!0),i(()=>t.break()),o;function i(a){let c=t.const("len",S._`${r}.length`);t.forRange("i",0,c,(u)=>{e.subschema({keyword:s,dataProp:u,dataPropType:He.Type.Num},o),t.if(S.not(o),a)})}}sn.validateArray=ku;function Nu(e){let{gen:t,schema:r,keyword:s,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some((c)=>He.alwaysValidSchema(n,c))&&!n.opts.unevaluated)return;let i=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((c,u)=>{let l=e.subschema({keyword:s,schemaProp:u,compositeRule:!0},a);if(t.assign(i,S._`${i} || ${a}`),!e.mergeValidEvaluated(l,a))t.if(S.not(i))})),e.result(i,()=>e.reset(),()=>e.error(!0))}sn.validateUnion=Nu});var hn=ae(function(dn){Object.defineProperty(dn,"__esModule",{value:!0});dn.validateKeywordUsage=dn.validSchemaType=dn.funcKeywordCode=dn.macroKeywordCode=void 0;var I=Dt(),De=Pl(),cn=Q(),un=ct();function Uu(e,t){let{gen:r,keyword:s,schema:n,parentSchema:o,it:i}=e,a=t.macro.call(i.self,n,o,i),c=ln(r,s,a);if(i.opts.validateSchema!==!1)i.self.validateSchema(a,!0);let u=r.name("valid");e.subschema({schema:a,schemaPath:I.nil,errSchemaPath:`${i.errSchemaPath}/${s}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}dn.macroKeywordCode=Uu;function Ku(e,t){var r;let{gen:s,keyword:n,schema:o,parentSchema:i,$data:a,it:c}=e;Lu(c,t);let u=!a&&t.compile?t.compile.call(c.self,o,i,c):t.validate,l=ln(s,n,u),f=s.let("valid");e.block$data(f,g),e.ok((r=t.valid)!==null&&r!==void 0?r:f);function g(){if(t.errors===!1){if(h(),t.modifying)an(e);m(()=>e.error())}else{let v=t.async?y():p();if(t.modifying)an(e);m(()=>Hu(e,v))}}function y(){let v=s.let("ruleErrs",null);return s.try(()=>h(I._`await `),(x)=>s.assign(f,!1).if(I._`${x} instanceof ${c.ValidationError}`,()=>s.assign(v,I._`${x}.errors`),()=>s.throw(x))),v}function p(){let v=I._`${l}.errors`;return s.assign(v,null),h(I.nil),v}function h(v=t.async?I._`await `:I.nil){let x=c.opts.passContext?De.default.this:De.default.self,O=!(("compile"in t)&&!a||t.schema===!1);s.assign(f,I._`${v}${cn.callValidateCode(e,l,x,O)}`,t.modifying)}function m(v){var x;s.if(I.not((x=t.valid)!==null&&x!==void 0?x:f),v)}}dn.funcKeywordCode=Ku;function an(e){let{gen:t,data:r,it:s}=e;t.if(s.parentData,()=>t.assign(r,I._`${s.parentData}[${s.parentDataProperty}]`))}function Hu(e,t){let{gen:r}=e;r.if(I._`Array.isArray(${t})`,()=>{r.assign(De.default.vErrors,I._`${De.default.vErrors} === null ? ${t} : ${De.default.vErrors}.concat(${t})`).assign(De.default.errors,I._`${De.default.vErrors}.length`),un.extendErrors(e)},()=>e.error())}function Lu({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}function ln(e,t,r){if(r===void 0)throw Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:I.stringify(r)})}function Gu(e,t,r=!1){return!t.length||t.some((s)=>s==="array"?Array.isArray(e):s==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==s||r&&typeof e>"u")}dn.validSchemaType=Gu;function Ju({schema:e,opts:t,self:r,errSchemaPath:s},n,o){if(Array.isArray(n.keyword)?!n.keyword.includes(o):n.keyword!==o)throw Error("ajv implementation error");let i=n.dependencies;if(i===null||i===void 0?void 0:i.some((a)=>!Object.prototype.hasOwnProperty.call(e,a)))throw Error(`parent schema must have dependencies of ${o}: ${i.join(",")}`);if(n.validateSchema){if(!n.validateSchema(e[o])){let c=`keyword "${o}" value is invalid at path "${s}": `+r.errorsText(n.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw Error(c)}}}dn.validateKeywordUsage=Ju});var yn=ae(function(pn){Object.defineProperty(pn,"__esModule",{value:!0});pn.extendSubschemaMode=pn.extendSubschemaData=pn.getSubschema=void 0;var z=Dt(),xt=on();function Zu(e,{keyword:t,schemaProp:r,schema:s,schemaPath:n,errSchemaPath:o,topSchemaRef:i}){if(t!==void 0&&s!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let a=e.schema[t];return r===void 0?{schema:a,schemaPath:z._`${e.schemaPath}${z.getProperty(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:z._`${e.schemaPath}${z.getProperty(t)}${z.getProperty(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${xt.escapeFragment(r)}`}}if(s!==void 0){if(n===void 0||o===void 0||i===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:s,schemaPath:n,topSchemaRef:i,errSchemaPath:o}}throw Error('either "keyword" or "schema" must be passed')}pn.getSubschema=Zu;function Xu(e,t,{dataProp:r,dataPropType:s,data:n,dataTypes:o,propertyName:i}){if(n!==void 0&&r!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=t;if(r!==void 0){let{errorPath:u,dataPathArr:l,opts:f}=t,g=a.let("data",z._`${t.data}${z.getProperty(r)}`,!0);c(g),e.errorPath=z.str`${u}${xt.getErrorPath(r,s,f.jsPropertySyntax)}`,e.parentDataProperty=z._`${r}`,e.dataPathArr=[...l,e.parentDataProperty]}if(n!==void 0){let u=n instanceof z.Name?n:a.let("data",n,!0);if(c(u),i!==void 0)e.propertyName=i}if(o)e.dataTypes=o;function c(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}pn.extendSubschemaData=Xu;function Yu(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:s,createErrors:n,allErrors:o}){if(s!==void 0)e.compositeRule=s;if(n!==void 0)e.createErrors=n;if(o!==void 0)e.allErrors=o;e.jtdDiscriminator=t,e.jtdMetadata=r}pn.extendSubschemaMode=Yu});var Er=ae(function(mm,_n){_n.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var s,n,o;if(Array.isArray(t)){if(s=t.length,s!=r.length)return!1;for(n=s;n--!==0;)if(!e(t[n],r[n]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),s=o.length,s!==Object.keys(r).length)return!1;for(n=s;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[n]))return!1;for(n=s;n--!==0;){var i=o[n];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r}});var $n=ae(function(ym,gn){var we=gn.exports=function(e,t,r){if(typeof t=="function")r=t,t={};r=t.cb||r;var s=typeof r=="function"?r:r.pre||function(){},n=r.post||function(){};Ot(t,s,n,e,"",e)};we.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};we.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};we.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};we.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Ot(e,t,r,s,n,o,i,a,c,u){if(s&&typeof s=="object"&&!Array.isArray(s)){t(s,n,o,i,a,c,u);for(var l in s){var f=s[l];if(Array.isArray(f)){if(l in we.arrayKeywords)for(var g=0;g<f.length;g++)Ot(e,t,r,f[g],n+"/"+l+"/"+g,o,n,l,s,g)}else if(l in we.propsKeywords){if(f&&typeof f=="object")for(var y in f)Ot(e,t,r,f[y],n+"/"+l+"/"+rl(y),o,n,l,s,y)}else if(l in we.keywords||e.allKeys&&!(l in we.skipKeywords))Ot(e,t,r,f,n+"/"+l,o,n,l,s)}r(s,n,o,i,a,c,u)}}function rl(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var lt=ae(function(Sn){Object.defineProperty(Sn,"__esModule",{value:!0});Sn.getSchemaRefs=Sn.resolveUrl=Sn.normalizeId=Sn._getFullPath=Sn.getFullPath=Sn.inlineRef=void 0;var vn=on(),sl=Er(),nl=$n(),ol=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function il(e,t=!0){if(typeof e=="boolean")return!0;if(t===!0)return!br(e);if(!t)return!1;return wn(e)<=t}Sn.inlineRef=il;var al=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function br(e){for(let t in e){if(al.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(br))return!0;if(typeof r=="object"&&br(r))return!0}return!1}function wn(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,ol.has(r))continue;if(typeof e[r]=="object")vn.eachItem(e[r],(s)=>t+=wn(s));if(t===1/0)return 1/0}return t}function En(e,t="",r){if(r!==!1)t=Le(t);let s=e.parse(t);return bn(e,s)}Sn.getFullPath=En;function bn(e,t){return e.serialize(t).split("#")[0]+"#"}Sn._getFullPath=bn;var cl=/#\/?$/;function Le(e){return e?e.replace(cl,""):""}Sn.normalizeId=Le;function ul(e,t,r){return r=Le(r),e.resolve(t,r)}Sn.resolveUrl=ul;var ll=/^[a-z_][-a-z0-9._]*$/i;function dl(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:s}=this.opts,n=Le(e[r]||t),o={"":n},i=En(s,n,!1),a={},c=new Set;return nl(e,{allKeys:!0},(f,g,y,p)=>{if(p===void 0)return;let h=i+g,m=o[p];if(typeof f[r]=="string")m=v.call(this,f[r]);x.call(this,f.$anchor),x.call(this,f.$dynamicAnchor),o[g]=m;function v(O){let j=this.opts.uriResolver.resolve;if(O=Le(m?j(m,O):O),c.has(O))throw l(O);c.add(O);let k=this.refs[O];if(typeof k=="string")k=this.refs[k];if(typeof k=="object")u(f,k.schema,O);else if(O!==Le(h))if(O[0]==="#")u(f,a[O],O),a[O]=f;else this.refs[O]=h;return O}function x(O){if(typeof O=="string"){if(!ll.test(O))throw Error(`invalid anchor "${O}"`);v.call(this,`#${O}`)}}}),a;function u(f,g,y){if(g!==void 0&&!sl(f,g))throw l(y)}function l(f){return Error(`reference "${f}" resolves to more than one schema`)}}Sn.getSchemaRefs=dl});var Mf=ae(function(Vn){Object.defineProperty(Vn,"__esModule",{value:!0});Vn.getData=Vn.KeywordCxt=Vn.validateFunctionCode=void 0;var Nt=Cs(),kt=ut(),Je=yr(),Ee=ut(),Nn=Ys(),re=hn(),Ge=yn(),d=Dt(),P=Pl(),Rn=lt(),U=on(),te=ct();function _l(e){if(jn(e)){if(Tn(e),In(e)){vl(e);return}}qn(e,()=>Nt.topBoolOrEmptySchema(e))}Vn.validateFunctionCode=_l;function qn({gen:e,validateName:t,schema:r,schemaEnv:s,opts:n},o){if(n.code.es5)e.func(t,d._`${P.default.data}, ${P.default.valCxt}`,s.$async,()=>{e.code(d._`"use strict"; ${xn(r,n)}`),$l(e,n),e.code(o)});else e.func(t,d._`${P.default.data}, ${gl(n)}`,s.$async,()=>e.code(xn(r,n)).code(o))}function gl(e){return d._`{${P.default.instancePath}="", ${P.default.parentData}, ${P.default.parentDataProperty}, ${P.default.rootData}=${P.default.data}${e.dynamicRef?d._`, ${P.default.dynamicAnchors}={}`:d.nil}}={}`}function $l(e,t){e.if(P.default.valCxt,()=>{if(e.var(P.default.instancePath,d._`${P.default.valCxt}.${P.default.instancePath}`),e.var(P.default.parentData,d._`${P.default.valCxt}.${P.default.parentData}`),e.var(P.default.parentDataProperty,d._`${P.default.valCxt}.${P.default.parentDataProperty}`),e.var(P.default.rootData,d._`${P.default.valCxt}.${P.default.rootData}`),t.dynamicRef)e.var(P.default.dynamicAnchors,d._`${P.default.valCxt}.${P.default.dynamicAnchors}`)},()=>{if(e.var(P.default.instancePath,d._`""`),e.var(P.default.parentData,d._`undefined`),e.var(P.default.parentDataProperty,d._`undefined`),e.var(P.default.rootData,P.default.data),t.dynamicRef)e.var(P.default.dynamicAnchors,d._`{}`)})}function vl(e){let{schema:t,opts:r,gen:s}=e;qn(e,()=>{if(r.$comment&&t.$comment)Dn(e);if(xl(e),s.let(P.default.vErrors,null),s.let(P.default.errors,0),r.unevaluated)wl(e);Cn(e),Nl(e)});return}function wl(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",d._`${r}.evaluated`),t.if(d._`${e.evaluated}.dynamicProps`,()=>t.assign(d._`${e.evaluated}.props`,d._`undefined`)),t.if(d._`${e.evaluated}.dynamicItems`,()=>t.assign(d._`${e.evaluated}.items`,d._`undefined`))}function xn(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?d._`/*# sourceURL=${r} */`:d.nil}function El(e,t){if(jn(e)){if(Tn(e),In(e)){bl(e,t);return}}Nt.boolOrEmptySchema(e,t)}function In({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function jn(e){return typeof e.schema!="boolean"}function bl(e,t){let{schema:r,gen:s,opts:n}=e;if(n.$comment&&r.$comment)Dn(e);Ol(e),kl(e);let o=s.const("_errs",P.default.errors);Cn(e,o),s.var(t,d._`${o} === ${P.default.errors}`)}function Tn(e){U.checkUnknownRules(e),Sl(e)}function Cn(e,t){if(e.opts.jtd)return On(e,[],!1,t);let r=kt.getSchemaTypes(e.schema),s=kt.coerceAndCheckDataType(e,r);On(e,r,!s,t)}function Sl(e){let{schema:t,errSchemaPath:r,opts:s,self:n}=e;if(t.$ref&&s.ignoreKeywordsWithRef&&U.schemaHasRulesButRef(t,n.RULES))n.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function xl(e){let{schema:t,opts:r}=e;if(t.default!==void 0&&r.useDefaults&&r.strictSchema)U.checkStrictMode(e,"default is ignored in the schema root")}function Ol(e){let t=e.schema[e.opts.schemaId];if(t)e.baseId=Rn.resolveUrl(e.opts.uriResolver,e.baseId,t)}function kl(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}function Dn({gen:e,schemaEnv:t,schema:r,errSchemaPath:s,opts:n}){let o=r.$comment;if(n.$comment===!0)e.code(d._`${P.default.self}.logger.log(${o})`);else if(typeof n.$comment=="function"){let i=d.str`${s}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code(d._`${P.default.self}.opts.$comment(${o}, ${i}, ${a}.schema)`)}}function Nl(e){let{gen:t,schemaEnv:r,validateName:s,ValidationError:n,opts:o}=e;if(r.$async)t.if(d._`${P.default.errors} === 0`,()=>t.return(P.default.data),()=>t.throw(d._`new ${n}(${P.default.vErrors})`));else{if(t.assign(d._`${s}.errors`,P.default.vErrors),o.unevaluated)Rl(e);t.return(d._`${P.default.errors} === 0`)}}function Rl({gen:e,evaluated:t,props:r,items:s}){if(r instanceof d.Name)e.assign(d._`${t}.props`,r);if(s instanceof d.Name)e.assign(d._`${t}.items`,s)}function On(e,t,r,s){let{gen:n,schema:o,data:i,allErrors:a,opts:c,self:u}=e,{RULES:l}=u;if(o.$ref&&(c.ignoreKeywordsWithRef||!U.schemaHasRulesButRef(o,l))){n.block(()=>Mn(e,"$ref",l.all.$ref.definition));return}if(!c.jtd)ql(e,t);n.block(()=>{for(let g of l.rules)f(g);f(l.post)});function f(g){if(!Je.shouldUseGroup(o,g))return;if(g.type){if(n.if(Ee.checkDataType(g.type,i,c.strictNumbers)),kn(e,g),t.length===1&&t[0]===g.type&&r)n.else(),Ee.reportTypeError(e);n.endIf()}else kn(e,g);if(!a)n.if(d._`${P.default.errors} === ${s||0}`)}}function kn(e,t){let{gen:r,schema:s,opts:{useDefaults:n}}=e;if(n)Nn.assignDefaults(e,t.type);r.block(()=>{for(let o of t.rules)if(Je.shouldUseRule(s,o))Mn(e,o.keyword,o.definition,t.type)})}function ql(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;if(Il(e,t),!e.opts.allowUnionTypes)jl(e,t);Tl(e,e.dataTypes)}function Il(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((r)=>{if(!An(e.dataTypes,r))Sr(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),Dl(e,t)}function jl(e,t){if(t.length>1&&!(t.length===2&&t.includes("null")))Sr(e,"use allowUnionTypes to allow union type keyword")}function Tl(e,t){let r=e.self.RULES.all;for(let s in r){let n=r[s];if(typeof n=="object"&&Je.shouldUseRule(e.schema,n)){let{type:o}=n.definition;if(o.length&&!o.some((i)=>Cl(t,i)))Sr(e,`missing type "${o.join(",")}" for keyword "${s}"`)}}}function Cl(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function An(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function Dl(e,t){let r=[];for(let s of e.dataTypes)if(An(t,s))r.push(s);else if(t.includes("integer")&&s==="number")r.push("integer");e.dataTypes=r}function Sr(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,U.checkStrictMode(e,t,e.opts.strictTypes)}class Pr{constructor(e,t,r){if(re.validateKeywordUsage(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=U.schemaRefOrVal(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",Fn(this.$data,e));else if(this.schemaCode=this.schemaValue,!re.validSchemaType(this.schema,t.schemaType,t.allowUndefined))throw Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);if("code"in t?t.trackErrors:t.errors!==!1)this.errsCount=e.gen.const("_errs",P.default.errors)}result(e,t,r){this.failResult(d.not(e),t,r)}failResult(e,t,r){if(this.gen.if(e),r)r();else this.error();if(t){if(this.gen.else(),t(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(e,t){this.failResult(d.not(e),void 0,t)}fail(e){if(e===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(e),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail(d._`${t} !== undefined && (${d.or(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?te.reportExtraError:te.reportError)(this,this.def.error,t)}$dataError(){te.reportError(this,this.def.$dataError||te.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');te.resetErrorsCount(this.gen,this.errsCount)}ok(e){if(!this.allErrors)this.gen.if(e)}setParams(e,t){if(t)Object.assign(this.params,e);else this.params=e}block$data(e,t,r=d.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=d.nil,t=d.nil){if(!this.$data)return;let{gen:r,schemaCode:s,schemaType:n,def:o}=this;if(r.if(d.or(d._`${s} === undefined`,t)),e!==d.nil)r.assign(e,!0);if(n.length||o.validateSchema){if(r.elseIf(this.invalid$data()),this.$dataError(),e!==d.nil)r.assign(e,!1)}r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:s,it:n}=this;return d.or(o(),i());function o(){if(r.length){if(!(t instanceof d.Name))throw Error("ajv implementation error");let a=Array.isArray(r)?r:[r];return d._`${Ee.checkDataTypes(a,t,n.opts.strictNumbers,Ee.DataType.Wrong)}`}return d.nil}function i(){if(s.validateSchema){let a=e.scopeValue("validate$data",{ref:s.validateSchema});return d._`!${a}(${t})`}return d.nil}}subschema(e,t){let r=Ge.getSubschema(this.it,e);Ge.extendSubschemaData(r,this.it,e),Ge.extendSubschemaMode(r,e);let s={...this.it,...r,items:void 0,props:void 0};return El(s,t),s}mergeEvaluated(e,t){let{it:r,gen:s}=this;if(!r.opts.unevaluated)return;if(r.props!==!0&&e.props!==void 0)r.props=U.mergeEvaluated.props(s,e.props,r.props,t);if(r.items!==!0&&e.items!==void 0)r.items=U.mergeEvaluated.items(s,e.items,r.items,t)}mergeValidEvaluated(e,t){let{it:r,gen:s}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return s.if(t,()=>this.mergeEvaluated(e,d.Name)),!0}}Vn.KeywordCxt=Pr;function Mn(e,t,r,s){let n=new Pr(e,r,t);if("code"in r)r.code(n,s);else if(n.$data&&r.validate)re.funcKeywordCode(n,r);else if("macro"in r)re.macroKeywordCode(n,r);else if(r.compile||r.validate)re.funcKeywordCode(n,r)}var Al=/^\/(?:[^~]|~0|~1)*$/,Ml=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Fn(e,{dataLevel:t,dataNames:r,dataPathArr:s}){let n,o;if(e==="")return P.default.rootData;if(e[0]==="/"){if(!Al.test(e))throw Error(`Invalid JSON-pointer: ${e}`);n=e,o=P.default.rootData}else{let u=Ml.exec(e);if(!u)throw Error(`Invalid JSON-pointer: ${e}`);let l=+u[1];if(n=u[2],n==="#"){if(l>=t)throw Error(c("property/index",l));return s[t-l]}if(l>t)throw Error(c("data",l));if(o=r[t-l],!n)return o}let i=o,a=n.split("/");for(let u of a)if(u)o=d._`${o}${d.getProperty(U.unescapeJsonPointer(u))}`,i=d._`${i} && ${o}`;return i;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${t}`}}Vn.getData=Fn});var Yg=ae(function(Kn){Object.defineProperty(Kn,"__esModule",{value:!0});class Un extends Error{constructor(e){super("validation failed");this.errors=e,this.ajv=this.validation=!0}}Kn.default=Un});var Ff=ae(function(Ln){Object.defineProperty(Ln,"__esModule",{value:!0});var Be=lt();class Hn extends Error{constructor(e,t,r,s){super(s||`can't resolve reference ${r} from id ${t}`);this.missingRef=Be.resolveUrl(e,t,r),this.missingSchema=Be.normalizeId(Be.getFullPath(e,this.missingRef))}}Ln.default=Hn});var iw=ae(function(Bn){Object.defineProperty(Bn,"__esModule",{value:!0});Bn.resolveSchema=Bn.getCompilingSchema=Bn.resolveRef=Bn.compileSchema=Bn.SchemaEnv=void 0;var M=Dt(),Kl=Yg(),Ae=Pl(),F=lt(),Rt=on(),Gn=Mf();class dt{constructor(e){var t;this.refs={},this.dynamicAnchors={};let r;if(typeof e.schema=="object")r=e.schema;this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:F.normalizeId(r===null||r===void 0?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=r===null||r===void 0?void 0:r.$async,this.refs={}}}Bn.SchemaEnv=dt;function Or(e){let t=Jn.call(this,e);if(t)return t;let r=F.getFullPath(this.opts.uriResolver,e.root.baseId),{es5:s,lines:n}=this.opts.code,{ownProperties:o}=this.opts,i=new M.CodeGen(this.scope,{es5:s,lines:n,ownProperties:o}),a;if(e.$async)a=i.scopeValue("Error",{ref:Kl.default,code:M._`require("ajv/dist/runtime/validation_error").default`});let c=i.scopeName("validate");e.validateName=c;let u={gen:i,allErrors:this.opts.allErrors,data:Ae.default.data,parentData:Ae.default.parentData,parentDataProperty:Ae.default.parentDataProperty,dataNames:[Ae.default.data],dataPathArr:[M.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:M.stringify(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:M.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:M._`""`,opts:this.opts,self:this},l;try{this._compilations.add(e),Gn.validateFunctionCode(u),i.optimize(this.opts.code.optimize);let f=i.toString();if(l=`${i.scopeRefs(Ae.default.scope)}return ${f}`,this.opts.code.process)l=this.opts.code.process(l,e);let y=Function(`${Ae.default.self}`,`${Ae.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:y}),y.errors=null,y.schema=e.schema,y.schemaEnv=e,e.$async)y.$async=!0;if(this.opts.code.source===!0)y.source={validateName:c,validateCode:f,scopeValues:i._values};if(this.opts.unevaluated){let{props:p,items:h}=u;if(y.evaluated={props:p instanceof M.Name?void 0:p,items:h instanceof M.Name?void 0:h,dynamicProps:p instanceof M.Name,dynamicItems:h instanceof M.Name},y.source)y.source.evaluated=M.stringify(y.evaluated)}return e.validate=y,e}catch(f){if(delete e.validate,delete e.validateName,l)this.logger.error("Error compiling schema, function code:",l);throw f}finally{this._compilations.delete(e)}}Bn.compileSchema=Or;function Hl(e,t,r){var s;r=F.resolveUrl(this.opts.uriResolver,t,r);let n=e.refs[r];if(n)return n;let o=Jl.call(this,e,r);if(o===void 0){let i=(s=e.localRefs)===null||s===void 0?void 0:s[r],{schemaId:a}=this.opts;if(i)o=new dt({schema:i,schemaId:a,root:e,baseId:t})}if(o===void 0)return;return e.refs[r]=Ll.call(this,o)}Bn.resolveRef=Hl;function Ll(e){if(F.inlineRef(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:Or.call(this,e)}function Jn(e){for(let t of this._compilations)if(Gl(t,e))return t}Bn.getCompilingSchema=Jn;function Gl(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function Jl(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||qt.call(this,e,t)}function qt(e,t){let r=this.opts.uriResolver.parse(t),s=F._getFullPath(this.opts.uriResolver,r),n=F.getFullPath(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&s===n)return xr.call(this,r,e);let o=F.normalizeId(s),i=this.refs[o]||this.schemas[o];if(typeof i=="string"){let a=qt.call(this,e,i);if(typeof(a===null||a===void 0?void 0:a.schema)!=="object")return;return xr.call(this,r,a)}if(typeof(i===null||i===void 0?void 0:i.schema)!=="object")return;if(!i.validate)Or.call(this,i);if(o===F.normalizeId(t)){let{schema:a}=i,{schemaId:c}=this.opts,u=a[c];if(u)n=F.resolveUrl(this.opts.uriResolver,n,u);return new dt({schema:a,schemaId:c,root:e,baseId:n})}return xr.call(this,r,i)}Bn.resolveSchema=qt;var Bl=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function xr(e,{baseId:t,schema:r,root:s}){var n;if(((n=e.fragment)===null||n===void 0?void 0:n[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if(typeof r==="boolean")return;let c=r[Rt.unescapeFragment(a)];if(c===void 0)return;r=c;let u=typeof r==="object"&&r[this.opts.schemaId];if(!Bl.has(a)&&u)t=F.resolveUrl(this.opts.uriResolver,t,u)}let o;if(typeof r!="boolean"&&r.$ref&&!Rt.schemaHasRulesButRef(r,this.RULES)){let a=F.resolveUrl(this.opts.uriResolver,t,r.$ref);o=qt.call(this,s,a)}let{schemaId:i}=this.opts;if(o=o||new dt({schema:r,schemaId:i,root:s,baseId:t}),o.schema!==o.root.schema)return o;return}});var Qn=ae(function(Em,Yl){Yl.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var jr=ae(function(bm,so){var ed=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Nr=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),td=RegExp.prototype.test.bind(/^\d*$/u),Me=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),Rr=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),Xn=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),qr=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),rd=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),G=Array(256);for(let t=0;t<256;t++)G[t]="%"+"0123456789ABCDEF"[t>>4]+"0123456789ABCDEF"[t&15];function K(e){if(e<2048)return G[192|e>>6]+G[128|e&63];if(e<65536)return G[224|e>>12]+G[128|e>>6&63]+G[128|e&63];return G[240|e>>18]+G[128|e>>12&63]+G[128|e>>6&63]+G[128|e&63]}function sd(e){let t="",r=0,s=0;for(s=0;s<e.length;s++){if(r=e[s].charCodeAt(0),r===48)continue;if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[s];break}for(s+=1;s<e.length;s++){if(r=e[s].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[s]}return t}var nd=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),od=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),id=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),ad=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function cd(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++){if(id(e[t]))continue;if(e[t]==="%"&&t+2<e.length&&Me(e.slice(t+1,t+3))){t+=2;continue}return!1}return!0}function Zn(e){let t=-1,r=0,s=-1,n=0;for(let a=0;a<e.length;a++)if(e[a]==="0"){if(s===-1)s=a;if(n++,n>r)r=n,t=s}else s=-1,n=0;if(r<2)return e.join(":");let o=e.slice(0,t).join(":"),i=e.slice(t+r).join(":");return o+"::"+i}function ud(e){let t=e.indexOf("::");if(t!==-1&&e.indexOf("::",t+1)!==-1)return;let r=t===-1?e.split(":"):e.slice(0,t).split(":"),s=t===-1?[]:e.slice(t+2).split(":");if(t!==-1){if(r.length===1&&r[0]==="")r.length=0;if(s.length===1&&s[0]==="")s.length=0}let n=r.concat(s),o=0;for(let a=0;a<n.length;a++){let c=n[a];if(c==="")return;if(c.indexOf(".")!==-1){if(a!==n.length-1||t!==-1&&s.length===0||!Nr(c))return;o+=2;continue}if(!nd(c))return;n[a]=parseInt(c,16).toString(16),o++}if(t===-1){if(o!==8)return;return Zn(n)}if(o>=8)return;let i=n.slice(0,r.length);for(let a=o;a<8;a++)i.push("0");for(let a=r.length;a<n.length;a++)i.push(n[a]);return Zn(i)}function kr(e){let t=e[0]==="["&&e[e.length-1]==="]";if((e[0]==="["||e[e.length-1]==="]")&&!t)return{host:e,isIPV6:!1,error:!0};let s=t?e.slice(1,-1):e;if(t&&od(s))return s=s.toLowerCase(),{host:`[${s}]`,escapedHost:s,isIPV6:!1,isIPVFuture:!0};if(ld(s,":")<2)return{host:e,isIPV6:!1,error:t};let n="",o=s.indexOf("%");if(o!==-1){let a=s.slice(o,o+3).toLowerCase()==="%25"?3:1;if(n=s.slice(o+a),!cd(n))return{host:e,isIPV6:!1,error:!0};s=s.slice(0,o)}let i=ud(s);if(i===void 0)return{host:e,isIPV6:!1,error:!0};return{host:i+(n?"%"+n:""),escapedHost:i+(n?"%25"+n:""),isIPV6:!0}}function ld(e,t){let r=0;for(let s=0;s<e.length;s++)if(e[s]===t)r++;return r}function dd(e){let t=e,r=[],s=-1,n=0;while(n=t.length){if(n===1)if(t===".")break;else if(t==="/"){r.push("/");break}else{r.push(t);break}else if(n===2){if(t[0]==="."){if(t[1]===".")break;else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."||t[1]==="/"){r.push("/");break}}}else if(n===3){if(t==="/.."){if(r.length!==0)r.pop();r.push("/");break}}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."){if(t[3]==="/"){if(t=t.slice(3),r.length!==0)r.pop();continue}}}}if((s=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,s)),t=t.slice(s)}return r.join("")}var fd={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},hd=/[@/?#:]/g,pd=/[@/?#]/g;function Yn(e,t){let r=t?pd:hd;return r.lastIndex=0,e.replace(r,(s)=>fd[s])}function eo(e,t=!1){if(e.indexOf("%")===-1)return e;let r="";for(let s=0;s<e.length;s++){if(e[s]==="%"&&s+2<e.length){let n=e.slice(s+1,s+3);if(Me(n)){let o=n.toUpperCase(),i=String.fromCharCode(parseInt(o,16));if(t&&Rr(i))r+=i;else r+="%"+o;s+=2;continue}}r+=e[s]}return r}function md(e){let t="";for(let r=0;r<e.length;r++){let s=e[r];if(s==="%"&&r+2<e.length){let n=e.slice(r+1,r+3);if(Me(n)){let o=n.toUpperCase(),i=String.fromCharCode(parseInt(o,16));if(i!=="."&&Rr(i))t+=i;else t+="%"+o;r+=2;continue}}if(Xn(s))t+=s;else{let n=e.charCodeAt(r);if(n<128)t+=ro(n)?s:G[n];else if(n<55296||n>57343)t+=K(n);else if(n<=56319&&r+1<e.length){let o=e.charCodeAt(r+1);if(o>=56320&&o<=57343)t+=K(65536+(n-55296<<10)+(o-56320)),r++;else t+=K(65533)}else t+=K(65533)}}return t}function yd(e,t=!1){let r="",s=t&&e[0]!=="/";for(let n=0;n<e.length;n++){let o=e[n];if(o==="%"&&n+2<e.length){let i=e.slice(n+1,n+3);if(Me(i)){r+="%"+i.toUpperCase(),n+=2;continue}}if(o==="/")s=!1;if(Xn(o)&&(o!==":"||!s))r+=o;else{let i=e.charCodeAt(n);if(i<128)r+=G[i];else if(i<55296||i>57343)r+=K(i);else if(i<=56319&&n+1<e.length){let a=e.charCodeAt(n+1);if(a>=56320&&a<=57343)r+=K(65536+(i-55296<<10)+(a-56320)),n++;else r+=K(65533)}else r+=K(65533)}}return r}function Ir(e,t){let r="";for(let s=0;s<e.length;s++){let n=e[s];if(n==="%"&&s+2<e.length){let o=e.slice(s+1,s+3);if(Me(o)){r+="%"+o.toUpperCase(),s+=2;continue}}if(t(n))r+=n;else{let o=e.charCodeAt(s);if(o<128)r+=G[o];else if(o<55296||o>57343)r+=K(o);else if(o<=56319&&s+1<e.length){let i=e.charCodeAt(s+1);if(i>=56320&&i<=57343)r+=K(65536+(o-55296<<10)+(i-56320)),s++;else r+=K(65533)}else r+=K(65533)}}return r}function to(e){return Ir(e,rd)}function _d(e){return Ir(e,qr)}function gd(e){return Ir(e,qr)}function ro(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===42||e===43||e===45||e===46||e===47||e===64||e===95}function $d(e){let t="";for(let r=0;r<e.length;r++){let s=e[r];if(s==="%"&&r+2<e.length){let n=e.slice(r+1,r+3);if(Me(n)){let o=n.toUpperCase(),i=String.fromCharCode(parseInt(o,16));if(Rr(i))t+=i;else t+="%"+o;r+=2;continue}}if(qr(s))t+=s;else{let n=e.charCodeAt(r);if(n<128)t+=ro(n)?s:G[n];else if(n<55296||n>57343)t+=K(n);else if(n<=56319&&r+1<e.length){let o=e.charCodeAt(r+1);if(o>=56320&&o<=57343)t+=K(65536+(n-55296<<10)+(o-56320)),r++;else t+=K(65533)}else t+=K(65533)}}return t}function vd(e){let t="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){let s=e.slice(r+1,r+3);if(Me(s)){t+="%"+s.toUpperCase(),r+=2;continue}}t+=escape(e[r])}return t}function wd(e){let t=[];if(e.userinfo!==void 0)t.push(to(e.userinfo)),t.push("@");if(e.host!==void 0){let r=e.host;if(!Nr(r)){let s=kr(r);if(s.isIPV6!==!0&&s.isIPVFuture!==!0)r=eo(r,!0),s=kr(r);if(s.isIPV6===!0||s.isIPVFuture===!0)r=`[${s.escapedHost}]`;else r=Yn(r,!1)}t.push(r)}if(typeof e.port==="number"||typeof e.port==="string"){let r=String(e.port);if(!td(r))throw TypeError("URI port is malformed.");t.push(":"),t.push(r)}return t.length?t.join(""):void 0}so.exports={nonSimpleDomain:ad,recomposeAuthority:wd,reescapeHostDelimiters:Yn,normalizePercentEncoding:eo,normalizePathEncoding:md,serializePathEncoding:yd,normalizeQueryFragmentEncoding:$d,encodeUserinfo:to,encodeQuery:_d,encodeFragment:gd,escapePreservingEscapes:vd,removeDotSegments:dd,isIPv4:Nr,isUUID:ed,normalizeIPv6:kr,stringArrayToHexStripped:sd}});var co=ae(function(Sm,ao){var{isUUID:Ed}=jr(),bd=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,Sd=["http","https","ws","wss","urn","urn:uuid"];function Pd(e){return Sd.indexOf(e)!==-1}function Tr(e){if(e.secure===!0)return!0;else if(e.secure===!1)return!1;else if(e.scheme)return e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S");else return!1}function no(e){if(!e.host)e.error=e.error||"HTTP URIs must have a host.";return e}function oo(e){let t=String(e.scheme).toLowerCase()==="https";if(e.port===(t?443:80)||e.port==="")e.port=void 0;if(!e.path)e.path="/";return e}function xd(e){return e.secure=Tr(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function Od(e){if(e.port===(Tr(e)?443:80)||e.port==="")e.port=void 0;if(typeof e.secure==="boolean")e.scheme=e.secure?"wss":"ws",e.secure=void 0;if(e.resourceName){let t=e.resourceName.indexOf("?"),r=t===-1?e.resourceName:e.resourceName.slice(0,t);e.path=r&&r!=="/"?r:void 0,e.query=t===-1?void 0:e.resourceName.slice(t+1),e.resourceName=void 0}return e.fragment=void 0,e}function kd(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(bd);if(r&&r[0]===e.path){let s=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let n=`${s}:${t.nid||e.nid}`,o=Cr(n);if(e.path=void 0,o)e=o.parse(e,t)}else e.error=e.error||"URN can not be parsed.";return e}function Nd(e,t){if(e.nid===void 0)throw Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",s=e.nid.toLowerCase(),n=`${r}:${t.nid||s}`,o=Cr(n);if(o)e=o.serialize(e,t);let i=e,a=e.nss;return i.path=`${s||t.nid}:${a}`,t.skipEscape=!0,i}function Rd(e,t){let r=e;if(r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!Ed(r.uuid)))r.error=r.error||"UUID is not valid.";return r}function qd(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var io={scheme:"http",domainHost:!0,parse:no,serialize:oo},Id={scheme:"https",domainHost:io.domainHost,parse:no,serialize:oo},It={scheme:"ws",domainHost:!0,parse:xd,serialize:Od},jd={scheme:"wss",domainHost:It.domainHost,parse:It.parse,serialize:It.serialize},Td={scheme:"urn",parse:kd,serialize:Nd,skipNormalize:!0},Cd={scheme:"urn:uuid",parse:Rd,serialize:qd,skipNormalize:!0},jt={http:io,https:Id,ws:It,wss:jd,urn:Td,"urn:uuid":Cd};Object.setPrototypeOf(jt,null);function Cr(e){return e&&(jt[e]||jt[e.toLowerCase()])||void 0}ao.exports={wsIsSecure:Tr,SCHEMES:jt,isValidSchemeName:Pd,getSchemeHandler:Cr}});var wo=ae(function(Pm,At){var{normalizeIPv6:po,removeDotSegments:ht,recomposeAuthority:Dd,normalizePercentEncoding:Dr,normalizePathEncoding:Ad,serializePathEncoding:uo,normalizeQueryFragmentEncoding:lo,encodeQuery:Md,encodeFragment:Fd,reescapeHostDelimiters:Vd,isIPv4:mo,nonSimpleDomain:zd}=jr(),{SCHEMES:yo,getSchemeHandler:Ar}=co(),_o=/^[A-Za-z][A-Za-z0-9+.-]*$/u;function fo(e){let t=unescape(String(e));if(!_o.test(t))throw TypeError("URI scheme is malformed.");return t}function Ud(e,t){if(typeof e==="string")e=Qd(e,t);else if(typeof e==="object")e=Ct(Fe(e,t),t);return e}function Kd(e,t,r){let s=r?Object.assign({scheme:"null"},r):{scheme:"null"},{parsed:n,malformedAuthorityOrPort:o,malformedPercentEncoding:i,malformedSchemeSpecific:a,malformedHost:c,malformedScheme:u}=Tt(e,s),{parsed:l,malformedAuthorityOrPort:f,malformedPercentEncoding:g,malformedSchemeSpecific:y,malformedHost:p,malformedScheme:h}=Tt(t,s);if(o||f||i||g||a||y||c||p||u||h)throw Error(n.error||l.error||"URI is malformed.");let m=go(n,l,s,!0),v=Ar(r&&r.scheme||m.scheme),x=m.host,O=x!==void 0&&x!==""&&(mo(x)||po(x).isIPV6);$o(m,r||{},v,O);let j=x&&x.indexOf("%")!==-1&&!/\P{ASCII}/u.test(x);if(m.error&&!j)throw Error(m.error);return s.skipEscape=!0,Fe(m,s)}function go(e,t,r,s){let n={};if(!s)e=Ct(Fe(e,r),r),t=Ct(Fe(t,r),r);if(r=r||{},!r.tolerant&&t.scheme)n.scheme=t.scheme,n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=ht(t.path||""),n.query=t.query;else{if(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=ht(t.path||""),n.query=t.query;else{if(!t.path)if(n.path=e.path,t.query!==void 0)n.query=t.query;else n.query=e.query;else{if(t.path[0]==="/")n.path=ht(t.path);else{if((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path)n.path="/"+t.path;else if(!e.path)n.path=t.path;else n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path;n.path=ht(n.path)}n.query=t.query}n.userinfo=e.userinfo,n.host=e.host,n.port=e.port}n.scheme=e.scheme}return n.fragment=t.fragment,n}function Hd(e,t,r){let s=ho(e,r),n=ho(t,r);return s!==void 0&&n!==void 0&&s===n}function Fe(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},s=Object.assign({},t),n=[];if(r.scheme)r.scheme=fo(r.scheme);let o=Ar(s.scheme||r.scheme);if(o&&o.serialize)o.serialize(r,s);let i=r.userinfo!==void 0||r.host!==void 0||r.port!==void 0,a=!s.skipEscape&&r.scheme===void 0&&!i;if(r.path!==void 0)if(!s.skipEscape)r.path=uo(r.path,a);else r.path=Dr(r.path);if(s.reference!=="suffix"&&r.scheme)r.scheme=fo(r.scheme),n.push(r.scheme,":");let c=Dd(r);if(c!==void 0){if(s.reference!=="suffix")n.push("//");if(n.push(c),r.path&&r.path[0]!=="/")n.push("/")}if(r.path!==void 0){let u=r.path;if(!s.absolutePath&&(!o||!o.absolutePath))u=ht(u);if(a)u=uo(u,!0);if(c===void 0&&u[0]==="/"&&u[1]==="/")u="/%2F"+u.slice(2);n.push(u)}if(r.query!==void 0)n.push("?",Md(r.query));if(r.fragment!==void 0)n.push("#",Fd(r.fragment));return n.join("")}var Ld=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,Gd=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,Jd=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function Bd(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port==="number"&&(e.port<0||e.port>65535))return"URI port is malformed.";return}function ft(e){if(e===void 0)return!1;let t=e.indexOf("%");while(t!==-1){if(t+2>=e.length||!/^[\da-f]{2}$/iu.test(e.slice(t+1,t+3)))return!0;t=e.indexOf("%",t+3)}return!1}function Mr(e){return e[0]==="["&&e[e.length-1]==="]"}function Wd(e){let t=e[4];return ft(e[3])||t!==void 0&&!Mr(t)&&ft(t)||ft(e[6])||ft(e[7])||ft(e[8])}function $o(e,t,r,s){if(!t.unicodeSupport&&(!r||!r.unicodeSupport)&&e.host&&!Mr(e.host)&&(t.domainHost||r&&r.domainHost)&&s===!1&&zd(e.host))try{e.host=new URL("http://"+e.host).hostname}catch(n){return e.error=e.error||"Host's domain name can not be converted to ASCII: "+n,!0}return!1}function Tt(e,t){let r=Object.assign({},t),s={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},n=!1,o=!1,i=!1,a=!1,c=!1,u=!1,l=!1;if(r.reference==="suffix")if(r.scheme)e=r.scheme+":"+e;else e="//"+e;let f=e.match(Gd);if(f!==null&&f[1].indexOf("\\")!==-1)s.error="URI authority must not contain a literal backslash.",n=!0;let g=e.match(Jd);if(g!==null){let p=g[1],h=p.replace(/[\t\n\r]/g,"");if(h.length>=2){if(h.slice(0,2)!=="//")s.error=s.error||"URI authority must not contain a literal backslash.",n=!0;else if(p.length!==h.length)s.error=s.error||"URI authority introducer must not contain whitespace.",n=!0}}let y=e.match(Ld);if(y){if(s.scheme=y[1],s.userinfo=y[3],s.host=y[4],s.port=parseInt(y[5],10),s.path=y[6]||"",s.query=y[7],s.fragment=y[8],s.scheme!==void 0){let m=unescape(s.scheme);if(_o.test(m))s.scheme=m.toLowerCase();else s.error=s.error||"URI scheme is malformed.",u=!0}if(o=Wd(y),o)s.error=s.error||"URI contains malformed percent-encoding.";if(isNaN(s.port))s.port=y[5];let p=Bd(s,y);if(p!==void 0)s.error=s.error||p,n=!0;if(s.host)if(mo(s.host)===!1){let v=Mr(s.host),x=s.host.indexOf("[")!==-1||s.host.indexOf("]")!==-1,O=po(s.host);if(l=O.isIPV6||O.isIPVFuture===!0,c=x&&(!v||O.error===!0),s.host=l?O.host:O.host.toLowerCase(),c)s.error=s.error||"URI host is malformed.",n=!0}else l=!0;if(s.scheme===void 0&&s.userinfo===void 0&&s.host===void 0&&s.port===void 0&&s.query===void 0&&!s.path)s.reference="same-document";else if(s.scheme===void 0)s.reference="relative";else if(s.fragment===void 0)s.reference="absolute";else s.reference="uri";if(r.reference&&r.reference!=="suffix"&&r.reference!==s.reference)s.error=s.error||"URI is not a "+r.reference+" reference.";let h=Ar(r.scheme||s.scheme);if(!c)a=$o(s,r,h,l);if(e.indexOf("%")!==-1&&s.host!==void 0&&!c){let m=l?s.host:Dr(s.host,!0);if(!l)m=Dr(m.toLowerCase());s.host=Vd(m,l)}if(!h||h&&!h.skipNormalize){if(s.path)s.path=Ad(s.path);if(s.query)s.query=lo(s.query);if(s.fragment)s.fragment=lo(s.fragment)}if(h&&h.parse){if(h.parse(s,r),h===yo.urn&&s.nid===void 0)i=!0}}else s.error=s.error||"URI can not be parsed.";return{parsed:s,malformedAuthorityOrPort:n,malformedPercentEncoding:o,malformedSchemeSpecific:i,malformedHost:a,malformedScheme:u}}function Ct(e,t){return Tt(e,t).parsed}function Qd(e,t){return vo(e,t).normalized}function vo(e,t){let{parsed:r,malformedAuthorityOrPort:s,malformedPercentEncoding:n,malformedSchemeSpecific:o,malformedHost:i,malformedScheme:a}=Tt(e,t);return{normalized:s||n||o||i||a?e:Fe(r,t),malformedAuthorityOrPort:s,malformedPercentEncoding:n,malformedSchemeSpecific:o,malformedHost:i,malformedScheme:a}}function ho(e,t){if(typeof e!=="string"&&typeof e!=="object")return;let r;try{r=typeof e==="string"?e:Fe(e,t)}catch{return}let{normalized:s,malformedAuthorityOrPort:n,malformedPercentEncoding:o,malformedSchemeSpecific:i,malformedHost:a,malformedScheme:c}=vo(r,t);return n||o||i||a||c?void 0:s}var Fr={SCHEMES:yo,normalize:Ud,resolve:Kd,resolveComponent:go,equal:Hd,serialize:Fe,parse:Ct};At.exports=Fr;At.exports.default=Fr;At.exports.fastUri=Fr});var So=ae(function(bo){Object.defineProperty(bo,"__esModule",{value:!0});var Eo=wo();Eo.code='require("ajv/dist/runtime/uri").default';bo.default=Eo});var _0=ae(function(me){Object.defineProperty(me,"__esModule",{value:!0});me.CodeGen=me.Name=me.nil=me.stringify=me.str=me._=me.KeywordCxt=void 0;var Xd=Mf();Object.defineProperty(me,"KeywordCxt",{enumerable:!0,get:function(){return Xd.KeywordCxt}});var Qe=Dt();Object.defineProperty(me,"_",{enumerable:!0,get:function(){return Qe._}});Object.defineProperty(me,"str",{enumerable:!0,get:function(){return Qe.str}});Object.defineProperty(me,"stringify",{enumerable:!0,get:function(){return Qe.stringify}});Object.defineProperty(me,"nil",{enumerable:!0,get:function(){return Qe.nil}});Object.defineProperty(me,"Name",{enumerable:!0,get:function(){return Qe.Name}});Object.defineProperty(me,"CodeGen",{enumerable:!0,get:function(){return Qe.CodeGen}});var Yd=Yg(),No=Ff(),Ro=mr(),se=iw(),qo=Dt(),ne=lt(),be=ut(),We=on(),Po=Qn(),ef=So(),Io=(e,t)=>new RegExp(e,t);Io.code="new RegExp";var tf=["removeAdditional","useDefaults","coerceTypes"],rf=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),sf={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},nf={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},xo=200;function of(e){var t,r,s,n,o,i,a,c,u,l,f,g,y,p,h,m,v,x,O,j,k,ee,he,Yt,er;let nt=e.strict,tr=(t=e.code)===null||t===void 0?void 0:t.optimize,Hr=tr===!0||tr===void 0?1:tr||0,Lr=(s=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&s!==void 0?s:Io,ka=(n=e.uriResolver)!==null&&n!==void 0?n:ef.default;return{strictSchema:(i=(o=e.strictSchema)!==null&&o!==void 0?o:nt)!==null&&i!==void 0?i:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:nt)!==null&&c!==void 0?c:!0,strictTypes:(l=(u=e.strictTypes)!==null&&u!==void 0?u:nt)!==null&&l!==void 0?l:"log",strictTuples:(g=(f=e.strictTuples)!==null&&f!==void 0?f:nt)!==null&&g!==void 0?g:"log",strictRequired:(p=(y=e.strictRequired)!==null&&y!==void 0?y:nt)!==null&&p!==void 0?p:!1,code:e.code?{...e.code,optimize:Hr,regExp:Lr}:{optimize:Hr,regExp:Lr},loopRequired:(h=e.loopRequired)!==null&&h!==void 0?h:xo,loopEnum:(m=e.loopEnum)!==null&&m!==void 0?m:xo,meta:(v=e.meta)!==null&&v!==void 0?v:!0,messages:(x=e.messages)!==null&&x!==void 0?x:!0,inlineRefs:(O=e.inlineRefs)!==null&&O!==void 0?O:!0,schemaId:(j=e.schemaId)!==null&&j!==void 0?j:"$id",addUsedSchema:(k=e.addUsedSchema)!==null&&k!==void 0?k:!0,validateSchema:(ee=e.validateSchema)!==null&&ee!==void 0?ee:!0,validateFormats:(he=e.validateFormats)!==null&&he!==void 0?he:!0,unicodeRegExp:(Yt=e.unicodeRegExp)!==null&&Yt!==void 0?Yt:!0,int32range:(er=e.int32range)!==null&&er!==void 0?er:!0,uriResolver:ka}}class Mt{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...of(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new qo.ValueScope({scope:{},prefixes:rf,es5:t,lines:r}),this.logger=ff(e.logger);let s=e.validateFormats;if(e.validateFormats=!1,this.RULES=Ro.getRules(),Oo.call(this,sf,e,"NOT SUPPORTED"),Oo.call(this,nf,e,"DEPRECATED","warn"),this._metaOpts=lf.call(this),e.formats)cf.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords)uf.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);af.call(this),e.validateFormats=s}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,s=Po;if(r==="id")s={...Po},s.id=s.$id,delete s.$id;if(t&&e)this.addMetaSchema(s,s[r],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){let r;if(typeof e=="string"){if(r=this.getSchema(e),!r)throw Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let s=r(t);if(!("$async"in r))this.errors=r.errors;return s}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return s.call(this,e,t);async function s(u,l){await n.call(this,u.$schema);let f=this._addSchema(u,l);return f.validate||o.call(this,f)}async function n(u){if(u&&!this.getSchema(u))await s.call(this,{$ref:u},!0)}async function o(u){try{return this._compileSchemaEnv(u)}catch(l){if(!(l instanceof No.default))throw l;return i.call(this,l),await a.call(this,l.missingSchema),o.call(this,u)}}function i({missingSchema:u,missingRef:l}){if(this.refs[u])throw Error(`AnySchema ${u} is loaded but ${l} cannot be resolved`)}async function a(u){let l=await c.call(this,u);if(!this.refs[u])await n.call(this,l.$schema);if(!this.refs[u])this.addSchema(l,u,t)}async function c(u){let l=this._loading[u];if(l)return l;try{return await(this._loading[u]=r(u))}finally{delete this._loading[u]}}}addSchema(e,t,r,s=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,r,s);return this}let n;if(typeof e==="object"){let{schemaId:o}=this.opts;if(n=e[o],n!==void 0&&typeof n!="string")throw Error(`schema ${o} must be string`)}return t=ne.normalizeId(t||n),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,s,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if(typeof e=="boolean")return!0;let r;if(r=e.$schema,r!==void 0&&typeof r!="string")throw Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let s=this.validate(r,e);if(!s&&t){let n="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(n);else throw Error(n)}return s}getSchema(e){let t;while(typeof(t=ko.call(this,e))=="string")e=t;if(t===void 0){let{schemaId:r}=this.opts,s=new se.SchemaEnv({schema:{},schemaId:r});if(t=se.resolveSchema.call(this,s,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=ko.call(this,e);if(typeof t=="object")this._cache.delete(t.schema);return delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let r=e[this.opts.schemaId];if(r)r=ne.normalizeId(r),delete this.schemas[r],delete this.refs[r];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if(typeof e=="string"){if(r=e,typeof t=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r}else if(typeof e=="object"&&t===void 0){if(t=e,r=t.keyword,Array.isArray(r)&&!r.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(pf.call(this,r,t),!t)return We.eachItem(r,(n)=>Vr.call(this,n)),this;yf.call(this,t);let s={...t,type:be.getJSONTypes(t.type),schemaType:be.getJSONTypes(t.schemaType)};return We.eachItem(r,s.type.length===0?(n)=>Vr.call(this,n,s):(n)=>s.type.forEach((o)=>Vr.call(this,n,s,o))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let r of t.rules){let s=r.rules.findIndex((n)=>n.keyword===e);if(s>=0)r.rules.splice(s,1)}return this}addFormat(e,t){if(typeof t=="string")t=new RegExp(t);return this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){if(!e||e.length===0)return"No errors";return e.map((s)=>`${r}${s.instancePath} ${s.message}`).reduce((s,n)=>s+t+n)}$dataMetaSchema(e,t){let r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let s of t){let n=s.split("/").slice(1),o=e;for(let i of n)o=o[i];for(let i in r){let a=r[i];if(typeof a!="object")continue;let{$data:c}=a.definition,u=o[i];if(c&&u)o[i]=jo(u)}}return e}_removeAllSchemas(e,t){for(let r in e){let s=e[r];if(!t||t.test(r)){if(typeof s=="string")delete e[r];else if(s&&!s.meta)this._cache.delete(s.schema),delete e[r]}}}_addSchema(e,t,r,s=this.opts.validateSchema,n=this.opts.addUsedSchema){let o,{schemaId:i}=this.opts;if(typeof e=="object")o=e[i];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof e!="boolean")throw Error("schema must be object or boolean");let a=this._cache.get(e);if(a!==void 0)return a;r=ne.normalizeId(o||r);let c=ne.getSchemaRefs.call(this,e,r);if(a=new se.SchemaEnv({schema:e,schemaId:i,meta:t,baseId:r,localRefs:c}),this._cache.set(a.schema,a),n&&!r.startsWith("#")){if(r)this._checkUnique(r);this.refs[r]=a}if(s)this.validateSchema(e,!0);return a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta)this._compileMetaSchema(e);else se.compileSchema.call(this,e);if(!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{se.compileSchema.call(this,e)}finally{this.opts=t}}}Mt.ValidationError=Yd.default;Mt.MissingRefError=No.default;me.default=Mt;function Oo(e,t,r,s="error"){for(let n in e){let o=n;if(o in t)this.logger[s](`${r}: option ${n}. ${e[o]}`)}}function ko(e){return e=ne.normalizeId(e),this.schemas[e]||this.refs[e]}function af(){let e=this.opts.schemas;if(!e)return;if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function cf(){for(let e in this.opts.formats){let t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function uf(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];if(!r.keyword)r.keyword=t;this.addKeyword(r)}}function lf(){let e={...this.opts};for(let t of tf)delete e[t];return e}var df={log(){},warn(){},error(){}};function ff(e){if(e===!1)return df;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}var hf=/^[a-z_$][a-z0-9_$:-]*$/i;function pf(e,t){let{RULES:r}=this;if(We.eachItem(e,(s)=>{if(r.keywords[s])throw Error(`Keyword ${s} is already defined`);if(!hf.test(s))throw Error(`Keyword ${s} has invalid name`)}),!t)return;if(t.$data&&!(("code"in t)||("validate"in t)))throw Error('$data keyword must have "code" or "validate" function')}function Vr(e,t,r){var s;let n=t===null||t===void 0?void 0:t.post;if(r&&n)throw Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,i=n?o.post:o.rules.find(({type:c})=>c===r);if(!i)i={type:r,rules:[]},o.rules.push(i);if(o.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:be.getJSONTypes(t.type),schemaType:be.getJSONTypes(t.schemaType)}};if(t.before)mf.call(this,i,a,t.before);else i.rules.push(a);o.all[e]=a,(s=t.implements)===null||s===void 0||s.forEach((c)=>this.addKeyword(c))}function mf(e,t,r){let s=e.rules.findIndex((n)=>n.keyword===r);if(s>=0)e.rules.splice(s,0,t);else e.rules.push(t),this.logger.warn(`rule ${r} is not defined`)}function yf(e){let{metaSchema:t}=e;if(t===void 0)return;if(e.$data&&this.opts.$data)t=jo(t);e.validateSchema=this.compile(t,!0)}var _f={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function jo(e){return{anyOf:[e,_f]}}});var Co=ae(function(To){Object.defineProperty(To,"__esModule",{value:!0});var vf={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};To.default=vf});var S0=ae(function(Ao){Object.defineProperty(Ao,"__esModule",{value:!0});Ao.callRef=Ao.getValidate=void 0;var Ef=Ff(),Vt=Q(),C=Dt(),Ze=Pl(),zt=iw(),Se=on(),bf={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:s}=e,{baseId:n,schemaEnv:o,validateName:i,opts:a,self:c}=s,{root:u}=o;if((r==="#"||r==="#/")&&n===u.baseId)return f();let l=zt.resolveRef.call(c,u,n,r);if(l===void 0)throw new Ef.default(s.opts.uriResolver,n,r);if(l instanceof zt.SchemaEnv)return g(l);return y(l);function f(){if(o===u)return Ft(e,i,o,o.$async);let p=t.scopeValue("root",{ref:u});return Ft(e,C._`${p}.validate`,u,u.$async)}function g(p){let h=Do(e,p);Ft(e,h,p,p.$async)}function y(p){let h=t.scopeValue("schema",a.code.source===!0?{ref:p,code:C.stringify(p)}:{ref:p}),m=t.name("valid"),v=e.subschema({schema:p,dataTypes:[],schemaPath:C.nil,topSchemaRef:h,errSchemaPath:r},m);e.mergeEvaluated(v),e.ok(m)}}};function Do(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):C._`${r.scopeValue("wrapper",{ref:t})}.validate`}Ao.getValidate=Do;function Ft(e,t,r,s){let{gen:n,it:o}=e,{allErrors:i,schemaEnv:a,opts:c}=o,u=c.passContext?Ze.default.this:C.nil;if(s)l();else f();function l(){if(!a.$async)throw Error("async schema referenced by sync schema");let p=n.let("valid");n.try(()=>{if(n.code(C._`await ${Vt.callValidateCode(e,t,u)}`),y(t),!i)n.assign(p,!0)},(h)=>{if(n.if(C._`!(${h} instanceof ${o.ValidationError})`,()=>n.throw(h)),g(h),!i)n.assign(p,!1)}),e.ok(p)}function f(){e.result(Vt.callValidateCode(e,t,u),()=>y(t),()=>g(t))}function g(p){let h=C._`${p}.errors`;n.assign(Ze.default.vErrors,C._`${Ze.default.vErrors} === null ? ${h} : ${Ze.default.vErrors}.concat(${h})`),n.assign(Ze.default.errors,C._`${Ze.default.vErrors}.length`)}function y(p){var h;if(!o.opts.unevaluated)return;let m=(h=r===null||r===void 0?void 0:r.validate)===null||h===void 0?void 0:h.evaluated;if(o.props!==!0)if(m&&!m.dynamicProps){if(m.props!==void 0)o.props=Se.mergeEvaluated.props(n,m.props,o.props)}else{let v=n.var("props",C._`${p}.evaluated.props`);o.props=Se.mergeEvaluated.props(n,v,o.props,C.Name)}if(o.items!==!0)if(m&&!m.dynamicItems){if(m.items!==void 0)o.items=Se.mergeEvaluated.items(n,m.items,o.items)}else{let v=n.var("items",C._`${p}.evaluated.items`);o.items=Se.mergeEvaluated.items(n,v,o.items,C.Name)}}}Ao.callRef=Ft;Ao.default=bf});var C0=ae(function(Fo){Object.defineProperty(Fo,"__esModule",{value:!0});var xf=Co(),Of=S0(),kf=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",xf.default,Of.default];Fo.default=kf});var zo=ae(function(Vo){Object.defineProperty(Vo,"__esModule",{value:!0});var xe=Dt(),Pe=xe.operators,Ut={maximum:{okStr:"<=",ok:Pe.LTE,fail:Pe.GT},minimum:{okStr:">=",ok:Pe.GTE,fail:Pe.LT},exclusiveMaximum:{okStr:"<",ok:Pe.LT,fail:Pe.GTE},exclusiveMinimum:{okStr:">",ok:Pe.GT,fail:Pe.LTE}},Rf={message:({keyword:e,schemaCode:t})=>xe.str`must be ${Ut[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>xe._`{comparison: ${Ut[e].okStr}, limit: ${t}}`},qf={keyword:Object.keys(Ut),type:"number",schemaType:"number",$data:!0,error:Rf,code(e){let{keyword:t,data:r,schemaCode:s}=e;e.fail$data(xe._`${r} ${Ut[t].fail} ${s} || isNaN(${r})`)}};Vo.default=qf});var Ko=ae(function(Uo){Object.defineProperty(Uo,"__esModule",{value:!0});var oe=Dt(),jf={message:({schemaCode:e})=>oe.str`must be multiple of ${e}`,params:({schemaCode:e})=>oe._`{multipleOf: ${e}}`},Tf={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:jf,code(e){let{gen:t,data:r,schemaCode:s,it:n}=e,o=n.opts.multipleOfPrecision,i=t.let("res"),a=o?oe._`Math.abs(Math.round(${i}) - ${i}) > 1e-${o}`:oe._`${i} !== parseInt(${i})`;e.fail$data(oe._`(${s} === 0 || (${i} = ${r}/${s}, ${a}))`)}};Uo.default=Tf});var Go=ae(function(Lo){Object.defineProperty(Lo,"__esModule",{value:!0});function Ho(e){let t=e.length,r=0,s=0,n;while(s<t)if(r++,n=e.charCodeAt(s++),n>=55296&&n<=56319&&s<t){if(n=e.charCodeAt(s),(n&64512)===56320)s++}return r}Lo.default=Ho;Ho.code='require("ajv/dist/runtime/ucs2length").default'});var Wo=ae(function(Bo){Object.defineProperty(Bo,"__esModule",{value:!0});var J=Dt(),Jo=on(),Af=Go(),Vf={message({keyword:e,schemaCode:t}){return J.str`must NOT have ${e==="maxLength"?"more":"fewer"} than ${t} characters`},params:({schemaCode:e})=>J._`{limit: ${e}}`},zf={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Vf,code(e){let{keyword:t,data:r,schemaCode:s,it:n}=e,o=t==="maxLength"?J.operators.GT:J.operators.LT,i=n.opts.unicode===!1?J._`${r}.length`:J._`${Jo.useFunc(e.gen,Af.default)}(${r})`;e.fail$data(J._`${i} ${o} ${s}`)}};Bo.default=zf});var Yo=ae(function(Xo){Object.defineProperty(Xo,"__esModule",{value:!0});var Qo=Q(),Zo=on(),Z=Dt(),Kf={message:({schemaCode:e})=>Z.str`must match pattern "${e}"`,params:({schemaCode:e})=>Z._`{pattern: ${e}}`},Hf={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Kf,code(e){let{gen:t,data:r,$data:s,schema:n,schemaCode:o,it:i}=e,a=i.opts.unicodeRegExp?"u":"";if(s){let{regExp:c}=i.opts.code,u=c.code==="new RegExp"?Z._`new RegExp`:Zo.useFunc(t,c),l=t.let("valid");t.try(()=>t.assign(l,Z._`${u}(${o}, ${a}).test(${r})`),()=>t.assign(l,!1)),e.fail$data(Z._`!${l}`)}else{let c=Qo.usePattern(e,n);e.fail$data(Z._`!${c}.test(${r})`)}}};Xo.default=Hf});var ti=ae(function(ei){Object.defineProperty(ei,"__esModule",{value:!0});var ie=Dt(),Gf={message({keyword:e,schemaCode:t}){return ie.str`must NOT have ${e==="maxProperties"?"more":"fewer"} than ${t} properties`},params:({schemaCode:e})=>ie._`{limit: ${e}}`},Jf={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Gf,code(e){let{keyword:t,data:r,schemaCode:s}=e,n=t==="maxProperties"?ie.operators.GT:ie.operators.LT;e.fail$data(ie._`Object.keys(${r}).length ${n} ${s}`)}};ei.default=Jf});var ni=ae(function(si){Object.defineProperty(si,"__esModule",{value:!0});var ce=Q(),ue=Dt(),ri=on(),Wf={message:({params:{missingProperty:e}})=>ue.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>ue._`{missingProperty: ${e}}`},Qf={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Wf,code(e){let{gen:t,schema:r,schemaCode:s,data:n,$data:o,it:i}=e,{opts:a}=i;if(!o&&r.length===0)return;let c=r.length>=a.loopRequired;if(i.allErrors)u();else l();if(a.strictRequired){let y=e.parentSchema.properties,{definedProperties:p}=e.it;for(let h of r)if((y===null||y===void 0?void 0:y[h])===void 0&&!p.has(h)){let m=i.schemaEnv.baseId+i.errSchemaPath,v=`required property "${h}" is not defined at "${m}" (strictRequired)`;ri.checkStrictMode(i,v,i.opts.strictRequired)}}function u(){if(c||o)e.block$data(ue.nil,f);else for(let y of r)ce.checkReportMissingProp(e,y)}function l(){let y=t.let("missing");if(c||o){let p=t.let("valid",!0);e.block$data(p,()=>g(y,p)),e.ok(p)}else t.if(ce.checkMissingProp(e,r,y)),ce.reportMissingProp(e,y),t.else()}function f(){t.forOf("prop",s,(y)=>{e.setParams({missingProperty:y}),t.if(ce.noPropertyInData(t,n,y,a.ownProperties),()=>e.error())})}function g(y,p){e.setParams({missingProperty:y}),t.forOf(y,s,()=>{t.assign(p,ce.propertyInData(t,n,y,a.ownProperties)),t.if(ue.not(p),()=>{e.error(),t.break()})},ue.nil)}}};si.default=Qf});var ii=ae(function(oi){Object.defineProperty(oi,"__esModule",{value:!0});var le=Dt(),Xf={message({keyword:e,schemaCode:t}){return le.str`must NOT have ${e==="maxItems"?"more":"fewer"} than ${t} items`},params:({schemaCode:e})=>le._`{limit: ${e}}`},Yf={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Xf,code(e){let{keyword:t,data:r,schemaCode:s}=e,n=t==="maxItems"?le.operators.GT:le.operators.LT;e.fail$data(le._`${r}.length ${n} ${s}`)}};oi.default=Yf});var Kt=ae(function(ci){Object.defineProperty(ci,"__esModule",{value:!0});var ai=Er();ai.code='require("ajv/dist/runtime/equal").default';ci.default=ai});var di=ae(function(li){Object.defineProperty(li,"__esModule",{value:!0});var Xe=ut(),R=Dt(),ui=on(),rh=Kt(),sh={message:({params:{i:e,j:t}})=>R.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>R._`{i: ${e}, j: ${t}}`},nh={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:sh,code(e){let{gen:t,data:r,$data:s,schema:n,parentSchema:o,schemaCode:i,it:a}=e;if(!s&&!n)return;let c=t.let("valid"),u=o.items?Xe.getSchemaTypes(o.items):[];e.block$data(c,l,R._`${i} === false`),e.ok(c);function l(){let p=t.let("i",R._`${r}.length`),h=t.let("j");e.setParams({i:p,j:h}),t.assign(c,!0),t.if(R._`${p} > 1`,()=>(f()?g:y)(p,h))}function f(){return u.length>0&&!u.some((p)=>p==="object"||p==="array")}function g(p,h){let m=t.name("item"),v=Xe.checkDataTypes(u,m,a.opts.strictNumbers,Xe.DataType.Wrong),x=t.const("indices",R._`{}`);t.for(R._`;${p}--;`,()=>{if(t.let(m,R._`${r}[${p}]`),t.if(v,R._`continue`),u.length>1)t.if(R._`typeof ${m} == "string"`,R._`${m} += "_"`);t.if(R._`typeof ${x}[${m}] == "number"`,()=>{t.assign(h,R._`${x}[${m}]`),e.error(),t.assign(c,!1).break()}).code(R._`${x}[${m}] = ${p}`)})}function y(p,h){let m=ui.useFunc(t,rh.default),v=t.name("outer");t.label(v).for(R._`;${p}--;`,()=>t.for(R._`${h} = ${p}; ${h}--;`,()=>t.if(R._`${m}(${r}[${p}], ${r}[${h}])`,()=>{e.error(),t.assign(c,!1).break(v)})))}}};li.default=nh});var pi=ae(function(hi){Object.defineProperty(hi,"__esModule",{value:!0});var Ye=Dt(),fi=on(),ih=Kt(),ah={message:"must be equal to constant",params:({schemaCode:e})=>Ye._`{allowedValue: ${e}}`},ch={keyword:"const",$data:!0,error:ah,code(e){let{gen:t,data:r,$data:s,schemaCode:n,schema:o}=e;if(s||o&&typeof o=="object")e.fail$data(Ye._`!${fi.useFunc(t,ih.default)}(${r}, ${n})`);else e.fail(Ye._`${o} !== ${r}`)}};hi.default=ch});var _i=ae(function(yi){Object.defineProperty(yi,"__esModule",{value:!0});var de=Dt(),mi=on(),lh=Kt(),dh={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>de._`{allowedValues: ${e}}`},fh={keyword:"enum",schemaType:"array",$data:!0,error:dh,code(e){let{gen:t,data:r,$data:s,schema:n,schemaCode:o,it:i}=e;if(!s&&n.length===0)throw Error("enum must have non-empty array");let a=n.length>=i.opts.loopEnum,c,u=()=>c!==null&&c!==void 0?c:c=mi.useFunc(t,lh.default),l;if(a||s)l=t.let("valid"),e.block$data(l,f);else{if(!Array.isArray(n))throw Error("ajv implementation error");let y=t.const("vSchema",o);l=de.or(...n.map((p,h)=>g(y,h)))}e.pass(l);function f(){t.assign(l,!1),t.forOf("v",o,(y)=>t.if(de._`${u()}(${r}, ${y})`,()=>t.assign(l,!0).break()))}function g(y,p){let h=n[p];return typeof h==="object"&&h!==null?de._`${u()}(${r}, ${y}[${p}])`:de._`${r} === ${h}`}}};yi.default=fh});var k0=ae(function(gi){Object.defineProperty(gi,"__esModule",{value:!0});var ph=zo(),mh=Ko(),yh=Wo(),_h=Yo(),gh=ti(),$h=ni(),vh=ii(),wh=di(),Eh=pi(),bh=_i(),Sh=[ph.default,mh.default,yh.default,_h.default,gh.default,$h.default,vh.default,wh.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Eh.default,bh.default];gi.default=Sh});var zr=ae(function(vi){Object.defineProperty(vi,"__esModule",{value:!0});vi.validateAdditionalItems=void 0;var B=Dt(),et=on(),xh={message:({params:{len:e}})=>B.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>B._`{limit: ${e}}`},Oh={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:xh,code(e){let{parentSchema:t,it:r}=e,{items:s}=t;if(!Array.isArray(s)){et.checkStrictMode(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}$i(e,s)}};function $i(e,t){let{gen:r,schema:s,data:n,keyword:o,it:i}=e;i.items=!0;let a=r.const("len",B._`${n}.length`);if(s===!1)e.setParams({len:t.length}),e.pass(B._`${a} <= ${t.length}`);else if(typeof s=="object"&&!et.alwaysValidSchema(i,s)){let u=r.var("valid",B._`${a} <= ${t.length}`);r.if(B.not(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,a,(l)=>{if(e.subschema({keyword:o,dataProp:l,dataPropType:et.Type.Num},u),!i.allErrors)r.if(B.not(u),()=>r.break())})}}vi.validateAdditionalItems=$i;vi.default=Oh});var Ur=ae(function(Si){Object.defineProperty(Si,"__esModule",{value:!0});Si.validateTuple=void 0;var Ht=Dt(),Oe=on(),Ei=Q(),Nh={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return bi(e,"additionalItems",t);if(r.items=!0,Oe.alwaysValidSchema(r,t))return;e.ok(Ei.validateArray(e))}};function bi(e,t,r=e.schema){let{gen:s,parentSchema:n,data:o,keyword:i,it:a}=e;if(l(n),a.opts.unevaluated&&r.length&&a.items!==!0)a.items=Oe.mergeEvaluated.items(s,r.length,a.items);let c=s.name("valid"),u=s.const("len",Ht._`${o}.length`);r.forEach((f,g)=>{if(Oe.alwaysValidSchema(a,f))return;s.if(Ht._`${u} > ${g}`,()=>e.subschema({keyword:i,schemaProp:g,dataProp:g},c)),e.ok(c)});function l(f){let{opts:g,errSchemaPath:y}=a,p=r.length,h=p===f.minItems&&(p===f.maxItems||f[t]===!1);if(g.strictTuples&&!h){let m=`"${i}" is ${p}-tuple, but minItems or maxItems/${t} are not specified or different at path "${y}"`;Oe.checkStrictMode(a,m,g.strictTuples)}}}Si.validateTuple=bi;Si.default=Nh});var ki=ae(function(Oi){Object.defineProperty(Oi,"__esModule",{value:!0});var xi=Ur(),qh={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(e)=>xi.validateTuple(e,"items")};Oi.default=qh});var ji=ae(function(Ii){Object.defineProperty(Ii,"__esModule",{value:!0});var Lt=Dt(),Ni=on(),Ri=Q(),qi=zr(),jh={message:({params:{len:e}})=>Lt.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Lt._`{limit: ${e}}`},Th={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:jh,code(e){let{schema:t,parentSchema:r,it:s}=e,{prefixItems:n}=r;if(s.items=!0,Ni.alwaysValidSchema(s,t))return;if(n)qi.validateAdditionalItems(e,n);else e.ok(Ri.validateArray(e))}};Ii.default=Th});var Ci=ae(function(Ti){Object.defineProperty(Ti,"__esModule",{value:!0});var D=Dt(),ke=on(),Dh={message:({params:{min:e,max:t}})=>t===void 0?D.str`must contain at least ${e} valid item(s)`:D.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?D._`{minContains: ${e}}`:D._`{minContains: ${e}, maxContains: ${t}}`},Ah={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Dh,code(e){let{gen:t,schema:r,parentSchema:s,data:n,it:o}=e,i,a,{minContains:c,maxContains:u}=s;if(o.opts.next)i=c===void 0?1:c,a=u;else i=1;let l=t.const("len",D._`${n}.length`);if(e.setParams({min:i,max:a}),a===void 0&&i===0){ke.checkStrictMode(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&i>a){ke.checkStrictMode(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if(ke.alwaysValidSchema(o,r)){let h=D._`${l} >= ${i}`;if(a!==void 0)h=D._`${h} && ${l} <= ${a}`;e.pass(h);return}o.items=!0;let f=t.name("valid");if(a===void 0&&i===1)y(f,()=>t.if(f,()=>t.break()));else if(i===0){if(t.let(f,!0),a!==void 0)t.if(D._`${n}.length > 0`,g)}else t.let(f,!1),g();e.result(f,()=>e.reset());function g(){let h=t.name("_valid"),m=t.let("count",0);y(h,()=>t.if(h,()=>p(m)))}function y(h,m){t.forRange("i",0,l,(v)=>{e.subschema({keyword:"contains",dataProp:v,dataPropType:ke.Type.Num,compositeRule:!0},h),m()})}function p(h){if(t.code(D._`${h}++`),a===void 0)t.if(D._`${h} >= ${i}`,()=>t.assign(f,!0).break());else if(t.if(D._`${h} > ${a}`,()=>t.assign(f,!1).break()),i===1)t.assign(f,!0);else t.if(D._`${h} >= ${i}`,()=>t.assign(f,!0))}}};Ti.default=Ah});var E0=ae(function(Fi){Object.defineProperty(Fi,"__esModule",{value:!0});Fi.validateSchemaDeps=Fi.validatePropertyDeps=Fi.error=void 0;var tt=Dt(),Di=on(),fe=Q();Fi.error={message:({params:{property:e,depsCount:t,deps:r}})=>tt.str`must have ${t===1?"property":"properties"} ${r} when property ${e} is present`,params:({params:{property:e,depsCount:t,deps:r,missingProperty:s}})=>tt._`{property: ${e},
|
|
6
|
+
missingProperty: ${s},
|
|
7
|
+
depsCount: ${t},
|
|
8
|
+
deps: ${r}}`};var Fh={keyword:"dependencies",type:"object",schemaType:"object",error:Fi.error,code(e){let[t,r]=Vh(e);Ai(e,t),Mi(e,r)}};function Vh({schema:e}){let t={},r={};for(let s in e){if(s==="__proto__")continue;let n=Array.isArray(e[s])?t:r;n[s]=e[s]}return[t,r]}function Ai(e,t=e.schema){let{gen:r,data:s,it:n}=e;if(Object.keys(t).length===0)return;let o=r.let("missing");for(let i in t){let a=t[i];if(a.length===0)continue;let c=fe.propertyInData(r,s,i,n.opts.ownProperties);if(e.setParams({property:i,depsCount:a.length,deps:a.join(", ")}),n.allErrors)r.if(c,()=>{for(let u of a)fe.checkReportMissingProp(e,u)});else r.if(tt._`${c} && (${fe.checkMissingProp(e,a,o)})`),fe.reportMissingProp(e,o),r.else()}}Fi.validatePropertyDeps=Ai;function Mi(e,t=e.schema){let{gen:r,data:s,keyword:n,it:o}=e,i=r.name("valid");for(let a in t){if(Di.alwaysValidSchema(o,t[a]))continue;r.if(fe.propertyInData(r,s,a,o.opts.ownProperties),()=>{let c=e.subschema({keyword:n,schemaProp:a},i);e.mergeValidEvaluated(c,i)},()=>r.var(i,!0)),e.ok(i)}}Fi.validateSchemaDeps=Mi;Fi.default=Fh});var Hi=ae(function(Ki){Object.defineProperty(Ki,"__esModule",{value:!0});var Gt=Dt(),Ui=on(),Kh={message:"property name must be valid",params:({params:e})=>Gt._`{propertyName: ${e.propertyName}}`},Hh={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Kh,code(e){let{gen:t,schema:r,data:s,it:n}=e;if(Ui.alwaysValidSchema(n,r))return;let o=t.name("valid");t.forIn("key",s,(i)=>{e.setParams({propertyName:i}),e.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},o),t.if(Gt.not(o),()=>{if(e.error(!0),!n.allErrors)t.break()})}),e.ok(o)}};Ki.default=Hh});var Kr=ae(function(Li){Object.defineProperty(Li,"__esModule",{value:!0});var Ne=Q(),V=Dt(),Gh=Pl(),Re=on(),Jh={message:"must NOT have additional properties",params:({params:e})=>V._`{additionalProperty: ${e.additionalProperty}}`},Bh={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Jh,code(e){let{gen:t,schema:r,parentSchema:s,data:n,errsCount:o,it:i}=e;if(!o)throw Error("ajv implementation error");let{allErrors:a,opts:c}=i;if(i.props=!0,c.removeAdditional!=="all"&&Re.alwaysValidSchema(i,r))return;let u=Ne.allSchemaProperties(s.properties),l=Ne.allSchemaProperties(s.patternProperties);f(),e.ok(V._`${o} === ${Gh.default.errors}`);function f(){t.forIn("key",n,(m)=>{if(!u.length&&!l.length)p(m);else t.if(g(m),()=>p(m))})}function g(m){let v;if(u.length>8){let x=Re.schemaRefOrVal(i,s.properties,"properties");v=Ne.isOwnProperty(t,x,m)}else if(u.length)v=V.or(...u.map((x)=>V._`${m} === ${x}`));else v=V.nil;if(l.length)v=V.or(v,...l.map((x)=>V._`${Ne.usePattern(e,x)}.test(${m})`));return V.not(v)}function y(m){t.code(V._`delete ${n}[${m}]`)}function p(m){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){y(m);return}if(r===!1){if(e.setParams({additionalProperty:m}),e.error(),!a)t.break();return}if(typeof r=="object"&&!Re.alwaysValidSchema(i,r)){let v=t.name("valid");if(c.removeAdditional==="failing")h(m,v,!1),t.if(V.not(v),()=>{e.reset(),y(m)});else if(h(m,v),!a)t.if(V.not(v),()=>t.break())}}function h(m,v,x){let O={keyword:"additionalProperties",dataProp:m,dataPropType:Re.Type.Str};if(x===!1)Object.assign(O,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(O,v)}}};Li.default=Bh});var Wi=ae(function(Bi){Object.defineProperty(Bi,"__esModule",{value:!0});var Ji=Mf(),Jt=Q(),rt=on(),Gi=Kr(),Qh={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:s,data:n,it:o}=e;if(o.opts.removeAdditional==="all"&&s.additionalProperties===void 0)Gi.default.code(new Ji.KeywordCxt(o,Gi.default,"additionalProperties"));let i=Jt.allSchemaProperties(r);for(let f of i)o.definedProperties.add(f);if(o.opts.unevaluated&&i.length&&o.props!==!0)o.props=rt.mergeEvaluated.props(t,rt.toHash(i),o.props);let a=i.filter((f)=>!rt.alwaysValidSchema(o,r[f]));if(a.length===0)return;let c=t.name("valid");for(let f of a){if(u(f))l(f);else{if(t.if(Jt.propertyInData(t,n,f,o.opts.ownProperties)),l(f),!o.allErrors)t.else().var(c,!0);t.endIf()}e.it.definedProperties.add(f),e.ok(c)}function u(f){return o.opts.useDefaults&&!o.compositeRule&&r[f].default!==void 0}function l(f){e.subschema({keyword:"properties",schemaProp:f,dataProp:f},c)}}};Bi.default=Qh});var Zi=ae(function(Qi){Object.defineProperty(Qi,"__esModule",{value:!0});var Bt=Q(),qe=Dt(),Wt=on(),Qt=on(),Xh={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:s,parentSchema:n,it:o}=e,{opts:i}=o,a=Bt.allSchemaProperties(r),c=a.filter((h)=>Wt.alwaysValidSchema(o,r[h]));if(a.length===0||c.length===a.length&&(!o.opts.unevaluated||o.props===!0))return;let u=i.strictSchema&&!i.allowMatchingProperties&&n.properties,l=t.name("valid");if(o.props!==!0&&!(o.props instanceof qe.Name))o.props=Qt.evaluatedPropsToName(t,o.props);let{props:f}=o;g();function g(){for(let h of a){if(u)y(h);if(o.allErrors)p(h);else t.var(l,!0),p(h),t.if(l)}}function y(h){for(let m in u)if(new RegExp(h).test(m))Wt.checkStrictMode(o,`property ${m} matches pattern ${h} (use allowMatchingProperties)`)}function p(h){t.forIn("key",s,(m)=>{t.if(qe._`${Bt.usePattern(e,h)}.test(${m})`,()=>{let v=c.includes(h);if(!v)e.subschema({keyword:"patternProperties",schemaProp:h,dataProp:m,dataPropType:Qt.Type.Str},l);if(o.opts.unevaluated&&f!==!0)t.assign(qe._`${f}[${m}]`,!0);else if(!v&&!o.allErrors)t.if(qe.not(l),()=>t.break())})})}}};Qi.default=Xh});var ea=ae(function(Yi){Object.defineProperty(Yi,"__esModule",{value:!0});var Xi=on(),ep={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:s}=e;if(Xi.alwaysValidSchema(s,r)){e.fail();return}let n=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},n),e.failResult(n,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Yi.default=ep});var sa=ae(function(ra){Object.defineProperty(ra,"__esModule",{value:!0});var ta=Q(),rp={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:ta.validateUnion,error:{message:"must match a schema in anyOf"}};ra.default=rp});var ia=ae(function(oa){Object.defineProperty(oa,"__esModule",{value:!0});var Ie=Dt(),na=on(),np={message:"must match exactly one schema in oneOf",params:({params:e})=>Ie._`{passingSchemas: ${e.passing}}`},op={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:np,code(e){let{gen:t,schema:r,parentSchema:s,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(n.opts.discriminator&&s.discriminator)return;let o=r,i=t.let("valid",!1),a=t.let("passing",null),c=t.name("_valid");e.setParams({passing:a}),t.block(u),e.result(i,()=>e.reset(),()=>e.error(!0));function u(){o.forEach((l,f)=>{let g;if(na.alwaysValidSchema(n,l))t.var(c,!0);else g=e.subschema({keyword:"oneOf",schemaProp:f,compositeRule:!0},c);if(f>0)t.if(Ie._`${c} && ${i}`).assign(i,!1).assign(a,Ie._`[${a}, ${f}]`).else();t.if(c,()=>{if(t.assign(i,!0),t.assign(a,f),g)e.mergeEvaluated(g,Ie.Name)})})}}};oa.default=op});var ua=ae(function(ca){Object.defineProperty(ca,"__esModule",{value:!0});var aa=on(),ap={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");let n=t.name("valid");r.forEach((o,i)=>{if(aa.alwaysValidSchema(s,o))return;let a=e.subschema({keyword:"allOf",schemaProp:i},n);e.ok(n),e.mergeEvaluated(a)})}};ca.default=ap});var fa=ae(function(da){Object.defineProperty(da,"__esModule",{value:!0});var je=Dt(),Zt=on(),up={message:({params:e})=>je.str`must match "${e.ifClause}" schema`,params:({params:e})=>je._`{failingKeyword: ${e.ifClause}}`},lp={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:up,code(e){let{gen:t,parentSchema:r,it:s}=e;if(r.then===void 0&&r.else===void 0)Zt.checkStrictMode(s,'"if" without "then" and "else" is ignored');let n=la(s,"then"),o=la(s,"else");if(!n&&!o)return;let i=t.let("valid",!0),a=t.name("_valid");if(c(),e.reset(),n&&o){let l=t.let("ifClause");e.setParams({ifClause:l}),t.if(a,u("then",l),u("else",l))}else if(n)t.if(a,u("then"));else t.if(je.not(a),u("else"));e.pass(i,()=>e.error(!0));function c(){let l=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(l)}function u(l,f){return()=>{let g=e.subschema({keyword:l},a);if(t.assign(i,a),e.mergeValidEvaluated(g,i),f)t.assign(f,je._`${l}`);else e.setParams({ifClause:l})}}}};function la(e,t){let r=e.schema[t];return r!==void 0&&!Zt.alwaysValidSchema(e,r)}da.default=lp});var ma=ae(function(pa){Object.defineProperty(pa,"__esModule",{value:!0});var ha=on(),fp={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){if(t.if===void 0)ha.checkStrictMode(r,`"${e}" without "if" is ignored`)}};pa.default=fp});var T0=ae(function(ya){Object.defineProperty(ya,"__esModule",{value:!0});var pp=zr(),mp=ki(),yp=Ur(),_p=ji(),gp=Ci(),$p=E0(),vp=Hi(),wp=Kr(),Ep=Wi(),bp=Zi(),Sp=ea(),Pp=sa(),xp=ia(),Op=ua(),kp=fa(),Np=ma();function Rp(e=!1){let t=[Sp.default,Pp.default,xp.default,Op.default,kp.default,Np.default,vp.default,wp.default,$p.default,Ep.default,bp.default];if(e)t.push(mp.default,_p.default);else t.push(pp.default,yp.default);return t.push(gp.default),t}ya.default=Rp});var ga=ae(function(_a){Object.defineProperty(_a,"__esModule",{value:!0});var N=Dt(),Ip={message:({schemaCode:e})=>N.str`must match format "${e}"`,params:({schemaCode:e})=>N._`{format: ${e}}`},jp={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Ip,code(e,t){let{gen:r,data:s,$data:n,schema:o,schemaCode:i,it:a}=e,{opts:c,errSchemaPath:u,schemaEnv:l,self:f}=a;if(!c.validateFormats)return;if(n)g();else y();function g(){let p=r.scopeValue("formats",{ref:f.formats,code:c.code.formats}),h=r.const("fDef",N._`${p}[${i}]`),m=r.let("fType"),v=r.let("format");r.if(N._`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(m,N._`${h}.type || "string"`).assign(v,N._`${h}.validate`),()=>r.assign(m,N._`"string"`).assign(v,h)),e.fail$data(N.or(x(),O()));function x(){if(c.strictSchema===!1)return N.nil;return N._`${i} && !${v}`}function O(){let j=l.$async?N._`(${h}.async ? await ${v}(${s}) : ${v}(${s}))`:N._`${v}(${s})`,k=N._`(typeof ${v} == "function" ? ${j} : ${v}.test(${s}))`;return N._`${v} && ${v} !== true && ${m} === ${t} && !${k}`}}function y(){let p=f.formats[o];if(!p){x();return}if(p===!0)return;let[h,m,v]=O(p);if(h===t)e.pass(j());function x(){if(c.strictSchema===!1){f.logger.warn(k());return}throw Error(k());function k(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function O(k){let ee=k instanceof RegExp?N.regexpCode(k):c.code.formats?N._`${c.code.formats}${N.getProperty(o)}`:void 0,he=r.scopeValue("formats",{key:o,ref:k,code:ee});if(typeof k=="object"&&!(k instanceof RegExp))return[k.type||"string",k.validate,N._`${he}.validate`];return["string",k,he]}function j(){if(typeof p=="object"&&!(p instanceof RegExp)&&p.async){if(!l.$async)throw Error("async format in sync schema");return N._`await ${v}(${s})`}return typeof m=="function"?N._`${v}(${s})`:N._`${v}.test(${s})`}}}};_a.default=jp});var L0=ae(function($a){Object.defineProperty($a,"__esModule",{value:!0});var Cp=ga(),Dp=[Cp.default];$a.default=Dp});var R0=ae(function(va){Object.defineProperty(va,"__esModule",{value:!0});va.contentVocabulary=va.metadataVocabulary=void 0;va.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];va.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Pa=ae(function(ba){Object.defineProperty(ba,"__esModule",{value:!0});ba.DiscrError=void 0;var Ea;(function(e){e.Tag="tag",e.Mapping="mapping"})(Ea||(ba.DiscrError=Ea={}))});var $0=ae(function(Oa){Object.defineProperty(Oa,"__esModule",{value:!0});var X=Dt(),st=Pa(),Xt=iw(),Fp=Ff(),xa=on(),Vp={message:({params:{discrError:e,tagName:t}})=>e===st.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>X._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},zp={keyword:"discriminator",type:"object",schemaType:"object",error:Vp,code(e){let{gen:t,data:r,schema:s,parentSchema:n,it:o}=e,{oneOf:i}=n;if(!o.opts.discriminator)throw Error("discriminator: requires discriminator option");let a=s.propertyName;if(typeof a!="string")throw Error("discriminator: requires propertyName");if(s.mapping)throw Error("discriminator: mapping is not supported");if(!i)throw Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),u=t.const("tag",X._`${r}${X.getProperty(a)}`);t.if(X._`typeof ${u} == "string"`,()=>l(),()=>e.error(!1,{discrError:st.DiscrError.Tag,tag:u,tagName:a})),e.ok(c);function l(){let y=g();t.if(!1);for(let p in y)t.elseIf(X._`${u} === ${p}`),t.assign(c,f(y[p]));t.else(),e.error(!1,{discrError:st.DiscrError.Mapping,tag:u,tagName:a}),t.endIf()}function f(y){let p=t.name("valid"),h=e.subschema({keyword:"oneOf",schemaProp:y},p);return e.mergeEvaluated(h,X.Name),p}function g(){var y;let p={},h=v(n),m=!0;for(let j=0;j<i.length;j++){let k=i[j];if((k===null||k===void 0?void 0:k.$ref)&&!xa.schemaHasRulesButRef(k,o.self.RULES)){let he=k.$ref;if(k=Xt.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,he),k instanceof Xt.SchemaEnv)k=k.schema;if(k===void 0)throw new Fp.default(o.opts.uriResolver,o.baseId,he)}let ee=(y=k===null||k===void 0?void 0:k.properties)===null||y===void 0?void 0:y[a];if(typeof ee!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);m=m&&(h||v(k)),x(ee,j)}if(!m)throw Error(`discriminator: "${a}" must be required`);return p;function v({required:j}){return Array.isArray(j)&&j.includes(a)}function x(j,k){if(j.const)O(j.const,k);else if(j.enum)for(let ee of j.enum)O(ee,k);else throw Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function O(j,k){if(typeof j!="string"||j in p)throw Error(`discriminator: "${a}" values must be unique strings`);p[j]=k}}}};Oa.default=zp});
|
|
9
|
+
export{Dt,on,Pl,Mf,Yg,Ff,iw,_0,S0,C0,k0,E0,T0,L0,R0,$0};
|
|
10
|
+
|
|
11
|
+
//# debugId=5F8E69A1059F95A464756E2164756E21
|
|
12
|
+
//# sourceMappingURL=studio-zey7zsdw.js.map
|