@doeixd/machine 0.0.18 → 0.0.19
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/README.md +164 -3
- package/dist/cjs/development/core.js.map +2 -2
- package/dist/cjs/development/extract.js +500 -0
- package/dist/cjs/development/extract.js.map +7 -0
- package/dist/cjs/development/index.js +135 -477
- package/dist/cjs/development/index.js.map +4 -4
- package/dist/cjs/production/extract.js +5 -0
- package/dist/cjs/production/index.js +4 -5
- package/dist/esm/development/core.js.map +2 -2
- package/dist/esm/development/extract.js +486 -0
- package/dist/esm/development/extract.js.map +7 -0
- package/dist/esm/development/index.js +135 -484
- package/dist/esm/development/index.js.map +4 -4
- package/dist/esm/production/extract.js +5 -0
- package/dist/esm/production/index.js +4 -5
- package/dist/types/index.d.ts +45 -8
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/matcher.d.ts +318 -0
- package/dist/types/matcher.d.ts.map +1 -0
- package/package.json +13 -1
- package/src/index.ts +73 -9
- package/src/matcher.ts +544 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var y=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(r,a)=>(typeof require!="undefined"?require:r)[a]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});import{Project as S,Node as o}from"ts-morph";function C(e,r=!1){let a=e.getSymbol();if(a&&a.getDeclarations().some(o.isClassDeclaration))return a.getName();if(e.isStringLiteral()||e.isNumberLiteral()||e.isBooleanLiteral())return e.getLiteralValue();if(e.isString())return"string";if(e.isNumber())return"number";if(e.isBoolean())return"boolean";if(e.isArray()){let s=e.getArrayElementTypeOrThrow();return[C(s,r)]}if(e.isObject()||e.isIntersection()){let s={},n=e.getProperties();for(let t of n){let i=t.getName();if(i.startsWith("__@"))continue;let l=t.getValueDeclaration();if(l)try{s[i]=C(l.getType(),r)}catch(c){r&&console.error(` Warning: Failed to serialize property ${i}:`,c),s[i]="unknown"}}return Object.keys(s).length>0?s:null}return r&&console.error(` Unhandled type: ${e.getText()}`),"unknown"}function N(e){return o.isIdentifier(e)?e.getText():o.isTypeOfExpression(e)?e.getExpression().getText():"unknown"}function u(e){if(!o.isObjectLiteralExpression(e))return{};let r={};for(let a of e.getProperties())if(o.isPropertyAssignment(a)){let s=a.getName(),n=a.getInitializer();n&&(o.isStringLiteral(n)||o.isNumericLiteral(n)?r[s]=n.getLiteralValue():n.getText()==="true"||n.getText()==="false"?r[s]=n.getText()==="true":o.isIdentifier(n)?r[s]=n.getText():o.isObjectLiteralExpression(n)?r[s]=u(n):o.isArrayLiteralExpression(n)&&(r[s]=n.getElements().map(t=>o.isObjectLiteralExpression(t)?u(t):t.getText())))}return r}function M(e){if(!o.isObjectLiteralExpression(e))return{};let r={};for(let a of e.getProperties())if(o.isPropertyAssignment(a)){let s=a.getName(),n=a.getInitializer();if(!n)continue;s==="onDone"||s==="onError"?r[s]=N(n):o.isStringLiteral(n)?r[s]=n.getLiteralValue():o.isIdentifier(n)&&(r[s]=n.getText())}return r}function d(e,r=!1){if(!o.isCallExpression(e))return null;let a=e.getExpression(),s=o.isIdentifier(a)?a.getText():null;if(!s)return null;let n={},t=e.getArguments();switch(s){case"transitionTo":t[0]&&(n.target=N(t[0]));break;case"describe":if(t[0]&&o.isStringLiteral(t[0])&&(n.description=t[0].getLiteralValue()),t[1]&&o.isCallExpression(t[1])){let i=d(t[1],r);i&&Object.assign(n,i)}break;case"guarded":if(t[0]){let i=u(t[0]);Object.keys(i).length>0&&(n.guards=[i])}if(t[1]&&o.isCallExpression(t[1])){let i=d(t[1],r);i&&Object.assign(n,i)}break;case"invoke":if(t[0]){let i=M(t[0]);Object.keys(i).length>0&&(n.invoke=i)}break;case"action":if(t[0]){let i=u(t[0]);Object.keys(i).length>0&&(n.actions=[i])}if(t[1]&&o.isCallExpression(t[1])){let i=d(t[1],r);i&&Object.assign(n,i)}break;case"guard":if(t[2]){let i=u(t[2]);i.description&&(n.description=i.description)}if(n.guards=[{name:"runtime_guard",description:n.description||"Synchronous condition check"}],t[1]&&o.isCallExpression(t[1])){let i=d(t[1],r);i&&Object.assign(n,i)}break;case"guardAsync":if(t[2]){let i=u(t[2]);i.description&&(n.description=i.description)}if(n.guards=[{name:"runtime_guard_async",description:n.description||"Asynchronous condition check"}],t[1]&&o.isCallExpression(t[1])){let i=d(t[1],r);i&&Object.assign(n,i)}break;default:return null}return Object.keys(n).length>0?n:null}function k(e,r=!1){if(!o.isPropertyDeclaration(e))return r&&console.error(" ⚠️ Not a property declaration"),null;let a=e.getInitializer();if(!a)return r&&console.error(" ⚠️ No initializer"),null;if(!o.isCallExpression(a))return r&&console.error(" ⚠️ Initializer is not a call expression"),null;let s=d(a,r);return s&&r&&console.error(" ✅ Extracted metadata:",JSON.stringify(s,null,2)),s}function x(e,r=!1){let a={on:{}},s=e.getDeclarations()[0];if(!s||!o.isClassDeclaration(s))return r&&console.error(`⚠️ Warning: Could not get class declaration for ${e.getName()}`),a;let n=e.getName();r&&console.error(` Analyzing state: ${n}`);for(let t of s.getInstanceMembers()){let i=t.getName();r&&console.error(` Checking member: ${i}`);let l=k(t,r);if(!l)continue;r&&console.error(` Found transition: ${i}`);let{invoke:c,actions:f,guards:p,...h}=l;if(c&&(a.invoke||(a.invoke=[]),a.invoke.push({src:c.src,onDone:{target:c.onDone},onError:{target:c.onError},description:c.description}),r&&console.error(` → Invoke: ${c.src}`)),h.target){let g={target:h.target};h.description&&(g.description=h.description),p&&(g.cond=p.map(m=>m.name).join(" && "),r&&console.error(` → Guard: ${g.cond}`)),f&&f.length>0&&(g.actions=f.map(m=>m.name),r&&console.error(` → Actions: ${g.actions.join(", ")}`)),a.on[i]=g,r&&console.error(` → Target: ${h.target}`)}}return a}function O(e,r,a,s,n=!1){let t=x(r,n);if(s){n&&console.error(` 👪 Analyzing children for state: ${e}`),t.initial=s.initialState,t.states={};for(let i of s.classes){let l=a.getClass(i);if(l){let c=l.getSymbolOrThrow();t.states[i]=x(c,n)}else console.warn(`⚠️ Warning: Child class '${i}' not found.`)}}return t}function E(e,r,a=!1){a&&(console.error(`
|
|
2
|
+
🔍 Analyzing machine: ${e.id}`),console.error(` Source: ${e.input}`));let s=r.getSourceFile(e.input);if(!s)throw new Error(`Source file not found: ${e.input}`);if(e.parallel){a&&console.error(" ⏹️ Parallel machine detected. Analyzing regions.");let t={id:e.id,type:"parallel",states:{}};e.description&&(t.description=e.description);for(let i of e.parallel.regions){a&&console.error(` 📍 Analyzing region: ${i.name}`);let l={};for(let c of i.classes){let f=s.getClass(c);if(f){let p=f.getSymbolOrThrow();l[c]=x(p,a)}else console.warn(`⚠️ Warning: Class '${c}' not found for region '${i.name}'.`)}t.states[i.name]={initial:i.initialState,states:l}}return a&&console.error(` ✅ Extracted ${e.parallel.regions.length} parallel regions`),t}if(!e.initialState||!e.classes)throw new Error(`Machine config for '${e.id}' must have either 'parallel' or 'initialState'/'classes'.`);let n={id:e.id,initial:e.initialState,states:{}};e.description&&(n.description=e.description);for(let t of e.classes){let i=s.getClass(t);if(!i){console.warn(`⚠️ Warning: Class '${t}' not found in '${e.input}'. Skipping.`);continue}let l=i.getSymbolOrThrow(),c=t===e.initialState&&e.children,f=O(t,l,s,c?e.children:void 0,a);n.states[t]=f}return a&&console.error(` ✅ Extracted ${e.classes.length} states`),n}function T(e){var n;let r=(n=e.verbose)!=null?n:!1;r&&(console.error(`
|
|
3
|
+
📊 Starting statechart extraction`),console.error(` Machines to extract: ${e.machines.length}`));let a=new S;a.addSourceFilesAtPaths("src/**/*.ts"),a.addSourceFilesAtPaths("examples/**/*.ts");let s=[];for(let t of e.machines)try{let i=E(t,a,r);s.push(i)}catch(i){console.error(`❌ Error extracting machine '${t.id}':`,i),r||console.error(" Run with --verbose for more details")}return r&&console.error(`
|
|
4
|
+
✅ Extraction complete: ${s.length}/${e.machines.length} machines extracted`),s}function $(){let e={input:"examples/authMachine.ts",classes:["LoggedOutMachine","LoggingInMachine","LoggedInMachine","SessionExpiredMachine","ErrorMachine"],id:"auth",initialState:"LoggedOutMachine",description:"Authentication state machine"};console.error("🔍 Using legacy generateChart function"),console.error(`⚠️ Consider using extractMachines() with a config file instead
|
|
5
|
+
`);let r=new S;r.addSourceFilesAtPaths("src/**/*.ts"),r.addSourceFilesAtPaths("examples/**/*.ts");try{let a=E(e,r,!0);console.log(JSON.stringify(a,null,2))}catch(a){console.error("❌ Error:",a),process.exit(1)}}var w={hierarchical:{input:"examples/dashboardMachine.ts",id:"dashboard",classes:["DashboardMachine","LoggedOutMachine"],initialState:"DashboardMachine",children:{contextProperty:"child",initialState:"ViewingChildMachine",classes:["ViewingChildMachine","EditingChildMachine"]}},parallel:{input:"examples/editorMachine.ts",id:"editor",parallel:{regions:[{name:"fontWeight",initialState:"NormalWeight",classes:["NormalWeight","BoldWeight"]},{name:"textDecoration",initialState:"NoDecoration",classes:["NoDecoration","UnderlineState"]}]}}};y.main===module&&$();export{w as ADVANCED_CONFIG_EXAMPLES,C as _typeToJson,E as extractMachine,T as extractMachines,$ as generateChart};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
var V=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,n)=>(typeof require!="undefined"?require:t)[n]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});function U(e,t){let n=e(t),r=t;for(;;){let{value:i,done:o}=n.next(r);if(o)return i;r=i}}function xe(e){return function*(){return yield e}()}function fe(e){return e}function he(e,t){return t.reduce((n,r)=>U(r,n),e)}function pe(e){return e}function ge(e,t,n=(r,i)=>{console.log(`Step ${r}:`,i.context)}){let r=e(t),i=t,o=0;for(n(o,i);;){let{value:a,done:s}=r.next(i);if(s)return console.log("Final:",a),a;i=a,o++,n(o,i)}}async function Ce(e,t){let n=e(t),r=t;for(;;){let{value:i,done:o}=await n.next(r);if(o)return i;r=i}}async function*me(e){return yield e}var Te=Symbol("MachineMeta"),q=Symbol("__machine_runtime_meta__");function w(e,t){let n=e[q]||{},r={...n,...t};t.guards&&n.guards?r.guards=[...t.guards,...n.guards]:t.guards&&(r.guards=[...t.guards]),t.actions&&n.actions?r.actions=[...t.actions,...n.actions]:t.actions&&(r.actions=[...t.actions]),Object.defineProperty(e,q,{value:r,enumerable:!1,writable:!1,configurable:!0})}function be(e,t){return w(t,{target:e.name||e.toString()}),t}function we(e,t){return w(t,{description:e}),t}function Ee(e,t){return w(t,{guards:[e]}),t}function Se(e,t){return w(t,{invoke:{src:e.src,onDone:e.onDone.name||e.onDone.toString(),onError:e.onError.name||e.onError.toString(),description:e.description}}),t}function Ae(e,t){return w(t,{actions:[e]}),t}function R(e,t,n={}){let{onFail:r="throw",errorMessage:i,description:o}=n,a={...n,onFail:r,errorMessage:i,description:o},s=function(...c){let l=typeof this=="object"&&"context"in this,d=l?this.context:this;if(e(d,...c)){let M=l?this.context:this;return t.apply(M,c)}else if(r==="throw"){let M=i||"Guard condition failed";throw new Error(M)}else if(r==="ignore"){if(l)return this;throw new Error('Cannot use "ignore" mode with context-only binding. Use full machine binding or provide fallback.')}else if(typeof r=="function"){if(l)return r.apply(this,c);throw new Error("Cannot use function fallback with context-only binding. Use full machine binding.")}else return r};return Object.defineProperty(s,"__guard",{value:!0,enumerable:!1}),Object.defineProperty(s,"condition",{value:e,enumerable:!1}),Object.defineProperty(s,"transition",{value:t,enumerable:!1}),Object.defineProperty(s,"options",{value:a,enumerable:!1}),w(s,{description:o||"Synchronous guarded transition",guards:[{name:"runtime_guard",description:o||"Synchronous condition check"}]}),s}function O(e,t,n={}){let{onFail:r="throw",errorMessage:i,description:o}=n,a={...n,onFail:r,errorMessage:i,description:o},s=async function(...c){let l=typeof this=="object"&&"context"in this,d=l?this.context:this;if(await Promise.resolve(e(d,...c))){let M=l?this.context:this;return t.apply(M,c)}else if(r==="throw"){let M=i||"Guard condition failed";throw new Error(M)}else if(r==="ignore"){if(l)return this;throw new Error('Cannot use "ignore" mode with context-only binding. Use full machine binding or provide fallback.')}else if(typeof r=="function"){if(l)return r.apply(this,c);throw new Error("Cannot use function fallback with context-only binding. Use full machine binding.")}else return r};return Object.defineProperty(s,"__guard",{value:!0,enumerable:!1}),Object.defineProperty(s,"condition",{value:e,enumerable:!1}),Object.defineProperty(s,"transition",{value:t,enumerable:!1}),Object.defineProperty(s,"options",{value:a,enumerable:!1}),w(s,{description:o||"Runtime guarded transition",guards:[{name:"runtime_guard",description:o||"Runtime condition check"}]}),s}function Fe(e){return{do(t){let n=R(e,t);return n.else=function(r){return R(e,t,{onFail:r})},n}}}function je(e){return{do(t){let n=O(e,t);return n.else=function(r){return O(e,t,{onFail:r})},n}}}function Re(e,t){return t}function Oe(e,t){let n=e,r=s=>{n=s,t==null||t(s)},{context:i,...o}=e,a=new Proxy({},{get(s,c){let l=n[c];if(typeof l=="function")return(...d)=>{let u=l.apply(n.context,d),M=Object.assign({context:u.context},o);return r(M),M}}});return{get state(){return n},get context(){return n.context},actions:a,setState:r}}function Pe(e,t,n){let r=()=>{let o=e.getContext(),a=n(o),s=t[a];if(!s)throw new Error(`[Ensemble] Invalid state: No factory found for state "${String(a)}".`);return s(o)},i=new Proxy({},{get(o,a){let s=r(),c=s[a];if(typeof c!="function")throw new Error(`[Ensemble] Transition "${a}" is not valid in the current state.`);return(...l)=>c.apply(s.context,l)}});return{get context(){return e.getContext()},get state(){return r()},actions:i}}function Xe(e,t){return function(r){return Pe(e,r,t)}}function Qe(e,t){let n=Oe(t),r=e(n),i=r.next();for(;!i.done;)i=r.next();return i.value}function Ze(e,t){let n=e(t),r=n.next();for(;!r.done;)r=n.next();return r.value}var J=class{constructor(t){this.store=t}get context(){return this.store.getContext()}setContext(t){this.store.setContext(t)}};function et(e,t){let n=new e(t);return new Proxy({},{get(r,i){let o=t.getContext();if(i in o)return o[i];let a=n[i];if(typeof a=="function")return(...s)=>a.apply(n,s)},set(r,i,o){let a=t.getContext();if(i in a){let s={...a,[i]:o};return t.setContext(s),!0}return!1},has(r,i){let o=t.getContext();return i in o||typeof n[i]=="function"},ownKeys(r){let i=t.getContext(),o=Object.keys(i),a=Object.getOwnPropertyNames(Object.getPrototypeOf(n)).filter(s=>s!=="constructor"&&typeof n[s]=="function");return Array.from(new Set([...o,...a]))},getOwnPropertyDescriptor(r,i){let o=t.getContext();if(i in o||typeof n[i]=="function")return{value:void 0,writable:!0,enumerable:!0,configurable:!0}}})}function tt(e,t,n){let r=()=>{let i=n(e),o=t[i];if(!o)throw new Error(`[MutableMachine] Invalid state: No factory for state "${String(i)}".`);return o(e)};return new Proxy(e,{get(i,o,a){if(o in i)return i[o];let s=r(),c=s[o];if(typeof c=="function")return(...l)=>{let d=c.apply(s.context,l);if(typeof d!="object"||d===null){console.warn(`[MutableMachine] Transition "${String(o)}" did not return a valid context object. State may be inconsistent.`);return}Object.keys(i).forEach(u=>delete i[u]),Object.assign(i,d)}},set(i,o,a,s){return i[o]=a,!0},has(i,o){let a=r();return o in i||typeof a[o]=="function"}})}function st(e){return function(...t){let n=this.context.child;if(typeof n[e]=="function"){let r=n[e](...t);return F(this,{...this.context,child:r})}return this}}function ct(e){return function(){return typeof this.context[e]!="boolean"&&console.warn(`[toggle primitive] Property '${String(e)}' is not a boolean. Toggling may have unexpected results.`),F(this,{...this.context,[e]:!this.context[e]})}}var P=class extends T{constructor(n){super({status:"idle"});this.config=n;this.fetch=n=>new E(this.config,n!=null?n:this.config.initialParams,1)}},E=class extends T{constructor(n,r,i){super({status:"loading",abortController:new AbortController,attempts:i});this.config=n;this.params=r;this.succeed=n=>{var r,i;return(i=(r=this.config).onSuccess)==null||i.call(r,n),new v(this.config,{status:"success",data:n})};this.fail=n=>{var i,o,a;let r=(i=this.config.maxRetries)!=null?i:3;return this.context.attempts<r?new k(this.config,this.params,n,this.context.attempts):((a=(o=this.config).onError)==null||a.call(o,n),new N(this.config,{status:"error",error:n}))};this.cancel=()=>(this.context.abortController.abort(),new B(this.config));this.execute()}async execute(){}},k=class extends T{constructor(n,r,i,o){super({status:"retrying",error:i,attempts:o});this.config=n;this.params=r;this.retry=n=>new E(this.config,n!=null?n:this.params,this.context.attempts+1)}},v=class extends T{constructor(n,r){super(r);this.config=n;this.refetch=n=>new E(this.config,n!=null?n:this.config.initialParams,1)}},N=class extends T{constructor(n,r){super(r);this.config=n;this.retry=n=>new E(this.config,n!=null?n:this.config.initialParams,1)}},B=class extends T{constructor(n){super({status:"canceled"});this.config=n;this.refetch=n=>new E(this.config,n!=null?n:this.config.initialParams,1)}};function lt(e){return new P(e)}function Y(e,t){let n={...e.context,...t.context},r={...e},i={...t};delete r.context,delete i.context;let o={};for(let a in r){let s=r[a];o[a]=(...c)=>{let l=s.apply(e.context,c);return Y(l,t)}}for(let a in i){let s=i[a];o[a]=(...c)=>{let l=s.apply(t.context,c);return Y(e,l)}}return{context:n,...o}}import{Project as Q,Node as p}from"ts-morph";function X(e,t=!1){let n=e.getSymbol();if(n&&n.getDeclarations().some(p.isClassDeclaration))return n.getName();if(e.isStringLiteral()||e.isNumberLiteral()||e.isBooleanLiteral())return e.getLiteralValue();if(e.isString())return"string";if(e.isNumber())return"number";if(e.isBoolean())return"boolean";if(e.isArray()){let r=e.getArrayElementTypeOrThrow();return[X(r,t)]}if(e.isObject()||e.isIntersection()){let r={},i=e.getProperties();for(let o of i){let a=o.getName();if(a.startsWith("__@"))continue;let s=o.getValueDeclaration();if(s)try{r[a]=X(s.getType(),t)}catch(c){t&&console.error(` Warning: Failed to serialize property ${a}:`,c),r[a]="unknown"}}return Object.keys(r).length>0?r:null}return t&&console.error(` Unhandled type: ${e.getText()}`),"unknown"}function Z(e){return p.isIdentifier(e)?e.getText():p.isTypeOfExpression(e)?e.getExpression().getText():"unknown"}function A(e){if(!p.isObjectLiteralExpression(e))return{};let t={};for(let n of e.getProperties())if(p.isPropertyAssignment(n)){let r=n.getName(),i=n.getInitializer();i&&(p.isStringLiteral(i)||p.isNumericLiteral(i)?t[r]=i.getLiteralValue():i.getText()==="true"||i.getText()==="false"?t[r]=i.getText()==="true":p.isIdentifier(i)?t[r]=i.getText():p.isObjectLiteralExpression(i)?t[r]=A(i):p.isArrayLiteralExpression(i)&&(t[r]=i.getElements().map(o=>p.isObjectLiteralExpression(o)?A(o):o.getText())))}return t}function ke(e){if(!p.isObjectLiteralExpression(e))return{};let t={};for(let n of e.getProperties())if(p.isPropertyAssignment(n)){let r=n.getName(),i=n.getInitializer();if(!i)continue;r==="onDone"||r==="onError"?t[r]=Z(i):p.isStringLiteral(i)?t[r]=i.getLiteralValue():p.isIdentifier(i)&&(t[r]=i.getText())}return t}function S(e,t=!1){if(!p.isCallExpression(e))return null;let n=e.getExpression(),r=p.isIdentifier(n)?n.getText():null;if(!r)return null;let i={},o=e.getArguments();switch(r){case"transitionTo":o[0]&&(i.target=Z(o[0]));break;case"describe":if(o[0]&&p.isStringLiteral(o[0])&&(i.description=o[0].getLiteralValue()),o[1]&&p.isCallExpression(o[1])){let a=S(o[1],t);a&&Object.assign(i,a)}break;case"guarded":if(o[0]){let a=A(o[0]);Object.keys(a).length>0&&(i.guards=[a])}if(o[1]&&p.isCallExpression(o[1])){let a=S(o[1],t);a&&Object.assign(i,a)}break;case"invoke":if(o[0]){let a=ke(o[0]);Object.keys(a).length>0&&(i.invoke=a)}break;case"action":if(o[0]){let a=A(o[0]);Object.keys(a).length>0&&(i.actions=[a])}if(o[1]&&p.isCallExpression(o[1])){let a=S(o[1],t);a&&Object.assign(i,a)}break;case"guard":if(o[2]){let a=A(o[2]);a.description&&(i.description=a.description)}if(i.guards=[{name:"runtime_guard",description:i.description||"Synchronous condition check"}],o[1]&&p.isCallExpression(o[1])){let a=S(o[1],t);a&&Object.assign(i,a)}break;case"guardAsync":if(o[2]){let a=A(o[2]);a.description&&(i.description=a.description)}if(i.guards=[{name:"runtime_guard_async",description:i.description||"Asynchronous condition check"}],o[1]&&p.isCallExpression(o[1])){let a=S(o[1],t);a&&Object.assign(i,a)}break;default:return null}return Object.keys(i).length>0?i:null}function ve(e,t=!1){if(!p.isPropertyDeclaration(e))return t&&console.error(" ⚠️ Not a property declaration"),null;let n=e.getInitializer();if(!n)return t&&console.error(" ⚠️ No initializer"),null;if(!p.isCallExpression(n))return t&&console.error(" ⚠️ Initializer is not a call expression"),null;let r=S(n,t);return r&&t&&console.error(" ✅ Extracted metadata:",JSON.stringify(r,null,2)),r}function K(e,t=!1){let n={on:{}},r=e.getDeclarations()[0];if(!r||!p.isClassDeclaration(r))return t&&console.error(`⚠️ Warning: Could not get class declaration for ${e.getName()}`),n;let i=e.getName();t&&console.error(` Analyzing state: ${i}`);for(let o of r.getInstanceMembers()){let a=o.getName();t&&console.error(` Checking member: ${a}`);let s=ve(o,t);if(!s)continue;t&&console.error(` Found transition: ${a}`);let{invoke:c,actions:l,guards:d,...u}=s;if(c&&(n.invoke||(n.invoke=[]),n.invoke.push({src:c.src,onDone:{target:c.onDone},onError:{target:c.onError},description:c.description}),t&&console.error(` → Invoke: ${c.src}`)),u.target){let M={target:u.target};u.description&&(M.description=u.description),d&&(M.cond=d.map(y=>y.name).join(" && "),t&&console.error(` → Guard: ${M.cond}`)),l&&l.length>0&&(M.actions=l.map(y=>y.name),t&&console.error(` → Actions: ${M.actions.join(", ")}`)),n.on[a]=M,t&&console.error(` → Target: ${u.target}`)}}return n}function Ne(e,t,n,r,i=!1){let o=K(t,i);if(r){i&&console.error(` 👪 Analyzing children for state: ${e}`),o.initial=r.initialState,o.states={};for(let a of r.classes){let s=n.getClass(a);if(s){let c=s.getSymbolOrThrow();o.states[a]=K(c,i)}else console.warn(`⚠️ Warning: Child class '${a}' not found.`)}}return o}function ee(e,t,n=!1){n&&(console.error(`
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
`);let t=new Q;t.addSourceFilesAtPaths("src/**/*.ts"),t.addSourceFilesAtPaths("examples/**/*.ts");try{let n=ee(e,t,!0);console.log(JSON.stringify(n,null,2))}catch(n){console.error("❌ Error:",n),process.exit(1)}}var xt={hierarchical:{input:"examples/dashboardMachine.ts",id:"dashboard",classes:["DashboardMachine","LoggedOutMachine"],initialState:"DashboardMachine",children:{contextProperty:"child",initialState:"ViewingChildMachine",classes:["ViewingChildMachine","EditingChildMachine"]}},parallel:{input:"examples/editorMachine.ts",id:"editor",parallel:{regions:[{name:"fontWeight",initialState:"NormalWeight",classes:["NormalWeight","BoldWeight"]},{name:"textDecoration",initialState:"NoDecoration",classes:["NoDecoration","UnderlineState"]}]}}};V.main===module&&Be();var te=Symbol("CANCEL");function m(e,t,n={}){let{continueOnError:r=!1,logErrors:i=!0,onError:o}=n,a={...e};for(let s in e)Object.prototype.hasOwnProperty.call(e,s)&&s!=="context"&&typeof e[s]!="function"&&(a[s]=e[s]);for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;let c=e[s];typeof c=="function"&&s!=="context"&&(a[s]=function(...l){let d=s,u=a.context,M=()=>{let y;try{y=c.apply(this,l)}catch(f){if(t.error)try{t.error({transitionName:d,context:u,args:[...l],error:f})}catch(h){if(!r)throw h;i&&console.error(`Middleware error hook error for ${d}:`,h),o==null||o(h,"error",{transitionName:d,context:u,args:l,error:f})}throw f}let x=f=>{if(f&&typeof f=="object"&&f.context){for(let h in a)Object.prototype.hasOwnProperty.call(a,h)&&h!=="context"&&!(h in f)&&(f[h]=a[h]);for(let h in f){if(!Object.prototype.hasOwnProperty.call(f,h))continue;typeof f[h]=="function"&&h!=="context"&&a[h]&&(f[h]=a[h])}}return f};if(y&&typeof y.then=="function")return y.then(h=>{if(x(h),t.after)try{let C=t.after({transitionName:d,prevContext:u,nextContext:h.context,args:[...l]});if(C&&typeof C.then=="function")return C.then(()=>h)}catch(C){if(!r)throw C;i&&console.error(`Middleware after hook error for ${d}:`,C),o==null||o(C,"after",{transitionName:d,prevContext:u,nextContext:h.context,args:l})}return h});if(x(y),t.after)try{let f=t.after({transitionName:d,prevContext:u,nextContext:y.context,args:[...l]});if(f&&typeof f=="object"&&f&&"then"in f)return f.then(()=>y).catch(h=>{if(!r)throw h;return i&&console.error(`Middleware after hook error for ${d}:`,h),o==null||o(h,"after",{transitionName:d,prevContext:u,nextContext:y.context,args:l}),y})}catch(f){if(!r)throw f;i&&console.error(`Middleware after hook error for ${d}:`,f),o==null||o(f,"after",{transitionName:d,prevContext:u,nextContext:y.context,args:l})}return y};if(t.before)try{let y=t.before({transitionName:d,context:u,args:[...l]});if(y&&typeof y=="object"&&y&&"then"in y)return y.then(x=>x===te?a:M()).catch(x=>{if(!r)throw x;return i&&console.error(`Middleware before hook error for ${d}:`,x),o==null||o(x,"before",{transitionName:d,context:u,args:l}),M()});if(y===te)return a}catch(y){if(!r)throw y;i&&console.error(`Middleware before hook error for ${d}:`,y),o==null||o(y,"before",{transitionName:d,context:u,args:l})}return M()})}return a}function ne(e,t={}){let{logger:n=console.log,includeArgs:r=!1,includeContext:i=!0}=t;return m(e,{before:({transitionName:o,args:a})=>{let s=r?`→ ${o} [${a.join(", ")}]`:`→ ${o}`;n(s)},after:({transitionName:o,nextContext:a})=>{let s=i?` ${JSON.stringify(a)}`:"";n(`✓ ${o}${s}`)},error:({transitionName:o,error:a})=>{console.error(`[Machine] ${o} failed:`,a)}})}function re(e,t,n={}){let{eventPrefix:r="state_transition",includePrevContext:i=!1,includeArgs:o=!1}=n;return m(e,{after:({transitionName:a,prevContext:s,nextContext:c,args:l})=>{let d=`${r}.${a}`,u={transition:a};i&&(u.from=s),u.to=c,o&&(u.args=l),t(d,u)}})}function ie(e,t){return m(e,{before:n=>{if(t(n)===!1)throw new Error(`Validation failed for transition: ${n.transitionName}`)}})}function oe(e,t){return m(e,{before:n=>{if(!t(n))throw new Error(`Unauthorized transition: ${n.transitionName}`)}})}function ae(e,t,n={}){let{includeArgs:r=!1}=n;return m(e,{error:i=>{let o={transition:i.transitionName,context:i.context,...r&&{args:i.args}};t(i.error,o)}})}function se(e,t){let n=new Map;return m(e,{before:r=>{n.set(r.transitionName,Date.now())},after:r=>{let i=n.get(r.transitionName);if(i){let o=Date.now()-i;n.delete(r.transitionName);let a={transitionName:r.transitionName,duration:o,context:r.nextContext||r.prevContext};t(a)}}})}function ce(e,t={}){var c,l;let{maxAttempts:n=(c=t.maxRetries)!=null?c:3,shouldRetry:r=()=>!0,backoffMs:i=(l=t.delay)!=null?l:100,backoffMultiplier:o=2,onRetry:a}=t,s={...e};for(let d in e){if(!Object.prototype.hasOwnProperty.call(e,d))continue;let u=e[d];typeof u=="function"&&d!=="context"&&(s[d]=async function(...M){let y,x=0;for(;x<n;)try{return await u.apply(this,M)}catch(f){if(y=f,x++,x<n&&r(y,x)){a==null||a(y,x);let C=(typeof i=="function"?i(x):i)*Math.pow(o,x-1);await new Promise(b=>setTimeout(b,C))}else throw y}throw y})}return s}function pt(e,t){return n=>m(n,e,t)}function z(e,t={}){let{maxSize:n,serializer:r,onEntry:i}=t,o=[],a=0,s=m(e,{before:({transitionName:c,args:l})=>{let d={id:`entry-${a++}`,transitionName:c,args:[...l],timestamp:Date.now()};if(r)try{d.serializedArgs=r.serialize(l)}catch(u){console.error("Failed to serialize history args:",u)}o.push(d),n&&o.length>n&&o.shift(),i==null||i(d)}});return Object.assign(s,{history:o,clearHistory:()=>{o.length=0,a=0}})}function $(e,t={}){let{maxSize:n,serializer:r,captureSnapshot:i,onlyOnChange:o=!1}=t,a=[],s=0,c=m(e,{after:({transitionName:d,prevContext:u,nextContext:M})=>{if(o&&JSON.stringify(u)===JSON.stringify(M))return;let y={id:`snapshot-${s++}`,transitionName:d,before:{...u},after:{...M},timestamp:Date.now()};if(r)try{y.serializedBefore=r.serialize(u),y.serializedAfter=r.serialize(M)}catch(x){console.error("Failed to serialize snapshot:",x)}if(i)try{y.diff=i(u,M)}catch(x){console.error("Failed to capture snapshot:",x)}a.push(y),n&&a.length>n&&a.shift()}});return Object.assign(c,{snapshots:a,clearSnapshots:()=>{a.length=0,s=0},restoreSnapshot:d=>{let u=Object.fromEntries(Object.entries(e).filter(([M])=>M!=="context"&&M!=="snapshots"&&M!=="clearSnapshots"&&M!=="restoreSnapshot"&&typeof e[M]=="function"));return Object.assign({context:d},u)}})}function D(e,t={}){let{maxSize:n,serializer:r,onRecord:i}=t,o=[],a=[],s=0,c=0,l=m(e,{before:({transitionName:M,args:y})=>{let x={id:`entry-${s++}`,transitionName:M,args:[...y],timestamp:Date.now()};if(r)try{x.serializedArgs=r.serialize(y)}catch(f){console.error("Failed to serialize history args:",f)}o.push(x),n&&o.length>n&&o.shift(),i==null||i("history",x)},after:({transitionName:M,prevContext:y,nextContext:x})=>{let f={id:`snapshot-${c++}`,transitionName:M,before:{...y},after:{...x},timestamp:Date.now()};if(r)try{f.serializedBefore=r.serialize(y),f.serializedAfter=r.serialize(x)}catch(h){console.error("Failed to serialize snapshot:",h)}a.push(f),n&&a.length>n&&a.shift(),i==null||i("snapshot",f)}});return Object.assign(l,{history:o,snapshots:a,clearHistory:()=>{o.length=0,s=0},clearSnapshots:()=>{a.length=0,c=0},clearTimeTravel:()=>{o.length=0,a.length=0,s=0,c=0},restoreSnapshot:M=>{let y=Object.fromEntries(Object.entries(e).filter(([x])=>x!=="context"&&x!=="history"&&x!=="snapshots"&&x!=="clearHistory"&&x!=="clearSnapshots"&&x!=="restoreSnapshot"&&x!=="clearTimeTravel"&&x!=="replayFrom"&&typeof e[x]=="function"));return Object.assign({context:M},y)},replayFrom:M=>{var C;if(M<0||M>=o.length)throw new Error(`Invalid replay start index: ${M}`);let y=(C=a[M])==null?void 0:C.before;if(!y)throw new Error(`No snapshot available for index ${M}`);let x=o.slice(M),h=Object.assign({context:y},Object.fromEntries(Object.entries(e).filter(([b])=>b!=="context"&&typeof e[b]=="function")));for(let b of x){let I=h[b.transitionName];I&&(h=I.apply(h.context,b.args))}return h}})}function Rt(e,...t){return t.reduce((n,r)=>r(n),e)}function _(e,...t){return t.reduce((n,r)=>r(n),e)}var W=class e{constructor(t){this.machine=t}with(t){let n=t(this.machine);return new e(n)}build(){return this.machine}};function Ot(e){return new W(e)}function G(e,t){let n=function(r){return t(r)?e(r):r};return n.middleware=e,n.when=t,n}function Pt(e){return G(e,()=>typeof process!="undefined"?!1:typeof window!="undefined"?!window.location.hostname.includes("production"):!1)}function kt(e,t,n){return G(n,r=>r.context[e]===t)}function vt(){let e=new Map;return{register(t,n,r,i){if(e.has(t))throw new Error(`Middleware '${t}' is already registered`);return e.set(t,{name:t,middleware:n,description:r,priority:i}),this},unregister(t){return e.delete(t)},has(t){return e.has(t)},get(t){return e.get(t)},list(){return Array.from(e.values()).sort((t,n)=>{var r,i;return((r=t.priority)!=null?r:0)-((i=n.priority)!=null?i:0)})},apply(t,n){let r=n.map(i=>{let o=e.get(i);if(!o)throw new Error(`Middleware '${i}' is not registered`);return o}).sort((i,o)=>{var a,s;return((a=i.priority)!=null?a:0)-((s=o.priority)!=null?s:0)});return _(t,...r.map(i=>i.middleware))},applyAll(t){let n=this.list();return _(t,...n.map(r=>r.middleware))}}}function Nt(e={}){let{continueOnError:t=!1,logErrors:n=!0,onError:r}=e;return(i,...o)=>{let a=i,s=[],c=!0;for(let l=0;l<o.length;l++){let d=o[l];try{if("middleware"in d&&"when"in d){if(!d.when(a))continue;a=d.middleware(a)}else a=d(a)}catch(u){if(c=!1,!t)throw u;s.push({error:u,middlewareIndex:l,middlewareName:d.name}),n&&console.error(`Pipeline middleware error at index ${l}:`,u),r==null||r(u,l,d.name)}}return{machine:a,errors:s,success:c}}}function Bt(...e){return t=>_(t,...e)}function Kt(e,t){return n=>{for(let[r,i]of e)if(r(n))return i(n);return t?t(n):n}}function le(e){return typeof e=="function"&&e.length===1}function zt(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&"middleware"in e&&"when"in e&&le(e.middleware)&&typeof e.when=="function"}function $t(e,t){return e!==null&&typeof e=="object"&&"transitionName"in e&&"prevContext"in e&&"nextContext"in e&&"args"in e&&typeof e.transitionName=="string"&&Array.isArray(e.args)&&(!t||j(e.prevContext,t)&&j(e.nextContext,t))}function Dt(e,t){return e!==null&&typeof e=="object"&&"transitionName"in e&&"context"in e&&"args"in e&&typeof e.transitionName=="string"&&Array.isArray(e.args)&&(!t||j(e.context,t))}function _t(e,t){return e!==null&&typeof e=="object"&&"transitionName"in e&&"context"in e&&"args"in e&&"error"in e&&typeof e.transitionName=="string"&&Array.isArray(e.args)&&e.error instanceof Error&&(!t||j(e.context,t))}function Wt(e,t){if(e===null||typeof e!="object")return!1;let n=e;return!("before"in n&&n.before!==void 0&&typeof n.before!="function"||"after"in n&&n.after!==void 0&&typeof n.after!="function"||"error"in n&&n.error!==void 0&&typeof n.error!="function")}function Lt(e){return e===void 0||e!==null&&typeof e=="object"&&("continueOnError"in e?typeof e.continueOnError=="boolean":!0)&&("logErrors"in e?typeof e.logErrors=="boolean":!0)&&("onError"in e?typeof e.onError=="function"||e.onError===void 0:!0)}function j(e,t){return e!==null&&typeof e=="object"}function Gt(e){return e!==null&&typeof e=="object"&&"name"in e&&"middleware"in e&&typeof e.name=="string"&&le(e.middleware)&&("description"in e?typeof e.description=="string"||e.description===void 0:!0)&&("priority"in e?typeof e.priority=="number"||e.priority===void 0:!0)}function Ht(e){return e===void 0||e!==null&&typeof e=="object"&&("continueOnError"in e?typeof e.continueOnError=="boolean":!0)&&("logErrors"in e?typeof e.logErrors=="boolean":!0)&&("onError"in e?typeof e.onError=="function"||e.onError===void 0:!0)}var L=class{constructor(t){this.machine=t;this.middlewares=[]}withLogging(t){return this.middlewares.push(n=>ne(n,t)),this}withAnalytics(t,n){return this.middlewares.push(r=>re(r,t,n)),this}withValidation(t,n){return this.middlewares.push(r=>ie(r,t)),this}withPermissions(t){return this.middlewares.push(n=>oe(n,t)),this}withErrorReporting(t,n){return this.middlewares.push(r=>ae(r,t,n)),this}withPerformanceMonitoring(t,n){return this.middlewares.push(r=>se(r,t)),this}withRetry(t){return this.middlewares.push(n=>ce(n,t)),this}withHistory(t){return this.middlewares.push(n=>z(n,t)),this}withSnapshot(t){return this.middlewares.push(n=>$(n,t)),this}withTimeTravel(t){return this.middlewares.push(n=>D(n,t)),this}withDebugging(){return this.middlewares.push(t=>ze(t)),this}withCustom(t){return this.middlewares.push(t),this}withConditional(t,n){return this.middlewares.push(G(t,n)),this}build(){let t=this.machine;for(let n of this.middlewares)t=n(t);return t}getChain(){return[...this.middlewares]}clear(){return this.middlewares=[],this}};function Ke(e){return new L(e)}function It(e={}){return{create:t=>{let n=Ke(t);return e.logging&&n.withLogging(e.logging),e.analytics&&n.withAnalytics(e.analytics.track,e.analytics.options),e.history&&n.withHistory(e.history),e.snapshot&&n.withSnapshot(e.snapshot),e.timeTravel&&n.withTimeTravel(e.timeTravel),e.retry&&n.withRetry(e.retry),n}}}function ze(e){return D($(z(e)))}function $e(e,t){return e instanceof t}function De(e,...t){return{type:e,args:t}}function _e(e,t){return F(e,n=>({...n,...t}))}async function We(e,...t){let n=e;for(let r of t)n=await r(n);return n}function Le(e,t){return t?console.log(t,e.context):console.log(e.context),e}function Ge(e,t){return function(...n){let r=t(this.context,...n);return g(r,e())}}function He(e,t,...n){return e.apply(t,n)}function de(e){return new Proxy(e,{get(t,n){let r=t[n];return typeof r=="function"?function(...i){let o=r.apply(t.context,i);return o&&typeof o=="object"&&"context"in o?de(o):o}:r}})}var H=class e{constructor(t){return this.wrappedMachine=t,new Proxy(this,{get:(n,r)=>{if(r==="wrappedMachine")return Reflect.get(n,r);if(r==="context")return this.wrappedMachine.context;let i=this.wrappedMachine[r];return typeof i=="function"?(...o)=>{let a=i.apply(this.wrappedMachine.context,o);return a&&typeof a=="object"&&"context"in a?new e(a):a}:i}})}};function Ie(){return function(t){return function(...n){let r=t(this.context,...n);return g(r,this)}}}function ue(e){return{machine:e,addTransition:function(t,n){let r=function(...o){let a=n(this.context,...o);return g(a,this)},i=Me(e,{[t]:r});return ue(i)}}}function ye(e){return function(n){let r={},i=Object.fromEntries(Object.entries(n).map(([o,a])=>[o,function(...s){let c=a(this.context,...s);return g(c,r)}]));return Object.assign(r,i),g(e,r)}}function Ve(e,t){return t!==void 0?g(e,t):ye(e)}function g(e,t){if(typeof t=="function"){let i;i=t(s=>{let c=g(s,i),l=Object.fromEntries(Object.entries(i).map(([d,u])=>[d,u.bind(s)]));return Object.assign(c,l)});let a=Object.fromEntries(Object.entries(i).map(([s,c])=>[s,c.bind(e)]));return Object.assign({context:e},a)}let n="context"in t?Object.fromEntries(Object.entries(t).filter(([i])=>i!=="context")):t;return Object.assign({context:e},n)}function Ue(e,t){if(typeof t=="function"){let i;i=t(s=>{let c=Ue(s,i),l=Object.fromEntries(Object.entries(i).map(([d,u])=>[d,u.bind(s)]));return Object.assign(c,l)});let a=Object.fromEntries(Object.entries(i).map(([s,c])=>[s,c.bind(e)]));return Object.assign({context:e},a)}let n="context"in t?Object.fromEntries(Object.entries(t).filter(([i])=>i!=="context")):t;return Object.assign({context:e},n)}function sn(){return e=>{let t=Object.fromEntries(Object.entries(e).map(([n,r])=>[n,function(...i){let o=r(this.context,...i);return g(o,t)}]));return n=>g(n,t)}}function F(e,t){let{context:n,...r}=e,i=typeof t=="function"?t(n):t;return g(i,r)}function cn(e,t){let{context:n,...r}=e,i={...r,...t};return g(n,i)}function Me(e,t){let{context:n,...r}=e,i={...r,...t};return g(n,i)}function ln(e,t){return(...n)=>{let r=e(...n),i=t(),o={...r.context,...i.context},{context:a,...s}=r,{context:c,...l}=i,d={...s,...l};return g(o,d)}}function dn(e){let{context:t,...n}=e;return r=>g(r,n)}function un(e,t,n){let r=e.context[t],i=n[r];if(!i)throw new Error(`No handler found for state: ${String(r)}`);return i(e.context)}function yn(e,t,n){return e.context[t]===n}function Mn(e,t){let n=e,r=null;async function i(o){r&&(r.abort(),r=null);let a=n[o.type];if(typeof a!="function")throw new Error(`[Machine] Unknown event type '${String(o.type)}' on current state.`);let s=new AbortController;r=s;try{let l=await a.apply(n.context,[...o.args,{signal:s.signal}]);return s.signal.aborted||(n=l,t==null||t(n)),n}finally{r===s&&(r=null)}}return{get state(){return n.context},dispatch:i,stop:()=>{r&&(r.abort(),r=null)}}}var T=class{constructor(t){this.context=t}};function xn(e,t){let{context:n,...r}=e;return g(t(n),r)}export{xt as ADVANCED_CONFIG_EXAMPLES,H as BoundMachine,te as CANCEL,Te as META_KEY,T as MachineBase,L as MiddlewareBuilder,J as MultiMachineBase,X as _typeToJson,Ae as action,de as bindTransitions,Kt as branch,He as call,Ot as chain,Bt as combine,ln as combineFactories,Rt as compose,_ as composeTyped,Ue as createAsyncMachine,pt as createCustomMiddleware,Pe as createEnsemble,Xe as createEnsembleFactory,De as createEvent,lt as createFetchMachine,pe as createFlow,ye as createFunctionalMachine,g as createMachine,dn as createMachineBuilder,sn as createMachineFactory,m as createMiddleware,It as createMiddlewareFactory,vt as createMiddlewareRegistry,et as createMultiMachine,tt as createMutableMachine,Y as createParallelMachine,Nt as createPipeline,Oe as createRunner,Ge as createTransition,ue as createTransitionExtender,Ie as createTransitionFactory,st as delegateToChild,we as describe,Me as extendTransitions,ee as extractMachine,Mt as extractMachines,Be as generateChart,R as guard,O as guardAsync,Ee as guarded,yn as hasState,Pt as inDevelopment,Se as invoke,zt as isConditionalMiddleware,Dt as isMiddlewareContext,_t as isMiddlewareError,le as isMiddlewareFn,Wt as isMiddlewareHooks,Lt as isMiddlewareOptions,$t as isMiddlewareResult,Gt as isNamedMiddleware,Ht as isPipelineConfig,$e as isState,Le as logState,un as matchMachine,_e as mergeContext,Re as metadata,Ke as middlewareBuilder,xn as next,cn as overrideTransitions,We as pipeTransitions,U as run,Ce as runAsync,Mn as runMachine,he as runSequence,ge as runWithDebug,Ze as runWithEnsemble,Qe as runWithRunner,F as setContext,Ve as state,xe as step,me as stepAsync,ct as toggle,be as transitionTo,G as when,kt as whenContext,Fe as whenGuard,je as whenGuardAsync,re as withAnalytics,ze as withDebugging,ae as withErrorReporting,z as withHistory,ne as withLogging,se as withPerformanceMonitoring,oe as withPermissions,ce as withRetry,$ as withSnapshot,D as withTimeTravel,ie as withValidation,fe as yieldMachine};
|
|
1
|
+
function D(e,n){let t=e(n),r=n;for(;;){let{value:a,done:o}=t.next(r);if(o)return a;r=a}}function ie(e){return function*(){return yield e}()}function se(e){return e}function ce(e,n){return n.reduce((t,r)=>D(r,t),e)}function de(e){return e}function ye(e,n,t=(r,a)=>{console.log(`Step ${r}:`,a.context)}){let r=e(n),a=n,o=0;for(t(o,a);;){let{value:i,done:s}=r.next(a);if(s)return console.log("Final:",i),i;a=i,o++,t(o,a)}}async function le(e,n){let t=e(n),r=n;for(;;){let{value:a,done:o}=await t.next(r);if(o)return a;r=a}}async function*ue(e){return yield e}var Me=Symbol("MachineMeta"),I=Symbol("__machine_runtime_meta__");function b(e,n){let t=e[I]||{},r={...t,...n};n.guards&&t.guards?r.guards=[...n.guards,...t.guards]:n.guards&&(r.guards=[...n.guards]),n.actions&&t.actions?r.actions=[...n.actions,...t.actions]:n.actions&&(r.actions=[...n.actions]),Object.defineProperty(e,I,{value:r,enumerable:!1,writable:!1,configurable:!0})}function xe(e,n){return b(n,{target:e.name||e.toString()}),n}function he(e,n){return b(n,{description:e}),n}function fe(e,n){return b(n,{guards:[e]}),n}function pe(e,n){return b(n,{invoke:{src:e.src,onDone:e.onDone.name||e.onDone.toString(),onError:e.onError.name||e.onError.toString(),description:e.description}}),n}function Ce(e,n){return b(n,{actions:[e]}),n}function A(e,n,t={}){let{onFail:r="throw",errorMessage:a,description:o}=t,i={...t,onFail:r,errorMessage:a,description:o},s=function(...d){let c=typeof this=="object"&&"context"in this,y=c?this.context:this;if(e(y,...d)){let M=c?this.context:this;return n.apply(M,d)}else if(r==="throw"){let M=a||"Guard condition failed";throw new Error(M)}else if(r==="ignore"){if(c)return this;throw new Error('Cannot use "ignore" mode with context-only binding. Use full machine binding or provide fallback.')}else if(typeof r=="function"){if(c)return r.apply(this,d);throw new Error("Cannot use function fallback with context-only binding. Use full machine binding.")}else return r};return Object.defineProperty(s,"__guard",{value:!0,enumerable:!1}),Object.defineProperty(s,"condition",{value:e,enumerable:!1}),Object.defineProperty(s,"transition",{value:n,enumerable:!1}),Object.defineProperty(s,"options",{value:i,enumerable:!1}),b(s,{description:o||"Synchronous guarded transition",guards:[{name:"runtime_guard",description:o||"Synchronous condition check"}]}),s}function R(e,n,t={}){let{onFail:r="throw",errorMessage:a,description:o}=t,i={...t,onFail:r,errorMessage:a,description:o},s=async function(...d){let c=typeof this=="object"&&"context"in this,y=c?this.context:this;if(await Promise.resolve(e(y,...d))){let M=c?this.context:this;return n.apply(M,d)}else if(r==="throw"){let M=a||"Guard condition failed";throw new Error(M)}else if(r==="ignore"){if(c)return this;throw new Error('Cannot use "ignore" mode with context-only binding. Use full machine binding or provide fallback.')}else if(typeof r=="function"){if(c)return r.apply(this,d);throw new Error("Cannot use function fallback with context-only binding. Use full machine binding.")}else return r};return Object.defineProperty(s,"__guard",{value:!0,enumerable:!1}),Object.defineProperty(s,"condition",{value:e,enumerable:!1}),Object.defineProperty(s,"transition",{value:n,enumerable:!1}),Object.defineProperty(s,"options",{value:i,enumerable:!1}),b(s,{description:o||"Runtime guarded transition",guards:[{name:"runtime_guard",description:o||"Runtime condition check"}]}),s}function ge(e){return{do(n){let t=A(e,n);return t.else=function(r){return A(e,n,{onFail:r})},t}}}function me(e){return{do(n){let t=R(e,n);return t.else=function(r){return R(e,n,{onFail:r})},t}}}function Te(e,n){return n}function be(e,n){let t=e,r=s=>{t=s,n==null||n(s)},{context:a,...o}=e,i=new Proxy({},{get(s,d){let c=t[d];if(typeof c=="function")return(...y)=>{let l=c.apply(t.context,y),M=Object.assign({context:l.context},o);return r(M),M}}});return{get state(){return t},get context(){return t.context},actions:i,setState:r}}function we(e,n,t){let r=()=>{let o=e.getContext(),i=t(o),s=n[i];if(!s)throw new Error(`[Ensemble] Invalid state: No factory found for state "${String(i)}".`);return s(o)},a=new Proxy({},{get(o,i){let s=r(),d=s[i];if(typeof d!="function")throw new Error(`[Ensemble] Transition "${i}" is not valid in the current state.`);return(...c)=>d.apply(s.context,c)}});return{get context(){return e.getContext()},get state(){return r()},actions:a}}function De(e,n){return function(r){return we(e,r,n)}}function Ie(e,n){let t=be(n),r=e(t),a=r.next();for(;!a.done;)a=r.next();return a.value}function Ve(e,n){let t=e(n),r=t.next();for(;!r.done;)r=t.next();return r.value}var V=class{constructor(n){this.store=n}get context(){return this.store.getContext()}setContext(n){this.store.setContext(n)}};function Ue(e,n){let t=new e(n);return new Proxy({},{get(r,a){let o=n.getContext();if(a in o)return o[a];let i=t[a];if(typeof i=="function")return(...s)=>i.apply(t,s)},set(r,a,o){let i=n.getContext();if(a in i){let s={...i,[a]:o};return n.setContext(s),!0}return!1},has(r,a){let o=n.getContext();return a in o||typeof t[a]=="function"},ownKeys(r){let a=n.getContext(),o=Object.keys(a),i=Object.getOwnPropertyNames(Object.getPrototypeOf(t)).filter(s=>s!=="constructor"&&typeof t[s]=="function");return Array.from(new Set([...o,...i]))},getOwnPropertyDescriptor(r,a){let o=n.getContext();if(a in o||typeof t[a]=="function")return{value:void 0,writable:!0,enumerable:!0,configurable:!0}}})}function Le(e,n,t){let r=()=>{let a=t(e),o=n[a];if(!o)throw new Error(`[MutableMachine] Invalid state: No factory for state "${String(a)}".`);return o(e)};return new Proxy(e,{get(a,o,i){if(o in a)return a[o];let s=r(),d=s[o];if(typeof d=="function")return(...c)=>{let y=d.apply(s.context,c);if(typeof y!="object"||y===null){console.warn(`[MutableMachine] Transition "${String(o)}" did not return a valid context object. State may be inconsistent.`);return}Object.keys(a).forEach(l=>delete a[l]),Object.assign(a,y)}},set(a,o,i,s){return a[o]=i,!0},has(a,o){let i=r();return o in a||typeof i[o]=="function"}})}function Ze(e){return function(...n){let t=this.context.child;if(typeof t[e]=="function"){let r=t[e](...n);return E(this,{...this.context,child:r})}return this}}function en(e){return function(){return typeof this.context[e]!="boolean"&&console.warn(`[toggle primitive] Property '${String(e)}' is not a boolean. Toggling may have unexpected results.`),E(this,{...this.context,[e]:!this.context[e]})}}var S=class extends m{constructor(t){super({status:"idle"});this.config=t;this.fetch=t=>new w(this.config,t!=null?t:this.config.initialParams,1)}},w=class extends m{constructor(t,r,a){super({status:"loading",abortController:new AbortController,attempts:a});this.config=t;this.params=r;this.succeed=t=>{var r,a;return(a=(r=this.config).onSuccess)==null||a.call(r,t),new v(this.config,{status:"success",data:t})};this.fail=t=>{var a,o,i;let r=(a=this.config.maxRetries)!=null?a:3;return this.context.attempts<r?new j(this.config,this.params,t,this.context.attempts):((i=(o=this.config).onError)==null||i.call(o,t),new P(this.config,{status:"error",error:t}))};this.cancel=()=>(this.context.abortController.abort(),new O(this.config));this.execute()}async execute(){}},j=class extends m{constructor(t,r,a,o){super({status:"retrying",error:a,attempts:o});this.config=t;this.params=r;this.retry=t=>new w(this.config,t!=null?t:this.params,this.context.attempts+1)}},v=class extends m{constructor(t,r){super(r);this.config=t;this.refetch=t=>new w(this.config,t!=null?t:this.config.initialParams,1)}},P=class extends m{constructor(t,r){super(r);this.config=t;this.retry=t=>new w(this.config,t!=null?t:this.config.initialParams,1)}},O=class extends m{constructor(t){super({status:"canceled"});this.config=t;this.refetch=t=>new w(this.config,t!=null?t:this.config.initialParams,1)}};function nn(e){return new S(e)}function U(e,n){let t={...e.context,...n.context},r={...e},a={...n};delete r.context,delete a.context;let o={};for(let i in r){let s=r[i];o[i]=(...d)=>{let c=s.apply(e.context,d);return U(c,n)}}for(let i in a){let s=a[i];o[i]=(...d)=>{let c=s.apply(n.context,d);return U(e,c)}}return{context:t,...o}}var L=Symbol("CANCEL");function g(e,n,t={}){let{continueOnError:r=!1,logErrors:a=!0,onError:o}=t,i={...e};for(let s in e)Object.prototype.hasOwnProperty.call(e,s)&&s!=="context"&&typeof e[s]!="function"&&(i[s]=e[s]);for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;let d=e[s];typeof d=="function"&&s!=="context"&&(i[s]=function(...c){let y=s,l=i.context,M=()=>{let u;try{u=d.apply(this,c)}catch(h){if(n.error)try{n.error({transitionName:y,context:l,args:[...c],error:h})}catch(f){if(!r)throw f;a&&console.error(`Middleware error hook error for ${y}:`,f),o==null||o(f,"error",{transitionName:y,context:l,args:c,error:h})}throw h}let x=h=>{if(h&&typeof h=="object"&&h.context){for(let f in i)Object.prototype.hasOwnProperty.call(i,f)&&f!=="context"&&!(f in h)&&(h[f]=i[f]);for(let f in h){if(!Object.prototype.hasOwnProperty.call(h,f))continue;typeof h[f]=="function"&&f!=="context"&&i[f]&&(h[f]=i[f])}}return h};if(u&&typeof u.then=="function")return u.then(f=>{if(x(f),n.after)try{let C=n.after({transitionName:y,prevContext:l,nextContext:f.context,args:[...c]});if(C&&typeof C.then=="function")return C.then(()=>f)}catch(C){if(!r)throw C;a&&console.error(`Middleware after hook error for ${y}:`,C),o==null||o(C,"after",{transitionName:y,prevContext:l,nextContext:f.context,args:c})}return f});if(x(u),n.after)try{let h=n.after({transitionName:y,prevContext:l,nextContext:u.context,args:[...c]});if(h&&typeof h=="object"&&h&&"then"in h)return h.then(()=>u).catch(f=>{if(!r)throw f;return a&&console.error(`Middleware after hook error for ${y}:`,f),o==null||o(f,"after",{transitionName:y,prevContext:l,nextContext:u.context,args:c}),u})}catch(h){if(!r)throw h;a&&console.error(`Middleware after hook error for ${y}:`,h),o==null||o(h,"after",{transitionName:y,prevContext:l,nextContext:u.context,args:c})}return u};if(n.before)try{let u=n.before({transitionName:y,context:l,args:[...c]});if(u&&typeof u=="object"&&u&&"then"in u)return u.then(x=>x===L?i:M()).catch(x=>{if(!r)throw x;return a&&console.error(`Middleware before hook error for ${y}:`,x),o==null||o(x,"before",{transitionName:y,context:l,args:c}),M()});if(u===L)return i}catch(u){if(!r)throw u;a&&console.error(`Middleware before hook error for ${y}:`,u),o==null||o(u,"before",{transitionName:y,context:l,args:c})}return M()})}return i}function q(e,n={}){let{logger:t=console.log,includeArgs:r=!1,includeContext:a=!0}=n;return g(e,{before:({transitionName:o,args:i})=>{let s=r?`→ ${o} [${i.join(", ")}]`:`→ ${o}`;t(s)},after:({transitionName:o,nextContext:i})=>{let s=a?` ${JSON.stringify(i)}`:"";t(`✓ ${o}${s}`)},error:({transitionName:o,error:i})=>{console.error(`[Machine] ${o} failed:`,i)}})}function J(e,n,t={}){let{eventPrefix:r="state_transition",includePrevContext:a=!1,includeArgs:o=!1}=t;return g(e,{after:({transitionName:i,prevContext:s,nextContext:d,args:c})=>{let y=`${r}.${i}`,l={transition:i};a&&(l.from=s),l.to=d,o&&(l.args=c),n(y,l)}})}function Y(e,n){return g(e,{before:t=>{if(n(t)===!1)throw new Error(`Validation failed for transition: ${t.transitionName}`)}})}function Q(e,n){return g(e,{before:t=>{if(!n(t))throw new Error(`Unauthorized transition: ${t.transitionName}`)}})}function X(e,n,t={}){let{includeArgs:r=!1}=t;return g(e,{error:a=>{let o={transition:a.transitionName,context:a.context,...r&&{args:a.args}};n(a.error,o)}})}function Z(e,n){let t=new Map;return g(e,{before:r=>{t.set(r.transitionName,Date.now())},after:r=>{let a=t.get(r.transitionName);if(a){let o=Date.now()-a;t.delete(r.transitionName);let i={transitionName:r.transitionName,duration:o,context:r.nextContext||r.prevContext};n(i)}}})}function ee(e,n={}){var d,c;let{maxAttempts:t=(d=n.maxRetries)!=null?d:3,shouldRetry:r=()=>!0,backoffMs:a=(c=n.delay)!=null?c:100,backoffMultiplier:o=2,onRetry:i}=n,s={...e};for(let y in e){if(!Object.prototype.hasOwnProperty.call(e,y))continue;let l=e[y];typeof l=="function"&&y!=="context"&&(s[y]=async function(...M){let u,x=0;for(;x<t;)try{return await l.apply(this,M)}catch(h){if(u=h,x++,x<t&&r(u,x)){i==null||i(u,x);let C=(typeof a=="function"?a(x):a)*Math.pow(o,x-1);await new Promise(T=>setTimeout(T,C))}else throw u}throw u})}return s}function rn(e,n){return t=>g(t,e,n)}function k(e,n={}){let{maxSize:t,serializer:r,onEntry:a}=n,o=[],i=0,s=g(e,{before:({transitionName:d,args:c})=>{let y={id:`entry-${i++}`,transitionName:d,args:[...c],timestamp:Date.now()};if(r)try{y.serializedArgs=r.serialize(c)}catch(l){console.error("Failed to serialize history args:",l)}o.push(y),t&&o.length>t&&o.shift(),a==null||a(y)}});return Object.assign(s,{history:o,clearHistory:()=>{o.length=0,i=0}})}function B(e,n={}){let{maxSize:t,serializer:r,captureSnapshot:a,onlyOnChange:o=!1}=n,i=[],s=0,d=g(e,{after:({transitionName:y,prevContext:l,nextContext:M})=>{if(o&&JSON.stringify(l)===JSON.stringify(M))return;let u={id:`snapshot-${s++}`,transitionName:y,before:{...l},after:{...M},timestamp:Date.now()};if(r)try{u.serializedBefore=r.serialize(l),u.serializedAfter=r.serialize(M)}catch(x){console.error("Failed to serialize snapshot:",x)}if(a)try{u.diff=a(l,M)}catch(x){console.error("Failed to capture snapshot:",x)}i.push(u),t&&i.length>t&&i.shift()}});return Object.assign(d,{snapshots:i,clearSnapshots:()=>{i.length=0,s=0},restoreSnapshot:y=>{let l=Object.fromEntries(Object.entries(e).filter(([M])=>M!=="context"&&M!=="snapshots"&&M!=="clearSnapshots"&&M!=="restoreSnapshot"&&typeof e[M]=="function"));return Object.assign({context:y},l)}})}function N(e,n={}){let{maxSize:t,serializer:r,onRecord:a}=n,o=[],i=[],s=0,d=0,c=g(e,{before:({transitionName:M,args:u})=>{let x={id:`entry-${s++}`,transitionName:M,args:[...u],timestamp:Date.now()};if(r)try{x.serializedArgs=r.serialize(u)}catch(h){console.error("Failed to serialize history args:",h)}o.push(x),t&&o.length>t&&o.shift(),a==null||a("history",x)},after:({transitionName:M,prevContext:u,nextContext:x})=>{let h={id:`snapshot-${d++}`,transitionName:M,before:{...u},after:{...x},timestamp:Date.now()};if(r)try{h.serializedBefore=r.serialize(u),h.serializedAfter=r.serialize(x)}catch(f){console.error("Failed to serialize snapshot:",f)}i.push(h),t&&i.length>t&&i.shift(),a==null||a("snapshot",h)}});return Object.assign(c,{history:o,snapshots:i,clearHistory:()=>{o.length=0,s=0},clearSnapshots:()=>{i.length=0,d=0},clearTimeTravel:()=>{o.length=0,i.length=0,s=0,d=0},restoreSnapshot:M=>{let u=Object.fromEntries(Object.entries(e).filter(([x])=>x!=="context"&&x!=="history"&&x!=="snapshots"&&x!=="clearHistory"&&x!=="clearSnapshots"&&x!=="restoreSnapshot"&&x!=="clearTimeTravel"&&x!=="replayFrom"&&typeof e[x]=="function"));return Object.assign({context:M},u)},replayFrom:M=>{var C;if(M<0||M>=o.length)throw new Error(`Invalid replay start index: ${M}`);let u=(C=i[M])==null?void 0:C.before;if(!u)throw new Error(`No snapshot available for index ${M}`);let x=o.slice(M),f=Object.assign({context:u},Object.fromEntries(Object.entries(e).filter(([T])=>T!=="context"&&typeof e[T]=="function")));for(let T of x){let G=f[T.transitionName];G&&(f=G.apply(f.context,T.args))}return f}})}function fn(e,...n){return n.reduce((t,r)=>r(t),e)}function K(e,...n){return n.reduce((t,r)=>r(t),e)}var _=class e{constructor(n){this.machine=n}with(n){let t=n(this.machine);return new e(t)}build(){return this.machine}};function pn(e){return new _(e)}function z(e,n){let t=function(r){return n(r)?e(r):r};return t.middleware=e,t.when=n,t}function Cn(e){return z(e,()=>typeof process!="undefined"?!1:typeof window!="undefined"?!window.location.hostname.includes("production"):!1)}function gn(e,n,t){return z(t,r=>r.context[e]===n)}function mn(){let e=new Map;return{register(n,t,r,a){if(e.has(n))throw new Error(`Middleware '${n}' is already registered`);return e.set(n,{name:n,middleware:t,description:r,priority:a}),this},unregister(n){return e.delete(n)},has(n){return e.has(n)},get(n){return e.get(n)},list(){return Array.from(e.values()).sort((n,t)=>{var r,a;return((r=n.priority)!=null?r:0)-((a=t.priority)!=null?a:0)})},apply(n,t){let r=t.map(a=>{let o=e.get(a);if(!o)throw new Error(`Middleware '${a}' is not registered`);return o}).sort((a,o)=>{var i,s;return((i=a.priority)!=null?i:0)-((s=o.priority)!=null?s:0)});return K(n,...r.map(a=>a.middleware))},applyAll(n){let t=this.list();return K(n,...t.map(r=>r.middleware))}}}function Tn(e={}){let{continueOnError:n=!1,logErrors:t=!0,onError:r}=e;return(a,...o)=>{let i=a,s=[],d=!0;for(let c=0;c<o.length;c++){let y=o[c];try{if("middleware"in y&&"when"in y){if(!y.when(i))continue;i=y.middleware(i)}else i=y(i)}catch(l){if(d=!1,!n)throw l;s.push({error:l,middlewareIndex:c,middlewareName:y.name}),t&&console.error(`Pipeline middleware error at index ${c}:`,l),r==null||r(l,c,y.name)}}return{machine:i,errors:s,success:d}}}function bn(...e){return n=>K(n,...e)}function wn(e,n){return t=>{for(let[r,a]of e)if(r(t))return a(t);return n?n(t):t}}function ne(e){return typeof e=="function"&&e.length===1}function En(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&"middleware"in e&&"when"in e&&ne(e.middleware)&&typeof e.when=="function"}function Fn(e,n){return e!==null&&typeof e=="object"&&"transitionName"in e&&"prevContext"in e&&"nextContext"in e&&"args"in e&&typeof e.transitionName=="string"&&Array.isArray(e.args)&&(!n||F(e.prevContext,n)&&F(e.nextContext,n))}function An(e,n){return e!==null&&typeof e=="object"&&"transitionName"in e&&"context"in e&&"args"in e&&typeof e.transitionName=="string"&&Array.isArray(e.args)&&(!n||F(e.context,n))}function Rn(e,n){return e!==null&&typeof e=="object"&&"transitionName"in e&&"context"in e&&"args"in e&&"error"in e&&typeof e.transitionName=="string"&&Array.isArray(e.args)&&e.error instanceof Error&&(!n||F(e.context,n))}function Sn(e,n){if(e===null||typeof e!="object")return!1;let t=e;return!("before"in t&&t.before!==void 0&&typeof t.before!="function"||"after"in t&&t.after!==void 0&&typeof t.after!="function"||"error"in t&&t.error!==void 0&&typeof t.error!="function")}function jn(e){return e===void 0||e!==null&&typeof e=="object"&&("continueOnError"in e?typeof e.continueOnError=="boolean":!0)&&("logErrors"in e?typeof e.logErrors=="boolean":!0)&&("onError"in e?typeof e.onError=="function"||e.onError===void 0:!0)}function F(e,n){return e!==null&&typeof e=="object"}function vn(e){return e!==null&&typeof e=="object"&&"name"in e&&"middleware"in e&&typeof e.name=="string"&&ne(e.middleware)&&("description"in e?typeof e.description=="string"||e.description===void 0:!0)&&("priority"in e?typeof e.priority=="number"||e.priority===void 0:!0)}function Pn(e){return e===void 0||e!==null&&typeof e=="object"&&("continueOnError"in e?typeof e.continueOnError=="boolean":!0)&&("logErrors"in e?typeof e.logErrors=="boolean":!0)&&("onError"in e?typeof e.onError=="function"||e.onError===void 0:!0)}var H=class{constructor(n){this.machine=n;this.middlewares=[]}withLogging(n){return this.middlewares.push(t=>q(t,n)),this}withAnalytics(n,t){return this.middlewares.push(r=>J(r,n,t)),this}withValidation(n,t){return this.middlewares.push(r=>Y(r,n)),this}withPermissions(n){return this.middlewares.push(t=>Q(t,n)),this}withErrorReporting(n,t){return this.middlewares.push(r=>X(r,n,t)),this}withPerformanceMonitoring(n,t){return this.middlewares.push(r=>Z(r,n)),this}withRetry(n){return this.middlewares.push(t=>ee(t,n)),this}withHistory(n){return this.middlewares.push(t=>k(t,n)),this}withSnapshot(n){return this.middlewares.push(t=>B(t,n)),this}withTimeTravel(n){return this.middlewares.push(t=>N(t,n)),this}withDebugging(){return this.middlewares.push(n=>Fe(n)),this}withCustom(n){return this.middlewares.push(n),this}withConditional(n,t){return this.middlewares.push(z(n,t)),this}build(){let n=this.machine;for(let t of this.middlewares)n=t(n);return n}getChain(){return[...this.middlewares]}clear(){return this.middlewares=[],this}};function Ee(e){return new H(e)}function On(e={}){return{create:n=>{let t=Ee(n);return e.logging&&t.withLogging(e.logging),e.analytics&&t.withAnalytics(e.analytics.track,e.analytics.options),e.history&&t.withHistory(e.history),e.snapshot&&t.withSnapshot(e.snapshot),e.timeTravel&&t.withTimeTravel(e.timeTravel),e.retry&&t.withRetry(e.retry),t}}}function Fe(e){return N(B(k(e)))}function Ae(e,n){return e instanceof n}function Re(e,...n){return{type:e,args:n}}function Se(e,n){return E(e,t=>({...t,...n}))}async function je(e,...n){let t=e;for(let r of n)t=await r(t);return t}function ve(e,n){return n?console.log(n,e.context):console.log(e.context),e}function Pe(e,n){return function(...t){let r=n(this.context,...t);return p(r,e())}}function Oe(e,n,...t){return e.apply(n,t)}function te(e){return new Proxy(e,{get(n,t){let r=n[t];return typeof r=="function"?function(...a){let o=r.apply(n.context,a);return o&&typeof o=="object"&&"context"in o?te(o):o}:r}})}var W=class e{constructor(n){return this.wrappedMachine=n,new Proxy(this,{get:(t,r)=>{if(r==="wrappedMachine")return Reflect.get(t,r);if(r==="context")return this.wrappedMachine.context;let a=this.wrappedMachine[r];return typeof a=="function"?(...o)=>{let i=a.apply(this.wrappedMachine.context,o);return i&&typeof i=="object"&&"context"in i?new e(i):i}:a}})}};function ke(){return function(n){return function(...t){let r=n(this.context,...t);return p(r,this)}}}function re(e){return{machine:e,addTransition:function(n,t){let r=function(...o){let i=t(this.context,...o);return p(i,this)},a=oe(e,{[n]:r});return re(a)}}}function ae(e){return function(t){let r={},a=Object.fromEntries(Object.entries(t).map(([o,i])=>[o,function(...s){let d=i(this.context,...s);return p(d,r)}]));return Object.assign(r,a),p(e,r)}}function Be(e,n){return n!==void 0?p(e,n):ae(e)}function Ne(...e){let n=new Map;for(let[s,d,c]of e){if(n.has(s))throw new Error(`Duplicate matcher case name: "${s}"`);n.set(s,{predicate:c})}let t=new Proxy({},{get(s,d){return function(y){let l=n.get(d);if(!l){let M=Array.from(n.keys()).join(", ");throw new Error(`Unknown matcher case: "${d}". Available cases: ${M}`)}return l.predicate(y)}}}),r=new Proxy({},{get(s,d){return function(y){if(!n.has(d)){let l=Array.from(n.keys()).join(", ");throw new Error(`Unknown matcher case: "${d}". Available cases: ${l}`)}return{__brand:"CaseHandler",__name:d,__machine:void 0,__return:void 0,handler:y}}}}),a={__exhaustive:!0};function o(s){return{is(...d){if(d.length===0)throw new Error("Pattern match requires at least one handler and exhaustiveness marker");let c=d[d.length-1];if(!c||typeof c!="object"||!("__exhaustive"in c))throw new Error("Pattern match must end with match.exhaustive for compile-time exhaustiveness checking");let y=d.slice(0,-1);for(let u of y){let x=u.__name,h=n.get(x);if(!h)throw new Error(`Internal error: Unknown matcher case in handler: ${x}`);if(h.predicate(s))return u.handler(s)}let l=y.map(u=>u.__name).join(", "),M=Array.from(n.keys()).join(", ");throw new Error(`Non-exhaustive pattern match at runtime: no handler matched the machine.
|
|
2
|
+
Handled cases: [${l}]
|
|
3
|
+
All cases: [${M}]
|
|
4
|
+
This may occur if predicates don't cover all runtime possibilities.`)}}}function i(s){for(let[d,c,y]of e)if(y(s))return d;return null}return Object.assign(i,{is:t,when:o,case:r,exhaustive:a})}function Ke(e,n){return[e,void 0,t=>t instanceof n]}function _e(e,n,t){return[e,void 0,r=>$(r,n,t)]}function He(e,n){return[e,void 0,n]}function ze(){return{case(e,n,t){return[e,void 0,r=>$(r,n,t)]}}}function p(e,n){if(typeof n=="function"){let a;a=n(s=>{let d=p(s,a),c=Object.fromEntries(Object.entries(a).map(([y,l])=>[y,l.bind(s)]));return Object.assign(d,c)});let i=Object.fromEntries(Object.entries(a).map(([s,d])=>[s,d.bind(e)]));return Object.assign({context:e},i)}let t="context"in n?Object.fromEntries(Object.entries(n).filter(([a])=>a!=="context")):n;return Object.assign({context:e},t)}function We(e,n){if(typeof n=="function"){let a;a=n(s=>{let d=We(s,a),c=Object.fromEntries(Object.entries(a).map(([y,l])=>[y,l.bind(s)]));return Object.assign(d,c)});let i=Object.fromEntries(Object.entries(a).map(([s,d])=>[s,d.bind(e)]));return Object.assign({context:e},i)}let t="context"in n?Object.fromEntries(Object.entries(n).filter(([a])=>a!=="context")):n;return Object.assign({context:e},t)}function Jn(){return e=>{let n=Object.fromEntries(Object.entries(e).map(([t,r])=>[t,function(...a){let o=r(this.context,...a);return p(o,n)}]));return t=>p(t,n)}}function E(e,n){let{context:t,...r}=e,a=typeof n=="function"?n(t):n;return p(a,r)}function Yn(e){return{context:e}}function Qn(e,n){let{context:t,...r}=e,a={...r,...n};return p(t,a)}function oe(e,n){let{context:t,...r}=e,a={...r,...n};return p(t,a)}function Xn(e,n){return(...t)=>{let r=e(...t),a=n(),o={...r.context,...a.context},{context:i,...s}=r,{context:d,...c}=a,y={...s,...c};return p(o,y)}}function Zn(e){let{context:n,...t}=e;return r=>p(r,t)}function et(e,n,t){let r=e.context[n],a=t[r];if(!a)throw new Error(`No handler found for state: ${String(r)}`);return a(e.context)}function $(e,n,t){return e.context[n]===t}function nt(e,n){let t=e,r=null;async function a(o){r&&(r.abort(),r=null);let i=t[o.type];if(typeof i!="function")throw new Error(`[Machine] Unknown event type '${String(o.type)}' on current state.`);let s=new AbortController;r=s;try{let c=await i.apply(t.context,[...o.args,{signal:s.signal}]);return s.signal.aborted||(t=c,n==null||n(t)),t}finally{r===s&&(r=null)}}return{get state(){return t.context},dispatch:a,stop:()=>{r&&(r.abort(),r=null)}}}var m=class{constructor(n){this.context=n}};function tt(e,n){let{context:t,...r}=e;return p(n(t),r)}export{W as BoundMachine,L as CANCEL,Me as META_KEY,m as MachineBase,H as MiddlewareBuilder,V as MultiMachineBase,Ce as action,te as bindTransitions,wn as branch,Oe as call,pn as chain,Ke as classCase,bn as combine,Xn as combineFactories,fn as compose,K as composeTyped,We as createAsyncMachine,Yn as createContext,rn as createCustomMiddleware,we as createEnsemble,De as createEnsembleFactory,Re as createEvent,nn as createFetchMachine,de as createFlow,ae as createFunctionalMachine,p as createMachine,Zn as createMachineBuilder,Jn as createMachineFactory,Ne as createMatcher,g as createMiddleware,On as createMiddlewareFactory,mn as createMiddlewareRegistry,Ue as createMultiMachine,Le as createMutableMachine,U as createParallelMachine,Tn as createPipeline,be as createRunner,Pe as createTransition,re as createTransitionExtender,ke as createTransitionFactory,He as customCase,Ze as delegateToChild,he as describe,_e as discriminantCase,oe as extendTransitions,ze as forContext,A as guard,R as guardAsync,fe as guarded,$ as hasState,Cn as inDevelopment,pe as invoke,En as isConditionalMiddleware,An as isMiddlewareContext,Rn as isMiddlewareError,ne as isMiddlewareFn,Sn as isMiddlewareHooks,jn as isMiddlewareOptions,Fn as isMiddlewareResult,vn as isNamedMiddleware,Pn as isPipelineConfig,Ae as isState,ve as logState,et as matchMachine,Se as mergeContext,Te as metadata,Ee as middlewareBuilder,tt as next,Qn as overrideTransitions,je as pipeTransitions,D as run,le as runAsync,nt as runMachine,ce as runSequence,ye as runWithDebug,Ve as runWithEnsemble,Ie as runWithRunner,E as setContext,Be as state,ie as step,ue as stepAsync,en as toggle,xe as transitionTo,z as when,gn as whenContext,ge as whenGuard,me as whenGuardAsync,J as withAnalytics,Fe as withDebugging,X as withErrorReporting,k as withHistory,q as withLogging,Z as withPerformanceMonitoring,Q as withPermissions,ee as withRetry,B as withSnapshot,N as withTimeTravel,Y as withValidation,se as yieldMachine};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -293,7 +293,7 @@ export type BindTransitions<T> = {
|
|
|
293
293
|
* @param factory - A function that receives a `transition` helper and returns the transitions object.
|
|
294
294
|
* @returns A new machine instance.
|
|
295
295
|
*/
|
|
296
|
-
export declare function createMachine<C extends object, T extends Record<string, (this: C, ...args: any[]) => any>>(context: C, factory: (transition: (newContext: C) => Machine<C, any>) => T): Machine<C, BindTransitions<T>>;
|
|
296
|
+
export declare function createMachine<C extends object, T extends Record<string, (this: C, ...args: any[]) => any> = Record<string, (this: C, ...args: any[]) => any>>(context: C, factory: (transition: (newContext: C) => Machine<C, any>) => T): Machine<C, BindTransitions<T>>;
|
|
297
297
|
/**
|
|
298
298
|
* Creates a synchronous state machine from a context and transition functions.
|
|
299
299
|
* This is the core factory for the functional approach.
|
|
@@ -391,6 +391,38 @@ export declare function createMachineFactory<C extends object>(): <T extends Rec
|
|
|
391
391
|
* @returns A new machine instance of the same type with the updated context.
|
|
392
392
|
*/
|
|
393
393
|
export declare function setContext<M extends Machine<any>>(machine: M, newContextOrFn: Context<M> | ((ctx: Readonly<Context<M>>) => Context<M>)): M;
|
|
394
|
+
/**
|
|
395
|
+
* Creates a minimal machine-like object with just a context property.
|
|
396
|
+
* Useful for creating test fixtures and working with pattern matching utilities.
|
|
397
|
+
*
|
|
398
|
+
* @template C - The context type
|
|
399
|
+
* @param context - The context object
|
|
400
|
+
* @returns An object with a readonly context property
|
|
401
|
+
*
|
|
402
|
+
* @example
|
|
403
|
+
* ```typescript
|
|
404
|
+
* // For testing with discriminated unions
|
|
405
|
+
* type FetchContext =
|
|
406
|
+
* | { status: 'idle' }
|
|
407
|
+
* | { status: 'success'; data: string };
|
|
408
|
+
*
|
|
409
|
+
* const idleMachine = createContext<FetchContext>({ status: 'idle' });
|
|
410
|
+
* const successMachine = createContext<FetchContext>({ status: 'success', data: 'result' });
|
|
411
|
+
*
|
|
412
|
+
* // Works with pattern matching
|
|
413
|
+
* const match = createMatcher(
|
|
414
|
+
* discriminantCase('idle', 'status', 'idle'),
|
|
415
|
+
* discriminantCase('success', 'status', 'success')
|
|
416
|
+
* );
|
|
417
|
+
*
|
|
418
|
+
* if (match.is.success(successMachine)) {
|
|
419
|
+
* console.log(successMachine.context.data); // TypeScript knows data exists
|
|
420
|
+
* }
|
|
421
|
+
* ```
|
|
422
|
+
*/
|
|
423
|
+
export declare function createContext<C extends object>(context: C): {
|
|
424
|
+
readonly context: C;
|
|
425
|
+
};
|
|
394
426
|
/**
|
|
395
427
|
* Creates a new machine by overriding or adding transition functions to an existing machine.
|
|
396
428
|
* Ideal for mocking in tests or decorating functionality. The original machine is unchanged.
|
|
@@ -498,7 +530,8 @@ export declare function matchMachine<M extends Machine<any>, K extends keyof Con
|
|
|
498
530
|
}): R;
|
|
499
531
|
/**
|
|
500
532
|
* Type-safe helper to assert that a machine's context has a specific discriminant value.
|
|
501
|
-
* This narrows the type of the context based on the discriminant
|
|
533
|
+
* This narrows the type of the context based on the discriminant, properly handling
|
|
534
|
+
* discriminated unions.
|
|
502
535
|
*
|
|
503
536
|
* @template M - The machine type.
|
|
504
537
|
* @template K - The discriminant key.
|
|
@@ -509,14 +542,18 @@ export declare function matchMachine<M extends Machine<any>, K extends keyof Con
|
|
|
509
542
|
* @returns True if the discriminant matches, with type narrowing.
|
|
510
543
|
*
|
|
511
544
|
* @example
|
|
512
|
-
*
|
|
513
|
-
*
|
|
545
|
+
* type Context = { status: 'idle' } | { status: 'loading' } | { status: 'success'; data: string };
|
|
546
|
+
* const machine = createMachine<Context>({ status: 'success', data: 'test' }, {});
|
|
547
|
+
*
|
|
548
|
+
* if (hasState(machine, 'status', 'success')) {
|
|
549
|
+
* // machine.context is narrowed to { status: 'success'; data: string }
|
|
550
|
+
* console.log(machine.context.data); // ✓ TypeScript knows about 'data'
|
|
514
551
|
* }
|
|
515
552
|
*/
|
|
516
553
|
export declare function hasState<M extends Machine<any>, K extends keyof Context<M>, V extends Context<M>[K]>(machine: M, key: K, value: V): machine is M & {
|
|
517
|
-
context: Context<M
|
|
554
|
+
context: Extract<Context<M>, {
|
|
518
555
|
[P in K]: V;
|
|
519
|
-
}
|
|
556
|
+
}>;
|
|
520
557
|
};
|
|
521
558
|
/**
|
|
522
559
|
* Runs an asynchronous state machine with a managed lifecycle and event dispatch capability.
|
|
@@ -634,11 +671,11 @@ export type MachineLike<C extends object> = Machine<C> | Promise<Machine<C>>;
|
|
|
634
671
|
export type MachineResult<C extends object> = Machine<C> | [Machine<C>, () => void | Promise<void>];
|
|
635
672
|
export { run, step, yieldMachine, runSequence, createFlow, runWithDebug, runAsync, stepAsync } from './generators';
|
|
636
673
|
export { transitionTo, describe, guarded, guard, guardAsync, whenGuard, whenGuardAsync, invoke, action, metadata, META_KEY, type TransitionMeta, type GuardMeta, type InvokeMeta, type ActionMeta, type ClassConstructor, type WithMeta, type GuardOptions, type GuardFallback, type GuardedTransition } from './primitives';
|
|
637
|
-
export type { MachineConfig, ExtractionConfig } from './extract';
|
|
674
|
+
export type { MachineConfig, ExtractionConfig, ParallelRegionConfig, ChildStatesConfig } from './extract';
|
|
638
675
|
export * from './multi';
|
|
639
676
|
export * from './higher-order';
|
|
640
|
-
export * from './extract';
|
|
641
677
|
export * from './middleware/index';
|
|
642
678
|
export { isState, createEvent, createTransition, mergeContext, pipeTransitions, logState, call, bindTransitions, BoundMachine } from './utils';
|
|
643
679
|
export { createTransitionFactory, createTransitionExtender, createFunctionalMachine, state } from './functional-combinators';
|
|
680
|
+
export { createMatcher, classCase, discriminantCase, customCase, forContext, type MatcherCase, type CasesToMapping, type MatcherUnion, type CaseNames, type CaseHandler, type ExhaustivenessMarker, type IsExhaustive, type WhenBuilder, type Matcher } from './matcher';
|
|
644
681
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;;GAGG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAE7C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,OAAO,CACjB,CAAC,SAAS,MAAM,EAChB,CAAC,SAAS,MAAM,GAAG,EAAE,IACnB;IACF,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;CACrB,GAAG,CAAC,CAAC;AAEN;;;;GAIG;AACH,MAAM,MAAM,YAAY,CACtB,CAAC,SAAS,MAAM,EAChB,CAAC,SAAS,MAAM,GAAG,EAAE,IACnB;IACF,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;CACrB,GAAG,CAAC,CAAC;AAEN;;;GAGG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,IAC1F,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,KAAK,GAAG,GACjC,CAAC,SAAS,CAAC,GAAG,MAAM,IAAI,EAAE,iBAAiB,CAAC,GAAG,IAAI,GAAG,CAAC,GACvD,KAAK,CAAC;AAEV;;;;;GAKG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,GAAG,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAE/E;;;;GAIG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,GAAG,EAAE,IAAI,YAAY,CAAC,CAAC,EAAE,CAAC,C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