Web UI for ARGUS server
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.

612 lines
17 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
  3. typeof define === 'function' && define.amd ? define(['exports'], factory) :
  4. (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.PNotifyAnimate = {}));
  5. }(this, (function (exports) { 'use strict';
  6. function _typeof(obj) {
  7. "@babel/helpers - typeof";
  8. if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
  9. _typeof = function (obj) {
  10. return typeof obj;
  11. };
  12. } else {
  13. _typeof = function (obj) {
  14. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  15. };
  16. }
  17. return _typeof(obj);
  18. }
  19. function _classCallCheck(instance, Constructor) {
  20. if (!(instance instanceof Constructor)) {
  21. throw new TypeError("Cannot call a class as a function");
  22. }
  23. }
  24. function _defineProperties(target, props) {
  25. for (var i = 0; i < props.length; i++) {
  26. var descriptor = props[i];
  27. descriptor.enumerable = descriptor.enumerable || false;
  28. descriptor.configurable = true;
  29. if ("value" in descriptor) descriptor.writable = true;
  30. Object.defineProperty(target, descriptor.key, descriptor);
  31. }
  32. }
  33. function _createClass(Constructor, protoProps, staticProps) {
  34. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  35. if (staticProps) _defineProperties(Constructor, staticProps);
  36. return Constructor;
  37. }
  38. function _inherits(subClass, superClass) {
  39. if (typeof superClass !== "function" && superClass !== null) {
  40. throw new TypeError("Super expression must either be null or a function");
  41. }
  42. subClass.prototype = Object.create(superClass && superClass.prototype, {
  43. constructor: {
  44. value: subClass,
  45. writable: true,
  46. configurable: true
  47. }
  48. });
  49. if (superClass) _setPrototypeOf(subClass, superClass);
  50. }
  51. function _getPrototypeOf(o) {
  52. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  53. return o.__proto__ || Object.getPrototypeOf(o);
  54. };
  55. return _getPrototypeOf(o);
  56. }
  57. function _setPrototypeOf(o, p) {
  58. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  59. o.__proto__ = p;
  60. return o;
  61. };
  62. return _setPrototypeOf(o, p);
  63. }
  64. function _isNativeReflectConstruct() {
  65. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  66. if (Reflect.construct.sham) return false;
  67. if (typeof Proxy === "function") return true;
  68. try {
  69. Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
  70. return true;
  71. } catch (e) {
  72. return false;
  73. }
  74. }
  75. function _assertThisInitialized(self) {
  76. if (self === void 0) {
  77. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  78. }
  79. return self;
  80. }
  81. function _possibleConstructorReturn(self, call) {
  82. if (call && (typeof call === "object" || typeof call === "function")) {
  83. return call;
  84. }
  85. return _assertThisInitialized(self);
  86. }
  87. function _createSuper(Derived) {
  88. var hasNativeReflectConstruct = _isNativeReflectConstruct();
  89. return function _createSuperInternal() {
  90. var Super = _getPrototypeOf(Derived),
  91. result;
  92. if (hasNativeReflectConstruct) {
  93. var NewTarget = _getPrototypeOf(this).constructor;
  94. result = Reflect.construct(Super, arguments, NewTarget);
  95. } else {
  96. result = Super.apply(this, arguments);
  97. }
  98. return _possibleConstructorReturn(this, result);
  99. };
  100. }
  101. function _toConsumableArray(arr) {
  102. return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
  103. }
  104. function _arrayWithoutHoles(arr) {
  105. if (Array.isArray(arr)) return _arrayLikeToArray(arr);
  106. }
  107. function _iterableToArray(iter) {
  108. if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
  109. }
  110. function _unsupportedIterableToArray(o, minLen) {
  111. if (!o) return;
  112. if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  113. var n = Object.prototype.toString.call(o).slice(8, -1);
  114. if (n === "Object" && o.constructor) n = o.constructor.name;
  115. if (n === "Map" || n === "Set") return Array.from(o);
  116. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  117. }
  118. function _arrayLikeToArray(arr, len) {
  119. if (len == null || len > arr.length) len = arr.length;
  120. for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
  121. return arr2;
  122. }
  123. function _nonIterableSpread() {
  124. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  125. }
  126. function noop() {}
  127. function run(fn) {
  128. return fn();
  129. }
  130. function blank_object() {
  131. return Object.create(null);
  132. }
  133. function run_all(fns) {
  134. fns.forEach(run);
  135. }
  136. function is_function(thing) {
  137. return typeof thing === 'function';
  138. }
  139. function safe_not_equal(a, b) {
  140. return a != a ? b == b : a !== b || a && _typeof(a) === 'object' || typeof a === 'function';
  141. }
  142. function is_empty(obj) {
  143. return Object.keys(obj).length === 0;
  144. }
  145. function detach(node) {
  146. node.parentNode.removeChild(node);
  147. }
  148. function children(element) {
  149. return Array.from(element.childNodes);
  150. }
  151. var current_component;
  152. function set_current_component(component) {
  153. current_component = component;
  154. }
  155. function get_current_component() {
  156. if (!current_component) throw new Error('Function called outside component initialization');
  157. return current_component;
  158. }
  159. function onDestroy(fn) {
  160. get_current_component().$$.on_destroy.push(fn);
  161. }
  162. var dirty_components = [];
  163. var binding_callbacks = [];
  164. var render_callbacks = [];
  165. var flush_callbacks = [];
  166. var resolved_promise = Promise.resolve();
  167. var update_scheduled = false;
  168. function schedule_update() {
  169. if (!update_scheduled) {
  170. update_scheduled = true;
  171. resolved_promise.then(flush);
  172. }
  173. }
  174. function add_render_callback(fn) {
  175. render_callbacks.push(fn);
  176. }
  177. var flushing = false;
  178. var seen_callbacks = new Set();
  179. function flush() {
  180. if (flushing) return;
  181. flushing = true;
  182. do {
  183. // first, call beforeUpdate functions
  184. // and update components
  185. for (var i = 0; i < dirty_components.length; i += 1) {
  186. var component = dirty_components[i];
  187. set_current_component(component);
  188. update(component.$$);
  189. }
  190. set_current_component(null);
  191. dirty_components.length = 0;
  192. while (binding_callbacks.length) {
  193. binding_callbacks.pop()();
  194. } // then, once components are updated, call
  195. // afterUpdate functions. This may cause
  196. // subsequent updates...
  197. for (var _i = 0; _i < render_callbacks.length; _i += 1) {
  198. var callback = render_callbacks[_i];
  199. if (!seen_callbacks.has(callback)) {
  200. // ...so guard against infinite loops
  201. seen_callbacks.add(callback);
  202. callback();
  203. }
  204. }
  205. render_callbacks.length = 0;
  206. } while (dirty_components.length);
  207. while (flush_callbacks.length) {
  208. flush_callbacks.pop()();
  209. }
  210. update_scheduled = false;
  211. flushing = false;
  212. seen_callbacks.clear();
  213. }
  214. function update($$) {
  215. if ($$.fragment !== null) {
  216. $$.update();
  217. run_all($$.before_update);
  218. var dirty = $$.dirty;
  219. $$.dirty = [-1];
  220. $$.fragment && $$.fragment.p($$.ctx, dirty);
  221. $$.after_update.forEach(add_render_callback);
  222. }
  223. }
  224. var outroing = new Set();
  225. function transition_in(block, local) {
  226. if (block && block.i) {
  227. outroing["delete"](block);
  228. block.i(local);
  229. }
  230. }
  231. function mount_component(component, target, anchor) {
  232. var _component$$$ = component.$$,
  233. fragment = _component$$$.fragment,
  234. on_mount = _component$$$.on_mount,
  235. on_destroy = _component$$$.on_destroy,
  236. after_update = _component$$$.after_update;
  237. fragment && fragment.m(target, anchor); // onMount happens before the initial afterUpdate
  238. add_render_callback(function () {
  239. var new_on_destroy = on_mount.map(run).filter(is_function);
  240. if (on_destroy) {
  241. on_destroy.push.apply(on_destroy, _toConsumableArray(new_on_destroy));
  242. } else {
  243. // Edge case - component was destroyed immediately,
  244. // most likely as a result of a binding initialising
  245. run_all(new_on_destroy);
  246. }
  247. component.$$.on_mount = [];
  248. });
  249. after_update.forEach(add_render_callback);
  250. }
  251. function destroy_component(component, detaching) {
  252. var $$ = component.$$;
  253. if ($$.fragment !== null) {
  254. run_all($$.on_destroy);
  255. $$.fragment && $$.fragment.d(detaching); // TODO null out other refs, including component.$$ (but need to
  256. // preserve final state?)
  257. $$.on_destroy = $$.fragment = null;
  258. $$.ctx = [];
  259. }
  260. }
  261. function make_dirty(component, i) {
  262. if (component.$$.dirty[0] === -1) {
  263. dirty_components.push(component);
  264. schedule_update();
  265. component.$$.dirty.fill(0);
  266. }
  267. component.$$.dirty[i / 31 | 0] |= 1 << i % 31;
  268. }
  269. function init(component, options, instance, create_fragment, not_equal, props) {
  270. var dirty = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : [-1];
  271. var parent_component = current_component;
  272. set_current_component(component);
  273. var prop_values = options.props || {};
  274. var $$ = component.$$ = {
  275. fragment: null,
  276. ctx: null,
  277. // state
  278. props: props,
  279. update: noop,
  280. not_equal: not_equal,
  281. bound: blank_object(),
  282. // lifecycle
  283. on_mount: [],
  284. on_destroy: [],
  285. before_update: [],
  286. after_update: [],
  287. context: new Map(parent_component ? parent_component.$$.context : []),
  288. // everything else
  289. callbacks: blank_object(),
  290. dirty: dirty,
  291. skip_bound: false
  292. };
  293. var ready = false;
  294. $$.ctx = instance ? instance(component, prop_values, function (i, ret) {
  295. var value = (arguments.length <= 2 ? 0 : arguments.length - 2) ? arguments.length <= 2 ? undefined : arguments[2] : ret;
  296. if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
  297. if (!$$.skip_bound && $$.bound[i]) $$.bound[i](value);
  298. if (ready) make_dirty(component, i);
  299. }
  300. return ret;
  301. }) : [];
  302. $$.update();
  303. ready = true;
  304. run_all($$.before_update); // `false` as a special case of no DOM component
  305. $$.fragment = create_fragment ? create_fragment($$.ctx) : false;
  306. if (options.target) {
  307. if (options.hydrate) {
  308. var nodes = children(options.target); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
  309. $$.fragment && $$.fragment.l(nodes);
  310. nodes.forEach(detach);
  311. } else {
  312. // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
  313. $$.fragment && $$.fragment.c();
  314. }
  315. if (options.intro) transition_in(component.$$.fragment);
  316. mount_component(component, options.target, options.anchor);
  317. flush();
  318. }
  319. set_current_component(parent_component);
  320. }
  321. var SvelteComponent = /*#__PURE__*/function () {
  322. function SvelteComponent() {
  323. _classCallCheck(this, SvelteComponent);
  324. }
  325. _createClass(SvelteComponent, [{
  326. key: "$destroy",
  327. value: function $destroy() {
  328. destroy_component(this, 1);
  329. this.$destroy = noop;
  330. }
  331. }, {
  332. key: "$on",
  333. value: function $on(type, callback) {
  334. var callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []);
  335. callbacks.push(callback);
  336. return function () {
  337. var index = callbacks.indexOf(callback);
  338. if (index !== -1) callbacks.splice(index, 1);
  339. };
  340. }
  341. }, {
  342. key: "$set",
  343. value: function $set($$props) {
  344. if (this.$$set && !is_empty($$props)) {
  345. this.$$.skip_bound = true;
  346. this.$$set($$props);
  347. this.$$.skip_bound = false;
  348. }
  349. }
  350. }]);
  351. return SvelteComponent;
  352. }();
  353. var position = "PrependContainer";
  354. var defaults = {
  355. inClass: null,
  356. outClass: null
  357. };
  358. function instance($$self, $$props, $$invalidate) {
  359. var _$$props$self = $$props.self,
  360. self = _$$props$self === void 0 ? null : _$$props$self;
  361. var _$$props$inClass = $$props.inClass,
  362. inClass = _$$props$inClass === void 0 ? defaults.inClass : _$$props$inClass;
  363. var _$$props$outClass = $$props.outClass,
  364. outClass = _$$props$outClass === void 0 ? defaults.outClass : _$$props$outClass;
  365. var _animation = self.animation;
  366. var _animateIn = self.animateIn;
  367. var _animateOut = self.animateOut;
  368. onDestroy(function () {
  369. self.$set({
  370. animation: _animation,
  371. animateIn: _animateIn,
  372. animateOut: _animateOut
  373. });
  374. });
  375. self.on("pnotify:update", function () {
  376. if (self.refs.elem) {
  377. var animSpeed = 250;
  378. if (self.animateSpeed === "slow") {
  379. animSpeed = 400;
  380. } else if (self.animateSpeed === "fast") {
  381. animSpeed = 100;
  382. } else if (self.animateSpeed > 0) {
  383. animSpeed = self.animateSpeed;
  384. }
  385. animSpeed = animSpeed / 1000;
  386. if (self.refs.elem.style.animationDuration !== "".concat(animSpeed, "s")) {
  387. $$invalidate(0, self.refs.elem.style.animationDuration = "".concat(animSpeed, "s"), self);
  388. }
  389. }
  390. });
  391. function animateIn(callback, immediate) {
  392. // Declare that the notice is animating in.
  393. self.setAnimating("in");
  394. var off;
  395. var finished = function finished(event) {
  396. if (event && self.refs.elem && event.target !== self.refs.elem) {
  397. return;
  398. }
  399. off();
  400. self.setAnimatingClass("pnotify-in animated");
  401. if (callback) {
  402. callback.call();
  403. } // Declare that the notice has completed animating.
  404. self.setAnimating(false);
  405. };
  406. off = self.on("animationend", finished);
  407. if (immediate) {
  408. finished();
  409. } else {
  410. self.setAnimatingClass("pnotify-in animated ".concat(inClass || outClass));
  411. }
  412. }
  413. function animateOut(callback, immediate) {
  414. // Declare that the notice is animating out.
  415. self.setAnimating("out");
  416. var off;
  417. var finished = function finished(event) {
  418. if (event && self.refs.elem && event.target !== self.refs.elem) {
  419. return;
  420. }
  421. off();
  422. self.setAnimatingClass("animated");
  423. if (callback) {
  424. callback.call();
  425. } // Declare that the notice has completed animating.
  426. if (self.setAnimating) {
  427. self.setAnimating(false);
  428. }
  429. };
  430. off = self.on("animationend", finished);
  431. if (immediate) {
  432. finished();
  433. } else {
  434. self.setAnimatingClass("pnotify-in animated ".concat(outClass || inClass));
  435. }
  436. }
  437. self.attention = function (aniClass, callback) {
  438. var off;
  439. var cb = function cb() {
  440. off();
  441. self.removeModuleClass("container", "animated", aniClass);
  442. if (callback) {
  443. callback.call(self);
  444. }
  445. };
  446. off = self.on("animationend", cb);
  447. self.addModuleClass("container", "animated", aniClass);
  448. };
  449. $$self.$$set = function ($$props) {
  450. if ("self" in $$props) $$invalidate(0, self = $$props.self);
  451. if ("inClass" in $$props) $$invalidate(1, inClass = $$props.inClass);
  452. if ("outClass" in $$props) $$invalidate(2, outClass = $$props.outClass);
  453. };
  454. $$self.$$.update = function () {
  455. if ($$self.$$.dirty &
  456. /*inClass, outClass, self*/
  457. 7) {
  458. if (inClass || outClass) {
  459. self.$set({
  460. animation: "none",
  461. animateIn: animateIn,
  462. animateOut: animateOut
  463. });
  464. } else {
  465. self.$set({
  466. animation: _animation,
  467. animateIn: _animateIn,
  468. animateOut: _animateOut
  469. });
  470. }
  471. }
  472. };
  473. return [self, inClass, outClass];
  474. }
  475. var Animate = /*#__PURE__*/function (_SvelteComponent) {
  476. _inherits(Animate, _SvelteComponent);
  477. var _super = _createSuper(Animate);
  478. function Animate(options) {
  479. var _this;
  480. _classCallCheck(this, Animate);
  481. _this = _super.call(this);
  482. init(_assertThisInitialized(_this), options, instance, null, safe_not_equal, {
  483. self: 0,
  484. inClass: 1,
  485. outClass: 2
  486. });
  487. return _this;
  488. }
  489. return Animate;
  490. }(SvelteComponent);
  491. exports.default = Animate;
  492. exports.defaults = defaults;
  493. exports.position = position;
  494. Object.defineProperty(exports, '__esModule', { value: true });
  495. })));