!function(e){var n={};function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var i in e)t.d(r,i,function(n){return e[n]}.bind(null,i));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=23)}({23:function(e,n){window.PennController._AddElementType("Canvas",(function(e){let n=e=>e.match(/^\s*\d+(\.\d+)?(px|pt|pc|vw|vh|em|ex|ch|rem|cm|mm|in|vmin|vmax|[%])?\s*?/);this.immediate=function(t,r,i){if(void 0===t)t="Canvas",this.id=t;else if(void 0===i&&n(String(t))&&n(String(r))){i=r,r=t,t="Canvas";let n=e.controllers.underConstruction;e.controllers.running&&(n=e.controllers.list[e.controllers.running.id]);let s=2;for(;n.elements.hasOwnProperty("Canvas")&&n.elements.Canvas.hasOwnProperty(t);)t+=String(s);this.id=t}this.width=r,this.height=i},this.uponCreation=function(n){this.jQueryElement=$("
").css({width:this.width,height:this.height,overflow:"visible",position:"relative",display:"flex","flex-direction":"column"}),this.elementCommands=[],this.showElement=(n,t,r,i)=>new Promise(async s=>{await n.print(this.jQueryElement)._runPromises();let o=n._element,l=o.jQueryElement;const a=e.controllers.running,m=[t,r,window.PennController.Elements.getCanvas(this.id)];o._lastPrint=m,o.jQueryContainer?(e.utils.printAndRefreshUntil.call(o.jQueryContainer,t,r,this.jQueryElement,()=>a!=e.controllers.running||m!=o._lastPrint),(Number(i)>0||Number(i)>0)&&o.jQueryContainer.css("z-index",i)):(e.utils.printAndRefreshUntil.call(l,t,r,this.jQueryElement,()=>a!=e.controllers.running||m!=o._lastPrint),(Number(i)>0||Number(i)>0)&&l.css("z-index",i)),s()}),n()},this.end=function(){this.log&&(this.printTime?e.controllers.running.save(this.type,this.id,"Print","NA",this.printTime,"NULL"):e.controllers.running.save(this.type,this.id,"Print","NA","Never","NULL"))},this.value=function(){return this.elementCommands.length};let t=this;this.actions={color:function(e,n){this.jQueryElement.css("background-color",n),e()},print:async function(n,...t){e.elements.standardCommands.actions.print.apply(this,[async()=>{for(let e in this.elementCommands)await this.showElement(...this.elementCommands[e]);n()},...t])},remove:async function(n,...r){r.length?t.settings.remove.call(this,n,...r):e.elements.standardCommands.actions.remove.call(this,n)}},this.settings={add:function(n,t,r,i,s){i.hasOwnProperty("_element")&&i._element.jQueryElement instanceof jQuery?(this.elementCommands.push([i,t,r,s]),this.jQueryElement.parent().length?this.showElement(i,t,r,s).then(n):n()):(e.debug.error("Invalid element referenced to add to Canvas "+this.id),n())},remove:async function(n,t){if(t.hasOwnProperty("_element")){let n=this.elementCommands.map(e=>e[0]._element).indexOf(t._element);n>-1?(this.elementCommands.splice(n,1),await t.remove()._runPromises()):e.debug.error("Element referenced to remove from canvas not found in Canvas "+this.id)}else e.debug.error("Invalid element referenced to remove from Canvas "+this.id);n()}}}))}});