@stlite/desktop 0.30.2 → 0.32.0

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.
Files changed (51) hide show
  1. package/bin/dump_artifacts.js +1 -1
  2. package/build/asset-manifest.json +31 -29
  3. package/build/index.html +1 -1
  4. package/build/static/js/2116.fd3de825.chunk.js +1 -0
  5. package/build/static/js/2523.4761d79a.chunk.js +5 -0
  6. package/build/static/js/2632.de1769ff.chunk.js +1 -0
  7. package/build/static/js/277.d9ceff66.chunk.js +1 -0
  8. package/build/static/js/3376.d5aaecc4.chunk.js +1 -0
  9. package/build/static/js/3392.5ed3420d.chunk.js +1 -0
  10. package/build/static/js/{3977.8a9ac9d7.chunk.js → 3977.24eb5fb8.chunk.js} +1 -1
  11. package/build/static/js/{4210.66c14600.chunk.js → 4210.945a5966.chunk.js} +1 -1
  12. package/build/static/js/{4514.ff4d47b7.chunk.js → 4514.7931bd64.chunk.js} +1 -1
  13. package/build/static/js/{464.8a875fdd.chunk.js → 464.7c22f33c.chunk.js} +1 -1
  14. package/build/static/js/5608.b4074ab9.chunk.js +1 -0
  15. package/build/static/js/{5678.b7f865a0.chunk.js → 5678.729bced9.chunk.js} +1 -1
  16. package/build/static/js/6223.4bb0039e.chunk.js +2 -0
  17. package/build/static/js/6223.4bb0039e.chunk.js.LICENSE.txt +11 -0
  18. package/build/static/js/{6422.f69a61a8.chunk.js → 6422.c2900a88.chunk.js} +1 -1
  19. package/build/static/js/7073.5619981b.chunk.js +1 -0
  20. package/build/static/js/7496.0f941cac.chunk.js +1 -0
  21. package/build/static/js/{761.e16e6486.chunk.js → 761.ca3883de.chunk.js} +1 -1
  22. package/build/static/js/7698.00f5ff0b.chunk.js +1 -0
  23. package/build/static/js/7858.e4a6aa6d.chunk.js +5 -0
  24. package/build/static/js/{7937.a3bc5cdb.chunk.js → 7937.4b1be66e.chunk.js} +1 -1
  25. package/build/static/js/{8355.7352ad1b.chunk.js → 8355.b110abc9.chunk.js} +1 -1
  26. package/build/static/js/{8461.87a9a578.chunk.js → 8461.85faefa1.chunk.js} +1 -1
  27. package/build/static/js/9462.81f9c52a.chunk.js +1 -0
  28. package/build/static/js/9551.c45b17cf.chunk.js +1 -0
  29. package/build/static/js/main.e1e5cd43.js +28 -0
  30. package/build/static/js/{main.4ee8ce64.js.LICENSE.txt → main.e1e5cd43.js.LICENSE.txt} +1 -3
  31. package/build/static/media/checkmark.29851c8e9e6ef0c3d6c1e4efe3c1bb9e.svg +3 -0
  32. package/build/static/media/logo.83ae4f2fb87e38be7cbb8a5d2beb64d2.svg +5 -0
  33. package/build/static/media/rocket.b75b17d2b0a063c6cea230d1a9d77f1e.svg +9 -0
  34. package/package.json +4 -4
  35. package/build/static/js/2116.2e449b06.chunk.js +0 -1
  36. package/build/static/js/2523.7919ada5.chunk.js +0 -5
  37. package/build/static/js/2632.1bb45c13.chunk.js +0 -1
  38. package/build/static/js/277.fbace0b9.chunk.js +0 -1
  39. package/build/static/js/3376.839fa3bf.chunk.js +0 -1
  40. package/build/static/js/3392.7b32c75f.chunk.js +0 -1
  41. package/build/static/js/458.895bbb73.chunk.js +0 -1
  42. package/build/static/js/5608.314b94e4.chunk.js +0 -1
  43. package/build/static/js/6928.228563da.chunk.js +0 -2
  44. package/build/static/js/6928.228563da.chunk.js.LICENSE.txt +0 -26
  45. package/build/static/js/7073.33f107fd.chunk.js +0 -1
  46. package/build/static/js/7496.37614377.chunk.js +0 -1
  47. package/build/static/js/7698.095351a0.chunk.js +0 -1
  48. package/build/static/js/7858.fa281cb7.chunk.js +0 -5
  49. package/build/static/js/9462.ebffc855.chunk.js +0 -1
  50. package/build/static/js/9551.f6ae672e.chunk.js +0 -1
  51. package/build/static/js/main.4ee8ce64.js +0 -28
@@ -1,26 +0,0 @@
1
- /*!
2
- * https://github.com/Starcounter-Jack/JSON-Patch
3
- * (c) 2017-2021 Joachim Wester
4
- * MIT license
5
- */
6
-
7
- /*!
8
- * https://github.com/Starcounter-Jack/JSON-Patch
9
- * (c) 2017-2022 Joachim Wester
10
- * MIT licensed
11
- */
12
-
13
- /*! *****************************************************************************
14
- Copyright (c) Microsoft Corporation.
15
-
16
- Permission to use, copy, modify, and/or distribute this software for any
17
- purpose with or without fee is hereby granted.
18
-
19
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
20
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
21
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
22
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
23
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
24
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
25
- PERFORMANCE OF THIS SOFTWARE.
26
- ***************************************************************************** */
@@ -1 +0,0 @@
1
- (()=>{"use strict";var e={56977:e=>{function t(e){if("string"!==typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,n="",o=0,s=-1,a=0,i=0;i<=e.length;++i){if(i<e.length)r=e.charCodeAt(i);else{if(47===r)break;r=47}if(47===r){if(s===i-1||1===a);else if(s!==i-1&&2===a){if(n.length<2||2!==o||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var l=n.lastIndexOf("/");if(l!==n.length-1){-1===l?(n="",o=0):o=(n=n.slice(0,l)).length-1-n.lastIndexOf("/"),s=i,a=0;continue}}else if(2===n.length||1===n.length){n="",o=0,s=i,a=0;continue}t&&(n.length>0?n+="/..":n="..",o=2)}else n.length>0?n+="/"+e.slice(s+1,i):n=e.slice(s+1,i),o=i-s-1;s=i,a=0}else 46===r&&-1!==a?++a:a=-1}return n}var n={resolve:function(){for(var e,n="",o=!1,s=arguments.length-1;s>=-1&&!o;s--){var a;s>=0?a=arguments[s]:(void 0===e&&(e=process.cwd()),a=e),t(a),0!==a.length&&(n=a+"/"+n,o=47===a.charCodeAt(0))}return n=r(n,!o),o?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(e){if(t(e),0===e.length)return".";var n=47===e.charCodeAt(0),o=47===e.charCodeAt(e.length-1);return 0!==(e=r(e,!n)).length||n||(e="."),e.length>0&&o&&(e+="/"),n?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,r=0;r<arguments.length;++r){var o=arguments[r];t(o),o.length>0&&(void 0===e?e=o:e+="/"+o)}return void 0===e?".":n.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r)return"";if((e=n.resolve(e))===(r=n.resolve(r)))return"";for(var o=1;o<e.length&&47===e.charCodeAt(o);++o);for(var s=e.length,a=s-o,i=1;i<r.length&&47===r.charCodeAt(i);++i);for(var l=r.length-i,c=a<l?a:l,d=-1,g=0;g<=c;++g){if(g===c){if(l>c){if(47===r.charCodeAt(i+g))return r.slice(i+g+1);if(0===g)return r.slice(i+g)}else a>c&&(47===e.charCodeAt(o+g)?d=g:0===g&&(d=0));break}var u=e.charCodeAt(o+g);if(u!==r.charCodeAt(i+g))break;47===u&&(d=g)}var p="";for(g=o+d+1;g<=s;++g)g!==s&&47!==e.charCodeAt(g)||(0===p.length?p+="..":p+="/..");return p.length>0?p+r.slice(i+d):(i+=d,47===r.charCodeAt(i)&&++i,r.slice(i))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),n=47===r,o=-1,s=!0,a=e.length-1;a>=1;--a)if(47===(r=e.charCodeAt(a))){if(!s){o=a;break}}else s=!1;return-1===o?n?"/":".":n&&1===o?"//":e.slice(0,o)},basename:function(e,r){if(void 0!==r&&"string"!==typeof r)throw new TypeError('"ext" argument must be a string');t(e);var n,o=0,s=-1,a=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var i=r.length-1,l=-1;for(n=e.length-1;n>=0;--n){var c=e.charCodeAt(n);if(47===c){if(!a){o=n+1;break}}else-1===l&&(a=!1,l=n+1),i>=0&&(c===r.charCodeAt(i)?-1===--i&&(s=n):(i=-1,s=l))}return o===s?s=l:-1===s&&(s=e.length),e.slice(o,s)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!a){o=n+1;break}}else-1===s&&(a=!1,s=n+1);return-1===s?"":e.slice(o,s)},extname:function(e){t(e);for(var r=-1,n=0,o=-1,s=!0,a=0,i=e.length-1;i>=0;--i){var l=e.charCodeAt(i);if(47!==l)-1===o&&(s=!1,o=i+1),46===l?-1===r?r=i:1!==a&&(a=1):-1!==r&&(a=-1);else if(!s){n=i+1;break}}return-1===r||-1===o||0===a||1===a&&r===o-1&&r===n+1?"":e.slice(r,o)},format:function(e){if(null===e||"object"!==typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+e+n:n}("/",e)},parse:function(e){t(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return r;var n,o=e.charCodeAt(0),s=47===o;s?(r.root="/",n=1):n=0;for(var a=-1,i=0,l=-1,c=!0,d=e.length-1,g=0;d>=n;--d)if(47!==(o=e.charCodeAt(d)))-1===l&&(c=!1,l=d+1),46===o?-1===a?a=d:1!==g&&(g=1):-1!==a&&(g=-1);else if(!c){i=d+1;break}return-1===a||-1===l||0===g||1===g&&a===l-1&&a===i+1?-1!==l&&(r.base=r.name=0===i&&s?e.slice(1,l):e.slice(i,l)):(0===i&&s?(r.name=e.slice(1,a),r.base=e.slice(1,l)):(r.name=e.slice(i,a),r.base=e.slice(i,l)),r.ext=e.slice(a,l)),i>0?r.dir=e.slice(0,i-1):s&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};n.posix=n,e.exports=n}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;!function(e){function t(e){return null===e||"boolean"===typeof e||"number"===typeof e||"string"===typeof e}function r(e){return Array.isArray(e)}function n(e,o){if(e===o)return!0;if(t(e)||t(o))return!1;var s=r(e),a=r(o);return s===a&&(s&&a?function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(var r=0,o=e.length;r<o;++r)if(!n(e[r],t[r]))return!1;return!0}(e,o):function(e,t){if(e===t)return!0;for(var r in e)if(void 0!==e[r]&&!(r in t))return!1;for(var r in t)if(void 0!==t[r]&&!(r in e))return!1;for(var r in e){var o=e[r],s=t[r];if(void 0!==o||void 0!==s){if(void 0===o||void 0===s)return!1;if(!n(o,s))return!1}}return!0}(e,o))}function o(e){return t(e)?e:r(e)?function(e){for(var t=new Array(e.length),r=0,n=e.length;r<n;++r)t[r]=o(e[r]);return t}(e):function(e){var t={};for(var r in e){var n=e[r];void 0!==n&&(t[r]=o(n))}return t}(e)}e.emptyObject=Object.freeze({}),e.emptyArray=Object.freeze([]),e.isPrimitive=t,e.isArray=r,e.isObject=function(e){return!t(e)&&!r(e)},e.deepEqual=n,e.deepCopy=o}(e||(e={}));!function(){function e(){this._types=[],this._values=[]}e.prototype.types=function(){return this._types.slice()},e.prototype.hasData=function(e){return-1!==this._types.indexOf(e)},e.prototype.getData=function(e){var t=this._types.indexOf(e);return-1!==t?this._values[t]:void 0},e.prototype.setData=function(e,t){this.clearData(e),this._types.push(e),this._values.push(t)},e.prototype.clearData=function(e){var t=this._types.indexOf(e);-1!==t&&(this._types.splice(t,1),this._values.splice(t,1))},e.prototype.clear=function(){this._types.length=0,this._values.length=0}}();var t,n,o=function(){function e(){var e=this;this.promise=new Promise((function(t,r){e._resolve=t,e._reject=r}))}return e.prototype.resolve=function(e){(0,this._resolve)(e)},e.prototype.reject=function(e){(0,this._reject)(e)},e}();function s(e){for(var t=0,r=0,n=e.length;r<n;++r)r%4===0&&(t=4294967295*Math.random()>>>0),e[r]=255&t,t>>>=8}!function(e){e.getRandomValues=function(){var e="undefined"!==typeof window&&(window.crypto||window.msCrypto)||null;return e&&"function"===typeof e.getRandomValues?function(t){return e.getRandomValues(t)}:s}()}(t||(t={})),function(e){e.uuid4=function(e){for(var t=new Uint8Array(16),r=new Array(256),n=0;n<16;++n)r[n]="0"+n.toString(16);for(n=16;n<256;++n)r[n]=n.toString(16);return function(){return e(t),t[6]=64|15&t[6],t[8]=128|63&t[8],r[t[0]]+r[t[1]]+r[t[2]]+r[t[3]]+"-"+r[t[4]]+r[t[5]]+"-"+r[t[6]]+r[t[7]]+"-"+r[t[8]]+r[t[9]]+"-"+r[t[10]]+r[t[11]]+r[t[12]]+r[t[13]]+r[t[14]]+r[t[15]]}}(t.getRandomValues)}(n||(n={}));var a=r(56977),i=r.n(a);function l(e,t){const r=i().normalize(t),n=i().dirname(r).split("/"),o=[];for(const a of n){o.push(a);const t=o.join("/");if(e.FS.analyzePath(t).exists){if(e.FS.isDir(t))throw new Error(`"${t}" already exists and is not a directory.`)}else try{e.FS.mkdir(t)}catch(s){throw console.error(`Failed to create a directory "${t}"`),s}}}function c(e,t,r,n){l(e,t),e.FS.writeFile(t,r,n)}function d(e){e.forEach((e=>{let t;try{t=new URL(e)}catch(r){return}if("emfs:"===t.protocol||"file:"===t.protocol)throw new Error(`"emfs:" and "file:" protocols are not allowed for the requirement (${e})`)}))}function g(e){e.runPython('\nimport micropip\nmicropip.add_mock_package(\n "pyarrow", "0.0.1",\n modules={\n "pyarrow": """\n__version__ = \'0.0.1\' # TODO: Update when releasing\n\n\nclass Table:\n @classmethod\n def from_pandas(*args, **kwargs):\n raise NotImplementedError("stlite is not supporting this method.")\n"""\n }\n)\n')}var u=function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function a(e){try{l(n.next(e))}catch(t){s(t)}}function i(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,i)}l((n=n.apply(e,t||[])).next())}))};let p,f;const h=self,m=new o;function y(e){h.postMessage({type:"event:progress",data:{message:e}})}const v=function(){return u(this,void 0,void 0,(function*(){const{entrypoint:e,files:t,requirements:r,wheels:n,mountedSitePackagesSnapshotFilePath:o,pyodideEntrypointUrl:s}=yield m.promise;if(y("Loading Pyodide."),console.debug("Import the entrypoint script."),importScripts(null!==s&&void 0!==s?s:"https://cdn.jsdelivr.net/pyodide/v0.22.1/full/pyodide.js"),console.debug("Loading Pyodide"),p=yield loadPyodide({stdout:console.log,stderr:console.error}),console.debug("Loaded Pyodide"),y("Mounting files."),Object.keys(t).forEach((e=>{const{data:r,opts:n}=t[e];console.debug(`Write a file "${e}"`),c(p,e,r,n)})),o)y("Restoring the snapshot."),yield p.runPythonAsync("import tarfile, shutil, site"),yield p.runPythonAsync("\n site_packages_dirs = site.getsitepackages()\n for site_packages in site_packages_dirs:\n shutil.rmtree(site_packages)\n "),console.debug(`Unarchive ${o}`),yield p.runPythonAsync(`\n with tarfile.open("${o}", "r") as tar_gz_file:\n tar_gz_file.extractall("/")\n `),console.debug("Restored the snapshot"),y("Mocking some packages."),console.debug("Mock pyarrow"),g(p),console.debug("Mocked pyarrow");else{if(!n)throw new Error("Neither snapshot nor wheel files are provided.");{y("Installing streamlit and its dependencies."),console.debug("Loading stlite-server, and streamlit"),yield p.loadPackage("micropip");const e=p.pyimport("micropip");yield e.install.callKwargs([n.stliteServer],{keep_going:!0}),yield e.install.callKwargs([n.streamlit],{keep_going:!0}),console.debug("Loaded stlite-server, and streamlit"),y("Mocking some packages."),console.debug("Mock pyarrow"),g(p),console.debug("Mocked pyarrow"),y("Installing the requirements."),console.debug("Installing the requirements:",r),d(r),yield e.install.callKwargs(r,{keep_going:!0}),console.debug("Installed the requirements:",r)}}yield p.runPythonAsync("\n import importlib\n importlib.invalidate_caches()\n "),y("Loading streamlit package."),console.debug("Loading the Streamlit package"),yield p.runPythonAsync("\n import streamlit.runtime\n import streamlit.web\n "),console.debug("Loaded the Streamlit package"),y("Setting up the loggers."),console.debug("Setting the loggers"),yield p.runPythonAsync("\n import logging\n import streamlit.logger\n\n streamlit.logger.get_logger = logging.getLogger\n streamlit.logger.setup_formatter = None\n streamlit.logger.update_formatter = lambda *a, **k: None\n streamlit.logger.set_log_level = lambda *a, **k: None\n ");self.__logCallback__=e=>{e.startsWith("CRITICAL")||e.startsWith("ERROR")?console.error(e):e.startsWith("WARNING")?console.warn(e):e.startsWith("INFO")?console.info(e):e.startsWith("DEBUG")?console.debug(e):console.log(e)},yield p.runPythonAsync('\n from js import __logCallback__\n\n\n class JsHandler(logging.Handler):\n def emit(self, record):\n msg = self.format(record)\n __logCallback__(msg)\n\n\n main_formatter = logging.Formatter("%(levelname)s:%(name)s:%(message)s")\n\n js_handler = JsHandler()\n js_handler.setFormatter(main_formatter)\n\n root_logger = logging.getLogger()\n root_logger.handlers.clear()\n root_logger.addHandler(js_handler)\n root_logger.setLevel(logging.DEBUG)\n\n streamlit_handler = logging.getLogger("streamlit")\n streamlit_handler.setLevel(logging.DEBUG)\n '),console.debug("Set the loggers"),y("Mocking some Streamlit functions for the browser environment."),console.debug("Mocking some Streamlit functions"),yield p.runPythonAsync("\n import streamlit\n\n def is_cacheable_msg(msg):\n return False\n\n streamlit.runtime.runtime.is_cacheable_msg = is_cacheable_msg\n "),console.debug("Mocked some Streamlit functions"),y("Booting up the Streamlit server."),console.debug("Booting up the Streamlit server"),yield p.runPythonAsync(`\n from stlite_server.bootstrap import load_config_options, prepare\n from stlite_server.server import Server\n\n load_config_options({\n "global.dataFrameSerialization": "legacy", # Not to use PyArrow\n "browser.gatherUsageStats": False,\n })\n\n main_script_path = "${e}"\n command_line = None\n args = []\n\n prepare(main_script_path, args)\n\n server = Server(main_script_path, command_line)\n server.start()\n `),console.debug("Booted up the Streamlit server"),console.debug("Setting up the HTTP server"),f=p.globals.get("server").copy(),console.debug("Set up the HTTP server"),h.postMessage({type:"event:loaded"})}))}().catch((e=>{throw h.postMessage({type:"event:error",data:{error:e}}),e}));self.onmessage=e=>u(void 0,void 0,void 0,(function*(){const t=e.data;if("initData"===t.type)return void m.resolve(t.data);yield v;const r=e.ports[0];try{switch(t.type){case"websocket:connect":{console.debug("websocket:connect",t.data);const{path:e}=t.data;f.start_websocket(e,((e,t)=>{if(t){const t=e.getBuffer("u8");e.destroy();const r=new Uint8ClampedArray(t.data.buffer,t.data.byteOffset,t.data.byteLength);h.postMessage({type:"websocket:message",data:{payload:new Uint8Array(r)}})}else h.postMessage({type:"websocket:message",data:{payload:e}})})),r.postMessage({type:"reply"});break}case"websocket:send":{console.debug("websocket:send",t.data);const{payload:e}=t.data;f.receive_websocket_from_js(e);break}case"http:request":{console.debug("http:request",t.data);const{request:e}=t.data,n=(e,t,n)=>{const o=t.toJs(),s=n.toJs();console.debug({statusCode:e,headers:o,body:s});const a={type:"http:response",data:{response:{statusCode:e,headers:o,body:s}}};r.postMessage(a)};f.receive_http_from_js(e.method,e.path,e.headers,e.body,n);break}case"file:write":{const{path:e,data:n,opts:o}=t.data;console.debug(`Write a file "${e}"`),c(p,e,n,o),r.postMessage({type:"reply"});break}case"file:rename":{const{oldPath:e,newPath:n}=t.data;console.debug(`Rename "${e}" to ${n}`),function(e,t,r){l(e,r),e.FS.rename(t,r)}(p,e,n),r.postMessage({type:"reply"});break}case"file:unlink":{const{path:e}=t.data;console.debug(`Remove "${e}`),p.FS.unlink(e),r.postMessage({type:"reply"});break}case"install":{const{requirements:e}=t.data,n=p.pyimport("micropip");console.debug("Install the requirements:",e),d(e),yield n.install.callKwargs(e,{keep_going:!0}).then((()=>{if(e.includes("matplotlib"))return p.runPythonAsync("\n from stlite_server.bootstrap import _fix_matplotlib_crash\n _fix_matplotlib_crash()\n ")})).then((()=>{console.debug("Successfully installed"),r.postMessage({type:"reply"})}))}}}catch(n){r.postMessage({type:"reply",error:n})}})),h.postMessage({type:"event:start"})})()})();
@@ -1 +0,0 @@
1
- "use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[7496],{77390:(e,t,s)=>{s.d(t,{$:()=>c,Z:()=>h});var i=s(5057),r=s(31476),o=s(85493),n=s(99362),a=s(16449),l=s(80099),d=s(96266);let c;!function(e){e.EXTRASMALL="xs",e.SMALL="sm",e.MEDIUM="md",e.LARGE="lg",e.EXTRALARGE="xl"}(c||(c={}));const h=function({value:e,width:t,size:s=c.SMALL,overrides:h}){const g=(0,r.u)(),u={xs:g.spacing.twoXS,sm:g.spacing.sm,md:g.spacing.lg,lg:g.spacing.xl,xl:g.spacing.twoXL},{activeTheme:p}=i.useContext(o.Z),m=!(0,n.MJ)(p),f={BarContainer:{style:{marginTop:g.spacing.none,marginBottom:g.spacing.none,marginRight:g.spacing.none,marginLeft:g.spacing.none}},Bar:{style:({$theme:e})=>({width:t?t.toString():void 0,marginTop:g.spacing.none,marginBottom:g.spacing.none,marginRight:g.spacing.none,marginLeft:g.spacing.none,height:u[s],backgroundColor:e.colors.progressbarTrackFill,borderTopLeftRadius:g.spacing.twoXS,borderTopRightRadius:g.spacing.twoXS,borderBottomLeftRadius:g.spacing.twoXS,borderBottomRightRadius:g.spacing.twoXS})},BarProgress:{style:({$theme:e})=>({backgroundColor:m?g.colors.primary:g.colors.blue70,borderTopLeftRadius:g.spacing.twoXS,borderTopRightRadius:g.spacing.twoXS,borderBottomLeftRadius:g.spacing.twoXS,borderBottomRightRadius:g.spacing.twoXS})}};return(0,d.jsx)(a.Z,{value:e,overrides:(0,l.aO)(f,h)})}},77496:(e,t,s)=>{s.r(t),s.d(t,{default:()=>q});var i,r=s(30967),o=s(10458),n=s.n(o),a=s(65873),l=s.n(a),d=s(5057),c=s(32291),h=s(97292),g=s(54840),u=s(8429),p=s(86964),m=s(56846),f=s(52801),S=s(34422),w=s(41605),x=s(77390),R=s(45490),b=s(59990);function F(e,t){switch(e){case i.XSMALL:return{padding:`${t.spacing.twoXS} ${t.spacing.sm}`,fontSize:t.fontSizes.sm};case i.SMALL:return{padding:`${t.spacing.twoXS} ${t.spacing.md}`};case i.LARGE:return{padding:`${t.spacing.md} ${t.spacing.md}`};default:return{padding:`${t.spacing.xs} ${t.spacing.md}`}}}!function(e){e.XSMALL="xsmall",e.SMALL="small",e.MEDIUM="medium",e.LARGE="large"}(i||(i={}));const C=(0,R.Z)("div",{target:"ejtjsn29"})((({theme:e,width:t})=>({position:"relative",overflow:"hidden",width:"100%",objectFit:"contain"})),""),j=(0,R.Z)("div",{target:"ejtjsn28"})((({theme:e,width:t})=>({backgroundColor:e.colors.secondaryBg,borderRadius:`${e.radii.md} ${e.radii.md} 0 0`,width:"100%",height:9*t/16,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"})),""),I=(0,R.Z)("p",{target:"ejtjsn27"})((({theme:e})=>({marginTop:e.spacing.sm,textAlign:"center"})),""),v=(0,R.Z)("img",{target:"ejtjsn26"})((({theme:e,opacity:t})=>({borderRadius:`${e.radii.md} ${e.radii.md} 0 0`,objectFit:"contain",opacity:t})),""),E=(0,R.Z)("a",{target:"ejtjsn25"})((({theme:e})=>({color:e.colors.primary,display:"block",textDecoration:"none"})),""),T=(0,R.Z)("span",{target:"ejtjsn24"})((({theme:e})=>({display:"flex",alignItems:"center"})),""),M=(0,R.Z)("div",{target:"ejtjsn23"})((({theme:e})=>({position:"absolute",top:e.spacing.lg,right:e.spacing.lg,zIndex:1,color:e.colors.fadedText40,mixBlendMode:"difference",opacity:.6})),""),P=(0,R.Z)("div",{target:"ejtjsn21"})((({theme:e})=>({height:"fit-content",width:"100%",position:"absolute",bottom:0})),""),y=(0,R.Z)("button",{target:"ejtjsn20"})((({theme:e})=>({position:"relative",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:e.colors.lightenedBg05,border:`1px solid ${e.colors.fadedText10}`,borderRadius:`0 0 ${e.radii.md} ${e.radii.md}`,"&:hover":{borderColor:e.colors.primary,color:e.colors.primary},"&:active":{color:e.colors.white,borderColor:e.colors.primary,backgroundColor:e.colors.primary},"&:focus:not(:active)":{borderColor:e.colors.primary,color:e.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:e.colors.fadedText40},fontWeight:e.fontWeights.normal,padding:`${e.spacing.xs} ${e.spacing.md}`,margin:0,lineHeight:e.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{boxShadow:`0 0 0 0.2rem ${(0,b.DZ)(e.colors.primary,.5)}`,outline:"none"},...F(i.MEDIUM,e)})),"");var L=s(96266);const U=function({disabled:e,onClick:t,children:s,progress:i}){return(0,L.jsxs)(y,{disabled:e||!1,onClick:t||(()=>{}),progress:i||null,"data-testid":"stCameraInputButton",children:[s,i&&(0,L.jsx)(P,{children:(0,L.jsx)(x.Z,{value:i,size:x.$.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}},BarProgress:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}},BarContainer:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}}}})})]})};var k=s(90693),$=s(92445),Z=s(3579);let D;!function(e){e.USER="user",e.ENVIRONMENT="environment"}(D||(D={}));const X=({switchFacingMode:e})=>(0,L.jsx)(M,{children:(0,L.jsx)(g.ZP,{content:"Switch camera",placement:g.ug.TOP_RIGHT,children:(0,L.jsx)($.ZP,{kind:$.hY.MINIMAL,onClick:e,children:(0,L.jsx)(h.ZP,{content:k.Z,size:"twoXL",color:Z.Z.white})})})});var O=s(85585),_=s(31476),A=s(11226),B=s(74947),N=s.n(B),z=s(92371);let G;!function(e){e.PENDING="pending",e.SUCCESS="success",e.ERROR="error"}(G||(G={}));const V=({width:e})=>(0,L.jsxs)(j,{width:e,children:[(0,L.jsx)(h.ZP,{size:"threeXL",color:Z.Z.gray60,content:O.n}),(0,L.jsxs)(I,{children:["This app would like to use your camera.",(0,L.jsx)(E,{href:z.U3,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]})]}),W=({handleCapture:e,width:t,disabled:s,clearPhotoInProgress:i,setClearPhotoInProgress:r,facingMode:o,setFacingMode:n})=>{const[a,l]=(0,d.useState)(G.PENDING),c=(0,d.useRef)(null),[h,g]=(0,d.useState)(t),u=(0,d.useCallback)((0,S.Ds)(1e3,g),[]);(0,d.useEffect)((()=>{u(t)}),[t]);const p=(0,_.u)();return(0,L.jsxs)(C,{width:h,children:[a===G.SUCCESS||s||i?A.tq&&(0,L.jsx)(X,{switchFacingMode:n}):(0,L.jsx)(V,{width:h}),(0,L.jsx)(j,{hidden:a!==G.SUCCESS&&!s&&!i,width:h,children:!s&&(0,L.jsx)(N(),{audio:!1,ref:c,screenshotFormat:"image/jpeg",screenshotQuality:1,width:h,height:9*h/16,style:{borderRadius:`${p.radii.md} ${p.radii.md} 0 0`},onUserMediaError:()=>{l(G.ERROR)},onUserMedia:()=>{l(G.SUCCESS),r(!1)},videoConstraints:{width:{ideal:h},facingMode:o}})}),(0,L.jsx)(U,{onClick:function(){if(null!==c.current){const t=c.current.getScreenshot();e(t)}},disabled:a!==G.SUCCESS||s||i,children:"Take Photo"})]})};class H extends d.PureComponent{constructor(e){super(e),this.localFileIdCounter=1,this.RESTORED_FROM_WIDGET_STRING="RESTORED_FROM_WIDGET",this.formClearHelper=new m.Kz,this.getProgress=()=>{if(this.state.files.length>0&&"uploading"===this.state.files[this.state.files.length-1].status.type){return this.state.files[this.state.files.length-1].status.progress}},this.setClearPhotoInProgress=e=>{this.setState({clearPhotoInProgress:e})},this.setFacingMode=()=>{this.setState((e=>({facingMode:e.facingMode===D.USER?D.ENVIRONMENT:D.USER})))},this.handleCapture=e=>{if(null===e)return Promise.resolve();this.setState({imgSrc:e,shutter:!0,minShutterEffectPassed:!1});var t,s;return(t=e,s=`camera-input-${(new Date).toISOString().replace(/:/g,"_")}.jpg`,fetch(t).then((e=>e.arrayBuffer())).then((e=>new File([e],s,{type:"image/jpeg"})))).then((e=>this.uploadFile(e))).then((()=>{return e=150,new Promise((t=>setTimeout(t,e)));var e})).then((()=>{this.setState(((t,s)=>({imgSrc:e,shutter:t.shutter,minShutterEffectPassed:!0})))})).catch((e=>{(0,f.H)(e)}))},this.removeCapture=()=>{0!==this.state.files.length&&(this.state.files.forEach((e=>this.deleteFile(e.id))),this.setState({imgSrc:null,clearPhotoInProgress:!0}))},this.componentDidUpdate=e=>{const{element:t,widgetMgr:s}=this.props;if(e.disabled!==this.props.disabled&&this.props.disabled)return this.reset(),void s.setFileUploaderStateValue(t,new c.xO,{fromUi:!1});if("ready"!==this.status)return;const i=this.createWidgetValue();if(void 0===i)return;const r=s.getFileUploaderStateValue(t);l().isEqual(i,r)||s.setFileUploaderStateValue(t,i,{fromUi:!0})},this.onFormCleared=()=>{this.setState({files:[]},(()=>{const e=this.createWidgetValue();null!=e&&(this.setState({imgSrc:null}),this.props.widgetMgr.setFileUploaderStateValue(this.props.element,e,{fromUi:!0}))}))},this.deleteFile=e=>{const t=this.getFile(e);null!=t&&("uploading"===t.status.type&&t.status.cancelToken.cancel(),this.removeFile(e))},this.addFile=e=>{this.setState((t=>({files:[...t.files,e]})))},this.removeFile=e=>{this.setState((t=>({files:t.files.filter((t=>t.id!==e))})))},this.getFile=e=>this.state.files.find((t=>t.id===e)),this.updateFile=(e,t)=>{this.setState((s=>({files:s.files.map((s=>s.id===e?t:s))})))},this.onUploadComplete=(e,t)=>{this.setState((e=>({newestServerFileId:Math.max(e.newestServerFileId,t),shutter:!1})));const s=this.getFile(e);null!=s&&"uploading"===s.status.type&&this.updateFile(s.id,s.setStatus({type:"uploaded",serverFileId:t}))},this.onUploadProgress=(e,t)=>{const s=this.getFile(t);if(null==s||"uploading"!==s.status.type)return;const i=Math.round(100*e.loaded/e.total);s.status.progress!==i&&this.updateFile(t,s.setStatus({type:"uploading",cancelToken:s.status.cancelToken,progress:i}))},this.reset=()=>{this.setState({files:[],imgSrc:null})},this.uploadFile=e=>{const t=n().CancelToken.source(),s=new w.R(e.name,e.size,this.nextLocalFileId(),{type:"uploading",cancelToken:t,progress:1});this.addFile(s),this.props.uploadClient.uploadFile(this.props.element,e,(e=>this.onUploadProgress(e,s.id)),t.token).then((e=>this.onUploadComplete(s.id,e))).catch((e=>{n().isCancel(e)||this.updateFile(s.id,s.setStatus({type:"error",errorMessage:e?e.toString():"Unknown error"}))}))},this.state=this.initialValue}get initialValue(){const e={files:[],newestServerFileId:0,imgSrc:null,shutter:!1,minShutterEffectPassed:!0,clearPhotoInProgress:!1,facingMode:D.USER},{widgetMgr:t,element:s}=this.props,i=t.getFileUploaderStateValue(s);if(null==i)return e;const{maxFileId:r,uploadedFileInfo:o}=i;return null==r||0===r||null==o?e:{files:o.map((e=>{const t=e.name,s=e.size,i=e.id;return new w.R(t,s,this.nextLocalFileId(),{type:"uploaded",serverFileId:i})})),newestServerFileId:Number(r),imgSrc:0===o.length?"":this.RESTORED_FROM_WIDGET_STRING,shutter:!1,minShutterEffectPassed:!1,clearPhotoInProgress:!1,facingMode:D.USER}}componentWillUnmount(){this.formClearHelper.disconnect()}get status(){return this.state.files.some((e=>"uploading"===e.status.type))?"updating":"ready"}createWidgetValue(){if(0===this.state.newestServerFileId)return;const e=this.state.files.filter((e=>"uploaded"===e.status.type)).map((e=>{const{name:t,size:s,status:i}=e;return new c.jM({id:i.serverFileId,name:t,size:s})}));return new c.xO({maxFileId:this.state.newestServerFileId,uploadedFileInfo:e})}render(){var e;const{element:t,widgetMgr:s,disabled:i,width:o}=this.props;return this.formClearHelper.manageFormClearListener(s,t.formId,this.onFormCleared),(0,L.jsxs)(C,{width:o,className:"row-widget","data-testid":"stCameraInput",children:[(0,L.jsx)(p.ON,{label:t.label,disabled:i,labelVisibility:(0,S.iF)(null===(e=t.labelVisibility)||void 0===e?void 0:e.value),children:t.help&&(0,L.jsx)(p.dT,{children:(0,L.jsx)(u.Z,{content:t.help,placement:g.ug.TOP_RIGHT})})}),this.state.imgSrc?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(j,{width:o,children:this.state.imgSrc!==this.RESTORED_FROM_WIDGET_STRING&&(0,L.jsx)(v,{src:this.state.imgSrc,alt:"Snapshot",opacity:this.state.shutter||!this.state.minShutterEffectPassed?"50%":"100%",width:o,height:9*o/16})}),(0,L.jsx)(U,{onClick:this.removeCapture,progress:this.getProgress(),disabled:!!this.getProgress()||i,children:this.getProgress()?"Uploading...":(0,L.jsxs)(T,{children:[(0,L.jsx)(h.ZP,{content:r.X,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):(0,L.jsx)(W,{handleCapture:this.handleCapture,width:o,disabled:i,clearPhotoInProgress:this.state.clearPhotoInProgress,setClearPhotoInProgress:this.setClearPhotoInProgress,facingMode:this.state.facingMode,setFacingMode:this.setFacingMode})]})}nextLocalFileId(){return this.localFileIdCounter++}}const q=H},41605:(e,t,s)=>{s.d(t,{R:()=>i});class i{setStatus(e){return new i(this.name,this.size,this.id,e)}constructor(e,t,s,i){this.name=void 0,this.size=void 0,this.status=void 0,this.id=void 0,this.name=e,this.size=t,this.id=s,this.status=i}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[7698],{67698:(e,t,s)=>{s.r(t),s.d(t,{default:()=>m});var o=s(5057),n=s(31476),i=s(99362),r=s(46540),l=s(85493),a=s(45490),c=s(70765),g=s(69194);const d=(0,a.Z)(c.Q,{shouldForwardProp:g.Z,target:"e17lx80j1"})((({theme:e,$usingCustomTheme:t})=>({marginTop:e.spacing.none,marginBottom:e.spacing.none,marginRight:e.spacing.none,marginLeft:e.spacing.none,borderColor:e.colors.fadedText10,borderTopColor:t?e.colors.primary:e.colors.blue70,flexGrow:0,flexShrink:0})),""),h=(0,a.Z)("div",{target:"e17lx80j0"})((({theme:e})=>({display:"flex",gap:e.spacing.lg,alignItems:"center",width:"100%"})),"");var p=s(96266);const m=function({width:e,element:t}){const s=(0,n.u)(),{activeTheme:a}=o.useContext(l.Z),c=!(0,i.MJ)(a),g={width:e};return(0,p.jsx)("div",{className:"stSpinner",style:g,children:(0,p.jsxs)(h,{children:[(0,p.jsx)(d,{$size:s.iconSizes.twoXL,$usingCustomTheme:c}),(0,p.jsx)(r.Z,{source:t.text,allowHTML:!1})]})})}}}]);
@@ -1,5 +0,0 @@
1
- "use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[7858],{6757:(t,e,i)=>{i.d(e,{Z:()=>d});i(5057);var s=i(34422),n=i(86964),o=i(45490);const r=i(21371).F4`
2
- 50% {
3
- color: rgba(0, 0, 0, 0);
4
- }
5
- `,a=(0,o.Z)("span",{target:"e1m4n6jn0"})((({includeDot:t,shouldBlink:e,theme:i})=>({...t?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:i.colors.gray,margin:"0 5px"}}:{},...e?{color:i.colors.red,animationName:`${r}`,animationDuration:"0.5s",animationIterationCount:5}:{}})),"");var l=i(96266);const d=({dirty:t,value:e,maxLength:i,className:o,type:r="single"})=>{const d=[],h=(t,e=!1)=>{d.push((0,l.jsx)(a,{includeDot:d.length>0,shouldBlink:e,children:t},d.length))};return t&&("multiline"===r?(0,s.Ge)()?h("Press \u2318+Enter to apply"):h("Press Ctrl+Enter to apply"):h("Press Enter to apply")),i&&h(`${e.length}/${i}`,t&&e.length>=i),(0,l.jsx)(n.X7,{className:o,children:d})}},7858:(t,e,i)=>{i.r(e),i.d(e,{default:()=>R});var s=i(5057),n=i(52707),o=i(84332),r=i(59500),a=i(56846),l=i(52801),d=i(32291),h=i(8429),u=i(54840),c=i(97292),m=i(30124),p=i(6757),g=i(86964),b=i(34422),f=i(45490);const y=(0,f.Z)("div",{target:"e1jwn65y3"})((({theme:t})=>({display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",border:"1px solid transparent",transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:t.radii.md,"&.focused":{borderColor:t.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:t.spacing.none}}})),""),x=(0,f.Z)("div",{target:"e1jwn65y2"})({name:"76z9jo",styles:"display:flex;flex-direction:row;align-self:stretch"}),v=(0,f.Z)("button",{target:"e1jwn65y1"})((({theme:t})=>({margin:t.spacing.none,border:"none",height:t.sizes.full,display:"flex",alignItems:"center",width:"32px",justifyContent:"center",color:t.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:t.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:t.colors.white,backgroundColor:t.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:last-of-type":{borderTopRightRadius:t.radii.md,borderBottomRightRadius:t.radii.md},"&:disabled":{cursor:"not-allowed",color:t.colors.fadedText40}})),""),V=(0,f.Z)("div",{target:"e1jwn65y0"})((({theme:t})=>({position:"absolute",marginRight:t.spacing.twoXS,left:0,right:"64px"})),"");var w=i(96266);class D extends s.PureComponent{constructor(t){super(t),this.formClearHelper=new a.Kz,this.inputRef=s.createRef(),this.formatValue=t=>{const e=function(t){return null==t||""===t?void 0:t}(this.props.element.format);if(null==e)return t.toString();try{return(0,r.sprintf)(e,t)}catch(i){return(0,l.KE)(`Error in sprintf(${e}, ${t}): ${i}`),String(t)}},this.isIntData=()=>this.props.element.dataType===d.Y2.DataType.INT,this.getMin=()=>this.props.element.hasMin?this.props.element.min:-1/0,this.getMax=()=>this.props.element.hasMax?this.props.element.max:1/0,this.getStep=()=>{const{step:t}=this.props.element;return t||(this.isIntData()?1:.01)},this.commitWidgetValue=t=>{const{value:e}=this.state,{element:i,widgetMgr:s}=this.props,n=this.props.element,o=this.getMin(),r=this.getMax();if(o>e||e>r){const t=this.inputRef.current;t&&t.reportValidity()}else{const o=e||0===e?e:n.default;this.isIntData()?s.setIntValue(i,o,t):s.setDoubleValue(i,o,t),this.setState({dirty:!1,value:o,formattedValue:this.formatValue(o)})}},this.onFormCleared=()=>{this.setState(((t,e)=>({value:e.element.default})),(()=>this.commitWidgetValue({fromUi:!0})))},this.onBlur=()=>{this.state.dirty&&this.commitWidgetValue({fromUi:!0}),this.setState({isFocused:!1})},this.onFocus=()=>{this.setState({isFocused:!0})},this.onChange=t=>{const{value:e}=t.target;let i;i=this.isIntData()?parseInt(e,10):parseFloat(e),this.setState({dirty:!0,value:i,formattedValue:e})},this.onKeyDown=t=>{const{key:e}=t;switch(e){case"ArrowUp":t.preventDefault(),this.modifyValueUsingStep("increment")();break;case"ArrowDown":t.preventDefault(),this.modifyValueUsingStep("decrement")()}},this.onKeyPress=t=>{"Enter"===t.key&&this.state.dirty&&this.commitWidgetValue({fromUi:!0})},this.modifyValueUsingStep=t=>()=>{const{value:e}=this.state,i=this.getStep();switch(t){case"increment":this.canIncrement&&this.setState({dirty:!0,value:e+i},(()=>{this.commitWidgetValue({fromUi:!0})}));break;case"decrement":this.canDecrement&&this.setState({dirty:!0,value:e-i},(()=>{this.commitWidgetValue({fromUi:!0})}))}},this.state={dirty:!1,value:this.initialValue,formattedValue:this.formatValue(this.initialValue),isFocused:!1}}get initialValue(){const t=this.isIntData()?this.props.widgetMgr.getIntValue(this.props.element):this.props.widgetMgr.getDoubleValue(this.props.element);return void 0!==t?t:this.props.element.default}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:t}=this.props.element;t&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:t}=this.props.element;this.props.element.setValue=!1,this.setState({value:t,formattedValue:this.formatValue(t)},(()=>{this.commitWidgetValue({fromUi:!1})}))}get canDecrement(){return this.state.value-this.getStep()>=this.getMin()}get canIncrement(){return this.state.value+this.getStep()<=this.getMax()}render(){var t;const{element:e,width:i,disabled:s,widgetMgr:r}=this.props,{formattedValue:a,dirty:l,isFocused:d}=this.state,f={width:i},D=!this.canDecrement||s,R=!this.canIncrement||s;return this.formClearHelper.manageFormClearListener(r,e.formId,this.onFormCleared),(0,w.jsxs)("div",{className:"stNumberInput",style:f,children:[(0,w.jsx)(g.ON,{label:e.label,disabled:s,labelVisibility:(0,b.iF)(null===(t=e.labelVisibility)||void 0===t?void 0:t.value),children:e.help&&(0,w.jsx)(g.dT,{children:(0,w.jsx)(h.Z,{content:e.help,placement:u.ug.TOP_RIGHT})})}),(0,w.jsxs)(y,{className:d?"focused":"",children:[(0,w.jsx)(m.Z,{type:"number",inputRef:this.inputRef,value:a,onBlur:this.onBlur,onFocus:this.onFocus,onChange:this.onChange,onKeyPress:this.onKeyPress,onKeyDown:this.onKeyDown,disabled:s,"aria-label":e.label,overrides:{Input:{props:{step:this.getStep(),min:this.getMin(),max:this.getMax()},style:{lineHeight:"1.4",paddingRight:".5rem",paddingLeft:".5rem",paddingBottom:".5rem",paddingTop:".5rem"}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0})}}}),(0,w.jsxs)(x,{children:[(0,w.jsx)(v,{className:"step-down",onClick:this.modifyValueUsingStep("decrement"),disabled:D,children:(0,w.jsx)(c.ZP,{content:n.W,size:"xs",color:this.canDecrement?"inherit":"disabled"})}),(0,w.jsx)(v,{className:"step-up",onClick:this.modifyValueUsingStep("increment"),disabled:R,children:(0,w.jsx)(c.ZP,{content:o.v,size:"xs",color:this.canIncrement?"inherit":"disabled"})})]})]}),(0,w.jsx)(V,{children:(0,w.jsx)(p.Z,{dirty:l,value:a,className:"input-instructions"})})]})}}const R=D}}]);
@@ -1 +0,0 @@
1
- "use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[9462],{69462:(t,e,s)=>{s.r(e),s.d(e,{default:()=>n});var r=s(5057),u=s(85493),i=s(22199),a=s(9301),l=s(96266);function n({element:t,width:e}){const s=(0,r.useRef)(null),{getBaseUriParts:n}=(0,r.useContext)(u.Z);(0,r.useEffect)((()=>{s.current&&(s.current.currentTime=t.startTime)}),[t.startTime]);const c=(0,a.O0)(t.url),o=(0,i.Bz)(c,n());return(0,l.jsx)("audio",{id:"audio",ref:s,controls:!0,src:o,className:"stAudio",style:{width:e}})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[9551],{29551:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var s=r(5057),a=r(85493),n=r(32291),i=r(22199),l=r(9301),o=r(96266);const d=528;function c({element:e,width:t}){const r=(0,s.useRef)(null),{getBaseUriParts:c}=(0,s.useContext)(a.Z),{type:u,url:h}=e,m=(0,l.O0)(h);(0,s.useEffect)((()=>{const t=r.current,s=()=>{t&&(t.currentTime=e.startTime)};return t&&t.addEventListener("loadedmetadata",s),()=>{t&&t.removeEventListener("loadedmetadata",s)}}),[e]);const f=t=>{const{startTime:r}=e;return r?`${t}?start=${r}`:t};if(u===n.nk.Type.YOUTUBE_IFRAME){const e=0!==t?.75*t:d;return(0,o.jsx)("iframe",{title:m,src:f(m),width:t,height:e,frameBorder:"0",allow:"autoplay; encrypted-media",allowFullScreen:!0})}return(0,o.jsx)("video",{ref:r,controls:!0,src:(0,i.Bz)(m,c()),className:"stVideo",style:{width:t,height:0===t?d:void 0}})}}}]);