vizor_gui_tools 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see vizor_gui_tools.min.js.LICENSE.txt */
|
|
2
|
-
var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,o(n.key),n)}}function o(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==r(e)?e:e+""}t.d(e,{T:()=>d,V:()=>s});var i=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.zIndexCounter=9999999},e=[{key:"positionDiv",value:function(t,e,r){var n=document.getElementById(t);n&&n.style&&(n.style.position="absolute",n.style.left=e+"px",n.style.top=r+"px")}},{key:"formatAsWindow",value:function(t,e,r,n,o){var i=this,a=t;$(a).html("");var c=n||"auto",u=!1,s=$(a).css("height");$(a).css({position:"fixed",top:"20px",left:"50%",zIndex:1e3,border:"1px solid #6e647b",borderRadius:"15px",backgroundColor:"rgba(255, 255, 255, 0.9)",boxShadow:"rgba(0, 0, 0, .5) 19px 15px 24px",width:r+"px",height:c,minWidth:"400px",overflow:"hidden"}),$(a).addClass("hide-scrollbar-webkit"),$(a).addClass("hide-scrollbar-firefox"),$(a).addClass("hide-scrollbar-ie-edge"),$(a).on("mousedown",(function(){i.zIndexCounter++,$(a).css({zIndex:i.zIndexCounter})}));var l=$("<i>",{class:"fas fa-expand",css:{position:"absolute",bottom:"0",right:"0",cursor:"se-resize",padding:"5px",color:"#877575"}});$(a).append(l),$(a).resizable({handles:"se",minHeight:30,minWidth:400,maxHeight:"80%",maxWidth:"80%",start:function(t,e){u="30px"===$(a).css("height")},resize:function(t,e){u?$(this).resizable("option","minHeight",31):$(this).resizable("option","minHeight",s)}});var f=$("<div>",{class:"top-bar",css:{padding:"5px",backgroundColor:"#429bf5",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",cursor:"move",paddingRight:"20px"}}),h=$("<div>",{class:"top-bar-container"}),p=$("<div>",{class:"title-column",text:e}),d=$("<span>",{class:"drag-handle"});p.append(d);var y=$("<div>",{class:"icons-column",css:{"align-self":"flex-start","align-items":"flex-start"}}),v=$("<button>",{class:"collapse-button"}).append('<i class="fas fa-minus"></i>');y.append(v);var m=$("<button>",{class:"close-button"}).append('<i class="fas fa-times"></i>');y.append(m),h.append(p),h.append(y),f.append(h),$(a).prepend(f),m.on("click",(function(){$(a).css("visibility","hidden")})),v.on("click",(function(){u?($(a).css({height:s,maxHeight:"650px",visibility:"visible"}),v.find("i").removeClass("fa-plus").addClass("fa-minus"),u=!1):(s=$(a).css("height"),$(a).css({height:"55px",maxHeight:"650px",visibility:"visible"}),v.find("i").removeClass("fa-minus").addClass("fa-plus"),u=!0)}));var b,g,w=!1;f.on("mousedown",(function(t){w=!0,b=t.clientX-$(a).offset().left,g=t.clientY-$(a).offset().top})),$(document).on("mouseup",(function(){w=!1})),$(document).on("mousemove",(function(t){if(w){var e=window.innerWidth,r=window.innerHeight,n=t.clientX-b,o=t.clientY-g,i=e-$(a).outerWidth(),c=r-$(a).outerHeight();a.style.top=Math.min(Math.max(o,0),c)+"px",a.style.left=Math.min(Math.max(n,0),i)+"px"}}))}},{key:"setWindowTitle",value:function(t,e){$(t).find(".title-column").text(e)}},{key:"insertHtmlContent",value:function(t,e){var r=document.getElementById(t);if(r){var n=r.querySelector(".top-bar-container");n&&n.insertAdjacentHTML("afterend",e)}}}],e&&n(t.prototype,e),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function c(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}}function u(t){var e=function(t,e){if("object"!=a(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==a(e)?e:e+""}var s=function(){return t=function t(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:400,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:300,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"Default Title";!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.parent=document.body,this.div=document.createElement("div"),this.parent.appendChild(this.div),(new i).formatAsWindow(this.div,a,n,o,this.parent),this.contentContainer=document.createElement("div"),this.contentContainer.style.overflow="auto",this.contentContainer.style.maxHeight="calc(100% - 40px)";var c=this.div.querySelector(".top-bar-container");return c&&this.div.insertBefore(this.contentContainer,c.nextSibling),this},(e=[{key:"insertHtmlContent",value:function(t){this._insertHtmlContent(this.contentContainer,t)}},{key:"_insertHtmlContent",value:function(t,e){if(t){var r=document.createElement("div");for(r.innerHTML=e;r.firstChild;)t.appendChild(r.firstChild);t.scrollTop=t.scrollHeight}}}])&&c(t.prototype,e),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function f(){f=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,a=Object.create(i.prototype),c=new T(n||[]);return o(a,"_invoke",{value:k(t,r,c)}),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var d="suspendedStart",y="suspendedYield",v="executing",m="completed",b={};function g(){}function w(){}function x(){}var E={};s(E,a,(function(){return this}));var $=Object.getPrototypeOf,j=$&&$($(H([])));j&&j!==r&&n.call(j,a)&&(E=j);var L=x.prototype=g.prototype=Object.create(E);function C(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(o,i,a,c){var u=p(t[o],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==l(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function k(e,r,n){var o=d;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=_(c,n);if(u){if(u===b)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var s=p(e,r,n);if("normal"===s.type){if(o=n.done?m:y,s.arg===b)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=m,n.method="throw",n.arg=s.arg)}}}function _(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,_(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var i=p(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,b;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,b):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function H(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(l(e)+" is not iterable")}return w.prototype=x,o(L,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:w,configurable:!0}),w.displayName=s(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,s(t,u,"GeneratorFunction")),t.prototype=Object.create(L),t},e.awrap=function(t){return{__await:t}},C(S.prototype),s(S.prototype,c,(function(){return this})),e.AsyncIterator=S,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new S(h(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},C(L),s(L,u,"Generator"),s(L,a,(function(){return this})),s(L,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=H,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,b):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),b},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:H(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},e}function h(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function p(t){return new Promise((function(e,r){var n=document.createElement("script");n.src=t,n.onload=function(){return e(t)},n.onerror=function(){return r(new Error("Failed to load script: ".concat(t)))},document.body.appendChild(n)}))}function d(){return y.apply(this,arguments)}function y(){var t;return t=f().mark((function t(){return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return console.log("Initializing vizor_gui_tools"),t.prev=1,t.next=4,p("https://code.jquery.com/jquery-3.6.0.min.js");case 4:return t.next=6,p("https://code.jquery.com/ui/1.12.1/jquery-ui.min.js");case 6:e="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css",r=void 0,(r=document.createElement("link")).rel="stylesheet",r.href=e,document.head.appendChild(r),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(1),console.error("Error initializing vizor_gui_tools:",t.t0);case 12:case"end":return t.stop()}var e,r}),t,null,[[1,9]])})),y=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){h(i,n,o,a,c,"next",t)}function c(t){h(i,n,o,a,c,"throw",t)}a(void 0)}))},y.apply(this,arguments)}var v=e.T,m=e.V;export{v as init,m as vi_Window};
|
|
2
|
+
var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,o(n.key),n)}}function o(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==r(e)?e:e+""}t.d(e,{T:()=>m,V:()=>p});var i=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.zIndexCounter=9999999},e=[{key:"positionDiv",value:function(t,e,r){var n=document.getElementById(t);n&&n.style&&(n.style.position="absolute",n.style.left=e+"px",n.style.top=r+"px")}},{key:"formatAsWindow",value:function(t,e,r,n,o){var i=this,a=t;$(a).html("");var c=n||"auto",s=!1,u=$(a).css("height");$(a).css({position:"fixed",top:"20px",left:"50%",zIndex:1e3,border:"1px solid #6e647b",borderRadius:"15px",backgroundColor:"rgba(0, 0, 255, 0.9)",boxShadow:"rgba(0, 0, 0, .5) 19px 15px 24px",width:r+"px",height:c,minWidth:"400px",overflow:"hidden"}),$(a).addClass("hide-scrollbar-webkit"),$(a).addClass("hide-scrollbar-firefox"),$(a).addClass("hide-scrollbar-ie-edge"),$(a).on("mousedown",(function(){i.zIndexCounter++,$(a).css({zIndex:i.zIndexCounter})}));var l=$("<i>",{class:"fas fa-expand",css:{position:"absolute",bottom:"0",right:"0",cursor:"se-resize",padding:"5px",color:"#877575"}});$(a).append(l),$(a).resizable({handles:"se",minHeight:30,minWidth:400,maxHeight:"80%",maxWidth:"80%",start:function(t,e){s="30px"===$(a).css("height")},resize:function(t,e){s?$(this).resizable("option","minHeight",31):$(this).resizable("option","minHeight",u)}});var f=$("<div>",{class:"top-bar",css:{padding:"5px",backgroundColor:"#429bf5",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",cursor:"move",paddingRight:"20px"}}),p=$("<div>",{class:"top-bar-container"}),h=$("<div>",{class:"title-column",text:e}),d=$("<span>",{class:"drag-handle"});h.append(d);var y=$("<div>",{class:"icons-column",css:{"align-self":"flex-start","align-items":"flex-start"}}),v=$("<button>",{class:"collapse-button"}).append('<i class="fas fa-minus"></i>');y.append(v);var m=$("<button>",{class:"close-button"}).append('<i class="fas fa-times"></i>');y.append(m),p.append(h),p.append(y),f.append(p),$(a).prepend(f),m.on("click",(function(){$(a).css("visibility","hidden")})),v.on("click",(function(){s?($(a).css({height:u,maxHeight:"650px",visibility:"visible"}),v.find("i").removeClass("fa-plus").addClass("fa-minus"),s=!1):(u=$(a).css("height"),$(a).css({height:"55px",maxHeight:"650px",visibility:"visible"}),v.find("i").removeClass("fa-minus").addClass("fa-plus"),s=!0)}));var b,g,w=!1;f.on("mousedown",(function(t){w=!0,b=t.clientX-$(a).offset().left,g=t.clientY-$(a).offset().top})),$(document).on("mouseup",(function(){w=!1})),$(document).on("mousemove",(function(t){if(w){var e=window.innerWidth,r=window.innerHeight,n=t.clientX-b,o=t.clientY-g,i=e-$(a).outerWidth(),c=r-$(a).outerHeight();a.style.top=Math.min(Math.max(o,0),c)+"px",a.style.left=Math.min(Math.max(n,0),i)+"px"}}))}},{key:"setWindowTitle",value:function(t,e){$(t).find(".title-column").text(e)}},{key:"insertHtmlContent",value:function(t,e){var r=document.getElementById(t);if(r){var n=r.querySelector(".top-bar-container");n&&n.insertAdjacentHTML("afterend",e)}}}],e&&n(t.prototype,e),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function s(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?c(Object(r),!0).forEach((function(e){u(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function u(t,e,r){return(e=f(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function l(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,f(n.key),n)}}function f(t){var e=function(t,e){if("object"!=a(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==a(e)?e:e+""}var p=function(){return t=function t(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:400,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:300,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"Default Title",c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.config=s(s({},{backgroundColor:"black",borderColor:"black",transparentBackground:!1,scrollable:!1,fixedHeight:!1,titleBar:!0,closeButton:!0,minimizeButton:!1,borderTransparency:1,fontSize:"16px",showMinimizeButton:!0,showCloseButton:!0,position:{top:"0px",left:"0px"}}),c),this.parent=document.body,this.div=document.createElement("div"),this.parent.appendChild(this.div),(new i).formatAsWindow(this.div,a,n,o,this.parent),this.contentContainer=document.createElement("div"),this.contentContainer.style.overflow="auto",this.contentContainer.style.maxHeight="calc(100% - 40px)";var u=this.div.querySelector(".top-bar-container");return u&&this.div.insertBefore(this.contentContainer,u.nextSibling),this.applyConfig(),this},(e=[{key:"applyConfig",value:function(){$(this.div).css({backgroundColor:this.config.transparentBackground?"transparent":this.config.backgroundColor}),this.div.style.border=this.config.transparentBackground?"none":"1px solid ".concat(this.config.borderColor),this.div.style.opacity=this.config.borderTransparency,this.config.fixedHeight&&(this.div.style.height="300px"),this.config.scrollable?this.contentContainer.style.overflow="auto":this.contentContainer.style.overflow="hidden"}},{key:"insertHtmlContent",value:function(t){this._insertHtmlContent(this.contentContainer,t)}},{key:"add",value:function(t){this.contentContainer.appendChild(t)}},{key:"_insertHtmlContent",value:function(t,e){if(t){var r=document.createElement("div");for(r.innerHTML=e;r.firstChild;)t.appendChild(r.firstChild);t.scrollTop=t.scrollHeight}}}])&&l(t.prototype,e),r&&l(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function h(t){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h(t)}function d(){d=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,a=Object.create(i.prototype),c=new T(n||[]);return o(a,"_invoke",{value:S(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p="suspendedStart",y="suspendedYield",v="executing",m="completed",b={};function g(){}function w(){}function x(){}var j={};u(j,a,(function(){return this}));var C=Object.getPrototypeOf,O=C&&C(C(H([])));O&&O!==r&&n.call(O,a)&&(j=O);var E=x.prototype=g.prototype=Object.create(j);function k(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function $(t,e){function r(o,i,a,c){var s=f(t[o],t,i);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==h(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,c)}))}c(s.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function S(e,r,n){var o=p;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?m:y,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,L(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,b;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,b):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function H(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(h(e)+" is not iterable")}return w.prototype=x,o(E,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:w,configurable:!0}),w.displayName=u(x,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,u(t,s,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},k($.prototype),u($.prototype,c,(function(){return this})),e.AsyncIterator=$,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new $(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(E),u(E,s,"Generator"),u(E,a,(function(){return this})),u(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=H,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(_),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,b):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),b},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),_(r),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;_(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:H(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},e}function y(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}function v(t){return new Promise((function(e,r){var n=document.createElement("script");n.src=t,n.onload=function(){return e(t)},n.onerror=function(){return r(new Error("Failed to load script: ".concat(t)))},document.body.appendChild(n)}))}function m(){return b.apply(this,arguments)}function b(){var t;return t=d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return console.log("Initializing vizor_gui_tools"),t.prev=1,t.next=4,v("https://code.jquery.com/jquery-3.6.0.min.js");case 4:return t.next=6,v("https://code.jquery.com/ui/1.12.1/jquery-ui.min.js");case 6:e="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css",r=void 0,(r=document.createElement("link")).rel="stylesheet",r.href=e,document.head.appendChild(r),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(1),console.error("Error initializing vizor_gui_tools:",t.t0);case 12:case"end":return t.stop()}var e,r}),t,null,[[1,9]])})),b=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){y(i,n,o,a,c,"next",t)}function c(t){y(i,n,o,a,c,"throw",t)}a(void 0)}))},b.apply(this,arguments)}var g=e.T,w=e.V;export{g as init,w as vi_Window};
|