frameboard 0.47.0 → 0.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +91 -25
- package/dist/client/assets/index-BamvK2uK.css +2 -0
- package/dist/client/assets/{index-DyIuDdJY.js → index-JezGKuvY.js} +26 -26
- package/dist/client/index.html +2 -2
- package/dist/frame-bridge.js +8 -8
- package/package.json +1 -1
- package/dist/client/assets/index-7T-3-XIO.css +0 -2
package/dist/client/index.html
CHANGED
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
matchMedia('(prefers-color-scheme: dark)').matches),
|
|
24
24
|
)
|
|
25
25
|
</script>
|
|
26
|
-
<script type="module" crossorigin src="/assets/index-
|
|
27
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
26
|
+
<script type="module" crossorigin src="/assets/index-JezGKuvY.js"></script>
|
|
27
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BamvK2uK.css">
|
|
28
28
|
</head>
|
|
29
29
|
<body>
|
|
30
30
|
<div id="root"></div>
|
package/dist/frame-bridge.js
CHANGED
|
@@ -112,7 +112,7 @@ function va(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...S(n)})}//
|
|
|
112
112
|
function ya(e,t){let n=/* @__PURE__ */ ba(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Ne(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Ne(r))}},e(t.value,t)),t);return n}// @__NO_SIDE_EFFECTS__
|
|
113
113
|
function ba(e,t){let n=new A({check:`custom`,...S(t)});return n._zod.check=e,n}function xa(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&m(e,t,n[t]);return e}function Sa(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??hi,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:/* @__PURE__ */ new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function N(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function P(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,P(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&xa(o.schema,c),t.io===`input`&&F(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Ca(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function wa(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=/* @__PURE__ */ new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${Ca(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+Ca(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
114
114
|
|
|
115
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function Ta(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Ta(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}let Ea=/* @__PURE__ */ new Set([`type`,`properties`,`required`,`additionalProperties`]),Da=[`oneOf`,`anyOf`];function Oa(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function ka(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Ea.has(e))return null;t.push(n)}let n={},r=/* @__PURE__ */ new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Oa(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}m(n,r,e.length===1?e[0]:ka(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Oa(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Aa(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Ea)if(t in e)return;let n=t.filter(e=>Da.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=ka(t);else{let e=n[0],i=Da.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>ka([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,xa(e,r))}function ja(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):xa(i,s),xa(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Ta(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Aa(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}xa(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,m(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Na(t,`input`,e.processors),output:Na(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function F(e,t){let n=t??{seen:/* @__PURE__ */ new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return F(r.element,n);if(r.type===`set`)return F(r.valueType,n);if(r.type===`lazy`)return F(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return F(r.innerType,n);if(r.type===`intersection`)return F(r.left,n)||F(r.right,n);if(r.type===`record`||r.type===`map`)return F(r.keyType,n)||F(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:F(r.in,n)||F(r.out,n);if(r.type===`object`){for(let e in r.shape)if(F(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(F(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(F(e,n))return!0;return!!(r.rest&&F(r.rest,n))}return!1}let Ma=(e,t={})=>n=>{let r=Sa({...n,processors:t});return P(e,r),wa(r,e),ja(r,e)},Na=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Sa({...i??{},target:a,io:t,processors:n});return P(e,o),wa(o,e),ja(o,e)},Pa=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Fa=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Ia=(e,t)=>{Pa(e,`minimum`,t),Fa(e,`maximum`,t)},La=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Ra=(e,t)=>{e.patterns??=/* @__PURE__ */ new Set,e.patterns.add(t)},za=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Ba=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Va=(e,t)=>Pa(e,`minimum`,t.minimum),Ha=(e,t)=>Fa(e,`maximum`,t.maximum),Ua=e=>(t,n)=>{Ba(t,n.format);let[r,i]=e[n.format];Pa(t,`minimum`,r),Fa(t,`maximum`,i)},Wa={greater_than:(e,t)=>Pa(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>Fa(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>La(e,t.value),number_format:Ua(fe),bigint_format:Ua(pe),min_length:Va,max_length:Ha,length_equals:(e,t)=>Ia(e,t.length),min_size:Va,max_size:Ha,size_equals:(e,t)=>Ia(e,t.size),string_format:(e,t)=>{Ba(e,t.format),t.pattern&&Ra(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>za(e,t.mime)};function I(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Wa[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Pa(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Pa(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&Fa(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&Fa(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&La(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&za(t,i.mime);for(let e of i.patterns??[])Ra(t,e);return t}let Ga={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Ka=/* @__PURE__ */ new Map([[tr,zt],[rr,Bt]]),qa=e=>Ka.get(e)??e,Ja=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=I(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Ga[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(qa);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Ya=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=I(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=/* @__PURE__ */ new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):N(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},Xa=(e,t,n,r)=>{n.type=`boolean`},Za=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Qa=(e,t,n,r)=>{n.not={}},$a=(e,t,n,r)=>{let i=e._zod.def,a=o(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},eo=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(N(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(N(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},to=(e,t,n,r)=>{N(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},no=(e,t,n,r)=>{N(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},ro=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=I(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=P(a.element,t,{...r,path:[...r.path,`items`]})};function io(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?io(t.out):t.type===`catch`?io(t.innerType):e._zod.optin}let ao=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&N(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)m(i.properties,e,P(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?io(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=P(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},oo=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>P(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},so=(e,t,n,r)=>{let i=e._zod.def,a=P(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=P(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},co=(e,t,n,r)=>{let i=e._zod.def,a=P(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},lo=(e,t,n,r)=>{let i=e._zod.def;P(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},uo=Symbol();function fo(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(N(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),uo):JSON.parse(o)}let po=(e,t,n,r)=>{let i=e._zod.def;P(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=fo(i.defaultValue,e,t,n,r);o!==uo&&(n.default=o)},mo=(e,t,n,r)=>{let i=e._zod.def;P(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=fo(i.defaultValue,e,t,n,r);o!==uo&&(n._prefault=o)},ho=(e,t,n,r)=>{let i=e._zod.def;P(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{N(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},go=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;P(o,t,r);let s=t.seen.get(e);s.ref=o},_o=(e,t,n,r)=>{let i=e._zod.def;P(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},vo=(e,t,n,r)=>{let i=e._zod.def;P(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},yo=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]);function bo(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}let L=/*@__PURE__*/ E(`ZodError`,(e,t)=>{et.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);yo.has(n)||(yo.add(n),bo(n,`format`,e=>t=>rt(e,t)),bo(n,`flatten`,e=>t=>nt(e,t)),bo(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,c,2)}),bo(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,c,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),xo=/* @__PURE__ */ at(L),So=/* @__PURE__ */ ot(L),Co=/* @__PURE__ */ st(L),wo=/* @__PURE__ */ lt(L),To=/* @__PURE__ */ ht(L),Eo=/* @__PURE__ */ gt(L),Do=/* @__PURE__ */ _t(L),Oo=/* @__PURE__ */ vt(L),ko=/* @__PURE__ */ yt(L),Ao=/* @__PURE__ */ bt(L),jo=/* @__PURE__ */ xt(L),Mo=/* @__PURE__ */ St(L);function No(){O.localeError||k(di())}function Po(){O.memoizer||k({memoizer:ci()})}let R=/*@__PURE__*/ E(`ZodType`,(e,t)=>(No(),j.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(y(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return x(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ks(e,t))},superRefine(e,t){return this.check(qs(e,t))},overwrite(e){return this.check(/* @__PURE__ */ ua(e))},optional(){return Ds(this)},exactOptional(){return ks(this)},nullable(){return js(this)},nullish(){return Ds(js(this))},nonoptional(e){return Ls(this,e)},array(){return U(this)},or(e){return ys([this,e])},and(e){return xs(this,e)},transform(e){return Vs(this,Ts(e))},default(e){return Ns(this,e)},prefault(e){return Fs(this,e)},catch(e){return zs(this,e)},pipe(e){return Vs(this,e)},readonly(){return Us(this)},describe(e){let t=this.clone();return hi.add(t,{description:e}),t},meta(...e){if(e.length===0)return hi.get(this);let t=this.clone();return hi.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Fe(this,`~standard`,{...Cn(this),jsonSchema:{input:Na(this,`input`),output:Na(this,`output`)}})},set"~standard"(e){w(this,`~standard`,e)},parse:function e(t,n){return xo(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await So(this,t,n,{callee:e})},safeParse(e,t){return Co(this,e,t)},async safeParseAsync(e,t){return wo(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){w(this,`spa`,e)},validate(e,t){return ft(this,e,t)},validateAsync(e,t){return mt(this,e,t)},encode:function e(t,n){return To(this,t,n,{callee:e})},decode:function e(t,n){return Eo(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Do(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Oo(this,t,n,{callee:e})},safeEncode(e,t){return ko(this,e,t)},safeDecode(e,t){return Ao(this,e,t)},async safeEncodeAsync(e,t){return jo(this,e,t)},async safeDecodeAsync(e,t){return Mo(this,e,t)},toJSONSchema(e){return Ma(this,{})(e)},get description(){return hi.get(this)?.description},get _def(){return this._zod.def}}),Fo=/*@__PURE__*/ E(`_ZodString`,(e,t)=>{wn.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ja(e,t,n,r)},/*@__PURE__*/ Ie({format:e=>I(e).format??null,minLength:e=>I(e).minimum??null,maxLength:e=>I(e).maximum??null},{regex(...e){return this.check(/* @__PURE__ */ ia(...e))},includes(...e){return this.check(/* @__PURE__ */ sa(...e))},startsWith(...e){return this.check(/* @__PURE__ */ ca(...e))},endsWith(...e){return this.check(/* @__PURE__ */ la(...e))},min(...e){return this.check(/* @__PURE__ */ na(...e))},max(...e){return this.check(/* @__PURE__ */ ta(...e))},length(...e){return this.check(/* @__PURE__ */ ra(...e))},nonempty(...e){return this.check(/* @__PURE__ */ na(1,...e))},lowercase(e){return this.check(/* @__PURE__ */ aa(e))},uppercase(e){return this.check(/* @__PURE__ */ oa(e))},trim(){return this.check(/* @__PURE__ */ fa())},normalize(...e){return this.check(/* @__PURE__ */ da(...e))},toLowerCase(){return this.check(/* @__PURE__ */ pa())},toUpperCase(){return this.check(/* @__PURE__ */ ma())},slugify(){return this.check(/* @__PURE__ */ ha())}})),Io=/*@__PURE__*/ E(`ZodString`,(e,t)=>{wn.init(e,t),Fo.init(e,t)},{email(e){return this.check(/* @__PURE__ */ vi(Vo,e))},url(e){return this.check(/* @__PURE__ */ wi(Wo,e))},jwt(e){return this.check(/* @__PURE__ */ zi(as,e))},emoji(e){return this.check(/* @__PURE__ */ Ti(Go,e))},guid(e){return this.check(/* @__PURE__ */ yi(Ho,e))},uuid(e){return this.check(/* @__PURE__ */ bi(Uo,e))},uuidv4(e){return this.check(/* @__PURE__ */ xi(Uo,e))},uuidv6(e){return this.check(/* @__PURE__ */ Si(Uo,e))},uuidv7(e){return this.check(/* @__PURE__ */ Ci(Uo,e))},nanoid(e){return this.check(/* @__PURE__ */ Ei(Ko,e))},cuid(e){return this.check(/* @__PURE__ */ Di(qo,e))},cuid2(e){return this.check(/* @__PURE__ */ Oi(Jo,e))},ulid(e){return this.check(/* @__PURE__ */ ki(Yo,e))},base64(e){return this.check(/* @__PURE__ */ Ii(ns,e))},base64url(e){return this.check(/* @__PURE__ */ Li(rs,e))},xid(e){return this.check(/* @__PURE__ */ Ai(Xo,e))},ksuid(e){return this.check(/* @__PURE__ */ ji(Zo,e))},ipv4(e){return this.check(/* @__PURE__ */ Mi(Qo,e))},ipv6(e){return this.check(/* @__PURE__ */ Ni($o,e))},cidrv4(e){return this.check(/* @__PURE__ */ Pi(es,e))},cidrv6(e){return this.check(/* @__PURE__ */ Fi(ts,e))},e164(e){return this.check(/* @__PURE__ */ Ri(is,e))},datetime(e){return this.check(/* @__PURE__ */ Bi(Lo,e))},date(e){return this.check(/* @__PURE__ */ Vi(Ro,e))},time(e){return this.check(/* @__PURE__ */ Hi(zo,e))},duration(e){return this.check(/* @__PURE__ */ Ui(Bo,e))}});function z(e){return/* @__PURE__ */ _i(Io,e)}let B=/*@__PURE__*/ E(`ZodStringFormat`,(e,t)=>{M.init(e,t),Fo.init(e,t)}),Lo=/*@__PURE__*/ E(`ZodISODateTime`,(e,t)=>{Un.init(e,t),B.init(e,t)}),Ro=/*@__PURE__*/ E(`ZodISODate`,(e,t)=>{Wn.init(e,t),B.init(e,t)}),zo=/*@__PURE__*/ E(`ZodISOTime`,(e,t)=>{Gn.init(e,t),B.init(e,t)}),Bo=/*@__PURE__*/ E(`ZodISODuration`,(e,t)=>{Kn.init(e,t),B.init(e,t)}),Vo=/*@__PURE__*/ E(`ZodEmail`,(e,t)=>{Dn.init(e,t),B.init(e,t)}),Ho=/*@__PURE__*/ E(`ZodGUID`,(e,t)=>{Tn.init(e,t),B.init(e,t)}),Uo=/*@__PURE__*/ E(`ZodUUID`,(e,t)=>{En.init(e,t),B.init(e,t)}),Wo=/*@__PURE__*/ E(`ZodURL`,(e,t)=>{Fn.init(e,t),B.init(e,t)}),Go=/*@__PURE__*/ E(`ZodEmoji`,(e,t)=>{In.init(e,t),B.init(e,t)}),Ko=/*@__PURE__*/ E(`ZodNanoID`,(e,t)=>{Ln.init(e,t),B.init(e,t)}),qo=/*@__PURE__*/ E(`ZodCUID`,(e,t)=>{Rn.init(e,t),B.init(e,t)}),Jo=/*@__PURE__*/ E(`ZodCUID2`,(e,t)=>{zn.init(e,t),B.init(e,t)}),Yo=/*@__PURE__*/ E(`ZodULID`,(e,t)=>{Bn.init(e,t),B.init(e,t)}),Xo=/*@__PURE__*/ E(`ZodXID`,(e,t)=>{Vn.init(e,t),B.init(e,t)}),Zo=/*@__PURE__*/ E(`ZodKSUID`,(e,t)=>{Hn.init(e,t),B.init(e,t)}),Qo=/*@__PURE__*/ E(`ZodIPv4`,(e,t)=>{qn.init(e,t),B.init(e,t)}),$o=/*@__PURE__*/ E(`ZodIPv6`,(e,t)=>{Xn.init(e,t),B.init(e,t)}),es=/*@__PURE__*/ E(`ZodCIDRv4`,(e,t)=>{Zn.init(e,t),B.init(e,t)}),ts=/*@__PURE__*/ E(`ZodCIDRv6`,(e,t)=>{$n.init(e,t),B.init(e,t)}),ns=/*@__PURE__*/ E(`ZodBase64`,(e,t)=>{nr.init(e,t),B.init(e,t)}),rs=/*@__PURE__*/ E(`ZodBase64URL`,(e,t)=>{ar.init(e,t),B.init(e,t)}),is=/*@__PURE__*/ E(`ZodE164`,(e,t)=>{or.init(e,t),B.init(e,t)}),as=/*@__PURE__*/ E(`ZodJWT`,(e,t)=>{cr.init(e,t),B.init(e,t)}),os=/*@__PURE__*/ E(`ZodNumber`,(e,t)=>{lr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ya(e,t,n,r),e.isFinite=!0},/*@__PURE__*/ Ie({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=I(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=I(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=I(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>I(e).format??null},{gt(e,t){return this.check(/* @__PURE__ */ Qi(e,t))},gte(e,t){return this.check(/* @__PURE__ */ $i(e,t))},min(e,t){return this.check(/* @__PURE__ */ $i(e,t))},lt(e,t){return this.check(/* @__PURE__ */ Xi(e,t))},lte(e,t){return this.check(/* @__PURE__ */ Zi(e,t))},max(e,t){return this.check(/* @__PURE__ */ Zi(e,t))},int(e){return this.check(cs(e))},safe(e){return this.check(cs(e))},positive(e){return this.check(/* @__PURE__ */ Qi(0,e))},nonnegative(e){return this.check(/* @__PURE__ */ $i(0,e))},negative(e){return this.check(/* @__PURE__ */ Xi(0,e))},nonpositive(e){return this.check(/* @__PURE__ */ Zi(0,e))},multipleOf(e,t){return this.check(/* @__PURE__ */ ea(e,t))},step(e,t){return this.check(/* @__PURE__ */ ea(e,t))},finite(){return this}}));function V(e){return/* @__PURE__ */ Wi(os,e)}let ss=/*@__PURE__*/ E(`ZodNumberFormat`,(e,t)=>{ur.init(e,t),os.init(e,t)});function cs(e){return/* @__PURE__ */ Gi(ss,e)}let ls=/*@__PURE__*/ E(`ZodBoolean`,(e,t)=>{dr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xa(e,t,n,r)});function H(e){return/* @__PURE__ */ Ki(ls,e)}let us=/*@__PURE__*/ E(`ZodNull`,(e,t)=>{fr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Za(e,t,n,r)});function ds(e){return/* @__PURE__ */ qi(us,e)}let fs=/*@__PURE__*/ E(`ZodUnknown`,(e,t)=>{pr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function ps(){return/* @__PURE__ */ Ji(fs)}let ms=/*@__PURE__*/ E(`ZodNever`,(e,t)=>{mr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qa(e,t,n,r)});function hs(e){return/* @__PURE__ */ Yi(ms,e)}let gs=/*@__PURE__*/ E(`ZodArray`,(e,t)=>{Po(),vr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ro(e,t,n,r),e.element=t.element},{min(e,t){return this.check(/* @__PURE__ */ na(e,t))},nonempty(e){return this.check(/* @__PURE__ */ na(1,e))},max(e,t){return this.check(/* @__PURE__ */ ta(e,t))},length(e,t){return this.check(/* @__PURE__ */ ra(e,t))},unwrap(){return this.element}});function U(e,t){return/* @__PURE__ */ ga(gs,e,t)}let _s=/*@__PURE__*/ E(`ZodObject`,(e,t)=>{Po(),wr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ao(e,t,n,r),He(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return G(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(y(this._zod.def,{catchall:e}))},passthrough(){return this.clone(y(this._zod.def,{catchall:ps()}))},loose(){return this.clone(y(this._zod.def,{catchall:ps()}))},strict(){return this.clone(y(this._zod.def,{catchall:hs()}))},strip(){return this.clone(y(this._zod.def,{catchall:void 0}))},extend(e){return _e(this,e)},safeExtend(e){return ye(this,e)},merge(e){return be(this,e)},pick(e){return me(this,e)},omit(e){return ge(this,e)},partial(...e){return xe(Es,this,e[0])},exactPartial(...e){return xe(Os,this,e[0],`exactPartial`)},required(...e){return Se(Is,this,e[0])}});function W(e,t){let n={type:`object`,shape:e??{},...S(t)};return new _s(n)}let vs=/*@__PURE__*/ E(`ZodUnion`,(e,t)=>{Er.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oo(e,t,n,r),e.options=t.options});function ys(e,t){return new vs({type:`union`,options:e,...S(t)})}let bs=/*@__PURE__*/ E(`ZodIntersection`,(e,t)=>{Dr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>so(e,t,n,r)});function xs(e,t){return new bs({type:`intersection`,left:e,right:t})}let Ss=/*@__PURE__*/ E(`ZodEnum`,(e,t)=>{Ar.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$a(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Ss({...t,checks:[],...S(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Ss({...t,checks:[],...S(r),entries:i})}});function G(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new Ss({type:`enum`,entries:n,...S(t)})}let Cs=/*@__PURE__*/ E(`ZodLiteral`,(e,t)=>{jr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eo(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function K(e,t){return new Cs({type:`literal`,values:Array.isArray(e)?e:[e],...S(t)})}let ws=/*@__PURE__*/ E(`ZodTransform`,(e,t)=>{Po(),Mr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>no(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Je(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Ne(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Ne(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Ts(e){return new ws({type:`transform`,transform:e})}let Es=/*@__PURE__*/ E(`ZodOptional`,(e,t)=>{Pr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ds(e){return new Es({type:`optional`,innerType:e})}let Os=/*@__PURE__*/ E(`ZodExactOptional`,(e,t)=>{Fr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ks(e){return new Os({type:`optional`,innerType:e})}let As=/*@__PURE__*/ E(`ZodNullable`,(e,t)=>{Ir.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>co(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function js(e){return new As({type:`nullable`,innerType:e})}let Ms=/*@__PURE__*/ E(`ZodDefault`,(e,t)=>{Lr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>po(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ns(e,t){return new Ms({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():se(t)}})}let Ps=/*@__PURE__*/ E(`ZodPrefault`,(e,t)=>{zr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Fs(e,t){return new Ps({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():se(t)}})}let Is=/*@__PURE__*/ E(`ZodNonOptional`,(e,t)=>{Br.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ls(e,t){return new Is({type:`nonoptional`,innerType:e,...S(t)})}let Rs=/*@__PURE__*/ E(`ZodCatch`,(e,t)=>{Ur.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ho(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function zs(e,t){return new Rs({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Ue(t)})}let Bs=/*@__PURE__*/ E(`ZodPipe`,(e,t)=>{Wr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>go(e,t,n,r),e.in=t.in,e.out=t.out});function Vs(e,t){return new Bs({type:`pipe`,in:e,out:t})}let Hs=/*@__PURE__*/ E(`ZodReadonly`,(e,t)=>{Kr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_o(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Us(e){return new Hs({type:`readonly`,innerType:e})}let Ws=/*@__PURE__*/ E(`ZodCustom`,(e,t)=>{Jr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>to(e,t,n,r)});function Gs(e,t){return/* @__PURE__ */ _a(Ws,e??(()=>!0),t)}function Ks(e,t={}){return/* @__PURE__ */ va(Ws,e,t)}function qs(e,t){return/* @__PURE__ */ ya(e,t)}let q={step:`data-step`,effect:`data-step-effect`,start:`data-step-start`},Js=[`appear`,`fade`,`fly`,`wipe`,`zoom`],Ys=[`click`,`with`,`after`],Xs=W({x:V().finite(),y:V().finite(),width:V().finite(),height:V().finite()}),Zs=U(W({key:V().int().nonnegative(),control:Xs,target:Xs.nullable(),label:z()})),Qs=V().int().nonnegative(),$s=W({hash:z(),edits:U(ys([W({index:Qs,change:W({kind:K(`attribute`),name:K(`value`),value:z()})}),W({index:Qs,change:W({kind:K(`styles`),declarations:U(W({property:z(),value:z()}))})})]))}).nullable(),J=V().finite(),ec=V().int().nonnegative(),tc=W({hash:z(),gap:W({parent:ec,before:ec.nullable(),row:H(),flow:H(),origin:W({x:J,y:J}),room:J,line:W({x:J,y:J,width:J,height:J})})}).nullable();function nc(e,t,n){return e===`grid`||e===`inline-grid`?`grid`:e!==`flex`&&e!==`inline-flex`?`block`:n===`nowrap`?t.startsWith(`column`)?`vertical`:`horizontal`:`wrap`}let rc={deg:1,grad:.9,rad:180/Math.PI,turn:360};function ic(e){if(e===`none`||e===``)return 0;let t=/^(-?[\d.]+(?:e[+-]?\d+)?)(deg|grad|rad|turn)$/.exec(e),n=t?.[2]?rc[t[2]]:void 0;return!t||n===void 0?null:Math.round(Number(t[1])*n*100)/100}function ac(e){if(e===`none`||e===``)return{x:1,y:1};let t=e.split(/\s+/).map(e=>e.endsWith(`%`)?parseFloat(e)/100:Number(e)),[n,r=n,i=1]=t;return n===void 0||r===void 0||t.some(Number.isNaN)||t.length>3||i!==1?null:{x:n,y:r}}function oc(e){if(e===`none`||e===``)return!1;let t=/^matrix(3d)?\(([^)]*)\)$/.exec(e);if(!t?.[2])return!0;let n=t[2].split(`,`).map(Number);return(t[1]?n.slice(12,15):n.slice(4,6)).some(e=>e!==0)}let Y=V().finite(),sc=V().int().nonnegative(),cc=G([`block`,`vertical`,`horizontal`,`wrap`,`grid`]),lc=W({top:Y,right:Y,bottom:Y,left:Y}),uc=W({flow:cc,inline:H(),direction:z(),wrap:z(),justify:z(),alignItems:z(),ownJustify:H(),rowGap:Y,columnGap:Y,padding:lc,parent:cc,parentAlignItems:z(),width:Y,height:Y}),dc=W({width:Y,height:Y}),fc=W({kind:G([`box`,`text`,`media`,`container`]),natural:dc.nullable(),hugsHeight:H(),inset:dc,sizing:W({layout:uc,fills:H()}).nullable()}),pc=W({left:Y,top:Y}),mc=W({x:Y,y:Y,width:Y,height:Y}),hc=U(W({index:sc,box:mc,read:fc.nullable(),placed:pc.nullable(),nested:H(),margin:lc})).nullable(),gc=W({hash:z(),ghosts:U(W({index:sc,box:mc,placed:pc.nullable()}))}).nullable(),_c=U(W({index:sc,right:Y,top:Y})),vc=W({x:Y,y:Y}),yc=U(W({opacity:Y,radius:Y,fontFamily:z(),fontSize:Y,fontWeight:Y,lineHeight:Y.nullable(),letterSpacing:Y,textAlign:z(),textDecorationLine:z(),textTransform:z(),textWrapStyle:z(),truncated:H(),display:z(),color:z(),bordered:H(),borderWidth:Y.nullable(),holdsText:H(),textOnly:H(),text:z(),keepsBreaks:H(),rotation:W({degrees:Y.nullable(),scale:vc.nullable(),own:W({rotate:Y.nullable().optional(),scale:vc.nullable().optional()}),translated:H(),transform:W({own:z(),ruled:H(),reanchors:H()})}),placement:W({free:H(),left:Y,top:Y,width:Y.nullable(),height:Y.nullable(),inline:W({width:z(),height:z()}),wordsLeft:Y.nullable()}),layout:uc,inline:W({color:H(),backgroundColor:H(),background:H(),border:H()}),step:W({step:z().nullable(),effect:z().nullable(),start:z().nullable()})})).nullable(),bc=W({index:sc,hash:z()}).nullable(),xc=ys([W({kind:K(`toggle-play`)}),W({kind:K(`seek`),seconds:V().finite()}),W({kind:K(`toggle-sound`)}),W({kind:K(`set-flag`),name:G([`controls`,`autoplay`,`loop`,`muted`]),on:H()})]),Sc=W({tag:G([`video`,`audio`]),playable:H(),paused:H(),time:V().finite(),length:Gs(e=>typeof e==`number`),muted:H(),mutedInFile:H(),controls:H(),autoplay:H(),loop:H()}).nullable(),Cc=[`camera-orbit`,`max-camera-orbit`,`orientation`,`scale`,`animation-name`,`autoplay`],wc=W({name:G(Cc),value:z().nullable()}),Tc=z().nullable(),Ec=W({src:z(),loaded:H(),clips:U(z()),orbit:W({theta:V().finite(),phi:V().finite()}).nullable(),staged:W({"camera-orbit":Tc,"max-camera-orbit":Tc,orientation:Tc,scale:Tc,"animation-name":Tc,autoplay:Tc})}).nullable(),Dc=W({motion:W({source:G([`hf`,`timelines`,`css`,`model`]),duration:V().finite().nonnegative().nullable()}),span:V().finite().nonnegative()}),X=`frameboard-bridge`,Oc=`data-frameboard-editing`,kc=/* @__PURE__ */ `bindings.content-height.controls.controls-act.controls-edits.element-box.element-boxes.focus-keys.gap-at.hide-controls.hide-scrollbar.hide-strips.hold-animations.keep-previews.keys.live-body.live-element.measure.media.media-act.model.model-stage.motion.motion-moment.motion-release.motion-seek.overflow.page-colors.paint.pick-at.pins.pointer-move.preview-style.restamp.scroll.scroll-act.step-preview.steps.steps-show.takes-clicks.text-caret.text-edit.text-written.theme`.split(`.`);function Ac(e,t){let{data:n}=e;if(e.origin!==t||!Vc(n)||n.tag!==`frameboard-bridge`)return null;if(n.kind===`shown`){let{page:e,hash:t}=n;return typeof e==`string`&&e!==``&&(typeof t==`string`||t===null)?{tag:X,kind:`shown`,page:e,hash:t}:null}if(typeof n.id!=`string`||n.id===``)return null;let{id:r}=n;switch(n.kind){case`request`:return typeof n.op==`string`&&kc.includes(n.op)?{tag:X,kind:`request`,id:r,op:n.op,args:n.args}:null;case`reply`:return n.ok===!0?{tag:X,kind:`reply`,id:r,ok:!0,value:n.value}:n.ok===!1&&typeof n.error==`string`?{tag:X,kind:`reply`,id:r,ok:!1,error:n.error}:null;case`push`:return{tag:X,kind:`push`,id:r,value:n.value};case`close`:return{tag:X,kind:`close`,id:r};default:return null}}let Z=V().int().nonnegative(),jc=V().int().nonnegative(),Q=W({}).strict(),Mc=W({index:Z,hash:z()}),Nc=W({x:V().finite(),y:V().finite()}),Pc=W({x:V().finite(),y:V().finite(),width:V().finite(),height:V().finite()}),Fc=W({left:V().finite(),top:V().finite(),right:V().finite(),bottom:V().finite()}),Ic=W({top:V().finite(),size:V().finite()}),Lc=ys([W({kind:K(`commit`),text:z(),breaks:H(),run:V().int().nonnegative().optional()}),W({kind:K(`closed`)})]),Rc={theme:{args:W({theme:G([`light`,`dark`])}),value:H()},"hide-scrollbar":{args:Q,value:H()},scroll:{args:Q,value:Ic.nullable(),push:Ic.nullable()},"scroll-act":{args:ys([W({act:K(`page`),toward:ys([K(-1),K(1)])}),W({act:K(`to`),top:V().finite()})]),value:H()},keys:{args:W({keys:U(z()),keepTyping:H(),keepButtons:H().optional()}),value:H(),push:W({key:z(),repeat:H()})},"focus-keys":{args:Q,value:H(),push:K(!0)},"content-height":{args:Q,value:V().int().positive().nullable()},"element-box":{args:Mc,value:Fc.nullable()},"element-boxes":{args:W({hash:z(),indexes:U(Z)}),value:U(W({index:Z,box:Pc})).nullable()},"live-body":{args:Q,value:bc},"live-element":{args:W({hash:z(),indexes:U(Z)}),value:yc},measure:{args:W({hash:z(),indexes:U(Z)}),value:hc,push:hc},overflow:{args:Q,value:gc,push:gc},pins:{args:W({indexes:U(Z)}),value:_c,push:_c},"pick-at":{args:W({at:Nc}),value:W({hash:z().nullable(),chain:U(W({index:Z,tag:z()}))})},"gap-at":{args:W({at:Nc,carried:Z.optional()}),value:tc},"hide-strips":{args:Q,value:H()},"keep-previews":{args:Q,value:ds()},media:{args:Mc,value:Sc,push:Sc},"media-act":{args:Mc.extend({act:xc}),value:H()},model:{args:Mc,value:Ec,push:Ec},"model-stage":{args:Mc.and(wc),value:H()},paint:{args:W({fill:z()}),value:z().nullable()},"preview-style":{args:W({index:Z,property:z(),value:z().nullable()}),value:ds()},restamp:{args:W({hash:z()}),value:H()},"text-edit":{args:Mc.extend({at:Nc.optional(),empty:H().optional()}),value:H(),push:Lc},"text-caret":{args:W({edit:z(),at:Nc}),value:H()},"text-written":{args:W({edit:z(),written:H()}),value:ds()},steps:{args:W({shown:jc}),value:jc,push:jc},"steps-show":{args:W({steps:z(),shown:jc,entering:Z.nullable()}),value:H()},"step-preview":{args:W({index:Z,effect:G(Js)}),value:H()},"hold-animations":{args:Q,value:H()},"hide-controls":{args:Q,value:H()},"pointer-move":{args:Q,value:H(),push:ds()},motion:{args:Q,value:H(),push:Dc.nullable()},"motion-seek":{args:W({motion:z(),at:V().finite()}),value:H()},"motion-release":{args:W({motion:z()}),value:H()},"motion-moment":{args:Dc,value:V().finite().nonnegative()},controls:{args:Q,value:H(),push:jc},"controls-act":{args:W({controls:z(),act:G([`reset`,`settle`])}),value:H()},"controls-edits":{args:W({controls:z()}),value:$s},"takes-clicks":{args:Q,value:H()},bindings:{args:Q,value:Zs,push:Zs},"page-colors":{args:Q,value:W({fill:z().nullable(),ink:z()})}},zc=Symbol(`refused`);function Bc(e,t){let n=Rc[e].args.safeParse(t);return n.success?n.data:zc}function Vc(e){return typeof e==`object`&&!!e}let Hc=/^http:\/\/(127\.0\.0\.1|localhost)(:\d{1,5})?$/;function Uc(e,t){return e===`null`?!1:e===t||Hc.test(e)}[...[{name:`small-phone`,label:`Small phone`,group:`phone`,width:375,height:667},{name:`iphone-16`,label:`iPhone 16`,group:`phone`,width:393,height:852},{name:`iphone-18-pro`,label:`iPhone 18 Pro`,group:`phone`,width:402,height:874},{name:`android`,label:`Android`,group:`phone`,width:412,height:917},{name:`iphone-16-pro-max`,label:`iPhone 16 Pro Max`,group:`phone`,width:440,height:956},{name:`ipad-mini`,label:`iPad mini`,group:`tablet`,width:744,height:1133},{name:`ipad-pro-12-9`,label:`iPad Pro 12.9`,group:`tablet`,width:1024,height:1366},{name:`macbook-air`,label:`MacBook Air`,group:`desktop`,width:1280,height:832},{name:`full-hd`,label:`Full HD`,group:`desktop`,width:1920,height:1080},{name:`slide-16-9`,label:`Slide 16:9`,group:`slide`,width:1920,height:1080},{name:`slide-4-3`,label:`Slide 4:3`,group:`slide`,width:1024,height:768},{name:`og-card`,label:`Open Graph`,group:`social`,width:1200,height:630},{name:`linkedin-post`,label:`LinkedIn post`,group:`social`,width:1200,height:627},{name:`video-landscape`,label:`Video landscape`,group:`video`,width:1920,height:1080},{name:`video-portrait`,label:`Video portrait`,group:`video`,width:1080,height:1920}].map(e=>e.name)],28+{height:14,reach:.06,radius:10}.height;let Wc={width:81,height:30,top:14};Wc.top+Wc.height+10,Wc.top,Wc.height;function Gc(e=document){let t=e.defaultView,n=e=>e&&t?t.getComputedStyle(e):null,r=n(e.documentElement),i=n(e.body);return{fill:[r?.backgroundColor,i?.backgroundColor].find(e=>e!==void 0&&e!==`transparent`&&!/^rgba\(.*,\s*0\)$/.test(e))??null,ink:i?.color??r?.color??`CanvasText`}}function Kc(){let e=document.documentElement.scrollHeight;return e<=innerHeight+1?null:{top:scrollY/e,size:innerHeight/e}}let qc={theme:({theme:e})=>(t(document.documentElement,e),!0),"hide-scrollbar":(t,{onClose:n})=>{if(!document.head)return!1;let r=document.createElement(`style`);return r.setAttribute(e,``),r.textContent=`html { scrollbar-width: none }`,document.head.append(r),n(()=>r.remove()),!0},scroll:(e,{push:t,onClose:n})=>{let r=Kc(),i=()=>{let e=Kc();(e?.top!==r?.top||e?.size!==r?.size)&&(r=e,t(e))},a=new ResizeObserver(i);return a.observe(document.documentElement),addEventListener(`scroll`,i),addEventListener(`resize`,i),n(()=>{a.disconnect(),removeEventListener(`scroll`,i),removeEventListener(`resize`,i)}),r},"scroll-act":e=>(e.act===`page`?scrollBy({top:e.toward*innerHeight}):scrollTo({top:e.top*document.documentElement.scrollHeight}),!0),"content-height":()=>document.body?Jc(document):null,"page-colors":()=>Gc(document)};function Jc(e){let t=e.defaultView;if(!t)return 1;let n=e=>{let n=t.getComputedStyle(e);return n.overflowX!==`visible`||n.overflowY!==`visible`},r=t=>{for(let r=t.parentElement;r&&r!==e.body;r=r.parentElement)if(n(r))return!0;return!1},i=(e,t)=>e<t?(t-e)/2:0,a=r=>{let a=-1/0;if(n(r))return a;let o=parseFloat(t.getComputedStyle(r).lineHeight);for(let n of r.childNodes){if(n.nodeType!==t.Node.TEXT_NODE)continue;let r=e.createRange();r.selectNodeContents(n);for(let e of r.getClientRects())(e.width!==0||e.height!==0)&&(a=Math.max(a,e.bottom-i(o,e.height)))}return a},o=[`img`,`video`,`canvas`,`iframe`,`object`,`embed`,`audio`],s=e=>{let n=e.getBoundingClientRect();if(e.namespaceURI!==`http://www.w3.org/1999/xhtml`||o.includes(e.localName))return n.bottom;let r=t.getComputedStyle(e);if(r.display!==`inline`||parseFloat(r.paddingBottom)+parseFloat(r.borderBottomWidth)>0)return n.bottom;let a=parseFloat(r.paddingTop)+parseFloat(r.borderTopWidth);return n.bottom-i(parseFloat(r.lineHeight),n.height-a)},c=e.documentElement.getBoundingClientRect().bottom;for(let t of e.querySelectorAll(`body *`))r(t)||(c=Math.max(c,s(t),a(t)));return Math.max(1,Math.ceil(c+t.scrollY))}let Yc=`data-binds`;function Xc(e){let t=e.trim().split(/\s+/),n=t.pop(),r=t.join(` `);return!n||r===``?null:{selector:r,property:n}}function Zc(e){return/^--./.test(e)}function Qc(e){let t=/* @__PURE__ */ new Map;for(let{target:n,property:r,value:i,unit:a}of e){let e=t.get(n)??/* @__PURE__ */ new Map;e.set(r,`${i}${a}`),t.set(n,e)}return[...e.map(({index:e,value:t})=>({index:e,change:{kind:`attribute`,name:`value`,value:t}})),...[...t].map(([e,t])=>({index:e,change:{kind:`styles`,declarations:[...t].map(([e,t])=>({property:e,value:t}))}}))]}let $c=`[${Yc}], label:has([${Yc}]), :not(html, body):has(> [${Yc}], > label > [${Yc}]):not(:has(> :not([${Yc}], label))) { display: none !important }`;function el(e,t){let n=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Map,a=t=>{let n=Xc(t.getAttribute(`data-binds`)??``);if(!n||!Zc(n.property))return null;let r;try{r=e.querySelector(n.selector)}catch{return null}return r?{control:t,target:r,property:n.property,unit:t.getAttribute(`data-unit`)??``}:null},o=e=>{let r=n.get(e);n.delete(e);let a=r&&tl(r.target);if(r&&a){let e=[...n.values()].reverse().find(e=>e.target===r.target&&e.property===r.property),t=i.get(r.target)?.get(r.property);e?a.setProperty(r.property,`${e.control.value}${e.unit}`):!t||t.value===``?a.removeProperty(r.property):a.setProperty(r.property,t.value,t.priority)}t(n.size)},s=e=>{let r=e.target;if(!nl(r))return;if(r.value===``){n.has(r)&&o(r);return}let s=a(r),c=s&&tl(s.target);if(!s||!c)return;let l=i.get(s.target)??/* @__PURE__ */ new Map;l.has(s.property)||(l.set(s.property,{value:c.getPropertyValue(s.property),priority:c.getPropertyPriority(s.property)}),i.set(s.target,l)),c.setProperty(s.property,`${r.value}${s.unit}`),n.delete(r),n.set(r,s),t(n.size)};return e.addEventListener(`input`,s,!0),{edits:()=>{let t=[];for(let{control:i,target:a,property:o,unit:s}of n.values()){let n=r(e,i),c=r(e,a);n!==null&&c!==null&&i.value!==``&&t.push({index:n,value:i.value,unit:s,target:c,property:o})}return Qc(t)},reset:()=>{for(let e of n.keys())e.value=e.defaultValue;for(let[e,t]of i){let n=tl(e);for(let[e,{value:r,priority:i}]of t)r===``?n?.removeProperty(e):n?.setProperty(e,r,i)}n.clear(),i.clear(),t(0)},settle:()=>{for(let e of n.keys())e.setAttribute(`value`,e.value);n.clear(),i.clear(),t(0)},detach:()=>e.removeEventListener(`input`,s,!0)}}function tl(e){let t=e.style;return t&&typeof t.setProperty==`function`?t:null}function nl(e){return e!==null&&`hasAttribute`in e&&e.hasAttribute(`data-binds`)&&`value`in e&&`defaultValue`in e}function rl(e){return[...e.querySelectorAll(`[${Yc}]`)].map((t,n)=>{let r=t.getAttribute(`data-binds`)??``,i=Xc(r),a=i&&Zc(i.property)?il(e,i.selector):null,o=i?Zc(i.property)?a?`${i.selector} ${i.property}`:`${i.selector}, no match`:`${i.property}, not a custom property`:`${r.trim()||`data-binds`}, no property`;return{key:n,control:al(t),target:a?al(a):null,label:o}})}function il(e,t){try{return e.querySelector(t)}catch{return null}}function al(e){let t=e.getBoundingClientRect();return{x:Math.round(t.left),y:Math.round(t.top),width:Math.round(t.width),height:Math.round(t.height)}}let ol=/* @__PURE__ */ new Map,sl={controls:(e,{id:t,push:n,onClose:r})=>{let i=el(document,e=>n(e));return ol.set(t,i),r(()=>{i.reset(),i.detach(),ol.delete(t)}),!0},"controls-act":({controls:e,act:t})=>{let n=ol.get(e);return n?(t===`reset`?n.reset():n.settle(),!0):!1},"controls-edits":({controls:e})=>{let t=ol.get(e),n=a(document),r=t?.edits()??[];return n===null||r.length===0?null:{hash:n,edits:r}},bindings:(e,{push:t,onClose:n})=>{let r=document.documentElement;if(!r)return[];let i=()=>t(rl(document)),a=new ResizeObserver(i);return a.observe(r),addEventListener(`scroll`,i,!0),n(()=>{a.disconnect(),removeEventListener(`scroll`,i,!0)}),rl(document)}},cl=/* @__PURE__ */ new Set([`html`,`body`]);function ll(e,t){let n=[];for(let i=document.elementFromPoint(e,t);i&&!cl.has(i.localName);i=i.parentElement){let e=r(document,i);e!==null&&n.push({index:e,tag:i.localName})}return n}let ul=/* @__PURE__ */ new Set(/* @__PURE__ */ `area.br.col.embed.hr.iframe.img.input.link.meta.model-viewer.noscript.object.picture.script.select.source.style.template.textarea.title.track.video.audio.canvas.wbr.p.h1.h2.h3.h4.h5.h6.pre.button.label.a`.split(`.`));function dl(e){if(e.localName===`body`)return!0;if(e.namespaceURI!==`http://www.w3.org/1999/xhtml`||ul.has(e.localName)||e.childElementCount===0||e.closest(`svg, math`))return!1;let t=getComputedStyle(e).display;return t.startsWith(`inline`)||t===`contents`?!1:![...e.childNodes].some(e=>e.nodeType===Node.TEXT_NODE&&(e.textContent??``).trim()!==``)}function fl(e){let t=e.display;if(t.endsWith(`grid`))return{row:!0,reverse:!1,flow:!0};if(!t.endsWith(`flex`))return{row:!1,reverse:!1,flow:!1};let n=e.flexDirection;return{row:n.startsWith(`row`),reverse:n.endsWith(`reverse`),flow:!0}}function pl(e){let t=e=>{let t=getComputedStyle(e);return t.position!==`static`||t.transform!==`none`},n=e===document.body||e===document.documentElement?null:e;for(let r=e;r&&!n;)t(r)&&(n=r),r=r.parentElement;if(!n)return{x:0-scrollX,y:0-scrollY};let r=n.getBoundingClientRect();return{x:r.left+n.clientLeft-n.scrollLeft,y:r.top+n.clientTop-n.scrollTop}}function ml(e,t,n,r){if(!n){let n=t.top+t.height/2;return r?e.y>n:e.y<n}if(e.y<t.top)return!0;if(e.y>t.bottom)return!1;let i=t.left+t.width/2;return r?e.x>i:e.x<i}function hl(e){let t=document.body;if(!t)return null;let n=document.elementFromPoint(e.x,e.y);for(n&&t.contains(n)||(n=t);n&&!dl(n);)n=n.parentElement;let i=n&&r(document,n);if(!n||i==null)return null;let a=getComputedStyle(n),{row:o,reverse:s,flow:c}=fl(a),l=[...n.children].flatMap(e=>{let t=r(document,e),n=e.getBoundingClientRect();return t!==null&&(n.width>0||n.height>0)?[{index:t,box:n}]:[]}),u=l.findIndex(({box:t})=>ml(e,t,o,s)),d=u===-1?l.at(-1):l[u-1],f=u===-1?void 0:l[u],p=e=>Number.parseFloat(a.getPropertyValue(`padding-${e}`))||0;return{parent:i,before:f?.index??null,row:o,flow:c,origin:pl(n),room:Math.max(0,n.clientWidth-p(`left`)-p(`right`)),line:gl(n.getBoundingClientRect(),a,o,s,{after:d?.box,ahead:f?.box})}}function gl(e,t,n,r,{after:i,ahead:a}){let o=e=>Number.parseFloat(t.getPropertyValue(`padding-${e}`))||0,s={left:e.left+o(`left`),right:e.right-o(`right`),top:e.top+o(`top`),bottom:e.bottom-o(`bottom`)};if(n){let e=r?a:i,t=r?i:a,n=e&&t?(e.right+t.left)/2:e?.right??t?.left??s.left,o=a??i,c=o?.top??s.top,l=o?.bottom??s.bottom;return{x:n,y:c,width:0,height:Math.max(0,l-c)}}let c=r?a:i,l=r?i:a,u=c&&l?(c.bottom+l.top)/2:c?.bottom??l?.top??s.top;return{x:s.left,y:u,width:Math.max(0,s.right-s.left),height:0}}function _l(e,t){let n=hl(e),a=i(document,t),o=n?i(document,n.parent):null;if(!n||!a||!o||a.contains(o))return null;let s=a.nextElementSibling;return o===a.parentElement&&(n.before===t||n.before===(s?r(document,s):null))?null:n}function vl(e){if(!document.body)return null;let t=document.createElement(`div`);t.style.background=e,document.body.append(t);let n=getComputedStyle(t).backgroundColor;return t.remove(),n}let yl={"pick-at":({at:e})=>({hash:a(document),chain:ll(e.x,e.y)}),"gap-at":({at:e,carried:t})=>{let n=a(document),r=t===void 0?hl(e):_l(e,t);return n&&r?{hash:n,gap:r}:null},paint:({fill:e})=>vl(e)};function bl(e,t){e.readyState===`loading`?e.addEventListener(`DOMContentLoaded`,t,{once:!0}):t()}function xl(e){return a(document)===e.hash?i(document,e.index):null}let Sl=[`Shift`,`Meta`,`Alt`,`Control`],Cl=typeof navigator==`object`?navigator.platform:``,wl=/Mac|iPod|iPhone|iPad/.test(Cl)?`Meta`:`Control`,Tl=Cl===`Win32`?[`Control`,`Alt`]:[`Alt`];function El(e){return!!(e.key&&e.code&&e.getModifierState)}function Dl(e){let t=e.target;return e.repeat||e.isComposing||t!==e.currentTarget&&t.matches(`[contenteditable],input,select,textarea`)}function Ol(e,t){return typeof e.getModifierState==`function`?e.getModifierState(t)||Tl.includes(t)&&e.getModifierState(`AltGraph`):!1}function kl(e){return e.trim().split(` `).map(e=>{let t=e.split(/(?<=\w|\])\+/),n=t.pop(),r=n.match(/^\((.+)\)$/),i=r?RegExp(`^(?:${r[1]})$`,`iv`):n,a=[],o=[];for(let e of t){let t=e.match(/^\[(.*)\]$/),n=t?.[1]??e;n=n===`$mod`?wl:n,t?o.push(n):a.push(n)}return[a,o,i]})}function Al(e,[t,n,r]){let i=t.includes(`AltGraph`);return!((r instanceof RegExp?!(r.test(e.key)||r.test(e.code)):r.toUpperCase()!==e.key.toUpperCase()&&r!==e.code)||t.find(t=>!Ol(e,t))||Sl.find(a=>!t.includes(a)&&!n.includes(a)&&r!==a&&Ol(e,a)&&!(i&&Tl.includes(a))))}function jl(e,t={}){let n=t.timeout??1e3,r=t.ignore??Dl,i=Object.keys(e).map(t=>[t,kl(t),e[t]]),a=/* @__PURE__ */ new Map,o=null;return e=>{if(!El(e)||r(e))return;let t=[];for(let[n,r,o]of i){let[i,...s]=a.get(n)||r;if(!Al(e,i))Ol(e,e.key)||a.delete(n);else if(s.length>0)a.set(n,s),t.push(n);else if(a.delete(n),t.length)console.warn(`tinykeys: Conflict found, "${n}" did not fire, waiting for:`,t);else{o(e);break}}o&&clearTimeout(o),o=setTimeout(()=>a.clear(),n)}}function Ml(e,t,n={}){let r=n.event??`keydown`,i=jl(t,n);return e.addEventListener(r,i,n.capture),()=>{e.removeEventListener(r,i,n.capture)}}function Nl(e){return(e.code===`Space`||e.key===`Enter`)&&e.target instanceof Element&&e.target.closest(`button`)!==null}function Pl(e,{keepTyping:t,keepButtons:n}){if(e.isComposing||e.defaultPrevented||n&&Nl(e))return!0;if(!t)return!1;let r=e.target;return r instanceof HTMLElement&&(r.isContentEditable||r.matches(`[contenteditable],input,select,textarea`))}let Fl={keys:({keys:e,...t},{push:n,onClose:r})=>(r(Ml(window,Object.fromEntries(e.map(e=>[e,t=>{t.preventDefault(),n({key:e,repeat:t.repeat})}])),{ignore:e=>Pl(e,t)})),!0),"focus-keys":(e,{push:t,onClose:n})=>{let r=()=>t(!0);return window.addEventListener(`keydown`,r,!0),n(()=>window.removeEventListener(`keydown`,r,!0)),!0}};function Il(e){return Math.round(parseFloat(e)*100)/100}function Ll(e,t){let n=e.parentElement,r=n?getComputedStyle(n):null,i=e instanceof HTMLElement?e:null,a=e=>Il(e)||0;return{flow:nc(t.display,t.flexDirection,t.flexWrap),inline:t.display.startsWith(`inline-`),direction:t.flexDirection,wrap:t.flexWrap,justify:t.justifyContent,alignItems:t.alignItems,ownJustify:!!i?.style.getPropertyValue(`justify-content`),rowGap:t.rowGap===`normal`?0:a(t.rowGap),columnGap:t.columnGap===`normal`?0:a(t.columnGap),padding:{top:a(t.paddingTop),right:a(t.paddingRight),bottom:a(t.paddingBottom),left:a(t.paddingLeft)},parent:r?nc(r.display,r.flexDirection,r.flexWrap):`block`,parentAlignItems:r?.alignItems??`normal`,width:Math.round(i?.offsetWidth??0),height:Math.round(i?.offsetHeight??0)}}function Rl(e){let t=getComputedStyle(e),n=e.textContent??``,r=[t.borderTopWidth,t.borderRightWidth,t.borderBottomWidth,t.borderLeftWidth];return{opacity:Number(t.opacity),radius:Math.round(parseFloat(t.borderTopLeftRadius)||0),fontFamily:t.fontFamily,fontSize:Il(t.fontSize),fontWeight:Number(t.fontWeight),lineHeight:t.lineHeight===`normal`?null:Il(t.lineHeight),letterSpacing:t.letterSpacing===`normal`?0:Il(t.letterSpacing),textAlign:Gl(t.textAlign,t.direction),textDecorationLine:t.textDecorationLine,textTransform:t.textTransform,textWrapStyle:t.getPropertyValue(`text-wrap-style`)||`auto`,truncated:t.textOverflow===`ellipsis`&&t.overflowX!==`visible`&&t.getPropertyValue(`text-wrap-mode`)===`nowrap`,display:t.display,color:t.color,bordered:r.some(e=>parseFloat(e)>0),borderWidth:r.every(e=>e===r[0])?Il(t.borderTopWidth):null,holdsText:n.trim()!==``,textOnly:e.childElementCount===0&&n.trim()!==``,text:n,keepsBreaks:t.whiteSpace!==`normal`&&t.whiteSpace!==`nowrap`,rotation:{degrees:ic(t.rotate),scale:ac(t.scale),own:Vl(e),translated:oc(t.transform),transform:Hl(e,t)},placement:zl(e,t),layout:Ll(e,t),inline:Wl(e),step:{step:e.getAttribute(q.step),effect:e.getAttribute(q.effect),start:e.getAttribute(q.start)}}}function zl(e,t){let n=t.position===`absolute`||t.position===`fixed`,r=e=>{let t=parseFloat(e);return Number.isNaN(t)?null:Math.round(t)},i=r(t.width),a=r(t.height),o=e instanceof HTMLElement?e.style:null,s={width:o?.getPropertyValue(`width`)??``,height:o?.getPropertyValue(`height`)??``};if(n&&t.left.endsWith(`px`)&&t.top.endsWith(`px`))return{free:n,left:Math.round(parseFloat(t.left)),top:Math.round(parseFloat(t.top)),width:i,height:a,inline:s,wordsLeft:null};let c=e.parentElement,l=e=>{let t=getComputedStyle(e);return t.position!==`static`||t.transform!==`none`},u=null;if(t.position!==`fixed`){if(!n&&c&&c!==document.body&&c!==document.documentElement)u=c;else for(let e=c;e&&!u;e=e.parentElement)l(e)&&(u=e)}let d=t.position===`fixed`?0:-scrollX,f=t.position===`fixed`?0:-scrollY;if(u){let e=u.getBoundingClientRect();d=e.left+u.clientLeft-u.scrollLeft,f=e.top+u.clientTop-u.scrollTop}let p=e.getBoundingClientRect(),m=parseFloat(t.marginLeft)||0,h=Bl(e,t);return{free:n,left:Math.round(p.left-d-m),top:Math.round(p.top-f-(parseFloat(t.marginTop)||0)),width:i,height:a,inline:s,wordsLeft:h===null?null:Math.round(h-d-m)}}function Bl(e,t){if(!(e.childNodes.length>0&&[...e.childNodes].every(e=>e.nodeType===Node.TEXT_NODE)&&e.textContent?.trim()))return null;let n=document.createRange();n.selectNodeContents(e);let r=(parseFloat(t.borderLeftWidth)||0)+(parseFloat(t.paddingLeft)||0);return n.getBoundingClientRect().left-r}function Vl(e){let t=e instanceof HTMLElement?e:null,n=!!t?.style.getPropertyValue(`rotate`),r=!!t?.style.getPropertyValue(`scale`);if(!t||!n&&!r)return{};let i=t.getAttribute(`style`);t.style.removeProperty(`rotate`),t.style.removeProperty(`scale`);let a=getComputedStyle(t),o={...n?{rotate:ic(a.rotate)}:{},...r?{scale:ac(a.scale)}:{}};return i===null?t.removeAttribute(`style`):t.setAttribute(`style`,i),o}function Hl(e,t){let n=e instanceof HTMLElement?e.style.getPropertyValue(`transform`):``;return{own:n,ruled:n===``&&t.transform!==`none`,reanchors:t.transform===`none`&&Ul(e,t)}}function Ul(e,t){let n=t.position!==`static`;for(let t of e.querySelectorAll(`*`)){let r=getComputedStyle(t).position;if(r!==`fixed`&&(r!==`absolute`||n))continue;let i=!1;for(let n=t.parentElement;n&&n!==e&&!i;n=n.parentElement){let e=getComputedStyle(n);i=e.transform!==`none`||r===`absolute`&&e.position!==`static`}if(!i)return!0}return!1}function Wl(e){let t=e instanceof HTMLElement?e.style:null,n=t?Array.from({length:t.length},(e,n)=>t.item(n)):[];return{color:n.includes(`color`),backgroundColor:n.includes(`background-color`),background:/(?:^|;)\s*background\s*:/i.test(e.getAttribute(`style`)??``),border:n.some(e=>e.startsWith(`border-`)&&!e.endsWith(`-radius`))}}function Gl(e,t){return e===`start`?t===`rtl`?`right`:`left`:e===`end`?t===`rtl`?`left`:`right`:e}let Kl={"live-element":({hash:e,indexes:t})=>{if(a(document)!==e)return null;let n=t.flatMap(e=>{let t=i(document,e);return t?[Rl(t)]:[]});return n.length===t.length?n:null},"live-body":()=>{let e=a(document),t=document.body?r(document,document.body):null;return e!==null&&t!==null?{index:t,hash:e}:null}},ql=/* @__PURE__ */ new Set([`html`,`body`]),Jl=/* @__PURE__ */ new Set([`img`,`video`,`model-viewer`]);function Yl(e){if(!e||ql.has(e.localName))return null;if(Jl.has(e.localName))return`media`;let t=(e.textContent??``).trim()!==``;return e.childElementCount>0?t&&[...e.children].every(Xl)?`text`:`container`:t?`text`:e.localName===`div`?`box`:null}function Xl(e){let t=getComputedStyle(e).display;return t===`inline`||t.startsWith(`inline-`)}function Zl(e){let t=Yl(e),n=getComputedStyle(e);return!t||ic(n.rotate)!==0||n.transform.startsWith(`matrix3d(`)||(t===`text`||t===`container`)&&(n.display===`inline`||n.display===`contents`)?null:{kind:t,natural:tu(e),hugsHeight:t===`text`&&!nu(e),inset:eu(n),sizing:t===`container`?$l(e,n):null}}let Ql=/* @__PURE__ */ new Set([`vertical`,`horizontal`,`wrap`]);function $l(e,t){let n=Ll(e,t);return{layout:n,fills:Ql.has(n.parent)&&(parseFloat(t.flexGrow)||0)>0}}function eu(e){if(e.boxSizing!==`content-box`)return{width:0,height:0};let t=(...e)=>e.reduce((e,t)=>e+(parseFloat(t)||0),0);return{width:t(e.paddingLeft,e.paddingRight,e.borderLeftWidth,e.borderRightWidth),height:t(e.paddingTop,e.paddingBottom,e.borderTopWidth,e.borderBottomWidth)}}function tu(e){let[t,n]=e instanceof HTMLImageElement?[e.naturalWidth,e.naturalHeight]:e instanceof HTMLVideoElement?[e.videoWidth,e.videoHeight]:[0,0];return t>0&&n>0?{width:t,height:n}:null}function nu(e){let t=e instanceof HTMLElement?e.style.height:``;return t!==``&&t!==`auto`}function ru(e,t){if(t.some(t=>t!==e&&t.contains(e)))return null;let n=getComputedStyle(e);if(n.position!==`absolute`&&n.position!==`fixed`)return null;let r=parseFloat(n.left),i=parseFloat(n.top);return Number.isNaN(r)||Number.isNaN(i)?null:{left:r,top:i}}function iu(e){let t=getComputedStyle(e),n=e=>Number.parseFloat(e)||0;return{top:n(t.marginTop),right:n(t.marginRight),bottom:n(t.marginBottom),left:n(t.marginLeft)}}function au(e){let t=e.getBoundingClientRect();return{x:Math.round(t.left),y:Math.round(t.top),width:Math.round(t.width),height:Math.round(t.height)}}function ou(e){let t=e.getBoundingClientRect();return{x:t.left,y:t.top,width:t.width,height:t.height}}function su(e,t){if(a(document)!==e)return null;let n=t.flatMap(e=>{let t=i(document,e);return t?[t]:[]});return n.length===t.length?n:null}function cu(e,t){return t.map((n,r)=>({index:e[r]??0,box:au(n),read:Zl(n),placed:ru(n,[]),nested:t.some(e=>e!==n&&e.contains(n)),margin:iu(n)}))}function lu(){let e=document.body;if(!e)return[];let t=innerWidth,r=innerHeight,i=[],a=[];return n(document).forEach((n,o)=>{if(!e.contains(n)||n===e||a.some(e=>e.contains(n))||getComputedStyle(n).position===`fixed`)return;let s=n.getBoundingClientRect();(s.width!==0||s.height!==0)&&(s.left<-1||s.top<-1||s.right>t+1||s.bottom>r+1)&&!uu(n,e)&&(a.push(n),i.push({index:o,box:au(n),placed:ru(n,[])}))}),i}function uu(e,t){let n=e=>{let t=e.parentElement;if(getComputedStyle(e).position!==`absolute`)return t;for(;t&&getComputedStyle(t).position===`static`&&getComputedStyle(t).transform===`none`;)t=t.parentElement;return t};for(let r=n(e);r&&r!==t&&t.contains(r);r=n(r)){let e=getComputedStyle(r);if(e.overflowX!==`visible`||e.overflowY!==`visible`)return!0}return!1}function du(){let e=a(document);return e===null?null:{hash:e,ghosts:lu()}}function fu(e){return e.flatMap(e=>{let t=i(document,e)?.getBoundingClientRect();return t?[{index:e,right:t.right,top:t.top}]:[]})}function pu(e,t,n){let r=new ResizeObserver(t);for(let t of[...e,document.documentElement])r.observe(t);let i=new MutationObserver(t);if(n)for(let t of e)i.observe(t,{attributes:!0,attributeFilter:[`style`]});return addEventListener(`scroll`,t,!0),addEventListener(`resize`,t),()=>{r.disconnect(),i.disconnect(),removeEventListener(`scroll`,t,!0),removeEventListener(`resize`,t)}}let mu={"element-boxes":({hash:e,indexes:t})=>a(document)===e?t.flatMap(e=>{let t=i(document,e),n=t?ou(t):null;return n&&n.width>0&&n.height>0?[{index:e,box:n}]:[]}):null,measure:({hash:e,indexes:t},{push:n,onClose:r})=>{let i=su(e,t);return i?(r(pu(i,()=>n(cu(t,i)),i.length>1)),cu(t,i)):null},overflow:(e,{push:t,onClose:n})=>{let r=0,i=()=>{r===0&&(r=requestAnimationFrame(()=>{r=0,t(du())}))},a=new MutationObserver(i);return a.observe(document,{attributes:!0,attributeFilter:[`style`],subtree:!0}),addEventListener(`resize`,i),n(()=>{cancelAnimationFrame(r),a.disconnect(),removeEventListener(`resize`,i)}),du()},pins:({indexes:e},{push:t,onClose:n})=>(n(pu(e.flatMap(e=>{let t=i(document,e);return t?[t]:[]}),()=>t(fu(e)),!1)),fu(e))},hu=[`play`,`pause`,`timeupdate`,`durationchange`,`loadedmetadata`,`volumechange`,`seeked`,`error`,`emptied`],gu=[`controls`,`autoplay`,`loop`,`muted`];function _u(e){let t=xl(e);return t instanceof HTMLMediaElement?t:null}function vu(e){let t=e instanceof HTMLVideoElement,n=t&&e.readyState>=1&&e.videoWidth===0;return{tag:t?`video`:`audio`,playable:e.error===null&&!n,paused:e.paused,time:e.currentTime,length:e.duration,muted:e.muted,mutedInFile:e.defaultMuted,controls:e.hasAttribute(`controls`),autoplay:e.hasAttribute(`autoplay`),loop:e.hasAttribute(`loop`)}}function yu(e,t){switch(t.kind){case`toggle-play`:e.paused?e.play().catch(()=>void 0):e.pause();return;case`seek`:e.currentTime=t.seconds;return;case`toggle-sound`:e.muted=!e.muted;return;case`set-flag`:e.toggleAttribute(t.name,t.on)}}let bu=`frameboard-media-strip`;function xu(){if(document.getElementById(bu))return()=>{};let t=document.createElement(`style`);return t.id=bu,t.setAttribute(e,``),t.textContent=`video::-webkit-media-controls { display: none !important }`,document.head?.append(t),()=>t.remove()}let Su={media:(e,{push:t,onClose:n})=>{let r=_u(e);if(!r)return null;let i=()=>t(vu(r));for(let e of hu)r.addEventListener(e,i);let a=new MutationObserver(i);return a.observe(r,{attributeFilter:[...gu]}),n(()=>{for(let e of hu)r.removeEventListener(e,i);a.disconnect()}),vu(r)},"media-act":({act:e,...t})=>{let n=_u(t);return n?(yu(n,e),!0):!1},"hide-strips":(e,{onClose:t})=>(t(xu()),!0)},Cu=[`load`,`error`,`camera-change`];function wu(e){let t=xl(e);return t instanceof HTMLElement&&t.localName===`model-viewer`?t:null}function Tu(e){let t=Math.round(e*180/Math.PI)%360;return t>180?t-360:t<=-180?t+360:t}function Eu(e){let t=e.loaded===!0,n=t?e.getCameraOrbit?.():void 0,r={};for(let t of Cc)r[t]=e.getAttribute(t);return{src:e.getAttribute(`src`)??``,loaded:t,clips:t?[...e.availableAnimations??[]]:[],orbit:n?{theta:Tu(n.theta),phi:Tu(n.phi)}:null,staged:r}}function Du(e,t,n){n===null?e.removeAttribute(t):e.setAttribute(t,n),t===`camera-orbit`&&e.updateComplete?.then(()=>e.jumpCameraToGoal?.()),t===`autoplay`&&n===null&&e.loaded&&(e.pause?.(),e.currentTime=0)}let Ou={model:(e,{push:t,onClose:n})=>{let r=wu(e);if(!r)return null;let i=Eu(r),a=JSON.stringify(i),o=()=>{let e=Eu(r),n=JSON.stringify(e);n!==a&&(a=n,t(e))};for(let e of Cu)r.addEventListener(e,o);let s=new MutationObserver(o);return s.observe(r,{attributeFilter:[`src`,...Cc]}),n(()=>{for(let e of Cu)r.removeEventListener(e,o);s.disconnect()}),i},"model-stage":({name:e,value:t,...n})=>{let r=wu(n);return r?(Du(r,e,t),!0):!1}};async function ku(e,t){let n=e.performance.now()+t,r=()=>new Promise(t=>e.requestAnimationFrame(()=>t())),i=e=>typeof e==`number`&&Number.isFinite(e)?Math.round(e*1e3):null,a=()=>{let t=e.__hf,n=i(t?.duration);if(typeof t?.seek==`function`&&n!==null&&n>0)return{source:`hf`,duration:n};let r=e.__timelines,a=Object.values(r??{}).filter(e=>typeof e?.seek==`function`);if(a.length>0){let e=a.map(e=>i(typeof e.duration==`function`?e.duration.call(e):e.duration)).filter(e=>e!==null);return{source:`timelines`,duration:e.length===0?null:Math.max(...e)}}let o=e.document.getAnimations();if(o.length>0){let e=o.map(e=>e.effect?.getComputedTiming().endTime).filter(e=>typeof e==`number`&&Number.isFinite(e));return{source:`css`,duration:e.length===0?null:Math.round(Math.max(...e))}}let s=[...e.document.querySelectorAll(`model-viewer`)].map(e=>e).filter(e=>(e.availableAnimations?.length??0)>0);if(s.length>0){let e=s.map(e=>i(e.duration)).filter(e=>e!==null);return{source:`model`,duration:e.length===0?null:Math.max(...e)}}return null};for(await r();;){let t=a();if(t!==null||e.performance.now()>=n)return t;await r()}}async function Au(e,{motion:t,ms:n}){let r=t.duration===null?n:Math.min(Math.max(n,0),t.duration);if(t.source===`hf`)await e.__hf.seek(r/1e3);else if(t.source===`timelines`){let t=e.__timelines;for(let e of Object.values(t))typeof e?.seek==`function`&&(e.pause?.(),await e.seek(r/1e3))}else if(t.source===`css`)for(let t of e.document.getAnimations())t.pause(),t.currentTime=r;for(let t of e.document.querySelectorAll(`model-viewer`)){let e=t;typeof e.pause==`function`&&(e.pause(),e.currentTime=r/1e3)}return await new Promise(t=>e.requestAnimationFrame(()=>e.requestAnimationFrame(()=>t()))),r}let ju=1e4;async function Mu(e=ju){let t=await ku(window,e);return t===null?null:{motion:t,span:t.duration??Nu()}}function Nu(){let e=document.getAnimations().map(e=>{let t=e.effect?.getComputedTiming(),n=Number(t?.duration),r=t?.delay??0;return Number.isFinite(n)?r+n:0});return Math.round(Math.max(0,...e))}function Pu(e){let t=null,n=null,r=async()=>{for(;t!==null;){let n=t;t=null,await Au(window,{motion:e,ms:n})}n=null};return e=>(t=e,n??=r(),n)}function Fu(e){if(e.source===`css`)for(let e of document.getAnimations())e.play();else location.reload()}function Iu({motion:e,span:t}){let n=0;if(e.source===`css`){let e=document.getAnimations().map(e=>Number(e.currentTime)).filter(e=>Number.isFinite(e));n=Math.max(0,...e)}else if(e.source===`timelines`){let e=window.__timelines,t=Object.values(e??{}).find(e=>typeof e?.time==`function`),r=t?Number(t.time.call(t)):0;n=Number.isFinite(r)?r*1e3:0}return Math.round(t<=0?n:e.duration===null?n%t:Math.min(n,t))}let Lu=/* @__PURE__ */ new Map;function Ru(e){return{motion:(t,n)=>Bu(e,n),"motion-seek":({motion:e,at:t})=>{let n=Lu.get(e);return n?(n.seek(t),!0):!1},"motion-release":({motion:e})=>{let t=Lu.get(e);return t?(Fu(t.found.motion),!0):!1},"motion-moment":e=>Iu(e)}}let zu=Ru(ju);function Bu(e,{id:t,push:n,onClose:r}){let i=!1;return Mu(e).catch(()=>null).then(e=>{i||(e&&Lu.set(t,{found:e,seek:Pu(e.motion)}),n(e))}),r(()=>{i=!0,Lu.delete(t)}),!0}function Vu(t,n){if(!document.head)return!1;let r=document.createElement(`style`);return r.setAttribute(e,``),r.textContent=t,document.head.append(r),n(()=>r.remove()),!0}let Hu={"hold-animations":(e,{onClose:t})=>Vu(`*, *::before, *::after { animation-play-state: paused !important }`,t),"hide-controls":(e,{onClose:t})=>Vu($c,t),"pointer-move":(e,{push:t,onClose:n})=>{let r=0,i=()=>{r===0&&(r=requestAnimationFrame(()=>{r=0,t(null)}))};return addEventListener(`pointermove`,i),n(()=>{removeEventListener(`pointermove`,i),cancelAnimationFrame(r)}),!0}},Uu=/* @__PURE__ */ new Map;function Wu(e,t,n){let r=`${e}:${t}`,a=i(document,e),o=a instanceof HTMLElement?a:null,s=Uu.get(r);if(n===null){if(Uu.delete(r),!s||s.element!==o||!o)return;s.value===``?s.attribute===null?o.removeAttribute(`style`):o.setAttribute(`style`,s.attribute):o.style.setProperty(t,s.value,s.priority),o.getAttribute(`style`)===``&&o.removeAttribute(`style`)}else o&&(s?.element!==o&&Uu.set(r,{element:o,value:o.style.getPropertyValue(t),priority:o.style.getPropertyPriority(t),attribute:o.getAttribute(`style`)}),o.style.setProperty(t,n,`important`))}function Gu(t){return{"preview-style":({index:e,property:t,value:n})=>(Wu(e,t,n),null),"keep-previews":()=>(Uu.clear(),null),restamp:({hash:n})=>{let r=document.querySelector(`style[${e}]`);return r?(r.setAttribute(`data-hash`,n),t(),!0):!1}}}function Ku(e){return n(e).some(e=>e.matches(`a[href], button, input, select, textarea, summary, [onclick], [tabindex], [contenteditable], video[controls], audio[controls], script`))}let qu={"takes-clicks":()=>Ku(document)},$=`data-frameboard-step`,Ju=`--frameboard-step-delay`,Yu=`frameboard-present-steps`,Xu=`
|
|
115
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function Ta(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Ta(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}let Ea=/* @__PURE__ */ new Set([`type`,`properties`,`required`,`additionalProperties`]),Da=[`oneOf`,`anyOf`];function Oa(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function ka(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Ea.has(e))return null;t.push(n)}let n={},r=/* @__PURE__ */ new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Oa(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}m(n,r,e.length===1?e[0]:ka(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Oa(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Aa(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Ea)if(t in e)return;let n=t.filter(e=>Da.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=ka(t);else{let e=n[0],i=Da.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>ka([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,xa(e,r))}function ja(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):xa(i,s),xa(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Ta(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Aa(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}xa(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,m(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Na(t,`input`,e.processors),output:Na(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function F(e,t){let n=t??{seen:/* @__PURE__ */ new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return F(r.element,n);if(r.type===`set`)return F(r.valueType,n);if(r.type===`lazy`)return F(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return F(r.innerType,n);if(r.type===`intersection`)return F(r.left,n)||F(r.right,n);if(r.type===`record`||r.type===`map`)return F(r.keyType,n)||F(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:F(r.in,n)||F(r.out,n);if(r.type===`object`){for(let e in r.shape)if(F(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(F(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(F(e,n))return!0;return!!(r.rest&&F(r.rest,n))}return!1}let Ma=(e,t={})=>n=>{let r=Sa({...n,processors:t});return P(e,r),wa(r,e),ja(r,e)},Na=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Sa({...i??{},target:a,io:t,processors:n});return P(e,o),wa(o,e),ja(o,e)},Pa=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Fa=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Ia=(e,t)=>{Pa(e,`minimum`,t),Fa(e,`maximum`,t)},La=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Ra=(e,t)=>{e.patterns??=/* @__PURE__ */ new Set,e.patterns.add(t)},za=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Ba=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Va=(e,t)=>Pa(e,`minimum`,t.minimum),Ha=(e,t)=>Fa(e,`maximum`,t.maximum),Ua=e=>(t,n)=>{Ba(t,n.format);let[r,i]=e[n.format];Pa(t,`minimum`,r),Fa(t,`maximum`,i)},Wa={greater_than:(e,t)=>Pa(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>Fa(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>La(e,t.value),number_format:Ua(fe),bigint_format:Ua(pe),min_length:Va,max_length:Ha,length_equals:(e,t)=>Ia(e,t.length),min_size:Va,max_size:Ha,size_equals:(e,t)=>Ia(e,t.size),string_format:(e,t)=>{Ba(e,t.format),t.pattern&&Ra(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>za(e,t.mime)};function I(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Wa[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Pa(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Pa(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&Fa(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&Fa(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&La(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&za(t,i.mime);for(let e of i.patterns??[])Ra(t,e);return t}let Ga={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Ka=/* @__PURE__ */ new Map([[tr,zt],[rr,Bt]]),qa=e=>Ka.get(e)??e,Ja=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=I(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Ga[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(qa);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Ya=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=I(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=/* @__PURE__ */ new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):N(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},Xa=(e,t,n,r)=>{n.type=`boolean`},Za=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Qa=(e,t,n,r)=>{n.not={}},$a=(e,t,n,r)=>{let i=e._zod.def,a=o(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},eo=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(N(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(N(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},to=(e,t,n,r)=>{N(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},no=(e,t,n,r)=>{N(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},ro=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=I(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=P(a.element,t,{...r,path:[...r.path,`items`]})};function io(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?io(t.out):t.type===`catch`?io(t.innerType):e._zod.optin}let ao=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&N(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)m(i.properties,e,P(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?io(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=P(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},oo=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>P(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},so=(e,t,n,r)=>{let i=e._zod.def,a=P(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=P(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},co=(e,t,n,r)=>{let i=e._zod.def,a=P(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},lo=(e,t,n,r)=>{let i=e._zod.def;P(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},uo=Symbol();function fo(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(N(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),uo):JSON.parse(o)}let po=(e,t,n,r)=>{let i=e._zod.def;P(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=fo(i.defaultValue,e,t,n,r);o!==uo&&(n.default=o)},mo=(e,t,n,r)=>{let i=e._zod.def;P(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=fo(i.defaultValue,e,t,n,r);o!==uo&&(n._prefault=o)},ho=(e,t,n,r)=>{let i=e._zod.def;P(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{N(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},go=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;P(o,t,r);let s=t.seen.get(e);s.ref=o},_o=(e,t,n,r)=>{let i=e._zod.def;P(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},vo=(e,t,n,r)=>{let i=e._zod.def;P(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},yo=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]);function bo(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}let L=/*@__PURE__*/ E(`ZodError`,(e,t)=>{et.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);yo.has(n)||(yo.add(n),bo(n,`format`,e=>t=>rt(e,t)),bo(n,`flatten`,e=>t=>nt(e,t)),bo(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,c,2)}),bo(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,c,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),xo=/* @__PURE__ */ at(L),So=/* @__PURE__ */ ot(L),Co=/* @__PURE__ */ st(L),wo=/* @__PURE__ */ lt(L),To=/* @__PURE__ */ ht(L),Eo=/* @__PURE__ */ gt(L),Do=/* @__PURE__ */ _t(L),Oo=/* @__PURE__ */ vt(L),ko=/* @__PURE__ */ yt(L),Ao=/* @__PURE__ */ bt(L),jo=/* @__PURE__ */ xt(L),Mo=/* @__PURE__ */ St(L);function No(){O.localeError||k(di())}function Po(){O.memoizer||k({memoizer:ci()})}let R=/*@__PURE__*/ E(`ZodType`,(e,t)=>(No(),j.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(y(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return x(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ks(e,t))},superRefine(e,t){return this.check(qs(e,t))},overwrite(e){return this.check(/* @__PURE__ */ ua(e))},optional(){return Ds(this)},exactOptional(){return ks(this)},nullable(){return js(this)},nullish(){return Ds(js(this))},nonoptional(e){return Ls(this,e)},array(){return U(this)},or(e){return ys([this,e])},and(e){return xs(this,e)},transform(e){return Vs(this,Ts(e))},default(e){return Ns(this,e)},prefault(e){return Fs(this,e)},catch(e){return zs(this,e)},pipe(e){return Vs(this,e)},readonly(){return Us(this)},describe(e){let t=this.clone();return hi.add(t,{description:e}),t},meta(...e){if(e.length===0)return hi.get(this);let t=this.clone();return hi.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Fe(this,`~standard`,{...Cn(this),jsonSchema:{input:Na(this,`input`),output:Na(this,`output`)}})},set"~standard"(e){w(this,`~standard`,e)},parse:function e(t,n){return xo(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await So(this,t,n,{callee:e})},safeParse(e,t){return Co(this,e,t)},async safeParseAsync(e,t){return wo(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){w(this,`spa`,e)},validate(e,t){return ft(this,e,t)},validateAsync(e,t){return mt(this,e,t)},encode:function e(t,n){return To(this,t,n,{callee:e})},decode:function e(t,n){return Eo(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Do(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Oo(this,t,n,{callee:e})},safeEncode(e,t){return ko(this,e,t)},safeDecode(e,t){return Ao(this,e,t)},async safeEncodeAsync(e,t){return jo(this,e,t)},async safeDecodeAsync(e,t){return Mo(this,e,t)},toJSONSchema(e){return Ma(this,{})(e)},get description(){return hi.get(this)?.description},get _def(){return this._zod.def}}),Fo=/*@__PURE__*/ E(`_ZodString`,(e,t)=>{wn.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ja(e,t,n,r)},/*@__PURE__*/ Ie({format:e=>I(e).format??null,minLength:e=>I(e).minimum??null,maxLength:e=>I(e).maximum??null},{regex(...e){return this.check(/* @__PURE__ */ ia(...e))},includes(...e){return this.check(/* @__PURE__ */ sa(...e))},startsWith(...e){return this.check(/* @__PURE__ */ ca(...e))},endsWith(...e){return this.check(/* @__PURE__ */ la(...e))},min(...e){return this.check(/* @__PURE__ */ na(...e))},max(...e){return this.check(/* @__PURE__ */ ta(...e))},length(...e){return this.check(/* @__PURE__ */ ra(...e))},nonempty(...e){return this.check(/* @__PURE__ */ na(1,...e))},lowercase(e){return this.check(/* @__PURE__ */ aa(e))},uppercase(e){return this.check(/* @__PURE__ */ oa(e))},trim(){return this.check(/* @__PURE__ */ fa())},normalize(...e){return this.check(/* @__PURE__ */ da(...e))},toLowerCase(){return this.check(/* @__PURE__ */ pa())},toUpperCase(){return this.check(/* @__PURE__ */ ma())},slugify(){return this.check(/* @__PURE__ */ ha())}})),Io=/*@__PURE__*/ E(`ZodString`,(e,t)=>{wn.init(e,t),Fo.init(e,t)},{email(e){return this.check(/* @__PURE__ */ vi(Vo,e))},url(e){return this.check(/* @__PURE__ */ wi(Wo,e))},jwt(e){return this.check(/* @__PURE__ */ zi(as,e))},emoji(e){return this.check(/* @__PURE__ */ Ti(Go,e))},guid(e){return this.check(/* @__PURE__ */ yi(Ho,e))},uuid(e){return this.check(/* @__PURE__ */ bi(Uo,e))},uuidv4(e){return this.check(/* @__PURE__ */ xi(Uo,e))},uuidv6(e){return this.check(/* @__PURE__ */ Si(Uo,e))},uuidv7(e){return this.check(/* @__PURE__ */ Ci(Uo,e))},nanoid(e){return this.check(/* @__PURE__ */ Ei(Ko,e))},cuid(e){return this.check(/* @__PURE__ */ Di(qo,e))},cuid2(e){return this.check(/* @__PURE__ */ Oi(Jo,e))},ulid(e){return this.check(/* @__PURE__ */ ki(Yo,e))},base64(e){return this.check(/* @__PURE__ */ Ii(ns,e))},base64url(e){return this.check(/* @__PURE__ */ Li(rs,e))},xid(e){return this.check(/* @__PURE__ */ Ai(Xo,e))},ksuid(e){return this.check(/* @__PURE__ */ ji(Zo,e))},ipv4(e){return this.check(/* @__PURE__ */ Mi(Qo,e))},ipv6(e){return this.check(/* @__PURE__ */ Ni($o,e))},cidrv4(e){return this.check(/* @__PURE__ */ Pi(es,e))},cidrv6(e){return this.check(/* @__PURE__ */ Fi(ts,e))},e164(e){return this.check(/* @__PURE__ */ Ri(is,e))},datetime(e){return this.check(/* @__PURE__ */ Bi(Lo,e))},date(e){return this.check(/* @__PURE__ */ Vi(Ro,e))},time(e){return this.check(/* @__PURE__ */ Hi(zo,e))},duration(e){return this.check(/* @__PURE__ */ Ui(Bo,e))}});function z(e){return/* @__PURE__ */ _i(Io,e)}let B=/*@__PURE__*/ E(`ZodStringFormat`,(e,t)=>{M.init(e,t),Fo.init(e,t)}),Lo=/*@__PURE__*/ E(`ZodISODateTime`,(e,t)=>{Un.init(e,t),B.init(e,t)}),Ro=/*@__PURE__*/ E(`ZodISODate`,(e,t)=>{Wn.init(e,t),B.init(e,t)}),zo=/*@__PURE__*/ E(`ZodISOTime`,(e,t)=>{Gn.init(e,t),B.init(e,t)}),Bo=/*@__PURE__*/ E(`ZodISODuration`,(e,t)=>{Kn.init(e,t),B.init(e,t)}),Vo=/*@__PURE__*/ E(`ZodEmail`,(e,t)=>{Dn.init(e,t),B.init(e,t)}),Ho=/*@__PURE__*/ E(`ZodGUID`,(e,t)=>{Tn.init(e,t),B.init(e,t)}),Uo=/*@__PURE__*/ E(`ZodUUID`,(e,t)=>{En.init(e,t),B.init(e,t)}),Wo=/*@__PURE__*/ E(`ZodURL`,(e,t)=>{Fn.init(e,t),B.init(e,t)}),Go=/*@__PURE__*/ E(`ZodEmoji`,(e,t)=>{In.init(e,t),B.init(e,t)}),Ko=/*@__PURE__*/ E(`ZodNanoID`,(e,t)=>{Ln.init(e,t),B.init(e,t)}),qo=/*@__PURE__*/ E(`ZodCUID`,(e,t)=>{Rn.init(e,t),B.init(e,t)}),Jo=/*@__PURE__*/ E(`ZodCUID2`,(e,t)=>{zn.init(e,t),B.init(e,t)}),Yo=/*@__PURE__*/ E(`ZodULID`,(e,t)=>{Bn.init(e,t),B.init(e,t)}),Xo=/*@__PURE__*/ E(`ZodXID`,(e,t)=>{Vn.init(e,t),B.init(e,t)}),Zo=/*@__PURE__*/ E(`ZodKSUID`,(e,t)=>{Hn.init(e,t),B.init(e,t)}),Qo=/*@__PURE__*/ E(`ZodIPv4`,(e,t)=>{qn.init(e,t),B.init(e,t)}),$o=/*@__PURE__*/ E(`ZodIPv6`,(e,t)=>{Xn.init(e,t),B.init(e,t)}),es=/*@__PURE__*/ E(`ZodCIDRv4`,(e,t)=>{Zn.init(e,t),B.init(e,t)}),ts=/*@__PURE__*/ E(`ZodCIDRv6`,(e,t)=>{$n.init(e,t),B.init(e,t)}),ns=/*@__PURE__*/ E(`ZodBase64`,(e,t)=>{nr.init(e,t),B.init(e,t)}),rs=/*@__PURE__*/ E(`ZodBase64URL`,(e,t)=>{ar.init(e,t),B.init(e,t)}),is=/*@__PURE__*/ E(`ZodE164`,(e,t)=>{or.init(e,t),B.init(e,t)}),as=/*@__PURE__*/ E(`ZodJWT`,(e,t)=>{cr.init(e,t),B.init(e,t)}),os=/*@__PURE__*/ E(`ZodNumber`,(e,t)=>{lr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ya(e,t,n,r),e.isFinite=!0},/*@__PURE__*/ Ie({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=I(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=I(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=I(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>I(e).format??null},{gt(e,t){return this.check(/* @__PURE__ */ Qi(e,t))},gte(e,t){return this.check(/* @__PURE__ */ $i(e,t))},min(e,t){return this.check(/* @__PURE__ */ $i(e,t))},lt(e,t){return this.check(/* @__PURE__ */ Xi(e,t))},lte(e,t){return this.check(/* @__PURE__ */ Zi(e,t))},max(e,t){return this.check(/* @__PURE__ */ Zi(e,t))},int(e){return this.check(cs(e))},safe(e){return this.check(cs(e))},positive(e){return this.check(/* @__PURE__ */ Qi(0,e))},nonnegative(e){return this.check(/* @__PURE__ */ $i(0,e))},negative(e){return this.check(/* @__PURE__ */ Xi(0,e))},nonpositive(e){return this.check(/* @__PURE__ */ Zi(0,e))},multipleOf(e,t){return this.check(/* @__PURE__ */ ea(e,t))},step(e,t){return this.check(/* @__PURE__ */ ea(e,t))},finite(){return this}}));function V(e){return/* @__PURE__ */ Wi(os,e)}let ss=/*@__PURE__*/ E(`ZodNumberFormat`,(e,t)=>{ur.init(e,t),os.init(e,t)});function cs(e){return/* @__PURE__ */ Gi(ss,e)}let ls=/*@__PURE__*/ E(`ZodBoolean`,(e,t)=>{dr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xa(e,t,n,r)});function H(e){return/* @__PURE__ */ Ki(ls,e)}let us=/*@__PURE__*/ E(`ZodNull`,(e,t)=>{fr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Za(e,t,n,r)});function ds(e){return/* @__PURE__ */ qi(us,e)}let fs=/*@__PURE__*/ E(`ZodUnknown`,(e,t)=>{pr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function ps(){return/* @__PURE__ */ Ji(fs)}let ms=/*@__PURE__*/ E(`ZodNever`,(e,t)=>{mr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qa(e,t,n,r)});function hs(e){return/* @__PURE__ */ Yi(ms,e)}let gs=/*@__PURE__*/ E(`ZodArray`,(e,t)=>{Po(),vr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ro(e,t,n,r),e.element=t.element},{min(e,t){return this.check(/* @__PURE__ */ na(e,t))},nonempty(e){return this.check(/* @__PURE__ */ na(1,e))},max(e,t){return this.check(/* @__PURE__ */ ta(e,t))},length(e,t){return this.check(/* @__PURE__ */ ra(e,t))},unwrap(){return this.element}});function U(e,t){return/* @__PURE__ */ ga(gs,e,t)}let _s=/*@__PURE__*/ E(`ZodObject`,(e,t)=>{Po(),wr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ao(e,t,n,r),He(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return G(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(y(this._zod.def,{catchall:e}))},passthrough(){return this.clone(y(this._zod.def,{catchall:ps()}))},loose(){return this.clone(y(this._zod.def,{catchall:ps()}))},strict(){return this.clone(y(this._zod.def,{catchall:hs()}))},strip(){return this.clone(y(this._zod.def,{catchall:void 0}))},extend(e){return _e(this,e)},safeExtend(e){return ye(this,e)},merge(e){return be(this,e)},pick(e){return me(this,e)},omit(e){return ge(this,e)},partial(...e){return xe(Es,this,e[0])},exactPartial(...e){return xe(Os,this,e[0],`exactPartial`)},required(...e){return Se(Is,this,e[0])}});function W(e,t){let n={type:`object`,shape:e??{},...S(t)};return new _s(n)}let vs=/*@__PURE__*/ E(`ZodUnion`,(e,t)=>{Er.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oo(e,t,n,r),e.options=t.options});function ys(e,t){return new vs({type:`union`,options:e,...S(t)})}let bs=/*@__PURE__*/ E(`ZodIntersection`,(e,t)=>{Dr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>so(e,t,n,r)});function xs(e,t){return new bs({type:`intersection`,left:e,right:t})}let Ss=/*@__PURE__*/ E(`ZodEnum`,(e,t)=>{Ar.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$a(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Ss({...t,checks:[],...S(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Ss({...t,checks:[],...S(r),entries:i})}});function G(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new Ss({type:`enum`,entries:n,...S(t)})}let Cs=/*@__PURE__*/ E(`ZodLiteral`,(e,t)=>{jr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eo(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function K(e,t){return new Cs({type:`literal`,values:Array.isArray(e)?e:[e],...S(t)})}let ws=/*@__PURE__*/ E(`ZodTransform`,(e,t)=>{Po(),Mr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>no(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Je(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Ne(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Ne(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Ts(e){return new ws({type:`transform`,transform:e})}let Es=/*@__PURE__*/ E(`ZodOptional`,(e,t)=>{Pr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ds(e){return new Es({type:`optional`,innerType:e})}let Os=/*@__PURE__*/ E(`ZodExactOptional`,(e,t)=>{Fr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ks(e){return new Os({type:`optional`,innerType:e})}let As=/*@__PURE__*/ E(`ZodNullable`,(e,t)=>{Ir.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>co(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function js(e){return new As({type:`nullable`,innerType:e})}let Ms=/*@__PURE__*/ E(`ZodDefault`,(e,t)=>{Lr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>po(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ns(e,t){return new Ms({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():se(t)}})}let Ps=/*@__PURE__*/ E(`ZodPrefault`,(e,t)=>{zr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Fs(e,t){return new Ps({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():se(t)}})}let Is=/*@__PURE__*/ E(`ZodNonOptional`,(e,t)=>{Br.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ls(e,t){return new Is({type:`nonoptional`,innerType:e,...S(t)})}let Rs=/*@__PURE__*/ E(`ZodCatch`,(e,t)=>{Ur.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ho(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function zs(e,t){return new Rs({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Ue(t)})}let Bs=/*@__PURE__*/ E(`ZodPipe`,(e,t)=>{Wr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>go(e,t,n,r),e.in=t.in,e.out=t.out});function Vs(e,t){return new Bs({type:`pipe`,in:e,out:t})}let Hs=/*@__PURE__*/ E(`ZodReadonly`,(e,t)=>{Kr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_o(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Us(e){return new Hs({type:`readonly`,innerType:e})}let Ws=/*@__PURE__*/ E(`ZodCustom`,(e,t)=>{Jr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>to(e,t,n,r)});function Gs(e,t){return/* @__PURE__ */ _a(Ws,e??(()=>!0),t)}function Ks(e,t={}){return/* @__PURE__ */ va(Ws,e,t)}function qs(e,t){return/* @__PURE__ */ ya(e,t)}let q={step:`data-step`,effect:`data-step-effect`,start:`data-step-start`},Js=[`appear`,`fade`,`fly`,`wipe`,`zoom`],Ys=[`click`,`with`,`after`],Xs=W({x:V().finite(),y:V().finite(),width:V().finite(),height:V().finite()}),Zs=U(W({key:V().int().nonnegative(),control:Xs,target:Xs.nullable(),label:z()})),Qs=V().int().nonnegative(),$s=W({hash:z(),edits:U(ys([W({index:Qs,change:W({kind:K(`attribute`),name:K(`value`),value:z()})}),W({index:Qs,change:W({kind:K(`styles`),declarations:U(W({property:z(),value:z()}))})})]))}).nullable(),J=V().finite(),ec=V().int().nonnegative(),tc=W({hash:z(),gap:W({parent:ec,before:ec.nullable(),row:H(),flow:H(),origin:W({x:J,y:J}),room:J,line:W({x:J,y:J,width:J,height:J})})}).nullable();function nc(e,t,n){return e===`grid`||e===`inline-grid`?`grid`:e!==`flex`&&e!==`inline-flex`?`block`:n===`nowrap`?t.startsWith(`column`)?`vertical`:`horizontal`:`wrap`}let rc={deg:1,grad:.9,rad:180/Math.PI,turn:360};function ic(e){if(e===`none`||e===``)return 0;let t=/^(-?[\d.]+(?:e[+-]?\d+)?)(deg|grad|rad|turn)$/.exec(e),n=t?.[2]?rc[t[2]]:void 0;return!t||n===void 0?null:Math.round(Number(t[1])*n*100)/100}function ac(e){if(e===`none`||e===``)return{x:1,y:1};let t=e.split(/\s+/).map(e=>e.endsWith(`%`)?parseFloat(e)/100:Number(e)),[n,r=n,i=1]=t;return n===void 0||r===void 0||t.some(Number.isNaN)||t.length>3||i!==1?null:{x:n,y:r}}function oc(e){if(e===`none`||e===``)return!1;let t=/^matrix(3d)?\(([^)]*)\)$/.exec(e);if(!t?.[2])return!0;let n=t[2].split(`,`).map(Number);return(t[1]?n.slice(12,15):n.slice(4,6)).some(e=>e!==0)}let Y=V().finite(),sc=V().int().nonnegative(),cc=G([`block`,`vertical`,`horizontal`,`wrap`,`grid`]),lc=W({top:Y,right:Y,bottom:Y,left:Y}),uc=W({flow:cc,inline:H(),direction:z(),wrap:z(),justify:z(),alignItems:z(),ownJustify:H(),rowGap:Y,columnGap:Y,padding:lc,parent:cc,parentAlignItems:z(),width:Y,height:Y}),dc=W({width:Y,height:Y}),fc=W({kind:G([`box`,`text`,`media`,`container`]),natural:dc.nullable(),hugsHeight:H(),inset:dc,sizing:W({layout:uc,fills:H()}).nullable()}),pc=W({left:Y,top:Y}),mc=W({x:Y,y:Y,width:Y,height:Y}),hc=U(W({index:sc,box:mc,read:fc.nullable(),placed:pc.nullable(),nested:H(),margin:lc})).nullable(),gc=W({hash:z(),ghosts:U(W({index:sc,box:mc,placed:pc.nullable()}))}).nullable(),_c=U(W({index:sc,right:Y,top:Y})),vc=W({x:Y,y:Y}),yc=U(W({opacity:Y,radius:Y,fontFamily:z(),fontSize:Y,fontWeight:Y,lineHeight:Y.nullable(),letterSpacing:Y,textAlign:z(),textDecorationLine:z(),textTransform:z(),textWrapStyle:z(),truncated:H(),display:z(),color:z(),bordered:H(),borderWidth:Y.nullable(),holdsText:H(),textOnly:H(),text:z(),keepsBreaks:H(),rotation:W({degrees:Y.nullable(),scale:vc.nullable(),own:W({rotate:Y.nullable().optional(),scale:vc.nullable().optional()}),translated:H(),transform:W({own:z(),ruled:H(),reanchors:H()})}),placement:W({free:H(),left:Y,top:Y,width:Y.nullable(),height:Y.nullable(),inline:W({width:z(),height:z()}),wordsLeft:Y.nullable()}),layout:uc,inline:W({color:H(),backgroundColor:H(),background:H(),border:H()}),step:W({step:z().nullable(),effect:z().nullable(),start:z().nullable()})})).nullable(),bc=W({index:sc,hash:z()}).nullable(),xc=ys([W({kind:K(`toggle-play`)}),W({kind:K(`seek`),seconds:V().finite()}),W({kind:K(`toggle-sound`)}),W({kind:K(`set-flag`),name:G([`controls`,`autoplay`,`loop`,`muted`]),on:H()})]),Sc=W({tag:G([`video`,`audio`]),playable:H(),paused:H(),time:V().finite(),length:Gs(e=>typeof e==`number`),muted:H(),mutedInFile:H(),controls:H(),autoplay:H(),loop:H()}).nullable(),Cc=[`camera-orbit`,`max-camera-orbit`,`orientation`,`scale`,`animation-name`,`autoplay`],wc=W({name:G(Cc),value:z().nullable()}),Tc=z().nullable(),Ec=W({src:z(),loaded:H(),clips:U(z()),orbit:W({theta:V().finite(),phi:V().finite()}).nullable(),staged:W({"camera-orbit":Tc,"max-camera-orbit":Tc,orientation:Tc,scale:Tc,"animation-name":Tc,autoplay:Tc})}).nullable(),Dc=W({motion:W({source:G([`hf`,`timelines`,`css`,`model`]),duration:V().finite().nonnegative().nullable()}),span:V().finite().nonnegative()}),X=`frameboard-bridge`,Oc=`data-frameboard-editing`,kc=/* @__PURE__ */ `bindings.content-height.controls.controls-act.controls-edits.element-box.element-boxes.focus-keys.gap-at.hide-controls.hide-scrollbar.hide-strips.hold-animations.keep-previews.keys.live-body.live-element.measure.media.media-act.model.model-stage.motion.motion-moment.motion-release.motion-seek.overflow.page-colors.paint.pick-at.pins.pointer-move.preview-style.restamp.scroll.scroll-act.step-preview.steps.steps-show.takes-clicks.text-caret.text-edit.text-written.theme`.split(`.`);function Ac(e,t){let{data:n}=e;if(e.origin!==t||!Vc(n)||n.tag!==`frameboard-bridge`)return null;if(n.kind===`shown`){let{page:e,hash:t}=n;return typeof e==`string`&&e!==``&&(typeof t==`string`||t===null)?{tag:X,kind:`shown`,page:e,hash:t}:null}if(typeof n.id!=`string`||n.id===``)return null;let{id:r}=n;switch(n.kind){case`request`:return typeof n.op==`string`&&kc.includes(n.op)?{tag:X,kind:`request`,id:r,op:n.op,args:n.args}:null;case`reply`:return n.ok===!0?{tag:X,kind:`reply`,id:r,ok:!0,value:n.value}:n.ok===!1&&typeof n.error==`string`?{tag:X,kind:`reply`,id:r,ok:!1,error:n.error}:null;case`push`:return{tag:X,kind:`push`,id:r,value:n.value};case`close`:return{tag:X,kind:`close`,id:r};default:return null}}let Z=V().int().nonnegative(),jc=V().int().nonnegative(),Q=W({}).strict(),Mc=W({index:Z,hash:z()}),Nc=W({x:V().finite(),y:V().finite()}),Pc=W({x:V().finite(),y:V().finite(),width:V().finite(),height:V().finite()}),Fc=W({left:V().finite(),top:V().finite(),right:V().finite(),bottom:V().finite()}),Ic=W({top:V().finite(),size:V().finite()}),Lc=ys([W({kind:K(`commit`),text:z(),breaks:H(),run:V().int().nonnegative().optional()}),W({kind:K(`closed`)})]),Rc={theme:{args:W({theme:G([`light`,`dark`])}),value:H()},"hide-scrollbar":{args:Q,value:H()},scroll:{args:Q,value:Ic.nullable(),push:Ic.nullable()},"scroll-act":{args:ys([W({act:K(`page`),toward:ys([K(-1),K(1)])}),W({act:K(`to`),top:V().finite()})]),value:H()},keys:{args:W({keys:U(z()),keepTyping:H(),keepButtons:H().optional()}),value:H(),push:W({key:z(),repeat:H()})},"focus-keys":{args:Q,value:H(),push:K(!0)},"content-height":{args:Q,value:V().int().positive().nullable()},"element-box":{args:Mc,value:Fc.nullable()},"element-boxes":{args:W({hash:z(),indexes:U(Z)}),value:U(W({index:Z,box:Pc})).nullable()},"live-body":{args:Q,value:bc},"live-element":{args:W({hash:z(),indexes:U(Z)}),value:yc},measure:{args:W({hash:z(),indexes:U(Z)}),value:hc,push:hc},overflow:{args:Q,value:gc,push:gc},pins:{args:W({indexes:U(Z)}),value:_c,push:_c},"pick-at":{args:W({at:Nc}),value:W({hash:z().nullable(),chain:U(W({index:Z,tag:z()}))})},"gap-at":{args:W({at:Nc,carried:Z.optional()}),value:tc},"hide-strips":{args:Q,value:H()},"keep-previews":{args:Q,value:ds()},media:{args:Mc,value:Sc,push:Sc},"media-act":{args:Mc.extend({act:xc}),value:H()},model:{args:Mc,value:Ec,push:Ec},"model-stage":{args:Mc.and(wc),value:H()},paint:{args:W({fill:z()}),value:z().nullable()},"preview-style":{args:W({index:Z,property:z(),value:z().nullable()}),value:ds()},restamp:{args:W({hash:z()}),value:H()},"text-edit":{args:Mc.extend({at:Nc.optional(),empty:H().optional()}),value:H(),push:Lc},"text-caret":{args:W({edit:z(),at:Nc}),value:H()},"text-written":{args:W({edit:z(),written:H()}),value:ds()},steps:{args:W({shown:jc}),value:jc,push:jc},"steps-show":{args:W({steps:z(),shown:jc,entering:Z.nullable()}),value:H()},"step-preview":{args:W({index:Z,effect:G(Js)}),value:H()},"hold-animations":{args:Q,value:H()},"hide-controls":{args:Q,value:H()},"pointer-move":{args:Q,value:H(),push:ds()},motion:{args:Q,value:H(),push:Dc.nullable()},"motion-seek":{args:W({motion:z(),at:V().finite()}),value:H()},"motion-release":{args:W({motion:z()}),value:H()},"motion-moment":{args:Dc,value:V().finite().nonnegative()},controls:{args:Q,value:H(),push:jc},"controls-act":{args:W({controls:z(),act:G([`reset`,`settle`])}),value:H()},"controls-edits":{args:W({controls:z()}),value:$s},"takes-clicks":{args:Q,value:H()},bindings:{args:Q,value:Zs,push:Zs},"page-colors":{args:Q,value:W({fill:z().nullable(),ink:z()})}},zc=Symbol(`refused`);function Bc(e,t){let n=Rc[e].args.safeParse(t);return n.success?n.data:zc}function Vc(e){return typeof e==`object`&&!!e}let Hc=/^http:\/\/(127\.0\.0\.1|localhost)(:\d{1,5})?$/;function Uc(e,t){return e===`null`?!1:e===t||Hc.test(e)}[...[{name:`small-phone`,label:`Small phone`,group:`phone`,width:375,height:667},{name:`iphone-16`,label:`iPhone 16`,group:`phone`,width:393,height:852},{name:`iphone-18-pro`,label:`iPhone 18 Pro`,group:`phone`,width:402,height:874},{name:`android`,label:`Android`,group:`phone`,width:412,height:917},{name:`iphone-16-pro-max`,label:`iPhone 16 Pro Max`,group:`phone`,width:440,height:956},{name:`ipad-mini`,label:`iPad mini`,group:`tablet`,width:744,height:1133},{name:`ipad-pro-12-9`,label:`iPad Pro 12.9`,group:`tablet`,width:1024,height:1366},{name:`macbook-air`,label:`MacBook Air`,group:`desktop`,width:1280,height:832},{name:`full-hd`,label:`Full HD`,group:`desktop`,width:1920,height:1080},{name:`slide-16-9`,label:`Slide 16:9`,group:`slide`,width:1920,height:1080},{name:`slide-4-3`,label:`Slide 4:3`,group:`slide`,width:1024,height:768},{name:`og-card`,label:`Open Graph`,group:`social`,width:1200,height:630},{name:`linkedin-post`,label:`LinkedIn post`,group:`social`,width:1200,height:627},{name:`video-landscape`,label:`Video landscape`,group:`video`,width:1920,height:1080},{name:`video-portrait`,label:`Video portrait`,group:`video`,width:1080,height:1920}].map(e=>e.name)],28+{height:14,reach:.06,radius:10}.height;let Wc={width:81,height:30,top:14};Wc.top+Wc.height+10,Wc.top,Wc.height;function Gc(e=document){let t=e.defaultView,n=e=>e&&t?t.getComputedStyle(e):null,r=n(e.documentElement),i=n(e.body);return{fill:[r?.backgroundColor,i?.backgroundColor].find(e=>e!==void 0&&e!==`transparent`&&!/^rgba\(.*,\s*0\)$/.test(e))??null,ink:i?.color??r?.color??`CanvasText`}}function Kc(){let e=document.documentElement.scrollHeight;return e<=innerHeight+1?null:{top:scrollY/e,size:innerHeight/e}}let qc={theme:({theme:e})=>(t(document.documentElement,e),!0),"hide-scrollbar":(t,{onClose:n})=>{if(!document.head)return!1;let r=document.createElement(`style`);return r.setAttribute(e,``),r.textContent=`html { scrollbar-width: none }`,document.head.append(r),n(()=>r.remove()),!0},scroll:(e,{push:t,onClose:n})=>{let r=Kc(),i=()=>{let e=Kc();(e?.top!==r?.top||e?.size!==r?.size)&&(r=e,t(e))},a=new ResizeObserver(i);return a.observe(document.documentElement),addEventListener(`scroll`,i),addEventListener(`resize`,i),n(()=>{a.disconnect(),removeEventListener(`scroll`,i),removeEventListener(`resize`,i)}),r},"scroll-act":e=>(e.act===`page`?scrollBy({top:e.toward*innerHeight}):scrollTo({top:e.top*document.documentElement.scrollHeight}),!0),"content-height":()=>document.body?Jc(document):null,"page-colors":()=>Gc(document)};function Jc(e){let t=e.defaultView;if(!t)return 1;let n=e=>{let n=t.getComputedStyle(e);return n.overflowX!==`visible`||n.overflowY!==`visible`},r=t=>{for(let r=t.parentElement;r&&r!==e.body;r=r.parentElement)if(n(r))return!0;return!1},i=(e,t)=>e<t?(t-e)/2:0,a=r=>{let a=-1/0;if(n(r))return a;let o=parseFloat(t.getComputedStyle(r).lineHeight);for(let n of r.childNodes){if(n.nodeType!==t.Node.TEXT_NODE)continue;let r=e.createRange();r.selectNodeContents(n);for(let e of r.getClientRects())(e.width!==0||e.height!==0)&&(a=Math.max(a,e.bottom-i(o,e.height)))}return a},o=[`img`,`video`,`canvas`,`iframe`,`object`,`embed`,`audio`],s=e=>{let n=e.getBoundingClientRect();if(e.namespaceURI!==`http://www.w3.org/1999/xhtml`||o.includes(e.localName))return n.bottom;let r=t.getComputedStyle(e);if(r.display!==`inline`||parseFloat(r.paddingBottom)+parseFloat(r.borderBottomWidth)>0)return n.bottom;let a=parseFloat(r.paddingTop)+parseFloat(r.borderTopWidth);return n.bottom-i(parseFloat(r.lineHeight),n.height-a)},c=e.documentElement.getBoundingClientRect().bottom;for(let t of e.querySelectorAll(`body *`))r(t)||(c=Math.max(c,s(t),a(t)));return Math.max(1,Math.ceil(c+t.scrollY))}let Yc=`data-binds`;function Xc(e){let t=e.trim().split(/\s+/),n=t.pop(),r=t.join(` `);return!n||r===``?null:{selector:r,property:n}}function Zc(e){return/^--./.test(e)}function Qc(e){let t=/* @__PURE__ */ new Map;for(let{target:n,property:r,value:i,unit:a}of e){let e=t.get(n)??/* @__PURE__ */ new Map;e.set(r,`${i}${a}`),t.set(n,e)}return[...e.map(({index:e,value:t})=>({index:e,change:{kind:`attribute`,name:`value`,value:t}})),...[...t].map(([e,t])=>({index:e,change:{kind:`styles`,declarations:[...t].map(([e,t])=>({property:e,value:t}))}}))]}let $c=`[${Yc}], label:has([${Yc}]), :not(html, body):has(> [${Yc}], > label > [${Yc}]):not(:has(> :not([${Yc}], label))) { display: none !important }`;function el(e,t){let n=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Map,a=t=>{let n=Xc(t.getAttribute(`data-binds`)??``);if(!n||!Zc(n.property))return null;let r;try{r=e.querySelector(n.selector)}catch{return null}return r?{control:t,target:r,property:n.property,unit:t.getAttribute(`data-unit`)??``}:null},o=e=>{let r=n.get(e);n.delete(e);let a=r&&tl(r.target);if(r&&a){let e=[...n.values()].reverse().find(e=>e.target===r.target&&e.property===r.property),t=i.get(r.target)?.get(r.property);e?a.setProperty(r.property,`${e.control.value}${e.unit}`):!t||t.value===``?a.removeProperty(r.property):a.setProperty(r.property,t.value,t.priority)}t(n.size)},s=e=>{let r=e.target;if(!nl(r))return;if(r.value===``){n.has(r)&&o(r);return}let s=a(r),c=s&&tl(s.target);if(!s||!c)return;let l=i.get(s.target)??/* @__PURE__ */ new Map;l.has(s.property)||(l.set(s.property,{value:c.getPropertyValue(s.property),priority:c.getPropertyPriority(s.property)}),i.set(s.target,l)),c.setProperty(s.property,`${r.value}${s.unit}`),n.delete(r),n.set(r,s),t(n.size)};return e.addEventListener(`input`,s,!0),{edits:()=>{let t=[];for(let{control:i,target:a,property:o,unit:s}of n.values()){let n=r(e,i),c=r(e,a);n!==null&&c!==null&&i.value!==``&&t.push({index:n,value:i.value,unit:s,target:c,property:o})}return Qc(t)},reset:()=>{for(let e of n.keys())e.value=e.defaultValue;for(let[e,t]of i){let n=tl(e);for(let[e,{value:r,priority:i}]of t)r===``?n?.removeProperty(e):n?.setProperty(e,r,i)}n.clear(),i.clear(),t(0)},settle:()=>{for(let e of n.keys())e.setAttribute(`value`,e.value);n.clear(),i.clear(),t(0)},detach:()=>e.removeEventListener(`input`,s,!0)}}function tl(e){let t=e.style;return t&&typeof t.setProperty==`function`?t:null}function nl(e){return e!==null&&`hasAttribute`in e&&e.hasAttribute(`data-binds`)&&`value`in e&&`defaultValue`in e}function rl(e){return[...e.querySelectorAll(`[${Yc}]`)].map((t,n)=>{let r=t.getAttribute(`data-binds`)??``,i=Xc(r),a=i&&Zc(i.property)?il(e,i.selector):null,o=i?Zc(i.property)?a?`${i.selector} ${i.property}`:`${i.selector}, no match`:`${i.property}, not a custom property`:`${r.trim()||`data-binds`}, no property`;return{key:n,control:al(t),target:a?al(a):null,label:o}})}function il(e,t){try{return e.querySelector(t)}catch{return null}}function al(e){let t=e.getBoundingClientRect();return{x:Math.round(t.left),y:Math.round(t.top),width:Math.round(t.width),height:Math.round(t.height)}}let ol=/* @__PURE__ */ new Map,sl={controls:(e,{id:t,push:n,onClose:r})=>{let i=el(document,e=>n(e));return ol.set(t,i),r(()=>{i.reset(),i.detach(),ol.delete(t)}),!0},"controls-act":({controls:e,act:t})=>{let n=ol.get(e);return n?(t===`reset`?n.reset():n.settle(),!0):!1},"controls-edits":({controls:e})=>{let t=ol.get(e),n=a(document),r=t?.edits()??[];return n===null||r.length===0?null:{hash:n,edits:r}},bindings:(e,{push:t,onClose:n})=>{let r=document.documentElement;if(!r)return[];let i=()=>t(rl(document)),a=new ResizeObserver(i);return a.observe(r),addEventListener(`scroll`,i,!0),n(()=>{a.disconnect(),removeEventListener(`scroll`,i,!0)}),rl(document)}},cl=/* @__PURE__ */ new Set([`html`,`body`]);function ll(e,t){let n=[];for(let i=document.elementFromPoint(e,t);i&&!cl.has(i.localName);i=i.parentElement){let e=r(document,i);e!==null&&n.push({index:e,tag:i.localName})}return n}let ul=/* @__PURE__ */ new Set(/* @__PURE__ */ `area.br.col.embed.hr.iframe.img.input.link.meta.model-viewer.noscript.object.picture.script.select.source.style.template.textarea.title.track.video.audio.canvas.wbr.p.h1.h2.h3.h4.h5.h6.pre.button.label.a`.split(`.`));function dl(e){if(e.localName===`body`)return!0;if(e.namespaceURI!==`http://www.w3.org/1999/xhtml`||ul.has(e.localName)||e.childElementCount===0||e.closest(`svg, math`))return!1;let t=getComputedStyle(e).display;return t.startsWith(`inline`)||t===`contents`?!1:![...e.childNodes].some(e=>e.nodeType===Node.TEXT_NODE&&(e.textContent??``).trim()!==``)}function fl(e){let t=e.display;if(t.endsWith(`grid`))return{row:!0,reverse:!1,flow:!0};if(!t.endsWith(`flex`))return{row:!1,reverse:!1,flow:!1};let n=e.flexDirection;return{row:n.startsWith(`row`),reverse:n.endsWith(`reverse`),flow:!0}}function pl(e){let t=e=>{let t=getComputedStyle(e);return t.position!==`static`||t.transform!==`none`},n=e===document.body||e===document.documentElement?null:e;for(let r=e;r&&!n;)t(r)&&(n=r),r=r.parentElement;if(!n)return{x:0-scrollX,y:0-scrollY};let r=n.getBoundingClientRect();return{x:r.left+n.clientLeft-n.scrollLeft,y:r.top+n.clientTop-n.scrollTop}}function ml(e,t,n,r){if(!n){let n=t.top+t.height/2;return r?e.y>n:e.y<n}if(e.y<t.top)return!0;if(e.y>t.bottom)return!1;let i=t.left+t.width/2;return r?e.x>i:e.x<i}function hl(e){let t=document.body;if(!t)return null;let n=document.elementFromPoint(e.x,e.y);for(n&&t.contains(n)||(n=t);n&&!dl(n);)n=n.parentElement;let i=n&&r(document,n);if(!n||i==null)return null;let a=getComputedStyle(n),{row:o,reverse:s,flow:c}=fl(a),l=[...n.children].flatMap(e=>{let t=r(document,e),n=e.getBoundingClientRect();return t!==null&&(n.width>0||n.height>0)?[{index:t,box:n}]:[]}),u=l.findIndex(({box:t})=>ml(e,t,o,s)),d=u===-1?l.at(-1):l[u-1],f=u===-1?void 0:l[u],p=e=>Number.parseFloat(a.getPropertyValue(`padding-${e}`))||0;return{parent:i,before:f?.index??null,row:o,flow:c,origin:pl(n),room:Math.max(0,n.clientWidth-p(`left`)-p(`right`)),line:gl(n.getBoundingClientRect(),a,o,s,{after:d?.box,ahead:f?.box})}}function gl(e,t,n,r,{after:i,ahead:a}){let o=e=>Number.parseFloat(t.getPropertyValue(`padding-${e}`))||0,s={left:e.left+o(`left`),right:e.right-o(`right`),top:e.top+o(`top`),bottom:e.bottom-o(`bottom`)};if(n){let e=r?a:i,t=r?i:a,n=e&&t?(e.right+t.left)/2:e?.right??t?.left??s.left,o=a??i,c=o?.top??s.top,l=o?.bottom??s.bottom;return{x:n,y:c,width:0,height:Math.max(0,l-c)}}let c=r?a:i,l=r?i:a,u=c&&l?(c.bottom+l.top)/2:c?.bottom??l?.top??s.top;return{x:s.left,y:u,width:Math.max(0,s.right-s.left),height:0}}function _l(e,t){let n=hl(e),a=i(document,t),o=n?i(document,n.parent):null;if(!n||!a||!o||a.contains(o))return null;let s=a.nextElementSibling;return o===a.parentElement&&(n.before===t||n.before===(s?r(document,s):null))?null:n}function vl(e){if(!document.body)return null;let t=document.createElement(`div`);t.style.background=e,document.body.append(t);let n=getComputedStyle(t).backgroundColor;return t.remove(),n}let yl={"pick-at":({at:e})=>({hash:a(document),chain:ll(e.x,e.y)}),"gap-at":({at:e,carried:t})=>{let n=a(document),r=t===void 0?hl(e):_l(e,t);return n&&r?{hash:n,gap:r}:null},paint:({fill:e})=>vl(e)};function bl(e,t){e.readyState===`loading`?e.addEventListener(`DOMContentLoaded`,t,{once:!0}):t()}function xl(e){return a(document)===e.hash?i(document,e.index):null}let Sl=[`Shift`,`Meta`,`Alt`,`Control`],Cl=typeof navigator==`object`?navigator.platform:``,wl=/Mac|iPod|iPhone|iPad/.test(Cl)?`Meta`:`Control`,Tl=Cl===`Win32`?[`Control`,`Alt`]:[`Alt`];function El(e){return!!(e.key&&e.code&&e.getModifierState)}function Dl(e){let t=e.target;return e.repeat||e.isComposing||t!==e.currentTarget&&t.matches(`[contenteditable],input,select,textarea`)}function Ol(e,t){return typeof e.getModifierState==`function`?e.getModifierState(t)||Tl.includes(t)&&e.getModifierState(`AltGraph`):!1}function kl(e){return e.trim().split(` `).map(e=>{let t=e.split(/(?<=\w|\])\+/),n=t.pop(),r=n.match(/^\((.+)\)$/),i=r?RegExp(`^(?:${r[1]})$`,`iv`):n,a=[],o=[];for(let e of t){let t=e.match(/^\[(.*)\]$/),n=t?.[1]??e;n=n===`$mod`?wl:n,t?o.push(n):a.push(n)}return[a,o,i]})}function Al(e,[t,n,r]){let i=t.includes(`AltGraph`);return!((r instanceof RegExp?!(r.test(e.key)||r.test(e.code)):r.toUpperCase()!==e.key.toUpperCase()&&r!==e.code)||t.find(t=>!Ol(e,t))||Sl.find(a=>!t.includes(a)&&!n.includes(a)&&r!==a&&Ol(e,a)&&!(i&&Tl.includes(a))))}function jl(e,t={}){let n=t.timeout??1e3,r=t.ignore??Dl,i=Object.keys(e).map(t=>[t,kl(t),e[t]]),a=/* @__PURE__ */ new Map,o=null;return e=>{if(!El(e)||r(e))return;let t=[];for(let[n,r,o]of i){let[i,...s]=a.get(n)||r;if(!Al(e,i))Ol(e,e.key)||a.delete(n);else if(s.length>0)a.set(n,s),t.push(n);else if(a.delete(n),t.length)console.warn(`tinykeys: Conflict found, "${n}" did not fire, waiting for:`,t);else{o(e);break}}o&&clearTimeout(o),o=setTimeout(()=>a.clear(),n)}}function Ml(e,t,n={}){let r=n.event??`keydown`,i=jl(t,n);return e.addEventListener(r,i,n.capture),()=>{e.removeEventListener(r,i,n.capture)}}function Nl(e){return(e.code===`Space`||e.key===`Enter`)&&e.target instanceof Element&&e.target.closest(`button`)!==null}function Pl(e,{keepTyping:t,keepButtons:n}){if(e.isComposing||e.defaultPrevented||n&&Nl(e))return!0;if(!t)return!1;let r=e.target;return r instanceof HTMLElement&&(r.isContentEditable||r.matches(`[contenteditable],input,select,textarea`))}let Fl={keys:({keys:e,...t},{push:n,onClose:r})=>(r(Ml(window,Object.fromEntries(e.map(e=>[e,t=>{t.preventDefault(),n({key:e,repeat:t.repeat})}])),{ignore:e=>Pl(e,t)})),!0),"focus-keys":(e,{push:t,onClose:n})=>{let r=()=>t(!0);return window.addEventListener(`keydown`,r,!0),n(()=>window.removeEventListener(`keydown`,r,!0)),!0}};function Il(e){return Math.round(parseFloat(e)*100)/100}function Ll(e,t){let n=e.parentElement,r=n?getComputedStyle(n):null,i=e instanceof HTMLElement?e:null,a=e=>Il(e)||0;return{flow:nc(t.display,t.flexDirection,t.flexWrap),inline:t.display.startsWith(`inline-`),direction:t.flexDirection,wrap:t.flexWrap,justify:t.justifyContent,alignItems:t.alignItems,ownJustify:!!i?.style.getPropertyValue(`justify-content`),rowGap:t.rowGap===`normal`?0:a(t.rowGap),columnGap:t.columnGap===`normal`?0:a(t.columnGap),padding:{top:a(t.paddingTop),right:a(t.paddingRight),bottom:a(t.paddingBottom),left:a(t.paddingLeft)},parent:r?nc(r.display,r.flexDirection,r.flexWrap):`block`,parentAlignItems:r?.alignItems??`normal`,width:Math.round(i?.offsetWidth??0),height:Math.round(i?.offsetHeight??0)}}function Rl(e){let t=getComputedStyle(e),n=e.textContent??``,r=[t.borderTopWidth,t.borderRightWidth,t.borderBottomWidth,t.borderLeftWidth];return{opacity:Number(t.opacity),radius:Math.round(parseFloat(t.borderTopLeftRadius)||0),fontFamily:t.fontFamily,fontSize:Il(t.fontSize),fontWeight:Number(t.fontWeight),lineHeight:t.lineHeight===`normal`?null:Il(t.lineHeight),letterSpacing:t.letterSpacing===`normal`?0:Il(t.letterSpacing),textAlign:Kl(t.textAlign,t.direction),textDecorationLine:t.textDecorationLine,textTransform:t.textTransform,textWrapStyle:t.getPropertyValue(`text-wrap-style`)||`auto`,truncated:t.textOverflow===`ellipsis`&&t.overflowX!==`visible`&&t.getPropertyValue(`text-wrap-mode`)===`nowrap`,display:t.display,color:t.color,bordered:r.some(e=>parseFloat(e)>0),borderWidth:r.every(e=>e===r[0])?Il(t.borderTopWidth):null,holdsText:n.trim()!==``||zl(e,n),textOnly:e.childElementCount===0&&(n.trim()!==``||zl(e,n)),text:n,keepsBreaks:t.whiteSpace!==`normal`&&t.whiteSpace!==`nowrap`,rotation:{degrees:ic(t.rotate),scale:ac(t.scale),own:Hl(e),translated:oc(t.transform),transform:Ul(e,t)},placement:Bl(e,t),layout:Ll(e,t),inline:Gl(e),step:{step:e.getAttribute(q.step),effect:e.getAttribute(q.effect),start:e.getAttribute(q.start)}}}function zl(e,t){return e.localName===`p`&&e.childElementCount===0&&t.trim()===``}function Bl(e,t){let n=t.position===`absolute`||t.position===`fixed`,r=e=>{let t=parseFloat(e);return Number.isNaN(t)?null:Math.round(t)},i=r(t.width),a=r(t.height),o=e instanceof HTMLElement?e.style:null,s={width:o?.getPropertyValue(`width`)??``,height:o?.getPropertyValue(`height`)??``};if(n&&t.left.endsWith(`px`)&&t.top.endsWith(`px`))return{free:n,left:Math.round(parseFloat(t.left)),top:Math.round(parseFloat(t.top)),width:i,height:a,inline:s,wordsLeft:null};let c=e.parentElement,l=e=>{let t=getComputedStyle(e);return t.position!==`static`||t.transform!==`none`},u=null;if(t.position!==`fixed`){if(!n&&c&&c!==document.body&&c!==document.documentElement)u=c;else for(let e=c;e&&!u;e=e.parentElement)l(e)&&(u=e)}let d=t.position===`fixed`?0:-scrollX,f=t.position===`fixed`?0:-scrollY;if(u){let e=u.getBoundingClientRect();d=e.left+u.clientLeft-u.scrollLeft,f=e.top+u.clientTop-u.scrollTop}let p=e.getBoundingClientRect(),m=parseFloat(t.marginLeft)||0,h=Vl(e,t);return{free:n,left:Math.round(p.left-d-m),top:Math.round(p.top-f-(parseFloat(t.marginTop)||0)),width:i,height:a,inline:s,wordsLeft:h===null?null:Math.round(h-d-m)}}function Vl(e,t){if(!(e.childNodes.length>0&&[...e.childNodes].every(e=>e.nodeType===Node.TEXT_NODE)&&e.textContent?.trim()))return null;let n=document.createRange();n.selectNodeContents(e);let r=(parseFloat(t.borderLeftWidth)||0)+(parseFloat(t.paddingLeft)||0);return n.getBoundingClientRect().left-r}function Hl(e){let t=e instanceof HTMLElement?e:null,n=!!t?.style.getPropertyValue(`rotate`),r=!!t?.style.getPropertyValue(`scale`);if(!t||!n&&!r)return{};let i=t.getAttribute(`style`);t.style.removeProperty(`rotate`),t.style.removeProperty(`scale`);let a=getComputedStyle(t),o={...n?{rotate:ic(a.rotate)}:{},...r?{scale:ac(a.scale)}:{}};return i===null?t.removeAttribute(`style`):t.setAttribute(`style`,i),o}function Ul(e,t){let n=e instanceof HTMLElement?e.style.getPropertyValue(`transform`):``;return{own:n,ruled:n===``&&t.transform!==`none`,reanchors:t.transform===`none`&&Wl(e,t)}}function Wl(e,t){let n=t.position!==`static`;for(let t of e.querySelectorAll(`*`)){let r=getComputedStyle(t).position;if(r!==`fixed`&&(r!==`absolute`||n))continue;let i=!1;for(let n=t.parentElement;n&&n!==e&&!i;n=n.parentElement){let e=getComputedStyle(n);i=e.transform!==`none`||r===`absolute`&&e.position!==`static`}if(!i)return!0}return!1}function Gl(e){let t=e instanceof HTMLElement?e.style:null,n=t?Array.from({length:t.length},(e,n)=>t.item(n)):[];return{color:n.includes(`color`),backgroundColor:n.includes(`background-color`),background:/(?:^|;)\s*background\s*:/i.test(e.getAttribute(`style`)??``),border:n.some(e=>e.startsWith(`border-`)&&!e.endsWith(`-radius`))}}function Kl(e,t){return e===`start`?t===`rtl`?`right`:`left`:e===`end`?t===`rtl`?`left`:`right`:e}let ql={"live-element":({hash:e,indexes:t})=>{if(a(document)!==e)return null;let n=t.flatMap(e=>{let t=i(document,e);return t?[Rl(t)]:[]});return n.length===t.length?n:null},"live-body":()=>{let e=a(document),t=document.body?r(document,document.body):null;return e!==null&&t!==null?{index:t,hash:e}:null}},Jl=/* @__PURE__ */ new Set([`html`,`body`]),Yl=/* @__PURE__ */ new Set([`img`,`video`,`model-viewer`]);function Xl(e){if(!e||Jl.has(e.localName))return null;if(Yl.has(e.localName))return`media`;let t=(e.textContent??``).trim()!==``;return e.childElementCount>0?t&&[...e.children].every(Zl)?`text`:`container`:t?`text`:e.localName===`div`?`box`:null}function Zl(e){let t=getComputedStyle(e).display;return t===`inline`||t.startsWith(`inline-`)}function Ql(e){let t=Xl(e),n=getComputedStyle(e);return!t||ic(n.rotate)!==0||n.transform.startsWith(`matrix3d(`)||(t===`text`||t===`container`)&&(n.display===`inline`||n.display===`contents`)?null:{kind:t,natural:nu(e),hugsHeight:t===`text`&&!ru(e),inset:tu(n),sizing:t===`container`?eu(e,n):null}}let $l=/* @__PURE__ */ new Set([`vertical`,`horizontal`,`wrap`]);function eu(e,t){let n=Ll(e,t);return{layout:n,fills:$l.has(n.parent)&&(parseFloat(t.flexGrow)||0)>0}}function tu(e){if(e.boxSizing!==`content-box`)return{width:0,height:0};let t=(...e)=>e.reduce((e,t)=>e+(parseFloat(t)||0),0);return{width:t(e.paddingLeft,e.paddingRight,e.borderLeftWidth,e.borderRightWidth),height:t(e.paddingTop,e.paddingBottom,e.borderTopWidth,e.borderBottomWidth)}}function nu(e){let[t,n]=e instanceof HTMLImageElement?[e.naturalWidth,e.naturalHeight]:e instanceof HTMLVideoElement?[e.videoWidth,e.videoHeight]:[0,0];return t>0&&n>0?{width:t,height:n}:null}function ru(e){let t=e instanceof HTMLElement?e.style.height:``;return t!==``&&t!==`auto`}function iu(e,t){if(t.some(t=>t!==e&&t.contains(e)))return null;let n=getComputedStyle(e);if(n.position!==`absolute`&&n.position!==`fixed`)return null;let r=parseFloat(n.left),i=parseFloat(n.top);return Number.isNaN(r)||Number.isNaN(i)?null:{left:r,top:i}}function au(e){let t=getComputedStyle(e),n=e=>Number.parseFloat(e)||0;return{top:n(t.marginTop),right:n(t.marginRight),bottom:n(t.marginBottom),left:n(t.marginLeft)}}function ou(e){let t=e.getBoundingClientRect();return{x:Math.round(t.left),y:Math.round(t.top),width:Math.round(t.width),height:Math.round(t.height)}}function su(e){let t=e.getBoundingClientRect();return{x:t.left,y:t.top,width:t.width,height:t.height}}function cu(e,t){if(a(document)!==e)return null;let n=t.flatMap(e=>{let t=i(document,e);return t?[t]:[]});return n.length===t.length?n:null}function lu(e,t){return t.map((n,r)=>({index:e[r]??0,box:ou(n),read:Ql(n),placed:iu(n,[]),nested:t.some(e=>e!==n&&e.contains(n)),margin:au(n)}))}function uu(){let e=document.body;if(!e)return[];let t=innerWidth,r=innerHeight,i=[],a=[];return n(document).forEach((n,o)=>{if(!e.contains(n)||n===e||a.some(e=>e.contains(n))||getComputedStyle(n).position===`fixed`)return;let s=n.getBoundingClientRect();(s.width!==0||s.height!==0)&&(s.left<-1||s.top<-1||s.right>t+1||s.bottom>r+1)&&!du(n,e)&&(a.push(n),i.push({index:o,box:ou(n),placed:iu(n,[])}))}),i}function du(e,t){let n=e=>{let t=e.parentElement;if(getComputedStyle(e).position!==`absolute`)return t;for(;t&&getComputedStyle(t).position===`static`&&getComputedStyle(t).transform===`none`;)t=t.parentElement;return t};for(let r=n(e);r&&r!==t&&t.contains(r);r=n(r)){let e=getComputedStyle(r);if(e.overflowX!==`visible`||e.overflowY!==`visible`)return!0}return!1}function fu(){let e=a(document);return e===null?null:{hash:e,ghosts:uu()}}function pu(e){return e.flatMap(e=>{let t=i(document,e)?.getBoundingClientRect();return t?[{index:e,right:t.right,top:t.top}]:[]})}function mu(e,t,n){let r=new ResizeObserver(t);for(let t of[...e,document.documentElement])r.observe(t);let i=new MutationObserver(t);if(n)for(let t of e)i.observe(t,{attributes:!0,attributeFilter:[`style`]});return addEventListener(`scroll`,t,!0),addEventListener(`resize`,t),()=>{r.disconnect(),i.disconnect(),removeEventListener(`scroll`,t,!0),removeEventListener(`resize`,t)}}let hu={"element-boxes":({hash:e,indexes:t})=>a(document)===e?t.flatMap(e=>{let t=i(document,e),n=t?su(t):null;return n&&n.width>0&&n.height>0?[{index:e,box:n}]:[]}):null,measure:({hash:e,indexes:t},{push:n,onClose:r})=>{let i=cu(e,t);return i?(r(mu(i,()=>n(lu(t,i)),i.length>1)),lu(t,i)):null},overflow:(e,{push:t,onClose:n})=>{let r=0,i=()=>{r===0&&(r=requestAnimationFrame(()=>{r=0,t(fu())}))},a=new MutationObserver(i);return a.observe(document,{attributes:!0,attributeFilter:[`style`],subtree:!0}),addEventListener(`resize`,i),n(()=>{cancelAnimationFrame(r),a.disconnect(),removeEventListener(`resize`,i)}),fu()},pins:({indexes:e},{push:t,onClose:n})=>(n(mu(e.flatMap(e=>{let t=i(document,e);return t?[t]:[]}),()=>t(pu(e)),!1)),pu(e))},gu=[`play`,`pause`,`timeupdate`,`durationchange`,`loadedmetadata`,`volumechange`,`seeked`,`error`,`emptied`],_u=[`controls`,`autoplay`,`loop`,`muted`];function vu(e){let t=xl(e);return t instanceof HTMLMediaElement?t:null}function yu(e){let t=e instanceof HTMLVideoElement,n=t&&e.readyState>=1&&e.videoWidth===0;return{tag:t?`video`:`audio`,playable:e.error===null&&!n,paused:e.paused,time:e.currentTime,length:e.duration,muted:e.muted,mutedInFile:e.defaultMuted,controls:e.hasAttribute(`controls`),autoplay:e.hasAttribute(`autoplay`),loop:e.hasAttribute(`loop`)}}function bu(e,t){switch(t.kind){case`toggle-play`:e.paused?e.play().catch(()=>void 0):e.pause();return;case`seek`:e.currentTime=t.seconds;return;case`toggle-sound`:e.muted=!e.muted;return;case`set-flag`:e.toggleAttribute(t.name,t.on)}}let xu=`frameboard-media-strip`;function Su(){if(document.getElementById(xu))return()=>{};let t=document.createElement(`style`);return t.id=xu,t.setAttribute(e,``),t.textContent=`video::-webkit-media-controls { display: none !important }`,document.head?.append(t),()=>t.remove()}let Cu={media:(e,{push:t,onClose:n})=>{let r=vu(e);if(!r)return null;let i=()=>t(yu(r));for(let e of gu)r.addEventListener(e,i);let a=new MutationObserver(i);return a.observe(r,{attributeFilter:[..._u]}),n(()=>{for(let e of gu)r.removeEventListener(e,i);a.disconnect()}),yu(r)},"media-act":({act:e,...t})=>{let n=vu(t);return n?(bu(n,e),!0):!1},"hide-strips":(e,{onClose:t})=>(t(Su()),!0)},wu=[`load`,`error`,`camera-change`];function Tu(e){let t=xl(e);return t instanceof HTMLElement&&t.localName===`model-viewer`?t:null}function Eu(e){let t=Math.round(e*180/Math.PI)%360;return t>180?t-360:t<=-180?t+360:t}function Du(e){let t=e.loaded===!0,n=t?e.getCameraOrbit?.():void 0,r={};for(let t of Cc)r[t]=e.getAttribute(t);return{src:e.getAttribute(`src`)??``,loaded:t,clips:t?[...e.availableAnimations??[]]:[],orbit:n?{theta:Eu(n.theta),phi:Eu(n.phi)}:null,staged:r}}function Ou(e,t,n){n===null?e.removeAttribute(t):e.setAttribute(t,n),t===`camera-orbit`&&e.updateComplete?.then(()=>e.jumpCameraToGoal?.()),t===`autoplay`&&n===null&&e.loaded&&(e.pause?.(),e.currentTime=0)}let ku={model:(e,{push:t,onClose:n})=>{let r=Tu(e);if(!r)return null;let i=Du(r),a=JSON.stringify(i),o=()=>{let e=Du(r),n=JSON.stringify(e);n!==a&&(a=n,t(e))};for(let e of wu)r.addEventListener(e,o);let s=new MutationObserver(o);return s.observe(r,{attributeFilter:[`src`,...Cc]}),n(()=>{for(let e of wu)r.removeEventListener(e,o);s.disconnect()}),i},"model-stage":({name:e,value:t,...n})=>{let r=Tu(n);return r?(Ou(r,e,t),!0):!1}};async function Au(e,t){let n=e.performance.now()+t,r=()=>new Promise(t=>e.requestAnimationFrame(()=>t())),i=e=>typeof e==`number`&&Number.isFinite(e)?Math.round(e*1e3):null,a=()=>{let t=e.__hf,n=i(t?.duration);if(typeof t?.seek==`function`&&n!==null&&n>0)return{source:`hf`,duration:n};let r=e.__timelines,a=Object.values(r??{}).filter(e=>typeof e?.seek==`function`);if(a.length>0){let e=a.map(e=>i(typeof e.duration==`function`?e.duration.call(e):e.duration)).filter(e=>e!==null);return{source:`timelines`,duration:e.length===0?null:Math.max(...e)}}let o=e.document.getAnimations();if(o.length>0){let e=o.map(e=>e.effect?.getComputedTiming().endTime).filter(e=>typeof e==`number`&&Number.isFinite(e));return{source:`css`,duration:e.length===0?null:Math.round(Math.max(...e))}}let s=[...e.document.querySelectorAll(`model-viewer`)].map(e=>e).filter(e=>(e.availableAnimations?.length??0)>0);if(s.length>0){let e=s.map(e=>i(e.duration)).filter(e=>e!==null);return{source:`model`,duration:e.length===0?null:Math.max(...e)}}return null};for(await r();;){let t=a();if(t!==null||e.performance.now()>=n)return t;await r()}}async function ju(e,{motion:t,ms:n}){let r=t.duration===null?n:Math.min(Math.max(n,0),t.duration);if(t.source===`hf`)await e.__hf.seek(r/1e3);else if(t.source===`timelines`){let t=e.__timelines;for(let e of Object.values(t))typeof e?.seek==`function`&&(e.pause?.(),await e.seek(r/1e3))}else if(t.source===`css`)for(let t of e.document.getAnimations())t.pause(),t.currentTime=r;for(let t of e.document.querySelectorAll(`model-viewer`)){let e=t;typeof e.pause==`function`&&(e.pause(),e.currentTime=r/1e3)}return await new Promise(t=>e.requestAnimationFrame(()=>e.requestAnimationFrame(()=>t()))),r}let Mu=1e4;async function Nu(e=Mu){let t=await Au(window,e);return t===null?null:{motion:t,span:t.duration??Pu()}}function Pu(){let e=document.getAnimations().map(e=>{let t=e.effect?.getComputedTiming(),n=Number(t?.duration),r=t?.delay??0;return Number.isFinite(n)?r+n:0});return Math.round(Math.max(0,...e))}function Fu(e){let t=null,n=null,r=async()=>{for(;t!==null;){let n=t;t=null,await ju(window,{motion:e,ms:n})}n=null};return e=>(t=e,n??=r(),n)}function Iu(e){if(e.source===`css`)for(let e of document.getAnimations())e.play();else location.reload()}function Lu({motion:e,span:t}){let n=0;if(e.source===`css`){let e=document.getAnimations().map(e=>Number(e.currentTime)).filter(e=>Number.isFinite(e));n=Math.max(0,...e)}else if(e.source===`timelines`){let e=window.__timelines,t=Object.values(e??{}).find(e=>typeof e?.time==`function`),r=t?Number(t.time.call(t)):0;n=Number.isFinite(r)?r*1e3:0}return Math.round(t<=0?n:e.duration===null?n%t:Math.min(n,t))}let Ru=/* @__PURE__ */ new Map;function zu(e){return{motion:(t,n)=>Vu(e,n),"motion-seek":({motion:e,at:t})=>{let n=Ru.get(e);return n?(n.seek(t),!0):!1},"motion-release":({motion:e})=>{let t=Ru.get(e);return t?(Iu(t.found.motion),!0):!1},"motion-moment":e=>Lu(e)}}let Bu=zu(Mu);function Vu(e,{id:t,push:n,onClose:r}){let i=!1;return Nu(e).catch(()=>null).then(e=>{i||(e&&Ru.set(t,{found:e,seek:Fu(e.motion)}),n(e))}),r(()=>{i=!0,Ru.delete(t)}),!0}function Hu(t,n){if(!document.head)return!1;let r=document.createElement(`style`);return r.setAttribute(e,``),r.textContent=t,document.head.append(r),n(()=>r.remove()),!0}let Uu={"hold-animations":(e,{onClose:t})=>Hu(`*, *::before, *::after { animation-play-state: paused !important }`,t),"hide-controls":(e,{onClose:t})=>Hu($c,t),"pointer-move":(e,{push:t,onClose:n})=>{let r=0,i=()=>{r===0&&(r=requestAnimationFrame(()=>{r=0,t(null)}))};return addEventListener(`pointermove`,i),n(()=>{removeEventListener(`pointermove`,i),cancelAnimationFrame(r)}),!0}},Wu=/* @__PURE__ */ new Map;function Gu(e,t,n){let r=`${e}:${t}`,a=i(document,e),o=a instanceof HTMLElement?a:null,s=Wu.get(r);if(n===null){if(Wu.delete(r),!s||s.element!==o||!o)return;s.value===``?s.attribute===null?o.removeAttribute(`style`):o.setAttribute(`style`,s.attribute):o.style.setProperty(t,s.value,s.priority),o.getAttribute(`style`)===``&&o.removeAttribute(`style`)}else o&&(s?.element!==o&&Wu.set(r,{element:o,value:o.style.getPropertyValue(t),priority:o.style.getPropertyPriority(t),attribute:o.getAttribute(`style`)}),o.style.setProperty(t,n,`important`))}function Ku(t){return{"preview-style":({index:e,property:t,value:n})=>(Gu(e,t,n),null),"keep-previews":()=>(Wu.clear(),null),restamp:({hash:n})=>{let r=document.querySelector(`style[${e}]`);return r?(r.setAttribute(`data-hash`,n),t(),!0):!1}}}function qu(e){return n(e).some(e=>e.matches(`a[href], button, input, select, textarea, summary, [onclick], [tabindex], [contenteditable], video[controls], audio[controls], script`))}let Ju={"takes-clicks":()=>qu(document)},$=`data-frameboard-step`,Yu=`--frameboard-step-delay`,Xu=`frameboard-present-steps`,Zu=`
|
|
116
116
|
[${$}='hidden'] { visibility: hidden !important }
|
|
117
117
|
|
|
118
118
|
@keyframes frameboard-step-appear { from { visibility: hidden } to { visibility: visible } }
|
|
@@ -126,7 +126,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
126
126
|
animation-duration: 400ms;
|
|
127
127
|
animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
128
128
|
animation-fill-mode: both;
|
|
129
|
-
animation-delay: var(${
|
|
129
|
+
animation-delay: var(${Yu}, 0ms);
|
|
130
130
|
}
|
|
131
131
|
[${$}='enter'][${$}-effect='appear'] { animation-name: frameboard-step-appear; animation-duration: 1ms }
|
|
132
132
|
[${$}='enter'][${$}-effect='fade'] { animation-name: frameboard-step-fade }
|
|
@@ -134,14 +134,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
134
134
|
[${$}='enter'][${$}-effect='wipe'] { animation-name: frameboard-step-wipe }
|
|
135
135
|
[${$}='enter'][${$}-effect='zoom'] { animation-name: frameboard-step-zoom }
|
|
136
136
|
}
|
|
137
|
-
`;function
|
|
138
|
-
`).replace(
|
|
137
|
+
`;function Qu(e){return e instanceof HTMLElement||e instanceof SVGElement?e.style:void 0}function $u(e){let t=e.getAttribute(q.step)?.trim()??``;if(!/^\d+$/.test(t))return null;let n=Number(t);return n>0?n:null}function ed(e){let t=e.getAttribute(q.effect);return Js.find(e=>e===t)??`appear`}function td(e){let t=e.getAttribute(q.start);return Ys.find(e=>e===t)??`click`}function nd(e){return e===`appear`?0:400}function rd(e){let t=[...e.querySelectorAll(`[${q.step}]`)].map(e=>({element:e,number:$u(e)})).filter(e=>e.number!==null).sort((e,t)=>e.number-t.number),n=[],r=null;for(let e of t){let t=td(e.element),i=ed(e.element),a=n.at(-1),o=a?.at(-1);if(a&&o&&(e.number===r||t!==`click`)){let n=t===`after`?o.delayMs+nd(o.effect):o.delayMs;a.push({element:e.element,effect:i,delayMs:n})}else n.push([{element:e.element,effect:i,delayMs:0}]);r=e.number}return n}let id=`[${q.step}]`;function ad(e){return e.nodeType===1&&(e.matches(id)||e.querySelector(id)!==null)}function od(e){return e.some(e=>e.type===`attributes`||[...e.addedNodes,...e.removedNodes].some(ad))}function sd(e,t,n,r=null){cd(e);for(let[e,i]of t.entries())for(let{element:t,effect:a,delayMs:o}of i){let i=e>=n?`hidden`:e===r?`enter`:`shown`;t.setAttribute($,i),t.setAttribute(`${$}-effect`,a),Qu(t)?.setProperty(Yu,`${o}ms`)}}function cd(t){if(t.getElementById(Xu))return;let n=t.createElement(`style`);n.id=Xu,n.setAttribute(e,``),n.textContent=Zu,t.head?.append(n)}function ld(e,t){let n=e.ownerDocument;cd(n);let r=t===`appear`;e.setAttribute($,r?`hidden`:`enter`),e.setAttribute(`${$}-effect`,t);let i=!1,a=()=>{i||(i=!0,clearTimeout(o),e.removeAttribute($),e.removeAttribute(`${$}-effect`),n.querySelector(`[${$}]`)||n.getElementById(Xu)?.remove())},o=setTimeout(a,r?200:400);return a}let ud=Object.values(q),dd=/* @__PURE__ */ new Map,fd={steps:({shown:e},{id:t,push:n,onClose:r})=>{let i={shown:e,entering:null,groups:rd(document)};sd(document,i.groups,i.shown),dd.set(t,i);let a=new MutationObserver(e=>{od(e)&&(i.groups=rd(document),sd(document,i.groups,i.shown,i.entering),n(i.groups.length))});return a.observe(document.documentElement,{subtree:!0,childList:!0,attributeFilter:ud}),r(()=>{a.disconnect(),dd.delete(t)}),i.groups.length},"steps-show":({steps:e,shown:t,entering:n})=>{let r=dd.get(e);return r?(r.shown=t,r.entering=n,sd(document,r.groups,t,n),!0):!1},"step-preview":({index:e,effect:t},{onClose:n})=>{let r=i(document,e);return r?(n(ld(r,t)),!0):!1}},pd=/\r\n|\r/g,md=/\n+$/,hd=/[\t\n\f\r ]+/g;function gd(e){let{whiteSpace:t}=getComputedStyle(e);return t===`normal`||t===`nowrap`}function _d(e,t,n,r=!1){if(!(e instanceof HTMLElement))return null;if(e.childElementCount>0){let r=n&&bd(e,n);return r?xd(e,r,t):null}let i=(e.textContent??``).trim()===``;if(i&&!r)return null;let a=e,o=a.textContent??``,s=gd(a),c=s?o.replace(hd,` `).trim():o,l=a.style.whiteSpace,u=a.style.minHeight;c!==o&&(a.textContent=c),i&&(a.style.minHeight=`1lh`);let d=!0,f=()=>{d=!1,i&&(a.style.minHeight=u),a.removeAttribute(`contenteditable`),a.removeAttribute(Oc),a.removeEventListener(`keydown`,ee),a.removeEventListener(`paste`,v),a.removeEventListener(`blur`,_),window.removeEventListener(`pagehide`,g)},p=()=>{a.textContent=o,a.style.whiteSpace=l},m=()=>{a.isConnected&&p()},h=()=>{d&&(f(),p())};function g(){f(),t({kind:`closed`},m)}function _(){if(!d)return;f();let e=(a.textContent??``).replace(pd,`
|
|
138
|
+
`).replace(md,``);e===c.replace(md,``)?(p(),t({kind:`closed`},m)):(a.textContent=e,t({kind:`commit`,text:e,breaks:s&&e.includes(`
|
|
139
139
|
`)},m))}function ee(e){e.key===`Enter`&&(e.preventDefault(),te(`
|
|
140
|
-
`)),e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),_())}function v(e){e.preventDefault(),te((e.clipboardData?.getData(`text/plain`)??``).replace(
|
|
140
|
+
`)),e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),_())}function v(e){e.preventDefault(),te((e.clipboardData?.getData(`text/plain`)??``).replace(pd,`
|
|
141
141
|
`))}let te=e=>{let t=getSelection()?.getRangeAt(0);if(!t||!a.contains(t.commonAncestorContainer))return;s&&e.includes(`
|
|
142
142
|
`)&&(a.style.whiteSpace=`pre-line`);let n=(e,t)=>{let n=document.createRange();return n.selectNodeContents(a),n.setEnd(e,t),n.toString().length},r=n(t.startContainer,t.startOffset),i=n(t.endContainer,t.endOffset),o=a.textContent??``,c=o.slice(i),l=c===``&&e.endsWith(`
|
|
143
143
|
`)?`
|
|
144
|
-
`:``;a.textContent=o.slice(0,r)+e+(c||l);let u=document.createRange();u.setStart(a.firstChild??a,r+e.length),u.collapse(!0),getSelection()?.removeAllRanges(),getSelection()?.addRange(u)},y=({x:e,y:t})=>{let n=
|
|
145
|
-
`);e===o?(p(),n({kind:`closed`},m)):n({kind:`commit`,text:e,breaks:!1,run:r},m)}let ee=e=>a?e.replace(
|
|
144
|
+
`:``;a.textContent=o.slice(0,r)+e+(c||l);let u=document.createRange();u.setStart(a.firstChild??a,r+e.length),u.collapse(!0),getSelection()?.removeAllRanges(),getSelection()?.addRange(u)},y=({x:e,y:t})=>{let n=vd(e,t);return!d||!n||!a.contains(n.node)?!1:(yd(n.node,n.offset),!0)};a.setAttribute(`contenteditable`,`plaintext-only`),a.setAttribute(Oc,``),a.addEventListener(`keydown`,ee),a.addEventListener(`paste`,v),a.addEventListener(`blur`,_),window.addEventListener(`pagehide`,g),a.focus();let ne=document.createRange();ne.selectNodeContents(a);let re=getSelection();return re?.removeAllRanges(),re?.addRange(ne),{cancel:h,caretAt:y}}function vd(e,t){let n=document.caretPositionFromPoint?.(e,t);if(n)return{node:n.offsetNode,offset:n.offset};let r=document.caretRangeFromPoint?.(e,t);return r?{node:r.startContainer,offset:r.startOffset}:null}function yd(e,t){let n=document.createRange();n.setStart(e,t),n.collapse(!0);let r=getSelection();r?.removeAllRanges(),r?.addRange(n)}function bd(e,{x:t,y:n}){let r=vd(t,n)?.node;return r instanceof Text&&r.parentNode===e&&r.data.trim()!==``?r:null}function xd(e,t,n){let r=[...e.childNodes].filter(e=>e instanceof Text).indexOf(t),i=t.data,a=gd(e),o=a?i.replace(hd,` `):i;o!==i&&(t.data=o);let s=[...e.children].map(e=>({child:e,editable:e.getAttribute(`contenteditable`)})),c=[...e.childNodes],l=c.map(e=>e instanceof Text?e.data:``),u=!0,d=()=>{for(let t of[...e.childNodes])c.includes(t)||t.remove();for(let n=c.length-1;n>=0;n--){let r=c[n];r!==t&&r instanceof Text&&(r.data=l[n]??``);let i=c[n+1];r&&r.parentNode!==e&&e.insertBefore(r,i?.parentNode===e?i:null)}},f=()=>{u=!1,d(),e.removeAttribute(`contenteditable`),e.removeAttribute(Oc);for(let{child:e,editable:t}of s)t===null?e.removeAttribute(`contenteditable`):e.setAttribute(`contenteditable`,t);e.removeEventListener(`keydown`,v),e.removeEventListener(`paste`,te),e.removeEventListener(`beforeinput`,y),e.removeEventListener(`blur`,_),window.removeEventListener(`pagehide`,g)},p=()=>{t.data=i},m=()=>{t.isConnected&&p()},h=()=>{u&&(f(),p())};function g(){f(),n({kind:`closed`},m)}function _(){if(!u)return;f();let e=t.data.replace(pd,`
|
|
145
|
+
`);e===o?(p(),n({kind:`closed`},m)):n({kind:`commit`,text:e,breaks:!1,run:r},m)}let ee=e=>a?e.replace(hd,` `):e.replace(pd,`
|
|
146
146
|
`);function v(e){e.key===`Enter`&&(e.preventDefault(),a||ie(ne(),`
|
|
147
|
-
`)),e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),_())}function te(e){e.preventDefault(),ie(ne(),ee(e.clipboardData?.getData(`text/plain`)??``))}function y(e){if(!e.cancelable)return;e.preventDefault();let[t=ne()]=e.getTargetRanges();e.inputType.startsWith(`delete`)?ie(t,``):e.inputType.startsWith(`insert`)&&ie(t,ee(e.data??e.dataTransfer?.getData(`text/plain`)??``))}let ne=()=>{let e=getSelection();return e&&e.rangeCount>0?e.getRangeAt(0):void 0},re=(n,r)=>{if(n===t)return r;if(n!==e)return;let i=[...e.childNodes].indexOf(t);return r===i?0:r===i+1?t.length:void 0},ie=(e,n)=>{let r=e&&re(e.startContainer,e.startOffset),i=e&&re(e.endContainer,e.endOffset);if(r===void 0||i===void 0)return;t.replaceData(r,i-r,n);let a=document.createRange();a.setStart(t,r+n.length),a.collapse(!0),getSelection()?.removeAllRanges(),getSelection()?.addRange(a)},ae=({x:e,y:n})=>{let r=
|
|
147
|
+
`)),e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),_())}function te(e){e.preventDefault(),ie(ne(),ee(e.clipboardData?.getData(`text/plain`)??``))}function y(e){if(!e.cancelable)return;e.preventDefault();let[t=ne()]=e.getTargetRanges();e.inputType.startsWith(`delete`)?ie(t,``):e.inputType.startsWith(`insert`)&&ie(t,ee(e.data??e.dataTransfer?.getData(`text/plain`)??``))}let ne=()=>{let e=getSelection();return e&&e.rangeCount>0?e.getRangeAt(0):void 0},re=(n,r)=>{if(n===t)return r;if(n!==e)return;let i=[...e.childNodes].indexOf(t);return r===i?0:r===i+1?t.length:void 0},ie=(e,n)=>{let r=e&&re(e.startContainer,e.startOffset),i=e&&re(e.endContainer,e.endOffset);if(r===void 0||i===void 0)return;t.replaceData(r,i-r,n);let a=document.createRange();a.setStart(t,r+n.length),a.collapse(!0),getSelection()?.removeAllRanges(),getSelection()?.addRange(a)},ae=({x:e,y:n})=>{let r=vd(e,n),i=r&&re(r.node,r.offset);return!u||i==null?!1:(yd(t,i),!0)};for(let{child:e}of s)e.setAttribute(`contenteditable`,`false`);e.setAttribute(`contenteditable`,`plaintext-only`),e.setAttribute(Oc,``),e.addEventListener(`keydown`,v),e.addEventListener(`paste`,te),e.addEventListener(`beforeinput`,y),e.addEventListener(`blur`,_),window.addEventListener(`pagehide`,g),e.focus();let oe=document.createRange();oe.selectNodeContents(t);let b=getSelection();return b?.removeAllRanges(),b?.addRange(oe),{cancel:h,caretAt:ae}}document.currentScript?.remove();let Sd=window.parent,Cd=window.origin,wd=crypto.randomUUID(),Td=/* @__PURE__ */ new Map,Ed=/* @__PURE__ */ new Map,Dd=/* @__PURE__ */ new Map,Od={...qc,...sl,...yl,...Fl,...ql,...hu,...Cu,...ku,...Bu,...Uu,...Ju,...fd,"element-box":e=>{let t=xl(e);if(!t)return null;let{left:n,top:r,right:i,bottom:a}=t.getBoundingClientRect();return{left:n,top:r,right:i,bottom:a}},"text-edit":(e,{id:t,push:n,onClose:r})=>{let i=xl(e),a=!1,o=i&&_d(i,(e,r)=>{a=!0,Dd.delete(t),e.kind===`commit`&&Ed.set(t,r),n(e)},e.at,e.empty);return o?(Dd.set(t,o.caretAt),r(()=>{Dd.delete(t),a||o.cancel()}),!0):!1},"text-caret":({edit:e,at:t})=>Dd.get(e)?.(t)??!1,"text-written":({edit:e,written:t})=>{let n=Ed.get(e);return Ed.delete(e),t||n?.(),null},...Ku(()=>Ad())};function kd(e,t){Sd.postMessage(e,t)}function Ad(e=a(document)){kd({tag:X,kind:`shown`,page:wd,hash:e},`*`)}function jd(e,t,n,r){let i=Od[e];if(!i)throw Error(`no handler for ${e}`);let a=Bc(e,t);if(a===zc)throw Error(`not the arguments ${e} takes`);return i(a,{id:n,push:e=>kd({tag:X,kind:`push`,id:n,value:e},r),onClose:e=>Td.set(n,e)})}Sd!==window&&(bl(document,()=>Ad()),window.addEventListener(`pagehide`,()=>Ad(null)),window.addEventListener(`message`,e=>{if(e.source!==Sd)return;let{origin:t}=e;if(!Uc(t,Cd))return;let n=Ac(e,t);if(n?.kind===`close`&&(Td.get(n.id)?.(),Td.delete(n.id)),n?.kind!==`request`)return;let{id:r}=n;try{let e=jd(n.op,n.args,r,t);kd({tag:X,kind:`reply`,id:r,ok:!0,value:e},t)}catch(e){let n=e instanceof Error?e.message:String(e);kd({tag:X,kind:`reply`,id:r,ok:!1,error:n},t)}}))})();
|