text: !function(t){var e={};function n(i){if(e[i])return e[i].exports;var s=e[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)n.d(i,s,function(e){return t[e]}.bind(null,s));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}([function(t,e){t.exports=((t,e,n)=>{const i={};return Object.keys(e).filter(n(t,e)).forEach(n=>i[n]=e[n](t)),i})},function(t,e){t.exports=function(t,e,n,i=(t=>console.log(t)),s=(t=>t)){this.agents={},t.forEach(t=>this.agents[t.id]=t),this.state=e,this.update=n,this.render=i,this.stateFilter=s,this.history=[],this.reset=(()=>this.history=[]),this.run=(t=>{this.history.push(this.state);const e=()=>{Object.keys(this.agents).forEach(t=>{const e=this.agents[t].next(this.stateFilter(this.state,t,this.agents[t].beliefs)),n=this.update(e,t,this.state);this.state={...this.state,...n}}),this.history.push(this.state),this.render(this.state)};if(t)Array(t).fill(0).forEach(e);else for(;;)e();return this.history})}},function(t,e,n){JSson={Belief:n(3),Desire:n(4),Intentions:n(0),Plan:n(5),Agent:n(6),Environment:n(1),GridWorld:n(7),FieldType:n(8)},t.exports=JSson},function(t,e){const n="JS-son: Created belief with non-JSON object, non-JSON data type value";t.exports=((t,e)=>{const i={};i[t]=e;try{const t=JSON.parse(JSON.stringify(i));Object.keys(t).length!==Object.keys(i).length&&console.warn(n)}catch(t){console.warn(n)}return i})},function(t,e){t.exports=((t,e)=>{"function"!=typeof e&&console.warn("JS-son: desire body should be a function");const n={};return n[t]=e,n})},function(t,e){t.exports=((t,e)=>({head:t,body:e,run:n=>!0===t(n)?e(n):null}))},function(t,e,n){const i=n(0);t.exports=function(t,e,n,s,r=((t,e)=>n=>e[n](t))){this.id=t,this.beliefs=e,this.desires=n,this.plans=s,this.preferenceFunction=r,this.isActive=!0,this.next=function(t){if(this.beliefs={...this.beliefs,...t},this.isActive)return 0===Object.keys(n).length?this.intentions=this.beliefs:this.intentions=i(this.beliefs,this.desires,this.preferenceFunction),this.plans.map(t=>t.run(this.intentions)).filter(t=>null!==t)},this.stop=(()=>this.isActive=!1),this.start=(()=>this.isActive=!0)}},function(t,e,n){const i=n(1);t.exports=function(t,e,n,s=(t=>t)){return new i(t,e,(t,i,s)=>((t,e,n,i)=>{const s=n.positions[e];if(s){const r=i[n.fields[s]];return{...n,...r.trigger(t,e,n,s)}}return n})(t,i,e,n),t=>((t,e)=>"undefined"==typeof window?((t,e)=>[].concat("****",t.fields.map((n,i)=>{let s="";return i%t.dimensions[0]==0&&(s+="\r\n"),s+=e[n].render(t,i,!1)}),"\r\n****").join(""))(t,e):((t,e)=>[].concat("<table>",t.fields.map((n,i)=>{let s="";return i%t.dimensions[0]==0&&(s+="<tr>"),s+=e[n].render(t,i),i%t.dimensions[0]==t.dimensions[0]-1&&(s+="</tr>"),s}),"</table>").join(""))(t,e))(t,n),s)}},function(t,e){t.exports=((t,e,n,i,s=(()=>""))=>({id:t,render:(t,i,r=!0)=>r?`<td class="${e(t,i)}">${s(t,i)}</td>`:n(t,i),trigger:(t,e,n,s)=>i(t,e,n,s)}))}]);