\").addClass(\"cube-cell\").addClass(\"cell-id-\"+(i+1)).addClass(o.clsCell);\n cell.data(\"id\", i + 1).data(\"side\", this);\n cell.appendTo(side);\n if (o.numbers === true) {\n cell.html(i + 1);\n }\n }\n });\n\n var cells = element.find(\".cube-cell\");\n if (o.color !== null) {\n if (Farbe.Routines.isColor(o.color)) {\n cells.css({\n backgroundColor: o.color,\n borderColor: o.color\n })\n } else {\n cells.addClass(o.color);\n }\n }\n\n var axis = ['x', 'y', 'z'];\n $.each(axis, function(){\n var axis_name = this;\n var ax = $(\"
\").addClass(\"axis \" + o.axisStyle).addClass(\"axis-\"+axis_name).addClass(o.clsAxis);\n if (axis_name === \"x\") ax.addClass(o.clsAxisX);\n if (axis_name === \"y\") ax.addClass(o.clsAxisY);\n if (axis_name === \"z\") ax.addClass(o.clsAxisZ);\n ax.appendTo(element);\n });\n\n if (o.showAxis === false) {\n element.find(\".axis\").hide();\n }\n\n this._run();\n },\n\n _run: function(){\n var that = this, element = this.element, o = this.options;\n var interval = 0;\n\n clearInterval(this.interval);\n element.find(\".cube-cell\").removeClass(\"light\");\n\n if (o.custom !== Metro.noop) {\n Utils.exec(o.custom, [element]);\n } else {\n\n element.find(\".cube-cell\").removeClass(\"light\");\n\n that._start();\n\n interval = Utils.isObject(this.rules) ? Utils.objectLength(this.rules) : 0;\n\n this.interval = setInterval(function(){\n that._start();\n }, interval * o.flashInterval);\n }\n },\n\n _createCssForCellSize: function(){\n var element = this.element, o = this.options;\n var sheet = Metro.sheet;\n var width;\n var cell_size;\n\n if (o.margin === 8 && o.cells === 4) {\n return ;\n }\n\n width = parseInt(Utils.getStyleOne(element, 'width'));\n cell_size = Math.ceil((width / 2 - o.margin * o.cells * 2) / o.cells);\n Utils.addCssRule(sheet, \"#\"+element.attr('id')+\" .side .cube-cell\", \"width: \"+cell_size+\"px!important; height: \"+cell_size+\"px!important; margin: \" + o.margin + \"px!important;\");\n },\n\n _createCssForFlashColor: function(){\n var element = this.element, o = this.options;\n var sheet = Metro.sheet;\n var rule1;\n var rule2;\n var rules1 = [];\n var rules2 = [];\n var i;\n\n if (o.flashColor === null) {\n return ;\n }\n\n rule1 = \"0 0 10px \" + Farbe.Routines.toRGBA(Farbe.Routines.parse(o.flashColor), 1);\n rule2 = \"0 0 10px \" + Farbe.Routines.toRGBA(Farbe.Routines.parse(o.flashColor), o.attenuation);\n\n for(i = 0; i < 3; i++) {\n rules1.push(rule1);\n rules2.push(rule2);\n }\n\n Utils.addCssRule(sheet, \"@keyframes pulsar-cell-\"+element.attr('id'), \"0%, 100% { \" + \"box-shadow: \" + rules1.join(\",\") + \"} 50% { \" + \"box-shadow: \" + rules2.join(\",\") + \" }\");\n Utils.addCssRule(sheet, \"#\"+element.attr('id')+\" .side .cube-cell.light\", \"animation: pulsar-cell-\" + element.attr('id') + \" 2.5s 0s ease-out infinite; \" + \"background-color: \" + o.flashColor + \"!important; border-color: \" + o.flashColor+\"!important;\");\n },\n\n _createEvents: function(){\n var that = this, element = this.element, o = this.options;\n\n $(globalThis).on(Metro.events.blur, function(){\n if (o.stopOnBlur === true && that.running === true) {\n that._stop();\n }\n }, {ns: element.attr(\"id\")});\n\n $(globalThis).on(Metro.events.focus, function(){\n if (o.stopOnBlur === true && that.running === false) {\n that._start();\n }\n }, {ns: element.attr(\"id\")});\n\n element.on(Metro.events.click, \".cube-cell\", function(){\n if (o.cellClick === true) {\n var cell = $(this);\n cell.toggleClass(\"light\");\n }\n });\n },\n\n _start: function(){\n var that = this, element = this.element;\n\n element.find(\".cube-cell\").removeClass(\"light\");\n\n this.running = true;\n\n $.each(this.rules, function(index, rule){\n that._execRule(index, rule);\n });\n },\n\n _stop: function(){\n this.running = false;\n clearInterval(this.interval);\n $.each(this.intervals, function(){\n clearInterval(this);\n })\n },\n\n _tick: function(index, speed){\n var that = this, o = this.options;\n if (speed === undefined) {\n speed = o.flashInterval * index;\n }\n\n var interval = setTimeout(function(){\n\n that._fireEvent(\"tick\", {\n index: index\n });\n\n clearInterval(interval);\n Utils.arrayDelete(that.intervals, interval);\n }, speed);\n this.intervals.push(interval);\n },\n\n _toggle: function(cell, func, time, speed){\n var that = this;\n if (speed === undefined) {\n speed = this.options.flashInterval * time;\n }\n var interval = setTimeout(function(){\n cell[func === 'on' ? 'addClass' : 'removeClass'](\"light\");\n clearInterval(interval);\n Utils.arrayDelete(that.intervals, interval);\n }, speed);\n this.intervals.push(interval);\n },\n\n start: function(){\n this._start();\n },\n\n stop: function(){\n this._stop();\n },\n\n toRule: function(index, speed){\n var that = this, element = this.element, o = this.options;\n var rules = this.rules;\n\n if (rules === null || rules === undefined || rules[index] === undefined) {\n return ;\n }\n clearInterval(this.ruleInterval);\n this.ruleInterval = false;\n this.stop();\n element.find(\".cube-cell\").removeClass(\"light\");\n for (var i = 0; i <= index; i++) {\n this._execRule(i, rules[i], speed);\n }\n if (Utils.isInt(o.autoRestart) && o.autoRestart > 0) {\n this.ruleInterval = setTimeout(function(){\n that._run();\n }, o.autoRestart);\n }\n },\n\n _execRule: function(index, rule, speed){\n var that = this, element = this.element;\n var sides = ['left', 'right', 'top'];\n\n this._tick(index, speed);\n\n $.each(sides, function(){\n var side_class = \".\"+this+\"-side\";\n var side_name = this;\n var cells_on = rule[\"on\"] !== undefined && rule[\"on\"][side_name] !== undefined ? rule[\"on\"][side_name] : false;\n var cells_off = rule[\"off\"] !== undefined && rule[\"off\"][side_name] !== undefined ? rule[\"off\"][side_name] : false;\n\n if (cells_on !== false) $.each(cells_on, function(){\n var cell_index = this;\n var cell = element.find(side_class + \" .cell-id-\"+cell_index);\n\n that._toggle(cell, 'on', index, speed);\n });\n\n if (cells_off !== false) $.each(cells_off, function(){\n var cell_index = this;\n var cell = element.find(side_class + \" .cell-id-\"+cell_index);\n\n that._toggle(cell, 'off', index, speed);\n });\n });\n },\n\n rule: function(r){\n if (r === undefined) {\n return this.rules;\n }\n\n if (this._parseRules(r) !== true) {\n return ;\n }\n this.options.rules = r;\n this.stop();\n this.element.find(\".cube-cell\").removeClass(\"light\");\n this._run();\n },\n\n axis: function(show){\n var func = show === true ? \"show\" : \"hide\";\n this.element.find(\".axis\")[func]();\n },\n\n changeRules: function(){\n var element = this.element, o = this.options;\n var rules = element.attr(\"data-rules\");\n if (this._parseRules(rules) !== true) {\n return ;\n }\n this.stop();\n element.find(\".cube-cell\").removeClass(\"light\");\n o.rules = rules;\n this._run();\n },\n\n changeAxisVisibility: function(){\n var element = this.element;\n var visibility = JSON.parse(element.attr(\"data-show-axis\")) === true;\n var func = visibility ? \"show\" : \"hide\";\n element.find(\".axis\")[func]();\n },\n\n changeAxisStyle: function(){\n var element = this.element;\n var style = element.attr(\"data-axis-style\");\n\n element.find(\".axis\").removeClass(\"arrow line no-style\").addClass(style);\n },\n\n changeAttribute: function(attributeName){\n switch (attributeName) {\n case \"data-rules\": this.changeRules(); break;\n case \"data-show-axis\": this.changeAxisVisibility(); break;\n case \"data-axis-style\": this.changeAxisStyle(); break;\n }\n },\n\n destroy: function(){\n var element = this.element;\n\n clearInterval(this.interval);\n this.interval = null;\n\n $(globalThis).off(Metro.events.blur, {ns: element.attr(\"id\")});\n $(globalThis).off(Metro.events.focus,{ns: element.attr(\"id\")});\n\n element.off(Metro.events.click, \".cube-cell\");\n\n return element;\n }\n });\n}(Metro, Dom));", "/* global Metro */\n(function(Metro, $) {\n 'use strict';\n\n let CustomCheckboxDefaultConfig = {\n customCheckboxDeferred: 0,\n\n stateOn: \"\u2611\",\n stateOff: \"\u2610\",\n\n captionOn: \"\",\n captionOff: \"\",\n captionPosition: \"right\",\n\n clsCustomCheckbox: \"\",\n clsIcon: \"\",\n clsIconOn: \"\",\n clsIconOff: \"\",\n clsCaption: \"\",\n clsCaptionOn: \"\",\n clsCaptionOff: \"\",\n\n onCustomCheckboxCreate: Metro.noop\n };\n\n Metro.customCheckboxSetup = function (options) {\n CustomCheckboxDefaultConfig = $.extend({}, CustomCheckboxDefaultConfig, options);\n };\n\n if (typeof globalThis[\"metroCustomCheckboxSetup\"] !== undefined) {\n Metro.customCheckboxSetup(globalThis[\"metroCustomCheckboxSetup\"]);\n }\n\n Metro.Component('custom-checkbox', {\n init: function( options, elem ) {\n this._super(elem, options, CustomCheckboxDefaultConfig);\n\n return this;\n },\n\n _create: function(){\n const element = this.element, o = this.options;\n const container = element.wrap( $(\"