diff --git a/assets/img/V6-Base-Front-Slot-Splitter.png b/assets/img/V6-Base-Front-Slot-Spl.png similarity index 100% rename from assets/img/V6-Base-Front-Slot-Splitter.png rename to assets/img/V6-Base-Front-Slot-Spl.png diff --git a/assets/img/V6-Base-Front-Splitter-Fitting.png b/assets/img/V6-Base-Front-Spl-Fitting.png similarity index 100% rename from assets/img/V6-Base-Front-Splitter-Fitting.png rename to assets/img/V6-Base-Front-Spl-Fitting.png diff --git a/assets/img/V6-Carrier-Front-Bottom-Splitter.png b/assets/img/V6-Carrier-Front-Bottom-Spl.png similarity index 100% rename from assets/img/V6-Carrier-Front-Bottom-Splitter.png rename to assets/img/V6-Carrier-Front-Bottom-Spl.png diff --git a/assets/js/script.min.js b/assets/js/script.min.js index f3ee706..97ff447 100644 --- a/assets/js/script.min.js +++ b/assets/js/script.min.js @@ -1 +1 @@ -window.innerWidth<768&&[].slice.call(document.querySelectorAll("[data-bss-disabled-mobile]")).forEach((function(e){e.classList.remove("animated"),e.removeAttribute("data-bss-hover-animate"),e.removeAttribute("data-aos")})),document.addEventListener("DOMContentLoaded",(function(){[].slice.call(document.querySelectorAll("[data-bss-tooltip]")).map((function(e){return new bootstrap.Tooltip(e)}));var e=document.querySelectorAll('[data-bs-toggle="toast"]');for(var t of e)t.addEventListener("click",(function(){var e=t.getAttribute("data-bs-target");if(e)try{var a=document.querySelector(e);if(!a)return;new bootstrap.Toast(a).show()}catch(e){console.error(e)}}));var a=document.querySelectorAll("[data-bss-chart]");for(var n of a)n.chart=new Chart(n,JSON.parse(n.dataset.bssChart))}),!1),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Sortable=t()}(this,(function(){"use strict";function e(t){return(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 t(){return(t=Object.assign||function(e){for(var t=1;t"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){return!1}return!1}}function m(e,t,a,n){if(e){a=a||document;do{if(null!=t&&(">"===t[0]?e.parentNode===a&&g(e,t):g(e,t))||n&&e===a)return e;if(e===a)break}while(e=(o=e).host&&o!==document&&o.host.nodeType?o.host:o.parentNode)}var o;return null}var v,b=/\s+/g;function $(e,t,a){if(e&&t)if(e.classList)e.classList[a?"add":"remove"](t);else{var n=(" "+e.className+" ").replace(b," ").replace(" "+t+" "," ");e.className=(n+(a?" "+t:"")).replace(b," ")}}function w(e,t,a){var n=e&&e.style;if(n){if(void 0===a)return document.defaultView&&document.defaultView.getComputedStyle?a=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(a=e.currentStyle),void 0===t?a:a[t];t in n||-1!==t.indexOf("webkit")||(t="-webkit-"+t),n[t]=a+("string"==typeof a?"":"px")}}function S(e,t){var a="";if("string"==typeof e)a=e;else do{var n=w(e,"transform");n&&"none"!==n&&(a=n+" "+a)}while(!t&&(e=e.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(a)}function y(e,t,a){if(e){var n=e.getElementsByTagName(t),o=0,i=n.length;if(a)for(;o=o.left-i&&e<=o.right+i,s=t>=o.top-i&&t<=o.bottom+i;return i&&r&&s?a=n:void 0}})),a}((e=e.touches?e.touches[0]:e).clientX,e.clientY);if(t){var a={};for(var n in e)e.hasOwnProperty(n)&&(a[n]=e[n]);a.target=a.rootEl=t,a.preventDefault=void 0,a.stopPropagation=void 0,t[R]._onDragOver(a)}}}function Fe(e){H&&H.parentNode[R]._isOutsideThisEl(e.target)}function We(e,n){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=n=t({},n),e[R]=this;var o={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Me(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==We.supportPointer&&"PointerEvent"in window&&!c,emptyInsertThreshold:5};for(var i in z.initializePlugins(this,e,o),o)i in n||(n[i]=o[i]);for(var r in Ee(n),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));this.nativeDraggable=!n.forceFallback&&Te,this.nativeDraggable&&(this.options.touchStartThreshold=1),n.supportPointer?h(e,"pointerdown",this._onTapStart):(h(e,"mousedown",this._onTapStart),h(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(h(e,"dragover",this),h(e,"dragenter",this)),ve.push(this.el),n.store&&n.store.get&&this.sort(n.store.get(this)||[]),t(this,function(){var e,t=[];return{captureAnimationState:function(){t=[],this.options.animation&&[].slice.call(this.el.children).forEach((function(e){if("none"!==w(e,"display")&&e!==We.ghost){t.push({target:e,rect:D(e)});var n=a({},t[t.length-1].rect);if(e.thisAnimationDuration){var o=S(e,!0);o&&(n.top-=o.f,n.left-=o.e)}e.fromRect=n}}))},addAnimationState:function(e){t.push(e)},removeAnimationState:function(e){t.splice(function(e,t){for(var a in e)if(e.hasOwnProperty(a))for(var n in t)if(t.hasOwnProperty(n)&&t[n]===e[a][n])return Number(a);return-1}(t,{target:e}),1)},animateAll:function(a){var n=this;if(!this.options.animation)return clearTimeout(e),void("function"==typeof a&&a());var o=!1,i=0;t.forEach((function(e){var t=0,a=e.target,r=a.fromRect,s=D(a),l=a.prevFromRect,c=a.prevToRect,d=e.rect,u=S(a,!0);u&&(s.top-=u.f,s.left-=u.e),a.toRect=s,a.thisAnimationDuration&&O(l,s)&&!O(r,s)&&(d.top-s.top)/(d.left-s.left)==(r.top-s.top)/(r.left-s.left)&&(t=function(e,t,a,n){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-a.top,2)+Math.pow(t.left-a.left,2))*n.animation}(d,l,c,n.options)),O(s,r)||(a.prevFromRect=r,a.prevToRect=s,t||(t=n.options.animation),n.animate(a,d,s,t)),t&&(o=!0,i=Math.max(i,t),clearTimeout(a.animationResetTimer),a.animationResetTimer=setTimeout((function(){a.animationTime=0,a.prevFromRect=null,a.fromRect=null,a.prevToRect=null,a.thisAnimationDuration=null}),t),a.thisAnimationDuration=t)})),clearTimeout(e),o?e=setTimeout((function(){"function"==typeof a&&a()}),i):"function"==typeof a&&a(),t=[]},animate:function(e,t,a,n){if(n){w(e,"transition",""),w(e,"transform","");var o=S(this.el),i=o&&o.a,r=o&&o.d,s=(t.left-a.left)/(i||1),l=(t.top-a.top)/(r||1);e.animatingX=!!s,e.animatingY=!!l,w(e,"transform","translate3d("+s+"px,"+l+"px,0)"),this.forRepaintDummy=function(e){return e.offsetWidth}(e),w(e,"transition","transform "+n+"ms"+(this.options.easing?" "+this.options.easing:"")),w(e,"transform","translate3d(0,0,0)"),"number"==typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout((function(){w(e,"transition",""),w(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1}),n)}}}}())}function Ne(e,t,a,n,o,i,l,c){var d,u,p=e[R],h=p.options.onMove;return!window.CustomEvent||r||s?(d=document.createEvent("Event")).initEvent("move",!0,!0):d=new CustomEvent("move",{bubbles:!0,cancelable:!0}),d.to=t,d.from=e,d.dragged=a,d.draggedRect=n,d.related=o||t,d.relatedRect=i||D(t),d.willInsertAfter=c,d.originalEvent=l,e.dispatchEvent(d),h&&(u=h.call(p,d,l)),u}function Ae(e){e.draggable=!1}function Re(){Se=!1}function _e(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,a=t.length,n=0;a--;)n+=t.charCodeAt(a);return n.toString(36)}function Le(e){return setTimeout(e,0)}function ze(e){return clearTimeout(e)}Ce&&document.addEventListener("click",(function(e){if(me)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),me=!1}),!0),We.prototype={constructor:We,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(ue=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,H):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,a=this.el,n=this.options,o=n.preventOnFilter,i=e.type,r=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,s=(r||e).target,l=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,d=n.filter;if(function(e){ye.length=0;for(var t=e.getElementsByTagName("input"),a=t.length;a--;){var n=t[a];n.checked&&ye.push(n)}}(a),!H&&!(/mousedown|pointerdown/.test(i)&&0!==e.button||n.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!c||!s||"SELECT"!==s.tagName.toUpperCase())&&!((s=m(s,n.draggable,a,!1))&&s.animated||J===s)){if(Z=M(s),ee=M(s,n.draggable),"function"==typeof d){if(d.call(this,e,s,this))return G({sortable:t,rootEl:l,name:"filter",targetEl:s,toEl:a,fromEl:a}),B("filter",t,{evt:e}),void(o&&e.cancelable&&e.preventDefault())}else if(d&&(d=d.split(",").some((function(n){if(n=m(l,n.trim(),a,!1))return G({sortable:t,rootEl:n,name:"filter",targetEl:s,fromEl:a,toEl:a}),B("filter",t,{evt:e}),!0}))))return void(o&&e.cancelable&&e.preventDefault());n.handle&&!m(l,n.handle,a,!1)||this._prepareDragStart(e,r,s)}}},_prepareDragStart:function(e,t,a){var n,o=this,i=o.el,c=o.options,d=i.ownerDocument;if(a&&!H&&a.parentNode===i){var u=D(a);if(q=i,V=(H=a).parentNode,Y=H.nextSibling,J=a,ae=c.group,oe={target:We.dragged=H,clientX:(t||e).clientX,clientY:(t||e).clientY},le=oe.clientX-u.left,ce=oe.clientY-u.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,H.style["will-change"]="all",n=function(){B("delayEnded",o,{evt:e}),We.eventCanceled?o._onDrop():(o._disableDelayedDragEvents(),!l&&o.nativeDraggable&&(H.draggable=!0),o._triggerDragStart(e,t),G({sortable:o,name:"choose",originalEvent:e}),$(H,c.chosenClass,!0))},c.ignore.split(",").forEach((function(e){y(H,e.trim(),Ae)})),h(d,"dragover",Pe),h(d,"mousemove",Pe),h(d,"touchmove",Pe),h(d,"mouseup",o._onDrop),h(d,"touchend",o._onDrop),h(d,"touchcancel",o._onDrop),l&&this.nativeDraggable&&(this.options.touchStartThreshold=4,H.draggable=!0),B("delayStart",this,{evt:e}),!c.delay||c.delayOnTouchOnly&&!t||this.nativeDraggable&&(s||r))n();else{if(We.eventCanceled)return void this._onDrop();h(d,"mouseup",o._disableDelayedDrag),h(d,"touchend",o._disableDelayedDrag),h(d,"touchcancel",o._disableDelayedDrag),h(d,"mousemove",o._delayedDragTouchMoveHandler),h(d,"touchmove",o._delayedDragTouchMoveHandler),c.supportPointer&&h(d,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(n,c.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){H&&Ae(H),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;f(e,"mouseup",this._disableDelayedDrag),f(e,"touchend",this._disableDelayedDrag),f(e,"touchcancel",this._disableDelayedDrag),f(e,"mousemove",this._delayedDragTouchMoveHandler),f(e,"touchmove",this._delayedDragTouchMoveHandler),f(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?h(document,"pointermove",this._onTouchMove):h(document,t?"touchmove":"mousemove",this._onTouchMove):(h(H,"dragend",this),h(q,"dragstart",this._onDragStart));try{document.selection?Le((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(e,t){if(ge=!1,q&&H){B("dragStarted",this,{evt:t}),this.nativeDraggable&&h(document,"dragover",Fe);var a=this.options;e||$(H,a.dragClass,!1),$(H,a.ghostClass,!0),We.active=this,e&&this._appendGhost(),G({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(ie){this._lastX=ie.clientX,this._lastY=ie.clientY,Ie();for(var e=document.elementFromPoint(ie.clientX,ie.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(ie.clientX,ie.clientY))!==t;)t=e;if(H.parentNode[R]._isOutsideThisEl(e),t)do{if(t[R]&&t[R]._onDragOver({clientX:ie.clientX,clientY:ie.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break;e=t}while(t=t.parentNode);Oe()}},_onTouchMove:function(e){if(oe){var t=this.options,a=t.fallbackTolerance,n=t.fallbackOffset,o=e.touches?e.touches[0]:e,i=X&&S(X,!0),r=X&&i&&i.a,s=X&&i&&i.d,l=De&&fe&&E(fe),c=(o.clientX-oe.clientX+n.x)/(r||1)+(l?l[0]-we[0]:0)/(r||1),d=(o.clientY-oe.clientY+n.y)/(s||1)+(l?l[1]-we[1]:0)/(s||1);if(!We.active&&!ge){if(a&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))n.right+10||e.clientX<=n.right&&e.clientY>n.bottom&&e.clientX>=n.left:e.clientX>n.right&&e.clientY>n.top||e.clientX<=n.right&&e.clientY>n.bottom+10}(e,i,this)&&!v.animated){if(v===H)return z(!1);if(v&&r===e.target&&(s=v),s&&(n=D(s)),!1!==Ne(q,r,H,t,s,n,e,!!s))return L(),r.appendChild(H),V=r,U(),z(!0)}else if(s.parentNode===r){n=D(s);var b,S,y,C=H.parentNode!==r,T=!function(e,t,a){var n=a?e.left:e.top,o=a?e.right:e.bottom,i=a?e.width:e.height,r=a?t.left:t.top,s=a?t.right:t.bottom,l=a?t.width:t.height;return n===r||o===s||n+i/2===r+l/2}(H.animated&&H.toRect||t,s.animated&&s.toRect||n,i),E=i?"top":"left",I=k(s,"top","top")||k(H,"top","top"),O=I?I.scrollTop:void 0;if(ue!==s&&(S=n[E],be=!1,$e=!T&&l.invertSwap||C),0!==(b=function(e,t,a,n,o,i,r,s){var l=n?e.clientY:e.clientX,c=n?a.height:a.width,d=n?a.top:a.left,u=n?a.bottom:a.right,p=!1;if(!r)if(s&&he canvas").chart,sensor2Chart=document.querySelector("#ChartSensor2 > canvas").chart}function initUI2(){$("#relay-status").css("background-color",$(".card").css("color")),$("#relay-status").css("color",$(".card").css("background-color"))}function addSentGcode(e){if(null!=e){var t=$("#console-text-container"),a=$("#send-template").clone(!0);a.attr("id",""),a.removeClass("hidden"),a.text(e),t.append(a)}}async function addReceivedGcode(e){if(null!=e){$("#console-text-container span").length>3e3&&$("#console-text-container").find("span:first").remove();var t=$("#console-text-container"),a=$("#receive-template").clone(!0);a.attr("id",""),a.removeClass("hidden"),a.html(replaceTermAttr(e)),t.append(a),autoScroll&&(t[0].scrollTop=t[0].scrollHeight)}}function replaceTermAttr(e){var t=e.replace(/\x1b\[0m/g,"");t=t.replace(/\x1b\[1m/g,'');for(var a=/\x1b\[(\d+)m/g;m=a.exec(t);){var n="";m[1]>=30&&m[1]<=37?n="fgc"+m[1]:m[1]>=40&&m[1]<=47&&(n="bgc"+m[1]),t=t.replace(new RegExp("\\x1b\\["+m[1]+"m","g"),'')}return t}function createHistoryItem(e){if(null!=e){for(var t=0,a=$("#historyitemscontainer"),n=0;n-1&&(a=a.replace("/wi/","")),$(this).prop("src",a)}})),sitePrefix=githubPrefix,console.log("Image sources changed to Github...")}$.get("platform.txt",(function(e){$("#platform").text(e)})).fail((function(){location.host.startsWith("localhost")?$("#platform").text("Localhost"):$("#platform").text("Unknown Platform")})),$("#platform").removeClass("d-none"),curWIVersion=parseFloat($("#version-info").text().substring(1)),$.get(githubPrefix+"/wiversion.txt",(function(e){lastWIVersion=parseFloat(e),console.log("Lastest SMuFF-WI version: "+lastWIVersion),$("#update-note").text($("#update-note").text().replace("{VER}",lastWIVersion)),lastWIVersion>curWIVersion&&$("#update-note").removeClass("d-none")})).fail((function(){console.log("Not able to retrieve lastest SMuFF-WI version!"),$("#update-note").text(noWiVersion).removeClass("d-none")}))}$.get(githubPrefix+"/fwversion.txt",(function(e){console.log("Lastest SMuFF Firmware version: "+e),lastFWVersion=parseFloat(e)})),window.onscroll=function(){$(window).scrollTop()>35?($("#top-info").css("transform-origin","0 0"),$("#top-info").css("transform","scale(1, .65)"),$("#content").css("padding-top",hasDryer?"190px":"160px"),$("#settings-header").css("top","105px")):($("#top-info").css("transform","scale(1, 1)"),$("#content").css("padding-top",hasDryer?"230px":"200px"),$("#settings-header").css("top","200px"))};var t=$('');if(t.appendTo("head"),null!=localStorage.getItem("Theme")){var a=localStorage.getItem("Theme");$("#themes").val(a),t.attr("href",a).promise().done((function(){initUI(),setTimeout((function(){initUI2()}),1e3)}))}else initUI(),initUI2(),initSensorCharts();for(var n=0;n<3;n++)versionMismatch[n]=0;$("#themes").on("change",(function(){t.attr("href",$(this).val()).promise().done((function(){setTimeout((function(){initUI2()}),1e3)})),localStorage.setItem("Theme",$(this).val())}));var o=[].slice.call(document.querySelectorAll(".toast")).map((function(e){return new bootstrap.Toast(e)}));toastVersion=o[0],toastMain=o[1],swapSortable=Sortable.create(toolsswaplist,{swap:!0,swapClass:"swapping-highlight",animation:250,store:{get:function(e){},set:function(e){var t=swapSortable.toArray(),a=0;t.forEach((function(e){swapTools[a++]=parseInt(e.substring(3))}))}}});var i,r=Sortable.create(historyitemscontainer,{swap:!1,swapClass:"swapping-highlight",animation:250,store:{get:function(){var e=localStorage.getItem("CmdHistory");if(void 0!==e){var t=JSON.parse(e);null!=t&&t.forEach((function(e){createHistoryItem(e)}))}},set:function(){for(var e="[ ",t=$("#historyitemscontainer"),a=0;a=t.children().length&&(historyIndex=0),setGcodeHistory())})),$("body").on("keydown",(function(e){var t=e.keyCode||e.which;t>=112&&t<=115&&(e.preventDefault(),sendPFKey(t-32)),e.ctrlKey&&"s"===e.key&&(e.preventDefault(),$("#btn-save-settings").trigger("click")),e.ctrlKey&&"r"===e.key&&(e.preventDefault(),$("#btn-reload-settings").trigger("click"))})),$("#version-info, #release-notes").on("click",(function(){$("#recent-changes-modal").modal("show")})),$("#logo, #smuff").on("click",(function(){location.href="https://sites.google.com/view/the-smuff/"})),$("#btn-send-gcode").on("click",(async function(){var e=$("#gcode").val();null!=e&&e.length>0&&(historyIndex=-1,createHistoryItem(e),sendGcode(e,!0,!0),await getResponse()),$("#gcode").val("")})),$("#btn-clear-gcode").on("click",(function(){$("#console-text-container").empty()})),$("#btn-pf1").on("click",(function(){sendPFKey(80)})),$("#btn-pf2").on("click",(function(){sendPFKey(81)})),$("#btn-pf3").on("click",(function(){sendPFKey(82)})),$("#btn-pf4").on("click",(function(){sendPFKey(83)})),$("#btn-home").on("click",(function(){sendGcode("G28",!0,!0),moveCarrierG1=!1})),$("#btn-motors-off").on("click",(function(){sendGcode("M18",!0,!0)})),$("#btn-tool-maint").on("click",(function(){sendGcode("TM",!0,!0)})),$("#btn-wipe").on("click",(function(){sendGcode("G12",!0,!0)})),$("#btn-cut").on("click",(function(){sendGcode("G12C",!0,!0)})),$("#btn-load").on("click",(async function(){sendGcode("M700",!0,!0),showLoading(!1),await getResponse(),cancelInfo()})),$("#btn-unload").on("click",(async function(){$("#UseCutter").is(":checked")&&animateCutter(!1),sendGcode("M701",!0,!0),showUnloading(!1),await getResponse(),cancelInfo(),$("#UseCutter").is(":checked")&&animateCutterEnd()})),$("#btn-load-to-nozzle").on("click",(function(){sendGcode("M700N",!0,!0),showLoading(!1)})),$("#btn-load-to-splitter").on("click",(async function(){sendGcode("M700S",!0,!0),showLoading(!0)})),$("#btn-unload-from-splitter").on("click",(async function(){sendGcode("M701S",!0,!0),showUnloading(!0)})),$("#btn-reset").on("click",(function(){sendGcode("M999",!0,!0)})),$("#btn-view-script").on("click",(async function(){var e=$("#test-files option:selected").text();""!=e&&(sendGcode('M20L"test/'+e+'.gcode"'),await getResponse(),""!=responseBuffer&&($("#script-name").text(e),$("#script-content").val(responseBuffer),$("#view-script-modal").modal("show")))})),$("#btn-run-test").on("click",(async function(){var e;if("stopped"==$(this).data("state")){var t=$("#test-files option:selected").text();localStorage.setItem("runningScript",t),sendGcode('M98P"'+t+'"',!0,!1),await getResponse(),e=!0,testCancelled=0}else localStorage.setItem("runningScript",""),sendChar(""),e=!1,testCancelled=(new Date).getTime();showTestRunning(e)})),$("#btn-save-settings").on("click",(function(){showToast(savingSettings),saveConfig(),removeValFeedback()})),$("#btn-reload-settings").on("click",(function(){showToast(reloadingSettings),requestInit(),removeValFeedback()})),$("#btn-reset-swaps").on("click",(function(){var e=swapSortable.toArray();e.sort(),swapSortable.sort(e,!0),swapSortable.save()})),$("#btn-save-swaps").on("click",(async function(){for(var e="{ ",t=MAX_TOOLS,a=0;a0&&("firmware.bin"===e.target.files[0].name||"littlefs.bin"===e.target.files[0].name||"smuff.bin"===e.target.files[0].name)&&$("#btn-upload-esp-firmware").prop("disabled","").removeClass("disabled")})),$("#btn-upload-esp-firmware").on("click",(function(){showElement("#upload-progress",!1,!1),setDisabled(!0,"#btn-upload-esp-firmware"),$("#progress-esp-upload .progress-bar").css("width","0%").text("0%"),(new Upload).doUpload($("#upload-form")[0],"uploadBinary",(function(e){var t=0,a=e.loaded||e.position,n=e.total;e.lengthComputable&&(t=Math.ceil(a/n*100)),$("#progress-esp-upload .progress-bar").css("width",t+"%").text(t+"%")}),(function(e){console.log(uploadSuccess),$("#file-input-firmware")[0].value="",$("#uploading-label").text(uploadSuccess),setTimeout((function(){hideElement("#upload-progress",!1,!1),$("#esp-firmware-upload-modal").modal("hide"),showConnect(),window.location.reload(!0)}),8e3)}),(function(e){console.log(uploadFailed),$("#file-input-firmware")[0].value="",$("#uploading-label").text(uploadFailed)}))})),$("#card-relay").on("click",(async function(){if(hasSharedStepper&&!isTestRunning){var e="I"==$(this).find("span#state").data("state")?"E":"I";$(this).find("span#state").data("state",e),setRelayState(e),sendGcode("M17"+e,!0,!1),await getResponse()}})),$("#card-lid").on("click",(async function(){if(!isTestRunning){var e="0"==$(this).find("i").data("state")?"1":"0";hasLidState||setLidIcon(e),sendGcode("M280R"+e,!0,!1),await getResponse()}})),$("#card-purge").on("click",(async function(){if(!hasExtCtrl&&!isTestRunning){var e="0"==$(this).find("i").data("state")?"1":"0";setCheckmark(this,e),sendGcode('M205P"UsePurge"S'+e,!0,!1),await getResponse(),sendGcode("M503S1W",!1,!1),await getResponse()}})),$("#card-sendstat").on("click",(async function(){if(!isTestRunning){var e="0"==$(this).find("i").data("state")?"1":"0";setCheckmark(this,e),sendGcode('M205P"SendStats"S'+e,!0,!1),await getResponse(),sendGcode("M503S1W",!1,!1),await getResponse()}})),$("#tmc-status").on("click",(function(){$('.nav-item[data-section="#sec-statusinfo"]').trigger("click")})),$("#changes-pending").on("click",(function(){$('.nav-item[data-section="#sec-settings"]').trigger("click")})),$("#tool-selection").on("change",(async function(){if(moveCarrierG1=!1,$("#selector-pwr-off").addClass("hidden"),-1==$(this).val())sendGcode("G28X",!0,!1),moveCarrier(0),await getResponse();else{var e=parseInt($(this).val().substring(1));sendGcode($(this).val(),!0,!1),moveCarrier(e),await getResponse()}})),$("[id^=history-item-]").on("click",(function(){$("#gcode").focus(),$("#gcode").val($(this).find("span").text())})),$("#WipeSeq").on("focus, click",(function(){var e=$(this).val().matchAll(/([a-zA-Z]\d{1,3})/g);for(const t of e)console.log(t[0]),$("#wipe-"+t[0].toUpperCase()[0]).val(t[0].substring(1));$("#wipe-sequence-modal").modal("show")})),$("#Revolver-ServoClose").on("change",(async function(){initDone&&(sendGcode('M205P"ServoClose"S'+$(this).val()+"I99"),await getResponse())})),$("#Revolver-ServoOpen").on("change",(async function(){initDone&&(sendGcode('M205P"ServoOpen"S'+$(this).val()+"I99"),await getResponse())}))}));var tmcStatusBusy=!1;async function refreshTMCStats(){!tmcStatusBusy&&initDone&&(tmcStatusBusy=!0,$("#tmc-stat-0").hasClass("hidden")||(sendGcode("M122W0"),await getResponse()),$("#tmc-stat-1").hasClass("hidden")||(sendGcode("M122W1"),await getResponse()),$("#tmc-stat-2").hasClass("hidden")||(sendGcode("M122W2"),await getResponse()),$("#tmc-stat-3").hasClass("hidden")||(sendGcode("M122W3"),await getResponse()),tmcStatusBusy=!1)}function showTestRunning(e){if(!(1==e&&testCancelled>0&&(new Date).getTime()-testCancelled<4e3)){var t=$("#btn-run-test"),a=$("#test-status"),n=localStorage.getItem("runningScript");e?"running"!=t.data("state")&&(t.data("state","running"),t.find("i").removeClass("fa-play"),t.find("i").addClass("fa-stop"),a.removeClass("hidden"),a.html('Test "'+n+'" is running…'),isTestRunning=!0,$('.nav-item[data-section="#sec-dashboard"]').addClass("hidden"),$('.nav-item[data-section="#sec-live-control"]').addClass("hidden"),$('.nav-item[data-section="#sec-settings"]').addClass("hidden"),$('.nav-item[data-section="#sec-swaptools"]').addClass("hidden"),$('.nav-item[data-section="#sec-statusinfo"]').addClass("hidden"),setDisabled(!0,".sec-status"),$("#sec-status").hide("slow")):"stopped"!=t.data("state")&&(t.data("state","stopped"),t.find("i").removeClass("fa-stop"),t.find("i").addClass("fa-play"),a.addClass("hidden"),a.text(a.text().replace(n,"{TEST}")),isTestRunning=!1,$('.nav-item[data-section="#sec-dashboard"]').removeClass("hidden"),$('.nav-item[data-section="#sec-live-control"]').removeClass("hidden"),$('.nav-item[data-section="#sec-settings"]').removeClass("hidden"),$('.nav-item[data-section="#sec-swaptools"]').removeClass("hidden"),hasTmc&&$('.nav-item[data-section="#sec-statusinfo"]').removeClass("hidden"),setDisabled(!1,".sec-status"),$("#sec-status").show("slow"))}}function setCheckmark(e,t){var a=$(e).find("i");a.data("state",t),"send-stat"!=a.prop("id")?(a.removeClass("fa-check-circle fa-times-circle icon-checked icon-unchecked"),a.addClass("0"==t?"fa-times-circle icon-unchecked":"fa-check-circle icon-checked")):(a.removeClass("fa-repeat fa-times-circle fa-spin"),a.addClass("0"==t?"fa-times-circle":"fa-repeat fa-spin"))}function hideConnect(){$("#sec-start").fadeOut("slow").promise().done((function(){$("#content").css("padding-top",hasDryer?"230px":"200px"),$("#content").scrollTop(0),$("#sec-dashboard, #top-info").fadeIn("fast"),$('li.nav-item[data-section="#sec-dashboard"]').addClass("activeSection"),$('li.nav-item[data-section!="#sec-dashboard"]').removeClass("activeSection")})),$("#nav-container").removeClass("hidden"),tmcNotUsed=0,hideStatusInfoNav(),$("#btn-wizard").css("display","block");var e=localStorage.getItem("LastWizardDevice");localStorage.getItem("ShowWizard")!==never&&(localStorage.getItem("ShowWizard")==no&&e==$("#devname-label").text()||showWizard())}function showConnect(){$("#sec-dashboard, #sec-settings, #sec-swaptools, #sec-statusinfo, #sec-boardinfo, #sec-testrun, #sec-live-control, #top-info").fadeOut("fast").promise().done((function(){$("#content").css("padding-top","70px"),$("#sec-start").fadeIn("fast"),showConnectingMessage("slow",disconnected,null),setTimeout((function(){showConnectingMessage("slow",clickToConnect,null)}),2e3)})),$("#nav-container").addClass("hidden"),$("#btn-wizard").css("display","none")}async function sendChange(e){if(initDone){var t=buildM205Command(e);if(""!=t){e.removeClass("val-failed"),sendGcode(t);var a=await getResponse();e.addClass(a?"val-changed":"val-failed"),a||showToast(saveSettingFailed)}}}function setValue(e,t){try{if(void 0===e)return;for(var a of Object.keys(e)){var n,o=!1;t.indexOf("${key}")>-1?(n=t.replace("${key}",a),o=!0):n=t;var i=$("#"+n+(o?"":a));if(void 0!==i&&null!=i){if("checkbox"==i.prop("type")){var r,s;if("boolean"==typeof e[a])switch(r=e[a],e[a]){case!0:s=yes;break;case!1:s=no}else switch(e[a]){case 1:r=!0,s=high;break;case 0:r=!1,s=low;break;case"PWM":r=!1,s=pwm;break;case"OUTPUT":r=!0,s=output}i.prop("checked",r),i.attr("data-bs-original-title",s)}else if("color"==i.prop("type"))i.val("#"+e[a]);else{i.val(e[a]);var l=0;switch(a){case"LBtnDown":l=1;break;case"LBtnHold":l=2;break;case"RBtnDown":l=3;break;case"RBtnHold":l=4}l>0&&""!=e[a]&&$("#btn-pf"+l).text(pfButton+l+" ( "+e[a]+" )")}i.trigger("change")}else console.log("Control #"+a+" not found!");0}}catch(e){console.log("Failed to set value",e)}}function changeDebugLevel(){var e=0;$("#Dlvl-1").is(":checked")&&(e|=1),$("#Dlvl-2").is(":checked")&&(e|=2),$("#Dlvl-4").is(":checked")&&(e|=4),$("#Dlvl-8").is(":checked")&&(e|=8),$("#Dlvl-16").is(":checked")&&(e|=16),$("#Dlvl-32").is(":checked")&&(e|=32),$("#Dlvl-64").is(":checked")&&(e|=64),$("#Dlvl-128").is(":checked")&&(e|=128),console.log("Debug-Level: "+e),sendGcode("M111S"+e,!1,!1)}function setDebugLevel(e){var t=e.Level;$("#Dlvl-1").prop("checked",1&t),$("#Dlvl-2").prop("checked",2&t),$("#Dlvl-4").prop("checked",4&t),$("#Dlvl-8").prop("checked",8&t),$("#Dlvl-16").prop("checked",16&t),$("#Dlvl-32").prop("checked",32&t),$("#Dlvl-64").prop("checked",64&t),$("#Dlvl-128").prop("checked",128&t)}function setTMCstats(e){var t=e.TMCStatus.Axis;if(1==e.TMCStatus.InUse)for(var a of($("#tmc-stat-"+t).removeClass("hidden"),Object.keys(e.TMCStatus))){var n=$("#tmc-stat-"+t+"-"+a);"Version"==a&&(parseInt(e.TMCStatus[a])<1?versionMismatch[t]++:versionMismatch[t]>0&&versionMismatch[t]--),versionMismatch[t]>10&&(showToast(tmcVersionMismatch),$("#tmc-status").removeClass("hidden")),n.text(e.TMCStatus[a]),void 0!==n.parent().data("alert")&&("No"!=n.text()?(n.addClass("tmc-warning"),$("#tmc-status").removeClass("hidden")):(n.removeClass("tmc-warning"),$("#tmc-status").addClass("hidden")))}else $("#tmc-stat-"+t).addClass("hidden"),tmcNotUsed++;4==tmcNotUsed&&(hasTmc=!1,hideStatusInfoNav())}function setSettings(e,t){var a;try{if(a=JSON.parse(e),"Debug"==t&&(localStorage.setItem("DBG",e),setDebugLevel(a)),"TMC"==t&&(localStorage.setItem("TMC",e),setTMCstats(a)),"Basic"==t&&(localStorage.setItem("M503S1",e),setValue(a,""),setValue(a.Baudrates,"baudrate-")),"Steppers"==t&&(localStorage.setItem("M503S2",e),setValue(a.Selector,"Selector-"),setValue(a.Revolver,"Revolver-"),setValue(a.Feeder,"Feeder-")),"TMC Driver"==t&&(localStorage.setItem("M503S3",e),setValue(a.Selector,"Selector-TMC-"),setValue(a.Revolver,"Revolver-TMC-"),setValue(a.Feeder,"Feeder-TMC-")),"Servo mapping"==t&&(localStorage.setItem("M503S4",e),!hasV6S)){for(var n=getToolCount(),o=0;oCritical Parser error!
'+msg+'
'+e+"
"),void showToast(failedReadSettings)}}function addTestFiles(e){try{var t=JSON.parse(e);$("#test-files").empty(),null!=t&&t.forEach((function(e){var t=e.indexOf(".gcode");if(-1!=t){var a=e.substring(0,t);$("#test-files").append(new Option(a,""))}}))}catch(e){console.log(e),showToast(failedReadingTestFiles)}}function setRelayState(e){var t=e.substring(0,1),a=$("#card-relay").find("span#state");a.data("state",t),a.text(t)}function setFWInfo(e){hasTmc=!1,hasV6S=!1,hasDDE=!1,hasMultiservo=!1,hasDryer=!1;try{var t=e.split(":"),a=t[3].replace(" DATE","").trim();$("#version-label").text(t[2].replace(" ELECTRONICS","")),$("#electronics-label").text(a),$("#mode-label").text(t[5].replace(" OPTIONS","")),$("#acc-servo-pinmaps").addClass("d-none");try{if(t.length>5){console.log("Options: "+t[6]),$("#electronics-label").prop("title",t[6].replaceAll("|","; ")),boardOptions=t[6].split("|"),hasNeoPixels=!1,setDisabled(!0,".hasNeopixels"),setDisabled(!0,".hasBacklight"),setDisabled(!0,".hasTMC"),setDisabled(!0,".hasV6S"),setDisabled(!1,".has1stEndstop"),setDisabled(!1,".hasNotV6S"),setDisabled(!1,".hasPurge"),setDisabled(!0,".hasDDE"),setDisabled(!0,".hasSpoolmotors"),$("#acc-display").removeClass("hidden"),$("#acc-servo-pinmaps").addClass("d-none");for(var n=0;n0,isHeaterSet=heater1>=heater1Target-1&&heater10){var r=new Date(1e3*heaterTimeout).toISOString().substring(11,19);$("#timeout-label, #timeout-label-sec").text(r),showElement("#timeout-div")}else $("#timeout-label-sec").text("--:--:--"),hideElement("#timeout-div");break;case"HON:":(heaterOn=o)?($("#heating-div").addClass("heating"),showElement("#heating-icon")):($("#heating-div").removeClass("heating"),hideElement("#heating-icon"));break;case"DF1:":dryerFan1Speed=parseInt(e[2]),$("#fan1-label, #fan1-label-sec").text(dryerFan1Speed);break;case"DF2:":dryerFan2Speed=parseInt(e[2]),$("#fan2-label, #fan2-label-sec").text(dryerFan2Speed);break;case"HW:":o?(showHeaterWarning(),$("#heater1-label, #heater1-label-sec").addClass("tmc-warning"),$("#heater1-icon").addClass("tmc-warning")):($("#heater1-label, heater1-label-sec").removeClass("tmc-warning"),$("#heater1-icon").removeClass("tmc-warning"),cancelHeaterWarning())}}isDrying?($("#heater-column").addClass("drying"),$("#heater-status-sec").text(isHeaterSet?dryerDrying:dryerHeating),isStandalone&&(cmdCoolSent=!1,cmdClearSent=!1,heaterOn&&!cmdHeatingSent&&(sendWebSock(NeoPixelCmd+NeoPixelCmdHeating),cmdHeatingSent=!0,cmdHeatSent=!1),heaterOn||cmdHeatSent||(sendWebSock(NeoPixelCmd+NeoPixelCmdHeat),cmdHeatingSent=!1,cmdHeatSent=!0))):($("#heater-column").removeClass("drying"),$("#heater-status-sec").text(heater1<45?dryerIdle:dryerCooling),$("#btn-dryer-sec").text()!==startDrying&&$("#btn-dryer-sec").text(startDrying),isStandalone&&(cmdHeatingSent=!1,cmdHeatSent=!1,heater1<45&&!cmdClearSent&&(sendWebSock(NeoPixelCmd+NeoPixelCmdClear),cmdClearSent=!0),heater1>=45&&!cmdCoolSent&&(sendWebSock(NeoPixelCmd+NeoPixelCmdCool),cmdCoolSent=!0,cmdClearSent=!1))),0==loggingStart&&(loggingStart=new Date),$("#LogSensor1").is(":checked")&&(temperature1==lastTemp1&&humidity1==lastHumid1&&Math.ceil(heater1)==lastHeater1||logSensor(1,temperature1,humidity1,heater1,heater1Target),lastHumid1=humidity1,lastTemp1=temperature1,lastHeater1=Math.ceil(heater1)),$("#LogSensor2").is(":checked")&&(temperature2==lastTemp2&&humidity2==lastHumid2||logSensor(2,temperature2,humidity2),lastHumid2=humidity2,lastTemp2=temperature2),0==temperature1&&0==humidity1?hideElement("#sensor1-column"):showElement("#sensor1-column"),0==temperature2&&0==humidity2?hideElement("#sensor2-column"):showElement("#sensor2-column"),0==heater1?hideElement("#heater-column"):showElement("#heater-column"),0==temperature1&&0==temperature2&&0==humidity1&&0==humidity2&&0==heater1&&hideElement("#row-quickinfo2"),a=getCurrentTool(),moveCarrierG1||(smuffIsIdle||($('[id^="lvc-led-"]').each((function(){$(this).prop("id").endsWith(a)||setToolLed($(this),!1)})),-1!=a&&setToolLed($("#lvc-led-"+a),!0)),moveCarrier(-1==a?0:a)),setIdleAnimation(smuffIsIdle)}function hideElement(e,t=!0,a=!0){$(e).addClass("hidden"),t&&$(e).removeClass("d-flex"),a&&$(e).removeClass("d-inline")}function showElement(e,t=!0,a=!0){$(e).removeClass("hidden"),t&&$(e).addClass("d-flex"),a&&$(e).addClass("d-inline")}function setFeedLoadState(e,t){var a=e.width()*parseInt(t);void 0!==e&&e.scrollLeft()!=a&&e.animate({scrollLeft:a+"px"},600);var n=e.parent().find('img[id^="lvc-fitting-"]');2==t?n.attr("data-bs-original-title",ttpUnloadFromNozzle).tooltip("update"):1==t?n.attr("data-bs-original-title",ttpLoadToNozzle).tooltip("update"):16==t?n.attr("data-bs-original-title",ttpUnloadFromSelector).tooltip("update"):32==t?n.attr("data-bs-original-title",ttpUnloadFromNozzle).tooltip("update"):64==t?n.attr("data-bs-original-title",ttpUnloadFromDDE).tooltip("update"):n.attr("data-bs-original-title",ttpLoadToSplitter).tooltip("update")}function moveCarrier(e){var t=$("#lvc-slot-template").width(),a=$("#lvc-carrier").width();$("#lvc-carrier").css("right",a+e*t+"px")}function setToolLed(e,t,a,n){if(t){var o=$("#ToolColor").find(":selected").text();void 0!==a&&(o=a),$(e).css("opacity",1),$(e).css("background-color",o).fadeIn(smuffIsIdle?"fast":"slow")}else{if(hasNeoPixels)var i=0;void 0!==n?(i=parseFloat($(e).css("opacity"))-n,$(e).css("opacity",i<0?0:i)):$(e).css("opacity",0).fadeOut("fast")}}var idleAnimTimer=0;function setIdleAnimation(e){if(""!=$("#AnimBPM").val()&&hasNeoPixels){var t=getToolCount();if(-1!=t){var a=60/$("#AnimBPM").val()*1e3/t/3,n=getCurrentTool(),o=0,i=!0,r=!1;e?$("#IdleAnim").is(":checked")&&0==idleAnimTimer&&(idleAnimTimer=setInterval((async function(){if(n==t-1&&i?(i=!1,r=!0):0!=n||i||(i=!0,r=!0),$("#lvc-led-"+n).css("opacity")<=.15&&(r=!1),r||(i?n++:n--),$('[id^="lvc-led-"').each((function(){setToolLed($(this),!1,null,.2)})),!r){var e="hsl("+o+",80%,50%);";setToolLed($("#lvc-led-"+n),!0,e),(o+=5)>360&&(o=0)}}),a)):(0!=idleAnimTimer&&clearInterval(idleAnimTimer),idleAnimTimer=0)}}}function setTestResults(e){try{var t=JSON.parse(e.substring(15));$("#tst-elapsed").text(t.Elapsed),$("#tst-loopcnt").text(t.Loops),$("#tst-cmdcnt").text(t.Cmds),$("#tst-changes").text(t.ToolChanges),$("#tst-feederr").text(t.FeederErrors),$("#tst-stallselector").text(t.SelectorStalls),$("#tst-stallfeeder").text(t.FeederStalls);for(var a=t.FeedsOk.split("|"),n=t.FeedsMissed.split("|"),o=0;o0&&$("#tst-ok-"+o).text(i),r.length>0&&$("#tst-fail-"+o).text(r)}}catch(e){console.log(e)}}function showToast(e){$("#toast-message").html(e),toastMain.show()}function initWizard(){$("#wizard-device").val($("#Device").val()),$("#wizard-tools").val($("#Tools").val()),$("#wizard-bowden-len").val($("#BowdenLen").val()),$("#wizard-is-marlin").prop("checked",!1),$("#wizard-is-pmmu").prop("checked",$("#EmulPrusa").is(":checked")),$("#wizard-is-duet").prop("checked",$("#UseDuet").is(":checked")),$("#wizard-has-shared-stepper").prop("checked",$("#Feeder-SharedStepper").is(":checked")),$("#wizard-has-cutter").prop("checked",$("#UseCutter").is(":checked")),$("#wizard-selector-res09").prop("checked",!1),$("#wizard-feeder-res09").prop("checked",!1);var e=$("#electronics-label").text().trim();(e.endsWith("E3 V1.2")||e.endsWith("E3 V2.0")||e.endsWith("E3 V3.0"))&&$("#wizard-has-tmc2209").prop("checked",!0),"SMuFF"==$("#mode-label").text().trim()&&$("#wizard-is-marlin").prop("checked",!0),$("#wizard-is-marlin").trigger("change"),$("#wizard-is-pmmu").trigger("change"),$("#wizard-is-duet").trigger("change"),$("#wizard-has-shared-stepper").trigger("change"),$("#wizard-has-cutter").trigger("change"),$("#wizard-has-tmc2209").trigger("change"),$("#wizard-selector-res09").trigger("change"),$("#wizard-feeder-res09").trigger("change"),hasDDE?($("#wizard-dde-res09").trigger("change"),$("#wizard-dde-row").removeClass("hidden")):hideElement("#wizard-dde-row")}async function storeWizard(){var e=$("#wizard-device").val(),t=parseInt($("#wizard-tools").val()),a=parseFloat($("#wizard-bowden-len").val()),n=$("#wizard-is-pmmu").prop("checked"),o=$("#wizard-is-duet").prop("checked"),i=$("#wizard-has-shared-stepper").prop("checked"),r=$("#wizard-has-cutter").prop("checked"),s=$("#wizard-has-tmc2209").prop("checked"),l=$("#wizard-selector-res09").prop("checked"),c=$("#wizard-feeder-res09").prop("checked"),d=$("#wizard-dde-res09").prop("checked");setWizardOption("#Device",e),setWizardOption("#Tools",t),setWizardOption("#BowdenLen",a),setWizardBoolOption("#EmulPrusa",n),setWizardBoolOption("#Feeder-SharedStepper",i),setWizardBoolOption("#UseDuet",o),setWizardBoolOption("#UseCutter",r),s&&(setWizardListOption("#Selector-TMC-Mode",1),setWizardListOption("#Feeder-TMC-Mode",1),hasDDE&&setWizardListOption("#Revolver-TMC-Mode",1)),setWizardOption("#Selector-StepsMM",l?160:80),setWizardOption("#Feeder-StepsMM",c?820:410),hasDDE&&setWizardOption("#Revolver-StepsMM",d?820:410),$("#btn-save-settings").trigger("click")}function setWizardBoolOption(e,t){$(e).prop("checked")!=t&&$(e).trigger("click")}function setWizardOption(e,t){$(e).val()!=t&&$(e).val(t).trigger("focusout")}function setWizardListOption(e,t){$(e).val()!=t&&$(e).val(t).trigger("change")}function showWizard(){initWizard(),$("#wizard-modal").modal("show")}function hideWizard(){setTimeout((function(){$("#wizard-modal").modal("hide")}),500)}function resetWizard(){localStorage.setItem("ShowWizard",yes)}function showInfo(e){$("#info-message").html(e),$("#info-progressbar").css("width","0%").text("0%"),$("#info-modal").modal("show")}function cancelInfo(){$("#info-progressbar").css("width","100%").text("100%"),setTimeout((function(){$("#info-modal").modal("hide")}),500)}function showUserInfo(e){$("#user-message").html(e),$("#usrmsg-modal").modal("show")}function showError(e){$("#serious-error-message").html(e),$("#serious-error-modal").modal("show")}function cancelError(){setTimeout((function(){$("#serious-error-modal").modal("hide")}),500)}function showSDWarning(){$("#sd-warning").modal("show")}function cancelSDWarning(){setTimeout((function(){$("#sd-warning").modal("hide")}),500)}function showHeaterWarning(){$("#heater-warning").modal("show")}function cancelHeaterWarning(){setTimeout((function(){$("#heater-warning").modal("hide")}),500)}function showChangesPending(e){e?$("#changes-pending").show():$("#changes-pending").hide(),changesPending=e}function replaceId(e){return e=(e=(e=(e=(e=(e=(e=e.replace("Selector-","")).replace("Feeder-","")).replace("Revolver-","")).replace("TMC-","")).replace("Output-","")).replace("HumidityLevel-","")).replace("DynFanSpeed-","")}function normalizeId(e){var t=-1;return e.startsWith("Material-")&&(t=e.substring(9),e=e.substring(0,8)),e.startsWith("Color-")&&(t=e.substring(6),e=e.substring(0,5)),e.startsWith("PFactor-")&&(t=e.substring(8),e=e.substring(0,7)),e.startsWith("CValue-")&&(t=e.substring(7),e=e.substring(0,6)),e.startsWith("Spool-")&&(t=e.substring(6),e=e.substring(0,5)),e.startsWith("CCW-")&&(t=e.substring(4),e=e.substring(0,3)),e.startsWith("Close-")&&(t=e.substring(6),e=e.substring(0,5)),e.startsWith("Output-")&&(t=e.substring(7),e=e.substring(0,6)),e.startsWith("Mode-")&&(t=e.substring(5),e=e.substring(0,4)),e.startsWith("RevolverClose-")&&(t="T"+e.substring(14),e=e.substring(0,13)),e.startsWith("baudrate-")&&(t=e.substring(9),e=t),e.startsWith("HumidityLevel-")&&(t=e.substring(14),e=e.substring(0,13)+"s"),e.startsWith("DynFanSpeed-")&&(t=e.substring(12),e=e.substring(0,11)+"s"),[e,t]}function buildM205Command(e){var t,a=e.prop("id");if("M"==a&&"C"==a&&"CV"==a&&"PF"==a&&"O"==a&&"P"==a)return"";var n=e.prop("localName"),o=e.prop("type"),i=(e.attr("data-section"),e.attr("data-subsection"));if(""==a&&console.log(">>> No ID <<< for prop: "+n+" of type: "+o),"input"!=n&&"select"!=n||(t="text"==o?'"'+e.val()+'"':"color"==o?'"'+e.val().substring(1)+'"':"checkbox"==o?e.is(":checked")?1:0:isNaN(e.val())?null:e.val()),null!=t){const e=normalizeId(a=replaceId(a));a.startsWith("baudrate-")?(a="Baudrates",t='"'+t+'"'):a=e[0],idx=e[1];var r="",s="";if(void 0!==i){switch(i){case"Selector":r="X",s="I"+idx;break;case"Revolver":r="Y",s="I"+idx;break;case"Feeder":r="Z",s="I"+idx;break;case"User1":case"User2":s="M",a=i;break;case"HumidityLevels":case"DynFanSpeeds":s="I"+a,a=i}i.startsWith("T")&&(s="I"+i.substring(1))}return'M205P"'+a+'" S'+t+" "+r+s}return console.log("Skipping null value..."),""}function checkForChange(e){if(!initDone)return;var t=!1,a=replaceId(e.attr("id"));const n=normalizeId(a);if(a=n[0],idx=n[1],!a.startsWith("Dlvl-")){var o,i,r=e.attr("data-section"),s=e.attr("data-subsection"),l="checkbox"==e.prop("type"),c=JSON.parse(localStorage.getItem("M503"+r)),d="";if(void 0!==s?d=c[s][a]:void 0===(d=c[a])&&(d=c[idx],t=!0),void 0!==d){if(l?(e.tooltip("hide"),1==e.prop("checked")?"boolean"==typeof d?(o=!0,i=yes):"string"==typeof d?o=i=output:(o=1,i=high):"boolean"==typeof d?(o=!1,i=no):"string"==typeof d?o=i=pwm:(o=0,i=low),e.attr("data-bs-original-title",i),e.attr("aria-label",i)):o=e.val(),d!=o)try{return void 0!==s?c[s][a]=o:t?c[idx]=o:c[a]=o,localStorage.setItem("M503"+r,JSON.stringify(c)),!0}catch(e){console.log(e)}}else showToast(valUndefined+a+subSection+s+subSectionEnd),console.log("val undefined?!");return!1}}async function saveConfig(){sendGcode("M500"),getResponse()&&($("#restart-modal").modal("show"),showChangesPending(!1))}function removeValFeedback(){$("#accordion-settings input, #accordion-settings select").each((function(){$(this).removeClass("val-changed"),$(this).removeClass("val-failed")}))}function setGcodeHistory(){if(-1!=historyIndex){var e=$($("#historyitemscontainer").children())[historyIndex],t=$(e).find("span").text();$("#gcode").val(t),setTimeout((function(){$("#gcode").focus()}),100)}}function setLidIcon(e){var t=$("#card-lid").find("i");t.data("state",e),t.removeClass("fa-unlock fa-lock icon-unchecked icon-checked"),t.addClass("0"==e?"fa-unlock icon-unchecked":"fa-lock icon-checked"),setServoHorn(e)}function getCurrentTool(){var e=$("#tool-selection").val();return"-1"==e?-1:null!=e?parseInt(e.substring(1)):-1}function setServoHorn(e){var t=parseInt($("#Revolver-ServoOpen").val()),a=parseInt($("#Revolver-ServoClose").val()),n=getCurrentTool();-1!=n&&(a=parseInt($("#Close-"+n).val()));var o=e?90-a:90-t;if(!isNaN(o))if($("#lvc-horn").css({transform:"rotate("+o+"deg)"}),"#sec-live-control"==$(".nav-item.activeSection").data("section")){var i=e?a:t;$("#lvc-horn-image").attr("data-bs-original-title",i+" deg").tooltip("update")}else $("#sec-live-control .tooltip").each((function(){$(this).tooltip("hide")}))}async function recalculateSpeeds(){if(initDone){for(var e=[["Selector-MaxSpeed","X"],["Selector-AccelSpeed","X"],["Revolver-MaxSpeed","Y"],["Revolver-AccelSpeed","Y"],["Feeder-MaxSpeed","Z"],["Feeder-AccelSpeed","Z"],["Feeder-InsSpeed","Z"],["Feeder-PurgeSpeed","Z"]],t=0;t0&&a%50==0&&await sleep(100),$("#progress-upload .progress-bar").css("width",n+"%"),$("#progress-upload .progress-bar").text(parseInt(n)+"%"),uploadCancelled)break;pauseTransmission&&await getResume()}$("#progress-upload .progress-bar").css("width","100%"),$("#progress-upload .progress-bar").text("100%"),$("#firmware-file").val(""),setTimeout((function(){$("#firmware-upload-modal").modal("hide")}),2e3)}function showUserMessage(e){try{var t=JSON.parse(e.replaceAll('""','"')).UserMessage;t.startsWith("SD-Card removed.")||showUserInfo(t)}catch(e){console.log("Can't show User Message because: ",e)}}function showUserDialog(e){try{var t=JSON.parse(e);lastDlgId=t.UserDialog.Id;var a=t.UserDialog.Title,n=t.UserDialog.Message,o=t.UserDialog.Action,i=t.UserDialog.Buttons;gotDlgButton=!1,$("#usrdlg-title").html(''+a.replaceAll("\\n"," ")),$("#usrdlg-message").text(n.replaceAll("\\n","
")),$("#usrdlg-action").text(o.replaceAll("\\n","
"));var r=i.split("|");$("#btn-usrdlg-modal-1").addClass("d-none"),$("#btn-usrdlg-modal-2").addClass("d-none"),$("#btn-usrdlg-modal-3").addClass("d-none"),r.length>=1&&($("#btn-usrdlg-modal-1").text(r[0].trim()),$("#btn-usrdlg-modal-1").removeClass("d-none")),r.length>=2&&($("#btn-usrdlg-modal-2").text(r[1].trim()),$("#btn-usrdlg-modal-2").removeClass("d-none")),r.length>=3&&($("#btn-usrdlg-modal-3").text(r[2].trim()),$("#btn-usrdlg-modal-3").removeClass("d-none")),$("#usrdlg-modal").modal("show")}catch(e){console.log("Can't show User Dialog because: ",e)}}function sendDialogResult(e,t){sendGcode('{ "UserDialog": { "Id": '+e+', "Button": '+t+" } }",!1,!1,!0)}var sensor1Chart,sensor2Chart,isStandalone=!1,initDone=!1,initStarted=!1,seenOk=!1,seenError=!1,seenParserError=!1,prevLine="",configType="",currentSerial=-1,xlatedSpeed=0,collectResponse=!1,responseBuffer="",isPurging=!1,isBooting=!1,pauseTransmission=!1,temperature1=0,temperature2=0,humidity1=0,humidity2=0,heater1=0,heater1Target=0,heaterOn=!1,heaterTimeout=0,dryerFan1Speed=0,dryerFan2Speed=0,isDrying=!1,isHeaterSet=!1;function sleep(e){return new Promise((t=>setTimeout(t,e)))}function getResponse(){return new Promise((e=>gotOk(e)))}function getResume(){return new Promise((e=>gotXon(e)))}async function gotOk(e){for(var t=1e4;!seenOk;)await sleep(10),(t-=10)<=0&&e(!1);collectResponse=!1,e(!seenError)}async function gotXon(e){for(var t=1e4;pauseTransmission;)await sleep(10),(t-=10)<=0&&e(!1);e(!0)}async function connectHandler(){isTestRunning?($(".nav-item.activeSection").removeClass("activeSection"),$('.nav-item[data-section="#sec-testrun"]').trigger("click")):await requestInit()?hideConnect():(isStandalone||await disconnectSerial(),showConnect())}async function sendGcode(e,t,a,n=!0){if(console.log("Gcode: "+e),seenOk=!1,seenError=!1,0!=e.length){e.trim().toUpperCase().startsWith("M20L")&&(responseBuffer="",collectResponse=!0),e.trim().toUpperCase().startsWith("G1")&&(e.toUpperCase().indexOf("X")>-1&&$("#selector-pwr-off").addClass("hidden"),e.toUpperCase().indexOf("Z")>-1&&$("#feeder-pwr-off").addClass("hidden")),e.trim().toUpperCase().startsWith("M500")&&showChangesPending(!1);var o=e;n&&(e+="\r\n"),await(isStandalone?writeSerial(e):writeWebSerial(e)),await sleep(5),t&&addSentGcode(o),a&&$("#gcode").focus()}}async function sendChar(e){await(isStandalone?writeSerial(e):writeWebSerial(e))}function sendCharSync(e){isStandalone?writeSerial(e):writeWebSerial(e)}function sendPFKey(e){var t=String.fromCharCode(27,91,79,e);console.log("Seq: "+t),addSentGcode("[PF"+String.fromCharCode(e-31,93)),sendGcode(t,!1,!0)}async function sendInitSeq(e){var t=3,a=!1;do{if(sendGcode(e,!1,!1),await getResponse()&&!seenParserError){a=!0;break}showInfo(connectionFailedRetry),await sleep(1e3),cancelInfo(),t--}while(t>0);return a}async function requestTMCInit(){if(curFWVersion>=3.11)await sendInitSeq("M122W99");else{await sendInitSeq("M17");for(var e=0;e<4&&await sendInitSeq("M122W"+e);e++);}initDone=!0}async function requestInit(){try{if(1==initStarted)return!1;initStarted=!0,initDone=!1,addSentGcode(wiInitStart),showInfo(fetchingSettings);var e=!0;if(isStandalone&&(await sendInitSeq("M155S0")||(e=!1)),await sendInitSeq("M115")||(e=!1),e){var t=[];t=curFWVersion>=3.11?['M205P"WebInterface"S1',"M111W1","M503S0W",'M20S"/test" F"" W',"M155S1"]:['M205P"WebInterface"S1',"M111W1","M503S0W","M503S6W","M503S7W","M503S8W",'M20S"/test" F"" W','M205P"SendStats"S1'];for(var a=0;a

"+e.substring(11)+"

"),void addReceivedGcode(e.replaceAll(" "," "))}if(e.startsWith("ok")){if(seenOk=!0,(isShowingLoading||isShowingUnloading)&&((isShowingLoading&&!isPurging||isShowingUnloading)&&cancelInfo(),isShowingLoading=!1,isShowingUnloading=!1),!initDone)return}else if(e.startsWith("error:")||e.startsWith("echo: error"))seenError=!0,"BUSY"==e.substring(7)&&showToast(smuffBusy),console.log("Errors seen: "+seenError+" [ "+prevLine+" ]");else if("start"==e)isBooting=!1,cancelInfo(),initDone&&(setTimeout((function(){showInfo(fetchingSettings)}),1e3),requestInit());else if(e.indexOf("echo: ")>-1)if(e.indexOf(" dbg:")>-1)e.indexOf("setup start")>0&&(isBooting=!0,initDone=!0,showInfo(bootingMsg));else{if(e.indexOf(" Serial:")>-1)return currentSerial=parseInt(e.substring(e.indexOf(" Serial:")+9)),void $("#curSerial"+currentSerial).removeClass("hidden");if(e.indexOf(" states:")>-1)return void setStatus(e);if(e.indexOf(" testrun:")>-1)return setTestResults(e),void showTestRunning(!0);if(e.indexOf(" purging:")>-1)return void("done"==e.substring(e.indexOf(" purging:")+9)?(isPurging=!1,cancelInfo()):(isPurging=!0,showPurging(e.substring(e.indexOf(" purging:")+9))));if(e.indexOf(" speed:")>-1)return void(xlatedSpeed=e.substring(e.indexOf(" speed:")+7));if(e.indexOf(" update:")>-1){var t=e.indexOf(" update:")+8;return"done"==e.substring(t)&&console.log("Update done!"),"failed"==e.substring(t)&&console.log("Update failed!"),void("progress"==e.substring(t)&&(progress=e.substring(t+9),console.log("Update progress: "+progress+"%")))}if(e.indexOf(" WI-CMD:")>-1){t=e.indexOf(" WI-CMD:")+8;return void addReceivedGcode(e.replaceAll(" "," ").replaceAll("\n","
"))}if((e.indexOf(" INT")>-1||e.indexOf(" EXT")>-1)&&(setRelayState(e.substring(e.indexOf("echo: ")+6)),!initDone))return}else if(e.startsWith("FIRMWARE_NAME"))setFWInfo(e);else{if(e.startsWith("Unknown parameter 'WebInterface"))return initDone=!0,void showError("Apparently, this SMuFF-Firmware version is less than 2.26! Please update your firmware for this app.");if(e.startsWith("/*")){if(configType=e.replace("/*","").replace("*/","").trim(),!initDone)return void(configType.startsWith("Testscripts")&&(addTestFiles(configType.substring(12)),configType=""))}else if(e.startsWith('{"')){if(e.indexOf("UserMessage")>-1)return void showUserMessage(e);if(e.indexOf("UserDialog")>-1)return void showUserDialog(e);if(e.indexOf("PlaySequence")>-1)return void playSequence(e);if(e.indexOf("TMCStatus")>-1&&(configType="TMC"),setSettings(e,configType),!initDone)return}else for(var a=["M17","M111","M122","M155","M205","M503"],n=0;n0?a.data[e.index-1]:0,val=a.data[e.index],lbl=a.label+": ",0==e.datasetIndex?lbl+val+"% RH":lbl+val+"°C"}function tooltipAfterLabelCb(e,t){var a=t.datasets[e.datasetIndex];return prev=e.index>0?a.data[e.index-1]:0,val=a.data[e.index],delta="Δ "+(val-prev>=0?"+":"")+(val-prev).toFixed(1),0==e.datasetIndex?delta+"%":delta+"°C"}function initSensorCharts(){sensor1Chart.options.elements.point.radius=2,sensor2Chart.options.elements.point.radius=2,sensor1Chart.data.labels=[];for(var e=0;e15){sensor1Chart.data.labels.shift();for(var c=0;c15){sensor2Chart.data.labels.shift();for(c=0;c",{text:"None"})),(dryerProfilesJson=JSON.parse(dryerProfiles)).Profile))null!=t&&null!=t.Name&&e.append($("
"),o.append(''+(""!=toolColors[n]?"(":"")+toolColors[n]+(""!=toolColors[n]?")":"")+""),o.attr("id","slot"+n),t.append(o);var i=$("#swap-item-template").clone(!0);i.text(i.text()+(void 0===swapTools[n]?n:swapTools[n])),i.attr("id","swap-tool"+n),i.attr("data-id","st-"+swapTools[n]),i.css("cursor","grab"),i.append(''),a.append(i)}}}var port,textEncoder,writableStream,writer,readableStream,reader,current_fs,next_fs,previous_fs,left,opacity,scale,animating;async function connectSerial(e=115200){try{port=await navigator.serial.requestPort(),showInfo(openingPort),await port.open({baudRate:e,bufferSize:64}).then((function(){$("#info-message").html(serialPortOpen),textEncoder=new TextEncoderStream,writableStream=textEncoder.readable.pipeTo(port.writable),writer=textEncoder.writable.getWriter(),listenToSerial(),connectHandler()}))}catch{cancelInfo(),showConnectingMessage("fast",serialConnectionFail,null)}}async function disconnectSerial(){try{reader&&(await reader.cancel(),await readableStream.catch((()=>{})),reader=null,readableStream=null),writer&&(await writer.close(),await writableStream,writer=null,writableStream=null),port&&(await port.close(),port=null)}catch(e){console.log(e)}}async function listenToSerial(){const e=new TextDecoderStream;readableStream=port.readable.pipeTo(e.writable),reader=e.readable.getReader(),portListener=!0;try{for(var t="";;){const{value:e,done:o}=await reader.read();if(e)-1!=e.indexOf("")&&(pauseTransmission=!0,console.log("XOff"),t+=e.replaceAll("","")),-1!=e.indexOf("")?(pauseTransmission=!1,console.log("XOn"),t+=e.replaceAll("","")):t+=e;for(;t.length;){var a=t.indexOf("\n");if(-1==a)break;var n=t.substring(0,a);await parseResponse(n),collectResponse&&"ok"!=n&&(responseBuffer+=n+"\n"),t=t.substring(a+1)}if(o){reader.releaseLock();break}}}catch(e){console.log(e),disconnectSerial()}portListener=!1,showConnect()}async function writeWebSerial(e){await writer.write(e)}$(document).ready((function(){$("#Tools").on("change",(function(){var e=getToolCount(),t=$("#tool-selection");t.empty(),t.append('');for(var a=0;aT'+a+"");for(a=MAX_TOOLS-1;a>=e;a--)$("#tst-t"+a).parent().hide();setupMaterials(),hasV6S||setupServoMappings(),setupLiveControl(),setupSwaps(),hasV6S&&setupStepperMappings()})),$("#SpdsInMms").on("click",(function(){setTimeout((function(){recalculateSpeeds()}),750)})),$("#Feeder-SharedStepper").on("change",(function(){setDisabled(!(hasSharedStepper=$(this).is(":checked")),".hasSharedStepper"),setDisabled(!hasSharedStepper,".hasNotExtCtrl")})),$("#Feeder-UseEStop2").on("change",(function(){setDisabled(!$(this).is(":checked"),".has2ndEndstop")})),$("#Feeder-ExtCtrl").on("change",(function(){hasExtCtrl=$(this).is(":checked"),hasDDE||hasSharedStepper||setDisabled(hasExtCtrl,".hasNotExtCtrl")})),$("#UseCutter").on("change",(function(){setDisabled(!$(this).is(":checked"),".hasCutter")})),$("#Revolver-UseServo").on("change",(function(){hasV6S&&$(this).removeAttr("checked"),setDisabled(!$(this).is(":checked"),".hasServo"),hasV6S||setDisabled(!$(this).is(":checked"),".hasServoOpt")})),$("#InvRelay").on("change",(function(){initDone&&setTimeout((async function(){sendGcode("M17",!0,!1),await getResponse()}),500)})),$("#Selector-TMC-Mode").on("change",(function(){1==$(this).val()?($("#Selector-TMC-Params").show("slow"),$("#Selector-MS3").val(0).trigger("change")):$("#Selector-TMC-Params").hide("slow")})),$("#Feeder-TMC-Mode").on("change",(function(){1==$(this).val()?($("#Feeder-TMC-Params").show("slow"),$("#Feeder-MS3").val(0).trigger("change")):$("#Feeder-TMC-Params").hide("slow")})),$("#Revolver-TMC-Mode").on("change",(function(){1==$(this).val()?($("#Revolver-TMC-Params").show("slow"),$("#Revolver-MS3").val(0).trigger("change"),hasDDE||$("#Revolver-UseServo").prop("checked",!1).trigger("change")):$("#Revolver-TMC-Params").hide("slow")})),$("#Selector-MS3").on("change",(function(){$(this).val()>0&&$("#Selector-TMC-Mode").val(0).trigger("change")})),$("#Feeder-MS3").on("change",(function(){$(this).val()>0&&$("#Feeder-TMC-Mode").val(0).trigger("change")})),$("#Revolver-MS3").on("change",(function(){$(this).val()>0&&$("#Revolver-TMC-Mode").val(0).trigger("change")}))}));class Upload{constructor(){}doUpload(e,t,a,n,o){var i=new FormData(e);$.ajax({type:"POST",url:t,xhr:function(){var e=$.ajaxSettings.xhr();return e.upload&&e.upload.addEventListener("progress",a,!1),e},success:function(e){null!=n&&n(e)},error:function(e){null!=o&&o(e)},async:!0,data:i,cache:!1,contentType:!1,processData:!1,timeout:6e4})}}function resetWizard(){$("#msform fieldset").each((function(){$(this).css("opacity",0),$(this).css("transform","scale(1)"),$(this).css("display","none")})),previous_fs=null,next_fs=null,$("#progressbar li").removeClass("active"),(current_fs=$("#fs-welcome")).css("opacity",1),current_fs.css("transform","scale(1)"),current_fs.css("display","block"),$("#progressbar li").eq($("fieldset").index(current_fs)).addClass("active")}$(document).ready((function(){$("#wizard-modal .next.action-button").click((function(){if(animating)return!1;animating=!0,current_fs=$(this).parent(),next_fs=$(this).parent().next(),$("#progressbar li").eq($("fieldset").index(next_fs)).addClass("active"),next_fs.show(),current_fs.animate({opacity:0},{step:function(e,t){scale=1-.2*(1-e),left=50*e+"%",opacity=1-e,current_fs.css({transform:"scale("+scale+")"}),next_fs.css({left:left,opacity:opacity})},duration:800,complete:function(){current_fs.hide(),animating=!1},easing:"easeInOutBack"})})),$("#wizard-modal .previous.action-button").click((function(){if(animating)return!1;animating=!0,current_fs=$(this).parent(),previous_fs=$(this).parent().prev(),$("#progressbar li").eq($("fieldset").index(current_fs)).removeClass("active"),previous_fs.show(),current_fs.animate({opacity:0},{step:function(e,t){scale=.8+.2*(1-e),left=50*(1-e)+"%",opacity=1-e,current_fs.css({left:left}),previous_fs.css({transform:"scale("+scale+")",opacity:opacity})},duration:800,complete:function(){current_fs.hide(),animating=!1},easing:"easeInOutBack"})})),$("#wizard-modal .cancel").click((function(){hideWizard(),resetWizard(),$("#wizard-disable").is(":checked")&&(localStorage.setItem("ShowWizard",never),localStorage.setItem("LastWizardDevice",$("#devname-label").text()))})),$("#wizard-modal .submit").click((function(){return hideWizard(),localStorage.setItem("ShowWizard",no),localStorage.setItem("LastWizardDevice",$("#wizard-device").val()),storeWizard(),resetWizard(),!1})),$("input:checkbox[name^=wizard-]").change((function(){var e=$(this).is(":checked")?yes:no;$(this).parent().parent().next().text(e),"wizard-is-marlin"==$(this).prop("name")&&e==yes&&($("#wizard-is-duet").prop("checked",""),$("#wizard-is-pmmu").prop("checked",""),$("#wizard-is-duet").parent().parent().next().text(no),$("#wizard-is-pmmu").parent().parent().next().text(no)),"wizard-is-pmmu"==$(this).prop("name")&&e==yes&&($("#wizard-is-duet").prop("checked",""),$("#wizard-is-marlin").prop("checked",""),$("#wizard-is-duet").parent().parent().next().text(no),$("#wizard-is-marlin").parent().parent().next().text(no)),"wizard-is-duet"==$(this).prop("name")&&e==yes&&($("#wizard-is-pmmu").prop("checked",""),$("#wizard-is-marlin").prop("checked",""),$("#wizard-is-marlin").parent().parent().next().text(no),$("#wizard-is-pmmu").parent().parent().next().text(no)),$("#wizard-is-pmmu").is(":checked")||$("#wizard-is-marlin").is(":checked")||$("#wizard-is-duet").is(":checked")||($("#wizard-is-marlin").prop("checked","checked"),$("#wizard-is-marlin").parent().parent().next().text(yes))}))})); \ No newline at end of file +window.innerWidth<768&&[].slice.call(document.querySelectorAll("[data-bss-disabled-mobile]")).forEach((function(e){e.classList.remove("animated"),e.removeAttribute("data-bss-hover-animate"),e.removeAttribute("data-aos")})),document.addEventListener("DOMContentLoaded",(function(){[].slice.call(document.querySelectorAll("[data-bss-tooltip]")).map((function(e){return new bootstrap.Tooltip(e)}));var e=document.querySelectorAll('[data-bs-toggle="toast"]');for(var t of e)t.addEventListener("click",(function(){var e=t.getAttribute("data-bs-target");if(e)try{var a=document.querySelector(e);if(!a)return;new bootstrap.Toast(a).show()}catch(e){console.error(e)}}));var a=document.querySelectorAll("[data-bss-chart]");for(var n of a)n.chart=new Chart(n,JSON.parse(n.dataset.bssChart))}),!1),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Sortable=t()}(this,(function(){"use strict";function e(t){return(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 t(){return(t=Object.assign||function(e){for(var t=1;t"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){return!1}return!1}}function m(e,t,a,n){if(e){a=a||document;do{if(null!=t&&(">"===t[0]?e.parentNode===a&&g(e,t):g(e,t))||n&&e===a)return e;if(e===a)break}while(e=(o=e).host&&o!==document&&o.host.nodeType?o.host:o.parentNode)}var o;return null}var v,b=/\s+/g;function $(e,t,a){if(e&&t)if(e.classList)e.classList[a?"add":"remove"](t);else{var n=(" "+e.className+" ").replace(b," ").replace(" "+t+" "," ");e.className=(n+(a?" "+t:"")).replace(b," ")}}function w(e,t,a){var n=e&&e.style;if(n){if(void 0===a)return document.defaultView&&document.defaultView.getComputedStyle?a=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(a=e.currentStyle),void 0===t?a:a[t];t in n||-1!==t.indexOf("webkit")||(t="-webkit-"+t),n[t]=a+("string"==typeof a?"":"px")}}function S(e,t){var a="";if("string"==typeof e)a=e;else do{var n=w(e,"transform");n&&"none"!==n&&(a=n+" "+a)}while(!t&&(e=e.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(a)}function y(e,t,a){if(e){var n=e.getElementsByTagName(t),o=0,i=n.length;if(a)for(;o=o.left-i&&e<=o.right+i,s=t>=o.top-i&&t<=o.bottom+i;return i&&r&&s?a=n:void 0}})),a}((e=e.touches?e.touches[0]:e).clientX,e.clientY);if(t){var a={};for(var n in e)e.hasOwnProperty(n)&&(a[n]=e[n]);a.target=a.rootEl=t,a.preventDefault=void 0,a.stopPropagation=void 0,t[R]._onDragOver(a)}}}function Pe(e){H&&H.parentNode[R]._isOutsideThisEl(e.target)}function We(e,n){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=n=t({},n),e[R]=this;var o={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Me(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==We.supportPointer&&"PointerEvent"in window&&!c,emptyInsertThreshold:5};for(var i in z.initializePlugins(this,e,o),o)i in n||(n[i]=o[i]);for(var r in Ee(n),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));this.nativeDraggable=!n.forceFallback&&Te,this.nativeDraggable&&(this.options.touchStartThreshold=1),n.supportPointer?h(e,"pointerdown",this._onTapStart):(h(e,"mousedown",this._onTapStart),h(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(h(e,"dragover",this),h(e,"dragenter",this)),ve.push(this.el),n.store&&n.store.get&&this.sort(n.store.get(this)||[]),t(this,function(){var e,t=[];return{captureAnimationState:function(){t=[],this.options.animation&&[].slice.call(this.el.children).forEach((function(e){if("none"!==w(e,"display")&&e!==We.ghost){t.push({target:e,rect:D(e)});var n=a({},t[t.length-1].rect);if(e.thisAnimationDuration){var o=S(e,!0);o&&(n.top-=o.f,n.left-=o.e)}e.fromRect=n}}))},addAnimationState:function(e){t.push(e)},removeAnimationState:function(e){t.splice(function(e,t){for(var a in e)if(e.hasOwnProperty(a))for(var n in t)if(t.hasOwnProperty(n)&&t[n]===e[a][n])return Number(a);return-1}(t,{target:e}),1)},animateAll:function(a){var n=this;if(!this.options.animation)return clearTimeout(e),void("function"==typeof a&&a());var o=!1,i=0;t.forEach((function(e){var t=0,a=e.target,r=a.fromRect,s=D(a),l=a.prevFromRect,c=a.prevToRect,d=e.rect,u=S(a,!0);u&&(s.top-=u.f,s.left-=u.e),a.toRect=s,a.thisAnimationDuration&&F(l,s)&&!F(r,s)&&(d.top-s.top)/(d.left-s.left)==(r.top-s.top)/(r.left-s.left)&&(t=function(e,t,a,n){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-a.top,2)+Math.pow(t.left-a.left,2))*n.animation}(d,l,c,n.options)),F(s,r)||(a.prevFromRect=r,a.prevToRect=s,t||(t=n.options.animation),n.animate(a,d,s,t)),t&&(o=!0,i=Math.max(i,t),clearTimeout(a.animationResetTimer),a.animationResetTimer=setTimeout((function(){a.animationTime=0,a.prevFromRect=null,a.fromRect=null,a.prevToRect=null,a.thisAnimationDuration=null}),t),a.thisAnimationDuration=t)})),clearTimeout(e),o?e=setTimeout((function(){"function"==typeof a&&a()}),i):"function"==typeof a&&a(),t=[]},animate:function(e,t,a,n){if(n){w(e,"transition",""),w(e,"transform","");var o=S(this.el),i=o&&o.a,r=o&&o.d,s=(t.left-a.left)/(i||1),l=(t.top-a.top)/(r||1);e.animatingX=!!s,e.animatingY=!!l,w(e,"transform","translate3d("+s+"px,"+l+"px,0)"),this.forRepaintDummy=function(e){return e.offsetWidth}(e),w(e,"transition","transform "+n+"ms"+(this.options.easing?" "+this.options.easing:"")),w(e,"transform","translate3d(0,0,0)"),"number"==typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout((function(){w(e,"transition",""),w(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1}),n)}}}}())}function Ne(e,t,a,n,o,i,l,c){var d,u,p=e[R],h=p.options.onMove;return!window.CustomEvent||r||s?(d=document.createEvent("Event")).initEvent("move",!0,!0):d=new CustomEvent("move",{bubbles:!0,cancelable:!0}),d.to=t,d.from=e,d.dragged=a,d.draggedRect=n,d.related=o||t,d.relatedRect=i||D(t),d.willInsertAfter=c,d.originalEvent=l,e.dispatchEvent(d),h&&(u=h.call(p,d,l)),u}function Ae(e){e.draggable=!1}function Re(){Se=!1}function _e(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,a=t.length,n=0;a--;)n+=t.charCodeAt(a);return n.toString(36)}function Le(e){return setTimeout(e,0)}function ze(e){return clearTimeout(e)}Ce&&document.addEventListener("click",(function(e){if(me)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),me=!1}),!0),We.prototype={constructor:We,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(ue=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,H):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,a=this.el,n=this.options,o=n.preventOnFilter,i=e.type,r=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,s=(r||e).target,l=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,d=n.filter;if(function(e){ye.length=0;for(var t=e.getElementsByTagName("input"),a=t.length;a--;){var n=t[a];n.checked&&ye.push(n)}}(a),!H&&!(/mousedown|pointerdown/.test(i)&&0!==e.button||n.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!c||!s||"SELECT"!==s.tagName.toUpperCase())&&!((s=m(s,n.draggable,a,!1))&&s.animated||J===s)){if(Z=M(s),ee=M(s,n.draggable),"function"==typeof d){if(d.call(this,e,s,this))return G({sortable:t,rootEl:l,name:"filter",targetEl:s,toEl:a,fromEl:a}),B("filter",t,{evt:e}),void(o&&e.cancelable&&e.preventDefault())}else if(d&&(d=d.split(",").some((function(n){if(n=m(l,n.trim(),a,!1))return G({sortable:t,rootEl:n,name:"filter",targetEl:s,fromEl:a,toEl:a}),B("filter",t,{evt:e}),!0}))))return void(o&&e.cancelable&&e.preventDefault());n.handle&&!m(l,n.handle,a,!1)||this._prepareDragStart(e,r,s)}}},_prepareDragStart:function(e,t,a){var n,o=this,i=o.el,c=o.options,d=i.ownerDocument;if(a&&!H&&a.parentNode===i){var u=D(a);if(q=i,V=(H=a).parentNode,Y=H.nextSibling,J=a,ae=c.group,oe={target:We.dragged=H,clientX:(t||e).clientX,clientY:(t||e).clientY},le=oe.clientX-u.left,ce=oe.clientY-u.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,H.style["will-change"]="all",n=function(){B("delayEnded",o,{evt:e}),We.eventCanceled?o._onDrop():(o._disableDelayedDragEvents(),!l&&o.nativeDraggable&&(H.draggable=!0),o._triggerDragStart(e,t),G({sortable:o,name:"choose",originalEvent:e}),$(H,c.chosenClass,!0))},c.ignore.split(",").forEach((function(e){y(H,e.trim(),Ae)})),h(d,"dragover",Oe),h(d,"mousemove",Oe),h(d,"touchmove",Oe),h(d,"mouseup",o._onDrop),h(d,"touchend",o._onDrop),h(d,"touchcancel",o._onDrop),l&&this.nativeDraggable&&(this.options.touchStartThreshold=4,H.draggable=!0),B("delayStart",this,{evt:e}),!c.delay||c.delayOnTouchOnly&&!t||this.nativeDraggable&&(s||r))n();else{if(We.eventCanceled)return void this._onDrop();h(d,"mouseup",o._disableDelayedDrag),h(d,"touchend",o._disableDelayedDrag),h(d,"touchcancel",o._disableDelayedDrag),h(d,"mousemove",o._delayedDragTouchMoveHandler),h(d,"touchmove",o._delayedDragTouchMoveHandler),c.supportPointer&&h(d,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(n,c.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){H&&Ae(H),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;f(e,"mouseup",this._disableDelayedDrag),f(e,"touchend",this._disableDelayedDrag),f(e,"touchcancel",this._disableDelayedDrag),f(e,"mousemove",this._delayedDragTouchMoveHandler),f(e,"touchmove",this._delayedDragTouchMoveHandler),f(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?h(document,"pointermove",this._onTouchMove):h(document,t?"touchmove":"mousemove",this._onTouchMove):(h(H,"dragend",this),h(q,"dragstart",this._onDragStart));try{document.selection?Le((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(e,t){if(ge=!1,q&&H){B("dragStarted",this,{evt:t}),this.nativeDraggable&&h(document,"dragover",Pe);var a=this.options;e||$(H,a.dragClass,!1),$(H,a.ghostClass,!0),We.active=this,e&&this._appendGhost(),G({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(ie){this._lastX=ie.clientX,this._lastY=ie.clientY,Ie();for(var e=document.elementFromPoint(ie.clientX,ie.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(ie.clientX,ie.clientY))!==t;)t=e;if(H.parentNode[R]._isOutsideThisEl(e),t)do{if(t[R]&&t[R]._onDragOver({clientX:ie.clientX,clientY:ie.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break;e=t}while(t=t.parentNode);Fe()}},_onTouchMove:function(e){if(oe){var t=this.options,a=t.fallbackTolerance,n=t.fallbackOffset,o=e.touches?e.touches[0]:e,i=X&&S(X,!0),r=X&&i&&i.a,s=X&&i&&i.d,l=De&&fe&&E(fe),c=(o.clientX-oe.clientX+n.x)/(r||1)+(l?l[0]-we[0]:0)/(r||1),d=(o.clientY-oe.clientY+n.y)/(s||1)+(l?l[1]-we[1]:0)/(s||1);if(!We.active&&!ge){if(a&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))n.right+10||e.clientX<=n.right&&e.clientY>n.bottom&&e.clientX>=n.left:e.clientX>n.right&&e.clientY>n.top||e.clientX<=n.right&&e.clientY>n.bottom+10}(e,i,this)&&!v.animated){if(v===H)return z(!1);if(v&&r===e.target&&(s=v),s&&(n=D(s)),!1!==Ne(q,r,H,t,s,n,e,!!s))return L(),r.appendChild(H),V=r,U(),z(!0)}else if(s.parentNode===r){n=D(s);var b,S,y,C=H.parentNode!==r,T=!function(e,t,a){var n=a?e.left:e.top,o=a?e.right:e.bottom,i=a?e.width:e.height,r=a?t.left:t.top,s=a?t.right:t.bottom,l=a?t.width:t.height;return n===r||o===s||n+i/2===r+l/2}(H.animated&&H.toRect||t,s.animated&&s.toRect||n,i),E=i?"top":"left",I=k(s,"top","top")||k(H,"top","top"),F=I?I.scrollTop:void 0;if(ue!==s&&(S=n[E],be=!1,$e=!T&&l.invertSwap||C),0!==(b=function(e,t,a,n,o,i,r,s){var l=n?e.clientY:e.clientX,c=n?a.height:a.width,d=n?a.top:a.left,u=n?a.bottom:a.right,p=!1;if(!r)if(s&&he canvas").chart,sensor2Chart=document.querySelector("#ChartSensor2 > canvas").chart}function initUI2(){$("#relay-status").css("background-color",$(".card").css("color")),$("#relay-status").css("color",$(".card").css("background-color"))}function addSentGcode(e){if(null!=e){var t=$("#console-text-container"),a=$("#send-template").clone(!0);a.attr("id",""),a.removeClass("hidden"),a.text(e),t.append(a)}}async function addReceivedGcode(e){if(null!=e){$("#console-text-container span").length>3e3&&$("#console-text-container").find("span:first").remove();var t=$("#console-text-container"),a=$("#receive-template").clone(!0);a.attr("id",""),a.removeClass("hidden"),a.html(replaceTermAttr(e)),t.append(a),autoScroll&&(t[0].scrollTop=t[0].scrollHeight)}}function replaceTermAttr(e){var t=e.replace(/\x1b\[0m/g,"");t=t.replace(/\x1b\[1m/g,'');for(var a=/\x1b\[(\d+)m/g;m=a.exec(t);){var n="";m[1]>=30&&m[1]<=37?n="fgc"+m[1]:m[1]>=40&&m[1]<=47&&(n="bgc"+m[1]),t=t.replace(new RegExp("\\x1b\\["+m[1]+"m","g"),'')}return t}function createHistoryItem(e){if(null!=e){for(var t=0,a=$("#historyitemscontainer"),n=0;n-1&&(a=a.replace("/wi/","")),$(this).prop("src",a)}})),sitePrefix=githubPrefix,console.log("Image sources changed to Github...")}$.get("platform.txt",(function(e){$("#platform").text(e)})).fail((function(){location.host.startsWith("localhost")?$("#platform").text("Localhost"):$("#platform").text("Unknown Platform")})),$("#platform").removeClass("d-none"),curWIVersion=parseFloat($("#version-info").text().substring(1)),$.get(githubPrefix+"/wiversion.txt",(function(e){lastWIVersion=parseFloat(e),console.log("Lastest SMuFF-WI version: "+lastWIVersion),$("#update-note").text($("#update-note").text().replace("{VER}",lastWIVersion)),lastWIVersion>curWIVersion&&$("#update-note").removeClass("d-none")})).fail((function(){console.log("Not able to retrieve lastest SMuFF-WI version!"),$("#update-note").text(noWiVersion).removeClass("d-none")}))}$.get(githubPrefix+"/fwversion.txt",(function(e){console.log("Lastest SMuFF Firmware version: "+e),lastFWVersion=parseFloat(e)})),window.onscroll=function(){$(window).scrollTop()>35?($("#top-info").css("transform-origin","0 0"),$("#top-info").css("transform","scale(1, .65)"),$("#content").css("padding-top",hasDryer?"190px":"160px"),$("#settings-header").css("top","105px")):($("#top-info").css("transform","scale(1, 1)"),$("#content").css("padding-top",hasDryer?"230px":"200px"),$("#settings-header").css("top","200px"))};var t=$('');if(t.appendTo("head"),null!=localStorage.getItem("Theme")){var a=localStorage.getItem("Theme");$("#themes").val(a),t.attr("href",a).promise().done((function(){initUI(),setTimeout((function(){initUI2()}),1e3)}))}else initUI(),initUI2(),initSensorCharts();for(var n=0;n<3;n++)versionMismatch[n]=0;$("#themes").on("change",(function(){t.attr("href",$(this).val()).promise().done((function(){setTimeout((function(){initUI2()}),1e3)})),localStorage.setItem("Theme",$(this).val())}));var o=[].slice.call(document.querySelectorAll(".toast")).map((function(e){return new bootstrap.Toast(e)}));toastVersion=o[0],toastMain=o[1],swapSortable=Sortable.create(toolsswaplist,{swap:!0,swapClass:"swapping-highlight",animation:250,store:{get:function(e){},set:function(e){var t=swapSortable.toArray(),a=0;t.forEach((function(e){swapTools[a++]=parseInt(e.substring(3))}))}}});var i,r=Sortable.create(historyitemscontainer,{swap:!1,swapClass:"swapping-highlight",animation:250,store:{get:function(){var e=localStorage.getItem("CmdHistory");if(void 0!==e){var t=JSON.parse(e);null!=t&&t.forEach((function(e){createHistoryItem(e)}))}},set:function(){for(var e="[ ",t=$("#historyitemscontainer"),a=0;a=t.children().length&&(historyIndex=0),setGcodeHistory())})),$("body").on("keydown",(function(e){var t=e.keyCode||e.which;t>=112&&t<=115&&(e.preventDefault(),sendPFKey(t-32)),e.ctrlKey&&"s"===e.key&&(e.preventDefault(),$("#btn-save-settings").trigger("click")),e.ctrlKey&&"r"===e.key&&(e.preventDefault(),$("#btn-reload-settings").trigger("click"))})),$("#version-info, #release-notes").on("click",(function(){$("#recent-changes-modal").modal("show")})),$("#logo, #smuff").on("click",(function(){location.href="https://sites.google.com/view/the-smuff/"})),$("#btn-send-gcode").on("click",(async function(){var e=$("#gcode").val();null!=e&&e.length>0&&(historyIndex=-1,createHistoryItem(e),sendGcode(e,!0,!0),await getResponse()),$("#gcode").val("")})),$("#btn-clear-gcode").on("click",(function(){$("#console-text-container").empty()})),$("#btn-pf1").on("click",(function(){sendPFKey(80)})),$("#btn-pf2").on("click",(function(){sendPFKey(81)})),$("#btn-pf3").on("click",(function(){sendPFKey(82)})),$("#btn-pf4").on("click",(function(){sendPFKey(83)})),$("#btn-home").on("click",(function(){sendGcode("G28",!0,!0),moveCarrierG1=!1})),$("#btn-motors-off").on("click",(function(){sendGcode("M18",!0,!0)})),$("#btn-tool-maint").on("click",(function(){sendGcode("TM",!0,!0)})),$("#btn-wipe").on("click",(function(){sendGcode("G12",!0,!0)})),$("#btn-cut").on("click",(function(){sendGcode("G12C",!0,!0)})),$("#btn-load").on("click",(async function(){sendGcode("M700",!0,!0),showLoading(!1),await getResponse(),cancelInfo()})),$("#btn-unload").on("click",(async function(){$("#UseCutter").is(":checked")&&animateCutter(!1),sendGcode("M701",!0,!0),showUnloading(!1),await getResponse(),cancelInfo(),$("#UseCutter").is(":checked")&&animateCutterEnd()})),$("#btn-load-to-nozzle").on("click",(function(){sendGcode("M700N",!0,!0),showLoading(!1)})),$("#btn-load-to-splitter").on("click",(async function(){sendGcode("M700S",!0,!0),showLoading(!0)})),$("#btn-unload-from-splitter").on("click",(async function(){sendGcode("M701S",!0,!0),showUnloading(!0)})),$("#btn-reset").on("click",(function(){sendGcode("M999",!0,!0)})),$("#btn-view-script").on("click",(async function(){var e=$("#test-files option:selected").text();""!=e&&(sendGcode('M20L"test/'+e+'.gcode"'),await getResponse(),""!=responseBuffer&&($("#script-name").text(e),$("#script-content").val(responseBuffer),$("#view-script-modal").modal("show")))})),$("#btn-run-test").on("click",(async function(){var e;if("stopped"==$(this).data("state")){var t=$("#test-files option:selected").text();localStorage.setItem("runningScript",t),sendGcode('M98P"'+t+'"',!0,!1),await getResponse(),e=!0,testCancelled=0}else localStorage.setItem("runningScript",""),sendChar(""),e=!1,testCancelled=(new Date).getTime();showTestRunning(e)})),$("#btn-save-settings").on("click",(function(){showToast(savingSettings),saveConfig(),removeValFeedback()})),$("#btn-reload-settings").on("click",(function(){showToast(reloadingSettings),requestInit(),removeValFeedback()})),$("#btn-reset-swaps").on("click",(function(){var e=swapSortable.toArray();e.sort(),swapSortable.sort(e,!0),swapSortable.save()})),$("#btn-save-swaps").on("click",(async function(){for(var e="{ ",t=MAX_TOOLS,a=0;a0&&("firmware.bin"===e.target.files[0].name||"littlefs.bin"===e.target.files[0].name||"smuff.bin"===e.target.files[0].name)&&$("#btn-upload-esp-firmware").prop("disabled","").removeClass("disabled")})),$("#btn-upload-esp-firmware").on("click",(function(){showElement("#upload-progress",!1,!1),setDisabled(!0,"#btn-upload-esp-firmware"),$("#progress-esp-upload .progress-bar").css("width","0%").text("0%"),(new Upload).doUpload($("#upload-form")[0],"uploadBinary",(function(e){var t=0,a=e.loaded||e.position,n=e.total;e.lengthComputable&&(t=Math.ceil(a/n*100)),$("#progress-esp-upload .progress-bar").css("width",t+"%").text(t+"%")}),(function(e){console.log(uploadSuccess),$("#file-input-firmware")[0].value="",$("#uploading-label").text(uploadSuccess),setTimeout((function(){hideElement("#upload-progress",!1,!1),$("#esp-firmware-upload-modal").modal("hide"),showConnect(),window.location.reload(!0)}),8e3)}),(function(e){console.log(uploadFailed),$("#file-input-firmware")[0].value="",$("#uploading-label").text(uploadFailed)}))})),$("#card-relay").on("click",(async function(){if(hasSharedStepper&&!isTestRunning){var e="I"==$(this).find("span#state").data("state")?"E":"I";$(this).find("span#state").data("state",e),setRelayState(e),sendGcode("M17"+e,!0,!1),await getResponse()}})),$("#card-lid").on("click",(async function(){if(!isTestRunning){var e="0"==$(this).find("i").data("state")?"1":"0";hasLidState||setLidIcon(e),sendGcode("M280R"+e,!0,!1),await getResponse()}})),$("#card-purge").on("click",(async function(){if(!hasExtCtrl&&!isTestRunning){var e="0"==$(this).find("i").data("state")?"1":"0";setCheckmark(this,e),sendGcode('M205P"UsePurge"S'+e,!0,!1),await getResponse(),sendGcode("M503S1W",!1,!1),await getResponse()}})),$("#card-sendstat").on("click",(async function(){if(!isTestRunning){var e="0"==$(this).find("i").data("state")?"1":"0";setCheckmark(this,e),sendGcode('M205P"SendStats"S'+e,!0,!1),await getResponse(),sendGcode("M503S1W",!1,!1),await getResponse()}})),$("#tmc-status").on("click",(function(){$('.nav-item[data-section="#sec-statusinfo"]').trigger("click")})),$("#changes-pending").on("click",(function(){$('.nav-item[data-section="#sec-settings"]').trigger("click")})),$("#tool-selection").on("change",(async function(){if(moveCarrierG1=!1,$("#selector-pwr-off").addClass("hidden"),-1==$(this).val())sendGcode("G28X",!0,!1),moveCarrier(0),await getResponse();else{var e=parseInt($(this).val().substring(1));sendGcode($(this).val(),!0,!1),moveCarrier(e),await getResponse()}})),$("[id^=history-item-]").on("click",(function(){$("#gcode").focus(),$("#gcode").val($(this).find("span").text())})),$("#WipeSeq").on("focus, click",(function(){var e=$(this).val().matchAll(/([a-zA-Z]\d{1,3})/g);for(const t of e)console.log(t[0]),$("#wipe-"+t[0].toUpperCase()[0]).val(t[0].substring(1));$("#wipe-sequence-modal").modal("show")})),$("#Revolver-ServoClose").on("change",(async function(){initDone&&(sendGcode('M205P"ServoClose"S'+$(this).val()+"I99"),await getResponse())})),$("#Revolver-ServoOpen").on("change",(async function(){initDone&&(sendGcode('M205P"ServoOpen"S'+$(this).val()+"I99"),await getResponse())}))}));var tmcStatusBusy=!1;async function refreshTMCStats(){!tmcStatusBusy&&initDone&&(tmcStatusBusy=!0,$("#tmc-stat-0").hasClass("hidden")||(sendGcode("M122W0"),await getResponse()),$("#tmc-stat-1").hasClass("hidden")||(sendGcode("M122W1"),await getResponse()),$("#tmc-stat-2").hasClass("hidden")||(sendGcode("M122W2"),await getResponse()),$("#tmc-stat-3").hasClass("hidden")||(sendGcode("M122W3"),await getResponse()),tmcStatusBusy=!1)}function showTestRunning(e){if(!(1==e&&testCancelled>0&&(new Date).getTime()-testCancelled<4e3)){var t=$("#btn-run-test"),a=$("#test-status"),n=localStorage.getItem("runningScript");e?"running"!=t.data("state")&&(t.data("state","running"),t.find("i").removeClass("fa-play"),t.find("i").addClass("fa-stop"),a.removeClass("hidden"),a.html('Test "'+n+'" is running…'),isTestRunning=!0,$('.nav-item[data-section="#sec-dashboard"]').addClass("hidden"),$('.nav-item[data-section="#sec-live-control"]').addClass("hidden"),$('.nav-item[data-section="#sec-settings"]').addClass("hidden"),$('.nav-item[data-section="#sec-swaptools"]').addClass("hidden"),$('.nav-item[data-section="#sec-statusinfo"]').addClass("hidden"),setDisabled(!0,".sec-status"),$("#sec-status").hide("slow")):"stopped"!=t.data("state")&&(t.data("state","stopped"),t.find("i").removeClass("fa-stop"),t.find("i").addClass("fa-play"),a.addClass("hidden"),a.text(a.text().replace(n,"{TEST}")),isTestRunning=!1,$('.nav-item[data-section="#sec-dashboard"]').removeClass("hidden"),$('.nav-item[data-section="#sec-live-control"]').removeClass("hidden"),$('.nav-item[data-section="#sec-settings"]').removeClass("hidden"),$('.nav-item[data-section="#sec-swaptools"]').removeClass("hidden"),hasTmc&&$('.nav-item[data-section="#sec-statusinfo"]').removeClass("hidden"),setDisabled(!1,".sec-status"),$("#sec-status").show("slow"))}}function setCheckmark(e,t){var a=$(e).find("i");a.data("state",t),"send-stat"!=a.prop("id")?(a.removeClass("fa-check-circle fa-times-circle icon-checked icon-unchecked"),a.addClass("0"==t?"fa-times-circle icon-unchecked":"fa-check-circle icon-checked")):(a.removeClass("fa-repeat fa-times-circle fa-spin"),a.addClass("0"==t?"fa-times-circle":"fa-repeat fa-spin"))}function hideConnect(){$("#sec-start").fadeOut("slow").promise().done((function(){$("#content").css("padding-top",hasDryer?"230px":"200px"),$("#content").scrollTop(0),$("#sec-dashboard, #top-info").fadeIn("fast"),$('li.nav-item[data-section="#sec-dashboard"]').addClass("activeSection"),$('li.nav-item[data-section!="#sec-dashboard"]').removeClass("activeSection")})),$("#nav-container").removeClass("hidden"),tmcNotUsed=0,hideStatusInfoNav(),$("#btn-wizard").css("display","block");var e=localStorage.getItem("LastWizardDevice");localStorage.getItem("ShowWizard")!==never&&(localStorage.getItem("ShowWizard")==no&&e==$("#devname-label").text()||showWizard())}function showConnect(){$("#sec-dashboard, #sec-settings, #sec-swaptools, #sec-statusinfo, #sec-boardinfo, #sec-testrun, #sec-live-control, #top-info").fadeOut("fast").promise().done((function(){$("#content").css("padding-top","70px"),$("#sec-start").fadeIn("fast"),showConnectingMessage("slow",disconnected,null),setTimeout((function(){showConnectingMessage("slow",clickToConnect,null)}),2e3)})),$("#nav-container").addClass("hidden"),$("#btn-wizard").css("display","none")}async function sendChange(e){if(initDone){var t=buildM205Command(e);if(""!=t){e.removeClass("val-failed"),sendGcode(t);var a=await getResponse();e.addClass(a?"val-changed":"val-failed"),a||showToast(saveSettingFailed)}}}function setValue(e,t){try{if(void 0===e)return;for(var a of Object.keys(e)){var n,o=!1;t.indexOf("${key}")>-1?(n=t.replace("${key}",a),o=!0):n=t;var i=$("#"+n+(o?"":a));if(void 0!==i&&null!=i){if("checkbox"==i.prop("type")){var r,s;if("boolean"==typeof e[a])switch(r=e[a],e[a]){case!0:s=yes;break;case!1:s=no}else switch(e[a]){case 1:r=!0,s=high;break;case 0:r=!1,s=low;break;case"PWM":r=!1,s=pwm;break;case"OUTPUT":r=!0,s=output}i.prop("checked",r),i.attr("data-bs-original-title",s)}else if("color"==i.prop("type"))i.val("#"+e[a]);else{i.val(e[a]);var l=0;switch(a){case"LBtnDown":l=1;break;case"LBtnHold":l=2;break;case"RBtnDown":l=3;break;case"RBtnHold":l=4}l>0&&""!=e[a]&&$("#btn-pf"+l).text(pfButton+l+" ( "+e[a]+" )")}i.trigger("change")}else console.log("Control #"+a+" not found!");0}}catch(e){console.log("Failed to set value",e)}}function changeDebugLevel(){var e=0;$("#Dlvl-1").is(":checked")&&(e|=1),$("#Dlvl-2").is(":checked")&&(e|=2),$("#Dlvl-4").is(":checked")&&(e|=4),$("#Dlvl-8").is(":checked")&&(e|=8),$("#Dlvl-16").is(":checked")&&(e|=16),$("#Dlvl-32").is(":checked")&&(e|=32),$("#Dlvl-64").is(":checked")&&(e|=64),$("#Dlvl-128").is(":checked")&&(e|=128),console.log("Debug-Level: "+e),sendGcode("M111S"+e,!1,!1)}function setDebugLevel(e){var t=e.Level;$("#Dlvl-1").prop("checked",1&t),$("#Dlvl-2").prop("checked",2&t),$("#Dlvl-4").prop("checked",4&t),$("#Dlvl-8").prop("checked",8&t),$("#Dlvl-16").prop("checked",16&t),$("#Dlvl-32").prop("checked",32&t),$("#Dlvl-64").prop("checked",64&t),$("#Dlvl-128").prop("checked",128&t)}function setTMCstats(e){var t=e.TMCStatus.Axis;if(1==e.TMCStatus.InUse)for(var a of($("#tmc-stat-"+t).removeClass("hidden"),Object.keys(e.TMCStatus))){var n=$("#tmc-stat-"+t+"-"+a);"Version"==a&&(parseInt(e.TMCStatus[a])<1?versionMismatch[t]++:versionMismatch[t]>0&&versionMismatch[t]--),versionMismatch[t]>10&&(showToast(tmcVersionMismatch),$("#tmc-status").removeClass("hidden")),n.text(e.TMCStatus[a]),void 0!==n.parent().data("alert")&&("No"!=n.text()?(n.addClass("tmc-warning"),$("#tmc-status").removeClass("hidden")):(n.removeClass("tmc-warning"),$("#tmc-status").addClass("hidden")))}else $("#tmc-stat-"+t).addClass("hidden"),tmcNotUsed++;4==tmcNotUsed&&(hasTmc=!1,hideStatusInfoNav())}function setSettings(e,t){var a;try{if(a=JSON.parse(e),"Debug"==t&&(localStorage.setItem("DBG",e),setDebugLevel(a)),"TMC"==t&&(localStorage.setItem("TMC",e),setTMCstats(a)),"Basic"==t&&(localStorage.setItem("M503S1",e),setValue(a,""),setValue(a.Baudrates,"baudrate-")),"Steppers"==t&&(localStorage.setItem("M503S2",e),setValue(a.Selector,"Selector-"),setValue(a.Revolver,"Revolver-"),setValue(a.Feeder,"Feeder-")),"TMC Driver"==t&&(localStorage.setItem("M503S3",e),setValue(a.Selector,"Selector-TMC-"),setValue(a.Revolver,"Revolver-TMC-"),setValue(a.Feeder,"Feeder-TMC-")),"Servo mapping"==t&&(localStorage.setItem("M503S4",e),!hasV6S)){for(var n=getToolCount(),o=0;oCritical Parser error!
'+msg+'
'+e+"
"),void showToast(failedReadSettings)}}function addTestFiles(e){try{var t=JSON.parse(e);$("#test-files").empty(),null!=t&&t.forEach((function(e){var t=e.indexOf(".gcode");if(-1!=t){var a=e.substring(0,t);$("#test-files").append(new Option(a,""))}}))}catch(e){console.log(e),showToast(failedReadingTestFiles)}}function setRelayState(e){var t=e.substring(0,1),a=$("#card-relay").find("span#state");a.data("state",t),a.text(t)}function setFWInfo(e){hasTmc=!1,hasV6S=!1,hasDDE=!1,hasMultiservo=!1,hasDryer=!1;try{var t=e.split(":"),a=t[3].replace(" DATE","").trim();$("#version-label").text(t[2].replace(" ELECTRONICS","")),$("#electronics-label").text(a),$("#mode-label").text(t[5].replace(" OPTIONS","")),$("#acc-servo-pinmaps").addClass("d-none");try{if(t.length>5){console.log("Options: "+t[6]),$("#electronics-label").prop("title",t[6].replaceAll("|","; ")),boardOptions=t[6].split("|"),hasNeoPixels=!1,setDisabled(!0,".hasNeopixels"),setDisabled(!0,".hasBacklight"),setDisabled(!0,".hasTMC"),setDisabled(!0,".hasV6S"),setDisabled(!1,".has1stEndstop"),setDisabled(!1,".hasNotV6S"),setDisabled(!1,".hasPurge"),setDisabled(!0,".hasDDE"),setDisabled(!0,".hasSpoolmotors"),$("#acc-display").removeClass("hidden"),$("#acc-servo-pinmaps").addClass("d-none");for(var n=0;n0,isHeaterSet=heater1>=heater1Target-1&&heater10){var r=new Date(1e3*heaterTimeout).toISOString().substring(11,19);$("#timeout-label, #timeout-label-sec").text(r),showElement("#timeout-div")}else $("#timeout-label-sec").text("--:--:--"),hideElement("#timeout-div");break;case"HON:":(heaterOn=o)?($("#heating-div").addClass("heating"),showElement("#heating-icon")):($("#heating-div").removeClass("heating"),hideElement("#heating-icon"));break;case"DF1:":dryerFan1Speed=parseInt(e[2]),$("#fan1-label, #fan1-label-sec").text(dryerFan1Speed);break;case"DF2:":dryerFan2Speed=parseInt(e[2]),$("#fan2-label, #fan2-label-sec").text(dryerFan2Speed);break;case"HW:":o?(showHeaterWarning(),$("#heater1-label, #heater1-label-sec").addClass("tmc-warning"),$("#heater1-icon").addClass("tmc-warning")):($("#heater1-label, heater1-label-sec").removeClass("tmc-warning"),$("#heater1-icon").removeClass("tmc-warning"),cancelHeaterWarning())}}isDrying?($("#heater-column").addClass("drying"),$("#heater-status-sec").text(isHeaterSet?dryerDrying:dryerHeating),isStandalone&&(cmdCoolSent=!1,cmdClearSent=!1,heaterOn&&!cmdHeatingSent&&(sendWebSock(NeoPixelCmd+NeoPixelCmdHeating),cmdHeatingSent=!0,cmdHeatSent=!1),heaterOn||cmdHeatSent||(sendWebSock(NeoPixelCmd+NeoPixelCmdHeat),cmdHeatingSent=!1,cmdHeatSent=!0))):($("#heater-column").removeClass("drying"),$("#heater-status-sec").text(heater1<45?dryerIdle:dryerCooling),$("#btn-dryer-sec").text()!==startDrying&&$("#btn-dryer-sec").text(startDrying),isStandalone&&(cmdHeatingSent=!1,cmdHeatSent=!1,heater1<45&&!cmdClearSent&&(sendWebSock(NeoPixelCmd+NeoPixelCmdClear),cmdClearSent=!0),heater1>=45&&!cmdCoolSent&&(sendWebSock(NeoPixelCmd+NeoPixelCmdCool),cmdCoolSent=!0,cmdClearSent=!1))),0==loggingStart&&(loggingStart=new Date),$("#LogSensor1").is(":checked")&&(statusTime%5==0&&logSensor(1,temperature1,humidity1,heater1,heater1Target),lastHumid1=humidity1,lastTemp1=temperature1,lastHeater1=Math.ceil(heater1)),$("#LogSensor2").is(":checked")&&(statusTime%5==0&&logSensor(2,temperature2,humidity2),lastHumid2=humidity2,lastTemp2=temperature2),0==temperature1&&0==humidity1?hideElement("#sensor1-column"):showElement("#sensor1-column"),0==temperature2&&0==humidity2?hideElement("#sensor2-column"):showElement("#sensor2-column"),0==heater1?hideElement("#heater-column"):showElement("#heater-column"),0==temperature1&&0==temperature2&&0==humidity1&&0==humidity2&&0==heater1&&hideElement("#row-quickinfo2"),a=getCurrentTool(),moveCarrierG1||(smuffIsIdle||($('[id^="lvc-led-"]').each((function(){$(this).prop("id").endsWith(a)||setToolLed($(this),!1)})),-1!=a&&setToolLed($("#lvc-led-"+a),!0)),moveCarrier(-1==a?0:a)),setIdleAnimation(smuffIsIdle)}function hideElement(e,t=!0,a=!0){$(e).addClass("hidden"),t&&$(e).removeClass("d-flex"),a&&$(e).removeClass("d-inline")}function showElement(e,t=!0,a=!0){$(e).removeClass("hidden"),t&&$(e).addClass("d-flex"),a&&$(e).addClass("d-inline")}function setFeedLoadState(e,t){var a=e.width()*parseInt(t);void 0!==e&&e.scrollLeft()!=a&&e.animate({scrollLeft:a+"px"},600);var n=e.parent().find('img[id^="lvc-fitting-"]');2==t?n.attr("data-bs-original-title",ttpUnloadFromNozzle).tooltip("update"):1==t?n.attr("data-bs-original-title",ttpLoadToNozzle).tooltip("update"):16==t?n.attr("data-bs-original-title",ttpUnloadFromSelector).tooltip("update"):32==t?n.attr("data-bs-original-title",ttpUnloadFromNozzle).tooltip("update"):64==t?n.attr("data-bs-original-title",ttpUnloadFromDDE).tooltip("update"):n.attr("data-bs-original-title",ttpLoadToSplitter).tooltip("update")}function moveCarrier(e){var t=$("#lvc-slot-template").width(),a=$("#lvc-carrier").width();$("#lvc-carrier").css("right",a+e*t+"px")}function setToolLed(e,t,a,n){if(t){var o=$("#ToolColor").find(":selected").text();void 0!==a&&(o=a),$(e).css("opacity",1),$(e).css("background-color",o).fadeIn(smuffIsIdle?"fast":"slow")}else{if(hasNeoPixels)var i=0;void 0!==n?(i=parseFloat($(e).css("opacity"))-n,$(e).css("opacity",i<0?0:i)):$(e).css("opacity",0).fadeOut("fast")}}var idleAnimTimer=0;function setIdleAnimation(e){if(""!=$("#AnimBPM").val()&&hasNeoPixels){var t=getToolCount();if(-1!=t){var a=60/$("#AnimBPM").val()*1e3/t/3,n=getCurrentTool(),o=0,i=!0,r=!1;e?$("#IdleAnim").is(":checked")&&0==idleAnimTimer&&(idleAnimTimer=setInterval((async function(){if(n==t-1&&i?(i=!1,r=!0):0!=n||i||(i=!0,r=!0),$("#lvc-led-"+n).css("opacity")<=.15&&(r=!1),r||(i?n++:n--),$('[id^="lvc-led-"').each((function(){setToolLed($(this),!1,null,.2)})),!r){var e="hsl("+o+",80%,50%);";setToolLed($("#lvc-led-"+n),!0,e),(o+=5)>360&&(o=0)}}),a)):(0!=idleAnimTimer&&clearInterval(idleAnimTimer),idleAnimTimer=0)}}}function setTestResults(e){try{var t=JSON.parse(e.substring(15));$("#tst-elapsed").text(t.Elapsed),$("#tst-loopcnt").text(t.Loops),$("#tst-cmdcnt").text(t.Cmds),$("#tst-changes").text(t.ToolChanges),$("#tst-feederr").text(t.FeederErrors),$("#tst-stallselector").text(t.SelectorStalls),$("#tst-stallfeeder").text(t.FeederStalls);for(var a=t.FeedsOk.split("|"),n=t.FeedsMissed.split("|"),o=0;o0&&$("#tst-ok-"+o).text(i),r.length>0&&$("#tst-fail-"+o).text(r)}}catch(e){console.log(e)}}function showToast(e){$("#toast-message").html(e),toastMain.show()}function initWizard(){$("#wizard-device").val($("#Device").val()),$("#wizard-tools").val($("#Tools").val()),$("#wizard-bowden-len").val($("#BowdenLen").val()),$("#wizard-is-marlin").prop("checked",!1),$("#wizard-is-pmmu").prop("checked",$("#EmulPrusa").is(":checked")),$("#wizard-is-duet").prop("checked",$("#UseDuet").is(":checked")),$("#wizard-has-shared-stepper").prop("checked",$("#Feeder-SharedStepper").is(":checked")),$("#wizard-has-cutter").prop("checked",$("#UseCutter").is(":checked")),$("#wizard-selector-res09").prop("checked",!1),$("#wizard-feeder-res09").prop("checked",!1);var e=$("#electronics-label").text().trim();(e.endsWith("E3 V1.2")||e.endsWith("E3 V2.0")||e.endsWith("E3 V3.0"))&&$("#wizard-has-tmc2209").prop("checked",!0),"SMuFF"==$("#mode-label").text().trim()&&$("#wizard-is-marlin").prop("checked",!0),$("#wizard-is-marlin").trigger("change"),$("#wizard-is-pmmu").trigger("change"),$("#wizard-is-duet").trigger("change"),$("#wizard-has-shared-stepper").trigger("change"),$("#wizard-has-cutter").trigger("change"),$("#wizard-has-tmc2209").trigger("change"),$("#wizard-selector-res09").trigger("change"),$("#wizard-feeder-res09").trigger("change"),hasDDE?($("#wizard-dde-res09").trigger("change"),$("#wizard-dde-row").removeClass("hidden")):hideElement("#wizard-dde-row")}async function storeWizard(){var e=$("#wizard-device").val(),t=parseInt($("#wizard-tools").val()),a=parseFloat($("#wizard-bowden-len").val()),n=$("#wizard-is-pmmu").prop("checked"),o=$("#wizard-is-duet").prop("checked"),i=$("#wizard-has-shared-stepper").prop("checked"),r=$("#wizard-has-cutter").prop("checked"),s=$("#wizard-has-tmc2209").prop("checked"),l=$("#wizard-selector-res09").prop("checked"),c=$("#wizard-feeder-res09").prop("checked"),d=$("#wizard-dde-res09").prop("checked");setWizardOption("#Device",e),setWizardOption("#Tools",t),setWizardOption("#BowdenLen",a),setWizardBoolOption("#EmulPrusa",n),setWizardBoolOption("#Feeder-SharedStepper",i),setWizardBoolOption("#UseDuet",o),setWizardBoolOption("#UseCutter",r),s&&(setWizardListOption("#Selector-TMC-Mode",1),setWizardListOption("#Feeder-TMC-Mode",1),hasDDE&&setWizardListOption("#Revolver-TMC-Mode",1)),setWizardOption("#Selector-StepsMM",l?160:80),setWizardOption("#Feeder-StepsMM",c?820:410),hasDDE&&setWizardOption("#Revolver-StepsMM",d?820:410),$("#btn-save-settings").trigger("click")}function setWizardBoolOption(e,t){$(e).prop("checked")!=t&&$(e).trigger("click")}function setWizardOption(e,t){$(e).val()!=t&&$(e).val(t).trigger("focusout")}function setWizardListOption(e,t){$(e).val()!=t&&$(e).val(t).trigger("change")}function showWizard(){initWizard(),$("#wizard-modal").modal("show")}function hideWizard(){setTimeout((function(){$("#wizard-modal").modal("hide")}),500)}function resetWizard(){localStorage.setItem("ShowWizard",yes)}function showInfo(e){$("#info-message").html(e),$("#info-progressbar").css("width","0%").text("0%"),$("#info-modal").modal("show")}function cancelInfo(){$("#info-progressbar").css("width","100%").text("100%"),setTimeout((function(){$("#info-modal").modal("hide")}),500)}function showUserInfo(e){$("#user-message").html(e),$("#usrmsg-modal").modal("show")}function showError(e){$("#serious-error-message").html(e),$("#serious-error-modal").modal("show")}function cancelError(){setTimeout((function(){$("#serious-error-modal").modal("hide")}),500)}function showSDWarning(){$("#sd-warning").modal("show")}function cancelSDWarning(){setTimeout((function(){$("#sd-warning").modal("hide")}),500)}function showHeaterWarning(){$("#heater-warning").modal("show")}function cancelHeaterWarning(){setTimeout((function(){$("#heater-warning").modal("hide")}),500)}function showChangesPending(e){e?$("#changes-pending").show():$("#changes-pending").hide(),changesPending=e}function replaceId(e){return e=(e=(e=(e=(e=(e=(e=e.replace("Selector-","")).replace("Feeder-","")).replace("Revolver-","")).replace("TMC-","")).replace("Output-","")).replace("HumidityLevel-","")).replace("DynFanSpeed-","")}function normalizeId(e){var t=-1;return e.startsWith("Material-")&&(t=e.substring(9),e=e.substring(0,8)),e.startsWith("Color-")&&(t=e.substring(6),e=e.substring(0,5)),e.startsWith("PFactor-")&&(t=e.substring(8),e=e.substring(0,7)),e.startsWith("CValue-")&&(t=e.substring(7),e=e.substring(0,6)),e.startsWith("Spool-")&&(t=e.substring(6),e=e.substring(0,5)),e.startsWith("CCW-")&&(t=e.substring(4),e=e.substring(0,3)),e.startsWith("Close-")&&(t=e.substring(6),e=e.substring(0,5)),e.startsWith("Output-")&&(t=e.substring(7),e=e.substring(0,6)),e.startsWith("Mode-")&&(t=e.substring(5),e=e.substring(0,4)),e.startsWith("RevolverClose-")&&(t="T"+e.substring(14),e=e.substring(0,13)),e.startsWith("baudrate-")&&(t=e.substring(9),e=t),e.startsWith("HumidityLevel-")&&(t=e.substring(14),e=e.substring(0,13)+"s"),e.startsWith("DynFanSpeed-")&&(t=e.substring(12),e=e.substring(0,11)+"s"),[e,t]}function buildM205Command(e){var t,a=e.prop("id");if("M"==a&&"C"==a&&"CV"==a&&"PF"==a&&"O"==a&&"P"==a)return"";var n=e.prop("localName"),o=e.prop("type"),i=(e.attr("data-section"),e.attr("data-subsection"));if(""==a&&console.log(">>> No ID <<< for prop: "+n+" of type: "+o),"input"!=n&&"select"!=n||(t="text"==o?'"'+e.val()+'"':"color"==o?'"'+e.val().substring(1)+'"':"checkbox"==o?e.is(":checked")?1:0:isNaN(e.val())?null:e.val()),null!=t){const e=normalizeId(a=replaceId(a));a.startsWith("baudrate-")?(a="Baudrates",t='"'+t+'"'):a=e[0],idx=e[1];var r="",s="";if(void 0!==i){switch(i){case"Selector":r="X",s="I"+idx;break;case"Revolver":r="Y",s="I"+idx;break;case"Feeder":r="Z",s="I"+idx;break;case"User1":case"User2":s="M",a=i;break;case"HumidityLevels":case"DynFanSpeeds":s="I"+a,a=i}i.startsWith("T")&&(s="I"+i.substring(1))}return'M205P"'+a+'" S'+t+" "+r+s}return console.log("Skipping null value..."),""}function checkForChange(e){if(!initDone)return;var t=!1,a=replaceId(e.attr("id"));const n=normalizeId(a);if(a=n[0],idx=n[1],!a.startsWith("Dlvl-")){var o,i,r=e.attr("data-section"),s=e.attr("data-subsection"),l="checkbox"==e.prop("type"),c=JSON.parse(localStorage.getItem("M503"+r)),d="";if(void 0!==s?d=c[s][a]:void 0===(d=c[a])&&(d=c[idx],t=!0),void 0!==d){if(l?(e.tooltip("hide"),1==e.prop("checked")?"boolean"==typeof d?(o=!0,i=yes):"string"==typeof d?o=i=output:(o=1,i=high):"boolean"==typeof d?(o=!1,i=no):"string"==typeof d?o=i=pwm:(o=0,i=low),e.attr("data-bs-original-title",i),e.attr("aria-label",i)):o=e.val(),d!=o)try{return void 0!==s?c[s][a]=o:t?c[idx]=o:c[a]=o,localStorage.setItem("M503"+r,JSON.stringify(c)),!0}catch(e){console.log(e)}}else showToast(valUndefined+a+subSection+s+subSectionEnd),console.log("val undefined?!");return!1}}async function saveConfig(){sendGcode("M500"),getResponse()&&($("#restart-modal").modal("show"),showChangesPending(!1))}function removeValFeedback(){$("#accordion-settings input, #accordion-settings select").each((function(){$(this).removeClass("val-changed"),$(this).removeClass("val-failed")}))}function setGcodeHistory(){if(-1!=historyIndex){var e=$($("#historyitemscontainer").children())[historyIndex],t=$(e).find("span").text();$("#gcode").val(t),setTimeout((function(){$("#gcode").focus()}),100)}}function setLidIcon(e){var t=$("#card-lid").find("i");t.data("state",e),t.removeClass("fa-unlock fa-lock icon-unchecked icon-checked"),t.addClass("0"==e?"fa-unlock icon-unchecked":"fa-lock icon-checked"),setServoHorn(e)}function getCurrentTool(){var e=$("#tool-selection").val();return"-1"==e?-1:null!=e?parseInt(e.substring(1)):-1}function setServoHorn(e){var t=parseInt($("#Revolver-ServoOpen").val()),a=parseInt($("#Revolver-ServoClose").val()),n=getCurrentTool();-1!=n&&(a=parseInt($("#Close-"+n).val()));var o=e?90-a:90-t;if(!isNaN(o))if($("#lvc-horn").css({transform:"rotate("+o+"deg)"}),"#sec-live-control"==$(".nav-item.activeSection").data("section")){var i=e?a:t;$("#lvc-horn-image").attr("data-bs-original-title",i+" deg").tooltip("update")}else $("#sec-live-control .tooltip").each((function(){$(this).tooltip("hide")}))}async function recalculateSpeeds(){if(initDone){for(var e=[["Selector-MaxSpeed","X"],["Selector-AccelSpeed","X"],["Revolver-MaxSpeed","Y"],["Revolver-AccelSpeed","Y"],["Feeder-MaxSpeed","Z"],["Feeder-AccelSpeed","Z"],["Feeder-InsSpeed","Z"],["Feeder-PurgeSpeed","Z"]],t=0;t0&&a%50==0&&await sleep(100),$("#progress-upload .progress-bar").css("width",n+"%"),$("#progress-upload .progress-bar").text(parseInt(n)+"%"),uploadCancelled)break;pauseTransmission&&await getResume()}$("#progress-upload .progress-bar").css("width","100%"),$("#progress-upload .progress-bar").text("100%"),$("#firmware-file").val(""),setTimeout((function(){$("#firmware-upload-modal").modal("hide")}),2e3)}function showUserMessage(e){try{var t=JSON.parse(e.replaceAll('""','"')).UserMessage;t.startsWith("SD-Card removed.")||showUserInfo(t)}catch(e){console.log("Can't show User Message because: ",e)}}function showUserDialog(e){try{var t=JSON.parse(e);lastDlgId=t.UserDialog.Id;var a=t.UserDialog.Title,n=t.UserDialog.Message,o=t.UserDialog.Action,i=t.UserDialog.Buttons;gotDlgButton=!1,$("#usrdlg-title").html(''+a.replaceAll("\\n"," ")),$("#usrdlg-message").text(n.replaceAll("\\n","
")),$("#usrdlg-action").text(o.replaceAll("\\n","
"));var r=i.split("|");$("#btn-usrdlg-modal-1").addClass("d-none"),$("#btn-usrdlg-modal-2").addClass("d-none"),$("#btn-usrdlg-modal-3").addClass("d-none"),r.length>=1&&($("#btn-usrdlg-modal-1").text(r[0].trim()),$("#btn-usrdlg-modal-1").removeClass("d-none")),r.length>=2&&($("#btn-usrdlg-modal-2").text(r[1].trim()),$("#btn-usrdlg-modal-2").removeClass("d-none")),r.length>=3&&($("#btn-usrdlg-modal-3").text(r[2].trim()),$("#btn-usrdlg-modal-3").removeClass("d-none")),$("#usrdlg-modal").modal("show")}catch(e){console.log("Can't show User Dialog because: ",e)}}function sendDialogResult(e,t){sendGcode('{ "UserDialog": { "Id": '+e+', "Button": '+t+" } }",!1,!1,!0)}var sensor1Chart,sensor2Chart,isStandalone=!1,initDone=!1,initStarted=!1,seenOk=!1,seenError=!1,seenParserError=!1,prevLine="",configType="",currentSerial=-1,xlatedSpeed=0,collectResponse=!1,responseBuffer="",isPurging=!1,isBooting=!1,pauseTransmission=!1,temperature1=0,temperature2=0,humidity1=0,humidity2=0,heater1=0,heater1Target=0,heaterOn=!1,heaterTimeout=0,dryerFan1Speed=0,dryerFan2Speed=0,isDrying=!1,isFan1Dynamic=!1,isHeaterSet=!1;function sleep(e){return new Promise((t=>setTimeout(t,e)))}function getResponse(){return new Promise((e=>gotOk(e)))}function getResume(){return new Promise((e=>gotXon(e)))}async function gotOk(e){for(var t=1e4;!seenOk;)await sleep(10),(t-=10)<=0&&e(!1);collectResponse=!1,e(!seenError)}async function gotXon(e){for(var t=1e4;pauseTransmission;)await sleep(10),(t-=10)<=0&&e(!1);e(!0)}async function connectHandler(){isTestRunning?($(".nav-item.activeSection").removeClass("activeSection"),$('.nav-item[data-section="#sec-testrun"]').trigger("click")):await requestInit()?hideConnect():(isStandalone||await disconnectSerial(),showConnect())}async function sendGcode(e,t,a,n=!0){if(console.log("Gcode: "+e),seenOk=!1,seenError=!1,0!=e.length){e.trim().toUpperCase().startsWith("M20L")&&(responseBuffer="",collectResponse=!0),e.trim().toUpperCase().startsWith("G1")&&(e.toUpperCase().indexOf("X")>-1&&$("#selector-pwr-off").addClass("hidden"),e.toUpperCase().indexOf("Z")>-1&&$("#feeder-pwr-off").addClass("hidden")),e.trim().toUpperCase().startsWith("M500")&&showChangesPending(!1);var o=e;n&&(e+="\r\n"),await(isStandalone?writeSerial(e):writeWebSerial(e)),await sleep(5),t&&addSentGcode(o),a&&$("#gcode").focus()}}async function sendChar(e){await(isStandalone?writeSerial(e):writeWebSerial(e))}function sendCharSync(e){isStandalone?writeSerial(e):writeWebSerial(e)}function sendPFKey(e){var t=String.fromCharCode(27,91,79,e);console.log("Seq: "+t),addSentGcode("[PF"+String.fromCharCode(e-31,93)),sendGcode(t,!1,!0)}async function sendInitSeq(e){var t=3,a=!1;do{if(sendGcode(e,!1,!1),await getResponse()&&!seenParserError){a=!0;break}showInfo(connectionFailedRetry),await sleep(1e3),cancelInfo(),t--}while(t>0);return a}async function requestTMCInit(){if(curFWVersion>=3.11)await sendInitSeq("M122W99");else{await sendInitSeq("M17");for(var e=0;e<4&&await sendInitSeq("M122W"+e);e++);}initDone=!0}async function requestInit(){try{if(1==initStarted)return!1;initStarted=!0,initDone=!1,addSentGcode(wiInitStart),showInfo(fetchingSettings);var e=!0;if(isStandalone&&(await sendInitSeq("M155S0")||(e=!1)),await sendInitSeq("M115")||(e=!1),e){var t=[];t=curFWVersion>=3.11?['M205P"WebInterface"S1',"M111W1","M503S0W",'M20S"/test" F"" W',"M155S1"]:['M205P"WebInterface"S1',"M111W1","M503S0W","M503S6W","M503S7W","M503S8W",'M20S"/test" F"" W','M205P"SendStats"S1'];for(var a=0;a

"+e.substring(11)+"

"),void addReceivedGcode(e.replaceAll(" "," "))}if(e.startsWith("ok")){if(seenOk=!0,(isShowingLoading||isShowingUnloading)&&((isShowingLoading&&!isPurging||isShowingUnloading)&&cancelInfo(),isShowingLoading=!1,isShowingUnloading=!1),!initDone)return}else if(e.startsWith("error:")||e.startsWith("echo: error"))seenError=!0,"BUSY"==e.substring(7)&&showToast(smuffBusy),console.log("Errors seen: "+seenError+" [ "+prevLine+" ]");else if("start"==e)isBooting=!1,cancelInfo(),initDone&&(setTimeout((function(){showInfo(fetchingSettings)}),1e3),requestInit());else if(e.indexOf("echo: ")>-1)if(e.indexOf(" dbg:")>-1)e.indexOf("setup start")>0&&(isBooting=!0,initDone=!0,showInfo(bootingMsg));else{if(e.indexOf(" Serial:")>-1)return currentSerial=parseInt(e.substring(e.indexOf(" Serial:")+9)),void $("#curSerial"+currentSerial).removeClass("hidden");if(e.indexOf(" states:")>-1)return void setStatus(e);if(e.indexOf(" testrun:")>-1)return setTestResults(e),void showTestRunning(!0);if(e.indexOf(" purging:")>-1)return void("done"==e.substring(e.indexOf(" purging:")+9)?(isPurging=!1,cancelInfo()):(isPurging=!0,showPurging(e.substring(e.indexOf(" purging:")+9))));if(e.indexOf(" speed:")>-1)return void(xlatedSpeed=e.substring(e.indexOf(" speed:")+7));if(e.indexOf(" update:")>-1){var t=e.indexOf(" update:")+8;return"done"==e.substring(t)&&console.log("Update done!"),"failed"==e.substring(t)&&console.log("Update failed!"),void("progress"==e.substring(t)&&(progress=e.substring(t+9),console.log("Update progress: "+progress+"%")))}if(e.indexOf(" WI-CMD:")>-1){t=e.indexOf(" WI-CMD:")+8;return void addReceivedGcode(e.replaceAll(" "," ").replaceAll("\n","
"))}if((e.indexOf(" INT")>-1||e.indexOf(" EXT")>-1)&&(setRelayState(e.substring(e.indexOf("echo: ")+6)),!initDone))return}else if(e.startsWith("FIRMWARE_NAME"))setFWInfo(e);else{if(e.startsWith("Unknown parameter 'WebInterface"))return initDone=!0,void showError("Apparently, this SMuFF-Firmware version is less than 2.26! Please update your firmware for this app.");if(e.startsWith("/*")){if(configType=e.replace("/*","").replace("*/","").trim(),!initDone)return void(configType.startsWith("Testscripts")&&(addTestFiles(configType.substring(12)),configType=""))}else if(e.startsWith('{"')){if(e.indexOf("UserMessage")>-1)return void showUserMessage(e);if(e.indexOf("UserDialog")>-1)return void showUserDialog(e);if(e.indexOf("PlaySequence")>-1)return void playSequence(e);if(e.indexOf("TMCStatus")>-1&&(configType="TMC"),setSettings(e,configType),!initDone)return}else for(var a=["M17","M111","M122","M155","M205","M503"],n=0;n0?a.data[e.index-1]:0,val=a.data[e.index],lbl=a.label+": ",0==e.datasetIndex?lbl+val+"% RH":lbl+val+"°C"}function tooltipAfterLabelCb(e,t){var a=t.datasets[e.datasetIndex],n=e.index;do{if(prev=n>0?a.data[n-1]:0,--n<0)break}while(null==prev);return val=a.data[e.index],delta="Δ "+(val-prev>=0?"+":"")+(val-prev).toFixed(1),0==e.datasetIndex?delta+"%":delta+"°C"}function initSensorCharts(){sensor1Chart.options.elements.point.radius=2,sensor1Chart.options.scales=chartScales,sensor1Chart.options.tooltips=chartTooltips,sensor2Chart.options.elements.point.radius=2,sensor2Chart.options.scales=chartScales,sensor2Chart.options.tooltips=chartTooltips,sensor1Chart.data.labels=[];for(var e=0;e15){sensor1Chart.data.labels.shift();for(var c=0;c15){sensor2Chart.data.labels.shift();for(c=0;c",{text:"None"})),(dryerProfilesJson=JSON.parse(dryerProfiles)).Profile))null!=t&&null!=t.Name&&e.append($("
"),o.append(''+(""!=toolColors[n]?"(":"")+toolColors[n]+(""!=toolColors[n]?")":"")+""),o.attr("id","slot"+n),t.append(o);var i=$("#swap-item-template").clone(!0);i.text(i.text()+(void 0===swapTools[n]?n:swapTools[n])),i.attr("id","swap-tool"+n),i.attr("data-id","st-"+swapTools[n]),i.css("cursor","grab"),i.append(''),a.append(i)}}}var port,textEncoder,writableStream,writer,readableStream,reader,current_fs,next_fs,previous_fs,left,opacity,scale,animating;async function connectSerial(e=115200){try{port=await navigator.serial.requestPort(),showInfo(openingPort),await port.open({baudRate:e,bufferSize:64}).then((function(){$("#info-message").html(serialPortOpen),textEncoder=new TextEncoderStream,writableStream=textEncoder.readable.pipeTo(port.writable),writer=textEncoder.writable.getWriter(),listenToSerial(),connectHandler()}))}catch{cancelInfo(),showConnectingMessage("fast",serialConnectionFail,null)}}async function disconnectSerial(){try{reader&&(await reader.cancel(),await readableStream.catch((()=>{})),reader=null,readableStream=null),writer&&(await writer.close(),await writableStream,writer=null,writableStream=null),port&&(await port.close(),port=null)}catch(e){console.log(e)}}async function listenToSerial(){const e=new TextDecoderStream;readableStream=port.readable.pipeTo(e.writable),reader=e.readable.getReader(),portListener=!0;try{for(var t="";;){const{value:e,done:o}=await reader.read();if(e)-1!=e.indexOf("")&&(pauseTransmission=!0,console.log("XOff"),t+=e.replaceAll("","")),-1!=e.indexOf("")?(pauseTransmission=!1,console.log("XOn"),t+=e.replaceAll("","")):t+=e;for(;t.length;){var a=t.indexOf("\n");if(-1==a)break;var n=t.substring(0,a);await parseResponse(n),collectResponse&&"ok"!=n&&(responseBuffer+=n+"\n"),t=t.substring(a+1)}if(o){reader.releaseLock();break}}}catch(e){console.log(e),disconnectSerial()}portListener=!1,showConnect()}async function writeWebSerial(e){await writer.write(e)}$(document).ready((function(){$("#Tools").on("change",(function(){var e=getToolCount(),t=$("#tool-selection");t.empty(),t.append('');for(var a=0;aT'+a+"");for(a=MAX_TOOLS-1;a>=e;a--)$("#tst-t"+a).parent().hide();setupMaterials(),hasV6S||setupServoMappings(),setupLiveControl(),setupSwaps(),hasV6S&&setupStepperMappings()})),$("#SpdsInMms").on("click",(function(){setTimeout((function(){recalculateSpeeds()}),750)})),$("#Feeder-SharedStepper").on("change",(function(){setDisabled(!(hasSharedStepper=$(this).is(":checked")),".hasSharedStepper"),setDisabled(!hasSharedStepper,".hasNotExtCtrl")})),$("#Feeder-UseEStop2").on("change",(function(){setDisabled(!$(this).is(":checked"),".has2ndEndstop")})),$("#Feeder-ExtCtrl").on("change",(function(){hasExtCtrl=$(this).is(":checked"),hasDDE||hasSharedStepper||setDisabled(hasExtCtrl,".hasNotExtCtrl")})),$("#UseCutter").on("change",(function(){setDisabled(!$(this).is(":checked"),".hasCutter")})),$("#Revolver-UseServo").on("change",(function(){hasV6S&&$(this).removeAttr("checked"),setDisabled(!$(this).is(":checked"),".hasServo"),hasV6S||setDisabled(!$(this).is(":checked"),".hasServoOpt")})),$("#InvRelay").on("change",(function(){initDone&&setTimeout((async function(){sendGcode("M17",!0,!1),await getResponse()}),500)})),$("#Selector-TMC-Mode").on("change",(function(){1==$(this).val()?($("#Selector-TMC-Params").show("slow"),$("#Selector-MS3").val(0).trigger("change")):$("#Selector-TMC-Params").hide("slow")})),$("#Feeder-TMC-Mode").on("change",(function(){1==$(this).val()?($("#Feeder-TMC-Params").show("slow"),$("#Feeder-MS3").val(0).trigger("change")):$("#Feeder-TMC-Params").hide("slow")})),$("#Revolver-TMC-Mode").on("change",(function(){1==$(this).val()?($("#Revolver-TMC-Params").show("slow"),$("#Revolver-MS3").val(0).trigger("change"),hasDDE||$("#Revolver-UseServo").prop("checked",!1).trigger("change")):$("#Revolver-TMC-Params").hide("slow")})),$("#Selector-MS3").on("change",(function(){$(this).val()>0&&$("#Selector-TMC-Mode").val(0).trigger("change")})),$("#Feeder-MS3").on("change",(function(){$(this).val()>0&&$("#Feeder-TMC-Mode").val(0).trigger("change")})),$("#Revolver-MS3").on("change",(function(){$(this).val()>0&&$("#Revolver-TMC-Mode").val(0).trigger("change")}))}));class Upload{constructor(){}doUpload(e,t,a,n,o){var i=new FormData(e);$.ajax({type:"POST",url:t,xhr:function(){var e=$.ajaxSettings.xhr();return e.upload&&e.upload.addEventListener("progress",a,!1),e},success:function(e){null!=n&&n(e)},error:function(e){null!=o&&o(e)},async:!0,data:i,cache:!1,contentType:!1,processData:!1,timeout:6e4})}}function resetWizard(){$("#msform fieldset").each((function(){$(this).css("opacity",0),$(this).css("transform","scale(1)"),$(this).css("display","none")})),previous_fs=null,next_fs=null,$("#progressbar li").removeClass("active"),(current_fs=$("#fs-welcome")).css("opacity",1),current_fs.css("transform","scale(1)"),current_fs.css("display","block"),$("#progressbar li").eq($("fieldset").index(current_fs)).addClass("active")}$(document).ready((function(){$("#wizard-modal .next.action-button").click((function(){if(animating)return!1;animating=!0,current_fs=$(this).parent(),next_fs=$(this).parent().next(),$("#progressbar li").eq($("fieldset").index(next_fs)).addClass("active"),next_fs.show(),current_fs.animate({opacity:0},{step:function(e,t){scale=1-.2*(1-e),left=50*e+"%",opacity=1-e,current_fs.css({transform:"scale("+scale+")"}),next_fs.css({left:left,opacity:opacity})},duration:800,complete:function(){current_fs.hide(),animating=!1},easing:"easeInOutBack"})})),$("#wizard-modal .previous.action-button").click((function(){if(animating)return!1;animating=!0,current_fs=$(this).parent(),previous_fs=$(this).parent().prev(),$("#progressbar li").eq($("fieldset").index(current_fs)).removeClass("active"),previous_fs.show(),current_fs.animate({opacity:0},{step:function(e,t){scale=.8+.2*(1-e),left=50*(1-e)+"%",opacity=1-e,current_fs.css({left:left}),previous_fs.css({transform:"scale("+scale+")",opacity:opacity})},duration:800,complete:function(){current_fs.hide(),animating=!1},easing:"easeInOutBack"})})),$("#wizard-modal .cancel").click((function(){hideWizard(),resetWizard(),$("#wizard-disable").is(":checked")&&(localStorage.setItem("ShowWizard",never),localStorage.setItem("LastWizardDevice",$("#devname-label").text()))})),$("#wizard-modal .submit").click((function(){return hideWizard(),localStorage.setItem("ShowWizard",no),localStorage.setItem("LastWizardDevice",$("#wizard-device").val()),storeWizard(),resetWizard(),!1})),$("input:checkbox[name^=wizard-]").change((function(){var e=$(this).is(":checked")?yes:no;$(this).parent().parent().next().text(e),"wizard-is-marlin"==$(this).prop("name")&&e==yes&&($("#wizard-is-duet").prop("checked",""),$("#wizard-is-pmmu").prop("checked",""),$("#wizard-is-duet").parent().parent().next().text(no),$("#wizard-is-pmmu").parent().parent().next().text(no)),"wizard-is-pmmu"==$(this).prop("name")&&e==yes&&($("#wizard-is-duet").prop("checked",""),$("#wizard-is-marlin").prop("checked",""),$("#wizard-is-duet").parent().parent().next().text(no),$("#wizard-is-marlin").parent().parent().next().text(no)),"wizard-is-duet"==$(this).prop("name")&&e==yes&&($("#wizard-is-pmmu").prop("checked",""),$("#wizard-is-marlin").prop("checked",""),$("#wizard-is-marlin").parent().parent().next().text(no),$("#wizard-is-pmmu").parent().parent().next().text(no)),$("#wizard-is-pmmu").is(":checked")||$("#wizard-is-marlin").is(":checked")||$("#wizard-is-duet").is(":checked")||($("#wizard-is-marlin").prop("checked","checked"),$("#wizard-is-marlin").parent().parent().next().text(yes))}))})); \ No newline at end of file diff --git a/index.html b/index.html index 8fafeab..3937347 100644 --- a/index.html +++ b/index.html @@ -13,9 +13,9 @@
100%
DevNameVERSION:V2.26D 
ELECTRONICS:SKR mini 
MODE:SMuFF
SENSOR 1:20.0°C30.0%
SENSOR 2:20.0°C30.0%
DRYER:
20.0°C / 0.0°C100%75%
Settings  CHANGED BUT UNSAVED
Test {TEST} is running...
Dryer00:00:00
TMC Warning
Selector
Revolver
Feeder E1
Feeder E2
Relay
E
Lid
Purge
Status

SMuFF

WebInterface

 by Technik Gegg 2021-2025 - 
V1.26
Click here to connect...
Read Release Notes
ATTENTION: The latest version of the WebInterface found on the web ({VER}) has outdated your current version.
Please update to the latest version or you might miss some new or updated features!
Disclaimer: This Web-App utilizes Google Analytics for tracking page calls for future improvements.
If you do not agree, please leave this app now.

Dashboard

G-Code
echo: dbg: [ after setupTimers ]
G1 Z100 F200
History

    Settings






    Left Button Down [F1]:
    Left Button Hold [F2]:
    Right Button Down [F3]:
    Right Button Hold [F4]:
    TMC Settings
    TMC Settings
    TMC Settings

    Live Control

    Hover with the mouse over the images to find active areas.

    Swap Tools

    • Tool 

        Status Info

        Selector (X)

        --
        Version: 
        --
        RMS Current: 
        --
        mA
        Config. Current:
        --
        mA
        Microsteps: 
        --
        MS1/MS2: 
        --
        UART Mode: 
        --
        Phase A Open: 
        --
        Phase B Open: 
        --
        Phase A Shorted: 
        --
        Phase B Shorted: 
        --
        Overtemperature: 
        --

        Revolver (Y)

        --
        Version: 
        --
        RMS Current: 
        --
        mA
        Config. Current:
        --
        mA
        Microsteps: 
        --
        MS1/MS2: 
        --
        UART Mode: 
        --
        Phase A Open: 
        --
        Phase B Open: 
        --
        Phase A Shorted: 
        --
        Phase B Shorted: 
        --
        Overtemperature: 
        --

        Feeder (Z)

        --
        Version: 
        --
        RMS Current: 
        --
        mA
        Config. Current:
        --
        mA
        Microsteps: 
        --
        MS1/MS2: 
        --
        UART Mode: 
        --
        Phase A Open: 
        --
        Phase B Open: 
        --
        Phase A Shorted: 
        --
        Phase B Shorted: 
        --
        Overtemperature: 
        --

        Feeder (E)

        --
        Version: 
        --
        RMS Current: 
        --
        mA
        Config. Current:
        --
        mA
        Microsteps: 
        --
        MS1/MS2: 
        --
        UART Mode: 
        --
        Phase A Open: 
        --
        Phase B Open: 
        --
        Phase A Shorted: 
        --
        Phase B Shorted: 
        --
        Overtemperature: 
        --

        Board Info

        Run Test

        Time Elapsed

        00:00:00

        Loop Count

        0

        Commands

        0

        Tool Changes

        0

        Feeder Errors

        0

        Stalls Feeder

        0

        Stalls Selector

        0

        Tool 0

        0

        0

        Tool 1

        0

        0

        Tool 2

        0

        0

        Tool 3

        0

        0

        Tool 4

        0

        0

        Tool 5

        0

        0

        Tool 6

        0

        0

        Tool 7

        0

        0

        Tool 8

        0

        0

        Tool 9

        0

        0

        Tool 10

        0

        0

        Tool 11

        0

        0

        Filament Dryer Status

        Idle

        Heater Temperature: 
        20.0
        °C
        Target Temperature: 
        0.0
        °C
        Fan 1 Speed:
        0
        %
        Fan 2 Speed: 
        0
        %
        Temperature (Sensor 1): 
        20
        °C
        Relative Humidity (Sensor 1): 
        35
        %
        Temperature (Sensor 2): 
        20
        °C
        Relative Humidity (Sensor 2):
        35
        %

        AHT Sensor 1

        AHT Sensor 2

        © Technik Gegg 2021-2023
        DevNameVERSION:V2.26D 
        ELECTRONICS:SKR mini 
        MODE:SMuFF
        SENSOR 1:20.0°C30.0%
        SENSOR 2:20.0°C30.0%
        DRYER:
        20.0°C / 0.0°C100%75%
        Settings  CHANGED BUT UNSAVED
        Test {TEST} is running...
        Dryer00:00:00
        TMC Warning
        Selector
        Revolver
        Feeder E1
        Feeder E2
        Relay
        E
        Lid
        Purge
        Status

        SMuFF

        WebInterface

         by Technik Gegg 2021-2025 - 
        V1.26
        Click here to connect...
        Read Release Notes
        ATTENTION: The latest version of the WebInterface found on the web ({VER}) has outdated your current version.
        Please update to the latest version or you might miss some new or updated features!
        Disclaimer: This Web-App utilizes Google Analytics for tracking page calls for future improvements.
        If you do not agree, please leave this app now.

        Dashboard

        G-Code
        echo: dbg: [ after setupTimers ]
        G1 Z100 F200
        History

          Settings






          Left Button Down [F1]:
          Left Button Hold [F2]:
          Right Button Down [F3]:
          Right Button Hold [F4]:
          TMC Settings
          TMC Settings
          TMC Settings

          Live Control

          Hover with the mouse over the images to find active areas.

          Swap Tools

          • Tool 

              Status Info

              Selector (X)

              --
              Version: 
              --
              RMS Current: 
              --
              mA
              Config. Current:
              --
              mA
              Microsteps: 
              --
              MS1/MS2: 
              --
              UART Mode: 
              --
              Phase A Open: 
              --
              Phase B Open: 
              --
              Phase A Shorted: 
              --
              Phase B Shorted: 
              --
              Overtemperature: 
              --

              Revolver (Y)

              --
              Version: 
              --
              RMS Current: 
              --
              mA
              Config. Current:
              --
              mA
              Microsteps: 
              --
              MS1/MS2: 
              --
              UART Mode: 
              --
              Phase A Open: 
              --
              Phase B Open: 
              --
              Phase A Shorted: 
              --
              Phase B Shorted: 
              --
              Overtemperature: 
              --

              Feeder (Z)

              --
              Version: 
              --
              RMS Current: 
              --
              mA
              Config. Current:
              --
              mA
              Microsteps: 
              --
              MS1/MS2: 
              --
              UART Mode: 
              --
              Phase A Open: 
              --
              Phase B Open: 
              --
              Phase A Shorted: 
              --
              Phase B Shorted: 
              --
              Overtemperature: 
              --

              Feeder (E)

              --
              Version: 
              --
              RMS Current: 
              --
              mA
              Config. Current:
              --
              mA
              Microsteps: 
              --
              MS1/MS2: 
              --
              UART Mode: 
              --
              Phase A Open: 
              --
              Phase B Open: 
              --
              Phase A Shorted: 
              --
              Phase B Shorted: 
              --
              Overtemperature: 
              --

              Board Info

              Run Test

              Time Elapsed

              00:00:00

              Loop Count

              0

              Commands

              0

              Tool Changes

              0

              Feeder Errors

              0

              Stalls Feeder

              0

              Stalls Selector

              0

              Tool 0

              0

              0

              Tool 1

              0

              0

              Tool 2

              0

              0

              Tool 3

              0

              0

              Tool 4

              0

              0

              Tool 5

              0

              0

              Tool 6

              0

              0

              Tool 7

              0

              0

              Tool 8

              0

              0

              Tool 9

              0

              0

              Tool 10

              0

              0

              Tool 11

              0

              0

              Filament Dryer Status

              Idle

              Heater Temperature: 
              20.0
              °C
              Target Temperature: 
              0.0
              °C
              Fan 1 Speed:
              0
              %
              Fan 2 Speed: 
              0
              %
              Temperature (Sensor 1): 
              20
              °C
              Relative Humidity (Sensor 1): 
              35
              %
              Temperature (Sensor 2): 
              20
              °C
              Relative Humidity (Sensor 2):
              35
              %

              AHT Sensor 1

              AHT Sensor 2

              © Technik Gegg 2021-2023
              \ No newline at end of file +Update WI-ESP
              \ No newline at end of file diff --git a/source/SMuFF WI.bsdesign b/source/SMuFF WI.bsdesign index 8229498..e89a646 100644 Binary files a/source/SMuFF WI.bsdesign and b/source/SMuFF WI.bsdesign differ