You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
14 KiB

!function webpackUniversalModuleDefinition(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.AlgorithmVisualizer=r():t.AlgorithmVisualizer=r()}("undefined"!=typeof self?self:this,function(){return function(t){var r={};function __webpack_require__(e){if(r[e])return r[e].exports;var o=r[e]={i:e,l:!1,exports:{}};return t[e].call(o.exports,o,o.exports,__webpack_require__),o.l=!0,o.exports}return __webpack_require__.m=t,__webpack_require__.c=r,__webpack_require__.d=function(t,r,e){__webpack_require__.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:e})},__webpack_require__.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},__webpack_require__.t=function(t,r){if(1&r&&(t=__webpack_require__(t)),8&r)return t;if(4&r&&"object"==typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(__webpack_require__.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&r&&"string"!=typeof t)for(var o in t)__webpack_require__.d(e,o,function(r){return t[r]}.bind(null,o));return e},__webpack_require__.n=function(t){var r=t&&t.__esModule?function getDefault(){return t.default}:function getModuleExports(){return t};return __webpack_require__.d(r,"a",r),r},__webpack_require__.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=0)}([function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o=e(1);r.Randomize=o.default;var n=e(2);r.Commander=n.default;var a=e(5);r.Layout=a.default;var i=e(6);r.VerticalLayout=i.default;var c=e(7);r.HorizontalLayout=c.default;var u=e(8);r.Tracer=u.default;var p=e(9);r.LogTracer=p.default;var s=e(10);r.Array2DTracer=s.default;var _=e(11);r.Array1DTracer=_.default;var f=e(12);r.ChartTracer=f.default;var d=e(13);r.GraphTracer=d.default},function(t,r,e){"use strict";var o=this&&this.__extends||function(){var t=function(r,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(r,e)};return function(r,e){function __(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}}();Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function Randomizer(){}return Randomizer.prototype.create=function(){return null},Randomizer}(),a=function(t){function Integer(r,e){void 0===r&&(r=1),void 0===e&&(e=9);var o=t.call(this)||this;return o._min=r,o._max=e,o}return o(Integer,t),Integer.prototype.create=function(){return Math.random()*(this._max-this._min+1)+this._min|0},Integer}(n),i=(function(t){function Double(r,e){void 0===r&&(r=0),void 0===e&&(e=1);var o=t.call(this)||this;return o._min=r,o._max=e,o}o(Double,t),Double.prototype.create=function(){return Math.random()*(this._max-this._min)+this._min}}(n),function(t){function String(r,e){void 0===r&&(r=16),void 0===e&&(e="abcdefghijklmnopqrstuvwxyz");var o=t.call(this)||this;return o._length=r,o._letters=e,o}return o(String,t),String.prototype.create=function(){for(var t="",r=new a(0,this._letters.length-1),e=0;e<this._length;e++)t+=this._letters[r.create()];return t},String}(n)),c=function(t){function Array2D(r,e,o){void 0===r&&(r=10),void 0===e&&(e=10),void 0===o&&(o=new a);var n=t.call(this)||this;return n._N=r,n._M=e,n._randomizer=o,n._sorted=!1,n}return o(Array2D,t),Array2D.prototype.sorted=function(t){return void 0===t&&(t=!0),this._sorted=t,this},Array2D.prototype.create=function(){for(var t=[],r=0;r<this._N;r++){t.push([]);for(var e=0;e<this._M;e++)t[r].push(this._randomizer.create());this._sorted&&t[r].sort(function(t,r){return t-r})}return t},Array2D}(n),u=function(t){function Array1D(r,e){return t.call(this,1,r,e)||this}return o(Array1D,t),Array1D.prototype.create=function(){return t.prototype.create.call(this)[0]},Array1D}(c),p=function(t){function Graph(r,e,o){void 0===r&&(r=5),void 0===e&&(e=.3),void 0===o&&(o=new a);var n=t.call(this)||this;return n._N=r,n._ratio=e,n._randomizer=o,n._directed=!0,n._weighted=!1,n}return o(Graph,t),Graph.prototype.directed=function(t){return void 0===t&&(t=!0),this._directed=t,this},Graph.prototype.weighted=function(t){return void 0===t&&(t=!0),this._weighted=t,this},Graph.prototype.create=function(){for(var t=new Array(this._N),r=0;r<this._N;r++)t[r]=new Array(this._N);for(r=0;r<this._N;r++)for(var e=0;e<this._N;e++)r===e?t[r][e]=0:this._directed||r<e?t[r][e]=Math.random()<this._ratio?this._weighted?this._randomizer.create():1:0:t[r][e]=t[e][r];return t},Graph}(n);r.default={Integer:a,String:i,Array1D:u,Array2D:c,Graph:p}},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o=e(0),n=function(){function Commander(t){Commander.objectCount++;var r=this.constructor.name;this.key=Commander.keyRandomizer.create(),this.command(r,t)}return Commander.command=function(t,r,e){var o=Array.from(e);if(this.commands.push({key:t,method:r,args:JSON.parse(JSON.stringify(o))}),this.commands.length>1e6)throw new Error("Too Many Commands");if(this.objectCount>100)throw new Error("Too Many Objects")},Commander.prototype.destroy=function(){Commander.objectCount--,this.command("destroy",arguments)},Commander.prototype.command=function(t,r){Commander.command(this.key,t,r)},Commander.prototype.toJSON=function(){return this.key},Commander.keyRandomizer=new o.Randomize.String(8,"abcdefghijklmnopqrstuvwxyz0123456789"),Commander.objectCount=0,Commander.commands=[],Commander}();if(!process.env.ALGORITHM_VISUALIZER){var a=e(3),i=e(4);process.on("beforeExit",function(){a.post("https://algorithm-visualizer.org/api/visualizations",{content:JSON.stringify(n.commands)}).then(function(t){return i(t.data,{wait:!1})}).catch(console.error).finally(function(){return process.exit()})})}r.default=n},function(t,r){t.exports=require("axios")},function(t,r){t.exports=require("opn")},function(t,r,e){"use strict";var o=this&&this.__extends||function(){var t=function(r,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(r,e)};return function(r,e){function __(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}}();Object.defineProperty(r,"__esModule",{value:!0});var n=function(t){function Layout(r){return t.call(this,arguments)||this}return o(Layout,t),Layout.setRoot=function(t){this.command(null,"setRoot",arguments)},Layout.prototype.add=function(t,r){this.command("add",arguments)},Layout.prototype.remove=function(t){this.command("remove",arguments)},Layout.prototype.removeAll=function(){this.command("removeAll",arguments)},Layout}(e(0).Commander);r.default=n},function(t,r,e){"use strict";var o=this&&this.__extends||function(){var t=function(r,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(r,e)};return function(r,e){function __(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}}();Object.defineProperty(r,"__esModule",{value:!0});var n=function(t){function VerticalLayout(){return null!==t&&t.apply(this,arguments)||this}return o(VerticalLayout,t),VerticalLayout}(e(0).Layout);r.default=n},function(t,r,e){"use strict";var o=this&&this.__extends||function(){var t=function(r,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(r,e)};return function(r,e){function __(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}}();Object.defineProperty(r,"__esModule",{value:!0});var n=function(t){function HorizontalLayout(){return null!==t&&t.apply(this,arguments)||this}return o(HorizontalLayout,t),HorizontalLayout}(e(0).Layout);r.default=n},function(t,r,e){"use strict";var o=this&&this.__extends||function(){var t=function(r,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(r,e)};return function(r,e){function __(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}}();Object.defineProperty(r,"__esModule",{value:!0});var n=function(t){function Tracer(r){return t.call(this,arguments)||this}return o(Tracer,t),Tracer.delay=function(t){this.command(null,"delay",arguments)},Tracer.prototype.set=function(){this.command("set",arguments)},Tracer.prototype.reset=function(){this.command("reset",arguments)},Tracer}(e(0).Commander);r.default=n},function(t,r,e){"use strict";var o=this&&this.__extends||function(){var t=function(r,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(r,e)};return function(r,e){function __(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}}();Object.defineProperty(r,"__esModule",{value:!0});var n=function(t){function LogTracer(){return null!==t&&t.apply(this,arguments)||this}return o(LogTracer,t),LogTracer.prototype.set=function(t){this.command("set",arguments)},LogTracer.prototype.print=function(t){this.command("print",arguments)},LogTracer.prototype.println=function(t){this.command("println",arguments)},LogTracer.prototype.printf=function(t){for(var r=[],e=1;e<arguments.length;e++)r[e-1]=arguments[e];this.command("printf",arguments)},LogTracer}(e(0).Tracer);r.default=n},function(t,r,e){"use strict";var o=this&&this.__extends||function(){var t=function(r,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(r,e)};return function(r,e){function __(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}}();Object.defineProperty(r,"__esModule",{value:!0});var n=function(t){function Array2DTracer(){return null!==t&&t.apply(this,arguments)||this}return o(Array2DTracer,t),Array2DTracer.prototype.set=function(t){this.command("set",arguments)},Array2DTracer.prototype.patch=function(t,r,e){this.command("patch",arguments)},Array2DTracer.prototype.depatch=function(t,r){this.command("depatch",arguments)},Array2DTracer.prototype.select=function(t,r,e,o){this.command("select",arguments)},Array2DTracer.prototype.selectRow=function(t,r,e){this.command("selectRow",arguments)},Array2DTracer.prototype.selectCol=function(t,r,e){this.command("selectCol",arguments)},Array2DTracer.prototype.deselect=function(t,r,e,o){this.command("deselect",arguments)},Array2DTracer.prototype.deselectRow=function(t,r,e){this.command("deselectRow",arguments)},Array2DTracer.prototype.deselectCol=function(t,r,e){this.command("deselectCol",arguments)},Array2DTracer}(e(0).Tracer);r.default=n},function(t,r,e){"use strict";var o=this&&this.__extends||function(){var t=function(r,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(r,e)};return function(r,e){function __(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}}();Object.defineProperty(r,"__esModule",{value:!0});var n=function(t){function Array1DTracer(){return null!==t&&t.apply(this,arguments)||this}return o(Array1DTracer,t),Array1DTracer.prototype.set=function(t){this.command("set",arguments)},Array1DTracer.prototype.patch=function(t,r){this.command("patch",arguments)},Array1DTracer.prototype.depatch=function(t){this.command("depatch",arguments)},Array1DTracer.prototype.select=function(t,r){this.command("select",arguments)},Array1DTracer.prototype.deselect=function(t,r){this.command("deselect",arguments)},Array1DTracer.prototype.chart=function(t){this.command("chart",arguments)},Array1DTracer}(e(0).Array2DTracer);r.default=n},function(t,r,e){"use strict";var o=this&&this.__extends||function(){var t=function(r,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(r,e)};return function(r,e){function __(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}}();Object.defineProperty(r,"__esModule",{value:!0});var n=function(t){function ChartTracer(){return null!==t&&t.apply(this,arguments)||this}return o(ChartTracer,t),ChartTracer}(e(0).Array1DTracer);r.default=n},function(t,r,e){"use strict";var o=this&&this.__extends||function(){var t=function(r,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(r,e)};return function(r,e){function __(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}}();Object.defineProperty(r,"__esModule",{value:!0});var n=function(t){function GraphTracer(){return null!==t&&t.apply(this,arguments)||this}return o(GraphTracer,t),GraphTracer.prototype.set=function(t){this.command("set",arguments)},GraphTracer.prototype.directed=function(t){return this.command("directed",arguments),this},GraphTracer.prototype.weighted=function(t){return this.command("weighted",arguments),this},GraphTracer.prototype.layoutCircle=function(){return this.command("layoutCircle",arguments),this},GraphTracer.prototype.layoutTree=function(t,r){return this.command("layoutTree",arguments),this},GraphTracer.prototype.layoutRandom=function(){return this.command("layoutRandom",arguments),this},GraphTracer.prototype.addNode=function(t,r,e,o,n,a){this.command("addNode",arguments)},GraphTracer.prototype.updateNode=function(t,r,e,o,n,a){this.command("updateNode",arguments)},GraphTracer.prototype.removeNode=function(t){this.command("removeNode",arguments)},GraphTracer.prototype.addEdge=function(t,r,e,o,n){this.command("addEdge",arguments)},GraphTracer.prototype.updateEdge=function(t,r,e,o,n){this.command("updateEdge",arguments)},GraphTracer.prototype.removeEdge=function(t,r){this.command("removeEdge",arguments)},GraphTracer.prototype.visit=function(t,r,e){this.command("visit",arguments)},GraphTracer.prototype.leave=function(t,r,e){this.command("leave",arguments)},GraphTracer.prototype.select=function(t,r){this.command("select",arguments)},GraphTracer.prototype.deselect=function(t,r){this.command("deselect",arguments)},GraphTracer.prototype.log=function(t){this.command("log",arguments)},GraphTracer}(e(0).Tracer);r.default=n}])});