lumina-slides 9.0.2 → 9.0.3
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/lumina-slides.js +29 -9
- package/dist/lumina-slides.umd.cjs +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/site/SiteDocs.vue +93 -72
- package/src/core/Lumina.ts +30 -8
- package/src/core/elementResolver.ts +7 -1
- package/src/core/types.ts +3 -2
- package/src/index.ts +1 -1
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
|
|
45
45
|
`)}p.write("payload.value = newResult;"),p.write("return payload;");const S=p.compile();return(y,b)=>S(h,y,b)};let o;const s=Mu,a=!F1.jitless,u=a&&IN.value,c=e.catchall;let d;t._zod.parse=(h,p)=>{d??(d=r.value);const m=h.value;return s(m)?a&&u&&(p==null?void 0:p.async)===!1&&p.jitless!==!0?(o||(o=i(e.shape)),h=o(h,p),c?ox([],m,h,p,d,t):h):n(h,p):(h.issues.push({expected:"object",code:"invalid_type",input:m,inst:t}),h)}});function sx(t,e,n,r){for(const o of t)if(o.issues.length===0)return e.value=o.value,e;const i=t.filter(o=>!nl(o));return i.length===1?(e.value=i[0].value,i[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(o=>o.issues.map(s=>Uo(s,r,Fo())))}),e)}const ax=le("$ZodUnion",(t,e)=>{Wt.init(t,e),Lt(t._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Lt(t._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Lt(t._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),Lt(t._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){const i=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${i.map(o=>Jm(o.source)).join("|")})$`)}});const n=e.options.length===1,r=e.options[0]._zod.run;t._zod.parse=(i,o)=>{if(n)return r(i,o);let s=!1;const a=[];for(const l of e.options){const u=l._zod.run({value:i.value,issues:[]},o);if(u instanceof Promise)a.push(u),s=!0;else{if(u.issues.length===0)return u;a.push(u)}}return s?Promise.all(a).then(l=>sx(l,i,t,o)):sx(a,i,t,o)}}),yD=le("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,ax.init(t,e);const n=t._zod.parse;Lt(t._zod,"propValues",()=>{const i={};for(const o of e.options){const s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(const[a,l]of Object.entries(s)){i[a]||(i[a]=new Set);for(const u of l)i[a].add(u)}}return i});const r=gf(()=>{var s;const i=e.options,o=new Map;for(const a of i){const l=(s=a._zod.propValues)==null?void 0:s[e.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(a)}"`);for(const u of l){if(o.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);o.set(u,a)}}return o});t._zod.parse=(i,o)=>{const s=i.value;if(!Mu(s))return i.issues.push({code:"invalid_type",expected:"object",input:s,inst:t}),i;const a=r.value.get(s==null?void 0:s[e.discriminator]);return a?a._zod.run(i,o):e.unionFallback?n(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:s,path:[e.discriminator],inst:t}),i)}}),bD=le("$ZodIntersection",(t,e)=>{Wt.init(t,e),t._zod.parse=(n,r)=>{const i=n.value,o=e.left._zod.run({value:i,issues:[]},r),s=e.right._zod.run({value:i,issues:[]},r);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([l,u])=>lx(n,l,u)):lx(n,o,s)}});function ng(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(el(t)&&el(e)){const n=Object.keys(e),r=Object.keys(t).filter(o=>n.indexOf(o)!==-1),i={...t,...e};for(const o of r){const s=ng(t[o],e[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};i[o]=s.data}return{valid:!0,data:i}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<t.length;r++){const i=t[r],o=e[r],s=ng(i,o);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function lx(t,e,n){if(e.issues.length&&t.issues.push(...e.issues),n.issues.length&&t.issues.push(...n.issues),nl(t))return t;const r=ng(e.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return t.value=r.data,t}const _D=le("$ZodRecord",(t,e)=>{Wt.init(t,e),t._zod.parse=(n,r)=>{const i=n.value;if(!el(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),n;const o=[],s=e.keyType._zod.values;if(s){n.value={};const a=new Set;for(const u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);const c=e.valueType._zod.run({value:i[u],issues:[]},r);c instanceof Promise?o.push(c.then(d=>{d.issues.length&&n.issues.push(...rl(u,d.issues)),n.value[u]=d.value})):(c.issues.length&&n.issues.push(...rl(u,c.issues)),n.value[u]=c.value)}let l;for(const u in i)a.has(u)||(l=l??[],l.push(u));l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:l})}else{n.value={};for(const a of Reflect.ownKeys(i)){if(a==="__proto__")continue;const l=e.keyType._zod.run({value:a,issues:[]},r);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){e.mode==="loose"?n.value[a]=i[a]:n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(c=>Uo(c,r,Fo())),input:a,path:[a],inst:t});continue}const u=e.valueType._zod.run({value:i[a],issues:[]},r);u instanceof Promise?o.push(u.then(c=>{c.issues.length&&n.issues.push(...rl(a,c.issues)),n.value[l.value]=c.value})):(u.issues.length&&n.issues.push(...rl(a,u.issues)),n.value[l.value]=u.value)}}return o.length?Promise.all(o).then(()=>n):n}}),xD=le("$ZodEnum",(t,e)=>{Wt.init(t,e);const n=z1(e.entries),r=new Set(n);t._zod.values=r,t._zod.pattern=new RegExp(`^(${n.filter(i=>CN.has(typeof i)).map(i=>typeof i=="string"?tl(i):i.toString()).join("|")})$`),t._zod.parse=(i,o)=>{const s=i.value;return r.has(s)||i.issues.push({code:"invalid_value",values:n,input:s,inst:t}),i}}),wD=le("$ZodLiteral",(t,e)=>{if(Wt.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(e.values);t._zod.values=n,t._zod.pattern=new RegExp(`^(${e.values.map(r=>typeof r=="string"?tl(r):r?tl(r.toString()):String(r)).join("|")})$`),t._zod.parse=(r,i)=>{const o=r.value;return n.has(o)||r.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),r}}),SD=le("$ZodTransform",(t,e)=>{Wt.init(t,e),t._zod.parse=(n,r)=>{if(r.direction==="backward")throw new V1(t.constructor.name);const i=e.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(s=>(n.value=s,n));if(i instanceof Promise)throw new qa;return n.value=i,n}});function ux(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}const ED=le("$ZodOptional",(t,e)=>{Wt.init(t,e),t._zod.optin="optional",t._zod.optout="optional",Lt(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Lt(t._zod,"pattern",()=>{const n=e.innerType._zod.pattern;return n?new RegExp(`^(${Jm(n.source)})?$`):void 0}),t._zod.parse=(n,r)=>{if(e.innerType._zod.optin==="optional"){const i=e.innerType._zod.run(n,r);return i instanceof Promise?i.then(o=>ux(o,n.value)):ux(i,n.value)}return n.value===void 0?n:e.innerType._zod.run(n,r)}}),TD=le("$ZodNullable",(t,e)=>{Wt.init(t,e),Lt(t._zod,"optin",()=>e.innerType._zod.optin),Lt(t._zod,"optout",()=>e.innerType._zod.optout),Lt(t._zod,"pattern",()=>{const n=e.innerType._zod.pattern;return n?new RegExp(`^(${Jm(n.source)}|null)$`):void 0}),Lt(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(n,r)=>n.value===null?n:e.innerType._zod.run(n,r)}),ID=le("$ZodDefault",(t,e)=>{Wt.init(t,e),t._zod.optin="optional",Lt(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>{if(r.direction==="backward")return e.innerType._zod.run(n,r);if(n.value===void 0)return n.value=e.defaultValue,n;const i=e.innerType._zod.run(n,r);return i instanceof Promise?i.then(o=>cx(o,e)):cx(i,e)}});function cx(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}const CD=le("$ZodPrefault",(t,e)=>{Wt.init(t,e),t._zod.optin="optional",Lt(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=e.defaultValue),e.innerType._zod.run(n,r))}),AD=le("$ZodNonOptional",(t,e)=>{Wt.init(t,e),Lt(t._zod,"values",()=>{const n=e.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),t._zod.parse=(n,r)=>{const i=e.innerType._zod.run(n,r);return i instanceof Promise?i.then(o=>dx(o,t)):dx(i,t)}});function dx(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}const PD=le("$ZodCatch",(t,e)=>{Wt.init(t,e),Lt(t._zod,"optin",()=>e.innerType._zod.optin),Lt(t._zod,"optout",()=>e.innerType._zod.optout),Lt(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>{if(r.direction==="backward")return e.innerType._zod.run(n,r);const i=e.innerType._zod.run(n,r);return i instanceof Promise?i.then(o=>(n.value=o.value,o.issues.length&&(n.value=e.catchValue({...n,error:{issues:o.issues.map(s=>Uo(s,r,Fo()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=e.catchValue({...n,error:{issues:i.issues.map(o=>Uo(o,r,Fo()))},input:n.value}),n.issues=[]),n)}}),kD=le("$ZodPipe",(t,e)=>{Wt.init(t,e),Lt(t._zod,"values",()=>e.in._zod.values),Lt(t._zod,"optin",()=>e.in._zod.optin),Lt(t._zod,"optout",()=>e.out._zod.optout),Lt(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(n,r)=>{if(r.direction==="backward"){const o=e.out._zod.run(n,r);return o instanceof Promise?o.then(s=>wf(s,e.in,r)):wf(o,e.in,r)}const i=e.in._zod.run(n,r);return i instanceof Promise?i.then(o=>wf(o,e.out,r)):wf(i,e.out,r)}});function wf(t,e,n){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},n)}const OD=le("$ZodReadonly",(t,e)=>{Wt.init(t,e),Lt(t._zod,"propValues",()=>e.innerType._zod.propValues),Lt(t._zod,"values",()=>e.innerType._zod.values),Lt(t._zod,"optin",()=>{var n,r;return(r=(n=e.innerType)==null?void 0:n._zod)==null?void 0:r.optin}),Lt(t._zod,"optout",()=>{var n,r;return(r=(n=e.innerType)==null?void 0:n._zod)==null?void 0:r.optout}),t._zod.parse=(n,r)=>{if(r.direction==="backward")return e.innerType._zod.run(n,r);const i=e.innerType._zod.run(n,r);return i instanceof Promise?i.then(fx):fx(i)}});function fx(t){return t.value=Object.freeze(t.value),t}const ND=le("$ZodCustom",(t,e)=>{yr.init(t,e),Wt.init(t,e),t._zod.parse=(n,r)=>n,t._zod.check=n=>{const r=n.value,i=e.fn(r);if(i instanceof Promise)return i.then(o=>hx(o,n,r,t));hx(i,n,r,t)}});function hx(t,e,n,r){if(!t){const i={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),e.issues.push(Lu(i))}}var px;class RD{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...n){const r=n[0];if(this._map.set(e,r),r&&typeof r=="object"&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const n=this._map.get(e);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(e),this}get(e){const n=e._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const i={...r,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function DD(){return new RD}(px=globalThis).__zod_globalRegistry??(px.__zod_globalRegistry=DD());const Vu=globalThis.__zod_globalRegistry;function $D(t,e){return new t({type:"string",...Ge(e)})}function MD(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...Ge(e)})}function mx(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...Ge(e)})}function LD(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...Ge(e)})}function VD(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ge(e)})}function FD(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ge(e)})}function zD(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ge(e)})}function UD(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Ge(e)})}function BD(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...Ge(e)})}function jD(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ge(e)})}function HD(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...Ge(e)})}function GD(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ge(e)})}function WD(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...Ge(e)})}function KD(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...Ge(e)})}function ZD(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ge(e)})}function XD(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ge(e)})}function YD(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ge(e)})}function JD(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ge(e)})}function QD(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ge(e)})}function qD(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...Ge(e)})}function e$(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...Ge(e)})}function t$(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...Ge(e)})}function n$(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...Ge(e)})}function r$(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ge(e)})}function i$(t,e){return new t({type:"string",format:"date",check:"string_format",...Ge(e)})}function o$(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...Ge(e)})}function s$(t,e){return new t({type:"string",format:"duration",check:"string_format",...Ge(e)})}function a$(t,e){return new t({type:"number",checks:[],...Ge(e)})}function l$(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Ge(e)})}function u$(t,e){return new t({type:"boolean",...Ge(e)})}function c$(t,e){return new t({type:"undefined",...Ge(e)})}function d$(t,e){return new t({type:"null",...Ge(e)})}function f$(t){return new t({type:"any"})}function h$(t){return new t({type:"unknown"})}function p$(t,e){return new t({type:"never",...Ge(e)})}function gx(t,e){return new q1({check:"less_than",...Ge(e),value:t,inclusive:!1})}function rg(t,e){return new q1({check:"less_than",...Ge(e),value:t,inclusive:!0})}function vx(t,e){return new ex({check:"greater_than",...Ge(e),value:t,inclusive:!1})}function ig(t,e){return new ex({check:"greater_than",...Ge(e),value:t,inclusive:!0})}function yx(t,e){return new SR({check:"multiple_of",...Ge(e),value:t})}function bx(t,e){return new TR({check:"max_length",...Ge(e),maximum:t})}function Sf(t,e){return new IR({check:"min_length",...Ge(e),minimum:t})}function _x(t,e){return new CR({check:"length_equals",...Ge(e),length:t})}function m$(t,e){return new AR({check:"string_format",format:"regex",...Ge(e),pattern:t})}function g$(t){return new PR({check:"string_format",format:"lowercase",...Ge(t)})}function v$(t){return new kR({check:"string_format",format:"uppercase",...Ge(t)})}function y$(t,e){return new OR({check:"string_format",format:"includes",...Ge(e),includes:t})}function b$(t,e){return new NR({check:"string_format",format:"starts_with",...Ge(e),prefix:t})}function _$(t,e){return new RR({check:"string_format",format:"ends_with",...Ge(e),suffix:t})}function il(t){return new DR({check:"overwrite",tx:t})}function x$(t){return il(e=>e.normalize(t))}function w$(){return il(t=>t.trim())}function S$(){return il(t=>t.toLowerCase())}function E$(){return il(t=>t.toUpperCase())}function T$(){return il(t=>TN(t))}function I$(t,e,n){return new t({type:"array",element:e,...Ge(n)})}function C$(t,e,n){return new t({type:"custom",check:"custom",fn:e,...Ge(n)})}function A$(t){const e=P$(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Lu(r,n.value,e._zod.def));else{const i=r;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=e),i.continue??(i.continue=!e._zod.def.abort),n.issues.push(Lu(i))}},t(n.value,n)));return e}function P$(t,e){const n=new yr({check:"custom",...Ge(e)});return n._zod.check=t,n}function xx(t){let e=(t==null?void 0:t.target)??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:(t==null?void 0:t.metadata)??Vu,target:e,unrepresentable:(t==null?void 0:t.unrepresentable)??"throw",override:(t==null?void 0:t.override)??(()=>{}),io:(t==null?void 0:t.io)??"output",counter:0,seen:new Map,cycles:(t==null?void 0:t.cycles)??"ref",reused:(t==null?void 0:t.reused)??"inline",external:(t==null?void 0:t.external)??void 0}}function An(t,e,n={path:[],schemaPath:[]}){var c,d;var r;const i=t._zod.def,o=e.seen.get(t);if(o)return o.count++,n.schemaPath.includes(t)&&(o.cycle=n.path),o.schema;const s={schema:{},count:1,cycle:void 0,path:n.path};e.seen.set(t,s);const a=(d=(c=t._zod).toJSONSchema)==null?void 0:d.call(c);if(a)s.schema=a;else{const h={...n,schemaPath:[...n.schemaPath,t],path:n.path},p=t._zod.parent;if(p)s.ref=p,An(p,e,h),e.seen.get(p).isParent=!0;else if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,s.schema,h);else{const m=s.schema,g=e.processors[i.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);g(t,e,m,h)}}const l=e.metadataRegistry.get(t);return l&&Object.assign(s.schema,l),e.io==="input"&&cr(t)&&(delete s.schema.examples,delete s.schema.default),e.io==="input"&&s.schema._prefault&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault,e.seen.get(t).schema}function wx(t,e){var o,s,a;const n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=l=>{var p;const u=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){const m=(p=t.external.registry.get(l[0]))==null?void 0:p.id,g=t.external.uri??(E=>E);if(m)return{ref:g(m)};const _=l[1].defId??l[1].schema.id??`schema${t.counter++}`;return l[1].defId=_,{defId:_,ref:`${g("__shared")}#/${u}/${_}`}}if(l[1]===n)return{ref:"#"};const d=`#/${u}/`,h=l[1].schema.id??`__schema${t.counter++}`;return{defId:h,ref:d+h}},i=l=>{if(l[1].schema.$ref)return;const u=l[1],{ref:c,defId:d}=r(l);u.def={...u.schema},d&&(u.defId=d);const h=u.schema;for(const p in h)delete h[p];h.$ref=c};if(t.cycles==="throw")for(const l of t.seen.entries()){const u=l[1];if(u.cycle)throw new Error(`Cycle detected: #/${(o=u.cycle)==null?void 0:o.join("/")}/<root>
|
|
46
46
|
|
|
47
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of t.seen.entries()){const u=l[1];if(e===l[0]){i(l);continue}if(t.external){const d=(s=t.external.registry.get(l[0]))==null?void 0:s.id;if(e!==l[0]&&d){i(l);continue}}if((a=t.metadataRegistry.get(l[0]))==null?void 0:a.id){i(l);continue}if(u.cycle){i(l);continue}if(u.count>1&&t.reused==="ref"){i(l);continue}}}function Sx(t,e){var s,a,l;const n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=u=>{const c=t.seen.get(u),d=c.def??c.schema,h={...d};if(c.ref===null)return;const p=c.ref;if(c.ref=null,p){r(p);const m=t.seen.get(p).schema;m.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(m)):(Object.assign(d,m),Object.assign(d,h))}c.isParent||t.override({zodSchema:u,jsonSchema:d,path:c.path??[]})};for(const u of[...t.seen.entries()].reverse())r(u[0]);const i={};if(t.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":t.target,(s=t.external)!=null&&s.uri){const u=(a=t.external.registry.get(e))==null?void 0:a.id;if(!u)throw new Error("Schema is missing an `id` property");i.$id=t.external.uri(u)}Object.assign(i,n.def??n.schema);const o=((l=t.external)==null?void 0:l.defs)??{};for(const u of t.seen.entries()){const c=u[1];c.def&&c.defId&&(o[c.defId]=c.def)}t.external||Object.keys(o).length>0&&(t.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{const u=JSON.parse(JSON.stringify(i));return Object.defineProperty(u,"~standard",{value:{...e["~standard"],jsonSchema:{input:Ef(e,"input"),output:Ef(e,"output")}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function cr(t,e){const n=e??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);const r=t._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return cr(r.element,n);if(r.type==="set")return cr(r.valueType,n);if(r.type==="lazy")return cr(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")return cr(r.innerType,n);if(r.type==="intersection")return cr(r.left,n)||cr(r.right,n);if(r.type==="record"||r.type==="map")return cr(r.keyType,n)||cr(r.valueType,n);if(r.type==="pipe")return cr(r.in,n)||cr(r.out,n);if(r.type==="object"){for(const i in r.shape)if(cr(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(cr(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(cr(i,n))return!0;return!!(r.rest&&cr(r.rest,n))}return!1}const k$=(t,e={})=>n=>{const r=xx({...n,processors:e});return An(t,r),wx(r,t),Sx(r,t)},Ef=(t,e)=>n=>{const{libraryOptions:r,target:i}=n??{},o=xx({...r??{},target:i,io:e,processors:{}});return An(t,o),wx(o,t),Sx(o,t)},O$={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},N$=(t,e,n,r)=>{const i=n;i.type="string";const{minimum:o,maximum:s,format:a,patterns:l,contentEncoding:u}=t._zod.bag;if(typeof o=="number"&&(i.minLength=o),typeof s=="number"&&(i.maxLength=s),a&&(i.format=O$[a]??a,i.format===""&&delete i.format),u&&(i.contentEncoding=u),l&&l.size>0){const c=[...l];c.length===1?i.pattern=c[0].source:c.length>1&&(i.allOf=[...c.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},R$=(t,e,n,r)=>{const i=n,{minimum:o,maximum:s,format:a,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:c}=t._zod.bag;typeof a=="string"&&a.includes("int")?i.type="integer":i.type="number",typeof c=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(i.minimum=c,i.exclusiveMinimum=!0):i.exclusiveMinimum=c),typeof o=="number"&&(i.minimum=o,typeof c=="number"&&e.target!=="draft-04"&&(c>=o?delete i.minimum:delete i.exclusiveMinimum)),typeof u=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(i.maximum=u,i.exclusiveMaximum=!0):i.exclusiveMaximum=u),typeof s=="number"&&(i.maximum=s,typeof u=="number"&&e.target!=="draft-04"&&(u<=s?delete i.maximum:delete i.exclusiveMaximum)),typeof l=="number"&&(i.multipleOf=l)},D$=(t,e,n,r)=>{n.type="boolean"},$$=(t,e,n,r)=>{e.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},M$=(t,e,n,r)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},L$=(t,e,n,r)=>{n.not={}},V$=(t,e,n,r)=>{},F$=(t,e,n,r)=>{},z$=(t,e,n,r)=>{const i=t._zod.def,o=z1(i.entries);o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),n.enum=o},U$=(t,e,n,r)=>{const i=t._zod.def,o=[];for(const s of i.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){const s=o[0];n.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?n.enum=[s]:n.const=s}else o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),o.every(s=>typeof s=="boolean")&&(n.type="boolean"),o.every(s=>s===null)&&(n.type="null"),n.enum=o},B$=(t,e,n,r)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},j$=(t,e,n,r)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},H$=(t,e,n,r)=>{const i=n,o=t._zod.def,{minimum:s,maximum:a}=t._zod.bag;typeof s=="number"&&(i.minItems=s),typeof a=="number"&&(i.maxItems=a),i.type="array",i.items=An(o.element,e,{...r,path:[...r.path,"items"]})},G$=(t,e,n,r)=>{var u;const i=n,o=t._zod.def;i.type="object",i.properties={};const s=o.shape;for(const c in s)i.properties[c]=An(s[c],e,{...r,path:[...r.path,"properties",c]});const a=new Set(Object.keys(s)),l=new Set([...a].filter(c=>{const d=o.shape[c]._zod;return e.io==="input"?d.optin===void 0:d.optout===void 0}));l.size>0&&(i.required=Array.from(l)),((u=o.catchall)==null?void 0:u._zod.def.type)==="never"?i.additionalProperties=!1:o.catchall?o.catchall&&(i.additionalProperties=An(o.catchall,e,{...r,path:[...r.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},W$=(t,e,n,r)=>{const i=t._zod.def,o=i.inclusive===!1,s=i.options.map((a,l)=>An(a,e,{...r,path:[...r.path,o?"oneOf":"anyOf",l]}));o?n.oneOf=s:n.anyOf=s},K$=(t,e,n,r)=>{const i=t._zod.def,o=An(i.left,e,{...r,path:[...r.path,"allOf",0]}),s=An(i.right,e,{...r,path:[...r.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,l=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];n.allOf=l},Z$=(t,e,n,r)=>{const i=n,o=t._zod.def;i.type="object",(e.target==="draft-07"||e.target==="draft-2020-12")&&(i.propertyNames=An(o.keyType,e,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=An(o.valueType,e,{...r,path:[...r.path,"additionalProperties"]})},X$=(t,e,n,r)=>{const i=t._zod.def,o=An(i.innerType,e,r),s=e.seen.get(t);e.target==="openapi-3.0"?(s.ref=i.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},Y$=(t,e,n,r)=>{const i=t._zod.def;An(i.innerType,e,r);const o=e.seen.get(t);o.ref=i.innerType},J$=(t,e,n,r)=>{const i=t._zod.def;An(i.innerType,e,r);const o=e.seen.get(t);o.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Q$=(t,e,n,r)=>{const i=t._zod.def;An(i.innerType,e,r);const o=e.seen.get(t);o.ref=i.innerType,e.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},q$=(t,e,n,r)=>{const i=t._zod.def;An(i.innerType,e,r);const o=e.seen.get(t);o.ref=i.innerType;let s;try{s=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=s},e3=(t,e,n,r)=>{const i=t._zod.def,o=e.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;An(o,e,r);const s=e.seen.get(t);s.ref=o},t3=(t,e,n,r)=>{const i=t._zod.def;An(i.innerType,e,r);const o=e.seen.get(t);o.ref=i.innerType,n.readOnly=!0},n3=(t,e,n,r)=>{const i=t._zod.def;An(i.innerType,e,r);const o=e.seen.get(t);o.ref=i.innerType},r3=le("ZodISODateTime",(t,e)=>{ZR.init(t,e),on.init(t,e)});function i3(t){return r$(r3,t)}const o3=le("ZodISODate",(t,e)=>{XR.init(t,e),on.init(t,e)});function s3(t){return i$(o3,t)}const a3=le("ZodISOTime",(t,e)=>{YR.init(t,e),on.init(t,e)});function l3(t){return o$(a3,t)}const u3=le("ZodISODuration",(t,e)=>{JR.init(t,e),on.init(t,e)});function c3(t){return s$(u3,t)}const Kr=le("ZodError",(t,e)=>{W1.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:n=>VN(t,n)},flatten:{value:n=>LN(t,n)},addIssue:{value:n=>{t.issues.push(n),t.message=JSON.stringify(t.issues,Xm,2)}},addIssues:{value:n=>{t.issues.push(...n),t.message=JSON.stringify(t.issues,Xm,2)}},isEmpty:{get(){return t.issues.length===0}}})},{Parent:Error}),d3=qm(Kr),f3=eg(Kr),h3=yf(Kr),p3=bf(Kr),m3=UN(Kr),g3=BN(Kr),v3=jN(Kr),y3=HN(Kr),b3=GN(Kr),_3=WN(Kr),x3=KN(Kr),w3=ZN(Kr),Xt=le("ZodType",(t,e)=>(Wt.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:Ef(t,"input"),output:Ef(t,"output")}}),t.toJSONSchema=k$(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.check=(...n)=>t.clone(Fs(e,{checks:[...e.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]})),t.clone=(n,r)=>zo(t,n,r),t.brand=()=>t,t.register=(n,r)=>(n.add(t,r),t),t.parse=(n,r)=>d3(t,n,r,{callee:t.parse}),t.safeParse=(n,r)=>h3(t,n,r),t.parseAsync=async(n,r)=>f3(t,n,r,{callee:t.parseAsync}),t.safeParseAsync=async(n,r)=>p3(t,n,r),t.spa=t.safeParseAsync,t.encode=(n,r)=>m3(t,n,r),t.decode=(n,r)=>g3(t,n,r),t.encodeAsync=async(n,r)=>v3(t,n,r),t.decodeAsync=async(n,r)=>y3(t,n,r),t.safeEncode=(n,r)=>b3(t,n,r),t.safeDecode=(n,r)=>_3(t,n,r),t.safeEncodeAsync=async(n,r)=>x3(t,n,r),t.safeDecodeAsync=async(n,r)=>w3(t,n,r),t.refine=(n,r)=>t.check(vM(n,r)),t.superRefine=n=>t.check(yM(n)),t.overwrite=n=>t.check(il(n)),t.optional=()=>Dx(t),t.nullable=()=>$x(t),t.nullish=()=>Dx($x(t)),t.nonoptional=n=>cM(t,n),t.array=()=>og(t),t.or=n=>sg([t,n]),t.and=n=>eM(t,n),t.transform=n=>ug(t,Nx(n)),t.default=n=>aM(t,n),t.prefault=n=>uM(t,n),t.catch=n=>fM(t,n),t.pipe=n=>ug(t,n),t.readonly=()=>mM(t),t.describe=n=>{const r=t.clone();return Vu.add(r,{description:n}),r},Object.defineProperty(t,"description",{get(){var n;return(n=Vu.get(t))==null?void 0:n.description},configurable:!0}),t.meta=(...n)=>{if(n.length===0)return Vu.get(t);const r=t.clone();return Vu.add(r,n[0]),r},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),Ex=le("_ZodString",(t,e)=>{tg.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(r,i,o)=>N$(t,r,i);const n=t._zod.bag;t.format=n.format??null,t.minLength=n.minimum??null,t.maxLength=n.maximum??null,t.regex=(...r)=>t.check(m$(...r)),t.includes=(...r)=>t.check(y$(...r)),t.startsWith=(...r)=>t.check(b$(...r)),t.endsWith=(...r)=>t.check(_$(...r)),t.min=(...r)=>t.check(Sf(...r)),t.max=(...r)=>t.check(bx(...r)),t.length=(...r)=>t.check(_x(...r)),t.nonempty=(...r)=>t.check(Sf(1,...r)),t.lowercase=r=>t.check(g$(r)),t.uppercase=r=>t.check(v$(r)),t.trim=()=>t.check(w$()),t.normalize=(...r)=>t.check(x$(...r)),t.toLowerCase=()=>t.check(S$()),t.toUpperCase=()=>t.check(E$()),t.slugify=()=>t.check(T$())}),S3=le("ZodString",(t,e)=>{tg.init(t,e),Ex.init(t,e),t.email=n=>t.check(MD(E3,n)),t.url=n=>t.check(UD(T3,n)),t.jwt=n=>t.check(n$(z3,n)),t.emoji=n=>t.check(BD(I3,n)),t.guid=n=>t.check(mx(Tx,n)),t.uuid=n=>t.check(LD(Tf,n)),t.uuidv4=n=>t.check(VD(Tf,n)),t.uuidv6=n=>t.check(FD(Tf,n)),t.uuidv7=n=>t.check(zD(Tf,n)),t.nanoid=n=>t.check(jD(C3,n)),t.guid=n=>t.check(mx(Tx,n)),t.cuid=n=>t.check(HD(A3,n)),t.cuid2=n=>t.check(GD(P3,n)),t.ulid=n=>t.check(WD(k3,n)),t.base64=n=>t.check(qD(L3,n)),t.base64url=n=>t.check(e$(V3,n)),t.xid=n=>t.check(KD(O3,n)),t.ksuid=n=>t.check(ZD(N3,n)),t.ipv4=n=>t.check(XD(R3,n)),t.ipv6=n=>t.check(YD(D3,n)),t.cidrv4=n=>t.check(JD($3,n)),t.cidrv6=n=>t.check(QD(M3,n)),t.e164=n=>t.check(t$(F3,n)),t.datetime=n=>t.check(i3(n)),t.date=n=>t.check(s3(n)),t.time=n=>t.check(l3(n)),t.duration=n=>t.check(c3(n))});function ve(t){return $D(S3,t)}const on=le("ZodStringFormat",(t,e)=>{Qt.init(t,e),Ex.init(t,e)}),E3=le("ZodEmail",(t,e)=>{FR.init(t,e),on.init(t,e)}),Tx=le("ZodGUID",(t,e)=>{LR.init(t,e),on.init(t,e)}),Tf=le("ZodUUID",(t,e)=>{VR.init(t,e),on.init(t,e)}),T3=le("ZodURL",(t,e)=>{zR.init(t,e),on.init(t,e)}),I3=le("ZodEmoji",(t,e)=>{UR.init(t,e),on.init(t,e)}),C3=le("ZodNanoID",(t,e)=>{BR.init(t,e),on.init(t,e)}),A3=le("ZodCUID",(t,e)=>{jR.init(t,e),on.init(t,e)}),P3=le("ZodCUID2",(t,e)=>{HR.init(t,e),on.init(t,e)}),k3=le("ZodULID",(t,e)=>{GR.init(t,e),on.init(t,e)}),O3=le("ZodXID",(t,e)=>{WR.init(t,e),on.init(t,e)}),N3=le("ZodKSUID",(t,e)=>{KR.init(t,e),on.init(t,e)}),R3=le("ZodIPv4",(t,e)=>{QR.init(t,e),on.init(t,e)}),D3=le("ZodIPv6",(t,e)=>{qR.init(t,e),on.init(t,e)}),$3=le("ZodCIDRv4",(t,e)=>{eD.init(t,e),on.init(t,e)}),M3=le("ZodCIDRv6",(t,e)=>{tD.init(t,e),on.init(t,e)}),L3=le("ZodBase64",(t,e)=>{nD.init(t,e),on.init(t,e)}),V3=le("ZodBase64URL",(t,e)=>{iD.init(t,e),on.init(t,e)}),F3=le("ZodE164",(t,e)=>{oD.init(t,e),on.init(t,e)}),z3=le("ZodJWT",(t,e)=>{aD.init(t,e),on.init(t,e)}),Ix=le("ZodNumber",(t,e)=>{nx.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(r,i,o)=>R$(t,r,i),t.gt=(r,i)=>t.check(vx(r,i)),t.gte=(r,i)=>t.check(ig(r,i)),t.min=(r,i)=>t.check(ig(r,i)),t.lt=(r,i)=>t.check(gx(r,i)),t.lte=(r,i)=>t.check(rg(r,i)),t.max=(r,i)=>t.check(rg(r,i)),t.int=r=>t.check(Cx(r)),t.safe=r=>t.check(Cx(r)),t.positive=r=>t.check(vx(0,r)),t.nonnegative=r=>t.check(ig(0,r)),t.negative=r=>t.check(gx(0,r)),t.nonpositive=r=>t.check(rg(0,r)),t.multipleOf=(r,i)=>t.check(yx(r,i)),t.step=(r,i)=>t.check(yx(r,i)),t.finite=()=>t;const n=t._zod.bag;t.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),t.isFinite=!0,t.format=n.format??null});function Zr(t){return a$(Ix,t)}const U3=le("ZodNumberFormat",(t,e)=>{lD.init(t,e),Ix.init(t,e)});function Cx(t){return l$(U3,t)}const B3=le("ZodBoolean",(t,e)=>{uD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>D$(t,n,r)});function Oi(t){return u$(B3,t)}const j3=le("ZodUndefined",(t,e)=>{cD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>M$(t,n)});function Ax(t){return c$(j3,t)}const H3=le("ZodNull",(t,e)=>{dD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>$$(t,n,r)});function Px(t){return d$(H3,t)}const G3=le("ZodAny",(t,e)=>{fD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>V$()});function W3(){return f$(G3)}const K3=le("ZodUnknown",(t,e)=>{hD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>F$()});function kx(){return h$(K3)}const Z3=le("ZodNever",(t,e)=>{pD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>L$(t,n,r)});function X3(t){return p$(Z3,t)}const Y3=le("ZodArray",(t,e)=>{mD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>H$(t,n,r,i),t.element=e.element,t.min=(n,r)=>t.check(Sf(n,r)),t.nonempty=n=>t.check(Sf(1,n)),t.max=(n,r)=>t.check(bx(n,r)),t.length=(n,r)=>t.check(_x(n,r)),t.unwrap=()=>t.element});function og(t,e){return I$(Y3,t,e)}const J3=le("ZodObject",(t,e)=>{vD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>G$(t,n,r,i),Lt(t,"shape",()=>e.shape),t.keyof=()=>Fn(Object.keys(t._zod.def.shape)),t.catchall=n=>t.clone({...t._zod.def,catchall:n}),t.passthrough=()=>t.clone({...t._zod.def,catchall:kx()}),t.loose=()=>t.clone({...t._zod.def,catchall:kx()}),t.strict=()=>t.clone({...t._zod.def,catchall:X3()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=n=>NN(t,n),t.safeExtend=n=>RN(t,n),t.merge=n=>DN(t,n),t.pick=n=>kN(t,n),t.omit=n=>ON(t,n),t.partial=(...n)=>$N(Rx,t,n[0]),t.required=(...n)=>MN(Mx,t,n[0])});function Rt(t,e){const n={type:"object",shape:t??{},...Ge(e)};return new J3(n)}const Ox=le("ZodUnion",(t,e)=>{ax.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>W$(t,n,r,i),t.options=e.options});function sg(t,e){return new Ox({type:"union",options:t,...Ge(e)})}const Q3=le("ZodDiscriminatedUnion",(t,e)=>{Ox.init(t,e),yD.init(t,e)});function ag(t,e,n){return new Q3({type:"union",options:e,discriminator:t,...Ge(n)})}const q3=le("ZodIntersection",(t,e)=>{bD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>K$(t,n,r,i)});function eM(t,e){return new q3({type:"intersection",left:t,right:e})}const tM=le("ZodRecord",(t,e)=>{_D.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>Z$(t,n,r,i),t.keyType=e.keyType,t.valueType=e.valueType});function nM(t,e,n){return new tM({type:"record",keyType:t,valueType:e,...Ge(n)})}const lg=le("ZodEnum",(t,e)=>{xD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(r,i,o)=>z$(t,r,i),t.enum=e.entries,t.options=Object.values(e.entries);const n=new Set(Object.keys(e.entries));t.extract=(r,i)=>{const o={};for(const s of r)if(n.has(s))o[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new lg({...e,checks:[],...Ge(i),entries:o})},t.exclude=(r,i)=>{const o={...e.entries};for(const s of r)if(n.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new lg({...e,checks:[],...Ge(i),entries:o})}});function Fn(t,e){const n=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new lg({type:"enum",entries:n,...Ge(e)})}const rM=le("ZodLiteral",(t,e)=>{wD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>U$(t,n,r),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function qn(t,e){return new rM({type:"literal",values:Array.isArray(t)?t:[t],...Ge(e)})}const iM=le("ZodTransform",(t,e)=>{SD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>j$(t,n),t._zod.parse=(n,r)=>{if(r.direction==="backward")throw new V1(t.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(Lu(o,n.value,e));else{const s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=t),n.issues.push(Lu(s))}};const i=e.transform(n.value,n);return i instanceof Promise?i.then(o=>(n.value=o,n)):(n.value=i,n)}});function Nx(t){return new iM({type:"transform",transform:t})}const Rx=le("ZodOptional",(t,e)=>{ED.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>n3(t,n,r,i),t.unwrap=()=>t._zod.def.innerType});function Dx(t){return new Rx({type:"optional",innerType:t})}const oM=le("ZodNullable",(t,e)=>{TD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>X$(t,n,r,i),t.unwrap=()=>t._zod.def.innerType});function $x(t){return new oM({type:"nullable",innerType:t})}const sM=le("ZodDefault",(t,e)=>{ID.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>J$(t,n,r,i),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function aM(t,e){return new sM({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():H1(e)}})}const lM=le("ZodPrefault",(t,e)=>{CD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>Q$(t,n,r,i),t.unwrap=()=>t._zod.def.innerType});function uM(t,e){return new lM({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():H1(e)}})}const Mx=le("ZodNonOptional",(t,e)=>{AD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>Y$(t,n,r,i),t.unwrap=()=>t._zod.def.innerType});function cM(t,e){return new Mx({type:"nonoptional",innerType:t,...Ge(e)})}const dM=le("ZodCatch",(t,e)=>{PD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>q$(t,n,r,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function fM(t,e){return new dM({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}const hM=le("ZodPipe",(t,e)=>{kD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>e3(t,n,r,i),t.in=e.in,t.out=e.out});function ug(t,e){return new hM({type:"pipe",in:t,out:e})}const pM=le("ZodReadonly",(t,e)=>{OD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>t3(t,n,r,i),t.unwrap=()=>t._zod.def.innerType});function mM(t){return new pM({type:"readonly",innerType:t})}const gM=le("ZodCustom",(t,e)=>{ND.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>B$(t,n)});function vM(t,e={}){return C$(gM,t,e)}function yM(t){return A$(t)}function bM(t,e){return ug(Nx(t),e)}const If=t=>{if(!t||typeof t!="object")return t;if(Array.isArray(t))return t.map(r=>If(r));const e={t:"title",s:"subtitle",d:"description",desc:"description",bg:"background",img:"image",fs:"features",tl:"timeline",st:"steps"},n={};for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const i=e[r]||r,o=t[r];n[i]=If(o)}return n},Ni=t=>sg([t,og(t),Px(),Ax()]).transform(e=>e==null?[]:Array.isArray(e)?e:[e]),At=sg([ve(),Zr(),Px(),Ax()]).transform(t=>t==null?"":String(t)),cg=ve().describe("Icon name (e.g. 'star', 'users', 'arrow-right'). Use standard Lucide/FontAwesome names."),ol=Rt({id:ve().optional().describe("Unique ID for the slide. Useful for navigation."),sizing:Fn(["viewport","container"]).optional().describe("How the slide fits the screen. Default: 'viewport'."),meta:nM(ve(),W3()).optional().describe("Arbitrary metadata for custom behavior.")}),_M=ol.extend({type:qn("statement").describe("Use for high-impact titles, covers, or quotes."),title:At.describe("Main headline. Keep it punchy (3-6 words)."),subtitle:At.optional().describe("Supporting text or attribution."),tag:At.optional().describe("Small eyebrow tag above the title.")}),xM=Rt({title:At.describe("Feature name."),description:At.describe("Short benefit description."),icon:cg.optional().describe("Visual icon for the feature.")}),wM=ol.extend({type:qn("features").describe("Use for lists of benefits, stats, or grid items."),title:At.describe("Section header."),description:At.optional().describe("Contextual description."),features:Ni(xM).describe("Array of feature cards.")}),Lx=Rt({date:At.describe("Time marker (Year, Date, or 'Now')."),title:At.describe("Event title."),description:At.describe("Event details (1-2 sentences)."),icon:cg.optional().describe("Optional marker icon.")}),SM=ol.extend({type:qn("timeline").describe("Use for history, roadmaps, or chronological steps."),title:At.describe("Timeline header."),subtitle:At.optional(),timeline:Ni(Lx).describe("Ordered events.")}),Vx=Rt({step:At.describe("Step number/label (e.g., '01', 'A')."),title:At.describe("Action title."),description:At.optional().describe("Action details."),icon:cg.optional()}),EM=ol.extend({type:qn("steps").describe("Use for tutorials, 'how-to' guides, or process flows."),title:At.describe("Process header."),subtitle:At.optional(),steps:Ni(Vx).describe("Sequential steps.")}),TM=ol.extend({type:qn("half").describe("Use when you have a strong visual + explanations."),imageSide:Fn(["left","right"]).default("left").describe("Which side the image goes on."),image:At.describe("URL to the image."),title:At.describe("Headline."),tag:At.optional(),paragraphs:Ni(ve()).describe("Array of text blocks/paragraphs."),cta:At.optional().describe("Call to Action label (button).")}),Fu=Fn(["none","xs","sm","md","lg","xl","2xl"]).describe("Spacing size token."),co=Fn(["auto","quarter","third","half","two-thirds","three-quarters","full"]).describe("Element size in container."),IM=Fn(["top","center","bottom"]).describe("Vertical alignment."),CM=Fn(["left","center","right"]).describe("Horizontal alignment."),Fx=Fn(["left","center","right"]).describe("Text alignment."),zx=Rt({type:qn("title").describe("Large heading text."),text:At.describe("The heading text."),size:Fn(["lg","xl","2xl","3xl"]).optional().describe("Heading size. Default: 'xl'."),align:Fx.optional().describe("Text alignment. Default: 'left'.")}),Ux=Rt({type:qn("text").describe("Body paragraph text."),text:At.describe("The paragraph text."),align:Fx.optional().describe("Text alignment. Default: 'left'."),muted:Oi().optional().describe("Muted/subtle appearance. Default: false.")}),Bx=Rt({type:qn("bullets").describe("Unordered bullet list."),items:Ni(ve()).describe("List items.")}),jx=Rt({type:qn("ordered").describe("Numbered list."),items:Ni(ve()).describe("List items.")}),AM=Rt({type:qn("image").describe("Visual media element."),src:At.describe("Image URL."),alt:At.optional().describe("Alt text for accessibility."),fill:Oi().optional().describe("Fill container edge-to-edge. Default: true."),fit:Fn(["cover","contain"]).optional().describe("Object-fit when fill. Default: 'cover'."),rounded:Fn(["none","sm","md","lg","xl","full"]).optional().describe("Border radius.")}),Hx=Rt({type:qn("button").describe("Call-to-action button."),label:At.describe("Button label text."),action:At.optional().describe("Action identifier emitted on click."),variant:Fn(["primary","secondary","outline","ghost"]).optional().describe("Visual variant. Default: 'primary'."),fullWidth:Oi().optional().describe("Full width button. Default: false.")}),Gx=Rt({type:qn("timeline").describe("Embedded timeline with events."),items:Ni(Lx).describe("Timeline events."),compact:Oi().optional().describe("Compact display mode. Default: false.")}),Wx=Rt({type:qn("stepper").describe("Embedded step-by-step process."),items:Ni(Vx).describe("Step items."),compact:Oi().optional().describe("Compact display mode. Default: false.")}),PM=Rt({type:qn("spacer").describe("Adds visual spacing."),size:Fu.optional().describe("Size of the space. Default: 'md'.")}),kM=ag("type",[zx,Ux,Bx,jx,Hx,Gx,Wx,PM]),OM=Rt({type:qn("content").describe("Groups child elements vertically with alignment control."),elements:Ni(kM).describe("Child elements."),valign:IM.optional().describe("Vertical alignment. Default: 'center'."),halign:CM.optional().describe("Horizontal alignment. Default: 'left'."),gap:Fu.optional().describe("Gap between children. Default: 'md'."),padding:Fu.optional().describe("Internal padding. Default: 'lg'."),size:co.optional().describe("Size in parent flex container.")}),NM=ag("type",[AM.extend({size:co.optional()}),OM,zx.extend({size:co.optional()}),Ux.extend({size:co.optional()}),Bx.extend({size:co.optional()}),jx.extend({size:co.optional()}),Hx.extend({size:co.optional()}),Gx.extend({size:co.optional()}),Wx.extend({size:co.optional()})]),RM=ol.extend({type:qn("flex").describe("Flow-based layout. Elements flow in order with semantic sizing."),direction:Fn(["horizontal","vertical"]).optional().describe("Main flow direction. Default: 'horizontal'."),gap:Fu.optional().describe("Gap between elements. Default: 'none'."),padding:Fu.optional().describe("Container padding. Default: 'none'."),elements:Ni(NM).describe("Flex elements in flow order.")}),DM=ag("type",[_M,wM,SM,EM,TM,RM]),$M=Rt({primary:ve().optional().describe("Main brand/accent color. Used for highlights, buttons, links. Example: '#3b82f6'"),secondary:ve().optional().describe("Secondary brand color. Used for complementary elements. Example: '#8b5cf6'"),accent:ve().optional().describe("Tertiary/accent color. Used for special highlights. Example: '#06b6d4'"),background:ve().optional().describe("Main background color. Example: '#030303'"),surface:ve().optional().describe("Elevated surface color (cards, panels, modals). Example: '#0a0a0a'"),text:ve().optional().describe("Primary text color. Example: '#ffffff'"),textSecondary:ve().optional().describe("Secondary/subdued text color. Example: '#e5e7eb'"),muted:ve().optional().describe("Muted/disabled text color. Example: '#9ca3af'"),success:ve().optional().describe("Success state color (green tones). Example: '#10b981'"),warning:ve().optional().describe("Warning state color (yellow/amber). Example: '#f59e0b'"),danger:ve().optional().describe("Danger/error state color (red). Example: '#ef4444'"),info:ve().optional().describe("Informational state color (blue). Example: '#3b82f6'"),border:ve().optional().describe("Border color for containers, cards. Example: 'rgba(255,255,255,0.1)'"),borderSubtle:ve().optional().describe("Subtle border for dividers. Example: 'rgba(255,255,255,0.05)'"),shadow:ve().optional().describe("Shadow color. Example: '#000000'"),overlay:ve().optional().describe("Overlay color for modals. Example: 'rgba(0,0,0,0.5)'"),highlight:ve().optional().describe("Highlight/selection color."),buttonPrimary:ve().optional().describe("Primary button background."),buttonPrimaryText:ve().optional().describe("Primary button text color."),buttonSecondary:ve().optional().describe("Secondary button background."),buttonSecondaryText:ve().optional().describe("Secondary button text color."),link:ve().optional().describe("Link color."),linkHover:ve().optional().describe("Link hover color."),gradientFrom:ve().optional().describe("Gradient start color. Example: '#3b82f6'"),gradientVia:ve().optional().describe("Gradient middle color (optional)."),gradientTo:ve().optional().describe("Gradient end color. Example: '#8b5cf6'")}).describe("Color palette configuration with 25+ customizable colors."),MM=Rt({fontFamily:Rt({heading:ve().optional().describe("Font for headings. Example: 'Inter, sans-serif'"),body:ve().optional().describe("Font for body text. Example: 'Inter, sans-serif'"),mono:ve().optional().describe("Font for code. Example: 'monospace'")}).optional().describe("Font family definitions."),fontSize:Rt({xs:ve().optional().describe("Extra small: 0.75rem"),sm:ve().optional().describe("Small: 0.875rem"),base:ve().optional().describe("Base: 1rem"),lg:ve().optional().describe("Large: 1.125rem"),xl:ve().optional().describe("Extra large: 1.25rem"),"2xl":ve().optional().describe("2XL: 1.5rem"),"3xl":ve().optional().describe("3XL: 1.875rem"),"4xl":ve().optional().describe("4XL: 2.25rem"),"5xl":ve().optional().describe("5XL: 3rem"),"6xl":ve().optional().describe("6XL: 3.75rem"),"7xl":ve().optional().describe("7XL: 4.5rem")}).optional().describe("Font size scale."),fontWeight:Rt({light:Zr().optional().describe("Light: 300"),normal:Zr().optional().describe("Normal: 400"),medium:Zr().optional().describe("Medium: 500"),semibold:Zr().optional().describe("Semibold: 600"),bold:Zr().optional().describe("Bold: 700"),extrabold:Zr().optional().describe("Extra bold: 800")}).optional().describe("Font weight scale."),lineHeight:Rt({tight:ve().optional().describe("Tight: 1.1"),snug:ve().optional().describe("Snug: 1.25"),normal:ve().optional().describe("Normal: 1.5"),relaxed:ve().optional().describe("Relaxed: 1.625"),loose:ve().optional().describe("Loose: 2")}).optional().describe("Line height scale."),letterSpacing:Rt({tighter:ve().optional().describe("-0.05em"),tight:ve().optional().describe("-0.025em"),normal:ve().optional().describe("0"),wide:ve().optional().describe("0.025em"),wider:ve().optional().describe("0.05em"),widest:ve().optional().describe("0.1em")}).optional().describe("Letter spacing scale.")}).describe("Typography configuration: fonts, sizes, weights, line-heights."),LM=Rt({none:ve().optional().describe("0"),xs:ve().optional().describe("0.25rem / 4px"),sm:ve().optional().describe("0.5rem / 8px"),md:ve().optional().describe("1rem / 16px"),lg:ve().optional().describe("1.5rem / 24px"),xl:ve().optional().describe("2rem / 32px"),"2xl":ve().optional().describe("3rem / 48px"),"3xl":ve().optional().describe("4rem / 64px"),"4xl":ve().optional().describe("6rem / 96px")}).describe("Spacing scale for gaps, padding, margins."),VM=Rt({none:ve().optional().describe("No rounding: 0"),sm:ve().optional().describe("Small: 0.25rem"),md:ve().optional().describe("Medium: 0.5rem"),lg:ve().optional().describe("Large: 0.75rem"),xl:ve().optional().describe("Extra large: 1rem"),"2xl":ve().optional().describe("2XL: 1.5rem"),"3xl":ve().optional().describe("3XL: 2rem"),full:ve().optional().describe("Full circle: 9999px")}).describe("Border radius scale for rounded corners."),FM=Rt({useGradients:Oi().optional().describe("Enable/disable gradient effects globally."),gradientDirection:Fn(["to-t","to-b","to-l","to-r","to-tl","to-tr","to-bl","to-br"]).optional().describe("Gradient direction."),gradientFrom:ve().optional().describe("Override gradient start color."),gradientVia:ve().optional().describe("Override gradient middle color."),gradientTo:ve().optional().describe("Override gradient end color."),useShadows:Oi().optional().describe("Enable/disable shadow effects."),shadowIntensity:Fn(["none","sm","md","lg","xl","2xl"]).optional().describe("Shadow intensity level."),shadowColor:ve().optional().describe("Shadow color."),useGlass:Oi().optional().describe("Enable/disable glassmorphism effect."),glassOpacity:Zr().optional().describe("Glass panel opacity (0-1)."),glassBlur:ve().optional().describe("Glass blur amount. Example: '20px'"),glassBorderOpacity:Zr().optional().describe("Glass border opacity (0-1)."),useOrb:Oi().optional().describe("Enable/disable ambient orb/glow effect."),orbOpacity:Zr().optional().describe("Orb opacity (0-1)."),orbBlur:ve().optional().describe("Orb blur amount. Example: '120px'"),orbSize:ve().optional().describe("Orb size. Example: '60vw'"),animationsEnabled:Oi().optional().describe("Enable/disable animations globally."),transitionDuration:ve().optional().describe("Default transition duration. Example: '0.3s'"),transitionEasing:ve().optional().describe("Default transition easing. Example: 'ease-out'"),hoverScale:Zr().optional().describe("Hover scale factor. Example: 1.05")}).describe("Visual effects: gradients, shadows, glass, orb, animations."),zM=Rt({buttonRadius:ve().optional().describe("Button border radius."),buttonPadding:ve().optional().describe("Button padding. Example: '0.75rem 1.5rem'"),buttonFontWeight:Zr().optional().describe("Button font weight."),buttonTextTransform:Fn(["none","uppercase","capitalize"]).optional().describe("Button text transform."),cardRadius:ve().optional().describe("Card border radius."),cardPadding:ve().optional().describe("Card padding."),cardBorderWidth:ve().optional().describe("Card border width. Example: '1px'"),cardBackground:ve().optional().describe("Card background override."),timelineNodeSize:ve().optional().describe("Timeline node size. Example: '1rem'"),timelineLineWidth:ve().optional().describe("Timeline line width. Example: '2px'"),timelineNodeColor:ve().optional().describe("Timeline node color."),timelineLineColor:ve().optional().describe("Timeline line color."),stepBadgeSize:ve().optional().describe("Step badge size."),stepFontSize:ve().optional().describe("Step font size."),progressHeight:ve().optional().describe("Progress bar height."),progressRadius:ve().optional().describe("Progress bar border radius."),progressBackground:ve().optional().describe("Progress bar background."),progressFill:ve().optional().describe("Progress bar fill color."),tagPadding:ve().optional().describe("Tag padding."),tagRadius:ve().optional().describe("Tag border radius."),tagFontSize:ve().optional().describe("Tag font size."),inputRadius:ve().optional().describe("Input border radius."),inputPadding:ve().optional().describe("Input padding."),inputBorder:ve().optional().describe("Input border color."),inputFocusBorder:ve().optional().describe("Input focus border color.")}).describe("Component-specific theming: buttons, cards, timeline, steps, etc."),dg=Rt({colors:$M.optional().describe("Color palette with 25+ customizable colors."),typography:MM.optional().describe("Typography: fonts, sizes, weights, line-heights."),spacing:LM.optional().describe("Spacing scale for consistent gaps and padding."),borderRadius:VM.optional().describe("Border radius tokens for rounded corners."),effects:FM.optional().describe("Visual effects: gradients, shadows, glass, orb."),components:zM.optional().describe("Component-specific styling tokens.")}).describe("Complete theme configuration for full visual customization."),UM=Fn(["default","ocean","midnight","forest","cyber","latte","sunset","monochrome"]).describe("Built-in theme preset name."),BM=Rt({title:At.describe("Title of the entire presentation."),author:At.optional(),date:At.optional(),theme:UM.optional().describe("Theme preset to use. Options: default, ocean, midnight, forest, cyber, latte, sunset, monochrome."),themeConfig:dg.optional().describe("Custom theme configuration to override preset values.")}).passthrough(),jM=Rt({meta:BM.describe("Global deck settings including title and theme."),slides:og(bM(If,DM)).describe("Ordered array of slide definitions.")});function Kx(){try{const{zodToJsonSchema:t}=require("zod-to-json-schema");return t(jM,"LuminaDeck")}catch{return console.warn("zod-to-json-schema not installed. Install it to export raw JSON Schema."),{}}}function Zx(){try{const{zodToJsonSchema:t}=require("zod-to-json-schema");return t(dg,"LuminaThemeConfig")}catch{return console.warn("zod-to-json-schema not installed. Install it to export raw JSON Schema."),{}}}function zs(t,e){if(!t||!e)return;const n=e.split(".");let r=t;for(const i of n){if(r==null)return;r=r[i]}return r}function sl(t,e,n){if(!t)return t;if(!e)return n;const r=e.split("."),i=r[0],o=r.slice(1).join(".");if(Array.isArray(t)){const a=parseInt(i,10);if(isNaN(a))return t;const l=[...t];return r.length===1?l[a]=n:l[a]=sl(t[a],o,n),l}const s={...t};return r.length===1?s[i]=n:s[i]=sl(t[i]||{},o,n),s}function HM(t,e,n,r){const i=zs(t,e);if(!Array.isArray(i))return console.warn(`[Lumina Deep] Insert failed: Target at '${e}' is not an array.`),t;const o=[...i];return o.splice(n,0,r),sl(t,e,o)}function GM(t,e,n){const r=zs(t,e);if(!Array.isArray(r))return console.warn(`[Lumina Deep] Remove failed: Target at '${e}' is not an array.`),t;const i=[...r];return i.splice(n,1),sl(t,e,i)}function WM(t,e,n,r){const i=zs(t,e);if(!Array.isArray(i))return t;const o=[...i],[s]=o.splice(n,1);return o.splice(r,0,s),sl(t,e,o)}function Cf(t,...e){const n=t??0;return e.length===0?`s${n}`:`s${n}-${e.map(String).join("-")}`}function fg(t){return t.join(".")}function Bo(t,e){if(!(!t||!e.length))return zs(t,fg(e))}function Xx(t){return Array.isArray(t)?t:typeof t!="string"?[]:t.split(".").map(e=>/^\d+$/.test(e)?parseInt(e,10):e)}function Vt(t,e,n){var s;const r=t;if(n.length===0||n.length===1&&n[0]==="slide")return(r==null?void 0:r.id)||Cf(e,"slide");const i=Bo(t,n);if(i!=null&&typeof i=="object"&&typeof i.id=="string")return i.id;const o=fg(n);return o&&((s=r==null?void 0:r.ids)!=null&&s[o])?r.ids[o]:Cf(e,...n)}const Yx={statement:()=>[["tag"],["title"],["subtitle"]],features:t=>{const e=Bo(t,["features"]),n=Array.isArray(e)?e:[];return[["header"],...n.map((r,i)=>["features",i])]},half:()=>[["media"],["tag"],["title"],["paragraphs"],["cta"]],timeline:t=>{const e=Bo(t,["timeline"]),n=Array.isArray(e)?e:[];return[["title"],["subtitle"],...n.map((r,i)=>["timeline",i])]},steps:t=>{const e=Bo(t,["steps"]),n=Array.isArray(e)?e:[];return[["header"],...n.map((r,i)=>["steps",i])]},flex:t=>{const e=[],n=Bo(t,["elements"]);return(Array.isArray(n)?n:[]).forEach((i,o)=>{e.push(["elements",o]);const s=i&&typeof i=="object"?i:null;(s==null?void 0:s.type)==="content"&&Array.isArray(s.elements)&&s.elements.forEach((a,l)=>e.push(["elements",o,"elements",l]))}),e},chart:()=>[["title"],["subtitle"],["chart"]],diagram:t=>{const e=[],n=Bo(t,["nodes"]),r=Bo(t,["edges"]);return(Array.isArray(n)?n:[]).forEach((i,o)=>e.push(["nodes",o])),(Array.isArray(r)?r:[]).forEach((i,o)=>e.push(["edges",o])),e},custom:()=>[],video:()=>[["video"],["title"]],free:t=>{const e=Bo(t,["elements"]);return(Array.isArray(e)?e:[]).map((r,i)=>["elements",i])}};function KM(t,e){Yx[t]=e}function Jx(t){const e=(t==null?void 0:t.type)||"unknown",n=Yx[e]||(()=>[]);return[["slide"],...n(t)]}function Af(t,e){return Jx(t).map(n=>Vt(t,e,n))}const dn=Symbol("LuminaStore"),Qx={loop:!1,navigation:!0,keyboard:!0,touch:!0,debug:!1,theme:"default",ui:{visible:!0,showProgressBar:!0,showSlideCount:!0,showControls:!0},keys:{next:["ArrowRight"," ","Enter"],prev:["ArrowLeft","Backspace"]},animation:{enabled:!0,type:"cascade",durationIn:1,durationOut:.5,stagger:.1,ease:"power3.out"}};function al(t){if(typeof t=="string")return SN(t);if(Array.isArray(t))return t.map(al);if(t&&typeof t=="object"){const e={};for(const n in t)e[n]=al(t[n]);return e}return t}function qx(t,e){if(typeof t!="object"||t===null||typeof e!="object"||e===null)return e;if(Array.isArray(e))return e.map(al);const n={...t};for(const r in e)e[r]===Object(e[r])?r in t?n[r]=qx(t[r],e[r]):Object.assign(n,{[r]:al(e[r])}):Object.assign(n,{[r]:al(e[r])});return n}function ZM(t={}){const e={...Qx,...t};t&&typeof t.keys=="object"&&(e.keys={...Qx.keys,...t.keys});const n=Da({deck:null,currentIndex:0,options:e,isReady:!1,actionHistory:[],elementState:{},userData:{}}),r=()=>!n.deck||n.deck.slides.length===0?null:n.deck.slides[n.currentIndex]||null,i=()=>n.deck?n.options.loop?!0:n.currentIndex<n.deck.slides.length-1:!1,o=()=>n.deck?n.options.loop?!0:n.currentIndex>0:!1,s=()=>!n.deck||n.deck.slides.length<=1?0:n.currentIndex/(n.deck.slides.length-1);function a(P){n.options={...n.options,...P},P.theme&&(P.theme,n.options.theme=P.theme),P.ui&&(n.options.ui={...n.options.ui,...P.ui}),P.keys&&(n.options.keys={...n.options.keys,...P.keys}),P.animation&&(n.options.animation={...n.options.animation,...P.animation}),P.elementControl&&(n.options.elementControl={...n.options.elementControl||{},...P.elementControl})}function l(P){if(!P||typeof P!="object")return P;if(Array.isArray(P))return P.map(l);const C={...P};if(C.type==="flex"&&Array.isArray(C.elements))C.elements=C.elements.map(v=>({dragKey:v.dragKey||Date.now()+Math.random(),...l(v)}));else if(C.type==="content"&&Array.isArray(C.elements))C.elements=C.elements.map(v=>({dragKey:v.dragKey||Date.now()+Math.random()+1,...l(v)}));else for(const v in C)C[v]=l(C[v]);return C}function u(P){var M,H,G,Y,se;if(!P||!Array.isArray(P.slides)){console.error("[LuminaStore] Invalid deck format");return}const C=If(P),v=l(C),x=(M=v.meta)==null?void 0:M.initialElementState,I=x&&typeof x=="object"&&!Array.isArray(x)?x:{};if(n.elementState=Object.fromEntries(Object.entries(I).map(([ie,ue])=>[ie,{...ue&&typeof ue=="object"?ue:{}}])),n.deck=al(v),n.currentIndex=0,n.isReady=!0,n.actionHistory=[],((H=n.options.elementControl)==null?void 0:H.defaultVisible)===!1||((Y=(G=v.meta)==null?void 0:G.elementControl)==null?void 0:Y.defaultVisible)===!1){const ie=new Set(Object.keys(I));(((se=n.deck)==null?void 0:se.slides)??[]).forEach((ue,_e)=>{Af(ue,_e).forEach(Ee=>{if(!ie.has(Ee)){const he=n.elementState[Ee]||{};n.elementState[Ee]={...he,visible:!1}}})})}}function c(P){if(!n.deck)return;const C=qx(n.deck,P);n.deck=l(C)}function d(P){n.actionHistory.push(P),n.actionHistory.length>50&&n.actionHistory.shift()}function h(){var v;if(!i())return;const P=((v=n.deck)==null?void 0:v.slides.length)||0;let C=n.currentIndex;n.options.loop?C=(n.currentIndex+1)%P:C++,C!==n.currentIndex&&(n.currentIndex=C)}function p(){var v;if(!o())return;const P=((v=n.deck)==null?void 0:v.slides.length)||0;let C=n.currentIndex;n.options.loop?C=(n.currentIndex-1+P)%P:C--,C!==n.currentIndex&&(n.currentIndex=C)}function m(P){n.deck&&P>=0&&P<n.deck.slides.length&&n.currentIndex!==P&&(n.currentIndex=P)}function g(P,C){if(!n.deck)return;const v=sl(n.deck,P,C);n.deck=l(v)}function _(P,C,v){if(!n.deck)return;const x=zs(n.deck,P),I=v!==void 0?v:Array.isArray(x)?x.length:0,V=l(C);n.deck=HM(n.deck,P,I,V)}function E(P,C){n.deck&&(n.deck=GM(n.deck,P,C))}function S(P,C,v){n.deck&&(n.deck=WM(n.deck,P,C,v))}function y(P,C){const v=n.elementState[P]||{},x={...v};C.visible!==void 0&&(x.visible=C.visible),C.opacity!==void 0&&(x.opacity=C.opacity),C.transform!==void 0&&(x.transform=C.transform),C.class!==void 0&&(x.class=C.class),C.style!==void 0&&(x.style={...v.style||{},...C.style}),n.elementState[P]=x}function b(P){var H,G,Y,se;const C=n.deck;if(!(C!=null&&C.slides))return;const v=C.slides[P];if(!v)return;const x=(H=C.meta)==null?void 0:H.initialElementState,I=x&&typeof x=="object"&&!Array.isArray(x)?x:{},V=((G=n.options.elementControl)==null?void 0:G.defaultVisible)===!1||((se=(Y=C.meta)==null?void 0:Y.elementControl)==null?void 0:se.defaultVisible)===!1,M=new Set(Object.keys(I));Af(v,P).forEach(ie=>{if(M.has(ie)){const ue=I[ie];n.elementState[ie]={...ue&&typeof ue=="object"?ue:{}}}else V?n.elementState[ie]={visible:!1}:n.elementState[ie]={}})}function N(P){return n.userData[P]}function D(P,C){n.userData[P]=C}function O(P){return Object.prototype.hasOwnProperty.call(n.userData,P)}function k(P){return Object.prototype.hasOwnProperty.call(n.userData,P)?(delete n.userData[P],!0):!1}function w(){n.userData={}}return{state:$a(n),currentSlide:r,hasNext:i,hasPrev:o,progress:s,setOptions:a,loadDeck:u,patchDeck:c,updateNode:g,addNode:_,removeNode:E,moveNode:S,setElementState:y,resetElementStateForSlide:b,recordAction:d,next:h,prev:p,goto:m,getUserData:N,setUserData:D,hasUserData:O,deleteUserData:k,clearUserData:w}}function hg(){const t=bt(dn);if(!t)throw new Error("Lumina: Component must be used within a Lumina instance.");return{slide:Z(()=>t.currentSlide()),index:Z(()=>t.state.currentIndex),total:Z(()=>{var e;return((e=t.state.deck)==null?void 0:e.slides.length)||0}),next:t.next,prev:t.prev,goto:t.goto,options:t.state.options}}function XM(){const t=bt(dn);if(!t)return;let e=0;const n=300,r=i=>{var u,c;const{options:o}=t.state;if(!o.keyboard||!o.navigation)return;const s=Date.now();if(s-e<n)return;const a=((u=o.keys)==null?void 0:u.next)||[],l=((c=o.keys)==null?void 0:c.prev)||[];a.includes(i.key)?(t.next(),e=s):l.includes(i.key)&&(t.prev(),e=s)};Gt(()=>{window.addEventListener("keydown",r)}),lr(()=>{window.removeEventListener("keydown",r)})}const YM=50,JM=1.5,QM=400;function qM(){const t=bt(dn);if(!t)return{onTouchStart:()=>{},onTouchEnd:()=>{}};const e=we(null);let n=0;return{onTouchStart:o=>{o.touches.length===1&&(e.value={x:o.touches[0].clientX,y:o.touches[0].clientY})},onTouchEnd:o=>{const s=e.value;if(e.value=null,!s||o.changedTouches.length!==1)return;const{options:a}=t.state;if(!a.navigation)return;const l=Date.now();if(l-n<QM)return;const u=o.changedTouches[0],c=u.clientX-s.x,d=u.clientY-s.y;Math.abs(c)<YM||Math.abs(c)<=Math.abs(d)*JM||(c<0&&t.hasNext()?(t.next(),n=l):c>0&&t.hasPrev()&&(t.prev(),n=l))}}}class pg{constructor(){$n(this,"handlers",new Map)}on(e,n){this.handlers.has(e)||this.handlers.set(e,new Set),this.handlers.get(e).add(n)}off(e,n){const r=this.handlers.get(e);r&&r.delete(n)}emit(e,n){const r=this.handlers.get(e);r&&r.forEach(i=>{try{i(n)}catch(o){console.error(`[LuminaBus] Error in handler for event "${e}":`,o)}})}clear(){this.handlers.clear()}}const Ft=new pg,zu=Object.freeze(Object.defineProperty({__proto__:null,EventBus:pg,bus:Ft},Symbol.toStringTag,{value:"Module"}));function fo(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ew(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}/*!
|
|
47
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of t.seen.entries()){const u=l[1];if(e===l[0]){i(l);continue}if(t.external){const d=(s=t.external.registry.get(l[0]))==null?void 0:s.id;if(e!==l[0]&&d){i(l);continue}}if((a=t.metadataRegistry.get(l[0]))==null?void 0:a.id){i(l);continue}if(u.cycle){i(l);continue}if(u.count>1&&t.reused==="ref"){i(l);continue}}}function Sx(t,e){var s,a,l;const n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=u=>{const c=t.seen.get(u),d=c.def??c.schema,h={...d};if(c.ref===null)return;const p=c.ref;if(c.ref=null,p){r(p);const m=t.seen.get(p).schema;m.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(m)):(Object.assign(d,m),Object.assign(d,h))}c.isParent||t.override({zodSchema:u,jsonSchema:d,path:c.path??[]})};for(const u of[...t.seen.entries()].reverse())r(u[0]);const i={};if(t.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":t.target,(s=t.external)!=null&&s.uri){const u=(a=t.external.registry.get(e))==null?void 0:a.id;if(!u)throw new Error("Schema is missing an `id` property");i.$id=t.external.uri(u)}Object.assign(i,n.def??n.schema);const o=((l=t.external)==null?void 0:l.defs)??{};for(const u of t.seen.entries()){const c=u[1];c.def&&c.defId&&(o[c.defId]=c.def)}t.external||Object.keys(o).length>0&&(t.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{const u=JSON.parse(JSON.stringify(i));return Object.defineProperty(u,"~standard",{value:{...e["~standard"],jsonSchema:{input:Ef(e,"input"),output:Ef(e,"output")}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function cr(t,e){const n=e??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);const r=t._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return cr(r.element,n);if(r.type==="set")return cr(r.valueType,n);if(r.type==="lazy")return cr(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")return cr(r.innerType,n);if(r.type==="intersection")return cr(r.left,n)||cr(r.right,n);if(r.type==="record"||r.type==="map")return cr(r.keyType,n)||cr(r.valueType,n);if(r.type==="pipe")return cr(r.in,n)||cr(r.out,n);if(r.type==="object"){for(const i in r.shape)if(cr(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(cr(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(cr(i,n))return!0;return!!(r.rest&&cr(r.rest,n))}return!1}const k$=(t,e={})=>n=>{const r=xx({...n,processors:e});return An(t,r),wx(r,t),Sx(r,t)},Ef=(t,e)=>n=>{const{libraryOptions:r,target:i}=n??{},o=xx({...r??{},target:i,io:e,processors:{}});return An(t,o),wx(o,t),Sx(o,t)},O$={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},N$=(t,e,n,r)=>{const i=n;i.type="string";const{minimum:o,maximum:s,format:a,patterns:l,contentEncoding:u}=t._zod.bag;if(typeof o=="number"&&(i.minLength=o),typeof s=="number"&&(i.maxLength=s),a&&(i.format=O$[a]??a,i.format===""&&delete i.format),u&&(i.contentEncoding=u),l&&l.size>0){const c=[...l];c.length===1?i.pattern=c[0].source:c.length>1&&(i.allOf=[...c.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},R$=(t,e,n,r)=>{const i=n,{minimum:o,maximum:s,format:a,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:c}=t._zod.bag;typeof a=="string"&&a.includes("int")?i.type="integer":i.type="number",typeof c=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(i.minimum=c,i.exclusiveMinimum=!0):i.exclusiveMinimum=c),typeof o=="number"&&(i.minimum=o,typeof c=="number"&&e.target!=="draft-04"&&(c>=o?delete i.minimum:delete i.exclusiveMinimum)),typeof u=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(i.maximum=u,i.exclusiveMaximum=!0):i.exclusiveMaximum=u),typeof s=="number"&&(i.maximum=s,typeof u=="number"&&e.target!=="draft-04"&&(u<=s?delete i.maximum:delete i.exclusiveMaximum)),typeof l=="number"&&(i.multipleOf=l)},D$=(t,e,n,r)=>{n.type="boolean"},$$=(t,e,n,r)=>{e.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},M$=(t,e,n,r)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},L$=(t,e,n,r)=>{n.not={}},V$=(t,e,n,r)=>{},F$=(t,e,n,r)=>{},z$=(t,e,n,r)=>{const i=t._zod.def,o=z1(i.entries);o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),n.enum=o},U$=(t,e,n,r)=>{const i=t._zod.def,o=[];for(const s of i.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){const s=o[0];n.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?n.enum=[s]:n.const=s}else o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),o.every(s=>typeof s=="boolean")&&(n.type="boolean"),o.every(s=>s===null)&&(n.type="null"),n.enum=o},B$=(t,e,n,r)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},j$=(t,e,n,r)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},H$=(t,e,n,r)=>{const i=n,o=t._zod.def,{minimum:s,maximum:a}=t._zod.bag;typeof s=="number"&&(i.minItems=s),typeof a=="number"&&(i.maxItems=a),i.type="array",i.items=An(o.element,e,{...r,path:[...r.path,"items"]})},G$=(t,e,n,r)=>{var u;const i=n,o=t._zod.def;i.type="object",i.properties={};const s=o.shape;for(const c in s)i.properties[c]=An(s[c],e,{...r,path:[...r.path,"properties",c]});const a=new Set(Object.keys(s)),l=new Set([...a].filter(c=>{const d=o.shape[c]._zod;return e.io==="input"?d.optin===void 0:d.optout===void 0}));l.size>0&&(i.required=Array.from(l)),((u=o.catchall)==null?void 0:u._zod.def.type)==="never"?i.additionalProperties=!1:o.catchall?o.catchall&&(i.additionalProperties=An(o.catchall,e,{...r,path:[...r.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},W$=(t,e,n,r)=>{const i=t._zod.def,o=i.inclusive===!1,s=i.options.map((a,l)=>An(a,e,{...r,path:[...r.path,o?"oneOf":"anyOf",l]}));o?n.oneOf=s:n.anyOf=s},K$=(t,e,n,r)=>{const i=t._zod.def,o=An(i.left,e,{...r,path:[...r.path,"allOf",0]}),s=An(i.right,e,{...r,path:[...r.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,l=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];n.allOf=l},Z$=(t,e,n,r)=>{const i=n,o=t._zod.def;i.type="object",(e.target==="draft-07"||e.target==="draft-2020-12")&&(i.propertyNames=An(o.keyType,e,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=An(o.valueType,e,{...r,path:[...r.path,"additionalProperties"]})},X$=(t,e,n,r)=>{const i=t._zod.def,o=An(i.innerType,e,r),s=e.seen.get(t);e.target==="openapi-3.0"?(s.ref=i.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},Y$=(t,e,n,r)=>{const i=t._zod.def;An(i.innerType,e,r);const o=e.seen.get(t);o.ref=i.innerType},J$=(t,e,n,r)=>{const i=t._zod.def;An(i.innerType,e,r);const o=e.seen.get(t);o.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Q$=(t,e,n,r)=>{const i=t._zod.def;An(i.innerType,e,r);const o=e.seen.get(t);o.ref=i.innerType,e.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},q$=(t,e,n,r)=>{const i=t._zod.def;An(i.innerType,e,r);const o=e.seen.get(t);o.ref=i.innerType;let s;try{s=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=s},e3=(t,e,n,r)=>{const i=t._zod.def,o=e.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;An(o,e,r);const s=e.seen.get(t);s.ref=o},t3=(t,e,n,r)=>{const i=t._zod.def;An(i.innerType,e,r);const o=e.seen.get(t);o.ref=i.innerType,n.readOnly=!0},n3=(t,e,n,r)=>{const i=t._zod.def;An(i.innerType,e,r);const o=e.seen.get(t);o.ref=i.innerType},r3=le("ZodISODateTime",(t,e)=>{ZR.init(t,e),on.init(t,e)});function i3(t){return r$(r3,t)}const o3=le("ZodISODate",(t,e)=>{XR.init(t,e),on.init(t,e)});function s3(t){return i$(o3,t)}const a3=le("ZodISOTime",(t,e)=>{YR.init(t,e),on.init(t,e)});function l3(t){return o$(a3,t)}const u3=le("ZodISODuration",(t,e)=>{JR.init(t,e),on.init(t,e)});function c3(t){return s$(u3,t)}const Kr=le("ZodError",(t,e)=>{W1.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:n=>VN(t,n)},flatten:{value:n=>LN(t,n)},addIssue:{value:n=>{t.issues.push(n),t.message=JSON.stringify(t.issues,Xm,2)}},addIssues:{value:n=>{t.issues.push(...n),t.message=JSON.stringify(t.issues,Xm,2)}},isEmpty:{get(){return t.issues.length===0}}})},{Parent:Error}),d3=qm(Kr),f3=eg(Kr),h3=yf(Kr),p3=bf(Kr),m3=UN(Kr),g3=BN(Kr),v3=jN(Kr),y3=HN(Kr),b3=GN(Kr),_3=WN(Kr),x3=KN(Kr),w3=ZN(Kr),Xt=le("ZodType",(t,e)=>(Wt.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:Ef(t,"input"),output:Ef(t,"output")}}),t.toJSONSchema=k$(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.check=(...n)=>t.clone(Fs(e,{checks:[...e.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]})),t.clone=(n,r)=>zo(t,n,r),t.brand=()=>t,t.register=(n,r)=>(n.add(t,r),t),t.parse=(n,r)=>d3(t,n,r,{callee:t.parse}),t.safeParse=(n,r)=>h3(t,n,r),t.parseAsync=async(n,r)=>f3(t,n,r,{callee:t.parseAsync}),t.safeParseAsync=async(n,r)=>p3(t,n,r),t.spa=t.safeParseAsync,t.encode=(n,r)=>m3(t,n,r),t.decode=(n,r)=>g3(t,n,r),t.encodeAsync=async(n,r)=>v3(t,n,r),t.decodeAsync=async(n,r)=>y3(t,n,r),t.safeEncode=(n,r)=>b3(t,n,r),t.safeDecode=(n,r)=>_3(t,n,r),t.safeEncodeAsync=async(n,r)=>x3(t,n,r),t.safeDecodeAsync=async(n,r)=>w3(t,n,r),t.refine=(n,r)=>t.check(vM(n,r)),t.superRefine=n=>t.check(yM(n)),t.overwrite=n=>t.check(il(n)),t.optional=()=>Dx(t),t.nullable=()=>$x(t),t.nullish=()=>Dx($x(t)),t.nonoptional=n=>cM(t,n),t.array=()=>og(t),t.or=n=>sg([t,n]),t.and=n=>eM(t,n),t.transform=n=>ug(t,Nx(n)),t.default=n=>aM(t,n),t.prefault=n=>uM(t,n),t.catch=n=>fM(t,n),t.pipe=n=>ug(t,n),t.readonly=()=>mM(t),t.describe=n=>{const r=t.clone();return Vu.add(r,{description:n}),r},Object.defineProperty(t,"description",{get(){var n;return(n=Vu.get(t))==null?void 0:n.description},configurable:!0}),t.meta=(...n)=>{if(n.length===0)return Vu.get(t);const r=t.clone();return Vu.add(r,n[0]),r},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),Ex=le("_ZodString",(t,e)=>{tg.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(r,i,o)=>N$(t,r,i);const n=t._zod.bag;t.format=n.format??null,t.minLength=n.minimum??null,t.maxLength=n.maximum??null,t.regex=(...r)=>t.check(m$(...r)),t.includes=(...r)=>t.check(y$(...r)),t.startsWith=(...r)=>t.check(b$(...r)),t.endsWith=(...r)=>t.check(_$(...r)),t.min=(...r)=>t.check(Sf(...r)),t.max=(...r)=>t.check(bx(...r)),t.length=(...r)=>t.check(_x(...r)),t.nonempty=(...r)=>t.check(Sf(1,...r)),t.lowercase=r=>t.check(g$(r)),t.uppercase=r=>t.check(v$(r)),t.trim=()=>t.check(w$()),t.normalize=(...r)=>t.check(x$(...r)),t.toLowerCase=()=>t.check(S$()),t.toUpperCase=()=>t.check(E$()),t.slugify=()=>t.check(T$())}),S3=le("ZodString",(t,e)=>{tg.init(t,e),Ex.init(t,e),t.email=n=>t.check(MD(E3,n)),t.url=n=>t.check(UD(T3,n)),t.jwt=n=>t.check(n$(z3,n)),t.emoji=n=>t.check(BD(I3,n)),t.guid=n=>t.check(mx(Tx,n)),t.uuid=n=>t.check(LD(Tf,n)),t.uuidv4=n=>t.check(VD(Tf,n)),t.uuidv6=n=>t.check(FD(Tf,n)),t.uuidv7=n=>t.check(zD(Tf,n)),t.nanoid=n=>t.check(jD(C3,n)),t.guid=n=>t.check(mx(Tx,n)),t.cuid=n=>t.check(HD(A3,n)),t.cuid2=n=>t.check(GD(P3,n)),t.ulid=n=>t.check(WD(k3,n)),t.base64=n=>t.check(qD(L3,n)),t.base64url=n=>t.check(e$(V3,n)),t.xid=n=>t.check(KD(O3,n)),t.ksuid=n=>t.check(ZD(N3,n)),t.ipv4=n=>t.check(XD(R3,n)),t.ipv6=n=>t.check(YD(D3,n)),t.cidrv4=n=>t.check(JD($3,n)),t.cidrv6=n=>t.check(QD(M3,n)),t.e164=n=>t.check(t$(F3,n)),t.datetime=n=>t.check(i3(n)),t.date=n=>t.check(s3(n)),t.time=n=>t.check(l3(n)),t.duration=n=>t.check(c3(n))});function ve(t){return $D(S3,t)}const on=le("ZodStringFormat",(t,e)=>{Qt.init(t,e),Ex.init(t,e)}),E3=le("ZodEmail",(t,e)=>{FR.init(t,e),on.init(t,e)}),Tx=le("ZodGUID",(t,e)=>{LR.init(t,e),on.init(t,e)}),Tf=le("ZodUUID",(t,e)=>{VR.init(t,e),on.init(t,e)}),T3=le("ZodURL",(t,e)=>{zR.init(t,e),on.init(t,e)}),I3=le("ZodEmoji",(t,e)=>{UR.init(t,e),on.init(t,e)}),C3=le("ZodNanoID",(t,e)=>{BR.init(t,e),on.init(t,e)}),A3=le("ZodCUID",(t,e)=>{jR.init(t,e),on.init(t,e)}),P3=le("ZodCUID2",(t,e)=>{HR.init(t,e),on.init(t,e)}),k3=le("ZodULID",(t,e)=>{GR.init(t,e),on.init(t,e)}),O3=le("ZodXID",(t,e)=>{WR.init(t,e),on.init(t,e)}),N3=le("ZodKSUID",(t,e)=>{KR.init(t,e),on.init(t,e)}),R3=le("ZodIPv4",(t,e)=>{QR.init(t,e),on.init(t,e)}),D3=le("ZodIPv6",(t,e)=>{qR.init(t,e),on.init(t,e)}),$3=le("ZodCIDRv4",(t,e)=>{eD.init(t,e),on.init(t,e)}),M3=le("ZodCIDRv6",(t,e)=>{tD.init(t,e),on.init(t,e)}),L3=le("ZodBase64",(t,e)=>{nD.init(t,e),on.init(t,e)}),V3=le("ZodBase64URL",(t,e)=>{iD.init(t,e),on.init(t,e)}),F3=le("ZodE164",(t,e)=>{oD.init(t,e),on.init(t,e)}),z3=le("ZodJWT",(t,e)=>{aD.init(t,e),on.init(t,e)}),Ix=le("ZodNumber",(t,e)=>{nx.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(r,i,o)=>R$(t,r,i),t.gt=(r,i)=>t.check(vx(r,i)),t.gte=(r,i)=>t.check(ig(r,i)),t.min=(r,i)=>t.check(ig(r,i)),t.lt=(r,i)=>t.check(gx(r,i)),t.lte=(r,i)=>t.check(rg(r,i)),t.max=(r,i)=>t.check(rg(r,i)),t.int=r=>t.check(Cx(r)),t.safe=r=>t.check(Cx(r)),t.positive=r=>t.check(vx(0,r)),t.nonnegative=r=>t.check(ig(0,r)),t.negative=r=>t.check(gx(0,r)),t.nonpositive=r=>t.check(rg(0,r)),t.multipleOf=(r,i)=>t.check(yx(r,i)),t.step=(r,i)=>t.check(yx(r,i)),t.finite=()=>t;const n=t._zod.bag;t.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),t.isFinite=!0,t.format=n.format??null});function Zr(t){return a$(Ix,t)}const U3=le("ZodNumberFormat",(t,e)=>{lD.init(t,e),Ix.init(t,e)});function Cx(t){return l$(U3,t)}const B3=le("ZodBoolean",(t,e)=>{uD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>D$(t,n,r)});function Oi(t){return u$(B3,t)}const j3=le("ZodUndefined",(t,e)=>{cD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>M$(t,n)});function Ax(t){return c$(j3,t)}const H3=le("ZodNull",(t,e)=>{dD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>$$(t,n,r)});function Px(t){return d$(H3,t)}const G3=le("ZodAny",(t,e)=>{fD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>V$()});function W3(){return f$(G3)}const K3=le("ZodUnknown",(t,e)=>{hD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>F$()});function kx(){return h$(K3)}const Z3=le("ZodNever",(t,e)=>{pD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>L$(t,n,r)});function X3(t){return p$(Z3,t)}const Y3=le("ZodArray",(t,e)=>{mD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>H$(t,n,r,i),t.element=e.element,t.min=(n,r)=>t.check(Sf(n,r)),t.nonempty=n=>t.check(Sf(1,n)),t.max=(n,r)=>t.check(bx(n,r)),t.length=(n,r)=>t.check(_x(n,r)),t.unwrap=()=>t.element});function og(t,e){return I$(Y3,t,e)}const J3=le("ZodObject",(t,e)=>{vD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>G$(t,n,r,i),Lt(t,"shape",()=>e.shape),t.keyof=()=>Fn(Object.keys(t._zod.def.shape)),t.catchall=n=>t.clone({...t._zod.def,catchall:n}),t.passthrough=()=>t.clone({...t._zod.def,catchall:kx()}),t.loose=()=>t.clone({...t._zod.def,catchall:kx()}),t.strict=()=>t.clone({...t._zod.def,catchall:X3()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=n=>NN(t,n),t.safeExtend=n=>RN(t,n),t.merge=n=>DN(t,n),t.pick=n=>kN(t,n),t.omit=n=>ON(t,n),t.partial=(...n)=>$N(Rx,t,n[0]),t.required=(...n)=>MN(Mx,t,n[0])});function Rt(t,e){const n={type:"object",shape:t??{},...Ge(e)};return new J3(n)}const Ox=le("ZodUnion",(t,e)=>{ax.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>W$(t,n,r,i),t.options=e.options});function sg(t,e){return new Ox({type:"union",options:t,...Ge(e)})}const Q3=le("ZodDiscriminatedUnion",(t,e)=>{Ox.init(t,e),yD.init(t,e)});function ag(t,e,n){return new Q3({type:"union",options:e,discriminator:t,...Ge(n)})}const q3=le("ZodIntersection",(t,e)=>{bD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>K$(t,n,r,i)});function eM(t,e){return new q3({type:"intersection",left:t,right:e})}const tM=le("ZodRecord",(t,e)=>{_D.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>Z$(t,n,r,i),t.keyType=e.keyType,t.valueType=e.valueType});function nM(t,e,n){return new tM({type:"record",keyType:t,valueType:e,...Ge(n)})}const lg=le("ZodEnum",(t,e)=>{xD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(r,i,o)=>z$(t,r,i),t.enum=e.entries,t.options=Object.values(e.entries);const n=new Set(Object.keys(e.entries));t.extract=(r,i)=>{const o={};for(const s of r)if(n.has(s))o[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new lg({...e,checks:[],...Ge(i),entries:o})},t.exclude=(r,i)=>{const o={...e.entries};for(const s of r)if(n.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new lg({...e,checks:[],...Ge(i),entries:o})}});function Fn(t,e){const n=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new lg({type:"enum",entries:n,...Ge(e)})}const rM=le("ZodLiteral",(t,e)=>{wD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>U$(t,n,r),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function qn(t,e){return new rM({type:"literal",values:Array.isArray(t)?t:[t],...Ge(e)})}const iM=le("ZodTransform",(t,e)=>{SD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>j$(t,n),t._zod.parse=(n,r)=>{if(r.direction==="backward")throw new V1(t.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(Lu(o,n.value,e));else{const s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=t),n.issues.push(Lu(s))}};const i=e.transform(n.value,n);return i instanceof Promise?i.then(o=>(n.value=o,n)):(n.value=i,n)}});function Nx(t){return new iM({type:"transform",transform:t})}const Rx=le("ZodOptional",(t,e)=>{ED.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>n3(t,n,r,i),t.unwrap=()=>t._zod.def.innerType});function Dx(t){return new Rx({type:"optional",innerType:t})}const oM=le("ZodNullable",(t,e)=>{TD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>X$(t,n,r,i),t.unwrap=()=>t._zod.def.innerType});function $x(t){return new oM({type:"nullable",innerType:t})}const sM=le("ZodDefault",(t,e)=>{ID.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>J$(t,n,r,i),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function aM(t,e){return new sM({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():H1(e)}})}const lM=le("ZodPrefault",(t,e)=>{CD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>Q$(t,n,r,i),t.unwrap=()=>t._zod.def.innerType});function uM(t,e){return new lM({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():H1(e)}})}const Mx=le("ZodNonOptional",(t,e)=>{AD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>Y$(t,n,r,i),t.unwrap=()=>t._zod.def.innerType});function cM(t,e){return new Mx({type:"nonoptional",innerType:t,...Ge(e)})}const dM=le("ZodCatch",(t,e)=>{PD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>q$(t,n,r,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function fM(t,e){return new dM({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}const hM=le("ZodPipe",(t,e)=>{kD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>e3(t,n,r,i),t.in=e.in,t.out=e.out});function ug(t,e){return new hM({type:"pipe",in:t,out:e})}const pM=le("ZodReadonly",(t,e)=>{OD.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>t3(t,n,r,i),t.unwrap=()=>t._zod.def.innerType});function mM(t){return new pM({type:"readonly",innerType:t})}const gM=le("ZodCustom",(t,e)=>{ND.init(t,e),Xt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>B$(t,n)});function vM(t,e={}){return C$(gM,t,e)}function yM(t){return A$(t)}function bM(t,e){return ug(Nx(t),e)}const If=t=>{if(!t||typeof t!="object")return t;if(Array.isArray(t))return t.map(r=>If(r));const e={t:"title",s:"subtitle",d:"description",desc:"description",bg:"background",img:"image",fs:"features",tl:"timeline",st:"steps"},n={};for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const i=e[r]||r,o=t[r];n[i]=If(o)}return n},Ni=t=>sg([t,og(t),Px(),Ax()]).transform(e=>e==null?[]:Array.isArray(e)?e:[e]),At=sg([ve(),Zr(),Px(),Ax()]).transform(t=>t==null?"":String(t)),cg=ve().describe("Icon name (e.g. 'star', 'users', 'arrow-right'). Use standard Lucide/FontAwesome names."),ol=Rt({id:ve().optional().describe("Unique ID for the slide. Useful for navigation."),sizing:Fn(["viewport","container"]).optional().describe("How the slide fits the screen. Default: 'viewport'."),meta:nM(ve(),W3()).optional().describe("Arbitrary metadata for custom behavior.")}),_M=ol.extend({type:qn("statement").describe("Use for high-impact titles, covers, or quotes."),title:At.describe("Main headline. Keep it punchy (3-6 words)."),subtitle:At.optional().describe("Supporting text or attribution."),tag:At.optional().describe("Small eyebrow tag above the title.")}),xM=Rt({title:At.describe("Feature name."),description:At.describe("Short benefit description."),icon:cg.optional().describe("Visual icon for the feature.")}),wM=ol.extend({type:qn("features").describe("Use for lists of benefits, stats, or grid items."),title:At.describe("Section header."),description:At.optional().describe("Contextual description."),features:Ni(xM).describe("Array of feature cards.")}),Lx=Rt({date:At.describe("Time marker (Year, Date, or 'Now')."),title:At.describe("Event title."),description:At.describe("Event details (1-2 sentences)."),icon:cg.optional().describe("Optional marker icon.")}),SM=ol.extend({type:qn("timeline").describe("Use for history, roadmaps, or chronological steps."),title:At.describe("Timeline header."),subtitle:At.optional(),timeline:Ni(Lx).describe("Ordered events.")}),Vx=Rt({step:At.describe("Step number/label (e.g., '01', 'A')."),title:At.describe("Action title."),description:At.optional().describe("Action details."),icon:cg.optional()}),EM=ol.extend({type:qn("steps").describe("Use for tutorials, 'how-to' guides, or process flows."),title:At.describe("Process header."),subtitle:At.optional(),steps:Ni(Vx).describe("Sequential steps.")}),TM=ol.extend({type:qn("half").describe("Use when you have a strong visual + explanations."),imageSide:Fn(["left","right"]).default("left").describe("Which side the image goes on."),image:At.describe("URL to the image."),title:At.describe("Headline."),tag:At.optional(),paragraphs:Ni(ve()).describe("Array of text blocks/paragraphs."),cta:At.optional().describe("Call to Action label (button).")}),Fu=Fn(["none","xs","sm","md","lg","xl","2xl"]).describe("Spacing size token."),co=Fn(["auto","quarter","third","half","two-thirds","three-quarters","full"]).describe("Element size in container."),IM=Fn(["top","center","bottom"]).describe("Vertical alignment."),CM=Fn(["left","center","right"]).describe("Horizontal alignment."),Fx=Fn(["left","center","right"]).describe("Text alignment."),zx=Rt({type:qn("title").describe("Large heading text."),text:At.describe("The heading text."),size:Fn(["lg","xl","2xl","3xl"]).optional().describe("Heading size. Default: 'xl'."),align:Fx.optional().describe("Text alignment. Default: 'left'.")}),Ux=Rt({type:qn("text").describe("Body paragraph text."),text:At.describe("The paragraph text."),align:Fx.optional().describe("Text alignment. Default: 'left'."),muted:Oi().optional().describe("Muted/subtle appearance. Default: false.")}),Bx=Rt({type:qn("bullets").describe("Unordered bullet list."),items:Ni(ve()).describe("List items.")}),jx=Rt({type:qn("ordered").describe("Numbered list."),items:Ni(ve()).describe("List items.")}),AM=Rt({type:qn("image").describe("Visual media element."),src:At.describe("Image URL."),alt:At.optional().describe("Alt text for accessibility."),fill:Oi().optional().describe("Fill container edge-to-edge. Default: true."),fit:Fn(["cover","contain"]).optional().describe("Object-fit when fill. Default: 'cover'."),rounded:Fn(["none","sm","md","lg","xl","full"]).optional().describe("Border radius.")}),Hx=Rt({type:qn("button").describe("Call-to-action button."),label:At.describe("Button label text."),action:At.optional().describe("Action identifier emitted on click."),variant:Fn(["primary","secondary","outline","ghost"]).optional().describe("Visual variant. Default: 'primary'."),fullWidth:Oi().optional().describe("Full width button. Default: false.")}),Gx=Rt({type:qn("timeline").describe("Embedded timeline with events."),items:Ni(Lx).describe("Timeline events."),compact:Oi().optional().describe("Compact display mode. Default: false.")}),Wx=Rt({type:qn("stepper").describe("Embedded step-by-step process."),items:Ni(Vx).describe("Step items."),compact:Oi().optional().describe("Compact display mode. Default: false.")}),PM=Rt({type:qn("spacer").describe("Adds visual spacing."),size:Fu.optional().describe("Size of the space. Default: 'md'.")}),kM=ag("type",[zx,Ux,Bx,jx,Hx,Gx,Wx,PM]),OM=Rt({type:qn("content").describe("Groups child elements vertically with alignment control."),elements:Ni(kM).describe("Child elements."),valign:IM.optional().describe("Vertical alignment. Default: 'center'."),halign:CM.optional().describe("Horizontal alignment. Default: 'left'."),gap:Fu.optional().describe("Gap between children. Default: 'md'."),padding:Fu.optional().describe("Internal padding. Default: 'lg'."),size:co.optional().describe("Size in parent flex container.")}),NM=ag("type",[AM.extend({size:co.optional()}),OM,zx.extend({size:co.optional()}),Ux.extend({size:co.optional()}),Bx.extend({size:co.optional()}),jx.extend({size:co.optional()}),Hx.extend({size:co.optional()}),Gx.extend({size:co.optional()}),Wx.extend({size:co.optional()})]),RM=ol.extend({type:qn("flex").describe("Flow-based layout. Elements flow in order with semantic sizing."),direction:Fn(["horizontal","vertical"]).optional().describe("Main flow direction. Default: 'horizontal'."),gap:Fu.optional().describe("Gap between elements. Default: 'none'."),padding:Fu.optional().describe("Container padding. Default: 'none'."),elements:Ni(NM).describe("Flex elements in flow order.")}),DM=ag("type",[_M,wM,SM,EM,TM,RM]),$M=Rt({primary:ve().optional().describe("Main brand/accent color. Used for highlights, buttons, links. Example: '#3b82f6'"),secondary:ve().optional().describe("Secondary brand color. Used for complementary elements. Example: '#8b5cf6'"),accent:ve().optional().describe("Tertiary/accent color. Used for special highlights. Example: '#06b6d4'"),background:ve().optional().describe("Main background color. Example: '#030303'"),surface:ve().optional().describe("Elevated surface color (cards, panels, modals). Example: '#0a0a0a'"),text:ve().optional().describe("Primary text color. Example: '#ffffff'"),textSecondary:ve().optional().describe("Secondary/subdued text color. Example: '#e5e7eb'"),muted:ve().optional().describe("Muted/disabled text color. Example: '#9ca3af'"),success:ve().optional().describe("Success state color (green tones). Example: '#10b981'"),warning:ve().optional().describe("Warning state color (yellow/amber). Example: '#f59e0b'"),danger:ve().optional().describe("Danger/error state color (red). Example: '#ef4444'"),info:ve().optional().describe("Informational state color (blue). Example: '#3b82f6'"),border:ve().optional().describe("Border color for containers, cards. Example: 'rgba(255,255,255,0.1)'"),borderSubtle:ve().optional().describe("Subtle border for dividers. Example: 'rgba(255,255,255,0.05)'"),shadow:ve().optional().describe("Shadow color. Example: '#000000'"),overlay:ve().optional().describe("Overlay color for modals. Example: 'rgba(0,0,0,0.5)'"),highlight:ve().optional().describe("Highlight/selection color."),buttonPrimary:ve().optional().describe("Primary button background."),buttonPrimaryText:ve().optional().describe("Primary button text color."),buttonSecondary:ve().optional().describe("Secondary button background."),buttonSecondaryText:ve().optional().describe("Secondary button text color."),link:ve().optional().describe("Link color."),linkHover:ve().optional().describe("Link hover color."),gradientFrom:ve().optional().describe("Gradient start color. Example: '#3b82f6'"),gradientVia:ve().optional().describe("Gradient middle color (optional)."),gradientTo:ve().optional().describe("Gradient end color. Example: '#8b5cf6'")}).describe("Color palette configuration with 25+ customizable colors."),MM=Rt({fontFamily:Rt({heading:ve().optional().describe("Font for headings. Example: 'Inter, sans-serif'"),body:ve().optional().describe("Font for body text. Example: 'Inter, sans-serif'"),mono:ve().optional().describe("Font for code. Example: 'monospace'")}).optional().describe("Font family definitions."),fontSize:Rt({xs:ve().optional().describe("Extra small: 0.75rem"),sm:ve().optional().describe("Small: 0.875rem"),base:ve().optional().describe("Base: 1rem"),lg:ve().optional().describe("Large: 1.125rem"),xl:ve().optional().describe("Extra large: 1.25rem"),"2xl":ve().optional().describe("2XL: 1.5rem"),"3xl":ve().optional().describe("3XL: 1.875rem"),"4xl":ve().optional().describe("4XL: 2.25rem"),"5xl":ve().optional().describe("5XL: 3rem"),"6xl":ve().optional().describe("6XL: 3.75rem"),"7xl":ve().optional().describe("7XL: 4.5rem")}).optional().describe("Font size scale."),fontWeight:Rt({light:Zr().optional().describe("Light: 300"),normal:Zr().optional().describe("Normal: 400"),medium:Zr().optional().describe("Medium: 500"),semibold:Zr().optional().describe("Semibold: 600"),bold:Zr().optional().describe("Bold: 700"),extrabold:Zr().optional().describe("Extra bold: 800")}).optional().describe("Font weight scale."),lineHeight:Rt({tight:ve().optional().describe("Tight: 1.1"),snug:ve().optional().describe("Snug: 1.25"),normal:ve().optional().describe("Normal: 1.5"),relaxed:ve().optional().describe("Relaxed: 1.625"),loose:ve().optional().describe("Loose: 2")}).optional().describe("Line height scale."),letterSpacing:Rt({tighter:ve().optional().describe("-0.05em"),tight:ve().optional().describe("-0.025em"),normal:ve().optional().describe("0"),wide:ve().optional().describe("0.025em"),wider:ve().optional().describe("0.05em"),widest:ve().optional().describe("0.1em")}).optional().describe("Letter spacing scale.")}).describe("Typography configuration: fonts, sizes, weights, line-heights."),LM=Rt({none:ve().optional().describe("0"),xs:ve().optional().describe("0.25rem / 4px"),sm:ve().optional().describe("0.5rem / 8px"),md:ve().optional().describe("1rem / 16px"),lg:ve().optional().describe("1.5rem / 24px"),xl:ve().optional().describe("2rem / 32px"),"2xl":ve().optional().describe("3rem / 48px"),"3xl":ve().optional().describe("4rem / 64px"),"4xl":ve().optional().describe("6rem / 96px")}).describe("Spacing scale for gaps, padding, margins."),VM=Rt({none:ve().optional().describe("No rounding: 0"),sm:ve().optional().describe("Small: 0.25rem"),md:ve().optional().describe("Medium: 0.5rem"),lg:ve().optional().describe("Large: 0.75rem"),xl:ve().optional().describe("Extra large: 1rem"),"2xl":ve().optional().describe("2XL: 1.5rem"),"3xl":ve().optional().describe("3XL: 2rem"),full:ve().optional().describe("Full circle: 9999px")}).describe("Border radius scale for rounded corners."),FM=Rt({useGradients:Oi().optional().describe("Enable/disable gradient effects globally."),gradientDirection:Fn(["to-t","to-b","to-l","to-r","to-tl","to-tr","to-bl","to-br"]).optional().describe("Gradient direction."),gradientFrom:ve().optional().describe("Override gradient start color."),gradientVia:ve().optional().describe("Override gradient middle color."),gradientTo:ve().optional().describe("Override gradient end color."),useShadows:Oi().optional().describe("Enable/disable shadow effects."),shadowIntensity:Fn(["none","sm","md","lg","xl","2xl"]).optional().describe("Shadow intensity level."),shadowColor:ve().optional().describe("Shadow color."),useGlass:Oi().optional().describe("Enable/disable glassmorphism effect."),glassOpacity:Zr().optional().describe("Glass panel opacity (0-1)."),glassBlur:ve().optional().describe("Glass blur amount. Example: '20px'"),glassBorderOpacity:Zr().optional().describe("Glass border opacity (0-1)."),useOrb:Oi().optional().describe("Enable/disable ambient orb/glow effect."),orbOpacity:Zr().optional().describe("Orb opacity (0-1)."),orbBlur:ve().optional().describe("Orb blur amount. Example: '120px'"),orbSize:ve().optional().describe("Orb size. Example: '60vw'"),animationsEnabled:Oi().optional().describe("Enable/disable animations globally."),transitionDuration:ve().optional().describe("Default transition duration. Example: '0.3s'"),transitionEasing:ve().optional().describe("Default transition easing. Example: 'ease-out'"),hoverScale:Zr().optional().describe("Hover scale factor. Example: 1.05")}).describe("Visual effects: gradients, shadows, glass, orb, animations."),zM=Rt({buttonRadius:ve().optional().describe("Button border radius."),buttonPadding:ve().optional().describe("Button padding. Example: '0.75rem 1.5rem'"),buttonFontWeight:Zr().optional().describe("Button font weight."),buttonTextTransform:Fn(["none","uppercase","capitalize"]).optional().describe("Button text transform."),cardRadius:ve().optional().describe("Card border radius."),cardPadding:ve().optional().describe("Card padding."),cardBorderWidth:ve().optional().describe("Card border width. Example: '1px'"),cardBackground:ve().optional().describe("Card background override."),timelineNodeSize:ve().optional().describe("Timeline node size. Example: '1rem'"),timelineLineWidth:ve().optional().describe("Timeline line width. Example: '2px'"),timelineNodeColor:ve().optional().describe("Timeline node color."),timelineLineColor:ve().optional().describe("Timeline line color."),stepBadgeSize:ve().optional().describe("Step badge size."),stepFontSize:ve().optional().describe("Step font size."),progressHeight:ve().optional().describe("Progress bar height."),progressRadius:ve().optional().describe("Progress bar border radius."),progressBackground:ve().optional().describe("Progress bar background."),progressFill:ve().optional().describe("Progress bar fill color."),tagPadding:ve().optional().describe("Tag padding."),tagRadius:ve().optional().describe("Tag border radius."),tagFontSize:ve().optional().describe("Tag font size."),inputRadius:ve().optional().describe("Input border radius."),inputPadding:ve().optional().describe("Input padding."),inputBorder:ve().optional().describe("Input border color."),inputFocusBorder:ve().optional().describe("Input focus border color.")}).describe("Component-specific theming: buttons, cards, timeline, steps, etc."),dg=Rt({colors:$M.optional().describe("Color palette with 25+ customizable colors."),typography:MM.optional().describe("Typography: fonts, sizes, weights, line-heights."),spacing:LM.optional().describe("Spacing scale for consistent gaps and padding."),borderRadius:VM.optional().describe("Border radius tokens for rounded corners."),effects:FM.optional().describe("Visual effects: gradients, shadows, glass, orb."),components:zM.optional().describe("Component-specific styling tokens.")}).describe("Complete theme configuration for full visual customization."),UM=Fn(["default","ocean","midnight","forest","cyber","latte","sunset","monochrome"]).describe("Built-in theme preset name."),BM=Rt({title:At.describe("Title of the entire presentation."),author:At.optional(),date:At.optional(),theme:UM.optional().describe("Theme preset to use. Options: default, ocean, midnight, forest, cyber, latte, sunset, monochrome."),themeConfig:dg.optional().describe("Custom theme configuration to override preset values.")}).passthrough(),jM=Rt({meta:BM.describe("Global deck settings including title and theme."),slides:og(bM(If,DM)).describe("Ordered array of slide definitions.")});function Kx(){try{const{zodToJsonSchema:t}=require("zod-to-json-schema");return t(jM,"LuminaDeck")}catch{return console.warn("zod-to-json-schema not installed. Install it to export raw JSON Schema."),{}}}function Zx(){try{const{zodToJsonSchema:t}=require("zod-to-json-schema");return t(dg,"LuminaThemeConfig")}catch{return console.warn("zod-to-json-schema not installed. Install it to export raw JSON Schema."),{}}}function zs(t,e){if(!t||!e)return;const n=e.split(".");let r=t;for(const i of n){if(r==null)return;r=r[i]}return r}function sl(t,e,n){if(!t)return t;if(!e)return n;const r=e.split("."),i=r[0],o=r.slice(1).join(".");if(Array.isArray(t)){const a=parseInt(i,10);if(isNaN(a))return t;const l=[...t];return r.length===1?l[a]=n:l[a]=sl(t[a],o,n),l}const s={...t};return r.length===1?s[i]=n:s[i]=sl(t[i]||{},o,n),s}function HM(t,e,n,r){const i=zs(t,e);if(!Array.isArray(i))return console.warn(`[Lumina Deep] Insert failed: Target at '${e}' is not an array.`),t;const o=[...i];return o.splice(n,0,r),sl(t,e,o)}function GM(t,e,n){const r=zs(t,e);if(!Array.isArray(r))return console.warn(`[Lumina Deep] Remove failed: Target at '${e}' is not an array.`),t;const i=[...r];return i.splice(n,1),sl(t,e,i)}function WM(t,e,n,r){const i=zs(t,e);if(!Array.isArray(i))return t;const o=[...i],[s]=o.splice(n,1);return o.splice(r,0,s),sl(t,e,o)}function Cf(t,...e){const n=t??0;return e.length===0?`s${n}`:`s${n}-${e.map(String).join("-")}`}function fg(t){return t.join(".")}function Bo(t,e){if(!(!t||!e.length))return zs(t,fg(e))}function Xx(t){return Array.isArray(t)?t:typeof t!="string"?[]:t.split(".").map(e=>/^\d+$/.test(e)?parseInt(e,10):e)}function Vt(t,e,n){var s;const r=t;if(n.length===0||n.length===1&&n[0]==="slide")return(r==null?void 0:r.id)||Cf(e,"slide");const i=Bo(t,n);if(i!=null&&typeof i=="object"&&typeof i.id=="string")return i.id;const o=fg(n);return o&&((s=r==null?void 0:r.ids)!=null&&s[o])?r.ids[o]:(r==null?void 0:r.id)!=null&&r.id!==""?`${r.id}-${n.map(String).join("-")}`:Cf(e,...n)}const Yx={statement:()=>[["tag"],["title"],["subtitle"]],features:t=>{const e=Bo(t,["features"]),n=Array.isArray(e)?e:[];return[["header"],...n.map((r,i)=>["features",i])]},half:()=>[["media"],["tag"],["title"],["paragraphs"],["cta"]],timeline:t=>{const e=Bo(t,["timeline"]),n=Array.isArray(e)?e:[];return[["title"],["subtitle"],...n.map((r,i)=>["timeline",i])]},steps:t=>{const e=Bo(t,["steps"]),n=Array.isArray(e)?e:[];return[["header"],...n.map((r,i)=>["steps",i])]},flex:t=>{const e=[],n=Bo(t,["elements"]);return(Array.isArray(n)?n:[]).forEach((i,o)=>{e.push(["elements",o]);const s=i&&typeof i=="object"?i:null;(s==null?void 0:s.type)==="content"&&Array.isArray(s.elements)&&s.elements.forEach((a,l)=>e.push(["elements",o,"elements",l]))}),e},chart:()=>[["title"],["subtitle"],["chart"]],diagram:t=>{const e=[],n=Bo(t,["nodes"]),r=Bo(t,["edges"]);return(Array.isArray(n)?n:[]).forEach((i,o)=>e.push(["nodes",o])),(Array.isArray(r)?r:[]).forEach((i,o)=>e.push(["edges",o])),e},custom:()=>[],video:()=>[["video"],["title"]],free:t=>{const e=Bo(t,["elements"]);return(Array.isArray(e)?e:[]).map((r,i)=>["elements",i])}};function KM(t,e){Yx[t]=e}function Jx(t){const e=(t==null?void 0:t.type)||"unknown",n=Yx[e]||(()=>[]);return[["slide"],...n(t)]}function Af(t,e){return Jx(t).map(n=>Vt(t,e,n))}const dn=Symbol("LuminaStore"),Qx={loop:!1,navigation:!0,keyboard:!0,touch:!0,debug:!1,theme:"default",ui:{visible:!0,showProgressBar:!0,showSlideCount:!0,showControls:!0},keys:{next:["ArrowRight"," ","Enter"],prev:["ArrowLeft","Backspace"]},animation:{enabled:!0,type:"cascade",durationIn:1,durationOut:.5,stagger:.1,ease:"power3.out"}};function al(t){if(typeof t=="string")return SN(t);if(Array.isArray(t))return t.map(al);if(t&&typeof t=="object"){const e={};for(const n in t)e[n]=al(t[n]);return e}return t}function qx(t,e){if(typeof t!="object"||t===null||typeof e!="object"||e===null)return e;if(Array.isArray(e))return e.map(al);const n={...t};for(const r in e)e[r]===Object(e[r])?r in t?n[r]=qx(t[r],e[r]):Object.assign(n,{[r]:al(e[r])}):Object.assign(n,{[r]:al(e[r])});return n}function ZM(t={}){const e={...Qx,...t};t&&typeof t.keys=="object"&&(e.keys={...Qx.keys,...t.keys});const n=Da({deck:null,currentIndex:0,options:e,isReady:!1,actionHistory:[],elementState:{},userData:{}}),r=()=>!n.deck||n.deck.slides.length===0?null:n.deck.slides[n.currentIndex]||null,i=()=>n.deck?n.options.loop?!0:n.currentIndex<n.deck.slides.length-1:!1,o=()=>n.deck?n.options.loop?!0:n.currentIndex>0:!1,s=()=>!n.deck||n.deck.slides.length<=1?0:n.currentIndex/(n.deck.slides.length-1);function a(P){n.options={...n.options,...P},P.theme&&(P.theme,n.options.theme=P.theme),P.ui&&(n.options.ui={...n.options.ui,...P.ui}),P.keys&&(n.options.keys={...n.options.keys,...P.keys}),P.animation&&(n.options.animation={...n.options.animation,...P.animation}),P.elementControl&&(n.options.elementControl={...n.options.elementControl||{},...P.elementControl})}function l(P){if(!P||typeof P!="object")return P;if(Array.isArray(P))return P.map(l);const C={...P};if(C.type==="flex"&&Array.isArray(C.elements))C.elements=C.elements.map(v=>({dragKey:v.dragKey||Date.now()+Math.random(),...l(v)}));else if(C.type==="content"&&Array.isArray(C.elements))C.elements=C.elements.map(v=>({dragKey:v.dragKey||Date.now()+Math.random()+1,...l(v)}));else for(const v in C)C[v]=l(C[v]);return C}function u(P){var M,H,G,Y,se;if(!P||!Array.isArray(P.slides)){console.error("[LuminaStore] Invalid deck format");return}const C=If(P),v=l(C),x=(M=v.meta)==null?void 0:M.initialElementState,I=x&&typeof x=="object"&&!Array.isArray(x)?x:{};if(n.elementState=Object.fromEntries(Object.entries(I).map(([ie,ue])=>[ie,{...ue&&typeof ue=="object"?ue:{}}])),n.deck=al(v),n.currentIndex=0,n.isReady=!0,n.actionHistory=[],((H=n.options.elementControl)==null?void 0:H.defaultVisible)===!1||((Y=(G=v.meta)==null?void 0:G.elementControl)==null?void 0:Y.defaultVisible)===!1){const ie=new Set(Object.keys(I));(((se=n.deck)==null?void 0:se.slides)??[]).forEach((ue,_e)=>{Af(ue,_e).forEach(Ee=>{if(!ie.has(Ee)){const he=n.elementState[Ee]||{};n.elementState[Ee]={...he,visible:!1}}})})}}function c(P){if(!n.deck)return;const C=qx(n.deck,P);n.deck=l(C)}function d(P){n.actionHistory.push(P),n.actionHistory.length>50&&n.actionHistory.shift()}function h(){var v;if(!i())return;const P=((v=n.deck)==null?void 0:v.slides.length)||0;let C=n.currentIndex;n.options.loop?C=(n.currentIndex+1)%P:C++,C!==n.currentIndex&&(n.currentIndex=C)}function p(){var v;if(!o())return;const P=((v=n.deck)==null?void 0:v.slides.length)||0;let C=n.currentIndex;n.options.loop?C=(n.currentIndex-1+P)%P:C--,C!==n.currentIndex&&(n.currentIndex=C)}function m(P){n.deck&&P>=0&&P<n.deck.slides.length&&n.currentIndex!==P&&(n.currentIndex=P)}function g(P,C){if(!n.deck)return;const v=sl(n.deck,P,C);n.deck=l(v)}function _(P,C,v){if(!n.deck)return;const x=zs(n.deck,P),I=v!==void 0?v:Array.isArray(x)?x.length:0,V=l(C);n.deck=HM(n.deck,P,I,V)}function E(P,C){n.deck&&(n.deck=GM(n.deck,P,C))}function S(P,C,v){n.deck&&(n.deck=WM(n.deck,P,C,v))}function y(P,C){const v=n.elementState[P]||{},x={...v};C.visible!==void 0&&(x.visible=C.visible),C.opacity!==void 0&&(x.opacity=C.opacity),C.transform!==void 0&&(x.transform=C.transform),C.class!==void 0&&(x.class=C.class),C.style!==void 0&&(x.style={...v.style||{},...C.style}),n.elementState[P]=x}function b(P){var H,G,Y,se;const C=n.deck;if(!(C!=null&&C.slides))return;const v=C.slides[P];if(!v)return;const x=(H=C.meta)==null?void 0:H.initialElementState,I=x&&typeof x=="object"&&!Array.isArray(x)?x:{},V=((G=n.options.elementControl)==null?void 0:G.defaultVisible)===!1||((se=(Y=C.meta)==null?void 0:Y.elementControl)==null?void 0:se.defaultVisible)===!1,M=new Set(Object.keys(I));Af(v,P).forEach(ie=>{if(M.has(ie)){const ue=I[ie];n.elementState[ie]={...ue&&typeof ue=="object"?ue:{}}}else V?n.elementState[ie]={visible:!1}:n.elementState[ie]={}})}function N(P){return n.userData[P]}function D(P,C){n.userData[P]=C}function O(P){return Object.prototype.hasOwnProperty.call(n.userData,P)}function k(P){return Object.prototype.hasOwnProperty.call(n.userData,P)?(delete n.userData[P],!0):!1}function w(){n.userData={}}return{state:$a(n),currentSlide:r,hasNext:i,hasPrev:o,progress:s,setOptions:a,loadDeck:u,patchDeck:c,updateNode:g,addNode:_,removeNode:E,moveNode:S,setElementState:y,resetElementStateForSlide:b,recordAction:d,next:h,prev:p,goto:m,getUserData:N,setUserData:D,hasUserData:O,deleteUserData:k,clearUserData:w}}function hg(){const t=bt(dn);if(!t)throw new Error("Lumina: Component must be used within a Lumina instance.");return{slide:Z(()=>t.currentSlide()),index:Z(()=>t.state.currentIndex),total:Z(()=>{var e;return((e=t.state.deck)==null?void 0:e.slides.length)||0}),next:t.next,prev:t.prev,goto:t.goto,options:t.state.options}}function XM(){const t=bt(dn);if(!t)return;let e=0;const n=300,r=i=>{var u,c;const{options:o}=t.state;if(!o.keyboard||!o.navigation)return;const s=Date.now();if(s-e<n)return;const a=((u=o.keys)==null?void 0:u.next)||[],l=((c=o.keys)==null?void 0:c.prev)||[];a.includes(i.key)?(t.next(),e=s):l.includes(i.key)&&(t.prev(),e=s)};Gt(()=>{window.addEventListener("keydown",r)}),lr(()=>{window.removeEventListener("keydown",r)})}const YM=50,JM=1.5,QM=400;function qM(){const t=bt(dn);if(!t)return{onTouchStart:()=>{},onTouchEnd:()=>{}};const e=we(null);let n=0;return{onTouchStart:o=>{o.touches.length===1&&(e.value={x:o.touches[0].clientX,y:o.touches[0].clientY})},onTouchEnd:o=>{const s=e.value;if(e.value=null,!s||o.changedTouches.length!==1)return;const{options:a}=t.state;if(!a.navigation)return;const l=Date.now();if(l-n<QM)return;const u=o.changedTouches[0],c=u.clientX-s.x,d=u.clientY-s.y;Math.abs(c)<YM||Math.abs(c)<=Math.abs(d)*JM||(c<0&&t.hasNext()?(t.next(),n=l):c>0&&t.hasPrev()&&(t.prev(),n=l))}}}class pg{constructor(){$n(this,"handlers",new Map)}on(e,n){this.handlers.has(e)||this.handlers.set(e,new Set),this.handlers.get(e).add(n)}off(e,n){const r=this.handlers.get(e);r&&r.delete(n)}emit(e,n){const r=this.handlers.get(e);r&&r.forEach(i=>{try{i(n)}catch(o){console.error(`[LuminaBus] Error in handler for event "${e}":`,o)}})}clear(){this.handlers.clear()}}const Ft=new pg,zu=Object.freeze(Object.defineProperty({__proto__:null,EventBus:pg,bus:Ft},Symbol.toStringTag,{value:"Module"}));function fo(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ew(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}/*!
|
|
48
48
|
* GSAP 3.14.2
|
|
49
49
|
* https://gsap.com
|
|
50
50
|
*
|
|
@@ -2578,7 +2578,7 @@ Edge: ${t}
|
|
|
2578
2578
|
Source: ${e}
|
|
2579
2579
|
Target: ${n}`,EDGE_ORPHANED:t=>`Edge was orphaned (suddenly missing source or target) and has been removed
|
|
2580
2580
|
Edge: ${t}`,EDGE_NOT_FOUND:t=>`Edge not found
|
|
2581
|
-
Edge: ${t}`,USEVUEFLOW_OPTIONS:()=>"The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead"};class Pn extends Error{constructor(e,...n){var r;super((r=yA[e])==null?void 0:r.call(yA,...n)),this.name="VueFlowError",this.code=e,this.args=n}}function v0(t){return"clientX"in t}function IZ(t){return"sourceEvent"in t}function Zi(t,e){const n=v0(t);let r,i;return n?(r=t.clientX,i=t.clientY):"touches"in t&&t.touches.length>0?(r=t.touches[0].clientX,i=t.touches[0].clientY):"changedTouches"in t&&t.changedTouches.length>0?(r=t.changedTouches[0].clientX,i=t.changedTouches[0].clientY):(r=0,i=0),{x:r-((e==null?void 0:e.left)??0),y:i-((e==null?void 0:e.top)??0)}}const xp=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function CZ(t){var e,n;return{width:((e=t.dimensions)==null?void 0:e.width)??t.width??0,height:((n=t.dimensions)==null?void 0:n.height)??t.height??0}}function wp(t,e=[1,1]){return{x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}}const AZ=()=>!0;function y0(t){t==null||t.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function PZ(t,e,n){const r=[],i={x:t.x-n,y:t.y-n,width:n*2,height:n*2};for(const o of e.values())yp(i,vp(o))>0&&r.push(o);return r}const kZ=250;function OZ(t,e,n,r){var i,o;let s=[],a=Number.POSITIVE_INFINITY;const l=PZ(t,n,e+kZ);for(const u of l){const c=[...((i=u.handleBounds)==null?void 0:i.source)??[],...((o=u.handleBounds)==null?void 0:o.target)??[]];for(const d of c){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:h,y:p}=tu(u,d,d.position,!0),m=Math.sqrt((h-t.x)**2+(p-t.y)**2);m>e||(m<a?(s=[{...d,x:h,y:p}],a=m):m===a&&s.push({...d,x:h,y:p}))}}if(!s.length)return null;if(s.length>1){const u=r.type==="source"?"target":"source";return s.find(c=>c.type===u)??s[0]}return s[0]}function bA(t,{handle:e,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:o,doc:s,lib:a,flowId:l,isValidConnection:u=AZ},c,d,h,p){const m=o==="target",g=e?s.querySelector(`.${a}-flow__handle[data-id="${l}-${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`):null,{x:_,y:E}=Zi(t),S=s.elementFromPoint(_,E),y=S!=null&&S.classList.contains(`${a}-flow__handle`)?S:g,b={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){const N=_A(void 0,y),D=y.getAttribute("data-nodeid"),O=y.getAttribute("data-handleid"),k=y.classList.contains("connectable"),w=y.classList.contains("connectableend");if(!D||!N)return b;const P={source:m?D:r,sourceHandle:m?O:i,target:m?r:D,targetHandle:m?i:O};b.connection=P;const v=k&&w&&(n===ps.Strict?m&&N==="source"||!m&&N==="target":D!==r||O!==i);b.isValid=v&&u(P,{nodes:d,edges:c,sourceNode:h(P.source),targetNode:h(P.target)}),b.toHandle=xA(D,N,O,p,n,!0)}return b}function _A(t,e){return t||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function NZ(t,e){let n=null;return e?n="valid":t&&!e&&(n="invalid"),n}function RZ(t,e){let n=null;return e?n=!0:t&&!e&&(n=!1),n}function xA(t,e,n,r,i,o=!1){var s,a,l;const u=r.get(t);if(!u)return null;const c=i===ps.Strict?(s=u.handleBounds)==null?void 0:s[e]:[...((a=u.handleBounds)==null?void 0:a.source)??[],...((l=u.handleBounds)==null?void 0:l.target)??[]],d=(n?c==null?void 0:c.find(h=>h.id===n):c==null?void 0:c[0])??null;return d&&o?{...d,...tu(u,d,d.position,!0)}:d}const b0={[ze.Left]:ze.Right,[ze.Right]:ze.Left,[ze.Top]:ze.Bottom,[ze.Bottom]:ze.Top},DZ=["production","prod"];function od(t,...e){wA()&&console.warn(`[Vue Flow]: ${t}`,...e)}function wA(){return!DZ.includes("production")}function SA(t,e,n,r,i){const o=e.querySelectorAll(`.vue-flow__handle.${t}`);return o!=null&&o.length?Array.from(o).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:t,nodeId:i,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...bp(s)}}):null}function _0(t,e,n,r,i,o=!1,s){i.value=!1,t.selected?(o||t.selected&&e)&&(r([t]),mr(()=>{s.blur()})):n([t])}function Cn(t){return typeof re(t)<"u"}function $Z(t,e,n,r){if(!t||!t.source||!t.target)return n(new Pn(In.EDGE_INVALID,(t==null?void 0:t.id)??"[ID UNKNOWN]")),!1;let i;return ms(t)?i=t:i={...t,id:eA(t)},i=QC(i,void 0,r),pZ(i,e)?!1:i}function MZ(t,e,n,r,i){if(!e.source||!e.target)return i(new Pn(In.EDGE_INVALID,t.id)),!1;if(!n)return i(new Pn(In.EDGE_NOT_FOUND,t.id)),!1;const{id:o,...s}=t;return{...s,id:r?eA(e):o,source:e.source,target:e.target,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle}}function EA(t,e,n){const r={},i=[];for(let o=0;o<t.length;++o){const s=t[o];if(!_a(s)){n(new Pn(In.NODE_INVALID,s==null?void 0:s.id)||`[ID UNKNOWN|INDEX ${o}]`);continue}const a=dZ(s,e(s.id),s.parentNode);s.parentNode&&(r[s.parentNode]=!0),i[o]=a}for(const o of i){const s=e(o.parentNode)||i.find(a=>a.id===o.parentNode);o.parentNode&&!s&&n(new Pn(In.NODE_MISSING_PARENT,o.id,o.parentNode)),(o.parentNode||r[o.id])&&(r[o.id]&&(o.isParent=!0),s&&(s.isParent=!0))}return i}function TA(t,e,n,r,i,o){let s=i;const a=r.get(s)||new Map;r.set(s,a.set(n,e)),s=`${i}-${t}`;const l=r.get(s)||new Map;if(r.set(s,l.set(n,e)),o){s=`${i}-${t}-${o}`;const u=r.get(s)||new Map;r.set(s,u.set(n,e))}}function x0(t,e,n){t.clear();for(const r of n){const{source:i,target:o,sourceHandle:s=null,targetHandle:a=null}=r,l={edgeId:r.id,source:i,target:o,sourceHandle:s,targetHandle:a},u=`${i}-${s}--${o}-${a}`,c=`${o}-${a}--${i}-${s}`;TA("source",l,c,t,i,s),TA("target",l,u,t,o,a)}}function IA(t,e){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}function w0(t,e,n,r,i,o,s,a){const l=[];for(const u of t){const c=ms(u)?u:$Z(u,a,i,o);if(!c)continue;const d=n(c.source),h=n(c.target);if(!d||!h){i(new Pn(In.EDGE_SOURCE_TARGET_MISSING,c.id,c.source,c.target));continue}if(!d){i(new Pn(In.EDGE_SOURCE_MISSING,c.id,c.source));continue}if(!h){i(new Pn(In.EDGE_TARGET_MISSING,c.id,c.target));continue}if(e&&!e(c,{edges:a,nodes:s,sourceNode:d,targetNode:h})){i(new Pn(In.EDGE_INVALID,c.id));continue}const p=r(c.id);l.push({...QC(c,p,o),sourceNode:d,targetNode:h})}return l}const CA=Symbol("vueFlow"),S0=Symbol("nodeId"),AA=Symbol("nodeRef"),LZ=Symbol("edgeId"),VZ=Symbol("edgeRef"),Sp=Symbol("slots");function PA(t){const{vueFlowRef:e,snapToGrid:n,snapGrid:r,noDragClassName:i,nodeLookup:o,nodeExtent:s,nodeDragThreshold:a,viewport:l,autoPanOnNodeDrag:u,autoPanSpeed:c,nodesDraggable:d,panBy:h,findNode:p,multiSelectionActive:m,nodesSelectionActive:g,selectNodesOnDrag:_,removeSelectedElements:E,addSelectedNodes:S,updateNodePositions:y,emits:b}=Dt(),{onStart:N,onDrag:D,onStop:O,onClick:k,el:w,disabled:P,id:C,selectable:v,dragHandle:x}=t,I=Ii(!1);let V=[],M,H=null,G={x:void 0,y:void 0},Y={x:0,y:0},se=null,ie=!1,ue=!1,_e=0,Ee=!1;const he=kA(),de=({x:$e,y:B})=>{G={x:$e,y:B};let $=!1;if(V=V.map(L=>{const z={x:$e-L.distance.x,y:B-L.distance.y},{computedPosition:F}=g0(L,n.value?wp(z,r.value):z,b.error,s.value,L.parentNode?p(L.parentNode):void 0);return $=$||L.position.x!==F.x||L.position.y!==F.y,L.position=F,L}),ue=ue||$,!!$&&(y(V,!0,!0),I.value=!0,se)){const[L,z]=m0({id:C,dragItems:V,findNode:p});D({event:se,node:L,nodes:z})}},pe=()=>{if(!H)return;const[$e,B]=uA(Y,H,c.value);if($e!==0||B!==0){const $={x:(G.x??0)-$e/l.value.zoom,y:(G.y??0)-B/l.value.zoom};h({x:$e,y:B})&&de($)}_e=requestAnimationFrame(pe)},Le=($e,B)=>{ie=!0;const $=p(C);!_.value&&!m.value&&$&&($.selected||E()),$&&dt(v)&&_.value&&_0($,m.value,S,E,g,!1,B);const L=he($e.sourceEvent);if(G=L,V=_Z(o.value,d.value,L,C),V.length){const[z,F]=m0({id:C,dragItems:V,findNode:p});N({event:$e.sourceEvent,node:z,nodes:F})}},De=($e,B)=>{var $;$e.sourceEvent.type==="touchmove"&&$e.sourceEvent.touches.length>1||(ue=!1,a.value===0&&Le($e,B),G=he($e.sourceEvent),H=(($=e.value)==null?void 0:$.getBoundingClientRect())||null,Y=Zi($e.sourceEvent,H))},Be=($e,B)=>{const $=he($e.sourceEvent);if(!Ee&&ie&&u.value&&(Ee=!0,pe()),!ie){const L=$.xSnapped-(G.x??0),z=$.ySnapped-(G.y??0);Math.sqrt(L*L+z*z)>a.value&&Le($e,B)}(G.x!==$.xSnapped||G.y!==$.ySnapped)&&V.length&&ie&&(se=$e.sourceEvent,Y=Zi($e.sourceEvent,H),de($))},et=$e=>{let B=!1;if(!ie&&!I.value&&!m.value){const $=$e.sourceEvent,L=he($),z=L.xSnapped-(G.x??0),F=L.ySnapped-(G.y??0),W=Math.sqrt(z*z+F*F);W!==0&&W<=a.value&&(k==null||k($),B=!0)}if(V.length&&!B){ue&&(y(V,!1,!1),ue=!1);const[$,L]=m0({id:C,dragItems:V,findNode:p});O({event:$e.sourceEvent,node:$,nodes:L})}V=[],I.value=!1,Ee=!1,ie=!1,G={x:void 0,y:void 0},cancelAnimationFrame(_e)};return Qe([()=>dt(P),w],([$e,B],$,L)=>{if(B){const z=_i(B);$e||(M=cW().on("start",F=>De(F,B)).on("drag",F=>Be(F,B)).on("end",F=>et(F)).filter(F=>{const W=F.target,ee=dt(x);return!F.button&&(!i.value||!mA(W,`.${i.value}`,B)&&(!ee||mA(W,ee,B)))}),z.call(M)),L(()=>{z.on(".drag",null),M&&(M.on("start",null),M.on("drag",null),M.on("end",null))})}}),I}function FZ(){return{doubleClick:Re(),click:Re(),mouseEnter:Re(),mouseMove:Re(),mouseLeave:Re(),contextMenu:Re(),updateStart:Re(),update:Re(),updateEnd:Re()}}function zZ(t,e){const n=FZ();return n.doubleClick.on(r=>{var i,o;e.edgeDoubleClick(r),(o=(i=t.events)==null?void 0:i.doubleClick)==null||o.call(i,r)}),n.click.on(r=>{var i,o;e.edgeClick(r),(o=(i=t.events)==null?void 0:i.click)==null||o.call(i,r)}),n.mouseEnter.on(r=>{var i,o;e.edgeMouseEnter(r),(o=(i=t.events)==null?void 0:i.mouseEnter)==null||o.call(i,r)}),n.mouseMove.on(r=>{var i,o;e.edgeMouseMove(r),(o=(i=t.events)==null?void 0:i.mouseMove)==null||o.call(i,r)}),n.mouseLeave.on(r=>{var i,o;e.edgeMouseLeave(r),(o=(i=t.events)==null?void 0:i.mouseLeave)==null||o.call(i,r)}),n.contextMenu.on(r=>{var i,o;e.edgeContextMenu(r),(o=(i=t.events)==null?void 0:i.contextMenu)==null||o.call(i,r)}),n.updateStart.on(r=>{var i,o;e.edgeUpdateStart(r),(o=(i=t.events)==null?void 0:i.updateStart)==null||o.call(i,r)}),n.update.on(r=>{var i,o;e.edgeUpdate(r),(o=(i=t.events)==null?void 0:i.update)==null||o.call(i,r)}),n.updateEnd.on(r=>{var i,o;e.edgeUpdateEnd(r),(o=(i=t.events)==null?void 0:i.updateEnd)==null||o.call(i,r)}),Object.entries(n).reduce((r,[i,o])=>(r.emit[i]=o.trigger,r.on[i]=o.on,r),{emit:{},on:{}})}function kA(){const{viewport:t,snapGrid:e,snapToGrid:n,vueFlowRef:r}=Dt();return i=>{var o;const s=((o=r.value)==null?void 0:o.getBoundingClientRect())??{left:0,top:0},a=IZ(i)?i.sourceEvent:i,{x:l,y:u}=Zi(a,s),c=rd({x:l,y:u},t.value),{x:d,y:h}=n.value?wp(c,e.value):c;return{xSnapped:d,ySnapped:h,...c}}}function Ep(){return!0}function OA({handleId:t,nodeId:e,type:n,isValidConnection:r,edgeUpdaterType:i,onEdgeUpdate:o,onEdgeUpdateEnd:s}){const{id:a,vueFlowRef:l,connectionMode:u,connectionRadius:c,connectOnClick:d,connectionClickStartHandle:h,nodesConnectable:p,autoPanOnConnect:m,autoPanSpeed:g,findNode:_,panBy:E,startConnection:S,updateConnection:y,endConnection:b,emits:N,viewport:D,edges:O,nodes:k,isValidConnection:w,nodeLookup:P}=Dt();let C=null,v=!1,x=null;function I(M){var H;const G=dt(n)==="target",Y=v0(M),se=JC(M.target),ie=M.currentTarget;if(ie&&(Y&&M.button===0||!Y)){let ue=function(Q){$=Zi(Q,et),de=OZ(rd($,D.value,!1,[1,1]),c.value,P.value,F),L||(z(),L=!0);const ye=bA(Q,{handle:de,connectionMode:u.value,fromNodeId:dt(e),fromHandleId:dt(t),fromType:G?"target":"source",isValidConnection:he,doc:se,lib:"vue",flowId:a,nodeLookup:P.value},O.value,k.value,_,P.value);x=ye.handleDomNode,C=ye.connection,v=RZ(!!de,ye.isValid);const fe={...te,isValid:v,to:ye.toHandle&&v?nd({x:ye.toHandle.x,y:ye.toHandle.y},D.value):$,toHandle:ye.toHandle,toPosition:v&&ye.toHandle?ye.toHandle.position:b0[F.position],toNode:ye.toHandle?P.value.get(ye.toHandle.nodeId):null};if(v&&de&&(te!=null&&te.toHandle)&&fe.toHandle&&te.toHandle.type===fe.toHandle.type&&te.toHandle.nodeId===fe.toHandle.nodeId&&te.toHandle.id===fe.toHandle.id&&te.to.x===fe.to.x&&te.to.y===fe.to.y)return;const be=de??ye.toHandle;if(y(be&&v?nd({x:be.x,y:be.y},D.value):$,be,NZ(!!be,v)),te=fe,!de&&!v&&!x)return y0(B);C&&C.source!==C.target&&x&&(y0(B),B=x,x.classList.add("connecting","vue-flow__handle-connecting"),x.classList.toggle("valid",!!v),x.classList.toggle("vue-flow__handle-valid",!!v))},_e=function(Q){"touches"in Q&&Q.touches.length>0||((de||x)&&C&&v&&(o?o(Q,C):N.connect(C)),N.connectEnd(Q),i&&(s==null||s(Q)),y0(B),cancelAnimationFrame(pe),b(Q),L=!1,v=!1,C=null,x=null,se.removeEventListener("mousemove",ue),se.removeEventListener("mouseup",_e),se.removeEventListener("touchmove",ue),se.removeEventListener("touchend",_e))};const Ee=_(dt(e));let he=dt(r)||w.value||Ep;!he&&Ee&&(he=(G?Ee.isValidSourcePos:Ee.isValidTargetPos)||Ep);let de,pe=0;const{x:Le,y:De}=Zi(M),Be=_A(dt(i),ie),et=(H=l.value)==null?void 0:H.getBoundingClientRect();if(!et||!Be)return;const $e=xA(dt(e),Be,dt(t),P.value,u.value);if(!$e)return;let B,$=Zi(M,et),L=!1;const z=()=>{if(!m.value)return;const[Q,ye]=uA($,et,g.value);E({x:Q,y:ye}),pe=requestAnimationFrame(z)},F={...$e,nodeId:dt(e),type:Be,position:$e.position},W=P.value.get(dt(e)),J={inProgress:!0,isValid:null,from:tu(W,F,ze.Left,!0),fromHandle:F,fromPosition:F.position,fromNode:W,to:$,toHandle:null,toPosition:b0[F.position],toNode:null};S({nodeId:dt(e),id:dt(t),type:Be,position:(ie==null?void 0:ie.getAttribute("data-handlepos"))||ze.Top,...$},{x:Le-et.left,y:De-et.top}),N.connectStart({event:M,nodeId:dt(e),handleId:dt(t),handleType:Be});let te=J;se.addEventListener("mousemove",ue),se.addEventListener("mouseup",_e),se.addEventListener("touchmove",ue),se.addEventListener("touchend",_e)}}function V(M){var H,G;if(!d.value)return;const Y=dt(n)==="target";if(!h.value){N.clickConnectStart({event:M,nodeId:dt(e),handleId:dt(t)}),S({nodeId:dt(e),type:dt(n),id:dt(t),position:ze.Top,...Zi(M)},void 0,!0);return}let se=dt(r)||w.value||Ep;const ie=_(dt(e));if(!se&&ie&&(se=(Y?ie.isValidSourcePos:ie.isValidTargetPos)||Ep),ie&&(typeof ie.connectable>"u"?p.value:ie.connectable)===!1)return;const ue=JC(M.target),_e=bA(M,{handle:{nodeId:dt(e),id:dt(t),type:dt(n),position:ze.Top,...Zi(M)},connectionMode:u.value,fromNodeId:h.value.nodeId,fromHandleId:h.value.id??null,fromType:h.value.type,isValidConnection:se,doc:ue,lib:"vue",flowId:a,nodeLookup:P.value},O.value,k.value,_,P.value),Ee=((H=_e.connection)==null?void 0:H.source)===((G=_e.connection)==null?void 0:G.target);_e.isValid&&_e.connection&&!Ee&&N.connect(_e.connection),N.clickConnectEnd(M),b(M,!0)}return{handlePointerDown:I,handleClick:V}}function UZ(){return bt(S0,"")}function NA(t){const e=t??UZ()??"",n=bt(AA,we(null)),{findNode:r,edges:i,emits:o}=Dt(),s=r(e);return s||o.error(new Pn(In.NODE_NOT_FOUND,e)),{id:e,nodeEl:n,node:s,parentNode:Z(()=>r(s.parentNode)),connectedEdges:Z(()=>iA([s],i.value))}}function BZ(){return{doubleClick:Re(),click:Re(),mouseEnter:Re(),mouseMove:Re(),mouseLeave:Re(),contextMenu:Re(),dragStart:Re(),drag:Re(),dragStop:Re()}}function jZ(t,e){const n=BZ();return n.doubleClick.on(r=>{var i,o;e.nodeDoubleClick(r),(o=(i=t.events)==null?void 0:i.doubleClick)==null||o.call(i,r)}),n.click.on(r=>{var i,o;e.nodeClick(r),(o=(i=t.events)==null?void 0:i.click)==null||o.call(i,r)}),n.mouseEnter.on(r=>{var i,o;e.nodeMouseEnter(r),(o=(i=t.events)==null?void 0:i.mouseEnter)==null||o.call(i,r)}),n.mouseMove.on(r=>{var i,o;e.nodeMouseMove(r),(o=(i=t.events)==null?void 0:i.mouseMove)==null||o.call(i,r)}),n.mouseLeave.on(r=>{var i,o;e.nodeMouseLeave(r),(o=(i=t.events)==null?void 0:i.mouseLeave)==null||o.call(i,r)}),n.contextMenu.on(r=>{var i,o;e.nodeContextMenu(r),(o=(i=t.events)==null?void 0:i.contextMenu)==null||o.call(i,r)}),n.dragStart.on(r=>{var i,o;e.nodeDragStart(r),(o=(i=t.events)==null?void 0:i.dragStart)==null||o.call(i,r)}),n.drag.on(r=>{var i,o;e.nodeDrag(r),(o=(i=t.events)==null?void 0:i.drag)==null||o.call(i,r)}),n.dragStop.on(r=>{var i,o;e.nodeDragStop(r),(o=(i=t.events)==null?void 0:i.dragStop)==null||o.call(i,r)}),Object.entries(n).reduce((r,[i,o])=>(r.emit[i]=o.trigger,r.on[i]=o.on,r),{emit:{},on:{}})}function RA(){const{getSelectedNodes:t,nodeExtent:e,updateNodePositions:n,findNode:r,snapGrid:i,snapToGrid:o,nodesDraggable:s,emits:a}=Dt();return(l,u=!1)=>{const c=o.value?i.value[0]:5,d=o.value?i.value[1]:5,h=u?4:1,p=l.x*c*h,m=l.y*d*h,g=[];for(const _ of t.value)if(_.draggable||s&&typeof _.draggable>"u"){const E={x:_.computedPosition.x+p,y:_.computedPosition.y+m},{position:S}=g0(_,E,a.error,e.value,_.parentNode?r(_.parentNode):void 0);g.push({id:_.id,position:S,from:_.position,distance:{x:l.x,y:l.y},dimensions:_.dimensions})}n(g,!0,!1)}}const Tp=.1,HZ=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2;function ys(){return od("Viewport not initialized yet."),Promise.resolve(!1)}const GZ={zoomIn:ys,zoomOut:ys,zoomTo:ys,fitView:ys,setCenter:ys,fitBounds:ys,project:t=>t,screenToFlowCoordinate:t=>t,flowToScreenCoordinate:t=>t,setViewport:ys,setTransform:ys,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function WZ(t){function e(r,i){return new Promise(o=>{t.d3Selection&&t.d3Zoom?t.d3Zoom.interpolate((i==null?void 0:i.interpolate)==="linear"?Kc:ap).scaleBy(E0(t.d3Selection,i==null?void 0:i.duration,i==null?void 0:i.ease,()=>{o(!0)}),r):o(!1)})}function n(r,i,o,s){return new Promise(a=>{var l;const{x:u,y:c}=YC({x:-r,y:-i},t.translateExtent),d=Ql.translate(-u,-c).scale(o);t.d3Selection&&t.d3Zoom?(l=t.d3Zoom)==null||l.interpolate((s==null?void 0:s.interpolate)==="linear"?Kc:ap).transform(E0(t.d3Selection,s==null?void 0:s.duration,s==null?void 0:s.ease,()=>{a(!0)}),d):a(!1)})}return Z(()=>t.d3Zoom&&t.d3Selection&&t.dimensions.width&&t.dimensions.height?{viewportInitialized:!0,zoomIn:i=>e(1.2,i),zoomOut:i=>e(1/1.2,i),zoomTo:(i,o)=>new Promise(s=>{t.d3Selection&&t.d3Zoom?t.d3Zoom.interpolate((o==null?void 0:o.interpolate)==="linear"?Kc:ap).scaleTo(E0(t.d3Selection,o==null?void 0:o.duration,o==null?void 0:o.ease,()=>{s(!0)}),i):s(!1)}),setViewport:(i,o)=>n(i.x,i.y,i.zoom,o),setTransform:(i,o)=>n(i.x,i.y,i.zoom,o),getViewport:()=>({x:t.viewport.x,y:t.viewport.y,zoom:t.viewport.zoom}),getTransform:()=>({x:t.viewport.x,y:t.viewport.y,zoom:t.viewport.zoom}),fitView:(i={padding:Tp,includeHiddenNodes:!1,duration:0})=>{var o,s;const a=[];for(const h of t.nodes)h.dimensions.width&&h.dimensions.height&&((i==null?void 0:i.includeHiddenNodes)||!h.hidden)&&(!((o=i.nodes)!=null&&o.length)||(s=i.nodes)!=null&&s.length&&i.nodes.includes(h.id))&&a.push(h);if(!a.length)return Promise.resolve(!1);const l=nA(a),{x:u,y:c,zoom:d}=oA(l,t.dimensions.width,t.dimensions.height,i.minZoom??t.minZoom,i.maxZoom??t.maxZoom,i.padding??Tp);return n(u,c,d,i)},setCenter:(i,o,s)=>{const a=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:t.maxZoom,l=t.dimensions.width/2-i*a,u=t.dimensions.height/2-o*a;return n(l,u,a,s)},fitBounds:(i,o={padding:Tp})=>{const{x:s,y:a,zoom:l}=oA(i,t.dimensions.width,t.dimensions.height,t.minZoom,t.maxZoom,o.padding??Tp);return n(s,a,l,o)},project:i=>rd(i,t.viewport,t.snapToGrid,t.snapGrid),screenToFlowCoordinate:i=>{if(t.vueFlowRef){const{x:o,y:s}=t.vueFlowRef.getBoundingClientRect(),a={x:i.x-o,y:i.y-s};return rd(a,t.viewport,t.snapToGrid,t.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:i=>{if(t.vueFlowRef){const{x:o,y:s}=t.vueFlowRef.getBoundingClientRect(),a={x:i.x+o,y:i.y+s};return nd(a,t.viewport)}return{x:0,y:0}}}:GZ)}function E0(t,e=0,n=HZ,r=()=>{}){const i=typeof e=="number"&&e>0;return i||r(),i?t.transition().duration(e).ease(n).on("end",r):t}function KZ(t,e,n){const r=Jp(!0);return r.run(()=>{const i=()=>{r.run(()=>{let g,_,E=!!(n.nodes.value.length||n.edges.value.length);g=Kl([t.modelValue,()=>{var S,y;return(y=(S=t.modelValue)==null?void 0:S.value)==null?void 0:y.length}],([S])=>{S&&Array.isArray(S)&&(_==null||_.pause(),n.setElements(S),!_&&!E&&S.length?E=!0:_==null||_.resume())}),_=Kl([n.nodes,n.edges,()=>n.edges.value.length,()=>n.nodes.value.length],([S,y])=>{var b;(b=t.modelValue)!=null&&b.value&&Array.isArray(t.modelValue.value)&&(g==null||g.pause(),t.modelValue.value=[...S,...y],mr(()=>{g==null||g.resume()}))},{immediate:E}),du(()=>{g==null||g.stop(),_==null||_.stop()})})},o=()=>{r.run(()=>{let g,_,E=!!n.nodes.value.length;g=Kl([t.nodes,()=>{var S,y;return(y=(S=t.nodes)==null?void 0:S.value)==null?void 0:y.length}],([S])=>{S&&Array.isArray(S)&&(_==null||_.pause(),n.setNodes(S),!_&&!E&&S.length?E=!0:_==null||_.resume())}),_=Kl([n.nodes,()=>n.nodes.value.length],([S])=>{var y;(y=t.nodes)!=null&&y.value&&Array.isArray(t.nodes.value)&&(g==null||g.pause(),t.nodes.value=[...S],mr(()=>{g==null||g.resume()}))},{immediate:E}),du(()=>{g==null||g.stop(),_==null||_.stop()})})},s=()=>{r.run(()=>{let g,_,E=!!n.edges.value.length;g=Kl([t.edges,()=>{var S,y;return(y=(S=t.edges)==null?void 0:S.value)==null?void 0:y.length}],([S])=>{S&&Array.isArray(S)&&(_==null||_.pause(),n.setEdges(S),!_&&!E&&S.length?E=!0:_==null||_.resume())}),_=Kl([n.edges,()=>n.edges.value.length],([S])=>{var y;(y=t.edges)!=null&&y.value&&Array.isArray(t.edges.value)&&(g==null||g.pause(),t.edges.value=[...S],mr(()=>{g==null||g.resume()}))},{immediate:E}),du(()=>{g==null||g.stop(),_==null||_.stop()})})},a=()=>{r.run(()=>{Qe(()=>e.maxZoom,()=>{e.maxZoom&&Cn(e.maxZoom)&&n.setMaxZoom(e.maxZoom)},{immediate:!0})})},l=()=>{r.run(()=>{Qe(()=>e.minZoom,()=>{e.minZoom&&Cn(e.minZoom)&&n.setMinZoom(e.minZoom)},{immediate:!0})})},u=()=>{r.run(()=>{Qe(()=>e.translateExtent,()=>{e.translateExtent&&Cn(e.translateExtent)&&n.setTranslateExtent(e.translateExtent)},{immediate:!0})})},c=()=>{r.run(()=>{Qe(()=>e.nodeExtent,()=>{e.nodeExtent&&Cn(e.nodeExtent)&&n.setNodeExtent(e.nodeExtent)},{immediate:!0})})},d=()=>{r.run(()=>{Qe(()=>e.applyDefault,()=>{Cn(e.applyDefault)&&(n.applyDefault.value=e.applyDefault)},{immediate:!0})})},h=()=>{r.run(()=>{const g=async _=>{let E=_;typeof e.autoConnect=="function"&&(E=await e.autoConnect(_)),E!==!1&&n.addEdges([E])};Qe(()=>e.autoConnect,()=>{Cn(e.autoConnect)&&(n.autoConnect.value=e.autoConnect)},{immediate:!0}),Qe(n.autoConnect,(_,E,S)=>{_?n.onConnect(g):n.hooks.value.connect.off(g),S(()=>{n.hooks.value.connect.off(g)})},{immediate:!0})})},p=()=>{const g=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const _ of Object.keys(e)){const E=_;if(!g.includes(E)){const S=Ot(()=>e[E]),y=n[E];Jt(y)&&r.run(()=>{Qe(S,b=>{Cn(b)&&(y.value=b)},{immediate:!0})})}}};(()=>{i(),o(),s(),l(),a(),u(),c(),d(),h(),p()})()}),()=>r.stop()}function ZZ(){return{edgesChange:Re(),nodesChange:Re(),nodeDoubleClick:Re(),nodeClick:Re(),nodeMouseEnter:Re(),nodeMouseMove:Re(),nodeMouseLeave:Re(),nodeContextMenu:Re(),nodeDragStart:Re(),nodeDrag:Re(),nodeDragStop:Re(),nodesInitialized:Re(),miniMapNodeClick:Re(),miniMapNodeDoubleClick:Re(),miniMapNodeMouseEnter:Re(),miniMapNodeMouseMove:Re(),miniMapNodeMouseLeave:Re(),connect:Re(),connectStart:Re(),connectEnd:Re(),clickConnectStart:Re(),clickConnectEnd:Re(),paneReady:Re(),init:Re(),move:Re(),moveStart:Re(),moveEnd:Re(),selectionDragStart:Re(),selectionDrag:Re(),selectionDragStop:Re(),selectionContextMenu:Re(),selectionStart:Re(),selectionEnd:Re(),viewportChangeStart:Re(),viewportChange:Re(),viewportChangeEnd:Re(),paneScroll:Re(),paneClick:Re(),paneContextMenu:Re(),paneMouseEnter:Re(),paneMouseMove:Re(),paneMouseLeave:Re(),edgeContextMenu:Re(),edgeMouseEnter:Re(),edgeMouseMove:Re(),edgeMouseLeave:Re(),edgeDoubleClick:Re(),edgeClick:Re(),edgeUpdateStart:Re(),edgeUpdate:Re(),edgeUpdateEnd:Re(),updateNodeInternals:Re(),error:Re(t=>od(t.message))}}function XZ(t,e){const n=xn();vm(()=>{for(const[i,o]of Object.entries(e.value)){const s=a=>{t(i,a)};o.setEmitter(s),Uc(o.removeEmitter),o.setHasEmitListeners(()=>r(i)),Uc(o.removeHasEmitListeners)}});function r(i){var o;const s=YZ(i);return!!((o=n==null?void 0:n.vnode.props)==null?void 0:o[s])}}function YZ(t){const[e,...n]=t.split(":");return`on${e.replace(/(?:^|-)(\w)/g,(i,o)=>o.toUpperCase())}${n.length?`:${n.join(":")}`:""}`}function DA(){return{vueFlowRef:null,viewportRef:null,nodes:[],edges:[],connectionLookup:new Map,nodeTypes:{},edgeTypes:{},initialized:!1,dimensions:{width:0,height:0},viewport:{x:0,y:0,zoom:1},d3Zoom:null,d3Selection:null,d3ZoomHandler:null,minZoom:.5,maxZoom:2,translateExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],nodeExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],selectionMode:d0.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:qc.Free,paneClickDistance:0,panOnDrag:!0,edgeUpdaterRadius:10,onlyRenderVisibleElements:!1,defaultViewport:{x:0,y:0,zoom:1},nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,defaultMarkerColor:"#b1b1b7",connectionLineStyle:{},connectionLineType:null,connectionLineOptions:{type:ba.Bezier,style:{}},connectionMode:ps.Loose,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectionPosition:{x:Number.NaN,y:Number.NaN},connectionRadius:20,connectOnClick:!0,connectionStatus:null,isValidConnection:null,snapGrid:[15,15],snapToGrid:!1,edgesUpdatable:!1,edgesFocusable:!0,nodesFocusable:!0,nodesConnectable:!0,nodesDraggable:!0,nodeDragThreshold:1,elementsSelectable:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,selectionKeyCode:"Shift",multiSelectionKeyCode:xp()?"Meta":"Control",zoomActivationKeyCode:xp()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:ZZ(),applyDefault:!0,autoConnect:!1,fitViewOnInit:!1,fitViewOnInitDone:!1,noDragClassName:"nodrag",noWheelClassName:"nowheel",noPanClassName:"nopan",defaultEdgeOptions:void 0,elevateEdgesOnSelect:!1,elevateNodesOnSelect:!0,autoPanOnNodeDrag:!0,autoPanOnConnect:!0,autoPanSpeed:15,disableKeyboardA11y:!1,ariaLiveMessage:""}}const JZ=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function QZ(t,e,n){const r=WZ(t),i=$=>{const L=$??[];t.hooks.updateNodeInternals.trigger(L)},o=$=>hZ($,t.nodes,t.edges),s=$=>fZ($,t.nodes,t.edges),a=$=>iA($,t.edges),l=({id:$,type:L,nodeId:z})=>{var F;const W=$?`-${L}-${$}`:`-${L}`;return Array.from(((F=t.connectionLookup.get(`${z}${W}`))==null?void 0:F.values())??[])},u=$=>{if($)return e.value.get($)},c=$=>{if($)return n.value.get($)},d=($,L,z)=>{var F,W;const ee=[];for(const J of $){const te={id:J.id,type:"position",dragging:z,from:J.from};if(L&&(te.position=J.position,J.parentNode)){const Q=u(J.parentNode);te.position={x:te.position.x-(((F=Q==null?void 0:Q.computedPosition)==null?void 0:F.x)??0),y:te.position.y-(((W=Q==null?void 0:Q.computedPosition)==null?void 0:W.y)??0)}}ee.push(te)}ee!=null&&ee.length&&t.hooks.nodesChange.trigger(ee)},h=$=>{if(!t.vueFlowRef)return;const L=t.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!L)return;const z=window.getComputedStyle(L),{m22:F}=new window.DOMMatrixReadOnly(z.transform),W=[];for(const ee of $){const J=ee,te=u(J.id);if(te){const Q=bp(J.nodeElement);if(!!(Q.width&&Q.height&&(te.dimensions.width!==Q.width||te.dimensions.height!==Q.height||J.forceUpdate))){const fe=J.nodeElement.getBoundingClientRect();te.dimensions=Q,te.handleBounds.source=SA("source",J.nodeElement,fe,F,te.id),te.handleBounds.target=SA("target",J.nodeElement,fe,F,te.id),W.push({id:te.id,type:"dimensions",dimensions:Q})}}}!t.fitViewOnInitDone&&t.fitViewOnInit&&r.value.fitView().then(()=>{t.fitViewOnInitDone=!0}),W.length&&t.hooks.nodesChange.trigger(W)},p=($,L)=>{const z=new Set,F=new Set;for(const J of $)_a(J)?z.add(J.id):ms(J)&&F.add(J.id);const W=vs(e.value,z,!0),ee=vs(n.value,F);if(t.multiSelectionActive){for(const J of z)W.push(gs(J,L));for(const J of F)ee.push(gs(J,L))}W.length&&t.hooks.nodesChange.trigger(W),ee.length&&t.hooks.edgesChange.trigger(ee)},m=$=>{if(t.multiSelectionActive){const L=$.map(z=>gs(z.id,!0));t.hooks.nodesChange.trigger(L);return}t.hooks.nodesChange.trigger(vs(e.value,new Set($.map(L=>L.id)),!0)),t.hooks.edgesChange.trigger(vs(n.value))},g=$=>{if(t.multiSelectionActive){const L=$.map(z=>gs(z.id,!0));t.hooks.edgesChange.trigger(L);return}t.hooks.edgesChange.trigger(vs(n.value,new Set($.map(L=>L.id)))),t.hooks.nodesChange.trigger(vs(e.value,new Set,!0))},_=$=>{p($,!0)},E=$=>{const z=($||t.nodes).map(F=>(F.selected=!1,gs(F.id,!1)));t.hooks.nodesChange.trigger(z)},S=$=>{const z=($||t.edges).map(F=>(F.selected=!1,gs(F.id,!1)));t.hooks.edgesChange.trigger(z)},y=$=>{if(!$||!$.length)return p([],!1);const L=$.reduce((z,F)=>{const W=gs(F.id,!1);return _a(F)?z.nodes.push(W):z.edges.push(W),z},{nodes:[],edges:[]});L.nodes.length&&t.hooks.nodesChange.trigger(L.nodes),L.edges.length&&t.hooks.edgesChange.trigger(L.edges)},b=$=>{var L;(L=t.d3Zoom)==null||L.scaleExtent([$,t.maxZoom]),t.minZoom=$},N=$=>{var L;(L=t.d3Zoom)==null||L.scaleExtent([t.minZoom,$]),t.maxZoom=$},D=$=>{var L;(L=t.d3Zoom)==null||L.translateExtent($),t.translateExtent=$},O=$=>{t.nodeExtent=$,i()},k=$=>{var L;(L=t.d3Zoom)==null||L.clickDistance($)},w=$=>{t.nodesDraggable=$,t.nodesConnectable=$,t.elementsSelectable=$},P=$=>{const L=$ instanceof Function?$(t.nodes):$;!t.initialized&&!L.length||(t.nodes=EA(L,u,t.hooks.error.trigger))},C=$=>{const L=$ instanceof Function?$(t.edges):$;if(!t.initialized&&!L.length)return;const z=w0(L,t.isValidConnection,u,c,t.hooks.error.trigger,t.defaultEdgeOptions,t.nodes,t.edges);x0(t.connectionLookup,n.value,z),t.edges=z},v=$=>{const L=$ instanceof Function?$([...t.nodes,...t.edges]):$;!t.initialized&&!L.length||(P(L.filter(_a)),C(L.filter(ms)))},x=$=>{let L=$ instanceof Function?$(t.nodes):$;L=Array.isArray(L)?L:[L];const z=EA(L,u,t.hooks.error.trigger),F=[];for(const W of z)F.push(dA(W));F.length&&t.hooks.nodesChange.trigger(F)},I=$=>{let L=$ instanceof Function?$(t.edges):$;L=Array.isArray(L)?L:[L];const z=w0(L,t.isValidConnection,u,c,t.hooks.error.trigger,t.defaultEdgeOptions,t.nodes,t.edges),F=[];for(const W of z)F.push(dA(W));F.length&&t.hooks.edgesChange.trigger(F)},V=($,L=!0,z=!1)=>{const F=$ instanceof Function?$(t.nodes):$,W=Array.isArray(F)?F:[F],ee=[],J=[];function te(ye){const fe=a(ye);for(const be of fe)(!Cn(be.deletable)||be.deletable)&&J.push(hA(be.id,be.source,be.target,be.sourceHandle,be.targetHandle))}function Q(ye){const fe=[];for(const be of t.nodes)be.parentNode===ye&&fe.push(be);if(fe.length){for(const be of fe)ee.push(fA(be.id));L&&te(fe);for(const be of fe)Q(be.id)}}for(const ye of W){const fe=typeof ye=="string"?u(ye):ye;fe&&(Cn(fe.deletable)&&!fe.deletable||(ee.push(fA(fe.id)),L&&te([fe]),z&&Q(fe.id)))}J.length&&t.hooks.edgesChange.trigger(J),ee.length&&t.hooks.nodesChange.trigger(ee)},M=$=>{const L=$ instanceof Function?$(t.edges):$,z=Array.isArray(L)?L:[L],F=[];for(const W of z){const ee=typeof W=="string"?c(W):W;ee&&(Cn(ee.deletable)&&!ee.deletable||F.push(hA(typeof W=="string"?W:W.id,ee.source,ee.target,ee.sourceHandle,ee.targetHandle)))}t.hooks.edgesChange.trigger(F)},H=($,L,z=!0)=>{const F=c($.id);if(!F)return!1;const W=t.edges.indexOf(F),ee=MZ($,L,F,z,t.hooks.error.trigger);if(ee){const[J]=w0([ee],t.isValidConnection,u,c,t.hooks.error.trigger,t.defaultEdgeOptions,t.nodes,t.edges);return t.edges=t.edges.map((te,Q)=>Q===W?J:te),x0(t.connectionLookup,n.value,[J]),J}return!1},G=($,L,z={replace:!1})=>{const F=c($);if(!F)return;const W=typeof L=="function"?L(F):L;F.data=z.replace?W:{...F.data,...W}},Y=$=>cA($,t.nodes),se=$=>{const L=cA($,t.edges);return x0(t.connectionLookup,n.value,L),L},ie=($,L,z={replace:!1})=>{const F=u($);if(!F)return;const W=typeof L=="function"?L(F):L;z.replace?t.nodes.splice(t.nodes.indexOf(F),1,W):Object.assign(F,W)},ue=($,L,z={replace:!1})=>{const F=u($);if(!F)return;const W=typeof L=="function"?L(F):L;F.data=z.replace?W:{...F.data,...W}},_e=($,L,z=!1)=>{z?t.connectionClickStartHandle=$:t.connectionStartHandle=$,t.connectionEndHandle=null,t.connectionStatus=null,L&&(t.connectionPosition=L)},Ee=($,L=null,z=null)=>{t.connectionStartHandle&&(t.connectionPosition=$,t.connectionEndHandle=L,t.connectionStatus=z)},he=($,L)=>{t.connectionPosition={x:Number.NaN,y:Number.NaN},t.connectionEndHandle=null,t.connectionStatus=null,L?t.connectionClickStartHandle=null:t.connectionStartHandle=null},de=$=>{const L=cZ($),z=L?null:td($)?$:u($.id);return!L&&!z?[null,null,L]:[L?$:vp(z),z,L]},pe=($,L=!0,z=t.nodes)=>{const[F,W,ee]=de($);if(!F)return[];const J=[];for(const te of z||t.nodes){if(!ee&&(te.id===W.id||!te.computedPosition))continue;const Q=vp(te),ye=yp(Q,F);(L&&ye>0||ye>=Q.width*Q.height||ye>=Number(F.width)*Number(F.height))&&J.push(te)}return J},Le=($,L,z=!0)=>{const[F]=de($);if(!F)return!1;const W=yp(F,L);return z&&W>0||W>=Number(F.width)*Number(F.height)},De=$=>{const{viewport:L,dimensions:z,d3Zoom:F,d3Selection:W,translateExtent:ee}=t;if(!F||!W||!$.x&&!$.y)return!1;const J=Ql.translate(L.x+$.x,L.y+$.y).scale(L.zoom),te=[[0,0],[z.width,z.height]],Q=F.constrain()(J,te,ee),ye=t.viewport.x!==Q.x||t.viewport.y!==Q.y||t.viewport.zoom!==Q.k;return F.transform(W,Q),ye},Be=$=>{const L=$ instanceof Function?$(t):$,z=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];Cn(L.defaultEdgeOptions)&&(t.defaultEdgeOptions=L.defaultEdgeOptions);const F=L.modelValue||L.nodes||L.edges?[]:void 0;F&&(L.modelValue&&F.push(...L.modelValue),L.nodes&&F.push(...L.nodes),L.edges&&F.push(...L.edges),v(F));const W=()=>{Cn(L.maxZoom)&&N(L.maxZoom),Cn(L.minZoom)&&b(L.minZoom),Cn(L.translateExtent)&&D(L.translateExtent)};for(const ee of Object.keys(L)){const J=ee,te=L[J];![...JZ,...z].includes(J)&&Cn(te)&&(t[J]=te)}Hy(()=>t.d3Zoom).not.toBeNull().then(W),t.initialized||(t.initialized=!0)};return{updateNodePositions:d,updateNodeDimensions:h,setElements:v,setNodes:P,setEdges:C,addNodes:x,addEdges:I,removeNodes:V,removeEdges:M,findNode:u,findEdge:c,updateEdge:H,updateEdgeData:G,updateNode:ie,updateNodeData:ue,applyEdgeChanges:se,applyNodeChanges:Y,addSelectedElements:_,addSelectedNodes:m,addSelectedEdges:g,setMinZoom:b,setMaxZoom:N,setTranslateExtent:D,setNodeExtent:O,setPaneClickDistance:k,removeSelectedElements:y,removeSelectedNodes:E,removeSelectedEdges:S,startConnection:_e,updateConnection:Ee,endConnection:he,setInteractive:w,setState:Be,getIntersectingNodes:pe,getIncomers:o,getOutgoers:s,getConnectedEdges:a,getHandleConnections:l,isNodeIntersecting:Le,panBy:De,fitView:$=>r.value.fitView($),zoomIn:$=>r.value.zoomIn($),zoomOut:$=>r.value.zoomOut($),zoomTo:($,L)=>r.value.zoomTo($,L),setViewport:($,L)=>r.value.setViewport($,L),setTransform:($,L)=>r.value.setTransform($,L),getViewport:()=>r.value.getViewport(),getTransform:()=>r.value.getTransform(),setCenter:($,L,z)=>r.value.setCenter($,L,z),fitBounds:($,L)=>r.value.fitBounds($,L),project:$=>r.value.project($),screenToFlowCoordinate:$=>r.value.screenToFlowCoordinate($),flowToScreenCoordinate:$=>r.value.flowToScreenCoordinate($),toObject:()=>{const $=[],L=[];for(const z of t.nodes){const{computedPosition:F,handleBounds:W,selected:ee,dimensions:J,isParent:te,resizing:Q,dragging:ye,events:fe,...be}=z;$.push(be)}for(const z of t.edges){const{selected:F,sourceNode:W,targetNode:ee,events:J,...te}=z;L.push(te)}return JSON.parse(JSON.stringify({nodes:$,edges:L,position:[t.viewport.x,t.viewport.y],zoom:t.viewport.zoom,viewport:t.viewport}))},fromObject:$=>new Promise(L=>{const{nodes:z,edges:F,position:W,zoom:ee,viewport:J}=$;z&&P(z),F&&C(F);const[te,Q]=J!=null&&J.x&&(J!=null&&J.y)?[J.x,J.y]:W??[null,null];if(te&&Q){const ye=(J==null?void 0:J.zoom)||ee||t.viewport.zoom;return Hy(()=>r.value.viewportInitialized).toBe(!0).then(()=>{r.value.setViewport({x:te,y:Q,zoom:ye}).then(()=>{L(!0)})})}else L(!0)}),updateNodeInternals:i,viewportHelper:r,$reset:()=>{const $=DA();if(t.edges=[],t.nodes=[],t.d3Zoom&&t.d3Selection){const L=Ql.translate($.defaultViewport.x??0,$.defaultViewport.y??0).scale(Ao($.defaultViewport.zoom??1,$.minZoom,$.maxZoom)),z=t.viewportRef.getBoundingClientRect(),F=[[0,0],[z.width,z.height]],W=t.d3Zoom.constrain()(L,F,$.translateExtent);t.d3Zoom.transform(t.d3Selection,W)}Be($)},$destroy:()=>{}}}const qZ=["data-id","data-handleid","data-nodeid","data-handlepos"],bs=Te({...{name:"Handle",compatConfig:{MODE:3}},props:{id:{default:null},type:{},position:{default:()=>ze.Top},isValidConnection:{type:Function},connectable:{type:[Boolean,Number,String,Function],default:void 0},connectableStart:{type:Boolean,default:!0},connectableEnd:{type:Boolean,default:!0}},setup(t,{expose:e}){const n=a_(t,["position","connectable","connectableStart","connectableEnd","id"]),r=Ot(()=>n.type??"source"),i=Ot(()=>n.isValidConnection??null),{id:o,connectionStartHandle:s,connectionClickStartHandle:a,connectionEndHandle:l,vueFlowRef:u,nodesConnectable:c,noDragClassName:d,noPanClassName:h}=Dt(),{id:p,node:m,nodeEl:g,connectedEdges:_}=NA(),E=we(),S=Ot(()=>typeof t.connectableStart<"u"?t.connectableStart:!0),y=Ot(()=>typeof t.connectableEnd<"u"?t.connectableEnd:!0),b=Ot(()=>{var C,v,x,I,V,M;return((C=s.value)==null?void 0:C.nodeId)===p&&((v=s.value)==null?void 0:v.id)===t.id&&((x=s.value)==null?void 0:x.type)===r.value||((I=l.value)==null?void 0:I.nodeId)===p&&((V=l.value)==null?void 0:V.id)===t.id&&((M=l.value)==null?void 0:M.type)===r.value}),N=Ot(()=>{var C,v,x;return((C=a.value)==null?void 0:C.nodeId)===p&&((v=a.value)==null?void 0:v.id)===t.id&&((x=a.value)==null?void 0:x.type)===r.value}),{handlePointerDown:D,handleClick:O}=OA({nodeId:p,handleId:t.id,isValidConnection:i,type:r}),k=Z(()=>typeof t.connectable=="string"&&t.connectable==="single"?!_.value.some(C=>{const v=C[`${r.value}Handle`];return C[r.value]!==p?!1:v?v===t.id:!0}):typeof t.connectable=="number"?_.value.filter(C=>{const v=C[`${r.value}Handle`];return C[r.value]!==p?!1:v?v===t.id:!0}).length<t.connectable:typeof t.connectable=="function"?t.connectable(m,_.value):Cn(t.connectable)?t.connectable:c.value);Gt(()=>{var C;if(!m.dimensions.width||!m.dimensions.height)return;const v=(C=m.handleBounds[r.value])==null?void 0:C.find(Y=>Y.id===t.id);if(!u.value||v)return;const x=u.value.querySelector(".vue-flow__transformationpane");if(!g.value||!E.value||!x||!t.id)return;const I=g.value.getBoundingClientRect(),V=E.value.getBoundingClientRect(),M=window.getComputedStyle(x),{m22:H}=new window.DOMMatrixReadOnly(M.transform),G={id:t.id,position:t.position,x:(V.left-I.left)/H,y:(V.top-I.top)/H,type:r.value,nodeId:p,...bp(E.value)};m.handleBounds[r.value]=[...m.handleBounds[r.value]??[],G]});function w(C){const v=v0(C);k.value&&S.value&&(v&&C.button===0||!v)&&D(C)}function P(C){!p||!a.value&&!S.value||k.value&&O(C)}return e({handleClick:O,handlePointerDown:D,onClick:P,onPointerDown:w}),(C,v)=>(j(),K("div",{ref_key:"handle",ref:E,"data-id":`${re(o)}-${re(p)}-${t.id}-${r.value}`,"data-handleid":t.id,"data-nodeid":re(p),"data-handlepos":C.position,class:Se(["vue-flow__handle",[`vue-flow__handle-${C.position}`,`vue-flow__handle-${t.id}`,re(d),re(h),r.value,{connectable:k.value,connecting:N.value,connectablestart:S.value,connectableend:y.value,connectionindicator:k.value&&(S.value&&!b.value||y.value&&b.value)}]]),onMousedown:w,onTouchstartPassive:w,onClick:P},[Mt(C.$slots,"default",{id:C.id})],42,qZ))}}),Ip=function({sourcePosition:t=ze.Bottom,targetPosition:e=ze.Top,label:n,connectable:r=!0,isValidTargetPos:i,isValidSourcePos:o,data:s}){const a=s.label??n;return[qe(bs,{type:"target",position:e,connectable:r,isValidConnection:i}),typeof a!="string"&&a?qe(a):qe(Ve,[a]),qe(bs,{type:"source",position:t,connectable:r,isValidConnection:o})]};Ip.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"],Ip.inheritAttrs=!1,Ip.compatConfig={MODE:3};const eX=Ip,Cp=function({targetPosition:t=ze.Top,label:e,connectable:n=!0,isValidTargetPos:r,data:i}){const o=i.label??e;return[qe(bs,{type:"target",position:t,connectable:n,isValidConnection:r}),typeof o!="string"&&o?qe(o):qe(Ve,[o])]};Cp.props=["targetPosition","label","isValidTargetPos","connectable","data"],Cp.inheritAttrs=!1,Cp.compatConfig={MODE:3};const tX=Cp,Ap=function({sourcePosition:t=ze.Bottom,label:e,connectable:n=!0,isValidSourcePos:r,data:i}){const o=i.label??e;return[typeof o!="string"&&o?qe(o):qe(Ve,[o]),qe(bs,{type:"source",position:t,connectable:n,isValidConnection:r})]};Ap.props=["sourcePosition","label","isValidSourcePos","connectable","data"],Ap.inheritAttrs=!1,Ap.compatConfig={MODE:3};const nX=Ap,rX=["transform"],iX=["width","height","x","y","rx","ry"],oX=["y"],sX=Te({...{name:"EdgeText",compatConfig:{MODE:3}},props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(t){const e=we({x:0,y:0,width:0,height:0}),n=we(null),r=Z(()=>`translate(${t.x-e.value.width/2} ${t.y-e.value.height/2})`);Gt(i),Qe([()=>t.x,()=>t.y,n,()=>t.label],i);function i(){if(!n.value)return;const o=n.value.getBBox();(o.width!==e.value.width||o.height!==e.value.height)&&(e.value=o)}return(o,s)=>(j(),K("g",{transform:r.value,class:"vue-flow__edge-textwrapper"},[o.labelShowBg?(j(),K("rect",{key:0,class:"vue-flow__edge-textbg",width:`${e.value.width+2*o.labelBgPadding[0]}px`,height:`${e.value.height+2*o.labelBgPadding[1]}px`,x:-o.labelBgPadding[0],y:-o.labelBgPadding[1],style:Ze(o.labelBgStyle),rx:o.labelBgBorderRadius,ry:o.labelBgBorderRadius},null,12,iX)):Ae("",!0),A("text",ao(o.$attrs,{ref_key:"el",ref:n,class:"vue-flow__edge-text",y:e.value.height/2,dy:"0.3em",style:o.labelStyle}),[Mt(o.$slots,"default",{},()=>[typeof o.label!="string"?(j(),Ne(Jn(o.label),{key:0})):(j(),K(Ve,{key:1},[_t(Ie(o.label),1)],64))])],16,oX)],8,rX))}}),aX=["id","d","marker-end","marker-start"],lX=["d","stroke-width"],Pp=Te({...{name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},props:{id:{},labelX:{},labelY:{},path:{},label:{},markerStart:{},markerEnd:{},interactionWidth:{default:20},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{}},setup(t,{expose:e}){const n=we(null),r=we(null),i=we(null),o=o_();return e({pathEl:n,interactionEl:r,labelEl:i}),(s,a)=>(j(),K(Ve,null,[A("path",ao(re(o),{id:s.id,ref_key:"pathEl",ref:n,d:s.path,class:"vue-flow__edge-path","marker-end":s.markerEnd,"marker-start":s.markerStart}),null,16,aX),s.interactionWidth?(j(),K("path",{key:0,ref_key:"interactionEl",ref:r,fill:"none",d:s.path,"stroke-width":s.interactionWidth,"stroke-opacity":0,class:"vue-flow__edge-interaction"},null,8,lX)):Ae("",!0),s.label&&s.labelX&&s.labelY?(j(),Ne(sX,{key:1,ref_key:"labelEl",ref:i,x:s.labelX,y:s.labelY,label:s.label,"label-show-bg":s.labelShowBg,"label-bg-style":s.labelBgStyle,"label-bg-padding":s.labelBgPadding,"label-bg-border-radius":s.labelBgBorderRadius,"label-style":s.labelStyle},null,8,["x","y","label","label-show-bg","label-bg-style","label-bg-padding","label-bg-border-radius","label-style"])):Ae("",!0)],64))}});function $A({sourceX:t,sourceY:e,targetX:n,targetY:r}){const i=Math.abs(n-t)/2,o=n<t?n+i:n-i,s=Math.abs(r-e)/2,a=r<e?r+s:r-s;return[o,a,i,s]}function MA({sourceX:t,sourceY:e,targetX:n,targetY:r,sourceControlX:i,sourceControlY:o,targetControlX:s,targetControlY:a}){const l=t*.125+i*.375+s*.375+n*.125,u=e*.125+o*.375+a*.375+r*.125,c=Math.abs(l-t),d=Math.abs(u-e);return[l,u,c,d]}function kp(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}function LA({pos:t,x1:e,y1:n,x2:r,y2:i,c:o}){let s,a;switch(t){case ze.Left:s=e-kp(e-r,o),a=n;break;case ze.Right:s=e+kp(r-e,o),a=n;break;case ze.Top:s=e,a=n-kp(n-i,o);break;case ze.Bottom:s=e,a=n+kp(i-n,o);break}return[s,a]}function VA(t){const{sourceX:e,sourceY:n,sourcePosition:r=ze.Bottom,targetX:i,targetY:o,targetPosition:s=ze.Top,curvature:a=.25}=t,[l,u]=LA({pos:r,x1:e,y1:n,x2:i,y2:o,c:a}),[c,d]=LA({pos:s,x1:i,y1:o,x2:e,y2:n,c:a}),[h,p,m,g]=MA({sourceX:e,sourceY:n,targetX:i,targetY:o,sourceControlX:l,sourceControlY:u,targetControlX:c,targetControlY:d});return[`M${e},${n} C${l},${u} ${c},${d} ${i},${o}`,h,p,m,g]}function FA({pos:t,x1:e,y1:n,x2:r,y2:i}){let o,s;switch(t){case ze.Left:case ze.Right:o=.5*(e+r),s=n;break;case ze.Top:case ze.Bottom:o=e,s=.5*(n+i);break}return[o,s]}function zA(t){const{sourceX:e,sourceY:n,sourcePosition:r=ze.Bottom,targetX:i,targetY:o,targetPosition:s=ze.Top}=t,[a,l]=FA({pos:r,x1:e,y1:n,x2:i,y2:o}),[u,c]=FA({pos:s,x1:i,y1:o,x2:e,y2:n}),[d,h,p,m]=MA({sourceX:e,sourceY:n,targetX:i,targetY:o,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:c});return[`M${e},${n} C${a},${l} ${u},${c} ${i},${o}`,d,h,p,m]}const UA={[ze.Left]:{x:-1,y:0},[ze.Right]:{x:1,y:0},[ze.Top]:{x:0,y:-1},[ze.Bottom]:{x:0,y:1}};function uX({source:t,sourcePosition:e=ze.Bottom,target:n}){return e===ze.Left||e===ze.Right?t.x<n.x?{x:1,y:0}:{x:-1,y:0}:t.y<n.y?{x:0,y:1}:{x:0,y:-1}}function BA(t,e){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function cX({source:t,sourcePosition:e=ze.Bottom,target:n,targetPosition:r=ze.Top,center:i,offset:o}){const s=UA[e],a=UA[r],l={x:t.x+s.x*o,y:t.y+s.y*o},u={x:n.x+a.x*o,y:n.y+a.y*o},c=uX({source:l,sourcePosition:e,target:u}),d=c.x!==0?"x":"y",h=c[d];let p,m,g;const _={x:0,y:0},E={x:0,y:0},[S,y,b,N]=$A({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(s[d]*a[d]===-1){m=i.x??S,g=i.y??y;const O=[{x:m,y:l.y},{x:m,y:u.y}],k=[{x:l.x,y:g},{x:u.x,y:g}];s[d]===h?p=d==="x"?O:k:p=d==="x"?k:O}else{const O=[{x:l.x,y:u.y}],k=[{x:u.x,y:l.y}];if(d==="x"?p=s.x===h?k:O:p=s.y===h?O:k,e===r){const x=Math.abs(t[d]-n[d]);if(x<=o){const I=Math.min(o-1,o-x);s[d]===h?_[d]=(l[d]>t[d]?-1:1)*I:E[d]=(u[d]>n[d]?-1:1)*I}}if(e!==r){const x=d==="x"?"y":"x",I=s[d]===a[x],V=l[x]>u[x],M=l[x]<u[x];(s[d]===1&&(!I&&V||I&&M)||s[d]!==1&&(!I&&M||I&&V))&&(p=d==="x"?O:k)}const w={x:l.x+_.x,y:l.y+_.y},P={x:u.x+E.x,y:u.y+E.y},C=Math.max(Math.abs(w.x-p[0].x),Math.abs(P.x-p[0].x)),v=Math.max(Math.abs(w.y-p[0].y),Math.abs(P.y-p[0].y));C>=v?(m=(w.x+P.x)/2,g=p[0].y):(m=p[0].x,g=(w.y+P.y)/2)}return[[t,{x:l.x+_.x,y:l.y+_.y},...p,{x:u.x+E.x,y:u.y+E.y},n],m,g,b,N]}function dX(t,e,n,r){const i=Math.min(BA(t,e)/2,BA(e,n)/2,r),{x:o,y:s}=e;if(t.x===o&&o===n.x||t.y===s&&s===n.y)return`L${o} ${s}`;if(t.y===s){const u=t.x<n.x?-1:1,c=t.y<n.y?1:-1;return`L ${o+i*u},${s}Q ${o},${s} ${o},${s+i*c}`}const a=t.x<n.x?1:-1,l=t.y<n.y?-1:1;return`L ${o},${s+i*l}Q ${o},${s} ${o+i*a},${s}`}function T0(t){const{sourceX:e,sourceY:n,sourcePosition:r=ze.Bottom,targetX:i,targetY:o,targetPosition:s=ze.Top,borderRadius:a=5,centerX:l,centerY:u,offset:c=20}=t,[d,h,p,m,g]=cX({source:{x:e,y:n},sourcePosition:r,target:{x:i,y:o},targetPosition:s,center:{x:l,y:u},offset:c});return[d.reduce((E,S,y)=>{let b;return y>0&&y<d.length-1?b=dX(d[y-1],S,d[y+1],a):b=`${y===0?"M":"L"}${S.x} ${S.y}`,E+=b,E},""),h,p,m,g]}function fX(t){const{sourceX:e,sourceY:n,targetX:r,targetY:i}=t,[o,s,a,l]=$A({sourceX:e,sourceY:n,targetX:r,targetY:i});return[`M ${e},${n}L ${r},${i}`,o,s,a,l]}const hX=Te({name:"StraightEdge",props:["label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(t,{attrs:e}){return()=>{const[n,r,i]=fX(t);return qe(Pp,{path:n,labelX:r,labelY:i,...e,...t})}}}),jA=Te({name:"SmoothStepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","borderRadius","markerEnd","markerStart","interactionWidth","offset"],compatConfig:{MODE:3},setup(t,{attrs:e}){return()=>{const[n,r,i]=T0({...t,sourcePosition:t.sourcePosition??ze.Bottom,targetPosition:t.targetPosition??ze.Top});return qe(Pp,{path:n,labelX:r,labelY:i,...e,...t})}}}),pX=Te({name:"StepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],setup(t,{attrs:e}){return()=>qe(jA,{...t,...e,borderRadius:0})}}),mX=Te({name:"BezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","curvature","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(t,{attrs:e}){return()=>{const[n,r,i]=VA({...t,sourcePosition:t.sourcePosition??ze.Bottom,targetPosition:t.targetPosition??ze.Top});return qe(Pp,{path:n,labelX:r,labelY:i,...e,...t})}}}),gX=Te({name:"SimpleBezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(t,{attrs:e}){return()=>{const[n,r,i]=zA({...t,sourcePosition:t.sourcePosition??ze.Bottom,targetPosition:t.targetPosition??ze.Top});return qe(Pp,{path:n,labelX:r,labelY:i,...e,...t})}}}),vX={input:nX,default:eX,output:tX},yX={default:mX,straight:hX,step:pX,smoothstep:jA,simplebezier:gX};function bX(t,e,n){const r=Z(()=>g=>e.value.get(g)),i=Z(()=>g=>n.value.get(g)),o=Z(()=>{const g={...yX,...t.edgeTypes},_=Object.keys(g);for(const E of t.edges)E.type&&!_.includes(E.type)&&(g[E.type]=E.type);return g}),s=Z(()=>{const g={...vX,...t.nodeTypes},_=Object.keys(g);for(const E of t.nodes)E.type&&!_.includes(E.type)&&(g[E.type]=E.type);return g}),a=Z(()=>t.onlyRenderVisibleElements?rA(t.nodes,{x:0,y:0,width:t.dimensions.width,height:t.dimensions.height},t.viewport,!0):t.nodes),l=Z(()=>{if(t.onlyRenderVisibleElements){const g=[];for(const _ of t.edges){const E=e.value.get(_.source),S=e.value.get(_.target);EZ({sourcePos:E.computedPosition||{x:0,y:0},targetPos:S.computedPosition||{x:0,y:0},sourceWidth:E.dimensions.width,sourceHeight:E.dimensions.height,targetWidth:S.dimensions.width,targetHeight:S.dimensions.height,width:t.dimensions.width,height:t.dimensions.height,viewport:t.viewport})&&g.push(_)}return g}return t.edges}),u=Z(()=>[...a.value,...l.value]),c=Z(()=>{const g=[];for(const _ of t.nodes)_.selected&&g.push(_);return g}),d=Z(()=>{const g=[];for(const _ of t.edges)_.selected&&g.push(_);return g}),h=Z(()=>[...c.value,...d.value]),p=Z(()=>{const g=[];for(const _ of t.nodes)_.dimensions.width&&_.dimensions.height&&_.handleBounds!==void 0&&g.push(_);return g}),m=Z(()=>a.value.length>0&&p.value.length===a.value.length);return{getNode:r,getEdge:i,getElements:u,getEdgeTypes:o,getNodeTypes:s,getEdges:l,getNodes:a,getSelectedElements:h,getSelectedNodes:c,getSelectedEdges:d,getNodesInitialized:p,areNodesInitialized:m}}class xa{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var e;const n=(e=xn())==null?void 0:e.appContext.app,r=(n==null?void 0:n.config.globalProperties.$vueFlowStorage)??xa.instance;return xa.instance=r??new xa,n&&(n.config.globalProperties.$vueFlowStorage=xa.instance),xa.instance}set(e,n){return this.flows.set(e,n)}get(e){return this.flows.get(e)}remove(e){return this.flows.delete(e)}create(e,n){const r=DA(),i=Da(r),o={};for(const[h,p]of Object.entries(i.hooks)){const m=`on${h.charAt(0).toUpperCase()+h.slice(1)}`;o[m]=p.on}const s={};for(const[h,p]of Object.entries(i.hooks))s[h]=p.trigger;const a=Z(()=>{const h=new Map;for(const p of i.nodes)h.set(p.id,p);return h}),l=Z(()=>{const h=new Map;for(const p of i.edges)h.set(p.id,p);return h}),u=bX(i,a,l),c=QZ(i,a,l);c.setState({...i,...n});const d={...o,...u,...c,...bH(i),nodeLookup:a,edgeLookup:l,emits:s,id:e,vueFlowVersion:"1.48.1",$destroy:()=>{this.remove(e)}};return this.set(e,d),d}getId(){return`vue-flow-${this.currentId++}`}}function Dt(t){const e=xa.getInstance(),n=Id(),r=typeof t=="object",i=r?t:{id:t},o=i.id,s=o??(n==null?void 0:n.vueFlowId);let a;if(n){const l=bt(CA,null);typeof l<"u"&&l!==null&&(!s||l.id===s)&&(a=l)}if(a||s&&(a=e.get(s)),!a||s&&a.id!==s){const l=o??e.getId(),u=e.create(l,i);a=u,(n??Jp(!0)).run(()=>{Qe(u.applyDefault,(d,h,p)=>{const m=_=>{u.applyNodeChanges(_)},g=_=>{u.applyEdgeChanges(_)};d?(u.onNodesChange(m),u.onEdgesChange(g)):(u.hooks.value.nodesChange.off(m),u.hooks.value.edgesChange.off(g)),p(()=>{u.hooks.value.nodesChange.off(m),u.hooks.value.edgesChange.off(g)})},{immediate:!0}),Uc(()=>{if(a){const d=e.get(a.id);d?d.$destroy():od(`No store instance found for id ${a.id} in storage.`)}})})}else r&&a.setState(i);if(n&&(to(CA,a),n.vueFlowId=a.id),r){const l=xn();(l==null?void 0:l.type.name)!=="VueFlow"&&a.emits.error(new Pn(In.USEVUEFLOW_OPTIONS))}return a}function _X(t){const{emits:e,dimensions:n}=Dt();let r;Gt(()=>{const i=()=>{var o,s;if(!t.value||!(((s=(o=t.value).checkVisibility)==null?void 0:s.call(o))??!0))return;const a=bp(t.value);(a.width===0||a.height===0)&&e.error(new Pn(In.MISSING_VIEWPORT_DIMENSIONS)),n.value={width:a.width||500,height:a.height||500}};i(),window.addEventListener("resize",i),t.value&&(r=new ResizeObserver(()=>i()),r.observe(t.value)),Wa(()=>{window.removeEventListener("resize",i),r&&t.value&&r.unobserve(t.value)})})}const xX=Te({...{name:"UserSelection",compatConfig:{MODE:3}},props:{userSelectionRect:{}},setup(t){return(e,n)=>(j(),K("div",{class:"vue-flow__selection vue-flow__container",style:Ze({width:`${e.userSelectionRect.width}px`,height:`${e.userSelectionRect.height}px`,transform:`translate(${e.userSelectionRect.x}px, ${e.userSelectionRect.y}px)`})},null,4))}}),wX=["tabIndex"],SX=Te({...{name:"NodesSelection",compatConfig:{MODE:3}},setup(t){const{emits:e,viewport:n,getSelectedNodes:r,noPanClassName:i,disableKeyboardA11y:o,userSelectionActive:s}=Dt(),a=RA(),l=we(null),u=PA({el:l,onStart(m){e.selectionDragStart(m),e.nodeDragStart(m)},onDrag(m){e.selectionDrag(m),e.nodeDrag(m)},onStop(m){e.selectionDragStop(m),e.nodeDragStop(m)}});Gt(()=>{var m;o.value||(m=l.value)==null||m.focus({preventScroll:!0})});const c=Z(()=>nA(r.value)),d=Z(()=>({width:`${c.value.width}px`,height:`${c.value.height}px`,top:`${c.value.y}px`,left:`${c.value.x}px`}));function h(m){e.selectionContextMenu({event:m,nodes:r.value})}function p(m){o.value||ql[m.key]&&(m.preventDefault(),a({x:ql[m.key].x,y:ql[m.key].y},m.shiftKey))}return(m,g)=>!re(s)&&c.value.width&&c.value.height?(j(),K("div",{key:0,class:Se(["vue-flow__nodesselection vue-flow__container",re(i)]),style:Ze({transform:`translate(${re(n).x}px,${re(n).y}px) scale(${re(n).zoom})`})},[A("div",{ref_key:"el",ref:l,class:Se([{dragging:re(u)},"vue-flow__nodesselection-rect"]),style:Ze(d.value),tabIndex:re(o)?void 0:-1,onContextmenu:h,onKeydown:p},null,46,wX)],6)):Ae("",!0)}});function EX(t,e){return{x:t.clientX-e.left,y:t.clientY-e.top}}const TX=Te({...{name:"Pane",compatConfig:{MODE:3}},props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(t){const{vueFlowRef:e,nodes:n,viewport:r,emits:i,userSelectionActive:o,removeSelectedElements:s,userSelectionRect:a,elementsSelectable:l,nodesSelectionActive:u,getSelectedEdges:c,getSelectedNodes:d,removeNodes:h,removeEdges:p,selectionMode:m,deleteKeyCode:g,multiSelectionKeyCode:_,multiSelectionActive:E,edgeLookup:S,nodeLookup:y,connectionLookup:b,defaultEdgeOptions:N,connectionStartHandle:D,panOnDrag:O}=Dt(),k=Ii(null),w=Ii(new Set),P=Ii(new Set),C=Ii(null),v=Ot(()=>l.value&&(t.isSelecting||o.value)),x=Ot(()=>D.value!==null);let I=!1,V=!1;const M=ed(g,{actInsideInputWithModifier:!1}),H=ed(_);Qe(M,he=>{he&&(h(d.value),p(c.value),u.value=!1)}),Qe(H,he=>{E.value=he});function G(he,de){return pe=>{pe.target===de&&(he==null||he(pe))}}function Y(he){if(I||x.value){I=!1;return}i.paneClick(he),s(),u.value=!1}function se(he){var de;if(Array.isArray(O.value)&&((de=O.value)!=null&&de.includes(2))){he.preventDefault();return}i.paneContextMenu(he)}function ie(he){i.paneScroll(he)}function ue(he){var de,pe,Le;if(C.value=((de=e.value)==null?void 0:de.getBoundingClientRect())??null,!l.value||!t.isSelecting||he.button!==0||he.target!==k.value||!C.value)return;(Le=(pe=he.target)==null?void 0:pe.setPointerCapture)==null||Le.call(pe,he.pointerId);const{x:De,y:Be}=EX(he,C.value);V=!0,I=!1,s(),a.value={width:0,height:0,startX:De,startY:Be,x:De,y:Be},i.selectionStart(he)}function _e(he){var de;if(!C.value||!a.value)return;I=!0;const{x:pe,y:Le}=Zi(he,C.value),{startX:De=0,startY:Be=0}=a.value,et={startX:De,startY:Be,x:pe<De?pe:De,y:Le<Be?Le:Be,width:Math.abs(pe-De),height:Math.abs(Le-Be)},$e=w.value,B=P.value;w.value=new Set(rA(n.value,et,r.value,m.value===d0.Partial,!0).map(L=>L.id)),P.value=new Set;const $=((de=N.value)==null?void 0:de.selectable)??!0;for(const L of w.value){const z=b.value.get(L);if(z)for(const{edgeId:F}of z.values()){const W=S.value.get(F);W&&(W.selectable??$)&&P.value.add(F)}}if(!IA($e,w.value)){const L=vs(y.value,w.value,!0);i.nodesChange(L)}if(!IA(B,P.value)){const L=vs(S.value,P.value);i.edgesChange(L)}a.value=et,o.value=!0,u.value=!1}function Ee(he){var de;he.button!==0||!V||((de=he.target)==null||de.releasePointerCapture(he.pointerId),!o.value&&a.value&&he.target===k.value&&Y(he),o.value=!1,a.value=null,u.value=w.value.size>0,i.selectionEnd(he),t.selectionKeyPressed&&(I=!1),V=!1)}return(he,de)=>(j(),K("div",{ref_key:"container",ref:k,class:Se(["vue-flow__pane vue-flow__container",{selection:he.isSelecting}]),onClick:de[0]||(de[0]=pe=>v.value?void 0:G(Y,k.value)(pe)),onContextmenu:de[1]||(de[1]=pe=>G(se,k.value)(pe)),onWheelPassive:de[2]||(de[2]=pe=>G(ie,k.value)(pe)),onPointerenter:de[3]||(de[3]=pe=>v.value?void 0:re(i).paneMouseEnter(pe)),onPointerdown:de[4]||(de[4]=pe=>v.value?ue(pe):re(i).paneMouseMove(pe)),onPointermove:de[5]||(de[5]=pe=>v.value?_e(pe):re(i).paneMouseMove(pe)),onPointerup:de[6]||(de[6]=pe=>v.value?Ee(pe):void 0),onPointerleave:de[7]||(de[7]=pe=>re(i).paneMouseLeave(pe))},[Mt(he.$slots,"default"),re(o)&&re(a)?(j(),Ne(xX,{key:0,"user-selection-rect":re(a)},null,8,["user-selection-rect"])):Ae("",!0),re(u)&&re(d).length?(j(),Ne(SX,{key:1})):Ae("",!0)],34))}}),IX=Te({...{name:"Transform",compatConfig:{MODE:3}},setup(t){const{viewport:e,fitViewOnInit:n,fitViewOnInitDone:r}=Dt(),i=Z(()=>n.value?!r.value:!1),o=Z(()=>`translate(${e.value.x}px,${e.value.y}px) scale(${e.value.zoom})`);return(s,a)=>(j(),K("div",{class:"vue-flow__transformationpane vue-flow__container",style:Ze({transform:o.value,opacity:i.value?0:void 0})},[Mt(s.$slots,"default")],4))}}),CX=Te({...{name:"Viewport",compatConfig:{MODE:3}},setup(t){const{minZoom:e,maxZoom:n,defaultViewport:r,translateExtent:i,zoomActivationKeyCode:o,selectionKeyCode:s,panActivationKeyCode:a,panOnScroll:l,panOnScrollMode:u,panOnScrollSpeed:c,panOnDrag:d,zoomOnDoubleClick:h,zoomOnPinch:p,zoomOnScroll:m,preventScrolling:g,noWheelClassName:_,noPanClassName:E,emits:S,connectionStartHandle:y,userSelectionActive:b,paneDragging:N,d3Zoom:D,d3Selection:O,d3ZoomHandler:k,viewport:w,viewportRef:P,paneClickDistance:C}=Dt();_X(P);const v=Ii(!1),x=Ii(!1);let I=null,V=!1,M=0,H={x:0,y:0,zoom:0};const G=ed(a),Y=ed(s),se=ed(o),ie=Ot(()=>(!Y.value||Y.value&&s.value===!0)&&(G.value||d.value)),ue=Ot(()=>G.value||l.value),_e=Ot(()=>Y.value||s.value===!0&&ie.value!==!0),Ee=Ot(()=>y.value!==null);Gt(()=>{if(!P.value){od("Viewport element is missing");return}const De=P.value,Be=De.getBoundingClientRect(),et=rZ().clickDistance(C.value).scaleExtent([e.value,n.value]).translateExtent(i.value),$e=_i(De).call(et),B=$e.on("wheel.zoom"),$=Ql.translate(r.value.x??0,r.value.y??0).scale(Ao(r.value.zoom??1,e.value,n.value)),L=[[0,0],[Be.width,Be.height]],z=et.constrain()($,L,i.value);et.transform($e,z),et.wheelDelta(aA),D.value=et,O.value=$e,k.value=B,w.value={x:z.x,y:z.y,zoom:z.k},et.on("start",F=>{var W;if(!F.sourceEvent)return null;M=F.sourceEvent.button,v.value=!0;const ee=pe(F.transform);((W=F.sourceEvent)==null?void 0:W.type)==="mousedown"&&(N.value=!0),H=ee,S.viewportChangeStart(ee),S.moveStart({event:F,flowTransform:ee})}),et.on("end",F=>{if(!F.sourceEvent)return null;if(v.value=!1,N.value=!1,he(ie.value,M??0)&&!V&&S.paneContextMenu(F.sourceEvent),V=!1,de(H,F.transform)){const W=pe(F.transform);H=W,S.viewportChangeEnd(W),S.moveEnd({event:F,flowTransform:W})}}),et.filter(F=>{var W;const ee=se.value||m.value,J=p.value&&F.ctrlKey,te=F.button,Q=F.type==="wheel";if(te===1&&F.type==="mousedown"&&(Le(F,"vue-flow__node")||Le(F,"vue-flow__edge")))return!0;if(!ie.value&&!ee&&!ue.value&&!h.value&&!p.value||b.value||Ee.value&&!Q||!h.value&&F.type==="dblclick"||Le(F,_.value)&&Q||Le(F,E.value)&&(!Q||ue.value&&Q&&!se.value)||!p.value&&F.ctrlKey&&Q||!ee&&!ue.value&&!J&&Q)return!1;if(!p&&F.type==="touchstart"&&((W=F.touches)==null?void 0:W.length)>1)return F.preventDefault(),!1;if(!ie.value&&(F.type==="mousedown"||F.type==="touchstart")||s.value===!0&&Array.isArray(d.value)&&d.value.includes(0)&&te===0||Array.isArray(d.value)&&!d.value.includes(te)&&(F.type==="mousedown"||F.type==="touchstart"))return!1;const ye=Array.isArray(d.value)&&d.value.includes(te)||s.value===!0&&Array.isArray(d.value)&&!d.value.includes(0)||!te||te<=1;return(!F.ctrlKey||G.value||Q)&&ye}),Qe([b,ie],()=>{b.value&&!v.value?et.on("zoom",null):b.value||et.on("zoom",F=>{w.value={x:F.transform.x,y:F.transform.y,zoom:F.transform.k};const W=pe(F.transform);V=he(ie.value,M??0),S.viewportChange(W),S.move({event:F,flowTransform:W})})},{immediate:!0}),Qe([b,ue,u,se,p,g,_],()=>{ue.value&&!se.value&&!b.value?$e.on("wheel.zoom",F=>{if(Le(F,_.value))return!1;const W=se.value||m.value,ee=p.value&&F.ctrlKey;if(!(!g.value||ue.value||W||ee))return!1;F.preventDefault(),F.stopImmediatePropagation();const te=$e.property("__zoom").k||1,Q=xp();if(!G.value&&F.ctrlKey&&p.value&&Q){const rt=Hi(F),gt=aA(F),X=te*2**gt;et.scaleTo($e,X,rt,F);return}const ye=F.deltaMode===1?20:1;let fe=u.value===qc.Vertical?0:F.deltaX*ye,be=u.value===qc.Horizontal?0:F.deltaY*ye;!Q&&F.shiftKey&&u.value!==qc.Vertical&&!fe&&be&&(fe=be,be=0),et.translateBy($e,-(fe/te)*c.value,-(be/te)*c.value);const Me=pe($e.property("__zoom"));I&&clearTimeout(I),x.value?(S.move({event:F,flowTransform:Me}),S.viewportChange(Me),I=setTimeout(()=>{S.moveEnd({event:F,flowTransform:Me}),S.viewportChangeEnd(Me),x.value=!1},150)):(x.value=!0,S.moveStart({event:F,flowTransform:Me}),S.viewportChangeStart(Me))},{passive:!1}):typeof B<"u"&&$e.on("wheel.zoom",function(F,W){const ee=!g.value&&F.type==="wheel"&&!F.ctrlKey,J=se.value||m.value,te=p.value&&F.ctrlKey;if(!J&&!l.value&&!te&&F.type==="wheel"||ee||Le(F,_.value))return null;F.preventDefault(),B.call(this,F,W)},{passive:!1})},{immediate:!0})});function he(De,Be){return Be===2&&Array.isArray(De)&&De.includes(2)}function de(De,Be){return De.x!==Be.x&&!Number.isNaN(Be.x)||De.y!==Be.y&&!Number.isNaN(Be.y)||De.zoom!==Be.k&&!Number.isNaN(Be.k)}function pe(De){return{x:De.x,y:De.y,zoom:De.k}}function Le(De,Be){return De.target.closest(`.${Be}`)}return(De,Be)=>(j(),K("div",{ref_key:"viewportRef",ref:P,class:"vue-flow__viewport vue-flow__container"},[ce(TX,{"is-selecting":_e.value,"selection-key-pressed":re(Y),class:Se({connecting:Ee.value,dragging:re(N),draggable:re(d)===!0||Array.isArray(re(d))&&re(d).includes(0)})},{default:Ce(()=>[ce(IX,null,{default:Ce(()=>[Mt(De.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),AX=["id"],PX=["id"],kX=["id"],OX=Te({...{name:"A11yDescriptions",compatConfig:{MODE:3}},setup(t){const{id:e,disableKeyboardA11y:n,ariaLiveMessage:r}=Dt();return(i,o)=>(j(),K(Ve,null,[A("div",{id:`${re(KC)}-${re(e)}`,style:{display:"none"}}," Press enter or space to select a node. "+Ie(re(n)?"":"You can then use the arrow keys to move the node around.")+" You can then use the arrow keys to move the node around, press delete to remove it and press escape to cancel. ",9,AX),A("div",{id:`${re(ZC)}-${re(e)}`,style:{display:"none"}}," Press enter or space to select an edge. You can then press delete to remove it or press escape to cancel. ",8,PX),re(n)?Ae("",!0):(j(),K("div",{key:0,id:`${re(uZ)}-${re(e)}`,"aria-live":"assertive","aria-atomic":"true",style:{position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)","clip-path":"inset(100%)"}},Ie(re(r)),9,kX))],64))}});function NX(){const t=Dt();Qe(()=>t.viewportHelper.value.viewportInitialized,e=>{e&&setTimeout(()=>{t.emits.init(t),t.emits.paneReady(t)},1)})}function RX(t,e,n){return n===ze.Left?t-e:n===ze.Right?t+e:t}function DX(t,e,n){return n===ze.Top?t-e:n===ze.Bottom?t+e:t}const I0=function({radius:t=10,centerX:e=0,centerY:n=0,position:r=ze.Top,type:i}){return qe("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${i}`,cx:RX(e,t,r),cy:DX(n,t,r),r:t,stroke:"transparent",fill:"transparent"})};I0.props=["radius","centerX","centerY","position","type"],I0.compatConfig={MODE:3};const HA=I0,$X=Te({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(t){const{id:e,addSelectedEdges:n,connectionMode:r,edgeUpdaterRadius:i,emits:o,nodesSelectionActive:s,noPanClassName:a,getEdgeTypes:l,removeSelectedEdges:u,findEdge:c,findNode:d,isValidConnection:h,multiSelectionActive:p,disableKeyboardA11y:m,elementsSelectable:g,edgesUpdatable:_,edgesFocusable:E,hooks:S}=Dt(),y=Z(()=>c(t.id)),{emit:b,on:N}=zZ(y.value,o),D=bt(Sp),O=xn(),k=we(!1),w=we(!1),P=we(""),C=we(null),v=we("source"),x=we(null),I=Ot(()=>typeof y.value.selectable>"u"?g.value:y.value.selectable),V=Ot(()=>typeof y.value.updatable>"u"?_.value:y.value.updatable),M=Ot(()=>typeof y.value.focusable>"u"?E.value:y.value.focusable);to(LZ,t.id),to(VZ,x);const H=Z(()=>y.value.class instanceof Function?y.value.class(y.value):y.value.class),G=Z(()=>y.value.style instanceof Function?y.value.style(y.value):y.value.style),Y=Z(()=>{const L=y.value.type||"default",z=D==null?void 0:D[`edge-${L}`];if(z)return z;let F=y.value.template??l.value[L];if(typeof F=="string"&&O){const W=Object.keys(O.appContext.components);W&&W.includes(L)&&(F=kr(L,!1))}return F&&typeof F!="string"?F:(o.error(new Pn(In.EDGE_TYPE_MISSING,F)),!1)}),{handlePointerDown:se}=OA({nodeId:P,handleId:C,type:v,isValidConnection:h,edgeUpdaterType:v,onEdgeUpdate:_e,onEdgeUpdateEnd:Ee});return()=>{const L=d(y.value.source),z=d(y.value.target),F="pathOptions"in y.value?y.value.pathOptions:{};if(!L&&!z)return o.error(new Pn(In.EDGE_SOURCE_TARGET_MISSING,y.value.id,y.value.source,y.value.target)),null;if(!L)return o.error(new Pn(In.EDGE_SOURCE_MISSING,y.value.id,y.value.source)),null;if(!z)return o.error(new Pn(In.EDGE_TARGET_MISSING,y.value.id,y.value.target)),null;if(!y.value||y.value.hidden||L.hidden||z.hidden)return null;let W;r.value===ps.Strict?W=L.handleBounds.source:W=[...L.handleBounds.source||[],...L.handleBounds.target||[]];const ee=vA(W,y.value.sourceHandle);let J;r.value===ps.Strict?J=z.handleBounds.target:J=[...z.handleBounds.target||[],...z.handleBounds.source||[]];const te=vA(J,y.value.targetHandle),Q=(ee==null?void 0:ee.position)||ze.Bottom,ye=(te==null?void 0:te.position)||ze.Top,{x:fe,y:be}=tu(L,ee,Q),{x:Me,y:rt}=tu(z,te,ye);return y.value.sourceX=fe,y.value.sourceY=be,y.value.targetX=Me,y.value.targetY=rt,qe("g",{ref:x,key:t.id,"data-id":t.id,class:["vue-flow__edge",`vue-flow__edge-${Y.value===!1?"default":y.value.type||"default"}`,a.value,H.value,{updating:k.value,selected:y.value.selected,animated:y.value.animated,inactive:!I.value&&!S.value.edgeClick.hasListeners()}],tabIndex:M.value?0:void 0,"aria-label":y.value.ariaLabel===null?void 0:y.value.ariaLabel??`Edge from ${y.value.source} to ${y.value.target}`,"aria-describedby":M.value?`${ZC}-${e}`:void 0,"aria-roledescription":"edge",role:M.value?"group":"img",...y.value.domAttributes,onClick:de,onContextmenu:pe,onDblclick:Le,onMouseenter:De,onMousemove:Be,onMouseleave:et,onKeyDown:M.value?$:void 0},[w.value?null:qe(Y.value===!1?l.value.default:Y.value,{id:t.id,sourceNode:L,targetNode:z,source:y.value.source,target:y.value.target,type:y.value.type,updatable:V.value,selected:y.value.selected,animated:y.value.animated,label:y.value.label,labelStyle:y.value.labelStyle,labelShowBg:y.value.labelShowBg,labelBgStyle:y.value.labelBgStyle,labelBgPadding:y.value.labelBgPadding,labelBgBorderRadius:y.value.labelBgBorderRadius,data:y.value.data,events:{...y.value.events,...N},style:G.value,markerStart:`url('#${id(y.value.markerStart,e)}')`,markerEnd:`url('#${id(y.value.markerEnd,e)}')`,sourcePosition:Q,targetPosition:ye,sourceX:fe,sourceY:be,targetX:Me,targetY:rt,sourceHandleId:y.value.sourceHandle,targetHandleId:y.value.targetHandle,interactionWidth:y.value.interactionWidth,...F}),[V.value==="source"||V.value===!0?[qe("g",{onMousedown:$e,onMouseenter:ie,onMouseout:ue},qe(HA,{position:Q,centerX:fe,centerY:be,radius:i.value,type:"source","data-type":"source"}))]:null,V.value==="target"||V.value===!0?[qe("g",{onMousedown:B,onMouseenter:ie,onMouseout:ue},qe(HA,{position:ye,centerX:Me,centerY:rt,radius:i.value,type:"target","data-type":"target"}))]:null]])};function ie(){k.value=!0}function ue(){k.value=!1}function _e(L,z){b.update({event:L,edge:y.value,connection:z})}function Ee(L){b.updateEnd({event:L,edge:y.value}),w.value=!1}function he(L,z){L.button===0&&(w.value=!0,P.value=z?y.value.target:y.value.source,C.value=(z?y.value.targetHandle:y.value.sourceHandle)??null,v.value=z?"target":"source",b.updateStart({event:L,edge:y.value}),se(L))}function de(L){var z;const F={event:L,edge:y.value};I.value&&(s.value=!1,y.value.selected&&p.value?(u([y.value]),(z=x.value)==null||z.blur()):n([y.value])),b.click(F)}function pe(L){b.contextMenu({event:L,edge:y.value})}function Le(L){b.doubleClick({event:L,edge:y.value})}function De(L){b.mouseEnter({event:L,edge:y.value})}function Be(L){b.mouseMove({event:L,edge:y.value})}function et(L){b.mouseLeave({event:L,edge:y.value})}function $e(L){he(L,!0)}function B(L){he(L,!1)}function $(L){var z;!m.value&&XC.includes(L.key)&&I.value&&(L.key==="Escape"?((z=x.value)==null||z.blur(),u([c(t.id)])):n([c(t.id)]))}}}),MX=Te({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var t;const{id:e,connectionMode:n,connectionStartHandle:r,connectionEndHandle:i,connectionPosition:o,connectionLineType:s,connectionLineStyle:a,connectionLineOptions:l,connectionStatus:u,viewport:c,findNode:d}=Dt(),h=(t=bt(Sp))==null?void 0:t["connection-line"],p=Z(()=>{var S;return d((S=r.value)==null?void 0:S.nodeId)}),m=Z(()=>{var S;return d((S=i.value)==null?void 0:S.nodeId)??null}),g=Z(()=>({x:(o.value.x-c.value.x)/c.value.zoom,y:(o.value.y-c.value.y)/c.value.zoom})),_=Z(()=>l.value.markerStart?`url(#${id(l.value.markerStart,e)})`:""),E=Z(()=>l.value.markerEnd?`url(#${id(l.value.markerEnd,e)})`:"");return()=>{var S,y,b;if(!p.value||!r.value)return null;const N=r.value.id,D=r.value.type,O=p.value.handleBounds;let k=(O==null?void 0:O[D])??[];if(n.value===ps.Loose){const G=(O==null?void 0:O[D==="source"?"target":"source"])??[];k=[...k,...G]}if(!k)return null;const w=(N?k.find(G=>G.id===N):k[0])??null,P=(w==null?void 0:w.position)??ze.Top,{x:C,y:v}=tu(p.value,w,P);let x=null;m.value&&(n.value===ps.Strict?x=((S=m.value.handleBounds[D==="source"?"target":"source"])==null?void 0:S.find(G=>{var Y;return G.id===((Y=i.value)==null?void 0:Y.id)}))||null:x=((y=[...m.value.handleBounds.source??[],...m.value.handleBounds.target??[]])==null?void 0:y.find(G=>{var Y;return G.id===((Y=i.value)==null?void 0:Y.id)}))||null);const I=((b=i.value)==null?void 0:b.position)??(P?b0[P]:null);if(!P||!I)return null;const V=s.value??l.value.type??ba.Bezier;let M="";const H={sourceX:C,sourceY:v,sourcePosition:P,targetX:g.value.x,targetY:g.value.y,targetPosition:I};return V===ba.Bezier?[M]=VA(H):V===ba.Step?[M]=T0({...H,borderRadius:0}):V===ba.SmoothStep?[M]=T0(H):V===ba.SimpleBezier?[M]=zA(H):M=`M${C},${v} ${g.value.x},${g.value.y}`,qe("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},qe("g",{class:"vue-flow__connection"},h?qe(h,{sourceX:C,sourceY:v,sourcePosition:P,targetX:g.value.x,targetY:g.value.y,targetPosition:I,sourceNode:p.value,sourceHandle:w,targetNode:m.value,targetHandle:x,markerEnd:E.value,markerStart:_.value,connectionStatus:u.value}):qe("path",{d:M,class:[l.value.class,u.value,"vue-flow__connection-path"],style:{...a.value,...l.value.style},"marker-end":E.value,"marker-start":_.value})))}}}),LX=["id","markerWidth","markerHeight","markerUnits","orient"],VX=Te({...{name:"MarkerType",compatConfig:{MODE:3}},props:{id:{},type:{},color:{default:"none"},width:{default:12.5},height:{default:12.5},markerUnits:{default:"strokeWidth"},orient:{default:"auto-start-reverse"},strokeWidth:{default:1}},setup(t){return(e,n)=>(j(),K("marker",{id:e.id,class:"vue-flow__arrowhead",viewBox:"-10 -10 20 20",refX:"0",refY:"0",markerWidth:`${e.width}`,markerHeight:`${e.height}`,markerUnits:e.markerUnits,orient:e.orient},[e.type===re(f0).ArrowClosed?(j(),K("polyline",{key:0,style:Ze({stroke:e.color,fill:e.color,strokeWidth:e.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",points:"-5,-4 0,0 -5,4 -5,-4"},null,4)):Ae("",!0),e.type===re(f0).Arrow?(j(),K("polyline",{key:1,style:Ze({stroke:e.color,strokeWidth:e.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",fill:"none",points:"-5,-4 0,0 -5,4"},null,4)):Ae("",!0)],8,LX))}}),FX={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},zX=Te({...{name:"MarkerDefinitions",compatConfig:{MODE:3}},setup(t){const{id:e,edges:n,connectionLineOptions:r,defaultMarkerColor:i}=Dt(),o=Z(()=>{const s=new Set,a=[],l=u=>{if(u){const c=id(u,e);s.has(c)||(typeof u=="object"?a.push({...u,id:c,color:u.color||i.value}):a.push({id:c,color:i.value,type:u}),s.add(c))}};for(const u of[r.value.markerEnd,r.value.markerStart])l(u);for(const u of n.value)for(const c of[u.markerStart,u.markerEnd])l(c);return a.sort((u,c)=>u.id.localeCompare(c.id))});return(s,a)=>(j(),K("svg",FX,[A("defs",null,[(j(!0),K(Ve,null,It(o.value,l=>(j(),Ne(VX,{id:l.id,key:l.id,type:l.type,color:l.color,width:l.width,height:l.height,markerUnits:l.markerUnits,"stroke-width":l.strokeWidth,orient:l.orient},null,8,["id","type","color","width","height","markerUnits","stroke-width","orient"]))),128))])]))}}),UX=Te({...{name:"Edges",compatConfig:{MODE:3}},setup(t){const{findNode:e,getEdges:n,elevateEdgesOnSelect:r}=Dt();return(i,o)=>(j(),K(Ve,null,[ce(zX),(j(!0),K(Ve,null,It(re(n),s=>(j(),K("svg",{key:s.id,class:"vue-flow__edges vue-flow__container",style:Ze({zIndex:re(TZ)(s,re(e),re(r))})},[ce(re($X),{id:s.id},null,8,["id"])],4))),128)),ce(re(MX))],64))}}),BX=Te({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(t){const{id:e,noPanClassName:n,selectNodesOnDrag:r,nodesSelectionActive:i,multiSelectionActive:o,emits:s,removeSelectedNodes:a,addSelectedNodes:l,updateNodeDimensions:u,onUpdateNodeInternals:c,getNodeTypes:d,nodeExtent:h,elevateNodesOnSelect:p,disableKeyboardA11y:m,ariaLiveMessage:g,snapToGrid:_,snapGrid:E,nodeDragThreshold:S,nodesDraggable:y,elementsSelectable:b,nodesConnectable:N,nodesFocusable:D,hooks:O}=Dt(),k=we(null);to(AA,k),to(S0,t.id);const w=bt(Sp),P=xn(),C=RA(),{node:v,parentNode:x}=NA(t.id),{emit:I,on:V}=jZ(v,s),M=Ot(()=>typeof v.draggable>"u"?y.value:v.draggable),H=Ot(()=>typeof v.selectable>"u"?b.value:v.selectable),G=Ot(()=>typeof v.connectable>"u"?N.value:v.connectable),Y=Ot(()=>typeof v.focusable>"u"?D.value:v.focusable),se=Z(()=>H.value||M.value||O.value.nodeClick.hasListeners()||O.value.nodeDoubleClick.hasListeners()||O.value.nodeMouseEnter.hasListeners()||O.value.nodeMouseMove.hasListeners()||O.value.nodeMouseLeave.hasListeners()),ie=Ot(()=>!!v.dimensions.width&&!!v.dimensions.height),ue=Z(()=>{const z=v.type||"default",F=w==null?void 0:w[`node-${z}`];if(F)return F;let W=v.template||d.value[z];if(typeof W=="string"&&P){const ee=Object.keys(P.appContext.components);ee&&ee.includes(z)&&(W=kr(z,!1))}return W&&typeof W!="string"?W:(s.error(new Pn(In.NODE_TYPE_MISSING,W)),!1)}),_e=PA({id:t.id,el:k,disabled:()=>!M.value,selectable:H,dragHandle:()=>v.dragHandle,onStart(z){I.dragStart(z)},onDrag(z){I.drag(z)},onStop(z){I.dragStop(z)},onClick(z){$(z)}}),Ee=Z(()=>v.class instanceof Function?v.class(v):v.class),he=Z(()=>{const z=(v.style instanceof Function?v.style(v):v.style)||{},F=v.width instanceof Function?v.width(v):v.width,W=v.height instanceof Function?v.height(v):v.height;return!z.width&&F&&(z.width=typeof F=="string"?F:`${F}px`),!z.height&&W&&(z.height=typeof W=="string"?W:`${W}px`),z}),de=Ot(()=>Number(v.zIndex??he.value.zIndex??0));return c(z=>{(z.includes(t.id)||!z.length)&&Le()}),Gt(()=>{Qe(()=>v.hidden,(z=!1,F,W)=>{!z&&k.value&&(t.resizeObserver.observe(k.value),W(()=>{k.value&&t.resizeObserver.unobserve(k.value)}))},{immediate:!0,flush:"post"})}),Qe([()=>v.type,()=>v.sourcePosition,()=>v.targetPosition],()=>{mr(()=>{u([{id:t.id,nodeElement:k.value,forceUpdate:!0}])})}),Qe([()=>v.position.x,()=>v.position.y,()=>{var z;return(z=x.value)==null?void 0:z.computedPosition.x},()=>{var z;return(z=x.value)==null?void 0:z.computedPosition.y},()=>{var z;return(z=x.value)==null?void 0:z.computedPosition.z},de,()=>v.selected,()=>v.dimensions.height,()=>v.dimensions.width,()=>{var z;return(z=x.value)==null?void 0:z.dimensions.height},()=>{var z;return(z=x.value)==null?void 0:z.dimensions.width}],([z,F,W,ee,J,te])=>{const Q={x:z,y:F,z:te+(p.value&&v.selected?1e3:0)};typeof W<"u"&&typeof ee<"u"?v.computedPosition=bZ({x:W,y:ee,z:J},Q):v.computedPosition=Q},{flush:"post",immediate:!0}),Qe([()=>v.extent,h],([z,F],[W,ee])=>{(z!==W||F!==ee)&&pe()}),v.extent==="parent"||typeof v.extent=="object"&&"range"in v.extent&&v.extent.range==="parent"?Hy(()=>ie).toBe(!0).then(pe):pe(),()=>v.hidden?null:qe("div",{ref:k,"data-id":v.id,class:["vue-flow__node",`vue-flow__node-${ue.value===!1?"default":v.type||"default"}`,{[n.value]:M.value,dragging:_e==null?void 0:_e.value,draggable:M.value,selected:v.selected,selectable:H.value,parent:v.isParent},Ee.value],style:{visibility:ie.value?"visible":"hidden",zIndex:v.computedPosition.z??de.value,transform:`translate(${v.computedPosition.x}px,${v.computedPosition.y}px)`,pointerEvents:se.value?"all":"none",...he.value},tabIndex:Y.value?0:void 0,role:Y.value?"group":void 0,"aria-describedby":m.value?void 0:`${KC}-${e}`,"aria-label":v.ariaLabel,"aria-roledescription":"node",...v.domAttributes,onMouseenter:De,onMousemove:Be,onMouseleave:et,onContextmenu:$e,onClick:$,onDblclick:B,onKeydown:L},[qe(ue.value===!1?d.value.default:ue.value,{id:v.id,type:v.type,data:v.data,events:{...v.events,...V},selected:v.selected,resizing:v.resizing,dragging:_e.value,connectable:G.value,position:v.computedPosition,dimensions:v.dimensions,isValidTargetPos:v.isValidTargetPos,isValidSourcePos:v.isValidSourcePos,parent:v.parentNode,parentNodeId:v.parentNode,zIndex:v.computedPosition.z??de.value,targetPosition:v.targetPosition,sourcePosition:v.sourcePosition,label:v.label,dragHandle:v.dragHandle,onUpdateNodeInternals:Le})]);function pe(){const z=v.computedPosition,{computedPosition:F,position:W}=g0(v,_.value?wp(z,E.value):z,s.error,h.value,x.value);(v.computedPosition.x!==F.x||v.computedPosition.y!==F.y)&&(v.computedPosition={...v.computedPosition,...F}),(v.position.x!==W.x||v.position.y!==W.y)&&(v.position=W)}function Le(){k.value&&u([{id:t.id,nodeElement:k.value,forceUpdate:!0}])}function De(z){_e!=null&&_e.value||I.mouseEnter({event:z,node:v})}function Be(z){_e!=null&&_e.value||I.mouseMove({event:z,node:v})}function et(z){_e!=null&&_e.value||I.mouseLeave({event:z,node:v})}function $e(z){return I.contextMenu({event:z,node:v})}function B(z){return I.doubleClick({event:z,node:v})}function $(z){H.value&&(!r.value||!M.value||S.value>0)&&_0(v,o.value,l,a,i,!1,k.value),I.click({event:z,node:v})}function L(z){if(!(h0(z)||m.value))if(XC.includes(z.key)&&H.value){const F=z.key==="Escape";_0(v,o.value,l,a,i,F,k.value)}else M.value&&v.selected&&ql[z.key]&&(z.preventDefault(),g.value=`Moved selected node ${z.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~v.position.x}, y: ${~~v.position.y}`,C({x:ql[z.key].x,y:ql[z.key].y},z.shiftKey))}}});function jX(t={includeHiddenNodes:!1}){const{nodes:e}=Dt();return Z(()=>{if(e.value.length===0)return!1;for(const n of e.value)if((t.includeHiddenNodes||!n.hidden)&&((n==null?void 0:n.handleBounds)===void 0||n.dimensions.width===0||n.dimensions.height===0))return!1;return!0})}const HX={class:"vue-flow__nodes vue-flow__container"},GX=Te({...{name:"Nodes",compatConfig:{MODE:3}},setup(t){const{getNodes:e,updateNodeDimensions:n,emits:r}=Dt(),i=jX(),o=we();return Qe(i,s=>{s&&mr(()=>{r.nodesInitialized(e.value)})},{immediate:!0}),Gt(()=>{o.value=new ResizeObserver(s=>{const a=s.map(l=>({id:l.target.getAttribute("data-id"),nodeElement:l.target,forceUpdate:!0}));mr(()=>n(a))})}),Wa(()=>{var s;return(s=o.value)==null?void 0:s.disconnect()}),(s,a)=>(j(),K("div",HX,[o.value?(j(!0),K(Ve,{key:0},It(re(e),(l,u,c,d)=>{const h=[l.id];if(d&&d.key===l.id&&zm(d,h))return d;const p=(j(),Ne(re(BX),{id:l.id,key:l.id,"resize-observer":o.value},null,8,["id","resize-observer"]));return p.memo=h,p},a,0),128)):Ae("",!0)]))}});function WX(){const{emits:t}=Dt();Gt(()=>{if(wA()){const e=document.querySelector(".vue-flow__pane");e&&window.getComputedStyle(e).zIndex!=="1"&&t.error(new Pn(In.MISSING_STYLES))}})}const KX=A("div",{class:"vue-flow__edge-labels"},null,-1),ZX=Te({...{name:"VueFlow",compatConfig:{MODE:3}},props:{id:{},modelValue:{},nodes:{},edges:{},edgeTypes:{},nodeTypes:{},connectionMode:{},connectionLineType:{},connectionLineStyle:{default:void 0},connectionLineOptions:{default:void 0},connectionRadius:{},isValidConnection:{type:[Function,null],default:void 0},deleteKeyCode:{default:void 0},selectionKeyCode:{type:[Boolean,null],default:void 0},multiSelectionKeyCode:{default:void 0},zoomActivationKeyCode:{default:void 0},panActivationKeyCode:{default:void 0},snapToGrid:{type:Boolean,default:void 0},snapGrid:{},onlyRenderVisibleElements:{type:Boolean,default:void 0},edgesUpdatable:{type:[Boolean,String],default:void 0},nodesDraggable:{type:Boolean,default:void 0},nodesConnectable:{type:Boolean,default:void 0},nodeDragThreshold:{},elementsSelectable:{type:Boolean,default:void 0},selectNodesOnDrag:{type:Boolean,default:void 0},panOnDrag:{type:[Boolean,Array],default:void 0},minZoom:{},maxZoom:{},defaultViewport:{},translateExtent:{},nodeExtent:{},defaultMarkerColor:{},zoomOnScroll:{type:Boolean,default:void 0},zoomOnPinch:{type:Boolean,default:void 0},panOnScroll:{type:Boolean,default:void 0},panOnScrollSpeed:{},panOnScrollMode:{},paneClickDistance:{},zoomOnDoubleClick:{type:Boolean,default:void 0},preventScrolling:{type:Boolean,default:void 0},selectionMode:{},edgeUpdaterRadius:{},fitViewOnInit:{type:Boolean,default:void 0},connectOnClick:{type:Boolean,default:void 0},applyDefault:{type:Boolean,default:void 0},autoConnect:{type:[Boolean,Function],default:void 0},noDragClassName:{},noWheelClassName:{},noPanClassName:{},defaultEdgeOptions:{},elevateEdgesOnSelect:{type:Boolean,default:void 0},elevateNodesOnSelect:{type:Boolean,default:void 0},disableKeyboardA11y:{type:Boolean,default:void 0},edgesFocusable:{type:Boolean,default:void 0},nodesFocusable:{type:Boolean,default:void 0},autoPanOnConnect:{type:Boolean,default:void 0},autoPanOnNodeDrag:{type:Boolean,default:void 0},autoPanSpeed:{}},emits:["nodesChange","edgesChange","nodesInitialized","paneReady","init","updateNodeInternals","error","connect","connectStart","connectEnd","clickConnectStart","clickConnectEnd","moveStart","move","moveEnd","selectionDragStart","selectionDrag","selectionDragStop","selectionContextMenu","selectionStart","selectionEnd","viewportChangeStart","viewportChange","viewportChangeEnd","paneScroll","paneClick","paneContextMenu","paneMouseEnter","paneMouseMove","paneMouseLeave","edgeUpdate","edgeContextMenu","edgeMouseEnter","edgeMouseMove","edgeMouseLeave","edgeDoubleClick","edgeClick","edgeUpdateStart","edgeUpdateEnd","nodeContextMenu","nodeMouseEnter","nodeMouseMove","nodeMouseLeave","nodeDoubleClick","nodeClick","nodeDragStart","nodeDrag","nodeDragStop","miniMapNodeClick","miniMapNodeDoubleClick","miniMapNodeMouseEnter","miniMapNodeMouseMove","miniMapNodeMouseLeave","update:modelValue","update:nodes","update:edges"],setup(t,{expose:e,emit:n}){const r=t,i=i_(),o=Gy(r,"modelValue",n),s=Gy(r,"nodes",n),a=Gy(r,"edges",n),l=Dt(r),u=KZ({modelValue:o,nodes:s,edges:a},r,l);return XZ(n,l.hooks),NX(),WX(),to(Sp,i),lr(u),e(l),(c,d)=>(j(),K("div",{ref:re(l).vueFlowRef,class:"vue-flow"},[ce(CX,null,{default:Ce(()=>[ce(UX),KX,ce(GX),Mt(c.$slots,"zoom-pane")]),_:3}),Mt(c.$slots,"default"),ce(OX)],512))}}),XX=Te({...{name:"Panel",compatConfig:{MODE:3}},props:{position:{}},setup(t){const e=t,{userSelectionActive:n}=Dt(),r=Z(()=>`${e.position}`.split("-"));return(i,o)=>(j(),K("div",{class:Se(["vue-flow__panel",r.value]),style:Ze({pointerEvents:re(n)?"none":"all"})},[Mt(i.$slots,"default")],6))}}),YX={name:"ControlButton",compatConfig:{MODE:3}},JX=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},QX={type:"button",class:"vue-flow__controls-button"};function qX(t,e,n,r,i,o){return j(),K("button",QX,[Mt(t.$slots,"default")])}const Op=JX(YX,[["render",qX]]),eY={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},tY=[A("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"},null,-1)];function nY(t,e){return j(),K("svg",eY,tY)}const rY={render:nY},iY={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},oY=[A("path",{d:"M0 0h32v4.2H0z"},null,-1)];function sY(t,e){return j(),K("svg",iY,oY)}const aY={render:sY},lY={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},uY=[A("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0 0 27.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94a.919.919 0 0 1-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"},null,-1)];function cY(t,e){return j(),K("svg",lY,uY)}const dY={render:cY},fY={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},hY=[A("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"},null,-1)];function pY(t,e){return j(),K("svg",fY,hY)}const mY={render:pY},gY={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},vY=[A("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047z"},null,-1)];function yY(t,e){return j(),K("svg",gY,vY)}const bY={render:yY},_Y=Te({...{name:"Controls",compatConfig:{MODE:3}},props:{showZoom:{type:Boolean,default:!0},showFitView:{type:Boolean,default:!0},showInteractive:{type:Boolean,default:!0},fitViewParams:{},position:{default:()=>GC.BottomLeft}},emits:["zoomIn","zoomOut","fitView","interactionChange"],setup(t,{emit:e}){const{nodesDraggable:n,nodesConnectable:r,elementsSelectable:i,setInteractive:o,zoomIn:s,zoomOut:a,fitView:l,viewport:u,minZoom:c,maxZoom:d}=Dt(),h=Ot(()=>n.value||r.value||i.value),p=Ot(()=>u.value.zoom<=c.value),m=Ot(()=>u.value.zoom>=d.value);function g(){s(),e("zoomIn")}function _(){a(),e("zoomOut")}function E(){l(t.fitViewParams),e("fitView")}function S(){o(!h.value),e("interactionChange",!h.value)}return(y,b)=>(j(),Ne(re(XX),{class:"vue-flow__controls",position:y.position},{default:Ce(()=>[Mt(y.$slots,"top"),y.showZoom?(j(),K(Ve,{key:0},[Mt(y.$slots,"control-zoom-in",{},()=>[ce(Op,{class:"vue-flow__controls-zoomin",disabled:m.value,onClick:g},{default:Ce(()=>[Mt(y.$slots,"icon-zoom-in",{},()=>[(j(),Ne(Jn(re(rY))))])]),_:3},8,["disabled"])]),Mt(y.$slots,"control-zoom-out",{},()=>[ce(Op,{class:"vue-flow__controls-zoomout",disabled:p.value,onClick:_},{default:Ce(()=>[Mt(y.$slots,"icon-zoom-out",{},()=>[(j(),Ne(Jn(re(aY))))])]),_:3},8,["disabled"])])],64)):Ae("",!0),y.showFitView?Mt(y.$slots,"control-fit-view",{key:1},()=>[ce(Op,{class:"vue-flow__controls-fitview",onClick:E},{default:Ce(()=>[Mt(y.$slots,"icon-fit-view",{},()=>[(j(),Ne(Jn(re(dY))))])]),_:3})]):Ae("",!0),y.showInteractive?Mt(y.$slots,"control-interactive",{key:2},()=>[y.showInteractive?(j(),Ne(Op,{key:0,class:"vue-flow__controls-interactive",onClick:S},{default:Ce(()=>[h.value?Mt(y.$slots,"icon-unlock",{key:0},()=>[(j(),Ne(Jn(re(bY))))]):Ae("",!0),h.value?Ae("",!0):Mt(y.$slots,"icon-lock",{key:1},()=>[(j(),Ne(Jn(re(mY))))])]),_:3})):Ae("",!0)]):Ae("",!0),Mt(y.$slots,"default")]),_:3},8,["position"]))}});var C0="http://www.w3.org/1999/xhtml";const GA={svg:"http://www.w3.org/2000/svg",xhtml:C0,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function WA(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),GA.hasOwnProperty(e)?{space:GA[e],local:t}:t}function xY(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===C0&&e.documentElement.namespaceURI===C0?e.createElement(t):e.createElementNS(n,t)}}function wY(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function KA(t){var e=WA(t);return(e.local?wY:xY)(e)}function SY(){}function ZA(t){return t==null?SY:function(){return this.querySelector(t)}}function EY(t){typeof t!="function"&&(t=ZA(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,a=r[i]=new Array(s),l,u,c=0;c<s;++c)(l=o[c])&&(u=t.call(l,l.__data__,c,o))&&("__data__"in l&&(u.__data__=l.__data__),a[c]=u);return new ti(r,this._parents)}function TY(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function IY(){return[]}function CY(t){return t==null?IY:function(){return this.querySelectorAll(t)}}function AY(t){return function(){return TY(t.apply(this,arguments))}}function PY(t){typeof t=="function"?t=AY(t):t=CY(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var s=e[o],a=s.length,l,u=0;u<a;++u)(l=s[u])&&(r.push(t.call(l,l.__data__,u,s)),i.push(l));return new ti(r,i)}function kY(t){return function(){return this.matches(t)}}function XA(t){return function(e){return e.matches(t)}}var OY=Array.prototype.find;function NY(t){return function(){return OY.call(this.children,t)}}function RY(){return this.firstElementChild}function DY(t){return this.select(t==null?RY:NY(typeof t=="function"?t:XA(t)))}var $Y=Array.prototype.filter;function MY(){return Array.from(this.children)}function LY(t){return function(){return $Y.call(this.children,t)}}function VY(t){return this.selectAll(t==null?MY:LY(typeof t=="function"?t:XA(t)))}function FY(t){typeof t!="function"&&(t=kY(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,a=r[i]=[],l,u=0;u<s;++u)(l=o[u])&&t.call(l,l.__data__,u,o)&&a.push(l);return new ti(r,this._parents)}function YA(t){return new Array(t.length)}function zY(){return new ti(this._enter||this._groups.map(YA),this._parents)}function Np(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Np.prototype={constructor:Np,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function UY(t){return function(){return t}}function BY(t,e,n,r,i,o){for(var s=0,a,l=e.length,u=o.length;s<u;++s)(a=e[s])?(a.__data__=o[s],r[s]=a):n[s]=new Np(t,o[s]);for(;s<l;++s)(a=e[s])&&(i[s]=a)}function jY(t,e,n,r,i,o,s){var a,l,u=new Map,c=e.length,d=o.length,h=new Array(c),p;for(a=0;a<c;++a)(l=e[a])&&(h[a]=p=s.call(l,l.__data__,a,e)+"",u.has(p)?i[a]=l:u.set(p,l));for(a=0;a<d;++a)p=s.call(t,o[a],a,o)+"",(l=u.get(p))?(r[a]=l,l.__data__=o[a],u.delete(p)):n[a]=new Np(t,o[a]);for(a=0;a<c;++a)(l=e[a])&&u.get(h[a])===l&&(i[a]=l)}function HY(t){return t.__data__}function GY(t,e){if(!arguments.length)return Array.from(this,HY);var n=e?jY:BY,r=this._parents,i=this._groups;typeof t!="function"&&(t=UY(t));for(var o=i.length,s=new Array(o),a=new Array(o),l=new Array(o),u=0;u<o;++u){var c=r[u],d=i[u],h=d.length,p=WY(t.call(c,c&&c.__data__,u,r)),m=p.length,g=a[u]=new Array(m),_=s[u]=new Array(m),E=l[u]=new Array(h);n(c,d,g,_,E,p,e);for(var S=0,y=0,b,N;S<m;++S)if(b=g[S]){for(S>=y&&(y=S+1);!(N=_[y])&&++y<m;);b._next=N||null}}return s=new ti(s,r),s._enter=a,s._exit=l,s}function WY(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function KY(){return new ti(this._exit||this._groups.map(YA),this._parents)}function ZY(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function XY(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,s=Math.min(i,o),a=new Array(i),l=0;l<s;++l)for(var u=n[l],c=r[l],d=u.length,h=a[l]=new Array(d),p,m=0;m<d;++m)(p=u[m]||c[m])&&(h[m]=p);for(;l<i;++l)a[l]=n[l];return new ti(a,this._parents)}function YY(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],s;--i>=0;)(s=r[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function JY(t){t||(t=QY);function e(d,h){return d&&h?t(d.__data__,h.__data__):!d-!h}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var s=n[o],a=s.length,l=i[o]=new Array(a),u,c=0;c<a;++c)(u=s[c])&&(l[c]=u);l.sort(e)}return new ti(i,this._parents).order()}function QY(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function qY(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function eJ(){return Array.from(this)}function tJ(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null}function nJ(){let t=0;for(const e of this)++t;return t}function rJ(){return!this.node()}function iJ(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,s=i.length,a;o<s;++o)(a=i[o])&&t.call(a,a.__data__,o,i);return this}function oJ(t){return function(){this.removeAttribute(t)}}function sJ(t){return function(){this.removeAttributeNS(t.space,t.local)}}function aJ(t,e){return function(){this.setAttribute(t,e)}}function lJ(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function uJ(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function cJ(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function dJ(t,e){var n=WA(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?sJ:oJ:typeof e=="function"?n.local?cJ:uJ:n.local?lJ:aJ)(n,e))}function JA(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function fJ(t){return function(){this.style.removeProperty(t)}}function hJ(t,e,n){return function(){this.style.setProperty(t,e,n)}}function pJ(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function mJ(t,e,n){return arguments.length>1?this.each((e==null?fJ:typeof e=="function"?pJ:hJ)(t,e,n??"")):gJ(this.node(),t)}function gJ(t,e){return t.style.getPropertyValue(e)||JA(t).getComputedStyle(t,null).getPropertyValue(e)}function vJ(t){return function(){delete this[t]}}function yJ(t,e){return function(){this[t]=e}}function bJ(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function _J(t,e){return arguments.length>1?this.each((e==null?vJ:typeof e=="function"?bJ:yJ)(t,e)):this.node()[t]}function QA(t){return t.trim().split(/^|\s+/)}function A0(t){return t.classList||new qA(t)}function qA(t){this._node=t,this._names=QA(t.getAttribute("class")||"")}qA.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function eP(t,e){for(var n=A0(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function tP(t,e){for(var n=A0(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function xJ(t){return function(){eP(this,t)}}function wJ(t){return function(){tP(this,t)}}function SJ(t,e){return function(){(e.apply(this,arguments)?eP:tP)(this,t)}}function EJ(t,e){var n=QA(t+"");if(arguments.length<2){for(var r=A0(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?SJ:e?xJ:wJ)(n,e))}function TJ(){this.textContent=""}function IJ(t){return function(){this.textContent=t}}function CJ(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function AJ(t){return arguments.length?this.each(t==null?TJ:(typeof t=="function"?CJ:IJ)(t)):this.node().textContent}function PJ(){this.innerHTML=""}function kJ(t){return function(){this.innerHTML=t}}function OJ(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function NJ(t){return arguments.length?this.each(t==null?PJ:(typeof t=="function"?OJ:kJ)(t)):this.node().innerHTML}function RJ(){this.nextSibling&&this.parentNode.appendChild(this)}function DJ(){return this.each(RJ)}function $J(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function MJ(){return this.each($J)}function LJ(t){var e=typeof t=="function"?t:KA(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function VJ(){return null}function FJ(t,e){var n=typeof t=="function"?t:KA(t),r=e==null?VJ:typeof e=="function"?e:ZA(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function zJ(){var t=this.parentNode;t&&t.removeChild(this)}function UJ(){return this.each(zJ)}function BJ(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function jJ(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function HJ(t){return this.select(t?jJ:BJ)}function GJ(t){return arguments.length?this.property("__data__",t):this.node().__data__}function WJ(t){return function(e){t.call(this,e,this.__data__)}}function KJ(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function ZJ(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function XJ(t,e,n){return function(){var r=this.__on,i,o=WJ(e);if(r){for(var s=0,a=r.length;s<a;++s)if((i=r[s]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function YJ(t,e,n){var r=KJ(t+""),i,o=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,u=a.length,c;l<u;++l)for(i=0,c=a[l];i<o;++i)if((s=r[i]).type===c.type&&s.name===c.name)return c.value}return}for(a=e?XJ:ZJ,i=0;i<o;++i)this.each(a(r[i],e,n));return this}function nP(t,e,n){var r=JA(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function JJ(t,e){return function(){return nP(this,t,e)}}function QJ(t,e){return function(){return nP(this,t,e.apply(this,arguments))}}function qJ(t,e){return this.each((typeof e=="function"?QJ:JJ)(t,e))}function*eQ(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,s;i<o;++i)(s=r[i])&&(yield s)}var tQ=[null];function ti(t,e){this._groups=t,this._parents=e}function nQ(){return this}ti.prototype={constructor:ti,select:EY,selectAll:PY,selectChild:DY,selectChildren:VY,filter:FY,data:GY,enter:zY,exit:KY,join:ZY,merge:XY,selection:nQ,order:YY,sort:JY,call:qY,nodes:eJ,node:tJ,size:nJ,empty:rJ,each:iJ,attr:dJ,style:mJ,property:_J,classed:EJ,text:AJ,html:NJ,raise:DJ,lower:MJ,append:LJ,insert:FJ,remove:UJ,clone:HJ,datum:GJ,on:YJ,dispatch:qJ,[Symbol.iterator]:eQ};function sd(t){return typeof t=="string"?new ti([[document.querySelector(t)]],[document.documentElement]):new ti([[t]],tQ)}function rQ(t){let e;for(;e=t.sourceEvent;)t=e;return t}function rP(t,e){if(t=rQ(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}var iQ={value:()=>{}};function iP(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Rp(n)}function Rp(t){this._=t}function oQ(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Rp.prototype=iP.prototype={constructor:Rp,on:function(t,e){var n=this._,r=oQ(t+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(t=r[o]).type)&&(i=sQ(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<s;)if(i=(t=r[o]).type)n[i]=oP(n[i],t.name,e);else if(e==null)for(i in n)n[i]=oP(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Rp(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function sQ(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function oP(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=iQ,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}const aQ={passive:!1},ad={capture:!0,passive:!1};function P0(t){t.stopImmediatePropagation()}function nu(t){t.preventDefault(),t.stopImmediatePropagation()}function lQ(t){var e=t.document.documentElement,n=sd(t).on("dragstart.drag",nu,ad);"onselectstart"in e?n.on("selectstart.drag",nu,ad):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function uQ(t,e){var n=t.document.documentElement,r=sd(t).on("dragstart.drag",null);e&&(r.on("click.drag",nu,ad),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Dp=t=>()=>t;function k0(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:o,x:s,y:a,dx:l,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}k0.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function cQ(t){return!t.ctrlKey&&!t.button}function dQ(){return this.parentNode}function fQ(t,e){return e??{x:t.x,y:t.y}}function hQ(){return navigator.maxTouchPoints||"ontouchstart"in this}function pQ(){var t=cQ,e=dQ,n=fQ,r=hQ,i={},o=iP("start","drag","end"),s=0,a,l,u,c,d=0;function h(b){b.on("mousedown.drag",p).filter(r).on("touchstart.drag",_).on("touchmove.drag",E,aQ).on("touchend.drag touchcancel.drag",S).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(b,N){if(!(c||!t.call(this,b,N))){var D=y(this,e.call(this,b,N),b,N,"mouse");D&&(sd(b.view).on("mousemove.drag",m,ad).on("mouseup.drag",g,ad),lQ(b.view),P0(b),u=!1,a=b.clientX,l=b.clientY,D("start",b))}}function m(b){if(nu(b),!u){var N=b.clientX-a,D=b.clientY-l;u=N*N+D*D>d}i.mouse("drag",b)}function g(b){sd(b.view).on("mousemove.drag mouseup.drag",null),uQ(b.view,u),nu(b),i.mouse("end",b)}function _(b,N){if(t.call(this,b,N)){var D=b.changedTouches,O=e.call(this,b,N),k=D.length,w,P;for(w=0;w<k;++w)(P=y(this,O,b,N,D[w].identifier,D[w]))&&(P0(b),P("start",b,D[w]))}}function E(b){var N=b.changedTouches,D=N.length,O,k;for(O=0;O<D;++O)(k=i[N[O].identifier])&&(nu(b),k("drag",b,N[O]))}function S(b){var N=b.changedTouches,D=N.length,O,k;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),O=0;O<D;++O)(k=i[N[O].identifier])&&(P0(b),k("end",b,N[O]))}function y(b,N,D,O,k,w){var P=o.copy(),C=rP(w||D,N),v,x,I;if((I=n.call(b,new k0("beforestart",{sourceEvent:D,target:h,identifier:k,active:s,x:C[0],y:C[1],dx:0,dy:0,dispatch:P}),O))!=null)return v=I.x-C[0]||0,x=I.y-C[1]||0,function V(M,H,G){var Y=C,se;switch(M){case"start":i[k]=V,se=s++;break;case"end":delete i[k],--s;case"drag":C=rP(G||H,N),se=s;break}P.call(M,b,new k0(M,{sourceEvent:H,subject:I,target:h,identifier:k,active:se,x:C[0]+v,y:C[1]+x,dx:C[0]-Y[0],dy:C[1]-Y[1],dispatch:P}),O)}}return h.filter=function(b){return arguments.length?(t=typeof b=="function"?b:Dp(!!b),h):t},h.container=function(b){return arguments.length?(e=typeof b=="function"?b:Dp(b),h):e},h.subject=function(b){return arguments.length?(n=typeof b=="function"?b:Dp(b),h):n},h.touchable=function(b){return arguments.length?(r=typeof b=="function"?b:Dp(!!b),h):r},h.on=function(){var b=o.on.apply(o,arguments);return b===o?h:b},h.clickDistance=function(b){return arguments.length?(d=(b=+b)*b,h):Math.sqrt(d)},h}var wa=(t=>(t.Line="line",t.Handle="handle",t))(wa||{});function mQ({width:t,prevWidth:e,height:n,prevHeight:r,invertX:i,invertY:o}){const s=t-e,a=n-r,l=[s>0?1:s<0?-1:0,a>0?1:a<0?-1:0];return s&&i&&(l[0]=l[0]*-1),a&&o&&(l[1]=l[1]*-1),l}const gQ={[wa.Line]:"right",[wa.Handle]:"bottom-right"},vQ={[wa.Line]:"borderColor",[wa.Handle]:"backgroundColor"},sP=Te({...{name:"ResizeControl",compatConfig:{MODE:3}},props:{nodeId:{},color:{},minWidth:{default:10},minHeight:{default:10},maxWidth:{default:Number.MAX_VALUE},maxHeight:{default:Number.MAX_VALUE},position:{},variant:{default:"handle"},shouldResize:{},keepAspectRatio:{type:[Boolean,Number],default:!1},autoScale:{type:Boolean,default:!0},handleClassName:{},handleStyle:{},lineClassName:{},lineStyle:{},isVisible:{type:Boolean}},emits:["resizeStart","resize","resizeEnd"],setup(t,{emit:e}){const n=t,r={width:0,height:0,x:0,y:0},i={...r,pointerX:0,pointerY:0,aspectRatio:1},{findNode:o,emits:s,viewport:a,noDragClassName:l}=Dt(),u=kA(),c=we();let d=i,h=r;const p=Ot(()=>n.position??gQ[n.variant]),m=Z(()=>p.value.split("-")),g=Ot(()=>n.color?{[vQ[n.variant]]:n.color}:{});return kb(_=>{if(!c.value||!n.nodeId)return;const E=sd(c.value),S=p.value.includes("right")||p.value.includes("left"),y=p.value.includes("bottom")||p.value.includes("top"),b=p.value.includes("left"),N=p.value.includes("top"),D=pQ().on("start",O=>{const k=o(n.nodeId),{xSnapped:w,ySnapped:P}=u(O);h={width:(k==null?void 0:k.dimensions.width)??0,height:(k==null?void 0:k.dimensions.height)??0,x:(k==null?void 0:k.position.x)??0,y:(k==null?void 0:k.position.y)??0},d={...h,pointerX:w,pointerY:P,aspectRatio:h.width/h.height},e("resizeStart",{event:O,params:h})}).on("drag",O=>{var k;const{xSnapped:w,ySnapped:P}=u(O),C=o(n.nodeId);if(C){const v=[],{pointerX:x,pointerY:I,width:V,height:M,x:H,y:G,aspectRatio:Y}=d,{x:se,y:ie,width:ue,height:_e}=h,Ee=Math.floor(S?w-x:0),he=Math.floor(y?P-I:0);let de=Ao(V+(b?-Ee:Ee),n.minWidth,n.maxWidth),pe=Ao(M+(N?-he:he),n.minHeight,n.maxHeight);if(n.keepAspectRatio){const B=de/pe;let $=Y;typeof n.keepAspectRatio=="number"&&B!==n.keepAspectRatio&&($=n.keepAspectRatio);const L=S&&y,z=S&&!y,F=y&&!S;de=B<=$&&L||F?pe*$:de,pe=B>$&&L||z?de/$:pe,de>=n.maxWidth?(de=n.maxWidth,pe=n.maxWidth/$):de<=n.minWidth&&(de=n.minWidth,pe=n.minWidth/$),pe>=n.maxHeight?(pe=n.maxHeight,de=n.maxHeight*$):pe<=n.minHeight&&(pe=n.minHeight,de=n.minHeight*$)}const Le=de!==ue,De=pe!==_e;if(b||N){const B=b?H-(de-V):H,$=N?G-(pe-M):G,L=B!==se&&Le,z=$!==ie&&De;if(L||z){const F={id:C.id,type:"position",from:C.position,position:{x:L?B:se,y:z?$:ie}};v.push(F),h.x=F.position.x,h.y=F.position.y}}if(n.nodeId&&(Le||De)){const B={id:n.nodeId,type:"dimensions",updateStyle:!0,resizing:!0,dimensions:{width:de,height:pe}};v.push(B),h.width=de,h.height=pe}if(v.length===0)return;const Be=mQ({width:h.width,prevWidth:ue,height:h.height,prevHeight:_e,invertX:b,invertY:N}),et={...h,direction:Be};if(((k=n.shouldResize)==null?void 0:k.call(n,O,et))===!1)return;e("resize",{event:O,params:et}),s.nodesChange(v)}}).on("end",O=>{if(n.nodeId){const k={id:n.nodeId,type:"dimensions",resizing:!1};e("resizeEnd",{event:O,params:h}),s.nodesChange([k])}});E.call(D),_(()=>{E.on(".drag",null)})}),(_,E)=>(j(),K("div",{ref_key:"resizeControlRef",ref:c,class:Se(["vue-flow__resize-control",[...m.value,_.variant,re(l)]]),style:Ze({...g.value,scale:_.variant===re(wa).Handle?`${Math.max(1/re(a).zoom,1)}`:void 0})},[Mt(_.$slots,"default")],6))}}),yQ=Te({...{name:"NodeResizer",compatConfig:{MODE:3},inheritAttrs:!1},props:{nodeId:{},color:{},handleClassName:{},handleStyle:{},lineClassName:{},lineStyle:{},isVisible:{type:Boolean,default:!0},minWidth:{},minHeight:{},maxWidth:{},maxHeight:{},shouldResize:{},keepAspectRatio:{type:[Boolean,Number]},autoScale:{type:Boolean,default:!0}},emits:["resizeStart","resize","resizeEnd"],setup(t,{emit:e}){const n=t,{findNode:r,emits:i}=Dt(),o=["top-left","top-right","bottom-left","bottom-right"],s=["top","right","bottom","left"],a=bt(S0,null),l=Ot(()=>typeof n.nodeId=="string"?n.nodeId:a),u=Z(()=>r(l.value));return Qe([()=>n.minWidth,()=>n.minHeight,()=>n.maxWidth,()=>n.maxHeight,()=>{var c;return!!((c=u.value)!=null&&c.dimensions.width)&&!!u.value.dimensions.height}],([c,d,h,p,m])=>{const g=u.value;if(g&&m){const _={id:g.id,type:"dimensions",updateStyle:!0,dimensions:{width:g.dimensions.width,height:g.dimensions.height}};c&&g.dimensions.width<c&&(_.dimensions.width=c),d&&g.dimensions.height<d&&(_.dimensions.height=d),h&&g.dimensions.width>h&&(_.dimensions.width=h),p&&g.dimensions.height>p&&(_.dimensions.height=p),(_.dimensions.width!==g.dimensions.width||_.dimensions.height!==g.dimensions.height)&&i.nodesChange([_])}},{flush:"post",immediate:!0}),(c,d)=>c.isVisible?(j(),K(Ve,{key:0},[(j(),K(Ve,null,It(s,h=>ce(sP,{key:h,class:Se(c.lineClassName),style:Ze(c.lineStyle),"node-id":l.value,position:h,variant:re(wa).Line,color:c.color,"min-width":c.minWidth,"min-height":c.minHeight,"max-width":c.maxWidth,"max-height":c.maxHeight,"should-resize":c.shouldResize,"keep-aspect-ratio":c.keepAspectRatio,"auto-scale":c.autoScale,onResizeStart:d[0]||(d[0]=p=>e("resizeStart",p)),onResize:d[1]||(d[1]=p=>e("resize",p)),onResizeEnd:d[2]||(d[2]=p=>e("resizeEnd",p))},null,8,["class","style","node-id","position","variant","color","min-width","min-height","max-width","max-height","should-resize","keep-aspect-ratio","auto-scale"])),64)),(j(),K(Ve,null,It(o,h=>ce(sP,{key:h,class:Se(c.handleClassName),style:Ze(c.handleStyle),"node-id":l.value,position:h,color:c.color,"min-width":c.minWidth,"min-height":c.minHeight,"max-width":c.maxWidth,"max-height":c.maxHeight,"should-resize":c.shouldResize,"keep-aspect-ratio":c.keepAspectRatio,"auto-scale":c.autoScale,onResizeStart:d[3]||(d[3]=p=>e("resizeStart",p)),onResize:d[4]||(d[4]=p=>e("resize",p)),onResizeEnd:d[5]||(d[5]=p=>e("resizeEnd",p))},null,8,["class","style","node-id","position","color","min-width","min-height","max-width","max-height","should-resize","keep-aspect-ratio","auto-scale"])),64))],64)):Ae("",!0)}}),bQ=["data-lumina-id"],_Q=["src"],xQ={key:1,class:"placeholder"},aP=Qr(Te({__name:"StudioDiagramNode",props:{id:{},data:{},selected:{type:Boolean},label:{},type:{},style:{},editable:{type:Boolean},elementId:{}},setup(t){const e=t,n=Z(()=>{if(!e.label)return null;if(typeof e.label=="string")return e.label;if(typeof e.label=="object"&&"toString"in e.label){const a=e.label.toString();if(a!=="[object Object]")return a}return null}),r=Z(()=>{var a,l;return((a=e.data)==null?void 0:a.type)==="image"||((l=e.data)==null?void 0:l.shape)==="image"}),i=Z(()=>{var a;return((a=e.data)==null?void 0:a.shape)||"rectangle"}),o=Z(()=>{var a,l,u,c,d,h;return{backgroundColor:((a=e.style)==null?void 0:a.backgroundColor)||((u=(l=e.data)==null?void 0:l.style)==null?void 0:u.backgroundColor)||"#ffffff",color:((c=e.style)==null?void 0:c.color)||((h=(d=e.data)==null?void 0:d.style)==null?void 0:h.color)||"#000000",borderRadius:i.value==="rounded"?"12px":"4px",border:e.editable&&e.selected?"2px solid #3b82f6":"1px solid #ccc"}}),s=Z(()=>({borderRadius:"4px",border:e.editable&&e.selected?"2px solid #3b82f6":"none",overflow:"hidden"}));return(a,l)=>{var u,c;return j(),K("div",{class:"studio-diagram-node","data-lumina-id":t.elementId||void 0},[t.editable&&t.selected?(j(),Ne(re(yQ),{key:0,"min-width":80,"min-height":40})):Ae("",!0),r.value?(j(),K("div",{key:1,class:"node-content node-image",style:Ze(s.value)},[(u=t.data)!=null&&u.imageUrl?(j(),K("img",{key:0,src:t.data.imageUrl,alt:"",class:"node-img"},null,8,_Q)):(j(),K("div",xQ,[...l[0]||(l[0]=[A("i",{class:"ph-thin ph-image text-2xl text-gray-400"},null,-1),A("span",{class:"text-xs text-gray-400"},"No Image",-1)])]))],4)):(j(),K("div",{key:2,class:"node-content",style:Ze(o.value)},Ie(n.value||((c=t.data)==null?void 0:c.label)||"Node"),5)),t.editable?(j(),K(Ve,{key:3},[ce(re(bs),{type:"target",position:re(ze).Top,class:"node-handle"},null,8,["position"]),ce(re(bs),{type:"source",position:re(ze).Bottom,class:"node-handle"},null,8,["position"]),ce(re(bs),{type:"target",position:re(ze).Left,class:"node-handle"},null,8,["position"]),ce(re(bs),{type:"source",position:re(ze).Right,class:"node-handle"},null,8,["position"])],64)):Ae("",!0)],8,bQ)}}}),[["__scopeId","data-v-602e723d"]]),lP=Te({__name:"LayoutDiagram",props:{data:{}},setup(t){const e=t,{options:n,index:r}=hg(),i=Z(()=>!!n.studio),o=we(e.data.nodes||[]),s=we(e.data.edges||[]);Qe(()=>e.data.edges,y=>{y&&JSON.stringify(y)!==JSON.stringify(s.value)&&(s.value=[...y])},{deep:!0}),Gt(()=>{e.data.nodes&&(o.value=[...e.data.nodes]),e.data.edges&&(s.value=[...e.data.edges])});const{onNodeDragStop:a,onConnect:l}=Dt(),u=()=>{const y=o.value.map(b=>JSON.parse(JSON.stringify(b)));Promise.resolve().then(()=>zu).then(({bus:b})=>{b.emit("action",{type:"slide-update",slideIndex:r.value,patch:{nodes:y}})})};Promise.resolve().then(()=>zu).then(({bus:y})=>{y.on("diagram-node-update",b=>{if(b.slideIndex!==r.value)return;const N=o.value.findIndex(D=>D.id===b.nodeId);if(N!==-1){const D=o.value[N],O=b.key.split(".");let k=D;for(let w=0;w<O.length-1;w++)k[O[w]]||(k[O[w]]={}),k=k[O[w]];k[O[O.length-1]]=b.value,o.value=[...o.value],u()}})}),a(y=>{if(!i.value)return;const b=o.value.map(N=>JSON.parse(JSON.stringify(N)));Promise.resolve().then(()=>zu).then(({bus:N})=>{N.emit("action",{type:"slide-update",slideIndex:r.value,patch:{nodes:b}})})}),l(y=>{if(!i.value)return;const b={id:`edge-${y.source}-${y.target}-${Date.now()}`,source:y.source,target:y.target,sourceHandle:y.sourceHandle,targetHandle:y.targetHandle,type:"default",animated:!1};s.value=[...s.value,b];const N=s.value.map(D=>JSON.parse(JSON.stringify(D)));Promise.resolve().then(()=>zu).then(({bus:D})=>{D.emit("action",{type:"slide-update",slideIndex:r.value,patch:{edges:N}})})});const c=bt(tv,null),{onNodeClick:d,onPaneClick:h,onEdgeClick:p,addNodes:m,project:g,findNode:_}=Dt();d(({node:y})=>{if(!i.value||!c)return;const N=(e.data.nodes||[]).findIndex(D=>D.id===y.id);N!==-1&&c.select(`slides.${r.value}.nodes.${N}`)}),p(({edge:y})=>{if(!i.value||!c)return;const N=(e.data.edges||[]).findIndex(D=>D.id===y.id);if(N!==-1){const D=`slides.${r.value}.edges.${N}`;c.select(D)}});const E=y=>{y.preventDefault(),y.dataTransfer&&(y.dataTransfer.dropEffect="move")},S=y=>{var w;if(!i.value||!c)return;const b=(w=y.dataTransfer)==null?void 0:w.getData("application/vueflow");if(!b)return;const{left:N,top:D}=y.currentTarget.getBoundingClientRect(),O=g({x:y.clientX-N,y:y.clientY-D}),k={id:`node-${Date.now()}`,type:"default",position:O,label:`${b} Node`,data:{type:b,style:{backgroundColor:"#ffffff",color:"#000000",width:"150px",height:"50px"}}};c.store.addNode(`slides.${r.value}.nodes`,k),c.commit()};return(y,b)=>(j(),Ne(bi,{data:t.data,"slide-index":re(r),class:"layout-diagram"},{default:Ce(()=>[A("div",{class:Se(["w-full relative",t.data.sizing==="container"?"h-full min-h-[400px]":"h-screen"]),onClick:b[2]||(b[2]=Or(()=>{},["stop"]))},[ce(re(ZX),{nodes:o.value,"onUpdate:nodes":b[0]||(b[0]=N=>o.value=N),edges:s.value,"onUpdate:edges":b[1]||(b[1]=N=>s.value=N),class:"h-full w-full","fit-view-on-init":!0,"default-viewport":{zoom:1},"min-zoom":.1,"max-zoom":4,onDragover:E,onDrop:S},{"node-default":Ce(N=>{var D;return[ce(aP,ao(N,{editable:i.value,"element-id":(D=N.node)==null?void 0:D.id}),null,16,["editable","element-id"])]}),"node-input":Ce(N=>{var D;return[ce(aP,ao(N,{editable:i.value,"element-id":(D=N.node)==null?void 0:D.id}),null,16,["editable","element-id"])]}),default:Ce(()=>[i.value?(j(),Ne(re(_Y),{key:0})):Ae("",!0)]),_:1},8,["nodes","edges"])],2)]),_:1},8,["data","slide-index"]))}}),wQ={class:"w-full h-full"},SQ=Te({__name:"EditorLayoutFixed",props:{data:{},slideIndex:{}},setup(t){const e=n=>({half:Vy,statement:Fy,features:zy,timeline:Uy,steps:By,chart:WI,video:KI,auto:ZI,custom:XI,diagram:lP})[n]||"div";return(n,r)=>(j(),K("div",wQ,[ce(hs,{path:`slides.${t.slideIndex}`,label:t.data.type,class:"w-full h-full"},{default:Ce(()=>[(j(),Ne(Jn(e(t.data.type)),{data:t.data},null,8,["data"]))]),_:1},8,["path","label"])]))}}),EQ={class:"w-full h-full"},TQ=Te({__name:"EditorLayoutSteps",props:{data:{},slideIndex:{}},setup(t){return(e,n)=>(j(),K("div",EQ,[ce(hs,{path:`slides.${t.slideIndex}`,label:t.data.type,class:"w-full h-full"},{default:Ce(()=>[ce(By,{data:t.data},null,8,["data"])]),_:1},8,["path","label"])]))}}),IQ={class:"w-full h-full"},CQ=Te({__name:"EditorLayoutTimeline",props:{data:{},slideIndex:{}},setup(t){return(e,n)=>(j(),K("div",IQ,[ce(hs,{path:`slides.${t.slideIndex}`,label:t.data.type,class:"w-full h-full"},{default:Ce(()=>[ce(Uy,{data:t.data},null,8,["data"])]),_:1},8,["path","label"])]))}}),AQ={class:"w-full h-full"},PQ=Te({__name:"EditorLayoutFeatures",props:{data:{},slideIndex:{}},setup(t){return(e,n)=>(j(),K("div",AQ,[ce(hs,{path:`slides.${t.slideIndex}`,label:t.data.type,class:"w-full h-full"},{default:Ce(()=>[ce(zy,{data:t.data},null,8,["data"])]),_:1},8,["path","label"])]))}}),kQ={class:"w-full h-full"},OQ=Te({__name:"EditorLayoutHalf",props:{data:{},slideIndex:{}},setup(t){return(e,n)=>(j(),K("div",kQ,[ce(hs,{path:`slides.${t.slideIndex}`,label:t.data.type,class:"w-full h-full"},{default:Ce(()=>[ce(Vy,{data:t.data},null,8,["data"])]),_:1},8,["path","label"])]))}}),NQ={class:"w-full h-full"},RQ=Te({__name:"EditorLayoutStatement",props:{data:{},slideIndex:{}},setup(t){return(e,n)=>(j(),K("div",NQ,[ce(hs,{path:`slides.${t.slideIndex}`,label:t.data.type,class:"w-full h-full"},{default:Ce(()=>[ce(Fy,{data:t.data},null,8,["data"])]),_:1},8,["path","label"])]))}}),DQ={class:"absolute top-4 right-4 z-50 flex items-center gap-2 bg-black/60 backdrop-blur-md rounded-lg px-3 py-2 border border-white/10"},$Q={class:"text-white/70 text-xs font-mono w-12 text-center"},MQ={key:0,class:"absolute top-4 left-4 z-50 bg-blue-500/80 text-white text-xs px-2 py-1 rounded"},LQ={class:"absolute inset-0 z-0 pointer-events-none"},VQ={class:"absolute inset-0 z-10 overflow-y-auto overflow-x-hidden scroll-smooth"},FQ={class:"relative min-h-full w-full"},zQ={key:1,class:"flex w-full h-[720px] items-center justify-center text-white/30"},UQ=Qr(Te({__name:"EditorCanvas",setup(t){const{slide:e,index:n}=hg(),r=bt(dn),i=we(.6),o=we(0),s=we(0),a=we(!1),l=we({x:0,y:0}),u=Z(()=>({transform:`translate(${o.value}px, ${s.value}px) scale(${i.value})`,transformOrigin:"center center",transition:a.value?"none":"transform 0.15s ease-out"})),c=we({top:"-20%",left:"-10%"}),d=Z(()=>({backgroundColor:"var(--lumina-color-background, #030303)",color:"var(--lumina-color-text, #ffffff)",fontFamily:"var(--lumina-font-body, Inter, system-ui, sans-serif)"})),h=Z(()=>{var v,x,I,V,M,H;return{top:((I=(x=(v=e.value)==null?void 0:v.meta)==null?void 0:x.orbPos)==null?void 0:I.top)||c.value.top,left:((H=(M=(V=e.value)==null?void 0:V.meta)==null?void 0:M.orbPos)==null?void 0:H.left)||c.value.left}}),p=()=>{var M;const v=r==null?void 0:r.state.deck;if(!v)return;const x=((M=v.meta)==null?void 0:M.theme)||v.theme||"default",I=v.meta||{},V={colors:I.colors,typography:I.typography,spacing:I.spacing,borderRadius:I.borderRadius,effects:I.effects,components:I.components};Gl.inject(x,V)};Qe(()=>{var v,x;return(x=(v=r==null?void 0:r.state.deck)==null?void 0:v.meta)==null?void 0:x.theme},p,{immediate:!0}),Qe(()=>{var v;return(v=r==null?void 0:r.state.deck)==null?void 0:v.theme},p),Qe(()=>r==null?void 0:r.state.deck,p,{immediate:!0,deep:!1}),Qe(n,(v,x)=>{if(v===0)c.value={top:"-20%",left:"-10%"};else if(x!==void 0){const I=(V,M)=>Math.floor(Math.random()*(M-V+1)+V);c.value={top:`${I(-25,65)}%`,left:`${I(-25,65)}%`}}},{immediate:!0}),Gt(()=>{p()});const m=()=>{i.value=Math.min(i.value+.1,2)},g=()=>{i.value=Math.max(i.value-.1,.2)},_=()=>{i.value=.6,o.value=0,s.value=0},E=v=>{if(v.ctrlKey||v.metaKey){v.preventDefault();const V=v.deltaY>0?-.05:.05;i.value=Math.max(.2,Math.min(2,i.value+V));return}const I=v.target.closest(".overflow-y-auto");if(I){const{scrollTop:V,scrollHeight:M,clientHeight:H}=I;if(M>H){const Y=V<=0,se=Math.abs(V+H-M)<1,ie=v.deltaY<0,ue=v.deltaY>0;if(ie&&!Y||ue&&!se){v.stopPropagation();return}}}v.preventDefault(),v.shiftKey&&v.deltaX===0?o.value-=v.deltaY:(o.value-=v.deltaX,s.value-=v.deltaY)},S=we(!1),y=we(null),b=v=>{v.code==="Space"&&!v.repeat&&!(v.target instanceof HTMLInputElement||v.target instanceof HTMLTextAreaElement)&&(S.value=!0)},N=v=>{v.code==="Space"&&(S.value=!1,a.value&&!D.value&&(a.value=!1))};Gt(()=>{p(),window.addEventListener("keydown",b),window.addEventListener("keyup",N)}),lr(()=>{window.removeEventListener("keydown",b),window.removeEventListener("keyup",N)});const D=we(!1),O=v=>{const x=v.button===1,I=v.button===0,V=v.target,M=V.classList.contains("canvas-transform-wrapper")||V===y.value;(x||I&&(S.value||v.shiftKey||M))&&(a.value=!0,D.value=!0,l.value={x:v.clientX,y:v.clientY},v.preventDefault())},k=v=>{a.value&&(o.value+=v.clientX-l.value.x,s.value+=v.clientY-l.value.y,l.value={x:v.clientX,y:v.clientY})},w=()=>{a.value=!1,D.value=!1},P=ai(),C=()=>{a.value||P.select(`slides.${n.value}`)};return(v,x)=>{var I,V;return j(),K("div",{ref_key:"canvasContainer",ref:y,class:Se(["flex-1 bg-[#050505] overflow-hidden flex items-center justify-center relative transition-cursor duration-150",{"cursor-grab":!a.value&&S.value,"cursor-grabbing":a.value,"cursor-default":!a.value&&!S.value}]),onWheel:E,onMousedown:O,onMousemove:k,onMouseup:w,onMouseleave:w},[A("div",DQ,[A("button",{onClick:g,class:"w-6 h-6 flex items-center justify-center text-white/70 hover:text-white transition"},[...x[0]||(x[0]=[A("i",{class:"ph-thin ph-minus text-xs"},null,-1)])]),A("span",$Q,Ie(Math.round(i.value*100))+"%",1),A("button",{onClick:m,class:"w-6 h-6 flex items-center justify-center text-white/70 hover:text-white transition"},[...x[1]||(x[1]=[A("i",{class:"ph-thin ph-plus text-xs"},null,-1)])]),A("button",{onClick:_,class:"w-6 h-6 flex items-center justify-center text-white/70 hover:text-white transition ml-2",title:"Reset Zoom"},[...x[2]||(x[2]=[A("i",{class:"ph-thin ph-arrows-out-simple text-xs"},null,-1)])])]),a.value?(j(),K("div",MQ," Panning ")):Ae("",!0),A("div",{class:"canvas-transform-wrapper",style:Ze(u.value)},[A("div",{class:"w-[1280px] h-[720px] shadow-2xl relative border border-[#333] overflow-hidden",style:Ze(d.value),onClick:Or(C,["stop"])},[A("div",LQ,[ce(vS,{"orb-color":(V=(I=re(e))==null?void 0:I.meta)==null?void 0:V.orbColor,"orb-pos":h.value},null,8,["orb-color","orb-pos"])]),A("div",VQ,[A("div",FQ,[re(e)?(j(),K(Ve,{key:0},[re(e).type==="flex"?(j(),Ne(k7,{key:0,data:re(e),"slide-index":re(n)},null,8,["data","slide-index"])):re(e).type==="steps"?(j(),Ne(TQ,{key:1,data:re(e),"slide-index":re(n)},null,8,["data","slide-index"])):re(e).type==="timeline"?(j(),Ne(CQ,{key:2,data:re(e),"slide-index":re(n)},null,8,["data","slide-index"])):re(e).type==="features"?(j(),Ne(PQ,{key:3,data:re(e),"slide-index":re(n)},null,8,["data","slide-index"])):re(e).type==="half"?(j(),Ne(OQ,{key:4,data:re(e),"slide-index":re(n)},null,8,["data","slide-index"])):re(e).type==="statement"?(j(),Ne(RQ,{key:5,data:re(e),"slide-index":re(n)},null,8,["data","slide-index"])):(j(),Ne(SQ,{key:6,data:re(e),"slide-index":re(n)},null,8,["data","slide-index"]))],64)):(j(),K("div",zQ," No slide selected "))])])],4)],4)],34)}}}),[["__scopeId","data-v-06b57ef9"]]),BQ={class:"fixed bottom-6 left-1/2 -translate-x-1/2 z-50 flex items-center gap-3 bg-[#0a0a0a]/90 backdrop-blur-2xl px-4 py-3 rounded-2xl border border-white/10 shadow-[0_20px_50px_rgba(0,0,0,0.5)] transition-all duration-300"},jQ={class:"relative shrink-0"},HQ={class:"flex flex-col gap-1"},GQ=["onClick"],WQ={class:"w-8 h-8 rounded-lg bg-white/5 flex items-center justify-center group-hover:bg-blue-500/20 group-hover:text-blue-400 transition-colors"},KQ={class:"font-medium"},ZQ=["onClick"],XQ={class:"w-full h-full flex items-center justify-center text-[8px] text-white/30",style:{backgroundColor:"var(--lumina-color-background, #0a0a0a)"}},YQ={class:"font-bold text-white/50"},JQ={class:"absolute bottom-1 right-1 px-1.5 py-0.5 bg-white/10 backdrop-blur-md rounded-md text-[6px] text-white/80 font-bold uppercase tracking-tighter"},QQ=["onClick"],qQ={class:"flex flex-col items-center justify-center px-4 py-1.5 rounded-xl bg-white/5 border border-white/5 shrink-0"},eq={class:"text-[10px] font-mono text-white/50 leading-tight"},tq={class:"flex flex-col items-center text-center mb-8"},nq={class:"text-sm text-white/40"},rq={class:"flex gap-4"},iq=Qr(Te({__name:"SlideNavigator",setup(t){const e=bt(dn),n=ai(),r=we(!1),i=we(null),o=we(!1),s=Z(()=>{var E;return((E=e.state.deck)==null?void 0:E.slides)||[]}),a=Z(()=>e.state.currentIndex),l=Z({get(){var E;return((E=e.state.deck)==null?void 0:E.slides)||[]},set(E){e.patchDeck({slides:E}),n.commit()}}),u=[{type:"flex",label:"Flex Layout",icon:"ph-thin ph-squares-four"},{type:"statement",label:"Statement",icon:"ph-thin ph-quotes"},{type:"half",label:"Half Layout",icon:"ph-thin ph-columns"},{type:"features",label:"Features",icon:"ph-thin ph-grid-four"},{type:"timeline",label:"Timeline",icon:"ph-thin ph-clock"},{type:"steps",label:"Steps",icon:"ph-thin ph-list-numbers"},{type:"diagram",label:"Diagram",icon:"ph-thin ph-tree-structure"}],c={flex:{type:"flex",direction:"horizontal",gap:"md",padding:"lg",elements:[{type:"content",size:"half",halign:"left",valign:"center",elements:[{type:"title",text:"New Slide",size:"xl"},{type:"text",text:"Start editing your content here."}]},{type:"image",size:"half",src:"https://images.unsplash.com/photo-1557683316-973673baf926?w=800",alt:"Placeholder image",fill:!0,rounded:"lg"}]},statement:{type:"statement",tag:"Tagline",title:"Big Statement Here",subtitle:"Supporting description text goes below the main statement."},half:{type:"half",imageSide:"right",image:"https://images.unsplash.com/photo-1557683316-973673baf926?w=800",tag:"Category",title:"Split Layout Title",paragraphs:["First paragraph of content.","Second paragraph with more details."],cta:"Learn More"},features:{type:"features",title:"Key Features",description:"Discover what makes us different.",features:[{icon:"star",title:"Feature One",desc:"Description of the first feature."},{icon:"rocket",title:"Feature Two",desc:"Description of the second feature."},{icon:"lightning",title:"Feature Three",desc:"Description of the third feature."}]},timeline:{type:"timeline",title:"Our Journey",subtitle:"Key milestones in our history.",timeline:[{date:"2020",title:"Founded",description:"Company was established."},{date:"2022",title:"Growth",description:"Expanded to new markets."},{date:"2024",title:"Today",description:"Serving customers worldwide."}]},steps:{type:"steps",title:"How It Works",subtitle:"Simple steps to get started.",steps:[{step:"1",title:"Step One",description:"First thing to do."},{step:"2",title:"Step Two",description:"Second thing to do."},{step:"3",title:"Step Three",description:"Final step."}]},diagram:{type:"diagram",title:"New Diagram",nodes:[{id:"1",type:"input",label:"Start",position:{x:250,y:5}},{id:"2",label:"Process",position:{x:100,y:100}},{id:"3",label:"End",position:{x:400,y:100}}],edges:[{id:"e1-2",source:"1",target:"2",animated:!0},{id:"e1-3",source:"1",target:"3"}]}},d=E=>({flex:"Flex",statement:"Stmt",half:"Half",features:"Feat",timeline:"Time",steps:"Step",diagram:"Diag"})[E]||E.slice(0,4),h=E=>{e.goto(E),n.select(null)},p=()=>{r.value=!r.value},m=E=>{const S=c[E]||c.flex,y=JSON.parse(JSON.stringify(S));y.type==="flex"&&Array.isArray(y.elements)&&y.elements.forEach(D=>{D.dragKey=Date.now()+Math.random(),D.type==="content"&&Array.isArray(D.elements)&&D.elements.forEach(O=>{O.dragKey=Date.now()+Math.random()+1})});const b=[...s.value],N=a.value+1;b.splice(N,0,y),e.patchDeck({slides:b}),n.commit(),setTimeout(()=>{e.goto(N),r.value=!1},50)},g=()=>{const E=i.value;if(E===null||s.value.length<=1){i.value=null;return}const S=[...s.value];S.splice(E,1),e.patchDeck({slides:S}),n.commit(),a.value>=S.length&&e.goto(S.length-1),i.value=null},_=()=>{r.value=!1};return Gt(()=>{document.addEventListener("click",_)}),lr(()=>{document.removeEventListener("click",_)}),(E,S)=>(j(),K(Ve,null,[A("div",BQ,[A("div",jQ,[A("button",{onClick:Or(p,["stop"]),class:"w-10 h-10 rounded-xl bg-blue-600 hover:bg-blue-500 text-white flex items-center justify-center transition-all duration-200 active:scale-95 shadow-lg shadow-blue-600/20 group",title:"Add New Slide"},[A("i",{class:Se(["ph-thin ph-plus transition-transform duration-300",{"rotate-45":r.value}])},null,2)]),ce(Ya,{name:"menu"},{default:Ce(()=>[r.value?(j(),K("div",{key:0,class:"absolute bottom-full left-0 mb-4 bg-[#111] border border-white/10 rounded-2xl p-2 min-w-[180px] shadow-2xl backdrop-blur-xl z-[60]",onClick:S[0]||(S[0]=Or(()=>{},["stop"]))},[S[7]||(S[7]=A("div",{class:"px-3 py-2 text-[10px] font-bold text-white/30 uppercase tracking-widest border-b border-white/5 mb-1"}," Select Layout ",-1)),A("div",HQ,[(j(),K(Ve,null,It(u,y=>A("button",{key:y.type,onClick:b=>m(y.type),class:"w-full px-3 py-2.5 text-left text-xs text-white/70 hover:text-white hover:bg-white/5 rounded-xl transition-all flex items-center gap-3 group"},[A("div",WQ,[A("i",{class:Se(y.icon)},null,2)]),A("span",KQ,Ie(y.label),1)],8,GQ)),64))])])):Ae("",!0)]),_:1})]),ce(re(Gh),{modelValue:l.value,"onUpdate:modelValue":S[1]||(S[1]=y=>l.value=y),"item-key":"id",class:"flex items-center gap-2 max-w-[650px] overflow-x-auto slide-scroll px-1 py-1 scroll-smooth",animation:200,"ghost-class":"opacity-50","drag-class":"scale-105",onStart:S[2]||(S[2]=y=>o.value=!0),onEnd:S[3]||(S[3]=y=>o.value=!1)},{item:Ce(({element:y,index:b})=>[A("button",{onClick:N=>h(b),class:Se(["shrink-0 w-16 h-10 rounded-xl overflow-hidden border-2 transition-all duration-200 relative group active:scale-95 cursor-grab active:cursor-grabbing",a.value===b?"border-blue-500 ring-4 ring-blue-500/20 scale-105 z-10":"border-white/5 shadow-inner hover:border-white/20"])},[A("div",XQ,[A("span",YQ,Ie(b+1),1),S[8]||(S[8]=A("div",{class:"absolute inset-0 bg-gradient-to-t from-black/60 to-transparent"},null,-1))]),A("div",JQ,Ie(d(y.type)),1),s.value.length>1?(j(),K("button",{key:0,onClick:Or(N=>i.value=b,["stop"]),class:"absolute top-1 right-1 w-5 h-5 bg-red-500/80 hover:bg-red-500 rounded-lg flex items-center justify-center opacity-0 group-hover:opacity-100 transition-all duration-200 transform hover:scale-110"},[...S[9]||(S[9]=[A("i",{class:"ph-thin ph-x text-[10px] text-white"},null,-1)])],8,QQ)):Ae("",!0)],10,ZQ)]),_:1},8,["modelValue"]),A("div",qQ,[S[11]||(S[11]=A("div",{class:"text-[10px] font-bold text-white uppercase tracking-tighter leading-tight"},"Slide",-1)),A("div",eq,[_t(Ie(a.value+1)+" ",1),S[10]||(S[10]=A("span",{class:"text-white/20"},"/",-1)),_t(" "+Ie(s.value.length),1)])])]),ce(Ya,{name:"modal"},{default:Ce(()=>[i.value!==null?(j(),K("div",{key:0,class:"fixed inset-0 z-[100] flex items-center justify-center bg-black/80 backdrop-blur-md",onClick:S[6]||(S[6]=y=>i.value=null)},[A("div",{class:"bg-[#111111] border border-white/10 rounded-3xl p-8 shadow-2xl max-w-sm w-full mx-4 transform transition-all",onClick:S[5]||(S[5]=Or(()=>{},["stop"]))},[A("div",tq,[S[12]||(S[12]=A("div",{class:"w-16 h-16 rounded-2xl bg-red-500/10 flex items-center justify-center text-red-500 mb-6 border border-red-500/20"},[A("i",{class:"ph-thin ph-trash text-2xl"})],-1)),S[13]||(S[13]=A("h3",{class:"text-xl font-bold text-white mb-2"},"Delete slide?",-1)),A("p",nq,"This will permanently remove slide #"+Ie(i.value+1)+" and all its content.",1)]),A("div",rq,[A("button",{onClick:S[4]||(S[4]=y=>i.value=null),class:"flex-1 px-6 py-3 rounded-2xl bg-white/5 hover:bg-white/10 text-white transition text-sm font-semibold border border-white/5"}," Cancel "),A("button",{onClick:g,class:"flex-1 px-6 py-3 rounded-2xl bg-red-600 hover:bg-red-500 text-white transition text-sm font-semibold shadow-xl shadow-red-600/30"}," Delete ")])])])):Ae("",!0)]),_:1})],64))}}),[["__scopeId","data-v-b431cd99"]]),oq={class:"flex flex-col w-full h-screen bg-black text-white font-sans overflow-hidden"},sq={class:"flex flex-1 overflow-hidden relative"},aq={class:"w-72 bg-[#111] border-l border-[#333] flex flex-col"},uP=Te({__name:"LuminaStudio",setup(t){const e=V5();return to(tv,e),(n,r)=>(j(),K("div",oq,[ce(I9),A("div",sq,[ce(RB),ce(UQ),A("div",aq,[ce(x7)]),ce(iq)])]))}}),ni=class ni{constructor(e){$n(this,"channel",null);$n(this,"handlers",new Set);$n(this,"lastTimestamp",0);$n(this,"heartbeatInterval",null);$n(this,"isConnected",!1);$n(this,"connectionHandlers",new Set);this.channelName=e,this.initChannel()}static getInstance(e,n=!1){return n?new ni(e):(ni.instances.has(e)||ni.instances.set(e,new ni(e)),ni.instances.get(e))}static isSupported(){return typeof BroadcastChannel<"u"}initChannel(){if(!ni.isSupported()){console.warn("[SpeakerChannel] BroadcastChannel not supported in this environment");return}try{this.channel=new BroadcastChannel(this.channelName),this.channel.onmessage=e=>{const n=e.data;if(!(n.timestamp&&n.timestamp===this.lastTimestamp)){if(n.action==="ping"){this.send({action:"pong"}),this.handlers.forEach(r=>{try{r(n)}catch(i){console.error("[SpeakerChannel] Handler error:",i)}});return}if(n.action==="pong"){this.setConnected(!0);return}if(n.action==="close"){this.setConnected(!1);return}this.handlers.forEach(r=>{try{r(n)}catch(i){console.error("[SpeakerChannel] Handler error:",i)}})}},this.channel.onmessageerror=e=>{console.error("[SpeakerChannel] Message error:",e)},this.startHeartbeat()}catch(e){console.error("[SpeakerChannel] Failed to initialize:",e)}}send(e){if(!this.channel)return;const n={...e,timestamp:Date.now(),channelId:this.channelName};this.lastTimestamp=n.timestamp,this.channel.postMessage(n)}subscribe(e){return this.handlers.add(e),()=>this.handlers.delete(e)}onConnectionChange(e){return this.connectionHandlers.add(e),e(this.isConnected),()=>this.connectionHandlers.delete(e)}get connected(){return this.isConnected}ping(){this.send({action:"ping"})}notifyClose(){this.send({action:"close"})}startHeartbeat(){this.ping(),this.heartbeatInterval=setInterval(()=>{(this.handlers.size>0||this.connectionHandlers.size>0)&&this.ping()},5e3)}setConnected(e){this.isConnected!==e&&(this.isConnected=e,this.connectionHandlers.forEach(n=>n(e)))}destroy(){this.notifyClose(),this.heartbeatInterval&&(clearInterval(this.heartbeatInterval),this.heartbeatInterval=null),this.channel&&(this.channel.close(),this.channel=null),this.handlers.clear(),this.connectionHandlers.clear(),ni.instances.delete(this.channelName)}static destroyAll(){ni.instances.forEach(e=>e.destroy()),ni.instances.clear()}};$n(ni,"instances",new Map);let ru=ni;const lq={class:"speaker-notes"},uq={class:"sn-header"},cq={class:"sn-status"},dq={class:"sn-slide-count"},fq={class:"sn-content"},hq={class:"sn-notes-section"},pq=["innerHTML"],mq={key:1,class:"sn-notes-empty"},gq={class:"sn-footer"},vq={class:"sn-nav-controls"},yq=["disabled"],bq={class:"sn-timer-value"},_q=["disabled"],xq=Qr(Te({__name:"LuminaSpeakerNotes",props:{channelId:{}},setup(t){const e=t,n=we(0),r=we(0),i=we(""),o=we(null),s=we(!1),a=we(null),l=we(0),u=we(!1),c=we(null),d=Z(()=>r.value===0?"No slides loaded":`Slide ${n.value+1} / ${r.value}`),h=Z(()=>{const w=Math.floor(l.value/3600),P=Math.floor(l.value%3600/60),C=l.value%60;return w>0?`${w.toString().padStart(2,"0")}:${P.toString().padStart(2,"0")}:${C.toString().padStart(2,"0")}`:`${P.toString().padStart(2,"0")}:${C.toString().padStart(2,"0")}`}),p=Z(()=>n.value<r.value-1),m=Z(()=>n.value>0);function g(w){return w?w.replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/__(.*?)__/g,"<strong>$1</strong>").replace(new RegExp("(?<!\\*)\\*(?!\\*)(.*?)(?<!\\*)\\*(?!\\*)","g"),"<em>$1</em>").replace(new RegExp("(?<!_)_(?!_)(.*?)(?<!_)_(?!_)","g"),"<em>$1</em>").replace(/\n/g,"<br>").replace(/^[-*]\s+(.*)$/gm,"<li>$1</li>").replace(/(<li>.*<\/li>)/gs,"<ul>$1</ul>").replace(/<\/ul>\s*<ul>/g,""):""}function _(){const w=new URLSearchParams(window.location.search),P=e.channelId||w.get("channel")||"lumina-speaker-default";a.value=ru.getInstance(P,!0),a.value.onConnectionChange(I=>{s.value=I}),a.value.subscribe(E);let C=0;const v=10,x=setInterval(()=>{var I;if(r.value>0||C>=v){clearInterval(x);return}(I=a.value)==null||I.ping(),C++},300);a.value.ping()}function E(w){switch(w.action){case"state":w.index!==void 0&&(n.value=w.index),w.totalSlides!==void 0&&(r.value=w.totalSlides),w.currentNotes!==void 0&&(i.value=w.currentNotes),w.nextSlidePreview&&(o.value=w.nextSlidePreview);break;case"goto":w.index!==void 0&&(n.value=w.index);break}}function S(){var w;p.value&&((w=a.value)==null||w.send({action:"next"}))}function y(){var w;m.value&&((w=a.value)==null||w.send({action:"prev"}))}function b(){u.value||(u.value=!0,c.value=setInterval(()=>{l.value++},1e3))}function N(){u.value=!1,c.value&&(clearInterval(c.value),c.value=null)}function D(){u.value?N():b()}function O(){N(),l.value=0}function k(w){switch(w.key){case"ArrowRight":case" ":case"Enter":w.preventDefault(),S();break;case"ArrowLeft":case"Backspace":w.preventDefault(),y();break;case"t":case"T":w.preventDefault(),D();break;case"r":case"R":if(w.ctrlKey||w.metaKey)return;w.preventDefault(),O();break}}return Gt(()=>{_(),window.addEventListener("keydown",k),window.addEventListener("beforeunload",()=>{var w;(w=a.value)==null||w.notifyClose()})}),lr(()=>{var w;N(),window.removeEventListener("keydown",k),(w=a.value)==null||w.destroy()}),(w,P)=>(j(),K("div",lq,[A("header",uq,[P[0]||(P[0]=of('<div class="sn-title" data-v-ccdb989d><svg class="sn-logo" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-ccdb989d><path d="M12 2L2 7l10 5 10-5-10-5z" data-v-ccdb989d></path><path d="M2 17l10 5 10-5" data-v-ccdb989d></path><path d="M2 12l10 5 10-5" data-v-ccdb989d></path></svg><span data-v-ccdb989d>Lumina Speaker Notes</span></div>',1)),A("div",cq,[A("span",{class:Se(["sn-indicator",{connected:s.value}])},null,2),A("span",dq,Ie(d.value),1)])]),A("main",fq,[A("section",hq,[P[2]||(P[2]=A("h2",{class:"sn-section-title"},"Notes",-1)),i.value?(j(),K("div",{key:0,class:"sn-notes-content",innerHTML:g(i.value)},null,8,pq)):(j(),K("div",mq,[...P[1]||(P[1]=[A("p",null,"No notes for this slide",-1)])]))])]),A("footer",gq,[A("div",vq,[A("button",{class:"sn-btn sn-btn-nav",disabled:!m.value,onClick:y,title:"Previous (← or Backspace)"},[...P[3]||(P[3]=[A("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[A("polyline",{points:"15 18 9 12 15 6"})],-1),A("span",null,"Prev",-1)])],8,yq),A("div",{class:"sn-timer",onClick:D,title:"Click to start/pause (T)"},[A("span",{class:Se(["sn-timer-icon",{running:u.value}])},Ie(u.value?"⏸":"▶"),3),A("span",bq,Ie(h.value),1),A("button",{class:"sn-timer-reset",onClick:Or(O,["stop"]),title:"Reset timer (R)"},"↻")]),A("button",{class:"sn-btn sn-btn-nav sn-btn-primary",disabled:!p.value,onClick:S,title:"Next (→, Space, or Enter)"},[...P[4]||(P[4]=[A("span",null,"Next",-1),A("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[A("polyline",{points:"9 18 15 12 9 6"})],-1)])],8,_q)])])]))}}),[["__scopeId","data-v-ccdb989d"]]),wq=Qr(Te({__name:"LayoutFlex",props:{data:{},slideIndex:{}},emits:["action"],setup(t,{emit:e}){const n=t,r=e,i=bt(dn),o=Z(()=>n.slideIndex??(i==null?void 0:i.state.currentIndex)??0),s=g=>Vt(n.data,o.value,["elements",g]),a=(g,_)=>Vt(n.data,o.value,["elements",g,"elements",_]),l=Z(()=>({padding:So[n.data.padding||"none"]})),u=Z(()=>n.data.direction==="vertical"?"flex-col":"flex-col lg:flex-row"),c=Z(()=>({gap:So[n.data.gap||"none"],...jI(n.data.direction,n.data.halign,n.data.valign)})),d=g=>Ly(g,n.data.direction==="vertical"),h=g=>{const _=n.data.direction==="vertical";return{...Ly(g,_),...UI(g),height:_?"auto":"100%",width:_?"100%":"auto",minHeight:_?"auto":"100%"}},p=g=>{r("action",g),Ft.emit("action",g)},m=g=>({title:DI,text:$I,image:Zh,video:Xh,bullets:LI,ordered:VI,button:MI,timeline:FI,stepper:zI,spacer:HI})[g]||"div";return(g,_)=>{const E=kr("LuminaElement");return j(),Ne(bi,{data:t.data,"slide-index":o.value},{default:Ce(()=>[A("div",{class:"flex-layout w-full h-screen flex flex-col overflow-y-auto lg:overflow-hidden",style:Ze(l.value)},[A("div",{class:Se(["flex-1 flex w-full min-h-full lg:h-full",u.value]),style:Ze(c.value)},[(j(!0),K(Ve,null,It(t.data.elements,(S,y)=>(j(),K(Ve,{key:y},[S.type==="image"?(j(),Ne(E,{key:0,id:s(y),class:Se(["flex-item",re(zc)(S.size)]),style:Ze(d(S))},{default:Ce(()=>[ce(Zh,{src:S.src,alt:S.alt,fill:S.fill,rounded:S.rounded,"container-class":"w-full h-full min-h-0","container-style":{},class:Se(S.class)},null,8,["src","alt","fill","rounded","class"])]),_:2},1032,["id","class","style"])):S.type==="video"?(j(),Ne(E,{key:1,id:s(y),class:Se(["flex-item",re(zc)(S.size),S.class]),style:Ze(d(S))},{default:Ce(()=>[ce(Xh,{class:Se(re(C7)(S.rounded,S.fill)),src:S.src,poster:S.poster,autoplay:S.autoplay??!1,loop:S.loop??!1,muted:S.muted??!1,controls:S.controls??!0,"object-fit":S.fill!==!1?"cover":"contain"},null,8,["class","src","poster","autoplay","loop","muted","controls","object-fit"])]),_:2},1032,["id","class","style"])):S.type==="content"?(j(),Ne(E,{key:2,id:s(y),class:Se(["flex-item flex flex-col h-full",re(zc)(S.size)]),style:Ze(h(S))},{default:Ce(()=>[(j(!0),K(Ve,null,It(S.elements,(b,N)=>(j(),Ne(E,{key:N,id:a(y,N)},{default:Ce(()=>[(j(),Ne(Jn(m(b.type)),ao({ref_for:!0},b,{onAction:p}),null,16))]),_:2},1032,["id"]))),128))]),_:2},1032,["id","class","style"])):(j(),Ne(E,{key:3,id:s(y),class:Se(["flex-item",re(zc)(S.size)]),style:Ze({...re(BI)(),width:t.data.direction==="vertical"?"100%":"auto"})},{default:Ce(()=>[(j(),Ne(Jn(m(S.type)),ao({ref_for:!0},S,{onAction:p}),null,16))]),_:2},1032,["id","class","style"]))],64))),128))],6)],4)]),_:1},8,["data","slide-index"])}}}),[["__scopeId","data-v-8a1ddc69"]]),cP=Te({__name:"LuminaElement",props:{id:{},tag:{default:"div"},class:{},style:{}},setup(t){const e=t,n=GI(()=>e.id),r=Z(()=>{const s=e.id;if(s==null)return;const a=String(s).trim();return a||void 0}),i=Z(()=>{const s=e.class;return Array.isArray(s)?s.filter(Boolean).join(" "):s||""}),o=Z(()=>{const s=re(n.style)??{},a={...e.style||{},...s};return"opacity"in s&&a.transition==null&&(a.transition="opacity var(--lumina-element-opacity-transition, 0.35s ease-out)"),a});return(s,a)=>(j(),Ne(Jn(t.tag),{"data-lumina-id":r.value,style:Ze(o.value),class:Se([re(n).class,i.value].filter(Boolean))},{default:Ce(()=>[Mt(s.$slots,"default")]),_:3},8,["data-lumina-id","style","class"]))}}),Sq={class:"layout-free-stage absolute inset-0 min-h-[100vh] overflow-hidden"},Eq=["src"],Tq={key:2},Iq=Te({__name:"LayoutFree",props:{data:{},slideIndex:{}},setup(t){const e=t,n=bt(dn),r=Z(()=>e.slideIndex??(n==null?void 0:n.state.currentIndex)??0);function i(a){return Vt(e.data,r.value,["elements",a])}function o(a){const l={position:"absolute",left:0,top:0,fontFamily:"var(--lumina-font-heading, inherit)",color:"var(--lumina-color-text-safe, #fff)"};return a.width!=null&&(l.width=typeof a.width=="number"?`${a.width}px`:a.width),a.height!=null&&(l.height=typeof a.height=="number"?`${a.height}px`:a.height),a.fontSize!=null&&(l.fontSize=typeof a.fontSize=="number"?`${a.fontSize}px`:a.fontSize),a.color&&(l.color=a.color),a.fontWeight&&(l.fontWeight=a.fontWeight),a.type==="box"&&a.backgroundColor&&(l.backgroundColor=a.backgroundColor),l}function s(a){const l={display:"block"};return a.width!=null&&(l.width=typeof a.width=="number"?`${a.width}px`:a.width),a.height!=null&&(l.height=typeof a.height=="number"?`${a.height}px`:a.height),l}return(a,l)=>(j(),Ne(bi,{data:t.data,"slide-index":r.value},{default:Ce(()=>[A("div",Sq,[(j(!0),K(Ve,null,It(t.data.elements||[],(u,c)=>(j(),Ne(cP,{key:c,id:i(c),tag:(u.type==="image","div"),style:Ze(o(u)),class:"layout-free-element"},{default:Ce(()=>[u.type==="text"?(j(),K(Ve,{key:0},[_t(Ie(u.text),1)],64)):u.type==="image"&&u.src?(j(),K("img",{key:1,src:u.src,alt:"",class:"max-w-full max-h-full object-contain",style:Ze(s(u))},null,12,Eq)):u.type==="box"?(j(),K("span",Tq," ")):Ae("",!0)]),_:2},1032,["id","tag","style"]))),128))])]),_:1},8,["data","slide-index"]))}}),dP={fadeUp:{from:{opacity:0,y:20},to:{opacity:1,y:0},ease:"power2.out"},fadeIn:{from:{opacity:0},to:{opacity:1},ease:"power2.out"},scaleIn:{from:{opacity:0,scale:.9},to:{opacity:1,scale:1},ease:"back.out(1.2)"},slideLeft:{from:{opacity:0,x:40},to:{opacity:1,x:0},ease:"power2.out"},slideRight:{from:{opacity:0,x:-40},to:{opacity:1,x:0},ease:"power2.out"},zoomIn:{from:{opacity:0,scale:.7},to:{opacity:1,scale:1},ease:"power2.out"},blurIn:{from:{opacity:0,filter:"blur(12px)"},to:{opacity:1,filter:"blur(0)"},ease:"power2.out"},spring:{from:{opacity:0,y:30},to:{opacity:1,y:0},ease:"elastic.out(1, 0.4)"},drop:{from:{y:-80,opacity:0},to:{y:0,opacity:1},ease:"back.out(1.5)"},fadeOut:{from:{opacity:1},to:{opacity:0},ease:"power2.in"}},fP={};function hP(t){return dP[t]??fP[t]??null}function Cq(t,e){fP[t]={...e}}function O0(t,e,n){let r={...(e==null?void 0:e.from)??{}},i={...(e==null?void 0:e.to)??{opacity:1}},o=(e==null?void 0:e.ease)??"power2.out",s=(e==null?void 0:e.duration)??.5;const a=t.preset||t.motion;if(a){const l=n&&n[a]||hP(a);l&&(l.from!=null&&(r={...l.from}),l.to!=null&&(i={...l.to}),l.ease!=null&&(o=l.ease),l.duration!=null&&(s=l.duration))}return t.from&&Object.keys(t.from).length&&(r={...r,...t.from}),t.to&&Object.keys(t.to).length&&(i={...i,...t.to}),t.ease!=null&&(o=t.ease),t.duration!=null&&(s=t.duration),Object.keys(i).length===0&&(i={opacity:1}),{from:r,to:i,ease:o,duration:s}}function Aq(t){return()=>{let e=t+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}function Pq(t,e){const n=[...t],r=Aq(e);for(let i=n.length-1;i>0;i--){const o=Math.floor(r()*(i+1));[n[i],n[o]]=[n[o],n[i]]}return n}function pP(t){const{ids:e,delayMs:n,mode:r="sequential",randomSeed:i=0}=t;if(!e.length)return[];let o;switch(r){case"sequential":o=e;break;case"center-out":{const l=(e.length-1)/2,u=e.map((c,d)=>({id:c,d:Math.abs(d-l)}));u.sort((c,d)=>c.d-d.d),o=u.map(c=>c.id);break}case"ends-in":{const l=(e.length-1)/2,u=e.map((c,d)=>({id:c,d:Math.abs(d-l)}));u.sort((c,d)=>d.d-c.d),o=u.map(c=>c.id);break}case"wave":o=e;break;case"random":o=Pq(e,i);break;default:o=e}const s=[];if(r==="wave")for(let a=0;a<o.length;a++)s.push({id:o[a],delayMs:a*(n*.6),index:a});else for(let a=0;a<o.length;a++)s.push({id:o[a],delayMs:(a+1)*n,index:a});return s}function mP(t,e,n){function r(a){t.setElementState(n,a)}function i(){var a;return((a=t.state.elementState[n])==null?void 0:a.class)??""}const o={show(){r({visible:!0,opacity:1});const a=e.getElementById(n),l=a==null?void 0:a.closest(".reveal-zoom, .reveal-up, .reveal-card, .reveal-left, .reveal-right");return l&&Bt.set(l,{opacity:1}),o},hide(){return r({visible:!1}),o},toggle(a){var u;const l=((u=t.state.elementState[n])==null?void 0:u.visible)!==!1;return r({visible:a!==void 0?a:!l}),o},opacity(a){return r({opacity:a}),o},transform(a){return r({transform:a}),o},css(a){return r({style:a}),o},addClass(a){const u=(i()+" "+a).trim();return r({class:u}),o},removeClass(a){const u=i().split(/\s+/).filter(c=>c&&c!==a).join(" ");return r({class:u}),o},animate(a){return s(a),o},animateAsync(a){return new Promise(l=>{s(a,()=>{var u;(u=a.onComplete)==null||u.call(a),l()})})},animateToProgress(a,l){const u=Object.keys(l).map(E=>parseFloat(E)).filter(E=>!Number.isNaN(E)).sort((E,S)=>E-S);if(u.length===0)return o;const c=u[0],d=u[u.length-1];let h;if(a<=c)h=l[String(c)]??{};else if(a>=d)h=l[String(d)]??{};else{let E=0;for(;E+1<u.length&&u[E+1]<=a;)E++;const S=u[E],y=u[E+1],b=l[String(S)]??{},N=l[String(y)]??{},D=(a-S)/(y-S);h={};const O=["opacity","x","y","scale","rotate"];for(const k of O){const w=b[k],P=N[k];typeof w=="number"&&typeof P=="number"?h[k]=w+(P-w)*D:typeof P=="number"?h[k]=P:typeof w=="number"&&(h[k]=w)}typeof N.visible=="boolean"?h.visible=N.visible:typeof b.visible=="boolean"&&(h.visible=b.visible)}const p=h.opacity!==void 0?h.opacity:1,m=[];(h.x!==void 0||h.y!==void 0)&&m.push(`translate(${h.x??0}px, ${h.y??0}px)`),h.scale!==void 0&&m.push(`scale(${h.scale})`),h.rotate!==void 0&&m.push(`rotate(${h.rotate}deg)`);const g=m.length?m.join(" "):"",_=h.visible!==void 0?h.visible:p>0;return r({opacity:p,transform:g,visible:_}),o}};function s(a,l){var S,y;const u=e.getElementById(n);if(!u)return;const c=Ys(t,void 0),d=(y=(S=t.state.deck)==null?void 0:S.meta)==null?void 0:y.motions,{from:h,to:p,ease:m,duration:g}=O0(a,{duration:c.elementDuration,ease:c.elementEase},d),_=l??a.onComplete,E={...p,duration:g,ease:m,overwrite:!0,onComplete:_};h&&Object.keys(h).length?Bt.fromTo(u,h,E):Bt.to(u,E)}return o}class kq{constructor(e,n={}){$n(this,"app");$n(this,"store");$n(this,"data");$n(this,"speakerWindow",null);$n(this,"speakerChannel",null);$n(this,"speakerChannelId");$n(this,"speakerUnsubscribe",null);$n(this,"_timelineProgress",0);$n(this,"_timelineCancel",null);this.selector=e,this.speakerChannelId=`lumina-speaker-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,this.store=ZM(n);const r={get:i=>this.store.getUserData(i),set:(i,o)=>(this.store.setUserData(i,o),r),has:i=>this.store.hasUserData(i),delete:i=>this.store.deleteUserData(i),clear:()=>this.store.clearUserData(),keys:()=>Object.keys(this.store.state.userData)};this.data=r,n.theme&&Gl.inject(n.theme),this.app=n.studio?Qa(uP):Qa(yS),this.app.provide(dn,this.store),this.app.provide("LuminaEngine",this),Qe(()=>this.store.state.currentIndex,(i,o)=>{var l,u;this.store.resetElementStateForSlide(i);const s=this.store.state.deck,a=(l=s==null?void 0:s.slides)==null?void 0:l[i];if(a){Ft.emit("slideChange",{index:i,previousIndex:o??0,slide:a});const c=((u=s==null?void 0:s.meta)==null?void 0:u.reveal)??(a==null?void 0:a.reveal);c&&typeof c=="object"&&this.revealInSequence(i,this.getRevealOptionsFromDeck(s,i))}}),Qe(()=>{var i;return(i=this.store.state.deck)==null?void 0:i.meta},i=>{var o;if(i){const s=i.themeConfig||{},a={colors:i.colors,typography:i.typography,spacing:i.spacing,borderRadius:i.borderRadius,effects:i.effects,components:i.components},l=s&&typeof s=="object"&&!Array.isArray(s)?s:{},u=Fc(l,a),c=this.store.state.deck,d=(c==null?void 0:c.theme)??i.theme??((o=this.store.state.options)==null?void 0:o.theme)??"default";Gl.inject(d,u),i.orbColor&&document.documentElement.style.setProperty("--lumina-colors-primary",i.orbColor),Ft.emit("themeChange",{theme:typeof d=="string"?d:"custom"})}},{deep:!0}),this.app.component("layout-statement",Fy),this.app.component("layout-half",Vy),this.app.component("layout-features",zy),this.app.component("layout-timeline",Uy),this.app.component("layout-steps",By),this.app.component("layout-flex",wq),this.app.component("layout-auto",ZI),this.app.component("layout-custom",XI),this.app.component("layout-chart",WI),this.app.component("layout-video",KI),this.app.component("layout-diagram",lP),this.app.component("layout-free",Iq),this.app.component("LuminaElement",cP),Ft.on("action",i=>{if(i.type==="slide-update"&&typeof i.slideIndex=="number"){const{slideIndex:o,patch:s}=i;s&&typeof s=="object"&&("nodes"in s&&this.store.updateNode(`slides.${o}.nodes`,s.nodes),"edges"in s&&this.store.updateNode(`slides.${o}.edges`,s.edges))}this.store.recordAction(i)}),this.app.mount(this.selector),this.syncSpeakerNotes()}load(e){var n,r,i;if(!e||!Array.isArray(e.slides)){Ft.emit("error",new Error("Invalid deck: expected { meta?, slides: [] }"));return}try{this.store.loadDeck(e),Ft.emit("ready",e);const o=((n=e.meta)==null?void 0:n.reveal)??((i=(r=e.slides)==null?void 0:r[0])==null?void 0:i.reveal);o&&typeof o=="object"&&this.revealInSequence(0,this.getRevealOptionsFromDeck(e,0)),this.syncSpeakerNotes()}catch(o){Ft.emit("error",o instanceof Error?o:new Error(String(o)))}}patch(e){this.store.patchDeck(e),Ft.emit("patch",{diff:e??{}}),this.syncSpeakerNotes()}exportState(){const{currentIndex:e,deck:n,actionHistory:r}=this.store.state,i=n==null?void 0:n.slides[e],o=r.map(a=>`User ${a.type}ed on ${a.label||a.value}`).join(" -> "),s=r.length>5?"High Engagement":"Low Engagement";return Object.freeze({status:"active",currentSlide:{index:e,id:(i==null?void 0:i.id)||e,type:i==null?void 0:i.type,title:(typeof(i==null?void 0:i.title)=="string"?i.title:null)||"(No Title)"},narrative:`User is currently on slide ${e+1}. Session Flow: ${o||"Just started"}.`,engagementLevel:s,history:[...r]})}on(e,n){Ft.on(e,n)}off(e,n){Ft.off(e,n)}emitError(e){Ft.emit("error",e)}destroy(){Ft.emit("destroy",{}),this.closeSpeakerNotes(),this.app&&this.app.unmount(),Ft.clear()}get currentSlideIndex(){return this.store.state.currentIndex}goTo(e){const n=this.store.state.currentIndex;this.store.goto(e),this.store.state.currentIndex!==n&&Ft.emit("navigate",{direction:"goto",fromIndex:n,toIndex:this.store.state.currentIndex}),this.syncSpeakerNotes()}next(){const e=this.store.state.currentIndex;this.store.next(),this.store.state.currentIndex!==e&&Ft.emit("navigate",{direction:"next",fromIndex:e,toIndex:this.store.state.currentIndex}),this.syncSpeakerNotes()}prev(){const e=this.store.state.currentIndex;this.store.prev(),this.store.state.currentIndex!==e&&Ft.emit("navigate",{direction:"prev",fromIndex:e,toIndex:this.store.state.currentIndex}),this.syncSpeakerNotes()}getElementById(e){const n=document.querySelector(this.selector);if(!n)return null;const r=n.querySelector("[data-lumina-root]")||n,i=e.replace(/\\/g,"\\\\").replace(/"/g,'\\"'),o=r.querySelector(`[data-lumina-id="${i}"]`);return o instanceof HTMLElement?o:null}element(e,n){var r;if(typeof e=="number"){const i=(r=this.store.state.deck)==null?void 0:r.slides[e],o=Xx(n),s=i?Vt(i,e,o):Cf(e,...o);return mP(this.store,this,s)}return mP(this.store,this,e)}elements(e){var r;const n=(r=this.store.state.deck)==null?void 0:r.slides[e];return n?Af(n,e):[]}hideAll(e){const n=e??this.currentSlideIndex;return this.elements(n).forEach(r=>this.element(r).hide()),this}showAll(e){const n=e??this.currentSlideIndex;return this.elements(n).forEach(r=>this.element(r).show()),this}showOnly(e,n){const r=n??this.currentSlideIndex;return this.hideAll(r),e.forEach(i=>this.element(i).show()),this}hideAllExcept(e,n){return this.showOnly(e,n)}resetSlide(e){return this.store.resetElementStateForSlide(e??this.currentSlideIndex),this}delay(e){return new Promise(n=>setTimeout(n,e))}getRevealOptionsFromDeck(e,n){var a;const r=e.meta,i=(a=e.slides)==null?void 0:a[n],o=r!=null&&r.reveal&&typeof r.reveal=="object"?r.reveal:{},s=i!=null&&i.reveal&&typeof i.reveal=="object"?i.reveal:{};return{...o,...s}}revealInSequence(e,n){var p,m,g,_,E;const r=e??this.currentSlideIndex;let i=this.elements(r);const o=n??{};(p=o.only)!=null&&p.length&&(i=i.filter(S=>o.only.includes(S))),(m=o.exclude)!=null&&m.length&&(i=i.filter(S=>!o.exclude.includes(S)));const s=(g=this.store.state.deck)==null?void 0:g.slides[r],a=Ys(this.store,s??void 0),l=o.delayMs??a.revealDelayMs,u=o.animate!==!1,c=(E=(_=this.store.state.deck)==null?void 0:_.meta)==null?void 0:E.motions,d=O0({preset:o.preset,motion:o.motion,from:o.from,to:o.to,ease:o.ease,duration:o.duration},{from:{opacity:0,y:16},to:{opacity:1,y:0},ease:a.revealEase,duration:a.revealDuration},c),h=pP({ids:i,delayMs:l,mode:o.staggerMode??"sequential",randomSeed:o.randomSeed??r});return o.hideFirst!==!1&&this.hideAll(r),new Promise(S=>{if(Ft.emit("revealStart",{slideIndex:r,elementIds:h.map(N=>N.id)}),h.length===0){Ft.emit("revealComplete",{slideIndex:r}),S();return}h.forEach((N,D)=>{setTimeout(()=>{Ft.emit("revealElement",{slideIndex:r,elementId:N.id,index:D}),this.element(N.id).show(),u&&this.element(N.id).animate({from:d.from,to:d.to,duration:d.duration,ease:d.ease})},N.delayMs)});const b=(o.staggerMode??"sequential")==="sequential"?h.length*l:h.length?Math.max(...h.map(N=>N.delayMs)):0;setTimeout(()=>{Ft.emit("revealComplete",{slideIndex:r}),S()},b)})}get timelineProgress(){return this._timelineProgress}seekTo(e,n){var s;const r=n??this.currentSlideIndex,i=(s=this.store.state.deck)==null?void 0:s.slides[r],o=i==null?void 0:i.timelineTracks;if(this._timelineProgress=Math.max(0,Math.min(1,e)),Ft.emit("timelineSeek",{progress:this._timelineProgress,slideIndex:r}),!o||typeof o!="object")return this;for(const a of Object.keys(o))this.element(a).animateToProgress(this._timelineProgress,o[a]);return this}playTimeline(e=5,n){var d;const r=n??this.currentSlideIndex,i=(d=this.store.state.deck)==null?void 0:d.slides[r];if(!(i!=null&&i.timelineTracks)||typeof i.timelineTracks!="object")return[Promise.resolve(),()=>{}];this._timelineCancel&&this._timelineCancel();let o=0,s=0;const a=()=>{o&&cancelAnimationFrame(o),o=0,this._timelineCancel=null};this._timelineCancel=a;const l=h=>{s||(s=h);const p=(h-s)/1e3,m=Math.min(1,p/e);this.seekTo(m,r),m<1?o=requestAnimationFrame(l):(o=0,this._timelineCancel=null,Ft.emit("timelineComplete",{slideIndex:r}),u())};let u;const c=new Promise(h=>{u=h});return o=requestAnimationFrame(l),[c,a]}openSpeakerNotes(){if(this.speakerWindow&&!this.speakerWindow.closed)return this.speakerWindow.focus(),this.speakerWindow;if(!ru.isSupported())return console.error("[Lumina] BroadcastChannel not supported."),null;const e=600,n=800,r=window.screenX+window.outerWidth,i=window.screenY;if(this.speakerWindow=window.open("about:blank",`lumina-speaker-notes-${this.speakerChannelId}`,`width=${e},height=${n},left=${r},top=${i},resizable=yes,scrollbars=yes`),!this.speakerWindow)return console.warn("[Lumina] Popup blocked."),null;const o=this.speakerWindow;return o.document.open(),o.document.write(`
|
|
2581
|
+
Edge: ${t}`,USEVUEFLOW_OPTIONS:()=>"The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead"};class Pn extends Error{constructor(e,...n){var r;super((r=yA[e])==null?void 0:r.call(yA,...n)),this.name="VueFlowError",this.code=e,this.args=n}}function v0(t){return"clientX"in t}function IZ(t){return"sourceEvent"in t}function Zi(t,e){const n=v0(t);let r,i;return n?(r=t.clientX,i=t.clientY):"touches"in t&&t.touches.length>0?(r=t.touches[0].clientX,i=t.touches[0].clientY):"changedTouches"in t&&t.changedTouches.length>0?(r=t.changedTouches[0].clientX,i=t.changedTouches[0].clientY):(r=0,i=0),{x:r-((e==null?void 0:e.left)??0),y:i-((e==null?void 0:e.top)??0)}}const xp=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function CZ(t){var e,n;return{width:((e=t.dimensions)==null?void 0:e.width)??t.width??0,height:((n=t.dimensions)==null?void 0:n.height)??t.height??0}}function wp(t,e=[1,1]){return{x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}}const AZ=()=>!0;function y0(t){t==null||t.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function PZ(t,e,n){const r=[],i={x:t.x-n,y:t.y-n,width:n*2,height:n*2};for(const o of e.values())yp(i,vp(o))>0&&r.push(o);return r}const kZ=250;function OZ(t,e,n,r){var i,o;let s=[],a=Number.POSITIVE_INFINITY;const l=PZ(t,n,e+kZ);for(const u of l){const c=[...((i=u.handleBounds)==null?void 0:i.source)??[],...((o=u.handleBounds)==null?void 0:o.target)??[]];for(const d of c){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:h,y:p}=tu(u,d,d.position,!0),m=Math.sqrt((h-t.x)**2+(p-t.y)**2);m>e||(m<a?(s=[{...d,x:h,y:p}],a=m):m===a&&s.push({...d,x:h,y:p}))}}if(!s.length)return null;if(s.length>1){const u=r.type==="source"?"target":"source";return s.find(c=>c.type===u)??s[0]}return s[0]}function bA(t,{handle:e,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:o,doc:s,lib:a,flowId:l,isValidConnection:u=AZ},c,d,h,p){const m=o==="target",g=e?s.querySelector(`.${a}-flow__handle[data-id="${l}-${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`):null,{x:_,y:E}=Zi(t),S=s.elementFromPoint(_,E),y=S!=null&&S.classList.contains(`${a}-flow__handle`)?S:g,b={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){const N=_A(void 0,y),D=y.getAttribute("data-nodeid"),O=y.getAttribute("data-handleid"),k=y.classList.contains("connectable"),w=y.classList.contains("connectableend");if(!D||!N)return b;const P={source:m?D:r,sourceHandle:m?O:i,target:m?r:D,targetHandle:m?i:O};b.connection=P;const v=k&&w&&(n===ps.Strict?m&&N==="source"||!m&&N==="target":D!==r||O!==i);b.isValid=v&&u(P,{nodes:d,edges:c,sourceNode:h(P.source),targetNode:h(P.target)}),b.toHandle=xA(D,N,O,p,n,!0)}return b}function _A(t,e){return t||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function NZ(t,e){let n=null;return e?n="valid":t&&!e&&(n="invalid"),n}function RZ(t,e){let n=null;return e?n=!0:t&&!e&&(n=!1),n}function xA(t,e,n,r,i,o=!1){var s,a,l;const u=r.get(t);if(!u)return null;const c=i===ps.Strict?(s=u.handleBounds)==null?void 0:s[e]:[...((a=u.handleBounds)==null?void 0:a.source)??[],...((l=u.handleBounds)==null?void 0:l.target)??[]],d=(n?c==null?void 0:c.find(h=>h.id===n):c==null?void 0:c[0])??null;return d&&o?{...d,...tu(u,d,d.position,!0)}:d}const b0={[ze.Left]:ze.Right,[ze.Right]:ze.Left,[ze.Top]:ze.Bottom,[ze.Bottom]:ze.Top},DZ=["production","prod"];function od(t,...e){wA()&&console.warn(`[Vue Flow]: ${t}`,...e)}function wA(){return!DZ.includes("production")}function SA(t,e,n,r,i){const o=e.querySelectorAll(`.vue-flow__handle.${t}`);return o!=null&&o.length?Array.from(o).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:t,nodeId:i,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...bp(s)}}):null}function _0(t,e,n,r,i,o=!1,s){i.value=!1,t.selected?(o||t.selected&&e)&&(r([t]),mr(()=>{s.blur()})):n([t])}function Cn(t){return typeof re(t)<"u"}function $Z(t,e,n,r){if(!t||!t.source||!t.target)return n(new Pn(In.EDGE_INVALID,(t==null?void 0:t.id)??"[ID UNKNOWN]")),!1;let i;return ms(t)?i=t:i={...t,id:eA(t)},i=QC(i,void 0,r),pZ(i,e)?!1:i}function MZ(t,e,n,r,i){if(!e.source||!e.target)return i(new Pn(In.EDGE_INVALID,t.id)),!1;if(!n)return i(new Pn(In.EDGE_NOT_FOUND,t.id)),!1;const{id:o,...s}=t;return{...s,id:r?eA(e):o,source:e.source,target:e.target,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle}}function EA(t,e,n){const r={},i=[];for(let o=0;o<t.length;++o){const s=t[o];if(!_a(s)){n(new Pn(In.NODE_INVALID,s==null?void 0:s.id)||`[ID UNKNOWN|INDEX ${o}]`);continue}const a=dZ(s,e(s.id),s.parentNode);s.parentNode&&(r[s.parentNode]=!0),i[o]=a}for(const o of i){const s=e(o.parentNode)||i.find(a=>a.id===o.parentNode);o.parentNode&&!s&&n(new Pn(In.NODE_MISSING_PARENT,o.id,o.parentNode)),(o.parentNode||r[o.id])&&(r[o.id]&&(o.isParent=!0),s&&(s.isParent=!0))}return i}function TA(t,e,n,r,i,o){let s=i;const a=r.get(s)||new Map;r.set(s,a.set(n,e)),s=`${i}-${t}`;const l=r.get(s)||new Map;if(r.set(s,l.set(n,e)),o){s=`${i}-${t}-${o}`;const u=r.get(s)||new Map;r.set(s,u.set(n,e))}}function x0(t,e,n){t.clear();for(const r of n){const{source:i,target:o,sourceHandle:s=null,targetHandle:a=null}=r,l={edgeId:r.id,source:i,target:o,sourceHandle:s,targetHandle:a},u=`${i}-${s}--${o}-${a}`,c=`${o}-${a}--${i}-${s}`;TA("source",l,c,t,i,s),TA("target",l,u,t,o,a)}}function IA(t,e){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}function w0(t,e,n,r,i,o,s,a){const l=[];for(const u of t){const c=ms(u)?u:$Z(u,a,i,o);if(!c)continue;const d=n(c.source),h=n(c.target);if(!d||!h){i(new Pn(In.EDGE_SOURCE_TARGET_MISSING,c.id,c.source,c.target));continue}if(!d){i(new Pn(In.EDGE_SOURCE_MISSING,c.id,c.source));continue}if(!h){i(new Pn(In.EDGE_TARGET_MISSING,c.id,c.target));continue}if(e&&!e(c,{edges:a,nodes:s,sourceNode:d,targetNode:h})){i(new Pn(In.EDGE_INVALID,c.id));continue}const p=r(c.id);l.push({...QC(c,p,o),sourceNode:d,targetNode:h})}return l}const CA=Symbol("vueFlow"),S0=Symbol("nodeId"),AA=Symbol("nodeRef"),LZ=Symbol("edgeId"),VZ=Symbol("edgeRef"),Sp=Symbol("slots");function PA(t){const{vueFlowRef:e,snapToGrid:n,snapGrid:r,noDragClassName:i,nodeLookup:o,nodeExtent:s,nodeDragThreshold:a,viewport:l,autoPanOnNodeDrag:u,autoPanSpeed:c,nodesDraggable:d,panBy:h,findNode:p,multiSelectionActive:m,nodesSelectionActive:g,selectNodesOnDrag:_,removeSelectedElements:E,addSelectedNodes:S,updateNodePositions:y,emits:b}=Dt(),{onStart:N,onDrag:D,onStop:O,onClick:k,el:w,disabled:P,id:C,selectable:v,dragHandle:x}=t,I=Ii(!1);let V=[],M,H=null,G={x:void 0,y:void 0},Y={x:0,y:0},se=null,ie=!1,ue=!1,_e=0,Ee=!1;const he=kA(),de=({x:$e,y:B})=>{G={x:$e,y:B};let $=!1;if(V=V.map(L=>{const z={x:$e-L.distance.x,y:B-L.distance.y},{computedPosition:F}=g0(L,n.value?wp(z,r.value):z,b.error,s.value,L.parentNode?p(L.parentNode):void 0);return $=$||L.position.x!==F.x||L.position.y!==F.y,L.position=F,L}),ue=ue||$,!!$&&(y(V,!0,!0),I.value=!0,se)){const[L,z]=m0({id:C,dragItems:V,findNode:p});D({event:se,node:L,nodes:z})}},pe=()=>{if(!H)return;const[$e,B]=uA(Y,H,c.value);if($e!==0||B!==0){const $={x:(G.x??0)-$e/l.value.zoom,y:(G.y??0)-B/l.value.zoom};h({x:$e,y:B})&&de($)}_e=requestAnimationFrame(pe)},Le=($e,B)=>{ie=!0;const $=p(C);!_.value&&!m.value&&$&&($.selected||E()),$&&dt(v)&&_.value&&_0($,m.value,S,E,g,!1,B);const L=he($e.sourceEvent);if(G=L,V=_Z(o.value,d.value,L,C),V.length){const[z,F]=m0({id:C,dragItems:V,findNode:p});N({event:$e.sourceEvent,node:z,nodes:F})}},De=($e,B)=>{var $;$e.sourceEvent.type==="touchmove"&&$e.sourceEvent.touches.length>1||(ue=!1,a.value===0&&Le($e,B),G=he($e.sourceEvent),H=(($=e.value)==null?void 0:$.getBoundingClientRect())||null,Y=Zi($e.sourceEvent,H))},Be=($e,B)=>{const $=he($e.sourceEvent);if(!Ee&&ie&&u.value&&(Ee=!0,pe()),!ie){const L=$.xSnapped-(G.x??0),z=$.ySnapped-(G.y??0);Math.sqrt(L*L+z*z)>a.value&&Le($e,B)}(G.x!==$.xSnapped||G.y!==$.ySnapped)&&V.length&&ie&&(se=$e.sourceEvent,Y=Zi($e.sourceEvent,H),de($))},et=$e=>{let B=!1;if(!ie&&!I.value&&!m.value){const $=$e.sourceEvent,L=he($),z=L.xSnapped-(G.x??0),F=L.ySnapped-(G.y??0),W=Math.sqrt(z*z+F*F);W!==0&&W<=a.value&&(k==null||k($),B=!0)}if(V.length&&!B){ue&&(y(V,!1,!1),ue=!1);const[$,L]=m0({id:C,dragItems:V,findNode:p});O({event:$e.sourceEvent,node:$,nodes:L})}V=[],I.value=!1,Ee=!1,ie=!1,G={x:void 0,y:void 0},cancelAnimationFrame(_e)};return Qe([()=>dt(P),w],([$e,B],$,L)=>{if(B){const z=_i(B);$e||(M=cW().on("start",F=>De(F,B)).on("drag",F=>Be(F,B)).on("end",F=>et(F)).filter(F=>{const W=F.target,ee=dt(x);return!F.button&&(!i.value||!mA(W,`.${i.value}`,B)&&(!ee||mA(W,ee,B)))}),z.call(M)),L(()=>{z.on(".drag",null),M&&(M.on("start",null),M.on("drag",null),M.on("end",null))})}}),I}function FZ(){return{doubleClick:Re(),click:Re(),mouseEnter:Re(),mouseMove:Re(),mouseLeave:Re(),contextMenu:Re(),updateStart:Re(),update:Re(),updateEnd:Re()}}function zZ(t,e){const n=FZ();return n.doubleClick.on(r=>{var i,o;e.edgeDoubleClick(r),(o=(i=t.events)==null?void 0:i.doubleClick)==null||o.call(i,r)}),n.click.on(r=>{var i,o;e.edgeClick(r),(o=(i=t.events)==null?void 0:i.click)==null||o.call(i,r)}),n.mouseEnter.on(r=>{var i,o;e.edgeMouseEnter(r),(o=(i=t.events)==null?void 0:i.mouseEnter)==null||o.call(i,r)}),n.mouseMove.on(r=>{var i,o;e.edgeMouseMove(r),(o=(i=t.events)==null?void 0:i.mouseMove)==null||o.call(i,r)}),n.mouseLeave.on(r=>{var i,o;e.edgeMouseLeave(r),(o=(i=t.events)==null?void 0:i.mouseLeave)==null||o.call(i,r)}),n.contextMenu.on(r=>{var i,o;e.edgeContextMenu(r),(o=(i=t.events)==null?void 0:i.contextMenu)==null||o.call(i,r)}),n.updateStart.on(r=>{var i,o;e.edgeUpdateStart(r),(o=(i=t.events)==null?void 0:i.updateStart)==null||o.call(i,r)}),n.update.on(r=>{var i,o;e.edgeUpdate(r),(o=(i=t.events)==null?void 0:i.update)==null||o.call(i,r)}),n.updateEnd.on(r=>{var i,o;e.edgeUpdateEnd(r),(o=(i=t.events)==null?void 0:i.updateEnd)==null||o.call(i,r)}),Object.entries(n).reduce((r,[i,o])=>(r.emit[i]=o.trigger,r.on[i]=o.on,r),{emit:{},on:{}})}function kA(){const{viewport:t,snapGrid:e,snapToGrid:n,vueFlowRef:r}=Dt();return i=>{var o;const s=((o=r.value)==null?void 0:o.getBoundingClientRect())??{left:0,top:0},a=IZ(i)?i.sourceEvent:i,{x:l,y:u}=Zi(a,s),c=rd({x:l,y:u},t.value),{x:d,y:h}=n.value?wp(c,e.value):c;return{xSnapped:d,ySnapped:h,...c}}}function Ep(){return!0}function OA({handleId:t,nodeId:e,type:n,isValidConnection:r,edgeUpdaterType:i,onEdgeUpdate:o,onEdgeUpdateEnd:s}){const{id:a,vueFlowRef:l,connectionMode:u,connectionRadius:c,connectOnClick:d,connectionClickStartHandle:h,nodesConnectable:p,autoPanOnConnect:m,autoPanSpeed:g,findNode:_,panBy:E,startConnection:S,updateConnection:y,endConnection:b,emits:N,viewport:D,edges:O,nodes:k,isValidConnection:w,nodeLookup:P}=Dt();let C=null,v=!1,x=null;function I(M){var H;const G=dt(n)==="target",Y=v0(M),se=JC(M.target),ie=M.currentTarget;if(ie&&(Y&&M.button===0||!Y)){let ue=function(Q){$=Zi(Q,et),de=OZ(rd($,D.value,!1,[1,1]),c.value,P.value,F),L||(z(),L=!0);const ye=bA(Q,{handle:de,connectionMode:u.value,fromNodeId:dt(e),fromHandleId:dt(t),fromType:G?"target":"source",isValidConnection:he,doc:se,lib:"vue",flowId:a,nodeLookup:P.value},O.value,k.value,_,P.value);x=ye.handleDomNode,C=ye.connection,v=RZ(!!de,ye.isValid);const fe={...te,isValid:v,to:ye.toHandle&&v?nd({x:ye.toHandle.x,y:ye.toHandle.y},D.value):$,toHandle:ye.toHandle,toPosition:v&&ye.toHandle?ye.toHandle.position:b0[F.position],toNode:ye.toHandle?P.value.get(ye.toHandle.nodeId):null};if(v&&de&&(te!=null&&te.toHandle)&&fe.toHandle&&te.toHandle.type===fe.toHandle.type&&te.toHandle.nodeId===fe.toHandle.nodeId&&te.toHandle.id===fe.toHandle.id&&te.to.x===fe.to.x&&te.to.y===fe.to.y)return;const be=de??ye.toHandle;if(y(be&&v?nd({x:be.x,y:be.y},D.value):$,be,NZ(!!be,v)),te=fe,!de&&!v&&!x)return y0(B);C&&C.source!==C.target&&x&&(y0(B),B=x,x.classList.add("connecting","vue-flow__handle-connecting"),x.classList.toggle("valid",!!v),x.classList.toggle("vue-flow__handle-valid",!!v))},_e=function(Q){"touches"in Q&&Q.touches.length>0||((de||x)&&C&&v&&(o?o(Q,C):N.connect(C)),N.connectEnd(Q),i&&(s==null||s(Q)),y0(B),cancelAnimationFrame(pe),b(Q),L=!1,v=!1,C=null,x=null,se.removeEventListener("mousemove",ue),se.removeEventListener("mouseup",_e),se.removeEventListener("touchmove",ue),se.removeEventListener("touchend",_e))};const Ee=_(dt(e));let he=dt(r)||w.value||Ep;!he&&Ee&&(he=(G?Ee.isValidSourcePos:Ee.isValidTargetPos)||Ep);let de,pe=0;const{x:Le,y:De}=Zi(M),Be=_A(dt(i),ie),et=(H=l.value)==null?void 0:H.getBoundingClientRect();if(!et||!Be)return;const $e=xA(dt(e),Be,dt(t),P.value,u.value);if(!$e)return;let B,$=Zi(M,et),L=!1;const z=()=>{if(!m.value)return;const[Q,ye]=uA($,et,g.value);E({x:Q,y:ye}),pe=requestAnimationFrame(z)},F={...$e,nodeId:dt(e),type:Be,position:$e.position},W=P.value.get(dt(e)),J={inProgress:!0,isValid:null,from:tu(W,F,ze.Left,!0),fromHandle:F,fromPosition:F.position,fromNode:W,to:$,toHandle:null,toPosition:b0[F.position],toNode:null};S({nodeId:dt(e),id:dt(t),type:Be,position:(ie==null?void 0:ie.getAttribute("data-handlepos"))||ze.Top,...$},{x:Le-et.left,y:De-et.top}),N.connectStart({event:M,nodeId:dt(e),handleId:dt(t),handleType:Be});let te=J;se.addEventListener("mousemove",ue),se.addEventListener("mouseup",_e),se.addEventListener("touchmove",ue),se.addEventListener("touchend",_e)}}function V(M){var H,G;if(!d.value)return;const Y=dt(n)==="target";if(!h.value){N.clickConnectStart({event:M,nodeId:dt(e),handleId:dt(t)}),S({nodeId:dt(e),type:dt(n),id:dt(t),position:ze.Top,...Zi(M)},void 0,!0);return}let se=dt(r)||w.value||Ep;const ie=_(dt(e));if(!se&&ie&&(se=(Y?ie.isValidSourcePos:ie.isValidTargetPos)||Ep),ie&&(typeof ie.connectable>"u"?p.value:ie.connectable)===!1)return;const ue=JC(M.target),_e=bA(M,{handle:{nodeId:dt(e),id:dt(t),type:dt(n),position:ze.Top,...Zi(M)},connectionMode:u.value,fromNodeId:h.value.nodeId,fromHandleId:h.value.id??null,fromType:h.value.type,isValidConnection:se,doc:ue,lib:"vue",flowId:a,nodeLookup:P.value},O.value,k.value,_,P.value),Ee=((H=_e.connection)==null?void 0:H.source)===((G=_e.connection)==null?void 0:G.target);_e.isValid&&_e.connection&&!Ee&&N.connect(_e.connection),N.clickConnectEnd(M),b(M,!0)}return{handlePointerDown:I,handleClick:V}}function UZ(){return bt(S0,"")}function NA(t){const e=t??UZ()??"",n=bt(AA,we(null)),{findNode:r,edges:i,emits:o}=Dt(),s=r(e);return s||o.error(new Pn(In.NODE_NOT_FOUND,e)),{id:e,nodeEl:n,node:s,parentNode:Z(()=>r(s.parentNode)),connectedEdges:Z(()=>iA([s],i.value))}}function BZ(){return{doubleClick:Re(),click:Re(),mouseEnter:Re(),mouseMove:Re(),mouseLeave:Re(),contextMenu:Re(),dragStart:Re(),drag:Re(),dragStop:Re()}}function jZ(t,e){const n=BZ();return n.doubleClick.on(r=>{var i,o;e.nodeDoubleClick(r),(o=(i=t.events)==null?void 0:i.doubleClick)==null||o.call(i,r)}),n.click.on(r=>{var i,o;e.nodeClick(r),(o=(i=t.events)==null?void 0:i.click)==null||o.call(i,r)}),n.mouseEnter.on(r=>{var i,o;e.nodeMouseEnter(r),(o=(i=t.events)==null?void 0:i.mouseEnter)==null||o.call(i,r)}),n.mouseMove.on(r=>{var i,o;e.nodeMouseMove(r),(o=(i=t.events)==null?void 0:i.mouseMove)==null||o.call(i,r)}),n.mouseLeave.on(r=>{var i,o;e.nodeMouseLeave(r),(o=(i=t.events)==null?void 0:i.mouseLeave)==null||o.call(i,r)}),n.contextMenu.on(r=>{var i,o;e.nodeContextMenu(r),(o=(i=t.events)==null?void 0:i.contextMenu)==null||o.call(i,r)}),n.dragStart.on(r=>{var i,o;e.nodeDragStart(r),(o=(i=t.events)==null?void 0:i.dragStart)==null||o.call(i,r)}),n.drag.on(r=>{var i,o;e.nodeDrag(r),(o=(i=t.events)==null?void 0:i.drag)==null||o.call(i,r)}),n.dragStop.on(r=>{var i,o;e.nodeDragStop(r),(o=(i=t.events)==null?void 0:i.dragStop)==null||o.call(i,r)}),Object.entries(n).reduce((r,[i,o])=>(r.emit[i]=o.trigger,r.on[i]=o.on,r),{emit:{},on:{}})}function RA(){const{getSelectedNodes:t,nodeExtent:e,updateNodePositions:n,findNode:r,snapGrid:i,snapToGrid:o,nodesDraggable:s,emits:a}=Dt();return(l,u=!1)=>{const c=o.value?i.value[0]:5,d=o.value?i.value[1]:5,h=u?4:1,p=l.x*c*h,m=l.y*d*h,g=[];for(const _ of t.value)if(_.draggable||s&&typeof _.draggable>"u"){const E={x:_.computedPosition.x+p,y:_.computedPosition.y+m},{position:S}=g0(_,E,a.error,e.value,_.parentNode?r(_.parentNode):void 0);g.push({id:_.id,position:S,from:_.position,distance:{x:l.x,y:l.y},dimensions:_.dimensions})}n(g,!0,!1)}}const Tp=.1,HZ=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2;function ys(){return od("Viewport not initialized yet."),Promise.resolve(!1)}const GZ={zoomIn:ys,zoomOut:ys,zoomTo:ys,fitView:ys,setCenter:ys,fitBounds:ys,project:t=>t,screenToFlowCoordinate:t=>t,flowToScreenCoordinate:t=>t,setViewport:ys,setTransform:ys,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function WZ(t){function e(r,i){return new Promise(o=>{t.d3Selection&&t.d3Zoom?t.d3Zoom.interpolate((i==null?void 0:i.interpolate)==="linear"?Kc:ap).scaleBy(E0(t.d3Selection,i==null?void 0:i.duration,i==null?void 0:i.ease,()=>{o(!0)}),r):o(!1)})}function n(r,i,o,s){return new Promise(a=>{var l;const{x:u,y:c}=YC({x:-r,y:-i},t.translateExtent),d=Ql.translate(-u,-c).scale(o);t.d3Selection&&t.d3Zoom?(l=t.d3Zoom)==null||l.interpolate((s==null?void 0:s.interpolate)==="linear"?Kc:ap).transform(E0(t.d3Selection,s==null?void 0:s.duration,s==null?void 0:s.ease,()=>{a(!0)}),d):a(!1)})}return Z(()=>t.d3Zoom&&t.d3Selection&&t.dimensions.width&&t.dimensions.height?{viewportInitialized:!0,zoomIn:i=>e(1.2,i),zoomOut:i=>e(1/1.2,i),zoomTo:(i,o)=>new Promise(s=>{t.d3Selection&&t.d3Zoom?t.d3Zoom.interpolate((o==null?void 0:o.interpolate)==="linear"?Kc:ap).scaleTo(E0(t.d3Selection,o==null?void 0:o.duration,o==null?void 0:o.ease,()=>{s(!0)}),i):s(!1)}),setViewport:(i,o)=>n(i.x,i.y,i.zoom,o),setTransform:(i,o)=>n(i.x,i.y,i.zoom,o),getViewport:()=>({x:t.viewport.x,y:t.viewport.y,zoom:t.viewport.zoom}),getTransform:()=>({x:t.viewport.x,y:t.viewport.y,zoom:t.viewport.zoom}),fitView:(i={padding:Tp,includeHiddenNodes:!1,duration:0})=>{var o,s;const a=[];for(const h of t.nodes)h.dimensions.width&&h.dimensions.height&&((i==null?void 0:i.includeHiddenNodes)||!h.hidden)&&(!((o=i.nodes)!=null&&o.length)||(s=i.nodes)!=null&&s.length&&i.nodes.includes(h.id))&&a.push(h);if(!a.length)return Promise.resolve(!1);const l=nA(a),{x:u,y:c,zoom:d}=oA(l,t.dimensions.width,t.dimensions.height,i.minZoom??t.minZoom,i.maxZoom??t.maxZoom,i.padding??Tp);return n(u,c,d,i)},setCenter:(i,o,s)=>{const a=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:t.maxZoom,l=t.dimensions.width/2-i*a,u=t.dimensions.height/2-o*a;return n(l,u,a,s)},fitBounds:(i,o={padding:Tp})=>{const{x:s,y:a,zoom:l}=oA(i,t.dimensions.width,t.dimensions.height,t.minZoom,t.maxZoom,o.padding??Tp);return n(s,a,l,o)},project:i=>rd(i,t.viewport,t.snapToGrid,t.snapGrid),screenToFlowCoordinate:i=>{if(t.vueFlowRef){const{x:o,y:s}=t.vueFlowRef.getBoundingClientRect(),a={x:i.x-o,y:i.y-s};return rd(a,t.viewport,t.snapToGrid,t.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:i=>{if(t.vueFlowRef){const{x:o,y:s}=t.vueFlowRef.getBoundingClientRect(),a={x:i.x+o,y:i.y+s};return nd(a,t.viewport)}return{x:0,y:0}}}:GZ)}function E0(t,e=0,n=HZ,r=()=>{}){const i=typeof e=="number"&&e>0;return i||r(),i?t.transition().duration(e).ease(n).on("end",r):t}function KZ(t,e,n){const r=Jp(!0);return r.run(()=>{const i=()=>{r.run(()=>{let g,_,E=!!(n.nodes.value.length||n.edges.value.length);g=Kl([t.modelValue,()=>{var S,y;return(y=(S=t.modelValue)==null?void 0:S.value)==null?void 0:y.length}],([S])=>{S&&Array.isArray(S)&&(_==null||_.pause(),n.setElements(S),!_&&!E&&S.length?E=!0:_==null||_.resume())}),_=Kl([n.nodes,n.edges,()=>n.edges.value.length,()=>n.nodes.value.length],([S,y])=>{var b;(b=t.modelValue)!=null&&b.value&&Array.isArray(t.modelValue.value)&&(g==null||g.pause(),t.modelValue.value=[...S,...y],mr(()=>{g==null||g.resume()}))},{immediate:E}),du(()=>{g==null||g.stop(),_==null||_.stop()})})},o=()=>{r.run(()=>{let g,_,E=!!n.nodes.value.length;g=Kl([t.nodes,()=>{var S,y;return(y=(S=t.nodes)==null?void 0:S.value)==null?void 0:y.length}],([S])=>{S&&Array.isArray(S)&&(_==null||_.pause(),n.setNodes(S),!_&&!E&&S.length?E=!0:_==null||_.resume())}),_=Kl([n.nodes,()=>n.nodes.value.length],([S])=>{var y;(y=t.nodes)!=null&&y.value&&Array.isArray(t.nodes.value)&&(g==null||g.pause(),t.nodes.value=[...S],mr(()=>{g==null||g.resume()}))},{immediate:E}),du(()=>{g==null||g.stop(),_==null||_.stop()})})},s=()=>{r.run(()=>{let g,_,E=!!n.edges.value.length;g=Kl([t.edges,()=>{var S,y;return(y=(S=t.edges)==null?void 0:S.value)==null?void 0:y.length}],([S])=>{S&&Array.isArray(S)&&(_==null||_.pause(),n.setEdges(S),!_&&!E&&S.length?E=!0:_==null||_.resume())}),_=Kl([n.edges,()=>n.edges.value.length],([S])=>{var y;(y=t.edges)!=null&&y.value&&Array.isArray(t.edges.value)&&(g==null||g.pause(),t.edges.value=[...S],mr(()=>{g==null||g.resume()}))},{immediate:E}),du(()=>{g==null||g.stop(),_==null||_.stop()})})},a=()=>{r.run(()=>{Qe(()=>e.maxZoom,()=>{e.maxZoom&&Cn(e.maxZoom)&&n.setMaxZoom(e.maxZoom)},{immediate:!0})})},l=()=>{r.run(()=>{Qe(()=>e.minZoom,()=>{e.minZoom&&Cn(e.minZoom)&&n.setMinZoom(e.minZoom)},{immediate:!0})})},u=()=>{r.run(()=>{Qe(()=>e.translateExtent,()=>{e.translateExtent&&Cn(e.translateExtent)&&n.setTranslateExtent(e.translateExtent)},{immediate:!0})})},c=()=>{r.run(()=>{Qe(()=>e.nodeExtent,()=>{e.nodeExtent&&Cn(e.nodeExtent)&&n.setNodeExtent(e.nodeExtent)},{immediate:!0})})},d=()=>{r.run(()=>{Qe(()=>e.applyDefault,()=>{Cn(e.applyDefault)&&(n.applyDefault.value=e.applyDefault)},{immediate:!0})})},h=()=>{r.run(()=>{const g=async _=>{let E=_;typeof e.autoConnect=="function"&&(E=await e.autoConnect(_)),E!==!1&&n.addEdges([E])};Qe(()=>e.autoConnect,()=>{Cn(e.autoConnect)&&(n.autoConnect.value=e.autoConnect)},{immediate:!0}),Qe(n.autoConnect,(_,E,S)=>{_?n.onConnect(g):n.hooks.value.connect.off(g),S(()=>{n.hooks.value.connect.off(g)})},{immediate:!0})})},p=()=>{const g=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const _ of Object.keys(e)){const E=_;if(!g.includes(E)){const S=Ot(()=>e[E]),y=n[E];Jt(y)&&r.run(()=>{Qe(S,b=>{Cn(b)&&(y.value=b)},{immediate:!0})})}}};(()=>{i(),o(),s(),l(),a(),u(),c(),d(),h(),p()})()}),()=>r.stop()}function ZZ(){return{edgesChange:Re(),nodesChange:Re(),nodeDoubleClick:Re(),nodeClick:Re(),nodeMouseEnter:Re(),nodeMouseMove:Re(),nodeMouseLeave:Re(),nodeContextMenu:Re(),nodeDragStart:Re(),nodeDrag:Re(),nodeDragStop:Re(),nodesInitialized:Re(),miniMapNodeClick:Re(),miniMapNodeDoubleClick:Re(),miniMapNodeMouseEnter:Re(),miniMapNodeMouseMove:Re(),miniMapNodeMouseLeave:Re(),connect:Re(),connectStart:Re(),connectEnd:Re(),clickConnectStart:Re(),clickConnectEnd:Re(),paneReady:Re(),init:Re(),move:Re(),moveStart:Re(),moveEnd:Re(),selectionDragStart:Re(),selectionDrag:Re(),selectionDragStop:Re(),selectionContextMenu:Re(),selectionStart:Re(),selectionEnd:Re(),viewportChangeStart:Re(),viewportChange:Re(),viewportChangeEnd:Re(),paneScroll:Re(),paneClick:Re(),paneContextMenu:Re(),paneMouseEnter:Re(),paneMouseMove:Re(),paneMouseLeave:Re(),edgeContextMenu:Re(),edgeMouseEnter:Re(),edgeMouseMove:Re(),edgeMouseLeave:Re(),edgeDoubleClick:Re(),edgeClick:Re(),edgeUpdateStart:Re(),edgeUpdate:Re(),edgeUpdateEnd:Re(),updateNodeInternals:Re(),error:Re(t=>od(t.message))}}function XZ(t,e){const n=xn();vm(()=>{for(const[i,o]of Object.entries(e.value)){const s=a=>{t(i,a)};o.setEmitter(s),Uc(o.removeEmitter),o.setHasEmitListeners(()=>r(i)),Uc(o.removeHasEmitListeners)}});function r(i){var o;const s=YZ(i);return!!((o=n==null?void 0:n.vnode.props)==null?void 0:o[s])}}function YZ(t){const[e,...n]=t.split(":");return`on${e.replace(/(?:^|-)(\w)/g,(i,o)=>o.toUpperCase())}${n.length?`:${n.join(":")}`:""}`}function DA(){return{vueFlowRef:null,viewportRef:null,nodes:[],edges:[],connectionLookup:new Map,nodeTypes:{},edgeTypes:{},initialized:!1,dimensions:{width:0,height:0},viewport:{x:0,y:0,zoom:1},d3Zoom:null,d3Selection:null,d3ZoomHandler:null,minZoom:.5,maxZoom:2,translateExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],nodeExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],selectionMode:d0.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:qc.Free,paneClickDistance:0,panOnDrag:!0,edgeUpdaterRadius:10,onlyRenderVisibleElements:!1,defaultViewport:{x:0,y:0,zoom:1},nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,defaultMarkerColor:"#b1b1b7",connectionLineStyle:{},connectionLineType:null,connectionLineOptions:{type:ba.Bezier,style:{}},connectionMode:ps.Loose,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectionPosition:{x:Number.NaN,y:Number.NaN},connectionRadius:20,connectOnClick:!0,connectionStatus:null,isValidConnection:null,snapGrid:[15,15],snapToGrid:!1,edgesUpdatable:!1,edgesFocusable:!0,nodesFocusable:!0,nodesConnectable:!0,nodesDraggable:!0,nodeDragThreshold:1,elementsSelectable:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,selectionKeyCode:"Shift",multiSelectionKeyCode:xp()?"Meta":"Control",zoomActivationKeyCode:xp()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:ZZ(),applyDefault:!0,autoConnect:!1,fitViewOnInit:!1,fitViewOnInitDone:!1,noDragClassName:"nodrag",noWheelClassName:"nowheel",noPanClassName:"nopan",defaultEdgeOptions:void 0,elevateEdgesOnSelect:!1,elevateNodesOnSelect:!0,autoPanOnNodeDrag:!0,autoPanOnConnect:!0,autoPanSpeed:15,disableKeyboardA11y:!1,ariaLiveMessage:""}}const JZ=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function QZ(t,e,n){const r=WZ(t),i=$=>{const L=$??[];t.hooks.updateNodeInternals.trigger(L)},o=$=>hZ($,t.nodes,t.edges),s=$=>fZ($,t.nodes,t.edges),a=$=>iA($,t.edges),l=({id:$,type:L,nodeId:z})=>{var F;const W=$?`-${L}-${$}`:`-${L}`;return Array.from(((F=t.connectionLookup.get(`${z}${W}`))==null?void 0:F.values())??[])},u=$=>{if($)return e.value.get($)},c=$=>{if($)return n.value.get($)},d=($,L,z)=>{var F,W;const ee=[];for(const J of $){const te={id:J.id,type:"position",dragging:z,from:J.from};if(L&&(te.position=J.position,J.parentNode)){const Q=u(J.parentNode);te.position={x:te.position.x-(((F=Q==null?void 0:Q.computedPosition)==null?void 0:F.x)??0),y:te.position.y-(((W=Q==null?void 0:Q.computedPosition)==null?void 0:W.y)??0)}}ee.push(te)}ee!=null&&ee.length&&t.hooks.nodesChange.trigger(ee)},h=$=>{if(!t.vueFlowRef)return;const L=t.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!L)return;const z=window.getComputedStyle(L),{m22:F}=new window.DOMMatrixReadOnly(z.transform),W=[];for(const ee of $){const J=ee,te=u(J.id);if(te){const Q=bp(J.nodeElement);if(!!(Q.width&&Q.height&&(te.dimensions.width!==Q.width||te.dimensions.height!==Q.height||J.forceUpdate))){const fe=J.nodeElement.getBoundingClientRect();te.dimensions=Q,te.handleBounds.source=SA("source",J.nodeElement,fe,F,te.id),te.handleBounds.target=SA("target",J.nodeElement,fe,F,te.id),W.push({id:te.id,type:"dimensions",dimensions:Q})}}}!t.fitViewOnInitDone&&t.fitViewOnInit&&r.value.fitView().then(()=>{t.fitViewOnInitDone=!0}),W.length&&t.hooks.nodesChange.trigger(W)},p=($,L)=>{const z=new Set,F=new Set;for(const J of $)_a(J)?z.add(J.id):ms(J)&&F.add(J.id);const W=vs(e.value,z,!0),ee=vs(n.value,F);if(t.multiSelectionActive){for(const J of z)W.push(gs(J,L));for(const J of F)ee.push(gs(J,L))}W.length&&t.hooks.nodesChange.trigger(W),ee.length&&t.hooks.edgesChange.trigger(ee)},m=$=>{if(t.multiSelectionActive){const L=$.map(z=>gs(z.id,!0));t.hooks.nodesChange.trigger(L);return}t.hooks.nodesChange.trigger(vs(e.value,new Set($.map(L=>L.id)),!0)),t.hooks.edgesChange.trigger(vs(n.value))},g=$=>{if(t.multiSelectionActive){const L=$.map(z=>gs(z.id,!0));t.hooks.edgesChange.trigger(L);return}t.hooks.edgesChange.trigger(vs(n.value,new Set($.map(L=>L.id)))),t.hooks.nodesChange.trigger(vs(e.value,new Set,!0))},_=$=>{p($,!0)},E=$=>{const z=($||t.nodes).map(F=>(F.selected=!1,gs(F.id,!1)));t.hooks.nodesChange.trigger(z)},S=$=>{const z=($||t.edges).map(F=>(F.selected=!1,gs(F.id,!1)));t.hooks.edgesChange.trigger(z)},y=$=>{if(!$||!$.length)return p([],!1);const L=$.reduce((z,F)=>{const W=gs(F.id,!1);return _a(F)?z.nodes.push(W):z.edges.push(W),z},{nodes:[],edges:[]});L.nodes.length&&t.hooks.nodesChange.trigger(L.nodes),L.edges.length&&t.hooks.edgesChange.trigger(L.edges)},b=$=>{var L;(L=t.d3Zoom)==null||L.scaleExtent([$,t.maxZoom]),t.minZoom=$},N=$=>{var L;(L=t.d3Zoom)==null||L.scaleExtent([t.minZoom,$]),t.maxZoom=$},D=$=>{var L;(L=t.d3Zoom)==null||L.translateExtent($),t.translateExtent=$},O=$=>{t.nodeExtent=$,i()},k=$=>{var L;(L=t.d3Zoom)==null||L.clickDistance($)},w=$=>{t.nodesDraggable=$,t.nodesConnectable=$,t.elementsSelectable=$},P=$=>{const L=$ instanceof Function?$(t.nodes):$;!t.initialized&&!L.length||(t.nodes=EA(L,u,t.hooks.error.trigger))},C=$=>{const L=$ instanceof Function?$(t.edges):$;if(!t.initialized&&!L.length)return;const z=w0(L,t.isValidConnection,u,c,t.hooks.error.trigger,t.defaultEdgeOptions,t.nodes,t.edges);x0(t.connectionLookup,n.value,z),t.edges=z},v=$=>{const L=$ instanceof Function?$([...t.nodes,...t.edges]):$;!t.initialized&&!L.length||(P(L.filter(_a)),C(L.filter(ms)))},x=$=>{let L=$ instanceof Function?$(t.nodes):$;L=Array.isArray(L)?L:[L];const z=EA(L,u,t.hooks.error.trigger),F=[];for(const W of z)F.push(dA(W));F.length&&t.hooks.nodesChange.trigger(F)},I=$=>{let L=$ instanceof Function?$(t.edges):$;L=Array.isArray(L)?L:[L];const z=w0(L,t.isValidConnection,u,c,t.hooks.error.trigger,t.defaultEdgeOptions,t.nodes,t.edges),F=[];for(const W of z)F.push(dA(W));F.length&&t.hooks.edgesChange.trigger(F)},V=($,L=!0,z=!1)=>{const F=$ instanceof Function?$(t.nodes):$,W=Array.isArray(F)?F:[F],ee=[],J=[];function te(ye){const fe=a(ye);for(const be of fe)(!Cn(be.deletable)||be.deletable)&&J.push(hA(be.id,be.source,be.target,be.sourceHandle,be.targetHandle))}function Q(ye){const fe=[];for(const be of t.nodes)be.parentNode===ye&&fe.push(be);if(fe.length){for(const be of fe)ee.push(fA(be.id));L&&te(fe);for(const be of fe)Q(be.id)}}for(const ye of W){const fe=typeof ye=="string"?u(ye):ye;fe&&(Cn(fe.deletable)&&!fe.deletable||(ee.push(fA(fe.id)),L&&te([fe]),z&&Q(fe.id)))}J.length&&t.hooks.edgesChange.trigger(J),ee.length&&t.hooks.nodesChange.trigger(ee)},M=$=>{const L=$ instanceof Function?$(t.edges):$,z=Array.isArray(L)?L:[L],F=[];for(const W of z){const ee=typeof W=="string"?c(W):W;ee&&(Cn(ee.deletable)&&!ee.deletable||F.push(hA(typeof W=="string"?W:W.id,ee.source,ee.target,ee.sourceHandle,ee.targetHandle)))}t.hooks.edgesChange.trigger(F)},H=($,L,z=!0)=>{const F=c($.id);if(!F)return!1;const W=t.edges.indexOf(F),ee=MZ($,L,F,z,t.hooks.error.trigger);if(ee){const[J]=w0([ee],t.isValidConnection,u,c,t.hooks.error.trigger,t.defaultEdgeOptions,t.nodes,t.edges);return t.edges=t.edges.map((te,Q)=>Q===W?J:te),x0(t.connectionLookup,n.value,[J]),J}return!1},G=($,L,z={replace:!1})=>{const F=c($);if(!F)return;const W=typeof L=="function"?L(F):L;F.data=z.replace?W:{...F.data,...W}},Y=$=>cA($,t.nodes),se=$=>{const L=cA($,t.edges);return x0(t.connectionLookup,n.value,L),L},ie=($,L,z={replace:!1})=>{const F=u($);if(!F)return;const W=typeof L=="function"?L(F):L;z.replace?t.nodes.splice(t.nodes.indexOf(F),1,W):Object.assign(F,W)},ue=($,L,z={replace:!1})=>{const F=u($);if(!F)return;const W=typeof L=="function"?L(F):L;F.data=z.replace?W:{...F.data,...W}},_e=($,L,z=!1)=>{z?t.connectionClickStartHandle=$:t.connectionStartHandle=$,t.connectionEndHandle=null,t.connectionStatus=null,L&&(t.connectionPosition=L)},Ee=($,L=null,z=null)=>{t.connectionStartHandle&&(t.connectionPosition=$,t.connectionEndHandle=L,t.connectionStatus=z)},he=($,L)=>{t.connectionPosition={x:Number.NaN,y:Number.NaN},t.connectionEndHandle=null,t.connectionStatus=null,L?t.connectionClickStartHandle=null:t.connectionStartHandle=null},de=$=>{const L=cZ($),z=L?null:td($)?$:u($.id);return!L&&!z?[null,null,L]:[L?$:vp(z),z,L]},pe=($,L=!0,z=t.nodes)=>{const[F,W,ee]=de($);if(!F)return[];const J=[];for(const te of z||t.nodes){if(!ee&&(te.id===W.id||!te.computedPosition))continue;const Q=vp(te),ye=yp(Q,F);(L&&ye>0||ye>=Q.width*Q.height||ye>=Number(F.width)*Number(F.height))&&J.push(te)}return J},Le=($,L,z=!0)=>{const[F]=de($);if(!F)return!1;const W=yp(F,L);return z&&W>0||W>=Number(F.width)*Number(F.height)},De=$=>{const{viewport:L,dimensions:z,d3Zoom:F,d3Selection:W,translateExtent:ee}=t;if(!F||!W||!$.x&&!$.y)return!1;const J=Ql.translate(L.x+$.x,L.y+$.y).scale(L.zoom),te=[[0,0],[z.width,z.height]],Q=F.constrain()(J,te,ee),ye=t.viewport.x!==Q.x||t.viewport.y!==Q.y||t.viewport.zoom!==Q.k;return F.transform(W,Q),ye},Be=$=>{const L=$ instanceof Function?$(t):$,z=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];Cn(L.defaultEdgeOptions)&&(t.defaultEdgeOptions=L.defaultEdgeOptions);const F=L.modelValue||L.nodes||L.edges?[]:void 0;F&&(L.modelValue&&F.push(...L.modelValue),L.nodes&&F.push(...L.nodes),L.edges&&F.push(...L.edges),v(F));const W=()=>{Cn(L.maxZoom)&&N(L.maxZoom),Cn(L.minZoom)&&b(L.minZoom),Cn(L.translateExtent)&&D(L.translateExtent)};for(const ee of Object.keys(L)){const J=ee,te=L[J];![...JZ,...z].includes(J)&&Cn(te)&&(t[J]=te)}Hy(()=>t.d3Zoom).not.toBeNull().then(W),t.initialized||(t.initialized=!0)};return{updateNodePositions:d,updateNodeDimensions:h,setElements:v,setNodes:P,setEdges:C,addNodes:x,addEdges:I,removeNodes:V,removeEdges:M,findNode:u,findEdge:c,updateEdge:H,updateEdgeData:G,updateNode:ie,updateNodeData:ue,applyEdgeChanges:se,applyNodeChanges:Y,addSelectedElements:_,addSelectedNodes:m,addSelectedEdges:g,setMinZoom:b,setMaxZoom:N,setTranslateExtent:D,setNodeExtent:O,setPaneClickDistance:k,removeSelectedElements:y,removeSelectedNodes:E,removeSelectedEdges:S,startConnection:_e,updateConnection:Ee,endConnection:he,setInteractive:w,setState:Be,getIntersectingNodes:pe,getIncomers:o,getOutgoers:s,getConnectedEdges:a,getHandleConnections:l,isNodeIntersecting:Le,panBy:De,fitView:$=>r.value.fitView($),zoomIn:$=>r.value.zoomIn($),zoomOut:$=>r.value.zoomOut($),zoomTo:($,L)=>r.value.zoomTo($,L),setViewport:($,L)=>r.value.setViewport($,L),setTransform:($,L)=>r.value.setTransform($,L),getViewport:()=>r.value.getViewport(),getTransform:()=>r.value.getTransform(),setCenter:($,L,z)=>r.value.setCenter($,L,z),fitBounds:($,L)=>r.value.fitBounds($,L),project:$=>r.value.project($),screenToFlowCoordinate:$=>r.value.screenToFlowCoordinate($),flowToScreenCoordinate:$=>r.value.flowToScreenCoordinate($),toObject:()=>{const $=[],L=[];for(const z of t.nodes){const{computedPosition:F,handleBounds:W,selected:ee,dimensions:J,isParent:te,resizing:Q,dragging:ye,events:fe,...be}=z;$.push(be)}for(const z of t.edges){const{selected:F,sourceNode:W,targetNode:ee,events:J,...te}=z;L.push(te)}return JSON.parse(JSON.stringify({nodes:$,edges:L,position:[t.viewport.x,t.viewport.y],zoom:t.viewport.zoom,viewport:t.viewport}))},fromObject:$=>new Promise(L=>{const{nodes:z,edges:F,position:W,zoom:ee,viewport:J}=$;z&&P(z),F&&C(F);const[te,Q]=J!=null&&J.x&&(J!=null&&J.y)?[J.x,J.y]:W??[null,null];if(te&&Q){const ye=(J==null?void 0:J.zoom)||ee||t.viewport.zoom;return Hy(()=>r.value.viewportInitialized).toBe(!0).then(()=>{r.value.setViewport({x:te,y:Q,zoom:ye}).then(()=>{L(!0)})})}else L(!0)}),updateNodeInternals:i,viewportHelper:r,$reset:()=>{const $=DA();if(t.edges=[],t.nodes=[],t.d3Zoom&&t.d3Selection){const L=Ql.translate($.defaultViewport.x??0,$.defaultViewport.y??0).scale(Ao($.defaultViewport.zoom??1,$.minZoom,$.maxZoom)),z=t.viewportRef.getBoundingClientRect(),F=[[0,0],[z.width,z.height]],W=t.d3Zoom.constrain()(L,F,$.translateExtent);t.d3Zoom.transform(t.d3Selection,W)}Be($)},$destroy:()=>{}}}const qZ=["data-id","data-handleid","data-nodeid","data-handlepos"],bs=Te({...{name:"Handle",compatConfig:{MODE:3}},props:{id:{default:null},type:{},position:{default:()=>ze.Top},isValidConnection:{type:Function},connectable:{type:[Boolean,Number,String,Function],default:void 0},connectableStart:{type:Boolean,default:!0},connectableEnd:{type:Boolean,default:!0}},setup(t,{expose:e}){const n=a_(t,["position","connectable","connectableStart","connectableEnd","id"]),r=Ot(()=>n.type??"source"),i=Ot(()=>n.isValidConnection??null),{id:o,connectionStartHandle:s,connectionClickStartHandle:a,connectionEndHandle:l,vueFlowRef:u,nodesConnectable:c,noDragClassName:d,noPanClassName:h}=Dt(),{id:p,node:m,nodeEl:g,connectedEdges:_}=NA(),E=we(),S=Ot(()=>typeof t.connectableStart<"u"?t.connectableStart:!0),y=Ot(()=>typeof t.connectableEnd<"u"?t.connectableEnd:!0),b=Ot(()=>{var C,v,x,I,V,M;return((C=s.value)==null?void 0:C.nodeId)===p&&((v=s.value)==null?void 0:v.id)===t.id&&((x=s.value)==null?void 0:x.type)===r.value||((I=l.value)==null?void 0:I.nodeId)===p&&((V=l.value)==null?void 0:V.id)===t.id&&((M=l.value)==null?void 0:M.type)===r.value}),N=Ot(()=>{var C,v,x;return((C=a.value)==null?void 0:C.nodeId)===p&&((v=a.value)==null?void 0:v.id)===t.id&&((x=a.value)==null?void 0:x.type)===r.value}),{handlePointerDown:D,handleClick:O}=OA({nodeId:p,handleId:t.id,isValidConnection:i,type:r}),k=Z(()=>typeof t.connectable=="string"&&t.connectable==="single"?!_.value.some(C=>{const v=C[`${r.value}Handle`];return C[r.value]!==p?!1:v?v===t.id:!0}):typeof t.connectable=="number"?_.value.filter(C=>{const v=C[`${r.value}Handle`];return C[r.value]!==p?!1:v?v===t.id:!0}).length<t.connectable:typeof t.connectable=="function"?t.connectable(m,_.value):Cn(t.connectable)?t.connectable:c.value);Gt(()=>{var C;if(!m.dimensions.width||!m.dimensions.height)return;const v=(C=m.handleBounds[r.value])==null?void 0:C.find(Y=>Y.id===t.id);if(!u.value||v)return;const x=u.value.querySelector(".vue-flow__transformationpane");if(!g.value||!E.value||!x||!t.id)return;const I=g.value.getBoundingClientRect(),V=E.value.getBoundingClientRect(),M=window.getComputedStyle(x),{m22:H}=new window.DOMMatrixReadOnly(M.transform),G={id:t.id,position:t.position,x:(V.left-I.left)/H,y:(V.top-I.top)/H,type:r.value,nodeId:p,...bp(E.value)};m.handleBounds[r.value]=[...m.handleBounds[r.value]??[],G]});function w(C){const v=v0(C);k.value&&S.value&&(v&&C.button===0||!v)&&D(C)}function P(C){!p||!a.value&&!S.value||k.value&&O(C)}return e({handleClick:O,handlePointerDown:D,onClick:P,onPointerDown:w}),(C,v)=>(j(),K("div",{ref_key:"handle",ref:E,"data-id":`${re(o)}-${re(p)}-${t.id}-${r.value}`,"data-handleid":t.id,"data-nodeid":re(p),"data-handlepos":C.position,class:Se(["vue-flow__handle",[`vue-flow__handle-${C.position}`,`vue-flow__handle-${t.id}`,re(d),re(h),r.value,{connectable:k.value,connecting:N.value,connectablestart:S.value,connectableend:y.value,connectionindicator:k.value&&(S.value&&!b.value||y.value&&b.value)}]]),onMousedown:w,onTouchstartPassive:w,onClick:P},[Mt(C.$slots,"default",{id:C.id})],42,qZ))}}),Ip=function({sourcePosition:t=ze.Bottom,targetPosition:e=ze.Top,label:n,connectable:r=!0,isValidTargetPos:i,isValidSourcePos:o,data:s}){const a=s.label??n;return[qe(bs,{type:"target",position:e,connectable:r,isValidConnection:i}),typeof a!="string"&&a?qe(a):qe(Ve,[a]),qe(bs,{type:"source",position:t,connectable:r,isValidConnection:o})]};Ip.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"],Ip.inheritAttrs=!1,Ip.compatConfig={MODE:3};const eX=Ip,Cp=function({targetPosition:t=ze.Top,label:e,connectable:n=!0,isValidTargetPos:r,data:i}){const o=i.label??e;return[qe(bs,{type:"target",position:t,connectable:n,isValidConnection:r}),typeof o!="string"&&o?qe(o):qe(Ve,[o])]};Cp.props=["targetPosition","label","isValidTargetPos","connectable","data"],Cp.inheritAttrs=!1,Cp.compatConfig={MODE:3};const tX=Cp,Ap=function({sourcePosition:t=ze.Bottom,label:e,connectable:n=!0,isValidSourcePos:r,data:i}){const o=i.label??e;return[typeof o!="string"&&o?qe(o):qe(Ve,[o]),qe(bs,{type:"source",position:t,connectable:n,isValidConnection:r})]};Ap.props=["sourcePosition","label","isValidSourcePos","connectable","data"],Ap.inheritAttrs=!1,Ap.compatConfig={MODE:3};const nX=Ap,rX=["transform"],iX=["width","height","x","y","rx","ry"],oX=["y"],sX=Te({...{name:"EdgeText",compatConfig:{MODE:3}},props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(t){const e=we({x:0,y:0,width:0,height:0}),n=we(null),r=Z(()=>`translate(${t.x-e.value.width/2} ${t.y-e.value.height/2})`);Gt(i),Qe([()=>t.x,()=>t.y,n,()=>t.label],i);function i(){if(!n.value)return;const o=n.value.getBBox();(o.width!==e.value.width||o.height!==e.value.height)&&(e.value=o)}return(o,s)=>(j(),K("g",{transform:r.value,class:"vue-flow__edge-textwrapper"},[o.labelShowBg?(j(),K("rect",{key:0,class:"vue-flow__edge-textbg",width:`${e.value.width+2*o.labelBgPadding[0]}px`,height:`${e.value.height+2*o.labelBgPadding[1]}px`,x:-o.labelBgPadding[0],y:-o.labelBgPadding[1],style:Ze(o.labelBgStyle),rx:o.labelBgBorderRadius,ry:o.labelBgBorderRadius},null,12,iX)):Ae("",!0),A("text",ao(o.$attrs,{ref_key:"el",ref:n,class:"vue-flow__edge-text",y:e.value.height/2,dy:"0.3em",style:o.labelStyle}),[Mt(o.$slots,"default",{},()=>[typeof o.label!="string"?(j(),Ne(Jn(o.label),{key:0})):(j(),K(Ve,{key:1},[_t(Ie(o.label),1)],64))])],16,oX)],8,rX))}}),aX=["id","d","marker-end","marker-start"],lX=["d","stroke-width"],Pp=Te({...{name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},props:{id:{},labelX:{},labelY:{},path:{},label:{},markerStart:{},markerEnd:{},interactionWidth:{default:20},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{}},setup(t,{expose:e}){const n=we(null),r=we(null),i=we(null),o=o_();return e({pathEl:n,interactionEl:r,labelEl:i}),(s,a)=>(j(),K(Ve,null,[A("path",ao(re(o),{id:s.id,ref_key:"pathEl",ref:n,d:s.path,class:"vue-flow__edge-path","marker-end":s.markerEnd,"marker-start":s.markerStart}),null,16,aX),s.interactionWidth?(j(),K("path",{key:0,ref_key:"interactionEl",ref:r,fill:"none",d:s.path,"stroke-width":s.interactionWidth,"stroke-opacity":0,class:"vue-flow__edge-interaction"},null,8,lX)):Ae("",!0),s.label&&s.labelX&&s.labelY?(j(),Ne(sX,{key:1,ref_key:"labelEl",ref:i,x:s.labelX,y:s.labelY,label:s.label,"label-show-bg":s.labelShowBg,"label-bg-style":s.labelBgStyle,"label-bg-padding":s.labelBgPadding,"label-bg-border-radius":s.labelBgBorderRadius,"label-style":s.labelStyle},null,8,["x","y","label","label-show-bg","label-bg-style","label-bg-padding","label-bg-border-radius","label-style"])):Ae("",!0)],64))}});function $A({sourceX:t,sourceY:e,targetX:n,targetY:r}){const i=Math.abs(n-t)/2,o=n<t?n+i:n-i,s=Math.abs(r-e)/2,a=r<e?r+s:r-s;return[o,a,i,s]}function MA({sourceX:t,sourceY:e,targetX:n,targetY:r,sourceControlX:i,sourceControlY:o,targetControlX:s,targetControlY:a}){const l=t*.125+i*.375+s*.375+n*.125,u=e*.125+o*.375+a*.375+r*.125,c=Math.abs(l-t),d=Math.abs(u-e);return[l,u,c,d]}function kp(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}function LA({pos:t,x1:e,y1:n,x2:r,y2:i,c:o}){let s,a;switch(t){case ze.Left:s=e-kp(e-r,o),a=n;break;case ze.Right:s=e+kp(r-e,o),a=n;break;case ze.Top:s=e,a=n-kp(n-i,o);break;case ze.Bottom:s=e,a=n+kp(i-n,o);break}return[s,a]}function VA(t){const{sourceX:e,sourceY:n,sourcePosition:r=ze.Bottom,targetX:i,targetY:o,targetPosition:s=ze.Top,curvature:a=.25}=t,[l,u]=LA({pos:r,x1:e,y1:n,x2:i,y2:o,c:a}),[c,d]=LA({pos:s,x1:i,y1:o,x2:e,y2:n,c:a}),[h,p,m,g]=MA({sourceX:e,sourceY:n,targetX:i,targetY:o,sourceControlX:l,sourceControlY:u,targetControlX:c,targetControlY:d});return[`M${e},${n} C${l},${u} ${c},${d} ${i},${o}`,h,p,m,g]}function FA({pos:t,x1:e,y1:n,x2:r,y2:i}){let o,s;switch(t){case ze.Left:case ze.Right:o=.5*(e+r),s=n;break;case ze.Top:case ze.Bottom:o=e,s=.5*(n+i);break}return[o,s]}function zA(t){const{sourceX:e,sourceY:n,sourcePosition:r=ze.Bottom,targetX:i,targetY:o,targetPosition:s=ze.Top}=t,[a,l]=FA({pos:r,x1:e,y1:n,x2:i,y2:o}),[u,c]=FA({pos:s,x1:i,y1:o,x2:e,y2:n}),[d,h,p,m]=MA({sourceX:e,sourceY:n,targetX:i,targetY:o,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:c});return[`M${e},${n} C${a},${l} ${u},${c} ${i},${o}`,d,h,p,m]}const UA={[ze.Left]:{x:-1,y:0},[ze.Right]:{x:1,y:0},[ze.Top]:{x:0,y:-1},[ze.Bottom]:{x:0,y:1}};function uX({source:t,sourcePosition:e=ze.Bottom,target:n}){return e===ze.Left||e===ze.Right?t.x<n.x?{x:1,y:0}:{x:-1,y:0}:t.y<n.y?{x:0,y:1}:{x:0,y:-1}}function BA(t,e){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function cX({source:t,sourcePosition:e=ze.Bottom,target:n,targetPosition:r=ze.Top,center:i,offset:o}){const s=UA[e],a=UA[r],l={x:t.x+s.x*o,y:t.y+s.y*o},u={x:n.x+a.x*o,y:n.y+a.y*o},c=uX({source:l,sourcePosition:e,target:u}),d=c.x!==0?"x":"y",h=c[d];let p,m,g;const _={x:0,y:0},E={x:0,y:0},[S,y,b,N]=$A({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(s[d]*a[d]===-1){m=i.x??S,g=i.y??y;const O=[{x:m,y:l.y},{x:m,y:u.y}],k=[{x:l.x,y:g},{x:u.x,y:g}];s[d]===h?p=d==="x"?O:k:p=d==="x"?k:O}else{const O=[{x:l.x,y:u.y}],k=[{x:u.x,y:l.y}];if(d==="x"?p=s.x===h?k:O:p=s.y===h?O:k,e===r){const x=Math.abs(t[d]-n[d]);if(x<=o){const I=Math.min(o-1,o-x);s[d]===h?_[d]=(l[d]>t[d]?-1:1)*I:E[d]=(u[d]>n[d]?-1:1)*I}}if(e!==r){const x=d==="x"?"y":"x",I=s[d]===a[x],V=l[x]>u[x],M=l[x]<u[x];(s[d]===1&&(!I&&V||I&&M)||s[d]!==1&&(!I&&M||I&&V))&&(p=d==="x"?O:k)}const w={x:l.x+_.x,y:l.y+_.y},P={x:u.x+E.x,y:u.y+E.y},C=Math.max(Math.abs(w.x-p[0].x),Math.abs(P.x-p[0].x)),v=Math.max(Math.abs(w.y-p[0].y),Math.abs(P.y-p[0].y));C>=v?(m=(w.x+P.x)/2,g=p[0].y):(m=p[0].x,g=(w.y+P.y)/2)}return[[t,{x:l.x+_.x,y:l.y+_.y},...p,{x:u.x+E.x,y:u.y+E.y},n],m,g,b,N]}function dX(t,e,n,r){const i=Math.min(BA(t,e)/2,BA(e,n)/2,r),{x:o,y:s}=e;if(t.x===o&&o===n.x||t.y===s&&s===n.y)return`L${o} ${s}`;if(t.y===s){const u=t.x<n.x?-1:1,c=t.y<n.y?1:-1;return`L ${o+i*u},${s}Q ${o},${s} ${o},${s+i*c}`}const a=t.x<n.x?1:-1,l=t.y<n.y?-1:1;return`L ${o},${s+i*l}Q ${o},${s} ${o+i*a},${s}`}function T0(t){const{sourceX:e,sourceY:n,sourcePosition:r=ze.Bottom,targetX:i,targetY:o,targetPosition:s=ze.Top,borderRadius:a=5,centerX:l,centerY:u,offset:c=20}=t,[d,h,p,m,g]=cX({source:{x:e,y:n},sourcePosition:r,target:{x:i,y:o},targetPosition:s,center:{x:l,y:u},offset:c});return[d.reduce((E,S,y)=>{let b;return y>0&&y<d.length-1?b=dX(d[y-1],S,d[y+1],a):b=`${y===0?"M":"L"}${S.x} ${S.y}`,E+=b,E},""),h,p,m,g]}function fX(t){const{sourceX:e,sourceY:n,targetX:r,targetY:i}=t,[o,s,a,l]=$A({sourceX:e,sourceY:n,targetX:r,targetY:i});return[`M ${e},${n}L ${r},${i}`,o,s,a,l]}const hX=Te({name:"StraightEdge",props:["label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(t,{attrs:e}){return()=>{const[n,r,i]=fX(t);return qe(Pp,{path:n,labelX:r,labelY:i,...e,...t})}}}),jA=Te({name:"SmoothStepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","borderRadius","markerEnd","markerStart","interactionWidth","offset"],compatConfig:{MODE:3},setup(t,{attrs:e}){return()=>{const[n,r,i]=T0({...t,sourcePosition:t.sourcePosition??ze.Bottom,targetPosition:t.targetPosition??ze.Top});return qe(Pp,{path:n,labelX:r,labelY:i,...e,...t})}}}),pX=Te({name:"StepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],setup(t,{attrs:e}){return()=>qe(jA,{...t,...e,borderRadius:0})}}),mX=Te({name:"BezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","curvature","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(t,{attrs:e}){return()=>{const[n,r,i]=VA({...t,sourcePosition:t.sourcePosition??ze.Bottom,targetPosition:t.targetPosition??ze.Top});return qe(Pp,{path:n,labelX:r,labelY:i,...e,...t})}}}),gX=Te({name:"SimpleBezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(t,{attrs:e}){return()=>{const[n,r,i]=zA({...t,sourcePosition:t.sourcePosition??ze.Bottom,targetPosition:t.targetPosition??ze.Top});return qe(Pp,{path:n,labelX:r,labelY:i,...e,...t})}}}),vX={input:nX,default:eX,output:tX},yX={default:mX,straight:hX,step:pX,smoothstep:jA,simplebezier:gX};function bX(t,e,n){const r=Z(()=>g=>e.value.get(g)),i=Z(()=>g=>n.value.get(g)),o=Z(()=>{const g={...yX,...t.edgeTypes},_=Object.keys(g);for(const E of t.edges)E.type&&!_.includes(E.type)&&(g[E.type]=E.type);return g}),s=Z(()=>{const g={...vX,...t.nodeTypes},_=Object.keys(g);for(const E of t.nodes)E.type&&!_.includes(E.type)&&(g[E.type]=E.type);return g}),a=Z(()=>t.onlyRenderVisibleElements?rA(t.nodes,{x:0,y:0,width:t.dimensions.width,height:t.dimensions.height},t.viewport,!0):t.nodes),l=Z(()=>{if(t.onlyRenderVisibleElements){const g=[];for(const _ of t.edges){const E=e.value.get(_.source),S=e.value.get(_.target);EZ({sourcePos:E.computedPosition||{x:0,y:0},targetPos:S.computedPosition||{x:0,y:0},sourceWidth:E.dimensions.width,sourceHeight:E.dimensions.height,targetWidth:S.dimensions.width,targetHeight:S.dimensions.height,width:t.dimensions.width,height:t.dimensions.height,viewport:t.viewport})&&g.push(_)}return g}return t.edges}),u=Z(()=>[...a.value,...l.value]),c=Z(()=>{const g=[];for(const _ of t.nodes)_.selected&&g.push(_);return g}),d=Z(()=>{const g=[];for(const _ of t.edges)_.selected&&g.push(_);return g}),h=Z(()=>[...c.value,...d.value]),p=Z(()=>{const g=[];for(const _ of t.nodes)_.dimensions.width&&_.dimensions.height&&_.handleBounds!==void 0&&g.push(_);return g}),m=Z(()=>a.value.length>0&&p.value.length===a.value.length);return{getNode:r,getEdge:i,getElements:u,getEdgeTypes:o,getNodeTypes:s,getEdges:l,getNodes:a,getSelectedElements:h,getSelectedNodes:c,getSelectedEdges:d,getNodesInitialized:p,areNodesInitialized:m}}class xa{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var e;const n=(e=xn())==null?void 0:e.appContext.app,r=(n==null?void 0:n.config.globalProperties.$vueFlowStorage)??xa.instance;return xa.instance=r??new xa,n&&(n.config.globalProperties.$vueFlowStorage=xa.instance),xa.instance}set(e,n){return this.flows.set(e,n)}get(e){return this.flows.get(e)}remove(e){return this.flows.delete(e)}create(e,n){const r=DA(),i=Da(r),o={};for(const[h,p]of Object.entries(i.hooks)){const m=`on${h.charAt(0).toUpperCase()+h.slice(1)}`;o[m]=p.on}const s={};for(const[h,p]of Object.entries(i.hooks))s[h]=p.trigger;const a=Z(()=>{const h=new Map;for(const p of i.nodes)h.set(p.id,p);return h}),l=Z(()=>{const h=new Map;for(const p of i.edges)h.set(p.id,p);return h}),u=bX(i,a,l),c=QZ(i,a,l);c.setState({...i,...n});const d={...o,...u,...c,...bH(i),nodeLookup:a,edgeLookup:l,emits:s,id:e,vueFlowVersion:"1.48.1",$destroy:()=>{this.remove(e)}};return this.set(e,d),d}getId(){return`vue-flow-${this.currentId++}`}}function Dt(t){const e=xa.getInstance(),n=Id(),r=typeof t=="object",i=r?t:{id:t},o=i.id,s=o??(n==null?void 0:n.vueFlowId);let a;if(n){const l=bt(CA,null);typeof l<"u"&&l!==null&&(!s||l.id===s)&&(a=l)}if(a||s&&(a=e.get(s)),!a||s&&a.id!==s){const l=o??e.getId(),u=e.create(l,i);a=u,(n??Jp(!0)).run(()=>{Qe(u.applyDefault,(d,h,p)=>{const m=_=>{u.applyNodeChanges(_)},g=_=>{u.applyEdgeChanges(_)};d?(u.onNodesChange(m),u.onEdgesChange(g)):(u.hooks.value.nodesChange.off(m),u.hooks.value.edgesChange.off(g)),p(()=>{u.hooks.value.nodesChange.off(m),u.hooks.value.edgesChange.off(g)})},{immediate:!0}),Uc(()=>{if(a){const d=e.get(a.id);d?d.$destroy():od(`No store instance found for id ${a.id} in storage.`)}})})}else r&&a.setState(i);if(n&&(to(CA,a),n.vueFlowId=a.id),r){const l=xn();(l==null?void 0:l.type.name)!=="VueFlow"&&a.emits.error(new Pn(In.USEVUEFLOW_OPTIONS))}return a}function _X(t){const{emits:e,dimensions:n}=Dt();let r;Gt(()=>{const i=()=>{var o,s;if(!t.value||!(((s=(o=t.value).checkVisibility)==null?void 0:s.call(o))??!0))return;const a=bp(t.value);(a.width===0||a.height===0)&&e.error(new Pn(In.MISSING_VIEWPORT_DIMENSIONS)),n.value={width:a.width||500,height:a.height||500}};i(),window.addEventListener("resize",i),t.value&&(r=new ResizeObserver(()=>i()),r.observe(t.value)),Wa(()=>{window.removeEventListener("resize",i),r&&t.value&&r.unobserve(t.value)})})}const xX=Te({...{name:"UserSelection",compatConfig:{MODE:3}},props:{userSelectionRect:{}},setup(t){return(e,n)=>(j(),K("div",{class:"vue-flow__selection vue-flow__container",style:Ze({width:`${e.userSelectionRect.width}px`,height:`${e.userSelectionRect.height}px`,transform:`translate(${e.userSelectionRect.x}px, ${e.userSelectionRect.y}px)`})},null,4))}}),wX=["tabIndex"],SX=Te({...{name:"NodesSelection",compatConfig:{MODE:3}},setup(t){const{emits:e,viewport:n,getSelectedNodes:r,noPanClassName:i,disableKeyboardA11y:o,userSelectionActive:s}=Dt(),a=RA(),l=we(null),u=PA({el:l,onStart(m){e.selectionDragStart(m),e.nodeDragStart(m)},onDrag(m){e.selectionDrag(m),e.nodeDrag(m)},onStop(m){e.selectionDragStop(m),e.nodeDragStop(m)}});Gt(()=>{var m;o.value||(m=l.value)==null||m.focus({preventScroll:!0})});const c=Z(()=>nA(r.value)),d=Z(()=>({width:`${c.value.width}px`,height:`${c.value.height}px`,top:`${c.value.y}px`,left:`${c.value.x}px`}));function h(m){e.selectionContextMenu({event:m,nodes:r.value})}function p(m){o.value||ql[m.key]&&(m.preventDefault(),a({x:ql[m.key].x,y:ql[m.key].y},m.shiftKey))}return(m,g)=>!re(s)&&c.value.width&&c.value.height?(j(),K("div",{key:0,class:Se(["vue-flow__nodesselection vue-flow__container",re(i)]),style:Ze({transform:`translate(${re(n).x}px,${re(n).y}px) scale(${re(n).zoom})`})},[A("div",{ref_key:"el",ref:l,class:Se([{dragging:re(u)},"vue-flow__nodesselection-rect"]),style:Ze(d.value),tabIndex:re(o)?void 0:-1,onContextmenu:h,onKeydown:p},null,46,wX)],6)):Ae("",!0)}});function EX(t,e){return{x:t.clientX-e.left,y:t.clientY-e.top}}const TX=Te({...{name:"Pane",compatConfig:{MODE:3}},props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(t){const{vueFlowRef:e,nodes:n,viewport:r,emits:i,userSelectionActive:o,removeSelectedElements:s,userSelectionRect:a,elementsSelectable:l,nodesSelectionActive:u,getSelectedEdges:c,getSelectedNodes:d,removeNodes:h,removeEdges:p,selectionMode:m,deleteKeyCode:g,multiSelectionKeyCode:_,multiSelectionActive:E,edgeLookup:S,nodeLookup:y,connectionLookup:b,defaultEdgeOptions:N,connectionStartHandle:D,panOnDrag:O}=Dt(),k=Ii(null),w=Ii(new Set),P=Ii(new Set),C=Ii(null),v=Ot(()=>l.value&&(t.isSelecting||o.value)),x=Ot(()=>D.value!==null);let I=!1,V=!1;const M=ed(g,{actInsideInputWithModifier:!1}),H=ed(_);Qe(M,he=>{he&&(h(d.value),p(c.value),u.value=!1)}),Qe(H,he=>{E.value=he});function G(he,de){return pe=>{pe.target===de&&(he==null||he(pe))}}function Y(he){if(I||x.value){I=!1;return}i.paneClick(he),s(),u.value=!1}function se(he){var de;if(Array.isArray(O.value)&&((de=O.value)!=null&&de.includes(2))){he.preventDefault();return}i.paneContextMenu(he)}function ie(he){i.paneScroll(he)}function ue(he){var de,pe,Le;if(C.value=((de=e.value)==null?void 0:de.getBoundingClientRect())??null,!l.value||!t.isSelecting||he.button!==0||he.target!==k.value||!C.value)return;(Le=(pe=he.target)==null?void 0:pe.setPointerCapture)==null||Le.call(pe,he.pointerId);const{x:De,y:Be}=EX(he,C.value);V=!0,I=!1,s(),a.value={width:0,height:0,startX:De,startY:Be,x:De,y:Be},i.selectionStart(he)}function _e(he){var de;if(!C.value||!a.value)return;I=!0;const{x:pe,y:Le}=Zi(he,C.value),{startX:De=0,startY:Be=0}=a.value,et={startX:De,startY:Be,x:pe<De?pe:De,y:Le<Be?Le:Be,width:Math.abs(pe-De),height:Math.abs(Le-Be)},$e=w.value,B=P.value;w.value=new Set(rA(n.value,et,r.value,m.value===d0.Partial,!0).map(L=>L.id)),P.value=new Set;const $=((de=N.value)==null?void 0:de.selectable)??!0;for(const L of w.value){const z=b.value.get(L);if(z)for(const{edgeId:F}of z.values()){const W=S.value.get(F);W&&(W.selectable??$)&&P.value.add(F)}}if(!IA($e,w.value)){const L=vs(y.value,w.value,!0);i.nodesChange(L)}if(!IA(B,P.value)){const L=vs(S.value,P.value);i.edgesChange(L)}a.value=et,o.value=!0,u.value=!1}function Ee(he){var de;he.button!==0||!V||((de=he.target)==null||de.releasePointerCapture(he.pointerId),!o.value&&a.value&&he.target===k.value&&Y(he),o.value=!1,a.value=null,u.value=w.value.size>0,i.selectionEnd(he),t.selectionKeyPressed&&(I=!1),V=!1)}return(he,de)=>(j(),K("div",{ref_key:"container",ref:k,class:Se(["vue-flow__pane vue-flow__container",{selection:he.isSelecting}]),onClick:de[0]||(de[0]=pe=>v.value?void 0:G(Y,k.value)(pe)),onContextmenu:de[1]||(de[1]=pe=>G(se,k.value)(pe)),onWheelPassive:de[2]||(de[2]=pe=>G(ie,k.value)(pe)),onPointerenter:de[3]||(de[3]=pe=>v.value?void 0:re(i).paneMouseEnter(pe)),onPointerdown:de[4]||(de[4]=pe=>v.value?ue(pe):re(i).paneMouseMove(pe)),onPointermove:de[5]||(de[5]=pe=>v.value?_e(pe):re(i).paneMouseMove(pe)),onPointerup:de[6]||(de[6]=pe=>v.value?Ee(pe):void 0),onPointerleave:de[7]||(de[7]=pe=>re(i).paneMouseLeave(pe))},[Mt(he.$slots,"default"),re(o)&&re(a)?(j(),Ne(xX,{key:0,"user-selection-rect":re(a)},null,8,["user-selection-rect"])):Ae("",!0),re(u)&&re(d).length?(j(),Ne(SX,{key:1})):Ae("",!0)],34))}}),IX=Te({...{name:"Transform",compatConfig:{MODE:3}},setup(t){const{viewport:e,fitViewOnInit:n,fitViewOnInitDone:r}=Dt(),i=Z(()=>n.value?!r.value:!1),o=Z(()=>`translate(${e.value.x}px,${e.value.y}px) scale(${e.value.zoom})`);return(s,a)=>(j(),K("div",{class:"vue-flow__transformationpane vue-flow__container",style:Ze({transform:o.value,opacity:i.value?0:void 0})},[Mt(s.$slots,"default")],4))}}),CX=Te({...{name:"Viewport",compatConfig:{MODE:3}},setup(t){const{minZoom:e,maxZoom:n,defaultViewport:r,translateExtent:i,zoomActivationKeyCode:o,selectionKeyCode:s,panActivationKeyCode:a,panOnScroll:l,panOnScrollMode:u,panOnScrollSpeed:c,panOnDrag:d,zoomOnDoubleClick:h,zoomOnPinch:p,zoomOnScroll:m,preventScrolling:g,noWheelClassName:_,noPanClassName:E,emits:S,connectionStartHandle:y,userSelectionActive:b,paneDragging:N,d3Zoom:D,d3Selection:O,d3ZoomHandler:k,viewport:w,viewportRef:P,paneClickDistance:C}=Dt();_X(P);const v=Ii(!1),x=Ii(!1);let I=null,V=!1,M=0,H={x:0,y:0,zoom:0};const G=ed(a),Y=ed(s),se=ed(o),ie=Ot(()=>(!Y.value||Y.value&&s.value===!0)&&(G.value||d.value)),ue=Ot(()=>G.value||l.value),_e=Ot(()=>Y.value||s.value===!0&&ie.value!==!0),Ee=Ot(()=>y.value!==null);Gt(()=>{if(!P.value){od("Viewport element is missing");return}const De=P.value,Be=De.getBoundingClientRect(),et=rZ().clickDistance(C.value).scaleExtent([e.value,n.value]).translateExtent(i.value),$e=_i(De).call(et),B=$e.on("wheel.zoom"),$=Ql.translate(r.value.x??0,r.value.y??0).scale(Ao(r.value.zoom??1,e.value,n.value)),L=[[0,0],[Be.width,Be.height]],z=et.constrain()($,L,i.value);et.transform($e,z),et.wheelDelta(aA),D.value=et,O.value=$e,k.value=B,w.value={x:z.x,y:z.y,zoom:z.k},et.on("start",F=>{var W;if(!F.sourceEvent)return null;M=F.sourceEvent.button,v.value=!0;const ee=pe(F.transform);((W=F.sourceEvent)==null?void 0:W.type)==="mousedown"&&(N.value=!0),H=ee,S.viewportChangeStart(ee),S.moveStart({event:F,flowTransform:ee})}),et.on("end",F=>{if(!F.sourceEvent)return null;if(v.value=!1,N.value=!1,he(ie.value,M??0)&&!V&&S.paneContextMenu(F.sourceEvent),V=!1,de(H,F.transform)){const W=pe(F.transform);H=W,S.viewportChangeEnd(W),S.moveEnd({event:F,flowTransform:W})}}),et.filter(F=>{var W;const ee=se.value||m.value,J=p.value&&F.ctrlKey,te=F.button,Q=F.type==="wheel";if(te===1&&F.type==="mousedown"&&(Le(F,"vue-flow__node")||Le(F,"vue-flow__edge")))return!0;if(!ie.value&&!ee&&!ue.value&&!h.value&&!p.value||b.value||Ee.value&&!Q||!h.value&&F.type==="dblclick"||Le(F,_.value)&&Q||Le(F,E.value)&&(!Q||ue.value&&Q&&!se.value)||!p.value&&F.ctrlKey&&Q||!ee&&!ue.value&&!J&&Q)return!1;if(!p&&F.type==="touchstart"&&((W=F.touches)==null?void 0:W.length)>1)return F.preventDefault(),!1;if(!ie.value&&(F.type==="mousedown"||F.type==="touchstart")||s.value===!0&&Array.isArray(d.value)&&d.value.includes(0)&&te===0||Array.isArray(d.value)&&!d.value.includes(te)&&(F.type==="mousedown"||F.type==="touchstart"))return!1;const ye=Array.isArray(d.value)&&d.value.includes(te)||s.value===!0&&Array.isArray(d.value)&&!d.value.includes(0)||!te||te<=1;return(!F.ctrlKey||G.value||Q)&&ye}),Qe([b,ie],()=>{b.value&&!v.value?et.on("zoom",null):b.value||et.on("zoom",F=>{w.value={x:F.transform.x,y:F.transform.y,zoom:F.transform.k};const W=pe(F.transform);V=he(ie.value,M??0),S.viewportChange(W),S.move({event:F,flowTransform:W})})},{immediate:!0}),Qe([b,ue,u,se,p,g,_],()=>{ue.value&&!se.value&&!b.value?$e.on("wheel.zoom",F=>{if(Le(F,_.value))return!1;const W=se.value||m.value,ee=p.value&&F.ctrlKey;if(!(!g.value||ue.value||W||ee))return!1;F.preventDefault(),F.stopImmediatePropagation();const te=$e.property("__zoom").k||1,Q=xp();if(!G.value&&F.ctrlKey&&p.value&&Q){const rt=Hi(F),gt=aA(F),X=te*2**gt;et.scaleTo($e,X,rt,F);return}const ye=F.deltaMode===1?20:1;let fe=u.value===qc.Vertical?0:F.deltaX*ye,be=u.value===qc.Horizontal?0:F.deltaY*ye;!Q&&F.shiftKey&&u.value!==qc.Vertical&&!fe&&be&&(fe=be,be=0),et.translateBy($e,-(fe/te)*c.value,-(be/te)*c.value);const Me=pe($e.property("__zoom"));I&&clearTimeout(I),x.value?(S.move({event:F,flowTransform:Me}),S.viewportChange(Me),I=setTimeout(()=>{S.moveEnd({event:F,flowTransform:Me}),S.viewportChangeEnd(Me),x.value=!1},150)):(x.value=!0,S.moveStart({event:F,flowTransform:Me}),S.viewportChangeStart(Me))},{passive:!1}):typeof B<"u"&&$e.on("wheel.zoom",function(F,W){const ee=!g.value&&F.type==="wheel"&&!F.ctrlKey,J=se.value||m.value,te=p.value&&F.ctrlKey;if(!J&&!l.value&&!te&&F.type==="wheel"||ee||Le(F,_.value))return null;F.preventDefault(),B.call(this,F,W)},{passive:!1})},{immediate:!0})});function he(De,Be){return Be===2&&Array.isArray(De)&&De.includes(2)}function de(De,Be){return De.x!==Be.x&&!Number.isNaN(Be.x)||De.y!==Be.y&&!Number.isNaN(Be.y)||De.zoom!==Be.k&&!Number.isNaN(Be.k)}function pe(De){return{x:De.x,y:De.y,zoom:De.k}}function Le(De,Be){return De.target.closest(`.${Be}`)}return(De,Be)=>(j(),K("div",{ref_key:"viewportRef",ref:P,class:"vue-flow__viewport vue-flow__container"},[ce(TX,{"is-selecting":_e.value,"selection-key-pressed":re(Y),class:Se({connecting:Ee.value,dragging:re(N),draggable:re(d)===!0||Array.isArray(re(d))&&re(d).includes(0)})},{default:Ce(()=>[ce(IX,null,{default:Ce(()=>[Mt(De.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),AX=["id"],PX=["id"],kX=["id"],OX=Te({...{name:"A11yDescriptions",compatConfig:{MODE:3}},setup(t){const{id:e,disableKeyboardA11y:n,ariaLiveMessage:r}=Dt();return(i,o)=>(j(),K(Ve,null,[A("div",{id:`${re(KC)}-${re(e)}`,style:{display:"none"}}," Press enter or space to select a node. "+Ie(re(n)?"":"You can then use the arrow keys to move the node around.")+" You can then use the arrow keys to move the node around, press delete to remove it and press escape to cancel. ",9,AX),A("div",{id:`${re(ZC)}-${re(e)}`,style:{display:"none"}}," Press enter or space to select an edge. You can then press delete to remove it or press escape to cancel. ",8,PX),re(n)?Ae("",!0):(j(),K("div",{key:0,id:`${re(uZ)}-${re(e)}`,"aria-live":"assertive","aria-atomic":"true",style:{position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)","clip-path":"inset(100%)"}},Ie(re(r)),9,kX))],64))}});function NX(){const t=Dt();Qe(()=>t.viewportHelper.value.viewportInitialized,e=>{e&&setTimeout(()=>{t.emits.init(t),t.emits.paneReady(t)},1)})}function RX(t,e,n){return n===ze.Left?t-e:n===ze.Right?t+e:t}function DX(t,e,n){return n===ze.Top?t-e:n===ze.Bottom?t+e:t}const I0=function({radius:t=10,centerX:e=0,centerY:n=0,position:r=ze.Top,type:i}){return qe("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${i}`,cx:RX(e,t,r),cy:DX(n,t,r),r:t,stroke:"transparent",fill:"transparent"})};I0.props=["radius","centerX","centerY","position","type"],I0.compatConfig={MODE:3};const HA=I0,$X=Te({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(t){const{id:e,addSelectedEdges:n,connectionMode:r,edgeUpdaterRadius:i,emits:o,nodesSelectionActive:s,noPanClassName:a,getEdgeTypes:l,removeSelectedEdges:u,findEdge:c,findNode:d,isValidConnection:h,multiSelectionActive:p,disableKeyboardA11y:m,elementsSelectable:g,edgesUpdatable:_,edgesFocusable:E,hooks:S}=Dt(),y=Z(()=>c(t.id)),{emit:b,on:N}=zZ(y.value,o),D=bt(Sp),O=xn(),k=we(!1),w=we(!1),P=we(""),C=we(null),v=we("source"),x=we(null),I=Ot(()=>typeof y.value.selectable>"u"?g.value:y.value.selectable),V=Ot(()=>typeof y.value.updatable>"u"?_.value:y.value.updatable),M=Ot(()=>typeof y.value.focusable>"u"?E.value:y.value.focusable);to(LZ,t.id),to(VZ,x);const H=Z(()=>y.value.class instanceof Function?y.value.class(y.value):y.value.class),G=Z(()=>y.value.style instanceof Function?y.value.style(y.value):y.value.style),Y=Z(()=>{const L=y.value.type||"default",z=D==null?void 0:D[`edge-${L}`];if(z)return z;let F=y.value.template??l.value[L];if(typeof F=="string"&&O){const W=Object.keys(O.appContext.components);W&&W.includes(L)&&(F=kr(L,!1))}return F&&typeof F!="string"?F:(o.error(new Pn(In.EDGE_TYPE_MISSING,F)),!1)}),{handlePointerDown:se}=OA({nodeId:P,handleId:C,type:v,isValidConnection:h,edgeUpdaterType:v,onEdgeUpdate:_e,onEdgeUpdateEnd:Ee});return()=>{const L=d(y.value.source),z=d(y.value.target),F="pathOptions"in y.value?y.value.pathOptions:{};if(!L&&!z)return o.error(new Pn(In.EDGE_SOURCE_TARGET_MISSING,y.value.id,y.value.source,y.value.target)),null;if(!L)return o.error(new Pn(In.EDGE_SOURCE_MISSING,y.value.id,y.value.source)),null;if(!z)return o.error(new Pn(In.EDGE_TARGET_MISSING,y.value.id,y.value.target)),null;if(!y.value||y.value.hidden||L.hidden||z.hidden)return null;let W;r.value===ps.Strict?W=L.handleBounds.source:W=[...L.handleBounds.source||[],...L.handleBounds.target||[]];const ee=vA(W,y.value.sourceHandle);let J;r.value===ps.Strict?J=z.handleBounds.target:J=[...z.handleBounds.target||[],...z.handleBounds.source||[]];const te=vA(J,y.value.targetHandle),Q=(ee==null?void 0:ee.position)||ze.Bottom,ye=(te==null?void 0:te.position)||ze.Top,{x:fe,y:be}=tu(L,ee,Q),{x:Me,y:rt}=tu(z,te,ye);return y.value.sourceX=fe,y.value.sourceY=be,y.value.targetX=Me,y.value.targetY=rt,qe("g",{ref:x,key:t.id,"data-id":t.id,class:["vue-flow__edge",`vue-flow__edge-${Y.value===!1?"default":y.value.type||"default"}`,a.value,H.value,{updating:k.value,selected:y.value.selected,animated:y.value.animated,inactive:!I.value&&!S.value.edgeClick.hasListeners()}],tabIndex:M.value?0:void 0,"aria-label":y.value.ariaLabel===null?void 0:y.value.ariaLabel??`Edge from ${y.value.source} to ${y.value.target}`,"aria-describedby":M.value?`${ZC}-${e}`:void 0,"aria-roledescription":"edge",role:M.value?"group":"img",...y.value.domAttributes,onClick:de,onContextmenu:pe,onDblclick:Le,onMouseenter:De,onMousemove:Be,onMouseleave:et,onKeyDown:M.value?$:void 0},[w.value?null:qe(Y.value===!1?l.value.default:Y.value,{id:t.id,sourceNode:L,targetNode:z,source:y.value.source,target:y.value.target,type:y.value.type,updatable:V.value,selected:y.value.selected,animated:y.value.animated,label:y.value.label,labelStyle:y.value.labelStyle,labelShowBg:y.value.labelShowBg,labelBgStyle:y.value.labelBgStyle,labelBgPadding:y.value.labelBgPadding,labelBgBorderRadius:y.value.labelBgBorderRadius,data:y.value.data,events:{...y.value.events,...N},style:G.value,markerStart:`url('#${id(y.value.markerStart,e)}')`,markerEnd:`url('#${id(y.value.markerEnd,e)}')`,sourcePosition:Q,targetPosition:ye,sourceX:fe,sourceY:be,targetX:Me,targetY:rt,sourceHandleId:y.value.sourceHandle,targetHandleId:y.value.targetHandle,interactionWidth:y.value.interactionWidth,...F}),[V.value==="source"||V.value===!0?[qe("g",{onMousedown:$e,onMouseenter:ie,onMouseout:ue},qe(HA,{position:Q,centerX:fe,centerY:be,radius:i.value,type:"source","data-type":"source"}))]:null,V.value==="target"||V.value===!0?[qe("g",{onMousedown:B,onMouseenter:ie,onMouseout:ue},qe(HA,{position:ye,centerX:Me,centerY:rt,radius:i.value,type:"target","data-type":"target"}))]:null]])};function ie(){k.value=!0}function ue(){k.value=!1}function _e(L,z){b.update({event:L,edge:y.value,connection:z})}function Ee(L){b.updateEnd({event:L,edge:y.value}),w.value=!1}function he(L,z){L.button===0&&(w.value=!0,P.value=z?y.value.target:y.value.source,C.value=(z?y.value.targetHandle:y.value.sourceHandle)??null,v.value=z?"target":"source",b.updateStart({event:L,edge:y.value}),se(L))}function de(L){var z;const F={event:L,edge:y.value};I.value&&(s.value=!1,y.value.selected&&p.value?(u([y.value]),(z=x.value)==null||z.blur()):n([y.value])),b.click(F)}function pe(L){b.contextMenu({event:L,edge:y.value})}function Le(L){b.doubleClick({event:L,edge:y.value})}function De(L){b.mouseEnter({event:L,edge:y.value})}function Be(L){b.mouseMove({event:L,edge:y.value})}function et(L){b.mouseLeave({event:L,edge:y.value})}function $e(L){he(L,!0)}function B(L){he(L,!1)}function $(L){var z;!m.value&&XC.includes(L.key)&&I.value&&(L.key==="Escape"?((z=x.value)==null||z.blur(),u([c(t.id)])):n([c(t.id)]))}}}),MX=Te({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var t;const{id:e,connectionMode:n,connectionStartHandle:r,connectionEndHandle:i,connectionPosition:o,connectionLineType:s,connectionLineStyle:a,connectionLineOptions:l,connectionStatus:u,viewport:c,findNode:d}=Dt(),h=(t=bt(Sp))==null?void 0:t["connection-line"],p=Z(()=>{var S;return d((S=r.value)==null?void 0:S.nodeId)}),m=Z(()=>{var S;return d((S=i.value)==null?void 0:S.nodeId)??null}),g=Z(()=>({x:(o.value.x-c.value.x)/c.value.zoom,y:(o.value.y-c.value.y)/c.value.zoom})),_=Z(()=>l.value.markerStart?`url(#${id(l.value.markerStart,e)})`:""),E=Z(()=>l.value.markerEnd?`url(#${id(l.value.markerEnd,e)})`:"");return()=>{var S,y,b;if(!p.value||!r.value)return null;const N=r.value.id,D=r.value.type,O=p.value.handleBounds;let k=(O==null?void 0:O[D])??[];if(n.value===ps.Loose){const G=(O==null?void 0:O[D==="source"?"target":"source"])??[];k=[...k,...G]}if(!k)return null;const w=(N?k.find(G=>G.id===N):k[0])??null,P=(w==null?void 0:w.position)??ze.Top,{x:C,y:v}=tu(p.value,w,P);let x=null;m.value&&(n.value===ps.Strict?x=((S=m.value.handleBounds[D==="source"?"target":"source"])==null?void 0:S.find(G=>{var Y;return G.id===((Y=i.value)==null?void 0:Y.id)}))||null:x=((y=[...m.value.handleBounds.source??[],...m.value.handleBounds.target??[]])==null?void 0:y.find(G=>{var Y;return G.id===((Y=i.value)==null?void 0:Y.id)}))||null);const I=((b=i.value)==null?void 0:b.position)??(P?b0[P]:null);if(!P||!I)return null;const V=s.value??l.value.type??ba.Bezier;let M="";const H={sourceX:C,sourceY:v,sourcePosition:P,targetX:g.value.x,targetY:g.value.y,targetPosition:I};return V===ba.Bezier?[M]=VA(H):V===ba.Step?[M]=T0({...H,borderRadius:0}):V===ba.SmoothStep?[M]=T0(H):V===ba.SimpleBezier?[M]=zA(H):M=`M${C},${v} ${g.value.x},${g.value.y}`,qe("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},qe("g",{class:"vue-flow__connection"},h?qe(h,{sourceX:C,sourceY:v,sourcePosition:P,targetX:g.value.x,targetY:g.value.y,targetPosition:I,sourceNode:p.value,sourceHandle:w,targetNode:m.value,targetHandle:x,markerEnd:E.value,markerStart:_.value,connectionStatus:u.value}):qe("path",{d:M,class:[l.value.class,u.value,"vue-flow__connection-path"],style:{...a.value,...l.value.style},"marker-end":E.value,"marker-start":_.value})))}}}),LX=["id","markerWidth","markerHeight","markerUnits","orient"],VX=Te({...{name:"MarkerType",compatConfig:{MODE:3}},props:{id:{},type:{},color:{default:"none"},width:{default:12.5},height:{default:12.5},markerUnits:{default:"strokeWidth"},orient:{default:"auto-start-reverse"},strokeWidth:{default:1}},setup(t){return(e,n)=>(j(),K("marker",{id:e.id,class:"vue-flow__arrowhead",viewBox:"-10 -10 20 20",refX:"0",refY:"0",markerWidth:`${e.width}`,markerHeight:`${e.height}`,markerUnits:e.markerUnits,orient:e.orient},[e.type===re(f0).ArrowClosed?(j(),K("polyline",{key:0,style:Ze({stroke:e.color,fill:e.color,strokeWidth:e.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",points:"-5,-4 0,0 -5,4 -5,-4"},null,4)):Ae("",!0),e.type===re(f0).Arrow?(j(),K("polyline",{key:1,style:Ze({stroke:e.color,strokeWidth:e.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",fill:"none",points:"-5,-4 0,0 -5,4"},null,4)):Ae("",!0)],8,LX))}}),FX={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},zX=Te({...{name:"MarkerDefinitions",compatConfig:{MODE:3}},setup(t){const{id:e,edges:n,connectionLineOptions:r,defaultMarkerColor:i}=Dt(),o=Z(()=>{const s=new Set,a=[],l=u=>{if(u){const c=id(u,e);s.has(c)||(typeof u=="object"?a.push({...u,id:c,color:u.color||i.value}):a.push({id:c,color:i.value,type:u}),s.add(c))}};for(const u of[r.value.markerEnd,r.value.markerStart])l(u);for(const u of n.value)for(const c of[u.markerStart,u.markerEnd])l(c);return a.sort((u,c)=>u.id.localeCompare(c.id))});return(s,a)=>(j(),K("svg",FX,[A("defs",null,[(j(!0),K(Ve,null,It(o.value,l=>(j(),Ne(VX,{id:l.id,key:l.id,type:l.type,color:l.color,width:l.width,height:l.height,markerUnits:l.markerUnits,"stroke-width":l.strokeWidth,orient:l.orient},null,8,["id","type","color","width","height","markerUnits","stroke-width","orient"]))),128))])]))}}),UX=Te({...{name:"Edges",compatConfig:{MODE:3}},setup(t){const{findNode:e,getEdges:n,elevateEdgesOnSelect:r}=Dt();return(i,o)=>(j(),K(Ve,null,[ce(zX),(j(!0),K(Ve,null,It(re(n),s=>(j(),K("svg",{key:s.id,class:"vue-flow__edges vue-flow__container",style:Ze({zIndex:re(TZ)(s,re(e),re(r))})},[ce(re($X),{id:s.id},null,8,["id"])],4))),128)),ce(re(MX))],64))}}),BX=Te({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(t){const{id:e,noPanClassName:n,selectNodesOnDrag:r,nodesSelectionActive:i,multiSelectionActive:o,emits:s,removeSelectedNodes:a,addSelectedNodes:l,updateNodeDimensions:u,onUpdateNodeInternals:c,getNodeTypes:d,nodeExtent:h,elevateNodesOnSelect:p,disableKeyboardA11y:m,ariaLiveMessage:g,snapToGrid:_,snapGrid:E,nodeDragThreshold:S,nodesDraggable:y,elementsSelectable:b,nodesConnectable:N,nodesFocusable:D,hooks:O}=Dt(),k=we(null);to(AA,k),to(S0,t.id);const w=bt(Sp),P=xn(),C=RA(),{node:v,parentNode:x}=NA(t.id),{emit:I,on:V}=jZ(v,s),M=Ot(()=>typeof v.draggable>"u"?y.value:v.draggable),H=Ot(()=>typeof v.selectable>"u"?b.value:v.selectable),G=Ot(()=>typeof v.connectable>"u"?N.value:v.connectable),Y=Ot(()=>typeof v.focusable>"u"?D.value:v.focusable),se=Z(()=>H.value||M.value||O.value.nodeClick.hasListeners()||O.value.nodeDoubleClick.hasListeners()||O.value.nodeMouseEnter.hasListeners()||O.value.nodeMouseMove.hasListeners()||O.value.nodeMouseLeave.hasListeners()),ie=Ot(()=>!!v.dimensions.width&&!!v.dimensions.height),ue=Z(()=>{const z=v.type||"default",F=w==null?void 0:w[`node-${z}`];if(F)return F;let W=v.template||d.value[z];if(typeof W=="string"&&P){const ee=Object.keys(P.appContext.components);ee&&ee.includes(z)&&(W=kr(z,!1))}return W&&typeof W!="string"?W:(s.error(new Pn(In.NODE_TYPE_MISSING,W)),!1)}),_e=PA({id:t.id,el:k,disabled:()=>!M.value,selectable:H,dragHandle:()=>v.dragHandle,onStart(z){I.dragStart(z)},onDrag(z){I.drag(z)},onStop(z){I.dragStop(z)},onClick(z){$(z)}}),Ee=Z(()=>v.class instanceof Function?v.class(v):v.class),he=Z(()=>{const z=(v.style instanceof Function?v.style(v):v.style)||{},F=v.width instanceof Function?v.width(v):v.width,W=v.height instanceof Function?v.height(v):v.height;return!z.width&&F&&(z.width=typeof F=="string"?F:`${F}px`),!z.height&&W&&(z.height=typeof W=="string"?W:`${W}px`),z}),de=Ot(()=>Number(v.zIndex??he.value.zIndex??0));return c(z=>{(z.includes(t.id)||!z.length)&&Le()}),Gt(()=>{Qe(()=>v.hidden,(z=!1,F,W)=>{!z&&k.value&&(t.resizeObserver.observe(k.value),W(()=>{k.value&&t.resizeObserver.unobserve(k.value)}))},{immediate:!0,flush:"post"})}),Qe([()=>v.type,()=>v.sourcePosition,()=>v.targetPosition],()=>{mr(()=>{u([{id:t.id,nodeElement:k.value,forceUpdate:!0}])})}),Qe([()=>v.position.x,()=>v.position.y,()=>{var z;return(z=x.value)==null?void 0:z.computedPosition.x},()=>{var z;return(z=x.value)==null?void 0:z.computedPosition.y},()=>{var z;return(z=x.value)==null?void 0:z.computedPosition.z},de,()=>v.selected,()=>v.dimensions.height,()=>v.dimensions.width,()=>{var z;return(z=x.value)==null?void 0:z.dimensions.height},()=>{var z;return(z=x.value)==null?void 0:z.dimensions.width}],([z,F,W,ee,J,te])=>{const Q={x:z,y:F,z:te+(p.value&&v.selected?1e3:0)};typeof W<"u"&&typeof ee<"u"?v.computedPosition=bZ({x:W,y:ee,z:J},Q):v.computedPosition=Q},{flush:"post",immediate:!0}),Qe([()=>v.extent,h],([z,F],[W,ee])=>{(z!==W||F!==ee)&&pe()}),v.extent==="parent"||typeof v.extent=="object"&&"range"in v.extent&&v.extent.range==="parent"?Hy(()=>ie).toBe(!0).then(pe):pe(),()=>v.hidden?null:qe("div",{ref:k,"data-id":v.id,class:["vue-flow__node",`vue-flow__node-${ue.value===!1?"default":v.type||"default"}`,{[n.value]:M.value,dragging:_e==null?void 0:_e.value,draggable:M.value,selected:v.selected,selectable:H.value,parent:v.isParent},Ee.value],style:{visibility:ie.value?"visible":"hidden",zIndex:v.computedPosition.z??de.value,transform:`translate(${v.computedPosition.x}px,${v.computedPosition.y}px)`,pointerEvents:se.value?"all":"none",...he.value},tabIndex:Y.value?0:void 0,role:Y.value?"group":void 0,"aria-describedby":m.value?void 0:`${KC}-${e}`,"aria-label":v.ariaLabel,"aria-roledescription":"node",...v.domAttributes,onMouseenter:De,onMousemove:Be,onMouseleave:et,onContextmenu:$e,onClick:$,onDblclick:B,onKeydown:L},[qe(ue.value===!1?d.value.default:ue.value,{id:v.id,type:v.type,data:v.data,events:{...v.events,...V},selected:v.selected,resizing:v.resizing,dragging:_e.value,connectable:G.value,position:v.computedPosition,dimensions:v.dimensions,isValidTargetPos:v.isValidTargetPos,isValidSourcePos:v.isValidSourcePos,parent:v.parentNode,parentNodeId:v.parentNode,zIndex:v.computedPosition.z??de.value,targetPosition:v.targetPosition,sourcePosition:v.sourcePosition,label:v.label,dragHandle:v.dragHandle,onUpdateNodeInternals:Le})]);function pe(){const z=v.computedPosition,{computedPosition:F,position:W}=g0(v,_.value?wp(z,E.value):z,s.error,h.value,x.value);(v.computedPosition.x!==F.x||v.computedPosition.y!==F.y)&&(v.computedPosition={...v.computedPosition,...F}),(v.position.x!==W.x||v.position.y!==W.y)&&(v.position=W)}function Le(){k.value&&u([{id:t.id,nodeElement:k.value,forceUpdate:!0}])}function De(z){_e!=null&&_e.value||I.mouseEnter({event:z,node:v})}function Be(z){_e!=null&&_e.value||I.mouseMove({event:z,node:v})}function et(z){_e!=null&&_e.value||I.mouseLeave({event:z,node:v})}function $e(z){return I.contextMenu({event:z,node:v})}function B(z){return I.doubleClick({event:z,node:v})}function $(z){H.value&&(!r.value||!M.value||S.value>0)&&_0(v,o.value,l,a,i,!1,k.value),I.click({event:z,node:v})}function L(z){if(!(h0(z)||m.value))if(XC.includes(z.key)&&H.value){const F=z.key==="Escape";_0(v,o.value,l,a,i,F,k.value)}else M.value&&v.selected&&ql[z.key]&&(z.preventDefault(),g.value=`Moved selected node ${z.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~v.position.x}, y: ${~~v.position.y}`,C({x:ql[z.key].x,y:ql[z.key].y},z.shiftKey))}}});function jX(t={includeHiddenNodes:!1}){const{nodes:e}=Dt();return Z(()=>{if(e.value.length===0)return!1;for(const n of e.value)if((t.includeHiddenNodes||!n.hidden)&&((n==null?void 0:n.handleBounds)===void 0||n.dimensions.width===0||n.dimensions.height===0))return!1;return!0})}const HX={class:"vue-flow__nodes vue-flow__container"},GX=Te({...{name:"Nodes",compatConfig:{MODE:3}},setup(t){const{getNodes:e,updateNodeDimensions:n,emits:r}=Dt(),i=jX(),o=we();return Qe(i,s=>{s&&mr(()=>{r.nodesInitialized(e.value)})},{immediate:!0}),Gt(()=>{o.value=new ResizeObserver(s=>{const a=s.map(l=>({id:l.target.getAttribute("data-id"),nodeElement:l.target,forceUpdate:!0}));mr(()=>n(a))})}),Wa(()=>{var s;return(s=o.value)==null?void 0:s.disconnect()}),(s,a)=>(j(),K("div",HX,[o.value?(j(!0),K(Ve,{key:0},It(re(e),(l,u,c,d)=>{const h=[l.id];if(d&&d.key===l.id&&zm(d,h))return d;const p=(j(),Ne(re(BX),{id:l.id,key:l.id,"resize-observer":o.value},null,8,["id","resize-observer"]));return p.memo=h,p},a,0),128)):Ae("",!0)]))}});function WX(){const{emits:t}=Dt();Gt(()=>{if(wA()){const e=document.querySelector(".vue-flow__pane");e&&window.getComputedStyle(e).zIndex!=="1"&&t.error(new Pn(In.MISSING_STYLES))}})}const KX=A("div",{class:"vue-flow__edge-labels"},null,-1),ZX=Te({...{name:"VueFlow",compatConfig:{MODE:3}},props:{id:{},modelValue:{},nodes:{},edges:{},edgeTypes:{},nodeTypes:{},connectionMode:{},connectionLineType:{},connectionLineStyle:{default:void 0},connectionLineOptions:{default:void 0},connectionRadius:{},isValidConnection:{type:[Function,null],default:void 0},deleteKeyCode:{default:void 0},selectionKeyCode:{type:[Boolean,null],default:void 0},multiSelectionKeyCode:{default:void 0},zoomActivationKeyCode:{default:void 0},panActivationKeyCode:{default:void 0},snapToGrid:{type:Boolean,default:void 0},snapGrid:{},onlyRenderVisibleElements:{type:Boolean,default:void 0},edgesUpdatable:{type:[Boolean,String],default:void 0},nodesDraggable:{type:Boolean,default:void 0},nodesConnectable:{type:Boolean,default:void 0},nodeDragThreshold:{},elementsSelectable:{type:Boolean,default:void 0},selectNodesOnDrag:{type:Boolean,default:void 0},panOnDrag:{type:[Boolean,Array],default:void 0},minZoom:{},maxZoom:{},defaultViewport:{},translateExtent:{},nodeExtent:{},defaultMarkerColor:{},zoomOnScroll:{type:Boolean,default:void 0},zoomOnPinch:{type:Boolean,default:void 0},panOnScroll:{type:Boolean,default:void 0},panOnScrollSpeed:{},panOnScrollMode:{},paneClickDistance:{},zoomOnDoubleClick:{type:Boolean,default:void 0},preventScrolling:{type:Boolean,default:void 0},selectionMode:{},edgeUpdaterRadius:{},fitViewOnInit:{type:Boolean,default:void 0},connectOnClick:{type:Boolean,default:void 0},applyDefault:{type:Boolean,default:void 0},autoConnect:{type:[Boolean,Function],default:void 0},noDragClassName:{},noWheelClassName:{},noPanClassName:{},defaultEdgeOptions:{},elevateEdgesOnSelect:{type:Boolean,default:void 0},elevateNodesOnSelect:{type:Boolean,default:void 0},disableKeyboardA11y:{type:Boolean,default:void 0},edgesFocusable:{type:Boolean,default:void 0},nodesFocusable:{type:Boolean,default:void 0},autoPanOnConnect:{type:Boolean,default:void 0},autoPanOnNodeDrag:{type:Boolean,default:void 0},autoPanSpeed:{}},emits:["nodesChange","edgesChange","nodesInitialized","paneReady","init","updateNodeInternals","error","connect","connectStart","connectEnd","clickConnectStart","clickConnectEnd","moveStart","move","moveEnd","selectionDragStart","selectionDrag","selectionDragStop","selectionContextMenu","selectionStart","selectionEnd","viewportChangeStart","viewportChange","viewportChangeEnd","paneScroll","paneClick","paneContextMenu","paneMouseEnter","paneMouseMove","paneMouseLeave","edgeUpdate","edgeContextMenu","edgeMouseEnter","edgeMouseMove","edgeMouseLeave","edgeDoubleClick","edgeClick","edgeUpdateStart","edgeUpdateEnd","nodeContextMenu","nodeMouseEnter","nodeMouseMove","nodeMouseLeave","nodeDoubleClick","nodeClick","nodeDragStart","nodeDrag","nodeDragStop","miniMapNodeClick","miniMapNodeDoubleClick","miniMapNodeMouseEnter","miniMapNodeMouseMove","miniMapNodeMouseLeave","update:modelValue","update:nodes","update:edges"],setup(t,{expose:e,emit:n}){const r=t,i=i_(),o=Gy(r,"modelValue",n),s=Gy(r,"nodes",n),a=Gy(r,"edges",n),l=Dt(r),u=KZ({modelValue:o,nodes:s,edges:a},r,l);return XZ(n,l.hooks),NX(),WX(),to(Sp,i),lr(u),e(l),(c,d)=>(j(),K("div",{ref:re(l).vueFlowRef,class:"vue-flow"},[ce(CX,null,{default:Ce(()=>[ce(UX),KX,ce(GX),Mt(c.$slots,"zoom-pane")]),_:3}),Mt(c.$slots,"default"),ce(OX)],512))}}),XX=Te({...{name:"Panel",compatConfig:{MODE:3}},props:{position:{}},setup(t){const e=t,{userSelectionActive:n}=Dt(),r=Z(()=>`${e.position}`.split("-"));return(i,o)=>(j(),K("div",{class:Se(["vue-flow__panel",r.value]),style:Ze({pointerEvents:re(n)?"none":"all"})},[Mt(i.$slots,"default")],6))}}),YX={name:"ControlButton",compatConfig:{MODE:3}},JX=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},QX={type:"button",class:"vue-flow__controls-button"};function qX(t,e,n,r,i,o){return j(),K("button",QX,[Mt(t.$slots,"default")])}const Op=JX(YX,[["render",qX]]),eY={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},tY=[A("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"},null,-1)];function nY(t,e){return j(),K("svg",eY,tY)}const rY={render:nY},iY={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},oY=[A("path",{d:"M0 0h32v4.2H0z"},null,-1)];function sY(t,e){return j(),K("svg",iY,oY)}const aY={render:sY},lY={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},uY=[A("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0 0 27.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94a.919.919 0 0 1-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"},null,-1)];function cY(t,e){return j(),K("svg",lY,uY)}const dY={render:cY},fY={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},hY=[A("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"},null,-1)];function pY(t,e){return j(),K("svg",fY,hY)}const mY={render:pY},gY={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},vY=[A("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047z"},null,-1)];function yY(t,e){return j(),K("svg",gY,vY)}const bY={render:yY},_Y=Te({...{name:"Controls",compatConfig:{MODE:3}},props:{showZoom:{type:Boolean,default:!0},showFitView:{type:Boolean,default:!0},showInteractive:{type:Boolean,default:!0},fitViewParams:{},position:{default:()=>GC.BottomLeft}},emits:["zoomIn","zoomOut","fitView","interactionChange"],setup(t,{emit:e}){const{nodesDraggable:n,nodesConnectable:r,elementsSelectable:i,setInteractive:o,zoomIn:s,zoomOut:a,fitView:l,viewport:u,minZoom:c,maxZoom:d}=Dt(),h=Ot(()=>n.value||r.value||i.value),p=Ot(()=>u.value.zoom<=c.value),m=Ot(()=>u.value.zoom>=d.value);function g(){s(),e("zoomIn")}function _(){a(),e("zoomOut")}function E(){l(t.fitViewParams),e("fitView")}function S(){o(!h.value),e("interactionChange",!h.value)}return(y,b)=>(j(),Ne(re(XX),{class:"vue-flow__controls",position:y.position},{default:Ce(()=>[Mt(y.$slots,"top"),y.showZoom?(j(),K(Ve,{key:0},[Mt(y.$slots,"control-zoom-in",{},()=>[ce(Op,{class:"vue-flow__controls-zoomin",disabled:m.value,onClick:g},{default:Ce(()=>[Mt(y.$slots,"icon-zoom-in",{},()=>[(j(),Ne(Jn(re(rY))))])]),_:3},8,["disabled"])]),Mt(y.$slots,"control-zoom-out",{},()=>[ce(Op,{class:"vue-flow__controls-zoomout",disabled:p.value,onClick:_},{default:Ce(()=>[Mt(y.$slots,"icon-zoom-out",{},()=>[(j(),Ne(Jn(re(aY))))])]),_:3},8,["disabled"])])],64)):Ae("",!0),y.showFitView?Mt(y.$slots,"control-fit-view",{key:1},()=>[ce(Op,{class:"vue-flow__controls-fitview",onClick:E},{default:Ce(()=>[Mt(y.$slots,"icon-fit-view",{},()=>[(j(),Ne(Jn(re(dY))))])]),_:3})]):Ae("",!0),y.showInteractive?Mt(y.$slots,"control-interactive",{key:2},()=>[y.showInteractive?(j(),Ne(Op,{key:0,class:"vue-flow__controls-interactive",onClick:S},{default:Ce(()=>[h.value?Mt(y.$slots,"icon-unlock",{key:0},()=>[(j(),Ne(Jn(re(bY))))]):Ae("",!0),h.value?Ae("",!0):Mt(y.$slots,"icon-lock",{key:1},()=>[(j(),Ne(Jn(re(mY))))])]),_:3})):Ae("",!0)]):Ae("",!0),Mt(y.$slots,"default")]),_:3},8,["position"]))}});var C0="http://www.w3.org/1999/xhtml";const GA={svg:"http://www.w3.org/2000/svg",xhtml:C0,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function WA(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),GA.hasOwnProperty(e)?{space:GA[e],local:t}:t}function xY(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===C0&&e.documentElement.namespaceURI===C0?e.createElement(t):e.createElementNS(n,t)}}function wY(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function KA(t){var e=WA(t);return(e.local?wY:xY)(e)}function SY(){}function ZA(t){return t==null?SY:function(){return this.querySelector(t)}}function EY(t){typeof t!="function"&&(t=ZA(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,a=r[i]=new Array(s),l,u,c=0;c<s;++c)(l=o[c])&&(u=t.call(l,l.__data__,c,o))&&("__data__"in l&&(u.__data__=l.__data__),a[c]=u);return new ti(r,this._parents)}function TY(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function IY(){return[]}function CY(t){return t==null?IY:function(){return this.querySelectorAll(t)}}function AY(t){return function(){return TY(t.apply(this,arguments))}}function PY(t){typeof t=="function"?t=AY(t):t=CY(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var s=e[o],a=s.length,l,u=0;u<a;++u)(l=s[u])&&(r.push(t.call(l,l.__data__,u,s)),i.push(l));return new ti(r,i)}function kY(t){return function(){return this.matches(t)}}function XA(t){return function(e){return e.matches(t)}}var OY=Array.prototype.find;function NY(t){return function(){return OY.call(this.children,t)}}function RY(){return this.firstElementChild}function DY(t){return this.select(t==null?RY:NY(typeof t=="function"?t:XA(t)))}var $Y=Array.prototype.filter;function MY(){return Array.from(this.children)}function LY(t){return function(){return $Y.call(this.children,t)}}function VY(t){return this.selectAll(t==null?MY:LY(typeof t=="function"?t:XA(t)))}function FY(t){typeof t!="function"&&(t=kY(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,a=r[i]=[],l,u=0;u<s;++u)(l=o[u])&&t.call(l,l.__data__,u,o)&&a.push(l);return new ti(r,this._parents)}function YA(t){return new Array(t.length)}function zY(){return new ti(this._enter||this._groups.map(YA),this._parents)}function Np(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Np.prototype={constructor:Np,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function UY(t){return function(){return t}}function BY(t,e,n,r,i,o){for(var s=0,a,l=e.length,u=o.length;s<u;++s)(a=e[s])?(a.__data__=o[s],r[s]=a):n[s]=new Np(t,o[s]);for(;s<l;++s)(a=e[s])&&(i[s]=a)}function jY(t,e,n,r,i,o,s){var a,l,u=new Map,c=e.length,d=o.length,h=new Array(c),p;for(a=0;a<c;++a)(l=e[a])&&(h[a]=p=s.call(l,l.__data__,a,e)+"",u.has(p)?i[a]=l:u.set(p,l));for(a=0;a<d;++a)p=s.call(t,o[a],a,o)+"",(l=u.get(p))?(r[a]=l,l.__data__=o[a],u.delete(p)):n[a]=new Np(t,o[a]);for(a=0;a<c;++a)(l=e[a])&&u.get(h[a])===l&&(i[a]=l)}function HY(t){return t.__data__}function GY(t,e){if(!arguments.length)return Array.from(this,HY);var n=e?jY:BY,r=this._parents,i=this._groups;typeof t!="function"&&(t=UY(t));for(var o=i.length,s=new Array(o),a=new Array(o),l=new Array(o),u=0;u<o;++u){var c=r[u],d=i[u],h=d.length,p=WY(t.call(c,c&&c.__data__,u,r)),m=p.length,g=a[u]=new Array(m),_=s[u]=new Array(m),E=l[u]=new Array(h);n(c,d,g,_,E,p,e);for(var S=0,y=0,b,N;S<m;++S)if(b=g[S]){for(S>=y&&(y=S+1);!(N=_[y])&&++y<m;);b._next=N||null}}return s=new ti(s,r),s._enter=a,s._exit=l,s}function WY(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function KY(){return new ti(this._exit||this._groups.map(YA),this._parents)}function ZY(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function XY(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,s=Math.min(i,o),a=new Array(i),l=0;l<s;++l)for(var u=n[l],c=r[l],d=u.length,h=a[l]=new Array(d),p,m=0;m<d;++m)(p=u[m]||c[m])&&(h[m]=p);for(;l<i;++l)a[l]=n[l];return new ti(a,this._parents)}function YY(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],s;--i>=0;)(s=r[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function JY(t){t||(t=QY);function e(d,h){return d&&h?t(d.__data__,h.__data__):!d-!h}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var s=n[o],a=s.length,l=i[o]=new Array(a),u,c=0;c<a;++c)(u=s[c])&&(l[c]=u);l.sort(e)}return new ti(i,this._parents).order()}function QY(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function qY(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function eJ(){return Array.from(this)}function tJ(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null}function nJ(){let t=0;for(const e of this)++t;return t}function rJ(){return!this.node()}function iJ(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,s=i.length,a;o<s;++o)(a=i[o])&&t.call(a,a.__data__,o,i);return this}function oJ(t){return function(){this.removeAttribute(t)}}function sJ(t){return function(){this.removeAttributeNS(t.space,t.local)}}function aJ(t,e){return function(){this.setAttribute(t,e)}}function lJ(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function uJ(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function cJ(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function dJ(t,e){var n=WA(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?sJ:oJ:typeof e=="function"?n.local?cJ:uJ:n.local?lJ:aJ)(n,e))}function JA(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function fJ(t){return function(){this.style.removeProperty(t)}}function hJ(t,e,n){return function(){this.style.setProperty(t,e,n)}}function pJ(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function mJ(t,e,n){return arguments.length>1?this.each((e==null?fJ:typeof e=="function"?pJ:hJ)(t,e,n??"")):gJ(this.node(),t)}function gJ(t,e){return t.style.getPropertyValue(e)||JA(t).getComputedStyle(t,null).getPropertyValue(e)}function vJ(t){return function(){delete this[t]}}function yJ(t,e){return function(){this[t]=e}}function bJ(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function _J(t,e){return arguments.length>1?this.each((e==null?vJ:typeof e=="function"?bJ:yJ)(t,e)):this.node()[t]}function QA(t){return t.trim().split(/^|\s+/)}function A0(t){return t.classList||new qA(t)}function qA(t){this._node=t,this._names=QA(t.getAttribute("class")||"")}qA.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function eP(t,e){for(var n=A0(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function tP(t,e){for(var n=A0(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function xJ(t){return function(){eP(this,t)}}function wJ(t){return function(){tP(this,t)}}function SJ(t,e){return function(){(e.apply(this,arguments)?eP:tP)(this,t)}}function EJ(t,e){var n=QA(t+"");if(arguments.length<2){for(var r=A0(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?SJ:e?xJ:wJ)(n,e))}function TJ(){this.textContent=""}function IJ(t){return function(){this.textContent=t}}function CJ(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function AJ(t){return arguments.length?this.each(t==null?TJ:(typeof t=="function"?CJ:IJ)(t)):this.node().textContent}function PJ(){this.innerHTML=""}function kJ(t){return function(){this.innerHTML=t}}function OJ(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function NJ(t){return arguments.length?this.each(t==null?PJ:(typeof t=="function"?OJ:kJ)(t)):this.node().innerHTML}function RJ(){this.nextSibling&&this.parentNode.appendChild(this)}function DJ(){return this.each(RJ)}function $J(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function MJ(){return this.each($J)}function LJ(t){var e=typeof t=="function"?t:KA(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function VJ(){return null}function FJ(t,e){var n=typeof t=="function"?t:KA(t),r=e==null?VJ:typeof e=="function"?e:ZA(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function zJ(){var t=this.parentNode;t&&t.removeChild(this)}function UJ(){return this.each(zJ)}function BJ(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function jJ(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function HJ(t){return this.select(t?jJ:BJ)}function GJ(t){return arguments.length?this.property("__data__",t):this.node().__data__}function WJ(t){return function(e){t.call(this,e,this.__data__)}}function KJ(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function ZJ(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function XJ(t,e,n){return function(){var r=this.__on,i,o=WJ(e);if(r){for(var s=0,a=r.length;s<a;++s)if((i=r[s]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function YJ(t,e,n){var r=KJ(t+""),i,o=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,u=a.length,c;l<u;++l)for(i=0,c=a[l];i<o;++i)if((s=r[i]).type===c.type&&s.name===c.name)return c.value}return}for(a=e?XJ:ZJ,i=0;i<o;++i)this.each(a(r[i],e,n));return this}function nP(t,e,n){var r=JA(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function JJ(t,e){return function(){return nP(this,t,e)}}function QJ(t,e){return function(){return nP(this,t,e.apply(this,arguments))}}function qJ(t,e){return this.each((typeof e=="function"?QJ:JJ)(t,e))}function*eQ(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,s;i<o;++i)(s=r[i])&&(yield s)}var tQ=[null];function ti(t,e){this._groups=t,this._parents=e}function nQ(){return this}ti.prototype={constructor:ti,select:EY,selectAll:PY,selectChild:DY,selectChildren:VY,filter:FY,data:GY,enter:zY,exit:KY,join:ZY,merge:XY,selection:nQ,order:YY,sort:JY,call:qY,nodes:eJ,node:tJ,size:nJ,empty:rJ,each:iJ,attr:dJ,style:mJ,property:_J,classed:EJ,text:AJ,html:NJ,raise:DJ,lower:MJ,append:LJ,insert:FJ,remove:UJ,clone:HJ,datum:GJ,on:YJ,dispatch:qJ,[Symbol.iterator]:eQ};function sd(t){return typeof t=="string"?new ti([[document.querySelector(t)]],[document.documentElement]):new ti([[t]],tQ)}function rQ(t){let e;for(;e=t.sourceEvent;)t=e;return t}function rP(t,e){if(t=rQ(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}var iQ={value:()=>{}};function iP(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Rp(n)}function Rp(t){this._=t}function oQ(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Rp.prototype=iP.prototype={constructor:Rp,on:function(t,e){var n=this._,r=oQ(t+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(t=r[o]).type)&&(i=sQ(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<s;)if(i=(t=r[o]).type)n[i]=oP(n[i],t.name,e);else if(e==null)for(i in n)n[i]=oP(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Rp(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function sQ(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function oP(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=iQ,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}const aQ={passive:!1},ad={capture:!0,passive:!1};function P0(t){t.stopImmediatePropagation()}function nu(t){t.preventDefault(),t.stopImmediatePropagation()}function lQ(t){var e=t.document.documentElement,n=sd(t).on("dragstart.drag",nu,ad);"onselectstart"in e?n.on("selectstart.drag",nu,ad):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function uQ(t,e){var n=t.document.documentElement,r=sd(t).on("dragstart.drag",null);e&&(r.on("click.drag",nu,ad),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Dp=t=>()=>t;function k0(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:o,x:s,y:a,dx:l,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}k0.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function cQ(t){return!t.ctrlKey&&!t.button}function dQ(){return this.parentNode}function fQ(t,e){return e??{x:t.x,y:t.y}}function hQ(){return navigator.maxTouchPoints||"ontouchstart"in this}function pQ(){var t=cQ,e=dQ,n=fQ,r=hQ,i={},o=iP("start","drag","end"),s=0,a,l,u,c,d=0;function h(b){b.on("mousedown.drag",p).filter(r).on("touchstart.drag",_).on("touchmove.drag",E,aQ).on("touchend.drag touchcancel.drag",S).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(b,N){if(!(c||!t.call(this,b,N))){var D=y(this,e.call(this,b,N),b,N,"mouse");D&&(sd(b.view).on("mousemove.drag",m,ad).on("mouseup.drag",g,ad),lQ(b.view),P0(b),u=!1,a=b.clientX,l=b.clientY,D("start",b))}}function m(b){if(nu(b),!u){var N=b.clientX-a,D=b.clientY-l;u=N*N+D*D>d}i.mouse("drag",b)}function g(b){sd(b.view).on("mousemove.drag mouseup.drag",null),uQ(b.view,u),nu(b),i.mouse("end",b)}function _(b,N){if(t.call(this,b,N)){var D=b.changedTouches,O=e.call(this,b,N),k=D.length,w,P;for(w=0;w<k;++w)(P=y(this,O,b,N,D[w].identifier,D[w]))&&(P0(b),P("start",b,D[w]))}}function E(b){var N=b.changedTouches,D=N.length,O,k;for(O=0;O<D;++O)(k=i[N[O].identifier])&&(nu(b),k("drag",b,N[O]))}function S(b){var N=b.changedTouches,D=N.length,O,k;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),O=0;O<D;++O)(k=i[N[O].identifier])&&(P0(b),k("end",b,N[O]))}function y(b,N,D,O,k,w){var P=o.copy(),C=rP(w||D,N),v,x,I;if((I=n.call(b,new k0("beforestart",{sourceEvent:D,target:h,identifier:k,active:s,x:C[0],y:C[1],dx:0,dy:0,dispatch:P}),O))!=null)return v=I.x-C[0]||0,x=I.y-C[1]||0,function V(M,H,G){var Y=C,se;switch(M){case"start":i[k]=V,se=s++;break;case"end":delete i[k],--s;case"drag":C=rP(G||H,N),se=s;break}P.call(M,b,new k0(M,{sourceEvent:H,subject:I,target:h,identifier:k,active:se,x:C[0]+v,y:C[1]+x,dx:C[0]-Y[0],dy:C[1]-Y[1],dispatch:P}),O)}}return h.filter=function(b){return arguments.length?(t=typeof b=="function"?b:Dp(!!b),h):t},h.container=function(b){return arguments.length?(e=typeof b=="function"?b:Dp(b),h):e},h.subject=function(b){return arguments.length?(n=typeof b=="function"?b:Dp(b),h):n},h.touchable=function(b){return arguments.length?(r=typeof b=="function"?b:Dp(!!b),h):r},h.on=function(){var b=o.on.apply(o,arguments);return b===o?h:b},h.clickDistance=function(b){return arguments.length?(d=(b=+b)*b,h):Math.sqrt(d)},h}var wa=(t=>(t.Line="line",t.Handle="handle",t))(wa||{});function mQ({width:t,prevWidth:e,height:n,prevHeight:r,invertX:i,invertY:o}){const s=t-e,a=n-r,l=[s>0?1:s<0?-1:0,a>0?1:a<0?-1:0];return s&&i&&(l[0]=l[0]*-1),a&&o&&(l[1]=l[1]*-1),l}const gQ={[wa.Line]:"right",[wa.Handle]:"bottom-right"},vQ={[wa.Line]:"borderColor",[wa.Handle]:"backgroundColor"},sP=Te({...{name:"ResizeControl",compatConfig:{MODE:3}},props:{nodeId:{},color:{},minWidth:{default:10},minHeight:{default:10},maxWidth:{default:Number.MAX_VALUE},maxHeight:{default:Number.MAX_VALUE},position:{},variant:{default:"handle"},shouldResize:{},keepAspectRatio:{type:[Boolean,Number],default:!1},autoScale:{type:Boolean,default:!0},handleClassName:{},handleStyle:{},lineClassName:{},lineStyle:{},isVisible:{type:Boolean}},emits:["resizeStart","resize","resizeEnd"],setup(t,{emit:e}){const n=t,r={width:0,height:0,x:0,y:0},i={...r,pointerX:0,pointerY:0,aspectRatio:1},{findNode:o,emits:s,viewport:a,noDragClassName:l}=Dt(),u=kA(),c=we();let d=i,h=r;const p=Ot(()=>n.position??gQ[n.variant]),m=Z(()=>p.value.split("-")),g=Ot(()=>n.color?{[vQ[n.variant]]:n.color}:{});return kb(_=>{if(!c.value||!n.nodeId)return;const E=sd(c.value),S=p.value.includes("right")||p.value.includes("left"),y=p.value.includes("bottom")||p.value.includes("top"),b=p.value.includes("left"),N=p.value.includes("top"),D=pQ().on("start",O=>{const k=o(n.nodeId),{xSnapped:w,ySnapped:P}=u(O);h={width:(k==null?void 0:k.dimensions.width)??0,height:(k==null?void 0:k.dimensions.height)??0,x:(k==null?void 0:k.position.x)??0,y:(k==null?void 0:k.position.y)??0},d={...h,pointerX:w,pointerY:P,aspectRatio:h.width/h.height},e("resizeStart",{event:O,params:h})}).on("drag",O=>{var k;const{xSnapped:w,ySnapped:P}=u(O),C=o(n.nodeId);if(C){const v=[],{pointerX:x,pointerY:I,width:V,height:M,x:H,y:G,aspectRatio:Y}=d,{x:se,y:ie,width:ue,height:_e}=h,Ee=Math.floor(S?w-x:0),he=Math.floor(y?P-I:0);let de=Ao(V+(b?-Ee:Ee),n.minWidth,n.maxWidth),pe=Ao(M+(N?-he:he),n.minHeight,n.maxHeight);if(n.keepAspectRatio){const B=de/pe;let $=Y;typeof n.keepAspectRatio=="number"&&B!==n.keepAspectRatio&&($=n.keepAspectRatio);const L=S&&y,z=S&&!y,F=y&&!S;de=B<=$&&L||F?pe*$:de,pe=B>$&&L||z?de/$:pe,de>=n.maxWidth?(de=n.maxWidth,pe=n.maxWidth/$):de<=n.minWidth&&(de=n.minWidth,pe=n.minWidth/$),pe>=n.maxHeight?(pe=n.maxHeight,de=n.maxHeight*$):pe<=n.minHeight&&(pe=n.minHeight,de=n.minHeight*$)}const Le=de!==ue,De=pe!==_e;if(b||N){const B=b?H-(de-V):H,$=N?G-(pe-M):G,L=B!==se&&Le,z=$!==ie&&De;if(L||z){const F={id:C.id,type:"position",from:C.position,position:{x:L?B:se,y:z?$:ie}};v.push(F),h.x=F.position.x,h.y=F.position.y}}if(n.nodeId&&(Le||De)){const B={id:n.nodeId,type:"dimensions",updateStyle:!0,resizing:!0,dimensions:{width:de,height:pe}};v.push(B),h.width=de,h.height=pe}if(v.length===0)return;const Be=mQ({width:h.width,prevWidth:ue,height:h.height,prevHeight:_e,invertX:b,invertY:N}),et={...h,direction:Be};if(((k=n.shouldResize)==null?void 0:k.call(n,O,et))===!1)return;e("resize",{event:O,params:et}),s.nodesChange(v)}}).on("end",O=>{if(n.nodeId){const k={id:n.nodeId,type:"dimensions",resizing:!1};e("resizeEnd",{event:O,params:h}),s.nodesChange([k])}});E.call(D),_(()=>{E.on(".drag",null)})}),(_,E)=>(j(),K("div",{ref_key:"resizeControlRef",ref:c,class:Se(["vue-flow__resize-control",[...m.value,_.variant,re(l)]]),style:Ze({...g.value,scale:_.variant===re(wa).Handle?`${Math.max(1/re(a).zoom,1)}`:void 0})},[Mt(_.$slots,"default")],6))}}),yQ=Te({...{name:"NodeResizer",compatConfig:{MODE:3},inheritAttrs:!1},props:{nodeId:{},color:{},handleClassName:{},handleStyle:{},lineClassName:{},lineStyle:{},isVisible:{type:Boolean,default:!0},minWidth:{},minHeight:{},maxWidth:{},maxHeight:{},shouldResize:{},keepAspectRatio:{type:[Boolean,Number]},autoScale:{type:Boolean,default:!0}},emits:["resizeStart","resize","resizeEnd"],setup(t,{emit:e}){const n=t,{findNode:r,emits:i}=Dt(),o=["top-left","top-right","bottom-left","bottom-right"],s=["top","right","bottom","left"],a=bt(S0,null),l=Ot(()=>typeof n.nodeId=="string"?n.nodeId:a),u=Z(()=>r(l.value));return Qe([()=>n.minWidth,()=>n.minHeight,()=>n.maxWidth,()=>n.maxHeight,()=>{var c;return!!((c=u.value)!=null&&c.dimensions.width)&&!!u.value.dimensions.height}],([c,d,h,p,m])=>{const g=u.value;if(g&&m){const _={id:g.id,type:"dimensions",updateStyle:!0,dimensions:{width:g.dimensions.width,height:g.dimensions.height}};c&&g.dimensions.width<c&&(_.dimensions.width=c),d&&g.dimensions.height<d&&(_.dimensions.height=d),h&&g.dimensions.width>h&&(_.dimensions.width=h),p&&g.dimensions.height>p&&(_.dimensions.height=p),(_.dimensions.width!==g.dimensions.width||_.dimensions.height!==g.dimensions.height)&&i.nodesChange([_])}},{flush:"post",immediate:!0}),(c,d)=>c.isVisible?(j(),K(Ve,{key:0},[(j(),K(Ve,null,It(s,h=>ce(sP,{key:h,class:Se(c.lineClassName),style:Ze(c.lineStyle),"node-id":l.value,position:h,variant:re(wa).Line,color:c.color,"min-width":c.minWidth,"min-height":c.minHeight,"max-width":c.maxWidth,"max-height":c.maxHeight,"should-resize":c.shouldResize,"keep-aspect-ratio":c.keepAspectRatio,"auto-scale":c.autoScale,onResizeStart:d[0]||(d[0]=p=>e("resizeStart",p)),onResize:d[1]||(d[1]=p=>e("resize",p)),onResizeEnd:d[2]||(d[2]=p=>e("resizeEnd",p))},null,8,["class","style","node-id","position","variant","color","min-width","min-height","max-width","max-height","should-resize","keep-aspect-ratio","auto-scale"])),64)),(j(),K(Ve,null,It(o,h=>ce(sP,{key:h,class:Se(c.handleClassName),style:Ze(c.handleStyle),"node-id":l.value,position:h,color:c.color,"min-width":c.minWidth,"min-height":c.minHeight,"max-width":c.maxWidth,"max-height":c.maxHeight,"should-resize":c.shouldResize,"keep-aspect-ratio":c.keepAspectRatio,"auto-scale":c.autoScale,onResizeStart:d[3]||(d[3]=p=>e("resizeStart",p)),onResize:d[4]||(d[4]=p=>e("resize",p)),onResizeEnd:d[5]||(d[5]=p=>e("resizeEnd",p))},null,8,["class","style","node-id","position","color","min-width","min-height","max-width","max-height","should-resize","keep-aspect-ratio","auto-scale"])),64))],64)):Ae("",!0)}}),bQ=["data-lumina-id"],_Q=["src"],xQ={key:1,class:"placeholder"},aP=Qr(Te({__name:"StudioDiagramNode",props:{id:{},data:{},selected:{type:Boolean},label:{},type:{},style:{},editable:{type:Boolean},elementId:{}},setup(t){const e=t,n=Z(()=>{if(!e.label)return null;if(typeof e.label=="string")return e.label;if(typeof e.label=="object"&&"toString"in e.label){const a=e.label.toString();if(a!=="[object Object]")return a}return null}),r=Z(()=>{var a,l;return((a=e.data)==null?void 0:a.type)==="image"||((l=e.data)==null?void 0:l.shape)==="image"}),i=Z(()=>{var a;return((a=e.data)==null?void 0:a.shape)||"rectangle"}),o=Z(()=>{var a,l,u,c,d,h;return{backgroundColor:((a=e.style)==null?void 0:a.backgroundColor)||((u=(l=e.data)==null?void 0:l.style)==null?void 0:u.backgroundColor)||"#ffffff",color:((c=e.style)==null?void 0:c.color)||((h=(d=e.data)==null?void 0:d.style)==null?void 0:h.color)||"#000000",borderRadius:i.value==="rounded"?"12px":"4px",border:e.editable&&e.selected?"2px solid #3b82f6":"1px solid #ccc"}}),s=Z(()=>({borderRadius:"4px",border:e.editable&&e.selected?"2px solid #3b82f6":"none",overflow:"hidden"}));return(a,l)=>{var u,c;return j(),K("div",{class:"studio-diagram-node","data-lumina-id":t.elementId||void 0},[t.editable&&t.selected?(j(),Ne(re(yQ),{key:0,"min-width":80,"min-height":40})):Ae("",!0),r.value?(j(),K("div",{key:1,class:"node-content node-image",style:Ze(s.value)},[(u=t.data)!=null&&u.imageUrl?(j(),K("img",{key:0,src:t.data.imageUrl,alt:"",class:"node-img"},null,8,_Q)):(j(),K("div",xQ,[...l[0]||(l[0]=[A("i",{class:"ph-thin ph-image text-2xl text-gray-400"},null,-1),A("span",{class:"text-xs text-gray-400"},"No Image",-1)])]))],4)):(j(),K("div",{key:2,class:"node-content",style:Ze(o.value)},Ie(n.value||((c=t.data)==null?void 0:c.label)||"Node"),5)),t.editable?(j(),K(Ve,{key:3},[ce(re(bs),{type:"target",position:re(ze).Top,class:"node-handle"},null,8,["position"]),ce(re(bs),{type:"source",position:re(ze).Bottom,class:"node-handle"},null,8,["position"]),ce(re(bs),{type:"target",position:re(ze).Left,class:"node-handle"},null,8,["position"]),ce(re(bs),{type:"source",position:re(ze).Right,class:"node-handle"},null,8,["position"])],64)):Ae("",!0)],8,bQ)}}}),[["__scopeId","data-v-602e723d"]]),lP=Te({__name:"LayoutDiagram",props:{data:{}},setup(t){const e=t,{options:n,index:r}=hg(),i=Z(()=>!!n.studio),o=we(e.data.nodes||[]),s=we(e.data.edges||[]);Qe(()=>e.data.edges,y=>{y&&JSON.stringify(y)!==JSON.stringify(s.value)&&(s.value=[...y])},{deep:!0}),Gt(()=>{e.data.nodes&&(o.value=[...e.data.nodes]),e.data.edges&&(s.value=[...e.data.edges])});const{onNodeDragStop:a,onConnect:l}=Dt(),u=()=>{const y=o.value.map(b=>JSON.parse(JSON.stringify(b)));Promise.resolve().then(()=>zu).then(({bus:b})=>{b.emit("action",{type:"slide-update",slideIndex:r.value,patch:{nodes:y}})})};Promise.resolve().then(()=>zu).then(({bus:y})=>{y.on("diagram-node-update",b=>{if(b.slideIndex!==r.value)return;const N=o.value.findIndex(D=>D.id===b.nodeId);if(N!==-1){const D=o.value[N],O=b.key.split(".");let k=D;for(let w=0;w<O.length-1;w++)k[O[w]]||(k[O[w]]={}),k=k[O[w]];k[O[O.length-1]]=b.value,o.value=[...o.value],u()}})}),a(y=>{if(!i.value)return;const b=o.value.map(N=>JSON.parse(JSON.stringify(N)));Promise.resolve().then(()=>zu).then(({bus:N})=>{N.emit("action",{type:"slide-update",slideIndex:r.value,patch:{nodes:b}})})}),l(y=>{if(!i.value)return;const b={id:`edge-${y.source}-${y.target}-${Date.now()}`,source:y.source,target:y.target,sourceHandle:y.sourceHandle,targetHandle:y.targetHandle,type:"default",animated:!1};s.value=[...s.value,b];const N=s.value.map(D=>JSON.parse(JSON.stringify(D)));Promise.resolve().then(()=>zu).then(({bus:D})=>{D.emit("action",{type:"slide-update",slideIndex:r.value,patch:{edges:N}})})});const c=bt(tv,null),{onNodeClick:d,onPaneClick:h,onEdgeClick:p,addNodes:m,project:g,findNode:_}=Dt();d(({node:y})=>{if(!i.value||!c)return;const N=(e.data.nodes||[]).findIndex(D=>D.id===y.id);N!==-1&&c.select(`slides.${r.value}.nodes.${N}`)}),p(({edge:y})=>{if(!i.value||!c)return;const N=(e.data.edges||[]).findIndex(D=>D.id===y.id);if(N!==-1){const D=`slides.${r.value}.edges.${N}`;c.select(D)}});const E=y=>{y.preventDefault(),y.dataTransfer&&(y.dataTransfer.dropEffect="move")},S=y=>{var w;if(!i.value||!c)return;const b=(w=y.dataTransfer)==null?void 0:w.getData("application/vueflow");if(!b)return;const{left:N,top:D}=y.currentTarget.getBoundingClientRect(),O=g({x:y.clientX-N,y:y.clientY-D}),k={id:`node-${Date.now()}`,type:"default",position:O,label:`${b} Node`,data:{type:b,style:{backgroundColor:"#ffffff",color:"#000000",width:"150px",height:"50px"}}};c.store.addNode(`slides.${r.value}.nodes`,k),c.commit()};return(y,b)=>(j(),Ne(bi,{data:t.data,"slide-index":re(r),class:"layout-diagram"},{default:Ce(()=>[A("div",{class:Se(["w-full relative",t.data.sizing==="container"?"h-full min-h-[400px]":"h-screen"]),onClick:b[2]||(b[2]=Or(()=>{},["stop"]))},[ce(re(ZX),{nodes:o.value,"onUpdate:nodes":b[0]||(b[0]=N=>o.value=N),edges:s.value,"onUpdate:edges":b[1]||(b[1]=N=>s.value=N),class:"h-full w-full","fit-view-on-init":!0,"default-viewport":{zoom:1},"min-zoom":.1,"max-zoom":4,onDragover:E,onDrop:S},{"node-default":Ce(N=>{var D;return[ce(aP,ao(N,{editable:i.value,"element-id":(D=N.node)==null?void 0:D.id}),null,16,["editable","element-id"])]}),"node-input":Ce(N=>{var D;return[ce(aP,ao(N,{editable:i.value,"element-id":(D=N.node)==null?void 0:D.id}),null,16,["editable","element-id"])]}),default:Ce(()=>[i.value?(j(),Ne(re(_Y),{key:0})):Ae("",!0)]),_:1},8,["nodes","edges"])],2)]),_:1},8,["data","slide-index"]))}}),wQ={class:"w-full h-full"},SQ=Te({__name:"EditorLayoutFixed",props:{data:{},slideIndex:{}},setup(t){const e=n=>({half:Vy,statement:Fy,features:zy,timeline:Uy,steps:By,chart:WI,video:KI,auto:ZI,custom:XI,diagram:lP})[n]||"div";return(n,r)=>(j(),K("div",wQ,[ce(hs,{path:`slides.${t.slideIndex}`,label:t.data.type,class:"w-full h-full"},{default:Ce(()=>[(j(),Ne(Jn(e(t.data.type)),{data:t.data},null,8,["data"]))]),_:1},8,["path","label"])]))}}),EQ={class:"w-full h-full"},TQ=Te({__name:"EditorLayoutSteps",props:{data:{},slideIndex:{}},setup(t){return(e,n)=>(j(),K("div",EQ,[ce(hs,{path:`slides.${t.slideIndex}`,label:t.data.type,class:"w-full h-full"},{default:Ce(()=>[ce(By,{data:t.data},null,8,["data"])]),_:1},8,["path","label"])]))}}),IQ={class:"w-full h-full"},CQ=Te({__name:"EditorLayoutTimeline",props:{data:{},slideIndex:{}},setup(t){return(e,n)=>(j(),K("div",IQ,[ce(hs,{path:`slides.${t.slideIndex}`,label:t.data.type,class:"w-full h-full"},{default:Ce(()=>[ce(Uy,{data:t.data},null,8,["data"])]),_:1},8,["path","label"])]))}}),AQ={class:"w-full h-full"},PQ=Te({__name:"EditorLayoutFeatures",props:{data:{},slideIndex:{}},setup(t){return(e,n)=>(j(),K("div",AQ,[ce(hs,{path:`slides.${t.slideIndex}`,label:t.data.type,class:"w-full h-full"},{default:Ce(()=>[ce(zy,{data:t.data},null,8,["data"])]),_:1},8,["path","label"])]))}}),kQ={class:"w-full h-full"},OQ=Te({__name:"EditorLayoutHalf",props:{data:{},slideIndex:{}},setup(t){return(e,n)=>(j(),K("div",kQ,[ce(hs,{path:`slides.${t.slideIndex}`,label:t.data.type,class:"w-full h-full"},{default:Ce(()=>[ce(Vy,{data:t.data},null,8,["data"])]),_:1},8,["path","label"])]))}}),NQ={class:"w-full h-full"},RQ=Te({__name:"EditorLayoutStatement",props:{data:{},slideIndex:{}},setup(t){return(e,n)=>(j(),K("div",NQ,[ce(hs,{path:`slides.${t.slideIndex}`,label:t.data.type,class:"w-full h-full"},{default:Ce(()=>[ce(Fy,{data:t.data},null,8,["data"])]),_:1},8,["path","label"])]))}}),DQ={class:"absolute top-4 right-4 z-50 flex items-center gap-2 bg-black/60 backdrop-blur-md rounded-lg px-3 py-2 border border-white/10"},$Q={class:"text-white/70 text-xs font-mono w-12 text-center"},MQ={key:0,class:"absolute top-4 left-4 z-50 bg-blue-500/80 text-white text-xs px-2 py-1 rounded"},LQ={class:"absolute inset-0 z-0 pointer-events-none"},VQ={class:"absolute inset-0 z-10 overflow-y-auto overflow-x-hidden scroll-smooth"},FQ={class:"relative min-h-full w-full"},zQ={key:1,class:"flex w-full h-[720px] items-center justify-center text-white/30"},UQ=Qr(Te({__name:"EditorCanvas",setup(t){const{slide:e,index:n}=hg(),r=bt(dn),i=we(.6),o=we(0),s=we(0),a=we(!1),l=we({x:0,y:0}),u=Z(()=>({transform:`translate(${o.value}px, ${s.value}px) scale(${i.value})`,transformOrigin:"center center",transition:a.value?"none":"transform 0.15s ease-out"})),c=we({top:"-20%",left:"-10%"}),d=Z(()=>({backgroundColor:"var(--lumina-color-background, #030303)",color:"var(--lumina-color-text, #ffffff)",fontFamily:"var(--lumina-font-body, Inter, system-ui, sans-serif)"})),h=Z(()=>{var v,x,I,V,M,H;return{top:((I=(x=(v=e.value)==null?void 0:v.meta)==null?void 0:x.orbPos)==null?void 0:I.top)||c.value.top,left:((H=(M=(V=e.value)==null?void 0:V.meta)==null?void 0:M.orbPos)==null?void 0:H.left)||c.value.left}}),p=()=>{var M;const v=r==null?void 0:r.state.deck;if(!v)return;const x=((M=v.meta)==null?void 0:M.theme)||v.theme||"default",I=v.meta||{},V={colors:I.colors,typography:I.typography,spacing:I.spacing,borderRadius:I.borderRadius,effects:I.effects,components:I.components};Gl.inject(x,V)};Qe(()=>{var v,x;return(x=(v=r==null?void 0:r.state.deck)==null?void 0:v.meta)==null?void 0:x.theme},p,{immediate:!0}),Qe(()=>{var v;return(v=r==null?void 0:r.state.deck)==null?void 0:v.theme},p),Qe(()=>r==null?void 0:r.state.deck,p,{immediate:!0,deep:!1}),Qe(n,(v,x)=>{if(v===0)c.value={top:"-20%",left:"-10%"};else if(x!==void 0){const I=(V,M)=>Math.floor(Math.random()*(M-V+1)+V);c.value={top:`${I(-25,65)}%`,left:`${I(-25,65)}%`}}},{immediate:!0}),Gt(()=>{p()});const m=()=>{i.value=Math.min(i.value+.1,2)},g=()=>{i.value=Math.max(i.value-.1,.2)},_=()=>{i.value=.6,o.value=0,s.value=0},E=v=>{if(v.ctrlKey||v.metaKey){v.preventDefault();const V=v.deltaY>0?-.05:.05;i.value=Math.max(.2,Math.min(2,i.value+V));return}const I=v.target.closest(".overflow-y-auto");if(I){const{scrollTop:V,scrollHeight:M,clientHeight:H}=I;if(M>H){const Y=V<=0,se=Math.abs(V+H-M)<1,ie=v.deltaY<0,ue=v.deltaY>0;if(ie&&!Y||ue&&!se){v.stopPropagation();return}}}v.preventDefault(),v.shiftKey&&v.deltaX===0?o.value-=v.deltaY:(o.value-=v.deltaX,s.value-=v.deltaY)},S=we(!1),y=we(null),b=v=>{v.code==="Space"&&!v.repeat&&!(v.target instanceof HTMLInputElement||v.target instanceof HTMLTextAreaElement)&&(S.value=!0)},N=v=>{v.code==="Space"&&(S.value=!1,a.value&&!D.value&&(a.value=!1))};Gt(()=>{p(),window.addEventListener("keydown",b),window.addEventListener("keyup",N)}),lr(()=>{window.removeEventListener("keydown",b),window.removeEventListener("keyup",N)});const D=we(!1),O=v=>{const x=v.button===1,I=v.button===0,V=v.target,M=V.classList.contains("canvas-transform-wrapper")||V===y.value;(x||I&&(S.value||v.shiftKey||M))&&(a.value=!0,D.value=!0,l.value={x:v.clientX,y:v.clientY},v.preventDefault())},k=v=>{a.value&&(o.value+=v.clientX-l.value.x,s.value+=v.clientY-l.value.y,l.value={x:v.clientX,y:v.clientY})},w=()=>{a.value=!1,D.value=!1},P=ai(),C=()=>{a.value||P.select(`slides.${n.value}`)};return(v,x)=>{var I,V;return j(),K("div",{ref_key:"canvasContainer",ref:y,class:Se(["flex-1 bg-[#050505] overflow-hidden flex items-center justify-center relative transition-cursor duration-150",{"cursor-grab":!a.value&&S.value,"cursor-grabbing":a.value,"cursor-default":!a.value&&!S.value}]),onWheel:E,onMousedown:O,onMousemove:k,onMouseup:w,onMouseleave:w},[A("div",DQ,[A("button",{onClick:g,class:"w-6 h-6 flex items-center justify-center text-white/70 hover:text-white transition"},[...x[0]||(x[0]=[A("i",{class:"ph-thin ph-minus text-xs"},null,-1)])]),A("span",$Q,Ie(Math.round(i.value*100))+"%",1),A("button",{onClick:m,class:"w-6 h-6 flex items-center justify-center text-white/70 hover:text-white transition"},[...x[1]||(x[1]=[A("i",{class:"ph-thin ph-plus text-xs"},null,-1)])]),A("button",{onClick:_,class:"w-6 h-6 flex items-center justify-center text-white/70 hover:text-white transition ml-2",title:"Reset Zoom"},[...x[2]||(x[2]=[A("i",{class:"ph-thin ph-arrows-out-simple text-xs"},null,-1)])])]),a.value?(j(),K("div",MQ," Panning ")):Ae("",!0),A("div",{class:"canvas-transform-wrapper",style:Ze(u.value)},[A("div",{class:"w-[1280px] h-[720px] shadow-2xl relative border border-[#333] overflow-hidden",style:Ze(d.value),onClick:Or(C,["stop"])},[A("div",LQ,[ce(vS,{"orb-color":(V=(I=re(e))==null?void 0:I.meta)==null?void 0:V.orbColor,"orb-pos":h.value},null,8,["orb-color","orb-pos"])]),A("div",VQ,[A("div",FQ,[re(e)?(j(),K(Ve,{key:0},[re(e).type==="flex"?(j(),Ne(k7,{key:0,data:re(e),"slide-index":re(n)},null,8,["data","slide-index"])):re(e).type==="steps"?(j(),Ne(TQ,{key:1,data:re(e),"slide-index":re(n)},null,8,["data","slide-index"])):re(e).type==="timeline"?(j(),Ne(CQ,{key:2,data:re(e),"slide-index":re(n)},null,8,["data","slide-index"])):re(e).type==="features"?(j(),Ne(PQ,{key:3,data:re(e),"slide-index":re(n)},null,8,["data","slide-index"])):re(e).type==="half"?(j(),Ne(OQ,{key:4,data:re(e),"slide-index":re(n)},null,8,["data","slide-index"])):re(e).type==="statement"?(j(),Ne(RQ,{key:5,data:re(e),"slide-index":re(n)},null,8,["data","slide-index"])):(j(),Ne(SQ,{key:6,data:re(e),"slide-index":re(n)},null,8,["data","slide-index"]))],64)):(j(),K("div",zQ," No slide selected "))])])],4)],4)],34)}}}),[["__scopeId","data-v-06b57ef9"]]),BQ={class:"fixed bottom-6 left-1/2 -translate-x-1/2 z-50 flex items-center gap-3 bg-[#0a0a0a]/90 backdrop-blur-2xl px-4 py-3 rounded-2xl border border-white/10 shadow-[0_20px_50px_rgba(0,0,0,0.5)] transition-all duration-300"},jQ={class:"relative shrink-0"},HQ={class:"flex flex-col gap-1"},GQ=["onClick"],WQ={class:"w-8 h-8 rounded-lg bg-white/5 flex items-center justify-center group-hover:bg-blue-500/20 group-hover:text-blue-400 transition-colors"},KQ={class:"font-medium"},ZQ=["onClick"],XQ={class:"w-full h-full flex items-center justify-center text-[8px] text-white/30",style:{backgroundColor:"var(--lumina-color-background, #0a0a0a)"}},YQ={class:"font-bold text-white/50"},JQ={class:"absolute bottom-1 right-1 px-1.5 py-0.5 bg-white/10 backdrop-blur-md rounded-md text-[6px] text-white/80 font-bold uppercase tracking-tighter"},QQ=["onClick"],qQ={class:"flex flex-col items-center justify-center px-4 py-1.5 rounded-xl bg-white/5 border border-white/5 shrink-0"},eq={class:"text-[10px] font-mono text-white/50 leading-tight"},tq={class:"flex flex-col items-center text-center mb-8"},nq={class:"text-sm text-white/40"},rq={class:"flex gap-4"},iq=Qr(Te({__name:"SlideNavigator",setup(t){const e=bt(dn),n=ai(),r=we(!1),i=we(null),o=we(!1),s=Z(()=>{var E;return((E=e.state.deck)==null?void 0:E.slides)||[]}),a=Z(()=>e.state.currentIndex),l=Z({get(){var E;return((E=e.state.deck)==null?void 0:E.slides)||[]},set(E){e.patchDeck({slides:E}),n.commit()}}),u=[{type:"flex",label:"Flex Layout",icon:"ph-thin ph-squares-four"},{type:"statement",label:"Statement",icon:"ph-thin ph-quotes"},{type:"half",label:"Half Layout",icon:"ph-thin ph-columns"},{type:"features",label:"Features",icon:"ph-thin ph-grid-four"},{type:"timeline",label:"Timeline",icon:"ph-thin ph-clock"},{type:"steps",label:"Steps",icon:"ph-thin ph-list-numbers"},{type:"diagram",label:"Diagram",icon:"ph-thin ph-tree-structure"}],c={flex:{type:"flex",direction:"horizontal",gap:"md",padding:"lg",elements:[{type:"content",size:"half",halign:"left",valign:"center",elements:[{type:"title",text:"New Slide",size:"xl"},{type:"text",text:"Start editing your content here."}]},{type:"image",size:"half",src:"https://images.unsplash.com/photo-1557683316-973673baf926?w=800",alt:"Placeholder image",fill:!0,rounded:"lg"}]},statement:{type:"statement",tag:"Tagline",title:"Big Statement Here",subtitle:"Supporting description text goes below the main statement."},half:{type:"half",imageSide:"right",image:"https://images.unsplash.com/photo-1557683316-973673baf926?w=800",tag:"Category",title:"Split Layout Title",paragraphs:["First paragraph of content.","Second paragraph with more details."],cta:"Learn More"},features:{type:"features",title:"Key Features",description:"Discover what makes us different.",features:[{icon:"star",title:"Feature One",desc:"Description of the first feature."},{icon:"rocket",title:"Feature Two",desc:"Description of the second feature."},{icon:"lightning",title:"Feature Three",desc:"Description of the third feature."}]},timeline:{type:"timeline",title:"Our Journey",subtitle:"Key milestones in our history.",timeline:[{date:"2020",title:"Founded",description:"Company was established."},{date:"2022",title:"Growth",description:"Expanded to new markets."},{date:"2024",title:"Today",description:"Serving customers worldwide."}]},steps:{type:"steps",title:"How It Works",subtitle:"Simple steps to get started.",steps:[{step:"1",title:"Step One",description:"First thing to do."},{step:"2",title:"Step Two",description:"Second thing to do."},{step:"3",title:"Step Three",description:"Final step."}]},diagram:{type:"diagram",title:"New Diagram",nodes:[{id:"1",type:"input",label:"Start",position:{x:250,y:5}},{id:"2",label:"Process",position:{x:100,y:100}},{id:"3",label:"End",position:{x:400,y:100}}],edges:[{id:"e1-2",source:"1",target:"2",animated:!0},{id:"e1-3",source:"1",target:"3"}]}},d=E=>({flex:"Flex",statement:"Stmt",half:"Half",features:"Feat",timeline:"Time",steps:"Step",diagram:"Diag"})[E]||E.slice(0,4),h=E=>{e.goto(E),n.select(null)},p=()=>{r.value=!r.value},m=E=>{const S=c[E]||c.flex,y=JSON.parse(JSON.stringify(S));y.type==="flex"&&Array.isArray(y.elements)&&y.elements.forEach(D=>{D.dragKey=Date.now()+Math.random(),D.type==="content"&&Array.isArray(D.elements)&&D.elements.forEach(O=>{O.dragKey=Date.now()+Math.random()+1})});const b=[...s.value],N=a.value+1;b.splice(N,0,y),e.patchDeck({slides:b}),n.commit(),setTimeout(()=>{e.goto(N),r.value=!1},50)},g=()=>{const E=i.value;if(E===null||s.value.length<=1){i.value=null;return}const S=[...s.value];S.splice(E,1),e.patchDeck({slides:S}),n.commit(),a.value>=S.length&&e.goto(S.length-1),i.value=null},_=()=>{r.value=!1};return Gt(()=>{document.addEventListener("click",_)}),lr(()=>{document.removeEventListener("click",_)}),(E,S)=>(j(),K(Ve,null,[A("div",BQ,[A("div",jQ,[A("button",{onClick:Or(p,["stop"]),class:"w-10 h-10 rounded-xl bg-blue-600 hover:bg-blue-500 text-white flex items-center justify-center transition-all duration-200 active:scale-95 shadow-lg shadow-blue-600/20 group",title:"Add New Slide"},[A("i",{class:Se(["ph-thin ph-plus transition-transform duration-300",{"rotate-45":r.value}])},null,2)]),ce(Ya,{name:"menu"},{default:Ce(()=>[r.value?(j(),K("div",{key:0,class:"absolute bottom-full left-0 mb-4 bg-[#111] border border-white/10 rounded-2xl p-2 min-w-[180px] shadow-2xl backdrop-blur-xl z-[60]",onClick:S[0]||(S[0]=Or(()=>{},["stop"]))},[S[7]||(S[7]=A("div",{class:"px-3 py-2 text-[10px] font-bold text-white/30 uppercase tracking-widest border-b border-white/5 mb-1"}," Select Layout ",-1)),A("div",HQ,[(j(),K(Ve,null,It(u,y=>A("button",{key:y.type,onClick:b=>m(y.type),class:"w-full px-3 py-2.5 text-left text-xs text-white/70 hover:text-white hover:bg-white/5 rounded-xl transition-all flex items-center gap-3 group"},[A("div",WQ,[A("i",{class:Se(y.icon)},null,2)]),A("span",KQ,Ie(y.label),1)],8,GQ)),64))])])):Ae("",!0)]),_:1})]),ce(re(Gh),{modelValue:l.value,"onUpdate:modelValue":S[1]||(S[1]=y=>l.value=y),"item-key":"id",class:"flex items-center gap-2 max-w-[650px] overflow-x-auto slide-scroll px-1 py-1 scroll-smooth",animation:200,"ghost-class":"opacity-50","drag-class":"scale-105",onStart:S[2]||(S[2]=y=>o.value=!0),onEnd:S[3]||(S[3]=y=>o.value=!1)},{item:Ce(({element:y,index:b})=>[A("button",{onClick:N=>h(b),class:Se(["shrink-0 w-16 h-10 rounded-xl overflow-hidden border-2 transition-all duration-200 relative group active:scale-95 cursor-grab active:cursor-grabbing",a.value===b?"border-blue-500 ring-4 ring-blue-500/20 scale-105 z-10":"border-white/5 shadow-inner hover:border-white/20"])},[A("div",XQ,[A("span",YQ,Ie(b+1),1),S[8]||(S[8]=A("div",{class:"absolute inset-0 bg-gradient-to-t from-black/60 to-transparent"},null,-1))]),A("div",JQ,Ie(d(y.type)),1),s.value.length>1?(j(),K("button",{key:0,onClick:Or(N=>i.value=b,["stop"]),class:"absolute top-1 right-1 w-5 h-5 bg-red-500/80 hover:bg-red-500 rounded-lg flex items-center justify-center opacity-0 group-hover:opacity-100 transition-all duration-200 transform hover:scale-110"},[...S[9]||(S[9]=[A("i",{class:"ph-thin ph-x text-[10px] text-white"},null,-1)])],8,QQ)):Ae("",!0)],10,ZQ)]),_:1},8,["modelValue"]),A("div",qQ,[S[11]||(S[11]=A("div",{class:"text-[10px] font-bold text-white uppercase tracking-tighter leading-tight"},"Slide",-1)),A("div",eq,[_t(Ie(a.value+1)+" ",1),S[10]||(S[10]=A("span",{class:"text-white/20"},"/",-1)),_t(" "+Ie(s.value.length),1)])])]),ce(Ya,{name:"modal"},{default:Ce(()=>[i.value!==null?(j(),K("div",{key:0,class:"fixed inset-0 z-[100] flex items-center justify-center bg-black/80 backdrop-blur-md",onClick:S[6]||(S[6]=y=>i.value=null)},[A("div",{class:"bg-[#111111] border border-white/10 rounded-3xl p-8 shadow-2xl max-w-sm w-full mx-4 transform transition-all",onClick:S[5]||(S[5]=Or(()=>{},["stop"]))},[A("div",tq,[S[12]||(S[12]=A("div",{class:"w-16 h-16 rounded-2xl bg-red-500/10 flex items-center justify-center text-red-500 mb-6 border border-red-500/20"},[A("i",{class:"ph-thin ph-trash text-2xl"})],-1)),S[13]||(S[13]=A("h3",{class:"text-xl font-bold text-white mb-2"},"Delete slide?",-1)),A("p",nq,"This will permanently remove slide #"+Ie(i.value+1)+" and all its content.",1)]),A("div",rq,[A("button",{onClick:S[4]||(S[4]=y=>i.value=null),class:"flex-1 px-6 py-3 rounded-2xl bg-white/5 hover:bg-white/10 text-white transition text-sm font-semibold border border-white/5"}," Cancel "),A("button",{onClick:g,class:"flex-1 px-6 py-3 rounded-2xl bg-red-600 hover:bg-red-500 text-white transition text-sm font-semibold shadow-xl shadow-red-600/30"}," Delete ")])])])):Ae("",!0)]),_:1})],64))}}),[["__scopeId","data-v-b431cd99"]]),oq={class:"flex flex-col w-full h-screen bg-black text-white font-sans overflow-hidden"},sq={class:"flex flex-1 overflow-hidden relative"},aq={class:"w-72 bg-[#111] border-l border-[#333] flex flex-col"},uP=Te({__name:"LuminaStudio",setup(t){const e=V5();return to(tv,e),(n,r)=>(j(),K("div",oq,[ce(I9),A("div",sq,[ce(RB),ce(UQ),A("div",aq,[ce(x7)]),ce(iq)])]))}}),ni=class ni{constructor(e){$n(this,"channel",null);$n(this,"handlers",new Set);$n(this,"lastTimestamp",0);$n(this,"heartbeatInterval",null);$n(this,"isConnected",!1);$n(this,"connectionHandlers",new Set);this.channelName=e,this.initChannel()}static getInstance(e,n=!1){return n?new ni(e):(ni.instances.has(e)||ni.instances.set(e,new ni(e)),ni.instances.get(e))}static isSupported(){return typeof BroadcastChannel<"u"}initChannel(){if(!ni.isSupported()){console.warn("[SpeakerChannel] BroadcastChannel not supported in this environment");return}try{this.channel=new BroadcastChannel(this.channelName),this.channel.onmessage=e=>{const n=e.data;if(!(n.timestamp&&n.timestamp===this.lastTimestamp)){if(n.action==="ping"){this.send({action:"pong"}),this.handlers.forEach(r=>{try{r(n)}catch(i){console.error("[SpeakerChannel] Handler error:",i)}});return}if(n.action==="pong"){this.setConnected(!0);return}if(n.action==="close"){this.setConnected(!1);return}this.handlers.forEach(r=>{try{r(n)}catch(i){console.error("[SpeakerChannel] Handler error:",i)}})}},this.channel.onmessageerror=e=>{console.error("[SpeakerChannel] Message error:",e)},this.startHeartbeat()}catch(e){console.error("[SpeakerChannel] Failed to initialize:",e)}}send(e){if(!this.channel)return;const n={...e,timestamp:Date.now(),channelId:this.channelName};this.lastTimestamp=n.timestamp,this.channel.postMessage(n)}subscribe(e){return this.handlers.add(e),()=>this.handlers.delete(e)}onConnectionChange(e){return this.connectionHandlers.add(e),e(this.isConnected),()=>this.connectionHandlers.delete(e)}get connected(){return this.isConnected}ping(){this.send({action:"ping"})}notifyClose(){this.send({action:"close"})}startHeartbeat(){this.ping(),this.heartbeatInterval=setInterval(()=>{(this.handlers.size>0||this.connectionHandlers.size>0)&&this.ping()},5e3)}setConnected(e){this.isConnected!==e&&(this.isConnected=e,this.connectionHandlers.forEach(n=>n(e)))}destroy(){this.notifyClose(),this.heartbeatInterval&&(clearInterval(this.heartbeatInterval),this.heartbeatInterval=null),this.channel&&(this.channel.close(),this.channel=null),this.handlers.clear(),this.connectionHandlers.clear(),ni.instances.delete(this.channelName)}static destroyAll(){ni.instances.forEach(e=>e.destroy()),ni.instances.clear()}};$n(ni,"instances",new Map);let ru=ni;const lq={class:"speaker-notes"},uq={class:"sn-header"},cq={class:"sn-status"},dq={class:"sn-slide-count"},fq={class:"sn-content"},hq={class:"sn-notes-section"},pq=["innerHTML"],mq={key:1,class:"sn-notes-empty"},gq={class:"sn-footer"},vq={class:"sn-nav-controls"},yq=["disabled"],bq={class:"sn-timer-value"},_q=["disabled"],xq=Qr(Te({__name:"LuminaSpeakerNotes",props:{channelId:{}},setup(t){const e=t,n=we(0),r=we(0),i=we(""),o=we(null),s=we(!1),a=we(null),l=we(0),u=we(!1),c=we(null),d=Z(()=>r.value===0?"No slides loaded":`Slide ${n.value+1} / ${r.value}`),h=Z(()=>{const w=Math.floor(l.value/3600),P=Math.floor(l.value%3600/60),C=l.value%60;return w>0?`${w.toString().padStart(2,"0")}:${P.toString().padStart(2,"0")}:${C.toString().padStart(2,"0")}`:`${P.toString().padStart(2,"0")}:${C.toString().padStart(2,"0")}`}),p=Z(()=>n.value<r.value-1),m=Z(()=>n.value>0);function g(w){return w?w.replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/__(.*?)__/g,"<strong>$1</strong>").replace(new RegExp("(?<!\\*)\\*(?!\\*)(.*?)(?<!\\*)\\*(?!\\*)","g"),"<em>$1</em>").replace(new RegExp("(?<!_)_(?!_)(.*?)(?<!_)_(?!_)","g"),"<em>$1</em>").replace(/\n/g,"<br>").replace(/^[-*]\s+(.*)$/gm,"<li>$1</li>").replace(/(<li>.*<\/li>)/gs,"<ul>$1</ul>").replace(/<\/ul>\s*<ul>/g,""):""}function _(){const w=new URLSearchParams(window.location.search),P=e.channelId||w.get("channel")||"lumina-speaker-default";a.value=ru.getInstance(P,!0),a.value.onConnectionChange(I=>{s.value=I}),a.value.subscribe(E);let C=0;const v=10,x=setInterval(()=>{var I;if(r.value>0||C>=v){clearInterval(x);return}(I=a.value)==null||I.ping(),C++},300);a.value.ping()}function E(w){switch(w.action){case"state":w.index!==void 0&&(n.value=w.index),w.totalSlides!==void 0&&(r.value=w.totalSlides),w.currentNotes!==void 0&&(i.value=w.currentNotes),w.nextSlidePreview&&(o.value=w.nextSlidePreview);break;case"goto":w.index!==void 0&&(n.value=w.index);break}}function S(){var w;p.value&&((w=a.value)==null||w.send({action:"next"}))}function y(){var w;m.value&&((w=a.value)==null||w.send({action:"prev"}))}function b(){u.value||(u.value=!0,c.value=setInterval(()=>{l.value++},1e3))}function N(){u.value=!1,c.value&&(clearInterval(c.value),c.value=null)}function D(){u.value?N():b()}function O(){N(),l.value=0}function k(w){switch(w.key){case"ArrowRight":case" ":case"Enter":w.preventDefault(),S();break;case"ArrowLeft":case"Backspace":w.preventDefault(),y();break;case"t":case"T":w.preventDefault(),D();break;case"r":case"R":if(w.ctrlKey||w.metaKey)return;w.preventDefault(),O();break}}return Gt(()=>{_(),window.addEventListener("keydown",k),window.addEventListener("beforeunload",()=>{var w;(w=a.value)==null||w.notifyClose()})}),lr(()=>{var w;N(),window.removeEventListener("keydown",k),(w=a.value)==null||w.destroy()}),(w,P)=>(j(),K("div",lq,[A("header",uq,[P[0]||(P[0]=of('<div class="sn-title" data-v-ccdb989d><svg class="sn-logo" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-ccdb989d><path d="M12 2L2 7l10 5 10-5-10-5z" data-v-ccdb989d></path><path d="M2 17l10 5 10-5" data-v-ccdb989d></path><path d="M2 12l10 5 10-5" data-v-ccdb989d></path></svg><span data-v-ccdb989d>Lumina Speaker Notes</span></div>',1)),A("div",cq,[A("span",{class:Se(["sn-indicator",{connected:s.value}])},null,2),A("span",dq,Ie(d.value),1)])]),A("main",fq,[A("section",hq,[P[2]||(P[2]=A("h2",{class:"sn-section-title"},"Notes",-1)),i.value?(j(),K("div",{key:0,class:"sn-notes-content",innerHTML:g(i.value)},null,8,pq)):(j(),K("div",mq,[...P[1]||(P[1]=[A("p",null,"No notes for this slide",-1)])]))])]),A("footer",gq,[A("div",vq,[A("button",{class:"sn-btn sn-btn-nav",disabled:!m.value,onClick:y,title:"Previous (← or Backspace)"},[...P[3]||(P[3]=[A("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[A("polyline",{points:"15 18 9 12 15 6"})],-1),A("span",null,"Prev",-1)])],8,yq),A("div",{class:"sn-timer",onClick:D,title:"Click to start/pause (T)"},[A("span",{class:Se(["sn-timer-icon",{running:u.value}])},Ie(u.value?"⏸":"▶"),3),A("span",bq,Ie(h.value),1),A("button",{class:"sn-timer-reset",onClick:Or(O,["stop"]),title:"Reset timer (R)"},"↻")]),A("button",{class:"sn-btn sn-btn-nav sn-btn-primary",disabled:!p.value,onClick:S,title:"Next (→, Space, or Enter)"},[...P[4]||(P[4]=[A("span",null,"Next",-1),A("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[A("polyline",{points:"9 18 15 12 9 6"})],-1)])],8,_q)])])]))}}),[["__scopeId","data-v-ccdb989d"]]),wq=Qr(Te({__name:"LayoutFlex",props:{data:{},slideIndex:{}},emits:["action"],setup(t,{emit:e}){const n=t,r=e,i=bt(dn),o=Z(()=>n.slideIndex??(i==null?void 0:i.state.currentIndex)??0),s=g=>Vt(n.data,o.value,["elements",g]),a=(g,_)=>Vt(n.data,o.value,["elements",g,"elements",_]),l=Z(()=>({padding:So[n.data.padding||"none"]})),u=Z(()=>n.data.direction==="vertical"?"flex-col":"flex-col lg:flex-row"),c=Z(()=>({gap:So[n.data.gap||"none"],...jI(n.data.direction,n.data.halign,n.data.valign)})),d=g=>Ly(g,n.data.direction==="vertical"),h=g=>{const _=n.data.direction==="vertical";return{...Ly(g,_),...UI(g),height:_?"auto":"100%",width:_?"100%":"auto",minHeight:_?"auto":"100%"}},p=g=>{r("action",g),Ft.emit("action",g)},m=g=>({title:DI,text:$I,image:Zh,video:Xh,bullets:LI,ordered:VI,button:MI,timeline:FI,stepper:zI,spacer:HI})[g]||"div";return(g,_)=>{const E=kr("LuminaElement");return j(),Ne(bi,{data:t.data,"slide-index":o.value},{default:Ce(()=>[A("div",{class:"flex-layout w-full h-screen flex flex-col overflow-y-auto lg:overflow-hidden",style:Ze(l.value)},[A("div",{class:Se(["flex-1 flex w-full min-h-full lg:h-full",u.value]),style:Ze(c.value)},[(j(!0),K(Ve,null,It(t.data.elements,(S,y)=>(j(),K(Ve,{key:y},[S.type==="image"?(j(),Ne(E,{key:0,id:s(y),class:Se(["flex-item",re(zc)(S.size)]),style:Ze(d(S))},{default:Ce(()=>[ce(Zh,{src:S.src,alt:S.alt,fill:S.fill,rounded:S.rounded,"container-class":"w-full h-full min-h-0","container-style":{},class:Se(S.class)},null,8,["src","alt","fill","rounded","class"])]),_:2},1032,["id","class","style"])):S.type==="video"?(j(),Ne(E,{key:1,id:s(y),class:Se(["flex-item",re(zc)(S.size),S.class]),style:Ze(d(S))},{default:Ce(()=>[ce(Xh,{class:Se(re(C7)(S.rounded,S.fill)),src:S.src,poster:S.poster,autoplay:S.autoplay??!1,loop:S.loop??!1,muted:S.muted??!1,controls:S.controls??!0,"object-fit":S.fill!==!1?"cover":"contain"},null,8,["class","src","poster","autoplay","loop","muted","controls","object-fit"])]),_:2},1032,["id","class","style"])):S.type==="content"?(j(),Ne(E,{key:2,id:s(y),class:Se(["flex-item flex flex-col h-full",re(zc)(S.size)]),style:Ze(h(S))},{default:Ce(()=>[(j(!0),K(Ve,null,It(S.elements,(b,N)=>(j(),Ne(E,{key:N,id:a(y,N)},{default:Ce(()=>[(j(),Ne(Jn(m(b.type)),ao({ref_for:!0},b,{onAction:p}),null,16))]),_:2},1032,["id"]))),128))]),_:2},1032,["id","class","style"])):(j(),Ne(E,{key:3,id:s(y),class:Se(["flex-item",re(zc)(S.size)]),style:Ze({...re(BI)(),width:t.data.direction==="vertical"?"100%":"auto"})},{default:Ce(()=>[(j(),Ne(Jn(m(S.type)),ao({ref_for:!0},S,{onAction:p}),null,16))]),_:2},1032,["id","class","style"]))],64))),128))],6)],4)]),_:1},8,["data","slide-index"])}}}),[["__scopeId","data-v-8a1ddc69"]]),cP=Te({__name:"LuminaElement",props:{id:{},tag:{default:"div"},class:{},style:{}},setup(t){const e=t,n=GI(()=>e.id),r=Z(()=>{const s=e.id;if(s==null)return;const a=String(s).trim();return a||void 0}),i=Z(()=>{const s=e.class;return Array.isArray(s)?s.filter(Boolean).join(" "):s||""}),o=Z(()=>{const s=re(n.style)??{},a={...e.style||{},...s};return"opacity"in s&&a.transition==null&&(a.transition="opacity var(--lumina-element-opacity-transition, 0.35s ease-out)"),a});return(s,a)=>(j(),Ne(Jn(t.tag),{"data-lumina-id":r.value,style:Ze(o.value),class:Se([re(n).class,i.value].filter(Boolean))},{default:Ce(()=>[Mt(s.$slots,"default")]),_:3},8,["data-lumina-id","style","class"]))}}),Sq={class:"layout-free-stage absolute inset-0 min-h-[100vh] overflow-hidden"},Eq=["src"],Tq={key:2},Iq=Te({__name:"LayoutFree",props:{data:{},slideIndex:{}},setup(t){const e=t,n=bt(dn),r=Z(()=>e.slideIndex??(n==null?void 0:n.state.currentIndex)??0);function i(a){return Vt(e.data,r.value,["elements",a])}function o(a){const l={position:"absolute",left:0,top:0,fontFamily:"var(--lumina-font-heading, inherit)",color:"var(--lumina-color-text-safe, #fff)"};return a.width!=null&&(l.width=typeof a.width=="number"?`${a.width}px`:a.width),a.height!=null&&(l.height=typeof a.height=="number"?`${a.height}px`:a.height),a.fontSize!=null&&(l.fontSize=typeof a.fontSize=="number"?`${a.fontSize}px`:a.fontSize),a.color&&(l.color=a.color),a.fontWeight&&(l.fontWeight=a.fontWeight),a.type==="box"&&a.backgroundColor&&(l.backgroundColor=a.backgroundColor),l}function s(a){const l={display:"block"};return a.width!=null&&(l.width=typeof a.width=="number"?`${a.width}px`:a.width),a.height!=null&&(l.height=typeof a.height=="number"?`${a.height}px`:a.height),l}return(a,l)=>(j(),Ne(bi,{data:t.data,"slide-index":r.value},{default:Ce(()=>[A("div",Sq,[(j(!0),K(Ve,null,It(t.data.elements||[],(u,c)=>(j(),Ne(cP,{key:c,id:i(c),tag:(u.type==="image","div"),style:Ze(o(u)),class:"layout-free-element"},{default:Ce(()=>[u.type==="text"?(j(),K(Ve,{key:0},[_t(Ie(u.text),1)],64)):u.type==="image"&&u.src?(j(),K("img",{key:1,src:u.src,alt:"",class:"max-w-full max-h-full object-contain",style:Ze(s(u))},null,12,Eq)):u.type==="box"?(j(),K("span",Tq," ")):Ae("",!0)]),_:2},1032,["id","tag","style"]))),128))])]),_:1},8,["data","slide-index"]))}}),dP={fadeUp:{from:{opacity:0,y:20},to:{opacity:1,y:0},ease:"power2.out"},fadeIn:{from:{opacity:0},to:{opacity:1},ease:"power2.out"},scaleIn:{from:{opacity:0,scale:.9},to:{opacity:1,scale:1},ease:"back.out(1.2)"},slideLeft:{from:{opacity:0,x:40},to:{opacity:1,x:0},ease:"power2.out"},slideRight:{from:{opacity:0,x:-40},to:{opacity:1,x:0},ease:"power2.out"},zoomIn:{from:{opacity:0,scale:.7},to:{opacity:1,scale:1},ease:"power2.out"},blurIn:{from:{opacity:0,filter:"blur(12px)"},to:{opacity:1,filter:"blur(0)"},ease:"power2.out"},spring:{from:{opacity:0,y:30},to:{opacity:1,y:0},ease:"elastic.out(1, 0.4)"},drop:{from:{y:-80,opacity:0},to:{y:0,opacity:1},ease:"back.out(1.5)"},fadeOut:{from:{opacity:1},to:{opacity:0},ease:"power2.in"}},fP={};function hP(t){return dP[t]??fP[t]??null}function Cq(t,e){fP[t]={...e}}function O0(t,e,n){let r={...(e==null?void 0:e.from)??{}},i={...(e==null?void 0:e.to)??{opacity:1}},o=(e==null?void 0:e.ease)??"power2.out",s=(e==null?void 0:e.duration)??.5;const a=t.preset||t.motion;if(a){const l=n&&n[a]||hP(a);l&&(l.from!=null&&(r={...l.from}),l.to!=null&&(i={...l.to}),l.ease!=null&&(o=l.ease),l.duration!=null&&(s=l.duration))}return t.from&&Object.keys(t.from).length&&(r={...r,...t.from}),t.to&&Object.keys(t.to).length&&(i={...i,...t.to}),t.ease!=null&&(o=t.ease),t.duration!=null&&(s=t.duration),Object.keys(i).length===0&&(i={opacity:1}),{from:r,to:i,ease:o,duration:s}}function Aq(t){return()=>{let e=t+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}function Pq(t,e){const n=[...t],r=Aq(e);for(let i=n.length-1;i>0;i--){const o=Math.floor(r()*(i+1));[n[i],n[o]]=[n[o],n[i]]}return n}function pP(t){const{ids:e,delayMs:n,mode:r="sequential",randomSeed:i=0}=t;if(!e.length)return[];let o;switch(r){case"sequential":o=e;break;case"center-out":{const l=(e.length-1)/2,u=e.map((c,d)=>({id:c,d:Math.abs(d-l)}));u.sort((c,d)=>c.d-d.d),o=u.map(c=>c.id);break}case"ends-in":{const l=(e.length-1)/2,u=e.map((c,d)=>({id:c,d:Math.abs(d-l)}));u.sort((c,d)=>d.d-c.d),o=u.map(c=>c.id);break}case"wave":o=e;break;case"random":o=Pq(e,i);break;default:o=e}const s=[];if(r==="wave")for(let a=0;a<o.length;a++)s.push({id:o[a],delayMs:a*(n*.6),index:a});else for(let a=0;a<o.length;a++)s.push({id:o[a],delayMs:(a+1)*n,index:a});return s}function mP(t,e,n){function r(a){t.setElementState(n,a)}function i(){var a;return((a=t.state.elementState[n])==null?void 0:a.class)??""}const o={show(){r({visible:!0,opacity:1});const a=e.getElementById(n),l=a==null?void 0:a.closest(".reveal-zoom, .reveal-up, .reveal-card, .reveal-left, .reveal-right");return l&&Bt.set(l,{opacity:1}),o},hide(){return r({visible:!1}),o},toggle(a){var u;const l=((u=t.state.elementState[n])==null?void 0:u.visible)!==!1;return r({visible:a!==void 0?a:!l}),o},opacity(a){return r({opacity:a}),o},transform(a){return r({transform:a}),o},css(a){return r({style:a}),o},addClass(a){const u=(i()+" "+a).trim();return r({class:u}),o},removeClass(a){const u=i().split(/\s+/).filter(c=>c&&c!==a).join(" ");return r({class:u}),o},animate(a){return s(a),o},animateAsync(a){return new Promise(l=>{s(a,()=>{var u;(u=a.onComplete)==null||u.call(a),l()})})},animateToProgress(a,l){const u=Object.keys(l).map(E=>parseFloat(E)).filter(E=>!Number.isNaN(E)).sort((E,S)=>E-S);if(u.length===0)return o;const c=u[0],d=u[u.length-1];let h;if(a<=c)h=l[String(c)]??{};else if(a>=d)h=l[String(d)]??{};else{let E=0;for(;E+1<u.length&&u[E+1]<=a;)E++;const S=u[E],y=u[E+1],b=l[String(S)]??{},N=l[String(y)]??{},D=(a-S)/(y-S);h={};const O=["opacity","x","y","scale","rotate"];for(const k of O){const w=b[k],P=N[k];typeof w=="number"&&typeof P=="number"?h[k]=w+(P-w)*D:typeof P=="number"?h[k]=P:typeof w=="number"&&(h[k]=w)}typeof N.visible=="boolean"?h.visible=N.visible:typeof b.visible=="boolean"&&(h.visible=b.visible)}const p=h.opacity!==void 0?h.opacity:1,m=[];(h.x!==void 0||h.y!==void 0)&&m.push(`translate(${h.x??0}px, ${h.y??0}px)`),h.scale!==void 0&&m.push(`scale(${h.scale})`),h.rotate!==void 0&&m.push(`rotate(${h.rotate}deg)`);const g=m.length?m.join(" "):"",_=h.visible!==void 0?h.visible:p>0;return r({opacity:p,transform:g,visible:_}),o}};function s(a,l){var S,y;const u=e.getElementById(n);if(!u)return;const c=Ys(t,void 0),d=(y=(S=t.state.deck)==null?void 0:S.meta)==null?void 0:y.motions,{from:h,to:p,ease:m,duration:g}=O0(a,{duration:c.elementDuration,ease:c.elementEase},d),_=l??a.onComplete,E={...p,duration:g,ease:m,overwrite:!0,onComplete:_};h&&Object.keys(h).length?Bt.fromTo(u,h,E):Bt.to(u,E)}return o}class kq{constructor(e,n={}){$n(this,"app");$n(this,"store");$n(this,"data");$n(this,"speakerWindow",null);$n(this,"speakerChannel",null);$n(this,"speakerChannelId");$n(this,"speakerUnsubscribe",null);$n(this,"_timelineProgress",0);$n(this,"_timelineCancel",null);this.selector=e,this.speakerChannelId=`lumina-speaker-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,this.store=ZM(n);const r={get:i=>this.store.getUserData(i),set:(i,o)=>(this.store.setUserData(i,o),r),has:i=>this.store.hasUserData(i),delete:i=>this.store.deleteUserData(i),clear:()=>this.store.clearUserData(),keys:()=>Object.keys(this.store.state.userData)};this.data=r,n.theme&&Gl.inject(n.theme),this.app=n.studio?Qa(uP):Qa(yS),this.app.provide(dn,this.store),this.app.provide("LuminaEngine",this),Qe(()=>this.store.state.currentIndex,(i,o)=>{var l,u;this.store.resetElementStateForSlide(i);const s=this.store.state.deck,a=(l=s==null?void 0:s.slides)==null?void 0:l[i];if(a){Ft.emit("slideChange",{index:i,previousIndex:o??0,slide:a});const c=((u=s==null?void 0:s.meta)==null?void 0:u.reveal)??(a==null?void 0:a.reveal);c&&typeof c=="object"&&this.revealInSequence(i,this.getRevealOptionsFromDeck(s,i))}}),Qe(()=>{var i;return(i=this.store.state.deck)==null?void 0:i.meta},i=>{var o;if(i){const s=i.themeConfig||{},a={colors:i.colors,typography:i.typography,spacing:i.spacing,borderRadius:i.borderRadius,effects:i.effects,components:i.components},l=s&&typeof s=="object"&&!Array.isArray(s)?s:{},u=Fc(l,a),c=this.store.state.deck,d=(c==null?void 0:c.theme)??i.theme??((o=this.store.state.options)==null?void 0:o.theme)??"default";Gl.inject(d,u),i.orbColor&&document.documentElement.style.setProperty("--lumina-colors-primary",i.orbColor),Ft.emit("themeChange",{theme:typeof d=="string"?d:"custom"})}},{deep:!0}),this.app.component("layout-statement",Fy),this.app.component("layout-half",Vy),this.app.component("layout-features",zy),this.app.component("layout-timeline",Uy),this.app.component("layout-steps",By),this.app.component("layout-flex",wq),this.app.component("layout-auto",ZI),this.app.component("layout-custom",XI),this.app.component("layout-chart",WI),this.app.component("layout-video",KI),this.app.component("layout-diagram",lP),this.app.component("layout-free",Iq),this.app.component("LuminaElement",cP),Ft.on("action",i=>{if(i.type==="slide-update"&&typeof i.slideIndex=="number"){const{slideIndex:o,patch:s}=i;s&&typeof s=="object"&&("nodes"in s&&this.store.updateNode(`slides.${o}.nodes`,s.nodes),"edges"in s&&this.store.updateNode(`slides.${o}.edges`,s.edges))}this.store.recordAction(i)}),this.app.mount(this.selector),this.syncSpeakerNotes()}load(e){var n,r,i;if(!e||!Array.isArray(e.slides)){Ft.emit("error",new Error("Invalid deck: expected { meta?, slides: [] }"));return}try{this.store.loadDeck(e),Ft.emit("ready",e);const o=((n=e.meta)==null?void 0:n.reveal)??((i=(r=e.slides)==null?void 0:r[0])==null?void 0:i.reveal);o&&typeof o=="object"&&this.revealInSequence(0,this.getRevealOptionsFromDeck(e,0)),this.syncSpeakerNotes()}catch(o){Ft.emit("error",o instanceof Error?o:new Error(String(o)))}}patch(e){this.store.patchDeck(e),Ft.emit("patch",{diff:e??{}}),this.syncSpeakerNotes()}exportState(){const{currentIndex:e,deck:n,actionHistory:r}=this.store.state,i=n==null?void 0:n.slides[e],o=r.map(a=>`User ${a.type}ed on ${a.label||a.value}`).join(" -> "),s=r.length>5?"High Engagement":"Low Engagement";return Object.freeze({status:"active",currentSlide:{index:e,id:(i==null?void 0:i.id)||e,type:i==null?void 0:i.type,title:(typeof(i==null?void 0:i.title)=="string"?i.title:null)||"(No Title)"},narrative:`User is currently on slide ${e+1}. Session Flow: ${o||"Just started"}.`,engagementLevel:s,history:[...r]})}on(e,n){Ft.on(e,n)}off(e,n){Ft.off(e,n)}emitError(e){Ft.emit("error",e)}destroy(){Ft.emit("destroy",{}),this.closeSpeakerNotes(),this.app&&this.app.unmount(),Ft.clear()}get currentSlideIndex(){return this.store.state.currentIndex}goTo(e){const n=this.store.state.currentIndex;this.store.goto(e),this.store.state.currentIndex!==n&&Ft.emit("navigate",{direction:"goto",fromIndex:n,toIndex:this.store.state.currentIndex}),this.syncSpeakerNotes()}next(){const e=this.store.state.currentIndex;this.store.next(),this.store.state.currentIndex!==e&&Ft.emit("navigate",{direction:"next",fromIndex:e,toIndex:this.store.state.currentIndex}),this.syncSpeakerNotes()}prev(){const e=this.store.state.currentIndex;this.store.prev(),this.store.state.currentIndex!==e&&Ft.emit("navigate",{direction:"prev",fromIndex:e,toIndex:this.store.state.currentIndex}),this.syncSpeakerNotes()}getElementById(e){const n=document.querySelector(this.selector);if(!n)return null;const r=n.querySelector("[data-lumina-root]")||n,i=e.replace(/\\/g,"\\\\").replace(/"/g,'\\"'),o=r.querySelector(`[data-lumina-id="${i}"]`);return o instanceof HTMLElement?o:null}element(e,n){var r;if(typeof e=="number"){const i=(r=this.store.state.deck)==null?void 0:r.slides[e],o=Xx(n),s=i?Vt(i,e,o):Cf(e,...o);return mP(this.store,this,s)}return mP(this.store,this,e)}elementInCurrent(e){const n=this.store.state.currentIndex??0;return this.element(n,e)}elements(e){var i;const n=e??this.store.state.currentIndex??0,r=(i=this.store.state.deck)==null?void 0:i.slides[n];return r?Af(r,n):[]}hideAll(e){const n=e??this.currentSlideIndex;return this.elements(n).forEach(r=>this.element(r).hide()),this}showAll(e){const n=e??this.currentSlideIndex;return this.elements(n).forEach(r=>this.element(r).show()),this}showOnly(e,n){const r=n??this.currentSlideIndex;return this.hideAll(r),e.forEach(i=>this.element(i).show()),this}hideAllExcept(e,n){return this.showOnly(e,n)}resetSlide(e){return this.store.resetElementStateForSlide(e??this.currentSlideIndex),this}delay(e){return new Promise(n=>setTimeout(n,e))}getRevealOptionsFromDeck(e,n){var a;const r=e.meta,i=(a=e.slides)==null?void 0:a[n],o=r!=null&&r.reveal&&typeof r.reveal=="object"?r.reveal:{},s=i!=null&&i.reveal&&typeof i.reveal=="object"?i.reveal:{};return{...o,...s}}revealInSequence(e,n){var p,m,g,_,E;const r=e??this.currentSlideIndex;let i=this.elements(r);const o=n??{};(p=o.only)!=null&&p.length&&(i=i.filter(S=>o.only.includes(S))),(m=o.exclude)!=null&&m.length&&(i=i.filter(S=>!o.exclude.includes(S)));const s=(g=this.store.state.deck)==null?void 0:g.slides[r],a=Ys(this.store,s??void 0),l=o.delayMs??a.revealDelayMs,u=o.animate!==!1,c=(E=(_=this.store.state.deck)==null?void 0:_.meta)==null?void 0:E.motions,d=O0({preset:o.preset,motion:o.motion,from:o.from,to:o.to,ease:o.ease,duration:o.duration},{from:{opacity:0,y:16},to:{opacity:1,y:0},ease:a.revealEase,duration:a.revealDuration},c),h=pP({ids:i,delayMs:l,mode:o.staggerMode??"sequential",randomSeed:o.randomSeed??r});return o.hideFirst!==!1&&this.hideAll(r),new Promise(S=>{if(Ft.emit("revealStart",{slideIndex:r,elementIds:h.map(N=>N.id)}),h.length===0){Ft.emit("revealComplete",{slideIndex:r}),S();return}h.forEach((N,D)=>{setTimeout(()=>{Ft.emit("revealElement",{slideIndex:r,elementId:N.id,index:D}),this.element(N.id).show(),u&&this.element(N.id).animate({from:d.from,to:d.to,duration:d.duration,ease:d.ease})},N.delayMs)});const b=(o.staggerMode??"sequential")==="sequential"?h.length*l:h.length?Math.max(...h.map(N=>N.delayMs)):0;setTimeout(()=>{Ft.emit("revealComplete",{slideIndex:r}),S()},b)})}get timelineProgress(){return this._timelineProgress}seekTo(e,n){var s;const r=n??this.currentSlideIndex,i=(s=this.store.state.deck)==null?void 0:s.slides[r],o=i==null?void 0:i.timelineTracks;if(this._timelineProgress=Math.max(0,Math.min(1,e)),Ft.emit("timelineSeek",{progress:this._timelineProgress,slideIndex:r}),!o||typeof o!="object")return this;for(const a of Object.keys(o))this.element(a).animateToProgress(this._timelineProgress,o[a]);return this}playTimeline(e=5,n){var d;const r=n??this.currentSlideIndex,i=(d=this.store.state.deck)==null?void 0:d.slides[r];if(!(i!=null&&i.timelineTracks)||typeof i.timelineTracks!="object")return[Promise.resolve(),()=>{}];this._timelineCancel&&this._timelineCancel();let o=0,s=0;const a=()=>{o&&cancelAnimationFrame(o),o=0,this._timelineCancel=null};this._timelineCancel=a;const l=h=>{s||(s=h);const p=(h-s)/1e3,m=Math.min(1,p/e);this.seekTo(m,r),m<1?o=requestAnimationFrame(l):(o=0,this._timelineCancel=null,Ft.emit("timelineComplete",{slideIndex:r}),u())};let u;const c=new Promise(h=>{u=h});return o=requestAnimationFrame(l),[c,a]}openSpeakerNotes(){if(this.speakerWindow&&!this.speakerWindow.closed)return this.speakerWindow.focus(),this.speakerWindow;if(!ru.isSupported())return console.error("[Lumina] BroadcastChannel not supported."),null;const e=600,n=800,r=window.screenX+window.outerWidth,i=window.screenY;if(this.speakerWindow=window.open("about:blank",`lumina-speaker-notes-${this.speakerChannelId}`,`width=${e},height=${n},left=${r},top=${i},resizable=yes,scrollbars=yes`),!this.speakerWindow)return console.warn("[Lumina] Popup blocked."),null;const o=this.speakerWindow;return o.document.open(),o.document.write(`
|
|
2582
2582
|
<!DOCTYPE html>
|
|
2583
2583
|
<html lang="en">
|
|
2584
2584
|
<head>
|