{"size": 80824, "ext": "js", "max_stars_repo_path": "docs/main.js", "max_stars_repo_name": "programmingforthepuzzled/puzzled", "max_stars_repo_stars_event_min_datetime": "2018-09-29T02:04:42.000Z", "max_stars_repo_stars_event_max_datetime": "2018-09-29T02:04:42.000Z", "max_issues_repo_path": "docs/main.js", "max_issues_repo_name": "programmingforthepuzzled/puzzled", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "docs/main.js", "max_forks_repo_name": "programmingforthepuzzled/puzzled", "max_forks_repo_forks_event_min_datetime": "2018-09-19T05:36:14.000Z", "max_forks_repo_forks_event_max_datetime": "2018-09-19T05:36:14.000Z"}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 616.9770992366, "max_line_length": 11846, "alphanum_fraction": 0.7106057607}
parcelRequire=function(e,r,n,t){var i="function"==typeof parcelRequire&&parcelRequire,o="function"==typeof require&&require;function u(n,t){if(!r[n]){if(!e[n]){var f="function"==typeof parcelRequire&&parcelRequire;if(!t&&f)return f(n,!0);if(i)return i(n,!0);if(o&&"string"==typeof n)return o(n);var c=new Error("Cannot find module '"+n+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[n][1][r]||r};var l=r[n]=new u.Module(n);e[n][0].call(l.exports,p,l,l.exports,this)}return r[n].exports;function p(e){return u(p.resolve(e))}}u.isParcelRequire=!0,u.Module=function(e){this.id=e,this.bundle=u,this.exports={}},u.modules=e,u.cache=r,u.parent=i,u.register=function(r,n){e[r]=[function(e,r){r.exports=n},{}]};for(var f=0;f<n.length;f++)u(n[f]);if(n.length){var c=u(n[n.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=c:"function"==typeof define&&define.amd?define(function(){return c}):t&&(this[t]=c)}return u}({"VuXv":[function(require,module,exports) {
var global = arguments[3];
var t=arguments[3];!function(t){"use strict";var r,e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag",u="object"==typeof module,h=t.regeneratorRuntime;if(h)u&&(module.exports=h);else{(h=t.regeneratorRuntime=u?module.exports:{}).wrap=w;var f="suspendedStart",s="suspendedYield",l="executing",p="completed",y={},v={};v[i]=function(){return this};var d=Object.getPrototypeOf,g=d&&d(d(P([])));g&&g!==e&&n.call(g,i)&&(v=g);var m=b.prototype=x.prototype=Object.create(v);E.prototype=m.constructor=b,b.constructor=E,b[c]=E.displayName="GeneratorFunction",h.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===E||"GeneratorFunction"===(r.displayName||r.name))},h.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c in t||(t[c]="GeneratorFunction")),t.prototype=Object.create(m),t},h.awrap=function(t){return{__await:t}},_(j.prototype),j.prototype[a]=function(){return this},h.AsyncIterator=j,h.async=function(t,r,e,n){var o=new j(w(t,r,e,n));return h.isGeneratorFunction(r)?o:o.next().then(function(t){return t.done?t.value:o.next()})},_(m),m[c]="Generator",m[i]=function(){return this},m.toString=function(){return"[object Generator]"},h.keys=function(t){var r=[];for(var e in t)r.push(e);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},h.values=P,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(G),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function o(n,o){return c.type="throw",c.arg=t,e.next=n,o&&(e.method="next",e.arg=r),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),h=n.call(a,"finallyLoc");if(u&&h){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var o=this.tryEntries[e];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=r,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),G(e),y}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;G(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:P(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),y}}}function w(t,r,e,n){var o=r&&r.prototype instanceof x?r:x,i=Object.create(o.prototype),a=new N(n||[]);return i._invoke=function(t,r,e){var n=f;return function(o,i){if(n===l)throw new Error("Generator is already running");if(n===p){if("throw"===o)throw i;return F()}for(e.method=o,e.arg=i;;){var a=e.delegate;if(a){var c=O(a,e);if(c){if(c===y)continue;return c}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if(n===f)throw n=p,e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);n=l;var u=L(t,r,e);if("normal"===u.type){if(n=e.done?p:s,u.arg===y)continue;return{value:u.arg,done:e.done}}"throw"===u.type&&(n=p,e.method="throw",e.arg=u.arg)}}}(t,e,a),i}function L(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}function x(){}function E(){}function b(){}function _(t){["next","throw","return"].forEach(function(r){t[r]=function(t){return this._invoke(r,t)}})}function j(t){var r;this._invoke=function(e,o){function i(){return new Promise(function(r,i){!function r(e,o,i,a){var c=L(t[e],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==typeof h&&n.call(h,"__await")?Promise.resolve(h.__await).then(function(t){r("next",t,i,a)},function(t){r("throw",t,i,a)}):Promise.resolve(h).then(function(t){u.value=t,i(u)},function(t){return r("throw",t,i,a)})}a(c.arg)}(e,o,r,i)})}return r=r?r.then(i,i):i()}}function O(t,e){var n=t.iterator[e.method];if(n===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=r,O(t,e),"throw"===e.method))return y;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var o=L(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,y;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,y):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,y)}function k(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function G(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function P(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function e(){for(;++o<t.length;)if(n.call(t,o))return e.value=t[o],e.done=!1,e;return e.value=r,e.done=!0,e};return a.next=a}}return{next:F}}function F(){return{value:r,done:!0}}}(function(){return this||"object"==typeof self&&self}()||Function("return this")());
},{}],"rgxB":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.codeErrorAlert=function(){alert("Your code has errors. Fix them before continuing.")};
},{}],"UnXq":[function(require,module,exports) {
"use strict";var t=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(u,i){function o(t){try{a(r.next(t))}catch(t){i(t)}}function c(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?u(t.value):new n(function(e){e(t.value)}).then(o,c)}a((r=r.apply(t,e||[])).next())})};function e(e){return t(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(t){return setTimeout(t,e)}));case 1:case"end":return t.stop()}},t,this)}))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"r6/B":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=new Vue({el:"#vue-app-message-display",data:{messages:[]},methods:{typeToClass:function(e){return"has-text-"+e}}}),s=exports.clearMessages=function(){e.messages.splice(0,e.messages.length)},t=exports.addMessage=function(s){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"danger";e.messages.push({text:s,type:t})};
},{}],"zH/Q":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=function(){function t(t,n){for(var r=0;r<n.length;r++){var e=n[r];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}return function(n,r,e){return r&&t(n.prototype,r),e&&t(n,e),n}}(),n=r(["",""],["",""]);function r(t,n){return Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}}))}function e(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}var u=function(){function r(){for(var t=this,n=arguments.length,u=Array(n),o=0;o<n;o++)u[o]=arguments[o];return e(this,r),this.tag=function(n){for(var r=arguments.length,e=Array(r>1?r-1:0),u=1;u<r;u++)e[u-1]=arguments[u];return"function"==typeof n?t.interimTag.bind(t,n):"string"==typeof n?t.transformEndResult(n):(n=n.map(t.transformString.bind(t)),t.transformEndResult(n.reduce(t.processSubstitutions.bind(t,e))))},u.length>0&&Array.isArray(u[0])&&(u=u[0]),this.transformers=u.map(function(t){return"function"==typeof t?t():t}),this.tag}return t(r,[{key:"interimTag",value:function(t,r){for(var e=arguments.length,u=Array(e>2?e-2:0),o=2;o<e;o++)u[o-2]=arguments[o];return this.tag(n,t.apply(void 0,[r].concat(u)))}},{key:"processSubstitutions",value:function(t,n,r){var e=this.transformSubstitution(t.shift(),n);return"".concat(n,e,r)}},{key:"transformString",value:function(t){return this.transformers.reduce(function(t,n){return n.onString?n.onString(t):t},t)}},{key:"transformSubstitution",value:function(t,n){return this.transformers.reduce(function(t,r){return r.onSubstitution?r.onSubstitution(t,n):t},t)}},{key:"transformEndResult",value:function(t){return this.transformers.reduce(function(t,n){return n.onEndResult?n.onEndResult(t):t},t)}}]),r}();exports.default=u;
},{}],"Q/T9":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./TemplateTag"),t=r(e);function r(e){return e&&e.__esModule?e:{default:e}}exports.default=t.default;
},{"./TemplateTag":"zH/Q"}],"POTh":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{onEndResult:function(r){if(""===e)return r.trim();if("start"===(e=e.toLowerCase())||"left"===e)return r.replace(/^\s*/,"");if("end"===e||"right"===e)return r.replace(/\s*$/,"");throw new Error("Side not supported: "+e)}}};exports.default=e;
},{}],"oMaF":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./trimResultTransformer"),r=t(e);function t(e){return e&&e.__esModule?e:{default:e}}exports.default=r.default;
},{"./trimResultTransformer":"POTh"}],"aIss":[function(require,module,exports) {
"use strict";function r(r){if(Array.isArray(r)){for(var n=0,e=Array(r.length);n<r.length;n++)e[n]=r[n];return e}return Array.from(r)}Object.defineProperty(exports,"__esModule",{value:!0});var n=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"initial";return{onEndResult:function(e){if("initial"===n){var t=e.match(/^[^\S\n]*(?=\S)/gm),a=t&&Math.min.apply(Math,r(t.map(function(r){return r.length})));if(a){var i=new RegExp("^.{"+a+"}","gm");return e.replace(i,"")}return e}if("all"===n)return e.replace(/^[^\S\n]+/gm,"");throw new Error("Unknown type: "+n)}}};exports.default=n;
},{}],"wR//":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./stripIndentTransformer"),r=t(e);function t(e){return e&&e.__esModule?e:{default:e}}exports.default=r.default;
},{"./stripIndentTransformer":"aIss"}],"+wXP":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=function(e,r){return{onEndResult:function(t){if(null==e||null==r)throw new Error("replaceResultTransformer requires at least 2 arguments.");return t.replace(e,r)}}};exports.default=e;
},{}],"CaXL":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./replaceResultTransformer"),r=t(e);function t(e){return e&&e.__esModule?e:{default:e}}exports.default=r.default;
},{"./replaceResultTransformer":"+wXP"}],"yRgv":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=function(e,r){return{onSubstitution:function(t,n){if(null==e||null==r)throw new Error("replaceSubstitutionTransformer requires at least 2 arguments.");return null==t?t:t.toString().replace(e,r)}}};exports.default=e;
},{}],"a4QR":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./replaceSubstitutionTransformer"),t=r(e);function r(e){return e&&e.__esModule?e:{default:e}}exports.default=t.default;
},{"./replaceSubstitutionTransformer":"yRgv"}],"fL7M":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=function(r,e){return{onString:function(t){if(null==r||null==e)throw new Error("replaceStringTransformer requires at least 2 arguments.");return t.replace(r,e)}}};exports.default=r;
},{}],"S15p":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./replaceStringTransformer"),r=t(e);function t(e){return e&&e.__esModule?e:{default:e}}exports.default=r.default;
},{"./replaceStringTransformer":"fL7M"}],"T9vP":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r={separator:"",conjunction:"",serial:!1},e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r;return{onSubstitution:function(r,n){if(Array.isArray(r)){var t=r.length,i=e.separator,o=e.conjunction,a=e.serial,s=n.match(/(\n?[^\S\n]+)$/);if(r=s?r.join(i+s[1]):r.join(i+" "),o&&t>1){var u=r.lastIndexOf(i);r=r.slice(0,u)+(a?i:"")+" "+o+r.slice(u+1)}}return r}}};exports.default=e;
},{}],"k2vK":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./inlineArrayTransformer"),r=t(e);function t(e){return e&&e.__esModule?e:{default:e}}exports.default=r.default;
},{"./inlineArrayTransformer":"T9vP"}],"OfC/":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=function(t){return{onSubstitution:function(e,r){if(null==t||"string"!=typeof t)throw new Error("You need to specify a string character to split by.");return"string"==typeof e&&e.includes(t)&&(e=e.split(t)),e}}};exports.default=t;
},{}],"tweT":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./splitStringTransformer"),r=t(e);function t(e){return e&&e.__esModule?e:{default:e}}exports.default=r.default;
},{"./splitStringTransformer":"OfC/"}],"sSuZ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=function(e){return null!=e&&!Number.isNaN(e)&&"boolean"!=typeof e},r=function(){return{onSubstitution:function(r){return Array.isArray(r)?r.filter(e):e(r)?r:""}}};exports.default=r;
},{}],"9MR/":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./removeNonPrintingValuesTransformer"),r=t(e);function t(e){return e&&e.__esModule?e:{default:e}}exports.default=r.default;
},{"./removeNonPrintingValuesTransformer":"sSuZ"}],"ANj+":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../TemplateTag"),r=f(e),t=require("../stripIndentTransformer"),a=f(t),u=require("../inlineArrayTransformer"),l=f(u),n=require("../trimResultTransformer"),s=f(n);function f(e){return e&&e.__esModule?e:{default:e}}var i=new r.default((0,l.default)({separator:","}),a.default,s.default);exports.default=i;
},{"../TemplateTag":"Q/T9","../stripIndentTransformer":"wR//","../inlineArrayTransformer":"k2vK","../trimResultTransformer":"oMaF"}],"zVoE":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./commaLists"),t=r(e);function r(e){return e&&e.__esModule?e:{default:e}}exports.default=t.default;
},{"./commaLists":"ANj+"}],"KTo5":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../TemplateTag"),r=o(e),t=require("../stripIndentTransformer"),a=o(t),u=require("../inlineArrayTransformer"),n=o(u),i=require("../trimResultTransformer"),l=o(i);function o(e){return e&&e.__esModule?e:{default:e}}var s=new r.default((0,n.default)({separator:",",conjunction:"and"}),a.default,l.default);exports.default=s;
},{"../TemplateTag":"Q/T9","../stripIndentTransformer":"wR//","../inlineArrayTransformer":"k2vK","../trimResultTransformer":"oMaF"}],"hUi7":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./commaListsAnd"),t=r(e);function r(e){return e&&e.__esModule?e:{default:e}}exports.default=t.default;
},{"./commaListsAnd":"KTo5"}],"p4N3":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../TemplateTag"),r=l(e),t=require("../stripIndentTransformer"),u=l(t),a=require("../inlineArrayTransformer"),n=l(a),o=require("../trimResultTransformer"),i=l(o);function l(e){return e&&e.__esModule?e:{default:e}}var s=new r.default((0,n.default)({separator:",",conjunction:"or"}),u.default,i.default);exports.default=s;
},{"../TemplateTag":"Q/T9","../stripIndentTransformer":"wR//","../inlineArrayTransformer":"k2vK","../trimResultTransformer":"oMaF"}],"lB9V":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./commaListsOr"),t=r(e);function r(e){return e&&e.__esModule?e:{default:e}}exports.default=t.default;
},{"./commaListsOr":"p4N3"}],"Xu5K":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../TemplateTag"),r=m(e),t=require("../stripIndentTransformer"),u=m(t),a=require("../inlineArrayTransformer"),n=m(a),i=require("../trimResultTransformer"),l=m(i),f=require("../splitStringTransformer"),s=m(f),o=require("../removeNonPrintingValuesTransformer"),d=m(o);function m(e){return e&&e.__esModule?e:{default:e}}var T=new r.default((0,s.default)("\n"),d.default,n.default,u.default,l.default);exports.default=T;
},{"../TemplateTag":"Q/T9","../stripIndentTransformer":"wR//","../inlineArrayTransformer":"k2vK","../trimResultTransformer":"oMaF","../splitStringTransformer":"tweT","../removeNonPrintingValuesTransformer":"9MR/"}],"pG/F":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./html"),t=r(e);function r(e){return e&&e.__esModule?e:{default:e}}exports.default=t.default;
},{"./html":"Xu5K"}],"s4NW":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("../html"),t=r(e);function r(e){return e&&e.__esModule?e:{default:e}}exports.default=t.default;
},{"../html":"pG/F"}],"unBw":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../TemplateTag"),r=g(e),t=require("../stripIndentTransformer"),u=g(t),a=require("../inlineArrayTransformer"),l=g(a),f=require("../trimResultTransformer"),d=g(f),i=require("../splitStringTransformer"),n=g(i),s=require("../replaceSubstitutionTransformer"),o=g(s);function g(e){return e&&e.__esModule?e:{default:e}}var m=new r.default((0,n.default)("\n"),l.default,u.default,d.default,(0,o.default)(/&/g,"&amp;"),(0,o.default)(/</g,"&lt;"),(0,o.default)(/>/g,"&gt;"),(0,o.default)(/"/g,"&quot;"),(0,o.default)(/'/g,"&#x27;"),(0,o.default)(/`/g,"&#x60;"));exports.default=m;
},{"../TemplateTag":"Q/T9","../stripIndentTransformer":"wR//","../inlineArrayTransformer":"k2vK","../trimResultTransformer":"oMaF","../splitStringTransformer":"tweT","../replaceSubstitutionTransformer":"a4QR"}],"8/rC":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./safeHtml"),t=r(e);function r(e){return e&&e.__esModule?e:{default:e}}exports.default=t.default;
},{"./safeHtml":"unBw"}],"Po01":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../TemplateTag"),r=s(e),t=require("../trimResultTransformer"),u=s(t),a=require("../replaceResultTransformer"),l=s(a);function s(e){return e&&e.__esModule?e:{default:e}}var f=new r.default((0,l.default)(/(?:\n(?:\s*))+/g," "),u.default);exports.default=f;
},{"../TemplateTag":"Q/T9","../trimResultTransformer":"oMaF","../replaceResultTransformer":"CaXL"}],"okH6":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./oneLine"),t=r(e);function r(e){return e&&e.__esModule?e:{default:e}}exports.default=t.default;
},{"./oneLine":"Po01"}],"ShrF":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../TemplateTag"),r=s(e),t=require("../trimResultTransformer"),u=s(t),a=require("../replaceResultTransformer"),l=s(a);function s(e){return e&&e.__esModule?e:{default:e}}var f=new r.default((0,l.default)(/(?:\n\s*)/g,""),u.default);exports.default=f;
},{"../TemplateTag":"Q/T9","../trimResultTransformer":"oMaF","../replaceResultTransformer":"CaXL"}],"bRvt":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./oneLineTrim"),t=r(e);function r(e){return e&&e.__esModule?e:{default:e}}exports.default=t.default;
},{"./oneLineTrim":"ShrF"}],"2fF1":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../TemplateTag"),r=i(e),t=require("../inlineArrayTransformer"),a=i(t),u=require("../trimResultTransformer"),l=i(u),s=require("../replaceResultTransformer"),f=i(s);function i(e){return e&&e.__esModule?e:{default:e}}var n=new r.default((0,a.default)({separator:","}),(0,f.default)(/(?:\s+)/g," "),l.default);exports.default=n;
},{"../TemplateTag":"Q/T9","../inlineArrayTransformer":"k2vK","../trimResultTransformer":"oMaF","../replaceResultTransformer":"CaXL"}],"NtMF":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./oneLineCommaLists"),t=r(e);function r(e){return e&&e.__esModule?e:{default:e}}exports.default=t.default;
},{"./oneLineCommaLists":"2fF1"}],"xuSy":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../TemplateTag"),r=s(e),t=require("../inlineArrayTransformer"),u=s(t),a=require("../trimResultTransformer"),l=s(a),n=require("../replaceResultTransformer"),o=s(n);function s(e){return e&&e.__esModule?e:{default:e}}var f=new r.default((0,u.default)({separator:",",conjunction:"or"}),(0,o.default)(/(?:\s+)/g," "),l.default);exports.default=f;
},{"../TemplateTag":"Q/T9","../inlineArrayTransformer":"k2vK","../trimResultTransformer":"oMaF","../replaceResultTransformer":"CaXL"}],"wv27":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./oneLineCommaListsOr"),t=r(e);function r(e){return e&&e.__esModule?e:{default:e}}exports.default=t.default;
},{"./oneLineCommaListsOr":"xuSy"}],"cYKW":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../TemplateTag"),r=o(e),t=require("../inlineArrayTransformer"),a=o(t),u=require("../trimResultTransformer"),l=o(u),n=require("../replaceResultTransformer"),s=o(n);function o(e){return e&&e.__esModule?e:{default:e}}var f=new r.default((0,a.default)({separator:",",conjunction:"and"}),(0,s.default)(/(?:\s+)/g," "),l.default);exports.default=f;
},{"../TemplateTag":"Q/T9","../inlineArrayTransformer":"k2vK","../trimResultTransformer":"oMaF","../replaceResultTransformer":"CaXL"}],"5yzU":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./oneLineCommaListsAnd"),t=r(e);function r(e){return e&&e.__esModule?e:{default:e}}exports.default=t.default;
},{"./oneLineCommaListsAnd":"cYKW"}],"Ey4o":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../TemplateTag"),r=i(e),t=require("../stripIndentTransformer"),u=i(t),a=require("../inlineArrayTransformer"),l=i(a),n=require("../trimResultTransformer"),f=i(n);function i(e){return e&&e.__esModule?e:{default:e}}var s=new r.default(l.default,u.default,f.default);exports.default=s;
},{"../TemplateTag":"Q/T9","../stripIndentTransformer":"wR//","../inlineArrayTransformer":"k2vK","../trimResultTransformer":"oMaF"}],"RqFD":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./inlineLists"),t=r(e);function r(e){return e&&e.__esModule?e:{default:e}}exports.default=t.default;
},{"./inlineLists":"Ey4o"}],"CWPs":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../TemplateTag"),r=i(e),t=require("../inlineArrayTransformer"),u=i(t),a=require("../trimResultTransformer"),l=i(a),s=require("../replaceResultTransformer"),f=i(s);function i(e){return e&&e.__esModule?e:{default:e}}var n=new r.default(u.default,(0,f.default)(/(?:\s+)/g," "),l.default);exports.default=n;
},{"../TemplateTag":"Q/T9","../inlineArrayTransformer":"k2vK","../trimResultTransformer":"oMaF","../replaceResultTransformer":"CaXL"}],"D9qW":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./oneLineInlineLists"),t=r(e);function r(e){return e&&e.__esModule?e:{default:e}}exports.default=t.default;
},{"./oneLineInlineLists":"CWPs"}],"ciUv":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../TemplateTag"),r=s(e),t=require("../stripIndentTransformer"),u=s(t),a=require("../trimResultTransformer"),l=s(a);function s(e){return e&&e.__esModule?e:{default:e}}var d=new r.default(u.default,l.default);exports.default=d;
},{"../TemplateTag":"Q/T9","../stripIndentTransformer":"wR//","../trimResultTransformer":"oMaF"}],"OZRL":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./stripIndent"),t=r(e);function r(e){return e&&e.__esModule?e:{default:e}}exports.default=t.default;
},{"./stripIndent":"ciUv"}],"l40o":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../TemplateTag"),r=s(e),t=require("../stripIndentTransformer"),u=s(t),a=require("../trimResultTransformer"),l=s(a);function s(e){return e&&e.__esModule?e:{default:e}}var d=new r.default((0,u.default)("all"),l.default);exports.default=d;
},{"../TemplateTag":"Q/T9","../stripIndentTransformer":"wR//","../trimResultTransformer":"oMaF"}],"Pgi2":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./stripIndents"),t=r(e);function r(e){return e&&e.__esModule?e:{default:e}}exports.default=t.default;
},{"./stripIndents":"l40o"}],"9Gk7":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.stripIndents=exports.stripIndent=exports.oneLineInlineLists=exports.inlineLists=exports.oneLineCommaListsAnd=exports.oneLineCommaListsOr=exports.oneLineCommaLists=exports.oneLineTrim=exports.oneLine=exports.safeHtml=exports.source=exports.codeBlock=exports.html=exports.commaListsOr=exports.commaListsAnd=exports.commaLists=exports.removeNonPrintingValuesTransformer=exports.splitStringTransformer=exports.inlineArrayTransformer=exports.replaceStringTransformer=exports.replaceSubstitutionTransformer=exports.replaceResultTransformer=exports.stripIndentTransformer=exports.trimResultTransformer=exports.TemplateTag=void 0;var e=require("./TemplateTag"),r=X(e),t=require("./trimResultTransformer"),s=X(t),o=require("./stripIndentTransformer"),n=X(o),i=require("./replaceResultTransformer"),a=X(i),m=require("./replaceSubstitutionTransformer"),p=X(m),u=require("./replaceStringTransformer"),l=X(u),f=require("./inlineArrayTransformer"),x=X(f),d=require("./splitStringTransformer"),L=X(d),T=require("./removeNonPrintingValuesTransformer"),c=X(T),q=require("./commaLists"),g=X(q),I=require("./commaListsAnd"),A=X(I),C=require("./commaListsOr"),S=X(C),O=require("./html"),v=X(O),R=require("./codeBlock"),b=X(R),y=require("./source"),P=X(y),_=require("./safeHtml"),h=X(_),k=require("./oneLine"),B=X(k),H=require("./oneLineTrim"),N=X(H),V=require("./oneLineCommaLists"),M=X(V),j=require("./oneLineCommaListsOr"),w=X(j),z=require("./oneLineCommaListsAnd"),D=X(z),E=require("./inlineLists"),F=X(E),G=require("./oneLineInlineLists"),J=X(G),K=require("./stripIndent"),Q=X(K),U=require("./stripIndents"),W=X(U);function X(e){return e&&e.__esModule?e:{default:e}}exports.TemplateTag=r.default,exports.trimResultTransformer=s.default,exports.stripIndentTransformer=n.default,exports.replaceResultTransformer=a.default,exports.replaceSubstitutionTransformer=p.default,exports.replaceStringTransformer=l.default,exports.inlineArrayTransformer=x.default,exports.splitStringTransformer=L.default,exports.removeNonPrintingValuesTransformer=c.default,exports.commaLists=g.default,exports.commaListsAnd=A.default,exports.commaListsOr=S.default,exports.html=v.default,exports.codeBlock=b.default,exports.source=P.default,exports.safeHtml=h.default,exports.oneLine=B.default,exports.oneLineTrim=N.default,exports.oneLineCommaLists=M.default,exports.oneLineCommaListsOr=w.default,exports.oneLineCommaListsAnd=D.default,exports.inlineLists=F.default,exports.oneLineInlineLists=J.default,exports.stripIndent=Q.default,exports.stripIndents=W.default;
},{"./TemplateTag":"Q/T9","./trimResultTransformer":"oMaF","./stripIndentTransformer":"wR//","./replaceResultTransformer":"CaXL","./replaceSubstitutionTransformer":"a4QR","./replaceStringTransformer":"S15p","./inlineArrayTransformer":"k2vK","./splitStringTransformer":"tweT","./removeNonPrintingValuesTransformer":"9MR/","./commaLists":"zVoE","./commaListsAnd":"hUi7","./commaListsOr":"lB9V","./html":"pG/F","./codeBlock":"s4NW","./source":"s4NW","./safeHtml":"8/rC","./oneLine":"okH6","./oneLineTrim":"bRvt","./oneLineCommaLists":"NtMF","./oneLineCommaListsOr":"wv27","./oneLineCommaListsAnd":"5yzU","./inlineLists":"RqFD","./oneLineInlineLists":"D9qW","./stripIndent":"OZRL","./stripIndents":"Pgi2"}],"XLdV":[function(require,module,exports) {
"use strict";var e=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e){return JSON.parse(JSON.stringify(e))}Object.defineProperty(exports,"__esModule",{value:!0});var n=function(){function n(e,r){t(this,n),this.states=e,this.addState(exports.GenericStatus.NoError,r)}return e(n,[{key:"addState",value:function(e,t){void 0===t&&(t=this.stateData),this.states.push(new o(r(t),e))}}]),n}();exports.Puzzle=n;var o=function e(r,n){t(this,e),this.data=r,this.status=n};exports.State=o;var s,a,i=function e(r,n){t(this,e),this.event=r,this.severityLevel=n};exports.Status=i,function(e){e.Success="success",e.None=""}(s=exports.GenericEvent||(exports.GenericEvent={})),function(e){e.NoError="no_error",e.NonFatalError="non_fatal_error",e.FatalError="fatal_error"}(a=exports.SeverityLevel||(exports.SeverityLevel={})),exports.GenericStatus={NoError:new i(s.None,a.NoError),Success:new i(s.Success,a.NoError)};
},{}],"wlSc":[function(require,module,exports) {
"use strict";var e;Object.defineProperty(exports,"__esModule",{value:!0}),function(e){e.Left="left",e.Right="right"}(e=exports.Side||(exports.Side={})),exports.checkSuccess=function(t){return!t.find(function(t){return t.side===e.Left})},exports.crossersOnCorrectSide=function(e,t){var r=e.find(function(e){return e.side!==t});if(void 0!==r)return r},exports.switchSides=function(t){var r=void 0;r=t[0].side===e.Left?e.Right:e.Left,t.map(function(e){return e.side=r})};
},{}],"eoo9":[function(require,module,exports) {
"use strict";var e=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),t=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function r(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(exports,"__esModule",{value:!0});var i=require("../base-puzzle-setup"),s=require("./common-setup"),u=function(e){function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:17,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:s.Side.Left,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];n(this,r);var c=o(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,u,new l(e,t,null)));return c.adventurers=e,c.timePassed=t,c.timeLimit=a,c.currentSide=i,c.states=u,c}return a(r,i.Puzzle),t(r,[{key:"stateData",get:function(){return new l(this.adventurers,this.timePassed,this.currentSide)}},{key:"outOfTime",get:function(){return f.timePassed>f.timeLimit}}]),r}(),c=function(e){function t(e,r){n(this,t);var a=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));return a.data=e,a.status=r,a}return a(t,i.State),t}();exports.GhoulState=c;var l=function e(t,r,o){n(this,e),this.adventurers=t,this.timePassed=r,this.moveDirection=o},d=function e(t,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.Side.Left,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];n(this,e),this.name=t,this.timeToCross=r,this.side=o,this.hasTorch=a};function h(e){var t=s.crossersOnCorrectSide(e,f.currentSide);return void 0!==t?new i.Status(t.name+" not on correct side",i.SeverityLevel.NonFatalError):e.length>2?new i.Status("only a max of 2 adventurers can cross the bridge at once",i.SeverityLevel.NonFatalError):0===e.length?new i.Status("an adventurer is needed to cross the bridge",i.SeverityLevel.NonFatalError):e.find(function(e){return e.hasTorch})?null:new i.Status("at least 1 adventurer must have a torch to cross the bridge",i.SeverityLevel.NonFatalError)}exports.GhoulStatus={SuccessStatus:new i.Status("Success - Everyone crossed the bridge.",i.SeverityLevel.NoError)},exports.crossBridge=function(){if(!f.outOfTime){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var o=h(t);null===o?(s.switchSides(t),f.currentSide=t[0].side,f.timePassed+=Math.max.apply(Math,r(t.map(function(e){return e.timeToCross}))),f.outOfTime?f.addState(new i.Status("Time limit exceeded",i.SeverityLevel.FatalError)):s.checkSuccess(f.adventurers)?f.addState(exports.GhoulStatus.SuccessStatus):f.addState(i.GenericStatus.NoError)):f.addState(o)}},exports.giveTorch=function(t){if(!f.outOfTime)if(!0===t.hasTorch)f.addState(new i.Status(t.name+" already has the torch",i.SeverityLevel.NonFatalError));else{var r=f.adventurers.filter(function(e){return!0===e.hasTorch}).map(function(e){return e.side});if(e(r,1)[0]!==t.side)return void f.addState(new i.Status("The torch can only be transferred to adventurers on the same side",i.SeverityLevel.NonFatalError));f.adventurers.map(function(e){return e.hasTorch=!1}),t.hasTorch=!0,f.addState(i.GenericStatus.NoError)}},exports.initGhoulPuzzle=function(){var e=[new d("alice",1,s.Side.Left,!0),new d("bob",2),new d("charlie",5),new d("doris",10)];return f=new u(e),exports.states=f.states,e};var f=void 0;
},{"../base-puzzle-setup":"XLdV","./common-setup":"wlSc"}],"sx7l":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createDraw=function(){var e="animation-container",t=document.getElementById(e);for(t.style.background="";t.firstChild;)t.removeChild(t.firstChild);return SVG(e)};
},{}],"jQaN":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./common-setup");exports.sortIntoLeftAndRightSides=function(t){function n(e,t){return e.filter(function(e){return e.side==t}).map(function(t){return e.indexOf(t)})}return[n(t,e.Side.Left),n(t,e.Side.Right)]},exports.getMovingCrossers=function(e,t){return e.filter(function(n){return n.side!==t[e.indexOf(n)].side}).map(function(t){return e.indexOf(t)})},exports.getBaseDimensions=function(e){var t=e.native().getBoundingClientRect();return[t.width,t.height]},exports.getCenterY=function(e,t){return t/2-e/2},exports.finalizeMessages=function(e){var t=[],n=[];e.map(function(e){e.includes("is on the right side")?t.push(e):n.push(e)}),e=n.concat(t);for(var r=arguments.length,i=Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return(e=i.concat(e)).join("<br>")};
},{"./common-setup":"wlSc"}],"MwiP":[function(require,module,exports) {
"use strict";var e=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],r=!0,s=!1,a=void 0;try{for(var n,h=e[Symbol.iterator]();!(r=(n=h.next()).done)&&(i.push(n.value),!t||i.length!==t);r=!0);}catch(e){s=!0,a=e}finally{try{!r&&h.return&&h.return()}finally{if(s)throw a}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),t=function(){function e(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}();function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=this&&this.__awaiter||function(e,t,i,r){return new(i||(i=Promise))(function(s,a){function n(e){try{o(r.next(e))}catch(e){a(e)}}function h(e){try{o(r.throw(e))}catch(e){a(e)}}function o(e){e.done?s(e.value):new i(function(t){t(e.value)}).then(n,h)}o((r=r.apply(e,t||[])).next())})},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});var a=require("../base-animator"),n=require("./common-animator"),h=s(require("../../utils")),o=require("./common-setup"),d=require("../base-puzzle-setup"),c=require("./bridge-setup"),u=function(){function s(t,r){var h=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.createDraw();i(this,s),this.addMessage=t,this.specificDir=r,this.draw=h,this.drawings=new Map,this.fileExtension=".svg",this.charsOnSide=4,this.bridgeHeightToWidthRatio=140/512,this.draw.clear();var o=n.getBaseDimensions(this.draw),d=e(o,2);this.baseWidth=d[0],this.baseHeight=d[1],console.log(this.baseHeight),this.characterSideLength=this.baseWidth/16,this.sideWidth=this.characterSideLength*this.charsOnSide,this.bridgeHeight=(this.baseWidth-2*this.sideWidth)*this.bridgeHeightToWidthRatio,this.bridgeYCoord=this.baseHeight-this.bridgeHeight,console.log(this.bridgeHeight),console.log(this.bridgeYCoord),this.timePassedText=this.draw.text("Time passed: 0"),this.timePassedText.font({family:"Helvetica",size:30}),this.torchHeight=this.characterSideLength,this.torch=this.createTorch()}return t(s,[{key:"createTorch",value:function(){return this.draw.image(this.specificDir+"torch"+this.fileExtension).size(this.characterSideLength/2,this.characterSideLength)}},{key:"animate",value:function(){return r(this,void 0,void 0,regeneratorRuntime.mark(function e(){var t,i,r,s,a,n,o,d;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:for(this.setupBackground(),t=0;t<c.states[0].data.adventurers.length;t++)i=c.states[0].data.adventurers[t],this.drawings.set(t,this.draw.image(this.specificDir+i.name+this.fileExtension).size(this.characterSideLength,this.characterSideLength));r=!0,s=!1,a=void 0,e.prev=5,n=c.states[Symbol.iterator]();case 7:if(r=(o=n.next()).done){e.next=16;break}return d=o.value,e.next=11,this.drawFrame(d);case 11:return e.next=13,h.default(500);case 13:r=!0,e.next=7;break;case 16:e.next=22;break;case 18:e.prev=18,e.t0=e.catch(5),s=!0,a=e.t0;case 22:e.prev=22,e.prev=23,!r&&n.return&&n.return();case 25:if(e.prev=25,!s){e.next=28;break}throw a;case 28:return e.finish(25);case 29:return e.finish(22);case 30:case"end":return e.stop()}},e,this,[[5,18,22,30],[23,,25,29]])}))}},{key:"drawFrame",value:function(t){return r(this,void 0,void 0,regeneratorRuntime.mark(function i(){var r,s,a,h,u,v,g,f,l,m,p;return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(r=c.states.indexOf(t),s=n.sortIntoLeftAndRightSides(t.data.adventurers),a=e(s,2),h=a[0],u=a[1],0!==r){i.next=7;break}this.drawBridgeSide(o.Side.Left,h),this.drawBridgeSide(o.Side.Right,u),i.next=18;break;case 7:return v=!1,g=!1,t.status===c.GhoulStatus.SuccessStatus?v=!0:t.status.severityLevel===d.SeverityLevel.FatalError?g=!0:t.status.severityLevel===d.SeverityLevel.NonFatalError&&this.addMessage("Warning: "+t.status.event,"warning"),(f=t.data.moveDirection)===o.Side.Left?this.drawBridgeSide(o.Side.Right,u):this.drawBridgeSide(o.Side.Left,h),l=c.states[r-1],m=n.getMovingCrossers(t.data.adventurers,l.data.adventurers),i.next=16,this.animateCrossing(m,f,t);case 16:f===o.Side.Left?this.drawBridgeSide(o.Side.Left,h):this.drawBridgeSide(o.Side.Right,u),g?this.displayFatalError(t.status.event):v&&this.addMessage(t.status.event,"success");case 18:this.updateTimePassed(t.data.timePassed),this.updateTorch(t),"yes"===sessionStorage.getItem("accessibility")&&r===c.states.length-1&&(p=[],t.data.adventurers.forEach(function(e){p.push(e.name+" is on the "+e.side+" side.")}),this.addMessage(n.finalizeMessages(p,"Final state:",this.getAdventurerWithTorch(t)+" has the torch"),"success"));case 21:case"end":return i.stop()}},i,this)}))}},{key:"displayFatalError",value:function(e){var t=3*this.characterSideLength;this.draw.image(this.specificDir+"ghost"+this.fileExtension).size(t,t).move(this.baseWidth/2-t/2,this.bridgeYCoord-t-t/2),this.addMessage("Error: "+e)}},{key:"updateTimePassed",value:function(e){this.timePassedText.text("Time Passed: "+e)}},{key:"getAdventurerWithTorch",value:function(t){var i=t.data.adventurers.filter(function(e){return e.hasTorch}).map(function(e){return e.name});return e(i,1)[0]}},{key:"updateTorch",value:function(t){var i=this.getAdventurerWithTorch(t),r=t.data.adventurers.filter(function(e){return e.name===i}).map(function(e){return t.data.adventurers.indexOf(e)}),s=e(r,1)[0],a=this.drawings.get(s);this.moveTorch(a)}},{key:"moveTorch",value:function(e){this.torch.move(e.x()+this.characterSideLength/4,this.bridgeYCoord-this.characterSideLength-this.torchHeight)}},{key:"animateCrossing",value:function(e,t,i){return r(this,void 0,void 0,regeneratorRuntime.mark(function r(){var s,a,n,d,u,v,g,f,l,m,p,b,w,S,y,x,k,L,W,T;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(s=1200,null!==t){r.next=3;break}throw"Internal Error - moveDirection cannot be null. Report this to the developer.";case 3:if(0!==e.length){r.next=5;break}return r.abrupt("return");case 5:for(a=this.draw.group(),n=this.characterSideLength,d=this.sideWidth,u=this.baseWidth-this.sideWidth,t===o.Side.Left&&(n*=-1,d=this.baseWidth-this.sideWidth,u=this.sideWidth),v=d,g=u-d,f=!0,l=!1,m=void 0,r.prev=15,p=e[Symbol.iterator]();!(f=(b=p.next()).done);f=!0)w=b.value,(S=this.drawings.get(w)).move(v,this.bridgeYCoord-this.characterSideLength),a.add(S),i.data.adventurers[w].hasTorch&&(this.moveTorch(S),a.add(this.torch)),v+=n;r.next=23;break;case 19:r.prev=19,r.t0=r.catch(15),l=!0,m=r.t0;case 23:r.prev=23,r.prev=24,!f&&p.return&&p.return();case 26:if(r.prev=26,!l){r.next=29;break}throw m;case 29:return r.finish(26);case 30:return r.finish(23);case 31:return a.animate(s,"-",0).move(g,0),r.next=34,h.default(s);case 34:for(a.remove(),y=!0,x=!1,k=void 0,r.prev=38,L=e[Symbol.iterator]();!(y=(W=L.next()).done);y=!0)T=W.value,this.drawings.set(T,this.draw.image(this.specificDir+c.states[0].data.adventurers[T].name+this.fileExtension).size(this.characterSideLength,this.characterSideLength));r.next=46;break;case 42:r.prev=42,r.t1=r.catch(38),x=!0,k=r.t1;case 46:r.prev=46,r.prev=47,!y&&L.return&&L.return();case 49:if(r.prev=49,!x){r.next=52;break}throw k;case 52:return r.finish(49);case 53:return r.finish(46);case 54:this.torch=this.createTorch();case 55:case"end":return r.stop()}},r,this,[[15,19,23,31],[24,,26,30],[38,42,46,54],[47,,49,53]])}))}},{key:"drawBridgeSide",value:function(e,t){var i=void 0,r=this.characterSideLength;e===o.Side.Left?i=0:(i=this.baseWidth,i+=r*=-1);var s=!0,a=!1,n=void 0;try{for(var h,d=t[Symbol.iterator]();!(s=(h=d.next()).done);s=!0){var c=h.value;this.drawings.get(c).move(i,this.bridgeYCoord-this.characterSideLength),i+=r}}catch(e){a=!0,n=e}finally{try{!s&&d.return&&d.return()}finally{if(a)throw n}}}},{key:"setupBackground",value:function(){var e=this.baseWidth-2*this.sideWidth;this.draw.image(this.specificDir+"bridge"+this.fileExtension).size(e,this.bridgeHeight).move(this.sideWidth,this.bridgeYCoord),this.draw.rect().size(this.sideWidth,this.bridgeHeight).move(0,this.bridgeYCoord).fill("#A9A9A9").clone().move(this.baseWidth-this.sideWidth,this.bridgeYCoord)}}]),s}();exports.BridgeAnimator=u;
},{"../base-animator":"sx7l","./common-animator":"jQaN","../../utils":"UnXq","./common-setup":"wlSc","../base-puzzle-setup":"XLdV","./bridge-setup":"eoo9"}],"/7gd":[function(require,module,exports) {
"use strict";var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(exports,"__esModule",{value:!0});var a=require("../base-puzzle-setup"),i=require("./common-setup"),s=function(e){function i(e,t,o){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];r(this,i);var u=n(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,s,new l(e,t)));return u.passengers=e,u.boat=t,u.rules=o,u.fatalErrorRaised=a,u.states=s,u}return o(i,a.Puzzle),t(i,[{key:"stateData",get:function(){return new l(this.passengers,this.boat)}}]),i}(),u=function(e){function t(e,o){r(this,t);var a=n(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,o));return a.data=e,a.status=o,a}return o(t,a.State),t}();exports.RiverState=u;var l=function e(t,n){r(this,e),this.passengers=t,this.boat=n},p=function e(t,n,o){r(this,e),this.oldType=t,this.newType=n,this.side=o};exports.RiverErrorData=p;var c=function(e){function t(e,o,a){r(this,t);var i=n(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,o));return i.event=e,i.severityLevel=o,i.errorData=a,i}return o(t,a.Status),t}();exports.RiverStatus=c,exports.RiverStatuses={SuccessStatus:new a.Status("Success - Everyone crossed the river.",a.SeverityLevel.NoError)};var f=function e(t,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.Side.Left;r(this,e),this.rowerTypes=t,this.weightLimit=n,this.side=o},y=function e(t,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.Side.Left;r(this,e),this.type=t,this.weight=n,this.side=o};exports.Passenger=y;var v=function e(){r(this,e)},h=function(s){function u(e,t,o){r(this,u);var a=n(this,(u.__proto__||Object.getPrototypeOf(u)).call(this));return a.type1=e,a.type2=t,a.type3=o,a}return o(u,v),t(u,[{key:"check",value:function(t){var r=this,n=function(e){var n=function(e,t,r){return e.side===t&&e.type===r},o=t.passengers.some(function(t){return n(t,e,r.type1)}),i=t.passengers.some(function(t){return n(t,e,r.type2)}),s=t.passengers.some(function(t){return n(t,e,r.type3)});if(o&&i&&!s){var u=r.type1+" and "+r.type2+" are both on "+e+" side without "+r.type3;return"apple"===r.type2?{v:new c(u,a.SeverityLevel.FatalError,new p(r.type2,"apple_eaten",e))}:{v:new c(u,a.SeverityLevel.FatalError,new p(r.type2,"skull",e))}}},o=!0,s=!1,u=void 0;try{for(var l,f=Object.values(i.Side)[Symbol.iterator]();!(o=(l=f.next()).done);o=!0){var y=n(l.value);if("object"===(void 0===y?"undefined":e(y)))return y.v}}catch(e){s=!0,u=e}finally{try{!o&&f.return&&f.return()}finally{if(s)throw u}}return a.GenericStatus.NoError}}]),u}(),d=function(e){function s(e,t){r(this,s);var o=n(this,(s.__proto__||Object.getPrototypeOf(s)).call(this));return o.type1=e,o.type2=t,o}return o(s,v),t(s,[{key:"check",value:function(e){var t=!0,r=!1,n=void 0;try{for(var o,s=Object.values(i.Side)[Symbol.iterator]();!(t=(o=s.next()).done);t=!0){var u=o.value,l=0,f=0,y=!0,v=!1,h=void 0;try{for(var d,b=e.passengers[Symbol.iterator]();!(y=(d=b.next()).done);y=!0){var w=d.value;w.type===this.type1&&w.side===u?l++:w.type===this.type2&&w.side===u&&f++}}catch(e){v=!0,h=e}finally{try{!y&&b.return&&b.return()}finally{if(v)throw h}}if(l>f&&f>0){var S=this.type1+"s outnumber "+this.type2+"s on the "+u+" side";return new c(S,a.SeverityLevel.FatalError,new p(this.type2,"skull",u))}}}catch(e){r=!0,n=e}finally{try{!t&&s.return&&s.return()}finally{if(r)throw n}}return a.GenericStatus.NoError}}]),s}();function b(e){var t=!1,r=0,n=!0,o=!1,s=void 0;try{for(var u,l=e[Symbol.iterator]();!(n=(u=l.next()).done);n=!0){var p=u.value;if(r+=p.weight,w.boat.rowerTypes.indexOf(p.type)>-1&&(t=!0),p.side!=w.boat.side)return new a.Status(p.type+" not on correct side",a.SeverityLevel.NonFatalError)}}catch(e){o=!0,s=e}finally{try{!n&&l.return&&l.return()}finally{if(o)throw s}}var c=i.crossersOnCorrectSide(e,w.boat.side);return void 0!==c?new a.Status(c.type+" not on correct side",a.SeverityLevel.NonFatalError):r>w.boat.weightLimit?new a.Status("boat weight limit exceeded",a.SeverityLevel.NonFatalError):t?null:new a.Status("no rower on boat",a.SeverityLevel.NonFatalError)}exports.moveBoat=function(){if(!w.fatalErrorRaised){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=b(t);if(null===n){i.switchSides(t),w.boat.side=t[0].side;var o=!0,s=!1,u=void 0;try{for(var l,p=w.rules[Symbol.iterator]();!(o=(l=p.next()).done);o=!0){var c=l.value.check(w);if(c!==a.GenericStatus.NoError)return w.fatalErrorRaised=!0,void w.addState(c)}}catch(e){s=!0,u=e}finally{try{!o&&p.return&&p.return()}finally{if(s)throw u}}i.checkSuccess(w.passengers)?w.addState(exports.RiverStatuses.SuccessStatus):w.addState(a.GenericStatus.NoError)}else w.addState(n)}},exports.initGoatPuzzle=function(){var e=new f(["farmer"],2),t=[new y("goat",1),new y("apple",1),new y("wolf",1),new y("farmer",1)],r=[new h("wolf","goat","farmer"),new h("goat","apple","farmer")];return w=new s(t,e,r),exports.states=w.states,w.passengers},exports.initVampirePuzzle=function(){for(var e=new f(["vampire","priest"],2),t=[],r=[],n=[],o=0;o<3;o++)r.push(new y("vampire",1));t.push.apply(t,r);for(var a=0;a<3;a++)n.push(new y("priest",1));t.push.apply(t,n);var i=[new d("vampire","priest")];return w=new s(t,e,i),exports.states=w.states,[r,n]},exports.initSoldierPuzzle=function(){for(var e=new f(["soldier","boy"],3),t=[],r=[],n=[],o=0;o<6;o++)r.push(new y("soldier",2));t.push.apply(t,r);for(var a=0;a<2;a++)n.push(new y("boy",1));t.push.apply(t,n);return w=new s(t,e,[]),exports.states=w.states,[r,n]},exports.initActorPuzzle=function(){var e=new f(["anne","anne_agent","bob","bob_agent"],2),t=[new y("anne",1),new y("anne_agent",1),new y("bob",1),new y("bob_agent",1)],r=[new h("anne","bob_agent","anne_agent"),new h("bob","anne_agent","bob_agent")];return w=new s(t,e,r),exports.states=w.states,w.passengers};var w=void 0;
},{"../base-puzzle-setup":"XLdV","./common-setup":"wlSc"}],"l2rr":[function(require,module,exports) {
"use strict";var e=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],a=!0,s=!1,i=void 0;try{for(var n,o=e[Symbol.iterator]();!(a=(n=o.next()).done)&&(r.push(n.value),!t||r.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{!a&&o.return&&o.return()}finally{if(s)throw i}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),t=function(){function e(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,r,a){return r&&e(t.prototype,r),a&&e(t,a),t}}();function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=this&&this.__awaiter||function(e,t,r,a){return new(r||(r=Promise))(function(s,i){function n(e){try{u(a.next(e))}catch(e){i(e)}}function o(e){try{u(a.throw(e))}catch(e){i(e)}}function u(e){e.done?s(e.value):new r(function(t){t(e.value)}).then(n,o)}u((a=a.apply(e,t||[])).next())})},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});var i=require("../base-puzzle-setup"),n=require("../base-animator"),o=require("./river-setup"),u=require("./common-animator"),c=s(require("../../utils")),l=require("./common-setup"),d="#80FF72",v="#7EE8FA",h=".svg",p=new Map,f=void 0,m=void 0,g=void 0,y=4,w=2,b=10,x=void 0,k=void 0,D=void 0,S=void 0,P=void 0,z=void 0,R=1200,E=function e(t,a){r(this,e),this.display=t,this.real=a},B=function(){function s(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.createDraw();r(this,s),this.addMessage=e,this.specificDir=t,this.draw=a,this.baseDir="./assets/river-crossing/",this.commonDir="common/",this.textPool=[],this.draw.clear(),p.clear()}return t(s,[{key:"animate",value:function(){return a(this,void 0,void 0,regeneratorRuntime.mark(function e(){var t,r,a,s,i,n,u,l;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:for(this.calculateDimensions(),this.initBackground(),this.initBoat(),t=0;t<o.states[0].data.passengers.length;t++)r=o.states[0].data.passengers[t],p.set(t,this.draw.image(this.baseDir+this.specificDir+r.type+h).size(x,x));a=!0,s=!1,i=void 0,e.prev=7,n=o.states[Symbol.iterator]();case 9:if(a=(u=n.next()).done){e.next=18;break}return l=u.value,e.next=13,this.drawFrame(l);case 13:return e.next=15,c.default(500);case 15:a=!0,e.next=9;break;case 18:e.next=24;break;case 20:e.prev=20,e.t0=e.catch(7),s=!0,i=e.t0;case 24:e.prev=24,e.prev=25,!a&&n.return&&n.return();case 27:if(e.prev=27,!s){e.next=30;break}throw i;case 30:return e.finish(27);case 31:return e.finish(24);case 32:case"end":return e.stop()}},e,this,[[7,20,24,32],[25,,27,31]])}))}},{key:"initBoat",value:function(){m=2*x+b,g=u.getCenterY(m,k),f=this.draw.image(this.baseDir+this.commonDir+"raft.svg").size(m,m).move(P+S,g)}},{key:"drawFrame",value:function(t){return a(this,void 0,void 0,regeneratorRuntime.mark(function r(){var a,s,n,c,d,v,h,p,f,m,g,y,w,b;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(a=o.states.indexOf(t),s=u.sortIntoLeftAndRightSides(t.data.passengers),n=e(s,2),c=n[0],d=n[1],v=!1,h=!1,t.status===o.RiverStatuses.SuccessStatus?v=!0:t.status.severityLevel===i.SeverityLevel.FatalError?h=!0:t.status.severityLevel===i.SeverityLevel.NonFatalError&&this.addMessage("Warning: "+t.status.event,"warning"),"left"===(p=t.data.boat.side)?this.drawRiverBank(z,d):this.drawRiverBank(P,c),0===a){r.next=12;break}return f=o.states[a-1],m=u.getMovingCrossers(t.data.passengers,f.data.passengers),r.next=12,this.animateCrossing(m,p);case 12:p===l.Side.Left?this.drawRiverBank(P,c):this.drawRiverBank(z,d),this.numberPuzzle([],void 0),h?this.displayFatalError(t.status.event,t.status.errorData,t.data.passengers):v&&this.addMessage(t.status.event,"success"),"yes"===sessionStorage.getItem("accessibility")&&a===o.states.length-1&&(g=[],y=this.checkSoldierOrPriest(),w=void 0,b=!1,1===y?(b=!0,w=this.generateDisplayNums("soldier","boy")):2===y&&(b=!0,w=this.generateDisplayNums("vampire","priest")),t.data.passengers.forEach(function(e,t){b?g.push(e.type+" "+w[t].display+" is on the "+e.side+" side."):g.push(e.type+" is on the "+e.side+" side.")}),this.addMessage(u.finalizeMessages(g,"Final state:"),"success"));case 16:case"end":return r.stop()}},r,this)}))}},{key:"numberPuzzle",value:function(e,t){this.textPool.map(function(e){return e.remove()}),this.textPool.splice(0,this.textPool.length);var r=this.checkSoldierOrPriest();1===r?this.numberPassengers("soldier","boy",e,t):2===r&&this.numberPassengers("vampire","priest",e,t)}},{key:"checkSoldierOrPriest",value:function(){return o.states[0].data.passengers.some(function(e){return"soldier"===e.type})?1:o.states[0].data.passengers.some(function(e){return"priest"===e.type})?2:0}},{key:"generateDisplayNums",value:function(e,t){for(var r=o.states[0].data.passengers.filter(function(t){return t.type===e}),a=o.states[0].data.passengers.filter(function(e){return e.type===t}),s=[],i=0;i<r.length;i++)s.push(new E(i,i));for(var n=0;n<a.length;n++)s.push(new E(n,r.length+n));return s}},{key:"numberPassengers",value:function(e,t,r,a){var s,i,n,o=this,u=this.generateDisplayNums(e,t),c=!0,l=!1,d=void 0;try{for(var v,h=u[Symbol.iterator]();!(c=(v=h.next()).done);c=!0){var f=v.value;s=f.display,i=f.real,void 0,n=o.draw.text(s.toString()).move(p.get(i).x(),p.get(i).y()).font({weight:"700"}),o.textPool.push(n),r.includes(i)&&a.add(n)}}catch(e){l=!0,d=e}finally{try{!c&&h.return&&h.return()}finally{if(l)throw d}}}},{key:"displayFatalError",value:function(e,t,r){o.states[0].data.passengers.find(function(e){return["Bob_Wife","Charlie_Wife","Bob","Charlie"].includes(e.type)})||this.replaceImage(t.oldType,t.newType,t.side,r),this.addMessage("Error: "+e)}},{key:"replaceImage",value:function(e,t,r,a){var s=this;p.forEach(function(i,n){var o=i.src;if(o&&a[n].side===r&&o.split("/").pop().slice(0,-h.length)===e){var u=i.x(),c=i.y();i.remove(),i="apple"===e?s.draw.image(i.src.replace(e+h,t+h)).size(x,x).move(u,c):s.draw.image(i.src.replace(i.src.split("/").slice(-2).join("/"),"common/"+t+h)).size(x,x).move(u,c)}})}},{key:"animateCrossing",value:function(e,t){return a(this,void 0,void 0,regeneratorRuntime.mark(function r(){var a,s,i,n,d,v,y,w,D,E,B,M,F,_,C,O,q,I,L,A,N,j,T,W,Y,V,G,H,J;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(a=this.draw.group(),s=!1,e.length>0&&(a.add(f),s=!0),i=u.getCenterY(x,k),t!==l.Side.Right){r.next=36;break}for(d=n=P+S,v=!0,y=!1,w=void 0,r.prev=10,D=e[Symbol.iterator]();!(v=(E=D.next()).done);v=!0)B=E.value,(M=p.get(B)).move(d,i),a.add(M),d+=x+b;r.next=18;break;case 14:r.prev=14,r.t0=r.catch(10),y=!0,w=r.t0;case 18:r.prev=18,r.prev=19,!v&&D.return&&D.return();case 21:if(r.prev=21,!y){r.next=24;break}throw w;case 24:return r.finish(21);case 25:return r.finish(18);case 26:return _=(F=z-m)-n,this.numberPuzzle(e,a),a.animate(R,"-",0).move(_,0),r.next=32,c.default(R);case 32:a.remove(),s&&(f=this.draw.image(this.baseDir+this.commonDir+"raft.svg").size(m,m).y(g).x(F)),r.next=64;break;case 36:for(C=z-x,O=!0,q=!1,I=void 0,r.prev=40,L=e[Symbol.iterator]();!(O=(A=L.next()).done);O=!0)N=A.value,(j=p.get(N)).move(C,i),a.add(j),C-=x+b;r.next=48;break;case 44:r.prev=44,r.t1=r.catch(40),q=!0,I=r.t1;case 48:r.prev=48,r.prev=49,!O&&L.return&&L.return();case 51:if(r.prev=51,!q){r.next=54;break}throw I;case 54:return r.finish(51);case 55:return r.finish(48);case 56:return T=-(z-(P+S+m)),this.numberPuzzle(e,a),a.animate(R,"-",0).move(T,0),r.next=62,c.default(R);case 62:a.remove(),s&&(f=this.draw.image(this.baseDir+this.commonDir+"raft.svg").size(m,m).y(g).x(P+m));case 64:for(W=!0,Y=!1,V=void 0,r.prev=67,G=e[Symbol.iterator]();!(W=(H=G.next()).done);W=!0)J=H.value,p.set(J,this.draw.image(this.baseDir+this.specificDir+o.states[0].data.passengers[J].type+h).size(x,x));r.next=75;break;case 71:r.prev=71,r.t2=r.catch(67),Y=!0,V=r.t2;case 75:r.prev=75,r.prev=76,!W&&G.return&&G.return();case 78:if(r.prev=78,!Y){r.next=81;break}throw V;case 81:return r.finish(78);case 82:return r.finish(75);case 83:case"end":return r.stop()}},r,this,[[10,14,18,26],[19,,21,25],[40,44,48,56],[49,,51,55],[67,71,75,83],[76,,78,82]])}))}},{key:"calculateDimensions",value:function(){var t=b*(y-1),r=u.getBaseDimensions(this.draw),a=e(r,2);D=a[0],k=a[1],x=Math.round((k-t)/y),P=0,z=D-w*x-b}},{key:"initBackground",value:function(){S=x*w+b,this.draw.rect(S,k).move(0,0).fill(d).clone().x(z),this.draw.rect(D-2*S,k).move(S,0).fill(v);var e=S+parseInt(window.getComputedStyle(this.draw.node.parentElement,null).getPropertyValue("padding-left").replace(/px/g,"")),t=this.draw.node.parentElement.offsetWidth-e;this.draw.node.parentElement.style.background="linear-gradient(to right, "+d+" 0%, "+d+" "+e+"px, "+v+" "+e+"px, "+v+" "+t+"px, "+d+" "+t+"px, "+d+" 100%)"}},{key:"drawRiverBank",value:function(e,t){var r=0,a=e;e:for(var s=0;s<w;s++){for(var i=0,n=0;n<y;n++){if(r===t.length)break e;p.get(t[r]).move(a,i),i+=x+b,r++}a+=x}}}]),s}();exports.RiverAnimator=B;
},{"../base-puzzle-setup":"XLdV","../base-animator":"sx7l","./river-setup":"/7gd","./common-animator":"jQaN","../../utils":"UnXq","./common-setup":"wlSc"}],"9syz":[function(require,module,exports) {
"use strict";var e=function(){return function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,r){var t=[],o=!0,n=!1,s=void 0;try{for(var i,a=e[Symbol.iterator]();!(o=(i=a.next()).done)&&(t.push(i.value),!r||t.length!==r);o=!0);}catch(e){n=!0,s=e}finally{try{!o&&a.return&&a.return()}finally{if(n)throw s}}return t}(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=function(){function e(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(r,t,o){return t&&e(r.prototype,t),o&&e(r,o),r}}(),t=d(["\n        declare class Adventurer {\n            private constructor()\n         }\n        declare const crossBridge = function(...adventurers: Adventurer[]): void\n        declare const giveTorch = function(adventurer: Adventurer): void\n        "],["\n        declare class Adventurer {\n            private constructor()\n         }\n        declare const crossBridge = function(...adventurers: Adventurer[]): void\n        declare const giveTorch = function(adventurer: Adventurer): void\n        "]),o=d(["\n        declare class Passenger {\n            private constructor()\n        }\n        declare const moveBoat = function(...passengers: Passenger[]): void\n        "],["\n        declare class Passenger {\n            private constructor()\n        }\n        declare const moveBoat = function(...passengers: Passenger[]): void\n        "]),n=d(["\n        <strong>Function:</strong> <code>moveBoat</code><br>\n        <strong>Inputs:</strong> <code>goat</code>, <code>wolf</code>, <code>farmer</code>, <code>apple</code><br>\n        <strong>Number of Inputs:</strong> 1 to 2<br>\n        <strong>Description</strong>: Moves objects across the river on the boat.\n        "],["\n        <strong>Function:</strong> <code>moveBoat</code><br>\n        <strong>Inputs:</strong> <code>goat</code>, <code>wolf</code>, <code>farmer</code>, <code>apple</code><br>\n        <strong>Number of Inputs:</strong> 1 to 2<br>\n        <strong>Description</strong>: Moves objects across the river on the boat.\n        "]),s=d(["\n        //Moves the farmer and apple across the river\n        moveBoat(farmer, apple)\n        "],["\n        //Moves the farmer and apple across the river\n        moveBoat(farmer, apple)\n        "]),i=d(["\n        <strong>Function:</strong> <code>moveBoat</code><br>\n        <strong>Inputs:</strong> Objects within the arrays <code>vampires</code>, <code>priests</code><br>\n        <strong>Number of Inputs:</strong> 1 to 2<br>\n        <strong>Description:</strong> Moves vampires and priests across the river.\n        "],["\n        <strong>Function:</strong> <code>moveBoat</code><br>\n        <strong>Inputs:</strong> Objects within the arrays <code>vampires</code>, <code>priests</code><br>\n        <strong>Number of Inputs:</strong> 1 to 2<br>\n        <strong>Description:</strong> Moves vampires and priests across the river.\n        "]),a=d(["\n        //Moves the first vampire and second priest across the river\n        moveBoat(vampires[0], priests[1])\n        "],["\n        //Moves the first vampire and second priest across the river\n        moveBoat(vampires[0], priests[1])\n        "]),c=d(["\n    //Moves the first soldier and second boy across the river\n    moveBoat(soldiers[0], boys[1])\n\n    //This is a for loop - it is used for repeating an action\n    //Move the first soldier across the river 3 times\n    for(var i = 0; i < 3; i++) {\n        moveBoat(soldiers[0])\n    }\n    "],["\n    //Moves the first soldier and second boy across the river\n    moveBoat(soldiers[0], boys[1])\n\n    //This is a for loop - it is used for repeating an action\n    //Move the first soldier across the river 3 times\n    for(var i = 0; i < 3; i++) {\n        moveBoat(soldiers[0])\n    }\n    "]);function d(e,r){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(r)}}))}function u(e,r){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!r||"object"!=typeof r&&"function"!=typeof r?e:r}function g(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function, not "+typeof r);e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r)}function l(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}var v=this&&this.__awaiter||function(e,r,t,o){return new(t||(t=Promise))(function(n,s){function i(e){try{c(o.next(e))}catch(e){s(e)}}function a(e){try{c(o.throw(e))}catch(e){s(e)}}function c(e){e.done?n(e.value):new t(function(r){r(e.value)}).then(i,a)}c((o=o.apply(e,r||[])).next())})},p=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t in e)Object.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r.default=e,r};Object.defineProperty(exports,"__esModule",{value:!0});var h=require("../ui/alerts"),b=p(require("../ui/message-view")),f=require("common-tags"),m=function e(r,t,o,n,s){var i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];l(this,e),this.objective=r,this.images=t,this.imageCaptions=o,this.rules=n,this.code=s,this.active=i},_=function(){function e(r,t,o){l(this,e),this.tutorialData=t,this.initialCode=o,this.setupCode=function(){b.clearMessages(),r()}}return r(e,[{key:"endCode",value:function(e){return v(this,void 0,void 0,regeneratorRuntime.mark(function r(){var t,o,n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=this.createAnimator(),r.next=3,t.animate();case 3:void 0!==e&&(o=void 0,n=/<anonymous>:(\d+)/.exec(JSON.stringify(e,Object.getOwnPropertyNames(e))),void 0!==e.lineNumber?o=e.lineNumber-2:null!==n?o=parseInt(n[1])-2:h.codeErrorAlert(),void 0!==o&&b.addMessage("Exception at line "+o+': "'+e.message+'"'));case 4:case"end":return r.stop()}},r,this)}))}}]),e}(),y=function(e){function t(e,r,o,n){l(this,t);var s=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r,o,n));return s.assetsDir=e,s}return g(t,_),r(t,[{key:"createAnimator",value:function(){return new this.animatorConstructor(b.addMessage,this.assetsDir)}}]),t}(),w=require("./crossing-puzzles/bridge-setup"),P=require("./crossing-puzzles/bridge-animator"),B=function(e){function r(e,o,n,s,i){l(this,r);var a=u(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,o,e,n,s));return a.__environment__={giveTorch:w.giveTorch,crossBridge:w.crossBridge},a.animatorConstructor=P.BridgeAnimator,a.typeDefs=f.stripIndent(t)+"\n"+i,a.tutorialData.images=a.tutorialData.images.map(function(e){return a.assetsDir+e}),a}return g(r,y),r}(),O=require("./crossing-puzzles/river-setup"),j=require("./crossing-puzzles/river-animator"),A=function(e){function r(e,t,n,s,i){l(this,r);var a=u(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,t,e,n,s));return a.__environment__={moveBoat:O.moveBoat},a.animatorConstructor=j.RiverAnimator,a.typeDefs=f.stripIndent(o)+"\n"+i,a.tutorialData.images=a.tutorialData.images.map(function(e){return"./assets/river-crossing/"+a.assetsDir+e}),a}return g(r,y),r}(),I="goat-apple-wolf/";exports.goatCabbageWolf=new A(function(){var r=O.initGoatPuzzle(),t=e(r,4),o=t[0],n=t[1],s=t[2],i=t[3];Object.assign(exports.goatCabbageWolf.__environment__,{goat:o,apple:n,wolf:s,farmer:i})},I,new m("Get the wolf, goat, farmer, and apple to the right side of the river using the boat.",["wolf.svg","goat.svg","farmer.svg","apple.svg"],["wolf","goat","farmer","apple"],["The wolf cannot be left alone with the goat.","The goat cannot be left alone with the apple.","Only the farmer can row the boat.","The boat can hold up to 2 objects."],[f.stripIndent(n)]),f.stripIndent(s),"declare const farmer: Passenger, goat: Passenger, wolf: Passenger, apple: Passenger;");var D="vampire-priest/";exports.vampirePriest=new A(function(){var r=O.initVampirePuzzle(),t=e(r,2),o=t[0],n=t[1];Object.assign(exports.vampirePriest.__environment__,{vampires:o,priests:n})},D,new m("Get three priests and three vampires to the other side of the river using the boat.",["priest.svg","vampire.svg"],["priest","vampire"],["The boat can hold a maximum of 2 people.","The number of vampires cannot exceed the number of priests on either side of the river.","Anyone can row the boat."],[f.stripIndent(i)]),f.stripIndent(a),"declare const vampires: Passenger[], priests: Passenger[];");var x="soldier-boy/";exports.soldierBoy=new A(function(){var r=O.initSoldierPuzzle(),t=e(r,2),o=t[0],n=t[1];Object.assign(exports.soldierBoy.__environment__,{soldiers:o,boys:n})},x,new m("Get six soldiers and two boys to the other side of the river using the boat.",["soldier.svg","boy.svg"],["soldier","boy"],["The boat can carry 2 boys, a soldier and a boy, but not 2 soldiers."],["<strong>Function:</strong> <code>moveBoat</code><br>\n<strong>Inputs:</strong> Objects within the arrays <code>soldiers</code>, <code>boys</code><br>\n<strong>Number of Inputs:</strong>  1 to 2<br>\n<strong>Description:</strong> Moves soldiers and boys across the river."]),f.stripIndent(c),"declare const soldiers: Passenger[], boys: Passenger[];");var M="agent-actor/";exports.agentActor=new A(function(){var r=O.initActorPuzzle(),t=e(r,4),o=t[0],n=t[1],s=t[2],i=t[3];Object.assign(exports.agentActor.__environment__,{anne:o,anne_agent:n,bob:s,bob_agent:i})},M,new m("Get the actors and their paranoid agents to the other side of the river using the boat.",["anne.svg","anne_agent.svg","bob.svg","bob_agent.svg"],["anne","anne_agent","bob","bob_agent"],["The boat can hold up to 2 people.","No actor can be in the presence of another actor's agent unless their own agent is also present, because each agent is worried their rival will poach their client","Anyone can row the boat."],["<strong>Function:</strong> <code>moveBoat</code><br>\n<strong>Inputs:</strong> <code>anne</code>,<code>anne_agent</code>,<code>bob</code>,<code>bob_agent</code><br>\n<strong>Number of Inputs:</strong>  1 to 2<br>\n<strong>Description:</strong> Moves agents and actors across the river."]),"//Moves Anne and her agent across the river\nmoveBoat(anne, anne_agent)","declare const anne: Passenger, anne_agent: Passenger, bob: Passenger, bob_agent: Passenger");var z="./assets/bridge-crossing/ghoul-adventurer/";exports.ghoul=new B(function(){var r=w.initGhoulPuzzle(),t=e(r,4),o=t[0],n=t[1],s=t[2],i=t[3];Object.assign(exports.ghoul.__environment__,{alice:o,bob:n,charlie:s,doris:i})},z,new m("Get all four adventurers to the other side of the bridge.",["alice.svg","bob.svg","charlie.svg","doris.svg"],["alice","bob","charlie","doris"],["Alice, Bob, Charlie, and Doris can cross the bridge in 1, 2, 5, and 10 minutes respectively","All 4 adventurers must cross the bridge in 17 minutes or less, otherwise a ghoul appears","The bridge can only bear the weight of 2 people at a time","Crossing the bridge is impossible without the torch"],["<strong>Function:</strong> <code>crossBridge</code><br>\n<strong>Inputs:</strong> <code>alice</code>, <code>bob</code>, <code>charlie</code>, <code>doris</code><br>\n<strong>Number of Inputs:</strong> 1 to 2<br>\n<strong>Description</strong>: Moves adventurers across the bridge.","<strong>Function:</strong> <code>giveTorch</code><br>\n<strong>Inputs:</strong> <code>Alice</code>, <code>Bob</code>, <code>Charlie</code>, <code>Doris</code><br>\n<strong>Number of Inputs:</strong> 1<br>\n<strong>Description</strong>: Gives the torch to an adventurer."]),"//Moves Alice and Doris across the Bridge\ncrossBridge(alice, doris)\n//Gives torch to Doris\ngiveTorch(doris)","declare const alice: Adventurer, bob: Adventurer, charlie: Adventurer, doris: Adventurer");
},{"../ui/alerts":"rgxB","../ui/message-view":"r6/B","common-tags":"9Gk7","./crossing-puzzles/bridge-setup":"eoo9","./crossing-puzzles/bridge-animator":"MwiP","./crossing-puzzles/river-setup":"/7gd","./crossing-puzzles/river-animator":"l2rr"}],"bVsJ":[function(require,module,exports) {
var e=void 0;exports.initModal=function(t){t=Object.assign(t,{onLast:!1}),e=new Vue({el:"#vue-app-modal",data:t,methods:{continueToPuzzle:function(){this.active=!1},returnToMenu:function(){window.history.back()}}})},window.setTimeout(function(){document.querySelector(".button.is-success").focus()},0),window.addEventListener("keydown",function(t){9===t.keyCode&&e.active&&(event.preventDefault(),document.activeElement===document.querySelector(".button.is-success")?document.querySelector(".button.is-danger").focus():document.querySelector(".button.is-success").focus())});
},{}],"A2T1":[function(require,module,exports) {
"use strict";var e=function(){var e=s(regeneratorRuntime.mark(function e(){var t,n,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:p.runUserCode(),(t=document.createElement("title")).textContent="Animation",t.id="title",(n=document.createElement("desc")).textContent="Displays the animation",n.id="desc",(r=document.getElementById("animation-container").querySelector("svg")).insertBefore(n,r.childNodes[0]),r.insertBefore(t,r.childNodes[0]),r.setAttribute("role","img"),r.setAttribute("aria-labelledby","title"),r.setAttribute("aria-describedby","desc");case 13:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),t=function(){var e=s(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(window.puzzledEditor&&window.addPuzzleLib){e.next=5;break}return e.next=3,(0,i.default)(10);case 3:e.next=0;break;case 5:window.addPuzzleLib(c.typeDefs),window.puzzledEditor.setValue(c.initialCode);case 7:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),n=require("./ui/alerts"),r=require("./utils"),i=u(r),o=require("./puzzles/puzzle-manager");function u(e){return e&&e.__esModule?e:{default:e}}function a(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function s(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){return function r(i,o){try{var u=t[i](o),a=u.value}catch(e){return void n(e)}if(!u.done)return Promise.resolve(a).then(function(e){r("next",e)},function(e){r("throw",e)});e(a)}("next")})}}var d=new Map;d.set("Wolves and Goats",o.goatCabbageWolf),d.set("Priests and Vampires",o.vampirePriest),d.set("Soldiers and Boys",o.soldierBoy),d.set("Actors and Agents",o.agentActor),d.set("Ghouls and Adventurers",o.ghoul);var c=d.get(sessionStorage.getItem("puzzleID")),l="vue-run-button",p=new Vue({el:"#"+l,data:{runningCode:!1,text:"Run"},methods:{runUserCode:function(){var e=s(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.startRunning(),this.runningCode=!0,!window.getMarkers){e.next=7;break}if(!window.getMarkers().some(function(e){return 8==e.severity||4==e.severity})){e.next=7;break}return(0,n.codeErrorAlert)(),this.stopRunning(),e.abrupt("return");case 7:return c.setupCode(),e.prev=8,t=window.puzzledEditor?window.puzzledEditor.getValue():"",(new(Function.prototype.bind.apply(Function,[null].concat(a(Object.keys(c.__environment__)),[t])))).apply(void 0,a(Object.values(c.__environment__))),e.next=13,c.endCode();case 13:e.next=19;break;case 15:return e.prev=15,e.t0=e.catch(8),e.next=19,c.endCode(e.t0);case 19:this.stopRunning();case 20:case"end":return e.stop()}},e,this,[[8,15]])}));return function(){return e.apply(this,arguments)}}(),startRunning:function(){this.text=" ",this.runningCode=!0},stopRunning:function(){this.runningCode=!1,this.text="Run"}}}),f=require("./ui/modal-controller");f.initModal(c.tutorialData),e();var g=document.getElementById(l);g.style.height=g.clientHeight+4+"px",t();
},{"./ui/alerts":"rgxB","./utils":"UnXq","./puzzles/puzzle-manager":"9syz","./ui/modal-controller":"bVsJ"}],"epB2":[function(require,module,exports) {
"use strict";require("regenerator-runtime/runtime"),require("./app");
},{"regenerator-runtime/runtime":"VuXv","./app":"A2T1"}]},{},["epB2"], null)
//# sourceMappingURL=/main.map