1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950open!CoreopenBonsai_web_procmoduleInterpreter=structtype('value,'action,'context)t=value:'value->context:'context->'action->unitEffect.tendmoduleInput=structtype('value,'context)t={value:'value;context:'context}endtype('value,'action)t={value:'value;run_action:'action->unitEffect.t}letcomponent~interpret~input=letopenBonsai.Let_syntaxinlet%subInput.{value;context=_},run_action=Bonsai.wrap()~equal:[%equal:Unit.t]~default_model:()~apply_action:(funapply_action_contextresult()action->matchresultwith|Inactive->eprint_s[%message"An action sent to a [wrap] has been dropped because its input was not \
present. This happens when the [wrap] is inactive when it receives a \
message."[%here]];()|Active(Input.{value;context},_)->Bonsai.Apply_action_context.schedule_eventapply_action_context(interpret~value~contextaction))~f:(fun_inject->let%subinput=input~run_action:injectinlet%arrinputandrun_action=injectininput,run_action)inlet%arrvalueandrun_actionin{value;run_action};;