streamlit 1.52.0__py3-none-any.whl → 1.52.1__py3-none-any.whl

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 (93) hide show
  1. streamlit/static/index.html +1 -1
  2. streamlit/static/manifest.json +284 -284
  3. streamlit/static/static/js/{ErrorOutline.esm.ZJDbmVTx.js → ErrorOutline.esm.sMJdFExW.js} +1 -1
  4. streamlit/static/static/js/{FileDownload.esm.Dx0vI3vH.js → FileDownload.esm.CV-WYqBn.js} +1 -1
  5. streamlit/static/static/js/{FileHelper.B7Ero7qQ.js → FileHelper.5nCh9KDY.js} +1 -1
  6. streamlit/static/static/js/{FormClearHelper.CG2XN1_g.js → FormClearHelper.-9RbsnV0.js} +1 -1
  7. streamlit/static/static/js/{InputInstructions.Cj5-1zf6.js → InputInstructions.2R3tBtW9.js} +1 -1
  8. streamlit/static/static/js/{Particles.BfWfv0Aw.js → Particles.DDHoXFxh.js} +1 -1
  9. streamlit/static/static/js/{ProgressBar.CGQ8OgfO.js → ProgressBar.BxmfHxKu.js} +1 -1
  10. streamlit/static/static/js/{StreamlitSyntaxHighlighter.DTKLpwhl.js → StreamlitSyntaxHighlighter.BFWV0oqR.js} +1 -1
  11. streamlit/static/static/js/{Toolbar.B2qFUmd9.js → Toolbar.DMgU0Vgw.js} +1 -1
  12. streamlit/static/static/js/{base-input.o9tL8MDP.js → base-input.BXTqYbyG.js} +1 -1
  13. streamlit/static/static/js/{checkbox.0BeV1IBL.js → checkbox.5xWaqPqm.js} +1 -1
  14. streamlit/static/static/js/{createSuper.RBO59fEm.js → createSuper.OIgV8wc-.js} +1 -1
  15. streamlit/static/static/js/{data-grid-overlay-editor.CiTkUy0t.js → data-grid-overlay-editor.B4RIu9cw.js} +1 -1
  16. streamlit/static/static/js/{downloader.DwNZg3Mw.js → downloader.DwCJck8O.js} +1 -1
  17. streamlit/static/static/js/{embed.XT9xNd3F.js → embed.HKcgTiLB.js} +1 -1
  18. streamlit/static/static/js/{es6.x9KsYQg-.js → es6.4AP97RGk.js} +2 -2
  19. streamlit/static/static/js/{iframeResizer.contentWindow.ZVXpMPi0.js → iframeResizer.contentWindow.BZAsvL9q.js} +1 -1
  20. streamlit/static/static/js/{index.BxjzhVUb.js → index.-3selq_5.js} +1 -1
  21. streamlit/static/static/js/{index.AnXMIBz3.js → index.1ylynMAS.js} +1 -1
  22. streamlit/static/static/js/{index.hbeqcRTn.js → index.6UunrySF.js} +1 -1
  23. streamlit/static/static/js/{index.BfEKaEmw.js → index.B0TPxAZ1.js} +1 -1
  24. streamlit/static/static/js/{index.BQr-XwGV.js → index.BHWBaOWH.js} +1 -1
  25. streamlit/static/static/js/{index.CF5MxTbK.js → index.BJas6XzW.js} +1 -1
  26. streamlit/static/static/js/{index.B527JZdO.js → index.BKIlG7Ng.js} +1 -1
  27. streamlit/static/static/js/{index.5VPOamri.js → index.BMU6zZRk.js} +1 -1
  28. streamlit/static/static/js/{index.DO5utP74.js → index.BNMLO-0p.js} +1 -1
  29. streamlit/static/static/js/{index.DS7lf09n.js → index.BPmBNTel.js} +1 -1
  30. streamlit/static/static/js/{index.q5hIQwAY.js → index.BVuohWM1.js} +1 -1
  31. streamlit/static/static/js/{index.uSX757_v.js → index.B_AvdOKC.js} +1 -1
  32. streamlit/static/static/js/{index.RJZuWCGA.js → index.BjQIH-3U.js} +1 -1
  33. streamlit/static/static/js/{index.CyroQtI4.js → index.BrqtKtSu.js} +1 -1
  34. streamlit/static/static/js/{index.C_rK-Swb.js → index.Buc7XrOl.js} +5 -5
  35. streamlit/static/static/js/{index.DBalctjj.js → index.CIC9pLsG.js} +1 -1
  36. streamlit/static/static/js/{index.BTtmaLDB.js → index.CP2YZ73v.js} +1 -1
  37. streamlit/static/static/js/{index.DpNTZz82.js → index.CSbah0y4.js} +1 -1
  38. streamlit/static/static/js/{index.BWB_91TA.js → index.CbiYVMT1.js} +1 -1
  39. streamlit/static/static/js/{index.BHgV-yW4.js → index.CbxllBj8.js} +1 -1
  40. streamlit/static/static/js/{index.D6HmkoDm.js → index.Cd1D2eGF.js} +1 -1
  41. streamlit/static/static/js/{index.CuvXOyER.js → index.Ckcqwai8.js} +1 -1
  42. streamlit/static/static/js/{index.DMxc2XFp.js → index.CqTPbV5Y.js} +5 -5
  43. streamlit/static/static/js/{index.x_QRaLMd.js → index.CxXo5UKy.js} +1 -1
  44. streamlit/static/static/js/{index.rORSX6IW.js → index.CxbL5FgL.js} +1 -1
  45. streamlit/static/static/js/{index.CLmq_z9K.js → index.D52dMvK5.js} +1 -1
  46. streamlit/static/static/js/{index.Bjy4NRu9.js → index.DBUdji-9.js} +1 -1
  47. streamlit/static/static/js/{index.BuCx76ZV.js → index.DMU3coc2.js} +1 -1
  48. streamlit/static/static/js/{index.DsgAU5lc.js → index.DN4sfQLP.js} +1 -1
  49. streamlit/static/static/js/{index.KfXqjDYy.js → index.DRDE9rnx.js} +1 -1
  50. streamlit/static/static/js/{index.CyUHWoCC.js → index.DY9Ac89e.js} +1 -1
  51. streamlit/static/static/js/{index.BfXjTO8b.js → index.DYKCsDvl.js} +1 -1
  52. streamlit/static/static/js/{index.DXxnU5ej.js → index.Da9gznCC.js} +1 -1
  53. streamlit/static/static/js/{index.CjozwSzS.js → index.DfIRibXG.js} +1 -1
  54. streamlit/static/static/js/{index.CTgm_-jO.js → index.Dg5zbEp2.js} +1 -1
  55. streamlit/static/static/js/{index.Dr9HIhQw.js → index.Di9I2cid.js} +1 -1
  56. streamlit/static/static/js/{index.Bu5JWpT_.js → index.DkpEv0uV.js} +1 -1
  57. streamlit/static/static/js/{index.PaidgjCs.js → index.DwJ9Vhsl.js} +1 -1
  58. streamlit/static/static/js/{index.DWexTVLY.js → index.L7erTnMm.js} +1 -1
  59. streamlit/static/static/js/{index.CkGVt6-G.js → index.NaDyAN1s.js} +1 -1
  60. streamlit/static/static/js/{index.DlltaH7J.js → index.RNTPpVde.js} +1 -1
  61. streamlit/static/static/js/{index.DB_w_CZQ.js → index.VFDFuf_7.js} +1 -1
  62. streamlit/static/static/js/{index.By55VdPY.js → index.W-bl3NDo.js} +1 -1
  63. streamlit/static/static/js/{index.CNH4rdSz.js → index.XYozEjwK.js} +1 -1
  64. streamlit/static/static/js/{index.DAqCNvsO.js → index.oyLQ4pue.js} +1 -1
  65. streamlit/static/static/js/{index.DK0RFJUG.js → index.q4fLUQtC.js} +1 -1
  66. streamlit/static/static/js/{index.DcU3uDvB.js → index.q9puCQgK.js} +1 -1
  67. streamlit/static/static/js/{index.B1fRb5wF.js → index.xZBTXGNC.js} +1 -1
  68. streamlit/static/static/js/{input.D5oh9-aB.js → input.CcvrgErO.js} +1 -1
  69. streamlit/static/static/js/{main.q9oGOg0H.js → main.eVHOp4Th.js} +1 -1
  70. streamlit/static/static/js/{memory.5kCSFUJS.js → memory.Ck_sLv5Y.js} +1 -1
  71. streamlit/static/static/js/{number-overlay-editor.Cn_LsK8N.js → number-overlay-editor.DgcLMWOy.js} +1 -1
  72. streamlit/static/static/js/{pandasStylerUtils.BqhXt51_.js → pandasStylerUtils.DqP0h70z.js} +1 -1
  73. streamlit/static/static/js/{possibleConstructorReturn.DD9NK1Z8.js → possibleConstructorReturn.C_51n46K.js} +1 -1
  74. streamlit/static/static/js/{sandbox.DACSyz29.js → sandbox.Q-g3QIZJ.js} +1 -1
  75. streamlit/static/static/js/{styled-components.C3R090At.js → styled-components.e0V96rJw.js} +1 -1
  76. streamlit/static/static/js/{throttle.B0GR3Iyz.js → throttle.D3b5WILl.js} +1 -1
  77. streamlit/static/static/js/{timepicker.BdhzPxrv.js → timepicker.Bpn70xGc.js} +1 -1
  78. streamlit/static/static/js/{toConsumableArray.Db2pdqM2.js → toConsumableArray.DIN_ys1J.js} +1 -1
  79. streamlit/static/static/js/uniqueId.B27POWT6.js +1 -0
  80. streamlit/static/static/js/{useBasicWidgetState.Bfp6TnSw.js → useBasicWidgetState.DA3_qaXD.js} +1 -1
  81. streamlit/static/static/js/{useIntlLocale.hRV75Xgj.js → useIntlLocale.BSq6SANa.js} +1 -1
  82. streamlit/static/static/js/{useTextInputAutoExpand.QepX7n8Y.js → useTextInputAutoExpand.ytEW5QmA.js} +1 -1
  83. streamlit/static/static/js/{useUpdateUiValue.DHx8TzX6.js → useUpdateUiValue.DOxWBNiI.js} +1 -1
  84. streamlit/static/static/js/{useWaveformController.WxVzpzEX.js → useWaveformController.BCmk6WLk.js} +1 -1
  85. streamlit/static/static/js/{withCalculatedWidth.DcKeRSWJ.js → withCalculatedWidth.ChdrMItN.js} +1 -1
  86. streamlit/static/static/js/{withFullScreenWrapper.CrHddARq.js → withFullScreenWrapper.7j_lzlaF.js} +1 -1
  87. {streamlit-1.52.0.dist-info → streamlit-1.52.1.dist-info}/METADATA +1 -1
  88. {streamlit-1.52.0.dist-info → streamlit-1.52.1.dist-info}/RECORD +92 -92
  89. streamlit/static/static/js/uniqueId.CtqIr-Yh.js +0 -1
  90. {streamlit-1.52.0.data → streamlit-1.52.1.data}/scripts/streamlit.cmd +0 -0
  91. {streamlit-1.52.0.dist-info → streamlit-1.52.1.dist-info}/WHEEL +0 -0
  92. {streamlit-1.52.0.dist-info → streamlit-1.52.1.dist-info}/entry_points.txt +0 -0
  93. {streamlit-1.52.0.dist-info → streamlit-1.52.1.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
1
- import{r as It,cU as Tr,d0 as At,ag as _h,d1 as c5,bs as zu,_ as $D,j as Jf,a0 as l5,x as WD,k as JD,R as XD,d2 as AB,bn as u5,L as f5,g as h5,l as gB,ck as d5,d3 as mB}from"./index.DMxc2XFp.js";import{_ as gs,a as p5,C as A5}from"./toConsumableArray.Db2pdqM2.js";import{f as of,e as af,d as Ux,_ as Bp,a as zx}from"./possibleConstructorReturn.DD9NK1Z8.js";import{E as KD,w as g5}from"./withFullScreenWrapper.CrHddARq.js";import{a as m5,T as _5}from"./Toolbar.B2qFUmd9.js";import{l as r2}from"./index.8HslT92O.js";import{a as y5}from"./useBasicWidgetState.Bfp6TnSw.js";import{u as v5,s as b5}from"./threshold.Q1mXg5rX.js";import"./FormClearHelper.CG2XN1_g.js";import"./value.B4vHRSi7.js";function x5(r,e){for(var t=0;t<e.length;t++){const n=e[t];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in r)){const s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(r,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}function o_(r,e){if(!r)throw new Error(e||"loader assertion failed.")}const Gx=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),_B=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);_B&&parseFloat(_B[1]);const a_=globalThis,c_=globalThis.process||{},w5=globalThis.navigator||{};function qD(r){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&process.versions?.electron)return!0;const t=typeof navigator<"u"&&navigator.userAgent;return!!(t&&t.indexOf("Electron")>=0)}function Al(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||qD()}function C5(r){return Al()?qD()?"Electron":(w5.userAgent||"").indexOf("Edge")>-1?"Edge":globalThis.chrome?"Chrome":globalThis.safari?"Safari":globalThis.mozInnerScreenX?"Firefox":"Unknown":"Node"}const iy="4.1.0";function T5(r){try{const e=window[r],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch{return null}}let E5=class{constructor(e,t,n="sessionStorage"){this.storage=T5(n),this.id=e,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}};function B5(r){let e;return r<10?e=`${r.toFixed(2)}ms`:r<100?e=`${r.toFixed(1)}ms`:r<1e3?e=`${r.toFixed(0)}ms`:e=`${(r/1e3).toFixed(2)}s`,e}function S5(r,e=8){const t=Math.max(e-r.length,0);return`${" ".repeat(t)}${r}`}var l_;(function(r){r[r.BLACK=30]="BLACK",r[r.RED=31]="RED",r[r.GREEN=32]="GREEN",r[r.YELLOW=33]="YELLOW",r[r.BLUE=34]="BLUE",r[r.MAGENTA=35]="MAGENTA",r[r.CYAN=36]="CYAN",r[r.WHITE=37]="WHITE",r[r.BRIGHT_BLACK=90]="BRIGHT_BLACK",r[r.BRIGHT_RED=91]="BRIGHT_RED",r[r.BRIGHT_GREEN=92]="BRIGHT_GREEN",r[r.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",r[r.BRIGHT_BLUE=94]="BRIGHT_BLUE",r[r.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",r[r.BRIGHT_CYAN=96]="BRIGHT_CYAN",r[r.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(l_||(l_={}));const I5=10;function yB(r){return typeof r!="string"?r:(r=r.toUpperCase(),l_[r]||l_.WHITE)}function M5(r,e,t){return!Al&&typeof r=="string"&&(e&&(r=`\x1B[${yB(e)}m${r}\x1B[39m`),t&&(r=`\x1B[${yB(t)+I5}m${r}\x1B[49m`)),r}function P5(r,e=["constructor"]){const t=Object.getPrototypeOf(r),n=Object.getOwnPropertyNames(t),i=r;for(const s of n){const o=i[s];typeof o=="function"&&(e.find(c=>s===c)||(i[s]=o.bind(r)))}}function Vx(r,e){if(!r)throw new Error("Assertion failed")}function md(){let r;if(Al()&&a_.performance)r=a_?.performance?.now?.();else if("hrtime"in c_){const e=c_?.hrtime?.();r=e[0]*1e3+e[1]/1e6}else r=Date.now();return r}const _d={debug:Al()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},R5={enabled:!0,level:0};function yd(){}const vB={},bB={once:!0};let YD=class{constructor({id:e}={id:""}){this.VERSION=iy,this._startTs=md(),this._deltaTs=md(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new E5(`__probe-${this.id}__`,R5),this.timeStamp(`${this.id} started`),P5(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((md()-this._startTs).toPrecision(10))}getDelta(){return Number((md()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,t){this._storage.setConfiguration({[e]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,t){if(!e)throw new Error(t||"Assertion failed")}warn(e){return this._getLogFunction(0,e,_d.warn,arguments,bB)}error(e){return this._getLogFunction(0,e,_d.error,arguments)}deprecated(e,t){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${t}\` instead`)}removed(e,t){return this.error(`\`${e}\` has been removed. Use \`${t}\` instead`)}probe(e,t){return this._getLogFunction(e,t,_d.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,_d.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,_d.debug||_d.info,arguments,bB)}table(e,t,n){return t?this._getLogFunction(e,t,console.table||yd,n&&[n],{tag:D5(t)}):yd}time(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}timeEnd(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,t){return this._getLogFunction(e,t,console.timeStamp||yd)}group(e,t,n={collapsed:!1}){const i=xB({logLevel:e,message:t,opts:n}),{collapsed:s}=n;return i.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(e,t,n={}){return this.group(e,t,Object.assign({},n,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||yd)}withGroup(e,t,n){this.group(e,t)();try{n()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=ZD(e)}_getLogFunction(e,t,n,i,s){if(this._shouldLog(e)){s=xB({logLevel:e,message:t,args:i,opts:s}),n=n||s.method,Vx(n),s.total=this.getTotal(),s.delta=this.getDelta(),this._deltaTs=md();const o=s.tag||s.message;if(s.once&&o)if(!vB[o])vB[o]=md();else return yd;return t=F5(this.id,s.message,s),n.bind(console,t,...s.args)}return yd}};YD.VERSION=iy;function ZD(r){if(!r)return 0;let e;switch(typeof r){case"number":e=r;break;case"object":e=r.logLevel||r.priority||0;break;default:return 0}return Vx(Number.isFinite(e)&&e>=0),e}function xB(r){const{logLevel:e,message:t}=r;r.logLevel=ZD(e);const n=r.args?Array.from(r.args):[];for(;n.length&&n.shift()!==t;);switch(typeof e){case"string":case"function":t!==void 0&&n.unshift(t),r.message=e;break;case"object":Object.assign(r,e);break}typeof r.message=="function"&&(r.message=r.message());const i=typeof r.message;return Vx(i==="string"||i==="object"),Object.assign(r,{args:n},r.opts)}function F5(r,e,t){if(typeof e=="string"){const n=t.time?S5(B5(t.total)):"";e=t.time?`${r}: ${n} ${e}`:`${r}: ${e}`,e=M5(e,t.color,t.background)}return e}function D5(r){for(const e in r)for(const t in r[e])return t||"untitled";return"empty"}function O5(r,e){return QD(r||{},e)}function QD(r,e,t=0){if(t>3)return e;const n={...r};for(const[i,s]of Object.entries(e))s&&typeof s=="object"&&!Array.isArray(s)?n[i]=QD(n[i]||{},e[i],t+1):n[i]=e[i];return n}const L5="latest";function k5(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.2.4"),globalThis._loadersgl_.version}const N5=k5();function Yu(r,e){if(!r)throw new Error(e||"loaders.gl assertion failed.")}const rh=typeof process!="object"||String(process)!=="[object process]"||process.browser,U5=typeof window<"u"&&typeof window.orientation<"u",wB=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);wB&&parseFloat(wB[1]);let z5=class{name;workerThread;isRunning=!0;result;_resolve=()=>{};_reject=()=>{};constructor(e,t){this.name=e,this.workerThread=t,this.result=new Promise((n,i)=>{this._resolve=n,this._reject=i})}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){Yu(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){Yu(this.isRunning),this.isRunning=!1,this._reject(e)}},Nv=class{terminate(){}};const Uv=new Map;function G5(r){Yu(r.source&&!r.url||!r.source&&r.url);let e=Uv.get(r.source||r.url);return e||(r.url&&(e=V5(r.url),Uv.set(r.url,e)),r.source&&(e=eO(r.source),Uv.set(r.source,e))),Yu(e),e}function V5(r){if(!r.startsWith("http"))return r;const e=H5(r);return eO(e)}function eO(r){const e=new Blob([r],{type:"application/javascript"});return URL.createObjectURL(e)}function H5(r){return`try {
1
+ import{r as It,cU as Tr,d0 as At,ag as _h,d1 as c5,bs as zu,_ as $D,j as Jf,a0 as l5,x as WD,k as JD,R as XD,d2 as AB,bn as u5,L as f5,g as h5,l as gB,ck as d5,d3 as mB}from"./index.CqTPbV5Y.js";import{_ as gs,a as p5,C as A5}from"./toConsumableArray.DIN_ys1J.js";import{f as of,e as af,d as Ux,_ as Bp,a as zx}from"./possibleConstructorReturn.C_51n46K.js";import{E as KD,w as g5}from"./withFullScreenWrapper.7j_lzlaF.js";import{a as m5,T as _5}from"./Toolbar.DMgU0Vgw.js";import{l as r2}from"./index.8HslT92O.js";import{a as y5}from"./useBasicWidgetState.DA3_qaXD.js";import{u as v5,s as b5}from"./threshold.Q1mXg5rX.js";import"./FormClearHelper.-9RbsnV0.js";import"./value.B4vHRSi7.js";function x5(r,e){for(var t=0;t<e.length;t++){const n=e[t];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in r)){const s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(r,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}function o_(r,e){if(!r)throw new Error(e||"loader assertion failed.")}const Gx=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),_B=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);_B&&parseFloat(_B[1]);const a_=globalThis,c_=globalThis.process||{},w5=globalThis.navigator||{};function qD(r){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&process.versions?.electron)return!0;const t=typeof navigator<"u"&&navigator.userAgent;return!!(t&&t.indexOf("Electron")>=0)}function Al(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||qD()}function C5(r){return Al()?qD()?"Electron":(w5.userAgent||"").indexOf("Edge")>-1?"Edge":globalThis.chrome?"Chrome":globalThis.safari?"Safari":globalThis.mozInnerScreenX?"Firefox":"Unknown":"Node"}const iy="4.1.0";function T5(r){try{const e=window[r],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch{return null}}let E5=class{constructor(e,t,n="sessionStorage"){this.storage=T5(n),this.id=e,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}};function B5(r){let e;return r<10?e=`${r.toFixed(2)}ms`:r<100?e=`${r.toFixed(1)}ms`:r<1e3?e=`${r.toFixed(0)}ms`:e=`${(r/1e3).toFixed(2)}s`,e}function S5(r,e=8){const t=Math.max(e-r.length,0);return`${" ".repeat(t)}${r}`}var l_;(function(r){r[r.BLACK=30]="BLACK",r[r.RED=31]="RED",r[r.GREEN=32]="GREEN",r[r.YELLOW=33]="YELLOW",r[r.BLUE=34]="BLUE",r[r.MAGENTA=35]="MAGENTA",r[r.CYAN=36]="CYAN",r[r.WHITE=37]="WHITE",r[r.BRIGHT_BLACK=90]="BRIGHT_BLACK",r[r.BRIGHT_RED=91]="BRIGHT_RED",r[r.BRIGHT_GREEN=92]="BRIGHT_GREEN",r[r.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",r[r.BRIGHT_BLUE=94]="BRIGHT_BLUE",r[r.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",r[r.BRIGHT_CYAN=96]="BRIGHT_CYAN",r[r.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(l_||(l_={}));const I5=10;function yB(r){return typeof r!="string"?r:(r=r.toUpperCase(),l_[r]||l_.WHITE)}function M5(r,e,t){return!Al&&typeof r=="string"&&(e&&(r=`\x1B[${yB(e)}m${r}\x1B[39m`),t&&(r=`\x1B[${yB(t)+I5}m${r}\x1B[49m`)),r}function P5(r,e=["constructor"]){const t=Object.getPrototypeOf(r),n=Object.getOwnPropertyNames(t),i=r;for(const s of n){const o=i[s];typeof o=="function"&&(e.find(c=>s===c)||(i[s]=o.bind(r)))}}function Vx(r,e){if(!r)throw new Error("Assertion failed")}function md(){let r;if(Al()&&a_.performance)r=a_?.performance?.now?.();else if("hrtime"in c_){const e=c_?.hrtime?.();r=e[0]*1e3+e[1]/1e6}else r=Date.now();return r}const _d={debug:Al()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},R5={enabled:!0,level:0};function yd(){}const vB={},bB={once:!0};let YD=class{constructor({id:e}={id:""}){this.VERSION=iy,this._startTs=md(),this._deltaTs=md(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new E5(`__probe-${this.id}__`,R5),this.timeStamp(`${this.id} started`),P5(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((md()-this._startTs).toPrecision(10))}getDelta(){return Number((md()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,t){this._storage.setConfiguration({[e]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,t){if(!e)throw new Error(t||"Assertion failed")}warn(e){return this._getLogFunction(0,e,_d.warn,arguments,bB)}error(e){return this._getLogFunction(0,e,_d.error,arguments)}deprecated(e,t){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${t}\` instead`)}removed(e,t){return this.error(`\`${e}\` has been removed. Use \`${t}\` instead`)}probe(e,t){return this._getLogFunction(e,t,_d.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,_d.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,_d.debug||_d.info,arguments,bB)}table(e,t,n){return t?this._getLogFunction(e,t,console.table||yd,n&&[n],{tag:D5(t)}):yd}time(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}timeEnd(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,t){return this._getLogFunction(e,t,console.timeStamp||yd)}group(e,t,n={collapsed:!1}){const i=xB({logLevel:e,message:t,opts:n}),{collapsed:s}=n;return i.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(e,t,n={}){return this.group(e,t,Object.assign({},n,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||yd)}withGroup(e,t,n){this.group(e,t)();try{n()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=ZD(e)}_getLogFunction(e,t,n,i,s){if(this._shouldLog(e)){s=xB({logLevel:e,message:t,args:i,opts:s}),n=n||s.method,Vx(n),s.total=this.getTotal(),s.delta=this.getDelta(),this._deltaTs=md();const o=s.tag||s.message;if(s.once&&o)if(!vB[o])vB[o]=md();else return yd;return t=F5(this.id,s.message,s),n.bind(console,t,...s.args)}return yd}};YD.VERSION=iy;function ZD(r){if(!r)return 0;let e;switch(typeof r){case"number":e=r;break;case"object":e=r.logLevel||r.priority||0;break;default:return 0}return Vx(Number.isFinite(e)&&e>=0),e}function xB(r){const{logLevel:e,message:t}=r;r.logLevel=ZD(e);const n=r.args?Array.from(r.args):[];for(;n.length&&n.shift()!==t;);switch(typeof e){case"string":case"function":t!==void 0&&n.unshift(t),r.message=e;break;case"object":Object.assign(r,e);break}typeof r.message=="function"&&(r.message=r.message());const i=typeof r.message;return Vx(i==="string"||i==="object"),Object.assign(r,{args:n},r.opts)}function F5(r,e,t){if(typeof e=="string"){const n=t.time?S5(B5(t.total)):"";e=t.time?`${r}: ${n} ${e}`:`${r}: ${e}`,e=M5(e,t.color,t.background)}return e}function D5(r){for(const e in r)for(const t in r[e])return t||"untitled";return"empty"}function O5(r,e){return QD(r||{},e)}function QD(r,e,t=0){if(t>3)return e;const n={...r};for(const[i,s]of Object.entries(e))s&&typeof s=="object"&&!Array.isArray(s)?n[i]=QD(n[i]||{},e[i],t+1):n[i]=e[i];return n}const L5="latest";function k5(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.2.4"),globalThis._loadersgl_.version}const N5=k5();function Yu(r,e){if(!r)throw new Error(e||"loaders.gl assertion failed.")}const rh=typeof process!="object"||String(process)!=="[object process]"||process.browser,U5=typeof window<"u"&&typeof window.orientation<"u",wB=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);wB&&parseFloat(wB[1]);let z5=class{name;workerThread;isRunning=!0;result;_resolve=()=>{};_reject=()=>{};constructor(e,t){this.name=e,this.workerThread=t,this.result=new Promise((n,i)=>{this._resolve=n,this._reject=i})}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){Yu(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){Yu(this.isRunning),this.isRunning=!1,this._reject(e)}},Nv=class{terminate(){}};const Uv=new Map;function G5(r){Yu(r.source&&!r.url||!r.source&&r.url);let e=Uv.get(r.source||r.url);return e||(r.url&&(e=V5(r.url),Uv.set(r.url,e)),r.source&&(e=eO(r.source),Uv.set(r.source,e))),Yu(e),e}function V5(r){if(!r.startsWith("http"))return r;const e=H5(r);return eO(e)}function eO(r){const e=new Blob([r],{type:"application/javascript"});return URL.createObjectURL(e)}function H5(r){return`try {
2
2
  importScripts('${r}');
3
3
  } catch (error) {
4
4
  console.error(error);
@@ -1 +1 @@
1
- import{x as a,r as t,n as i,j as d,e}from"./index.DMxc2XFp.js";import{D as c,a as l}from"./IFrameUtil.DefezniK.js";const m=a("iframe",{target:"evfee5y0"})(({theme:o,disableScrolling:r})=>({width:"100%",height:"100%",colorScheme:"normal",border:"none",padding:o.spacing.none,margin:o.spacing.none,overflow:r?"hidden":void 0}));function n(o){return e(o)||o===""?void 0:o}function f({element:o}){const r=n(o.src),s=i(r)?void 0:n(o.srcdoc);return d(m,{className:"stIFrame","data-testid":"stIFrame",allow:l,disableScrolling:!o.scrolling,src:r,srcDoc:s,scrolling:o.scrolling?"auto":"no",sandbox:c,title:"st.iframe",tabIndex:o.tabIndex??void 0})}const F=t.memo(f);export{F as default};
1
+ import{x as a,r as t,n as i,j as d,e}from"./index.CqTPbV5Y.js";import{D as c,a as l}from"./IFrameUtil.DefezniK.js";const m=a("iframe",{target:"evfee5y0"})(({theme:o,disableScrolling:r})=>({width:"100%",height:"100%",colorScheme:"normal",border:"none",padding:o.spacing.none,margin:o.spacing.none,overflow:r?"hidden":void 0}));function n(o){return e(o)||o===""?void 0:o}function f({element:o}){const r=n(o.src),s=i(r)?void 0:n(o.srcdoc);return d(m,{className:"stIFrame","data-testid":"stIFrame",allow:l,disableScrolling:!o.scrolling,src:r,srcDoc:s,scrolling:o.scrolling?"auto":"no",sandbox:c,title:"st.iframe",tabIndex:o.tabIndex??void 0})}const F=t.memo(f);export{F as default};
@@ -1 +1 @@
1
- import{r,E as q,_ as M,x as E,b7 as T,e as h,n as Q,Q as de,g as pe,f as fe,aa as me,aI as _,l as W,j as u,m as be,ab as ge,T as he,P as ye,ac as Ie,ad as Te,Z as Ce,ax as X}from"./index.DMxc2XFp.js";import{I as we}from"./InputInstructions.Cj5-1zf6.js";import{u as Se}from"./FormClearHelper.CG2XN1_g.js";import{s as ve}from"./sprintf.D7DtBTRn.js";import{u as Ve}from"./uniqueId.CtqIr-Yh.js";import{I as xe}from"./input.D5oh9-aB.js";import"./base-input.o9tL8MDP.js";var Z=r.forwardRef(function(e,t){var a={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(q,M({iconAttrs:a,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:t}),r.createElement("path",{d:"M0 3v2h8V3H0z"}))});Z.displayName="Minus";var J=r.forwardRef(function(e,t){var a={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(q,M({iconAttrs:a,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:t}),r.createElement("path",{d:"M3 0v3H0v2h3v3h2V5h3V3H5V0H3z"}))});J.displayName="Plus";const ke=E("div",{target:"eaba2yi0"})(({theme:e})=>({display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",height:e.sizes.minElementHeight,borderWidth:e.sizes.borderWidth,borderStyle:"solid",borderColor:e.colors.widgetBorderColor??e.colors.secondaryBg,transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:e.radii.default,overflow:"hidden","&.focused":{borderColor:e.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:e.spacing.none}}})),De=E("div",{target:"eaba2yi1"})({display:"flex",flexDirection:"row",alignSelf:"stretch"}),G=E("button",{target:"eaba2yi2"})(({theme:e})=>({margin:e.spacing.none,border:"none",height:e.sizes.full,display:"flex",alignItems:"center",width:e.sizes.numberInputControlsWidth,justifyContent:"center",color:e.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:e.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:e.colors.white,backgroundColor:e.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:disabled":{cursor:"not-allowed",color:e.colors.fadedText40}})),Ee=E("div",{target:"eaba2yi3"})(({theme:e,clearable:t})=>({position:"absolute",marginRight:e.spacing.twoXS,left:0,right:`calc(${e.sizes.numberInputControlsWidth} * 2 + ${t?"1em":"0em"})`})),Re=de.getLogger("NumberInput");function Ne(e){return h(e)||e===""?void 0:e}const D=({value:e,format:t,step:a,dataType:m})=>{if(h(e))return null;let o=Ne(t);if(h(o)&&Q(a)){const i=a.toString();m===T.DataType.FLOAT&&a!==0&&i.includes(".")&&(o=`%0.${i.split(".")[1].length}f`)}if(h(o))return e.toString();try{return ve.sprintf(o,e)}catch(i){return Re.warn(`Error in sprintf(${o}, ${e}): ${i}`),String(e)}},Fe=(e,t,a)=>h(e)?!1:e-t>=a,ze=(e,t,a)=>h(e)?!1:e+t<=a,We=e=>(e.element.dataType===T.DataType.INT?e.widgetMgr.getIntValue(e.element):e.widgetMgr.getDoubleValue(e.element))??e.element.default??null,K=({step:e,dataType:t})=>e||(t===T.DataType.INT?1:.01),Le=({disabled:e,element:t,widgetMgr:a,fragmentId:m})=>{const o=pe(),{dataType:i,id:v,formId:f,default:L,format:b,icon:R,min:y,max:I}=t,{width:B,elementRef:Y}=fe(),[s,ee]=r.useState(()=>K(t)),P=We({element:t,widgetMgr:a}),[g,C]=r.useState(!1),[l,w]=r.useState(P),[U,H]=r.useState(!1),V=r.useRef(null),A=r.useRef(Ve("number_input_")),[$,S]=r.useState(()=>D({value:P,dataType:i,format:b,step:s})),x=Fe(l,s,y),k=ze(l,s,I),O=me({formId:f}),te=O?a.allowFormEnterToSubmit(f):g,oe=U&&B>o.breakpoints.hideWidgetDetails;r.useEffect(()=>{ee(K({step:t.step,dataType:t.dataType}))},[t.dataType,t.step]),r.useEffect(()=>{g||S(D({value:l,dataType:i,format:b,step:s}))},[i,b,s]);const d=r.useCallback(({value:n,source:c})=>{if(Q(n)&&(y>n||n>I))V.current?.reportValidity();else{const p=n??L??null;switch(i){case T.DataType.INT:a.setIntValue({id:v,formId:f},p,c,m);break;case T.DataType.FLOAT:a.setDoubleValue({id:v,formId:f},p,c,m);break;default:throw new Error("Invalid data type")}C(!1),w(p),S(D({value:p,dataType:i,format:b,step:s}))}},[y,I,V,a,m,s,i,v,f,L,b]),re=r.useCallback(()=>{g&&d({value:l,source:{fromUi:!0}}),H(!1)},[g,l,d]),ne=r.useCallback(()=>{H(!0)},[]),j=r.useCallback(()=>{const{value:n}=t;t.setValue=!1,w(n??null),S(D({value:n??null,dataType:i,format:b,step:s})),d({value:n??null,source:{fromUi:!1}})},[t,s,d,i,b]);r.useEffect(()=>{t.setValue?j():d({value:l,source:{fromUi:!1}});const n=V.current;if(n){const c=p=>{p.preventDefault()};return n.addEventListener("wheel",c),()=>{n.removeEventListener("wheel",c)}}},[]),t.setValue&&j();const N=h(t.default)&&!e,ae=r.useCallback(()=>{const n=t.default??null;w(n),d({value:n,source:{fromUi:!0}})},[t]);Se({element:t,widgetMgr:a,onFormCleared:ae});const se=n=>{const{value:c}=n.target;if(c==="")C(!0),w(null),S(null);else{let p;t.dataType===T.DataType.INT?p=parseInt(c,10):p=parseFloat(c),C(!0),w(p),S(c)}},F=r.useCallback(()=>{k&&(C(!0),d({value:(l??y)+s,source:{fromUi:!0}}))},[l,y,s,k]),z=r.useCallback(()=>{x&&(C(!0),d({value:(l??I)-s,source:{fromUi:!0}}))},[l,I,s,x]),ie=r.useCallback(n=>{const{key:c}=n;switch(c){case"ArrowUp":n.preventDefault(),F();break;case"ArrowDown":n.preventDefault(),z();break}},[F,z]),le=r.useCallback(n=>{n.key==="Enter"&&(g&&d({value:l,source:{fromUi:!0}}),a.allowFormEnterToSubmit(f)&&a.submitForm(f,m))},[g,l,d,a,f,m]),ce=_(o.iconSizes.lg)+2*_(o.spacing.twoXS),ue=R?o.breakpoints.hideNumberInputControls+ce:o.breakpoints.hideNumberInputControls;return W("div",{className:"stNumberInput","data-testid":"stNumberInput",ref:Y,children:[u(Ie,{label:t.label,disabled:e,labelVisibility:be(t.labelVisibility?.value),htmlFor:A.current,children:t.help&&u(ge,{children:u(he,{content:t.help,placement:ye.TOP_RIGHT})})}),W(ke,{className:U?"focused":"","data-testid":"stNumberInputContainer",children:[u(xe,{type:"number",inputRef:V,value:$??"",placeholder:t.placeholder,onBlur:re,onFocus:ne,onChange:se,onKeyPress:le,onKeyDown:ie,clearable:N,clearOnEscape:N,disabled:e,"aria-label":t.label,startEnhancer:t.icon&&u(Ce,{"data-testid":"stNumberInputIcon",iconValue:t.icon,size:"lg"}),id:A.current,overrides:{ClearIconContainer:{style:{padding:0}},ClearIcon:{props:{overrides:{Svg:{style:{color:o.colors.grayTextColor,padding:o.spacing.threeXS,height:o.sizes.clearIconSize,width:o.sizes.clearIconSize,":hover":{fill:o.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInputField",step:s,min:y,max:I,type:"number",inputMode:""},style:{fontWeight:o.fontWeights.normal,lineHeight:o.lineHeights.inputWidget,paddingRight:o.spacing.sm,paddingLeft:o.spacing.md,paddingBottom:o.spacing.sm,paddingTop:o.spacing.sm,"::placeholder":{color:o.colors.fadedText60}}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:{borderTopRightRadius:0,borderBottomRightRadius:0,borderTopLeftRadius:0,borderBottomLeftRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,paddingRight:0,paddingLeft:R?o.spacing.sm:0}},StartEnhancer:{style:{paddingLeft:0,paddingRight:0,minWidth:o.iconSizes.lg,color:Te(R)?o.colors.fadedText60:"inherit"}}}}),B>ue&&W(De,{children:[u(G,{"data-testid":"stNumberInputStepDown",onClick:z,disabled:!x||e,tabIndex:-1,children:u(X,{content:Z,size:"xs",color:x?"inherit":o.colors.fadedText40})}),u(G,{"data-testid":"stNumberInputStepUp",onClick:F,disabled:!k||e,tabIndex:-1,children:u(X,{content:J,size:"xs",color:k?"inherit":o.colors.fadedText40})})]})]}),oe&&u(Ee,{clearable:N,children:u(we,{dirty:g,value:$??"",inForm:O,allowEnterToSubmit:te})})]})},je=r.memo(Le);export{je as default};
1
+ import{r,E as q,_ as M,x as E,b7 as T,e as h,n as Q,Q as de,g as pe,f as fe,aa as me,aI as _,l as W,j as u,m as be,ab as ge,T as he,P as ye,ac as Ie,ad as Te,Z as Ce,ax as X}from"./index.CqTPbV5Y.js";import{I as we}from"./InputInstructions.2R3tBtW9.js";import{u as Se}from"./FormClearHelper.-9RbsnV0.js";import{s as ve}from"./sprintf.D7DtBTRn.js";import{u as Ve}from"./uniqueId.B27POWT6.js";import{I as xe}from"./input.CcvrgErO.js";import"./base-input.BXTqYbyG.js";var Z=r.forwardRef(function(e,t){var a={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(q,M({iconAttrs:a,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:t}),r.createElement("path",{d:"M0 3v2h8V3H0z"}))});Z.displayName="Minus";var J=r.forwardRef(function(e,t){var a={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(q,M({iconAttrs:a,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:t}),r.createElement("path",{d:"M3 0v3H0v2h3v3h2V5h3V3H5V0H3z"}))});J.displayName="Plus";const ke=E("div",{target:"eaba2yi0"})(({theme:e})=>({display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",height:e.sizes.minElementHeight,borderWidth:e.sizes.borderWidth,borderStyle:"solid",borderColor:e.colors.widgetBorderColor??e.colors.secondaryBg,transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:e.radii.default,overflow:"hidden","&.focused":{borderColor:e.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:e.spacing.none}}})),De=E("div",{target:"eaba2yi1"})({display:"flex",flexDirection:"row",alignSelf:"stretch"}),G=E("button",{target:"eaba2yi2"})(({theme:e})=>({margin:e.spacing.none,border:"none",height:e.sizes.full,display:"flex",alignItems:"center",width:e.sizes.numberInputControlsWidth,justifyContent:"center",color:e.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:e.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:e.colors.white,backgroundColor:e.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:disabled":{cursor:"not-allowed",color:e.colors.fadedText40}})),Ee=E("div",{target:"eaba2yi3"})(({theme:e,clearable:t})=>({position:"absolute",marginRight:e.spacing.twoXS,left:0,right:`calc(${e.sizes.numberInputControlsWidth} * 2 + ${t?"1em":"0em"})`})),Re=de.getLogger("NumberInput");function Ne(e){return h(e)||e===""?void 0:e}const D=({value:e,format:t,step:a,dataType:m})=>{if(h(e))return null;let o=Ne(t);if(h(o)&&Q(a)){const i=a.toString();m===T.DataType.FLOAT&&a!==0&&i.includes(".")&&(o=`%0.${i.split(".")[1].length}f`)}if(h(o))return e.toString();try{return ve.sprintf(o,e)}catch(i){return Re.warn(`Error in sprintf(${o}, ${e}): ${i}`),String(e)}},Fe=(e,t,a)=>h(e)?!1:e-t>=a,ze=(e,t,a)=>h(e)?!1:e+t<=a,We=e=>(e.element.dataType===T.DataType.INT?e.widgetMgr.getIntValue(e.element):e.widgetMgr.getDoubleValue(e.element))??e.element.default??null,K=({step:e,dataType:t})=>e||(t===T.DataType.INT?1:.01),Le=({disabled:e,element:t,widgetMgr:a,fragmentId:m})=>{const o=pe(),{dataType:i,id:v,formId:f,default:L,format:b,icon:R,min:y,max:I}=t,{width:B,elementRef:Y}=fe(),[s,ee]=r.useState(()=>K(t)),P=We({element:t,widgetMgr:a}),[g,C]=r.useState(!1),[l,w]=r.useState(P),[U,H]=r.useState(!1),V=r.useRef(null),A=r.useRef(Ve("number_input_")),[$,S]=r.useState(()=>D({value:P,dataType:i,format:b,step:s})),x=Fe(l,s,y),k=ze(l,s,I),O=me({formId:f}),te=O?a.allowFormEnterToSubmit(f):g,oe=U&&B>o.breakpoints.hideWidgetDetails;r.useEffect(()=>{ee(K({step:t.step,dataType:t.dataType}))},[t.dataType,t.step]),r.useEffect(()=>{g||S(D({value:l,dataType:i,format:b,step:s}))},[i,b,s]);const d=r.useCallback(({value:n,source:c})=>{if(Q(n)&&(y>n||n>I))V.current?.reportValidity();else{const p=n??L??null;switch(i){case T.DataType.INT:a.setIntValue({id:v,formId:f},p,c,m);break;case T.DataType.FLOAT:a.setDoubleValue({id:v,formId:f},p,c,m);break;default:throw new Error("Invalid data type")}C(!1),w(p),S(D({value:p,dataType:i,format:b,step:s}))}},[y,I,V,a,m,s,i,v,f,L,b]),re=r.useCallback(()=>{g&&d({value:l,source:{fromUi:!0}}),H(!1)},[g,l,d]),ne=r.useCallback(()=>{H(!0)},[]),j=r.useCallback(()=>{const{value:n}=t;t.setValue=!1,w(n??null),S(D({value:n??null,dataType:i,format:b,step:s})),d({value:n??null,source:{fromUi:!1}})},[t,s,d,i,b]);r.useEffect(()=>{t.setValue?j():d({value:l,source:{fromUi:!1}});const n=V.current;if(n){const c=p=>{p.preventDefault()};return n.addEventListener("wheel",c),()=>{n.removeEventListener("wheel",c)}}},[]),t.setValue&&j();const N=h(t.default)&&!e,ae=r.useCallback(()=>{const n=t.default??null;w(n),d({value:n,source:{fromUi:!0}})},[t]);Se({element:t,widgetMgr:a,onFormCleared:ae});const se=n=>{const{value:c}=n.target;if(c==="")C(!0),w(null),S(null);else{let p;t.dataType===T.DataType.INT?p=parseInt(c,10):p=parseFloat(c),C(!0),w(p),S(c)}},F=r.useCallback(()=>{k&&(C(!0),d({value:(l??y)+s,source:{fromUi:!0}}))},[l,y,s,k]),z=r.useCallback(()=>{x&&(C(!0),d({value:(l??I)-s,source:{fromUi:!0}}))},[l,I,s,x]),ie=r.useCallback(n=>{const{key:c}=n;switch(c){case"ArrowUp":n.preventDefault(),F();break;case"ArrowDown":n.preventDefault(),z();break}},[F,z]),le=r.useCallback(n=>{n.key==="Enter"&&(g&&d({value:l,source:{fromUi:!0}}),a.allowFormEnterToSubmit(f)&&a.submitForm(f,m))},[g,l,d,a,f,m]),ce=_(o.iconSizes.lg)+2*_(o.spacing.twoXS),ue=R?o.breakpoints.hideNumberInputControls+ce:o.breakpoints.hideNumberInputControls;return W("div",{className:"stNumberInput","data-testid":"stNumberInput",ref:Y,children:[u(Ie,{label:t.label,disabled:e,labelVisibility:be(t.labelVisibility?.value),htmlFor:A.current,children:t.help&&u(ge,{children:u(he,{content:t.help,placement:ye.TOP_RIGHT})})}),W(ke,{className:U?"focused":"","data-testid":"stNumberInputContainer",children:[u(xe,{type:"number",inputRef:V,value:$??"",placeholder:t.placeholder,onBlur:re,onFocus:ne,onChange:se,onKeyPress:le,onKeyDown:ie,clearable:N,clearOnEscape:N,disabled:e,"aria-label":t.label,startEnhancer:t.icon&&u(Ce,{"data-testid":"stNumberInputIcon",iconValue:t.icon,size:"lg"}),id:A.current,overrides:{ClearIconContainer:{style:{padding:0}},ClearIcon:{props:{overrides:{Svg:{style:{color:o.colors.grayTextColor,padding:o.spacing.threeXS,height:o.sizes.clearIconSize,width:o.sizes.clearIconSize,":hover":{fill:o.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInputField",step:s,min:y,max:I,type:"number",inputMode:""},style:{fontWeight:o.fontWeights.normal,lineHeight:o.lineHeights.inputWidget,paddingRight:o.spacing.sm,paddingLeft:o.spacing.md,paddingBottom:o.spacing.sm,paddingTop:o.spacing.sm,"::placeholder":{color:o.colors.fadedText60}}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:{borderTopRightRadius:0,borderBottomRightRadius:0,borderTopLeftRadius:0,borderBottomLeftRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,paddingRight:0,paddingLeft:R?o.spacing.sm:0}},StartEnhancer:{style:{paddingLeft:0,paddingRight:0,minWidth:o.iconSizes.lg,color:Te(R)?o.colors.fadedText60:"inherit"}}}}),B>ue&&W(De,{children:[u(G,{"data-testid":"stNumberInputStepDown",onClick:z,disabled:!x||e,tabIndex:-1,children:u(X,{content:Z,size:"xs",color:x?"inherit":o.colors.fadedText40})}),u(G,{"data-testid":"stNumberInputStepUp",onClick:F,disabled:!k||e,tabIndex:-1,children:u(X,{content:J,size:"xs",color:k?"inherit":o.colors.fadedText40})})]})]}),oe&&u(Ee,{clearable:N,children:u(we,{dirty:g,value:$??"",inForm:O,allowEnterToSubmit:te})})]})},je=r.memo(Le);export{je as default};
@@ -1 +1 @@
1
- import{r as o,E as T,_ as V,Q as $e,cj as v,ck as me,x as g,l as F,j as a,P as Q,b as ye,B as Ce,ax as z,T as We,a0 as H,g as Z,ay as we,Z as ve,bU as Ne,k as Pe,f as Oe,b1 as qe,cl as Ke,e as j,bM as he,bN as Xe}from"./index.DMxc2XFp.js";import{g as je,C as Ge,I as Ye,F as _,E as xe,b as _e,s as Qe,u as Ze,a as Je}from"./FileHelper.B7Ero7qQ.js";import{u as et}from"./useWaveformController.WxVzpzEX.js";import{I as tt}from"./InputInstructions.Cj5-1zf6.js";import{u as ot,T as rt}from"./useTextInputAutoExpand.QepX7n8Y.js";import{i as nt}from"./inputUtils.CptNuJwn.js";import{E as at}from"./ErrorOutline.esm.ZJDbmVTx.js";import{U as be}from"./UploadFileInfo.C-jY39rj.js";import"./base-input.o9tL8MDP.js";var Ie=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(T,V({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.createElement("path",{d:"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5a2.5 2.5 0 015 0v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5a2.5 2.5 0 005 0V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z"}))});Ie.displayName="AttachFile";var Ee=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(T,V({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.createElement("path",{d:"M18 6.7l-8.48 8.48-3.54-3.54a.996.996 0 10-1.41 1.41l4.24 4.24c.39.39 1.02.39 1.41 0l9.18-9.18a.999.999 0 00-.01-1.42c-.37-.38-1-.38-1.39.01z"}))});Ee.displayName="Check";var ze=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(T,V({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.createElement("path",{d:"M18.3 5.71a.996.996 0 00-1.41 0L12 10.59 7.11 5.7A.996.996 0 105.7 7.11L10.59 12 5.7 16.89a.996.996 0 101.41 1.41L12 13.41l4.89 4.89a.996.996 0 101.41-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z"}))});ze.displayName="Close";var Se=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(T,V({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("rect",{width:24,height:24,fill:"none"}),o.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 11c-.55 0-1-.45-1-1V8c0-.55.45-1 1-1s1 .45 1 1v4c0 .55-.45 1-1 1zm0 4c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1z"}))});Se.displayName="ErrorOutline";var Fe=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(T,V({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("rect",{width:24,height:24,fill:"none"}),o.createElement("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),o.createElement("path",{d:"M17.91 11c-.49 0-.9.36-.98.85C16.52 14.21 14.47 16 12 16s-4.52-1.79-4.93-4.15a.998.998 0 00-.98-.85c-.61 0-1.09.54-1 1.14.49 3 2.89 5.34 5.91 5.78V20c0 .55.45 1 1 1s1-.45 1-1v-2.08c3.02-.44 5.42-2.78 5.91-5.78.1-.6-.39-1.14-1-1.14z"}))});Fe.displayName="Mic";var Ue=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(T,V({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("rect",{width:24,height:24,fill:"none"}),o.createElement("path",{d:"M3 5.51v3.71c0 .46.31.86.76.97L11 12l-7.24 1.81c-.45.11-.76.51-.76.97v3.71c0 .72.73 1.2 1.39.92l15.42-6.49c.82-.34.82-1.5 0-1.84L4.39 4.58C3.73 4.31 3 4.79 3 5.51z"}))});Ue.displayName="Send";const N=$e.getLogger("ChatInput"),Re=(e,t)=>t===v.Directory?{...e,webkitdirectory:"",multiple:!0}:e,it=(e,t)=>{if(!t||t.length===0)return!0;const n=e.name.toLowerCase(),l=n.lastIndexOf(".");if(l===-1||l===n.length-1)return t.some(m=>m===""||m===".");const u=n.substring(l),c=n.substring(l+1);return t.some(m=>{const C=m.toLowerCase();return C.startsWith(".")?u===C:c===C})},st=(e,t)=>it(e,t)?{isValid:!0}:{isValid:!1,errorMessage:`${e.type||"This type of"} files are not allowed.`},De=e=>{switch(e){case v.None:return"a file";case v.Single:return"a file";case v.Multiple:return"files";case v.Directory:return"a directory";default:return me(e),"a file"}},lt=g("div",{target:"e15560op0"})(({theme:e,height:t})=>({backgroundColor:e.colors.transparent,position:"absolute",left:0,bottom:0,minHeight:`max(${e.sizes.emptyDropdownHeight}, ${t})`,width:"100%",zIndex:e.zIndices.priority})),ct=g("div",{target:"e15560op1"})(({theme:e,height:t})=>({border:`${e.sizes.borderWidth} solid`,borderColor:e.colors.primary,borderRadius:e.radii.chatInput,backgroundColor:e.colors.secondaryBg,color:e.colors.primary,display:"flex",alignItems:"center",justifyContent:"center",height:t,width:"100%",fontWeight:e.fontWeights.bold})),dt=g("div",{target:"e15560op2"})(({theme:e,disabled:t})=>({display:"flex",alignItems:"top",height:"100%",marginTop:`-${e.sizes.borderWidth}`,cursor:t?"not-allowed":"auto"})),ut=g("div",{target:"e15560op3"})(({disabled:e})=>({pointerEvents:e?"none":"auto"})),pt=g("div",{target:"e15560op4"})(({theme:e})=>({marginTop:"0.625em",marginLeft:e.spacing.sm,height:e.spacing.xl,width:e.sizes.borderWidth,backgroundColor:e.colors.fadedText20})),gt=g("div",{target:"e15560op5"})(({theme:e})=>({left:0,right:0,lineHeight:e.lineHeights.tight,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,overflowX:"auto"})),ft=g("div",{target:"e15560op6"})({display:"flex"}),ht=g("div",{target:"e15560op7"})({flex:"0 0 auto"}),mt=g("div",{target:"e15560op8"})(({theme:e})=>({display:"flex",alignItems:"center",padding:e.spacing.sm,gap:e.spacing.twoXS})),yt=g("div",{target:"e15560op9"})(({theme:e})=>({color:e.colors.fadedText60})),Ct=g("div",{target:"e15560op10"})(({theme:e,fileStatus:t})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:t.type==="uploaded"?e.colors.bodyText:e.colors.fadedText60})),wt=g("div",{target:"e15560op11"})(({theme:e})=>({marginRight:e.spacing.md,color:e.colors.fadedText60})),vt=g("small",{target:"e15560op12"})(({theme:e})=>({display:"flex",alignItems:"center",maxHeight:e.sizes.smallElementHeight,color:e.colors.fadedText60,"& :hover":{color:e.colors.bodyText}})),xt=({getRootProps:e,getInputProps:t,acceptFile:n,disabled:l,theme:u})=>{const c=Re(t(),n);return F(dt,{disabled:l,children:[F(ut,{"data-testid":"stChatInputFileUploadButton",disabled:l,...e(),children:[a("input",{...c}),a(We,{content:`Upload or drag and drop ${De(n)}`,placement:Q.TOP,onMouseEnterDelay:500,children:a(ye,{kind:Ce.MINIMAL,disabled:l,children:a(z,{content:Ie,size:"lg",color:l?u.colors.fadedText40:u.colors.fadedText60})})})]}),a(pt,{})]})},bt=o.memo(xt),It=({getRootProps:e,getInputProps:t,acceptFile:n,inputHeight:l})=>{const u=Re(t(),n);return F(H,{children:[a(lt,{height:l,...e(),children:a("input",{...u})}),a(ct,{height:l,children:`Drag and drop ${De(n)} here`})]})},Et=o.memo(It);function zt({children:e,content:t}){const n=Z();return a(we,{content:t,placement:Q.TOP,overrides:{Body:{style:{top:`-${n.sizes.minElementHeight}`}}},children:e})}const St=({fileInfo:e})=>{const t=Z(),{type:n}=e.status;switch(n){case"uploading":return a(ve,{iconValue:"spinner",testid:"stChatInputFileIconSpinner",size:"lg"});case"error":return a(zt,{content:e.status.errorMessage,children:a(z,{color:t.colors.redTextColor,content:at,size:"lg"})});case"uploaded":return a(z,{content:Ye,size:"lg"});default:return me(n),null}},Ft=({fileInfo:e,onDelete:t})=>F(mt,{className:"stChatInputFile","data-testid":"stChatInputFile",children:[a(yt,{children:a(St,{fileInfo:e})}),a(Ct,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:e.name,fileStatus:e.status,children:e.name}),a(wt,{children:je(e.size,_.Byte)}),a(vt,{"data-testid":"stChatInputDeleteBtn",children:a(ye,{onClick:()=>t(e.id),kind:Ce.MINIMAL,children:a(z,{content:Ge,size:"lg"})})})]}),Ut=o.memo(Ft),Rt=({items:e,onDelete:t})=>a(gt,{"data-testid":"stChatUploadedFiles",children:a(ft,{children:e.map(n=>a(ht,{children:a(Ut,{fileInfo:n,onDelete:t})},n.id))})}),Dt=o.memo(Rt),Tt=(e,t)=>{const n=[],l=[];return e.forEach(u=>{const c=st(u,t.fileType);c.isValid?n.push(u):l.push({file:u,errors:[{code:xe.FileInvalidType,message:c.errorMessage||"File type not allowed."}]})}),{accepted:n,rejected:l}},Vt=({acceptMultipleFiles:e,acceptDirectoryFiles:t,maxFileSize:n,uploadClient:l,uploadFile:u,addFiles:c,getNextLocalFileId:m,deleteExistingFiles:C,onUploadComplete:S,element:w})=>(h,f)=>{if(t&&h.length>0){const{accepted:p,rejected:x}=Tt(h,w);h=p,f=[...f,...x]}if(!e&&h.length===0&&f.length>1){const p=f.findIndex(x=>x.errors?.[0].code===xe.TooManyFiles);p>=0&&(h.push(f[p].file),f.splice(p,1))}if(!e&&h.length>0&&C(),l.fetchFileURLs(h).then(p=>{Ne(p,h).forEach(([x,P])=>{u(x,P)})}).catch(p=>{c(h.map(x=>new be(x.name,x.size,m(),{type:"error",errorMessage:p})))}),f.length>0){const p=f.map(x=>_e(x,m(),n));c(p)}S()},Mt=({getNextLocalFileId:e,addFiles:t,updateFile:n,uploadClient:l,element:u,onUploadProgress:c,onUploadComplete:m})=>(C,S)=>{const w=S.webkitRelativePath||S.name,h=new AbortController,f=new be(w,S.size,e(),{type:"uploading",abortController:h,progress:1});t([f]),l.uploadFile({formId:"",...u},C.uploadUrl,S,p=>c(p,f.id),h.signal).then(()=>m(f.id,C)).catch(p=>{p instanceof DOMException&&p.name==="AbortError"||n(f.id,f.setStatus({type:"error",errorMessage:p?p.toString():"Unknown error"}))})},At=g("div",{target:"eyzqfg10"})("border:none;position:relative;display:flex;"),Bt=g("div",{target:"eyzqfg11"})(({theme:e,extended:t})=>({border:`${e.sizes.borderWidth} solid`,borderColor:e.colors.widgetBorderColor??e.colors.transparent,borderRadius:e.radii.chatInput,backgroundColor:e.colors.secondaryBg,position:"relative",flexGrow:1,display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",paddingLeft:e.spacing.lg,maxHeight:t?"none":e.sizes.minElementHeight,gap:e.spacing.sm,overflow:"hidden",":focus-within":{borderColor:e.colors.primary}})),L=g("button",{target:"eyzqfg12"})(({theme:e,disabled:t,extended:n,hasError:l})=>{const u=Pe(e),[c,m]=u?[e.colors.gray60,e.colors.gray80]:[e.colors.gray80,e.colors.gray40],C=()=>l?e.colors.redTextColor:t?c:m;return{border:"none",backgroundColor:e.colors.transparent,borderTopRightRadius:n?"0":e.radii.chatInput,borderTopLeftRadius:n?e.radii.default:"0",borderBottomRightRadius:e.radii.chatInput,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:e.lineHeights.none,margin:e.spacing.none,padding:e.spacing.sm,color:C(),pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:u?e.colors.gray10:e.colors.gray90},"&:hover":{color:l?e.colors.red70:e.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:e.colors.transparent,borderColor:e.colors.transparent,color:e.colors.gray60,cursor:"not-allowed"}}}),kt=g("div",{target:"eyzqfg13"})(({theme:e,isRecording:t})=>({display:"flex",alignItems:t?"center":"flex-end",height:"100%",position:t?"static":"absolute",right:t?void 0:0,bottom:t?void 0:0,marginBottom:t?0:`-${e.sizes.borderWidth}`,pointerEvents:"none",gap:0,paddingRight:t?e.spacing.sm:0})),Lt=g("div",{target:"eyzqfg14"})(({theme:e,acceptAudio:t})=>({position:"absolute",bottom:"0px",right:t?`calc(2 * (${e.iconSizes.xl} + 2 * ${e.spacing.sm}) + 2 * ${e.spacing.sm})`:`calc(${e.iconSizes.xl} + 2 * ${e.spacing.sm} + ${e.spacing.sm})`})),Ht=g("div",{target:"eyzqfg15"})(({isRecording:e})=>({display:e?"flex":"none",flex:e?1:void 0,alignItems:"center",minWidth:0})),$t=g("div",{target:"eyzqfg16"})(({theme:e})=>({position:"relative",width:"100%",minHeight:e.sizes.minElementHeight,borderRadius:e.radii.default,overflow:"hidden","& > div":{position:"absolute",inset:0}})),G=(e,t,n)=>n.map(l=>l.id===e?t:l),Y=(e,t)=>t.find(n=>n.id===e);function Wt({disabled:e,element:t,widgetMgr:n,fragmentId:l,uploadClient:u}){const c=Z(),{placeholder:m,maxChars:C}=t,S=o.useRef(0),w=o.useRef(null),h=o.useRef(!1),f=o.useRef(null),p=o.useRef(null),{width:x,elementRef:P}=Oe(),{innerWidth:J,innerHeight:ee}=qe(),[R,O]=o.useState(t.default),[U,D]=o.useState([]),[M,q]=o.useState(!1),[A,te]=o.useState(!1),[K,B]=o.useState(null),k=t.acceptAudio??!1;o.useEffect(()=>()=>{p.current&&p.current.abort()},[]);const b=ot({textareaRef:w,dependencies:[m]}),$=o.useMemo(()=>U.some(r=>r.status.type==="uploading")?!1:R!==""||U.length>0,[U,R]),E=Ke(t.acceptFile),oe=Qe(t.maxUploadSizeMb,_.Megabyte,_.Byte),re=o.useCallback(r=>D(s=>[...s,...r]),[]),ne=o.useCallback(r=>{r.status.type==="uploading"&&r.status.abortController.abort(),r.status.type==="uploaded"&&r.status.fileUrls.deleteUrl&&u.deleteFile(r.status.fileUrls.deleteUrl).catch(s=>{N.error("Failed to delete file from server:",s)})},[u]),ae=o.useCallback(r=>{D(s=>{const d=Y(r,s);return j(d)?s:(ne(d),s.filter(i=>i.id!==r))})},[ne]),ie=o.useCallback(()=>{const r=U.filter(s=>s.status.type==="uploaded").map(s=>{const{name:d,size:i,status:I}=s,{fileId:X,fileUrls:He}=I;return new he({fileId:X,fileUrls:He,name:d,size:i})});return new Xe({uploadedFileInfo:r})},[U]),se=()=>S.current++,Te=Vt({acceptMultipleFiles:E===v.Multiple||E===v.Directory,acceptDirectoryFiles:E===v.Directory,maxFileSize:oe,uploadClient:u,uploadFile:Mt({getNextLocalFileId:se,addFiles:re,updateFile:(r,s)=>{D(d=>G(r,s,d))},uploadClient:u,element:t,onUploadProgress:(r,s)=>{D(d=>{const i=Y(s,d);if(j(i)||i.status.type!=="uploading")return d;const I=Math.round(r.loaded*100/r.total);return i.status.progress===I?d:G(s,i.setStatus({type:"uploading",abortController:i.status.abortController,progress:I}),d)})},onUploadComplete:(r,s)=>{D(d=>{const i=Y(r,d);return j(i)||i.status.type!=="uploading"?d:G(i.id,i.setStatus({type:"uploaded",fileId:s.fileId,fileUrls:s}),d)})}}),addFiles:re,getNextLocalFileId:se,deleteExistingFiles:()=>U.forEach(r=>ae(r.id)),onUploadComplete:()=>{w.current&&w.current.focus()},element:t}),{getRootProps:le,getInputProps:ce}=Ze({onDrop:Te,multiple:E===v.Multiple||E===v.Directory,accept:Je(t.fileType),maxSize:oe}),W=o.useCallback(r=>{if(w.current&&w.current.focus(),!$&&!r||e)return;const s=ie(),d={data:R,fileUploaderState:s,audioFileInfo:r};n.setChatInputValue(t,d,{fromUi:!0},l),D([]),O(""),b.clearScrollHeight()},[$,e,R,ie,n,t,l,b]),de=o.useCallback(async r=>{const s=new Date().toISOString().replace(/[:.]/g,"-"),d=new File([r],`audio-${s}.wav`,{type:"audio/wav"});try{te(!0);const i=await u.fetchFileURLs([d]);if(i.length===0)throw new Error("Failed to get upload URL for audio file");const I=i[0];p.current=new AbortController,await u.uploadFile({formId:"",...t},I.uploadUrl,d,()=>{},p.current.signal);const X=new he({fileId:I.fileId,fileUrls:I,name:d.name,size:d.size});W(X)}catch(i){const I="Recording failed";N.error("Audio upload failed:",i),B(I),w.current&&w.current.focus()}finally{te(!1)}},[u,t,W]),Ve=o.useMemo(()=>({onApprove:de,onPermissionDenied:()=>{const r="Microphone access denied";B(r),N.error("Permission denied:",r)},onError:r=>{B("Recording failed"),N.error("Recording error:",r)},onRecordStart:()=>{B(null)}}),[de]),y=et({containerRef:f,sampleRate:t.audioSampleRate??void 0,events:Ve}),ue=o.useCallback(()=>{W()},[W]),Me=r=>{const{metaKey:s,ctrlKey:d,shiftKey:i}=r;nt(r)&&!i&&!d&&!s&&(r.preventDefault(),ue())},Ae=r=>{const{value:s}=r.target;C!==0&&s.length>C||(O(s),b.updateScrollHeight(),K&&B(null))},pe=o.useCallback(async r=>{r.preventDefault(),r.stopPropagation(),!(!k||e||y.state==="recording")&&await y.start()},[k,e,y]),Be=o.useCallback(()=>{y.cancel(),w.current&&w.current.focus()},[y]),ge=o.useCallback(async()=>{const{blob:r}=await y.stop();await y.approve(r)},[y]),fe=o.useCallback(r=>{pe(r)},[pe]),ke=o.useCallback(()=>{ge()},[ge]);o.useEffect(()=>{if(t.setValue&&!h.current){h.current=!0;const r=t.value||"";O(r)}},[t.setValue,t.value]),o.useEffect(()=>{h.current=!1},[t]),o.useEffect(()=>{const r=i=>{i.preventDefault(),i.stopPropagation(),!M&&i.dataTransfer?.types.includes("Files")&&q(!0)},s=i=>{i.preventDefault(),i.stopPropagation(),M&&(i.clientX<=0&&i.clientY<=0||i.clientX>=J&&i.clientY>=ee)&&q(!1)},d=i=>{i.preventDefault(),i.stopPropagation(),M&&q(!1)};return window.addEventListener("dragover",r),window.addEventListener("drop",d),window.addEventListener("dragleave",s),()=>{window.removeEventListener("dragover",r),window.removeEventListener("drop",d),window.removeEventListener("dragleave",s)}},[M,J,ee]);const Le=E!==v.None&&M;return F(H,{children:[E===v.None?null:a(Dt,{items:[...U],onDelete:ae}),a(At,{className:"stChatInput","data-testid":"stChatInput",ref:P,children:Le?a(Et,{getRootProps:le,getInputProps:ce,acceptFile:E,inputHeight:b.height}):F(Bt,{extended:b.isExtended||y.state==="recording",children:[a(Ht,{isRecording:y.state==="recording",children:a($t,{ref:f})}),E===v.None||y.state==="recording"?null:a(bt,{getRootProps:le,getInputProps:ce,acceptFile:E,disabled:e,theme:c}),y.state!=="recording"&&a(rt,{inputRef:w,value:R,placeholder:m,onChange:Ae,onKeyDown:Me,"aria-label":m,disabled:e,rows:1,overrides:{Root:{style:{minHeight:c.sizes.minElementHeight,outline:"none",borderLeftWidth:"0",borderRightWidth:"0",borderTopWidth:"0",borderBottomWidth:"0",borderTopLeftRadius:"0",borderTopRightRadius:"0",borderBottomRightRadius:"0",borderBottomLeftRadius:"0"}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{fontWeight:c.fontWeights.normal,lineHeight:c.lineHeights.inputWidget,"::placeholder":{color:c.colors.fadedText60},height:b.height,maxHeight:b.maxHeight,paddingLeft:c.spacing.none,paddingBottom:c.spacing.sm,paddingTop:c.spacing.sm,paddingRight:k?`calc(2 * (${c.iconSizes.xl} + 2 * ${c.spacing.sm}))`:`calc(${c.iconSizes.xl} + 2 * ${c.spacing.sm} + ${c.spacing.sm})`}}}}),y.state!=="recording"&&x>c.breakpoints.hideWidgetDetails&&a(Lt,{acceptAudio:k,children:a(tt,{dirty:$,value:R,maxLength:C,type:"chat",inForm:!1})}),a(kt,{isRecording:y.state==="recording",children:y.state==="recording"?F(H,{children:[a(L,{onClick:Be,disabled:e,extended:b.isExtended,"data-testid":"stChatInputCancelButton",children:a(z,{content:ze,size:"lg",color:"inherit"})}),a(L,{onClick:ke,disabled:e||A,extended:b.isExtended,"data-testid":"stChatInputApproveButton",children:A?a(ve,{size:"lg",iconValue:"spinner"}):a(z,{content:Ee,size:"lg",color:"inherit"})})]}):F(H,{children:[k&&a(H,{children:K?a(we,{content:K,placement:Q.TOP,error:!0,children:a(L,{onClick:fe,disabled:e||A,extended:b.isExtended,hasError:!0,"data-testid":"stChatInputMicButton",children:a(z,{content:Se,size:"xl",color:"inherit"})})}):a(L,{onClick:fe,disabled:e||A,extended:b.isExtended,"data-testid":"stChatInputMicButton",children:a(z,{content:Fe,size:"xl",color:"inherit"})})}),a(L,{onClick:ue,disabled:!$||e||A,extended:b.isExtended,"data-testid":"stChatInputSubmitButton",children:a(z,{content:Ue,size:"xl",color:"inherit"})})]})})]})})]})}const _t=o.memo(Wt);export{_t as default};
1
+ import{r as o,E as T,_ as V,Q as $e,cj as v,ck as me,x as g,l as F,j as a,P as Q,b as ye,B as Ce,ax as z,T as We,a0 as H,g as Z,ay as we,Z as ve,bU as Ne,k as Pe,f as Oe,b1 as qe,cl as Ke,e as j,bM as he,bN as Xe}from"./index.CqTPbV5Y.js";import{g as je,C as Ge,I as Ye,F as _,E as xe,b as _e,s as Qe,u as Ze,a as Je}from"./FileHelper.5nCh9KDY.js";import{u as et}from"./useWaveformController.BCmk6WLk.js";import{I as tt}from"./InputInstructions.2R3tBtW9.js";import{u as ot,T as rt}from"./useTextInputAutoExpand.ytEW5QmA.js";import{i as nt}from"./inputUtils.CptNuJwn.js";import{E as at}from"./ErrorOutline.esm.sMJdFExW.js";import{U as be}from"./UploadFileInfo.C-jY39rj.js";import"./base-input.BXTqYbyG.js";var Ie=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(T,V({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.createElement("path",{d:"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5a2.5 2.5 0 015 0v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5a2.5 2.5 0 005 0V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z"}))});Ie.displayName="AttachFile";var Ee=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(T,V({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.createElement("path",{d:"M18 6.7l-8.48 8.48-3.54-3.54a.996.996 0 10-1.41 1.41l4.24 4.24c.39.39 1.02.39 1.41 0l9.18-9.18a.999.999 0 00-.01-1.42c-.37-.38-1-.38-1.39.01z"}))});Ee.displayName="Check";var ze=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(T,V({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.createElement("path",{d:"M18.3 5.71a.996.996 0 00-1.41 0L12 10.59 7.11 5.7A.996.996 0 105.7 7.11L10.59 12 5.7 16.89a.996.996 0 101.41 1.41L12 13.41l4.89 4.89a.996.996 0 101.41-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z"}))});ze.displayName="Close";var Se=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(T,V({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("rect",{width:24,height:24,fill:"none"}),o.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 11c-.55 0-1-.45-1-1V8c0-.55.45-1 1-1s1 .45 1 1v4c0 .55-.45 1-1 1zm0 4c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1z"}))});Se.displayName="ErrorOutline";var Fe=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(T,V({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("rect",{width:24,height:24,fill:"none"}),o.createElement("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),o.createElement("path",{d:"M17.91 11c-.49 0-.9.36-.98.85C16.52 14.21 14.47 16 12 16s-4.52-1.79-4.93-4.15a.998.998 0 00-.98-.85c-.61 0-1.09.54-1 1.14.49 3 2.89 5.34 5.91 5.78V20c0 .55.45 1 1 1s1-.45 1-1v-2.08c3.02-.44 5.42-2.78 5.91-5.78.1-.6-.39-1.14-1-1.14z"}))});Fe.displayName="Mic";var Ue=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(T,V({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("rect",{width:24,height:24,fill:"none"}),o.createElement("path",{d:"M3 5.51v3.71c0 .46.31.86.76.97L11 12l-7.24 1.81c-.45.11-.76.51-.76.97v3.71c0 .72.73 1.2 1.39.92l15.42-6.49c.82-.34.82-1.5 0-1.84L4.39 4.58C3.73 4.31 3 4.79 3 5.51z"}))});Ue.displayName="Send";const N=$e.getLogger("ChatInput"),Re=(e,t)=>t===v.Directory?{...e,webkitdirectory:"",multiple:!0}:e,it=(e,t)=>{if(!t||t.length===0)return!0;const n=e.name.toLowerCase(),l=n.lastIndexOf(".");if(l===-1||l===n.length-1)return t.some(m=>m===""||m===".");const u=n.substring(l),c=n.substring(l+1);return t.some(m=>{const C=m.toLowerCase();return C.startsWith(".")?u===C:c===C})},st=(e,t)=>it(e,t)?{isValid:!0}:{isValid:!1,errorMessage:`${e.type||"This type of"} files are not allowed.`},De=e=>{switch(e){case v.None:return"a file";case v.Single:return"a file";case v.Multiple:return"files";case v.Directory:return"a directory";default:return me(e),"a file"}},lt=g("div",{target:"e15560op0"})(({theme:e,height:t})=>({backgroundColor:e.colors.transparent,position:"absolute",left:0,bottom:0,minHeight:`max(${e.sizes.emptyDropdownHeight}, ${t})`,width:"100%",zIndex:e.zIndices.priority})),ct=g("div",{target:"e15560op1"})(({theme:e,height:t})=>({border:`${e.sizes.borderWidth} solid`,borderColor:e.colors.primary,borderRadius:e.radii.chatInput,backgroundColor:e.colors.secondaryBg,color:e.colors.primary,display:"flex",alignItems:"center",justifyContent:"center",height:t,width:"100%",fontWeight:e.fontWeights.bold})),dt=g("div",{target:"e15560op2"})(({theme:e,disabled:t})=>({display:"flex",alignItems:"top",height:"100%",marginTop:`-${e.sizes.borderWidth}`,cursor:t?"not-allowed":"auto"})),ut=g("div",{target:"e15560op3"})(({disabled:e})=>({pointerEvents:e?"none":"auto"})),pt=g("div",{target:"e15560op4"})(({theme:e})=>({marginTop:"0.625em",marginLeft:e.spacing.sm,height:e.spacing.xl,width:e.sizes.borderWidth,backgroundColor:e.colors.fadedText20})),gt=g("div",{target:"e15560op5"})(({theme:e})=>({left:0,right:0,lineHeight:e.lineHeights.tight,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,overflowX:"auto"})),ft=g("div",{target:"e15560op6"})({display:"flex"}),ht=g("div",{target:"e15560op7"})({flex:"0 0 auto"}),mt=g("div",{target:"e15560op8"})(({theme:e})=>({display:"flex",alignItems:"center",padding:e.spacing.sm,gap:e.spacing.twoXS})),yt=g("div",{target:"e15560op9"})(({theme:e})=>({color:e.colors.fadedText60})),Ct=g("div",{target:"e15560op10"})(({theme:e,fileStatus:t})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:t.type==="uploaded"?e.colors.bodyText:e.colors.fadedText60})),wt=g("div",{target:"e15560op11"})(({theme:e})=>({marginRight:e.spacing.md,color:e.colors.fadedText60})),vt=g("small",{target:"e15560op12"})(({theme:e})=>({display:"flex",alignItems:"center",maxHeight:e.sizes.smallElementHeight,color:e.colors.fadedText60,"& :hover":{color:e.colors.bodyText}})),xt=({getRootProps:e,getInputProps:t,acceptFile:n,disabled:l,theme:u})=>{const c=Re(t(),n);return F(dt,{disabled:l,children:[F(ut,{"data-testid":"stChatInputFileUploadButton",disabled:l,...e(),children:[a("input",{...c}),a(We,{content:`Upload or drag and drop ${De(n)}`,placement:Q.TOP,onMouseEnterDelay:500,children:a(ye,{kind:Ce.MINIMAL,disabled:l,children:a(z,{content:Ie,size:"lg",color:l?u.colors.fadedText40:u.colors.fadedText60})})})]}),a(pt,{})]})},bt=o.memo(xt),It=({getRootProps:e,getInputProps:t,acceptFile:n,inputHeight:l})=>{const u=Re(t(),n);return F(H,{children:[a(lt,{height:l,...e(),children:a("input",{...u})}),a(ct,{height:l,children:`Drag and drop ${De(n)} here`})]})},Et=o.memo(It);function zt({children:e,content:t}){const n=Z();return a(we,{content:t,placement:Q.TOP,overrides:{Body:{style:{top:`-${n.sizes.minElementHeight}`}}},children:e})}const St=({fileInfo:e})=>{const t=Z(),{type:n}=e.status;switch(n){case"uploading":return a(ve,{iconValue:"spinner",testid:"stChatInputFileIconSpinner",size:"lg"});case"error":return a(zt,{content:e.status.errorMessage,children:a(z,{color:t.colors.redTextColor,content:at,size:"lg"})});case"uploaded":return a(z,{content:Ye,size:"lg"});default:return me(n),null}},Ft=({fileInfo:e,onDelete:t})=>F(mt,{className:"stChatInputFile","data-testid":"stChatInputFile",children:[a(yt,{children:a(St,{fileInfo:e})}),a(Ct,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:e.name,fileStatus:e.status,children:e.name}),a(wt,{children:je(e.size,_.Byte)}),a(vt,{"data-testid":"stChatInputDeleteBtn",children:a(ye,{onClick:()=>t(e.id),kind:Ce.MINIMAL,children:a(z,{content:Ge,size:"lg"})})})]}),Ut=o.memo(Ft),Rt=({items:e,onDelete:t})=>a(gt,{"data-testid":"stChatUploadedFiles",children:a(ft,{children:e.map(n=>a(ht,{children:a(Ut,{fileInfo:n,onDelete:t})},n.id))})}),Dt=o.memo(Rt),Tt=(e,t)=>{const n=[],l=[];return e.forEach(u=>{const c=st(u,t.fileType);c.isValid?n.push(u):l.push({file:u,errors:[{code:xe.FileInvalidType,message:c.errorMessage||"File type not allowed."}]})}),{accepted:n,rejected:l}},Vt=({acceptMultipleFiles:e,acceptDirectoryFiles:t,maxFileSize:n,uploadClient:l,uploadFile:u,addFiles:c,getNextLocalFileId:m,deleteExistingFiles:C,onUploadComplete:S,element:w})=>(h,f)=>{if(t&&h.length>0){const{accepted:p,rejected:x}=Tt(h,w);h=p,f=[...f,...x]}if(!e&&h.length===0&&f.length>1){const p=f.findIndex(x=>x.errors?.[0].code===xe.TooManyFiles);p>=0&&(h.push(f[p].file),f.splice(p,1))}if(!e&&h.length>0&&C(),l.fetchFileURLs(h).then(p=>{Ne(p,h).forEach(([x,P])=>{u(x,P)})}).catch(p=>{c(h.map(x=>new be(x.name,x.size,m(),{type:"error",errorMessage:p})))}),f.length>0){const p=f.map(x=>_e(x,m(),n));c(p)}S()},Mt=({getNextLocalFileId:e,addFiles:t,updateFile:n,uploadClient:l,element:u,onUploadProgress:c,onUploadComplete:m})=>(C,S)=>{const w=S.webkitRelativePath||S.name,h=new AbortController,f=new be(w,S.size,e(),{type:"uploading",abortController:h,progress:1});t([f]),l.uploadFile({formId:"",...u},C.uploadUrl,S,p=>c(p,f.id),h.signal).then(()=>m(f.id,C)).catch(p=>{p instanceof DOMException&&p.name==="AbortError"||n(f.id,f.setStatus({type:"error",errorMessage:p?p.toString():"Unknown error"}))})},At=g("div",{target:"eyzqfg10"})("border:none;position:relative;display:flex;"),Bt=g("div",{target:"eyzqfg11"})(({theme:e,extended:t})=>({border:`${e.sizes.borderWidth} solid`,borderColor:e.colors.widgetBorderColor??e.colors.transparent,borderRadius:e.radii.chatInput,backgroundColor:e.colors.secondaryBg,position:"relative",flexGrow:1,display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",paddingLeft:e.spacing.lg,maxHeight:t?"none":e.sizes.minElementHeight,gap:e.spacing.sm,overflow:"hidden",":focus-within":{borderColor:e.colors.primary}})),L=g("button",{target:"eyzqfg12"})(({theme:e,disabled:t,extended:n,hasError:l})=>{const u=Pe(e),[c,m]=u?[e.colors.gray60,e.colors.gray80]:[e.colors.gray80,e.colors.gray40],C=()=>l?e.colors.redTextColor:t?c:m;return{border:"none",backgroundColor:e.colors.transparent,borderTopRightRadius:n?"0":e.radii.chatInput,borderTopLeftRadius:n?e.radii.default:"0",borderBottomRightRadius:e.radii.chatInput,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:e.lineHeights.none,margin:e.spacing.none,padding:e.spacing.sm,color:C(),pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:u?e.colors.gray10:e.colors.gray90},"&:hover":{color:l?e.colors.red70:e.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:e.colors.transparent,borderColor:e.colors.transparent,color:e.colors.gray60,cursor:"not-allowed"}}}),kt=g("div",{target:"eyzqfg13"})(({theme:e,isRecording:t})=>({display:"flex",alignItems:t?"center":"flex-end",height:"100%",position:t?"static":"absolute",right:t?void 0:0,bottom:t?void 0:0,marginBottom:t?0:`-${e.sizes.borderWidth}`,pointerEvents:"none",gap:0,paddingRight:t?e.spacing.sm:0})),Lt=g("div",{target:"eyzqfg14"})(({theme:e,acceptAudio:t})=>({position:"absolute",bottom:"0px",right:t?`calc(2 * (${e.iconSizes.xl} + 2 * ${e.spacing.sm}) + 2 * ${e.spacing.sm})`:`calc(${e.iconSizes.xl} + 2 * ${e.spacing.sm} + ${e.spacing.sm})`})),Ht=g("div",{target:"eyzqfg15"})(({isRecording:e})=>({display:e?"flex":"none",flex:e?1:void 0,alignItems:"center",minWidth:0})),$t=g("div",{target:"eyzqfg16"})(({theme:e})=>({position:"relative",width:"100%",minHeight:e.sizes.minElementHeight,borderRadius:e.radii.default,overflow:"hidden","& > div":{position:"absolute",inset:0}})),G=(e,t,n)=>n.map(l=>l.id===e?t:l),Y=(e,t)=>t.find(n=>n.id===e);function Wt({disabled:e,element:t,widgetMgr:n,fragmentId:l,uploadClient:u}){const c=Z(),{placeholder:m,maxChars:C}=t,S=o.useRef(0),w=o.useRef(null),h=o.useRef(!1),f=o.useRef(null),p=o.useRef(null),{width:x,elementRef:P}=Oe(),{innerWidth:J,innerHeight:ee}=qe(),[R,O]=o.useState(t.default),[U,D]=o.useState([]),[M,q]=o.useState(!1),[A,te]=o.useState(!1),[K,B]=o.useState(null),k=t.acceptAudio??!1;o.useEffect(()=>()=>{p.current&&p.current.abort()},[]);const b=ot({textareaRef:w,dependencies:[m]}),$=o.useMemo(()=>U.some(r=>r.status.type==="uploading")?!1:R!==""||U.length>0,[U,R]),E=Ke(t.acceptFile),oe=Qe(t.maxUploadSizeMb,_.Megabyte,_.Byte),re=o.useCallback(r=>D(s=>[...s,...r]),[]),ne=o.useCallback(r=>{r.status.type==="uploading"&&r.status.abortController.abort(),r.status.type==="uploaded"&&r.status.fileUrls.deleteUrl&&u.deleteFile(r.status.fileUrls.deleteUrl).catch(s=>{N.error("Failed to delete file from server:",s)})},[u]),ae=o.useCallback(r=>{D(s=>{const d=Y(r,s);return j(d)?s:(ne(d),s.filter(i=>i.id!==r))})},[ne]),ie=o.useCallback(()=>{const r=U.filter(s=>s.status.type==="uploaded").map(s=>{const{name:d,size:i,status:I}=s,{fileId:X,fileUrls:He}=I;return new he({fileId:X,fileUrls:He,name:d,size:i})});return new Xe({uploadedFileInfo:r})},[U]),se=()=>S.current++,Te=Vt({acceptMultipleFiles:E===v.Multiple||E===v.Directory,acceptDirectoryFiles:E===v.Directory,maxFileSize:oe,uploadClient:u,uploadFile:Mt({getNextLocalFileId:se,addFiles:re,updateFile:(r,s)=>{D(d=>G(r,s,d))},uploadClient:u,element:t,onUploadProgress:(r,s)=>{D(d=>{const i=Y(s,d);if(j(i)||i.status.type!=="uploading")return d;const I=Math.round(r.loaded*100/r.total);return i.status.progress===I?d:G(s,i.setStatus({type:"uploading",abortController:i.status.abortController,progress:I}),d)})},onUploadComplete:(r,s)=>{D(d=>{const i=Y(r,d);return j(i)||i.status.type!=="uploading"?d:G(i.id,i.setStatus({type:"uploaded",fileId:s.fileId,fileUrls:s}),d)})}}),addFiles:re,getNextLocalFileId:se,deleteExistingFiles:()=>U.forEach(r=>ae(r.id)),onUploadComplete:()=>{w.current&&w.current.focus()},element:t}),{getRootProps:le,getInputProps:ce}=Ze({onDrop:Te,multiple:E===v.Multiple||E===v.Directory,accept:Je(t.fileType),maxSize:oe}),W=o.useCallback(r=>{if(w.current&&w.current.focus(),!$&&!r||e)return;const s=ie(),d={data:R,fileUploaderState:s,audioFileInfo:r};n.setChatInputValue(t,d,{fromUi:!0},l),D([]),O(""),b.clearScrollHeight()},[$,e,R,ie,n,t,l,b]),de=o.useCallback(async r=>{const s=new Date().toISOString().replace(/[:.]/g,"-"),d=new File([r],`audio-${s}.wav`,{type:"audio/wav"});try{te(!0);const i=await u.fetchFileURLs([d]);if(i.length===0)throw new Error("Failed to get upload URL for audio file");const I=i[0];p.current=new AbortController,await u.uploadFile({formId:"",...t},I.uploadUrl,d,()=>{},p.current.signal);const X=new he({fileId:I.fileId,fileUrls:I,name:d.name,size:d.size});W(X)}catch(i){const I="Recording failed";N.error("Audio upload failed:",i),B(I),w.current&&w.current.focus()}finally{te(!1)}},[u,t,W]),Ve=o.useMemo(()=>({onApprove:de,onPermissionDenied:()=>{const r="Microphone access denied";B(r),N.error("Permission denied:",r)},onError:r=>{B("Recording failed"),N.error("Recording error:",r)},onRecordStart:()=>{B(null)}}),[de]),y=et({containerRef:f,sampleRate:t.audioSampleRate??void 0,events:Ve}),ue=o.useCallback(()=>{W()},[W]),Me=r=>{const{metaKey:s,ctrlKey:d,shiftKey:i}=r;nt(r)&&!i&&!d&&!s&&(r.preventDefault(),ue())},Ae=r=>{const{value:s}=r.target;C!==0&&s.length>C||(O(s),b.updateScrollHeight(),K&&B(null))},pe=o.useCallback(async r=>{r.preventDefault(),r.stopPropagation(),!(!k||e||y.state==="recording")&&await y.start()},[k,e,y]),Be=o.useCallback(()=>{y.cancel(),w.current&&w.current.focus()},[y]),ge=o.useCallback(async()=>{const{blob:r}=await y.stop();await y.approve(r)},[y]),fe=o.useCallback(r=>{pe(r)},[pe]),ke=o.useCallback(()=>{ge()},[ge]);o.useEffect(()=>{if(t.setValue&&!h.current){h.current=!0;const r=t.value||"";O(r)}},[t.setValue,t.value]),o.useEffect(()=>{h.current=!1},[t]),o.useEffect(()=>{const r=i=>{i.preventDefault(),i.stopPropagation(),!M&&i.dataTransfer?.types.includes("Files")&&q(!0)},s=i=>{i.preventDefault(),i.stopPropagation(),M&&(i.clientX<=0&&i.clientY<=0||i.clientX>=J&&i.clientY>=ee)&&q(!1)},d=i=>{i.preventDefault(),i.stopPropagation(),M&&q(!1)};return window.addEventListener("dragover",r),window.addEventListener("drop",d),window.addEventListener("dragleave",s),()=>{window.removeEventListener("dragover",r),window.removeEventListener("drop",d),window.removeEventListener("dragleave",s)}},[M,J,ee]);const Le=E!==v.None&&M;return F(H,{children:[E===v.None?null:a(Dt,{items:[...U],onDelete:ae}),a(At,{className:"stChatInput","data-testid":"stChatInput",ref:P,children:Le?a(Et,{getRootProps:le,getInputProps:ce,acceptFile:E,inputHeight:b.height}):F(Bt,{extended:b.isExtended||y.state==="recording",children:[a(Ht,{isRecording:y.state==="recording",children:a($t,{ref:f})}),E===v.None||y.state==="recording"?null:a(bt,{getRootProps:le,getInputProps:ce,acceptFile:E,disabled:e,theme:c}),y.state!=="recording"&&a(rt,{inputRef:w,value:R,placeholder:m,onChange:Ae,onKeyDown:Me,"aria-label":m,disabled:e,rows:1,overrides:{Root:{style:{minHeight:c.sizes.minElementHeight,outline:"none",borderLeftWidth:"0",borderRightWidth:"0",borderTopWidth:"0",borderBottomWidth:"0",borderTopLeftRadius:"0",borderTopRightRadius:"0",borderBottomRightRadius:"0",borderBottomLeftRadius:"0"}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{fontWeight:c.fontWeights.normal,lineHeight:c.lineHeights.inputWidget,"::placeholder":{color:c.colors.fadedText60},height:b.height,maxHeight:b.maxHeight,paddingLeft:c.spacing.none,paddingBottom:c.spacing.sm,paddingTop:c.spacing.sm,paddingRight:k?`calc(2 * (${c.iconSizes.xl} + 2 * ${c.spacing.sm}))`:`calc(${c.iconSizes.xl} + 2 * ${c.spacing.sm} + ${c.spacing.sm})`}}}}),y.state!=="recording"&&x>c.breakpoints.hideWidgetDetails&&a(Lt,{acceptAudio:k,children:a(tt,{dirty:$,value:R,maxLength:C,type:"chat",inForm:!1})}),a(kt,{isRecording:y.state==="recording",children:y.state==="recording"?F(H,{children:[a(L,{onClick:Be,disabled:e,extended:b.isExtended,"data-testid":"stChatInputCancelButton",children:a(z,{content:ze,size:"lg",color:"inherit"})}),a(L,{onClick:ke,disabled:e||A,extended:b.isExtended,"data-testid":"stChatInputApproveButton",children:A?a(ve,{size:"lg",iconValue:"spinner"}):a(z,{content:Ee,size:"lg",color:"inherit"})})]}):F(H,{children:[k&&a(H,{children:K?a(we,{content:K,placement:Q.TOP,error:!0,children:a(L,{onClick:fe,disabled:e||A,extended:b.isExtended,hasError:!0,"data-testid":"stChatInputMicButton",children:a(z,{content:Se,size:"xl",color:"inherit"})})}):a(L,{onClick:fe,disabled:e||A,extended:b.isExtended,"data-testid":"stChatInputMicButton",children:a(z,{content:Fe,size:"xl",color:"inherit"})})}),a(L,{onClick:ue,disabled:!$||e||A,extended:b.isExtended,"data-testid":"stChatInputSubmitButton",children:a(z,{content:Ue,size:"xl",color:"inherit"})})]})})]})})]})}const _t=o.memo(Wt);export{_t as default};
@@ -1 +1 @@
1
- import{r as c,B as s,u as d,j as a,a as B,b as h,c as m,D as p,d as f}from"./index.DMxc2XFp.js";function g(l){const{disabled:e,element:t,widgetMgr:n,fragmentId:r}=l,i=t.shortcut?t.shortcut:void 0;let o=s.SECONDARY;t.type==="primary"?o=s.PRIMARY:t.type==="tertiary"&&(o=s.TERTIARY);const u=c.useCallback(()=>{e||n.setTriggerValue(t,{fromUi:!0},r)},[e,n,t,r]);return d({shortcut:i,disabled:e,onActivate:u}),a(f,{className:"stButton","data-testid":"stButton",children:a(B,{help:t.help,containerWidth:!0,children:a(h,{kind:o,size:m.SMALL,disabled:e,containerWidth:!0,onClick:u,children:a(p,{icon:t.icon,label:t.label,shortcut:i})})})})}const R=c.memo(g);export{R as default};
1
+ import{r as c,B as s,u as d,j as a,a as B,b as h,c as m,D as p,d as f}from"./index.CqTPbV5Y.js";function g(l){const{disabled:e,element:t,widgetMgr:n,fragmentId:r}=l,i=t.shortcut?t.shortcut:void 0;let o=s.SECONDARY;t.type==="primary"?o=s.PRIMARY:t.type==="tertiary"&&(o=s.TERTIARY);const u=c.useCallback(()=>{e||n.setTriggerValue(t,{fromUi:!0},r)},[e,n,t,r]);return d({shortcut:i,disabled:e,onActivate:u}),a(f,{className:"stButton","data-testid":"stButton",children:a(B,{help:t.help,containerWidth:!0,children:a(h,{kind:o,size:m.SMALL,disabled:e,containerWidth:!0,onClick:u,children:a(p,{icon:t.icon,label:t.label,shortcut:i})})})})}const R=c.memo(g);export{R as default};
@@ -1 +1 @@
1
- import{x as l,r as i,O as v,j as f,Q as g}from"./index.DMxc2XFp.js";const T=l("div",{target:"ea9qfvi0"})(()=>({lineHeight:0})),y=l("audio",{target:"ea9qfvi1"})(({theme:t})=>({width:"100%",height:t.sizes.minElementHeight,margin:0,padding:0})),h=g.getLogger("Audio");function L({element:t,endpoints:a,elementMgr:s}){const o=i.useRef(null),{startTime:n,endTime:d,loop:u,autoplay:p}=t,E=i.useMemo(()=>{if(!t.id)return!0;const e=s.getElementState(t.id,"preventAutoplay");return e||s.setElementState(t.id,"preventAutoplay",!0),e??!1},[t.id,s]);i.useEffect(()=>{o.current&&(o.current.currentTime=n)},[n]),i.useEffect(()=>{const e=o.current,r=()=>{e&&(e.currentTime=t.startTime)};return e&&e.addEventListener("loadedmetadata",r),()=>{e&&e.removeEventListener("loadedmetadata",r)}},[t]),i.useEffect(()=>{const e=o.current;if(!e)return;let r=!1;const c=()=>{d>0&&e.currentTime>=d&&(u?(e.currentTime=n||0,e.play()):r||(r=!0,e.pause()))};return d>0&&e.addEventListener("timeupdate",c),()=>{e&&d>0&&e.removeEventListener("timeupdate",c)}},[d,u,n]),i.useEffect(()=>{const e=o.current;if(!e)return;const r=()=>{u&&(e.currentTime=n||0,e.play())};return e.addEventListener("ended",r),()=>{e&&e.removeEventListener("ended",r)}},[u,n]);const m=v(t.url),A=a.buildMediaURL(t.url);return f(T,{children:f(y,{className:"stAudio","data-testid":"stAudio",ref:o,controls:!0,autoPlay:p&&!E,src:A,onError:e=>{const r=e.currentTarget.src;h.error(`Client Error: Audio source error - ${r}`),a.sendClientErrorToHost("Audio","Audio source failed to load","onerror triggered",r)},crossOrigin:m})})}const C=i.memo(L);export{C as default};
1
+ import{x as l,r as i,O as v,j as f,Q as g}from"./index.CqTPbV5Y.js";const T=l("div",{target:"ea9qfvi0"})(()=>({lineHeight:0})),y=l("audio",{target:"ea9qfvi1"})(({theme:t})=>({width:"100%",height:t.sizes.minElementHeight,margin:0,padding:0})),h=g.getLogger("Audio");function L({element:t,endpoints:a,elementMgr:s}){const o=i.useRef(null),{startTime:n,endTime:d,loop:u,autoplay:p}=t,E=i.useMemo(()=>{if(!t.id)return!0;const e=s.getElementState(t.id,"preventAutoplay");return e||s.setElementState(t.id,"preventAutoplay",!0),e??!1},[t.id,s]);i.useEffect(()=>{o.current&&(o.current.currentTime=n)},[n]),i.useEffect(()=>{const e=o.current,r=()=>{e&&(e.currentTime=t.startTime)};return e&&e.addEventListener("loadedmetadata",r),()=>{e&&e.removeEventListener("loadedmetadata",r)}},[t]),i.useEffect(()=>{const e=o.current;if(!e)return;let r=!1;const c=()=>{d>0&&e.currentTime>=d&&(u?(e.currentTime=n||0,e.play()):r||(r=!0,e.pause()))};return d>0&&e.addEventListener("timeupdate",c),()=>{e&&d>0&&e.removeEventListener("timeupdate",c)}},[d,u,n]),i.useEffect(()=>{const e=o.current;if(!e)return;const r=()=>{u&&(e.currentTime=n||0,e.play())};return e.addEventListener("ended",r),()=>{e&&e.removeEventListener("ended",r)}},[u,n]);const m=v(t.url),A=a.buildMediaURL(t.url);return f(T,{children:f(y,{className:"stAudio","data-testid":"stAudio",ref:o,controls:!0,autoPlay:p&&!E,src:A,onError:e=>{const r=e.currentTarget.src;h.error(`Client Error: Audio source error - ${r}`),a.sendClientErrorToHost("Audio","Audio source failed to load","onerror triggered",r)},crossOrigin:m})})}const C=i.memo(L);export{C as default};
@@ -1 +1 @@
1
- import{r as p,g as x,k as T,j as n,l as C,m as y,S,o as L,T as W,P as B,p as w,t as R,C as E,q as P}from"./index.DMxc2XFp.js";import{u as $}from"./useBasicWidgetState.Bfp6TnSw.js";import{S as v,L as X,a as m}from"./checkbox.0BeV1IBL.js";import"./FormClearHelper.CG2XN1_g.js";function H({element:t,disabled:a,widgetMgr:s,fragmentId:d}){const[f,g]=$({getStateFromWidgetMgr:M,getDefaultStateFromProto:V,getCurrStateFromProto:I,updateWidgetMgrState:j,element:t,widgetMgr:s,fragmentId:d}),k=p.useCallback(i=>{g({value:i.target.checked,fromUi:!0})},[g]),e=x(),{colors:o,spacing:h,sizes:r}=e,u=T(e),b=a?o.fadedText40:o.bodyText;return n(P,{className:"row-widget stCheckbox","data-testid":"stCheckbox",children:n(v,{checked:f,disabled:a,onChange:k,"aria-label":t.label,checkmarkType:t.type===E.StyleType.TOGGLE?m.toggle:m.default,labelPlacement:X.right,overrides:{Root:{style:({$isFocusVisible:i})=>({marginBottom:h.none,marginTop:h.none,backgroundColor:i?o.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Toggle:{style:({$checked:i})=>{let c=u?o.bgColor:o.bodyText;return a&&(c=u?o.gray70:o.gray90),{width:`calc(${r.checkbox} - ${e.spacing.twoXS})`,height:`calc(${r.checkbox} - ${e.spacing.twoXS})`,transform:i?`translateX(${r.checkbox})`:"",backgroundColor:c,boxShadow:""}}},ToggleTrack:{style:({$checked:i,$isHovered:c})=>{let l=o.fadedText40;return c&&!a&&(l=o.fadedText20),i&&!a&&(l=o.primary),{marginRight:0,marginLeft:0,marginBottom:0,marginTop:e.spacing.twoXS,paddingLeft:e.spacing.threeXS,paddingRight:e.spacing.threeXS,width:`calc(2 * ${r.checkbox})`,minWidth:`calc(2 * ${r.checkbox})`,height:r.checkbox,minHeight:r.checkbox,borderBottomLeftRadius:e.radii.full,borderTopLeftRadius:e.radii.full,borderBottomRightRadius:e.radii.full,borderTopRightRadius:e.radii.full,backgroundColor:l}}},Checkmark:{style:({$isFocusVisible:i,$checked:c})=>{const l=c&&!a?o.primary:o.fadedText40;return{outline:0,width:r.checkbox,height:r.checkbox,marginTop:e.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:i&&c?`0 0 0 0.2rem ${R(o.primary,.5)}`:"",borderLeftWidth:r.borderWidth,borderRightWidth:r.borderWidth,borderTopWidth:r.borderWidth,borderBottomWidth:r.borderWidth,borderLeftColor:l,borderRightColor:l,borderTopColor:l,borderBottomColor:l}}},Label:{style:{lineHeight:e.lineHeights.small,paddingLeft:e.spacing.sm,position:"relative",color:b}}},children:C(w,{visibility:y(t.labelVisibility?.value),"data-testid":"stWidgetLabel",children:[n(S,{source:t.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),t.help&&n(L,{color:b,children:n(W,{content:t.help,placement:B.TOP_RIGHT})})]})})})}function M(t,a){return t.getBoolValue(a)}function V(t){return t.default??null}function I(t){return t.value??null}function j(t,a,s,d){a.setBoolValue(t,s.value,{fromUi:s.fromUi},d)}const z=p.memo(H);export{z as default};
1
+ import{r as p,g as x,k as T,j as n,l as C,m as y,S,o as L,T as W,P as B,p as w,t as R,C as E,q as P}from"./index.CqTPbV5Y.js";import{u as $}from"./useBasicWidgetState.DA3_qaXD.js";import{S as v,L as X,a as m}from"./checkbox.5xWaqPqm.js";import"./FormClearHelper.-9RbsnV0.js";function H({element:t,disabled:a,widgetMgr:s,fragmentId:d}){const[f,g]=$({getStateFromWidgetMgr:M,getDefaultStateFromProto:V,getCurrStateFromProto:I,updateWidgetMgrState:j,element:t,widgetMgr:s,fragmentId:d}),k=p.useCallback(i=>{g({value:i.target.checked,fromUi:!0})},[g]),e=x(),{colors:o,spacing:h,sizes:r}=e,u=T(e),b=a?o.fadedText40:o.bodyText;return n(P,{className:"row-widget stCheckbox","data-testid":"stCheckbox",children:n(v,{checked:f,disabled:a,onChange:k,"aria-label":t.label,checkmarkType:t.type===E.StyleType.TOGGLE?m.toggle:m.default,labelPlacement:X.right,overrides:{Root:{style:({$isFocusVisible:i})=>({marginBottom:h.none,marginTop:h.none,backgroundColor:i?o.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Toggle:{style:({$checked:i})=>{let c=u?o.bgColor:o.bodyText;return a&&(c=u?o.gray70:o.gray90),{width:`calc(${r.checkbox} - ${e.spacing.twoXS})`,height:`calc(${r.checkbox} - ${e.spacing.twoXS})`,transform:i?`translateX(${r.checkbox})`:"",backgroundColor:c,boxShadow:""}}},ToggleTrack:{style:({$checked:i,$isHovered:c})=>{let l=o.fadedText40;return c&&!a&&(l=o.fadedText20),i&&!a&&(l=o.primary),{marginRight:0,marginLeft:0,marginBottom:0,marginTop:e.spacing.twoXS,paddingLeft:e.spacing.threeXS,paddingRight:e.spacing.threeXS,width:`calc(2 * ${r.checkbox})`,minWidth:`calc(2 * ${r.checkbox})`,height:r.checkbox,minHeight:r.checkbox,borderBottomLeftRadius:e.radii.full,borderTopLeftRadius:e.radii.full,borderBottomRightRadius:e.radii.full,borderTopRightRadius:e.radii.full,backgroundColor:l}}},Checkmark:{style:({$isFocusVisible:i,$checked:c})=>{const l=c&&!a?o.primary:o.fadedText40;return{outline:0,width:r.checkbox,height:r.checkbox,marginTop:e.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:i&&c?`0 0 0 0.2rem ${R(o.primary,.5)}`:"",borderLeftWidth:r.borderWidth,borderRightWidth:r.borderWidth,borderTopWidth:r.borderWidth,borderBottomWidth:r.borderWidth,borderLeftColor:l,borderRightColor:l,borderTopColor:l,borderBottomColor:l}}},Label:{style:{lineHeight:e.lineHeights.small,paddingLeft:e.spacing.sm,position:"relative",color:b}}},children:C(w,{visibility:y(t.labelVisibility?.value),"data-testid":"stWidgetLabel",children:[n(S,{source:t.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),t.help&&n(L,{color:b,children:n(W,{content:t.help,placement:B.TOP_RIGHT})})]})})})}function M(t,a){return t.getBoolValue(a)}function V(t){return t.default??null}function I(t){return t.value??null}function j(t,a,s,d){a.setBoolValue(t,s.value,{fromUi:s.fromUi},d)}const z=p.memo(H);export{z as default};
@@ -1 +1 @@
1
- import{r as a,E as C,_ as E,x as s,aC as k,aA as x,aD as z,aE as I,g as D,f as W,aF as m,l,j as r,m as H,S as B,T as N,P as O,o as P,ax as X,aG as q,aH as T,aI as F}from"./index.DMxc2XFp.js";import{e as j,S as G,a as U,b as J}from"./embed.XT9xNd3F.js";import"./threshold.Q1mXg5rX.js";import"./value.B4vHRSi7.js";import"./timer.C2hYhUse.js";var A=a.forwardRef(function(e,t){var i={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(C,E({iconAttrs:i,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),a.createElement("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}))});A.displayName="ArrowDownward";var b=a.forwardRef(function(e,t){var i={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(C,E({iconAttrs:i,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),a.createElement("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"}))});b.displayName="ArrowUpward";const K=s("div",{target:"exsm2dv0"})(({theme:e,showBorder:t})=>({height:"100%",...t&&{border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:e.radii.default,overflow:"hidden"}})),Q=s("div",{target:"exsm2dv1"})(({theme:e,showBorder:t})=>({...t&&{padding:`calc(${e.spacing.lg} - ${e.sizes.borderWidth})`}})),Y=s("div",{target:"exsm2dv2"})(({theme:e,showBorder:t})=>({marginTop:t?void 0:e.spacing.lg,marginBottom:t?e.spacing.twoXL:void 0})),w=s("div",{target:"exsm2dv3"})(({theme:e})=>({overflowWrap:"normal",textOverflow:"ellipsis",width:"100%",overflow:"hidden",whiteSpace:"nowrap",fontFamily:e.genericFonts.bodyFont,lineHeight:"normal",verticalAlign:"middle","& > div":{overflow:"hidden","& > p":{textOverflow:"ellipsis",overflow:"hidden"}}})),Z=s(k,{target:"exsm2dv4"})(({visibility:e})=>({marginBottom:0,display:e===x.Collapsed?"none":"grid",gridTemplateColumns:e===x.Collapsed?"initial":"auto 1fr",visibility:e===x.Hidden?"hidden":"visible"})),ee=s("div",{target:"exsm2dv5"})(({theme:e})=>({fontSize:e.fontSizes.threeXL,color:e.colors.bodyText,paddingBottom:e.spacing.twoXS})),te=s("div",{target:"exsm2dv6"})(({theme:e,metricColor:t,showArrow:i})=>({color:I(e,t),backgroundColor:z(e,t),fontSize:e.fontSizes.sm,display:"inline-flex",flexDirection:"row",alignItems:"center",fontWeight:e.fontWeights.normal,borderRadius:e.radii.full,maxWidth:"100%",padding:`${e.spacing.threeXS} ${e.spacing.xs} ${e.spacing.threeXS} ${e.spacing.xs}`,...i&&{paddingLeft:e.spacing.twoXS}})),ie=1e3;function ae(e,t,i,o,f){const n=`metric_chart_${Math.random().toString(36).slice(2,10)}`,h=e.length===1?[e[0],e[0]]:e,d={$schema:"https://vega.github.io/schema/vega-lite/v5.json",width:Math.round(i),height:Math.round(F("3.5rem")),data:{values:h.map((v,g)=>({x:g,y:v}))},layer:[{name:`${n}_mark`,mark:{type:"line",...t===m.ChartType.LINE&&{type:"line",strokeCap:"round",strokeWidth:2},...t===m.ChartType.BAR&&{type:"bar",cornerRadius:parseFloat(o.radii.full)},...t===m.ChartType.AREA&&{type:"area",color:z(o,f),opacity:1,line:{color:T(o,f),opacity:1,strokeWidth:2,strokeCap:"round"}}},encoding:{x:{field:"x",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}},y:{field:"y",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}}}},{name:`${n}_points`,mark:{type:"point",opacity:0},encoding:{x:{field:"x",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}},y:{field:"y",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}}},params:[{name:`${n}_hover_selection`,select:{type:"point",encodings:["x"],nearest:!0,on:e.length>ie?"mousemove{16}":"mousemove",clear:"mouseleave"}}]},{name:`${n}_highlighted_points`,transform:[{filter:{param:`${n}_hover_selection`,empty:!1}}],mark:{type:"point",filled:!0,size:65,tooltip:!0},encoding:{x:{field:"x",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}},y:{field:"y",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}}}}],config:{view:{stroke:null},padding:{left:-3,right:-3,top:2,bottom:2},...t===m.ChartType.BAR&&{padding:{left:0,right:0,top:2,bottom:2}},mark:{tooltip:{content:"encoding"},color:T(o,f)}}};return d.config=U(d.config,o),d}function oe({element:e}){const t=D(),i=a.useRef(null),{width:o,elementRef:f}=W(),{MetricDirection:u}=m,{body:n,label:h,delta:d,direction:v,color:g,labelVisibility:L,help:M,showBorder:y,chartData:c,chartType:S}=e;let p=null;switch(v){case u.DOWN:p=A;break;case u.UP:p=b;break}const $="0 threeXS 0 0",R=d!=="";return a.useEffect(()=>{if(c&&c.length>0&&i.current&&o>0){const V=ae(c,S,o,t,g);j(i.current,V,{actions:!1,renderer:"svg",ast:!0,expr:J,tooltip:{theme:"custom",formatTooltip:_=>`${_.y}`}})}},[c,g,t,o,S,i]),l(K,{className:"stMetric","data-testid":"stMetric",showBorder:y,children:[l(Q,{showBorder:y,children:[l(Z,{"data-testid":"stMetricLabel",visibility:H(L?.value),children:[r(w,{children:r(B,{source:h,allowHTML:!1,isLabel:!0})}),M&&r(P,{children:r(N,{content:M,placement:O.TOP_RIGHT})})]}),r(ee,{"data-testid":"stMetricValue",children:l(w,{children:[" ",n," "]})}),R&&l(te,{"data-testid":"stMetricDelta",metricColor:g,showArrow:p!==null,children:[p&&r(X,{testid:p===b?"stMetricDeltaIcon-Up":"stMetricDeltaIcon-Down",content:p,size:"md",margin:$}),l(w,{children:[" ",d," "]})]})]}),c&&c.length>0&&l("div",{ref:f,children:[r(q,{styles:[G]}),r(Y,{ref:i,"data-testid":"stMetricChart",showBorder:y})]})]})}const ce=a.memo(oe);export{ce as default};
1
+ import{r as a,E as C,_ as E,x as s,aC as k,aA as x,aD as z,aE as I,g as D,f as W,aF as m,l,j as r,m as H,S as B,T as N,P as O,o as P,ax as X,aG as q,aH as T,aI as F}from"./index.CqTPbV5Y.js";import{e as j,S as G,a as U,b as J}from"./embed.HKcgTiLB.js";import"./threshold.Q1mXg5rX.js";import"./value.B4vHRSi7.js";import"./timer.C2hYhUse.js";var A=a.forwardRef(function(e,t){var i={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(C,E({iconAttrs:i,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),a.createElement("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}))});A.displayName="ArrowDownward";var b=a.forwardRef(function(e,t){var i={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(C,E({iconAttrs:i,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),a.createElement("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"}))});b.displayName="ArrowUpward";const K=s("div",{target:"exsm2dv0"})(({theme:e,showBorder:t})=>({height:"100%",...t&&{border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:e.radii.default,overflow:"hidden"}})),Q=s("div",{target:"exsm2dv1"})(({theme:e,showBorder:t})=>({...t&&{padding:`calc(${e.spacing.lg} - ${e.sizes.borderWidth})`}})),Y=s("div",{target:"exsm2dv2"})(({theme:e,showBorder:t})=>({marginTop:t?void 0:e.spacing.lg,marginBottom:t?e.spacing.twoXL:void 0})),w=s("div",{target:"exsm2dv3"})(({theme:e})=>({overflowWrap:"normal",textOverflow:"ellipsis",width:"100%",overflow:"hidden",whiteSpace:"nowrap",fontFamily:e.genericFonts.bodyFont,lineHeight:"normal",verticalAlign:"middle","& > div":{overflow:"hidden","& > p":{textOverflow:"ellipsis",overflow:"hidden"}}})),Z=s(k,{target:"exsm2dv4"})(({visibility:e})=>({marginBottom:0,display:e===x.Collapsed?"none":"grid",gridTemplateColumns:e===x.Collapsed?"initial":"auto 1fr",visibility:e===x.Hidden?"hidden":"visible"})),ee=s("div",{target:"exsm2dv5"})(({theme:e})=>({fontSize:e.fontSizes.threeXL,color:e.colors.bodyText,paddingBottom:e.spacing.twoXS})),te=s("div",{target:"exsm2dv6"})(({theme:e,metricColor:t,showArrow:i})=>({color:I(e,t),backgroundColor:z(e,t),fontSize:e.fontSizes.sm,display:"inline-flex",flexDirection:"row",alignItems:"center",fontWeight:e.fontWeights.normal,borderRadius:e.radii.full,maxWidth:"100%",padding:`${e.spacing.threeXS} ${e.spacing.xs} ${e.spacing.threeXS} ${e.spacing.xs}`,...i&&{paddingLeft:e.spacing.twoXS}})),ie=1e3;function ae(e,t,i,o,f){const n=`metric_chart_${Math.random().toString(36).slice(2,10)}`,h=e.length===1?[e[0],e[0]]:e,d={$schema:"https://vega.github.io/schema/vega-lite/v5.json",width:Math.round(i),height:Math.round(F("3.5rem")),data:{values:h.map((v,g)=>({x:g,y:v}))},layer:[{name:`${n}_mark`,mark:{type:"line",...t===m.ChartType.LINE&&{type:"line",strokeCap:"round",strokeWidth:2},...t===m.ChartType.BAR&&{type:"bar",cornerRadius:parseFloat(o.radii.full)},...t===m.ChartType.AREA&&{type:"area",color:z(o,f),opacity:1,line:{color:T(o,f),opacity:1,strokeWidth:2,strokeCap:"round"}}},encoding:{x:{field:"x",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}},y:{field:"y",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}}}},{name:`${n}_points`,mark:{type:"point",opacity:0},encoding:{x:{field:"x",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}},y:{field:"y",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}}},params:[{name:`${n}_hover_selection`,select:{type:"point",encodings:["x"],nearest:!0,on:e.length>ie?"mousemove{16}":"mousemove",clear:"mouseleave"}}]},{name:`${n}_highlighted_points`,transform:[{filter:{param:`${n}_hover_selection`,empty:!1}}],mark:{type:"point",filled:!0,size:65,tooltip:!0},encoding:{x:{field:"x",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}},y:{field:"y",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}}}}],config:{view:{stroke:null},padding:{left:-3,right:-3,top:2,bottom:2},...t===m.ChartType.BAR&&{padding:{left:0,right:0,top:2,bottom:2}},mark:{tooltip:{content:"encoding"},color:T(o,f)}}};return d.config=U(d.config,o),d}function oe({element:e}){const t=D(),i=a.useRef(null),{width:o,elementRef:f}=W(),{MetricDirection:u}=m,{body:n,label:h,delta:d,direction:v,color:g,labelVisibility:L,help:M,showBorder:y,chartData:c,chartType:S}=e;let p=null;switch(v){case u.DOWN:p=A;break;case u.UP:p=b;break}const $="0 threeXS 0 0",R=d!=="";return a.useEffect(()=>{if(c&&c.length>0&&i.current&&o>0){const V=ae(c,S,o,t,g);j(i.current,V,{actions:!1,renderer:"svg",ast:!0,expr:J,tooltip:{theme:"custom",formatTooltip:_=>`${_.y}`}})}},[c,g,t,o,S,i]),l(K,{className:"stMetric","data-testid":"stMetric",showBorder:y,children:[l(Q,{showBorder:y,children:[l(Z,{"data-testid":"stMetricLabel",visibility:H(L?.value),children:[r(w,{children:r(B,{source:h,allowHTML:!1,isLabel:!0})}),M&&r(P,{children:r(N,{content:M,placement:O.TOP_RIGHT})})]}),r(ee,{"data-testid":"stMetricValue",children:l(w,{children:[" ",n," "]})}),R&&l(te,{"data-testid":"stMetricDelta",metricColor:g,showArrow:p!==null,children:[p&&r(X,{testid:p===b?"stMetricDeltaIcon-Up":"stMetricDeltaIcon-Down",content:p,size:"md",margin:$}),l(w,{children:[" ",d," "]})]})]}),c&&c.length>0&&l("div",{ref:f,children:[r(q,{styles:[G]}),r(Y,{ref:i,"data-testid":"stMetricChart",showBorder:y})]})]})}const ce=a.memo(oe);export{ce as default};
@@ -1 +1 @@
1
- import{get as O}from"./index.CjozwSzS.js";import{I as P}from"./index.DMxc2XFp.js";const s=[{description:"angry face",emoji:"😠",emoticons:[">:(",">:[",">:-(",">:-[",">=(",">=[",">=-(",">=-["],name:"angry",tags:["mad","annoyed"]},{description:"smiling face with smiling eyes",emoji:"😊",emoticons:[':")',':"]',':"D',':-")',':-"]',':-"D','=")','="]','="D','=-")','=-"]','=-"D'],name:"blush",tags:["proud"]},{description:"broken heart",emoji:"💔",emoticons:["<\\3","</3"],name:"broken_heart",tags:[]},{description:"confused face",emoji:"😕",emoticons:[":/",":\\",":-/",":-\\","=/","=\\","=-/","=-\\"],name:"confused",tags:[]},{description:"crying face",emoji:"😢",emoticons:[":,(",":,[",":,|",":,-(",":,-[",":,-|",":'(",":'[",":'|",":'-(",":'-[",":'-|","=,(","=,[","=,|","=,-(","=,-[","=,-|","='(","='[","='|","='-(","='-[","='-|","T-T"],name:"cry",tags:["sad","tear"]},{description:"frowning face with open mouth",emoji:"😦",emoticons:[":(",":[",":-(",":-[","=(","=[","=-(","=-["],name:"frowning",tags:[]},{description:"red heart",emoji:"❤️",emoticons:["<3"],name:"heart",tags:["love"]},{description:"angry face with horns",emoji:"👿",emoticons:["]:(","]:[","]:-(","]:-[","]=(","]=[","]=-(","]=-["],name:"imp",tags:["angry","devil","evil","horns"]},{description:"smiling face with halo",emoji:"😇",emoticons:["o:)","o:]","o:D","o:-)","o:-]","o:-D","o=)","o=]","o=D","o=-)","o=-]","o=-D","O:)","O:]","O:D","O:-)","O:-]","O:-D","O=)","O=]","O=D","O=-)","O=-]","O=-D","0:)","0:]","0:D","0:-)","0:-]","0:-D","0=)","0=]","0=D","0=-)","0=-]","0=-D"],name:"innocent",tags:["angel"]},{description:"face with tears of joy",emoji:"😂",emoticons:[":,)",":,]",":,D",":,-)",":,-]",":,-D",":')",":']",":'D",":'-)",":'-]",":'-D","=,)","=,]","=,D","=,-)","=,-]","=,-D","=')","=']","='D","='-)","='-]","='-D"],name:"joy",tags:["tears"]},{description:"kissing face",emoji:"😗",emoticons:[":*",":-*","=*","=-*"],name:"kissing",tags:[]},{description:"grinning squinting face",emoji:"😆",emoticons:["x)","x]","xD","x-)","x-]","x-D","X)","X]","X-)","X-]","X-D"],name:"laughing",tags:["happy","haha"]},{description:"man",emoji:"👨",emoticons:[":3",":-3","=3","=-3",";3",";-3","x3","x-3","X3","X-3"],name:"man",tags:["mustache","father","dad"]},{description:"neutral face",emoji:"😐",emoticons:[":|",":-|","=|","=-|"],name:"neutral_face",tags:["meh"]},{description:"face without mouth",emoji:"😶",emoticons:[":-"],name:"no_mouth",tags:["mute","silence"]},{description:"face with open mouth",emoji:"😮",emoticons:[":o",":O",":0",":-o",":-O",":-0","=o","=O","=0","=-o","=-O","=-0"],name:"open_mouth",tags:["surprise","impressed","wow"]},{description:"enraged face",emoji:"😡",emoticons:[":@",":-@","=@","=-@"],name:"rage",tags:["angry"]},{description:"grinning face with smiling eyes",emoji:"😄",emoticons:[":D",":-D","=D","=-D"],name:"smile",tags:["happy","joy","laugh","pleased"]},{description:"grinning face with big eyes",emoji:"😃",emoticons:[":)",":]",":-)",":-]","=)","=]","=-)","=-]"],name:"smiley",tags:["happy","joy","haha"]},{description:"smiling face with horns",emoji:"😈",emoticons:["]:)","]:]","]:D","]:-)","]:-]","]:-D","]=)","]=]","]=D","]=-)","]=-]","]=-D"],name:"smiling_imp",tags:["devil","evil","horns"]},{description:"loudly crying face",emoji:"😭",emoticons:[":,'(",":,'[",":,'-(",":,'-[",":',(",":',[",":',-(",":',-[","=,'(","=,'[","=,'-(","=,'-[","=',(","=',[","=',-(","=',-["],name:"sob",tags:["sad","cry","bawling"]},{description:"face with tongue",emoji:"😛",emoticons:[":p",":P",":d",":-p",":-P",":-d","=p","=P","=d","=-p","=-P","=-d"],name:"stuck_out_tongue",tags:[]},{description:"squinting face with tongue",emoji:"😝",emoticons:["xP","x-p","x-P","x-d","Xp","Xd","X-p","X-P","X-d"],name:"stuck_out_tongue_closed_eyes",tags:["prank"]},{description:"winking face with tongue",emoji:"😜",emoticons:[";p",";P",";d",";-p",";-P",";-d"],name:"stuck_out_tongue_winking_eye",tags:["prank","silly"]},{description:"smiling face with sunglasses",emoji:"😎",emoticons:["8)","8]","8D","8-)","8-]","8-D","B)","B]","B-)","B-]","B-D"],name:"sunglasses",tags:["cool"]},{description:"downcast face with sweat",emoji:"😓",emoticons:[",:(",",:[",",:-(",",:-[",",=(",",=[",",=-(",",=-[","':(","':[","':-(","':-[","'=(","'=[","'=-(","'=-["],name:"sweat",tags:[]},{description:"grinning face with sweat",emoji:"😅",emoticons:[",:)",",:]",",:D",",:-)",",:-]",",:-D",",=)",",=]",",=D",",=-)",",=-]",",=-D","':)","':]","':D","':-)","':-]","':-D","'=)","'=]","'=D","'=-)","'=-]","'=-D"],name:"sweat_smile",tags:["hot"]},{description:"unamused face",emoji:"😒",emoticons:[":$",":s",":z",":S",":Z",":-$",":-s",":-z",":-S",":-Z","=$","=s","=z","=S","=Z","=-$","=-s","=-z","=-S","=-Z"],name:"unamused",tags:["meh"]},{description:"winking face",emoji:"😉",emoticons:[";)",";]",";D",";-)",";-]",";-D"],name:"wink",tags:["flirt"]}],x=/:\+1:|:-1:|:[\w-]+:/g,b=/(^|\s)[@$|*'",;.=:\-)([\]\\/<>038BOopPsSdDxXzZ]{2,5}/g,k=/(?:_|-(?!1))/g,X={padSpaceAfter:!1,emoticon:!1,accessible:!1},T=f=>{const t=Object.assign({},X,f),r=!!t.padSpaceAfter,u=!!t.emoticon,g=!!t.accessible;function d(e,i){return{type:"text",value:e,data:{hName:"span",hProperties:{role:"img",ariaLabel:i},hChildren:[{type:"text",value:e}]}}}function D(e){const i=s.find(o=>o.emoticons.includes(e)),n=s.find(o=>o.emoticons.includes(e.slice(0,-1))),a=s.find(o=>o.emoticons.includes(e.slice(1))),c=s.find(o=>o.emoticons.includes(e.slice(1,-1))),m=i||n||a||c;if(!m)return!1;const w=!(i||a)&&(c||n)?e.slice(-1):"",y=!(i||n)&&(c||a)?e.slice(0,1):"",_=r?" ":"",l=y+m.emoji+_+w;return g?d(l,m.name+" emoticon"):l}function h(e){let i=O(e);if(typeof i>"u")return!1;if(r&&(i=i+" "),g){const n=e.slice(1,-1).replace(k," ")+" emoji";return d(i,n)}return i}const p=[[x,h]];u&&p.push([b,D]);function j(e){P(e,p)}return j};export{T as default};
1
+ import{get as O}from"./index.DfIRibXG.js";import{I as P}from"./index.CqTPbV5Y.js";const s=[{description:"angry face",emoji:"😠",emoticons:[">:(",">:[",">:-(",">:-[",">=(",">=[",">=-(",">=-["],name:"angry",tags:["mad","annoyed"]},{description:"smiling face with smiling eyes",emoji:"😊",emoticons:[':")',':"]',':"D',':-")',':-"]',':-"D','=")','="]','="D','=-")','=-"]','=-"D'],name:"blush",tags:["proud"]},{description:"broken heart",emoji:"💔",emoticons:["<\\3","</3"],name:"broken_heart",tags:[]},{description:"confused face",emoji:"😕",emoticons:[":/",":\\",":-/",":-\\","=/","=\\","=-/","=-\\"],name:"confused",tags:[]},{description:"crying face",emoji:"😢",emoticons:[":,(",":,[",":,|",":,-(",":,-[",":,-|",":'(",":'[",":'|",":'-(",":'-[",":'-|","=,(","=,[","=,|","=,-(","=,-[","=,-|","='(","='[","='|","='-(","='-[","='-|","T-T"],name:"cry",tags:["sad","tear"]},{description:"frowning face with open mouth",emoji:"😦",emoticons:[":(",":[",":-(",":-[","=(","=[","=-(","=-["],name:"frowning",tags:[]},{description:"red heart",emoji:"❤️",emoticons:["<3"],name:"heart",tags:["love"]},{description:"angry face with horns",emoji:"👿",emoticons:["]:(","]:[","]:-(","]:-[","]=(","]=[","]=-(","]=-["],name:"imp",tags:["angry","devil","evil","horns"]},{description:"smiling face with halo",emoji:"😇",emoticons:["o:)","o:]","o:D","o:-)","o:-]","o:-D","o=)","o=]","o=D","o=-)","o=-]","o=-D","O:)","O:]","O:D","O:-)","O:-]","O:-D","O=)","O=]","O=D","O=-)","O=-]","O=-D","0:)","0:]","0:D","0:-)","0:-]","0:-D","0=)","0=]","0=D","0=-)","0=-]","0=-D"],name:"innocent",tags:["angel"]},{description:"face with tears of joy",emoji:"😂",emoticons:[":,)",":,]",":,D",":,-)",":,-]",":,-D",":')",":']",":'D",":'-)",":'-]",":'-D","=,)","=,]","=,D","=,-)","=,-]","=,-D","=')","=']","='D","='-)","='-]","='-D"],name:"joy",tags:["tears"]},{description:"kissing face",emoji:"😗",emoticons:[":*",":-*","=*","=-*"],name:"kissing",tags:[]},{description:"grinning squinting face",emoji:"😆",emoticons:["x)","x]","xD","x-)","x-]","x-D","X)","X]","X-)","X-]","X-D"],name:"laughing",tags:["happy","haha"]},{description:"man",emoji:"👨",emoticons:[":3",":-3","=3","=-3",";3",";-3","x3","x-3","X3","X-3"],name:"man",tags:["mustache","father","dad"]},{description:"neutral face",emoji:"😐",emoticons:[":|",":-|","=|","=-|"],name:"neutral_face",tags:["meh"]},{description:"face without mouth",emoji:"😶",emoticons:[":-"],name:"no_mouth",tags:["mute","silence"]},{description:"face with open mouth",emoji:"😮",emoticons:[":o",":O",":0",":-o",":-O",":-0","=o","=O","=0","=-o","=-O","=-0"],name:"open_mouth",tags:["surprise","impressed","wow"]},{description:"enraged face",emoji:"😡",emoticons:[":@",":-@","=@","=-@"],name:"rage",tags:["angry"]},{description:"grinning face with smiling eyes",emoji:"😄",emoticons:[":D",":-D","=D","=-D"],name:"smile",tags:["happy","joy","laugh","pleased"]},{description:"grinning face with big eyes",emoji:"😃",emoticons:[":)",":]",":-)",":-]","=)","=]","=-)","=-]"],name:"smiley",tags:["happy","joy","haha"]},{description:"smiling face with horns",emoji:"😈",emoticons:["]:)","]:]","]:D","]:-)","]:-]","]:-D","]=)","]=]","]=D","]=-)","]=-]","]=-D"],name:"smiling_imp",tags:["devil","evil","horns"]},{description:"loudly crying face",emoji:"😭",emoticons:[":,'(",":,'[",":,'-(",":,'-[",":',(",":',[",":',-(",":',-[","=,'(","=,'[","=,'-(","=,'-[","=',(","=',[","=',-(","=',-["],name:"sob",tags:["sad","cry","bawling"]},{description:"face with tongue",emoji:"😛",emoticons:[":p",":P",":d",":-p",":-P",":-d","=p","=P","=d","=-p","=-P","=-d"],name:"stuck_out_tongue",tags:[]},{description:"squinting face with tongue",emoji:"😝",emoticons:["xP","x-p","x-P","x-d","Xp","Xd","X-p","X-P","X-d"],name:"stuck_out_tongue_closed_eyes",tags:["prank"]},{description:"winking face with tongue",emoji:"😜",emoticons:[";p",";P",";d",";-p",";-P",";-d"],name:"stuck_out_tongue_winking_eye",tags:["prank","silly"]},{description:"smiling face with sunglasses",emoji:"😎",emoticons:["8)","8]","8D","8-)","8-]","8-D","B)","B]","B-)","B-]","B-D"],name:"sunglasses",tags:["cool"]},{description:"downcast face with sweat",emoji:"😓",emoticons:[",:(",",:[",",:-(",",:-[",",=(",",=[",",=-(",",=-[","':(","':[","':-(","':-[","'=(","'=[","'=-(","'=-["],name:"sweat",tags:[]},{description:"grinning face with sweat",emoji:"😅",emoticons:[",:)",",:]",",:D",",:-)",",:-]",",:-D",",=)",",=]",",=D",",=-)",",=-]",",=-D","':)","':]","':D","':-)","':-]","':-D","'=)","'=]","'=D","'=-)","'=-]","'=-D"],name:"sweat_smile",tags:["hot"]},{description:"unamused face",emoji:"😒",emoticons:[":$",":s",":z",":S",":Z",":-$",":-s",":-z",":-S",":-Z","=$","=s","=z","=S","=Z","=-$","=-s","=-z","=-S","=-Z"],name:"unamused",tags:["meh"]},{description:"winking face",emoji:"😉",emoticons:[";)",";]",";D",";-)",";-]",";-D"],name:"wink",tags:["flirt"]}],x=/:\+1:|:-1:|:[\w-]+:/g,b=/(^|\s)[@$|*'",;.=:\-)([\]\\/<>038BOopPsSdDxXzZ]{2,5}/g,k=/(?:_|-(?!1))/g,X={padSpaceAfter:!1,emoticon:!1,accessible:!1},T=f=>{const t=Object.assign({},X,f),r=!!t.padSpaceAfter,u=!!t.emoticon,g=!!t.accessible;function d(e,i){return{type:"text",value:e,data:{hName:"span",hProperties:{role:"img",ariaLabel:i},hChildren:[{type:"text",value:e}]}}}function D(e){const i=s.find(o=>o.emoticons.includes(e)),n=s.find(o=>o.emoticons.includes(e.slice(0,-1))),a=s.find(o=>o.emoticons.includes(e.slice(1))),c=s.find(o=>o.emoticons.includes(e.slice(1,-1))),m=i||n||a||c;if(!m)return!1;const w=!(i||a)&&(c||n)?e.slice(-1):"",y=!(i||n)&&(c||a)?e.slice(0,1):"",_=r?" ":"",l=y+m.emoji+_+w;return g?d(l,m.name+" emoticon"):l}function h(e){let i=O(e);if(typeof i>"u")return!1;if(r&&(i=i+" "),g){const n=e.slice(1,-1).replace(k," ")+" emoji";return d(i,n)}return i}const p=[[x,h]];u&&p.push([b,D]);function j(e){P(e,p)}return j};export{T as default};
@@ -1 +1 @@
1
- import{av as U,j as u,aw as _,ae as z,P as h,ax as $,S as G,ay as X,k as Z,e as q,r as s,g as J,az as K,L as Q,l as oo,m as to,ab as ro,T as eo,ac as no}from"./index.DMxc2XFp.js";import{h as x}from"./moment.C3j7ZXd7.js";import{u as ao,D as so,a as io}from"./useIntlLocale.hRV75Xgj.js";import{u as lo}from"./useBasicWidgetState.Bfp6TnSw.js";import{S as co}from"./styled-components.C3R090At.js";import{E as po}from"./ErrorOutline.esm.ZJDbmVTx.js";import"./timepicker.BdhzPxrv.js";import"./possibleConstructorReturn.DD9NK1Z8.js";import"./createSuper.RBO59fEm.js";import"./input.D5oh9-aB.js";import"./base-input.o9tL8MDP.js";import"./FormClearHelper.CG2XN1_g.js";const go=({theme:o,isInSidebar:t,step:r,minTime:c,maxTime:f,disabled:p,clearable:g,error:e})=>({Popover:{props:{ignoreBoundary:t,placement:_.bottomLeft,overrides:{Body:{style:{marginTop:o.spacing.px}}}}},CalendarContainer:{style:{fontSize:o.fontSizes.sm,paddingRight:o.spacing.sm,paddingLeft:o.spacing.sm,paddingBottom:o.spacing.none,paddingTop:o.spacing.sm}},Week:{style:{fontSize:o.fontSizes.sm}},Day:{style:({$pseudoHighlighted:i,$pseudoSelected:a,$selected:C,$isHovered:y})=>({fontSize:o.fontSizes.sm,lineHeight:o.lineHeights.base,"::before":{backgroundColor:C||a||i||y?`${o.colors.darkenedBgMix15} !important`:o.colors.transparent},"::after":{borderColor:o.colors.transparent},...Z(o)&&y&&a&&!C?{color:o.colors.secondaryBg}:{}})},PrevButton:{style:()=>({display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:o.colors.transparent},":focus":{backgroundColor:o.colors.transparent,outline:0}})},NextButton:{style:()=>({display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:o.colors.transparent},":focus":{backgroundColor:o.colors.transparent,outline:0}})},Input:{props:{maskChar:null,endEnhancer:e&&u(X,{content:u(G,{source:e,allowHTML:!1}),placement:h.TOP_RIGHT,error:!0,children:u($,{content:po,size:"lg"})}),overrides:{EndEnhancer:{style:{color:e?o.colors.redTextColor:o.colors.grayTextColor,backgroundColor:o.colors.transparent}},Root:{style:({$isFocused:i})=>{const a=z(o.colors,i);return{borderLeftWidth:o.sizes.borderWidth,borderRightWidth:o.sizes.borderWidth,borderTopWidth:o.sizes.borderWidth,borderBottomWidth:o.sizes.borderWidth,paddingRight:o.spacing.twoXS,borderTopColor:a,borderRightColor:a,borderBottomColor:a,borderLeftColor:a,...e&&{backgroundColor:o.colors.redBackgroundColor}}}},ClearIcon:{props:{overrides:{Svg:{style:{color:o.colors.grayTextColor,padding:o.spacing.threeXS,height:o.sizes.clearIconSize,width:o.sizes.clearIconSize,":hover":{fill:o.colors.bodyText}}}}}},InputContainer:{style:{backgroundColor:"transparent"}},Input:{style:{fontWeight:o.fontWeights.normal,paddingRight:o.spacing.sm,paddingLeft:o.spacing.md,paddingBottom:o.spacing.sm,paddingTop:o.spacing.sm,lineHeight:o.lineHeights.inputWidget,"::placeholder":{color:o.colors.fadedText60},...e&&{color:o.colors.redTextColor}},props:{"data-testid":"stDateTimeInputField"}}}}},TimeSelectContainer:{style:{paddingTop:o.spacing.none,paddingBottom:o.spacing.none}},TimeSelectFormControl:{style:{marginBottom:o.spacing.none},props:{overrides:{Label:{component:()=>null}}}},TimeSelect:{props:{step:r,format:"24",disabled:p,nullable:g,minTime:c,maxTime:f,overrides:{Select:{props:{disabled:p,overrides:{ControlContainer:{style:({$isFocused:i})=>{const a=z(o.colors,i);return{height:o.sizes.minElementHeight,borderLeftWidth:o.sizes.borderWidth,borderRightWidth:o.sizes.borderWidth,borderTopWidth:o.sizes.borderWidth,borderBottomWidth:o.sizes.borderWidth,borderTopColor:a,borderRightColor:a,borderBottomColor:a,borderLeftColor:a}}},IconsContainer:{style:()=>({paddingRight:o.spacing.sm})},ValueContainer:{style:()=>({lineHeight:o.lineHeights.inputWidget,paddingRight:o.spacing.sm,paddingLeft:o.spacing.md,paddingBottom:o.spacing.sm,paddingTop:o.spacing.sm})},SingleValue:{style:{fontWeight:o.fontWeights.normal},props:{"data-testid":"stDateTimeInputTimeDisplay"}},Dropdown:{style:()=>({paddingTop:o.spacing.none,paddingBottom:o.spacing.none,boxShadow:"none",maxHeight:o.sizes.maxDropdownHeight})},DropdownListItem:{component:co},Popover:{props:{ignoreBoundary:t,overrides:{Body:{style:()=>({marginTop:o.spacing.px})}}}},Placeholder:{style:()=>({color:o.colors.fadedText60})},SelectArrow:{component:U,props:{overrides:{Svg:{style:()=>({width:o.iconSizes.xl,height:o.iconSizes.xl})}}}}}}}}}}}),k="YYYY/MM/DD, HH:mm",uo=(o,t)=>{const r=o.getStringArrayValue(t);return r&&r.length>0?r[0]:null},fo=o=>o.default?.length?o.default[0]:null,mo=o=>o.value?.length?o.value[0]:null,M=o=>{let t;if(Array.isArray(o)?t=o.find(c=>c instanceof Date):t=o,!t||Number.isNaN(t.getTime()))return null;const r=new Date(t.getTime());return r.setSeconds(0,0),r},b=o=>{if(q(o)||o==="")return null;const t=x(o,k,!0);return t.isValid()?M(t.toDate()):null},I=(o,t)=>o.getFullYear()===t.getFullYear()&&o.getMonth()===t.getMonth()&&o.getDate()===t.getDate(),B=(o,t)=>{const r=new Date(o.getTime());return r.setHours(t.getHours(),t.getMinutes(),0,0),r},bo=(o,t,r,c)=>{const f=b(o.min),p=b(o.max),g=e=>{t.setStringArrayValue(o,e?[e]:[],{fromUi:r.fromUi},c)};if(r.value){const e=b(r.value);if(e){f&&e<f||p&&e>p||g(r.value);return}}g(r.value)};function To({disabled:o,element:t,widgetMgr:r,fragmentId:c}){const f=J(),p=s.useContext(K),g=s.useRef(null),[e,i]=lo({getStateFromWidgetMgr:uo,getDefaultStateFromProto:fo,getCurrStateFromProto:mo,updateWidgetMgrState:bo,element:t,widgetMgr:r,fragmentId:c}),{locale:a}=s.useContext(Q),C=ao(a),y=t.step?Number(t.step):900,l=s.useMemo(()=>b(t.min),[t.min]),d=s.useMemo(()=>b(t.max),[t.max]),T=s.useMemo(()=>b(e),[e]),[n,v]=s.useState(T),[H,L]=s.useState(T);T!==H&&(v(T),L(T));const P=l??void 0,V=d??void 0,E=s.useMemo(()=>{if(!(!n||!l))return I(n,l)?B(n,l):void 0},[n,l]),R=s.useMemo(()=>{if(!(!n||!d))return I(n,d)?B(n,d):void 0},[n,d]),w=t.format.replaceAll(/[a-zA-Z]/g,"9"),D=`${t.format.replaceAll("Y","y").replaceAll("D","d")}, HH:mm`,A=`${w}, 99:99`,F=`${t.format}, HH:MM`,W=(t.default&&t.default.length>0?t.default[0]:"").length===0&&!o,O=s.useMemo(()=>{if(!n)return null;if(l&&n<l||d&&n>d){const m=x(l).format(D),S=x(d).format(D);return`**Error**: Date and time set outside allowed range. Please select a date and time between ${m} and ${S}.`}return null},[n,l,d,D]),N=s.useCallback(({date:m})=>{const S=M(m);v(S),g.current?.open?.()},[]),Y=s.useCallback(()=>{const m=n?x(n).format(k):null;m!==e&&i({value:m,fromUi:!0})},[n,e,i]),j=go({theme:f,isInSidebar:p,step:y,minTime:E,maxTime:R,disabled:o,clearable:W,error:O});return oo("div",{className:"stDateTimeInput","data-testid":"stDateTimeInput",children:[u(no,{label:t.label,disabled:o,labelVisibility:to(t.labelVisibility?.value),children:t.help&&u(ro,{children:u(eo,{content:t.help,placement:h.TOP_RIGHT})})}),u(io,{ref:g,locale:C,density:so.high,value:n,onChange:N,onClose:Y,minDate:P,maxDate:V,disabled:o,timeSelectStart:!0,formatString:D,mask:A,placeholder:F,clearable:W,overrides:j,"aria-label":t.label})]})}const Lo=s.memo(To);export{Lo as default};
1
+ import{av as U,j as u,aw as _,ae as z,P as h,ax as $,S as G,ay as X,k as Z,e as q,r as s,g as J,az as K,L as Q,l as oo,m as to,ab as ro,T as eo,ac as no}from"./index.CqTPbV5Y.js";import{h as x}from"./moment.C3j7ZXd7.js";import{u as ao,D as so,a as io}from"./useIntlLocale.BSq6SANa.js";import{u as lo}from"./useBasicWidgetState.DA3_qaXD.js";import{S as co}from"./styled-components.e0V96rJw.js";import{E as po}from"./ErrorOutline.esm.sMJdFExW.js";import"./timepicker.Bpn70xGc.js";import"./possibleConstructorReturn.C_51n46K.js";import"./createSuper.OIgV8wc-.js";import"./input.CcvrgErO.js";import"./base-input.BXTqYbyG.js";import"./FormClearHelper.-9RbsnV0.js";const go=({theme:o,isInSidebar:t,step:r,minTime:c,maxTime:f,disabled:p,clearable:g,error:e})=>({Popover:{props:{ignoreBoundary:t,placement:_.bottomLeft,overrides:{Body:{style:{marginTop:o.spacing.px}}}}},CalendarContainer:{style:{fontSize:o.fontSizes.sm,paddingRight:o.spacing.sm,paddingLeft:o.spacing.sm,paddingBottom:o.spacing.none,paddingTop:o.spacing.sm}},Week:{style:{fontSize:o.fontSizes.sm}},Day:{style:({$pseudoHighlighted:i,$pseudoSelected:a,$selected:C,$isHovered:y})=>({fontSize:o.fontSizes.sm,lineHeight:o.lineHeights.base,"::before":{backgroundColor:C||a||i||y?`${o.colors.darkenedBgMix15} !important`:o.colors.transparent},"::after":{borderColor:o.colors.transparent},...Z(o)&&y&&a&&!C?{color:o.colors.secondaryBg}:{}})},PrevButton:{style:()=>({display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:o.colors.transparent},":focus":{backgroundColor:o.colors.transparent,outline:0}})},NextButton:{style:()=>({display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:o.colors.transparent},":focus":{backgroundColor:o.colors.transparent,outline:0}})},Input:{props:{maskChar:null,endEnhancer:e&&u(X,{content:u(G,{source:e,allowHTML:!1}),placement:h.TOP_RIGHT,error:!0,children:u($,{content:po,size:"lg"})}),overrides:{EndEnhancer:{style:{color:e?o.colors.redTextColor:o.colors.grayTextColor,backgroundColor:o.colors.transparent}},Root:{style:({$isFocused:i})=>{const a=z(o.colors,i);return{borderLeftWidth:o.sizes.borderWidth,borderRightWidth:o.sizes.borderWidth,borderTopWidth:o.sizes.borderWidth,borderBottomWidth:o.sizes.borderWidth,paddingRight:o.spacing.twoXS,borderTopColor:a,borderRightColor:a,borderBottomColor:a,borderLeftColor:a,...e&&{backgroundColor:o.colors.redBackgroundColor}}}},ClearIcon:{props:{overrides:{Svg:{style:{color:o.colors.grayTextColor,padding:o.spacing.threeXS,height:o.sizes.clearIconSize,width:o.sizes.clearIconSize,":hover":{fill:o.colors.bodyText}}}}}},InputContainer:{style:{backgroundColor:"transparent"}},Input:{style:{fontWeight:o.fontWeights.normal,paddingRight:o.spacing.sm,paddingLeft:o.spacing.md,paddingBottom:o.spacing.sm,paddingTop:o.spacing.sm,lineHeight:o.lineHeights.inputWidget,"::placeholder":{color:o.colors.fadedText60},...e&&{color:o.colors.redTextColor}},props:{"data-testid":"stDateTimeInputField"}}}}},TimeSelectContainer:{style:{paddingTop:o.spacing.none,paddingBottom:o.spacing.none}},TimeSelectFormControl:{style:{marginBottom:o.spacing.none},props:{overrides:{Label:{component:()=>null}}}},TimeSelect:{props:{step:r,format:"24",disabled:p,nullable:g,minTime:c,maxTime:f,overrides:{Select:{props:{disabled:p,overrides:{ControlContainer:{style:({$isFocused:i})=>{const a=z(o.colors,i);return{height:o.sizes.minElementHeight,borderLeftWidth:o.sizes.borderWidth,borderRightWidth:o.sizes.borderWidth,borderTopWidth:o.sizes.borderWidth,borderBottomWidth:o.sizes.borderWidth,borderTopColor:a,borderRightColor:a,borderBottomColor:a,borderLeftColor:a}}},IconsContainer:{style:()=>({paddingRight:o.spacing.sm})},ValueContainer:{style:()=>({lineHeight:o.lineHeights.inputWidget,paddingRight:o.spacing.sm,paddingLeft:o.spacing.md,paddingBottom:o.spacing.sm,paddingTop:o.spacing.sm})},SingleValue:{style:{fontWeight:o.fontWeights.normal},props:{"data-testid":"stDateTimeInputTimeDisplay"}},Dropdown:{style:()=>({paddingTop:o.spacing.none,paddingBottom:o.spacing.none,boxShadow:"none",maxHeight:o.sizes.maxDropdownHeight})},DropdownListItem:{component:co},Popover:{props:{ignoreBoundary:t,overrides:{Body:{style:()=>({marginTop:o.spacing.px})}}}},Placeholder:{style:()=>({color:o.colors.fadedText60})},SelectArrow:{component:U,props:{overrides:{Svg:{style:()=>({width:o.iconSizes.xl,height:o.iconSizes.xl})}}}}}}}}}}}),k="YYYY/MM/DD, HH:mm",uo=(o,t)=>{const r=o.getStringArrayValue(t);return r&&r.length>0?r[0]:null},fo=o=>o.default?.length?o.default[0]:null,mo=o=>o.value?.length?o.value[0]:null,M=o=>{let t;if(Array.isArray(o)?t=o.find(c=>c instanceof Date):t=o,!t||Number.isNaN(t.getTime()))return null;const r=new Date(t.getTime());return r.setSeconds(0,0),r},b=o=>{if(q(o)||o==="")return null;const t=x(o,k,!0);return t.isValid()?M(t.toDate()):null},I=(o,t)=>o.getFullYear()===t.getFullYear()&&o.getMonth()===t.getMonth()&&o.getDate()===t.getDate(),B=(o,t)=>{const r=new Date(o.getTime());return r.setHours(t.getHours(),t.getMinutes(),0,0),r},bo=(o,t,r,c)=>{const f=b(o.min),p=b(o.max),g=e=>{t.setStringArrayValue(o,e?[e]:[],{fromUi:r.fromUi},c)};if(r.value){const e=b(r.value);if(e){f&&e<f||p&&e>p||g(r.value);return}}g(r.value)};function To({disabled:o,element:t,widgetMgr:r,fragmentId:c}){const f=J(),p=s.useContext(K),g=s.useRef(null),[e,i]=lo({getStateFromWidgetMgr:uo,getDefaultStateFromProto:fo,getCurrStateFromProto:mo,updateWidgetMgrState:bo,element:t,widgetMgr:r,fragmentId:c}),{locale:a}=s.useContext(Q),C=ao(a),y=t.step?Number(t.step):900,l=s.useMemo(()=>b(t.min),[t.min]),d=s.useMemo(()=>b(t.max),[t.max]),T=s.useMemo(()=>b(e),[e]),[n,v]=s.useState(T),[H,L]=s.useState(T);T!==H&&(v(T),L(T));const P=l??void 0,V=d??void 0,E=s.useMemo(()=>{if(!(!n||!l))return I(n,l)?B(n,l):void 0},[n,l]),R=s.useMemo(()=>{if(!(!n||!d))return I(n,d)?B(n,d):void 0},[n,d]),w=t.format.replaceAll(/[a-zA-Z]/g,"9"),D=`${t.format.replaceAll("Y","y").replaceAll("D","d")}, HH:mm`,A=`${w}, 99:99`,F=`${t.format}, HH:MM`,W=(t.default&&t.default.length>0?t.default[0]:"").length===0&&!o,O=s.useMemo(()=>{if(!n)return null;if(l&&n<l||d&&n>d){const m=x(l).format(D),S=x(d).format(D);return`**Error**: Date and time set outside allowed range. Please select a date and time between ${m} and ${S}.`}return null},[n,l,d,D]),N=s.useCallback(({date:m})=>{const S=M(m);v(S),g.current?.open?.()},[]),Y=s.useCallback(()=>{const m=n?x(n).format(k):null;m!==e&&i({value:m,fromUi:!0})},[n,e,i]),j=go({theme:f,isInSidebar:p,step:y,minTime:E,maxTime:R,disabled:o,clearable:W,error:O});return oo("div",{className:"stDateTimeInput","data-testid":"stDateTimeInput",children:[u(no,{label:t.label,disabled:o,labelVisibility:to(t.labelVisibility?.value),children:t.help&&u(ro,{children:u(eo,{content:t.help,placement:h.TOP_RIGHT})})}),u(io,{ref:g,locale:C,density:so.high,value:n,onChange:N,onClose:Y,minDate:P,maxDate:V,disabled:o,timeSelectStart:!0,formatString:D,mask:A,placeholder:F,clearable:W,overrides:j,"aria-label":t.label})]})}const Lo=s.memo(To);export{Lo as default};
@@ -1 +1 @@
1
- import{r as s,E as G,_ as P,g as Q,e as I,N as K,M as Y,bj as L,bk as M,bl as Z,bm as q,n as H,bn as j,Q as U,R as ee,f as te,b3 as ne,bo as re,j as A,l as se,aG as oe}from"./index.DMxc2XFp.js";import{w as ae,E as ie}from"./withFullScreenWrapper.CrHddARq.js";import{a as k,S as _,T as ce}from"./Toolbar.B2qFUmd9.js";import{R as le}from"./index.C_rK-Swb.js";import{a as J,c as ue,b as fe,e as de,t as me,S as he,d as pe}from"./embed.XT9xNd3F.js";import{u as ge}from"./FormClearHelper.CG2XN1_g.js";import"./moment.C3j7ZXd7.js";import"./pandasStylerUtils.BqhXt51_.js";import"./_baseIndexOf.BTknn6Gb.js";import"./sprintf.D7DtBTRn.js";import"./index.8HslT92O.js";import"./main.q9oGOg0H.js";import"./throttle.B0GR3Iyz.js";import"./checkbox.0BeV1IBL.js";import"./createDownloadLinkElement.ZaXNnPK4.js";import"./toConsumableArray.Db2pdqM2.js";import"./possibleConstructorReturn.DD9NK1Z8.js";import"./createSuper.RBO59fEm.js";import"./FileDownload.esm.Dx0vI3vH.js";import"./_arrayIncludes.B19Iyn2B.js";import"./threshold.Q1mXg5rX.js";import"./value.B4vHRSi7.js";import"./timer.C2hYhUse.js";var B=s.forwardRef(function(n,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(G,P({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),s.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),s.createElement("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM7 10h2v7H7zm4-3h2v10h-2zm4 6h2v4h-2z"}))});B.displayName="InsertChart";var $=s.forwardRef(function(n,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(G,P({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),s.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),s.createElement("path",{d:"M20 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h15c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 2v3H5V5h15zm-5 14h-5v-9h5v9zM5 10h3v9H5v-9zm12 9v-9h3v9h-3z"}))});$.displayName="TableChart";const Se=20;function ye(n){"params"in n&&"encoding"in n&&n.params.forEach(t=>{"select"in t&&(["interval","point"].includes(t.select)&&(t.select={type:t.select}),"type"in t.select&&t.select.type==="point"&&!("encodings"in t.select)&&I(t.select.encodings)&&(t.select.encodings=Object.keys(n.encoding)))})}const be=(n,t,o,r,u,c,l,h)=>{const e=JSON.parse(n);if(r==="streamlit"?e.config=J(e.config,c):e.usermeta?.embedOptions?.theme==="streamlit"?(e.config=J(e.config,c),e.usermeta.embedOptions.theme=void 0):e.config=ue(e.config,c),e.title&&(typeof e.title=="string"&&(e.title={text:e.title}),e.title.limit=e.title.limit??Math.max(l-40,0)),o&&(e.height=h),t&&(e.width=l,"vconcat"in e&&e.vconcat.forEach(f=>{f.width=l})),e.padding||(e.padding={}),I(e.padding.bottom)&&(e.padding.bottom=Se),e.datasets)throw new Error("Datasets should not be passed as part of the spec");return u.length>0&&ye(e),e},we=(n,t,o,r,u)=>{const c=Q(),{id:l,formId:h,spec:e,data:f,datasets:a,vegaLiteTheme:d,selectionMode:i}=n,p=s.useMemo(()=>i,[JSON.stringify(i)]),S=s.useMemo(()=>be(e,r,u,d,p,c,t,o),[e,r,u,d,p,c,t,o]);return{id:l,formId:h,vegaLiteTheme:d,spec:S,selectionMode:p,data:f,datasets:a,useContainerWidth:r}},Ce={DATAFRAME_INDEX:"(index)"};function Ee(n){return!n||n.dimensions.numDataRows===0?null:z(n)}function Ve(n){const t=F(n);if(I(t))return null;const o={};for(const[r,u]of Object.entries(t))o[r]=z(u);return o}function F(n){if(n?.length===0)return null;const t={};return n.forEach(o=>{if(!o)return;const r=o.hasName?o.name:null;t[r]=o.data}),t}function z(n,t=0){if(n.dimensions.numDataRows===0)return[];const o=[],{numDataRows:r,numDataColumns:u,numIndexColumns:c}=n.dimensions,l=n.columnTypes[0]??void 0,h=l&&l.type===K.INDEX&&(Y(l)||L(l)||M(l));for(let e=t;e<r;e++){const f={};if(h){const{content:a}=n.getCell(e,0);f[Ce.DATAFRAME_INDEX]=typeof a=="bigint"?Number(a):a}for(let a=0;a<u;a++){const d=a+c,{content:i,contentType:p}=n.getCell(e,d);if((i instanceof Date||typeof i=="number"&&Number.isFinite(i))&&(L(p)||M(p))&&!Z(p)){const S=new Date(i).getTimezoneOffset()*60*1e3;f[n.columnNames[0][d]]=i.valueOf()+S}else f[n.columnNames[0][d]]=typeof i=="bigint"?Number(i):i}o.push(f)}return o}const ve=150,De=U.getLogger("useVegaLiteSelections"),Ne=(n,t,o)=>{const{id:r,formId:u,selectionMode:c}=n,l=s.useCallback(e=>{c.forEach(a=>{e.addSignalListener(a,q(ve,(d,i)=>{const p=e.getState({data:(C,O)=>c.some(g=>`${g}_store`===C),recurse:!1});H(p)&&t.setElementState(r,"viewState",p);let S=i;"vlPoint"in i&&"or"in i.vlPoint&&(S=i.vlPoint.or);const D={id:r,formId:u},V=JSON.parse(t.getStringValue(D)||"{}"),v={selection:{...V?.selection||{},[d]:S||{}}};j(V,v)||t.setStringValue(D,JSON.stringify(v),{fromUi:!0},o)}))});const f=t.getElementState(r,"viewState");if(H(f))try{return e.setState(f)}catch(a){De.warn("Failed to restore view state",a)}return e},[r,c,t,u,o]),h=s.useCallback(()=>{const e={selection:{}};c.forEach(i=>{e.selection[i]={}});const f={id:r,formId:u},a=t.getStringValue(f),d=a?JSON.parse(a):e;j(d,e)||t.setStringValue(f,JSON.stringify(e),{fromUi:!0},o)},[r,u,o,c,t]);return{maybeConfigureSelections:l,onFormCleared:h}},W="source",Te=U.getLogger("useVegaEmbed");function Oe(n,t,o){const r=s.useRef(null),u=s.useRef(null),c=s.useRef(W),l=s.useRef(null),h=s.useRef([]),e=s.useRef(null),f=s.useRef([]),[a,d]=s.useState(!1),{maybeConfigureSelections:i,onFormCleared:p}=Ne(n,t,o);ge({widgetMgr:t,element:n,onFormCleared:p});const{data:S,datasets:D}=n;s.useEffect(()=>{e.current=S,f.current=D,r.current===null&&(l.current=S,h.current=D)},[S,D]);const V=s.useCallback(()=>{u.current&&u.current(),u.current=null,r.current=null},[]),v=s.useCallback(async(g,y)=>{if(g.current===null)throw new Error("Element missing.");d(!0);try{V();const b={ast:!0,expr:fe,tooltip:{disableDefaultStyle:!0},defaultStyle:!1,forceActionsMenu:!0},{vgSpec:w,view:T,finalize:E}=await de(g.current,y,b);r.current=i(T),u.current=E;const m=Ve(f.current),N=m?Object.keys(m):[];if(N.length===1){const[x]=N;c.current=x}else N.length===0&&w.data&&(c.current=W);const R=Ee(e.current);if(R&&r.current.insert(c.current,R),m)for(const[x,X]of Object.entries(m))r.current.insert(x,X);return await r.current.runAsync(),await r.current.resize().runAsync(),l.current=e.current,h.current=f.current,r.current}finally{d(!1)}},[V,i]),C=s.useCallback((g,y,b,w)=>{if(!w||w.dimensions.numDataRows===0){try{g.remove(y,me)}catch{}return}if(!b||b.dimensions.numDataRows===0){g.insert(y,z(w));return}w.hash!==b.hash&&(g.data(y,z(w)),Te.info(`Had to clear the ${y} dataset before inserting data through Vega view.`))},[]),O=s.useCallback(async(g,y)=>{if(r.current===null||a)return null;const b=l.current,w=h.current;(b||g)&&C(r.current,c.current,b,g);const T=F(w)??{},E=F(y)??{};for(const[m,N]of Object.entries(E)){const R=m||c.current,x=T[R];C(r.current,R,x,N)}for(const m of Object.keys(T))!Object.hasOwn(E,m)&&m!==c.current&&C(r.current,m,null,null);return await r.current?.resize().runAsync(),l.current=g,h.current=y,r.current},[C,a]);return{createView:v,updateView:O,finalizeView:V}}function Ae(n){try{const t=typeof n=="string"?JSON.parse(n):n;return!!(t.facet||t.encoding?.row||t.encoding?.column||t.encoding?.facet)}catch{return!1}}const Re=({disableFullscreenMode:n,element:t,fragmentId:o,widgetMgr:r,widthConfig:u,heightConfig:c})=>{const[l,h]=s.useState(!1),[e,f]=s.useState(!1),{expanded:a,height:d,width:i,expand:p,collapse:S}=ee(ie),{width:D,height:V,elementRef:v}=te([l],0),C=ne(u)||t.useContainerWidth,O=re(c),g=Ae(t.spec),y=we(t,g?i??0:D,(a?d:V)??0,a?!0:C,a?!0:O),{createView:b,updateView:w,finalizeView:T}=Oe(y,r,o),{data:E,datasets:m,spec:N}=y;return s.useLayoutEffect(()=>(v.current!==null&&b(v,N),T),[b,T,N,i,d,l,v]),s.useEffect(()=>{w(E,m)},[E,m]),s.useEffect(()=>{E||m?.[0]?.data?f(!0):f(!1)},[E,m]),l?A(le,{data:E??m[0]?.data,height:d??V??void 0,width:u??void 0,customToolbarActions:[A(k,{label:"Show chart",icon:B,onClick:()=>{h(!1)}},"show-chart")]}):se(_,{height:O?a?d:"100%":d,useContainerWidth:a?!0:C,children:[A(ce,{target:_,isFullScreen:a,onExpand:p,onCollapse:S,disableFullscreenMode:n,children:e&&A(k,{label:"Show data",icon:$,onClick:()=>{h(!0)}})}),A(oe,{styles:[he]}),A(pe,{"data-testid":"stVegaLiteChart",className:"stVegaLiteChart",useContainerWidth:C,useContainerHeight:O,ref:v})]})},xe=ae(Re),tt=s.memo(xe);export{he as StyledVegaLiteChartTooltips,J as applyStreamlitTheme,tt as default};
1
+ import{r as s,E as G,_ as P,g as Q,e as I,N as K,M as Y,bj as L,bk as M,bl as Z,bm as q,n as H,bn as j,Q as U,R as ee,f as te,b3 as ne,bo as re,j as A,l as se,aG as oe}from"./index.CqTPbV5Y.js";import{w as ae,E as ie}from"./withFullScreenWrapper.7j_lzlaF.js";import{a as k,S as _,T as ce}from"./Toolbar.DMgU0Vgw.js";import{R as le}from"./index.Buc7XrOl.js";import{a as J,c as ue,b as fe,e as de,t as me,S as he,d as pe}from"./embed.HKcgTiLB.js";import{u as ge}from"./FormClearHelper.-9RbsnV0.js";import"./moment.C3j7ZXd7.js";import"./pandasStylerUtils.DqP0h70z.js";import"./_baseIndexOf.BTknn6Gb.js";import"./sprintf.D7DtBTRn.js";import"./index.8HslT92O.js";import"./main.eVHOp4Th.js";import"./throttle.D3b5WILl.js";import"./checkbox.5xWaqPqm.js";import"./createDownloadLinkElement.ZaXNnPK4.js";import"./toConsumableArray.DIN_ys1J.js";import"./possibleConstructorReturn.C_51n46K.js";import"./createSuper.OIgV8wc-.js";import"./FileDownload.esm.CV-WYqBn.js";import"./_arrayIncludes.B19Iyn2B.js";import"./threshold.Q1mXg5rX.js";import"./value.B4vHRSi7.js";import"./timer.C2hYhUse.js";var B=s.forwardRef(function(n,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(G,P({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),s.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),s.createElement("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM7 10h2v7H7zm4-3h2v10h-2zm4 6h2v4h-2z"}))});B.displayName="InsertChart";var $=s.forwardRef(function(n,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(G,P({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),s.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),s.createElement("path",{d:"M20 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h15c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 2v3H5V5h15zm-5 14h-5v-9h5v9zM5 10h3v9H5v-9zm12 9v-9h3v9h-3z"}))});$.displayName="TableChart";const Se=20;function ye(n){"params"in n&&"encoding"in n&&n.params.forEach(t=>{"select"in t&&(["interval","point"].includes(t.select)&&(t.select={type:t.select}),"type"in t.select&&t.select.type==="point"&&!("encodings"in t.select)&&I(t.select.encodings)&&(t.select.encodings=Object.keys(n.encoding)))})}const be=(n,t,o,r,u,c,l,h)=>{const e=JSON.parse(n);if(r==="streamlit"?e.config=J(e.config,c):e.usermeta?.embedOptions?.theme==="streamlit"?(e.config=J(e.config,c),e.usermeta.embedOptions.theme=void 0):e.config=ue(e.config,c),e.title&&(typeof e.title=="string"&&(e.title={text:e.title}),e.title.limit=e.title.limit??Math.max(l-40,0)),o&&(e.height=h),t&&(e.width=l,"vconcat"in e&&e.vconcat.forEach(f=>{f.width=l})),e.padding||(e.padding={}),I(e.padding.bottom)&&(e.padding.bottom=Se),e.datasets)throw new Error("Datasets should not be passed as part of the spec");return u.length>0&&ye(e),e},we=(n,t,o,r,u)=>{const c=Q(),{id:l,formId:h,spec:e,data:f,datasets:a,vegaLiteTheme:d,selectionMode:i}=n,p=s.useMemo(()=>i,[JSON.stringify(i)]),S=s.useMemo(()=>be(e,r,u,d,p,c,t,o),[e,r,u,d,p,c,t,o]);return{id:l,formId:h,vegaLiteTheme:d,spec:S,selectionMode:p,data:f,datasets:a,useContainerWidth:r}},Ce={DATAFRAME_INDEX:"(index)"};function Ee(n){return!n||n.dimensions.numDataRows===0?null:z(n)}function Ve(n){const t=F(n);if(I(t))return null;const o={};for(const[r,u]of Object.entries(t))o[r]=z(u);return o}function F(n){if(n?.length===0)return null;const t={};return n.forEach(o=>{if(!o)return;const r=o.hasName?o.name:null;t[r]=o.data}),t}function z(n,t=0){if(n.dimensions.numDataRows===0)return[];const o=[],{numDataRows:r,numDataColumns:u,numIndexColumns:c}=n.dimensions,l=n.columnTypes[0]??void 0,h=l&&l.type===K.INDEX&&(Y(l)||L(l)||M(l));for(let e=t;e<r;e++){const f={};if(h){const{content:a}=n.getCell(e,0);f[Ce.DATAFRAME_INDEX]=typeof a=="bigint"?Number(a):a}for(let a=0;a<u;a++){const d=a+c,{content:i,contentType:p}=n.getCell(e,d);if((i instanceof Date||typeof i=="number"&&Number.isFinite(i))&&(L(p)||M(p))&&!Z(p)){const S=new Date(i).getTimezoneOffset()*60*1e3;f[n.columnNames[0][d]]=i.valueOf()+S}else f[n.columnNames[0][d]]=typeof i=="bigint"?Number(i):i}o.push(f)}return o}const ve=150,De=U.getLogger("useVegaLiteSelections"),Ne=(n,t,o)=>{const{id:r,formId:u,selectionMode:c}=n,l=s.useCallback(e=>{c.forEach(a=>{e.addSignalListener(a,q(ve,(d,i)=>{const p=e.getState({data:(C,O)=>c.some(g=>`${g}_store`===C),recurse:!1});H(p)&&t.setElementState(r,"viewState",p);let S=i;"vlPoint"in i&&"or"in i.vlPoint&&(S=i.vlPoint.or);const D={id:r,formId:u},V=JSON.parse(t.getStringValue(D)||"{}"),v={selection:{...V?.selection||{},[d]:S||{}}};j(V,v)||t.setStringValue(D,JSON.stringify(v),{fromUi:!0},o)}))});const f=t.getElementState(r,"viewState");if(H(f))try{return e.setState(f)}catch(a){De.warn("Failed to restore view state",a)}return e},[r,c,t,u,o]),h=s.useCallback(()=>{const e={selection:{}};c.forEach(i=>{e.selection[i]={}});const f={id:r,formId:u},a=t.getStringValue(f),d=a?JSON.parse(a):e;j(d,e)||t.setStringValue(f,JSON.stringify(e),{fromUi:!0},o)},[r,u,o,c,t]);return{maybeConfigureSelections:l,onFormCleared:h}},W="source",Te=U.getLogger("useVegaEmbed");function Oe(n,t,o){const r=s.useRef(null),u=s.useRef(null),c=s.useRef(W),l=s.useRef(null),h=s.useRef([]),e=s.useRef(null),f=s.useRef([]),[a,d]=s.useState(!1),{maybeConfigureSelections:i,onFormCleared:p}=Ne(n,t,o);ge({widgetMgr:t,element:n,onFormCleared:p});const{data:S,datasets:D}=n;s.useEffect(()=>{e.current=S,f.current=D,r.current===null&&(l.current=S,h.current=D)},[S,D]);const V=s.useCallback(()=>{u.current&&u.current(),u.current=null,r.current=null},[]),v=s.useCallback(async(g,y)=>{if(g.current===null)throw new Error("Element missing.");d(!0);try{V();const b={ast:!0,expr:fe,tooltip:{disableDefaultStyle:!0},defaultStyle:!1,forceActionsMenu:!0},{vgSpec:w,view:T,finalize:E}=await de(g.current,y,b);r.current=i(T),u.current=E;const m=Ve(f.current),N=m?Object.keys(m):[];if(N.length===1){const[x]=N;c.current=x}else N.length===0&&w.data&&(c.current=W);const R=Ee(e.current);if(R&&r.current.insert(c.current,R),m)for(const[x,X]of Object.entries(m))r.current.insert(x,X);return await r.current.runAsync(),await r.current.resize().runAsync(),l.current=e.current,h.current=f.current,r.current}finally{d(!1)}},[V,i]),C=s.useCallback((g,y,b,w)=>{if(!w||w.dimensions.numDataRows===0){try{g.remove(y,me)}catch{}return}if(!b||b.dimensions.numDataRows===0){g.insert(y,z(w));return}w.hash!==b.hash&&(g.data(y,z(w)),Te.info(`Had to clear the ${y} dataset before inserting data through Vega view.`))},[]),O=s.useCallback(async(g,y)=>{if(r.current===null||a)return null;const b=l.current,w=h.current;(b||g)&&C(r.current,c.current,b,g);const T=F(w)??{},E=F(y)??{};for(const[m,N]of Object.entries(E)){const R=m||c.current,x=T[R];C(r.current,R,x,N)}for(const m of Object.keys(T))!Object.hasOwn(E,m)&&m!==c.current&&C(r.current,m,null,null);return await r.current?.resize().runAsync(),l.current=g,h.current=y,r.current},[C,a]);return{createView:v,updateView:O,finalizeView:V}}function Ae(n){try{const t=typeof n=="string"?JSON.parse(n):n;return!!(t.facet||t.encoding?.row||t.encoding?.column||t.encoding?.facet)}catch{return!1}}const Re=({disableFullscreenMode:n,element:t,fragmentId:o,widgetMgr:r,widthConfig:u,heightConfig:c})=>{const[l,h]=s.useState(!1),[e,f]=s.useState(!1),{expanded:a,height:d,width:i,expand:p,collapse:S}=ee(ie),{width:D,height:V,elementRef:v}=te([l],0),C=ne(u)||t.useContainerWidth,O=re(c),g=Ae(t.spec),y=we(t,g?i??0:D,(a?d:V)??0,a?!0:C,a?!0:O),{createView:b,updateView:w,finalizeView:T}=Oe(y,r,o),{data:E,datasets:m,spec:N}=y;return s.useLayoutEffect(()=>(v.current!==null&&b(v,N),T),[b,T,N,i,d,l,v]),s.useEffect(()=>{w(E,m)},[E,m]),s.useEffect(()=>{E||m?.[0]?.data?f(!0):f(!1)},[E,m]),l?A(le,{data:E??m[0]?.data,height:d??V??void 0,width:u??void 0,customToolbarActions:[A(k,{label:"Show chart",icon:B,onClick:()=>{h(!1)}},"show-chart")]}):se(_,{height:O?a?d:"100%":d,useContainerWidth:a?!0:C,children:[A(ce,{target:_,isFullScreen:a,onExpand:p,onCollapse:S,disableFullscreenMode:n,children:e&&A(k,{label:"Show data",icon:$,onClick:()=>{h(!0)}})}),A(oe,{styles:[he]}),A(pe,{"data-testid":"stVegaLiteChart",className:"stVegaLiteChart",useContainerWidth:C,useContainerHeight:O,ref:v})]})},xe=ae(Re),tt=s.memo(xe);export{he as StyledVegaLiteChartTooltips,J as applyStreamlitTheme,tt as default};
@@ -1,4 +1,4 @@
1
- import{Q,e as Z,bt as me,bu as ge,x as he,r as d,g as ye,bv as V,aj as I,j as A,X as pe,bw as H,bx as Ee,a1 as be,a2 as Fe,l as Ce,a0 as we,W as Ne,n as Oe}from"./index.DMxc2XFp.js";import{by as tr}from"./index.DMxc2XFp.js";import{w as Se}from"./withCalculatedWidth.DcKeRSWJ.js";import{C as W,a as Y}from"./urls.BwSlolu9.js";import{D as Ae,a as Re}from"./IFrameUtil.DefezniK.js";const v="%[a-f0-9]{2}",G=new RegExp("("+v+")|([^%]+?)","gi"),B=new RegExp("("+v+")+","gi");function T(e,r){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;r=r||1;const t=e.slice(0,r),n=e.slice(r);return Array.prototype.concat.call([],T(t),T(n))}function _e(e){try{return decodeURIComponent(e)}catch{let r=e.match(G)||[];for(let t=1;t<r.length;t++)e=T(r,t).join(""),r=e.match(G)||[];return e}}function Ie(e){const r={"%FE%FF":"��","%FF%FE":"��"};let t=B.exec(e);for(;t;){try{r[t[0]]=decodeURIComponent(t[0])}catch{const a=_e(t[0]);a!==t[0]&&(r[t[0]]=a)}t=B.exec(e)}r["%C2"]="�";const n=Object.keys(r);for(const a of n)e=e.replace(new RegExp(a,"g"),r[a]);return e}function Te(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return Ie(e)}}function Ue(e,r){const t={};if(Array.isArray(r))for(const n of r){const a=Object.getOwnPropertyDescriptor(e,n);a?.enumerable&&Object.defineProperty(t,n,a)}else for(const n of Reflect.ownKeys(e)){const a=Object.getOwnPropertyDescriptor(e,n);if(a.enumerable){const s=e[n];r(n,s,e)&&Object.defineProperty(t,n,a)}}return t}function ee(e,r){if(!(typeof e=="string"&&typeof r=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e===""||r==="")return[];const t=e.indexOf(r);return t===-1?[]:[e.slice(0,t),e.slice(t+r.length)]}const xe=e=>e==null,$e=e=>encodeURIComponent(e).replaceAll(/[!'()*]/g,r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`),U=Symbol("encodeFragmentIdentifier");function Me(e){switch(e.arrayFormat){case"index":return r=>(t,n)=>{const a=t.length;return n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?t:n===null?[...t,[c(r,e),"[",a,"]"].join("")]:[...t,[c(r,e),"[",c(a,e),"]=",c(n,e)].join("")]};case"bracket":return r=>(t,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?t:n===null?[...t,[c(r,e),"[]"].join("")]:[...t,[c(r,e),"[]=",c(n,e)].join("")];case"colon-list-separator":return r=>(t,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?t:n===null?[...t,[c(r,e),":list="].join("")]:[...t,[c(r,e),":list=",c(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{const r=e.arrayFormat==="bracket-separator"?"[]=":"=";return t=>(n,a)=>a===void 0||e.skipNull&&a===null||e.skipEmptyString&&a===""?n:(a=a===null?"":a,n.length===0?[[c(t,e),r,c(a,e)].join("")]:[[n,c(a,e)].join(e.arrayFormatSeparator)])}default:return r=>(t,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?t:n===null?[...t,c(r,e)]:[...t,[c(r,e),"=",c(n,e)].join("")]}}function Le(e){let r;switch(e.arrayFormat){case"index":return(t,n,a)=>{if(r=/\[(\d*)]$/.exec(t),t=t.replace(/\[\d*]$/,""),!r){a[t]=n;return}a[t]===void 0&&(a[t]={}),a[t][r[1]]=n};case"bracket":return(t,n,a)=>{if(r=/(\[])$/.exec(t),t=t.replace(/\[]$/,""),!r){a[t]=n;return}if(a[t]===void 0){a[t]=[n];return}a[t]=[...a[t],n]};case"colon-list-separator":return(t,n,a)=>{if(r=/(:list)$/.exec(t),t=t.replace(/:list$/,""),!r){a[t]=n;return}if(a[t]===void 0){a[t]=[n];return}a[t]=[...a[t],n]};case"comma":case"separator":return(t,n,a)=>{const o=typeof n=="string"&&n.includes(e.arrayFormatSeparator)?n.split(e.arrayFormatSeparator).map(i=>h(i,e)):n===null?n:h(n,e);a[t]=o};case"bracket-separator":return(t,n,a)=>{const s=/(\[])$/.test(t);if(t=t.replace(/\[]$/,""),!s){a[t]=n&&h(n,e);return}const o=n===null?[]:h(n,e).split(e.arrayFormatSeparator);if(a[t]===void 0){a[t]=o;return}a[t]=[...a[t],...o]};default:return(t,n,a)=>{if(a[t]===void 0){a[t]=n;return}a[t]=[...[a[t]].flat(),n]}}}function re(e){if(typeof e!="string"||e.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function c(e,r){return r.encode?r.strict?$e(e):encodeURIComponent(e):e}function h(e,r){return r.decode?Te(e):e}function te(e){return Array.isArray(e)?e.sort():typeof e=="object"?te(Object.keys(e)).sort((r,t)=>Number(r)-Number(t)).map(r=>e[r]):e}function ne(e){const r=e.indexOf("#");return r!==-1&&(e=e.slice(0,r)),e}function je(e){let r="";const t=e.indexOf("#");return t!==-1&&(r=e.slice(t)),r}function q(e,r,t){return t==="string"&&typeof e=="string"?e:typeof t=="function"&&typeof e=="string"?t(e):t==="boolean"&&e===null?!0:t==="boolean"&&e!==null&&(e.toLowerCase()==="true"||e.toLowerCase()==="false")?e.toLowerCase()==="true":t==="boolean"&&e!==null&&(e.toLowerCase()==="1"||e.toLowerCase()==="0")?e.toLowerCase()==="1":t==="string[]"&&r.arrayFormat!=="none"&&typeof e=="string"?[e]:t==="number[]"&&r.arrayFormat!=="none"&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?[Number(e)]:t==="number"&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?Number(e):r.parseBooleans&&e!==null&&(e.toLowerCase()==="true"||e.toLowerCase()==="false")?e.toLowerCase()==="true":r.parseNumbers&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?Number(e):e}function x(e){e=ne(e);const r=e.indexOf("?");return r===-1?"":e.slice(r+1)}function $(e,r){r={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,types:Object.create(null),...r},re(r.arrayFormatSeparator);const t=Le(r),n=Object.create(null);if(typeof e!="string"||(e=e.trim().replace(/^[?#&]/,""),!e))return n;for(const a of e.split("&")){if(a==="")continue;const s=r.decode?a.replaceAll("+"," "):a;let[o,i]=ee(s,"=");o===void 0&&(o=s),i=i===void 0?null:["comma","separator","bracket-separator"].includes(r.arrayFormat)?i:h(i,r),t(h(o,r),i,n)}for(const[a,s]of Object.entries(n))if(typeof s=="object"&&s!==null&&r.types[a]!=="string")for(const[o,i]of Object.entries(s)){const l=r.types[a],f=typeof l=="function"?l:l?l.replace("[]",""):void 0;s[o]=q(i,r,f)}else typeof s=="object"&&s!==null&&r.types[a]==="string"?n[a]=Object.values(s).join(r.arrayFormatSeparator):n[a]=q(s,r,r.types[a]);return r.sort===!1?n:(r.sort===!0?Object.keys(n).sort():Object.keys(n).sort(r.sort)).reduce((a,s)=>{const o=n[s];return a[s]=o&&typeof o=="object"&&!Array.isArray(o)?te(o):o,a},Object.create(null))}function ae(e,r){if(!e)return"";r={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...r},re(r.arrayFormatSeparator);const t=o=>r.skipNull&&xe(e[o])||r.skipEmptyString&&e[o]==="",n=Me(r),a={};for(const[o,i]of Object.entries(e))t(o)||(a[o]=i);const s=Object.keys(a);return r.sort!==!1&&s.sort(r.sort),s.map(o=>{let i=e[o];if(r.replacer&&(i=r.replacer(o,i),i===void 0)||i===void 0)return"";if(i===null)return c(o,r);if(Array.isArray(i)){if(i.length===0&&r.arrayFormat==="bracket-separator")return c(o,r)+"[]";let l=i;return r.replacer&&(l=i.map((f,u)=>r.replacer(`${o}[${u}]`,f)).filter(f=>f!==void 0)),l.reduce(n(o),[]).join("&")}return c(o,r)+"="+c(i,r)}).filter(o=>o.length>0).join("&")}function se(e,r){r={decode:!0,...r};let[t,n]=ee(e,"#");return t===void 0&&(t=e),{url:t?.split("?")?.[0]??"",query:$(x(e),r),...r&&r.parseFragmentIdentifier&&n?{fragmentIdentifier:h(n,r)}:{}}}function oe(e,r){r={encode:!0,strict:!0,[U]:!0,...r};const t=ne(e.url).split("?")[0]||"",n=x(e.url),a={...$(n,{sort:!1,...r}),...e.query};let s=ae(a,r);s&&=`?${s}`;let o=je(e.url);if(typeof e.fragmentIdentifier=="string"){const i=new URL(t);i.hash=e.fragmentIdentifier,o=r[U]?i.hash:`#${e.fragmentIdentifier}`}return`${t}${s}${o}`}function ie(e,r,t){t={parseFragmentIdentifier:!0,[U]:!1,...t};const{url:n,query:a,fragmentIdentifier:s}=se(e,t);return oe({url:n,query:Ue(a,r),fragmentIdentifier:s},t)}function De(e,r,t){const n=Array.isArray(r)?a=>!r.includes(a):(a,s)=>!r(a,s);return ie(e,n,t)}const Pe=Object.freeze(Object.defineProperty({__proto__:null,exclude:De,extract:x,parse:$,parseUrl:se,pick:ie,stringify:ae,stringifyUrl:oe},Symbol.toStringTag,{value:"Module"}));var N=function(e){return e.COMPONENT_READY="streamlit:componentReady",e.SET_COMPONENT_VALUE="streamlit:setComponentValue",e.SET_FRAME_HEIGHT="streamlit:setFrameHeight",e}({}),ke=function(e){return e.RENDER="streamlit:render",e}({});const Ve=1,F=Q.getLogger("componentUtils");function He(e){return(r,t)=>{if(!e.current)return;const{isReady:n,element:a,widgetMgr:s,setComponentError:o,componentReadyCallback:i,frameHeightCallback:l,fragmentId:f}=e.current,u=n();switch(r){case N.COMPONENT_READY:{const{apiVersion:y}=t;y!==Ve?o(new Error(`Unrecognized component API version: '${y}'`)):i();break}case N.SET_COMPONENT_VALUE:u?Ye(K(t,"value"),t.dataType,{fromUi:!0},a,s,f):F.warn(`Got ${r} before ${N.COMPONENT_READY}!`);break;case N.SET_FRAME_HEIGHT:u?l(K(t,"height")):F.warn(`Got ${r} before ${N.COMPONENT_READY}!`);break;default:F.warn(`Unrecognized ComponentBackMsgType: ${r}`)}}}function We(e,r){const t=JSON.parse(e),n=[];for(const a of r){const{key:s}=a;switch(a.value?.toLowerCase()){case"arrowdataframe":n.push({key:s,value:ge.toObject(a.arrowDataframe)});break;case"bytes":t[s]=a.bytes;break;default:throw new Error(`Unrecognized SpecialArg type: ${a.value}`)}}return[t,n]}function z(e,r,t,n,a){if(!a){F.warn("Can't send ForwardMsg; missing our iframe!");return}if(Z(a.contentWindow)){F.warn("Can't send ForwardMsg; iframe has no contentWindow!");return}a.contentWindow.postMessage({type:ke.RENDER,args:e,dfs:r,disabled:t,theme:{...me(n),font:n.genericFonts.bodyFont}},"*")}function Ye(e,r,t,n,a,s){if(e===void 0){F.warn("handleSetComponentValue: missing 'value' prop");return}switch(r){case"dataframe":a.setArrowValue(n,e,t,s);break;case"bytes":a.setBytesValue(n,e,t,s);break;default:a.setJsonValue(n,e,t,s)}}function K(e,r,t=void 0){return Object.hasOwn(e,r)?e[r]:t}const Ge=he("iframe",{target:"e1begtbc0"})(({theme:e,componentReady:r})=>({colorScheme:"normal",border:"none",padding:e.spacing.none,margin:e.spacing.none,display:r?"initial":"none"})),R=Q.getLogger("ComponentInstance"),J=6e4;function Be(e,r,t){let n;Oe(t)&&t!==""?n=t:n=r.getComponentURL(e,"index.html");const a=window.__streamlit?.CUSTOM_COMPONENT_CLIENT_ID,s=new URL(window.location.href);return n=Pe.stringifyUrl({url:n,query:{streamlitUrl:s.origin+s.pathname,...a&&{__streamlit_parent_client_id:a}}}),n}function X(e,r){let t;return r&&r!==""?t=`Your app is having trouble loading the **${e}** component.
1
+ import{Q,e as Z,bt as me,bu as ge,x as he,r as d,g as ye,bv as V,aj as I,j as A,X as pe,bw as H,bx as Ee,a1 as be,a2 as Fe,l as Ce,a0 as we,W as Ne,n as Oe}from"./index.CqTPbV5Y.js";import{by as tr}from"./index.CqTPbV5Y.js";import{w as Se}from"./withCalculatedWidth.ChdrMItN.js";import{C as W,a as Y}from"./urls.BwSlolu9.js";import{D as Ae,a as Re}from"./IFrameUtil.DefezniK.js";const v="%[a-f0-9]{2}",G=new RegExp("("+v+")|([^%]+?)","gi"),B=new RegExp("("+v+")+","gi");function T(e,r){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;r=r||1;const t=e.slice(0,r),n=e.slice(r);return Array.prototype.concat.call([],T(t),T(n))}function _e(e){try{return decodeURIComponent(e)}catch{let r=e.match(G)||[];for(let t=1;t<r.length;t++)e=T(r,t).join(""),r=e.match(G)||[];return e}}function Ie(e){const r={"%FE%FF":"��","%FF%FE":"��"};let t=B.exec(e);for(;t;){try{r[t[0]]=decodeURIComponent(t[0])}catch{const a=_e(t[0]);a!==t[0]&&(r[t[0]]=a)}t=B.exec(e)}r["%C2"]="�";const n=Object.keys(r);for(const a of n)e=e.replace(new RegExp(a,"g"),r[a]);return e}function Te(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return Ie(e)}}function Ue(e,r){const t={};if(Array.isArray(r))for(const n of r){const a=Object.getOwnPropertyDescriptor(e,n);a?.enumerable&&Object.defineProperty(t,n,a)}else for(const n of Reflect.ownKeys(e)){const a=Object.getOwnPropertyDescriptor(e,n);if(a.enumerable){const s=e[n];r(n,s,e)&&Object.defineProperty(t,n,a)}}return t}function ee(e,r){if(!(typeof e=="string"&&typeof r=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e===""||r==="")return[];const t=e.indexOf(r);return t===-1?[]:[e.slice(0,t),e.slice(t+r.length)]}const xe=e=>e==null,$e=e=>encodeURIComponent(e).replaceAll(/[!'()*]/g,r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`),U=Symbol("encodeFragmentIdentifier");function Me(e){switch(e.arrayFormat){case"index":return r=>(t,n)=>{const a=t.length;return n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?t:n===null?[...t,[c(r,e),"[",a,"]"].join("")]:[...t,[c(r,e),"[",c(a,e),"]=",c(n,e)].join("")]};case"bracket":return r=>(t,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?t:n===null?[...t,[c(r,e),"[]"].join("")]:[...t,[c(r,e),"[]=",c(n,e)].join("")];case"colon-list-separator":return r=>(t,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?t:n===null?[...t,[c(r,e),":list="].join("")]:[...t,[c(r,e),":list=",c(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{const r=e.arrayFormat==="bracket-separator"?"[]=":"=";return t=>(n,a)=>a===void 0||e.skipNull&&a===null||e.skipEmptyString&&a===""?n:(a=a===null?"":a,n.length===0?[[c(t,e),r,c(a,e)].join("")]:[[n,c(a,e)].join(e.arrayFormatSeparator)])}default:return r=>(t,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?t:n===null?[...t,c(r,e)]:[...t,[c(r,e),"=",c(n,e)].join("")]}}function Le(e){let r;switch(e.arrayFormat){case"index":return(t,n,a)=>{if(r=/\[(\d*)]$/.exec(t),t=t.replace(/\[\d*]$/,""),!r){a[t]=n;return}a[t]===void 0&&(a[t]={}),a[t][r[1]]=n};case"bracket":return(t,n,a)=>{if(r=/(\[])$/.exec(t),t=t.replace(/\[]$/,""),!r){a[t]=n;return}if(a[t]===void 0){a[t]=[n];return}a[t]=[...a[t],n]};case"colon-list-separator":return(t,n,a)=>{if(r=/(:list)$/.exec(t),t=t.replace(/:list$/,""),!r){a[t]=n;return}if(a[t]===void 0){a[t]=[n];return}a[t]=[...a[t],n]};case"comma":case"separator":return(t,n,a)=>{const o=typeof n=="string"&&n.includes(e.arrayFormatSeparator)?n.split(e.arrayFormatSeparator).map(i=>h(i,e)):n===null?n:h(n,e);a[t]=o};case"bracket-separator":return(t,n,a)=>{const s=/(\[])$/.test(t);if(t=t.replace(/\[]$/,""),!s){a[t]=n&&h(n,e);return}const o=n===null?[]:h(n,e).split(e.arrayFormatSeparator);if(a[t]===void 0){a[t]=o;return}a[t]=[...a[t],...o]};default:return(t,n,a)=>{if(a[t]===void 0){a[t]=n;return}a[t]=[...[a[t]].flat(),n]}}}function re(e){if(typeof e!="string"||e.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function c(e,r){return r.encode?r.strict?$e(e):encodeURIComponent(e):e}function h(e,r){return r.decode?Te(e):e}function te(e){return Array.isArray(e)?e.sort():typeof e=="object"?te(Object.keys(e)).sort((r,t)=>Number(r)-Number(t)).map(r=>e[r]):e}function ne(e){const r=e.indexOf("#");return r!==-1&&(e=e.slice(0,r)),e}function je(e){let r="";const t=e.indexOf("#");return t!==-1&&(r=e.slice(t)),r}function q(e,r,t){return t==="string"&&typeof e=="string"?e:typeof t=="function"&&typeof e=="string"?t(e):t==="boolean"&&e===null?!0:t==="boolean"&&e!==null&&(e.toLowerCase()==="true"||e.toLowerCase()==="false")?e.toLowerCase()==="true":t==="boolean"&&e!==null&&(e.toLowerCase()==="1"||e.toLowerCase()==="0")?e.toLowerCase()==="1":t==="string[]"&&r.arrayFormat!=="none"&&typeof e=="string"?[e]:t==="number[]"&&r.arrayFormat!=="none"&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?[Number(e)]:t==="number"&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?Number(e):r.parseBooleans&&e!==null&&(e.toLowerCase()==="true"||e.toLowerCase()==="false")?e.toLowerCase()==="true":r.parseNumbers&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?Number(e):e}function x(e){e=ne(e);const r=e.indexOf("?");return r===-1?"":e.slice(r+1)}function $(e,r){r={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,types:Object.create(null),...r},re(r.arrayFormatSeparator);const t=Le(r),n=Object.create(null);if(typeof e!="string"||(e=e.trim().replace(/^[?#&]/,""),!e))return n;for(const a of e.split("&")){if(a==="")continue;const s=r.decode?a.replaceAll("+"," "):a;let[o,i]=ee(s,"=");o===void 0&&(o=s),i=i===void 0?null:["comma","separator","bracket-separator"].includes(r.arrayFormat)?i:h(i,r),t(h(o,r),i,n)}for(const[a,s]of Object.entries(n))if(typeof s=="object"&&s!==null&&r.types[a]!=="string")for(const[o,i]of Object.entries(s)){const l=r.types[a],f=typeof l=="function"?l:l?l.replace("[]",""):void 0;s[o]=q(i,r,f)}else typeof s=="object"&&s!==null&&r.types[a]==="string"?n[a]=Object.values(s).join(r.arrayFormatSeparator):n[a]=q(s,r,r.types[a]);return r.sort===!1?n:(r.sort===!0?Object.keys(n).sort():Object.keys(n).sort(r.sort)).reduce((a,s)=>{const o=n[s];return a[s]=o&&typeof o=="object"&&!Array.isArray(o)?te(o):o,a},Object.create(null))}function ae(e,r){if(!e)return"";r={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...r},re(r.arrayFormatSeparator);const t=o=>r.skipNull&&xe(e[o])||r.skipEmptyString&&e[o]==="",n=Me(r),a={};for(const[o,i]of Object.entries(e))t(o)||(a[o]=i);const s=Object.keys(a);return r.sort!==!1&&s.sort(r.sort),s.map(o=>{let i=e[o];if(r.replacer&&(i=r.replacer(o,i),i===void 0)||i===void 0)return"";if(i===null)return c(o,r);if(Array.isArray(i)){if(i.length===0&&r.arrayFormat==="bracket-separator")return c(o,r)+"[]";let l=i;return r.replacer&&(l=i.map((f,u)=>r.replacer(`${o}[${u}]`,f)).filter(f=>f!==void 0)),l.reduce(n(o),[]).join("&")}return c(o,r)+"="+c(i,r)}).filter(o=>o.length>0).join("&")}function se(e,r){r={decode:!0,...r};let[t,n]=ee(e,"#");return t===void 0&&(t=e),{url:t?.split("?")?.[0]??"",query:$(x(e),r),...r&&r.parseFragmentIdentifier&&n?{fragmentIdentifier:h(n,r)}:{}}}function oe(e,r){r={encode:!0,strict:!0,[U]:!0,...r};const t=ne(e.url).split("?")[0]||"",n=x(e.url),a={...$(n,{sort:!1,...r}),...e.query};let s=ae(a,r);s&&=`?${s}`;let o=je(e.url);if(typeof e.fragmentIdentifier=="string"){const i=new URL(t);i.hash=e.fragmentIdentifier,o=r[U]?i.hash:`#${e.fragmentIdentifier}`}return`${t}${s}${o}`}function ie(e,r,t){t={parseFragmentIdentifier:!0,[U]:!1,...t};const{url:n,query:a,fragmentIdentifier:s}=se(e,t);return oe({url:n,query:Ue(a,r),fragmentIdentifier:s},t)}function De(e,r,t){const n=Array.isArray(r)?a=>!r.includes(a):(a,s)=>!r(a,s);return ie(e,n,t)}const Pe=Object.freeze(Object.defineProperty({__proto__:null,exclude:De,extract:x,parse:$,parseUrl:se,pick:ie,stringify:ae,stringifyUrl:oe},Symbol.toStringTag,{value:"Module"}));var N=function(e){return e.COMPONENT_READY="streamlit:componentReady",e.SET_COMPONENT_VALUE="streamlit:setComponentValue",e.SET_FRAME_HEIGHT="streamlit:setFrameHeight",e}({}),ke=function(e){return e.RENDER="streamlit:render",e}({});const Ve=1,F=Q.getLogger("componentUtils");function He(e){return(r,t)=>{if(!e.current)return;const{isReady:n,element:a,widgetMgr:s,setComponentError:o,componentReadyCallback:i,frameHeightCallback:l,fragmentId:f}=e.current,u=n();switch(r){case N.COMPONENT_READY:{const{apiVersion:y}=t;y!==Ve?o(new Error(`Unrecognized component API version: '${y}'`)):i();break}case N.SET_COMPONENT_VALUE:u?Ye(K(t,"value"),t.dataType,{fromUi:!0},a,s,f):F.warn(`Got ${r} before ${N.COMPONENT_READY}!`);break;case N.SET_FRAME_HEIGHT:u?l(K(t,"height")):F.warn(`Got ${r} before ${N.COMPONENT_READY}!`);break;default:F.warn(`Unrecognized ComponentBackMsgType: ${r}`)}}}function We(e,r){const t=JSON.parse(e),n=[];for(const a of r){const{key:s}=a;switch(a.value?.toLowerCase()){case"arrowdataframe":n.push({key:s,value:ge.toObject(a.arrowDataframe)});break;case"bytes":t[s]=a.bytes;break;default:throw new Error(`Unrecognized SpecialArg type: ${a.value}`)}}return[t,n]}function z(e,r,t,n,a){if(!a){F.warn("Can't send ForwardMsg; missing our iframe!");return}if(Z(a.contentWindow)){F.warn("Can't send ForwardMsg; iframe has no contentWindow!");return}a.contentWindow.postMessage({type:ke.RENDER,args:e,dfs:r,disabled:t,theme:{...me(n),font:n.genericFonts.bodyFont}},"*")}function Ye(e,r,t,n,a,s){if(e===void 0){F.warn("handleSetComponentValue: missing 'value' prop");return}switch(r){case"dataframe":a.setArrowValue(n,e,t,s);break;case"bytes":a.setBytesValue(n,e,t,s);break;default:a.setJsonValue(n,e,t,s)}}function K(e,r,t=void 0){return Object.hasOwn(e,r)?e[r]:t}const Ge=he("iframe",{target:"e1begtbc0"})(({theme:e,componentReady:r})=>({colorScheme:"normal",border:"none",padding:e.spacing.none,margin:e.spacing.none,display:r?"initial":"none"})),R=Q.getLogger("ComponentInstance"),J=6e4;function Be(e,r,t){let n;Oe(t)&&t!==""?n=t:n=r.getComponentURL(e,"index.html");const a=window.__streamlit?.CUSTOM_COMPONENT_CLIENT_ID,s=new URL(window.location.href);return n=Pe.stringifyUrl({url:n,query:{streamlitUrl:s.origin+s.pathname,...a&&{__streamlit_parent_client_id:a}}}),n}function X(e,r){let t;return r&&r!==""?t=`Your app is having trouble loading the **${e}** component.
2
2
  The app is attempting to load the component from **${r}**,
3
3
  and hasn't received its \`Streamlit.setComponentReady()\` message.
4
4
 
@@ -1,2 +1,2 @@
1
- import{H as _,r as u,Q as ao,ct as O,ck as co,W as io,g as lo,j as m,R as I,cu as fo,x as D,X as H}from"./index.DMxc2XFp.js";function go(o,e,r,t){for(var n=-1,s=o==null?0:o.length;++n<s;)r=e(r,o[n],n,o);return r}function Co(o){return function(e){return o?.[e]}}var xo={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},po=Co(xo),mo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bo="\\u0300-\\u036f",ho="\\ufe20-\\ufe2f",Ro="\\u20d0-\\u20ff",So=bo+ho+Ro,yo="["+So+"]",Eo=RegExp(yo,"g");function vo(o){return o=_(o),o&&o.replace(mo,po).replace(Eo,"")}var wo=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Bo(o){return o.match(wo)||[]}var Fo=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function ko(o){return Fo.test(o)}var V="\\ud800-\\udfff",To="\\u0300-\\u036f",Ao="\\ufe20-\\ufe2f",Uo="\\u20d0-\\u20ff",Io=To+Ao+Uo,J="\\u2700-\\u27bf",Z="a-z\\xdf-\\xf6\\xf8-\\xff",zo="\\xac\\xb1\\xd7\\xf7",Lo="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Oo="\\u2000-\\u206f",Mo=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",G="A-Z\\xc0-\\xd6\\xd8-\\xde",Wo="\\ufe0e\\ufe0f",Y=zo+Lo+Oo+Mo,q="['’]",M="["+Y+"]",jo="["+Io+"]",K="\\d+",$o="["+J+"]",X="["+Z+"]",Q="[^"+V+Y+K+J+Z+G+"]",No="\\ud83c[\\udffb-\\udfff]",Po="(?:"+jo+"|"+No+")",_o="[^"+V+"]",oo="(?:\\ud83c[\\udde6-\\uddff]){2}",eo="[\\ud800-\\udbff][\\udc00-\\udfff]",w="["+G+"]",Do="\\u200d",W="(?:"+X+"|"+Q+")",Ho="(?:"+w+"|"+Q+")",j="(?:"+q+"(?:d|ll|m|re|s|t|ve))?",$="(?:"+q+"(?:D|LL|M|RE|S|T|VE))?",ro=Po+"?",to="["+Wo+"]?",Vo="(?:"+Do+"(?:"+[_o,oo,eo].join("|")+")"+to+ro+")*",Jo="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Zo="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Go=to+ro+Vo,Yo="(?:"+[$o,oo,eo].join("|")+")"+Go,qo=RegExp([w+"?"+X+"+"+j+"(?="+[M,w,"$"].join("|")+")",Ho+"+"+$+"(?="+[M,w+W,"$"].join("|")+")",w+"?"+W+"+"+j,w+"+"+$,Zo,Jo,K,Yo].join("|"),"g");function Ko(o){return o.match(qo)||[]}function Xo(o,e,r){return o=_(o),e=e,e===void 0?ko(o)?Ko(o):Bo(o):o.match(e)||[]}var Qo="['’]",oe=RegExp(Qo,"g");function ee(o){return function(e){return go(Xo(vo(e).replace(oe,"")),o,"")}}var re=ee(function(o,e,r){return o+(r?"-":"")+e.toLowerCase()});const F=u.createContext(null);F.displayName="BidiComponentContext";const B=ao.getLogger("BidiComponent"),N="__",A="__streamlit_arrow_ref__",te="$$STREAMLIT_INTERNAL_KEY",ne=(o,e)=>{if(o&&typeof o=="object"&&!Array.isArray(o)){if(typeof o[A]=="string"){const t=o[A],n=e[t];if(n)try{return O(n)}catch{return null}return null}const r={};for(const[t,n]of Object.entries(o))if(n&&typeof n=="object"&&!Array.isArray(n)&&typeof n[A]=="string"){const s=n[A],a=e[s];if(a)try{r[t]=O(a)}catch{r[t]=null}else r[t]=null}else r[t]=n;return r}return o},se=({arrowBlobs:o,arrowData:e,bytes:r,data:t,json:n,mixedJson:s})=>{switch(t){case"json":return n?JSON.parse(n):null;case"arrowData":return e??null;case"bytes":return r??null;case"mixed":{if(s&&o&&s){const a=JSON.parse(s),i={};return o&&Object.entries(o).forEach(([f,l])=>{l?.data&&(i[f]=l.data)}),ne(a,i)}return null}case"any":case void 0:return null;default:co(t)}},ue=(o,e="--st")=>{const r={};return Object.entries(o).forEach(([t,n])=>{const s=re(t),a=`${e}-${s}`;if(typeof n=="boolean"){r[a]=n?"1":"0";return}r[a]=String(n)}),r},ae=o=>({primaryColor:o.colors.primary,backgroundColor:o.colors.bgColor,secondaryBackgroundColor:o.colors.secondaryBg,textColor:o.colors.bodyText,linkColor:o.colors.link,linkUnderline:o.linkUnderline,headingFont:o.genericFonts.headingFont,codeFont:o.genericFonts.codeFont,baseRadius:o.radii.default,buttonRadius:o.radii.button,baseFontSize:typeof o.fontSizes.baseFontSize=="number"?`${o.fontSizes.baseFontSize}px`:String(o.fontSizes.baseFontSize),baseFontWeight:o.fontWeights.normal,codeFontWeight:o.fontWeights.code,codeFontSize:o.fontSizes.codeFontSize,headingFontSizes:[o.fontSizes.h1FontSize,o.fontSizes.h2FontSize,o.fontSizes.h3FontSize,o.fontSizes.h4FontSize,o.fontSizes.h5FontSize,o.fontSizes.h6FontSize],headingFontWeights:[o.fontWeights.h1FontWeight,o.fontWeights.h2FontWeight,o.fontWeights.h3FontWeight,o.fontWeights.h4FontWeight,o.fontWeights.h5FontWeight,o.fontWeights.h6FontWeight],borderColor:o.colors.borderColor,dataframeBorderColor:o.colors.dataframeBorderColor,dataframeHeaderBackgroundColor:o.colors.dataframeHeaderBackgroundColor,codeBackgroundColor:o.colors.codeBackgroundColor,font:o.genericFonts.bodyFont,chartCategoricalColors:o.colors.chartCategoricalColors,chartSequentialColors:o.colors.chartSequentialColors,headingColor:o.colors.headingColor,borderColorLight:o.colors.borderColorLight,codeTextColor:o.colors.codeTextColor,widgetBorderColor:o.colors.widgetBorderColor,redColor:o.colors.redColor,orangeColor:o.colors.orangeColor,yellowColor:o.colors.yellowColor,blueColor:o.colors.blueColor,greenColor:o.colors.greenColor,violetColor:o.colors.violetColor,grayColor:o.colors.grayColor,redBackgroundColor:o.colors.redBackgroundColor,orangeBackgroundColor:o.colors.orangeBackgroundColor,yellowBackgroundColor:o.colors.yellowBackgroundColor,blueBackgroundColor:o.colors.blueBackgroundColor,greenBackgroundColor:o.colors.greenBackgroundColor,violetBackgroundColor:o.colors.violetBackgroundColor,grayBackgroundColor:o.colors.grayBackgroundColor,redTextColor:o.colors.redTextColor,orangeTextColor:o.colors.orangeTextColor,yellowTextColor:o.colors.yellowTextColor,blueTextColor:o.colors.blueTextColor,greenTextColor:o.colors.greenTextColor,violetTextColor:o.colors.violetTextColor,grayTextColor:o.colors.grayTextColor}),ce=u.memo(({element:o,children:e,widgetMgr:r,fragmentId:t,componentRegistry:n})=>{const{arrowData:s,bytes:a,componentName:i,cssContent:f,cssSourcePath:l,data:d,htmlContent:c,id:S,jsContent:b,json:x,jsSourcePath:p,mixed:g}=o,y=u.useMemo(()=>({id:o.id,formId:o.formId}),[o.id,o.formId]),k=u.useCallback(()=>{const v=r.getJsonValue(y);if(!v)return{};try{return JSON.parse(v)}catch(z){const R=io(z);return B.warn("Failed to parse widget JSON value; returning empty object.",{widgetId:y.id,formId:y.formId,error:R.message}),{}}},[y,r]),T=u.useMemo(()=>se({arrowBlobs:g?.arrowBlobs||void 0,arrowData:s?.data||void 0,bytes:a,data:d,json:x,mixedJson:g?.json||void 0}),[d,x,s?.data,a,g?.json,g?.arrowBlobs]),h=lo(),E=u.useMemo(()=>ae(h),[h]),C=u.useMemo(()=>({componentName:i,componentRegistry:n,cssContent:f?.trim(),cssSourcePath:l||void 0,data:T,fragmentId:t,getWidgetValue:k,htmlContent:c?.trim(),id:S,formId:o.formId||void 0,jsContent:b||void 0,jsSourcePath:p||void 0,theme:E,widgetMgr:r}),[i,n,f,l,t,k,c,S,o.formId,b,p,T,E,r]);return m(F.Provider,{value:C,children:e})}),no=(o,e)=>{if(o instanceof Error)return o;const r=e?`${e}: ${String(o)}`:String(o);return new Error(r)},U=(o,e,r)=>{const t=no(o,r);B.error(`BidiComponent Error: ${t.message}`,o),e(t)},ie=(o,e)=>{try{const t=document.createRange().createContextualFragment(o);e.appendChild(t)}catch(r){B.warn("createContextualFragment failed, falling back to innerHTML",r),e.innerHTML=o}},so=({containerRef:o,setError:e,skip:r=!1})=>{const t=u.useRef(null),{htmlContent:n,cssContent:s,cssSourcePath:a,componentName:i,componentRegistry:{getBidiComponentURL:f}}=I(F),l=u.useMemo(()=>{if(a)return f(i,a)},[i,a,f]);return u.useEffect(()=>{if(r)return;const d=o.current;if(d)try{if(t.current?.parentNode===d&&d.removeChild(t.current),t.current=document.createElement("div"),n){const c=document.createElement("div");ie(n,c),t.current.appendChild(c)}if(s){const c=document.createElement("style");c.textContent=s,t.current.appendChild(c)}else if(l){const c=document.createElement("link");c.href=l,c.rel="stylesheet",c.onerror=()=>{U(new Error(`Failed to load CSS from ${l}`),e)},t.current.appendChild(c)}d.appendChild(t.current)}catch(c){U(c,e,"Failed to process HTML/CSS content")}},[n,s,o,l,e,r]),t};class le{constructor(){this.hashSeed=2166136261,this.hashPrime=16777619,this.cache=new Map}computeHash(e){let r=this.hashSeed;for(let t=0;t<e.length;t++)r^=e.charCodeAt(t),r=Math.imul(r>>>0,this.hashPrime)>>>0;return(r>>>0).toString(16)}getOrCreateUrlForJs(e,r){const t=this.computeHash(e),n=this.cache.get(t);if(n)return{url:n,hash:t};const s=`${e}
1
+ import{H as _,r as u,Q as ao,ct as O,ck as co,W as io,g as lo,j as m,R as I,cu as fo,x as D,X as H}from"./index.CqTPbV5Y.js";function go(o,e,r,t){for(var n=-1,s=o==null?0:o.length;++n<s;)r=e(r,o[n],n,o);return r}function Co(o){return function(e){return o?.[e]}}var xo={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},po=Co(xo),mo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bo="\\u0300-\\u036f",ho="\\ufe20-\\ufe2f",Ro="\\u20d0-\\u20ff",So=bo+ho+Ro,yo="["+So+"]",Eo=RegExp(yo,"g");function vo(o){return o=_(o),o&&o.replace(mo,po).replace(Eo,"")}var wo=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Bo(o){return o.match(wo)||[]}var Fo=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function ko(o){return Fo.test(o)}var V="\\ud800-\\udfff",To="\\u0300-\\u036f",Ao="\\ufe20-\\ufe2f",Uo="\\u20d0-\\u20ff",Io=To+Ao+Uo,J="\\u2700-\\u27bf",Z="a-z\\xdf-\\xf6\\xf8-\\xff",zo="\\xac\\xb1\\xd7\\xf7",Lo="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Oo="\\u2000-\\u206f",Mo=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",G="A-Z\\xc0-\\xd6\\xd8-\\xde",Wo="\\ufe0e\\ufe0f",Y=zo+Lo+Oo+Mo,q="['’]",M="["+Y+"]",jo="["+Io+"]",K="\\d+",$o="["+J+"]",X="["+Z+"]",Q="[^"+V+Y+K+J+Z+G+"]",No="\\ud83c[\\udffb-\\udfff]",Po="(?:"+jo+"|"+No+")",_o="[^"+V+"]",oo="(?:\\ud83c[\\udde6-\\uddff]){2}",eo="[\\ud800-\\udbff][\\udc00-\\udfff]",w="["+G+"]",Do="\\u200d",W="(?:"+X+"|"+Q+")",Ho="(?:"+w+"|"+Q+")",j="(?:"+q+"(?:d|ll|m|re|s|t|ve))?",$="(?:"+q+"(?:D|LL|M|RE|S|T|VE))?",ro=Po+"?",to="["+Wo+"]?",Vo="(?:"+Do+"(?:"+[_o,oo,eo].join("|")+")"+to+ro+")*",Jo="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Zo="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Go=to+ro+Vo,Yo="(?:"+[$o,oo,eo].join("|")+")"+Go,qo=RegExp([w+"?"+X+"+"+j+"(?="+[M,w,"$"].join("|")+")",Ho+"+"+$+"(?="+[M,w+W,"$"].join("|")+")",w+"?"+W+"+"+j,w+"+"+$,Zo,Jo,K,Yo].join("|"),"g");function Ko(o){return o.match(qo)||[]}function Xo(o,e,r){return o=_(o),e=e,e===void 0?ko(o)?Ko(o):Bo(o):o.match(e)||[]}var Qo="['’]",oe=RegExp(Qo,"g");function ee(o){return function(e){return go(Xo(vo(e).replace(oe,"")),o,"")}}var re=ee(function(o,e,r){return o+(r?"-":"")+e.toLowerCase()});const F=u.createContext(null);F.displayName="BidiComponentContext";const B=ao.getLogger("BidiComponent"),N="__",A="__streamlit_arrow_ref__",te="$$STREAMLIT_INTERNAL_KEY",ne=(o,e)=>{if(o&&typeof o=="object"&&!Array.isArray(o)){if(typeof o[A]=="string"){const t=o[A],n=e[t];if(n)try{return O(n)}catch{return null}return null}const r={};for(const[t,n]of Object.entries(o))if(n&&typeof n=="object"&&!Array.isArray(n)&&typeof n[A]=="string"){const s=n[A],a=e[s];if(a)try{r[t]=O(a)}catch{r[t]=null}else r[t]=null}else r[t]=n;return r}return o},se=({arrowBlobs:o,arrowData:e,bytes:r,data:t,json:n,mixedJson:s})=>{switch(t){case"json":return n?JSON.parse(n):null;case"arrowData":return e??null;case"bytes":return r??null;case"mixed":{if(s&&o&&s){const a=JSON.parse(s),i={};return o&&Object.entries(o).forEach(([f,l])=>{l?.data&&(i[f]=l.data)}),ne(a,i)}return null}case"any":case void 0:return null;default:co(t)}},ue=(o,e="--st")=>{const r={};return Object.entries(o).forEach(([t,n])=>{const s=re(t),a=`${e}-${s}`;if(typeof n=="boolean"){r[a]=n?"1":"0";return}r[a]=String(n)}),r},ae=o=>({primaryColor:o.colors.primary,backgroundColor:o.colors.bgColor,secondaryBackgroundColor:o.colors.secondaryBg,textColor:o.colors.bodyText,linkColor:o.colors.link,linkUnderline:o.linkUnderline,headingFont:o.genericFonts.headingFont,codeFont:o.genericFonts.codeFont,baseRadius:o.radii.default,buttonRadius:o.radii.button,baseFontSize:typeof o.fontSizes.baseFontSize=="number"?`${o.fontSizes.baseFontSize}px`:String(o.fontSizes.baseFontSize),baseFontWeight:o.fontWeights.normal,codeFontWeight:o.fontWeights.code,codeFontSize:o.fontSizes.codeFontSize,headingFontSizes:[o.fontSizes.h1FontSize,o.fontSizes.h2FontSize,o.fontSizes.h3FontSize,o.fontSizes.h4FontSize,o.fontSizes.h5FontSize,o.fontSizes.h6FontSize],headingFontWeights:[o.fontWeights.h1FontWeight,o.fontWeights.h2FontWeight,o.fontWeights.h3FontWeight,o.fontWeights.h4FontWeight,o.fontWeights.h5FontWeight,o.fontWeights.h6FontWeight],borderColor:o.colors.borderColor,dataframeBorderColor:o.colors.dataframeBorderColor,dataframeHeaderBackgroundColor:o.colors.dataframeHeaderBackgroundColor,codeBackgroundColor:o.colors.codeBackgroundColor,font:o.genericFonts.bodyFont,chartCategoricalColors:o.colors.chartCategoricalColors,chartSequentialColors:o.colors.chartSequentialColors,headingColor:o.colors.headingColor,borderColorLight:o.colors.borderColorLight,codeTextColor:o.colors.codeTextColor,widgetBorderColor:o.colors.widgetBorderColor,redColor:o.colors.redColor,orangeColor:o.colors.orangeColor,yellowColor:o.colors.yellowColor,blueColor:o.colors.blueColor,greenColor:o.colors.greenColor,violetColor:o.colors.violetColor,grayColor:o.colors.grayColor,redBackgroundColor:o.colors.redBackgroundColor,orangeBackgroundColor:o.colors.orangeBackgroundColor,yellowBackgroundColor:o.colors.yellowBackgroundColor,blueBackgroundColor:o.colors.blueBackgroundColor,greenBackgroundColor:o.colors.greenBackgroundColor,violetBackgroundColor:o.colors.violetBackgroundColor,grayBackgroundColor:o.colors.grayBackgroundColor,redTextColor:o.colors.redTextColor,orangeTextColor:o.colors.orangeTextColor,yellowTextColor:o.colors.yellowTextColor,blueTextColor:o.colors.blueTextColor,greenTextColor:o.colors.greenTextColor,violetTextColor:o.colors.violetTextColor,grayTextColor:o.colors.grayTextColor}),ce=u.memo(({element:o,children:e,widgetMgr:r,fragmentId:t,componentRegistry:n})=>{const{arrowData:s,bytes:a,componentName:i,cssContent:f,cssSourcePath:l,data:d,htmlContent:c,id:S,jsContent:b,json:x,jsSourcePath:p,mixed:g}=o,y=u.useMemo(()=>({id:o.id,formId:o.formId}),[o.id,o.formId]),k=u.useCallback(()=>{const v=r.getJsonValue(y);if(!v)return{};try{return JSON.parse(v)}catch(z){const R=io(z);return B.warn("Failed to parse widget JSON value; returning empty object.",{widgetId:y.id,formId:y.formId,error:R.message}),{}}},[y,r]),T=u.useMemo(()=>se({arrowBlobs:g?.arrowBlobs||void 0,arrowData:s?.data||void 0,bytes:a,data:d,json:x,mixedJson:g?.json||void 0}),[d,x,s?.data,a,g?.json,g?.arrowBlobs]),h=lo(),E=u.useMemo(()=>ae(h),[h]),C=u.useMemo(()=>({componentName:i,componentRegistry:n,cssContent:f?.trim(),cssSourcePath:l||void 0,data:T,fragmentId:t,getWidgetValue:k,htmlContent:c?.trim(),id:S,formId:o.formId||void 0,jsContent:b||void 0,jsSourcePath:p||void 0,theme:E,widgetMgr:r}),[i,n,f,l,t,k,c,S,o.formId,b,p,T,E,r]);return m(F.Provider,{value:C,children:e})}),no=(o,e)=>{if(o instanceof Error)return o;const r=e?`${e}: ${String(o)}`:String(o);return new Error(r)},U=(o,e,r)=>{const t=no(o,r);B.error(`BidiComponent Error: ${t.message}`,o),e(t)},ie=(o,e)=>{try{const t=document.createRange().createContextualFragment(o);e.appendChild(t)}catch(r){B.warn("createContextualFragment failed, falling back to innerHTML",r),e.innerHTML=o}},so=({containerRef:o,setError:e,skip:r=!1})=>{const t=u.useRef(null),{htmlContent:n,cssContent:s,cssSourcePath:a,componentName:i,componentRegistry:{getBidiComponentURL:f}}=I(F),l=u.useMemo(()=>{if(a)return f(i,a)},[i,a,f]);return u.useEffect(()=>{if(r)return;const d=o.current;if(d)try{if(t.current?.parentNode===d&&d.removeChild(t.current),t.current=document.createElement("div"),n){const c=document.createElement("div");ie(n,c),t.current.appendChild(c)}if(s){const c=document.createElement("style");c.textContent=s,t.current.appendChild(c)}else if(l){const c=document.createElement("link");c.href=l,c.rel="stylesheet",c.onerror=()=>{U(new Error(`Failed to load CSS from ${l}`),e)},t.current.appendChild(c)}d.appendChild(t.current)}catch(c){U(c,e,"Failed to process HTML/CSS content")}},[n,s,o,l,e,r]),t};class le{constructor(){this.hashSeed=2166136261,this.hashPrime=16777619,this.cache=new Map}computeHash(e){let r=this.hashSeed;for(let t=0;t<e.length;t++)r^=e.charCodeAt(t),r=Math.imul(r>>>0,this.hashPrime)>>>0;return(r>>>0).toString(16)}getOrCreateUrlForJs(e,r){const t=this.computeHash(e),n=this.cache.get(t);if(n)return{url:n,hash:t};const s=`${e}
2
2
  //# sourceURL=${r}-${t}.js`,a=new Blob([s],{type:"text/javascript"}),i=URL.createObjectURL(a);return this.cache.set(t,i),{url:i,hash:t}}}const de=new le,fe="events";function ge(o){if(o.includes(N))throw new Error("Base component id must not contain the delimiter sequence");return`${te}_${o}${N}${fe}`}const P=async({componentId:o,componentIdForWidgetMgr:e,componentName:r,data:t,formId:n,fragmentId:s,getWidgetValue:a,moduleUrl:i,parentElement:f,widgetMgr:l})=>{const d=await import(i);if(!d)throw new Error("JS module does not exist.");if(!d.default||typeof d.default!="function")throw new Error("JS module does not have a default export function.");const c=(b,x)=>{let p={};try{p={...a(),[b]:x}}catch(g){B.error(`Failed to get existing value for ${b}`,g),p={[b]:x}}l.setJsonValue({id:e,formId:n},p,{fromUi:!0},s)},S=(b,x)=>{if(n){B.warn("BidiComponent: setTriggerValue ignored inside st.form. Triggers are not allowed in forms; use setStateValue and form submit instead.");return}const p=ge(e);l.setTriggerValue({id:p,formId:n},{fromUi:!0},s,{event:b,value:x})};return d.default({name:r,data:t,key:o,parentElement:f,setStateValue:c,setTriggerValue:S})},uo=({containerRef:o,setError:e,skip:r=!1})=>{const n=`st-bidi-component-${u.useMemo(()=>fo(),[])}`,{componentName:s,data:a,formId:i,fragmentId:f,getWidgetValue:l,id:d,jsContent:c,jsSourcePath:S,theme:b,widgetMgr:x,componentRegistry:{getBidiComponentURL:p}}=I(F),g=u.useMemo(()=>{if(S)return p(s,S)},[s,S,p]),y=u.useRef(),k=u.useRef(),T=u.useRef(!1);u.useEffect(()=>{const{current:h}=o;if(r||!c&&!g||!h)return;(async()=>{try{if(c){const{url:C}=de.getOrCreateUrlForJs(c,`st-bidi-${s}`);y.current=await P({componentId:n,componentIdForWidgetMgr:d,componentName:s,data:a,formId:i,fragmentId:f,getWidgetValue:l,moduleUrl:C,parentElement:h,widgetMgr:x})}else if(g){const C=g;try{await new Promise((v,z)=>{const R=document.createElement("script");R.type="module",R.src=C,R.async=!0,R.onload=()=>v(),R.onerror=()=>z(new Error(`Failed to load script from ${g}`)),document.head.appendChild(R),k.current=R}),y.current=await P({componentId:n,componentIdForWidgetMgr:d,componentName:s,data:a,formId:i,fragmentId:f,getWidgetValue:l,moduleUrl:C,parentElement:h,widgetMgr:x})}catch(v){throw no(v,`Failed to load or execute script from ${g}`)}}}catch(C){T.current||U(C,e)}})()},[n,s,o,a,i,f,l,d,c,g,e,r,x,b]),u.useEffect(()=>()=>{T.current=!0;const h=y.current;h&&Promise.resolve(h).then(C=>{C?.()}).catch(C=>{B.error("Failed to run custom component cleanup",C)});const E=k.current;E?.parentNode&&E.parentNode.removeChild(E)},[])},Ce=D("div",{target:"e10xsstg0"})(({cssCustomProperties:o})=>({...o,display:"contents"})),L=D("div",{target:"e10xsstg1"})({width:"100%",height:"100%"}),xe=u.memo(()=>{const o=u.useRef(null),e=u.useRef(null),[r,t]=u.useState(!1),[n,s]=u.useState(null),{id:a}=I(F);u.useEffect(()=>{if(o.current)try{if(o.current.shadowRoot){e.current=o.current.shadowRoot,t(!0);return}e.current=o.current.attachShadow({mode:"open"}),t(!0)}catch(f){U(f,s,"Failed to create shadow DOM")}},[a]);const i=!r||!!n;return so({containerRef:e,setError:s,skip:i}),uo({containerRef:e,setError:s,skip:i}),n?m(H,{name:"BidiComponent Error",message:n.message,stack:n.stack}):m(L,{ref:o,"data-testid":"stBidiComponentIsolated"})}),pe=u.memo(()=>{const o=u.useRef(null),[e,r]=u.useState(null),t=!!e;return so({containerRef:o,setError:r,skip:t}),uo({containerRef:o,setError:r,skip:t}),e?m(H,{name:"BidiComponent Error",message:e.message,stack:e.stack}):m(L,{ref:o,"data-testid":"stBidiComponentRegular"})}),me=({children:o})=>{const{theme:e}=I(F),r=u.useMemo(()=>ue(e),[e]);return m(Ce,{cssCustomProperties:r,children:o})},be=({element:o,widgetMgr:e,fragmentId:r,componentRegistry:t})=>{const{isolateStyles:n}=o;return m(ce,{element:o,widgetMgr:e,fragmentId:r,componentRegistry:t,children:m(L,{className:"stBidiComponent",children:m(me,{children:n?m(xe,{}):m(pe,{})})})})},Re=u.memo(be);export{F as BidiComponentContext,Re as default};