pixel-virtual-tree 1.0.5 → 1.0.7

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.
package/lib/index.js CHANGED
@@ -25,7 +25,7 @@ object-assign
25
25
  *
26
26
  * This source code is licensed under the MIT license found in the
27
27
  * LICENSE file in the root directory of this source tree.
28
- */function Sg(){return Lg||(Lg=1,e=_g,"production"!==process.env.NODE_ENV&&function(){function t(e,t){var n=e.length;e.push(t),function(e,t,n){for(var r=n;r>0;){var o=r-1>>>1,a=e[o];if(!(i(a,t)>0))return;e[o]=t,e[r]=a,r=o}}(e,t,n)}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();return n!==t&&(e[0]=n,function(e,t,n){for(var r=n,o=e.length,a=o>>>1;r<a;){var l=2*(r+1)-1,c=e[l],s=l+1,d=e[s];if(i(c,t)<0)s<o&&i(d,c)<0?(e[r]=d,e[s]=t,r=s):(e[r]=c,e[l]=t,r=l);else{if(!(s<o&&i(d,t)<0))return;e[r]=d,e[s]=t,r=s}}}(e,n,0)),t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error),"object"==typeof performance&&"function"==typeof performance.now){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],s=[],d=1,u=null,f=3,h=!1,p=!1,m=!1,C="function"==typeof setTimeout?setTimeout:null,g="function"==typeof clearTimeout?clearTimeout:null,v="undefined"!=typeof setImmediate?setImmediate:null;function y(e){for(var i=n(s);null!==i;){if(null===i.callback)r(s);else{if(!(i.startTime<=e))return;r(s),i.sortIndex=i.expirationTime,t(c,i)}i=n(s)}}function w(e){if(m=!1,y(e),!p)if(null!==n(c))p=!0,O(b);else{var t=n(s);null!==t&&z(w,t.startTime-e)}}function b(t,i){p=!1,m&&(m=!1,N()),h=!0;var o=f;try{return function(t,i){var o=i;for(y(o),u=n(c);null!==u&&(!(u.expirationTime>o)||t&&!L());){var a=u.callback;if("function"==typeof a){u.callback=null,f=u.priorityLevel;var l=a(u.expirationTime<=o);o=e.unstable_now(),"function"==typeof l?u.callback=l:u===n(c)&&r(c),y(o)}else r(c);u=n(c)}if(null!==u)return!0;var d=n(s);return null!==d&&z(w,d.startTime-o),!1}(t,i)}finally{u=null,f=o,h=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var E=!1,M=null,A=-1,x=5,k=-1;function L(){return!(e.unstable_now()-k<x)}var H,_=function(){if(null!==M){var t=e.unstable_now();k=t;var n=!0;try{n=M(!0,t)}finally{n?H():(E=!1,M=null)}}else E=!1};if("function"==typeof v)H=function(){v(_)};else if("undefined"!=typeof MessageChannel){var S=new MessageChannel,V=S.port2;S.port1.onmessage=_,H=function(){V.postMessage(null)}}else H=function(){C(_,0)};function O(e){M=e,E||(E=!0,H())}function z(t,n){A=C(function(){t(e.unstable_now())},n)}function N(){g(A),A=-1}var I=function(){};e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){p||h||(p=!0,O(b))},e.unstable_forceFrameRate=function(e){e<0||e>125?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):x=e>0?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){var t;switch(f){case 1:case 2:case 3:t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=I,e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,o){var a,l,u=e.unstable_now();if("object"==typeof o&&null!==o){var f=o.delay;a="number"==typeof f&&f>0?u+f:u}else a=u;switch(r){case 1:l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}var C=a+l,g={id:d++,callback:i,priorityLevel:r,startTime:a,expirationTime:C,sortIndex:-1};return a>u?(g.sortIndex=a,t(s,g),null===n(c)&&g===n(s)&&(m?N():m=!0,z(w,a-u))):(g.sortIndex=C,t(c,g),p||h||(p=!0,O(b))),g},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),_g;var e}var Vg=(Hg||(Hg=1,"production"===process.env.NODE_ENV?xg.exports=(Ag||(Ag=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(!(0<i(o,t)))break e;e[r]=t,e[n]=o,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,a=o>>>1;r<a;){var l=2*(r+1)-1,c=e[l],s=l+1,d=e[s];if(0>i(c,n))s<o&&0>i(d,c)?(e[r]=d,e[s]=n,r=s):(e[r]=c,e[l]=n,r=l);else{if(!(s<o&&0>i(d,n)))break e;e[r]=d,e[s]=n,r=s}}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],s=[],d=1,u=null,f=3,h=!1,p=!1,m=!1,C="function"==typeof setTimeout?setTimeout:null,g="function"==typeof clearTimeout?clearTimeout:null,v="undefined"!=typeof setImmediate?setImmediate:null;function y(e){for(var i=n(s);null!==i;){if(null===i.callback)r(s);else{if(!(i.startTime<=e))break;r(s),i.sortIndex=i.expirationTime,t(c,i)}i=n(s)}}function w(e){if(m=!1,y(e),!p)if(null!==n(c))p=!0,O(b);else{var t=n(s);null!==t&&z(w,t.startTime-e)}}function b(t,i){p=!1,m&&(m=!1,g(x),x=-1),h=!0;var o=f;try{for(y(i),u=n(c);null!==u&&(!(u.expirationTime>i)||t&&!H());){var a=u.callback;if("function"==typeof a){u.callback=null,f=u.priorityLevel;var l=a(u.expirationTime<=i);i=e.unstable_now(),"function"==typeof l?u.callback=l:u===n(c)&&r(c),y(i)}else r(c);u=n(c)}if(null!==u)var d=!0;else{var C=n(s);null!==C&&z(w,C.startTime-i),d=!1}return d}finally{u=null,f=o,h=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var E,M=!1,A=null,x=-1,k=5,L=-1;function H(){return!(e.unstable_now()-L<k)}function _(){if(null!==A){var t=e.unstable_now();L=t;var n=!0;try{n=A(!0,t)}finally{n?E():(M=!1,A=null)}}else M=!1}if("function"==typeof v)E=function(){v(_)};else if("undefined"!=typeof MessageChannel){var S=new MessageChannel,V=S.port2;S.port1.onmessage=_,E=function(){V.postMessage(null)}}else E=function(){C(_,0)};function O(e){A=e,M||(M=!0,E())}function z(t,n){x=C(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){p||h||(p=!0,O(b))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,o){var a=e.unstable_now();switch(o="object"==typeof o&&null!==o&&"number"==typeof(o=o.delay)&&0<o?a+o:a,r){case 1:var l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}return r={id:d++,callback:i,priorityLevel:r,startTime:o,expirationTime:l=o+l,sortIndex:-1},o>a?(r.sortIndex=o,t(s,r),null===n(c)&&r===n(s)&&(m?(g(x),x=-1):m=!0,z(w,o-a))):(r.sortIndex=l,t(c,r),p||h||(p=!0,O(b))),r},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(kg)),kg):xg.exports=Sg()),xg.exports);const Og=Symbol(),zg=Symbol(),Ng="undefined"==typeof window||/ServerSideRendering/.test(window.navigator&&window.navigator.userAgent)?l:u,Ig=Vg.unstable_runWithPriority?e=>{try{Vg.unstable_runWithPriority(Vg.unstable_NormalPriority,e)}catch(t){if("Not implemented."!==t.message)throw t;e()}}:e=>e();function Dg(e,t){const n=d(e)[Og];if("object"==typeof process&&"production"!==process.env.NODE_ENV&&!n)throw new Error("useContextSelector requires special context");const{v:{current:r},n:{current:i},l:o}=n,a=t(r),[l,c]=v((e,n)=>{if(!n)return[r,a];if("p"in n)throw n.p;if(n.n===i)return Object.is(e[1],a)?e:[r,a];try{if("v"in n){if(Object.is(e[0],n.v))return e;const r=t(n.v);return Object.is(e[1],r)?e:[n.v,r]}}catch(e){}return[...e]},[r,a]);return Object.is(l[1],a)||c(),Ng(()=>(o.add(c),()=>{o.delete(c)}),[o]),l[1]}const Tg=function(e){const t=c({[Og]:{v:{current:e},n:{current:-1},l:new Set,u:e=>e()}});var n;return t[zg]=t.Provider,t.Provider=(n=t.Provider,({value:e,children:t})=>{const r=a(e),i=a(0),[o,l]=s(null);o&&(o(e),l(null));const c=a();if(!c.current){const e=new Set,t=(t,n)=>{i.current+=1;const r={n:i.current};(null==n?void 0:n.suspense)&&(r.n*=-1,r.p=new Promise(e=>{l(()=>t=>{r.v=t,delete r.p,e(t)})})),e.forEach(e=>e(r)),t()};c.current={[Og]:{v:r,n:i,l:e,u:t}}}return Ng(()=>{r.current=e,i.current+=1,Ig(()=>{c.current[Og].l.forEach(t=>{t({n:i.current,v:e})})})},[e]),m(n,{value:c.current},t)}),delete t.Consumer,t}([Eg,()=>{}]),Zg=({children:t,useTableRef:n,totalWidth:r})=>{const i=a(null);return l(()=>{n&&i.current&&n(i)},[n]),e("table",{className:"ff-spreadsheet-table",ref:i,style:{minWidth:`${60+r}px`,tableLayout:"fixed"},children:t})},jg=t=>e("tr",{...t}),Rg=t=>e("tr",{className:"ff-spreadsheet-row-header",...t});function Bg(){return Dg(Tg,([,e])=>e)}function Pg(e){return Dg(Tg,([t])=>e(t))}const Fg=({selected:t,onSelect:n})=>{const i=r.useCallback(()=>{n()},[n]);return e("th",{className:"ff-spreadsheet-corner-header",onClick:i,tabIndex:0,children:e("div",{className:z("corner-header",{"ff-spreadsheet-header--selected":t}),children:e(P,{variant:t?"dark":"light",color:t?"var(--hover-color)":"var(--text-color)",name:"excel_corner_menu"})})})},Ug=t=>function(n){const i=Bg(),o=r.useCallback(()=>i({type:Ip}),[i]),a=Pg(e=>e.selected instanceof gC);return e(t,{...n,selected:a,onSelect:o})},qg=t=>function(n){const i=Bg(),o=r.useCallback((e,t)=>i(function(e,t){return{type:Np,payload:{column:e,extend:t}}}(e,t)),[i]),a=Pg(e=>e.selected.hasEntireColumn(n.column)),l=Pg(e=>e.selectedColumn??void 0),c=Pg(e=>e.active?$m(e.active,e.model.data):void 0);return e(t,{...n,cell:c,selected:a,selectedColumn:l,onSelect:o,scrollToColumn:n.scrollToColumn})},Wg=qg(({column:t,label:i,selected:o,onSelect:a,setContextMenu:l,deleteColumn:c,addColumnLeft:s,addColumnRight:d,columnContextEnable:u,cell:f,selectedColumn:p,minimumColumnWidth:m,maxColLimit:C,disableDeleteOption:g,contextMenu:v,onAddColumn:y,onDeleteColumn:w,setVisibleRange:b,scrollToColumn:E})=>{const M=Bg(),A=Pg(e=>e.model.data),x=Pg(e=>e.active),k=m,L=Pg(e=>e.columnDimensions[t]?.width||k),H=Pg(e=>e.model.data),{columnCount:_}=WC(H),S=r.useRef(A),V=r.useCallback(()=>{if(x){S.current?.[x.row]?.[x.column]!==PC&&S.current?.[0]?.length===A?.[0]?.length||(S.current=A);const e=S.current?.[x.row]?.[x.column]?.value,t=A?.[x.row]?.[x.column]?.value;return e===t}return!1},[x,A,S,PC]),O=e=>{b(t=>{const n={...t,end:"increment"===e?t.end+1:t.end-1};return p&&E(p),n})},N=h(()=>{const e=f?.contextDisable?.["Delete Column"]&&V();return[{label:"Add Column Left",value:"Add Column Left",iconName:"plus_icon",action:()=>{O("increment"),s(k),y?.(p??t,!0)},disableTooltip:"Column limit reached",visible:f?.contextDisable?.["Add Column Left"]??!1,disable:_>=C},{label:"Add Column Right",value:"Add Column Right",iconName:"plus_icon",action:()=>{O("increment"),d(k),y?.(p??t,!1)},disableTooltip:"Column limit reached",visible:f?.contextDisable?.["Add Column Right"]??!1,disable:_>=C},...g?[]:[{label:"Delete Column",value:"Delete Column",iconName:"delete",action:()=>{O("decrement"),c(),w?.(p??t)},disableTooltip:"",visible:!!e,disable:!1}]]},[p,f,s,d,c,k,_,C,g,y,w,t,V]),I=r.useCallback((e,n)=>{const r=n?t-1:t,i=Math.max(r,0);a(i,e.shiftKey);const o=e.clientX,l=L,c=e=>{const t=Math.max(k,l+(e.clientX-o));M(Em(i,t))},s=()=>{document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",s),M(Km())};document.addEventListener("mousemove",c),document.addEventListener("mouseup",s),M(Gm())},[t,L]),D=r.useCallback(e=>M(Fm(e)),[M]),T=r.useCallback(e=>{a(t,e.shiftKey)},[a,t]),Z=r.useCallback(e=>{e.preventDefault(),a(t,e.shiftKey),l({open:u,contextType:"column",options:N})},[t,p,u,N]);return r.useEffect(()=>{void 0!==p&&"column"===v?.contextType&&l(e=>({open:e.open,contextType:"column",options:N}))},[t,p,u,N,"column"===v?.contextType]),n("th",{className:z("ff-spreadsheet-header",{"ff-spreadsheet-header--selected":o}),style:{minWidth:`${L}px`},onClick:T,onContextMenu:Z,tabIndex:0,children:[e(F,{fontWeight:"medium",children:i??Qg(t)}),e("div",{className:"drag-column-selector drag-column-left",onMouseDown:e=>I(e,!1),onDoubleClick:()=>M(Em(t,k)),onClick:()=>D({row:-1,column:t})}),e("div",{className:"drag-column-selector drag-column-right",onMouseDown:e=>I(e,!0),onDoubleClick:()=>M(Em(t,k)),onClick:()=>D({row:-1,column:t})})]},t)});function Qg(e){let t="",n=e;for(;n>=0;)t=String.fromCharCode(65+n%26)+t,n=Math.floor(n/26)-1;return t}const Gg=({row:t,label:i,selected:o,onSelect:a,setContextMenu:l,addRowTop:c,addRowBottom:s,deleteRow:d,rowContextEnable:u,selectedRow:f,cell:h,maxRowLimit:p,disableDeleteOption:m,contextMenu:C,setVisibleRange:g,scrollToRow:v})=>{const y=Bg(),w=Pg(e=>e.rowDimensions[t]?.height||32),b=Pg(e=>e.model.data),{rowCount:E}=WC(b),M=e=>{g(t=>{const n={...t,end:"increment"===e?t.end+1:t.end-1};return f&&v(f),n})},A=r.useMemo(()=>[{label:"Add Row Top",value:"Add Row Top",iconName:"plus_icon",action:()=>{M("increment"),c()},disableTooltip:"Row limit reached",visible:h?.contextDisable?.["Add Row Top"]??!1,disable:E>=p},{label:"Add Row Bottom",value:"Add Row Bottom",iconName:"plus_icon",action:()=>{M("increment"),s()},disableTooltip:"Row limit reached",visible:h?.contextDisable?.["Add Row Bottom"]??!1,disable:E>=p},...m?[]:[{label:"Delete Row",value:"Delete Row",iconName:"delete",action:()=>{M("decrement"),d()},disableTooltip:"",visible:h?.contextDisable?.["Delete Row"]??!1,disable:!1}]],[f,t]),x=r.useCallback((e,n)=>{const r=n?t:t-1,i=Math.max(r,0);a(i,e.shiftKey);const o=e.clientY,l=w,c=e=>{const t=Math.max(32,l+(e.clientY-o));y(bm(i,t))},s=()=>{document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",s),y(Km())};document.addEventListener("mousemove",c),document.addEventListener("mouseup",s),y(Km())},[w,t]),k=r.useCallback(e=>y(Fm(e)),[y]),L=r.useCallback(e=>{a(t,e.shiftKey)},[t]),H=r.useCallback(e=>{e.preventDefault(),a(t,e.shiftKey),l({open:u,contextType:"row",options:A})},[t,u,A,f]);return r.useEffect(()=>{void 0!==f&&"row"===C?.contextType&&l(e=>({open:e.open,contextType:"row",options:A}))},[t,u,A,f,"row"===C?.contextType]),n("th",{className:z("ff-spreadsheet-header",{"ff-spreadsheet-header--selected":o}),style:{height:`${w}px`,minWidth:"60px"},onClick:L,onContextMenu:H,tabIndex:0,children:[e(F,{fontWeight:"medium",children:void 0!==i?i:t+1}),e("div",{className:"drag-row-selector drag-row-down",onMouseDown:e=>x(e,!0),onDoubleClick:()=>y(bm(t,32)),onClick:()=>k({row:t,column:-1})}),e("div",{className:"drag-row-selector drag-row-up",onMouseDown:e=>x(e,!1),onDoubleClick:()=>y(bm(t,32)),onClick:()=>k({row:t,column:-1})})]})},Kg=t=>function(n){const i=Bg(),o=Pg(e=>e.selected.hasEntireRow(n.row)),a=Pg(e=>e.active?$m(e.active,e.model.data):void 0),l=Pg(e=>e.selectedRow??void 0),c=r.useCallback((e,t)=>i(function(e,t){return{type:zp,payload:{row:e,extend:t}}}(e,t)),[i]);return e(t,{...n,selected:o,cell:a,selectedRow:l,onSelect:c,scrollToRow:n.scrollToRow})},Yg=({row:t,column:n,DataViewer:i,active:o,dragging:a,mode:l,data:c,evaluatedData:s,select:d,activate:u,setCellDimensions:f,setCellData:h})=>{const p=r.useRef(null),m=r.useMemo(()=>({row:t,column:n}),[t,n]),C=r.useCallback(e=>{e.preventDefault(),window.getSelection()?.removeAllRanges(),"view"===l&&(f(m,LC(e.currentTarget)),e.shiftKey?d(m):u(m))},[l,f,m,d,u]),g=r.useCallback(e=>{a&&(f(m,LC(e.currentTarget)),d(m))},[f,d,a,m]);return r.useEffect(()=>{const e=p.current;if(!e)return;const t=()=>{f(m,LC(e))};t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[f,m]),c&&c.DataViewer&&(i=c.DataViewer),e("td",{ref:p,style:{...c?.style,..."dropDown"===c?.inputType?.type&&{fontSize:"12px"},textDecoration:"underline"===c?.style?.textDecoration?c?.style?.textDecoration:"none"},className:z("ff-spreadsheet-cell",c?.className,{"ff-spreadsheet-active-cell":o||a}),onMouseEnter:g,onMouseDown:C,tabIndex:0,children:e(i,{row:t,column:n,cell:c,active:o,evaluatedCell:s,setCellData:h,inputValue:()=>null})})},Xg=t=>function(n){const{row:i,column:o}=n,a=Bg(),l=r.useMemo(()=>({row:i,column:o}),[i,o]),c=r.useCallback(e=>a(Um(l,e)),[a,l]),s=r.useCallback(e=>a(function(e){return{type:Tp,payload:{point:e}}}(e)),[a]),d=r.useCallback(e=>a(Fm(e)),[a]),u=r.useCallback((e,t)=>a(qm(e,t)),[a]),f=Pg(e=>kC(e.active,l)),h=Pg(e=>f?e.mode:"view"),p=Pg(e=>$m(l,e.model.data)),m=Pg(e=>$m(l,e.model.evaluatedData)),C=Pg(e=>e.dragging),g=Pg(e=>e.copied?.has(l)||!1);return e(t,{...n,active:f,copied:g,dragging:C,mode:h,evaluatedData:m,data:p,select:s,activate:d,setCellDimensions:u,setCellData:c})},Jg=({cell:r,evaluatedCell:i,active:o})=>{const a=function(e,t){const n=t?.value??e?.value;if(n&&"object"==typeof n)return n.toString();return n}(r,i);return e("span","boolean"==typeof a?{className:"ff-spreadsheet-data-viewer ff-spreadsheet-data-viewer--boolean",children:$g(a)}:{className:z("ff-spreadsheet-data-viewer",{"ff-spreadsheet-data-viewer--preserve-breaks":jC(a)}),children:o||"dropDown"!==r?.inputType?.type?o||"file"!==r?.inputType?.type?!o&&a:e(t,{children:G(r?.value)?n("div",{className:"ff-spreadsheet-data-viewer--without-fileType",children:[e(P,{name:"attachment_icon"})," Attachment"]}):(n=>{if(G(n))return e(t,{});return JSON.parse(n).map(t=>e("div",{className:"ff-spreadsheet-data-viewer--fileType",children:e(ln,{width:r?.style?.width??100,title:t?.name?.split("*")?.[0]??""})},t.name))})(a)}):n("div",{className:"ff-spreadsheet-data-viewer--dropdownType",children:[a,e(P,{name:"arrow_down",height:8,className:"dropdownType-icon"})]})})};function $g(e){return e?"TRUE":"FALSE"}const ev=i.forwardRef(({initialValue:t="",onChange:n,className:r="",style:o={}},c)=>{const s=a(null);i.useImperativeHandle(c,()=>s.current),l(()=>{s.current&&t!==s.current.innerText&&(s.current.innerText=t)},[t]);const d=()=>{if(s.current){const e=s.current.innerText;n?.(e)}};return e("div",{style:o,children:e("div",{ref:s,className:`editable-cell ${r}`,contentEditable:!0,suppressContentEditableWarning:!0,onKeyDown:e=>{if("Enter"===e.key){if(e.altKey||e.shiftKey)return e.preventDefault(),document.execCommand("insertLineBreak"),void d();s.current?.blur()}"Delete"!==e.key&&"Backspace"!==e.key||e.stopPropagation()},onInput:d,onPaste:e=>{e.preventDefault();const t=e.clipboardData.getData("text/plain"),n=window.getSelection();if(!n||!n.rangeCount)return;const r=n.getRangeAt(0);r.deleteContents();const i=document.createTextNode(t);r.insertNode(i),r.setStartAfter(i),r.collapse(!0),n.removeAllRanges(),n.addRange(r),d()},spellCheck:!1,autoCorrect:"off",autoCapitalize:"off",style:{outline:"none",transition:"border 0.2s",whiteSpace:"pre-wrap",wordBreak:"break-word",fontFamily:"inherit",fontSize:"inherit",lineHeight:"normal",minHeight:"24px",verticalAlign:"middle",caretColor:"black",height:"inherit",maxHeight:"inherit",display:"block",position:"relative",paddingBottom:"2px"}})})}),tv=({onChange:t,cell:n})=>{const i=r.useRef(null),o=r.useCallback(e=>{t({...n,value:e,style:n?.style,inputType:n?.inputType??{type:"text"}})},[t,n]);r.useEffect(()=>{i.current&&function(e){if(e)if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)e.selectionStart=e.selectionEnd=e.value.length;else if(e.isContentEditable){const t=document.createRange(),n=window.getSelection();t.selectNodeContents(e),t.collapse(!1),n?.removeAllRanges(),n?.addRange(t)}}(i.current)},[]);return e("div",{className:"ff-spreadsheet-data-editor",children:e(ev,{ref:i,initialValue:n?.value??"",onChange:o,className:"ff-spreadsheet-cell-textarea",style:{...n?.style,borderTop:"",borderBottom:"",borderLeft:"",borderRight:""}})})},nv=t=>{const i=r.useRef(null),o=r.useRef(null),a=Bg(),l=r.useCallback((e,t)=>a(Um(e,t)),[a]),c=r.useCallback(e=>a(Fm(e)),[a]),s=r.useCallback(()=>a({type:Up}),[a]),d=r.useCallback(e=>a({type:Cm,payload:{autofill:e}}),[a]),u=r.useCallback(e=>a(function(e){return{type:Xp,payload:{changes:e}}}(e)),[a]),f=r.useCallback(()=>{a({type:qp})},[a]),h=Pg(e=>e.rowDimensions),p=Pg(e=>e.active),m=Pg(e=>e.mode),C=Pg(e=>e.active?$m(e.active,e.model.data):void 0),g=Pg(e=>e.selected),v=Pg(e=>g&&IC(e.rowDimensions,e.columnDimensions,e.model.data,e.selected)),y=Pg(e=>{let t=p?zC(p,e.rowDimensions,e.columnDimensions):void 0;return t={top:t?.top?t?.top:0,height:t?.height?t?.height:0,left:t?.left?t?.left:0,width:t?.width?t?.width:0},t}),w=r.useMemo(()=>!p||!y||p.row<t.visibleRowRange.start||p.row>=t.visibleRowRange.end||p.column<t.visibleColRange.start||p.column>=t.visibleColRange.end,[p,y,t.visibleRowRange,t.visibleColRange]),b=r.useRef(void 0),E=r.useRef(null),M=r.useRef(void 0),A=r.useCallback(e=>{p&&l(p,e)},[l,p]),[x,k]=r.useState({value:"",name:""}),[L,H]=r.useState(!1),[_,S]=r.useState(),[V,O]=r.useState([]);r.useEffect(()=>{C&&p&&t.getActiveCell({value:C.value,active:p});const n=i.current;if(!w&&n){if(n.focus({preventScroll:!0}),"file"===C?.inputType?.type&&C?.value)try{const e=JSON.parse(C.value).map(e=>new File([new Blob],e.name.split("*")[0]??"default"));O(e)}catch(e){console.error("Error parsing cell value for files:",e),O([])}else O([]);if("dropDown"===C?.inputType?.type){k({value:C?.value,name:C?.value}),H(e=>!e);const t=C?.inputType?.options?.map(t=>({disable:t.disable,label:e("span",{style:{color:t.color},children:t.label}),value:t.value}));S(t)}}},[i,w,p]),r.useEffect(()=>{const e=E.current,t=M.current;if(E.current=p,M.current=C,!e||!t)return;const n=p?.row!==e.row||p?.column!==e.column;if(n||"edit"!==m){const e=b.current;t!==e?u([{prevCell:e||null,nextCell:t}]):n||C===t||u([{prevCell:t,nextCell:C||null}]),b.current=C}});const N=C&&C.DataEditor||t.DataEditor,I=C&&C.readOnly,D=r.useCallback(e=>{p&&(e.preventDefault(),d(!0))},[c,d,p]),T=r.useCallback(e=>{e.preventDefault(),t.setContextMenu({open:t.contextOption?.open??!1,contextType:t.contextOption?.contextType??null,options:t.contextOption?.options||[]})},[t]),Z=v?.height!==y?.height||v?.width!==y?.width,j=r.useCallback(e=>{p&&Z&&(qm(p,LC(e.currentTarget)),c(p))},[p,Z]),R=t.isAtRight?t.maxWidth-(y?.left-t.scrollPos.left)+100:t.maxWidth,B=t.isAtBottom?t.maxHeight-(y?.top-t.scrollPos.top)+64:t.maxHeight,P=["file","dropDown"].includes(C?.inputType?.type||"");return n("div",{ref:i,className:z("ff-spreadsheet-active-cell",`ff-spreadsheet-active-cell--${m}`,{"ff-spreadsheet-active-cell--hidden":w,"ff-spreadsheet-active-cell--dragging":Z&&"text"!==C?.inputType?.type}),onMouseDown:j,style:{...y,backgroundColor:C?.style?.backgroundColor,...P?{display:"flex",alignItems:C?.style?.alignContent,justifyContent:C?.style?.textAlign}:{},..."edit"===m&&p?{minWidth:Math.min(y?.width,t.maxWidth),minHeight:Math.min(y?.height,t.maxHeight),height:"auto",maxWidth:`${R}px`,maxHeight:`${B}px`,overflow:"auto",..."dropDown"===C?.inputType?.type?{}:{padding:"2px 4px 0px 4px",width:"max-content"}}:{}},onContextMenu:T,onClick:"view"!==m||I?void 0:s,tabIndex:0,children:[e("div",{className:P?"":"active-cell-main",children:"dropDown"===C?.inputType?.type?e(or,{...C?.inputType?.inputProps,dropDownRef:o,showOptions:{open:!("edit"!==m||!p),toggle:L},selectedOption:x,optionsList:_||[],height:26,showLabel:!1,disabled:!t.editable,showBorder:!1,optionZIndex:5e3,onChange:e=>{k({value:e.value,name:e.label}),A({...C,value:e.value,style:C?.style,inputType:C?.inputType})}}):"file"===C?.inputType?.type?e(Mp,{...C?.inputType?.inputProps,label:"",onFileListClick:e=>{const n=e.target.closest(".ff-attachment-files"),r=e.target.closest(".ff-icon-container, .ff-icon-click, .ff-icon-danger");if(n&&!r&&C?.value&&t.attachmentAction?.viewAttachment)try{const e=JSON.parse(C.value),r=n.parentElement?.querySelectorAll(".ff-attachment-files")||[],i=Array.from(r).indexOf(n);if(-1===i||!e[i])return void console.error("File index not found or invalid");const o=e[i];t.attachmentAction.viewAttachment(o.id,o.name?.split("*")[0]??"default")}catch(e){console.error("Error parsing cell value:",e)}else console.warn("Missing file element, icon click, cell value, or viewAttachment action")},selectedFiles:V,onFilesChange:async(e,n,r)=>{try{if("ADD"===r&&"file"===C?.inputType?.type){let n=[];try{C?.value&&(n=JSON.parse(C.value))}catch(e){console.error("Error parsing cell.value:",e)}let r=0;const i=e.filter((e,t,i)=>{const o=e.name.split("*")[0],a=i.findIndex(e=>e.name.split("*")[0]===o)!==t,l=n.some(e=>e.name.split("*")[0]===o);return!a&&!l||(r++,!1)});if(n.length+i.length>5)return void Pc.info("Cannot upload more than 5 files.");if(t.attachmentAction?.addAttachment&&i.length>0)try{let e=0,r=0,o=0;const l=V?.length+i?.length,c=l>0?25*l:1,s=[...n],d=i?.map(async e=>{try{if(e.name.includes("*"))return{file:e,status:"existing",data:{name:e.name}};const n=await(t?.attachmentAction?.addAttachment(e));if(!n||"string"==typeof n&&0===n.trim().length)return{file:e,status:"failed",reason:"no response"};if("string"==typeof n)try{const t=JSON.parse(n);return 507===t.responseCode?{file:e,status:"memory_full",reason:"no memory"}:400===t.responseCode?{file:e,status:"failed",reason:"invalid file"}:t?.id&&t?.name?{file:e,status:"success",data:t}:(console.error(`Invalid response structure for ${e.name}:`,t),{file:e,status:"failed",reason:"invalid response"})}catch(t){return console.error(`Parse error for ${e.name}:`,t),{file:e,status:"failed",reason:"parse error"}}if("object"==typeof n&&null!==n){const t=n;return t?.id&&t?.name?{file:e,status:"success",data:t}:(console.error(`Invalid response structure for ${e.name}:`,n),{file:e,status:"failed",reason:"invalid response"})}return console.error(`Unknown response for ${e.name}:`,n),{file:e,status:"failed",reason:"unknown"}}catch(t){return console.error(`Upload failed for ${e.name}:`,t),{file:e,status:"failed",reason:"upload error"}}});if((await Promise.allSettled(d)).forEach(t=>{if("fulfilled"===t.status&&t.value){const{status:n,data:i}=t.value;"success"===n&&i?.id&&i?.name?(s.push(i),e++):"existing"===n&&i?.name?s.push(i):"memory_full"===n?o++:r++}else r++}),e>0||s.length>n.length){const e=s.length>0?JSON.stringify(s):"";A({...C,value:e,style:C?.style,inputType:C?.inputType}),a(bm(p?.row||0,Math.max(c,h?.[p.row]?.height||c))),O(s.map(e=>new File([new Blob],e.name?.split("*")[0]??"default")))}o>0&&Pc.info("No memory available to add the file"),e>0&&Pc.success(`${e} file${e>1?"s":""} uploaded successfully`),r>0&&Pc.info(`${r} unsupported ${r>1?"files":"file"}. Please check the file formats.`)}catch(e){console.error("Upload operation failed:",e),Pc.error("Operation failed")}}else if("DELETE"===r&&"file"===C?.inputType?.type)try{let e=[...C&&JSON.parse(C.value)],r=0;for(const i of n||[]){const n=e.findIndex(e=>e.name.split("*")[0]===i.name.split("*")[0]),o=e[n]?.id;if(-1!==n&&o&&t.attachmentAction?.deleteAttachment)try{const a=await t.attachmentAction.deleteAttachment(o);"SUCCESS"===a||"object"==typeof a&&null!==a&&("status"in a&&"SUCCESS"===a.status||"responseCode"in a&&200===a.responseCode)?(e.splice(n,1),r++):console.error(`Delete failed for ${i.name}: Invalid response`,a)}catch(e){console.error(`Delete error for ${i.name}:`,e),Pc.error("Error deleting file")}else console.error(`Cannot delete ${i.name}: Invalid fileId or no match`,{index:n,fileId:o,hasDeleteAttachment:!!t.attachmentAction?.deleteAttachment}),Pc.error("Failed to delete file: Invalid file data")}if(r>0){const t=e.length>0?JSON.stringify(e):"";A({...C,value:t,style:C?.style,inputType:C?.inputType}),O(e?.map(e=>new File([new Blob],e.name.split("*")[0]))),Pc.success(`${r} file${r>1?"s":""} deleted successfully`)}else if(n?.length){const t=e?.filter(e=>e.id&&e.name);if(t.length<e.length){const e=t.length>0?JSON.stringify(t):"";A({...C,value:e,style:C?.style,inputType:C?.inputType}),O(t.map(e=>new File([new Blob],e.name.split("*")[0]))),Pc.error("Failed to delete file(s). Invalid file data detected.")}else Pc.error("Failed to delete file(s). No valid files removed.")}}catch(e){console.error("Delete operation failed:",e),Pc.error("Delete operation failed")}}catch(e){console.error("handleFilesChange error:",e),Pc.error("Operation failed")}},disabled:!t.editable,maxFiles:5,buttonLabel:"+ Attachments",buttonVariant:"tertiary",deleteButton:t.editable,selectedFileMessage:"Duplicate attachments not allowed within the same row",addAttachmentButton:t.editable,isInfoIconRequired:!1,truncateMaxLimit:(y?.width??0)-60}):"edit"===m&&p&&t.editable?e(N,{row:p.row,column:p.column,cell:C,onChange:A,exitEditMode:f}):e(ev,{initialValue:C?.value,onChange:()=>{},className:"ff-spreadsheet-cell-textarea",style:{...C?.style,textDecoration:"underline"===C?.style?.textDecoration?"underline":"none",backgroundColor:Z?"#1e161f00":C?.style?.backgroundColor,pointerEvents:"none",borderTop:"",borderBottom:"",borderLeft:"",borderRight:""}})}),!["file"].includes(C?.inputType?.type??"")&&("edit"===m||p&&e("div",{onMouseDown:D,className:"select_dot"}))]})},rv=({dimensions:t,dragging:n,hidden:r,variant:i})=>{const o=Pg(e=>e.active),a=Pg(e=>e.autoFill),l=Pg(e=>o?zC(o,e.rowDimensions,e.columnDimensions):void 0),{width:c,height:s,top:d,left:u}=t||{};let f=l?.height??0,h=l?.width??0,p=c,m=s;return a.open&&c&&s&&l&&(c-h>s-f?(p=c,m=l.height):(m=s,p=l.width)),e("div",{className:z("ff-spreadsheet-floating-rect",{[`ff-spreadsheet-floating-rect--${i}`]:i,"ff-spreadsheet-floating-rect--dragging":n,"ff-spreadsheet-floating-rect--hidden":r}),style:{width:(p??0)+1,height:(m??0)+1,top:d,left:u}})},iv=({scrollPos:t={top:0,left:0}})=>{const n=Pg(e=>e.selected),i=Pg(e=>e.dragging),o=Pg(e=>e.selected.size(e.model.data)<2),a=Pg(e=>n&&IC(e.rowDimensions,e.columnDimensions,e.model.data,e.selected)),l=r.useMemo(()=>{if(a)return{...a,top:a.top-1,left:a.left-1,height:a.height-1,width:a.width-1}},[a,t]);return e(rv,{variant:"selected",dimensions:l,dragging:i,hidden:o||!a})},ov=({scrollPos:t={top:0,left:0}})=>{const n=Pg(e=>e.copied),i=null===n,o=Pg(e=>n&&NC(e.rowDimensions,e.columnDimensions,n)),a=r.useMemo(()=>{if(o)return{...o,top:o.top-1,left:o.left-1,height:o.height-1,width:o.width-1}},[o,t]);return e(rv,{variant:"copied",dimensions:a,hidden:i||!o,dragging:!1})},av=({getColorValue:t,disabled:n,initialColor:r})=>{const i=a(null),[o,l]=s(r);return e("div",{className:z("ff-excel-color-selector",{"color-selector-disabled":n}),style:{backgroundColor:o},onClick:()=>{i.current&&!n&&i.current.click()},children:e("input",{type:"color",disabled:n,className:z("ff-excel-color-selector-picker",{"color-selector-disabled":n}),ref:i,onChange:e=>{l(e.target.value),t(e.target.value.replace("#",""))}})})},lv=e=>{switch(e.toUpperCase()){case"LEFT":default:return"left";case"RIGHT":return"right";case"CENTER":return"center";case"JUSTIFY":return"justify";case"BOTTOM":return"end";case"TOP":return"start"}},cv=e=>{switch(e){case"left":return"LEFT";case"right":return"RIGHT";case"center":return"CENTER";case"justify":return"JUSTIFY";case"end":default:return"BOTTOM";case"start":return"TOP"}},sv=e=>UC.reduce((t,n)=>Math.abs(n-parseFloat(e))<Math.abs(t-parseFloat(e))?n:t);function dv(e){const{border:t}=e;let n="",r="",i="",o="";return"THIN"!==t.top&&(n="MEDIUM"===t.top?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),"THIN"!==t.right&&(r="MEDIUM"===t.right?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),"THIN"!==t.bottom&&(i="MEDIUM"===t.bottom?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),"THIN"!==t.left&&(o="MEDIUM"===t.left?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),{fontSize:RC(sv(String(e.size))),fontFamily:(a=e.name,FC.some(e=>e.label===a)?a:"Poppins"),color:`#${e.color}`,backgroundColor:`#${e.backgroundColor}`,fontWeight:e.bold?"bold":"normal",fontStyle:e.italic?"italic":"normal",textDecoration:e.underline?"underline":"normal",borderTop:n,borderRight:r,borderBottom:i,borderLeft:o,textAlign:lv(e.alignment.horizontal),alignContent:lv(e.alignment.vertical)};var a}const uv=e=>{if(!e||"none"===e)return"THIN";if(e.includes("solid")||e.includes("dashed")||e.includes("dotted")){if(e.includes("2px")||e.includes("medium"))return"MEDIUM";if(e.includes("3px")||e.includes("medium"))return"THICK"}return"THIN"},fv=e=>({name:e.fontFamily||"Arial",size:BC(e.fontSize?.toString()||"12"),bold:"bold"===e.fontWeight,italic:"italic"===e.fontStyle,underline:"underline"===e.textDecoration,color:e.color?.replace("#","")||"000000",backgroundColor:e.backgroundColor?.replace("#","")||"FFFFFF",borderColor:"F2F2F2",border:{top:uv(e.borderTop?e.borderTop.toString():void 0),right:uv(e.borderRight?e.borderRight.toString():void 0),bottom:uv(e.borderBottom?e.borderBottom.toString():void 0),left:uv(e.borderLeft?e.borderLeft.toString():void 0)},alignment:{horizontal:cv(e.textAlign),vertical:cv(e.alignContent),wrapText:!1}}),hv=({toolbar:t="show",editable:r,onBold:i,onItalic:o,setUnderlineType:c,setColor:d,setFontSize:u,setFontFamily:f,setTextAlign:h,setBackgroundColor:p,setBorderType:m,setFormatePainter:C})=>{const g=Pg(e=>e.selected instanceof gC),[v,y]=s("disable"===t||!r),w=Pg(e=>e.active?$m(e.active,e.model.data):null),b=Pg(e=>e.model.data),E=Pg(e=>e.formattedStyle.open),M={...PC.style,color:"#1e161f",backgroundColor:"#ffffff",borderColor:"#1e161f"},[A,x]=s(w?.style||M),k=a(null);l(()=>{w?.style&&JSON.stringify(w.style)!==JSON.stringify(A)&&x(w?.style||M),g?y(!r):w&&"boolean"==typeof w.readOnly&&y(w.readOnly||"disable"===t||!r||"dropDown"===w?.inputType?.type)},[w,r]);const L=fv(A),[H,_]=s("border-none"),[S,V]=s({label:"",value:""}),[O,z]=s({label:"",value:""}),[N,I]=s({color:M.color,backgroundColor:M.backgroundColor,borderColor:M.borderColor}),D=[{value:"border-all-sides",label:"All Border",icon:"all_borders"},{value:"border-bottom",label:"Border Bottom",icon:"border_bottom"},{value:"border-left",label:"Border Left",icon:"border_left"},{value:"border-right",label:"Border Right",icon:"border_right"},{value:"border-top",label:"Border Top",icon:"border_top"},{value:"border-none",label:"No Border",icon:"no_border"}],T=UC.map(e=>({label:e,value:e}));l(()=>{let e=setTimeout(()=>{d(b,N.color)},0);return()=>{clearTimeout(e)}},[N.color]),l(()=>{let e=setTimeout(()=>{p(b,N.backgroundColor)},0);return()=>{clearTimeout(e)}},[N.backgroundColor]);return l(()=>{const e=A.fontFamily,t=`${BC(A.fontSize)}`;V({label:e??"Times New Roman",value:e??"Times New Roman"}),z({label:t??"11",value:t??"11"})},[A]),n("div",{className:"ff-excel-toolbar",children:[n("div",{className:"ff-excel-toolbar-font ",children:[e("div",{className:"ff-excel-toolbar-font-family",children:e(or,{disabled:v,height:24,tooltip:!0,showToolTip:!0,showLabel:!1,optionZIndex:2e3,onChange:e=>{V({label:e.label,value:e.label}),f(b,e.value)},required:!1,optionsList:FC,selectedOption:S})}),e("div",{className:"ff-excel-toolbar-font-size",children:e(or,{disabled:v,height:24,showLabel:!1,optionZIndex:2e3,required:!1,onChange:e=>{z({label:e.label,value:e.value}),u(b,e.value)},optionsList:T,selectedOption:O})})]}),e("div",{className:"ff-excel-toolbar-divider"}),n("div",{className:"ff-excel-toolbar-icon",children:[e(K,{placement:"top",title:"Text Left",children:e(P,{disabled:v,variant:"left"===A.textAlign?"dark":"light",hoverEffect:"left"!==A.textAlign,onClick:()=>h(b,"left"),name:"text_align_left"})}),e(K,{placement:"top",title:"Text Center",children:e(P,{disabled:v,variant:"center"===A.textAlign?"dark":"light",hoverEffect:"center"!==A.textAlign,onClick:()=>h(b,"center"),name:"text_align_center"})}),e(K,{placement:"top",title:"Text Right",children:e(P,{disabled:v,variant:"right"===A.textAlign?"dark":"light",hoverEffect:"right"!==A.textAlign,onClick:()=>h(b,"right"),name:"text_align_right"})})]}),e("div",{className:"ff-excel-toolbar-divider"}),n("div",{className:"ff-excel-toolbar-text",children:[e(K,{placement:"top",title:"Bold",children:e(P,{disabled:v,variant:L.bold?"dark":"light",hoverEffect:!L.bold,onClick:()=>i(b),name:"bold"})}),e(K,{placement:"top",title:"Italic",children:e(P,{disabled:v,variant:L.italic?"dark":"light",hoverEffect:!L.italic,onClick:()=>o(b),name:"italic"})}),e(K,{placement:"top",title:"Underline",children:e("div",{className:"ff-excel-toolbar-icon-underline",children:e(P,{disabled:v,variant:"underline"===A.textDecoration?"dark":"light",hoverEffect:"underline"!==A.textDecoration,onClick:()=>c(b),name:"underline"})})})]}),e("div",{className:"ff-excel-toolbar-divider"}),n("div",{className:"ff-excel-toolbar-icon",children:[e(K,{placement:"top",title:"Format Painter",children:e(P,{disabled:v,variant:E?"dark":"light",hoverEffect:!E,onClick:()=>{C(b)},name:"formate_painter"})}),e(K,{placement:"top",title:"Text Color",children:n("div",{className:"ff-excel-toolbar-icon-color",children:[e(P,{disabled:v,hoverEffect:!0,width:12,height:12,onClick:()=>{d(b,N.color)},name:"text_color"}),e(av,{disabled:v,getColorValue:e=>{I(t=>({...t,color:e}))},initialColor:N.color})]})}),e(K,{placement:"top",title:"Background Color",children:n("div",{className:"ff-excel-toolbar-icon-color",children:[e(P,{disabled:v,hoverEffect:!0,width:12,height:12,onClick:()=>p(b,N.backgroundColor),name:"fill_color"}),e(av,{disabled:v,getColorValue:e=>{I(t=>({...t,backgroundColor:e}))},initialColor:N.backgroundColor})]})})]}),e("div",{className:"ff-excel-toolbar-divider"}),e("div",{className:"ff-excel-toolbar-menu",children:n("div",{className:"ff-excel-toolbar-menu-option",children:[e(K,{placement:"top",title:"Border Type",children:e(P,{hoverEffect:!0,disabled:v,onClick:()=>m(b,H,"var(--input-hover-border-color)"),name:(()=>{const e=D.find(e=>e.value===H);return e?e.icon:""})()})}),e("span",{ref:k,children:e(ur,{disabled:v,iconName:"arrow_down",targetRef:k,iconSize:12,zIndex:2e3,options:D,tooltipTitle:"Border Type",tooltipPlacement:"top",onOptionClick:e=>{let t=e.value;m(b,t,"var(--input-hover-border-color)"),_(t)}})})]})})]})},pv=(e,t)=>{let n,r=null;const i=function(...i){const o=this;null===r||Date.now()-r>=t?(e.apply(o,i),r=Date.now()):(n&&clearTimeout(n),n=setTimeout(()=>{e.apply(o,i),r=Date.now()},t-(Date.now()-r)))};return i.cancel=()=>{n&&clearTimeout(n),n=null,r=null},i},mv=r.forwardRef(function(t,i){const{className:o,columnLabels:a=[],rowLabels:l=[],toolbar:c,editable:s,onKeyDown:d,Table:u=Zg,Row:f=jg,sheetHeight:h,HeaderRow:p=Rg,DataEditor:m=tv,DataViewer:C=Jg,onSelect:g=()=>{},onActivate:v=()=>{},onEvaluatedDataChange:y=()=>{},contextOption:w,attachmentAction:b,workRef:E,minimumColumnWidth:M,setContextMenu:A,maxRowLimit:x,maxColLimit:k,disableDeleteOption:L,contextMenu:H,getActiveCell:_,onAddColumn:S,onDeleteColumn:V}=t,O=t.minimumColumnWidth||100,N=r.useRef(!1),I=Pg(e=>e.model.data),[D,T]=r.useState(!1),[Z,j]=r.useState(0),[R,B]=r.useState(0),[P,F]=r.useState({top:0,left:0}),[U,q]=r.useState(!1),[W,Q]=r.useState(!1),G=r.useMemo(()=>{const e=t.createFormulaParser||GC,n=new $C(e,t.data);return T(e=>!e),{...Eg,model:n,selected:t.selected||Eg.selected}},[t.createFormulaParser,t.data,t.selected]),K=r.useReducer(Mg,G),[Y,X]=K,J=r.useMemo(()=>function(e,t,n){const{columns:r,rows:i}=lC(e);return{rows:t?Math.max(i,t.length):i,columns:n?Math.max(r,n.length):r}}(Y.model.data,l,a),[Y.model.data,l,a]),[$,ee]=r.useState({start:0,end:Math.min(20,J.rows)}),[te,ne]=r.useState({start:0,end:Math.min(15,J.columns)}),re=r.useCallback(e=>{let t=0;for(let n=0;n<e;n++)t+=Y.rowDimensions[n]?.height||32;return t},[Y.rowDimensions,32]),ie=r.useCallback(e=>{let t=0;for(let n=0;n<e;n++)t+=Y.columnDimensions[n]?.width||O;return t},[Y.columnDimensions,O]),oe=re(J.rows),ae=ie(J.columns),le=re($.start),ce=oe-re($.end),se=ie(te.start),de=ae-ie(te.end),ue=Y.mode,fe=r.useRef(null),he=e=>r.useCallback((...t)=>X(e(...t)),[e]),pe=he(wm),me=he(Xm),Ce=he(Ym),ge=he(Jm),ve=he(Wm),ye=he(Qm),we=he(jm),be=he(Gm),Ee=he(Km),Me=he(Rm),Ae=he(Bm),xe=he(Pm),ke=he(Mm),Le=he(Am),He=he(km),_e=he(_m),Se=he(Lm),Ve=he(Hm),Oe=he(xm),ze=he(Sm),Ne=he(Vm),Ie=he(Om),De=he(ym),Te=he(zm),Ze=he(Nm),je=he(Im),Re=he(Dm),Be=he(Tm),Pe=he(Zm);r.useImperativeHandle(i,()=>({removeSelect:ge}));const Fe=r.useRef(Y.active);r.useEffect(()=>{if(Y.active!==Fe.current)if(Y.active)v(Y.active);else{const e=E.current;e&&ZC(e)&&document.activeElement&&document.activeElement.blur()}Fe.current=Y.active},[v,Y.active]);const Ue=r.useRef(Y.model.evaluatedData);r.useEffect(()=>{Y?.model?.evaluatedData!==Ue?.current&&y(Y?.model?.evaluatedData),Ue.current=Y.model.evaluatedData},[Y?.model?.evaluatedData,y]);const qe=r.useRef(Y.selected);r.useEffect(()=>{Y.selected.equals(qe.current)||t.selected&&Y.selected.equals(t.selected)||g(Y.selected),qe.current=Y.selected},[Y.selected,g,t.selected]);const We=r.useRef(t.selected);r.useEffect(()=>{t.selected&&We.current&&!t.selected.equals(We.current)&&xe(t.selected),We.current=t.selected},[t.selected,xe]);let Qe=r.useRef(t.data);r.useEffect(()=>{pe(s),t.data!==Qe.current&&Me(t.data),Qe.current=t.data},[t.data,Me,s]);const Ge=r.useRef(t.createFormulaParser);r.useEffect(()=>{t.createFormulaParser!==Ge.current&&t.createFormulaParser&&Ae(t.createFormulaParser),Ge.current=t.createFormulaParser},[t.createFormulaParser,Ae]);const Ke=r.useCallback(e=>{const{model:t,selected:n}=Y,{data:r}=t,i=n.toRange(r);if(i){!function(e,t){e.clipboardData?.setData(AC,t)}(e,DC(function(e,t,n){const r=[],i=t.column-e.column;for(let o=e.row;o<=t.row;o++){const a=o-e.row;r[a]=r[a]||Array(i);for(let i=e.column;i<=t.column;i++)r[a][i-e.column]=$m({row:o,column:i},n)}return r}(i.start,i.end,r)))}},[Y]),Ye=r.useCallback(e=>{TC(fe.current,ue)&&(e.preventDefault(),e.stopPropagation(),Ke(e),me())},[ue,Ke,me]),Xe=r.useCallback(e=>{TC(fe.current,ue)&&(e.preventDefault(),e.stopPropagation(),Ke(e),Ce())},[ue,Ke,Ce]),Je=r.useCallback(e=>{if(TC(fe.current,ue)&&(e.preventDefault(),e.stopPropagation(),e.clipboardData)){const t=function(e){return window.clipboardData&&window.clipboardData.getData?window.clipboardData.getData("Text"):e.clipboardData&&e.clipboardData.getData?e.clipboardData.getData(AC):""}(e);ve(t)}},[ue,ve]),$e=r.useCallback(e=>{e.persist();const t=e.ctrlKey||e.metaKey,n=e.key.toLowerCase();t&&"b"===n?(e.preventDefault(),ke(I)):t&&"i"===n?(e.preventDefault(),Le(I)):t&&"u"===n&&(e.preventDefault(),He(I)),d&&d(e),e.defaultPrevented||(function(e,t){return void 0!==yg(e,t)}(Y,e)&&e.nativeEvent.preventDefault(),ye(e))},[Y,d,ye]),et=r.useCallback(()=>{Y.formattedStyle.open&&Y.active&&De(Y.active)},[Y]),tt=r.useCallback(()=>{Ee(),document.removeEventListener("mouseup",tt)},[Ee]),nt=r.useCallback(e=>{Y.dragging||1!==e.buttons||"view"!==ue||(be(),document.addEventListener("mouseup",tt))},[Y,be,tt,ue]),rt=r.useMemo(()=>Xg(t.Cell||Yg),[t.Cell,D,s]),it=r.useMemo(()=>Ug(t.CornerIndicator||Fg),[t.CornerIndicator,D]),ot=r.useMemo(()=>Kg(t.RowIndicator||Gg),[t.RowIndicator,D]),at=r.useMemo(()=>qg(t.ColumnIndicator||Wg),[t.ColumnIndicator,D]);r.useEffect(()=>(document.addEventListener("cut",Ye),document.addEventListener("copy",Xe),document.addEventListener("paste",Je),()=>{document.removeEventListener("cut",Ye),document.removeEventListener("copy",Xe),document.removeEventListener("paste",Je)}),[Ye,Xe,Je]);const lt=e=>{const t=new ResizeObserver(e=>{const t=e[0];if(t&&fe.current){const e=t.target;if(e){const{clientWidth:t,clientHeight:n}=e;B(Math.min(fe.current.clientHeight,n)),j(Math.min(fe.current.clientWidth,t))}}}),n=e.current;n&&t.observe(n)},ct=r.useCallback(e=>{const t=e.target,{scrollTop:n,clientHeight:r,scrollLeft:i,clientWidth:o}=t;F({top:n,left:i});let a=0;for(;a<J.rows&&re(a)<n;)a++;let l=a;for(;l<J.rows&&re(l)<n+r;)l++;a=Math.max(0,a-10),l=Math.min(J.rows,l+10),ee({start:a,end:l});const c=l===J.rows;q(c);let s=0;for(;s<J.columns&&ie(s)<i;)s++;let d=s;for(;d<J.columns&&ie(d)<i+o;)d++;s=Math.max(0,s-10),d=Math.min(J.columns,d+10),ne({start:s,end:d});const u=d===J.columns;Q(u),H.open&&A({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",visible:!1,disable:!1}]})},[J.rows,J.columns,re,ie]),st=r.useMemo(()=>pv(ct,16),[ct]),dt=e=>{N.current=!0,requestAnimationFrame(()=>{let t=0;for(let n=0;n<=e;n++)t+=Y.rowDimensions?.[n]?.height||32;requestAnimationFrame(()=>{fe.current&&e>=J.rows-1&&fe?.current?.scrollTo({top:t+32,behavior:"smooth"})})})},ut=e=>{N.current=!0,requestAnimationFrame(()=>{let t=0;for(let n=0;n<=e;n++)t+=Y.columnDimensions?.[n]?.width||O;requestAnimationFrame(()=>{fe.current&&e>=J.columns-1&&fe.current.scrollTo({left:t+60,behavior:"smooth"})})})};r.useEffect(()=>{N.current||(ee({start:0,end:Math.min(20,J.rows)}),ne({start:0,end:Math.min(15,J.columns)}))},[J.rows,J.columns,N.current]);const ft=xC($.end,$.start),ht=xC(te.end,te.start),pt=n("colgroup",{children:[e("col",{style:{width:"60px"}},"row-indicator")," ",e("col",{style:{width:`${se}px`}},"left-spacer")," ",ht.map(t=>e("col",{style:{width:`${Y.columnDimensions[t]?.width||O}px`}},t)),e("col",{style:{width:`${de}px`}},"right-spacer")," "]}),mt=r.useMemo(()=>n(u,{useTableRef:lt,totalWidth:ae,children:[pt,n("tbody",{children:[n(p,{children:[e(it,{}),e("div",{className:"spacer left"}),ht.map(n=>e(at,{column:n,minimumColumnWidth:M,setContextMenu:t.setContextMenu,label:n in a?a[n]:void 0,deleteColumn:Pe,addColumnLeft:je,addColumnRight:Re,columnContextEnable:t.columnContextEnable,maxColLimit:k,disableDeleteOption:L,contextMenu:H,onAddColumn:S,onDeleteColumn:V,setVisibleRange:ne,scrollToColumn:ut},n)),e("div",{className:"spacer right"})]}),e("tr",{style:{height:`${le}px`}}),ft.map(r=>n(f,{row:r,children:[e(ot,{label:r in l?l?.[r]:void 0,row:r,addRowTop:Te,addRowBottom:Ze,deleteRow:Be,setContextMenu:t.setContextMenu,rowContextEnable:t.rowContextEnable,maxRowLimit:x,disableDeleteOption:L,contextMenu:H,setVisibleRange:ee,scrollToRow:dt},r),e("div",{className:"spacer left"}),ht.map(t=>e(rt,{row:r,column:t,DataViewer:C},t)),e("div",{className:"spacer right"})]},r)),e("tr",{style:{height:`${ce}px`}})]})]}),[u,J.rows,J.columns,f,p,it,a,at,l,ot,rt,C,$,te,le,ce,se,de,Y.rowDimensions,Y.columnDimensions]),Ct=r.useMemo(()=>e(nv,{attachmentAction:b,contextOption:w,getActiveCell:_,setContextMenu:t.setContextMenu,DataEditor:m,visibleRowRange:$,visibleColRange:te,maxHeight:R-64,maxWidth:Z-M,totalHeight:oe,totalWidth:ae,isAtBottom:U,isAtRight:W,scrollPos:P,editable:s}),[m,$,te,Y.active,R,Z,oe,ae,U,W,s]),gt=r.useMemo(()=>n("div",{className:"ff-excel-spreadsheet-container",children:[e("div",{style:{width:`${Z}px`},className:z("ff-excel-header-column-hider",{"ff-excel-header-extend":["show","disable"].includes(c||""),"ff-excel-header-hider":"hide"===c})}),e("div",{style:{height:`${R}px`},className:z("ff-excel-header-column-hider",{"ff-excel-header-extend":["show","disable"].includes(c||""),"ff-excel-header-hider":"hide"===c})}),"hide"!==c&&e("div",{className:"ff-excel-toolbar-container",children:e(hv,{editable:s,toolbar:c,onBold:ke,onItalic:Le,setUnderlineType:He,setColor:ze,setBorderType:Oe,setFontSize:Se,setFontFamily:Ve,setTextAlign:_e,setBackgroundColor:Ne,setFormatePainter:Ie})}),n("div",{ref:fe,style:{height:h},className:z("ff-excel-spreadsheet",o),onKeyPress:we,onKeyDown:$e,onClick:et,onMouseMove:nt,onScroll:e=>st(e),children:[mt,Ct,e(iv,{scrollPos:P}),e(ov,{scrollPos:P})]})]}),[o,we,$e,nt,mt,Ct,Z]);return e(Tg.Provider,{value:K,children:gt})}),Cv=({contextMenu:t,position:r,editable:i})=>{if(!t.open)return null;return i&&e("div",{onContextMenu:e=>{e.preventDefault(),e.stopPropagation()},className:"ff-excel-menu",style:{left:r.x,top:r.y,position:"absolute",zIndex:9999999999},children:t.options.map(t=>{if(!t.visible){const i=t.disable;return e(K,{title:i?t.disableTooltip:"",children:n("div",{className:"ff-excel-menu-options "+(i?"disabled":""),onClick:()=>{i||t.action()},children:[t.iconName&&e(P,{name:t.iconName,height:16,width:16,color:(r=t.label,r.includes("Delete")?"var(--label-edit-error-text)":"var(--brand-color)"),disabled:i}),e(F,{as:"label",children:t.label})]})},t.label)}var r;return null})})},gv=({excelData:r,contextOption:o,toolbar:c="show",sheetBar:d="show",rowCount:u=26,colCount:f=26,sheetHeight:h="100%",editable:p=!0,contextHeightPositioning:m=0,contextWidthPositioning:C=0,onSave:g=()=>Promise.resolve(),onSaveInfoChange:v,attachmentAction:y={addAttachment:()=>Promise.resolve(""),deleteAttachment:()=>Promise.resolve(""),viewAttachment:()=>Promise.resolve()},onSaveDelay:w=3e3,scroller:b=!1,columnContextEnable:E=!0,rowContextEnable:M=!0,sheetBarContextEnable:A=!0,minimumColumnWidth:x=100,disableDeleteOption:k=!1,maxRowLimit:L=1/0,maxColLimit:H=1/0,maxSheetLimit:_=1/0,getActiveCell:S=()=>{}})=>{const V=a(null),[O,N]=s([]),[I,D]=s(""),[T,Z]=i.useState({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",disable:!1,visible:!1}]}),[j,R]=s({name:"defaultSheet",index:0}),[B,U]=s({defaultSheet:[[PC]]}),[q,W]=s([[PC]]),[Q,Y]=s((g.length,{})),[X,J]=s({x:0,y:0}),$=a(""),ee=a(null),te=a(null),ne=a(null);l(()=>{const e=r;if(e){const t=e.map(e=>e.sheetName);N(t),G(t.length)||($.current=t[0]||"",R({name:t[0]||"",index:0}));const n={},r={};e.forEach(e=>{const t=e.sheetName,i=e.data,o=Math.max(u,i.length),a=Math.max(f,Math.max(...i.map(e=>e.length)));let l=Array.from({length:o},()=>Array(a).fill({value:"",style:PC.style,readOnly:!1,inputType:void 0}));i.forEach((e,t)=>{e.forEach((e,n)=>{var r;t<o&&n<a&&(l[t]||(l[t]=[]),l[t][n]={value:(r=e.value,null==r?null:r),style:G(e?.style)?PC.style:dv(e?.style),readOnly:!!e?.readOnly&&e?.readOnly,inputType:e?.inputType??void 0,contextDisable:e.contextDisable})})});const c=new Set([...e?.rows?.readOnly?e.rows.readOnly.map(e=>`r${e}`):[],...e?.columns?.readOnly?e.columns.readOnly.map(e=>`c${e}`):[],...e?.cells?.readOnly?e.cells.readOnly.map(([e,t])=>`${e},${t}`):[]]);if(l.forEach((t,n)=>{t.forEach((t,r)=>{l[n]||(l[n]=[]);const i=c.has(`r${n+1}`)||c.has(`c${r+1}`)||c.has(`${n+1},${r+1}`),o=((t,n,r)=>r?.inputType?r.inputType:e?.rows?.inputType?.[t+1]||e?.columns?.inputType?.[n+1]||e?.cells?.inputType?.[`${t+1},${n+1}`]||{type:"text"})(n,r,t||PC);l[n][r]={...t,value:t?.value??"",readOnly:t?.readOnly?t.readOnly:i,inputType:o,contextDisable:t?.contextDisable}})}),n[t]=l,g.length>1){const e=i[0]||[];r[t]=Array.from({length:a},(t,n)=>({newData:"",oldData:e[n]?.value||""}))}}),U(n),g.length>1&&Y(r);const i=Object.keys(n)[0];i&&void 0!==n[i]&&W(n[i])}},[r]),l(()=>{v&&v(I),"File saved"===I&&setTimeout(()=>{D("")},2e3)},[I]),l(()=>{D("Saving..."),re(le())},[B,$.current]);const re=i.useCallback(Aa(e=>{if(g.length>1){const t={...Q};O.forEach((n,r)=>{const i=(e[r].data[0]||[]).map(e=>e?.value||"");t[n]=(t[n]||[]).map((e,t)=>({...e,newData:i[t]||""}))}),Y(t);const n=O.map(e=>({sheetName:e,headers:t[e]||[]}));g(e,n)}else g(e);D("File saved")},w),[g,Q,O]),ae=i.useCallback(e=>{e.ctrlKey&&"s"===e.key&&(e.preventDefault(),e.stopPropagation(),re(le()))},[g]);i.useEffect(()=>(document.addEventListener("keydown",ae),()=>{document.removeEventListener("keydown",ae)}),[ae]);const le=()=>O.map(e=>{const t=B[e]?.map(e=>{const t=e.reduce((e,t,n)=>""!==String(t?.value??"").trim()?n:e,-1),n=e.map((e,n)=>e&&e.style&&n<=t?{value:e.value,style:fv(e.style),readOnly:e.readOnly,inputType:e.inputType,contextDisable:e.contextDisable}:null).filter(e=>null!==e);return n.length>0?n:[]})||[],n=t.filter((e,n)=>{const r=t.slice(n+1).some(e=>e.length>0);return e.length>0||r});return{sheetName:e,data:G(n.length)?[[]]:n}}),[ce,se]=s(null),de=()=>O.length>=_,ue=()=>{if(de())return;const e=((e,t)=>{const n=t.map(e=>e.toLowerCase());let r=`${e}1`,i=2;for(;n.includes(r.toLowerCase());)r=`${e}${i}`,i++;return r})("Sheet",O),t=Array.from({length:u},()=>Array.from({length:f},()=>PC));N(t=>[...t,e]),R({index:O?.length,name:e}),U({...B,[e]:t}),W(t),g.length>1&&Y(t=>({...t,[e]:Array.from({length:f},()=>({newData:"",oldData:""}))})),$.current=e},fe=(e=[[PC]])=>{W(e)},he=(e,t,n)=>{const r=e.target;if(!r||r?.textContent?.trim()===n?.trim())return void se(null);const i=(r.textContent||"").trim();if(!i)return Pc.warning("Sheet name cannot be empty."),r.textContent=j.name,void se(null);if(i.length>50)return Pc.warning("The sheet name cannot be greater than 50 characters"),r.textContent=j.name,void se(null);if(O.map(e=>e.toLowerCase()).includes(i.toLowerCase())&&n.trim()?.toLowerCase()!==i?.toLowerCase())return Pc.warning("Sheet name already exists"),r.textContent=j.name,void se(null);let o=O;fe(B?.[n]),o.splice(t,1,i);const a=function(e,t,n){if(!(t in e))throw new Error(`Key "${t}" not found in object`);const{[t]:r,...i}=e;return{...i,[n]:r??[]}}(B,n,i);$.current=i,R(e=>({...e,name:i})),U(a),g.length>1&&Y(e=>{const t={...e},r=t[n];return delete t[n],t[i]=r??[],t}),se(null)};const pe=(e,t)=>{e!==j.name&&t!==j.index&&(R({index:t,name:e}),N(n=>{const r=[...n];return r[t]=e,r}),fe(B[e]),$.current=e)},me=i.useCallback((e,t=!1)=>{const n=e.target;(!n.closest(".ff-excel-tab-list")&&!n.closest(".ff-excel-sheet")||t)&&T.open&&(Z({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",visible:!1,disable:!1}]}),t||(e.preventDefault(),e.stopPropagation()))},[T.open]);i.useEffect(()=>(document.addEventListener("contextmenu",me),document.addEventListener("click",e=>me(e,!0)),()=>{document.removeEventListener("contextmenu",me),document.removeEventListener("click",e=>me(e,!0))}),[me]);const Ce=(e,t,n)=>{e.preventDefault();const r=[{label:"Add Sheet",value:"Add Sheet",iconName:"plus_icon",action:()=>ue(),disableTooltip:"Sheet limit reached",visible:!1,disable:de()},...k?[]:[{label:"Delete Sheet",value:"Delete Sheet",iconName:"delete",action:()=>((e,t)=>{if(O.length>1){let n=O.slice();n.splice(t,1);const r={...B};delete r[e];const i=Math.min(t,n.length-1);N(n),U(r),g.length>1&&Y(t=>{const n={...t};return delete n[e],n});const o=n[i]?n[i]:"";R({index:i,name:o}),fe(r?.[o]),$.current=o}else Pc.warning("Cannot delete the last sheet.")})(t,n),disableTooltip:"",visible:!1,disable:!1}]];Z(e=>({...e,open:!0,contextType:"sheet",options:r}))};l(()=>{ne.current?.removeSelect()},[j.name]);return e(t,{children:O.length>0&&n("div",{ref:ee,className:"ff-excel",onContextMenu:e=>{e.preventDefault();const t=te.current?.parentElement?.getBoundingClientRect(),n=window.scrollX,r=window.scrollY;let i=e.clientX-(t?.left||0)+n,o=e.clientY-(t?.top||0)+r;const a=300,l=window.innerWidth,c=window.innerHeight,s=l-e.clientX,d=e.clientX,u=c-e.clientY,f=e.clientY;s<a&&d>=a?i=e.clientX-(t?.left||0)+n-150:i+=2,u<200&&f>=200?o=e.clientY-(t?.top||0)+r-20:o+=2,e.target.classList.contains("ff-excel-tab-list")?J({x:i,y:o-(k?32:65)}):(i+a>l&&(i=l-a-2),i<0&&(i=2),J({x:i+C,y:o+m}))},onClick:e=>{e.stopPropagation(),T.open&&Z({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",visible:!1,disable:!1}]})},children:[e("div",{ref:te,className:"ff-excel-sheet",children:e(mv,{ref:ne,editable:p,attachmentAction:y,toolbar:c,sheetHeight:h,setContextMenu:Z,contextOption:o,data:q,columnContextEnable:E,rowContextEnable:M,minimumColumnWidth:x,onEvaluatedDataChange:e=>{U(t=>({...t,[$.current]:e}))},workRef:ee,scroller:b,maxRowLimit:L,maxColLimit:H,disableDeleteOption:k,contextMenu:T,getActiveCell:S,onAddColumn:(e,t)=>{g.length>1&&Y(n=>{const r=j.name,i=[...n[r]||[]],o=t?e:e+1;return i.splice(o,0,{newData:"",oldData:""}),{...n,[r]:i}})},onDeleteColumn:e=>{g.length>1&&Y(t=>{const n=j.name,r=[...t[n]||[]];return r.splice(e,1),{...t,[n]:r}})}},j.name)}),"hide"!==d&&n("div",{className:"ff-excel-sheet-bar",children:["show"===d&&n("div",{className:"ff-excel-add-sheet-set",children:[e(K,{title:de()?"Sheet limit reached":"Add Sheet",placement:"top",children:e(P,{disabled:!p||de(),className:"ff-excel-add-sheet-icon",hoverEffect:!0,onClick:ue,name:"plus_icon",height:20,width:20})}),e(ur,{options:(t=>t.map((t,r)=>({label:n("div",{style:{display:"flex",gap:"8px"},children:[j?.name===t?e(P,{height:16,width:16,name:"tick"}):e("div",{style:{height:"16px",width:"24px"}}),e(K,{title:oe(t,20,"count")?t:"",children:e(F,{children:ie(t,20,"count")})})]}),name:r,value:t})))(O),targetRef:V,onOptionClick:e=>{const{value:t,name:n=""}=e;pe(t,parseInt(n))},dropdownPlacement:"top",iconName:"show_script",tooltipTitle:"All Sheets",tooltipPlacement:"top",dropdownHeight:215,selectedValue:j.name})]}),e("div",{className:"ff-excel-tab-container",children:O.map((t,n)=>e(F,{lineHeight:"16px",children:e("div",{onContextMenu:e=>{pe(t,n),A&&Ce(e,t,n)},className:z("ff-excel-tab-list",{active:t===j.name}),onClick:()=>{pe(t,n)},suppressContentEditableWarning:ce===n,onDoubleClick:e=>{"show"===d&&(se(n),null===ce&&setTimeout(()=>(e=>{const t=document.createRange(),n=window.getSelection();t.selectNodeContents(e),t.collapse(!1),n?.removeAllRanges(),n?.addRange(t)})(e.target),0))},contentEditable:p&&ce===n,onBlur:e=>{he(e,n,t)},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),he(e,n,t))},children:t})},t))})]}),T.open&&e(Cv,{contextMenu:T,position:X,editable:p}),e(Bc,{})]})})},vv=({label:t="",isActive:n=!0,onClick:r=()=>{},isFilterChip:i=!1})=>{const o=i?"filter":"module";return e("div",{className:z("ff-module-chip",{"ff-filter-chip":i,[`ff-${o}-chip--active`]:n,[`ff-${o}-chip--hover`]:!n}),onClick:r,children:e(F,{lineHeight:"18px",className:"module-typography",children:t})})},yv=({x:e,y:t,radius:n,startAngle:r,endAngle:i})=>{const o=e+n*Math.cos(r),a=t+n*Math.sin(r),l=e+n*Math.cos(i),c=t+n*Math.sin(i),s=i-r>Math.PI?1:0;return i-r>=2*Math.PI?`\n M ${e+n} ${t}\n A ${n} ${n} 0 1 1 ${e-n} ${t} \n A ${n} ${n} 0 1 1 ${e+n} ${t}\n `:`M ${o} ${a} A ${n} ${n} 0 ${s} 1 ${l} ${c}`},wv=({radius:t=15,lineWidth:r=5,label:i,percentageValue:o,icon:l,fontSize:c=10,labelColor:d="",arcColor:u="var(--brand-color)",backgroundArcColor:f="var(--ff-select-scroll-thumb-color)",isSelectedArch:h=!1,onSelect:p})=>{const[m,C]=s({x:0,y:0}),[g,v]=s(!1),y=a(null);let w=-Math.PI/2;const b=2*(t+r),{backgroundArcPath:E,foregroundArcPath:M}=((e,t,n)=>{const r=t,i=r+Math.max(0,Math.min(e,100))/100*2*Math.PI;return{backgroundArcPath:yv({x:0,y:0,radius:n,startAngle:0,endAngle:2*Math.PI}),foregroundArcPath:yv({x:0,y:0,radius:n,startAngle:r,endAngle:i})}})(o,w,t),A=()=>{v(!0)},x=()=>{C({x:0,y:0}),v(!1)},k=e=>{if(y.current){const t=y.current.getBoundingClientRect();C({x:e.clientX-t.left,y:e.clientY-t.top})}};return n("div",{ref:y,className:"ff-icon-radial-chart-container",style:{"--fontSize":`${c}px`},onClick:p,children:[e("svg",{width:b,height:b,viewBox:`0 0 ${b} ${b}`,role:"img",children:n("g",{transform:`translate(${t+r}, ${t+r})`,children:[e("path",{d:E,fill:"none",stroke:f,strokeWidth:r,onMouseEnter:A,onMouseLeave:x,onMouseMove:k}),e("path",{d:M,fill:"none",stroke:u,strokeWidth:r,onMouseEnter:A,onMouseLeave:x,onMouseMove:k}),h&&e("path",{d:M,fill:"none",stroke:"var(--dotted-border-color)",strokeOpacity:"0.4",strokeWidth:r,onMouseEnter:A,onMouseLeave:x,onMouseMove:k}),l?e("foreignObject",{x:"-10",y:"-10",width:"20",height:"20",children:e(P,{className:"ff-radial-chart-icon-padding",name:l,height:20,width:20})}):e("text",{x:"0",y:"0",fill:d||u,textAnchor:"middle",dominantBaseline:"central",children:`${Math.round(o)}%`})]})}),g&&n("div",{className:"ff-icon-radial-chart-tooltip",style:{position:"absolute",left:`${m.x+15}px`,top:m.y-5+"px"},children:[e(F,{children:`${i} : `}),n(F,{children:[o,"%"]})]})]})},bv=({mediaSrc:t,fileId:r,onExpandClick:i,onDeleteClick:o,onDownloadClick:a,height:l="75px",width:c="79px",fileName:s,thumbnailMediaSrc:d,isDelete:u})=>e("div",{className:"ff-attach-media-container",style:{height:l,width:c},children:n("div",{className:"ff-media-wrapper",style:{height:l,width:c},children:[e("img",{src:d||t,alt:"Attached"}),n("div",{className:"ff-hover-icons",children:[n("div",{className:"ff-top-icons",children:[e("div",{className:"ff-icon-container",children:e(K,{title:"Download File",placement:"bottom",children:e(P,{name:"download_file_icon",height:10,width:10,onClick:a,color:"var(--icons-default-color)"})})}),u&&e("div",{className:"ff-icon-container",children:e(K,{title:"Delete",placement:"bottom",children:e(P,{name:"delete",height:10,width:10,color:"var(--ff-delete-button-attachment)",onClick:()=>{o&&o(r)}})})})]}),e("div",{className:"ff-expand-icon-container",children:e(K,{title:"Maximize",placement:"bottom",children:e(P,{name:"expand_icon",height:16,width:16,onClick:i})})})]}),e(F,{color:"var(--text-area-default-color)",fontWeight:"medium",className:"ff-media-text",children:s})]})}),Ev=({icon:r,status:i,count:o,text:a,style:c={width:"196.4px"},resetToggle:d,onSelectedStatus:u=e=>{}})=>{const[f,h]=s(!1),p=["total defects","defect density","open defects","closed defects","quality score"],m=p.includes(i.toLowerCase()),C=p.includes(i.toLowerCase());l(()=>{h(!d)},[d]);return n("div",{className:`ff-card-container ${i.toLowerCase()} ${f?"toggled":""}`,style:c,onClick:()=>(e=>{p.includes(e.toLowerCase())||(h(!0),u(e))})(i),children:[n("div",{className:"ff-status-bar",children:[e("div",{children:e(P,{name:r,height:20,width:20,hoverEffect:!1})}),!p.includes(i.toLowerCase())&&e(F,{fontWeight:"semi-bold",fontSize:"10px",textAlign:"center",lineHeight:"15px",className:"ff-status-text",as:"div",children:i.charAt(0).toUpperCase()+i.slice(1).toLowerCase()})]}),e("div",{className:"ff-content "+(C?"red-background":""),children:n(t,m?{children:[e(F,{fontWeight:"semi-bold",fontSize:"10px",className:"ff-text",lineHeight:"15px",color:"var(--ff-chip-text-color)",children:a}),e(F,{fontWeight:"semi-bold",fontSize:"24px",className:"ff-number",lineHeight:"36px",children:"defect density"===i.toLowerCase()?n(t,{children:[o.toString().padStart(2,"0"),e(F,{fontSize:"15px",fontWeight:"semi-bold",children:"/ Modules"})]}):"quality score"===i.toLowerCase()?`${parseFloat(o.toString()).toFixed(2)}%`:o.toString().padStart(2,"0")})]}:{children:[e(F,{fontWeight:"semi-bold",fontSize:"24px",className:"ff-number",lineHeight:"24px",color:f?"var(--base-bg-color)":"",children:o.toString().padStart(2,"0")}),e(F,{className:"ff-text",lineHeight:"18px",color:f?"var(--base-bg-color)":"var(--ff-chip-text-color)",children:a})]})})]})},Mv=({option:t})=>{const r=a(null),[i,o]=s(!1);l(()=>{const e=r.current;if(!e)return;const t=()=>{o(e.scrollWidth>e.clientWidth)},n=requestAnimationFrame(t);return window.addEventListener("resize",t),()=>{cancelAnimationFrame(n),window.removeEventListener("resize",t)}},[t]);const c={LOCAL:"local_variable_icon",GLOBAL:"global_variable_icon",PROJECT_ENVIRONMENT:"project_env_variable_icon"},d=e=>"_startforloop"===e?.type?`FLV_for:${e?.name}`:"DATAPROVIDER"===e?.type?`${e?.dpName}:${e?.varname}`:e?.name;return n("div",{style:{width:"-webkit-fill-available"},className:"ff-variable-option ff-variable-data",children:[e(K,{title:i?d(t):"",style:{width:"calc(100% - 32px)"},children:e("span",{ref:r,className:"ff-truncated_text",children:d(t)})}),e(P,{name:(e=>{if(!e)return"";const t=e._id||e.id;return t?.startsWith("PARAMETER")?"step_group_parameter":"LOCAL"===e.type&&"STEPGROUP"===e?.parentVariableType?"step_group_variable":"_startforloop"===e.type?"for_loop_variable":"DATAPROVIDER"===e.type?"data_provider_variable":c[e.type||""]||""})(t),height:24,width:24,hoverEffect:!0})]})};function Av(e){return()=>e}function xv(e){e()}function kv(e,t){return n=>e(t(n))}function Lv(e,t){return()=>e(t)}function Hv(e){return void 0!==e}function _v(){}function Sv(e,t){return t(e),e}function Vv(e,t){return t(e)}function Ov(...e){return e}function zv(e,t){return e(1,t)}function Nv(e,t){e(0,t)}function Iv(e){e(2)}function Dv(e){return e(4)}function Tv(e,t){return zv(e,function(e,t){return n=>e(t,n)}(t,0))}function Zv(e,t){const n=e(1,e=>{n(),t(e)});return n}function jv(e){let t,n;return r=>i=>{t=i,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function Rv(e,t){return e===t}function Bv(e=Rv){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function Pv(e){return t=>n=>{e(n)&&t(n)}}function Fv(e){return t=>kv(t,e)}function Uv(e){return t=>()=>{t(e)}}function qv(e,...t){const n=function(...e){return t=>e.reduceRight(Vv,t)}(...t);return(t,r)=>{switch(t){case 2:return void Iv(e);case 1:return zv(e,n(r))}}}function Wv(e,t){return n=>r=>{n(t=e(t,r))}}function Qv(e){return t=>n=>{e>0?e--:t(n)}}function Gv(e){let t,n=null;return r=>i=>{n=i,!t&&(t=setTimeout(()=>{t=void 0,r(n)},e))}}function Kv(...e){const t=new Array(e.length);let n=0,r=null;const i=Math.pow(2,e.length)-1;return e.forEach((e,o)=>{const a=Math.pow(2,o);zv(e,e=>{const l=n;n|=a,t[o]=e,l!==i&&n===i&&r&&(r(),r=null)})}),e=>o=>{const a=()=>{e([o].concat(t))};n===i?a():r=a}}function Yv(e){let t=e;const n=Jv();return(e,r)=>{switch(e){case 0:t=r;break;case 1:r(t);break;case 4:return t}return n(e,r)}}function Xv(e,t){return Sv(Yv(t),t=>Tv(e,t))}function Jv(){const e=[];return(t,n)=>{switch(t){case 0:return void e.slice().forEach(e=>{e(n)});case 2:return void e.splice(0,e.length);case 1:return e.push(n),()=>{const t=e.indexOf(n);t>-1&&e.splice(t,1)}}}}function $v(e){return Sv(Jv(),t=>Tv(e,t))}function ey(e,t=[],{singleton:n}={singleton:!0}){return{constructor:e,dependencies:t,id:ty(),singleton:n}}const ty=()=>Symbol();function ny(...e){const t=Jv(),n=new Array(e.length);let r=0;const i=Math.pow(2,e.length)-1;return e.forEach((e,o)=>{const a=Math.pow(2,o);zv(e,e=>{n[o]=e,r|=a,r===i&&Nv(t,n)})}),function(e,o){switch(e){case 2:return void Iv(t);case 1:return r===i&&o(n),zv(t,o)}}}function ry(e,t=Rv){return qv(e,Bv(t))}function iy(...e){return function(t,n){switch(t){case 2:return;case 1:return function(...e){return()=>{e.map(xv)}}(...e.map(e=>zv(e,n)))}}}var oy=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(oy||{});const ay={0:"debug",3:"error",1:"log",2:"warn"},ly=ey(()=>{const e=Yv(3);return{log:Yv((t,n,r=1)=>{var i;r>=(null!=(i=(typeof globalThis>"u"?window:globalThis).VIRTUOSO_LOG_LEVEL)?i:Dv(e))&&console[ay[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)}),logLevel:e}},[],{singleton:!0});function cy(e,t,n){return sy(e,t,n).callbackRef}function sy(e,t,n){const r=i.useRef(null);let o=e=>{};const a=i.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(t=>{const r=()=>{const n=t[0].target;null!==n.offsetParent&&e(n)};n?r():requestAnimationFrame(r)}):null,[e,n]);return o=e=>{e&&t?(null==a||a.observe(e),r.current=e):(r.current&&(null==a||a.unobserve(r.current)),r.current=null)},{callbackRef:o,ref:r}}function dy(e,t,n,r,o,a,l,c,s){const d=i.useCallback(n=>{const i=function(e,t,n,r){const i=e.length;if(0===i)return null;const o=[];for(let a=0;a<i;a++){const i=e.item(a);if(void 0===i.dataset.index)continue;const l=parseInt(i.dataset.index),c=parseFloat(i.dataset.knownSize),s=t(i,n);if(0===s&&r("Zero-sized element, this should not happen",{child:i},oy.ERROR),s===c)continue;const d=o[o.length-1];0===o.length||d.size!==s||d.endIndex!==l-1?o.push({endIndex:l,size:s,startIndex:l}):o[o.length-1].endIndex++}return o}(n.children,t,c?"offsetWidth":"offsetHeight",o);let s=n.parentElement;for(;!s.dataset.virtuosoScroller;)s=s.parentElement;const d="window"===s.lastElementChild.dataset.viewportType;let u;d&&(u=s.ownerDocument.defaultView);const f=l?c?l.scrollLeft:l.scrollTop:d?c?u.scrollX||u.document.documentElement.scrollLeft:u.scrollY||u.document.documentElement.scrollTop:c?s.scrollLeft:s.scrollTop,h=l?c?l.scrollWidth:l.scrollHeight:d?c?u.document.documentElement.scrollWidth:u.document.documentElement.scrollHeight:c?s.scrollWidth:s.scrollHeight,p=l?c?l.offsetWidth:l.offsetHeight:d?c?u.innerWidth:u.innerHeight:c?s.offsetWidth:s.offsetHeight;r({scrollHeight:h,scrollTop:Math.max(f,0),viewportHeight:p}),null==a||a(c?uy("column-gap",getComputedStyle(n).columnGap,o):uy("row-gap",getComputedStyle(n).rowGap,o)),null!==i&&e(i)},[e,t,o,a,l,r,c]);return sy(d,n,s)}function uy(e,t,n){return"normal"!==t&&!(null!=t&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,oy.WARN),"normal"===t?0:parseInt(null!=t?t:"0",10)}function fy(e,t,n){const r=i.useRef(null),o=i.useCallback(n=>{if(null==n||!n.offsetParent)return;const i=n.getBoundingClientRect(),o=i.width;let a,c;if(t){const e=t.getBoundingClientRect(),n=i.top-e.top;c=e.height-Math.max(0,n),a=n+t.scrollTop}else{const e=l.current.ownerDocument.defaultView;c=e.innerHeight-Math.max(0,i.top),a=i.top+e.scrollY}r.current={offsetTop:a,visibleHeight:c,visibleWidth:o},e(r.current)},[e,t]),{callbackRef:a,ref:l}=sy(o,!0,n),c=i.useCallback(()=>{o(l.current)},[o,l]);return i.useEffect(()=>{var e;if(t){t.addEventListener("scroll",c);const e=new ResizeObserver(()=>{requestAnimationFrame(c)});return e.observe(t),()=>{t.removeEventListener("scroll",c),e.unobserve(t)}}{const t=null==(e=l.current)?void 0:e.ownerDocument.defaultView;return null==t||t.addEventListener("scroll",c),null==t||t.addEventListener("resize",c),()=>{null==t||t.removeEventListener("scroll",c),null==t||t.removeEventListener("resize",c)}}},[c,t,l]),a}const hy=ey(()=>{const e=Jv(),t=Jv(),n=Yv(0),r=Jv(),i=Yv(0),o=Jv(),a=Jv(),l=Yv(0),c=Yv(0),s=Yv(0),d=Yv(0),u=Jv(),f=Jv(),h=Yv(!1),p=Yv(!1),m=Yv(!1);return Tv(qv(e,Fv(({scrollTop:e})=>e)),t),Tv(qv(e,Fv(({scrollHeight:e})=>e)),a),Tv(t,i),{deviation:n,fixedFooterHeight:s,fixedHeaderHeight:c,footerHeight:d,headerHeight:l,horizontalDirection:p,scrollBy:f,scrollContainerState:e,scrollHeight:a,scrollingInProgress:h,scrollTo:u,scrollTop:t,skipAnimationFrameInResizeObserver:m,smoothScrollTargetReached:r,statefulScrollTop:i,viewportHeight:o}},[],{singleton:!0}),py={lvl:0};function my(e,t){const n=e.length;if(0===n)return[];let{index:r,value:i}=t(e[0]);const o=[];for(let a=1;a<n;a++){const{index:n,value:l}=t(e[a]);o.push({end:n-1,start:r,value:i}),r=n,i=l}return o.push({end:1/0,start:r,value:i}),o}function Cy(e){return e===py}function gy(e,t){if(!Cy(e))return t===e.k?e.v:t<e.k?gy(e.l,t):gy(e.r,t)}function vy(e,t,n="k"){if(Cy(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=vy(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return vy(e.l,t,n)}function yy(e,t,n){return Cy(e)?Sy(t,n,1):t===e.k?ky(e,{k:t,v:n}):t<e.k?Vy(ky(e,{l:yy(e.l,t,n)})):Vy(ky(e,{r:yy(e.r,t,n)}))}function wy(){return py}function by(e,t,n){if(Cy(e))return[];return function(e){return my(e,({k:e,v:t})=>({index:e,value:t}))}(Ay(e,vy(e,t)[0],n))}function Ey(e,t){if(Cy(e))return py;const{k:n,l:r,r:i}=e;if(t===n){if(Cy(r))return i;if(Cy(i))return r;{const[t,n]=_y(r);return xy(ky(e,{k:t,l:Ly(r),v:n}))}}return xy(ky(e,t<n?{l:Ey(r,t)}:{r:Ey(i,t)}))}function My(e){return Cy(e)?[]:[...My(e.l),{k:e.k,v:e.v},...My(e.r)]}function Ay(e,t,n){if(Cy(e))return[];const{k:r,l:i,r:o,v:a}=e;let l=[];return r>t&&(l=l.concat(Ay(i,t,n))),r>=t&&r<=n&&l.push({k:r,v:a}),r<=n&&(l=l.concat(Ay(o,t,n))),l}function xy(e){const{l:t,lvl:n,r:r}=e;if(r.lvl>=n-1&&t.lvl>=n-1)return e;if(n>r.lvl+1){if(Hy(t))return Oy(ky(e,{lvl:n-1}));if(!Cy(t)&&!Cy(t.r))return ky(t.r,{l:ky(t,{r:t.r.l}),lvl:n,r:ky(e,{l:t.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}if(Hy(e))return zy(ky(e,{lvl:n-1}));if(Cy(r)||Cy(r.l))throw new Error("Unexpected empty nodes");{const t=r.l,i=Hy(t)?r.lvl-1:r.lvl;return ky(t,{l:ky(e,{lvl:n-1,r:t.l}),lvl:t.lvl+1,r:zy(ky(r,{l:t.r,lvl:i}))})}}function ky(e,t){return Sy(void 0!==t.k?t.k:e.k,void 0!==t.v?t.v:e.v,void 0!==t.lvl?t.lvl:e.lvl,void 0!==t.l?t.l:e.l,void 0!==t.r?t.r:e.r)}function Ly(e){return Cy(e.r)?e.l:xy(ky(e,{r:Ly(e.r)}))}function Hy(e){return Cy(e)||e.lvl>e.r.lvl}function _y(e){return Cy(e.r)?[e.k,e.v]:_y(e.r)}function Sy(e,t,n,r=py,i=py){return{k:e,l:r,lvl:n,r:i,v:t}}function Vy(e){return zy(Oy(e))}function Oy(e){const{l:t}=e;return Cy(t)||t.lvl!==e.lvl?e:ky(t,{r:ky(e,{l:t.r})})}function zy(e){const{lvl:t,r:n}=e;return Cy(n)||Cy(n.r)||n.lvl!==t||n.r.lvl!==t?e:ky(n,{l:ky(e,{r:n.l}),lvl:t+1})}function Ny(e,t){return!(!e||e.startIndex!==t.startIndex||e.endIndex!==t.endIndex)}function Iy(e,t){return!(!e||e[0]!==t[0]||e[1]!==t[1])}const Dy=ey(()=>({recalcInProgress:Yv(!1)}),[],{singleton:!0});function Ty(e,t,n){return e[Zy(e,t,n)]}function Zy(e,t,n,r=0){let i=e.length-1;for(;r<=i;){const o=Math.floor((r+i)/2),a=n(e[o],t);if(0===a)return o;if(-1===a){if(i-r<2)return o-1;i=o-1}else{if(i===r)return o;r=o+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function jy(e,t){return Math.round(e.getBoundingClientRect()[t])}function Ry(e){return!Cy(e.groupOffsetTree)}function By({index:e},t){return t===e?0:t<e?-1:1}function Py({offset:e},t){return t===e?0:t<e?-1:1}function Fy(e,t,n){if(0===t.length)return 0;const{index:r,offset:i,size:o}=Ty(t,e,By),a=e-r,l=o*a+(a-1)*n+i;return l>0?l+n:l}function Uy(e,t){if(!Ry(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function qy(e,t,n){if(function(e){return typeof e.groupIndex<"u"}(e))return t.groupIndices[e.groupIndex]+1;{let r=Uy("LAST"===e.index?n:e.index,t);return r=Math.max(0,r,Math.min(n,r)),r}}function Wy(e,t,n,r=0){return r>0&&(t=Math.max(t,Ty(e,r,By).offset)),my(function(e,t,n,r){const i=Zy(e,t,r),o=Zy(e,n,r,i);return e.slice(i,o+1)}(e,t,n,Py),Yy)}function Qy(e,[t,n,r,i]){t.length>0&&r("received item sizes",t,oy.DEBUG);const o=e.sizeTree;let a=o,l=0;if(n.length>0&&Cy(o)&&2===t.length){const e=t[0].size,r=t[1].size;a=n.reduce((t,n)=>yy(yy(t,n,e),n+1,r),a)}else[a,l]=function(e,t){let n=Cy(e)?0:1/0;for(const r of t){const{endIndex:t,size:i,startIndex:o}=r;if(n=Math.min(n,o),Cy(e)){e=yy(e,0,i);continue}const a=by(e,o-1,t+1);if(a.some(Xy(r)))continue;let l=!1,c=!1;for(const{end:n,start:r,value:o}of a)l?(t>=r||i===o)&&(e=Ey(e,r)):(c=o!==i,l=!0),n>t&&t>=r&&o!==i&&(e=yy(e,t+1,o));c&&(e=yy(e,o,i))}return[e,n]}(a,t);if(a===o)return e;const{lastIndex:c,lastOffset:s,lastSize:d,offsetTree:u}=Ky(e.offsetTree,l,a,i);return{groupIndices:n,groupOffsetTree:n.reduce((e,t)=>yy(e,t,Fy(t,u,i)),wy()),lastIndex:c,lastOffset:s,lastSize:d,offsetTree:u,sizeTree:a}}function Gy(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n===e?0:1)}function Ky(e,t,n,r){let i=e,o=0,a=0,l=0,c=0;if(0!==t){c=Zy(i,t-1,By),l=i[c].offset;const e=vy(n,t-1);o=e[0],a=e[1],i.length&&i[c].size===vy(n,t)[1]&&(c-=1),i=i.slice(0,c+1)}else i=[];for(const{start:e,value:c}of by(n,t,1/0)){const t=e-o,n=t*a+l+t*r;i.push({index:e,offset:n,size:c}),o=e,l=n,a=c}return{lastIndex:o,lastOffset:l,lastSize:a,offsetTree:i}}function Yy(e){return{index:e.index,value:e}}function Xy(e){const{endIndex:t,size:n,startIndex:r}=e;return e=>e.start===r&&(e.end===t||e.end===1/0)&&e.value===n}const Jy={offsetHeight:"height",offsetWidth:"width"},$y=ey(([{log:e},{recalcInProgress:t}])=>{const n=Jv(),r=Jv(),i=Xv(r,0),o=Jv(),a=Jv(),l=Yv(0),c=Yv([]),s=Yv(void 0),d=Yv(void 0),u=Yv(void 0),f=Yv(void 0),h=Yv((e,t)=>jy(e,Jy[t])),p=Yv(void 0),m=Yv(0),C={groupIndices:[],groupOffsetTree:wy(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:wy()},g=Xv(qv(n,Kv(c,e,m),Wv(Qy,C),Bv()),C),v=Xv(qv(c,Bv(),Wv((e,t)=>({current:t,prev:e.current}),{current:[],prev:[]}),Fv(({prev:e})=>e)),[]);Tv(qv(c,Pv(e=>e.length>0),Kv(g,m),Fv(([e,t,n])=>{const r=e.reduce((e,r,i)=>yy(e,r,Fy(r,t.offsetTree,n)||i),wy());return{...t,groupIndices:e,groupOffsetTree:r}})),g),Tv(qv(r,Kv(g),Pv(([e,{lastIndex:t}])=>e<t),Fv(([e,{lastIndex:t,lastSize:n}])=>[{endIndex:t,size:n,startIndex:e}])),n),Tv(s,d);const y=Xv(qv(s,Fv(e=>void 0===e)),!0);Tv(qv(d,Pv(e=>void 0!==e&&Cy(Dv(g).sizeTree)),Fv(e=>{const t=Dv(u),n=Dv(c).length>0;return t?n?[{endIndex:0,size:t,startIndex:0},{endIndex:1,size:e,startIndex:1}]:[]:[{endIndex:0,size:e,startIndex:0}]})),n),Tv(qv(f,Pv(e=>void 0!==e&&e.length>0&&Cy(Dv(g).sizeTree)),Fv(e=>{const t=[];let n=e[0],r=0;for(let i=1;i<e.length;i++){const o=e[i];o!==n&&(t.push({endIndex:i-1,size:n,startIndex:r}),n=o,r=i)}return t.push({endIndex:e.length-1,size:n,startIndex:r}),t})),n),Tv(qv(c,Kv(u,d),Pv(([,e,t])=>void 0!==e&&void 0!==t),Fv(([e,t,n])=>{const r=[];for(let i=0;i<e.length;i++){const o=e[i],a=e[i+1];r.push({startIndex:o,endIndex:o,size:t}),void 0!==a&&r.push({startIndex:o+1,endIndex:a-1,size:n})}return r})),n);const w=$v(qv(n,Kv(g),Wv(({sizes:e},[t,n])=>({changed:n!==e,sizes:n}),{changed:!1,sizes:C}),Fv(e=>e.changed)));zv(qv(l,Wv((e,t)=>({diff:e.prev-t,prev:t}),{diff:0,prev:0}),Fv(e=>e.diff)),e=>{const{groupIndices:n}=Dv(g);if(e>0)Nv(t,!0),Nv(o,e+Gy(e,n));else if(e<0){const t=Dv(v);t.length>0&&(e-=Gy(-e,t)),Nv(a,e)}}),zv(qv(l,Kv(e)),([e,t])=>{e<0&&t("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:l},oy.ERROR)});const b=$v(o);Tv(qv(o,Kv(g),Fv(([e,t])=>{const n=t.groupIndices.length>0,r=[],i=t.lastSize;if(n){const n=gy(t.sizeTree,0);let o=0,a=0;for(;o<e;){const e=t.groupIndices[a],l=t.groupIndices.length===a+1?1/0:t.groupIndices[a+1]-e-1;r.push({endIndex:e,size:n,startIndex:e}),r.push({endIndex:e+1+l-1,size:i,startIndex:e+1}),a++,o+=l+1}const l=My(t.sizeTree);return o!==e&&l.shift(),l.reduce((t,{k:n,v:r})=>{let i=t.ranges;return 0!==t.prevSize&&(i=[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]),{prevIndex:n+e,prevSize:r,ranges:i}},{prevIndex:e,prevSize:0,ranges:r}).ranges}return My(t.sizeTree).reduce((t,{k:n,v:r})=>({prevIndex:n+e,prevSize:r,ranges:[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]}),{prevIndex:0,prevSize:i,ranges:[]}).ranges})),n);const E=$v(qv(a,Kv(g,m),Fv(([e,{offsetTree:t},n])=>Fy(-e,t,n))));return Tv(qv(a,Kv(g,m),Fv(([e,t,n])=>{if(t.groupIndices.length>0){if(Cy(t.sizeTree))return t;let r=wy();const i=Dv(v);let o=0,a=0,l=0;for(;o<-e;){l=i[a];const e=i[a+1]-l-1;a++,o+=e+1}if(r=My(t.sizeTree).reduce((t,{k:n,v:r})=>yy(t,Math.max(0,n+e),r),r),o!==-e){r=yy(r,0,gy(t.sizeTree,l));r=yy(r,1,vy(t.sizeTree,1-e)[1])}return{...t,sizeTree:r,...Ky(t.offsetTree,0,r,n)}}{const r=My(t.sizeTree).reduce((t,{k:n,v:r})=>yy(t,Math.max(0,n+e),r),wy());return{...t,sizeTree:r,...Ky(t.offsetTree,0,r,n)}}})),g),{beforeUnshiftWith:b,data:p,defaultItemSize:d,firstItemIndex:l,fixedItemSize:s,fixedGroupSize:u,gap:m,groupIndices:c,heightEstimates:f,itemSize:h,listRefresh:w,shiftWith:a,shiftWithOffset:E,sizeRanges:n,sizes:g,statefulTotalCount:i,totalCount:r,trackItemSizes:y,unshiftWith:o}},Ov(ly,Dy),{singleton:!0});function ew(e){return e.reduce((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e),{groupIndices:[],totalCount:0})}const tw=ey(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:r,scrollTop:i}])=>{const o=Jv(),a=Jv(),l=$v(qv(o,Fv(ew)));return Tv(qv(l,Fv(e=>e.totalCount)),n),Tv(qv(l,Fv(e=>e.groupIndices)),e),Tv(qv(ny(i,t,r),Pv(([e,t])=>Ry(t)),Fv(([e,t,n])=>vy(t.groupOffsetTree,Math.max(e-n,0),"v")[0]),Bv(),Fv(e=>[e])),a),{groupCounts:o,topItemsIndexes:a}},Ov($y,hy)),nw=ey(([{log:e}])=>{const t=Yv(!1),n=$v(qv(t,Pv(e=>e),Bv()));return zv(t,t=>{t&&Dv(e)("props updated",{},oy.DEBUG)}),{didMount:n,propsReady:t}},Ov(ly),{singleton:!0}),rw=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function iw(e){const t="number"==typeof e?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!rw)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const ow=ey(([{gap:e,listRefresh:t,sizes:n,totalCount:r},{fixedFooterHeight:i,fixedHeaderHeight:o,footerHeight:a,headerHeight:l,scrollingInProgress:c,scrollTo:s,smoothScrollTargetReached:d,viewportHeight:u},{log:f}])=>{const h=Jv(),p=Jv(),m=Yv(0);let C=null,g=null,v=null;function y(){C&&(C(),C=null),v&&(v(),v=null),g&&(clearTimeout(g),g=null),Nv(c,!1)}return Tv(qv(h,Kv(n,u,r,m,l,a,f),Kv(e,o,i),Fv(([[e,n,r,i,o,a,l,s],u,f,m])=>{const w=iw(e),{align:b,behavior:E,offset:M}=w,A=i-1,x=qy(w,n,A);let k=Fy(x,n.offsetTree,u)+a;"end"===b?(k+=f+vy(n.sizeTree,x)[1]-r+m,x===A&&(k+=l)):"center"===b?k+=(f+vy(n.sizeTree,x)[1]-r+m)/2:k-=o,M&&(k+=M);const L=t=>{y(),t?(s("retrying to scroll to",{location:e},oy.DEBUG),Nv(h,e)):(Nv(p,!0),s("list did not change, scroll successful",{},oy.DEBUG))};if(y(),"smooth"===E){let e=!1;v=zv(t,t=>{e=e||t}),C=Zv(d,()=>{L(e)})}else C=Zv(qv(t,function(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return e=>{e&&(t(!0),clearTimeout(n))}}}(150)),L);return g=setTimeout(()=>{y()},1200),Nv(c,!0),s("scrolling from index to",{behavior:E,index:x,top:k},oy.DEBUG),{behavior:E,top:k}})),s),{scrollTargetReached:p,scrollToIndex:h,topListHeight:m}},Ov($y,hy,ly),{singleton:!0});function aw(e,t){0==e?t():requestAnimationFrame(()=>{aw(e-1,t)})}function lw(e,t){const n=t-1;return"number"==typeof e?e:"LAST"===e.index?n:e.index}const cw=ey(([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:r},{scrollTargetReached:i,scrollToIndex:o},{didMount:a}])=>{const l=Yv(!0),c=Yv(0),s=Yv(!0);return Tv(qv(a,Kv(c),Pv(([e,t])=>!!t),Uv(!1)),l),Tv(qv(a,Kv(c),Pv(([e,t])=>!!t),Uv(!1)),s),zv(qv(ny(t,a),Kv(l,n,e,s),Pv(([[,e],t,{sizeTree:n},r,i])=>e&&(!Cy(n)||Hv(r))&&!t&&!i),Kv(c)),([,e])=>{Zv(i,()=>{Nv(s,!0)}),aw(4,()=>{Zv(r,()=>{Nv(l,!0)}),Nv(o,e)})}),{initialItemFinalLocationReached:s,initialTopMostItemIndex:c,scrolledToInitialItem:l}},Ov($y,hy,ow,nw),{singleton:!0});function sw(e,t){return Math.abs(e-t)<1.01}const dw="up",uw="down",fw={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},hw=ey(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:r,scrollTop:i,viewportHeight:o}])=>{const a=Yv(!1),l=Yv(!0),c=Jv(),s=Jv(),d=Yv(4),u=Yv(0),f=Xv(qv(iy(qv(ry(i),Qv(1),Uv(!0)),qv(ry(i),Qv(1),Uv(!1),jv(100))),Bv()),!1),h=Xv(qv(iy(qv(n,Uv(!0)),qv(n,Uv(!1),jv(200))),Bv()),!1);Tv(qv(ny(ry(i),ry(u)),Fv(([e,t])=>e<=t),Bv()),l),Tv(qv(l,Gv(50)),s);const p=$v(qv(ny(r,ry(o),ry(t),ry(e),ry(d)),Wv((e,[{scrollHeight:t,scrollTop:n},r,i,o,a])=>{const l={scrollHeight:t,scrollTop:n,viewportHeight:r};if(n+r-t>-a){let t,r;return n>e.state.scrollTop?(t="SCROLLED_DOWN",r=e.state.scrollTop-n):(t="SIZE_DECREASED",r=e.state.scrollTop-n||e.scrollTopDelta),{atBottom:!0,atBottomBecause:t,scrollTopDelta:r,state:l}}let c;return c=l.scrollHeight>e.state.scrollHeight?"SIZE_INCREASED":r<e.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":n<e.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:c,state:l}},fw),Bv((e,t)=>e&&e.atBottom===t.atBottom))),m=Xv(qv(r,Wv((e,{scrollHeight:t,scrollTop:n,viewportHeight:r})=>{if(sw(e.scrollHeight,t))return{changed:!1,jump:0,scrollHeight:t,scrollTop:n};{const i=t-(n+r)<1;return e.scrollTop!==n&&i?{changed:!0,jump:e.scrollTop-n,scrollHeight:t,scrollTop:n}:{changed:!0,jump:0,scrollHeight:t,scrollTop:n}}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),Pv(e=>e.changed),Fv(e=>e.jump)),0);Tv(qv(p,Fv(e=>e.atBottom)),a),Tv(qv(a,Gv(50)),c);const C=Yv(uw);Tv(qv(r,Fv(({scrollTop:e})=>e),Bv(),Wv((e,t)=>Dv(h)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?dw:uw,prevScrollTop:t},{direction:uw,prevScrollTop:0}),Fv(e=>e.direction)),C),Tv(qv(r,Gv(50),Uv("none")),C);const g=Yv(0);return Tv(qv(f,Pv(e=>!e),Uv(0)),g),Tv(qv(i,Gv(100),Kv(f),Pv(([e,t])=>!!t),Wv(([e,t],[n])=>[t,n],[0,0]),Fv(([e,t])=>t-e)),g),{atBottomState:p,atBottomStateChange:c,atBottomThreshold:d,atTopStateChange:s,atTopThreshold:u,isAtBottom:a,isAtTop:l,isScrolling:f,lastJumpDueToItemResize:m,scrollDirection:C,scrollVelocity:g}},Ov(hy)),pw="top",mw="bottom",Cw="none";function gw(e,t,n){return"number"==typeof e?n===dw&&t===pw||n===uw&&t===mw?e:0:n===dw?t===pw?e.main:e.reverse:t===mw?e.main:e.reverse}function vw(e,t){var n;return"number"==typeof e?e:null!=(n=e[t])?n:0}const yw=ey(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:r,viewportHeight:i}])=>{const o=Jv(),a=Yv(0),l=Yv(0),c=Yv(0),s=Xv(qv(ny(ry(r),ry(i),ry(n),ry(o,Iy),ry(c),ry(a),ry(t),ry(e),ry(l)),Fv(([e,t,n,[r,i],o,a,l,c,s])=>{const d=e-c,u=a+l,f=Math.max(n-d,0);let h=Cw;const p=vw(s,pw),m=vw(s,mw);return r-=c,i+=n+l,(r+=n+l)>e+u-p&&(h=dw),(i-=c)<e-f+t+m&&(h=uw),h!==Cw?[Math.max(d-n-gw(o,pw,h)-p,0),d-f-l+t+gw(o,mw,h)+m]:null}),Pv(e=>null!=e),Bv(Iy)),[0,0]);return{increaseViewportBy:l,listBoundary:o,overscan:c,topListHeight:a,visibleRange:s}},Ov(hy),{singleton:!0});const ww={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function bw(e,t,n,r,i,o){const{lastIndex:a,lastOffset:l,lastSize:c}=i;let s=0,d=0;if(e.length>0){s=e[0].offset;const t=e[e.length-1];d=t.offset+t.size}const u=n-a,f=s,h=l+u*c+(u-1)*r-d;return{bottom:d,firstItemIndex:o,items:Mw(e,i,o),offsetBottom:h,offsetTop:s,top:f,topItems:Mw(t,i,o),topListHeight:t.reduce((e,t)=>t.size+e,0),totalCount:n}}function Ew(e,t,n,r,i,o){let a=0;if(n.groupIndices.length>0)for(const t of n.groupIndices){if(t-a>=e)break;a++}const l=e+a,c=lw(t,l);return bw(Array.from({length:l}).map((e,t)=>({data:o[t+c],index:t+c,offset:0,size:0})),[],l,i,n,r)}function Mw(e,t,n){if(0===e.length)return[];if(!Ry(t))return e.map(e=>({...e,index:e.index+n,originalIndex:e.index}));const r=e[0].index,i=e[e.length-1].index,o=[],a=by(t.groupOffsetTree,r,i);let l,c=0;for(const r of e){let e;(!l||l.end<r.index)&&(l=a.shift(),c=t.groupIndices.indexOf(l.start)),e=r.index===l.start?{index:c,type:"group"}:{groupIndex:c,index:r.index-(c+1)+n},o.push({...e,data:r.data,offset:r.offset,originalIndex:r.index,size:r.size})}return o}function Aw(e,t){var n;return void 0===e?0:"number"==typeof e?e:null!=(n=e[t])?n:0}const xw=ey(([{data:e,firstItemIndex:t,gap:n,sizes:r,totalCount:i},o,{listBoundary:a,topListHeight:l,visibleRange:c},{initialTopMostItemIndex:s,scrolledToInitialItem:d},{topListHeight:u},f,{didMount:h},{recalcInProgress:p}])=>{const m=Yv([]),C=Yv(0),g=Jv(),v=Yv(0);Tv(o.topItemsIndexes,m);const y=Xv(qv(ny(h,p,ry(c,Iy),ry(i),ry(r),ry(s),d,ry(m),ry(t),ry(n),ry(v),e),Pv(([e,t,,n,,,,,,,,r])=>{const i=r&&r.length!==n;return e&&!t&&!i}),Fv(([,,[e,t],n,r,i,o,a,l,c,s,d])=>{var u,f,h,p;const m=r,{offsetTree:g,sizeTree:v}=m,y=Dv(C);if(0===n)return{...ww,totalCount:n};if(0===e&&0===t)return 0===y?{...ww,totalCount:n}:Ew(y,i,r,l,c,d||[]);if(Cy(v))return y>0?null:bw(function(e,t,n){if(Ry(t)){const r=Uy(e,t);return[{index:vy(t.groupOffsetTree,r)[0],offset:0,size:0},{data:null==n?void 0:n[0],index:r,offset:0,size:0}]}return[{data:null==n?void 0:n[0],index:e,offset:0,size:0}]}(lw(i,n),m,d),[],n,c,m,l);const w=[];if(a.length>0){const e=a[0],t=a[a.length-1];let n=0;for(const r of by(v,e,t)){const i=r.value,o=Math.max(r.start,e),a=Math.min(r.end,t);for(let e=o;e<=a;e++)w.push({data:null==d?void 0:d[e],index:e,offset:n,size:i}),n+=i}}if(!o)return bw([],w,n,c,m,l);const b=a.length>0?a[a.length-1]+1:0,E=Wy(g,e,t,b);if(0===E.length)return null;const M=n-1,A=Sv([],n=>{for(const r of E){const i=r.value;let o=i.offset,a=r.start;const l=i.size;if(i.offset<e){a+=Math.floor((e-i.offset+c)/(l+c));const t=a-r.start;o+=t*l+t*c}a<b&&(o+=(b-a)*l,a=b);const s=Math.min(r.end,M);for(let e=a;e<=s&&!(o>=t);e++)n.push({data:null==d?void 0:d[e],index:e,offset:o,size:l}),o+=l+c}}),x=Aw(s,pw),k=Aw(s,mw);if(A.length>0&&(x>0||k>0)){const e=A[0],t=A[A.length-1];if(x>0&&e.index>b){const t=Math.min(x,e.index-b),n=[];let r=e.offset;for(let i=e.index-1;i>=e.index-t;i--){const t=null!=(f=null==(u=by(v,i,i)[0])?void 0:u.value)?f:e.size;r-=t+c,n.unshift({data:null==d?void 0:d[i],index:i,offset:r,size:t})}A.unshift(...n)}if(k>0&&t.index<M){const e=Math.min(k,M-t.index);let n=t.offset+t.size+c;for(let r=t.index+1;r<=t.index+e;r++){const e=null!=(p=null==(h=by(v,r,r)[0])?void 0:h.value)?p:t.size;A.push({data:null==d?void 0:d[r],index:r,offset:n,size:e}),n+=e+c}}}return bw(A,w,n,c,m,l)}),Pv(e=>null!==e),Bv()),ww);Tv(qv(e,Pv(Hv),Fv(e=>null==e?void 0:e.length)),i),Tv(qv(y,Fv(e=>e.topListHeight)),u),Tv(u,l),Tv(qv(y,Fv(e=>[e.top,e.bottom])),a),Tv(qv(y,Fv(e=>e.items)),g);const w=$v(qv(y,Pv(({items:e})=>e.length>0),Kv(i,e),Pv(([{items:e},t])=>e[e.length-1].originalIndex===t-1),Fv(([,e,t])=>[e-1,t]),Bv(Iy),Fv(([e])=>e))),b=$v(qv(y,Gv(200),Pv(({items:e,topItems:t})=>e.length>0&&e[0].originalIndex===t.length),Fv(({items:e})=>e[0].index),Bv())),E=$v(qv(y,Pv(({items:e})=>e.length>0),Fv(({items:e})=>{let t=0,n=e.length-1;for(;"group"===e[t].type&&t<n;)t++;for(;"group"===e[n].type&&n>t;)n--;return{endIndex:e[n].index,startIndex:e[t].index}}),Bv(Ny)));return{endReached:w,initialItemCount:C,itemsRendered:g,listState:y,minOverscanItemCount:v,rangeChanged:E,startReached:b,topItemsIndexes:m,...f}},Ov($y,tw,yw,cw,ow,hw,nw,Dy),{singleton:!0}),kw=ey(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:r},{listState:i}])=>{const o=Jv(),a=Xv(qv(ny(n,e,r,t,i),Fv(([e,t,n,r,i])=>e+t+n+r+i.offsetBottom+i.bottom)),0);return Tv(ry(a),o),{totalListHeight:a,totalListHeightChanged:o}},Ov(hy,xw),{singleton:!0}),Lw=ey(([{viewportHeight:e},{totalListHeight:t}])=>{const n=Yv(!1);return{alignToBottom:n,paddingTopAddition:Xv(qv(ny(n,e,t),Pv(([e])=>e),Fv(([,e,t])=>Math.max(0,e-t)),Gv(0),Bv()),0)}},Ov(hy,kw),{singleton:!0}),Hw=ey(()=>({context:Yv(null)})),_w=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:r,...i},viewportBottom:o,viewportTop:a})=>t<a?{...i,align:null!=n?n:"start",behavior:r}:e>o?{...i,align:null!=n?n:"end",behavior:r}:null,Sw=ey(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:i,headerHeight:o,scrollingInProgress:a,scrollTop:l,viewportHeight:c},{scrollToIndex:s}])=>{const d=Jv();return Tv(qv(d,Kv(t,c,n,o,i,r,l),Kv(e),Fv(([[e,t,n,r,i,o,l,c],s])=>{const{align:d,behavior:u,calculateViewLocation:f=_w,done:h,...p}=e,m=qy(e,t,r-1),C=Fy(m,t.offsetTree,s)+i+o,g=f({itemBottom:C+vy(t.sizeTree,m)[1],itemTop:C,locationParams:{align:d,behavior:u,...p},viewportBottom:c+n-l,viewportTop:c+o});return g?h&&Zv(qv(a,Pv(e=>!e),Qv(Dv(a)?1:2)),h):h&&h(),g}),Pv(e=>null!==e)),s),{scrollIntoView:d}},Ov($y,hy,ow,xw,ly),{singleton:!0});function Vw(e){return!!e&&("smooth"===e?"smooth":"auto")}const Ow=ey(([{listRefresh:e,totalCount:t,fixedItemSize:n,data:r},{atBottomState:i,isAtBottom:o},{scrollToIndex:a},{scrolledToInitialItem:l},{didMount:c,propsReady:s},{log:d},{scrollingInProgress:u},{context:f},{scrollIntoView:h}])=>{const p=Yv(!1),m=Jv();let C=null;function g(e){Nv(a,{align:"end",behavior:e,index:"LAST"})}function v(e){const t=Zv(i,t=>{e&&!t.atBottom&&"SIZE_INCREASED"===t.notAtBottomBecause&&!C&&(Dv(d)("scrolling to bottom due to increased size",{},oy.DEBUG),g("auto"))});setTimeout(t,100)}zv(qv(ny(qv(ry(t),Qv(1)),c),Kv(ry(p),o,l,u),Fv(([[e,t],n,r,i,o])=>{let a=t&&i,l="auto";return a&&(l=((e,t)=>"function"==typeof e?Vw(e(t)):t&&Vw(e))(n,r||o),a=a&&!!l),{followOutputBehavior:l,shouldFollow:a,totalCount:e}}),Pv(({shouldFollow:e})=>e)),({followOutputBehavior:t,totalCount:r})=>{C&&(C(),C=null),Dv(n)?requestAnimationFrame(()=>{Dv(d)("following output to ",{totalCount:r},oy.DEBUG),g(t)}):C=Zv(e,()=>{Dv(d)("following output to ",{totalCount:r},oy.DEBUG),g(t),C=null})}),zv(qv(ny(ry(p),t,s),Pv(([e,,t])=>e&&t),Wv(({value:e},[,t])=>({refreshed:e===t,value:t}),{refreshed:!1,value:0}),Pv(({refreshed:e})=>e),Kv(p,t)),([,e])=>{Dv(l)&&v(!1!==e)}),zv(m,()=>{v(!1!==Dv(p))}),zv(ny(ry(p),i),([e,t])=>{e&&!t.atBottom&&"VIEWPORT_HEIGHT_DECREASING"===t.notAtBottomBecause&&g("auto")});const y=Yv(null),w=Jv();return Tv(iy(qv(ry(r),Fv(e=>{var t;return null!=(t=null==e?void 0:e.length)?t:0})),qv(ry(t))),w),zv(qv(ny(qv(w,Qv(1)),c),Kv(ry(y),l,u,f),Fv(([[e,t],n,r,i,o])=>t&&r&&(null==n?void 0:n({context:o,totalCount:e,scrollingInProgress:i}))),Pv(e=>!!e),Gv(0)),t=>{C&&(C(),C=null),Dv(n)?requestAnimationFrame(()=>{Dv(d)("scrolling into view",{}),Nv(h,t)}):C=Zv(e,()=>{Dv(d)("scrolling into view",{}),Nv(h,t),C=null})}),{autoscrollToBottom:m,followOutput:p,scrollIntoViewOnChange:y}},Ov($y,hw,ow,cw,nw,ly,hy,Hw,Sw)),zw=ey(([{data:e,firstItemIndex:t,gap:n,sizes:r},{initialTopMostItemIndex:i},{initialItemCount:o,listState:a},{didMount:l}])=>(Tv(qv(l,Kv(o),Pv(([,e])=>0!==e),Kv(i,r,t,n,e),Fv(([[,e],t,n,r,i,o=[]])=>Ew(e,t,n,r,i,o))),a),{}),Ov($y,cw,xw,nw),{singleton:!0}),Nw=ey(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=Yv(0);return zv(qv(e,Kv(r),Pv(([,e])=>0!==e),Fv(([,e])=>({top:e}))),e=>{Zv(qv(n,Qv(1),Pv(e=>e.items.length>1)),()=>{requestAnimationFrame(()=>{Nv(t,e)})})}),{initialScrollTop:r}},Ov(nw,hy,xw),{singleton:!0}),Iw=ey(([{scrollVelocity:e}])=>{const t=Yv(!1),n=Jv(),r=Yv(!1);return Tv(qv(e,Kv(r,t,n),Pv(([e,t])=>!!t),Fv(([e,t,n,r])=>{const{enter:i,exit:o}=t;if(n){if(o(e,r))return!1}else if(i(e,r))return!0;return n}),Bv()),t),zv(qv(ny(t,e,n),Kv(r)),([[e,t,n],r])=>{e&&r&&r.change&&r.change(t,n)}),{isSeeking:t,scrollSeekConfiguration:r,scrollSeekRangeChanged:n,scrollVelocity:e}},Ov(hw),{singleton:!0}),Dw=ey(([{scrollContainerState:e,scrollTo:t}])=>{const n=Jv(),r=Jv(),i=Jv(),o=Yv(!1),a=Yv(void 0);return Tv(qv(ny(n,r),Fv(([{scrollHeight:e,scrollTop:t,viewportHeight:n},{offsetTop:r}])=>({scrollHeight:e,scrollTop:Math.max(0,t-r),viewportHeight:n}))),e),Tv(qv(t,Kv(r),Fv(([e,{offsetTop:t}])=>({...e,top:e.top+t}))),i),{customScrollParent:a,useWindowScroll:o,windowScrollContainerState:n,windowScrollTo:i,windowViewportRect:r}},Ov(hy)),Tw=ey(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:i},{didMount:o},{useWindowScroll:a,windowScrollContainerState:l,windowViewportRect:c}])=>{const s=Jv(),d=Yv(void 0),u=Yv(null),f=Yv(null);return Tv(l,u),Tv(c,f),zv(qv(s,Kv(t,r,a,u,f,n)),([e,t,n,r,i,o,a])=>{const l=function(e){return My(e).map(({k:e,v:t},n,r)=>{const i=r[n+1];return{endIndex:i?i.k-1:1/0,size:t,startIndex:e}})}(t.sizeTree);r&&null!==i&&null!==o&&(n=i.scrollTop-o.offsetTop),e({ranges:l,scrollTop:n-=a})}),Tv(qv(d,Pv(Hv),Fv(Zw)),i),Tv(qv(o,Kv(d),Pv(([,e])=>void 0!==e),Bv(),Fv(([,e])=>e.ranges)),e),{getState:s,restoreStateFrom:d}},Ov($y,hy,cw,nw,Dw));function Zw(e){return{align:"start",index:0,offset:e.scrollTop}}const jw=ey(([{topItemsIndexes:e}])=>{const t=Yv(0);return Tv(qv(t,Pv(e=>e>=0),Fv(e=>Array.from({length:e}).map((e,t)=>t))),e),{topItemCount:t}},Ov(xw));function Rw(e){let t,n=!1;return()=>(n||(n=!0,t=e()),t)}const Bw=Rw(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),Pw=ey(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:r},{isAtBottom:i,isScrolling:o,lastJumpDueToItemResize:a,scrollDirection:l},{listState:c},{beforeUnshiftWith:s,gap:d,shiftWithOffset:u,sizes:f},{log:h},{recalcInProgress:p}])=>{const m=$v(qv(c,Kv(a),Wv(([,e,t,n],[{bottom:r,items:i,offsetBottom:o,totalCount:a},l])=>{const c=r+o;let s=0;return t===a&&e.length>0&&i.length>0&&(0===i[0].originalIndex&&0===e[0].originalIndex||(s=c-n,0!==s&&(s+=l))),[s,i,a,c]},[0,[],0,0]),Pv(([e])=>0!==e),Kv(r,l,n,i,h,p),Pv(([,e,t,n,,,r])=>!r&&!n&&0!==e&&t===dw),Fv(([[e],,,,,t])=>(t("Upward scrolling compensation",{amount:e},oy.DEBUG),e))));function C(n){n>0?(Nv(t,{behavior:"auto",top:-n}),Nv(e,0)):(Nv(e,0),Nv(t,{behavior:"auto",top:-n}))}return zv(qv(m,Kv(e,o)),([t,n,r])=>{r&&Bw()?Nv(e,n-t):C(-t)}),zv(qv(ny(Xv(o,!1),e,p),Pv(([e,t,n])=>!e&&!n&&0!==t),Fv(([e,t])=>t),Gv(1)),C),Tv(qv(u,Fv(e=>({top:-e}))),t),zv(qv(s,Kv(f,d),Fv(([e,{groupIndices:t,lastSize:n,sizeTree:r},i])=>{function o(e){return e*(n+i)}if(0===t.length)return o(e);{let n=0;const i=gy(r,0);let a=0,l=0;for(;a<e;){a++,n+=i;let r=t.length===l+1?1/0:t[l+1]-t[l]-1;a+r>e&&(n-=i,r=e-a+1),a+=r,n+=o(r),l++}return n}})),n=>{Nv(e,n),requestAnimationFrame(()=>{Nv(t,{top:n}),requestAnimationFrame(()=>{Nv(e,0),Nv(p,!1)})})}),{deviation:e}},Ov(hy,hw,xw,$y,ly,Dy)),Fw=ey(([e,t,n,r,i,o,a,l,c,s,d])=>({...e,...t,...n,...r,...i,...o,...a,...l,...c,...s,...d}),Ov(yw,zw,nw,Iw,kw,Nw,Lw,Dw,Sw,ly,Hw)),Uw=ey(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:r,fixedGroupSize:i,gap:o,groupIndices:a,heightEstimates:l,itemSize:c,sizeRanges:s,sizes:d,statefulTotalCount:u,totalCount:f,trackItemSizes:h},{initialItemFinalLocationReached:p,initialTopMostItemIndex:m,scrolledToInitialItem:C},g,v,y,w,{scrollToIndex:b},E,{topItemCount:M},{groupCounts:A},x])=>{const{listState:k,minOverscanItemCount:L,topItemsIndexes:H,rangeChanged:_,...S}=w;return Tv(_,x.scrollSeekRangeChanged),Tv(qv(x.windowViewportRect,Fv(e=>e.visibleHeight)),g.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:r,fixedGroupHeight:i,gap:o,groupCounts:A,heightEstimates:l,initialItemFinalLocationReached:p,initialTopMostItemIndex:m,scrolledToInitialItem:C,sizeRanges:s,topItemCount:M,topItemsIndexes:H,totalCount:f,...y,groupIndices:a,itemSize:c,listState:k,minOverscanItemCount:L,scrollToIndex:b,statefulTotalCount:u,trackItemSizes:h,rangeChanged:_,...S,...x,...g,sizes:d,...v}},Ov($y,cw,hy,Tw,Ow,xw,ow,Pw,jw,tw,Fw));function qw(e,t){const n={},r={};let i=0;const o=e.length;for(;i<o;)r[e[i]]=1,i+=1;for(const e in t)Object.hasOwn(r,e)||(n[e]=t[e]);return n}const Ww=typeof document<"u"?i.useLayoutEffect:i.useEffect;function Qw(t,n,r){const o=Object.keys(n.required||{}),a=Object.keys(n.optional||{}),l=Object.keys(n.methods||{}),c=Object.keys(n.events||{}),s=i.createContext({});function d(e,t){e.propsReady&&Nv(e.propsReady,!1);for(const r of o){Nv(e[n.required[r]],t[r])}for(const r of a)if(r in t){Nv(e[n.optional[r]],t[r])}e.propsReady&&Nv(e.propsReady,!0)}function u(e){return c.reduce((t,r)=>(t[r]=function(e){let t,n;const r=()=>null==t?void 0:t();return function(i,o){switch(i){case 1:return o?n===o?void 0:(r(),n=o,t=zv(e,o),t):(r(),_v);case 2:return r(),void(n=null)}}}(e[n.events[r]]),t),{})}const f=i.forwardRef((f,h)=>{const{children:p,...m}=f,[C]=i.useState(()=>Sv(function(e){const t=new Map,n=({constructor:e,dependencies:r,id:i,singleton:o})=>{if(o&&t.has(i))return t.get(i);const a=e(r.map(e=>n(e)));return o&&t.set(i,a),a};return n(e)}(t),e=>{d(e,m)})),[g]=i.useState(Lv(u,C));Ww(()=>{for(const e of c)e in m&&zv(g[e],m[e]);return()=>{Object.values(g).map(Iv)}},[m,g,C]),Ww(()=>{d(C,m)}),i.useImperativeHandle(h,Av(function(e){return l.reduce((t,r)=>(t[r]=t=>{Nv(e[n.methods[r]],t)},t),{})}(C)));const v=r;return e(s.Provider,{value:C,children:r?e(v,{...qw([...o,...a,...c],m),children:p}):p})});return{Component:f,useEmitter:(e,t)=>{const n=i.useContext(s)[e];Ww(()=>zv(n,t),[t,n])},useEmitterValue:i.version.startsWith("18")?e=>{const t=i.useContext(s)[e],n=i.useCallback(e=>zv(t,e),[t]);return i.useSyncExternalStore(n,()=>Dv(t),()=>Dv(t))}:e=>{const t=i.useContext(s)[e],[n,r]=i.useState(Lv(Dv,t));return Ww(()=>zv(t,e=>{e!==n&&r(Av(e))}),[t,n]),n},usePublisher:e=>{const t=i.useContext(s);return i.useCallback(n=>{Nv(t[e],n)},[t,e])}}}const Gw=i.createContext(void 0),Kw=i.createContext(void 0),Yw=typeof document<"u"?i.useLayoutEffect:i.useEffect;function Xw(e){return"self"in e}function Jw(e,t,n,r=_v,o,a){const l=i.useRef(null),c=i.useRef(null),s=i.useRef(null),d=i.useCallback(n=>{let r,i,o;const l=n.target;if(function(e){return"body"in e}(l)||Xw(l)){const e=Xw(l)?l:l.defaultView;o=a?e.scrollX:e.scrollY,r=a?e.document.documentElement.scrollWidth:e.document.documentElement.scrollHeight,i=a?e.innerWidth:e.innerHeight}else o=a?l.scrollLeft:l.scrollTop,r=a?l.scrollWidth:l.scrollHeight,i=a?l.offsetWidth:l.offsetHeight;const d=()=>{e({scrollHeight:r,scrollTop:Math.max(o,0),viewportHeight:i})};n.suppressFlushSync?d():M.flushSync(d),null!==c.current&&(o===c.current||o<=0||o===r-i)&&(c.current=null,t(!0),s.current&&(clearTimeout(s.current),s.current=null))},[e,t,a]);return i.useEffect(()=>{const e=o||l.current;return r(o||l.current),d({suppressFlushSync:!0,target:e}),e.addEventListener("scroll",d,{passive:!0}),()=>{r(null),e.removeEventListener("scroll",d)}},[l,d,n,r,o]),{scrollByCallback:function(e){a&&(e={behavior:e.behavior,left:e.top}),l.current.scrollBy(e)},scrollerRef:l,scrollToCallback:function(n){const r=l.current;if(!r||(a?"offsetWidth"in r&&0===r.offsetWidth:"offsetHeight"in r&&0===r.offsetHeight))return;const i="smooth"===n.behavior;let o,d,u;Xw(r)?(d=Math.max(jy(r.document.documentElement,a?"width":"height"),a?r.document.documentElement.scrollWidth:r.document.documentElement.scrollHeight),o=a?r.innerWidth:r.innerHeight,u=a?window.scrollX:window.scrollY):(d=r[a?"scrollWidth":"scrollHeight"],o=jy(r,a?"width":"height"),u=r[a?"scrollLeft":"scrollTop"]);const f=d-o;if(n.top=Math.ceil(Math.max(Math.min(f,n.top),0)),sw(o,d)||n.top===u)return e({scrollHeight:d,scrollTop:u,viewportHeight:o}),void(i&&t(!0));i?(c.current=n.top,s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{s.current=null,c.current=null,t(!0)},1e3)):c.current=null,a&&(n={behavior:n.behavior,left:n.top}),r.scrollTo(n)}}}const $w="-webkit-sticky",eb="sticky",tb=Rw(()=>{if(typeof document>"u")return eb;const e=document.createElement("div");return e.style.position=$w,e.style.position===$w?$w:eb});function nb(e){return e}const rb=ey(()=>{const e=Yv(e=>`Item ${e}`),t=Yv(e=>`Group ${e}`),n=Yv({}),r=Yv(nb),i=Yv("div"),o=Yv(_v),a=(e,t=null)=>Xv(qv(n,Fv(t=>t[e]),Bv()),t);return{components:n,computeItemKey:r,EmptyPlaceholder:a("EmptyPlaceholder"),FooterComponent:a("Footer"),GroupComponent:a("Group","div"),groupContent:t,HeaderComponent:a("Header"),HeaderFooterTag:i,ItemComponent:a("Item","div"),itemContent:e,ListComponent:a("List","div"),ScrollerComponent:a("Scroller","div"),scrollerRef:o,ScrollSeekPlaceholder:a("ScrollSeekPlaceholder"),TopItemListComponent:a("TopItemList")}}),ib=ey(([e,t])=>({...e,...t}),Ov(Uw,rb)),ob=({height:t})=>e("div",{style:{height:t}}),ab={overflowAnchor:"none",position:tb(),zIndex:1},lb={overflowAnchor:"none"},cb={...lb,display:"inline-block",height:"100%"},sb=i.memo(function({showTopList:t=!1}){const n=kb("listState"),r=Lb("sizeRanges"),o=kb("useWindowScroll"),a=kb("customScrollParent"),l=Lb("windowScrollContainerState"),c=Lb("scrollContainerState"),s=a||o?l:c,d=kb("itemContent"),u=kb("context"),f=kb("groupContent"),h=kb("trackItemSizes"),p=kb("itemSize"),C=kb("log"),g=Lb("gap"),v=kb("horizontalDirection"),{callbackRef:y}=dy(r,p,h,t?_v:s,C,g,a,v,kb("skipAnimationFrameInResizeObserver")),[w,b]=i.useState(0);xb("deviation",e=>{w!==e&&b(e)});const E=kb("EmptyPlaceholder"),M=kb("ScrollSeekPlaceholder")||ob,A=kb("ListComponent"),x=kb("ItemComponent"),k=kb("GroupComponent"),L=kb("computeItemKey"),H=kb("isSeeking"),_=kb("groupIndices").length>0,S=kb("alignToBottom"),V=kb("initialItemFinalLocationReached"),O=t?{}:{boxSizing:"border-box",...v?{display:"inline-block",height:"100%",marginLeft:0!==w?w:S?"auto":0,paddingLeft:n.offsetTop,paddingRight:n.offsetBottom,whiteSpace:"nowrap"}:{marginTop:0!==w?w:S?"auto":0,paddingBottom:n.offsetBottom,paddingTop:n.offsetTop},...V?{}:{visibility:"hidden"}};return!t&&0===n.totalCount&&E?e(E,{...pb(E,u)}):e(A,{...pb(A,u),"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list",ref:y,style:O,children:(t?n.topItems:n.items).map(e=>{const t=e.originalIndex,r=L(t+n.firstItemIndex,e.data,u);return H?m(M,{...pb(M,u),height:e.size,index:e.index,key:r,type:e.type||"item",..."group"===e.type?{}:{groupIndex:e.groupIndex}}):"group"===e.type?m(k,{...pb(k,u),"data-index":t,"data-item-index":e.index,"data-known-size":e.size,key:r,style:ab},f(e.index,u)):m(x,{...pb(x,u),...mb(x,e.data),"data-index":t,"data-item-group-index":e.groupIndex,"data-item-index":e.index,"data-known-size":e.size,key:r,style:v?cb:lb},_?d(e.index,e.groupIndex,e.data,u):d(e.index,e.data,u))})})}),db={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},ub={outline:"none",overflowX:"auto",position:"relative"},fb=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:{}}),hb={position:tb(),top:0,width:"100%",zIndex:1};function pb(e,t){if("string"!=typeof e)return{context:t}}function mb(e,t){return{item:"string"==typeof e?void 0:t}}const Cb=i.memo(function(){const t=kb("HeaderComponent"),n=Lb("headerHeight"),r=kb("HeaderFooterTag"),o=cy(i.useMemo(()=>e=>{n(jy(e,"height"))},[n]),!0,kb("skipAnimationFrameInResizeObserver")),a=kb("context");return t?e(r,{ref:o,children:e(t,{...pb(t,a)})}):null}),gb=i.memo(function(){const t=kb("FooterComponent"),n=Lb("footerHeight"),r=kb("HeaderFooterTag"),o=cy(i.useMemo(()=>e=>{n(jy(e,"height"))},[n]),!0,kb("skipAnimationFrameInResizeObserver")),a=kb("context");return t?e(r,{ref:o,children:e(t,{...pb(t,a)})}):null});function vb({useEmitter:t,useEmitterValue:n,usePublisher:r}){return i.memo(function({children:i,style:o,context:a,...l}){const c=r("scrollContainerState"),s=n("ScrollerComponent"),d=r("smoothScrollTargetReached"),u=n("scrollerRef"),f=n("horizontalDirection")||!1,{scrollByCallback:h,scrollerRef:p,scrollToCallback:m}=Jw(c,d,s,u,void 0,f);return t("scrollTo",m),t("scrollBy",h),e(s,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:p,style:{...f?ub:db,...o},tabIndex:0,...l,...pb(s,a),children:i})})}function yb({useEmitter:t,useEmitterValue:n,usePublisher:r}){return i.memo(function({children:o,style:a,context:l,...c}){const s=r("windowScrollContainerState"),d=n("ScrollerComponent"),u=r("smoothScrollTargetReached"),f=n("totalListHeight"),h=n("deviation"),p=n("customScrollParent"),m=i.useRef(null),C=n("scrollerRef"),{scrollByCallback:g,scrollerRef:v,scrollToCallback:y}=Jw(s,u,d,C,p);return Yw(()=>{var e;return v.current=p||(null==(e=m.current)?void 0:e.ownerDocument.defaultView),()=>{v.current=null}},[v,p]),t("windowScrollTo",y),t("scrollBy",g),e(d,{ref:m,"data-virtuoso-scroller":!0,style:{position:"relative",...a,...0!==f?{height:f+h}:{}},...c,...pb(d,l),children:o})})}const wb=({children:t})=>{const n=i.useContext(Gw),r=Lb("viewportHeight"),o=Lb("fixedItemHeight"),a=kb("alignToBottom"),l=kb("horizontalDirection"),c=cy(i.useMemo(()=>kv(r,e=>jy(e,l?"width":"height")),[r,l]),!0,kb("skipAnimationFrameInResizeObserver"));return i.useEffect(()=>{n&&(r(n.viewportHeight),o(n.itemHeight))},[n,r,o]),e("div",{"data-viewport-type":"element",ref:c,style:fb(a),children:t})},bb=({children:t})=>{const n=i.useContext(Gw),r=Lb("windowViewportRect"),o=Lb("fixedItemHeight"),a=kb("customScrollParent"),l=fy(r,a,kb("skipAnimationFrameInResizeObserver")),c=kb("alignToBottom");return i.useEffect(()=>{n&&(o(n.itemHeight),r({offsetTop:0,visibleHeight:n.viewportHeight,visibleWidth:100}))},[n,r,o]),e("div",{"data-viewport-type":"window",ref:l,style:fb(c),children:t})},Eb=({children:t})=>{const n=kb("TopItemListComponent")||"div",r=kb("headerHeight"),i={...hb,marginTop:`${r}px`},o=kb("context");return e(n,{style:i,...pb(n,o),children:t})},Mb=i.memo(function(t){const r=kb("useWindowScroll"),i=kb("topItemsIndexes").length>0,o=kb("customScrollParent"),a=kb("context");return n(o||r?_b:Hb,{...t,context:a,children:[i&&e(Eb,{children:e(sb,{showTopList:!0})}),n(o||r?bb:wb,{children:[e(Cb,{}),e(sb,{}),e(gb,{})]})]})}),{Component:Ab,useEmitter:xb,useEmitterValue:kb,usePublisher:Lb}=Qw(ib,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},Mb),Hb=vb({useEmitter:xb,useEmitterValue:kb,usePublisher:Lb}),_b=yb({useEmitter:xb,useEmitterValue:kb,usePublisher:Lb}),Sb=Ab,Vb=ey(()=>{const e=Yv(e=>n("td",{children:["Item $",e]})),t=Yv(null),r=Yv(e=>n("td",{colSpan:1e3,children:["Group ",e]})),i=Yv(null),o=Yv(null),a=Yv({}),l=Yv(nb),c=Yv(_v),s=(e,t=null)=>Xv(qv(a,Fv(t=>t[e]),Bv()),t);return{components:a,computeItemKey:l,context:t,EmptyPlaceholder:s("EmptyPlaceholder"),FillerRow:s("FillerRow"),fixedFooterContent:o,fixedHeaderContent:i,itemContent:e,groupContent:r,ScrollerComponent:s("Scroller","div"),scrollerRef:c,ScrollSeekPlaceholder:s("ScrollSeekPlaceholder"),TableBodyComponent:s("TableBody","tbody"),TableComponent:s("Table","table"),TableFooterComponent:s("TableFoot","tfoot"),TableHeadComponent:s("TableHead","thead"),TableRowComponent:s("TableRow","tr"),GroupComponent:s("Group","tr")}});Ov(Uw,Vb),tb();const Ob={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},zb={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:Nb,floor:Ib,max:Db,min:Tb,round:Zb}=Math;function jb(e,t,n){return Array.from({length:t-e+1}).map((t,r)=>({data:null===n?null:n[r+e],index:r+e}))}function Rb(e,t){return e&&e.width===t.width&&e.height===t.height}function Bb(e,t){return e&&e.column===t.column&&e.row===t.row}const Pb=ey(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:r},{footerHeight:i,headerHeight:o,scrollBy:a,scrollContainerState:l,scrollTo:c,scrollTop:s,smoothScrollTargetReached:d,viewportHeight:u},f,h,{didMount:p,propsReady:m},{customScrollParent:C,useWindowScroll:g,windowScrollContainerState:v,windowScrollTo:y,windowViewportRect:w},b])=>{const E=Yv(0),M=Yv(0),A=Yv(Ob),x=Yv({height:0,width:0}),k=Yv({height:0,width:0}),L=Jv(),H=Jv(),_=Yv(0),S=Yv(null),V=Yv({column:0,row:0}),O=Jv(),z=Jv(),N=Yv(!1),I=Yv(0),D=Yv(!0),T=Yv(!1),Z=Yv(!1);zv(qv(p,Kv(I),Pv(([e,t])=>!!t)),()=>{Nv(D,!1)}),zv(qv(ny(p,D,k,x,I,T),Pv(([e,t,n,r,,i])=>e&&!t&&0!==n.height&&0!==r.height&&!i)),([,,,,e])=>{Nv(T,!0),aw(1,()=>{Nv(L,e)}),Zv(qv(s),()=>{Nv(t,[0,0]),Nv(D,!0)})}),Tv(qv(z,Pv(e=>null!=e&&e.scrollTop>0),Uv(0)),M),zv(qv(p,Kv(z),Pv(([,e])=>null!=e)),([,e])=>{e&&(Nv(x,e.viewport),Nv(k,e.item),Nv(V,e.gap),e.scrollTop>0&&(Nv(N,!0),Zv(qv(s,Qv(1)),e=>{Nv(N,!1)}),Nv(c,{top:e.scrollTop})))}),Tv(qv(x,Fv(({height:e})=>e)),u),Tv(qv(ny(ry(x,Rb),ry(k,Rb),ry(V,(e,t)=>e&&e.column===t.column&&e.row===t.row),ry(s)),Fv(([e,t,n,r])=>({gap:n,item:t,scrollTop:r,viewport:e}))),O),Tv(qv(ny(ry(E),r,ry(V,Bb),ry(k,Rb),ry(x,Rb),ry(S),ry(M),ry(N),ry(D),ry(I)),Pv(([,,,,,,,e])=>!e),Fv(([e,[t,n],r,i,o,a,l,,c,s])=>{const{column:d,row:u}=r,{height:f,width:h}=i,{width:p}=o;if(0===l&&(0===e||0===p))return Ob;if(0===h){const t=lw(s,e);return function(e){return{...zb,items:e}}(jb(t,t+Math.max(l-1,0),a))}const m=Fb(p,h,d);let C,g;c?0===t&&0===n&&l>0?(C=0,g=l-1):(C=m*Ib((t+u)/(f+u)),g=m*Nb((n+u)/(f+u))-1,g=Tb(e-1,Db(g,m-1)),C=Tb(g,Db(0,C))):(C=0,g=-1);const v=jb(C,g,a),{bottom:y,top:w}=Ub(o,r,i,v),b=Nb(e/m);return{bottom:y,itemHeight:f,items:v,itemWidth:h,offsetBottom:b*f+(b-1)*u-y,offsetTop:w,top:w}})),A),Tv(qv(S,Pv(e=>null!==e),Fv(e=>e.length)),E),Tv(qv(ny(x,k,A,V),Pv(([e,t,{items:n}])=>n.length>0&&0!==t.height&&0!==e.height),Fv(([e,t,{items:n},r])=>{const{bottom:i,top:o}=Ub(e,r,t,n);return[o,i]}),Bv(Iy)),t);const j=Yv(!1);Tv(qv(s,Kv(j),Fv(([e,t])=>t||0!==e)),j);const R=$v(qv(ny(A,E),Pv(([{items:e}])=>e.length>0),Kv(j),Pv(([[e,t],n])=>{const r=e.items[e.items.length-1].index===t-1;return(n||e.bottom>0&&e.itemHeight>0&&0===e.offsetBottom&&e.items.length===t)&&r}),Fv(([[,e]])=>e-1),Bv())),B=$v(qv(ry(A),Pv(({items:e})=>e.length>0&&0===e[0].index),Uv(0),Bv())),P=$v(qv(ry(A),Kv(N),Pv(([{items:e},t])=>e.length>0&&!t),Fv(([{items:e}])=>({endIndex:e[e.length-1].index,startIndex:e[0].index})),Bv(Ny),Gv(0)));Tv(P,h.scrollSeekRangeChanged),Tv(qv(L,Kv(x,k,E,V),Fv(([e,t,n,r,i])=>{const o=iw(e),{align:a,behavior:l,offset:c}=o;let s=o.index;"LAST"===s&&(s=r-1),s=Db(0,s,Tb(r-1,s));let d=qb(t,i,n,s);return"end"===a?d=Zb(d-t.height+n.height):"center"===a&&(d=Zb(d-t.height/2+n.height/2)),c&&(d+=c),{behavior:l,top:d}})),c);const F=Xv(qv(A,Fv(e=>e.offsetBottom+e.bottom)),0);return Tv(qv(w,Fv(e=>({height:e.visibleHeight,width:e.visibleWidth}))),x),{customScrollParent:C,data:S,deviation:_,footerHeight:i,gap:V,headerHeight:o,increaseViewportBy:e,initialItemCount:M,itemDimensions:k,overscan:n,restoreStateFrom:z,scrollBy:a,scrollContainerState:l,scrollHeight:H,scrollTo:c,scrollToIndex:L,scrollTop:s,smoothScrollTargetReached:d,totalCount:E,useWindowScroll:g,viewportDimensions:x,windowScrollContainerState:v,windowScrollTo:y,windowViewportRect:w,...h,gridState:A,horizontalDirection:Z,initialTopMostItemIndex:I,totalListHeight:F,...f,endReached:R,propsReady:m,rangeChanged:P,startReached:B,stateChanged:O,stateRestoreInProgress:N,...b}},Ov(yw,hy,hw,Iw,nw,Dw,ly));function Fb(e,t,n){return Db(1,Ib((e+n)/(Ib(t)+n)))}function Ub(e,t,n,r){const{height:i}=n;if(void 0===i||0===r.length)return{bottom:0,top:0};const o=qb(e,t,n,r[0].index);return{bottom:qb(e,t,n,r[r.length-1].index)+i,top:o}}function qb(e,t,n,r){const i=Fb(e.width,n.width,t.column),o=Ib(r/i),a=o*n.height+Db(0,o-1)*t.row;return a>0?a+t.row:a}const Wb=ey(()=>{const e=Yv(e=>`Item ${e}`),t=Yv({}),n=Yv(null),r=Yv("virtuoso-grid-item"),i=Yv("virtuoso-grid-list"),o=Yv(nb),a=Yv("div"),l=Yv(_v),c=(e,n=null)=>Xv(qv(t,Fv(t=>t[e]),Bv()),n),s=Yv(!1),d=Yv(!1);return Tv(ry(d),s),{components:t,computeItemKey:o,context:n,FooterComponent:c("Footer"),HeaderComponent:c("Header"),headerFooterTag:a,itemClassName:r,ItemComponent:c("Item","div"),itemContent:e,listClassName:i,ListComponent:c("List","div"),readyStateChanged:s,reportReadyState:d,ScrollerComponent:c("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder","div")}}),Qb=ey(([e,t])=>({...e,...t}),Ov(Pb,Wb)),Gb=i.memo(function(){const t=tE("gridState"),n=tE("listClassName"),r=tE("itemClassName"),o=tE("itemContent"),a=tE("computeItemKey"),l=tE("isSeeking"),c=nE("scrollHeight"),s=tE("ItemComponent"),d=tE("ListComponent"),u=tE("ScrollSeekPlaceholder"),f=tE("context"),h=nE("itemDimensions"),p=nE("gap"),C=tE("log"),g=tE("stateRestoreInProgress"),v=nE("reportReadyState"),y=cy(i.useMemo(()=>e=>{const t=e.parentElement.parentElement.scrollHeight;c(t);const n=e.firstChild;if(n){const{height:e,width:t}=n.getBoundingClientRect();h({height:e,width:t})}p({column:oE("column-gap",getComputedStyle(e).columnGap,C),row:oE("row-gap",getComputedStyle(e).rowGap,C)})},[c,h,p,C]),!0,!1);return Yw(()=>{t.itemHeight>0&&t.itemWidth>0&&v(!0)},[t]),g?null:e(d,{className:n,ref:y,...pb(d,f),"data-testid":"virtuoso-item-list",style:{paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},children:t.items.map(n=>{const i=a(n.index,n.data,f);return l?e(u,{...pb(u,f),height:t.itemHeight,index:n.index,width:t.itemWidth},i):m(s,{...pb(s,f),className:r,"data-index":n.index,key:i},o(n.index,n.data,f))})})}),Kb=i.memo(function(){const t=tE("HeaderComponent"),n=nE("headerHeight"),r=tE("headerFooterTag"),o=cy(i.useMemo(()=>e=>{n(jy(e,"height"))},[n]),!0,!1),a=tE("context");return t?e(r,{ref:o,children:e(t,{...pb(t,a)})}):null}),Yb=i.memo(function(){const t=tE("FooterComponent"),n=nE("footerHeight"),r=tE("headerFooterTag"),o=cy(i.useMemo(()=>e=>{n(jy(e,"height"))},[n]),!0,!1),a=tE("context");return t?e(r,{ref:o,children:e(t,{...pb(t,a)})}):null}),Xb=({children:t})=>{const n=i.useContext(Kw),r=nE("itemDimensions"),o=nE("viewportDimensions"),a=cy(i.useMemo(()=>e=>{o(e.getBoundingClientRect())},[o]),!0,!1);return i.useEffect(()=>{n&&(o({height:n.viewportHeight,width:n.viewportWidth}),r({height:n.itemHeight,width:n.itemWidth}))},[n,o,r]),e("div",{ref:a,style:fb(!1),children:t})},Jb=({children:t})=>{const n=i.useContext(Kw),r=nE("windowViewportRect"),o=nE("itemDimensions"),a=tE("customScrollParent"),l=fy(r,a,!1);return i.useEffect(()=>{n&&(o({height:n.itemHeight,width:n.itemWidth}),r({offsetTop:0,visibleHeight:n.viewportHeight,visibleWidth:n.viewportWidth}))},[n,r,o]),e("div",{ref:l,style:fb(!1),children:t})},$b=i.memo(function({...t}){const r=tE("useWindowScroll"),i=tE("customScrollParent"),o=i||r?iE:rE,a=i||r?Jb:Xb,l=tE("context");return e(o,{...t,...pb(o,l),children:n(a,{children:[e(Kb,{}),e(Gb,{}),e(Yb,{})]})})}),{useEmitter:eE,useEmitterValue:tE,usePublisher:nE}=Qw(Qb,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},$b),rE=vb({useEmitter:eE,useEmitterValue:tE,usePublisher:nE}),iE=yb({useEmitter:eE,useEmitterValue:tE,usePublisher:nE});function oE(e,t,n){return"normal"!==t&&!(null!=t&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,oy.WARN),"normal"===t?0:parseInt(null!=t?t:"0",10)}const aE=({optionsList:r=[],onSelectVariable:i,dropdownPosition:o,position:a="relative",width:l,height:c="160px",zIndex:s=9999})=>{const d={LOCAL:"local_variable_icon",GLOBAL:"global_variable_icon",PROJECT_ENVIRONMENT:"project_env_variable_icon"},u=e=>{if(!e)return"";const t=e._id||e.id;return t?.startsWith("PARAMETER")?"step_group_parameter":"STEPGROUP"!==e?.parentVariableType||"LOCAL"!==e.type&&"STEPGROUP"!==e?.type?"_startforloop"===e.type?"for_loop_variable":"DATAPROVIDER"===e.type?"data_provider_variable":d[e.type||""]||"":"step_group_variable"},f=e=>"_startforloop"===e?.type?`FLV_for:${e?.name}`:"DATAPROVIDER"===e?.type?`${e?.dpName}:${e?.varname}`:e?.name;function h(e){if(e.endsWith("px")){const t=parseInt(e.slice(0,-2),10);return isNaN(t)?212:t-66}return 212}return e("div",{className:z("ff-variable-dropdown",a),style:o?{top:o.top+30,left:o.left-30,width:l,height:c,zIndex:s}:{width:l,height:c,zIndex:s},children:G(r)?e("div",{className:"ff-variable-option ff-variable-option-no-data",children:e(F,{as:"span",fontSize:12,children:"No Option"})}):e(Sb,{totalCount:r.length,itemContent:o=>{const a=r[o];return a?e("div",{className:"ff-variable-data",onMouseDown:()=>i(a),children:l.endsWith("px")?n(t,{children:[e(K,{title:oe(f(a),h(l),"pixel")?f(a):"",style:{width:`${h(l)}px`},children:e(F,{as:"span",fontSize:12,className:"ff-truncated_text",children:f(a)})}),e(P,{name:u(a),height:24,width:24,hoverEffect:!0})]}):e(Mv,{option:a})},`${a.id}-${o}`):null},style:{height:c,fontSize:"12px"},overscan:10,fixedItemHeight:32})})},lE=({data:r=[],width:i,height:o,lineChartWidth:a,yAxisLabel:c,xAxisLabel:d,yAxisValueColor:u,xAxisColor:f,yAxisColor:h,yAxisLabelColor:p,textSize:m,fontWeight:C,numberSize:g,chartName:v,shouldCenterSinglePoint:y,xAxisLabelGap:w=16,isLeftOverflow:b=!1})=>{const E=40,M=i-80,A=o-80,[x,k]=s(!1),[L,H]=s({cursorX:null,hoverValues:{},dotPositions:{},tooltip:{visible:!1,left:0,top:0},currentXValue:null});l(()=>{const e=()=>{k(!1),H(e=>({...e,tooltip:{...e.tooltip,visible:!1}}))};return window.addEventListener("scroll",e,!0),()=>window.removeEventListener("scroll",e,!0)},[]);if(!(r&&r.length>0&&r?.some(e=>Array.isArray(e?.data)&&e?.data?.length>0))){const t=[];for(let e=6;e>=0;e--){const n=new Date;n.setDate(n.getDate()-e);const r=n?.toLocaleDateString("en-US",{day:"numeric",month:"short"});t.push(r)}const r=1024,a=6,l=7;return n("div",{className:"ff-line-chart-text",style:{width:i+20+w,gap:w},children:[e("div",{className:"ff-line-chart-yAxisLabel-warpper",style:{height:o},children:e(F,{className:"ff-line-chart-yAxisLabel",fontSize:m,fontWeight:"semi-bold",children:c})}),e("div",{className:"ff-line-chart-svg",children:e("svg",{height:o,width:i,className:"ff-line-chart-svg",children:n("g",{transform:"translate(40, 40)",children:[e("line",{x1:0,y1:A,x2:M,y2:A,stroke:f,strokeWidth:1}),e("text",{x:M/2.1,y:A+E/1.2,textAnchor:"middle",fill:p,className:"ff-line-chart-x-axis-label",style:{fontSize:m,fontWeight:C},children:d}),t.map((t,n)=>e("text",{x:n*(M/(l-1)),y:A+15,textAnchor:0===n?"start":n===l-1?"end":"middle",fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:g},children:t},t)),Array.from({length:a}).map((t,n)=>{const i=n*r/(a-1),o=i/1024;return e("text",{x:-10,y:A-i*A/r,textAnchor:"end",fill:u,className:"ff-line-chart-y-axis-text",style:{fontSize:g},children:o?.toFixed(1)},`y-${n}`)})]})})})]})}function _(e){if(!isNaN(e))return parseFloat(e);const t=at,n=e.match(t);if(!n)throw new Error("Invalid input format. Use '<value> <unit>' format (e.g., '10.9580078125 KB') or just a number.");const r=parseFloat(n[1]);switch(n[2]?n[2].toUpperCase():null){case"GB":return parseFloat((1024*r).toFixed(2));case"MB":return parseFloat(r.toFixed(2));case"KB":return parseFloat((r/1024).toFixed(2));default:throw new Error("Invalid unit. Supported units are GB, MB, and KB.")}}const S=r?.[0]?.data?.[0]?.hasOwnProperty("date")&&r?.[0]?.data?.[0]?.hasOwnProperty("totalMemory"),V="date",O=S?"totalMemory":"value",z=e=>{const t=r?.[0]?.data?.length;if(1===t)return y?M/2:M;const n=r[0].data.findIndex(t=>t[V]===e);return-1===n?0:n/(t-1)*M},N=Math.max(...r?.flatMap(e=>e?.data?.map(e=>_(e[O]))),5),I=e=>{if("memory"===v){const t=Math.max(...r?.flatMap(e=>e?.data?.map(e=>_(e[O]))));return A-e*A/(t>1024?t:1024)}return A-e*A/(0===N?1024:N)},D=e=>{if(1===e?.length){const t=e?.[0],n=z(t[V]),r=I(_(t[O]));return`M 0 ${I(0)} L ${n} ${r}`}return e?.reduce((t,n,r)=>{const i=z(n[V]),o=I(_(n[O]));if(0===r)return`M ${i} ${o}`;const a=e[r-1],l=a?z(a[V]):0;return`${t} C ${l+(i-l)/2} ${a?I(_(a[O])):0}, ${i-(i-l)/2} ${o}, ${i} ${o}`},"")},T=r[0].data;return n("div",{className:"ff-line-chart-text",style:{width:i+20+w,gap:w},children:[e("div",{className:"ff-line-chart-yAxisLabel-warpper",style:{height:o},children:e(F,{className:"ff-line-chart-yAxisLabel",fontSize:m,fontWeight:"semi-bold",children:c})}),n("div",{className:"ff-line-chart-svg",children:[e("svg",{height:o,width:i,onMouseMove:e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left-E;if(e.clientY-t.top-E>A)return k(!1),void H({cursorX:null,hoverValues:{},dotPositions:{},tooltip:{visible:!1,left:0,top:0},currentXValue:null});let i={hoverValues:{},dotPositions:{}},o=null;r.forEach((e,t)=>{const r=e.data.reduce((e,t)=>{const r=Math.abs(n-z(t[V]));return r<e.distance?{point:t,distance:r}:e},{point:null,distance:1/0}).point;r&&(o=r[V],i.hoverValues[t]=((e,t=2)=>{let n="";if("string"==typeof e){const t=e.match(rt),r=e.match(it);t&&(e=parseFloat(t[0])),r&&(n=r[0])}const r=Math.pow(10,t);return`${Math.ceil(e*r)/r} ${n}`.trim()})(r[O]),i.dotPositions[t]={x:z(r[V]),y:I(_(r[O]))})}),k(!0),H({cursorX:n,hoverValues:i.hoverValues,dotPositions:i.dotPositions,currentXValue:o,tooltip:o?{visible:!0,left:e.clientX+10,top:e.clientY-20}:{visible:!1,left:0,top:0}})},onMouseLeave:()=>H({cursorX:null,hoverValues:{},dotPositions:{},tooltip:{visible:!1,left:0,top:0},currentXValue:null}),className:"ff-line-chart-svg",children:n("g",{transform:"translate(40, 40)",children:[e("line",{x1:0,y1:0,x2:0,y2:A,strokeWidth:2}),e("line",{x1:0,y1:A,x2:M,y2:A,stroke:f,strokeWidth:1}),e("text",{x:M/2.1,y:A+E/1.2,textAnchor:"middle",fill:p,className:"ff-line-chart-x-axis-label",style:{fontSize:m,fontWeight:C},children:d}),r.map((r,i)=>{return!1!==r.show?n("g",{children:[e("path",{d:D(r.data),fill:"none",stroke:r.color,strokeWidth:a,opacity:(o=r.data,o.every(e=>0===_(e[O]))?.5:1)}),L.dotPositions[i]&&n(t,{children:[e("line",{x1:L.dotPositions[i].x,y1:0,x2:L.dotPositions[i].x,y2:A,stroke:"gray",strokeWidth:.5,strokeDasharray:"4"}),e("circle",{cx:L.dotPositions[i].x,cy:L.dotPositions[i].y,r:5,fill:"white",stroke:r.color,strokeWidth:a,style:{transition:"cx 0.1s, cy 0.1s"}}),e("line",{x1:0,y1:L.dotPositions[i].y,x2:M,y2:L.dotPositions[i].y,stroke:"gray",strokeWidth:.5,strokeDasharray:"4"})]})]},i):null;var o}),(()=>{if(1===T.length){const t=T?.[0];return e("text",{x:y?M/2:M,y:A+15,textAnchor:y?"middle":"end",fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:g},children:null!=t[V]?String(t[V]):""},String(t[V]))}if(T.length<7)return T.map(t=>e("text",{x:z(t[V]),y:A+15,textAnchor:"middle",fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:g},children:null!=t[V]?String(t[V]):""},String(t[V])));{const t=(i-80-7*9.2)/6;return Array.from({length:7}).map((n,r)=>{const i=Math.floor(r*(T?.length-1)/6),o=T[i];return e("text",{x:r*t,y:A+15,fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:g},children:null!=o?.[V]?String(o?.[V]):""},String(o?.[V]))})}})(),(()=>{if("memory"===v){const t=Math.max(N,1024);return Array.from({length:6}).map((n,r)=>{const i=r*t/5,o=i/1024;return e("text",{x:-10,y:I(i),textAnchor:"end",fill:u,className:"ff-line-chart-y-axis-text",style:{fontSize:g},children:o.toFixed(1)},`y-${r}`)})}return Array.from({length:6}).map((t,n)=>{const r=n*N/5;return e("text",{x:-10,y:I(r),textAnchor:"end",fill:u,className:"ff-line-chart-y-axis-text",style:{fontSize:g},children:r.toFixed(0)},`y-${n}`)})})()]})}),x&&L.tooltip.visible&&n("div",{className:"ff-line-chart-tooltip",style:{left:b&&L.tooltip.left/2>i/1.75?L.tooltip.left-180:L.tooltip.left,top:L.tooltip.top},children:[e("div",{className:"ff-line-chart-date",children:L.currentXValue}),Object.entries(L.hoverValues).map(([t,i])=>!1!==r[Number(t)]?.show&&n("div",{className:"ff-line-chart-inner-tooltip",children:["default"!==r[Number(t)]?.name&&e("div",{className:"ff-line-chart-status-dot",style:{backgroundColor:r[Number(t)]?.color}}),r[Number(t)]?.name,": ",i]},t))]})]})]})},cE=({onClose:t,top:r="100px",left:i="0px",className:o,description:a="Download and Install the fireflink client to run the script",onClick:c=()=>{},optionZIndex:s=10000001})=>{l(()=>{const e=e=>{"Escape"===e.key&&t?.()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[t]);return n("div",{className:`ff-download-client-wrapper ${o}`,style:{top:r,left:i,zIndex:s},children:[n("div",{className:"ff-download-client-header-wrapper",children:[e("div",{className:"ff-download-client-hollow-triangle"}),e(F,{fontWeight:"semi-bold",lineHeight:"32px",className:"ff-download-client-header-text",children:"Download client"}),e(P,{name:"close",color:"var(--brand-color)",className:"ff-download-client-close-icon",height:12,width:12})]}),n("div",{className:"ff-download-client-content-text",children:[e(F,{as:"div",color:"var(--download-client-content-text-color)",fontWeight:"semi-bold",textAlign:"center",lineHeight:"26px",children:a}),e(F,{as:"div",className:"ff-download-client-description-text",textAlign:"center",fontWeight:"medium",lineHeight:"26px",children:"Choose OS to Download"}),e("div",{className:"ff-download-client-os-wrapper",children:["windows","mac_icon","linux"].map(t=>e("div",{className:"ff-os-version-wrapper",onClick:()=>{c("mac_icon"===t?"mac":t)},children:e(P,{name:t,height:36,width:36})},t))})]})]})},sE=({legendName:t,height:r,width:i,children:o})=>e("div",{className:"ff_fieldSet_container",children:n("fieldset",{className:"ff_fieldSet",style:{height:r,width:i},children:[e("legend",{className:"ff_legend_container",children:e(F,{color:"var(--license_header_text_color)",fontSize:8,lineHeight:"12px",children:t})}),e("div",{className:"ff_children_container",children:o})]})}),dE=({onSelectVariable:t,dropdownPosition:n,filteredOptions:r=[],position:i="relative",width:o="100%",zIndex:a,truncateTextValue:l=34})=>e("div",{className:z(`ff-variable-dropdown-container ${i}`),style:n?{top:n.top+30,left:n.left-30,width:o,zIndex:a}:{width:o,zIndex:a},children:G(r)?e("div",{className:"ff-variable-option no-data",children:e(F,{as:"div",children:"No Option",fontSize:14})}):r?.map(n=>e("div",{className:"ff-variable-option",onMouseDown:()=>t(n),children:e(K,{title:oe(n?.name,l,"pixel")?n?.name:"",children:e(F,{children:ie(n?.name,l,"pixel")})})},n?.id))}),uE=o(({label:t="",hashInputValue:r="",setHashInputValue:i,variableList:o=[],placeholder:c="Enter text",onChange:d,onPaste:u,onCreateVariableClick:f,handleClearInput:h,value:p="",dropdownWidth:m="100%",dropdownHeight:C="160px",isHash:g=!1,isOnlyHash:v=!1,dataFiles:y=[],showAddVariableIcon:w=!0,helperText:E="",error:M,autoComplete:A="off",required:x=!1,zIndex:k=9999,truncateTextValue:L=34,formProps:H={},getSelectedVariable:_=()=>{},symbol:S="$",type:V="text",clearIcon:O=!0,inputTitle:N="",onBlur:I,helperTextWidth:D,iconProps:T={isShowIcon:!1,iconName:"",iconToolTipTitle:"",isIconDisable:!1,iconColor:"",onIconClick:()=>{}},...Z},j)=>{const[R,B]=s(!1),[U,q]=s(!1),[W,Q]=s(!1),[Y,X]=s(null),[J,$]=s(0),[ee,te]=s(!1),[ne,re]=s([]),ie=a(null),oe=a(null),[ae,le]=s("auto"),ce=T?.isShowIcon;l(()=>{const e=oe.current?.querySelector(".ff-input-container");if(!e)return;const t=new ResizeObserver(e=>{for(let t of e){const e=`${t.contentRect.width}px`;le(e)}});return t.observe(e),()=>{t.disconnect()}},[]),b(j,()=>ie.current),l(()=>{null!==Y&&ie.current&&(ie.current.setSelectionRange(Y,Y),ie.current.focus())},[Y]),l(()=>{g&&B(p.startsWith("#"));const e=y?.find(e=>e.name===p),t=o?.find(e=>e?.name===p);if(p.startsWith("#")&&g){const e=p.slice(1).toLowerCase(),t=y.filter(t=>t.name.toLowerCase().includes(e));re(t),B(!0)}const n=null!==e&&p.startsWith("#"),r=null!==t&&p.startsWith("$"),i=p.length>(t?.name.length||0),a=p.length>0&&!r||p.startsWith("#");v?te(!1):r||n||p.includes("$")||p.includes("#")?(te(!1),a&&te(!0)):i&&!p.includes("$")&&te(!0)},[p]);const se=()=>{ie.current&&$(ie.current.selectionStart||0)},de=se,ue=se;l(()=>{ie.current&&$(ie.current.selectionStart||0)},[p]);const fe=e=>{if(ie.current){const{selectionStart:t,selectionEnd:n}=ie.current,r=`${e.name}`;let o;if(o=g&&"#"===p[0]?e.name+p.slice(n||1):e.name,d){d({target:{value:o}},e),_(e.name)}ie.current.value=o,i?.(e),X((t||0)+r.length),B(!1),q(!0)}};const he=function(e,t,n){let r=!1,i="";const o="}"===p[t-1];if(t<0||t>e.length)return{showDropdown:r,searchString:i};const a=e.lastIndexOf(S,t-1),l=e.indexOf(S,t);if(-1!==a&&(v&&"$"===e[a]?r=!1:t===a+1?(r=!0,i=""):(i=e.slice(a+1,-1===l?void 0:l),t>a+1&&(i=e.slice(a+1,t)),r=!0),U&&o&&(r=!1),(/[{}]/.test(i)||0===t)&&(r=!1,i=""),i)){n.some(e=>e.name.toLowerCase().includes(i.toLowerCase()))||(n=[])}return{showDropdown:r,searchString:i}}(p,J,o),pe=()=>o?.filter(e=>e?.name?.toLowerCase()?.includes(he?.searchString?.toLowerCase()));return n("div",{className:"ff-add-variable-container",children:[n("div",{className:"ff-add-variable-input",ref:oe,children:[e(K,{title:N,style:{width:"100%"},children:e(tn,{...Z,name:"add_variable",ref:ie,type:V,className:z("ff-variable-input-container",{"ff-variable-input-container--show-icon":ce}),value:p,onChange:d,onPaste:()=>{te(!0)},variant:"primary",label:t,placeholder:c,onClick:de,onKeyUp:ue,onFocus:()=>Q(!0),onBlur:e=>{(e=>{e.relatedTarget&&e.relatedTarget.closest(".dropdown-container")||Q(!1)})(e),I?.(e)},autoComplete:A,helperText:E,error:M,required:x,helperTextWidth:D,...H})}),!G(p)&&ee&&w&&e("div",{className:"ff-create-variable-container",onClick:f,children:e(F,{fontWeight:"regular",fontSize:"10px",color:"var(--brand-color)",cursor:"pointer",children:"Create Variable"})}),!G(p)&&!v&&e("div",{className:z("ff-cancel-icon-container",{"ff-cancel-icon-container--show-icon":ce}),children:O&&e(K,{title:"Cancel",style:{zIndex:99999},children:e(P,{onClick:h,name:"close",height:16,width:16,hoverEffect:!0})})}),ce&&e("div",{className:"ff-info-icon-container",children:e(K,{title:ce&&!T?.isIconDisable?T?.iconToolTipTitle:"",children:e(P,{name:T?.iconName||"",hoverEffect:!1,height:16,width:16,color:T?.iconColor||"var(--text-area-default-color)",onClick:e=>{T?.onIconClick&&T?.onIconClick(e)},disabled:T?.isIconDisable,cursorType:"pointer"})})})]}),he?.showDropdown&&W&&e(aE,{position:"absolute",zIndex:k,truncateTextValue:L,width:ae,height:G(pe())?"auto":C,optionsList:pe(),onSelectVariable:fe}),R&&g&&W&&e(dE,{position:"relative",zIndex:k,truncateTextValue:L,width:ae,filteredOptions:ne,onSelectVariable:fe})]})}),fE=({isOpen:t,variableTypesList:r=[],onClose:i,onNameChange:o,onValueChange:a,variableName:c,variableValue:d,onVariableTypeChange:u,selectedVariableType:f,hideValue:h=!1,onHideChange:p,handleSubmit:m,mode:C="create",disabled:g,dataFiles:v=[],truncateTextValue:y=34,isEnterKeySubmit:w=!1})=>{const[b,E]=s(!1),[M,A]=s(""),[x,k]=s(),[L,H]=s(!1),[_,S]=s(!1),[V,O]=s({name:"",value:"",isChecked:!1});l(()=>{t&&"edit"===C&&O({name:c,value:d,isChecked:h})},[]);const z=e=>e&&0!==e.length?" "===e[0]||" "===e[e.length-1]?"Space is not allowed at starting and at the end":Ee.test(e)?e.length<3?"Name should contain at least 3 characters":e.length>25?"Name can contain at most 25 characters":"":"Name should be alphanumeric":"Variable Name is required";function N(e){const t=!!e,n=Ee.test(e),r=Vt.test(e),i=e.length>=3&&e.length<=25;return t&&n&&r&&i}l(()=>{const e=z(c);E(!!e),A(e)},[c]),l(()=>{if("edit"!==C)return;const{name:e,value:t,isChecked:n}=V;S(c!==e||d!==t||h!==n)},[C,c,d,h,V]);const I=()=>{!L&&N(c)&&(H(!0),m())};l(()=>{if(!w)return;const e=e=>{if("Enter"===e.key){e.preventDefault();!N(c)||L||"edit"===C&&!_||I()}};return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}},[w,c,d,h,L,C,_,f]);return e(X,{zIndex:1350,onClose:i,isOpen:t,title:"create"===C?"Create Variable":"Edit Variable",width:"284px",height:"280px",top:"30%",right:8,isFooterRequired:!0,overlay:!0,footerContent:e(()=>n("div",{className:"ff-create-slider-footer",children:[e(U,{onClick:i,label:"Cancel",variant:"tertiary"}),e(U,{variant:"primary",label:"create"===C?"Create":"Update",type:"submit",onClick:I,disabled:!N(c)||L||"edit"===C&&!_})]}),{}),children:n("div",{className:"ff-create-variable-slider",children:[e("div",{className:"ff-create-variable-slider-input",children:e(tn,{label:"Variable Name",required:!0,type:"text",name:"variableName",value:c||"",onChange:e=>{H(!1),o(e.target.value)},error:b,helperText:M,onBlur:e=>{const t=e.target.value,n=z(t);E(!!n),A(n)}})}),e(or,{label:"Variable Type",required:!0,onChange:e=>{u(e),H(!1)},selectedOption:f,optionsList:r,optionZIndex:99999,valueAccessor:"label",disabled:"edit"===C}),e(uE,{label:"Variable Value",placeholder:"Enter Variable value or select path using #",isHash:!0,isOnlyHash:!0,zIndex:99999,truncateTextValue:y,dataFiles:v,dropdownWidth:"100%",setHashInputValue:k,hashInputValue:x||{},value:d||"",type:h?"password":"text",onChange:(e,t)=>{const n=e.target.value;a(n,t)},showAddVariableIcon:!1}),n("div",{className:"ff-hide-value-content",children:[e(te,{onChange:e=>p(e.target.checked),name:"hideValue",label:"Hide Value",checked:h,disabled:g}),e(K,{title:"Once the value is hidden, it cannot be undone",children:e(P,{name:"info",width:12,height:12})})]})]})})},hE=({highlightText:t="",tableMeta:r=[],tableData:i=[],accordionType:o="row",noDataContent:a,height:l="100%",withFixedHeader:c=!1,headerType:d,TableAccordionStateIconWidth:u=4,TableAccordionStateIconHeight:f=8})=>{const[h,p]=s(-1),m=(e,t)=>{let n=e[t.accessor];return t.cell?t.cell({value:n,row:e,column:t.accessor}):t.accessor||n&&"object"!=typeof n?n:"--"},C=t=>{const n=t.map((t,n)=>e("table",{className:"ff-accordion-table",cellSpacing:0,children:e("tbody",{className:"ff-table-body",children:e("tr",{className:"ff-table-row",children:r.map((n,r)=>e("td",{className:"ff-table-cell",style:{width:n.width},children:"column"===o&&0===r?"":e(F,{children:m(t,n)})},n.accessor+r))},t.id||n)})},`accordion-table-${n}`));return n};return n("div",{style:{height:l},className:z("ff-accordion-table-container",{"ff-accordion-fixed-header-table":c}),children:[e("table",{cellSpacing:0,className:z("ff-accordion-table",{"ff-accordion-fixed-header":c}),children:e("thead",{children:e("tr",{className:"ff-table-row",children:r.map(t=>e("th",{style:{width:t.width},className:z("ff-table-header",d&&`ff-accordion-table--${d}-bg`),children:e("div",{children:e(F,{fontWeight:"semi-bold",fontSize:12,children:t.header})})},`header-${t.header}`))})})}),"row"===o&&i.map((n,r)=>e($,{highlightText:t,headerTitle:n.title,color:"var(--text-color)",accordionContent:C(n.data),disable:n.disable,disableInfoMessage:n.disableInfoMessage,accordionStateIconName:"arrows_down_icon",AccordionStateIconWidth:u,AccordionStateIconHeight:f},`accordion-row-${r}`)),"column"===o&&i.map((i,o)=>n("div",{className:"column-table-accordion",children:[e("div",{className:"ff-display-flex",children:e(K,{title:i.disable?i?.disableInfoMessage:"string"==typeof i.title&&oe(i.title,r[0]?.width,"pixel")?i.title:"",placement:"bottom-start",children:n("div",{className:`accordion-header ${i.disable&&"accordion-header--disabled"}`,children:[e("div",{className:"header-title",children:e("span",{children:e(F,{children:e(J,{text:ie(i.title,r[0]?.width,"pixel"),highlight:t})})})}),e("div",{className:"accordion-arrow",onClick:()=>{!i.disable&&(e=>{p(e===h?-1:e)})(o)},children:e(P,{name:h===o?"arrows_down_icon":"arrows_right_icon",color:"var(--table-with-accordion-icon-color)",width:u,height:f,hoverEffect:!1})})]})})}),h===o&&e("div",{children:C(i.data)})]},`column-accordion-${o}`)),i.length<=0&&e("div",{className:"no-data-content",style:{height:`calc(${l} - 50px)`},children:a})]})},pE=({progressPercentage:t,totalMemory:r,usedMemory:i,color:o="var(--brand-color)",trackColor:a="#f0f0f0",height:l=10,label:c,labelFontSize:s=12,labelTextColor:d="var(--ff-card-status-text-color)",showPercentage:u=!1,percentageFontSize:f=10,percentageTextColor:h="var(--tooltip-text-color)",progressBarWidth:p="200px"})=>{const m=e=>{const t=e.trim().toLowerCase();if("0"===t)return 0;const n=t.match(/^(\d+(?:\.\d+)?)\s*(kb|mb|gb)$/);if(!n||!n[1])return 0;const r=parseFloat(n[1]),i=n[2];return"gb"===i?1024*r:"kb"===i?r/1024:r};let C=0,g=c;if(void 0!==r&&void 0!==i){const e=m(i),t=m(r);t>0?(C=e/t*100,g=c||i):(C=0,g="0MB")}else C=t||0;const v=Math.max(0,Math.min(C,100));return n("div",{className:"ff-progress-bar-container "+(g?"ff-has-label":""),style:{width:p},children:[e("div",{className:"ff-progress-bar-track",style:{backgroundColor:a,height:`${l}px`},children:e("div",{className:"ff-progress-bar",style:{width:`${v}%`,backgroundColor:o,height:`${l}px`},children:u&&e(F,{className:"ff-progress-bar-percentage",fontSize:f,color:h,children:`${Math.round(v)}%`})})}),g&&e("div",{className:"ff-progress-bar-label",children:e(F,{fontSize:s,color:d,children:e(K,{title:oe(g,10,"count")?g:"",children:ie(g,10,"count")})})})]})},mE=({variant:t="primary",size:n="small",onClick:r,label:i="Choose File",disabled:o=!1,type:l="button",className:c="",style:d={},iconName:f,isChooseFile:h=!1,buttonWidth:p="auto",buttonHeight:m="auto",selectedFile:C={},handleCloseIcon:g,isMandatory:v=!1})=>{const y=a(null),[w,b]=s(0);u(()=>{y.current&&b(y.current.getBoundingClientRect().width-10)},[p]);const E=C?.name||i,M=w?ie(E,w,"pixel"):E,A=!!w&&oe(E,w,"pixel");return e("div",{ref:y,style:{width:p},children:e(K,{title:A?E:"",children:e(U,{variant:t,label:M,type:l,onClick:r,buttonWidth:p,buttonHeight:m,isChooseFile:h,size:n,disabled:o,className:c,iconName:f,style:d,iconPosition:"right",selectedFile:C,handleCloseIcon:g,isMandatory:v})})})},CE=({selected:t="text",handleClick:r,tabList:i})=>{const o=i?.includes("Automation"),a=i?.includes("Manual");return n("div",{className:"ff-script-switch-container",children:[e(K,{title:o?"Automation":"Add Automation",zIndex:1e3,children:e("div",{className:"ff-script-switch-button "+("Automation"===t?"active":""),onClick:()=>r(o?"Automation":"Add Automation"),children:e(P,{name:o?"automation_testcase":"add_testcase",color:"Automation"===t?"var(--primary-button-text-color)":"var(--description-text)"})})}),e(K,{title:a?"Manual":"Add Manual",zIndex:1e3,children:e("div",{className:"ff-script-switch-button "+("Manual"===t?"active":""),onClick:()=>r(a?"Manual":"Add Manual"),children:e(P,{name:a?"manual_testcase":"add_testcase",color:"Manual"===t?"var(--primary-button-text-color)":"var(--description-text)"})})})]})},gE=({selected:t,handleClick:n,tabList:r})=>e("div",{className:"ff-switch-container",children:r.map(r=>e(K,{title:t===r.name?null:r.tooltip,zIndex:1e3,children:e("div",{className:"ff-switch-button "+(t===r.name?"active":""),onClick:()=>n(r.name),children:e(P,{name:r.icon,color:t===r.name?"var(--primary-button-text-color)":"var(--description-text)"})})},r.name))}),vE=({onModalClose:t,MediaSrc:r,fileName:o,onDeleteClick:a,mediaType:c,fileId:d,thumbnailMediaSrc:u,isDelete:f=!0,onExpandClick:h,onDownloadClick:p,isMediaIcon:m=!1,previewOnly:C=!1,iconName:g="video_preview",isDisabled:v=!1})=>{const[y,w]=s(!1),b=i.useRef(null),E=()=>{w(!0),h&&h(d)},M=()=>{t?.(),w(!1)},A=()=>{p&&p(d)};return l(()=>{C&&w(!0)},[C]),n("div",{children:[!C&&(m?e(P,{name:g,hoverEffect:!0,onClick:E,disabled:v}):e(bv,{mediaSrc:r,mediaType:c,onDownloadClick:A,onDeleteClick:()=>a?.(r),onExpandClick:E,fileName:o,fileId:d,thumbnailMediaSrc:u,isDelete:f})),y&&e(Xf,{isOpen:y,onClose:M,isFooterDisplayed:!1,isHeaderDisplayed:!1,customWidth:"1130px",customHeight:"570px",zIndex:1e4,children:n("div",{className:"media-wrapper",children:[n("div",{className:"ff-expand-icons",children:[e(K,{title:"Download File",children:e(P,{name:"download_file_icon",onClick:A,color:"var(--icons-default-color)",className:"header-icons"})}),e(K,{title:"Expand",children:e(P,{name:"expand",onClick:E,color:"var(--icons-default-color)",className:"header-icons"})}),e(K,{title:"close",children:e(P,{name:"close",onClick:M,color:"var(--icons-default-color)",className:"header-icons"})})]}),"image"===c&&e("img",{src:r,alt:"fileName",height:"auto",width:"auto"}),"video"===c&&e("video",{src:r,controls:!0,controlsList:"nodownload",className:"ff-video-preview",ref:b,onCanPlay:()=>{if(b.current){const e=b.current.play();void 0!==e&&e.catch(e=>{console.error("Autoplay failed:",e)})}}})]})})]})},yE=({children:t,orientation:r="",navBarIcons:o=[],mobileHeight:a=448,mobileWidth:l=220,UtilityBar:c,tooltip:s={},background:d,navBarPosition:u="bottom"})=>{const f="portrait"===r,h=f?a:l,p=f?l:a,m=c&&"top"===u,C=c&&"bottom"===u,g=c&&"left"===u;return n("div",{className:["ff-mobileskin-wrapper",f?"portrait":"landscape",g?"ff-side-nav-left":"",m?"navbar-top":"",C?"navbar-bottom":""].filter(Boolean).join(" "),children:[m&&e("div",{className:"ff-nav-bar top-nav-bar",children:o.map(({title:t,name:n,className:r,...i},a)=>{const l=s?.[n]??a;return e(K,{title:s?.[n]||"",placement:"top",children:e("div",{className:`ff-nav-bar-icon ${r||""} ${a===o.length-1?"last-icon":""} ${m?"navbar-top":""}`,children:e(P,{name:n,...i})})},l)})}),e("div",{className:"ff-mobileskin-container",style:{height:h+16,width:p+16},children:e("div",{className:"ff-mobile-container",style:{width:p,height:h,background:d||"transparent"},children:e("div",{className:"ff-mobile-image-container",children:i.isValidElement(t)?t:e("img",{src:t,alt:"Mobile content",style:{width:f?"100%":2.1*l+"px",height:f?"100%":.5*a+"px"}})})})}),c&&C&&e("div",{className:"ff-nav-bar",children:o?.map((t,n)=>{const{title:r,...i}=t;return e("div",{className:`ff-nav-bar-icon ${t?.className||""} ${n===o.length-1?"last-icon":""}`,children:e(K,{title:r,children:e(P,{...i})})},n)})}),c&&g&&e("div",{className:"ff-side-nav-bar",children:o?.map((t,n)=>{const{title:r,...i}=t;return e("div",{className:`ff-sidebar ${t?.className||""} ${n===o.length-1?"last-icon":""}`,children:e(K,{title:r,placement:"bottom",children:e(P,{...i})})},n)})})]})},wE=o(({width:t=300,height:r=40,iconHeight:i=16,iconWidth:o=16,placeholder:l="Enter text",iconName:c="right_arrow_filled_icon",iconPosition:s="left",borderRadius:d=4,autoFocus:u=!1,value:f="",iconColor:h="var(--brand-color)",tooltipTitle:p="send",submitPrompt:m,onPromptChange:C,onBlur:g,onFocus:v,disableInput:y,isAdditionalIcon:w=!1,additionalIconName:b,additionIconToolTip:E,onAdditionalIconClick:M},A)=>{const x=a(null);se([{key:"Enter",action:()=>k()}],x);const k=e=>{f&&m?.(f.trim())};return n("div",{className:z("ff-prompt-container",{"icon-left":"left"===s,"icon-right":"left"!==s}),style:{width:`${t}px`,height:`${r}px`,borderRadius:d},ref:x,children:[e(K,{placement:"top",title:p,children:e(P,{name:c,className:"ff-prompt-icon",height:i,width:o,onClick:m,color:h,disabled:G(f)})}),e("input",{ref:A,className:"ff-prompt-input",type:"text",placeholder:l,autoFocus:u,onChange:C,onFocus:v,onBlur:g,value:f,readOnly:y}),w&&b&&e(K,{placement:"top",title:E,children:e(P,{name:b,className:"ff-prompt-icon additional-icon",height:i,width:o,onClick:M})})]})}),bE=({content:t,isVisible:n,maxWidth:r=300,onClick:i,isClickable:o=!0,arrowPosition:a="left"})=>e("div",{onClick:i,style:{width:`${r}px`,"--triangle-position":r-4+"px"},className:z("ff-chat-msg-box",{visible:n,hidden:!n,pointer:o,default:!o,"chat-arrow-left":"left"===a,"chat-arrow-right":"left"!==a}),children:e("div",{className:z("content",`arrow-${a}`),children:e(F,{children:t})})}),EE=({iconName:r,iconPosition:{top:i,left:o,bottom:a,right:l},hoverIconPosition:{top:c,left:d,bottom:u,right:f},modalPosition:{top:h,left:p,bottom:m,right:C},modalWidth:g,modalHeight:v,headerContent:y="Header Content",footerContent:w="Footer Content",iconWidth:b,iconHeight:E,modalHeading:M="Ask Fia",children:x,onClearChat:k})=>{const[L,H]=s(!1),[_,S]=s(!1);return n(t,{children:[n("div",{style:{top:void 0!==i?`${i}px`:void 0,left:void 0!==o?`${o}px`:void 0,bottom:void 0!==a?`${a}px`:void 0,right:void 0!==l?`${l}px`:void 0},className:"ff-dynamic-icon-container",children:[e(P,{className:"ff-dynamic-icon",name:r,onClick:()=>{S(e=>!e),setTimeout(()=>H(e=>!e),10)},height:E,width:b}),e("div",{style:{top:void 0!==c?`${c}px`:void 0,left:void 0!==d?`${d}px`:void 0,bottom:void 0!==u?`${u}px`:void 0,right:void 0!==f?`${f}px`:void 0},className:"ff-chat-icon-hover",children:e(P,{name:"ask_fia_icon",height:32,width:82})})]}),_&&A(e("div",{className:z("ff-dynamic-modal",{open:L}),style:{top:void 0!==h?`${h}px`:void 0,left:void 0!==p?`${p}px`:void 0,bottom:void 0!==m?`${m}px`:void 0,right:void 0!==C?`${C}px`:void 0,position:"fixed",height:v,width:g},children:n("div",{className:"ff-dynamic-modal-content",children:[y&&e("div",{className:"ff-dynamic-modal-header",children:n("div",{className:"header-container",children:[n("div",{className:"header-left",children:[e(P,{height:16,width:16,name:"fia_icon"}),e(F,{fontWeight:"medium",children:M})]}),n("div",{className:"header-right",children:[e("span",{className:"action",children:e(K,{title:"Clear chat",placement:"bottom",children:e(P,{height:16,width:16,name:"delete",color:"var(--tooltip-text-color)",onClick:k})})}),e("span",{className:"action",children:e(K,{title:"Close",placement:"bottom",children:e(P,{height:16,width:16,name:"close",color:"var(--tooltip-text-color)",onClick:()=>(H(!1),void setTimeout(()=>S(!1),300))})})})]})]})}),e("div",{className:"ff-dynamic-modal-body",children:x}),w&&e("div",{className:"ff-dynamic-modal-footer",children:w})]})}),document.body)]})},ME=o(({iconName:r,hoverTitle:i,iconPosition:{top:o,left:c,bottom:d,right:u},hoverIconPosition:{top:f,left:h,bottom:p,right:m},modalPosition:{top:C,left:g,bottom:v,right:y},modalWidth:w,modalHeight:E,headerContent:M="Header Content",footerContent:x="Footer Content",iconWidth:k,iconHeight:L,children:H,onVisibilityChange:_},S)=>{const[V,O]=s(!1),[N,I]=s(!1),D=a(null),T=()=>{D.current&&clearTimeout(D.current),O(!1),D.current=setTimeout(()=>{I(!1),_?.(!1)},300)};return b(S,()=>({closeModal:T})),l(()=>()=>{D.current&&clearTimeout(D.current)},[]),n(t,{children:[n("div",{style:{top:void 0!==o?`${o}px`:void 0,left:void 0!==c?`${c}px`:void 0,bottom:void 0!==d?`${d}px`:void 0,right:void 0!==u?`${u}px`:void 0},className:"ff-ai-dynamic-icon-container",children:[e(P,{className:"ff-ai-dynamic-icon",name:r,onClick:()=>{D.current&&clearTimeout(D.current),I(e=>!e),_?.(!N),D.current=setTimeout(()=>O(e=>!e),10)},height:L,width:k}),e("div",{style:{top:void 0!==f?`${f}px`:void 0,left:void 0!==h?`${h}px`:void 0,bottom:void 0!==p?`${p}px`:void 0,right:void 0!==m?`${m}px`:void 0},className:"ff-ai-chat-icon-hover",children:e("div",{className:"ai-hover-leaf",children:e(F,{fontWeight:"bold",fontSize:14,color:"var(--chatbot-leaf-text)",children:i})})})]}),N&&A(e("div",{className:z("ff-ai-dynamic-modal",{open:V}),style:{top:void 0!==C?`${C}px`:void 0,left:void 0!==g?`${g}px`:void 0,bottom:void 0!==v?`${v}px`:void 0,right:void 0!==y?`${y}px`:void 0,position:"fixed",height:E,width:w},children:n("div",{className:"ff-ai-dynamic-modal-content",children:[M&&e("div",{className:"ff-ai-dynamic-modal-header",children:M}),e("div",{className:"ff-ai-dynamic-modal-body",children:H}),x&&e("div",{className:"ff-ai-dynamic-modal-footer",children:x})]})}),document.body)]})}),AE=({variant:t,title:r,tabTitle:i,comment:o,profileShortName:a})=>n("div",{className:"ff-history-card",children:[e("div",{className:z("header",`header--${t}`),children:e(F,{fontWeight:"semi-bold",children:i})}),n("div",{className:"body",children:[e("div",{className:"title",children:n("div",{className:"profile",children:[e(F,{className:z("avatar",`avatar--${t}`),children:a}),e(F,{children:r})]})}),n("div",{className:"comment-container",children:[e(F,{fontWeight:"semi-bold",className:"heading",children:"Comments:"}),e(F,{color:"var(--details-page-value-color)",className:"comment",children:o})]})]})]}),xE=({onChange:t,disabled:r,checked:i=!1,id:o="toggle",path:a})=>n("div",{className:"ff--ai-switch-container",children:[e("input",{className:"ff--ai-switch-checkbox",id:`ff-toggle-${o}`,type:"checkbox",disabled:!!r,onChange:e=>{t&&t(e)},checked:i}),e("label",{className:z("ff--ai-switch-label",{"ff--ai-switch-label--disabled":r}),htmlFor:`ff-toggle-${o}`,children:e("span",{className:"ff--ai-switch-content",children:n("span",{className:"ff--ai-switch-content",children:[e(F,{className:z("ff--ai-switch-typography",{left:i,right:!i}),as:"div",fontWeight:"bold",fontSize:18,color:i?"var(--base-bg-color)":"var(--ff-ai-toggle-text-color)",children:"AI"}),e("img",{className:"ff--ai-switch-image",src:a,alt:"AI image"})]})})})]}),kE=o(({name:t,height:n=30,width:r=30,path:i="",onClick:o,color:c="var(--brand-color)",hoverEffect:s=!1,className:d="",disabled:u=!1,variant:f="light",isSelected:h=!1,x:p,y:m,tabIndex:C=-1,...g},v)=>{if(!B[t])return null;const y=a(null);l(()=>{y.current&&(void 0!==p&&y.current.setAttribute("x",String(p)),void 0!==m&&y.current.setAttribute("y",String(m)))},[p,m]);const w={ref:v,onClick:u?void 0:o,style:{height:`${n}px`,width:`${r}px`,cursor:u?"not-allowed":"pointer",opacity:u?.3:1},tabIndex:C,...g};return e("span",{...w,children:e("img",{height:n,width:r,src:i,alt:""})})}),LE=({id:r=0,serialNumber:i,activeId:o,setActiveId:c,children:d,onIconClick:u,numberChildren:f,onContainerClick:h,onNextClick:p,onPreviousClick:m,disabled:C,isEditAccess:g,versionsLength:v,count:y,hiddenActions:w=[]})=>{const[b,E]=s(!1),[M,A]=s(!1),x=a(null),k=Array.isArray(w)?w:w?[w]:[],L=(e,t)=>{e.stopPropagation(),t()};l(()=>{x.current&&(()=>{if(x.current){const e=getComputedStyle(x.current),t=1.2*parseFloat(e.fontSize)*6;x.current.scrollHeight>t&&A(!0)}})()},[]);const H=e=>{e.stopPropagation(),E(!b)};return n("div",{className:`ff-prompt-container-Block ${o===r?"active":"inactive"} `,onClick:()=>{c(r),h()},children:[e(F,{fontSize:8,className:"ff-prompt-number-bg-color",as:"span",children:`Test cases ${i}`}),n(t,{children:[n("div",{className:"ff-prompt-content "+(b?"expanded":""),ref:x,children:[d,b&&n(t,{children:[e("span",{role:"button","aria-label":"toggleExpand",onClick:H,className:"read-less-btn",children:e(F,{color:"var(--brand-color)",fontWeight:"semi-bold",className:"read-more-btn-text",children:"Read Less"})})," "]})]}),M&&!b&&e("div",{role:"button","aria-label":"toggleExpand",onClick:H,className:"read-more-btn",children:e(F,{color:"var(--brand-color)",fontWeight:"semi-bold",className:"read-more-btn-text",children:"Read More"})})]}),n("div",{className:"ff-prompt-icons",children:[e("div",{className:"ff-prompt-icons-leftside",children:[{action:"delete",title:"Delete",color:"var(--ff-delete-button-attachment)"},{action:"edit",title:"Edit",color:"var(--label-edit-text-label-color)"},{action:"regenerate",title:"Regenerate",color:"var(--label-edit-text-label-color)"}].filter(e=>!k.includes(e.action)).map((t,n)=>{const r=g&&"delete"===t?.action||"regenerate"===t?.action&&(v??0)>=3||C;return e(K,{title:t.title,placement:"bottom",children:e(P,{disabled:r,name:t.action,color:t.color,hoverEffect:!0,onClick:e=>((e,t)=>{e.stopPropagation(),u(t)})(e,t.action)})},`${t?.title}-${n}`)})}),n("div",{className:"ff-prompt-icons-rightside",children:[e(P,{disabled:1===y,className:"ff-prompt-icons-style",name:"arrow_left_accordian",color:"var(--table-column-text-color)",width:18,height:18,onClick:e=>L(e,m)}),f,e(P,{disabled:y===v,className:"ff-prompt-icons-style",name:"arrow_right_icon",color:"var(--table-column-text-color)",width:18,height:18,onClick:e=>L(e,p)})]})]})]})},HE=o(({type:t="text",variant:r="primary",name:i="",label:o,disabled:a=!1,disableLinkIcon:l=!1,required:c=!1,placeholder:s="Attach Link",value:d,error:u,helperText:f,noBorder:h,className:p="",onChange:m,onBlur:C,onFocus:g,autoComplete:v="off",autoFocus:y=!1,minValue:w=-1/0,maxValue:b=1/0,transparentBackground:E=!1,size:M="small",isLabelRequired:A=!0,onClick:x,onKeyUp:k,isViewMode:L=!1,...H},_)=>{const S=!G(d);return n("fieldset",{className:z("ff-link-input-fieldset",{"ff-link-input-fieldset--disabled":a}),children:[n("div",{className:z("ff-link-input-container",{"ff-link-input-container--float":S,"ff-link-input-container--disabled":!!a}),children:[A&&n("label",{className:z(`ff-link-input-label-container ff-link-input-label-container--${M}`,{"ff-link-input-label-container--danger":!!u}),htmlFor:i,children:[c&&e("span",{className:"required-asterisk",children:"*"}),e("span",{className:z(`ff-link-input-label ff-link-input-label--${r}`,{"ff-link-input-label--no-hover":!!d,"ff-link-input-label--disabled":!!a,"ff-link-input-label--danger":!!u}),children:o})]}),e("input",{ref:_,name:i,value:d,type:t,spellCheck:!1,id:i,className:z(`ff-link-input ff-link-input-${r} default-input ff-link-input--${M}`,{"ff-link-input--transparentBackground":!!E,"ff-link-input--no-hover":!!d,"ff-link-input--disabled":!!a,"ff-link-input--danger":!!u,"ff-link-input--no-border":!!h,"ff-link-input--placeholder":!A},`${p}`),placeholder:s,disabled:L||a,onChange:m,onFocus:g,onBlur:C,autoComplete:v,autoFocus:y,min:w,max:b,onClick:x,onKeyUp:k,...H}),e("div",{className:"input-link-icon",children:l||u||!S?e(P,{name:"link",disabled:!0}):e(K,{title:"Click here to navigate",children:e("span",{children:e(P,{name:"link",disabled:!1,onClick:()=>{d&&!u&&window.open(d,"_blank")}})})})})]}),f&&u&&e("span",{className:z("ff-link-input-message",{"ff-link-input-message--danger":!!u}),children:f})]})}),_E=({labelsList:r=[],height:i=""})=>{const o=e("div",{className:"ff-chip-tooltip",children:r.filter((e,t)=>t>0).map((t,n)=>e(F,{as:"div",className:"ff-chip-tooltip-label",children:t},`label-${n}-${t}`))});return e(t,{children:!G(r)&&n("div",{className:"ff-chip-with-count-container",children:[e(K,{title:r[0],children:e(F,{as:"div",children:ie(r[0]||"",10),className:"ff-chip-label",fontWeight:"medium",style:i?{height:i}:void 0})}),r.length>1&&e(K,{title:e(F,{as:"div",children:o}),children:e(F,{as:"div",children:"+"+(r.length-1),className:"ff-chip-count",fontWeight:"medium"})})]})})};class SE extends E{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){console.error("ErrorBoundary caught an error:",e,t)}render(){return this.state.hasError?this.props.fallback:this.props.children}}const VE=({iconName:t="",onButtonClick:r,buttonLabel:i="Label",buttonText:o="To Add Group",disableButton:a=!1,stepCount:l=1,iconWidth:c=120,iconHeight:s=120,addContentLabel:d="step"})=>n("div",{className:"add-content-button "+(a?"disabled":""),children:[!G(t)&&e("div",{className:"icon-container",children:e(P,{name:t,width:c,height:s})}),n("div",{className:"typography-label-button",children:[n(F,{fontSize:"12px",fontWeight:"regular",lineHeight:"18px",children:[d+l," :"]}),e(F,{fontSize:"12px",fontWeight:"semi-bold",lineHeight:"18px",children:"Click"}),e(Yf,{label:i,onClick:r,iconName:"plus_user_icon",isDisable:a}),e(F,{fontSize:"12px",fontWeight:"semi-bold",lineHeight:"18px",children:o})]})]}),OE=({variant:t="default",tabsData:r,activeTabId:i,onTabClick:o,noBorder:a=!1,noPadding:l=!1,titleSize:c="12px"})=>{const[d,u]=s(0);return n("div",{className:"ff-tabs-slider-container",children:[n("div",{className:z(`ff-tab-row--${t} ff-tab-row-section`,{"ff-tab-row--no-border":a,"ff-tab-row--no-padding":l,"ff-tab-row--position":r.length>4}),children:[r.length>4&&e(P,{className:"ff-tab-icon ff-tab-icon--previous",name:""+(d?"arrow_left_accordian":""),onClick:()=>{d>0&&u(e=>e-1)},hoverEffect:!0}),e("div",{className:"ff-tab-row-carousel",children:e("div",{className:"carousel_inner",style:{transform:`translateX(-${100*d}%)`},children:r.map(r=>n("button",{onClick:()=>!r.disabled&&o(r.id),disabled:r.disabled,className:z(`ff-tab-button--${t}`,{disabled:r.disabled,active:i===r.id}),style:{flex:"0 0 25%"},children:[n("div",{className:"label-count-section",children:[e(K,{title:r.label.length>9?r.label:"",children:e(F,{children:r.label.length>9?r.label.slice(0,9)+"...":r.label,fontSize:c,lineHeight:"18px",fontWeight:i===r.id?"semi-bold":"regular",color:i===r.id?"var(--tabs-label-active-color)":"var(--tabs-label-default-color)",className:z("ff-tab-label",{"ff-tab-label--active":i===r.id})})}),"default"===t&&r.count&&e("span",{className:z("tab-count",{"tab-count--active":i===r.id}),children:r.count})]}),e("div",{className:z("ff-tab-bar",{"ff-tab-bar--active":i===r.id})}),e("span",{className:"ff-defaultStatus "+("success"===r.status?"ff-successStatus":"error"===r.status?"ff-dangerStatus":"")})]},r.id))})}),r.length>4&&e(P,{className:"ff-tab-icon ff-tab-icon--next",name:""+(d<Math.ceil(r.length/4)-1?"arrow_right_icon":""),onClick:()=>{d<Math.ceil(r.length/4)-1&&u(e=>e+1)},hoverEffect:!0})]}),e("div",{className:"ff-tab-content",children:r.find(e=>e.id===i)?.component})]})},zE=o(({label:t="Status",iconName:r="update_icon",onClick:i,isDisable:o=!1,variant:a="default",backgroundColor:l=!1,border:c=!1},s)=>{const d={default:"var(--ff-avatar-background-color)",success:"var(--status-success-text-color)",danger:"var(--ff-delete-button-attachment)"};return e("button",{disabled:o,onClick:i,className:`\n ff-status-indicator\n ff-status-indicator--${a}\n ${l?`ff-status-indicator--with-bg ff-status-indicator--${a}-bg`:""}\n ${c?`ff-status-indicator--with-border ff-status-indicator--${a}-border`:""}\n `,ref:s,children:n("div",{className:"ff-status-indicator__content",children:[e(P,{name:"danger"===a?"close":r,color:d[a]||d.default,className:`ff-status-indicator__icon ff-status-indicator__icon--${a}`}),e(F,{as:"div",fontSize:12,className:`ff-status-indicator__label ff-status-indicator__label--${a}`,fontWeight:"medium",lineHeight:"20px",children:t})]})})}),NE=({rootLabel:t,childrenLabels:r,align:i="center",direction:o="horizontal"})=>{const a=r.length;return n("div","vertical"===o?{className:"ff-os-tree-vertical",style:{"--child-count":a},children:[n("div",{className:`ff-os-tree-vertical__row ff-os-tree-vertical__row--${i}`,children:[e("div",{className:"ff-os-tree-vertical__root-label",children:t}),e("div",{className:"ff-os-tree-vertical__horizontal-line"})]}),n("div",{className:"ff-os-tree-vertical__vertical-line-wrapper",children:[e("div",{className:"ff-os-tree-vertical__vertical-line"}),r.map((t,r)=>n("div",{className:"ff-os-tree-vertical__child",children:[e("div",{className:"ff-os-tree-vertical__child-connector"}),e("div",{className:"ff-os-tree-vertical__child-label",children:t})]},r))]})]}:{className:`ff-os-tree ff-os-tree--${i}`,style:{"--child-count":a},children:[n("div",{className:"ff-os-tree__root-wrapper",children:[e("div",{className:"ff-os-tree__root-label",children:t}),e("div",{className:"ff-os-tree__vertical-root"})]}),e("div",{className:"ff-os-tree__horizontal-connector",children:r.map((t,n)=>e("div",{className:"ff-os-tree__vertical-child"},n))}),e("div",{className:"ff-os-tree__children",children:r.map((t,n)=>e("div",{className:"ff-os-tree__child-container",children:e("div",{className:"ff-os-tree__child-label",children:t})},n))})]})},IE=({handleClose:t,handleResend:r,handleOtp:i,resendTimeout:o=30})=>{const[c,d]=s(Array(6).fill("")),[u,f]=s(o),[h,p]=s(!0),m=a(Array(6).fill(null));l(()=>{h||m.current[0]?.focus()},[h]),l(()=>{let e;return u>0&&(e=window.setInterval(()=>f(e=>e-1),1e3)),0===u&&p(!1),()=>clearInterval(e)},[u]);const C=e=>{e.preventDefault();const t=e.clipboardData.getData("text").replace(/\D/g,"").slice(0,6),n=Array(6).fill("");t.split("").forEach((e,t)=>{n[t]=e}),d(n);const r=Math.min(t.length,5);m.current[r]?.focus()};return e(Xf,{isOpen:!0,onClose:t,isFooterDisplayed:!1,isHeaderDisplayed:!1,zIndex:999999,customWidth:"340px",children:n("div",{className:"ff-otp-popup",children:[n("div",{className:"ff-otp-header",children:[e(F,{fontSize:24,lineHeight:"36px",fontWeight:"semi-bold",children:"OTP Verification"}),e(P,{name:"close",height:16,width:16,onClick:t,className:"ff-close-icon"})]}),e("div",{className:"ff-otp-boxes",children:c.map((t,n)=>e("input",{type:"text",maxLength:1,className:`ff-otp-input ${t?"filled":""} ${n===c.findIndex(e=>""===e)?"active":""}`,value:t,onKeyDown:e=>((e,t)=>{const{key:n}=e;if(/^[0-9]$/.test(n)){e.preventDefault();const r=[...c];r[t]=n,d(r),t<5&&m.current[t+1]?.focus()}else if("Backspace"===n){e.preventDefault();const n=[...c];n[t]="",d(n),t>0&&m.current[t-1]?.focus()}})(e,n),onPaste:C,ref:e=>m.current[n]=e,readOnly:!0},n))}),e(U,{variant:"primary",label:"Submit",onClick:()=>i(c.join("")),disabled:c.includes(""),className:"ff-submit-btn"}),n("div",{className:"ff-resend "+(h?"disabled":""),onClick:h?void 0:()=>{f(o),p(!0),d(Array(6).fill("")),r()},children:["Re-send OTP",u>0?` (${u}s)`:""]})]})})},DE=({isOpen:t,onClose:r,isPlaying:i,onTogglePlay:o,mediaType:c,src:d,headerTitle:u,onDownload:f,onExpand:h,showHeader:m=!0,showDownload:C=!0,showExpand:g=!0,width:v="800px",height:y="432px",showControls:w=!0,customStyle:b,overlay:E=!0,children:M,showControlDownload:A=!1,showControlExpand:x=!1})=>{const k=a(null),L=a(null),[H,_]=s(0),[S,V]=s(0),[O]=s(!1),[z,N]=s(!1),[I,D]=s(0);l(()=>{"video"===c&&k.current&&!M&&(i?k.current.play():k.current.pause())},[i,c,M]);const T=p(()=>{if(k.current&&!z){const e=k.current.currentTime/k.current.duration*100;D(e||0),_(k.current.currentTime)}},[z]),Z=p(()=>{k.current&&V(k.current.duration)},[]),j=p(()=>{_(0),D(0),o?.()},[o]),R=p(e=>`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,"0")}`,[]),B=p(e=>{if(k.current){const t=e/100*k.current.duration;k.current.currentTime=t,D(e),_(t)}},[]),U=p(e=>{if(z||!L.current)return;const t=L.current.getBoundingClientRect(),n=e.clientX-t.left,r=t.width,i=Math.max(0,Math.min(100,n/r*100));B(i)},[B,z]),q=p(e=>{if(!L.current)return;N(!0);const t=L.current.getBoundingClientRect(),n=e.clientX-t.left,r=t.width,i=Math.max(0,Math.min(100,n/r*100));B(i)},[B]),W=p(e=>{if(!z||!L.current||!k.current)return;const t=L.current.getBoundingClientRect(),n=e.clientX-t.left,r=t.width,i=Math.max(0,Math.min(100,n/r*100));B(i)},[z,B]),Q=p(()=>{N(!1)},[]);return l(()=>{if(z)return document.addEventListener("mousemove",W),document.addEventListener("mouseup",Q),()=>{document.removeEventListener("mousemove",W),document.removeEventListener("mouseup",Q)}},[z,W,Q]),t?e(kc,{isOpen:t,onClose:r,isMaximized:!1,showHeader:m,overlay:E,downloadHandler:()=>{},customStyle:b,header:n("div",{className:"ff-header-content",children:[e(P,{width:23,height:23,name:"automatic_locator"}),e(F,{children:e("span",{className:"ff-header-title",children:u})})]}),icons:e(K,{title:"Close",children:e(P,{name:"close",onClick:r})}),width:v,height:y,zIndex:999,children:n("div",{className:"ff-video-wrapper",children:[M||("video"===c?e("video",{ref:k,src:d,className:"ff-media-video",onTimeUpdate:T,onLoadedMetadata:Z,onEnded:j}):e("img",{src:d,alt:"Preview",className:"ff-media-image"})),n("div",{className:"ff-top-right-icons",children:[C&&e(K,{title:"Download",children:e(P,{name:"download_file",color:"white",onClick:f})}),g&&e(K,{title:O?"Minimize":"Maximize",children:e(P,{name:O?"collapse_icon":"expand_icon",color:"white",onClick:h})})]}),"video"===c&&w&&!M&&n("div",{className:"ff-media-controls",children:[e("button",{onClick:o,className:"ff-play-pause-btn",children:e(P,i?{width:35,height:35,name:"pause_button",color:"white"}:{width:35,height:35,name:"play_button",color:"white"})}),n("div",{className:"ff-progress-bar",children:[e("span",{className:"ff-current-time",children:R(H)}),e("input",{type:"range",className:"ff-seek-bar",min:0,max:100,value:I,onChange:e=>B(parseFloat(e.target.value)),onClick:U,onMouseDown:q,ref:L}),e("span",{className:"ff-total-time",children:R(S)})]}),n("div",{className:"ff-control-icons",children:[A&&e(K,{title:"Download",children:e(P,{name:"download_file",color:"white",onClick:f,cursorType:"pointer"})}),x&&e(K,{title:O?"Minimize":"Maximize",children:e(P,{name:O?"collapse_icon":"expand_icon",color:"white",onClick:h,cursorType:"pointer"})})]})]})]})}):null},TE=({header:r,secondaryHeader:i,primaryCount:o,secondaryCount:a,primaryItems:l,secondaryItems:c,width:s,activeTab:d="primary",activeTabId:u,onPrimaryTabClick:f,onSecondaryTabClick:h,onTabClick:p,actions:m,tabsData:C,notchPosition:g="top-left"})=>{const v=i&&"secondary"===d?c:l,y=a&&parseInt(a)>0,w=o&&parseInt(o)>0,b=i&&(w||y),{tooltip:E="Download",iconName:M="download_file",disabled:A=!1,onClick:x}=m?.download||{},{tooltip:k="Delete",iconName:L="delete_icon",disabled:H=!1,onClick:_}=m?.delete||{},S=()=>n("div",{className:"ff-dropdown-header-icons",children:[m?.download&&e(K,{title:E,children:e(P,{name:M||"",className:"ff-dropdown-icon ff-download-icon",onClick:x,width:18,height:20,disabled:A,hoverEffect:!0})}),m?.delete&&e(K,{title:k,children:e(P,{name:L||"",className:"ff-dropdown-icon ff-delete-icon",onClick:_,width:25,height:25,disabled:H,hoverEffect:!0})})]});return n("div",{className:"ff-resolution-dropdown",style:s?{minWidth:s}:{},children:[e("div",{className:"ff-dropdown-notch "+("bottom-center"===g?"bottom-center":"top-left")}),e("div",{className:"ff-dropdown-header",children:e("div",{className:"ff-dropdown-header-content",children:i&&C&&u?n(t,{children:[e(Zc,{tabsData:C,activeTabId:u,onTabClick:e=>{p&&p(e),"tab-1"===e&&f?f():"tab-2"===e&&h&&h()}}),b&&S()]}):i&&b?n("div",{className:"ff-dropdown-header-dual",children:[n("div",{className:"ff-dropdown-header-item "+("primary"===d?"active":""),onClick:f,children:[e(F,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:r}),o&&e("span",{className:"ff-dropdown-count",children:o})]}),n("div",{className:"ff-dropdown-header-item "+("secondary"===d?"active":""),onClick:h,children:[e(F,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:i}),a&&e("span",{className:"ff-dropdown-count",children:a})]}),S()]}):i?n("div",{className:"ff-dropdown-header-dual",children:[n("div",{className:"ff-dropdown-header-item "+("primary"===d?"active":""),onClick:f,children:[e(F,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:r}),o&&e("span",{className:"ff-dropdown-count",children:o})]}),n("div",{className:"ff-dropdown-header-item "+("secondary"===d?"active":""),onClick:h,children:[e(F,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:i}),a&&e("span",{className:"ff-dropdown-count",children:a})]})]}):e(F,{fontSize:16,fontWeight:"semi-bold",children:r})})}),e("ul",{className:"ff-dropdown-list",children:v?.map((t,n)=>e("li",{className:"ff-dropdown-item",children:t},n))})]})},ZE=(e,t)=>"string"==typeof e?ie(e,t):i.isValidElement(e)?i.cloneElement(e,{},ZE(e.props.children,t)):Array.isArray(e)?e.map(e=>ZE(e,t)):e;const jE=o(({treeData:r,columnsData:i,selected:o=[],select:c=null,onChange:d,onClick:f,onExpand:m,loadMore:C=()=>{},tableBorder:g,height:v="calc(100vh - 134px)",newNode:y,onAddConfirm:w=e=>{},onAddCancel:E=()=>{},handleEditFieldError:M,loading:A=!1,rootNode:x,pagination:k,selectedNode:L,tableHeaderBgColor:H="var(--border-color)",hideOnDisable:_=!1,freezeColumns:S,scriptLengthTruncate:V=25,addModuleInputWidth:O,addModuleSelectWidth:z,onScroll:N,onScrollEnd:I,disableEditLabelConfirmIcon:D,transparentHeader:T=!1,navigateTreeNode:Z=null,handleRemoveNavigateTreeNode:j=()=>{},scrollThreshold:R=128,showHeader:B=!0},P)=>{const[F,U]=s([]),[q,W]=s(0),[Q,K]=s(!1),[Y,X]=s(null),[J,$]=s(new Set),ee=a(null),ne=a(null),re=a(null),ie=a([]),oe=a({lastScrollTop:0,lastScrollTime:0,direction:null}),[ae,le]=s(null),[ce,se]=s(null),[de,ue]=s(null),[fe,he]=s(null);b(P,()=>ee.current),l(()=>{const e=new Blob(["\n self.onmessage = function(e) {\n const { type, payload } = e.data;\n\n try {\n if (type === 'PROCESS_DATA') {\n const { data, sortConfig, filterQuery } = payload;\n let processedData = [...data]; // Create a copy to avoid mutations\n\n // 1. Heavy Filtering O(N)\n if (filterQuery && filterQuery.trim()) {\n const query = filterQuery.toLowerCase();\n processedData = processedData.filter(row => \n Object.values(row).some(val => \n String(val).toLowerCase().includes(query)\n )\n );\n }\n\n // 2. Heavy Sorting O(N log N) - Merge Sort implementation\n if (sortConfig && sortConfig.key) {\n const { key, direction } = sortConfig;\n processedData.sort((a, b) => {\n const aVal = a[key];\n const bVal = b[key];\n \n // Handle undefined/null values\n if (aVal == null && bVal == null) return 0;\n if (aVal == null) return direction === 'asc' ? -1 : 1;\n if (bVal == null) return direction === 'asc' ? 1 : -1;\n \n // String comparison\n if (typeof aVal === 'string' && typeof bVal === 'string') {\n const comparison = aVal.localeCompare(bVal);\n return direction === 'asc' ? comparison : -comparison;\n }\n \n // Numeric comparison\n if (typeof aVal === 'number' && typeof bVal === 'number') {\n return direction === 'asc' ? aVal - bVal : bVal - aVal;\n }\n \n // Default comparison\n const aStr = String(aVal);\n const bStr = String(bVal);\n const comparison = aStr.localeCompare(bStr);\n return direction === 'asc' ? comparison : -comparison;\n });\n }\n\n // Post processed data back to main thread\n self.postMessage({ \n type: 'DATA_READY', \n payload: processedData \n });\n }\n } catch (error) {\n self.postMessage({ \n type: 'ERROR', \n payload: { message: error.message } \n });\n }\n };\n"],{type:"application/javascript"});return ne.current=new Worker(URL.createObjectURL(e)),ne.current.onmessage=e=>{const{type:t,payload:n}=e.data;"DATA_READY"===t?U(n):"ERROR"===t&&console.error("Worker error:",n)},()=>ne.current?.terminate()},[]),l(()=>{ne.current?.postMessage({type:"PROCESS_DATA",payload:{data:r,expandedKeys:Array.from(J)}})},[r,J]);const{virtualItems:pe,totalHeight:me}=((e,t,n,r,i=5)=>h(()=>{if(0===r)return{virtualItems:[],totalHeight:0,startIndex:0,endIndex:0};const o=Math.floor(e/n),a=Math.min(r-1,Math.ceil((e+t)/n)),l=Math.max(0,o-i),c=Math.min(r-1,a+i),s=[];for(let e=l;e<=c;e++)s.push({index:e,offsetY:e*n});return{virtualItems:s,totalHeight:r*n,startIndex:l,endIndex:c}},[e,t,n,r,i]))(q,"string"==typeof v?600:v,32,F.length);l(()=>{if(Z&&F.length>0){const e=F.findIndex(e=>e.key===Z),t=ee.current;if(-1!==e&&t){he(t.scrollTop);const n=32*e,r=t.clientHeight;t.scrollTo({top:Math.max(0,n-r/2+16),behavior:"smooth"}),j()}}},[Z,F,j]),l(()=>{null!==fe&&!A&&ee.current&&(Z||(ee.current.scrollTop=fe,he(null)))},[fe,A,Z]);const Ce=p(()=>{A||"above"===de||(ue("above"),le(ee.current?.scrollTop??null),se(ee.current?.scrollHeight??null),C("above"))},[A,de,C]),ge=p(()=>{A||"below"===de||(ue("below"),C("below"))},[A,de,C]),ve=p(()=>{const e=ee.current;if(!e||G(F))return;const t=Date.now(),n=e.scrollTop,r=e.scrollHeight,i=e.clientHeight;W(n),Q||K(!0),re.current&&clearTimeout(re.current),re.current=setTimeout(()=>{K(!1)},150);const o=n>oe.current.lastScrollTop?"down":"up";oe.current={lastScrollTop:n,lastScrollTime:t,direction:o};const a=n<R;if("down"!==o||!(r-(n+i)<R)||A||de||!0===F[F.length-1]?.lastResource||ge(),"up"!==o||!a||A||de||!0===F[0]?.lastResource||Ce(),!A&&"above"===de&&ie.current.length>0&&null!==ae){const t=ie.current;let n=0;for(let e=0;e<F.length&&t[0]?.key!==F[e]?.key;e++)n++;requestAnimationFrame(()=>{const t=32*n;t>0&&(e.scrollTop=ae+t,ie.current=F)})}},[A,de,F,Ce,ge,ae,R,Q]);l(()=>{const e=ee.current;if(!e)return;const t=Aa(()=>I?.(),150),n=()=>{N?.(),ve(),t()};return e.addEventListener("scroll",n),()=>{e.removeEventListener("scroll",n),t.cancel()}},[ve,N,I]),u(()=>{if(A||"above"!==de||null===ae||null===ce)A||ue(null);else{const e=ee.current;if(!e)return;const t=e.scrollHeight-ce;t>0&&(e.scrollTop=ae+t),ue(null),le(null),se(null)}},[A,de,ae,ce]);const ye=p(e=>{if(Y)return;X(e.key);const t=new Set(J);t.has(e.key)?t.delete(e.key):t.add(e.key),$(t),m?.(e)},[m,Y,J]),we=p((e,t)=>{Y||d?.(e,t)},[d,Y]),be=p((e,t)=>{Y||f?.(e,t)},[f,Y]),Ee=({node:t,index:n})=>{const r=t.expandable,i=J.has(t.key)||t.expanded,o=t.lastChild,a=t.lastResource,l=t.folder||r;return e("div",{className:`dg-tree-space-block ${r?"btn-toggle":""} ${o?"last-block":""} ${l?"":"no-folder"} ${a?"last-node":""} ${0===n?"tree-table-space-block-0":""}`,onClick:e=>{r&&(e.stopPropagation(),ye(t))},children:r&&e("div",{className:"dg-tree-expanded "+(i?"":"dg-tree-collapsed"),children:Y===t.key?e("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2024%2024%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%20%3Cstyle%3E%20%20%20%20.spinner_DupU%20%7B%20%20%20%20%20%20animation%3A%20spinner_sM3D%201.2s%20infinite%3B%20%20%20%20%20%20fill%3A%20%2371347b%3B%20%20%20%20%7D%20%20%20%20.spinner_GWtZ%20%7B%20animation-delay%3A%20.1s%3B%20%7D%20%20%20%20.spinner_dwN6%20%7B%20animation-delay%3A%20.2s%3B%20%7D%20%20%20%20.spinner_46QP%20%7B%20animation-delay%3A%20.3s%3B%20%7D%20%20%20%20.spinner_PD82%20%7B%20animation-delay%3A%20.4s%3B%20%7D%20%20%20%20.spinner_eUgh%20%7B%20animation-delay%3A%20.5s%3B%20%7D%20%20%20%20.spinner_eUaP%20%7B%20animation-delay%3A%20.6s%3B%20%7D%20%20%20%20.spinner_j38H%20%7B%20animation-delay%3A%20.7s%3B%20%7D%20%20%20%20.spinner_tVmX%20%7B%20animation-delay%3A%20.8s%3B%20%7D%20%20%20%20.spinner_DQhX%20%7B%20animation-delay%3A%20.9s%3B%20%7D%20%20%20%20.spinner_GIL4%20%7B%20animation-delay%3A%201s%3B%20%7D%20%20%20%20.spinner_n0Yb%20%7B%20animation-delay%3A%201.1s%3B%20%7D%20%20%20%20%40keyframes%20spinner_sM3D%20%7B%20%20%20%20%20%200%25%2C%2050%25%20%7B%20%20%20%20%20%20%20%20animation-timing-function%3A%20cubic-bezier%280%2C%201%2C%200%2C%201%29%3B%20%20%20%20%20%20%20%20r%3A%200%3B%20%20%20%20%20%20%7D%20%20%20%20%20%2010%25%20%7B%20%20%20%20%20%20%20%20animation-timing-function%3A%20cubic-bezier%28.53%2C%200%2C%20.61%2C%20.73%29%3B%20%20%20%20%20%20%20%20r%3A%202px%3B%20%20%20%20%20%20%7D%20%20%20%20%7D%20%20%3C%2Fstyle%3E%20%20%3Ccircle%20class%3D%22spinner_DupU%22%20cx%3D%2212%22%20cy%3D%223%22%20r%3D%220%22%20%2F%3E%20%20%3Ccircle%20class%3D%22spinner_DupU%20spinner_GWtZ%22%20cx%3D%2216.50%22%20cy%3D%224.21%22%20r%3D%220%22%20%2F%3E%20%20%3Ccircle%20class%3D%22spinner_DupU%20spinner_n0Yb%22%20cx%3D%227.50%22%20cy%3D%224.21%22%20r%3D%220%22%20%2F%3E%20%20%3Ccircle%20class%3D%22spinner_DupU%20spinner_dwN6%22%20cx%3D%2219.79%22%20cy%3D%227.50%22%20r%3D%220%22%20%2F%3E%20%20%3Ccircle%20class%3D%22spinner_DupU%20spinner_GIL4%22%20cx%3D%224.21%22%20cy%3D%227.50%22%20r%3D%220%22%20%2F%3E%20%20%3Ccircle%20class%3D%22spinner_DupU%20spinner_46QP%22%20cx%3D%2221.00%22%20cy%3D%2212.00%22%20r%3D%220%22%20%2F%3E%20%20%3Ccircle%20class%3D%22spinner_DupU%20spinner_DQhX%22%20cx%3D%223.00%22%20cy%3D%2212.00%22%20r%3D%220%22%20%2F%3E%20%20%3Ccircle%20class%3D%22spinner_DupU%20spinner_PD82%22%20cx%3D%2219.79%22%20cy%3D%2216.50%22%20r%3D%220%22%20%2F%3E%20%20%3Ccircle%20class%3D%22spinner_DupU%20spinner_tVmX%22%20cx%3D%224.21%22%20cy%3D%2216.50%22%20r%3D%220%22%20%2F%3E%20%20%3Ccircle%20class%3D%22spinner_DupU%20spinner_eUgh%22%20cx%3D%2216.50%22%20cy%3D%2219.79%22%20r%3D%220%22%20%2F%3E%20%20%3Ccircle%20class%3D%22spinner_DupU%20spinner_j38H%22%20cx%3D%227.50%22%20cy%3D%2219.79%22%20r%3D%220%22%20%2F%3E%20%20%3Ccircle%20class%3D%22spinner_DupU%20spinner_eUaP%22%20cx%3D%2212%22%20cy%3D%2221%22%20r%3D%220%22%20%2F%3E%3C%2Fsvg%3E",{width:12,height:12}):e("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%228%22%20viewBox%3D%220%200%2012%208%22%20fill%3D%22currentColor%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M11.8082%201.15807L11.4151%200.762261C11.2914%200.63865%2011.1268%200.570552%2010.9509%200.570552C10.7751%200.570552%2010.6103%200.63865%2010.4866%200.762261C8.01023%203.23876%203.99002%203.23373%201.51357%200.757285C1.39006%200.633674%201.22528%200.565674%201.04947%200.565674C0.873666%200.565674%200.708786%200.633674%200.585176%200.757285L0.192002%201.15065C-0.0640005%201.40646%20-0.0640005%201.82315%200.192002%202.07895L5.53683%207.443C5.66034%207.56651%205.82493%207.65354%206.00229%207.65354H6.00434C6.18025%207.65354%206.34483%207.56641%206.46835%207.443L11.8082%202.09349C11.9319%201.96998%2011.9998%201.80042%2012%201.62461C12%201.44871%2011.9319%201.28148%2011.8082%201.15807Z%22%20fill%3D%22currentColor%22%2F%3E%3C%2Fsvg%3E",{width:12,height:12})})})},Me=({node:t,column:r})=>{if("name"===r.accessor){const i=t.parentSiblings||Array(t.hierarchy||0).fill(!1);return n("div",{className:"dg-tree-container",children:[e("div",{className:"dg-tree-space-container",children:i.map((t,n)=>e("div",{className:"dg-tree-space-block "+(t?"":"no-lines")},n))}),e(Ee,{node:t,index:0}),n("div",{className:"dg-tree-content",children:["checkbox"===c&&!(_&&t.unselectable)&&e("div",{className:"dg-tree-content-select",children:e(te,{checked:"partially"!==t.selectedStatus&&("completely"===t.selectedStatus||!1),partial:"partially"===t.selectedStatus,onChange:e=>we(e,t),disabled:t.unselectable})}),"radio"===c&&!(_&&t.unselectable)&&e("div",{className:"dg-tree-content-select",children:e(za,{name:t.key,checked:o.includes(t.key),value:t.key,onChange:e=>we(e,t),disabled:t.unselectable})}),e("span",{className:"dg-tree-content-text "+(t.folder?"folder":""),children:ZE(vr(t,r),V)}),r.cell&&e("span",{className:"dg-tree-content-custom",children:r.cell({row:t,value:t[r.accessor]})})]}),r.actions&&e("div",{className:"dg-row-actions",children:r.actions(t)})]})}return n("div",{className:"dg-cell-content",children:[r.cell?r.cell({row:t,value:t[r.accessor]}):ZE(vr(t,r),V),r.actions&&e("div",{className:"dg-row-actions",children:r.actions(t)})]})},Ae=h(()=>i.map(e=>e.width||"400px").join(" "),[i]),xe=h(()=>S?i.slice(0,S).reduce((e,t)=>e+parseInt(t.width||"400",10),0):0,[S,i]),ke=({virtualItem:t})=>{const n=F[t.index];return n?e("div",{className:"dg-row "+(L&&L===n.key?"hover-selected":""),style:{height:32,transform:`translateY(${t.offsetY}px)`,gridTemplateColumns:Ae,"--frozen-column-width":S?`${xe}px`:"0px"},onClick:e=>be(e,n),id:0===t.index?"table-first-row":n.key,children:i.map((t,r)=>e("div",{className:"dg-cell",style:{width:t.width,paddingLeft:0===r?"8px":"12px"},children:e(Me,{node:n,column:t})},r))},t.index):null};return e("div",{className:"tree-table-wrapper-container",children:e("div",{className:"tree-table-wrap",ref:P,children:e("div",{className:`dg-container ${F.length?"":"table-empty"} ${Q?"dg-scrolling":""}`,ref:ee,style:{"--table-height":F.length?v:"auto","--frozen-column-width":S?`${xe}px`:"0px",border:g,height:"string"==typeof v?v:`${v}px`},children:n("div",{className:"dg-grid-container",style:{position:"relative"},children:[e(()=>B?e("div",{className:"dg-header "+(T?"dg-header-transparent":""),style:{gridTemplateColumns:Ae,backgroundColor:T?"transparent":H,pointerEvents:T?"none":"auto"},children:i.map(({name:t,width:n},r)=>e("div",{className:"dg-header-cell",style:{width:n,backgroundColor:T?"transparent":H},children:t},r))}):null,{}),e(()=>x?e("div",{className:"dg-root-row "+(L&&L===x?.node?.key?"hover-selected":""),style:{gridTemplateColumns:Ae},children:i.map((r,i)=>n("div",{className:"dg-root-cell",children:[0===i&&n(t,{children:["checkbox"===x.select&&e(te,{checked:"completely"===x?.node?.selectedStatus,partial:"partially"===x.node.selectedStatus,onChange:e=>we(e,x.node),disabled:x.node.unselectable}),"radio"===x.select&&e(za,{name:x.node.key,checked:o.includes(x.node.key),value:x.node.key,onChange:e=>we(e,x.node),disabled:x.node.unselectable})]}),e("span",{className:"dg-tree-content-text",children:"name"===r.accessor?e("span",{children:x.node[r.accessor]}):e("span",{children:ZE(vr(x.node,r),V)})})]},i))}):null,{}),e("div",{className:"dg-spacer",style:{height:me}}),pe.map(t=>e(ke,{virtualItem:t},t.index))]})})})})});function RE(e,t,n,r,i,o="children"){return function e(a){for(let l=0;l<a.length;l++){const c=a[l];if(c&&c[t]===n){const e=[...a];return"replace"===i?e[l]=r:e.splice("above"===i?l:l+1,0,r),{updatedArray:e}}if(c&&c[o]&&Array.isArray(c[o])){const t=e(c[o]);if(t)return{updatedArray:a.map((e,n)=>n===l?{...e,[o]:t.updatedArray}:e)}}}return null}(e)}const BE=(e,t)=>{if(e===t)return!0;if(null==e||null==t||"object"!=typeof e||"object"!=typeof t)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=Array.isArray(e),r=Array.isArray(t);if(n!==r)return!1;const i=n?e:Object.keys(e),o=r?t:Object.keys(t);if(i.length!==o.length)return!1;if(n)return i.every((e,t)=>BE(e,o[t]));{const n=new Set(o);return i.every(r=>n.has(r)&&BE(e[r],t[r]))}},PE=(e,t)=>!(!Array.isArray(e)||!Array.isArray(t))&&(e.length===t.length&&e.every((e,n)=>{const r=t[n];return BE(e,r)}));async function FE(e,t){const n=Uint8Array.from(atob(t),e=>e.charCodeAt(0)),r=await crypto.subtle.importKey("spki",n,{name:"RSA-OAEP",hash:"SHA-256"},!1,["encrypt"]),i=(new TextEncoder).encode(e),o=await crypto.subtle.encrypt({name:"RSA-OAEP"},r,i);return btoa(String.fromCharCode(...new Uint8Array(o)))}const UE=e=>{const t=e.toLowerCase().trim(),n=parseFloat(t);switch(t.replace(/[0-9.]/g,"").trim()){case"gb":return 1024*n*1024*1024;case"mb":return 1024*n*1024;case"kb":return 1024*n;default:return n}},qE=e=>{const t=e.toLowerCase().trim(),n=parseFloat(t);switch(t.replace(/[0-9.]/g,"").trim()){case"gb":default:return n;case"mb":return n/1024;case"kb":return n/1048576;case"b":return n/1073741824}},WE=({data:r,isYaxisSticky:i=!1,barWidth:o,height:c,barGap:d=20,colors:u=[],xAxisLabel:f,isTruncateText:h=!0,yAxisLabel:p,padding:m=20,yAxisDivisions:C=5,barBorderRadius:g=0,legend:v=!0,showXAxisLabels:y=!0,icons:w=[],iconSize:b,legendPosition:E="bottom",legendGap:M=5,extendBarChartRightWidth:A=0,isYAxisValuePercentage:x=!1,selectedBar:k,setSelectedBar:L,onSelectedBar:H=e=>{},totalLabel:_="Total Execution",customToolTip:S=!1,isOnclick:V=!1,isDashboardVersions:O,type:z="",isMemory:N,tooltipWidth:I="fit-content"})=>{const D=a(null),[T,Z]=s(null),[j,R]=s(!1);l(()=>{const e=()=>{const e=D.current;e&&j&&(e.style.display="none")};return window.addEventListener("scroll",e,!0),()=>window.removeEventListener("scroll",e,!0)},[j]);const B=(e=>{const t=["TB","GB","MB","KB"];for(const n of t){if(e.some(e=>"string"==typeof e.value&&e.value.toLowerCase().includes(n.toLowerCase())))return n}return null})(r),U=r.map(e=>{if("string"==typeof e.value){let t=0;if("memory"===z)t=qE(e.value);else if(N)switch(B){case"TB":t=(e=>{const t=e.toLowerCase().trim(),n=parseFloat(t);switch(t.replace(/[0-9.]/g,"").trim()){case"tb":default:return n;case"gb":return n/1024;case"mb":return n/1048576;case"kb":return n/1073741824;case"b":return n/1099511627776}})(e.value);break;case"GB":t=qE(e.value);break;case"MB":t=(e=>{const t=e.toLowerCase().trim(),n=parseFloat(t);switch(t.replace(/[0-9.]/g,"").trim()){case"mb":default:return n;case"gb":return 1024*n;case"tb":return 1024*n*1024;case"kb":return n/1024;case"b":return n/1048576}})(e.value);break;case"KB":t=(e=>{const t=e.toLowerCase().trim(),n=parseFloat(t);switch(t.replace(/[0-9.]/g,"").trim()){case"kb":default:return n;case"mb":return 1024*n;case"gb":return 1024*n*1024;case"tb":return 1024*n*1024*1024;case"b":return n/1024}})(e.value)}else t=parseFloat(e.value);return{...e,normalizedValue:t}}return{...e,normalizedValue:e.value}});let q=0;"memory"===z&&(q=r.reduce((e,t)=>"string"==typeof t.value?e+UE(t.value):e+1024*Number(t.value)*1024*1024,0));const W=q/1048576,Q=W<1024?`${Math.round(W)} mb`:`${(W/1024).toFixed(1)} gb`;let G=Math.max(...U.map(e=>e.normalizedValue));G="memory"===z?Math.max(G,1):Math.max(G,C);const K=40,Y=40,X=U.length*o+(U.length-1)*d+(i?Y:90)+A,J=Date.now(),$=t=>t.filter(e=>e.length>1).map((t,n)=>e("defs",{children:e("linearGradient",{id:`gradient-${J}-${z}-${n}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:t.map((r,i)=>e("stop",{offset:i/(t.length-1)*100+"%",stopColor:r},`${n}-${i}`))})},n)),ee=e=>{if(!u.length)return"grey";const t=u[e%u.length];return 1===t?.length?t[0]:`url(#gradient-${J}-${z}-${e%u.length})`},te=(e,t,n,r,i)=>{R(!0);const o=D.current;if(o)if(o.style.display="block",S)o.innerHTML=`<div>\n <div><Typography fontWeight='semi-bold'>${e}</Typography></div>\n <div><Typography>${n||""}</Typography></div>\n <div><Typography>${_} : ${t} ${r?"("+r+"%)":""}</Typography></div>\n </div>`;else if(O){const e=i?i.join(", "):"";o.innerHTML=`\n <div>\n <div><Typography>${_} : ${t}</Typography></div>\n ${e?`<div><Typography>Versions : ${e}</Typography></div>`:""}\n </div>`}else o.innerHTML="memory"===z?`<strong>${e}</strong>: ${t} / ${Q}`:`<strong>${e}</strong>: ${t} ${x?"%":""}`},ne=(e,t=!1)=>{const n=D.current;if(n){const r=n.parentElement?.getBoundingClientRect(),i=window.scrollX,o=window.scrollY,a=1===U?.length||!t?e.clientX-(r?.left||0)+i+10:e.clientX-(r?.left||0)+i-n?.offsetWidth-10,l=e.clientY-(r?.top||0)+o-20;n.style.left=`${a}px`,n.style.top=`${l}px`}},re=()=>{R(!1);const e=D.current;e&&(e.style.display="none")},oe=e=>{L&&(L(e),V&&H(e))},ae=e=>{if(h){if(ie(e,10).endsWith("...")){const t=D.current;t&&(t.style.display="block",t.innerHTML=e)}}},le=(e,t,n)=>{if(h){ie(t,10).endsWith("...")&&ne(e,n===U.length-1)}};return n("div",{className:"ff-bar-chart-container",children:[e("div",{ref:D,className:"ff-bar-chart-tooltip",style:{width:I}}),v&&"top"===E&&e("div",{className:"ff-legend-container",children:e("div",{className:"ff-bar-chart-legend",style:{gap:`${M}px`},children:U.map((t,r)=>n("div",{className:"ff-bar-chart-legend-item",onMouseEnter:()=>Z(r),onMouseLeave:()=>Z(null),children:[w[r]&&"string"==typeof w[r]?e(P,{name:String(w[r]),width:b,height:b}):e("span",{className:"ff-bar-chart-legend-item-circle",style:{backgroundColor:u[r%u.length]?.[0]||"grey"}}),e(F,{as:"div",fontSize:10,fontWeight:"regular",className:"ff-legend-label",children:t.label})]},t.label))})}),i?n("div",{className:"ff-bar-chart-wrapper",children:[e("div",{className:"ff-y-axis",children:e("svg",{width:60,height:c+K+(f?20:0),children:n(t,{children:[Array.from({length:C+1}).map((t,n)=>{const r=c-n/C*c+K+4,i=n*G/C,o="memory"===z?i.toFixed(1):x?`${i.toFixed(0).padStart(2,"0")}%`:i.toFixed(0).padStart(2,"0");return e("text",{x:50,y:r,fill:"black",textAnchor:"middle",className:"ff-bar-chart-labels",children:o},n)}),p&&e("text",{x:-(c/2+35),y:i?20:10,transform:"rotate(-90)",fill:"black",textAnchor:"middle",alignmentBaseline:"middle",className:"ff-bar-chart-labels",children:p})]})})}),e("div",{className:"ff-chart-scrollable",children:n("svg",{width:X,height:c+K+5+(y?20:0)+(f?20:0),children:[Array.isArray(u)&&u.length>0&&$(u),U.map((t,r)=>{const i=t.normalizedValue/G*c,a=t.normalizedValue<1?2:i,l=r*(o+d)+m,s=c-a+K,u=b||20,f=l+o/2-u/2,p=s-u,C=k===t.label,v=T===r;return n("g",{children:[w[r]&&"string"==typeof w[r]&&e("g",{onMouseEnter:()=>te(t.label,"memory"===z?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e,r===U.length-1),onMouseLeave:re,children:e(P,{name:String(w[r]),x:String(f),y:String(p),width:u,height:u,chartIcon:!0})}),e("rect",{x:l,y:s,width:o,height:a,fill:ee(r),rx:g,ry:g,style:{strokeWidth:C?3:0,opacity:null===T||v?1:.3,cursor:V?"pointer":"default",transition:"opacity 0.5s ease"},onMouseEnter:()=>te(t.label,"memory"===z||N?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e,r===U.length-1),onMouseLeave:re,onClick:()=>oe(t.label)}),C&&V&&e("rect",{x:l,y:s,width:o,height:a,fill:"var(--select-chart-highlight-color)",rx:g,ry:g,onMouseEnter:()=>te(t.label,"memory"===z?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e,r===U.length-1),onMouseLeave:re}),y&&e("text",{onMouseEnter:()=>ae(t.label),onMouseMove:e=>le(e,t.label,r),onMouseLeave:re,x:0===r?l:r===U.length-1?l+o:l+o/2,y:c+K+15,className:"ff-bar-chart-labels",fill:C?"var(--brand-color)":"black",fontWeight:C?"bold":"normal",textAnchor:0===r?"start":"middle",children:h?ie(t.label,10):t.label})]},r)}),e("line",{x1:i?0:m,y1:c+K,x2:X,y2:c+K,stroke:"#D9D9D9",strokeWidth:"1"}),!i&&f&&e("text",{x:X/2,y:c+K+(y?40:20),fontSize:"12",fill:"black",textAnchor:"middle",className:"ff-bar-chart-labels",children:f})]})}),e("div",{className:"ff-bar-chart-x-axis-label",children:f})]}):e("div",{children:n("svg",{width:X,height:c+K+5+(y?20:0)+(f?20:0),children:[Array.isArray(u)&&u.length>0&&$(u),Array.from({length:C+1}).map((t,n)=>{const r=c-n/C*c+K+4,i=n*G/C,o="memory"===z?i.toFixed(1):x?`${i.toFixed(0).padStart(2,"0")}%`:i.toFixed(0).padStart(2,"0");return e("text",{x:Y,y:r,fill:"black",textAnchor:"middle",className:"ff-bar-chart-labels",children:o},n)}),U.map((t,r)=>{const i=t.normalizedValue/G*c,a=t.normalizedValue<1?2:i,l=r*(o+d)+Y+m,s=c-a+K,u=b||20,f=l+o/2-u/2,p=s-u,C=k===t.label,v=T===r;return n("g",{children:[w[r]&&"string"==typeof w[r]&&e("g",{onMouseEnter:()=>te(t.label,"memory"===z?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e,r===U.length-1),onMouseLeave:re,children:e(P,{name:String(w[r]),x:String(f),y:String(p),width:u,height:u,chartIcon:!0})}),e("rect",{x:l,y:s,width:o,height:a,fill:ee(r),rx:g,ry:g,style:{strokeWidth:C?3:0,opacity:null===T||v?1:.3,cursor:V?"pointer":"default",transition:"opacity 0.5s ease"},onMouseEnter:()=>te(t.label,"memory"===z||N?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e,r===U.length-1),onMouseLeave:re,onClick:()=>oe(t.label)}),C&&V&&e("rect",{x:l,y:s,width:o,height:a,fill:"var(--select-chart-highlight-color)",rx:g,ry:g,onMouseEnter:()=>te(t.label,"memory"===z?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e,r===U.length-1),onMouseLeave:re}),y&&e("g",{children:e("text",{x:0===r?l:r===U.length-1?l+o:l+o/2,y:c+K+15,className:"ff-bar-chart-labels",fill:C?"var(--brand-color)":"black",fontWeight:C?"bold":"normal",textAnchor:0===r?"start":"middle",onMouseEnter:()=>ae(t.label),onMouseMove:e=>le(e,t.label,r),onMouseLeave:re,children:h?ie(t.label,10):t.label})})]},r)}),e("line",{x1:60,y1:c+K,x2:X,y2:c+K,stroke:"#D9D9D9",strokeWidth:"1"}),f&&e("text",{x:X/2,y:c+K+(y?40:20),fontSize:"12",fill:"black",textAnchor:"middle",className:"ff-bar-chart-labels",children:f}),p&&e("text",{x:-(c/2+35),y:10,transform:"rotate(-90)",fill:"black",textAnchor:"middle",alignmentBaseline:"middle",className:"ff-bar-chart-labels",children:p})]})}),v&&"bottom"===E&&e("div",{className:"ff-legend-container",children:e("div",{className:"ff-bar-chart-legend",style:{gap:`${M}px`},children:r.map((t,r)=>n("div",{className:"ff-bar-chart-legend-item",onMouseEnter:()=>Z(r),onMouseLeave:()=>Z(null),children:[w[r]&&"string"==typeof w[r]?e(P,{name:String(w[r]),width:b,height:b}):e("span",{className:"ff-bar-chart-legend-item-circle",style:{backgroundColor:u[r%u.length]?.[0]||"grey"}}),e("div",{children:e(F,{as:"div",fontSize:10,fontWeight:"regular",className:"ff-legend-label",children:t.label})})]},t.label))})})]})},QE=(e,t,n,r,i)=>{const o=e+n*Math.cos(r),a=t+n*Math.sin(r),l=e+n*Math.cos(i),c=t+n*Math.sin(i);return`M ${o} ${a} A ${n} ${n} 0 ${i-r>Math.PI?1:0} 1 ${l} ${c}`},GE=({radius:r,lineWidth:i,lineCap:o,barValues:a,labelHeading:l,legendType:c="numberLegend",isLegendDetails:d=!0,isPillValueVisible:u=!0,chartToLegendGap:f="16px",legendGap:h="8px",labelFontSize:p=12,subLabelFontSize:m=8,gapBetweenArch:C=10,capsuleStyle:g={padding:"4px"}})=>{const[v,y]=s({visible:!1,x:0,y:0,content:"",isArc:!1}),[w,b]=s(null),E=(e,t)=>Array.isArray(e.arcColor)?`url(#gradient-${t})`:e.arcColor,M=e=>Array.isArray(e.arcColor)?e.arcColor[0]:e.arcColor,A=a.map(e=>{if("string"==typeof e.value){const t=(e=>{if("string"!=typeof e)return e;{const t=e.trim().match(/^([\d.]+)\s*([a-zA-Z%]*)$/);if(!t)return 0;const n=parseFloat(t[1]??"0"),r=t[2]?.toUpperCase()||"";if(isNaN(n))return 0;switch(r){case"TB":return 1024*n*1024;case"GB":return 1024*n;case"MB":default:return n;case"KB":return n/1024}}})(e.value),n=isNaN(t)?0:t;return{...e,normalizedValue:n,labelValue:Number.isInteger(n)?n:n.toFixed(2)}}return{...e,normalizedValue:e.value,labelValue:Number.isInteger(e.value)?e.value:e.value?.toFixed(2)}}),x=A.reduce((e,t)=>e+t.normalizedValue,0),k=r,L=i+C,H=2*(k+L*(A.length-1)+i),_=[...A].reverse(),S=l.trim().split(" "),V=(e,t,n)=>{const{clientX:r,clientY:i}=e;y({visible:!0,x:r,y:i,content:t,isArc:n})},O=e=>{const{clientX:t,clientY:n}=e;y(e=>({...e,x:t,y:n}))},z=()=>{y({visible:!1,x:0,y:0,content:"",isArc:!1})};return n("div",{className:"ff-multi-radial-chart-container "+("numberLegend"===c?"ff-multi-radial-chart-number":"ff-multi-radial-chart-pill"),style:{gap:f},children:[e("div",{className:"relative",style:{width:H,height:H},children:n("svg",{width:H,height:H,viewBox:`0 0 ${H} ${H}`,className:"absolute top-0 left-0",children:[e("defs",{children:a.map((t,n)=>Array.isArray(t.arcColor)?e("linearGradient",{id:`gradient-${n}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%",gradientTransform:"rotate(90)",children:t.arcColor.map((n,r)=>e("stop",{offset:r/(t.arcColor.length-1)*100+"%",stopColor:n},r))},`gradient-${n}`):null)}),n("g",{transform:`translate(${H/2+1}, ${H/2+1})`,children:[_.map((t,r)=>{const a=A.length-1-r,l=2*(t.normalizedValue/x)*Math.PI;let c=-Math.PI/2,s=c+l;t.normalizedValue===x&&(c=0,s=2*Math.PI);const d=k+L*a,u=QE(0,0,d,0,2*Math.PI),f={opacity:null!==w?t.barLabel===w?1:.2:1,transition:"opacity 0.3s ease"};if(0===t.normalizedValue){const r=d*Math.cos(-Math.PI/2),o=d*Math.sin(-Math.PI/2);return n("g",{children:[e("path",{d:u,fill:"none",stroke:t.arcBackgroundColor,strokeWidth:i,className:"transition-all duration-300",style:f}),e("circle",{cx:r,cy:o,r:i+1,fill:E({...t,label:t.barLabel||"",key:t.labelValue?.toString()||""},a),onMouseEnter:e=>V(e,`${t.barLabel||"Data"}: ${t.value}`,!0),onMouseMove:O,onMouseLeave:z,style:f})]},a)}const h=QE(0,0,d,c,s);return n("g",{children:[e("path",{d:u,fill:"none",stroke:t.arcBackgroundColor,strokeWidth:i,className:"transition-all duration-300",style:f}),e("path",{d:h,fill:"none",stroke:E({...t,label:t.barLabel||"",key:t.labelValue?.toString()||""},a),strokeWidth:i,strokeLinecap:"square"===o?"butt":"round",onMouseEnter:e=>V(e,`${t.barLabel||"Data"}: ${t.value}`,!0),onMouseMove:O,onMouseLeave:z,style:{pointerEvents:"stroke",...f}})]},a)}),e("text",{x:"0",y:`-${i+C+2}`,fill:(()=>{if(!v.visible)return"";const e=v.content.split(":")[0]?.trim();if(void 0===e)return"";const t=A.find(t=>t.barLabel===e);if(!t)return"";const n={...t,label:t.barLabel,key:t.labelValue?.toString()??""};return M(n)})(),textAnchor:"middle",dominantBaseline:"central",children:v.visible?n(t,{children:[e("tspan",{x:"0",dy:"0",className:"ff-center-text-tooltip",children:(N=v.content.split(":")[1]?.trim()||"",I=9,N.length>I?N.slice(0,I)+"...":N)}),v.content.split(":")[0]?.split(" ").map((t,n)=>e("tspan",{x:"0",dy:0===n?`${i+C+5}`:18,className:"ff-center-text-tooltip",children:t},n))]}):e(t,{children:S.map((t,r)=>{if(0===r){const[i,...o]=t.split(" ");return n("tspan",{children:[e("tspan",{x:"0",dy:"0",style:{fontSize:`${p}px`},className:"ff-center-first-text",children:i}),e("tspan",{x:"0",dy:18,style:{fontSize:`${m}px`},className:"ff-center-text",children:o.join(" ")})]},r)}return e("tspan",{x:"0",dy:0===r?0:18,className:"ff-center-text",style:{fontSize:`${m}px`},children:t},r)})})})]})]})}),v.visible&&e("div",{className:"ff-multi-radial-tooltip",style:{position:"fixed",top:`${v.y+10}px`,left:`${v.x+15}px`,zIndex:1e3,pointerEvents:"none"},children:v.content}),d&&((t,r)=>{switch(r){case"numberLegend":return e("div",{className:"ff-legend-container ff-number-legend",style:{gap:h},children:t.map((t,r)=>n("div",{className:"ff-legend-item",onMouseEnter:e=>{b(t.barLabel||t.label),V(e,`${t.barLabel||"Data"}: ${t.value}`,!1)},onMouseMove:O,onMouseLeave:()=>{b(null),z()},children:[e(F,{fontSize:20,fontWeight:"semi-bold",className:"ff-legend-value",color:M(t),children:t.key.padStart(2,"0")}),e(F,{fontSize:10,className:"ff-legend-key",color:"var(--text-color)",children:t.label})]},r))});case"pillLegend":return e("div",{className:"ff-legend-container ff-pill-legend",style:{gap:h},children:t.slice().reverse().map((t,r)=>n("div",{className:"ff-legend-item",onMouseEnter:e=>{b(t.barLabel||t.label),V(e,`${t.barLabel||"Data"}: ${t.value}`,!1)},onMouseMove:O,onMouseLeave:()=>{b(null),z()},children:[e("span",{className:"ff-legend-capsule",style:{backgroundColor:M(t)},children:e(F,{fontSize:10,color:"var(--tooltip-text-color)",style:g,children:u&&t.value})}),e(F,{className:"ff-legend-key",children:t.label})]},r))});default:return null}})(A.map(e=>({...e,label:e?.barLabel,key:e.labelValue?.toString()})),c)]});var N,I};function KE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function YE(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function JE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?XE(Object(n),!0).forEach(function(t){YE(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XE(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function $E(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function tM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eM(Object(n),!0).forEach(function(t){$E(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function nM(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return t.apply(n,[].concat(i,r))}}}function rM(e){return{}.toString.call(e).includes("Object")}function iM(e){return"function"==typeof e}var oM=nM(function(e,t){throw new Error(e[t]||e.default)})({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),aM={changes:function(e,t){return rM(t)||oM("changeType"),Object.keys(t).some(function(t){return n=e,r=t,!Object.prototype.hasOwnProperty.call(n,r);var n,r})&&oM("changeField"),t},selector:function(e){iM(e)||oM("selectorType")},handler:function(e){iM(e)||rM(e)||oM("handlerType"),rM(e)&&Object.values(e).some(function(e){return!iM(e)})&&oM("handlersType")},initial:function(e){var t;e||oM("initialIsRequired"),rM(e)||oM("initialType"),t=e,Object.keys(t).length||oM("initialContent")}};function lM(e,t){return iM(t)?t(e.current):t}function cM(e,t){return e.current=tM(tM({},e.current),t),t}function sM(e,t,n){return iM(t)?t(e.current):Object.keys(n).forEach(function(n){var r;return null===(r=t[n])||void 0===r?void 0:r.call(t,e.current[n])}),n}var dM={create:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};aM.initial(e),aM.handler(t);var n={current:e},r=nM(sM)(n,t),i=nM(cM)(n),o=nM(aM.changes)(e),a=nM(lM)(n);return[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e};return aM.selector(e),e(n.current)},function(e){!function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}}(r,i,o,a)(e)}]}};var uM={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},fM=function(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return t.apply(n,[].concat(i,r))}}}(function(e,t){throw new Error(e[t]||e.default)})(uM),hM={config:function(e){var t;return e||fM("configIsRequired"),t=e,{}.toString.call(t).includes("Object")||fM("configType"),e.urls?(console.warn(uM.deprecation),{paths:{vs:e.urls.monacoBase}}):e}};function pM(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],pM(e[n],t[n]))}),JE(JE({},e),t)}var mM={type:"cancelation",msg:"operation is manually canceled"};function CM(e){var t=!1,n=new Promise(function(n,r){e.then(function(e){return t?r(mM):n(e)}),e.catch(r)});return n.cancel=function(){return t=!0},n}var gM,vM,yM=["monaco"],wM=dM.create({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}),bM=(vM=2,function(e){if(Array.isArray(e))return e}(gM=wM)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,l=[],c=!0,s=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(c=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){s=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw i}}return l}}(gM,vM)||function(e,t){if(e){if("string"==typeof e)return KE(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?KE(e,t):void 0}}(gM,vM)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),EM=bM[0],MM=bM[1];function AM(e){return document.body.appendChild(e)}function xM(e){var t=EM(function(e){return{config:e.config,reject:e.reject}}),n=function(e){var t=document.createElement("script");return e&&(t.src=e),t}("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function kM(){var e=EM(function(e){return{config:e.config,resolve:e.resolve,reject:e.reject}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(t){var n=t.m||t;LM(n),e.resolve(n)},function(t){e.reject(t)})}function LM(e){EM().monaco||MM({monaco:e})}var HM=new Promise(function(e,t){return MM({resolve:e,reject:t})}),_M={config:function(e){var t=hM.config(e),n=t.monaco,r=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(t,yM);MM(function(e){return{config:pM(e.config,r),monaco:n}})},init:function(){var e=EM(function(e){return{monaco:e.monaco,isInitialized:e.isInitialized,resolve:e.resolve}});if(!e.isInitialized){if(MM({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),CM(HM);if(window.monaco&&window.monaco.editor)return LM(window.monaco),e.resolve(window.monaco),CM(HM);!function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}}(AM,xM)(kM)}return CM(HM)},__getMonacoInstance:function(){return EM(function(e){return e.monaco})}},SM={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},VM={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}};var OM=function({children:e}){return i.createElement("div",{style:VM.container},e)},zM=OM;var NM=function({width:e,height:t,isEditorReady:n,loading:r,_ref:o,className:a,wrapperProps:l}){return i.createElement("section",{style:{...SM.wrapper,width:e,height:t},...l},!n&&i.createElement(zM,null,r),i.createElement("div",{ref:o,style:{...SM.fullWidth,...!n&&SM.hide},className:a}))},IM=g(NM);var DM=function(e){l(e,[])};var TM=function(e,t,n=!0){let r=a(!0);l(r.current||!n?()=>{r.current=!1}:e,t)};function ZM(){}function jM(e,t,n,r){return function(e,t){return e.editor.getModel(RM(e,t))}(e,r)||function(e,t,n,r){return e.editor.createModel(t,n,r?RM(e,r):void 0)}(e,t,n,r)}function RM(e,t){return e.Uri.parse(t)}var BM=function({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:o,originalModelPath:c,modifiedModelPath:d,keepCurrentOriginalModel:u=!1,keepCurrentModifiedModel:f=!1,theme:h="light",loading:m="Loading...",options:C={},height:g="100%",width:v="100%",className:y,wrapperProps:w={},beforeMount:b=ZM,onMount:E=ZM}){let[M,A]=s(!1),[x,k]=s(!0),L=a(null),H=a(null),_=a(null),S=a(E),V=a(b),O=a(!1);DM(()=>{let e=_M.init();return e.then(e=>(H.current=e)&&k(!1)).catch(e=>"cancelation"!==e?.type&&console.error("Monaco initialization: error:",e)),()=>L.current?function(){let e=L.current?.getModel();u||e?.original?.dispose(),f||e?.modified?.dispose(),L.current?.dispose()}():e.cancel()}),TM(()=>{if(L.current&&H.current){let t=L.current.getOriginalEditor(),i=jM(H.current,e||"",r||n||"text",c||"");i!==t.getModel()&&t.setModel(i)}},[c],M),TM(()=>{if(L.current&&H.current){let e=L.current.getModifiedEditor(),r=jM(H.current,t||"",o||n||"text",d||"");r!==e.getModel()&&e.setModel(r)}},[d],M),TM(()=>{let e=L.current.getModifiedEditor();e.getOption(H.current.editor.EditorOption.readOnly)?e.setValue(t||""):t!==e.getValue()&&(e.executeEdits("",[{range:e.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),e.pushUndoStop())},[t],M),TM(()=>{L.current?.getModel()?.original.setValue(e||"")},[e],M),TM(()=>{let{original:e,modified:t}=L.current.getModel();H.current.editor.setModelLanguage(e,r||n||"text"),H.current.editor.setModelLanguage(t,o||n||"text")},[n,r,o],M),TM(()=>{H.current?.editor.setTheme(h)},[h],M),TM(()=>{L.current?.updateOptions(C)},[C],M);let z=p(()=>{if(!H.current)return;V.current(H.current);let i=jM(H.current,e||"",r||n||"text",c||""),a=jM(H.current,t||"",o||n||"text",d||"");L.current?.setModel({original:i,modified:a})},[n,t,o,e,r,c,d]),N=p(()=>{!O.current&&_.current&&(L.current=H.current.editor.createDiffEditor(_.current,{automaticLayout:!0,...C}),z(),H.current?.editor.setTheme(h),A(!0),O.current=!0)},[C,h,z]);return l(()=>{M&&S.current(L.current,H.current)},[M]),l(()=>{!x&&!M&&N()},[x,M,N]),i.createElement(IM,{width:v,height:g,isEditorReady:M,loading:m,_ref:_,className:y,wrapperProps:w})};g(BM);var PM=function(e){let t=a();return l(()=>{t.current=e},[e]),t.current},FM=new Map;var UM,qM=function({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:o,path:c,theme:d="light",line:u,loading:f="Loading...",options:h={},overrideServices:m={},saveViewState:C=!0,keepCurrentModel:g=!1,width:v="100%",height:y="100%",className:w,wrapperProps:b={},beforeMount:E=ZM,onMount:M=ZM,onChange:A,onValidate:x=ZM}){let[k,L]=s(!1),[H,_]=s(!0),S=a(null),V=a(null),O=a(null),z=a(M),N=a(E),I=a(),D=a(r),T=PM(c),Z=a(!1),j=a(!1);DM(()=>{let e=_M.init();return e.then(e=>(S.current=e)&&_(!1)).catch(e=>"cancelation"!==e?.type&&console.error("Monaco initialization: error:",e)),()=>V.current?(I.current?.dispose(),g?C&&FM.set(c,V.current.saveViewState()):V.current.getModel()?.dispose(),void V.current.dispose()):e.cancel()}),TM(()=>{let i=jM(S.current,e||r||"",t||o||"",c||n||"");i!==V.current?.getModel()&&(C&&FM.set(T,V.current?.saveViewState()),V.current?.setModel(i),C&&V.current?.restoreViewState(FM.get(c)))},[c],k),TM(()=>{V.current?.updateOptions(h)},[h],k),TM(()=>{!V.current||void 0===r||(V.current.getOption(S.current.editor.EditorOption.readOnly)?V.current.setValue(r):r!==V.current.getValue()&&(j.current=!0,V.current.executeEdits("",[{range:V.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),V.current.pushUndoStop(),j.current=!1))},[r],k),TM(()=>{let e=V.current?.getModel();e&&o&&S.current?.editor.setModelLanguage(e,o)},[o],k),TM(()=>{void 0!==u&&V.current?.revealLine(u)},[u],k),TM(()=>{S.current?.editor.setTheme(d)},[d],k);let R=p(()=>{if(O.current&&S.current&&!Z.current){N.current(S.current);let i=c||n,a=jM(S.current,r||e||"",t||o||"",i||"");V.current=S.current?.editor.create(O.current,{model:a,automaticLayout:!0,...h},m),C&&V.current.restoreViewState(FM.get(i)),S.current.editor.setTheme(d),void 0!==u&&V.current.revealLine(u),L(!0),Z.current=!0}},[e,t,n,r,o,c,h,m,C,d,u]);return l(()=>{k&&z.current(V.current,S.current)},[k]),l(()=>{!H&&!k&&R()},[H,k,R]),D.current=r,l(()=>{k&&A&&(I.current?.dispose(),I.current=V.current?.onDidChangeModelContent(e=>{j.current||A(V.current.getValue(),e)}))},[k,A]),l(()=>{if(k){let e=S.current.editor.onDidChangeMarkers(e=>{let t=V.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=S.current.editor.getModelMarkers({resource:t});x?.(e)}});return()=>{e?.dispose()}}return()=>{}},[k,x]),i.createElement(IM,{width:v,height:y,isEditorReady:k,loading:f,_ref:O,className:w,wrapperProps:b})},WM=g(qM),QM={exports:{}},GM={},KM={exports:{}},YM={},XM={};function JM(){if(UM)return XM;function e(e){this.__parent=e,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function t(e,t){this.__cache=[""],this.__indent_size=e.indent_size,this.__indent_string=e.indent_char,e.indent_with_tabs||(this.__indent_string=new Array(e.indent_size+1).join(e.indent_char)),t=t||"",e.indent_level>0&&(t=new Array(e.indent_level+1).join(this.__indent_string)),this.__base_string=t,this.__base_string_length=t.length}function n(n,r){this.__indent_cache=new t(n,r),this.raw=!1,this._end_with_newline=n.end_with_newline,this.indent_size=n.indent_size,this.wrap_line_length=n.wrap_line_length,this.indent_empty_lines=n.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new e(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}return UM=1,e.prototype.clone_empty=function(){var t=new e(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t},e.prototype.item=function(e){return e<0?this.__items[this.__items.length+e]:this.__items[e]},e.prototype.has_match=function(e){for(var t=this.__items.length-1;t>=0;t--)if(this.__items[t].match(e))return!0;return!1},e.prototype.set_indent=function(e,t){this.is_empty()&&(this.__indent_count=e||0,this.__alignment_count=t||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},e.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},e.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},e.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var e=this.__parent.current_line;return e.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),e.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),e.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===e.__items[0]&&(e.__items.splice(0,1),e.__character_count-=1),!0}return!1},e.prototype.is_empty=function(){return 0===this.__items.length},e.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},e.prototype.push=function(e){this.__items.push(e);var t=e.lastIndexOf("\n");-1!==t?this.__character_count=e.length-t:this.__character_count+=e.length},e.prototype.pop=function(){var e=null;return this.is_empty()||(e=this.__items.pop(),this.__character_count-=e.length),e},e.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},e.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},e.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},e.prototype.toString=function(){var e="";return this.is_empty()?this.__parent.indent_empty_lines&&(e=this.__parent.get_indent_string(this.__indent_count)):(e=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),e+=this.__items.join("")),e},t.prototype.get_indent_size=function(e,t){var n=this.__base_string_length;return t=t||0,e<0&&(n=0),n+=e*this.__indent_size,n+=t},t.prototype.get_indent_string=function(e,t){var n=this.__base_string;return t=t||0,e<0&&(e=0,n=""),t+=e*this.__indent_size,this.__ensure_cache(t),n+=this.__cache[t]},t.prototype.__ensure_cache=function(e){for(;e>=this.__cache.length;)this.__add_column()},t.prototype.__add_column=function(){var e=this.__cache.length,t=0,n="";this.__indent_size&&e>=this.__indent_size&&(e-=(t=Math.floor(e/this.__indent_size))*this.__indent_size,n=new Array(t+1).join(this.__indent_string)),e&&(n+=new Array(e+1).join(" ")),this.__cache.push(n)},n.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},n.prototype.get_line_number=function(){return this.__lines.length},n.prototype.get_indent_string=function(e,t){return this.__indent_cache.get_indent_string(e,t)},n.prototype.get_indent_size=function(e,t){return this.__indent_cache.get_indent_size(e,t)},n.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},n.prototype.add_new_line=function(e){return!(this.is_empty()||!e&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},n.prototype.get_code=function(e){this.trim(!0);var t=this.current_line.pop();t&&("\n"===t[t.length-1]&&(t=t.replace(/\n+$/g,"")),this.current_line.push(t)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join("\n");return"\n"!==e&&(n=n.replace(/[\n]/g,e)),n},n.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},n.prototype.set_indent=function(e,t){return e=e||0,t=t||0,this.next_line.set_indent(e,t),this.__lines.length>1?(this.current_line.set_indent(e,t),!0):(this.current_line.set_indent(),!1)},n.prototype.add_raw_token=function(e){for(var t=0;t<e.newlines;t++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(e.whitespace_before),this.current_line.push(e.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},n.prototype.add_token=function(e){this.__add_space_before_token(),this.current_line.push(e),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},n.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},n.prototype.remove_indent=function(e){for(var t=this.__lines.length;e<t;)this.__lines[e]._remove_indent(),e++;this.current_line._remove_wrap_indent()},n.prototype.trim=function(e){for(e=void 0!==e&&e,this.current_line.trim();e&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},n.prototype.just_added_newline=function(){return this.current_line.is_empty()},n.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},n.prototype.ensure_empty_line_above=function(t,n){for(var r=this.__lines.length-2;r>=0;){var i=this.__lines[r];if(i.is_empty())break;if(0!==i.item(0).indexOf(t)&&i.item(-1)!==n){this.__lines.splice(r+1,0,new e(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},XM.Output=n,XM}var $M,eA={};function tA(){if($M)return eA;return $M=1,eA.Token=function(e,t,n,r){this.type=e,this.text=t,this.comments_before=null,this.newlines=n||0,this.whitespace_before=r||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null},eA}var nA,rA={};function iA(){return nA||(nA=1,o="(?:"+(i="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}")+"|[\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a"+(n="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc")+"])",a="(?:"+i+"|["+(t="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a")+n+(r="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f")+"])*",(e=rA).identifier=new RegExp(o+a,"g"),e.identifierStart=new RegExp(o),e.identifierMatch=new RegExp("(?:"+i+"|["+t+n+r+"])+"),e.newline=/[\n\r\u2028\u2029]/,e.lineBreak=new RegExp("\r\n|"+e.newline.source),e.allLineBreaks=new RegExp(e.lineBreak.source,"g")),rA;var e,t,n,r,i,o,a}var oA,aA,lA={},cA={};function sA(){if(oA)return cA;function e(e,n){this.raw_options=t(e,n),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}function t(e,t){var r,i={};for(r in e=n(e))r!==t&&(i[r]=e[r]);if(t&&e[t])for(r in e[t])i[r]=e[t][r];return i}function n(e){var t,n={};for(t in e){n[t.replace(/-/g,"_")]=e[t]}return n}return oA=1,e.prototype._get_array=function(e,t){var n=this.raw_options[e],r=t||[];return"object"==typeof n?null!==n&&"function"==typeof n.concat&&(r=n.concat()):"string"==typeof n&&(r=n.split(/[^a-zA-Z0-9_\/\-]+/)),r},e.prototype._get_boolean=function(e,t){var n=this.raw_options[e];return void 0===n?!!t:!!n},e.prototype._get_characters=function(e,t){var n=this.raw_options[e],r=t||"";return"string"==typeof n&&(r=n.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),r},e.prototype._get_number=function(e,t){var n=this.raw_options[e];t=parseInt(t,10),isNaN(t)&&(t=0);var r=parseInt(n,10);return isNaN(r)&&(r=t),r},e.prototype._get_selection=function(e,t,n){var r=this._get_selection_list(e,t,n);if(1!==r.length)throw new Error("Invalid Option Value: The option '"+e+"' can only be one of the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return r[0]},e.prototype._get_selection_list=function(e,t,n){if(!t||0===t.length)throw new Error("Selection list cannot be empty.");if(n=n||[t[0]],!this._is_valid_selection(n,t))throw new Error("Invalid Default Value!");var r=this._get_array(e,n);if(!this._is_valid_selection(r,t))throw new Error("Invalid Option Value: The option '"+e+"' can contain only the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return r},e.prototype._is_valid_selection=function(e,t){return e.length&&t.length&&!e.some(function(e){return-1===t.indexOf(e)})},cA.Options=e,cA.normalizeOpts=n,cA.mergeOpts=t,cA}function dA(){if(aA)return lA;aA=1;var e=sA().Options,t=["before-newline","after-newline","preserve-newline"];function n(n){e.call(this,n,"js");var r=this.raw_options.brace_style||null;"expand-strict"===r?this.raw_options.brace_style="expand":"collapse-preserve-inline"===r?this.raw_options.brace_style="collapse,preserve-inline":void 0!==this.raw_options.braces_on_own_line&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var o=0;o<i.length;o++)"preserve-inline"===i[o]?this.brace_preserve_inline=!0:this.brace_style=i[o];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",t),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}return n.prototype=new e,lA.Options=n,lA}var uA,fA={},hA={};function pA(){if(uA)return hA;uA=1;var e=RegExp.prototype.hasOwnProperty("sticky");function t(e){this.__input=e||"",this.__input_length=this.__input.length,this.__position=0}return t.prototype.restart=function(){this.__position=0},t.prototype.back=function(){this.__position>0&&(this.__position-=1)},t.prototype.hasNext=function(){return this.__position<this.__input_length},t.prototype.next=function(){var e=null;return this.hasNext()&&(e=this.__input.charAt(this.__position),this.__position+=1),e},t.prototype.peek=function(e){var t=null;return e=e||0,(e+=this.__position)>=0&&e<this.__input_length&&(t=this.__input.charAt(e)),t},t.prototype.__match=function(t,n){t.lastIndex=n;var r=t.exec(this.__input);return!r||e&&t.sticky||r.index!==n&&(r=null),r},t.prototype.test=function(e,t){return t=t||0,(t+=this.__position)>=0&&t<this.__input_length&&!!this.__match(e,t)},t.prototype.testChar=function(e,t){var n=this.peek(t);return e.lastIndex=0,null!==n&&e.test(n)},t.prototype.match=function(e){var t=this.__match(e,this.__position);return t?this.__position+=t[0].length:t=null,t},t.prototype.read=function(e,t,n){var r,i="";return e&&(r=this.match(e))&&(i+=r[0]),!t||!r&&e||(i+=this.readUntil(t,n)),i},t.prototype.readUntil=function(e,t){var n,r=this.__position;e.lastIndex=this.__position;var i=e.exec(this.__input);return i?(r=i.index,t&&(r+=i[0].length)):r=this.__input_length,n=this.__input.substring(this.__position,r),this.__position=r,n},t.prototype.readUntilAfter=function(e){return this.readUntil(e,!0)},t.prototype.get_regexp=function(t,n){var r=null,i="g";return n&&e&&(i="y"),"string"==typeof t&&""!==t?r=new RegExp(t,i):t&&(r=new RegExp(t.source,i)),r},t.prototype.get_literal_regexp=function(e){return RegExp(e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},t.prototype.peekUntilAfter=function(e){var t=this.__position,n=this.readUntilAfter(e);return this.__position=t,n},t.prototype.lookBack=function(e){var t=this.__position-1;return t>=e.length&&this.__input.substring(t-e.length,t).toLowerCase()===e},hA.InputScanner=t,hA}var mA,CA={},gA={};var vA,yA,wA,bA={},EA={};function MA(){if(vA)return EA;function e(e,t){this._input=e,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,t&&(this._starting_pattern=this._input.get_regexp(t._starting_pattern,!0),this._match_pattern=this._input.get_regexp(t._match_pattern,!0),this._until_pattern=this._input.get_regexp(t._until_pattern),this._until_after=t._until_after)}return vA=1,e.prototype.read=function(){var e=this._input.read(this._starting_pattern);return this._starting_pattern&&!e||(e+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),e},e.prototype.read_match=function(){return this._input.match(this._match_pattern)},e.prototype.until_after=function(e){var t=this._create();return t._until_after=!0,t._until_pattern=this._input.get_regexp(e),t._update(),t},e.prototype.until=function(e){var t=this._create();return t._until_after=!1,t._until_pattern=this._input.get_regexp(e),t._update(),t},e.prototype.starting_with=function(e){var t=this._create();return t._starting_pattern=this._input.get_regexp(e,!0),t._update(),t},e.prototype.matching=function(e){var t=this._create();return t._match_pattern=this._input.get_regexp(e,!0),t._update(),t},e.prototype._create=function(){return new e(this._input,this)},e.prototype._update=function(){},EA.Pattern=e,EA}function AA(){if(wA)return CA;wA=1;var e=pA().InputScanner,t=tA().Token,n=function(){if(mA)return gA;function e(e){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=e}return mA=1,e.prototype.restart=function(){this.__position=0},e.prototype.isEmpty=function(){return 0===this.__tokens_length},e.prototype.hasNext=function(){return this.__position<this.__tokens_length},e.prototype.next=function(){var e=null;return this.hasNext()&&(e=this.__tokens[this.__position],this.__position+=1),e},e.prototype.peek=function(e){var t=null;return e=e||0,(e+=this.__position)>=0&&e<this.__tokens_length&&(t=this.__tokens[e]),t},e.prototype.add=function(e){this.__parent_token&&(e.parent=this.__parent_token),this.__tokens.push(e),this.__tokens_length+=1},gA.TokenStream=e,gA}().TokenStream,r=function(){if(yA)return bA;yA=1;var e=MA().Pattern;function t(t,n){e.call(this,t,n),n?this._line_regexp=this._input.get_regexp(n._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}return t.prototype=new e,t.prototype.__set_whitespace_patterns=function(e,t){e+="\\t ",t+="\\n\\r",this._match_pattern=this._input.get_regexp("["+e+t+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+t+"]")},t.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var e=this._input.read(this._match_pattern);if(" "===e)this.whitespace_before_token=" ";else if(e){var t=this.__split(this._newline_regexp,e);this.newline_count=t.length-1,this.whitespace_before_token=t[this.newline_count]}return e},t.prototype.matching=function(e,t){var n=this._create();return n.__set_whitespace_patterns(e,t),n._update(),n},t.prototype._create=function(){return new t(this._input,this)},t.prototype.__split=function(e,t){e.lastIndex=0;for(var n=0,r=[],i=e.exec(t);i;)r.push(t.substring(n,i.index)),n=i.index+i[0].length,i=e.exec(t);return n<t.length?r.push(t.substring(n,t.length)):r.push(""),r},bA.WhitespacePattern=t,bA}().WhitespacePattern,i={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(t,n){this._input=new e(t),this._options=n||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new r(this._input)};return o.prototype.tokenize=function(){var e;this._input.restart(),this.__tokens=new n,this._reset();for(var r=new t(i.START,""),o=null,a=[],l=new n;r.type!==i.EOF;){for(e=this._get_next_token(r,o);this._is_comment(e);)l.add(e),e=this._get_next_token(r,o);l.isEmpty()||(e.comments_before=l,l=new n),e.parent=o,this._is_opening(e)?(a.push(o),o=e):o&&this._is_closing(e,o)&&(e.opened=o,o.closed=e,o=a.pop(),e.parent=o),e.previous=r,r.next=e,this.__tokens.add(e),r=e}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.prototype._get_next_token=function(e,t){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(i.RAW,n):this._create_token(i.EOF,"")},o.prototype._is_comment=function(e){return!1},o.prototype._is_opening=function(e){return!1},o.prototype._is_closing=function(e,t){return!1},o.prototype._create_token=function(e,n){return new t(e,n,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},CA.Tokenizer=o,CA.TOKEN=i,CA}var xA,kA={};function LA(){if(xA)return kA;function e(e,t){e="string"==typeof e?e:e.source,t="string"==typeof t?t:t.source,this.__directives_block_pattern=new RegExp(e+/ beautify( \w+[:]\w+)+ /.source+t,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(e+/\sbeautify\signore:end\s/.source+t,"g")}return xA=1,e.prototype.get_directives=function(e){if(!e.match(this.__directives_block_pattern))return null;var t={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(e);n;)t[n[1]]=n[2],n=this.__directive_pattern.exec(e);return t},e.prototype.readIgnored=function(e){return e.readUntilAfter(this.__directives_end_ignore_pattern)},kA.Directives=e,kA}var HA,_A,SA,VA,OA={};function zA(){if(HA)return OA;HA=1;var e=MA().Pattern,t={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function n(n,r){e.call(this,n,r),this.__template_pattern=null,this._disabled=Object.assign({},t),this._excluded=Object.assign({},t),r&&(this.__template_pattern=this._input.get_regexp(r.__template_pattern),this._excluded=Object.assign(this._excluded,r._excluded),this._disabled=Object.assign(this._disabled,r._disabled));var i=new e(n);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}return n.prototype=new e,n.prototype._create=function(){return new n(this._input,this)},n.prototype._update=function(){this.__set_templated_pattern()},n.prototype.disable=function(e){var t=this._create();return t._disabled[e]=!0,t._update(),t},n.prototype.read_options=function(e){var n=this._create();for(var r in t)n._disabled[r]=-1===e.templating.indexOf(r);return n._update(),n},n.prototype.exclude=function(e){var t=this._create();return t._excluded[e]=!0,t._update(),t},n.prototype.read=function(){var e="";e=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern);for(var t=this._read_template();t;)this._match_pattern?t+=this._input.read(this._match_pattern):t+=this._input.readUntil(this.__template_pattern),e+=t,t=this._read_template();return this._until_after&&(e+=this._input.readUntilAfter(this._until_pattern)),e},n.prototype.__set_templated_pattern=function(){var e=[];this._disabled.php||e.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||e.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||e.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||e.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(e.push(this.__patterns.django._starting_pattern.source),e.push(this.__patterns.django_value._starting_pattern.source),e.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||e.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&e.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+e.join("|")+")")},n.prototype._read_template=function(){var e="",t=this._input.peek();if("<"===t){var n=this._input.peek(1);this._disabled.php||this._excluded.php||"?"!==n||(e=e||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==n||(e=e||this.__patterns.erb.read())}else"{"===t&&(this._disabled.handlebars||this._excluded.handlebars||(e=(e=(e=e||this.__patterns.handlebars_comment.read())||this.__patterns.handlebars_unescaped.read())||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(e=e||this.__patterns.django_value.read()),this._excluded.django||(e=(e=e||this.__patterns.django_comment.read())||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(e=(e=(e=e||this.__patterns.smarty_comment.read())||this.__patterns.smarty_literal.read())||this.__patterns.smarty.read()));return e},OA.TemplatablePattern=n,OA}function NA(){if(_A)return fA;_A=1;var e=pA().InputScanner,t=AA().Tokenizer,n=AA().TOKEN,r=LA().Directives,i=iA(),o=MA().Pattern,a=zA().TemplatablePattern;function l(e,t){return-1!==t.indexOf(e)}var c={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:n.START,RAW:n.RAW,EOF:n.EOF},s=new r(/\/\*/,/\*\//),d=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,u=/[0-9]/,f=/[^\d\.]/,h=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),p=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";p=(p="\\?\\.(?!\\d) "+(p=p.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"))).replace(/ /g,"|");var m,C=new RegExp(p),g="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),v=g.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),y=new RegExp("^(?:"+v.join("|")+")$"),w=function(e,n){t.call(this,e,n),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var r=new o(this._input),l=new a(this._input).read_options(this._options);this.__patterns={template:l,identifier:l.starting_with(i.identifier).matching(i.identifierMatch),number:r.matching(d),punct:r.matching(C),comment:r.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:r.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:r.matching(/<!--/),html_comment_end:r.matching(/-->/),include:r.starting_with(/#include/).until_after(i.lineBreak),shebang:r.starting_with(/#!/).until_after(i.lineBreak),xml:r.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:l.until(/['\\\n\r\u2028\u2029]/),double_quote:l.until(/["\\\n\r\u2028\u2029]/),template_text:l.until(/[`\\$]/),template_expression:l.until(/[`}\\]/)}};return(w.prototype=new t)._is_comment=function(e){return e.type===c.COMMENT||e.type===c.BLOCK_COMMENT||e.type===c.UNKNOWN},w.prototype._is_opening=function(e){return e.type===c.START_BLOCK||e.type===c.START_EXPR},w.prototype._is_closing=function(e,t){return(e.type===c.END_BLOCK||e.type===c.END_EXPR)&&t&&("]"===e.text&&"["===t.text||")"===e.text&&"("===t.text||"}"===e.text&&"{"===t.text)},w.prototype._reset=function(){m=!1},w.prototype._get_next_token=function(e,t){var n=null;this._readWhitespace();var r=this._input.peek();return null===r?this._create_token(c.EOF,""):n=(n=(n=(n=(n=(n=(n=(n=(n=(n=n||this._read_non_javascript(r))||this._read_string(r))||this._read_pair(r,this._input.peek(1)))||this._read_word(e))||this._read_singles(r))||this._read_comment(r))||this._read_regexp(r,e))||this._read_xml(r,e))||this._read_punctuation())||this._create_token(c.UNKNOWN,this._input.next())},w.prototype._read_word=function(e){var t;return""!==(t=this.__patterns.identifier.read())?(t=t.replace(i.allLineBreaks,"\n"),e.type!==c.DOT&&(e.type!==c.RESERVED||"set"!==e.text&&"get"!==e.text)&&y.test(t)?"in"!==t&&"of"!==t||e.type!==c.WORD&&e.type!==c.STRING?this._create_token(c.RESERVED,t):this._create_token(c.OPERATOR,t):this._create_token(c.WORD,t)):""!==(t=this.__patterns.number.read())?this._create_token(c.WORD,t):void 0},w.prototype._read_singles=function(e){var t=null;return"("===e||"["===e?t=this._create_token(c.START_EXPR,e):")"===e||"]"===e?t=this._create_token(c.END_EXPR,e):"{"===e?t=this._create_token(c.START_BLOCK,e):"}"===e?t=this._create_token(c.END_BLOCK,e):";"===e?t=this._create_token(c.SEMICOLON,e):"."===e&&f.test(this._input.peek(1))?t=this._create_token(c.DOT,e):","===e&&(t=this._create_token(c.COMMA,e)),t&&this._input.next(),t},w.prototype._read_pair=function(e,t){var n=null;return"#"===e&&"{"===t&&(n=this._create_token(c.START_BLOCK,e+t)),n&&(this._input.next(),this._input.next()),n},w.prototype._read_punctuation=function(){var e=this.__patterns.punct.read();if(""!==e)return"="===e?this._create_token(c.EQUALS,e):"?."===e?this._create_token(c.DOT,e):this._create_token(c.OPERATOR,e)},w.prototype._read_non_javascript=function(e){var t="";if("#"===e){if(this._is_first_token()&&(t=this.__patterns.shebang.read()))return this._create_token(c.UNKNOWN,t.trim()+"\n");if(t=this.__patterns.include.read())return this._create_token(c.UNKNOWN,t.trim()+"\n");e=this._input.next();var n="#";if(this._input.hasNext()&&this._input.testChar(u)){do{n+=e=this._input.next()}while(this._input.hasNext()&&"#"!==e&&"="!==e);return"#"===e||("["===this._input.peek()&&"]"===this._input.peek(1)?(n+="[]",this._input.next(),this._input.next()):"{"===this._input.peek()&&"}"===this._input.peek(1)&&(n+="{}",this._input.next(),this._input.next())),this._create_token(c.WORD,n)}this._input.back()}else if("<"===e&&this._is_first_token()){if(t=this.__patterns.html_comment_start.read()){for(;this._input.hasNext()&&!this._input.testChar(i.newline);)t+=this._input.next();return m=!0,this._create_token(c.COMMENT,t)}}else if(m&&"-"===e&&(t=this.__patterns.html_comment_end.read()))return m=!1,this._create_token(c.COMMENT,t);return null},w.prototype._read_comment=function(e){var t=null;if("/"===e){var n="";if("*"===this._input.peek(1)){n=this.__patterns.block_comment.read();var r=s.get_directives(n);r&&"start"===r.ignore&&(n+=s.readIgnored(this._input)),n=n.replace(i.allLineBreaks,"\n"),(t=this._create_token(c.BLOCK_COMMENT,n)).directives=r}else"/"===this._input.peek(1)&&(n=this.__patterns.comment.read(),t=this._create_token(c.COMMENT,n))}return t},w.prototype._read_string=function(t){if("`"===t||"'"===t||'"'===t){var n=this._input.next();return this.has_char_escapes=!1,n+="`"===t?this._read_string_recursive("`",!0,"${"):this._read_string_recursive(t),this.has_char_escapes&&this._options.unescape_strings&&(n=function(t){var n="",r=0,i=new e(t),o=null;for(;i.hasNext();)if((o=i.match(/([\s]|[^\\]|\\\\)+/g))&&(n+=o[0]),"\\"===i.peek()){if(i.next(),"x"===i.peek())o=i.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==i.peek()){n+="\\",i.hasNext()&&(n+=i.next());continue}(o=i.match(/u([0-9A-Fa-f]{4})/g))||(o=i.match(/u\{([0-9A-Fa-f]+)\}/g))}if(!o)return t;if((r=parseInt(o[1],16))>126&&r<=255&&0===o[0].indexOf("x"))return t;n+=r>=0&&r<32||r>1114111?"\\"+o[0]:34===r||39===r||92===r?"\\"+String.fromCharCode(r):String.fromCharCode(r)}return n}(n)),this._input.peek()===t&&(n+=this._input.next()),n=n.replace(i.allLineBreaks,"\n"),this._create_token(c.STRING,n)}return null},w.prototype._allow_regexp_or_xml=function(e){return e.type===c.RESERVED&&l(e.text,["return","case","throw","else","do","typeof","yield"])||e.type===c.END_EXPR&&")"===e.text&&e.opened.previous.type===c.RESERVED&&l(e.opened.previous.text,["if","while","for"])||l(e.type,[c.COMMENT,c.START_EXPR,c.START_BLOCK,c.START,c.END_BLOCK,c.OPERATOR,c.EQUALS,c.EOF,c.SEMICOLON,c.COMMA])},w.prototype._read_regexp=function(e,t){if("/"===e&&this._allow_regexp_or_xml(t)){for(var n=this._input.next(),r=!1,o=!1;this._input.hasNext()&&(r||o||this._input.peek()!==e)&&!this._input.testChar(i.newline);)n+=this._input.peek(),r?r=!1:(r="\\"===this._input.peek(),"["===this._input.peek()?o=!0:"]"===this._input.peek()&&(o=!1)),this._input.next();return this._input.peek()===e&&(n+=this._input.next(),n+=this._input.read(i.identifier)),this._create_token(c.STRING,n)}return null},w.prototype._read_xml=function(e,t){if(this._options.e4x&&"<"===e&&this._allow_regexp_or_xml(t)){var n="",r=this.__patterns.xml.read_match();if(r){for(var o=r[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),a=0===o.indexOf("{"),l=0;r;){var s=!!r[1],d=r[2];if(!(!!r[r.length-1]||"![CDATA["===d.slice(0,8))&&(d===o||a&&d.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(s?--l:++l),n+=r[0],l<=0)break;r=this.__patterns.xml.read_match()}return r||(n+=this._input.match(/[\s\S]*/g)[0]),n=n.replace(i.allLineBreaks,"\n"),this._create_token(c.STRING,n)}}return null},w.prototype._read_string_recursive=function(e,t,n){var r,o;"'"===e?o=this.__patterns.single_quote:'"'===e?o=this.__patterns.double_quote:"`"===e?o=this.__patterns.template_text:"}"===e&&(o=this.__patterns.template_expression);for(var a=o.read(),l="";this._input.hasNext();){if((l=this._input.next())===e||!t&&i.newline.test(l)){this._input.back();break}"\\"===l&&this._input.hasNext()?("x"===(r=this._input.peek())||"u"===r?this.has_char_escapes=!0:"\r"===r&&"\n"===this._input.peek(1)&&this._input.next(),l+=this._input.next()):n&&("${"===n&&"$"===l&&"{"===this._input.peek()&&(l+=this._input.next()),n===l&&(l+="`"===e?this._read_string_recursive("}",t,"`"):this._read_string_recursive("`",t,"${"),this._input.hasNext()&&(l+=this._input.next()))),a+=l+=o.read()}return a},fA.Tokenizer=w,fA.TOKEN=c,fA.positionable_operators=h.slice(),fA.line_starters=g.slice(),fA}function IA(){if(SA)return YM;SA=1;var e=JM().Output,t=tA().Token,n=iA(),r=dA().Options,i=NA().Tokenizer,o=NA().line_starters,a=NA().positionable_operators,l=NA().TOKEN;function c(e,t){return-1!==t.indexOf(e)}function s(e){return e.replace(/^\s+/g,"")}function d(e,t){return e&&e.type===l.RESERVED&&e.text===t}function u(e,t){return e&&e.type===l.RESERVED&&c(e.text,t)}var f=["case","return","do","if","throw","else","await","break","continue","async"],h=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].replace(/-/g,"_")]=e[n];return t}(["before-newline","after-newline","preserve-newline"]),p=[h.before_newline,h.preserve_newline],m="BlockStatement",C="Statement",g="ObjectLiteral",v="ArrayLiteral",y="ForInitializer",w="Conditional",b="Expression";function E(e,t){t.multiline_frame||t.mode===y||t.mode===w||e.remove_indent(t.start_line_index)}function M(e){return e===v}function A(e){return c(e,[b,y,w])}function x(e,t){t=t||{},this._source_text=e||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new r(t)}x.prototype.create_flags=function(e,n){var r=0;return e&&(r=e.indentation_level,!this._output.just_added_newline()&&e.line_indent_level>r&&(r=e.line_indent_level)),{mode:n,parent:e,last_token:e?e.last_token:new t(l.START_BLOCK,""),last_word:e?e.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:r,alignment:0,line_indent_level:e?e.line_indent_level:r,start_line_index:this._output.get_line_number(),ternary_depth:0}},x.prototype._reset=function(t){var n=t.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new e(this._options,n),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(m);var r=new i(t,this._options);return this._tokens=r.tokenize(),t},x.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._reset(this._source_text),t=this._options.eol;"auto"===this._options.eol&&(t="\n",e&&n.lineBreak.test(e||"")&&(t=e.match(n.lineBreak)[0]));for(var r=this._tokens.next();r;)this.handle_token(r),this._last_last_text=this._flags.last_token.text,this._flags.last_token=r,r=this._tokens.next();return this._output.get_code(t)},x.prototype.handle_token=function(e,t){e.type===l.START_EXPR?this.handle_start_expr(e):e.type===l.END_EXPR?this.handle_end_expr(e):e.type===l.START_BLOCK?this.handle_start_block(e):e.type===l.END_BLOCK?this.handle_end_block(e):e.type===l.WORD||e.type===l.RESERVED?this.handle_word(e):e.type===l.SEMICOLON?this.handle_semicolon(e):e.type===l.STRING?this.handle_string(e):e.type===l.EQUALS?this.handle_equals(e):e.type===l.OPERATOR?this.handle_operator(e):e.type===l.COMMA?this.handle_comma(e):e.type===l.BLOCK_COMMENT?this.handle_block_comment(e,t):e.type===l.COMMENT?this.handle_comment(e,t):e.type===l.DOT?this.handle_dot(e):e.type===l.EOF?this.handle_eof(e):(e.type,l.UNKNOWN,this.handle_unknown(e,t))},x.prototype.handle_whitespace_and_comments=function(e,t){var n=e.newlines,r=this._options.keep_array_indentation&&M(this._flags.mode);if(e.comments_before)for(var i=e.comments_before.next();i;)this.handle_whitespace_and_comments(i,t),this.handle_token(i,t),i=e.comments_before.next();if(r)for(var o=0;o<n;o+=1)this.print_newline(o>0,t);else if(this._options.max_preserve_newlines&&n>this._options.max_preserve_newlines&&(n=this._options.max_preserve_newlines),this._options.preserve_newlines&&n>1){this.print_newline(!1,t);for(var a=1;a<n;a+=1)this.print_newline(!0,t)}};var k=["async","break","continue","return","throw","yield"];return x.prototype.allow_wrap_or_preserved_newline=function(e,t){if(t=void 0!==t&&t,!this._output.just_added_newline()){var n=this._options.preserve_newlines&&e.newlines||t;if(c(this._flags.last_token.text,a)||c(e.text,a)){var r=c(this._flags.last_token.text,a)&&c(this._options.operator_position,p)||c(e.text,a);n=n&&r}if(n)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(u(this._flags.last_token,k))return;this._output.set_wrap_point()}}},x.prototype.print_newline=function(e,t){if(!t&&";"!==this._flags.last_token.text&&","!==this._flags.last_token.text&&"="!==this._flags.last_token.text&&(this._flags.last_token.type!==l.OPERATOR||"--"===this._flags.last_token.text||"++"===this._flags.last_token.text))for(var n=this._tokens.peek();!(this._flags.mode!==C||this._flags.if_block&&d(n,"else")||this._flags.do_block);)this.restore_mode();this._output.add_new_line(e)&&(this._flags.multiline_frame=!0)},x.prototype.print_token_line_indentation=function(e){this._output.just_added_newline()&&(this._options.keep_array_indentation&&e.newlines&&("["===e.text||M(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(e.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},x.prototype.print_token=function(e){if(this._output.raw)this._output.add_raw_token(e);else{if(this._options.comma_first&&e.previous&&e.previous.type===l.COMMA&&this._output.just_added_newline()&&","===this._output.previous_line.last()){var t=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(t),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(e),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(e),this._output.non_breaking_space=!0,this._output.add_token(e.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)}},x.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},x.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},x.prototype.set_mode=function(e){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,e),this._flags=this.create_flags(this._previous_flags,e),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},x.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===C&&E(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},x.prototype.start_of_object_property=function(){return this._flags.parent.mode===g&&this._flags.mode===C&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||u(this._flags.last_token,["get","set"]))},x.prototype.start_of_statement=function(e){var t=!1;return!!(t=(t=(t=(t=(t=(t=(t=t||u(this._flags.last_token,["var","let","const"])&&e.type===l.WORD)||d(this._flags.last_token,"do"))||!(this._flags.parent.mode===g&&this._flags.mode===C)&&u(this._flags.last_token,k)&&!e.newlines)||d(this._flags.last_token,"else")&&!(d(e,"if")&&!e.comments_before))||this._flags.last_token.type===l.END_EXPR&&(this._previous_flags.mode===y||this._previous_flags.mode===w))||this._flags.last_token.type===l.WORD&&this._flags.mode===m&&!this._flags.in_case&&!("--"===e.text||"++"===e.text)&&"function"!==this._last_last_text&&e.type!==l.WORD&&e.type!==l.RESERVED)||this._flags.mode===g&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||u(this._flags.last_token,["get","set"])))&&(this.set_mode(C),this.indent(),this.handle_whitespace_and_comments(e,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e,u(e,["do","for","if","while"])),!0)},x.prototype.handle_start_expr=function(e){this.start_of_statement(e)||this.handle_whitespace_and_comments(e);var t=b;if("["===e.text){if(this._flags.last_token.type===l.WORD||")"===this._flags.last_token.text)return u(this._flags.last_token,o)&&(this._output.space_before_token=!0),this.print_token(e),this.set_mode(t),this.indent(),void(this._options.space_in_paren&&(this._output.space_before_token=!0));t=v,M(this._flags.mode)&&("["!==this._flags.last_token.text&&(","!==this._flags.last_token.text||"]"!==this._last_last_text&&"}"!==this._last_last_text)||this._options.keep_array_indentation||this.print_newline()),c(this._flags.last_token.type,[l.START_EXPR,l.END_EXPR,l.WORD,l.OPERATOR,l.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===l.RESERVED)"for"===this._flags.last_token.text?(this._output.space_before_token=this._options.space_before_conditional,t=y):c(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,t=w):c(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:"import"===this._flags.last_token.text&&""===e.whitespace_before?this._output.space_before_token=!1:(c(this._flags.last_token.text,o)||"catch"===this._flags.last_token.text)&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===l.EQUALS||this._flags.last_token.type===l.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e);else if(this._flags.last_token.type===l.WORD){this._output.space_before_token=!1;var n=this._tokens.peek(-3);if(this._options.space_after_named_function&&n){var r=this._tokens.peek(-4);u(n,["async","function"])||"*"===n.text&&u(r,["async","function"])?this._output.space_before_token=!0:this._flags.mode===g?"{"!==n.text&&","!==n.text&&("*"!==n.text||"{"!==r.text&&","!==r.text)||(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(e);(this._flags.last_token.type===l.RESERVED&&("function"===this._flags.last_word||"typeof"===this._flags.last_word)||"*"===this._flags.last_token.text&&(c(this._last_last_text,["function","yield"])||this._flags.mode===g&&c(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}";"===this._flags.last_token.text||this._flags.last_token.type===l.START_BLOCK?this.print_newline():this._flags.last_token.type!==l.END_EXPR&&this._flags.last_token.type!==l.START_EXPR&&this._flags.last_token.type!==l.END_BLOCK&&"."!==this._flags.last_token.text&&this._flags.last_token.type!==l.COMMA||this.allow_wrap_or_preserved_newline(e,e.newlines),this.print_token(e),this.set_mode(t),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},x.prototype.handle_end_expr=function(e){for(;this._flags.mode===C;)this.restore_mode();this.handle_whitespace_and_comments(e),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(e,"]"===e.text&&M(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type!==l.START_EXPR||this._options.space_in_empty_paren?this._output.space_before_token=!0:(this._output.trim(),this._output.space_before_token=!1)),this.deindent(),this.print_token(e),this.restore_mode(),E(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===w&&(this._previous_flags.mode=b,this._flags.do_block=!1,this._flags.do_while=!1)},x.prototype.handle_start_block=function(e){this.handle_whitespace_and_comments(e);var t=this._tokens.peek(),n=this._tokens.peek(1);"switch"===this._flags.last_word&&this._flags.last_token.type===l.END_EXPR?(this.set_mode(m),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(m):n&&(c(n.text,[":",","])&&c(t.type,[l.STRING,l.WORD,l.RESERVED])||c(t.text,["get","set","..."])&&c(n.type,[l.WORD,l.RESERVED]))?c(this._last_last_text,["class","interface"])&&!c(n.text,[":",","])?this.set_mode(m):this.set_mode(g):this._flags.last_token.type===l.OPERATOR&&"=>"===this._flags.last_token.text?this.set_mode(m):c(this._flags.last_token.type,[l.EQUALS,l.START_EXPR,l.COMMA,l.OPERATOR])||u(this._flags.last_token,["return","throw","import","default"])?this.set_mode(g):this.set_mode(m),this._flags.last_token&&u(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var r=!t.comments_before&&"}"===t.text,i=r&&"function"===this._flags.last_word&&this._flags.last_token.type===l.END_EXPR;if(this._options.brace_preserve_inline){var o=0,a=null;this._flags.inline_frame=!0;do{if(o+=1,(a=this._tokens.peek(o-1)).newlines){this._flags.inline_frame=!1;break}}while(a.type!==l.EOF&&(a.type!==l.END_BLOCK||a.opened!==e))}("expand"===this._options.brace_style||"none"===this._options.brace_style&&e.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==l.OPERATOR&&(i||this._flags.last_token.type===l.EQUALS||u(this._flags.last_token,f)&&"else"!==this._flags.last_token.text)?this._output.space_before_token=!0:this.print_newline(!1,!0):(!M(this._previous_flags.mode)||this._flags.last_token.type!==l.START_EXPR&&this._flags.last_token.type!==l.COMMA||((this._flags.last_token.type===l.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(e),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==l.OPERATOR&&this._flags.last_token.type!==l.START_EXPR&&(c(this._flags.last_token.type,[l.START_BLOCK,l.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(e),this.indent(),r||this._options.brace_preserve_inline&&this._flags.inline_frame||this.print_newline()},x.prototype.handle_end_block=function(e){for(this.handle_whitespace_and_comments(e);this._flags.mode===C;)this.restore_mode();var t=this._flags.last_token.type===l.START_BLOCK;this._flags.inline_frame&&!t?this._output.space_before_token=!0:"expand"===this._options.brace_style?t||this.print_newline():t||(M(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(e)},x.prototype.handle_word=function(e){if(e.type===l.RESERVED)if(c(e.text,["set","get"])&&this._flags.mode!==g)e.type=l.WORD;else if("import"===e.text&&c(this._tokens.peek().text,["(","."]))e.type=l.WORD;else if(c(e.text,["as","from"])&&!this._flags.import_block)e.type=l.WORD;else if(this._flags.mode===g){":"===this._tokens.peek().text&&(e.type=l.WORD)}if(this.start_of_statement(e)?u(this._flags.last_token,["var","let","const"])&&e.type===l.WORD&&(this._flags.declaration_statement=!0):!e.newlines||A(this._flags.mode)||this._flags.last_token.type===l.OPERATOR&&"--"!==this._flags.last_token.text&&"++"!==this._flags.last_token.text||this._flags.last_token.type===l.EQUALS||!this._options.preserve_newlines&&u(this._flags.last_token,["var","let","const","set","get"])?this.handle_whitespace_and_comments(e):(this.handle_whitespace_and_comments(e),this.print_newline()),this._flags.do_block&&!this._flags.do_while){if(d(e,"while"))return this._output.space_before_token=!0,this.print_token(e),this._output.space_before_token=!0,void(this._flags.do_while=!0);this.print_newline(),this._flags.do_block=!1}if(this._flags.if_block)if(!this._flags.else_block&&d(e,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===C;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&u(e,["case","default"]))return this.print_newline(),this._flags.case_block||!this._flags.case_body&&!this._options.jslint_happy||this.deindent(),this._flags.case_body=!1,this.print_token(e),void(this._flags.in_case=!0);if(this._flags.last_token.type!==l.COMMA&&this._flags.last_token.type!==l.START_EXPR&&this._flags.last_token.type!==l.EQUALS&&this._flags.last_token.type!==l.OPERATOR||this.start_of_object_property()||c(this._flags.last_token.text,["+","-"])&&":"===this._last_last_text&&this._flags.parent.mode===g||this.allow_wrap_or_preserved_newline(e),d(e,"function"))return(c(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!c(this._flags.last_token.text,["(","[","{",":","=",","])&&this._flags.last_token.type!==l.OPERATOR)&&(this._output.just_added_blankline()||e.comments_before||(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD?u(this._flags.last_token,["get","set","new","export"])||u(this._flags.last_token,k)||d(this._flags.last_token,"default")&&"export"===this._last_last_text||"declare"===this._flags.last_token.text?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===l.OPERATOR||"="===this._flags.last_token.text?this._output.space_before_token=!0:(this._flags.multiline_frame||!A(this._flags.mode)&&!M(this._flags.mode))&&this.print_newline(),this.print_token(e),void(this._flags.last_word=e.text);var t="NONE";(this._flags.last_token.type===l.END_BLOCK?this._previous_flags.inline_frame?t="SPACE":u(e,["else","catch","finally","from"])?"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&e.newlines?t="NEWLINE":(t="SPACE",this._output.space_before_token=!0):t="NEWLINE":this._flags.last_token.type===l.SEMICOLON&&this._flags.mode===m?t="NEWLINE":this._flags.last_token.type===l.SEMICOLON&&A(this._flags.mode)?t="SPACE":this._flags.last_token.type===l.STRING?t="NEWLINE":this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD||"*"===this._flags.last_token.text&&(c(this._last_last_text,["function","yield"])||this._flags.mode===g&&c(this._last_last_text,["{",","]))?t="SPACE":this._flags.last_token.type===l.START_BLOCK?t=this._flags.inline_frame?"SPACE":"NEWLINE":this._flags.last_token.type===l.END_EXPR&&(this._output.space_before_token=!0,t="NEWLINE"),u(e,o)&&")"!==this._flags.last_token.text&&(t=this._flags.inline_frame||"else"===this._flags.last_token.text||"export"===this._flags.last_token.text?"SPACE":"NEWLINE"),u(e,["else","catch","finally"]))?(this._flags.last_token.type!==l.END_BLOCK||this._previous_flags.mode!==m||"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&e.newlines)&&!this._flags.inline_frame?this.print_newline():(this._output.trim(!0),"}"!==this._output.current_line.last()&&this.print_newline(),this._output.space_before_token=!0):"NEWLINE"===t?u(this._flags.last_token,f)||"declare"===this._flags.last_token.text&&u(e,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==l.END_EXPR?this._flags.last_token.type===l.START_EXPR&&u(e,["var","let","const"])||":"===this._flags.last_token.text||(d(e,"if")&&d(e.previous,"else")?this._output.space_before_token=!0:this.print_newline()):u(e,o)&&")"!==this._flags.last_token.text&&this.print_newline():this._flags.multiline_frame&&M(this._flags.mode)&&","===this._flags.last_token.text&&"}"===this._last_last_text?this.print_newline():"SPACE"===t&&(this._output.space_before_token=!0);!e.previous||e.previous.type!==l.WORD&&e.previous.type!==l.RESERVED||(this._output.space_before_token=!0),this.print_token(e),this._flags.last_word=e.text,e.type===l.RESERVED&&("do"===e.text?this._flags.do_block=!0:"if"===e.text?this._flags.if_block=!0:"import"===e.text?this._flags.import_block=!0:this._flags.import_block&&d(e,"from")&&(this._flags.import_block=!1))},x.prototype.handle_semicolon=function(e){this.start_of_statement(e)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(e);for(var t=this._tokens.peek();!(this._flags.mode!==C||this._flags.if_block&&d(t,"else")||this._flags.do_block);)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(e)},x.prototype.handle_string=function(e){(!e.text.startsWith("`")||0!==e.newlines||""!==e.whitespace_before||")"!==e.previous.text&&this._flags.last_token.type!==l.WORD)&&(this.start_of_statement(e)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(e),this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR||this._flags.last_token.type===l.EQUALS||this._flags.last_token.type===l.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e):!e.text.startsWith("`")||this._flags.last_token.type!==l.END_EXPR||"]"!==e.previous.text&&")"!==e.previous.text||0!==e.newlines?this.print_newline():this._output.space_before_token=!0)),this.print_token(e)},x.prototype.handle_equals=function(e){this.start_of_statement(e)||this.handle_whitespace_and_comments(e),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(e),this._output.space_before_token=!0},x.prototype.handle_comma=function(e){this.handle_whitespace_and_comments(e,!0),this.print_token(e),this._output.space_before_token=!0,this._flags.declaration_statement?(A(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(e)):this._flags.mode===g||this._flags.mode===C&&this._flags.parent.mode===g?(this._flags.mode===C&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(e)},x.prototype.handle_operator=function(e){var t="*"===e.text&&(u(this._flags.last_token,["function","yield"])||c(this._flags.last_token.type,[l.START_BLOCK,l.COMMA,l.END_BLOCK,l.SEMICOLON])),n=c(e.text,["-","+"])&&(c(this._flags.last_token.type,[l.START_BLOCK,l.START_EXPR,l.EQUALS,l.OPERATOR])||c(this._flags.last_token.text,o)||","===this._flags.last_token.text);if(this.start_of_statement(e));else{var r=!t;this.handle_whitespace_and_comments(e,r)}if("*"!==e.text||this._flags.last_token.type!==l.DOT)if("::"!==e.text)if(c(e.text,["-","+"])&&this.start_of_object_property())this.print_token(e);else{if(this._flags.last_token.type===l.OPERATOR&&c(this._options.operator_position,p)&&this.allow_wrap_or_preserved_newline(e),":"===e.text&&this._flags.in_case)return this.print_token(e),this._flags.in_case=!1,this._flags.case_body=!0,void(this._tokens.peek().type!==l.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0));var i=!0,s=!0,d=!1;if(":"===e.text?0===this._flags.ternary_depth?i=!1:(this._flags.ternary_depth-=1,d=!0):"?"===e.text&&(this._flags.ternary_depth+=1),!n&&!t&&this._options.preserve_newlines&&c(e.text,a)){var g=":"===e.text,v=g&&d,y=g&&!d;switch(this._options.operator_position){case h.before_newline:return this._output.space_before_token=!y,this.print_token(e),g&&!v||this.allow_wrap_or_preserved_newline(e),void(this._output.space_before_token=!0);case h.after_newline:return this._output.space_before_token=!0,!g||v?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(e):this._output.space_before_token=!1,this.print_token(e),void(this._output.space_before_token=!0);case h.preserve_newline:return y||this.allow_wrap_or_preserved_newline(e),i=!(this._output.just_added_newline()||y),this._output.space_before_token=i,this.print_token(e),void(this._output.space_before_token=!0)}}if(t){this.allow_wrap_or_preserved_newline(e),i=!1;var w=this._tokens.peek();s=w&&c(w.type,[l.WORD,l.RESERVED])}else if("..."===e.text)this.allow_wrap_or_preserved_newline(e),i=this._flags.last_token.type===l.START_BLOCK,s=!1;else if(c(e.text,["--","++","!","~"])||n){if(this._flags.last_token.type!==l.COMMA&&this._flags.last_token.type!==l.START_EXPR||this.allow_wrap_or_preserved_newline(e),i=!1,s=!1,e.newlines&&("--"===e.text||"++"===e.text||"~"===e.text)){var b=u(this._flags.last_token,f)&&e.newlines;b&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(b,!0)}";"===this._flags.last_token.text&&A(this._flags.mode)&&(i=!0),this._flags.last_token.type===l.RESERVED?i=!0:this._flags.last_token.type===l.END_EXPR?i=!("]"===this._flags.last_token.text&&("--"===e.text||"++"===e.text)):this._flags.last_token.type===l.OPERATOR&&(i=c(e.text,["--","-","++","+"])&&c(this._flags.last_token.text,["--","-","++","+"]),c(e.text,["+","-"])&&c(this._flags.last_token.text,["--","++"])&&(s=!0)),(this._flags.mode!==m||this._flags.inline_frame)&&this._flags.mode!==C||"{"!==this._flags.last_token.text&&";"!==this._flags.last_token.text||this.print_newline()}this._output.space_before_token=this._output.space_before_token||i,this.print_token(e),this._output.space_before_token=s}else this.print_token(e);else this.print_token(e)},x.prototype.handle_block_comment=function(e,t){return this._output.raw?(this._output.add_raw_token(e),void(e.directives&&"end"===e.directives.preserve&&(this._output.raw=this._options.test_output_raw))):e.directives?(this.print_newline(!1,t),this.print_token(e),"start"===e.directives.preserve&&(this._output.raw=!0),void this.print_newline(!1,!0)):n.newline.test(e.text)||e.newlines?void this.print_block_commment(e,t):(this._output.space_before_token=!0,this.print_token(e),void(this._output.space_before_token=!0))},x.prototype.print_block_commment=function(e,t){var r,i=function(e){for(var t=[],r=(e=e.replace(n.allLineBreaks,"\n")).indexOf("\n");-1!==r;)t.push(e.substring(0,r)),r=(e=e.substring(r+1)).indexOf("\n");return e.length&&t.push(e),t}(e.text),o=!1,a=!1,l=e.whitespace_before,c=l.length;if(this.print_newline(!1,t),this.print_token_line_indentation(e),this._output.add_token(i[0]),this.print_newline(!1,t),i.length>1){for(o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].trim().charAt(0)!==t)return!1;return!0}(i=i.slice(1),"*"),a=function(e,t){for(var n,r=0,i=e.length;r<i;r++)if((n=e[r])&&0!==n.indexOf(t))return!1;return!0}(i,l),o&&(this._flags.alignment=1),r=0;r<i.length;r++)o?(this.print_token_line_indentation(e),this._output.add_token(s(i[r]))):a&&i[r]?(this.print_token_line_indentation(e),this._output.add_token(i[r].substring(c))):(this._output.current_line.set_indent(-1),this._output.add_token(i[r])),this.print_newline(!1,t);this._flags.alignment=0}},x.prototype.handle_comment=function(e,t){e.newlines?this.print_newline(!1,t):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(e),this.print_newline(!1,t)},x.prototype.handle_dot=function(e){this.start_of_statement(e)||this.handle_whitespace_and_comments(e,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),u(this._flags.last_token,f)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(e,")"===this._flags.last_token.text&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(e)},x.prototype.handle_unknown=function(e,t){this.print_token(e),"\n"===e.text[e.text.length-1]&&this.print_newline(!1,t)},x.prototype.handle_eof=function(e){for(;this._flags.mode===C;)this.restore_mode();this.handle_whitespace_and_comments(e)},YM.Beautifier=x,YM}var DA,TA,ZA,jA={exports:{}},RA={},BA={};function PA(){if(DA)return BA;DA=1;var e=sA().Options;function t(t){e.call(this,t,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var n=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||n;var r=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var i=0;i<r.length;i++)"expand"!==r[i]?this.brace_style="collapse":this.brace_style=r[i]}return t.prototype=new e,BA.Options=t,BA}function FA(){if(ZA)return jA.exports;ZA=1;var e=function(){if(TA)return RA;TA=1;var e=PA().Options,t=JM().Output,n=pA().InputScanner,r=new(0,LA().Directives)(/\/\*/,/\*\//),i=/\r\n|[\r\n]/,o=/\r\n|[\r\n]/g,a=/\s/,l=/(?:\s|\n)+/g,c=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,s=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function d(t,n){this._source_text=t||"",this._options=new e(n),this._ch=null,this._input=null,this.NESTED_AT_RULE={page:!0,"font-face":!0,keyframes:!0,media:!0,supports:!0,document:!0},this.CONDITIONAL_GROUP_RULE={media:!0,supports:!0,document:!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}return d.prototype.eatString=function(e){var t="";for(this._ch=this._input.next();this._ch;){if(t+=this._ch,"\\"===this._ch)t+=this._input.next();else if(-1!==e.indexOf(this._ch)||"\n"===this._ch)break;this._ch=this._input.next()}return t},d.prototype.eatWhitespace=function(e){for(var t=a.test(this._input.peek()),n=0;a.test(this._input.peek());)this._ch=this._input.next(),e&&"\n"===this._ch&&(0===n||n<this._options.max_preserve_newlines)&&(n++,this._output.add_new_line(!0));return t},d.prototype.foundNestedPseudoClass=function(){for(var e=0,t=1,n=this._input.peek(t);n;){if("{"===n)return!0;if("("===n)e+=1;else if(")"===n){if(0===e)return!1;e-=1}else if(";"===n||"}"===n)return!1;t++,n=this._input.peek(t)}return!1},d.prototype.print_string=function(e){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(e)},d.prototype.preserveSingleSpace=function(e){e&&(this._output.space_before_token=!0)},d.prototype.indent=function(){this._indentLevel++},d.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},d.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._source_text,d=this._options.eol;"auto"===d&&(d="\n",e&&i.test(e||"")&&(d=e.match(i)[0]));var u=(e=e.replace(o,"\n")).match(/^[\t ]*/)[0];this._output=new t(this._options,u),this._input=new n(e),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var f,h,p=0,m=!1,C=!1,g=!1,v=!1,y=!1,w=this._ch,b=!1;f=""!==this._input.read(l),h=w,this._ch=this._input.next(),"\\"===this._ch&&this._input.hasNext()&&(this._ch+=this._input.next()),w=this._ch,this._ch;)if("/"===this._ch&&"*"===this._input.peek()){this._output.add_new_line(),this._input.back();var E=this._input.read(c),M=r.get_directives(E);M&&"start"===M.ignore&&(E+=r.readIgnored(this._input)),this.print_string(E),this.eatWhitespace(!0),this._output.add_new_line()}else if("/"===this._ch&&"/"===this._input.peek())this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(s)),this.eatWhitespace(!0);else if("$"===this._ch){this.preserveSingleSpace(f),this.print_string(this._ch);var A=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);A.match(/[ :]$/)&&(A=this.eatString(": ").replace(/\s+$/,""),this.print_string(A),this._output.space_before_token=!0),0===p&&-1!==A.indexOf(":")&&(C=!0,this.indent())}else if("@"===this._ch)if(this.preserveSingleSpace(f),"{"===this._input.peek())this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var x=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);x.match(/[ :]$/)&&(x=this.eatString(": ").replace(/\s+$/,""),this.print_string(x),this._output.space_before_token=!0),0===p&&-1!==x.indexOf(":")?(C=!0,this.indent()):x in this.NESTED_AT_RULE?(this._nestedLevel+=1,x in this.CONDITIONAL_GROUP_RULE&&(g=!0)):0!==p||C||(v=!0)}else if("#"===this._ch&&"{"===this._input.peek())this.preserveSingleSpace(f),this.print_string(this._ch+this.eatString("}"));else if("{"===this._ch)C&&(C=!1,this.outdent()),v=!1,g?(g=!1,m=this._indentLevel>=this._nestedLevel):m=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&m&&this._output.previous_line&&"{"!==this._output.previous_line.item(-1)&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,"expand"===this._options.brace_style?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):("("===h?this._output.space_before_token=!1:","!==h&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if("}"===this._ch)this.outdent(),this._output.add_new_line(),"{"===h&&this._output.trim(!0),C&&(this.outdent(),C=!1),this.print_string(this._ch),m=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&"}"!==this._input.peek()&&this._output.add_new_line(!0),")"===this._input.peek()&&(this._output.trim(!0),"expand"===this._options.brace_style&&this._output.add_new_line(!0));else if(":"===this._ch){for(var k=0;k<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;k++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[k])){b=!0;break}!m&&!g||this._input.lookBack("&")||this.foundNestedPseudoClass()||this._input.lookBack("(")||v||0!==p?(this._input.lookBack(" ")&&(this._output.space_before_token=!0),":"===this._input.peek()?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":")):(this.print_string(":"),C||(C=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent()))}else if('"'===this._ch||"'"===this._ch){var L='"'===h||"'"===h;this.preserveSingleSpace(L||f),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(";"===this._ch)b=!1,0===p?(C&&(this.outdent(),C=!1),v=!1,this.print_string(this._ch),this.eatWhitespace(!0),"/"!==this._input.peek()&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if("("===this._ch)if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),p++,this.indent(),this._ch=this._input.next(),")"===this._ch||'"'===this._ch||"'"===this._ch?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),p&&(p--,this.outdent()));else{var H=!1;this._input.lookBack("with")&&(H=!0),this.preserveSingleSpace(f||H),this.print_string(this._ch),C&&"$"===h&&this._options.selector_separator_newline?(this._output.add_new_line(),y=!0):(this.eatWhitespace(),p++,this.indent())}else if(")"===this._ch)p&&(p--,this.outdent()),y&&";"===this._input.peek()&&this._options.selector_separator_newline&&(y=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(","===this._ch)this.print_string(this._ch),this.eatWhitespace(!0),!this._options.selector_separator_newline||C&&!y||0!==p||v?this._output.space_before_token=!0:this._output.add_new_line();else if(">"!==this._ch&&"+"!==this._ch&&"~"!==this._ch||C||0!==p)if("]"===this._ch)this.print_string(this._ch);else if("["===this._ch)this.preserveSingleSpace(f),this.print_string(this._ch);else if("="===this._ch)this.eatWhitespace(),this.print_string("="),a.test(this._ch)&&(this._ch="");else if("!"!==this._ch||this._input.lookBack("\\")){var _='"'===h||"'"===h;this.preserveSingleSpace(_||f),this.print_string(this._ch),!this._output.just_added_newline()&&"\n"===this._input.peek()&&b&&this._output.add_new_line()}else this._output.space_before_token=!0,this.print_string(this._ch);else this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&a.test(this._ch)&&(this._ch=""));return this._output.get_code(d)},RA.Beautifier=d,RA}().Beautifier,t=PA().Options;return jA.exports=function(t,n){return new e(t,n).beautify()},jA.exports.defaultOptions=function(){return new t},jA.exports}var UA,qA={exports:{}},WA={},QA={};function GA(){if(UA)return QA;UA=1;var e=sA().Options;function t(t){e.call(this,t,"html"),1===this.templating.length&&"auto"===this.templating[0]&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_min_attrs=this._get_number("wrap_attributes_min_attrs",2),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.inline_custom_elements=this._get_boolean("inline_custom_elements",!0),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}return t.prototype=new e,QA.Options=t,QA}var KA,YA,XA,JA,$A,ex={};function tx(){if(KA)return ex;KA=1;var e=AA().Tokenizer,t=AA().TOKEN,n=LA().Directives,r=zA().TemplatablePattern,i=MA().Pattern,o={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",CONTROL_FLOW_OPEN:"TK_CONTROL_FLOW_OPEN",CONTROL_FLOW_CLOSE:"TK_CONTROL_FLOW_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:t.START,RAW:t.RAW,EOF:t.EOF},a=new n(/<\!--/,/-->/),l=function(t,n){e.call(this,t,n),this._current_tag_name="";var o=new r(this._input).read_options(this._options),a=new i(this._input);if(this.__patterns={word:o.until(/[\n\r\t <]/),word_control_flow_close_excluded:o.until(/[\n\r\t <}]/),single_quote:o.until_after(/'/),double_quote:o.until_after(/"/),attribute:o.until(/[\n\r\t =>]|\/>/),element_name:o.until(/[\n\r\t >\/]/),angular_control_flow_start:a.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:a.starting_with(/{{!--/).until_after(/--}}/),handlebars:a.starting_with(/{{/).until_after(/}}/),handlebars_open:a.until(/[\n\r\t }]/),handlebars_raw_close:a.until(/}}/),comment:a.starting_with(/<!--/).until_after(/-->/),cdata:a.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:a.starting_with(/<!\[/).until_after(/]>/),processing:a.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars"),this.__patterns.word_control_flow_close_excluded=this.__patterns.word_control_flow_close_excluded.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var l=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=a.matching(l).until_after(l)}};return(l.prototype=new e)._is_comment=function(e){return!1},l.prototype._is_opening=function(e){return e.type===o.TAG_OPEN||e.type===o.CONTROL_FLOW_OPEN},l.prototype._is_closing=function(e,t){return e.type===o.TAG_CLOSE&&t&&((">"===e.text||"/>"===e.text)&&"<"===t.text[0]||"}}"===e.text&&"{"===t.text[0]&&"{"===t.text[1])||e.type===o.CONTROL_FLOW_CLOSE&&"}"===e.text&&t.text.endsWith("{")},l.prototype._reset=function(){this._current_tag_name=""},l.prototype._get_next_token=function(e,t){var n=null;this._readWhitespace();var r=this._input.peek();return null===r?this._create_token(o.EOF,""):n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=n||this._read_open_handlebars(r,t))||this._read_attribute(r,e,t))||this._read_close(r,t))||this._read_script_and_style(r,e))||this._read_control_flows(r,t))||this._read_raw_content(r,e,t))||this._read_content_word(r,t))||this._read_comment_or_cdata(r))||this._read_processing(r))||this._read_open(r,t))||this._create_token(o.UNKNOWN,this._input.next())},l.prototype._read_comment_or_cdata=function(e){var t=null,n=null,r=null;"<"===e&&("!"===this._input.peek(1)&&((n=this.__patterns.comment.read())?(r=a.get_directives(n))&&"start"===r.ignore&&(n+=a.readIgnored(this._input)):n=this.__patterns.cdata.read()),n&&((t=this._create_token(o.COMMENT,n)).directives=r));return t},l.prototype._read_processing=function(e){var t=null,n=null;if("<"===e){var r=this._input.peek(1);"!"!==r&&"?"!==r||(n=(n=this.__patterns.conditional_comment.read())||this.__patterns.processing.read()),n&&((t=this._create_token(o.COMMENT,n)).directives=null)}return t},l.prototype._read_open=function(e,t){var n=null,r=null;return t&&t.type!==o.CONTROL_FLOW_OPEN||"<"===e&&(n=this._input.next(),"/"===this._input.peek()&&(n+=this._input.next()),n+=this.__patterns.element_name.read(),r=this._create_token(o.TAG_OPEN,n)),r},l.prototype._read_open_handlebars=function(e,t){var n=null,r=null;return t&&t.type!==o.CONTROL_FLOW_OPEN||(this._options.templating.includes("angular")||this._options.indent_handlebars)&&"{"===e&&"{"===this._input.peek(1)&&(this._options.indent_handlebars&&"!"===this._input.peek(2)?(n=(n=this.__patterns.handlebars_comment.read())||this.__patterns.handlebars.read(),r=this._create_token(o.COMMENT,n)):(n=this.__patterns.handlebars_open.read(),r=this._create_token(o.TAG_OPEN,n))),r},l.prototype._read_control_flows=function(e,t){var n="",r=null;if(!this._options.templating.includes("angular"))return r;if("@"===e){if(""===(n=this.__patterns.angular_control_flow_start.read()))return r;for(var i=n.endsWith("(")?1:0,a=0;!n.endsWith("{")||i!==a;){var l=this._input.next();if(null===l)break;"("===l?i++:")"===l&&a++,n+=l}r=this._create_token(o.CONTROL_FLOW_OPEN,n)}else"}"===e&&t&&t.type===o.CONTROL_FLOW_OPEN&&(n=this._input.next(),r=this._create_token(o.CONTROL_FLOW_CLOSE,n));return r},l.prototype._read_close=function(e,t){var n=null,r=null;return t&&t.type===o.TAG_OPEN&&("<"===t.text[0]&&(">"===e||"/"===e&&">"===this._input.peek(1))?(n=this._input.next(),"/"===e&&(n+=this._input.next()),r=this._create_token(o.TAG_CLOSE,n)):"{"===t.text[0]&&"}"===e&&"}"===this._input.peek(1)&&(this._input.next(),this._input.next(),r=this._create_token(o.TAG_CLOSE,"}}"))),r},l.prototype._read_attribute=function(e,t,n){var r=null,i="";if(n&&"<"===n.text[0])if("="===e)r=this._create_token(o.EQUALS,this._input.next());else if('"'===e||"'"===e){var a=this._input.next();a+='"'===e?this.__patterns.double_quote.read():this.__patterns.single_quote.read(),r=this._create_token(o.VALUE,a)}else(i=this.__patterns.attribute.read())&&(r=t.type===o.EQUALS?this._create_token(o.VALUE,i):this._create_token(o.ATTRIBUTE,i));return r},l.prototype._is_content_unformatted=function(e){return-1===this._options.void_elements.indexOf(e)&&(-1!==this._options.content_unformatted.indexOf(e)||-1!==this._options.unformatted.indexOf(e))},l.prototype._read_raw_content=function(e,t,n){var r="";if(n&&"{"===n.text[0])r=this.__patterns.handlebars_raw_close.read();else if(t.type===o.TAG_CLOSE&&"<"===t.opened.text[0]&&"/"!==t.text[0]){var i=t.opened.text.substr(1).toLowerCase();this._is_content_unformatted(i)&&(r=this._input.readUntil(new RegExp("</"+i+"[\\n\\r\\t ]*?>","ig")))}return r?this._create_token(o.TEXT,r):null},l.prototype._read_script_and_style=function(e,t){if(t.type===o.TAG_CLOSE&&"<"===t.opened.text[0]&&"/"!==t.text[0]){var n=t.opened.text.substr(1).toLowerCase();if("script"===n||"style"===n){var r=this._read_comment_or_cdata(e);if(r)return r.type=o.TEXT,r;var i=this._input.readUntil(new RegExp("</"+n+"[\\n\\r\\t ]*?>","ig"));if(i)return this._create_token(o.TEXT,i)}}return null},l.prototype._read_content_word=function(e,t){var n="";return this._options.unformatted_content_delimiter&&e===this._options.unformatted_content_delimiter[0]&&(n=this.__patterns.unformatted_content_delimiter.read()),n||(n=t&&t.type===o.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),n?this._create_token(o.TEXT,n):null},ex.Tokenizer=l,ex.TOKEN=o,ex}function nx(){if(YA)return WA;YA=1;var e=GA().Options,t=JM().Output,n=tx().Tokenizer,r=tx().TOKEN,i=/\r\n|[\r\n]/,o=/\r\n|[\r\n]/g,a=function(e,n){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=e.max_preserve_newlines,this.preserve_newlines=e.preserve_newlines,this._output=new t(e,n)};a.prototype.current_line_has_match=function(e){return this._output.current_line.has_match(e)},a.prototype.set_space_before_token=function(e,t){this._output.space_before_token=e,this._output.non_breaking_space=t},a.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},a.prototype.add_raw_token=function(e){this._output.add_raw_token(e)},a.prototype.print_preserved_newlines=function(e){var t=0;e.type!==r.TEXT&&e.previous.type!==r.TEXT&&(t=e.newlines?1:0),this.preserve_newlines&&(t=e.newlines<this.max_preserve_newlines+1?e.newlines:this.max_preserve_newlines+1);for(var n=0;n<t;n++)this.print_newline(n>0);return 0!==t},a.prototype.traverse_whitespace=function(e){return!(!e.whitespace_before&&!e.newlines)&&(this.print_preserved_newlines(e)||(this._output.space_before_token=!0),!0)},a.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},a.prototype.print_newline=function(e){this._output.add_new_line(e)},a.prototype.print_token=function(e){e.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(e.text))},a.prototype.indent=function(){this.indent_level++},a.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},a.prototype.get_full_indent=function(e){return(e=this.indent_level+(e||0))<1?"":this._output.get_indent_string(e)};var l=function(e,t){var n=null,i=null;return t.closed?("script"===e?n="text/javascript":"style"===e&&(n="text/css"),n=function(e){for(var t=null,n=e.next;n.type!==r.EOF&&e.closed!==n;){if(n.type===r.ATTRIBUTE&&"type"===n.text){n.next&&n.next.type===r.EQUALS&&n.next.next&&n.next.next.type===r.VALUE&&(t=n.next.next.text);break}n=n.next}return t}(t)||n,n.search("text/css")>-1?i="css":n.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?i="javascript":n.search(/(text|application|dojo)\/(x-)?(html)/)>-1?i="html":n.search(/test\/null/)>-1&&(i="null"),i):null};function c(e,t){return-1!==t.indexOf(e)}function s(e,t,n){this.parent=e||null,this.tag=t?t.tag_name:"",this.indent_level=n||0,this.parser_token=t||null}function d(e){this._printer=e,this._current_frame=null}function u(t,n,r,i){this._source_text=t||"",n=n||{},this._js_beautify=r,this._css_beautify=i,this._tag_stack=null;var o=new e(n,"html");this._options=o,this._is_wrap_attributes_force="force"===this._options.wrap_attributes.substr(0,5),this._is_wrap_attributes_force_expand_multiline="force-expand-multiline"===this._options.wrap_attributes,this._is_wrap_attributes_force_aligned="force-aligned"===this._options.wrap_attributes,this._is_wrap_attributes_aligned_multiple="aligned-multiple"===this._options.wrap_attributes,this._is_wrap_attributes_preserve="preserve"===this._options.wrap_attributes.substr(0,8),this._is_wrap_attributes_preserve_aligned="preserve-aligned"===this._options.wrap_attributes}d.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},d.prototype.record_tag=function(e){var t=new s(this._current_frame,e,this._printer.indent_level);this._current_frame=t},d.prototype._try_pop_frame=function(e){var t=null;return e&&(t=e.parser_token,this._printer.indent_level=e.indent_level,this._current_frame=e.parent),t},d.prototype._get_frame=function(e,t){for(var n=this._current_frame;n&&-1===e.indexOf(n.tag);){if(t&&-1!==t.indexOf(n.tag)){n=null;break}n=n.parent}return n},d.prototype.try_pop=function(e,t){var n=this._get_frame([e],t);return this._try_pop_frame(n)},d.prototype.indent_to_tag=function(e){var t=this._get_frame(e);t&&(this._printer.indent_level=t.indent_level)},u.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._source_text,t=this._options.eol;"auto"===this._options.eol&&(t="\n",e&&i.test(e)&&(t=e.match(i)[0]));var l=(e=e.replace(o,"\n")).match(/^[\t ]*/)[0],c={text:"",type:""},s=new f(this._options),u=new a(this._options,l),h=new n(e,this._options).tokenize();this._tag_stack=new d(u);for(var p=null,m=h.next();m.type!==r.EOF;)m.type===r.TAG_OPEN||m.type===r.COMMENT?s=p=this._handle_tag_open(u,m,s,c,h):m.type===r.ATTRIBUTE||m.type===r.EQUALS||m.type===r.VALUE||m.type===r.TEXT&&!s.tag_complete?p=this._handle_inside_tag(u,m,s,c):m.type===r.TAG_CLOSE?p=this._handle_tag_close(u,m,s):m.type===r.TEXT?p=this._handle_text(u,m,s):m.type===r.CONTROL_FLOW_OPEN?p=this._handle_control_flow_open(u,m):m.type===r.CONTROL_FLOW_CLOSE?p=this._handle_control_flow_close(u,m):u.add_raw_token(m),c=p,m=h.next();return u._output.get_code(t)},u.prototype._handle_control_flow_open=function(e,t){var n={text:t.text,type:t.type};return e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),t.newlines?e.print_preserved_newlines(t):e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),e.print_token(t),e.indent(),n},u.prototype._handle_control_flow_close=function(e,t){var n={text:t.text,type:t.type};return e.deindent(),t.newlines?e.print_preserved_newlines(t):e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),e.print_token(t),n},u.prototype._handle_tag_close=function(e,t,n){var r={text:t.text,type:t.type};return e.alignment_size=0,n.tag_complete=!0,e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),n.is_unformatted?e.add_raw_token(t):("<"===n.tag_start_char&&(e.set_space_before_token("/"===t.text[0],!0),this._is_wrap_attributes_force_expand_multiline&&n.has_wrapped_attrs&&e.print_newline(!1)),e.print_token(t)),!n.indent_content||n.is_unformatted||n.is_content_unformatted||(e.indent(),n.indent_content=!1),n.is_inline_element||n.is_unformatted||n.is_content_unformatted||e.set_wrap_point(),r},u.prototype._handle_inside_tag=function(e,t,n,i){var o=n.has_wrapped_attrs,a={text:t.text,type:t.type};return e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),n.is_unformatted?e.add_raw_token(t):"{"===n.tag_start_char&&t.type===r.TEXT?e.print_preserved_newlines(t)?(t.newlines=0,e.add_raw_token(t)):e.print_token(t):(t.type===r.ATTRIBUTE?e.set_space_before_token(!0):(t.type===r.EQUALS||t.type===r.VALUE&&t.previous.type===r.EQUALS)&&e.set_space_before_token(!1),t.type===r.ATTRIBUTE&&"<"===n.tag_start_char&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(e.traverse_whitespace(t),o=o||0!==t.newlines),this._is_wrap_attributes_force&&n.attr_count>=this._options.wrap_attributes_min_attrs&&(i.type!==r.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(e.print_newline(!1),o=!0)),e.print_token(t),o=o||e.previous_token_wrapped(),n.has_wrapped_attrs=o),a},u.prototype._handle_text=function(e,t,n){var r={text:t.text,type:"TK_CONTENT"};return n.custom_beautifier_name?this._print_custom_beatifier_text(e,t,n):n.is_unformatted||n.is_content_unformatted?e.add_raw_token(t):(e.traverse_whitespace(t),e.print_token(t)),r},u.prototype._print_custom_beatifier_text=function(e,t,n){var r=this;if(""!==t.text){var i,o=t.text,a=1,l="",c="";"javascript"===n.custom_beautifier_name&&"function"==typeof this._js_beautify?i=this._js_beautify:"css"===n.custom_beautifier_name&&"function"==typeof this._css_beautify?i=this._css_beautify:"html"===n.custom_beautifier_name&&(i=function(e,t){return new u(e,t,r._js_beautify,r._css_beautify).beautify()}),"keep"===this._options.indent_scripts?a=0:"separate"===this._options.indent_scripts&&(a=-e.indent_level);var s=e.get_full_indent(a);if(o=o.replace(/\n[ \t]*$/,""),"html"!==n.custom_beautifier_name&&"<"===o[0]&&o.match(/^(<!--|<!\[CDATA\[)/)){var d=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(o);if(!d)return void e.add_raw_token(t);l=s+d[1]+"\n",o=d[4],d[5]&&(c=s+d[5]),o=o.replace(/\n[ \t]*$/,""),(d[2]||-1!==d[3].indexOf("\n"))&&(d=d[3].match(/[ \t]+$/))&&(t.whitespace_before=d[0])}if(o)if(i){var f=function(){this.eol="\n"};f.prototype=this._options.raw_options,o=i(s+o,new f)}else{var h=t.whitespace_before;h&&(o=o.replace(new RegExp("\n("+h+")?","g"),"\n")),o=s+o.replace(/\n/g,"\n"+s)}l&&(o=o?l+o+"\n"+c:l+c),e.print_newline(!1),o&&(t.text=o,t.whitespace_before="",t.newlines=0,e.add_raw_token(t),e.print_newline(!0))}},u.prototype._handle_tag_open=function(e,t,n,i,o){var a=this._get_tag_open_token(t);if(!n.is_unformatted&&!n.is_content_unformatted||n.is_empty_element||t.type!==r.TAG_OPEN||a.is_start_tag?(e.traverse_whitespace(t),this._set_tag_position(e,t,a,n,i),a.is_inline_element||e.set_wrap_point(),e.print_token(t)):(e.add_raw_token(t),a.start_tag_token=this._tag_stack.try_pop(a.tag_name)),a.is_start_tag&&this._is_wrap_attributes_force){var l,c=0;do{(l=o.peek(c)).type===r.ATTRIBUTE&&(a.attr_count+=1),c+=1}while(l.type!==r.EOF&&l.type!==r.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(a.alignment_size=t.text.length+1),a.tag_complete||a.is_unformatted||(e.alignment_size=a.alignment_size),a};var f=function(e,t,n){if(this.parent=t||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",n){var i;this.tag_start_char=n.text[0],this.text=n.text,"<"===this.tag_start_char?(i=n.text.match(/^<([^\s>]*)/),this.tag_check=i?i[1]:""):(i=n.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=i?i[1]:"",(n.text.startsWith("{{#>")||n.text.startsWith("{{~#>"))&&">"===this.tag_check[0]&&(">"===this.tag_check&&null!==n.next?this.tag_check=n.next.text.split(" ")[0]:this.tag_check=n.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),n.type===r.COMMENT&&(this.tag_complete=!0),this.is_start_tag="/"!==this.tag_check.charAt(0),this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||n.closed&&"/>"===n.closed.text;var o=2;"{"===this.tag_start_char&&this.text.length>=3&&"~"===this.text.charAt(2)&&(o=3),this.is_end_tag=this.is_end_tag||"{"===this.tag_start_char&&(!e.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(o)))}else this.tag_complete=!0};u.prototype._get_tag_open_token=function(e){var t=new f(this._options,this._tag_stack.get_parser_token(),e);return t.alignment_size=this._options.wrap_attributes_indent_size,t.is_end_tag=t.is_end_tag||c(t.tag_check,this._options.void_elements),t.is_empty_element=t.tag_complete||t.is_start_tag&&t.is_end_tag,t.is_unformatted=!t.tag_complete&&c(t.tag_check,this._options.unformatted),t.is_content_unformatted=!t.is_empty_element&&c(t.tag_check,this._options.content_unformatted),t.is_inline_element=c(t.tag_name,this._options.inline)||this._options.inline_custom_elements&&t.tag_name.includes("-")||"{"===t.tag_start_char,t},u.prototype._set_tag_position=function(e,t,n,i,o){if(n.is_empty_element||(n.is_end_tag?n.start_tag_token=this._tag_stack.try_pop(n.tag_name):(this._do_optional_end_element(n)&&(n.is_inline_element||e.print_newline(!1)),this._tag_stack.record_tag(n),"script"!==n.tag_name&&"style"!==n.tag_name||n.is_unformatted||n.is_content_unformatted||(n.custom_beautifier_name=l(n.tag_check,t)))),c(n.tag_check,this._options.extra_liners)&&(e.print_newline(!1),e._output.just_added_blankline()||e.print_newline(!0)),n.is_empty_element){if("{"===n.tag_start_char&&"else"===n.tag_check)this._tag_stack.indent_to_tag(["if","unless","each"]),n.indent_content=!0,e.current_line_has_match(/{{#if/)||e.print_newline(!1);"!--"===n.tag_name&&o.type===r.TAG_CLOSE&&i.is_end_tag&&-1===n.text.indexOf("\n")||(n.is_inline_element||n.is_unformatted||e.print_newline(!1),this._calcluate_parent_multiline(e,n))}else if(n.is_end_tag){var a=!1;a=(a=n.start_tag_token&&n.start_tag_token.multiline_content)||!n.is_inline_element&&!(i.is_inline_element||i.is_unformatted)&&!(o.type===r.TAG_CLOSE&&n.start_tag_token===i)&&"TK_CONTENT"!==o.type,(n.is_content_unformatted||n.is_unformatted)&&(a=!1),a&&e.print_newline(!1)}else n.indent_content=!n.custom_beautifier_name,"<"===n.tag_start_char&&("html"===n.tag_name?n.indent_content=this._options.indent_inner_html:"head"===n.tag_name?n.indent_content=this._options.indent_head_inner_html:"body"===n.tag_name&&(n.indent_content=this._options.indent_body_inner_html)),n.is_inline_element||n.is_unformatted||"TK_CONTENT"===o.type&&!n.is_content_unformatted||e.print_newline(!1),this._calcluate_parent_multiline(e,n)},u.prototype._calcluate_parent_multiline=function(e,t){!t.parent||!e._output.just_added_newline()||(t.is_inline_element||t.is_unformatted)&&t.parent.is_inline_element||(t.parent.multiline_content=!0)};var h=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","menu","nav","ol","p","pre","section","table","ul"],p=["a","audio","del","ins","map","noscript","video"];return u.prototype._do_optional_end_element=function(e){var t=null;if(!e.is_empty_element&&e.is_start_tag&&e.parent){if("body"===e.tag_name)t=t||this._tag_stack.try_pop("head");else if("li"===e.tag_name)t=t||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if("dd"===e.tag_name||"dt"===e.tag_name)t=(t=t||this._tag_stack.try_pop("dt",["dl"]))||this._tag_stack.try_pop("dd",["dl"]);else if("p"===e.parent.tag_name&&-1!==h.indexOf(e.tag_name)){var n=e.parent.parent;n&&-1!==p.indexOf(n.tag_name)||(t=t||this._tag_stack.try_pop("p"))}else"rp"===e.tag_name||"rt"===e.tag_name?t=(t=t||this._tag_stack.try_pop("rt",["ruby","rtc"]))||this._tag_stack.try_pop("rp",["ruby","rtc"]):"optgroup"===e.tag_name?t=t||this._tag_stack.try_pop("optgroup",["select"]):"option"===e.tag_name?t=t||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):"colgroup"===e.tag_name?t=t||this._tag_stack.try_pop("caption",["table"]):"thead"===e.tag_name?t=(t=t||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]):"tbody"===e.tag_name||"tfoot"===e.tag_name?t=(t=(t=(t=t||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("thead",["table"]))||this._tag_stack.try_pop("tbody",["table"]):"tr"===e.tag_name?t=(t=(t=t||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"]):"th"!==e.tag_name&&"td"!==e.tag_name||(t=(t=t||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]))||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return e.parent=this._tag_stack.get_parser_token(),t}},WA.Beautifier=u,WA}function rx(){if(JA)return GM;JA=1;var e=function(){if(VA)return KM.exports;VA=1;var e=IA().Beautifier,t=dA().Options;return KM.exports=function(t,n){return new e(t,n).beautify()},KM.exports.defaultOptions=function(){return new t},KM.exports}(),t=FA(),n=function(){if(XA)return qA.exports;XA=1;var e=nx().Beautifier,t=GA().Options;return qA.exports=function(t,n,r,i){return new e(t,n,r,i).beautify()},qA.exports.defaultOptions=function(){return new t},qA.exports}();function r(r,i,o,a){return n(r,i,o=o||e,a=a||t)}return r.defaultOptions=n.defaultOptions,GM.js=e,GM.css=t,GM.html=r,GM}var ix=($A||($A=1,function(e){var t,n,r,i,o=rx();o.js_beautify=o.js,o.css_beautify=o.css,o.html_beautify=o.html,e.exports=(t=o,n=o,r=o,i=function(e,n){return t.js_beautify(e,n)},i.js=t.js_beautify,i.css=n.css_beautify,i.html=r.html_beautify,i.js_beautify=t.js_beautify,i.css_beautify=n.css_beautify,i.html_beautify=r.html_beautify,i)}(QM)),QM.exports);const ox=(e,t,n=150)=>{if(!e||!t)return{top:0,left:0};const{top:r,left:i}=e,o=t.getBoundingClientRect();let a=r,l=i;return a-=a+n>t.clientHeight-n+130?Math.floor(n/2)+n-35:10,i>.6*o.width?l-=n+50:i<.5*o.width+n&&(l-=42),{top:a,left:l}},ax=o(({width:t="100%",height:r="100%",VariableDropdownHeight:i="160px",readOnly:o=!1,value:c="",handleChange:d,setValue:u,variableOptionsList:f=[],addForloopPrefix:h=!1,language:p="json",theme:m="light",isRequisiteType:C=!1,onPaste:g,showVariableDropdown:v=!0,defaultValue:y,customOptions:w={},editorVariableZindex:E=99999,showMinimap:M=!0,isFocus:A=!1},x)=>{const k=a(null),L=a([]),H=a(null),_=a(null),[S,V]=s(0),[O,z]=s(!1),[N,I]=s(!1),[D,T]=s({top:0,left:0}),[Z,j]=s([]),R=a(f);l(()=>{R.current=f},[f]);l(()=>{const e=k.current;if(!e)return;const t=e.onDidBlurEditorWidget(()=>{I(!1),H.current=null,_.current=null,L.current=[],V(0)}),n=t=>{const n=e.getDomNode(),r=n&&n.contains(t.target);if(!r||r&&!t.target.closest(".view-line, .monaco-editor-textarea")){const e=n?.querySelector("textarea");e&&e.blur()}};return document.addEventListener("mousedown",n),()=>{t.dispose(),document.removeEventListener("mousedown",n)}},[N]),l(()=>{const e=k.current;if(!e||!S)return;const t=[],n=[];O?n.push({range:{startLineNumber:S,startColumn:1,endLineNumber:S,endColumn:1},options:{isWholeLine:!1,linesDecorationsClassName:"active-line-number"}}):t.push({range:{startLineNumber:S,startColumn:1,endLineNumber:S,endColumn:1},options:{isWholeLine:!0,className:"current-line-background"}}),L.current=e.deltaDecorations(L.current,[...t,...n])},[S,O]);const B=(e,t)=>{switch(t){case"json":case"javascript":return ix.js(e,{indent_size:4,indent_char:" ",max_preserve_newlines:5,preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!0,brace_style:"collapse",space_before_conditional:!0,unescape_strings:!0,jslint_happy:!0,end_with_newline:!0,wrap_line_length:0,comma_first:!1,e4x:!0,indent_empty_lines:!0});case"html":case"xml":return ix.html(e,{indent_size:4,indent_char:" ",max_preserve_newlines:5,preserve_newlines:!0,end_with_newline:!0,wrap_line_length:0,indent_empty_lines:!0});default:return e}};return b(x,()=>({getEditorInstance:()=>k.current,focus:()=>{k.current?.focus()},beautify:()=>{if(k.current){const e=k.current.getValue(),t=k.current.getModel()?.getLanguageId(),n=B(e,t||"json");k.current.setValue(n)}}})),n("div",{style:{width:t,height:r},className:"ff-editor-container",children:[e(WM,{defaultValue:y,height:r,width:t,language:p,value:c,options:{minimap:{enabled:M},lineNumbers:"on",wordWrap:"on",autoClosingBrackets:"always",scrollBeyondLastLine:!1,readOnly:o,guides:{indentation:!1},...w},onMount:(e,t)=>{k.current=e,A&&setTimeout(()=>{e.focus()},0),e.onDidChangeCursorPosition(t=>{V(t.position.lineNumber);const n=e.getPosition(),r=e.getModel();if(!n||!r)return;const i=r.getLineContent(n.lineNumber),o=n.column-1;if(0===o)return void I(!1);const a=i.lastIndexOf("$",o-1),l=i.lastIndexOf("${",o-1),c=-1!==l?i.indexOf("}",l+2):-1,s=-1!==l&&-1!==c&&o-1>l&&o-1<c,d=!/\}/.test(i.slice(a+1,o));if(-1!==a&&o>a&&!/\s/.test(i.slice(a+1,o))&&!s&&d){H.current=a,_.current=i.slice(a+1,o);const r=(_.current??"").toLowerCase(),l=R.current.filter(e=>("_startforloop"===e.type&&h?`FLV_for:${e.name}`:e.name).toLowerCase().includes(r));j(l);const c=e.getScrolledVisiblePosition(n),s=e.getDomNode();T(ox(c,s,150)),["keyboard","mouse","deleteLeft"].includes(t?.source||"")&&I(!0)}else I(!1),H.current=null,_.current=null}),e.onMouseDown(()=>{setTimeout(()=>{const e=k.current;if(!e)return;const t=e.getPosition(),n=e.getModel();if(!t||!n)return;const r=n.getLineContent(t.lineNumber),i=t.column-2;"$"===r[i]?(H.current=i,_.current=""):(H.current=null,_.current=null)},0)}),e.onDidChangeCursorSelection(()=>{const t=(e.getSelections?.()||[]).some(e=>e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn);z(t)}),e.onDidChangeModelContent(()=>{const t=e.getValue();u(t);const n=e.getPosition(),r=e.getModel();if(!n||!r)return;const i=r.getLineContent(n.lineNumber),o=n.column-2;if("$"===i[H.current??o]){null===H.current&&(H.current=o),_.current=i.slice(H.current+1,o);const t=R.current.filter(e=>("_startforloop"===e.type&&h?`FLV_for:${e.name}`:e.name).toLowerCase().includes(_.current?.toLowerCase()));t.length?j(t):(j([]),H?.current!==o&&" "===i[o]&&(H.current=null,_.current=null,I(!1)));const r=e.getScrolledVisiblePosition(n),a=e.getDomNode();T(ox(r,a,150))}else H.current=null,_.current=null}),e.onDidPaste(()=>{const t=e.getValue();if(t){const n=B(t,p);e.setValue(n),g&&g(n)}}),t.languages.registerCompletionItemProvider(p,{triggerCharacters:["."],provideCompletionItems:(e,n)=>{const r=e.getValueInRange({startLineNumber:n.lineNumber,startColumn:1,endLineNumber:n.lineNumber,endColumn:n.column}),i=e.getWordAtPosition(n),o=i?new t.Range(n.lineNumber,i.startColumn,n.lineNumber,i.endColumn):new t.Range(n.lineNumber,n.column,n.lineNumber,n.column),a=[];return r.endsWith("ff.")&&a.push({label:"getVariable",kind:t.languages.CompletionItemKind.Method,insertText:"getVariable(${1:variableName})",insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet,detail:"Get a variable value",range:o},{label:"setVariable",kind:t.languages.CompletionItemKind.Method,insertText:"setVariable(${1:variableName}, ${2:value})",insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet,detail:"Set a variable value",range:o},{label:"sendRequest",kind:t.languages.CompletionItemKind.Method,insertText:'sendRequest({\n method: "GET",//add your method\n url: "https://fakestoreapi.com/products",//enter your url\n headers: { },//add your headers,\n params: params,//add your params,\n data: body,//add your request body,\n })',insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet,detail:"Make your http requests",range:o}),{suggestions:a}}})},onChange:(e,t)=>d(e,t),theme:m}),N&&D&&v&&e(aE,{position:"absolute",width:"300px",height:i,optionsList:Z,onSelectVariable:e=>{if(C&&k.current){const t=k.current,n=t.getPosition();if(n){const r=`'${e.name}'`,i=H?.current??0;t.executeEdits("",[{range:{startLineNumber:n.lineNumber,startColumn:i+1,endLineNumber:n.lineNumber,endColumn:i+(n.column-i)},text:r,forceMoveMarkers:!0}]),_.current=null,H.current=null,I(!1)}}else((e,t)=>{if(k.current){const n=k.current,r=n.getPosition();if(r){const i=`{${t}${"FLV_for:"===t?"":"_"}${e}}`,o=H?.current??0;n.executeEdits("",[{range:{startLineNumber:r.lineNumber,startColumn:o+2,endLineNumber:r.lineNumber,endColumn:o+(r.column-o)},text:i,forceMoveMarkers:!1}]);const a=[];a.push({range:{startLineNumber:S,startColumn:1,endLineNumber:S,endColumn:1},options:{isWholeLine:!1}}),L.current=n.deltaDecorations(L.current,a),_.current=null,H.current=null,I(!1)}}})("DATAPROVIDER"===e?.type?e?.dpName+":"+e?.varname:e?.name,"STEPGROUP"===e.parentVariableType?"SGV":"GLOBAL"===e?.type?"GV":"LOCAL"===e?.type?"LV":e?._id?.includes("PARAMETER")?"SGP":"_startforloop"===e?.type?"FLV_for:":"DATAPROVIDER"===e?.type?"DPV":"PEV")},dropdownPosition:D,zIndex:E})]})}),lx=e=>e.flatMap(e=>e.runLevelExecutionDataSets.map((t,n)=>{const{runLevelExecutionDataSets:r,...i}=e;return{...i,...t,runCount:n+1}}));var cx,sx={exports:{}};var dx=(cx||(cx=1,"undefined"!=typeof self&&self,sx.exports=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="lib/",n(n.s=5)}([function(t,n){t.exports=e},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ArcherContainerContextProvider=t.ArcherContainerContext=void 0;var i=r(n(0));t.ArcherContainerContext=i.default.createContext(null),t.ArcherContainerContextProvider=t.ArcherContainerContext.Provider},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.encodeId=void 0,t.encodeId=function(e){return encodeURI(e).replace(/%/g,"_")}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.getMarkerId=t.createShapeObj=t.getSourceToTargets=t.getEndShapeFromStyle=void 0;var r=["arrow","circle"];t.getEndShapeFromStyle=function(e){return e.endShape&&Object.keys(e.endShape).filter(function(e){return r.includes(e)})[0]||r[0]},t.getSourceToTargets=function(e){var t=Object.keys(e).map(function(t){return e[t]});return[].concat.apply([],t).sort(function(e,t){return e.order-t.order})},t.createShapeObj=function(e,n){return{arrow:function(){var t;return{arrow:Object.assign(Object.assign({},null==n?void 0:n.arrow),null===(t=e.endShape)||void 0===t?void 0:t.arrow)}},circle:function(){var t;return{circle:Object.assign(Object.assign({},null==n?void 0:n.circle),null===(t=e.endShape)||void 0===t?void 0:t.circle)}}}[(0,t.getEndShapeFromStyle)(e)]()},t.getMarkerId=function(e,t,n){return"".concat(e).concat(t.id).concat(n.id)}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.endShapeDefaultProp=void 0,t.endShapeDefaultProp={arrow:{arrowLength:10,arrowThickness:6},circle:{radius:2,fillColor:"#f00",strokeColor:"#0ff",strokeWidth:1}}},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ArcherContainer=t.ArcherElement=void 0;var i=n(6);Object.defineProperty(t,"ArcherElement",{enumerable:!0,get:function(){return r(i).default}});var o=n(11);Object.defineProperty(t,"ArcherContainer",{enumerable:!0,get:function(){return r(o).default}})},function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&("get"in i?t.__esModule:!i.writable&&!i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),l=n(7),c=n(1),s=n(2),d=n(8),u=n(10);t.default=function(e){var t=e.id,n=e.relations,r=void 0===n?[]:n,i=e.children,o=(0,a.useMemo)(function(){return(0,s.encodeId)(t)},[t]),f=(0,a.useContext)(c.ArcherContainerContext),h=(0,a.useRef)(),p=(0,a.useCallback)(function(e){var t=(0,u.generateSourceToTarget)(o,e);(0,u.assertContextExists)(f),f.registerTransitions(o,t)},[f,o]),m=(0,a.useCallback)(function(){(0,u.assertContextExists)(f),f.unregisterTransitions(o)},[f,o]),C=(0,a.useCallback)(function(e){e&&((0,u.assertContextExists)(f),f.registerChild(o,e))},[o,f]),g=(0,a.useCallback)(function(){(0,u.assertContextExists)(f),f.unregisterChild(o)},[f,o]);(0,l.useIsomorphicLayoutEffect)(function(){return C(h.current),function(){return g()}},[C,g]),(0,d.useDeepCompareEffect)(function(){return p(r),function(){return m()}},[p,r,m]),a.default.Children.only(i);var v=i;return a.default.cloneElement(v,Object.assign(Object.assign({},v.props),{ref:h}))}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useIsomorphicLayoutEffect=void 0;var r=n(0);t.useIsomorphicLayoutEffect="undefined"!=typeof window?r.useLayoutEffect:r.useEffect},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useDeepCompareEffect=void 0;var i=n(0),o=r(n(9));function a(e){var t=(0,i.useRef)();return(0,o.default)(e,t.current)||(t.current=e),t.current}t.useDeepCompareEffect=function(e,t){(0,i.useEffect)(e,t.map(a))}},function(e,t,n){var r=Array.isArray,i=Object.keys,o=Object.prototype.hasOwnProperty,a="undefined"!=typeof Element;e.exports=function(e,t){try{return function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){var l,c,s,d=r(t),u=r(n);if(d&&u){if((c=t.length)!=n.length)return!1;for(l=c;0!=l--;)if(!e(t[l],n[l]))return!1;return!0}if(d!=u)return!1;var f=t instanceof Date,h=n instanceof Date;if(f!=h)return!1;if(f&&h)return t.getTime()==n.getTime();var p=t instanceof RegExp,m=n instanceof RegExp;if(p!=m)return!1;if(p&&m)return t.toString()==n.toString();var C=i(t);if((c=C.length)!==i(n).length)return!1;for(l=c;0!=l--;)if(!o.call(n,C[l]))return!1;if(a&&t instanceof Element&&n instanceof Element)return t===n;for(l=c;0!=l--;)if(!("_owner"===(s=C[l])&&t.$$typeof||e(t[s],n[s])))return!1;return!0}return t!=t&&n!=n}(e,t)}catch(e){if(e.message&&e.message.match(/stack|recursion/i)||-2146828260===e.number)return console.warn("Warning: react-fast-compare does not handle circular references.",e.name,e.message),!1;throw e}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.generateSourceToTarget=t.assertContextExists=void 0;var r=n(2);t.assertContextExists=function(e){if(!e)throw new Error("Could not find ArcherContainerContext in <ArcherElement>. Please wrap the component in a <ArcherContainer>.")},t.generateSourceToTarget=function(e,t){return t.map(function(t){var n=t.targetId,i=t.sourceAnchor,o=t.targetAnchor,a=t.label,l=t.className,c=t.style,s=t.order,d=void 0===s?0:s,u=t.domAttributes,f=t.cursor,h=t.hitSlop;return{source:{id:(0,r.encodeId)(e),anchor:i},target:{id:(0,r.encodeId)(n),anchor:o},className:l,label:a,style:c,order:d,domAttributes:u,cursor:f,hitSlop:h}})}},function(e,t,n){function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,l=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){l=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(l)throw i}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var a=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&("get"in i?t.__esModule:!i.writable&&!i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),l=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&a(t,e,n);return l(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var d=c(n(0)),u=s(n(12)),f=n(1),h=n(14),p=n(4),m=n(19),C=n(20),g={position:"absolute",width:"100%",height:"100%",top:0,left:0,pointerEvents:"none"},v=d.default.forwardRef(function(e,t){var n=e.endShape,o=void 0===n?p.endShapeDefaultProp:n,a=e.strokeColor,l=void 0===a?"#f00":a,c=e.strokeWidth,s=void 0===c?2:c,v=e.svgContainerStyle,y=void 0===v?{}:v,w=e.noCurves,b=e.children,E=e.className,M=e.endMarker,A=e.lineStyle,x=e.offset,k=e.startMarker,L=e.strokeDasharray,H=e.style,_=i((0,d.useState)({}),2),S=_[0],V=_[1],O=i((0,d.useState)({}),2),z=O[0],N=O[1],I=(0,d.useRef)(new u.default(function(){R()})).current,D=(0,d.useRef)(null),T=i(d.default.useState(),2)[1],Z=(0,d.useRef)("arrow".concat(Math.random().toString().slice(2))).current;(0,d.useImperativeHandle)(t,function(){return{refreshScreen:R,arrowMarkerUniquePrefix:Z}});var j,R=d.default.useCallback(function(){return T({})},[]),B=(0,d.useCallback)(function(e,t){N(function(n){return Object.assign(Object.assign({},n),r({},e,t))})},[]),P=(0,d.useCallback)(function(e){N(function(t){var n=Object.assign({},t);return delete n[e],n})},[]),F=(0,d.useCallback)(function(e,t){V(function(n){return n[e]===t?n:Object.assign(Object.assign({},n),r({},e,t))})},[]),U=(0,d.useCallback)(function(e){V(function(t){var n=Object.assign({},t);return delete n[e],n})},[]),q=(0,d.useMemo)(function(){return Object.assign(Object.assign({},g),y)},[y]);j="function"==typeof b?b(f.ArcherContainerContext):b,(0,C.useResizeListener)(R),(0,C.useObserveElements)(S,I);var W=(0,d.useMemo)(function(){return{registerTransitions:B,unregisterTransitions:P,registerChild:F,unregisterChild:U}},[B,P,F,U]);return d.default.createElement(f.ArcherContainerContextProvider,{value:W},d.default.createElement("div",{style:Object.assign(Object.assign({},H),{position:"relative"}),className:E},d.default.createElement("svg",{style:q},d.default.createElement("defs",null,d.default.createElement(m.ArrowMarkers,{endShape:o,sourceToTargetsMap:z,strokeColor:l,uniqueId:Z})),d.default.createElement(h.SvgArrows,{startMarker:k,endMarker:M,endShape:o,strokeColor:l,strokeWidth:s,strokeDasharray:L,noCurves:w,lineStyle:A,offset:x,parentCurrent:D.current,refs:S,uniqueId:Z,sourceToTargetsMap:z})),d.default.createElement("div",{style:{height:"100%"},ref:D},j)))});t.default=v},function(e,t,n){n.r(t),function(e){var n=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some(function(e,r){return e[0]===t&&(n=r,!0)}),n}return function(){function t(){this.__entries__=[]}var n={size:{configurable:!0}};return n.size.get=function(){return this.__entries__.length},t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n<r.length;n+=1){var i=r[n];e.call(t,i[1],i[0])}},Object.defineProperties(t.prototype,n),t}()}(),r="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,i=void 0!==e&&e.Math===Math?e:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),o="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(i):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)},a=2,l=["top","right","bottom","left","width","height","size","weight"],c="undefined"!=typeof MutationObserver,s=function(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,r=!1,i=0;function l(){n&&(n=!1,e()),r&&s()}function c(){o(l)}function s(){var e=Date.now();if(n){if(e-i<a)return;r=!0}else n=!0,r=!1,setTimeout(c,t);i=e}return s}(this.refresh.bind(this),20)};s.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},s.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},s.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},s.prototype.updateObservers_=function(){var e=this.observers_.filter(function(e){return e.gatherActive(),e.hasActive()});return e.forEach(function(e){return e.broadcastActive()}),e.length>0},s.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),c?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},s.prototype.disconnect_=function(){r&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},s.prototype.onTransitionEnd_=function(e){var t=e.propertyName;void 0===t&&(t=""),l.some(function(e){return!!~t.indexOf(e)})&&this.refresh()},s.getInstance=function(){return this.instance_||(this.instance_=new s),this.instance_},s.instance_=null;var d=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n+=1){var i=r[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},u=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||i},f=v(0,0,0,0);function h(e){return parseFloat(e)||0}function p(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return t.reduce(function(t,n){return t+h(e["border-"+n+"-width"])},0)}function m(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return f;var r=u(e).getComputedStyle(e),i=function(e){for(var t={},n=0,r=["top","right","bottom","left"];n<r.length;n+=1){var i=r[n],o=e["padding-"+i];t[i]=h(o)}return t}(r),o=i.left+i.right,a=i.top+i.bottom,l=h(r.width),c=h(r.height);if("border-box"===r.boxSizing&&(Math.round(l+o)!==t&&(l-=p(r,"left","right")+o),Math.round(c+a)!==n&&(c-=p(r,"top","bottom")+a)),!function(e){return e===u(e).document.documentElement}(e)){var s=Math.round(l+o)-t,d=Math.round(c+a)-n;1!==Math.abs(s)&&(l-=s),1!==Math.abs(d)&&(c-=d)}return v(i.left,i.top,l,c)}var C="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof u(e).SVGGraphicsElement}:function(e){return e instanceof u(e).SVGElement&&"function"==typeof e.getBBox};function g(e){return r?C(e)?function(e){var t=e.getBBox();return v(0,0,t.width,t.height)}(e):m(e):f}function v(e,t,n,r){return{x:e,y:t,width:n,height:r}}var y=function(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=v(0,0,0,0),this.target=e};y.prototype.isActive=function(){var e=g(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},y.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e};var w=function(e,t){var n=function(e){var t=e.x,n=e.y,r=e.width,i=e.height,o="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,a=Object.create(o.prototype);return d(a,{x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:i+n,left:t}),a}(t);d(this,{target:e,contentRect:n})},b=function(e,t,r){if(this.activeObservations_=[],this.observations_=new n,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=r};b.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof u(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new y(e)),this.controller_.addObserver(this),this.controller_.refresh())}},b.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof u(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},b.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},b.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},b.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(e){return new w(e.target,e.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},b.prototype.clearActive=function(){this.activeObservations_.splice(0)},b.prototype.hasActive=function(){return this.activeObservations_.length>0};var E="undefined"!=typeof WeakMap?new WeakMap:new n,M=function(e){if(!(this instanceof M))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=s.getInstance(),n=new b(e,t,this);E.set(this,n)};["observe","unobserve","disconnect"].forEach(function(e){M.prototype[e]=function(){return(t=E.get(this))[e].apply(t,arguments);var t}});var A=void 0!==i.ResizeObserver?i.ResizeObserver:M;t.default=A}.call(this,n(13))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SvgArrows=void 0;var i=r(n(0)),o=n(15),a=r(n(17)),l=n(3),c=function(e){var t,n,r=e.style||{},c=r.startMarker||e.startMarker,s=null===(n=null!==(t=r.endMarker)&&void 0!==t?t:e.endMarker)||void 0===n||n,d=(0,l.createShapeObj)(r,e.endShape),u=e.domAttributes,f=e.cursor,h=e.hitSlop,p=r.strokeColor||e.strokeColor,m=r.strokeWidth||e.strokeWidth,C=r.strokeDasharray||e.strokeDasharray,g=!(!r.noCurves&&!e.noCurves),v=r.lineStyle||e.lineStyle||(g?"angle":"curve"),y=e.offset||0,w=e.source.anchor,b=(0,o.getPointCoordinatesFromAnchorPosition)(e.source.anchor,e.source.id,e.parentCoordinates,e.refs),E=e.target.anchor,M=(0,o.getPointCoordinatesFromAnchorPosition)(e.target.anchor,e.target.id,e.parentCoordinates,e.refs);return b?M?i.default.createElement(a.default,{className:e.className,startingPoint:b,startingAnchorOrientation:w,endingPoint:M,endingAnchorOrientation:E,strokeColor:p,strokeWidth:m,strokeDasharray:C,arrowLabel:e.label,arrowMarkerId:(0,l.getMarkerId)(e.uniqueId,e.source,e.target),lineStyle:v,offset:y,enableStartMarker:!!c,disableEndMarker:!s,endShape:d,domAttributes:u,hitSlop:h,cursor:f}):(console.warn("[React Archer] Could not find target element! Not drawing the arrow."),null):(console.warn("[React Archer] Could not find starting point of element! Not drawing the arrow."),null)};t.SvgArrows=function(e){var t=(0,o.getPointFromElement)(e.parentCurrent);return t?i.default.createElement(i.default.Fragment,null,(0,l.getSourceToTargets)(e.sourceToTargetsMap).map(function(n){return i.default.createElement(c,{key:JSON.stringify({source:n.source,target:n.target}),source:n.source,target:n.target,className:n.className,label:n.label,style:n.style||{},domAttributes:n.domAttributes,hitSlop:n.hitSlop,cursor:n.cursor,startMarker:e.startMarker,endMarker:e.endMarker,endShape:e.endShape,strokeColor:e.strokeColor,strokeWidth:e.strokeWidth,strokeDasharray:e.strokeDasharray,noCurves:e.noCurves,lineStyle:e.lineStyle,offset:e.offset,parentCoordinates:t,refs:e.refs,uniqueId:e.uniqueId})})):null}},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getPointCoordinatesFromAnchorPosition=t.getPointFromElement=void 0;var i=r(n(16));function o(e){return new i.default(e.left,e.top)}var a=function(e){return e?e.getBoundingClientRect():null};t.getPointFromElement=function(e){var t=a(e);return t?o(t):null},t.getPointCoordinatesFromAnchorPosition=function(e,t,n,r){var l=a(r[t]);if(!l)return null;var c=function(e,t){switch(e){case"top":return o(t).add(new i.default(t.width/2,0));case"bottom":return o(t).add(new i.default(t.width/2,t.height));case"left":return o(t).add(new i.default(0,t.height/2));case"right":return o(t).add(new i.default(t.width,t.height/2));case"middle":return o(t).add(new i.default(t.width/2,t.height/2));default:return console.error("[React Archer] Invalid anchor position was provided. Not drawing the arrow."),null}}(e,l);return c?c.substract(n):null}},function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.x=t,this.y=n}return function(e,t){t&&r(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1})}(e,[{key:"add",value:function(t){return new e(this.x+t.x,this.y+t.y)}},{key:"substract",value:function(t){return new e(this.x-t.x,this.y-t.y)}}]),e}();t.default=i},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.computeLabelDimensions=t.computeEndingAnchorPosition=t.computeStartingAnchorPosition=t.computeArrowPointAccordingToArrowHead=void 0;var i=r(n(0)),o=n(18);function a(e,t,n,r,i,a,l,c){var s=(0,o.computeArrowDirectionVector)(i),d=s.arrowX,u=s.arrowY;if("straight"===a&&void 0!==l&&void 0!==c){var f=Math.atan2(c-t,l-e);d=Math.cos(f),u=Math.sin(f)}return{xPoint:e+d*n*r/2,yPoint:t+u*n*r/2}}function l(e,t,n,r,i){return"top"===i||"bottom"===i?{xAnchor1:e,yAnchor1:t+(r-t)/2}:"left"===i||"right"===i?{xAnchor1:e+(n-e)/2,yAnchor1:t}:{xAnchor1:e,yAnchor1:t}}function c(e,t,n,r,i){return"top"===i||"bottom"===i?{xAnchor2:n,yAnchor2:r-(r-t)/2}:"left"===i||"right"===i?{xAnchor2:n-(n-e)/2,yAnchor2:r}:{xAnchor2:n,yAnchor2:r}}function s(e,t,n,r){return{xLabel:n>e?e:n,yLabel:r>t?t:r,labelWidth:Math.max(Math.abs(n-e),1),labelHeight:Math.max(Math.abs(r-t),1)}}t.computeArrowPointAccordingToArrowHead=a,t.computeStartingAnchorPosition=l,t.computeEndingAnchorPosition=c,t.computeLabelDimensions=s,t.default=function(e){var t=e.className,n=e.startingPoint,r=e.startingAnchorOrientation,o=e.endingPoint,d=e.endingAnchorOrientation,u=e.strokeColor,f=e.strokeWidth,h=e.strokeDasharray,p=e.arrowLabel,m=e.arrowMarkerId,C=e.lineStyle,g=e.offset,v=e.enableStartMarker,y=e.disableEndMarker,w=e.endShape,b=e.domAttributes,E=e.hitSlop,M=void 0===E?10:E,A=e.cursor,x=void 0===A?"pointer":A,k=w.circle?2*w.circle.radius:2*w.arrow.arrowLength,L=a(n.x,n.y,v?k:0,f,r,C,o.x,o.y),H=L.xPoint,_=L.yPoint,S=a(o.x,o.y,y?0:k,f,d,C,n.x,n.y),V=S.xPoint,O=S.yPoint,z=l(H,_,V,O,r),N=z.xAnchor1,I=z.yAnchor1,D=c(H,_,V,O,d),T=function(e){var t=e.xStart,n=e.yStart,r=e.xAnchor1,i=e.yAnchor1,o=e.xAnchor2,a=e.yAnchor2,l=e.xEnd,c=e.yEnd,s=e.lineStyle,d=e.offset;if(d&&0!==d){var u="straight"===s?Math.atan2(c-n,l-t):Math.atan2(i-n,r-t),f=d*Math.cos(u),h=d*Math.sin(u);"straight"!==s&&(t+=f,n+=h),l-=f,c-=h}var p="M".concat(t,",").concat(n," ");return["curve","angle"].includes(s)&&(p+="".concat("curve"===s?"C":"").concat(r,",").concat(i," ").concat(o,",").concat(a," ")),p+"".concat(l,",").concat(c)}({xStart:H,yStart:_,xAnchor1:N,yAnchor1:I,xAnchor2:D.xAnchor2,yAnchor2:D.yAnchor2,xEnd:V,yEnd:O,lineStyle:C,offset:g}),Z=s(H,_,V,O),j=Z.xLabel,R=Z.yLabel,B=Z.labelWidth,P=Z.labelHeight,F="url(#".concat(m,")");return i.default.createElement("g",{className:t},i.default.createElement("path",{d:T,style:{fill:"none",stroke:u,strokeWidth:f,strokeDasharray:h},markerStart:v?F:void 0,markerEnd:y?void 0:F}),b&&i.default.createElement("path",Object.assign({d:T,style:{fill:"none",stroke:"rgba(0, 0, 0, 0)",strokeWidth:M,cursor:b?x:"initial",pointerEvents:"all"}},b)),p&&i.default.createElement("foreignObject",{x:j,y:R,width:B,height:P,style:{overflow:"visible",pointerEvents:"none"}},i.default.createElement("div",{style:{position:"absolute",left:"50%",top:"50%",transform:"translateX(-50%) translateY(-50%)",pointerEvents:"all"}},i.default.createElement("div",null,p))))}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.computeArrowDirectionVector=void 0,t.computeArrowDirectionVector=function(e){switch(e){case"left":return{arrowX:-1,arrowY:0};case"right":return{arrowX:1,arrowY:0};case"top":return{arrowX:0,arrowY:-1};case"bottom":return{arrowX:0,arrowY:1};default:return{arrowX:0,arrowY:0}}}},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ArrowMarkers=void 0;var i=r(n(0)),o=n(4),a=n(3),l=function(e,t){return function(){var n,r,a,l,c,s,d,u,f,h,p,m,C=(null===(r=null===(n=e.endShape)||void 0===n?void 0:n.circle)||void 0===r?void 0:r.radius)||(null===(a=t.circle)||void 0===a?void 0:a.radius)||o.endShapeDefaultProp.circle.radius,g=(null===(c=null===(l=e.endShape)||void 0===l?void 0:l.circle)||void 0===c?void 0:c.strokeWidth)||(null===(s=t.circle)||void 0===s?void 0:s.strokeWidth)||o.endShapeDefaultProp.circle.strokeWidth,v=(null===(u=null===(d=e.endShape)||void 0===d?void 0:d.circle)||void 0===u?void 0:u.strokeColor)||(null===(f=t.circle)||void 0===f?void 0:f.strokeColor)||o.endShapeDefaultProp.circle.strokeColor,y=(null===(p=null===(h=e.endShape)||void 0===h?void 0:h.circle)||void 0===p?void 0:p.fillColor)||(null===(m=t.circle)||void 0===m?void 0:m.fillColor)||o.endShapeDefaultProp.circle.fillColor;return{markerWidth:4*C,markerHeight:4*C,refX:2*C+g,refY:2*C,path:i.default.createElement("circle",{cx:2*C,cy:2*C,r:C,fill:y,stroke:v,strokeWidth:g})}}},c=function(e,t,n){return function(){var r,a,l,c,s,d,u,f,h=e.strokeColor||n,p=null!==(s=null!==(l=null===(a=null===(r=e.endShape)||void 0===r?void 0:r.arrow)||void 0===a?void 0:a.arrowLength)&&void 0!==l?l:null===(c=null==t?void 0:t.arrow)||void 0===c?void 0:c.arrowLength)&&void 0!==s?s:o.endShapeDefaultProp.arrow.arrowLength,m=(null===(u=null===(d=e.endShape)||void 0===d?void 0:d.arrow)||void 0===u?void 0:u.arrowThickness)||(null===(f=null==t?void 0:t.arrow)||void 0===f?void 0:f.arrowThickness)||o.endShapeDefaultProp.arrow.arrowThickness,C="M0,0 L0,".concat(m," L").concat(p,",").concat(m/2," z");return{markerWidth:p,markerHeight:m,refX:0,refY:m/2,path:i.default.createElement("path",{d:C,fill:h})}}};t.ArrowMarkers=function(e){var t=e.sourceToTargetsMap,n=e.endShape,r=e.strokeColor,o=e.uniqueId;return i.default.createElement(i.default.Fragment,null,(0,a.getSourceToTargets)(t).map(function(e){var t=e.source,s=e.target,d=e.style,u=function(e){var t=e.style,n=e.strokeColor,r=e.endShape,i=(0,a.getEndShapeFromStyle)(t);return{circle:l(t,r),arrow:c(t,r,n)}[i]()}({style:void 0===d?{}:d,endShape:n,strokeColor:r}),f=u.markerHeight,h=u.markerWidth,p=u.path,m=u.refX,C=u.refY;return i.default.createElement("marker",{id:(0,a.getMarkerId)(o,t,s),key:(0,a.getMarkerId)(o,t,s),markerWidth:h,markerHeight:f,refX:m,refY:C,orient:"auto-start-reverse",markerUnits:"strokeWidth"},p)}))}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useResizeListener=t.useObserveElements=void 0;var r=n(0);t.useObserveElements=function(e,t){(0,r.useEffect)(function(){return Object.keys(e).map(function(n){t.observe(e[n])}),function(){Object.keys(e).map(function(n){t.unobserve(e[n])})}},[e,t])},t.useResizeListener=function(e){(0,r.useEffect)(function(){return window&&window.addEventListener("resize",e),function(){window&&window.removeEventListener("resize",e)}},[e])}}])}(i)),sx.exports);const ux=({getChildNodeComponent:r,parentNodeIndex:i,parentNodeData:o,verticalLineHeight:a,datasetHeight:l,curveHeights:c,itemRefs:s,datasetRef:d,isReadOnlyMode:u})=>e(t,{children:0===o?.machineInstances?.length?e(t,{children:!u&&n(t,{children:[e("div",{className:"ff-selectedMachines-connecting-line",children:n("div",{className:"ff-line",children:[e("div",{className:"ff-left-icon ff-left-icon-aligned"}),e("div",{className:"ff-right-icon"})]})}),e("div",{className:"ff-machine-instance ff-machine-env-button",children:r({isButton:!0,parentNodeData:o,parentNodeIndex:i})})]})}):o?.machineInstances?.map((f,h)=>{const p=0===h;return n("div",{className:"ff-machine-instance-row",children:[n("div",{className:"ff-selectedMachines-connecting-line "+(p?"":"ff-second-line"),children:[n("div",{className:"ff-line",children:[e("div",{className:"ff-left-icon "+(p?"ff-left-icon-aligned":"")}),e("div",{className:"ff-right-icon"})]}),p&&e("div",{className:"ff-vertical-line",style:{height:`${a}px`}})]}),e("div",{className:"ff-machine-instance",children:f?.runLevelExecutionDataSets?.map((a,u)=>e("div",{className:"ff-run-level-execution-dataset",ref:0===u?d:null,children:n("div",{className:"ff-execution-item",ref:e=>s.current[u]=e,children:[e("div",{className:"ff-curved-connector",style:{top:-l+"px"},children:n("div",{className:`ff-curve ff-connector-${u}`,style:{height:`${c[u]}px`},children:[e("div",{className:`ff-curve-right-icon ff-curve-right-icon-${u}`}),Number(f?.runScriptCount)?e("div",{className:"ff-selectedMachines-connecting-line-text",children:e(F,{fontSize:8,fontWeight:"regular",children:`${[0,"0",null].includes(f.runScriptCount)?"":f.runScriptCount} Script${1!==f.runScriptCount?"s":""}`})}):e(t,{})]})}),e("div",{className:"ff-run-data-box",children:r({isButton:!1,childNodeData:f,childNodeIndex:h,runLevelExecutionDataSet:a,runLevelExecutionDataSetIndex:u,parentNodeData:o,parentNodeIndex:i})})]})},a?.runLevelExecutionDataSetId))}),h===o?.machineInstances.length-1&&e(t,{children:!u&&n(t,{children:[e("div",{className:"ff-selectedMachines-connecting-line ff-second-line",children:n("div",{className:"ff-line",children:[e("div",{className:"ff-left-icon"}),e("div",{className:"ff-right-icon"})]})}),e("div",{className:"ff-machine-instance ff-machine-env-button",children:r({isButton:!0,parentNodeData:o,parentNodeIndex:i,childNodeIndex:h+1})})]})})]},h)})}),fx=({data:t,noOfScripts:r,getChildNodeComponent:o,getParentNodeComponent:c,getParentNodeComponentActionItems:d,childNodeCurveHeight:u=1.28,isReadOnlyMode:f=!1})=>{const h=a(null),[p,m]=s(0),[C,g]=s([]),v=a([]);l(()=>{h.current&&m(h.current.offsetHeight)},[t]);l(()=>{(()=>{const e=v.current.map((e,t)=>0===t?0:p*u);g(e)})()},[p,t]);const y=e=>1+(e.machineInstances?.length+1||0);let w=1;const b=t?.machines?.selectedMachines.reduce((e,t)=>f?e+(e=>!e?.machineInstances||G(e.machineInstances)?1:e.machineInstances.length)(t):e+y(t),0),E=Math.round(b/2);let M=1===E&&f&&2===b||1===E&&!f&&2===b;return e("div",{className:"connecting-branch-container",children:e(dx.ArcherContainer,{strokeColor:"var(--brand-color)",strokeWidth:1,startMarker:!0,endMarker:!1,noCurves:!0,children:n("div",{className:"ff-connecting-branch-grid-container",children:[e(dx.ArcherElement,{id:"rootNode",children:e("div",{className:"ff-grid-item ff-dynamic-item",style:{gridRow:E,top:M?"44px":""},children:e("div",{className:"ff-script-count-container",children:n("div",{className:"ff-script-count-box",children:[e(F,{children:r}),e(F,{children:"Scripts"})]})})})}),t?.machines?.selectedMachines.map((t,r)=>{const a=w,l=y(t);w+=l;const s=((e,t,n)=>{if(1===e.length&&f)return 0;const r=e.reduce((t,n,r)=>t+(r===e.length-1&&f?0:n.runLevelExecutionDataSets?.length||0),0);return r*(t+n)})(t?.machineInstances,p,16);return e(i.Fragment,{children:n("div",{className:"ff-selectedMachines",style:{gridRow:`${a} / span ${l}`},children:[e("div",{className:"ff-selectedMachines-input",children:n("div",{className:"ff-input-box-container "+(t?.machineInstances.length?"":"ff-input-box-aligned"),children:[e(dx.ArcherElement,{id:`parentnode${r}`,relations:[{targetId:"rootNode",targetAnchor:"left",sourceAnchor:"left"}],children:c({isMultiSelect:!1,parentNodeData:t,parentNodeIndex:r})}),d({parentNodeData:t,parentNodeIndex:r})]})}),e(ux,{parentNodeIndex:r,parentNodeData:t,verticalLineHeight:s,datasetHeight:p,curveHeights:C,itemRefs:v,datasetRef:h,getChildNodeComponent:o,isReadOnlyMode:f})]})},r)}),!f&&e("div",{className:"ff-select-machine-input",style:{gridRow:`${w}`},children:e(dx.ArcherElement,{id:"lastNode",relations:[{targetId:"rootNode",targetAnchor:"left",sourceAnchor:"left"}],children:e("div",{children:c({isMultiSelect:!0})})})})]})})})},hx=(e,t)=>{if(!(e&&e instanceof Blob))throw console.error("Invalid Blob object"),new Error("Invalid Blob object");const n=window.navigator;if(n.msSaveOrOpenBlob){const r=n.msSaveOrOpenBlob;r&&r(e,t)}else{const n=document.createElement("a");document.body.appendChild(n);const r=window.URL.createObjectURL(e);n.href=r,n.download=t,n.click(),setTimeout(()=>{window.URL.revokeObjectURL(r),document.body.removeChild(n)},0)}},px=({hasAtSymbol:t,usersObj:n,optionClicked:r,charsAfterAt:i,mentionUserRef:o})=>{const[c,d]=s(0),u=a([]);if(!t)return null;const f=n.filter(e=>!i||e.name.toLowerCase().startsWith(i.toLowerCase()));l(()=>{d(0)},[i]);const h=p(e=>{if(t&&0!==f.length)switch(e.key){case"ArrowDown":e.preventDefault(),d(e=>(e+1)%f.length);break;case"ArrowUp":e.preventDefault(),d(e=>0===e?f.length-1:e-1);break;case"Enter":e.preventDefault();const t=f[c];t&&r(t.name,t.emailId)}},[f,c,t,r]);return l(()=>{u.current[c]&&u.current[c]?.scrollIntoView({behavior:"smooth",block:"nearest"})},[c]),l(()=>(document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)),[h]),e("div",{className:"select-section",onMouseDown:e=>e.preventDefault(),children:e("div",{className:"select-group",ref:o,children:f.length?f.map((t,n)=>e("div",{ref:e=>u.current[n]=e,className:"mention-option "+(n===c?"hovered":""),onClick:()=>r(t.name,t.emailId),onMouseDown:e=>e.preventDefault(),children:e(F,{children:t.name})},t.id)):e("div",{className:"user-not-found",children:e(F,{children:"No user name found"})})})})},mx=e=>e&&Array.isArray(e)?e.map(({user:e})=>({id:e.id,name:e.name,emailId:e.emailId})):[],Cx=(e,t)=>{const n=t.find(t=>`@${t.name.replace(/\s+/g,"")}`===e);return n?n.emailId:null},gx=({handleInsertNode:t,handleEditNode:r,handleDeleteNode:i,comment:o,depth:c=0,isDisable:d,userDetails:u,isEditDeleteActionAllowed:h=!0,createdByID:p,rowBreakCharCount:m=83,isVewMode:C=!1,deleteEnable:g=!0})=>{const[v,y]=s(""),[w,b]=s(!1),[E,M]=s(!1),[A,x]=s(!0),[k,L]=s([]),[H,_]=s(!1),[S,V]=s([]),[O,z]=s({top:0,left:0}),[N,I]=s(""),D=a(null),T=a(null),Z=a(null);l(()=>{w&&o?.description&&y(o?.description)},[w,o.description]),l(()=>{const e=mx(u);L(e)},[u]),l(()=>{const e=(v.match(Lt)||[]).map(e=>Cx(e,k)).filter(Boolean);V(e)},[v]),l(()=>{const e=e=>{const t=T.current&&!T.current.contains(e.target)&&D.current&&!D.current.contains(e.target),n=Z.current&&!Z.current.contains(e.target)&&D.current&&!D.current.contains(e.target);(t||n)&&(_(!1),y(e=>e.replace(/(?:^|\s)(@\w*)$/,"")))};return H&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[H]);const{modifiedByUname:j,createdByUname:R,modifiedOn:B,createdOn:U}=o||{},q=B??U??(new Date).toLocaleString(),W=j??R??"Anonymous",Q=c>2,G=W?W.charAt(0).toUpperCase():"A";l(()=>{w&&o.description&&y(o.description)},[w,o.description]);const Y=()=>{0!==v.trim().length&&(w?(r(o.id,v,S),M(!1),y("")):(x(!0),t(o.id,v,S),M(!1),y("")),w&&b(!1))};l(()=>{(()=>{if(!D.current)return;const e=D?.current,t=w?T?.current:Z?.current,n=D.current.selectionStart,r=((e,t)=>{const n=document.createElement("div"),r=getComputedStyle(e);n.style.cssText=`\n position: absolute;\n visibility: hidden;\n white-space: pre-wrap;\n word-wrap: break-word;\n overflow: auto;\n width: ${e.offsetWidth}px;\n height: ${e.offsetHeight}px;\n font-family: ${r.fontFamily};\n font-size: ${r.fontSize};\n padding: ${r.padding};\n border: ${r.border};\n box-sizing: ${r.boxSizing};\n line-height: ${r.lineHeight};\n `,n.scrollTop=e.scrollTop,n.scrollLeft=e.scrollLeft,document.body.appendChild(n);const i=e.value.slice(0,t);n.textContent=i||".";const o=document.createElement("span");o.textContent=".",n.appendChild(o);const a=o.getBoundingClientRect();return document.body.removeChild(n),{top:a.top-20,left:a.left}})(e,n),i=t?.getBoundingClientRect().height??0,o=e?.getBoundingClientRect();if(!o)return;const a=window.innerHeight-o.bottom,l=o.top;z({top:a<i&&l>i?n-i-16:n+32,left:r.left+10})})()},[v]);const X=e=>{const t=e.target.value;y(t);const n=(t.match(/@\S+/g)||[]).map(e=>Cx(e,k)).filter(e=>null!==e);V(n);const r=e.target.selectionStart,i=t.slice(0,r),o=i.match(Nt);I(o?.[1]||"");const a=zt.test(i);_(!!a)},J=e=>{if("@"===e.key)_(!0);else if("Backspace"===e.key&&D.current){const t=D.current.selectionStart,n=v.slice(0,t);n.endsWith("@")&&_(!1);const r=n.match(St);if(r){e.preventDefault();const i=r[1],o=n.lastIndexOf(i||""),a=v.slice(0,o)+v.slice(t);y(a),_(!1),V(()=>(a.match(/@\w+/g)||[]).map(e=>e.slice(1)).map(e=>Cx(e,k)).filter(Boolean)),setTimeout(()=>{D.current?.setSelectionRange(o,o)},0)}}},$=e=>{if(!D.current)return;const t=D.current.selectionStart,n=v.slice(0,t),r=n.match(Ht);if(r){const i=n.lastIndexOf(r[1]||""),o=v.slice(t),a=`@${e.replace(/\s+/g,"")} `,l=v.slice(0,i)+a+o;y(l),_(!1),setTimeout(()=>{D.current?.focus(),D.current?.setSelectionRange(i+a.length+1,i+a.length+1)},0),V(()=>(l.match(/@\w+/g)||[]).map(e=>e.slice(1)).map(e=>Cx(e,k)).filter(Boolean))}};return e("div",{className:"commentsContainer",children:n("div",{className:"comment-wrapper",children:[n("div",{className:"commentContainer",children:[e("div",{className:"commentContainer__avatar",children:o?.profileImage?e("img",{height:30,width:30,src:`data:image/jpeg;base64,${o?.profileImage}`}):G}),n("div",{className:"ff-message-container",children:[n("div",{className:"ff-message",children:[e("div",{className:"ff-message-name",children:W}),e("div",{className:"ff-message-time",children:q})]}),n("div",{className:"ff-editable-container",children:[!w&&e(F,{className:"typography-text",children:o?.description?.split(It).map((t,n)=>t.startsWith("@")?e("b",{children:t},`highlight-${n}`):e(f,{children:t},`text-${n}`))}),w&&n("div",{className:"inputContainer",children:[e("textarea",{rows:v.length<m?1:3,className:"inputContainer_input first_input",value:v,autoFocus:!0,placeholder:"Edit comment",ref:D,onChange:e=>X(e),onKeyDown:J}),H&&e("div",{id:"mention-user",style:{position:"absolute",top:`${O.top}px`,left:`${O.left}px`},children:e(px,{hasAtSymbol:H,usersObj:k,optionClicked:$,charsAfterAt:N,mentionUserRef:T})}),n("div",{className:"edit-comment",children:[e("div",{className:"reply",children:e(K,{title:w?"Update":"Add",children:e(P,{name:"comment_reply",hoverEffect:!0,disabled:w&&v.trim()===(o?.description?.trim()??"")||0===v.trim().length,onClick:()=>{Y(),b(!1),M(!1)}})})}),e("div",{className:"reply",onClick:()=>{b(!1),M(!1),y("")},children:e(K,{title:w?"Cancel":"Close",children:e(P,{name:"close",color:"var(--ff-delete-button-attachment)",hoverEffect:!0})})})]})]}),n("div",{className:"comment-actions",children:[!Q&&c<2&&o.comments?.length>0&&e("div",{className:"action-icon",onClick:()=>x(e=>!e),children:e(K,{title:""+(A?"collapse":"expand"),children:e(P,{name:A?"collapse-arrow":"expand-arrow",disabled:w||E,hoverEffect:!0})})}),!Q&&c<2&&0===o.comments?.length&&e("div",{className:"action-icon",children:e(P,{name:"expand-arrow",disabled:!0})}),!C&&n("div",{className:"ff-comment-action-item",children:[c<2&&e("div",{className:"action-icon",children:e(K,{title:"Reply",children:e(P,{name:"comment_icon",disabled:w||d,hoverEffect:!0,onClick:()=>{M(!0)}})})}),h&&e("div",{className:"action-icon",children:e(K,{title:"Edit",children:e(P,{name:"edit",disabled:E||d,hoverEffect:!0,onClick:()=>b(!0)})})}),h&&g&&e("div",{className:"action-icon",children:e(K,{title:"Delete",children:e(P,{name:"delete",color:"var(--ff-delete-button-attachment)",onClick:()=>{E||i(o.id)},disabled:w||E||d,hoverEffect:!0})})})]})]})]})]})]}),e("div",{className:"comment-reply-container",children:E&&n("div",{className:"inputContainer",children:[e("textarea",{rows:v.length<m?1:3,className:"inputContainer_input first_input",value:v,autoFocus:!0,placeholder:"Add reply comments",ref:D,onChange:e=>X(e),onKeyDown:J}),H&&e("div",{id:"mention-user",style:{position:"absolute",top:`${O.top}px`,left:`${O.left}px`},children:e(px,{hasAtSymbol:H,usersObj:k,optionClicked:$,charsAfterAt:N,mentionUserRef:Z})}),n("div",{className:"edit-comment",children:[e("div",{className:"reply",onClick:()=>{Y(),b(!1),M(!1)},children:e(K,{title:"Reply",children:e(P,{name:"comment_reply",hoverEffect:!0,disabled:Boolean(!v.length)})})}),e("div",{className:"reply",onClick:()=>{b(!1),M(!1),y("")},children:e(K,{title:"Cancel",children:e(P,{name:"close",color:"var(--ff-delete-button-attachment)",hoverEffect:!0})})})]})]})}),A&&o.comments?.length>0&&e("div",{className:`child-comments ${0===c?"first-level-child":""} ${1===c?"second-level-child":""}`,children:o.comments.map(n=>e("div",{className:`child-comments child-comments-${c+1}`,children:e(gx,{handleInsertNode:t,handleEditNode:r,handleDeleteNode:i,comment:n,depth:c+1,isDisable:d,userDetails:u,isEditDeleteActionAllowed:o.createdBy===p,createdByID:p,isVewMode:C})},n.id))})]})})},vx=({commentsData:t,handleAddComment:r,handleEditComment:i,handleDeleteComment:o,onCommentsDataChange:c,currentUser:d,isDisable:u=!1,userDetails:f,createdByID:h,rowBreakCharCount:m=83,isVewMode:C=!1,deleteEnable:g=!0,showTextarea:v=!1,autoFocus:y=!1})=>{const[w,b]=s(""),[E,M]=s([]),[A,x]=s(!1),[k,L]=s([]),[H,_]=s({top:0,left:0}),[S,V]=s(""),O=a(null),z=a(null),[N,I]=s(!1);l(()=>{const e=mx(f);L(e)},[f]);const D=(e,t)=>{for(const n of e){if(n.id===t)return n;const e=D(n.comments,t);if(e)return e}return null};l(()=>{t&&M(t)},[t]),l(()=>{const e=e=>{z.current&&!z.current.contains(e.target)&&(x(!1),b(e=>{const t=e.split(" ");return t.length>0&&t?.[t?.length-1]?.startsWith("@")?t.slice(0,-1).join(" "):e}))};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const{insertNode:T,editNode:Z,deleteNode:j}=(()=>{const e=(t,n,r)=>t.map(t=>t.id===n?{...t,comments:[...t.comments,{id:Cp(),description:r.description,comments:[],createdBy:t.createdBy,modifiedBy:t.modifiedBy,createdByUname:t.createdByUname,modifiedByUname:t.modifiedByUname,createdOn:(new Date).toLocaleString(),modifiedOn:(new Date).toLocaleString(),commentParentId:n}]}:{...t,comments:e(t.comments,n,r)}),t=(e,n,r)=>e.map(e=>({...e,description:e.id===n?r:e.description,comments:t(e.comments,n,r)})),n=(e,t)=>e.filter(e=>e.id!==t).map(e=>({...e,comments:n(e.comments,t)}));return{insertNode:e,editNode:t,deleteNode:n}})(),R=(e,t,n)=>{if(!t.trim())return;const i={id:Cp(),description:t,commentParentId:e,emailId:n,comments:[],createdBy:d?.createdBy,modifiedBy:d?.modifiedBy,createdByUname:d?.createdByUname,modifiedByUname:d?.modifiedByUname,createdOn:(new Date).toISOString(),modifiedOn:(new Date).toISOString()};M(t=>T(t,e,i)),r&&r(i,D(E,e))},B=p((e,t,n)=>{const r=Z(E,e,t);M(r);const o=D(r,e);i&&i(e,t,o,n)},[E,Z,i]),U=p(async e=>{try{if(o){const t=await o(e);if(t?.success){const t=j(E,e);M(t)}}}catch(e){console.error("Error deleting comment:",e)}},[j,o]);l(()=>{c&&c(E)},[E,c]);l(()=>{(()=>{if(!O.current)return;const e=O?.current,t=z?.current,n=O.current.selectionStart,r=((e,t)=>{const n=document.createElement("div"),r=getComputedStyle(e);n.style.cssText=`\n position: absolute;\n visibility: hidden;\n white-space: pre-wrap;\n word-wrap: break-word;\n overflow: auto;\n width: ${e.offsetWidth}px;\n height: ${e.offsetHeight}px;\n font-family: ${r.fontFamily};\n font-size: ${r.fontSize};\n padding: ${r.padding};\n border: ${r.border};\n box-sizing: ${r.boxSizing};\n line-height: ${r.lineHeight};\n `,n.scrollTop=e.scrollTop,n.scrollLeft=e.scrollLeft,document.body.appendChild(n);const i=e.value.slice(0,t);n.textContent=i||".";const o=document.createElement("span");o.textContent=".",n.appendChild(o);const a=o.getBoundingClientRect();return document.body.removeChild(n),{top:a.top,left:a.left}})(e,n),i=t?.getBoundingClientRect().height??0,o=e?.getBoundingClientRect();if(!o)return;const a=window.innerHeight-o.bottom,l=o.top;_({top:a<i&&l>i?n-i-16:n+32,left:r.left+10})})()},[w]);l(()=>{w.includes("\n")||I(!1)},[w]);return n("div",{className:"ff-comments-container-box",children:[!C&&n("div",{className:"ff-first-comment "+(v?"no-border":""),children:[e(F,{fontWeight:"semi-bold",className:"ff-comment-heading",children:"Comments"}),!v&&n("div",{className:"input-wrapper",children:[e("textarea",{className:"inputContainer_input first_input",rows:N?3:w.length<m?1:3,autoFocus:y,value:w,onChange:e=>(e=>{const t=e.target.value;b(t);const n=e.target.selectionStart,r=t.slice(0,n),i=r.match(Nt);V(i?.[1]||"");const o=zt.test(r);x(!!o),t||I(!1)})(e),placeholder:"Add a comment",disabled:u,ref:O,onKeyDown:e=>{if("@"===e.key)x(!0);else if("Backspace"===e.key&&O.current){const t=O.current.selectionStart;if(w.slice(0,t).endsWith("@")&&x(!1),A){e.preventDefault();const n=w.slice(0,t-1)+w.slice(t);b(n);const r=t-1,i=n.slice(0,r).match(Nt);V(i?.[1]||""),x(!!i),setTimeout(()=>{O.current?.setSelectionRange(r,r)},0)}}"Enter"===e.key&&I(!0)}}),A&&e("div",{id:"mention-user",style:{position:"absolute",top:`${H.top}px`,left:`${H.left}px`},children:e(px,{hasAtSymbol:A,usersObj:k,optionClicked:e=>{if(!O.current)return;const t=O.current.selectionStart,n=w.slice(0,t),r=n.match(_t);if(r){const i=n.lastIndexOf(r[1]??""),o=w.slice(t),a=`@${e} `,l=w.slice(0,i)+a+o;b(l),x(!1),setTimeout(()=>{O.current?.focus();const e=i+a.length+1;O.current?.setSelectionRange(e,e)},0)}},charsAfterAt:S,mentionUserRef:z})}),e("span",{className:"reply-comment",children:e(K,{title:"Add",children:e(P,{name:"comment_reply",onClick:()=>{if(!w.trim())return;const e=k.filter(e=>new RegExp(`@${e.name}\\b`,"i").test(w)).map(e=>e.emailId),t={id:Cp(),description:w,comments:[],createdBy:d?.createdBy,modifiedBy:d?.modifiedBy,createdByUname:d?.createdByUname,modifiedByUname:d?.modifiedByUname,createdOn:(new Date).toISOString(),modifiedOn:(new Date).toISOString(),commentParentId:"",emailId:e};r&&r(t,null),M(e=>[...e,t]),b("")},hoverEffect:!0,disabled:Boolean(!w.length)})})})]})]}),E.length>0&&E.map(t=>e(gx,{handleInsertNode:R,handleEditNode:B,handleDeleteNode:U,comment:t,depth:0,isDisable:u,userDetails:f,isEditDeleteActionAllowed:t.createdBy===h,createdByID:h,isVewMode:C,deleteEnable:g},t.id))]})},yx=()=>{const e=a(!0);return{canTrigger:()=>e.current,setTriggered:()=>{e.current=!1},resetTrigger:()=>{e.current=!0}}},wx=({isOpen:t,onClose:r,onContinue:i,titleMessage:o="Warning!",subTitleMessage:a="Unsaved Changes.",iconName:l,modalMessage:c="Your web service data will be lost. Are you sure you want to exit?",firstButtonLabel:s="Cancel",secondButtonLabel:d="Continue",buttonVariant:u="warning",border:f="1px solid var(--warning-modal-border-color)",popupWidth:h="420",popupHeight:p="226",colorForTitleMessage:m="var(--status-button-bg-warning)",footerContent:C,firstButtonDisabled:g=!1,secondButtonDisabled:v=!1,zIndex:y=1100,iconSize:w=94})=>e(Xf,{overlayClassName:"custom-overlay",isOpen:t,onClose:r,isHeaderDisplayed:!1,zIndex:y,children:n("div",{className:"warning_modal_container",children:[n("div",{className:"warning_modal_content",children:[e(P,{name:l,className:"warning_modal_icon",width:w,height:w}),n("div",{className:"warning_modal_message",children:[n(F,{fontSize:20,fontWeight:"semi-bold",className:"warning_modal_title_wrapper",children:[" ",n(F,{color:`${m}`,fontSize:20,fontWeight:"semi-bold",children:[" ",o," "]})," ",a]}),n("div",{className:"warning_modal_message_wrapper",children:[e(F,{fontSize:16,children:c}),e(F,{as:"div",children:C})]})]})]}),n("div",{className:"warning_modal_footer_button",children:[e(U,{buttonHeight:"24px",variant:"secondary",label:s,onClick:r,disabled:g}),d&&e(U,{buttonHeight:"24px",variant:u||"warning",label:d,onClick:i,disabled:v})]})]}),ariaHideApp:!0,isFooterDisplayed:!1,customWidth:`${h}px`,customHeight:`${p}px`,boxShadow:"0px 1px 4px 0px var(--toaster-boxshadow)",border:f});function bx(e,t=[]){return t.reduce((e,t)=>e.replace(new RegExp(function(e){return e.replace(Ct,"\\$&")}(t),"gi"),""),e).replace(/([A-Z])/g," $1").trim().replace(/^./,e=>e.toUpperCase())}function Ex(e,t=[]){return e.toUpperCase()===e&&(e=e.toLowerCase()),e.includes("_")?function(e){return e.toLowerCase().replace(/_/g," ").replace(/^./,e=>e.toUpperCase())}(e):bx(e,t)}const Mx=({onSelectVariable:t,dropdownPosition:r,filteredOptions:i=[],position:o="relative",width:a="300px",zIndex:l=1e3,height:c="160px",truncateTextValue:s=34,isTruncateText:d=!1})=>n("div",{className:z("ff-variable-dropdown",o),style:r?{top:r.top+30,left:r.left-30,width:a,zIndex:l}:{width:a,zIndex:l,height:c},children:[i?.map(n=>{const r=d?ie(n?.name,s,"pixel"):n?.name,i=!!d&&oe(n?.name,s,"pixel");return e("div",{className:"ff-variable-option",onClick:()=>t(n),children:d?e(K,{title:i?n?.name:"",children:e(F,{children:r})}):e(F,{children:r})},n?.id)}),0===i?.length&&e("div",{className:"ff-variable-option .ff-variable-option-no-data ",children:e(F,{as:"span",fontSize:14,children:"No Option"})})]}),Ax=o(({label:t="",hashInputValue:r="",setHashInputValue:i,variableList:o=[],addForloopPrefix:c=!1,placeholder:d="Enter text",onChange:u,onCreateVariableClick:f,value:h="",dropdownWidth:p="inherit",isHash:m=!1,dataFiles:C=[],showAddVariableIcon:g=!0,helperText:v="",error:y,autoComplete:w="off",showHidePasswordIcon:E=!0,required:M=!1,formProps:A={},onlyDropdown:x=!1,type:k,onFocus:L,onBlur:H,readOnly:_=!1,height:S="160px",truncateTextValue:V=34,isTruncateText:O=!1,...z},N)=>{const[I,D]=s(!1),[T,Z]=s(!1),[j,R]=s(!1),[B,U]=s(null),[q,W]=s(0),[Q,Y]=s(!1),[X,J]=s(!1),[$,ee]=s([]),te=a(null);b(N,()=>te.current),l(()=>{null!==B&&te.current&&(te.current.setSelectionRange(B,B),te.current.focus())},[B]),l(()=>{if(m?D(h.startsWith("#")):J(!h?.includes("$")),h.startsWith("#")&&m){const e=h.slice(1).toLowerCase(),t=C.filter(t=>t.name.toLowerCase().includes(e));ee(t),D(!0)}},[h]),l(()=>{if(!Q&&x){const e=C.filter(e=>e.toLowerCase().includes(h.toLowerCase())).map((e,t)=>({id:t+1,name:e}));ee(e),D(e.length>0)}Y(!1)},[h]);const ne=()=>{te.current&&W(te.current.selectionStart||0)},re=ne,ie=ne;l(()=>{te.current&&W(te.current.selectionStart||0)},[h]);const oe=e=>{if(te.current){const{selectionStart:t,selectionEnd:n}=te.current,r=`{${"STEPGROUP"===e.parentVariableType?"SGV":"LOCAL"===e.type?"LV":"GLOBAL"===e.type?"GV":"GROUP"===e.type?"SGV":e?._id?.includes("PARAMETER")?"SGP":"_startforloop"===e.type?"FLV_for:":"DATAPROVIDER"===e.type?"DPV":"PEV"}${"_startforloop"===e?.type?"":"_"}${"DATAPROVIDER"===e?.type?e?.dpName+":"+e?.varname:e.name}}`;let o;if(o=m&&"#"===h[0]||x?e.name+h.slice(n||1):h.slice(0,function(e,t){const n=e.lastIndexOf("$",t-1),r=e.indexOf("$",t);return-1===n&&-1===r?-1:-1===n?r:-1===r||Math.abs(t-n)<=Math.abs(r-t)?n:r}(h,q)||0)+"$"+r+h.slice(n||0),u){u({target:{value:o}},e)}te.current.value=o,i?.(e),U((t||0)+r.length),D(!1),Y(!0),Z(!0)}};const ae=function(e,t,n){let r=!1,i="";const o="}"===h[t-1];if(t<0||t>e.length)return{showDropdown:r,searchString:i};const a=e.lastIndexOf("$",t-1),l=e.indexOf("$",t);if(-1!==a&&(t===a+1?(r=!0,i=""):(i=e.slice(a+1,-1===l?void 0:l),t>a+1&&(i=e.slice(a+1,t)),r=!0),T&&o&&(r=!1),(/[{}]/.test(i)||0===t)&&(r=!1,i=""),i)){n.some(e=>("_startforloop"===e.type&&c?`FLV_for:${e.name}`:e.name).toLowerCase().includes(i.toLowerCase()))||(r=!1,i="")}return{showDropdown:r,searchString:i}}(h,q,o),[le,ce]=s(!1);return n("div",{className:"ff-add-variable-container",children:[n("div",{className:"ff-add-variable-input",children:[e(tn,{readOnly:_,...z,name:"add_variable",ref:te,type:((e,t)=>"password"===e?t?"text":"password":e??"text")(k,le),value:h,onChange:u,variant:"primary",label:t,placeholder:d,onClick:re,onKeyUp:ie,onFocus:e=>{setTimeout(()=>{R(!0),L?.(e)},500)},onBlur:e=>{(e=>{e.relatedTarget&&e.relatedTarget.closest(".dropdown-container")||R(!1)})(e),H?.(e)},autoComplete:w,helperText:v,error:y,required:M,...A}),"password"===k&&E&&e(K,{title:le?"Hide":"Show",children:e(F,{as:"span",className:"ff-password-icon",children:e(P,{onClick:()=>{ce(e=>!e)},name:le?"hide_access_icon":"view_access_icon",width:16,height:16,hoverEffect:!0})})}),!G(h)&&!m&&X&&g&&e(K,{title:"Add Variable",children:e(P,{onClick:f,name:"add_variable",width:24,height:24,hoverEffect:!0})})]}),ae?.showDropdown&&j&&e(aE,{position:"absolute",width:p,optionsList:o.filter(e=>("_startforloop"===e.type&&c?`FLV_for:${e.name}`:e.name).toLowerCase().includes(ae?.searchString.toLowerCase())),onSelectVariable:oe,height:S}),I&&(m||x)&&e(Mx,{position:"relative",width:p,filteredOptions:$,zIndex:2e3,onSelectVariable:oe,height:S,isTruncateText:O,truncateTextValue:V})]})}),xx=(e,t)=>{const n=new Set;for(const r of e){const e=t?r[t]:JSON.stringify(r);if(n.has(e))return!0;n.add(e)}return!1};var kx,Lx;var Hx=(Lx||(Lx=1,kx=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=9)}([function(e,t){e.exports=i},function(e,t,n){var r;
28
+ */function Sg(){return Lg||(Lg=1,e=_g,"production"!==process.env.NODE_ENV&&function(){function t(e,t){var n=e.length;e.push(t),function(e,t,n){for(var r=n;r>0;){var o=r-1>>>1,a=e[o];if(!(i(a,t)>0))return;e[o]=t,e[r]=a,r=o}}(e,t,n)}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();return n!==t&&(e[0]=n,function(e,t,n){for(var r=n,o=e.length,a=o>>>1;r<a;){var l=2*(r+1)-1,c=e[l],s=l+1,d=e[s];if(i(c,t)<0)s<o&&i(d,c)<0?(e[r]=d,e[s]=t,r=s):(e[r]=c,e[l]=t,r=l);else{if(!(s<o&&i(d,t)<0))return;e[r]=d,e[s]=t,r=s}}}(e,n,0)),t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error),"object"==typeof performance&&"function"==typeof performance.now){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],s=[],d=1,u=null,f=3,h=!1,p=!1,m=!1,C="function"==typeof setTimeout?setTimeout:null,g="function"==typeof clearTimeout?clearTimeout:null,v="undefined"!=typeof setImmediate?setImmediate:null;function y(e){for(var i=n(s);null!==i;){if(null===i.callback)r(s);else{if(!(i.startTime<=e))return;r(s),i.sortIndex=i.expirationTime,t(c,i)}i=n(s)}}function w(e){if(m=!1,y(e),!p)if(null!==n(c))p=!0,O(b);else{var t=n(s);null!==t&&z(w,t.startTime-e)}}function b(t,i){p=!1,m&&(m=!1,N()),h=!0;var o=f;try{return function(t,i){var o=i;for(y(o),u=n(c);null!==u&&(!(u.expirationTime>o)||t&&!L());){var a=u.callback;if("function"==typeof a){u.callback=null,f=u.priorityLevel;var l=a(u.expirationTime<=o);o=e.unstable_now(),"function"==typeof l?u.callback=l:u===n(c)&&r(c),y(o)}else r(c);u=n(c)}if(null!==u)return!0;var d=n(s);return null!==d&&z(w,d.startTime-o),!1}(t,i)}finally{u=null,f=o,h=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var E=!1,M=null,A=-1,x=5,k=-1;function L(){return!(e.unstable_now()-k<x)}var H,_=function(){if(null!==M){var t=e.unstable_now();k=t;var n=!0;try{n=M(!0,t)}finally{n?H():(E=!1,M=null)}}else E=!1};if("function"==typeof v)H=function(){v(_)};else if("undefined"!=typeof MessageChannel){var S=new MessageChannel,V=S.port2;S.port1.onmessage=_,H=function(){V.postMessage(null)}}else H=function(){C(_,0)};function O(e){M=e,E||(E=!0,H())}function z(t,n){A=C(function(){t(e.unstable_now())},n)}function N(){g(A),A=-1}var I=function(){};e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){p||h||(p=!0,O(b))},e.unstable_forceFrameRate=function(e){e<0||e>125?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):x=e>0?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){var t;switch(f){case 1:case 2:case 3:t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=I,e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,o){var a,l,u=e.unstable_now();if("object"==typeof o&&null!==o){var f=o.delay;a="number"==typeof f&&f>0?u+f:u}else a=u;switch(r){case 1:l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}var C=a+l,g={id:d++,callback:i,priorityLevel:r,startTime:a,expirationTime:C,sortIndex:-1};return a>u?(g.sortIndex=a,t(s,g),null===n(c)&&g===n(s)&&(m?N():m=!0,z(w,a-u))):(g.sortIndex=C,t(c,g),p||h||(p=!0,O(b))),g},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),_g;var e}var Vg=(Hg||(Hg=1,"production"===process.env.NODE_ENV?xg.exports=(Ag||(Ag=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(!(0<i(o,t)))break e;e[r]=t,e[n]=o,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,a=o>>>1;r<a;){var l=2*(r+1)-1,c=e[l],s=l+1,d=e[s];if(0>i(c,n))s<o&&0>i(d,c)?(e[r]=d,e[s]=n,r=s):(e[r]=c,e[l]=n,r=l);else{if(!(s<o&&0>i(d,n)))break e;e[r]=d,e[s]=n,r=s}}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],s=[],d=1,u=null,f=3,h=!1,p=!1,m=!1,C="function"==typeof setTimeout?setTimeout:null,g="function"==typeof clearTimeout?clearTimeout:null,v="undefined"!=typeof setImmediate?setImmediate:null;function y(e){for(var i=n(s);null!==i;){if(null===i.callback)r(s);else{if(!(i.startTime<=e))break;r(s),i.sortIndex=i.expirationTime,t(c,i)}i=n(s)}}function w(e){if(m=!1,y(e),!p)if(null!==n(c))p=!0,O(b);else{var t=n(s);null!==t&&z(w,t.startTime-e)}}function b(t,i){p=!1,m&&(m=!1,g(x),x=-1),h=!0;var o=f;try{for(y(i),u=n(c);null!==u&&(!(u.expirationTime>i)||t&&!H());){var a=u.callback;if("function"==typeof a){u.callback=null,f=u.priorityLevel;var l=a(u.expirationTime<=i);i=e.unstable_now(),"function"==typeof l?u.callback=l:u===n(c)&&r(c),y(i)}else r(c);u=n(c)}if(null!==u)var d=!0;else{var C=n(s);null!==C&&z(w,C.startTime-i),d=!1}return d}finally{u=null,f=o,h=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var E,M=!1,A=null,x=-1,k=5,L=-1;function H(){return!(e.unstable_now()-L<k)}function _(){if(null!==A){var t=e.unstable_now();L=t;var n=!0;try{n=A(!0,t)}finally{n?E():(M=!1,A=null)}}else M=!1}if("function"==typeof v)E=function(){v(_)};else if("undefined"!=typeof MessageChannel){var S=new MessageChannel,V=S.port2;S.port1.onmessage=_,E=function(){V.postMessage(null)}}else E=function(){C(_,0)};function O(e){A=e,M||(M=!0,E())}function z(t,n){x=C(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){p||h||(p=!0,O(b))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,o){var a=e.unstable_now();switch(o="object"==typeof o&&null!==o&&"number"==typeof(o=o.delay)&&0<o?a+o:a,r){case 1:var l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}return r={id:d++,callback:i,priorityLevel:r,startTime:o,expirationTime:l=o+l,sortIndex:-1},o>a?(r.sortIndex=o,t(s,r),null===n(c)&&r===n(s)&&(m?(g(x),x=-1):m=!0,z(w,o-a))):(r.sortIndex=l,t(c,r),p||h||(p=!0,O(b))),r},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(kg)),kg):xg.exports=Sg()),xg.exports);const Og=Symbol(),zg=Symbol(),Ng="undefined"==typeof window||/ServerSideRendering/.test(window.navigator&&window.navigator.userAgent)?l:u,Ig=Vg.unstable_runWithPriority?e=>{try{Vg.unstable_runWithPriority(Vg.unstable_NormalPriority,e)}catch(t){if("Not implemented."!==t.message)throw t;e()}}:e=>e();function Dg(e,t){const n=d(e)[Og];if("object"==typeof process&&"production"!==process.env.NODE_ENV&&!n)throw new Error("useContextSelector requires special context");const{v:{current:r},n:{current:i},l:o}=n,a=t(r),[l,c]=v((e,n)=>{if(!n)return[r,a];if("p"in n)throw n.p;if(n.n===i)return Object.is(e[1],a)?e:[r,a];try{if("v"in n){if(Object.is(e[0],n.v))return e;const r=t(n.v);return Object.is(e[1],r)?e:[n.v,r]}}catch(e){}return[...e]},[r,a]);return Object.is(l[1],a)||c(),Ng(()=>(o.add(c),()=>{o.delete(c)}),[o]),l[1]}const Tg=function(e){const t=c({[Og]:{v:{current:e},n:{current:-1},l:new Set,u:e=>e()}});var n;return t[zg]=t.Provider,t.Provider=(n=t.Provider,({value:e,children:t})=>{const r=a(e),i=a(0),[o,l]=s(null);o&&(o(e),l(null));const c=a();if(!c.current){const e=new Set,t=(t,n)=>{i.current+=1;const r={n:i.current};(null==n?void 0:n.suspense)&&(r.n*=-1,r.p=new Promise(e=>{l(()=>t=>{r.v=t,delete r.p,e(t)})})),e.forEach(e=>e(r)),t()};c.current={[Og]:{v:r,n:i,l:e,u:t}}}return Ng(()=>{r.current=e,i.current+=1,Ig(()=>{c.current[Og].l.forEach(t=>{t({n:i.current,v:e})})})},[e]),m(n,{value:c.current},t)}),delete t.Consumer,t}([Eg,()=>{}]),Zg=({children:t,useTableRef:n,totalWidth:r})=>{const i=a(null);return l(()=>{n&&i.current&&n(i)},[n]),e("table",{className:"ff-spreadsheet-table",ref:i,style:{minWidth:`${60+r}px`,tableLayout:"fixed"},children:t})},jg=t=>e("tr",{...t}),Rg=t=>e("tr",{className:"ff-spreadsheet-row-header",...t});function Bg(){return Dg(Tg,([,e])=>e)}function Pg(e){return Dg(Tg,([t])=>e(t))}const Fg=({selected:t,onSelect:n})=>{const i=r.useCallback(()=>{n()},[n]);return e("th",{className:"ff-spreadsheet-corner-header",onClick:i,tabIndex:0,children:e("div",{className:z("corner-header",{"ff-spreadsheet-header--selected":t}),children:e(P,{variant:t?"dark":"light",color:t?"var(--hover-color)":"var(--text-color)",name:"excel_corner_menu"})})})},Ug=t=>function(n){const i=Bg(),o=r.useCallback(()=>i({type:Ip}),[i]),a=Pg(e=>e.selected instanceof gC);return e(t,{...n,selected:a,onSelect:o})},qg=t=>function(n){const i=Bg(),o=r.useCallback((e,t)=>i(function(e,t){return{type:Np,payload:{column:e,extend:t}}}(e,t)),[i]),a=Pg(e=>e.selected.hasEntireColumn(n.column)),l=Pg(e=>e.selectedColumn??void 0),c=Pg(e=>e.active?$m(e.active,e.model.data):void 0);return e(t,{...n,cell:c,selected:a,selectedColumn:l,onSelect:o,scrollToColumn:n.scrollToColumn})},Wg=qg(({column:t,label:i,selected:o,onSelect:a,setContextMenu:l,deleteColumn:c,addColumnLeft:s,addColumnRight:d,columnContextEnable:u,cell:f,selectedColumn:p,minimumColumnWidth:m,maxColLimit:C,disableDeleteOption:g,contextMenu:v,onAddColumn:y,onDeleteColumn:w,setVisibleRange:b,scrollToColumn:E})=>{const M=Bg(),A=Pg(e=>e.model.data),x=Pg(e=>e.active),k=m,L=Pg(e=>e.columnDimensions[t]?.width||k),H=Pg(e=>e.model.data),{columnCount:_}=WC(H),S=r.useRef(A),V=r.useCallback(()=>{if(x){S.current?.[x.row]?.[x.column]!==PC&&S.current?.[0]?.length===A?.[0]?.length||(S.current=A);const e=S.current?.[x.row]?.[x.column]?.value,t=A?.[x.row]?.[x.column]?.value;return e===t}return!1},[x,A,S,PC]),O=e=>{b(t=>{const n={...t,end:"increment"===e?t.end+1:t.end-1};return p&&E(p),n})},N=h(()=>{const e=f?.contextDisable?.["Delete Column"]&&V();return[{label:"Add Column Left",value:"Add Column Left",iconName:"plus_icon",action:()=>{O("increment"),s(k),y?.(p??t,!0)},disableTooltip:"Column limit reached",visible:f?.contextDisable?.["Add Column Left"]??!1,disable:_>=C},{label:"Add Column Right",value:"Add Column Right",iconName:"plus_icon",action:()=>{O("increment"),d(k),y?.(p??t,!1)},disableTooltip:"Column limit reached",visible:f?.contextDisable?.["Add Column Right"]??!1,disable:_>=C},...g?[]:[{label:"Delete Column",value:"Delete Column",iconName:"delete",action:()=>{O("decrement"),c(),w?.(p??t)},disableTooltip:"",visible:!!e,disable:!1}]]},[p,f,s,d,c,k,_,C,g,y,w,t,V]),I=r.useCallback((e,n)=>{const r=n?t-1:t,i=Math.max(r,0);a(i,e.shiftKey);const o=e.clientX,l=L,c=e=>{const t=Math.max(k,l+(e.clientX-o));M(Em(i,t))},s=()=>{document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",s),M(Km())};document.addEventListener("mousemove",c),document.addEventListener("mouseup",s),M(Gm())},[t,L]),D=r.useCallback(e=>M(Fm(e)),[M]),T=r.useCallback(e=>{a(t,e.shiftKey)},[a,t]),Z=r.useCallback(e=>{e.preventDefault(),a(t,e.shiftKey),l({open:u,contextType:"column",options:N})},[t,p,u,N]);return r.useEffect(()=>{void 0!==p&&"column"===v?.contextType&&l(e=>({open:e.open,contextType:"column",options:N}))},[t,p,u,N,"column"===v?.contextType]),n("th",{className:z("ff-spreadsheet-header",{"ff-spreadsheet-header--selected":o}),style:{minWidth:`${L}px`},onClick:T,onContextMenu:Z,tabIndex:0,children:[e(F,{fontWeight:"medium",children:i??Qg(t)}),e("div",{className:"drag-column-selector drag-column-left",onMouseDown:e=>I(e,!1),onDoubleClick:()=>M(Em(t,k)),onClick:()=>D({row:-1,column:t})}),e("div",{className:"drag-column-selector drag-column-right",onMouseDown:e=>I(e,!0),onDoubleClick:()=>M(Em(t,k)),onClick:()=>D({row:-1,column:t})})]},t)});function Qg(e){let t="",n=e;for(;n>=0;)t=String.fromCharCode(65+n%26)+t,n=Math.floor(n/26)-1;return t}const Gg=({row:t,label:i,selected:o,onSelect:a,setContextMenu:l,addRowTop:c,addRowBottom:s,deleteRow:d,rowContextEnable:u,selectedRow:f,cell:h,maxRowLimit:p,disableDeleteOption:m,contextMenu:C,setVisibleRange:g,scrollToRow:v})=>{const y=Bg(),w=Pg(e=>e.rowDimensions[t]?.height||32),b=Pg(e=>e.model.data),{rowCount:E}=WC(b),M=e=>{g(t=>{const n={...t,end:"increment"===e?t.end+1:t.end-1};return f&&v(f),n})},A=r.useMemo(()=>[{label:"Add Row Top",value:"Add Row Top",iconName:"plus_icon",action:()=>{M("increment"),c()},disableTooltip:"Row limit reached",visible:h?.contextDisable?.["Add Row Top"]??!1,disable:E>=p},{label:"Add Row Bottom",value:"Add Row Bottom",iconName:"plus_icon",action:()=>{M("increment"),s()},disableTooltip:"Row limit reached",visible:h?.contextDisable?.["Add Row Bottom"]??!1,disable:E>=p},...m?[]:[{label:"Delete Row",value:"Delete Row",iconName:"delete",action:()=>{M("decrement"),d()},disableTooltip:"",visible:h?.contextDisable?.["Delete Row"]??!1,disable:!1}]],[f,t]),x=r.useCallback((e,n)=>{const r=n?t:t-1,i=Math.max(r,0);a(i,e.shiftKey);const o=e.clientY,l=w,c=e=>{const t=Math.max(32,l+(e.clientY-o));y(bm(i,t))},s=()=>{document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",s),y(Km())};document.addEventListener("mousemove",c),document.addEventListener("mouseup",s),y(Km())},[w,t]),k=r.useCallback(e=>y(Fm(e)),[y]),L=r.useCallback(e=>{a(t,e.shiftKey)},[t]),H=r.useCallback(e=>{e.preventDefault(),a(t,e.shiftKey),l({open:u,contextType:"row",options:A})},[t,u,A,f]);return r.useEffect(()=>{void 0!==f&&"row"===C?.contextType&&l(e=>({open:e.open,contextType:"row",options:A}))},[t,u,A,f,"row"===C?.contextType]),n("th",{className:z("ff-spreadsheet-header",{"ff-spreadsheet-header--selected":o}),style:{height:`${w}px`,minWidth:"60px"},onClick:L,onContextMenu:H,tabIndex:0,children:[e(F,{fontWeight:"medium",children:void 0!==i?i:t+1}),e("div",{className:"drag-row-selector drag-row-down",onMouseDown:e=>x(e,!0),onDoubleClick:()=>y(bm(t,32)),onClick:()=>k({row:t,column:-1})}),e("div",{className:"drag-row-selector drag-row-up",onMouseDown:e=>x(e,!1),onDoubleClick:()=>y(bm(t,32)),onClick:()=>k({row:t,column:-1})})]})},Kg=t=>function(n){const i=Bg(),o=Pg(e=>e.selected.hasEntireRow(n.row)),a=Pg(e=>e.active?$m(e.active,e.model.data):void 0),l=Pg(e=>e.selectedRow??void 0),c=r.useCallback((e,t)=>i(function(e,t){return{type:zp,payload:{row:e,extend:t}}}(e,t)),[i]);return e(t,{...n,selected:o,cell:a,selectedRow:l,onSelect:c,scrollToRow:n.scrollToRow})},Yg=({row:t,column:n,DataViewer:i,active:o,dragging:a,mode:l,data:c,evaluatedData:s,select:d,activate:u,setCellDimensions:f,setCellData:h})=>{const p=r.useRef(null),m=r.useMemo(()=>({row:t,column:n}),[t,n]),C=r.useCallback(e=>{e.preventDefault(),window.getSelection()?.removeAllRanges(),"view"===l&&(f(m,LC(e.currentTarget)),e.shiftKey?d(m):u(m))},[l,f,m,d,u]),g=r.useCallback(e=>{a&&(f(m,LC(e.currentTarget)),d(m))},[f,d,a,m]);return r.useEffect(()=>{const e=p.current;if(!e)return;const t=()=>{f(m,LC(e))};t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[f,m]),c&&c.DataViewer&&(i=c.DataViewer),e("td",{ref:p,style:{...c?.style,..."dropDown"===c?.inputType?.type&&{fontSize:"12px"},textDecoration:"underline"===c?.style?.textDecoration?c?.style?.textDecoration:"none"},className:z("ff-spreadsheet-cell",c?.className,{"ff-spreadsheet-active-cell":o||a}),onMouseEnter:g,onMouseDown:C,tabIndex:0,children:e(i,{row:t,column:n,cell:c,active:o,evaluatedCell:s,setCellData:h,inputValue:()=>null})})},Xg=t=>function(n){const{row:i,column:o}=n,a=Bg(),l=r.useMemo(()=>({row:i,column:o}),[i,o]),c=r.useCallback(e=>a(Um(l,e)),[a,l]),s=r.useCallback(e=>a(function(e){return{type:Tp,payload:{point:e}}}(e)),[a]),d=r.useCallback(e=>a(Fm(e)),[a]),u=r.useCallback((e,t)=>a(qm(e,t)),[a]),f=Pg(e=>kC(e.active,l)),h=Pg(e=>f?e.mode:"view"),p=Pg(e=>$m(l,e.model.data)),m=Pg(e=>$m(l,e.model.evaluatedData)),C=Pg(e=>e.dragging),g=Pg(e=>e.copied?.has(l)||!1);return e(t,{...n,active:f,copied:g,dragging:C,mode:h,evaluatedData:m,data:p,select:s,activate:d,setCellDimensions:u,setCellData:c})},Jg=({cell:r,evaluatedCell:i,active:o})=>{const a=function(e,t){const n=t?.value??e?.value;if(n&&"object"==typeof n)return n.toString();return n}(r,i);return e("span","boolean"==typeof a?{className:"ff-spreadsheet-data-viewer ff-spreadsheet-data-viewer--boolean",children:$g(a)}:{className:z("ff-spreadsheet-data-viewer",{"ff-spreadsheet-data-viewer--preserve-breaks":jC(a)}),children:o||"dropDown"!==r?.inputType?.type?o||"file"!==r?.inputType?.type?!o&&a:e(t,{children:G(r?.value)?n("div",{className:"ff-spreadsheet-data-viewer--without-fileType",children:[e(P,{name:"attachment_icon"})," Attachment"]}):(n=>{if(G(n))return e(t,{});return JSON.parse(n).map(t=>e("div",{className:"ff-spreadsheet-data-viewer--fileType",children:e(ln,{width:r?.style?.width??100,title:t?.name?.split("*")?.[0]??""})},t.name))})(a)}):n("div",{className:"ff-spreadsheet-data-viewer--dropdownType",children:[a,e(P,{name:"arrow_down",height:8,className:"dropdownType-icon"})]})})};function $g(e){return e?"TRUE":"FALSE"}const ev=i.forwardRef(({initialValue:t="",onChange:n,className:r="",style:o={}},c)=>{const s=a(null);i.useImperativeHandle(c,()=>s.current),l(()=>{s.current&&t!==s.current.innerText&&(s.current.innerText=t)},[t]);const d=()=>{if(s.current){const e=s.current.innerText;n?.(e)}};return e("div",{style:o,children:e("div",{ref:s,className:`editable-cell ${r}`,contentEditable:!0,suppressContentEditableWarning:!0,onKeyDown:e=>{if("Enter"===e.key){if(e.altKey||e.shiftKey)return e.preventDefault(),document.execCommand("insertLineBreak"),void d();s.current?.blur()}"Delete"!==e.key&&"Backspace"!==e.key||e.stopPropagation()},onInput:d,onPaste:e=>{e.preventDefault();const t=e.clipboardData.getData("text/plain"),n=window.getSelection();if(!n||!n.rangeCount)return;const r=n.getRangeAt(0);r.deleteContents();const i=document.createTextNode(t);r.insertNode(i),r.setStartAfter(i),r.collapse(!0),n.removeAllRanges(),n.addRange(r),d()},spellCheck:!1,autoCorrect:"off",autoCapitalize:"off",style:{outline:"none",transition:"border 0.2s",whiteSpace:"pre-wrap",wordBreak:"break-word",fontFamily:"inherit",fontSize:"inherit",lineHeight:"normal",minHeight:"24px",verticalAlign:"middle",caretColor:"black",height:"inherit",maxHeight:"inherit",display:"block",position:"relative",paddingBottom:"2px"}})})}),tv=({onChange:t,cell:n})=>{const i=r.useRef(null),o=r.useCallback(e=>{t({...n,value:e,style:n?.style,inputType:n?.inputType??{type:"text"}})},[t,n]);r.useEffect(()=>{i.current&&function(e){if(e)if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)e.selectionStart=e.selectionEnd=e.value.length;else if(e.isContentEditable){const t=document.createRange(),n=window.getSelection();t.selectNodeContents(e),t.collapse(!1),n?.removeAllRanges(),n?.addRange(t)}}(i.current)},[]);return e("div",{className:"ff-spreadsheet-data-editor",children:e(ev,{ref:i,initialValue:n?.value??"",onChange:o,className:"ff-spreadsheet-cell-textarea",style:{...n?.style,borderTop:"",borderBottom:"",borderLeft:"",borderRight:""}})})},nv=t=>{const i=r.useRef(null),o=r.useRef(null),a=Bg(),l=r.useCallback((e,t)=>a(Um(e,t)),[a]),c=r.useCallback(e=>a(Fm(e)),[a]),s=r.useCallback(()=>a({type:Up}),[a]),d=r.useCallback(e=>a({type:Cm,payload:{autofill:e}}),[a]),u=r.useCallback(e=>a(function(e){return{type:Xp,payload:{changes:e}}}(e)),[a]),f=r.useCallback(()=>{a({type:qp})},[a]),h=Pg(e=>e.rowDimensions),p=Pg(e=>e.active),m=Pg(e=>e.mode),C=Pg(e=>e.active?$m(e.active,e.model.data):void 0),g=Pg(e=>e.selected),v=Pg(e=>g&&IC(e.rowDimensions,e.columnDimensions,e.model.data,e.selected)),y=Pg(e=>{let t=p?zC(p,e.rowDimensions,e.columnDimensions):void 0;return t={top:t?.top?t?.top:0,height:t?.height?t?.height:0,left:t?.left?t?.left:0,width:t?.width?t?.width:0},t}),w=r.useMemo(()=>!p||!y||p.row<t.visibleRowRange.start||p.row>=t.visibleRowRange.end||p.column<t.visibleColRange.start||p.column>=t.visibleColRange.end,[p,y,t.visibleRowRange,t.visibleColRange]),b=r.useRef(void 0),E=r.useRef(null),M=r.useRef(void 0),A=r.useCallback(e=>{p&&l(p,e)},[l,p]),[x,k]=r.useState({value:"",name:""}),[L,H]=r.useState(!1),[_,S]=r.useState(),[V,O]=r.useState([]);r.useEffect(()=>{C&&p&&t.getActiveCell({value:C.value,active:p});const n=i.current;if(!w&&n){if(n.focus({preventScroll:!0}),"file"===C?.inputType?.type&&C?.value)try{const e=JSON.parse(C.value).map(e=>new File([new Blob],e.name.split("*")[0]??"default"));O(e)}catch(e){console.error("Error parsing cell value for files:",e),O([])}else O([]);if("dropDown"===C?.inputType?.type){k({value:C?.value,name:C?.value}),H(e=>!e);const t=C?.inputType?.options?.map(t=>({disable:t.disable,label:e("span",{style:{color:t.color},children:t.label}),value:t.value}));S(t)}}},[i,w,p]),r.useEffect(()=>{const e=E.current,t=M.current;if(E.current=p,M.current=C,!e||!t)return;const n=p?.row!==e.row||p?.column!==e.column;if(n||"edit"!==m){const e=b.current;t!==e?u([{prevCell:e||null,nextCell:t}]):n||C===t||u([{prevCell:t,nextCell:C||null}]),b.current=C}});const N=C&&C.DataEditor||t.DataEditor,I=C&&C.readOnly,D=r.useCallback(e=>{p&&(e.preventDefault(),d(!0))},[c,d,p]),T=r.useCallback(e=>{e.preventDefault(),t.setContextMenu({open:t.contextOption?.open??!1,contextType:t.contextOption?.contextType??null,options:t.contextOption?.options||[]})},[t]),Z=v?.height!==y?.height||v?.width!==y?.width,j=r.useCallback(e=>{p&&Z&&(qm(p,LC(e.currentTarget)),c(p))},[p,Z]),R=t.isAtRight?t.maxWidth-(y?.left-t.scrollPos.left)+100:t.maxWidth,B=t.isAtBottom?t.maxHeight-(y?.top-t.scrollPos.top)+64:t.maxHeight,P=["file","dropDown"].includes(C?.inputType?.type||"");return n("div",{ref:i,className:z("ff-spreadsheet-active-cell",`ff-spreadsheet-active-cell--${m}`,{"ff-spreadsheet-active-cell--hidden":w,"ff-spreadsheet-active-cell--dragging":Z&&"text"!==C?.inputType?.type}),onMouseDown:j,style:{...y,backgroundColor:C?.style?.backgroundColor,...P?{display:"flex",alignItems:C?.style?.alignContent,justifyContent:C?.style?.textAlign}:{},..."edit"===m&&p?{minWidth:Math.min(y?.width,t.maxWidth),minHeight:Math.min(y?.height,t.maxHeight),height:"auto",maxWidth:`${R}px`,maxHeight:`${B}px`,overflow:"auto",..."dropDown"===C?.inputType?.type?{}:{padding:"2px 4px 0px 4px",width:"max-content"}}:{}},onContextMenu:T,onClick:"view"!==m||I?void 0:s,tabIndex:0,children:[e("div",{className:P?"":"active-cell-main",children:"dropDown"===C?.inputType?.type?e(or,{...C?.inputType?.inputProps,dropDownRef:o,showOptions:{open:!("edit"!==m||!p),toggle:L},selectedOption:x,optionsList:_||[],height:26,showLabel:!1,disabled:!t.editable,showBorder:!1,optionZIndex:5e3,onChange:e=>{k({value:e.value,name:e.label}),A({...C,value:e.value,style:C?.style,inputType:C?.inputType})}}):"file"===C?.inputType?.type?e(Mp,{...C?.inputType?.inputProps,label:"",onFileListClick:e=>{const n=e.target.closest(".ff-attachment-files"),r=e.target.closest(".ff-icon-container, .ff-icon-click, .ff-icon-danger");if(n&&!r&&C?.value&&t.attachmentAction?.viewAttachment)try{const e=JSON.parse(C.value),r=n.parentElement?.querySelectorAll(".ff-attachment-files")||[],i=Array.from(r).indexOf(n);if(-1===i||!e[i])return void console.error("File index not found or invalid");const o=e[i];t.attachmentAction.viewAttachment(o.id,o.name?.split("*")[0]??"default")}catch(e){console.error("Error parsing cell value:",e)}else console.warn("Missing file element, icon click, cell value, or viewAttachment action")},selectedFiles:V,onFilesChange:async(e,n,r)=>{try{if("ADD"===r&&"file"===C?.inputType?.type){let n=[];try{C?.value&&(n=JSON.parse(C.value))}catch(e){console.error("Error parsing cell.value:",e)}let r=0;const i=e.filter((e,t,i)=>{const o=e.name.split("*")[0],a=i.findIndex(e=>e.name.split("*")[0]===o)!==t,l=n.some(e=>e.name.split("*")[0]===o);return!a&&!l||(r++,!1)});if(n.length+i.length>5)return void Pc.info("Cannot upload more than 5 files.");if(t.attachmentAction?.addAttachment&&i.length>0)try{let e=0,r=0,o=0;const l=V?.length+i?.length,c=l>0?25*l:1,s=[...n],d=i?.map(async e=>{try{if(e.name.includes("*"))return{file:e,status:"existing",data:{name:e.name}};const n=await(t?.attachmentAction?.addAttachment(e));if(!n||"string"==typeof n&&0===n.trim().length)return{file:e,status:"failed",reason:"no response"};if("string"==typeof n)try{const t=JSON.parse(n);return 507===t.responseCode?{file:e,status:"memory_full",reason:"no memory"}:400===t.responseCode?{file:e,status:"failed",reason:"invalid file"}:t?.id&&t?.name?{file:e,status:"success",data:t}:(console.error(`Invalid response structure for ${e.name}:`,t),{file:e,status:"failed",reason:"invalid response"})}catch(t){return console.error(`Parse error for ${e.name}:`,t),{file:e,status:"failed",reason:"parse error"}}if("object"==typeof n&&null!==n){const t=n;return t?.id&&t?.name?{file:e,status:"success",data:t}:(console.error(`Invalid response structure for ${e.name}:`,n),{file:e,status:"failed",reason:"invalid response"})}return console.error(`Unknown response for ${e.name}:`,n),{file:e,status:"failed",reason:"unknown"}}catch(t){return console.error(`Upload failed for ${e.name}:`,t),{file:e,status:"failed",reason:"upload error"}}});if((await Promise.allSettled(d)).forEach(t=>{if("fulfilled"===t.status&&t.value){const{status:n,data:i}=t.value;"success"===n&&i?.id&&i?.name?(s.push(i),e++):"existing"===n&&i?.name?s.push(i):"memory_full"===n?o++:r++}else r++}),e>0||s.length>n.length){const e=s.length>0?JSON.stringify(s):"";A({...C,value:e,style:C?.style,inputType:C?.inputType}),a(bm(p?.row||0,Math.max(c,h?.[p.row]?.height||c))),O(s.map(e=>new File([new Blob],e.name?.split("*")[0]??"default")))}o>0&&Pc.info("No memory available to add the file"),e>0&&Pc.success(`${e} file${e>1?"s":""} uploaded successfully`),r>0&&Pc.info(`${r} unsupported ${r>1?"files":"file"}. Please check the file formats.`)}catch(e){console.error("Upload operation failed:",e),Pc.error("Operation failed")}}else if("DELETE"===r&&"file"===C?.inputType?.type)try{let e=[...C&&JSON.parse(C.value)],r=0;for(const i of n||[]){const n=e.findIndex(e=>e.name.split("*")[0]===i.name.split("*")[0]),o=e[n]?.id;if(-1!==n&&o&&t.attachmentAction?.deleteAttachment)try{const a=await t.attachmentAction.deleteAttachment(o);"SUCCESS"===a||"object"==typeof a&&null!==a&&("status"in a&&"SUCCESS"===a.status||"responseCode"in a&&200===a.responseCode)?(e.splice(n,1),r++):console.error(`Delete failed for ${i.name}: Invalid response`,a)}catch(e){console.error(`Delete error for ${i.name}:`,e),Pc.error("Error deleting file")}else console.error(`Cannot delete ${i.name}: Invalid fileId or no match`,{index:n,fileId:o,hasDeleteAttachment:!!t.attachmentAction?.deleteAttachment}),Pc.error("Failed to delete file: Invalid file data")}if(r>0){const t=e.length>0?JSON.stringify(e):"";A({...C,value:t,style:C?.style,inputType:C?.inputType}),O(e?.map(e=>new File([new Blob],e.name.split("*")[0]))),Pc.success(`${r} file${r>1?"s":""} deleted successfully`)}else if(n?.length){const t=e?.filter(e=>e.id&&e.name);if(t.length<e.length){const e=t.length>0?JSON.stringify(t):"";A({...C,value:e,style:C?.style,inputType:C?.inputType}),O(t.map(e=>new File([new Blob],e.name.split("*")[0]))),Pc.error("Failed to delete file(s). Invalid file data detected.")}else Pc.error("Failed to delete file(s). No valid files removed.")}}catch(e){console.error("Delete operation failed:",e),Pc.error("Delete operation failed")}}catch(e){console.error("handleFilesChange error:",e),Pc.error("Operation failed")}},disabled:!t.editable,maxFiles:5,buttonLabel:"+ Attachments",buttonVariant:"tertiary",deleteButton:t.editable,selectedFileMessage:"Duplicate attachments not allowed within the same row",addAttachmentButton:t.editable,isInfoIconRequired:!1,truncateMaxLimit:(y?.width??0)-60}):"edit"===m&&p&&t.editable?e(N,{row:p.row,column:p.column,cell:C,onChange:A,exitEditMode:f}):e(ev,{initialValue:C?.value,onChange:()=>{},className:"ff-spreadsheet-cell-textarea",style:{...C?.style,textDecoration:"underline"===C?.style?.textDecoration?"underline":"none",backgroundColor:Z?"#1e161f00":C?.style?.backgroundColor,pointerEvents:"none",borderTop:"",borderBottom:"",borderLeft:"",borderRight:""}})}),!["file"].includes(C?.inputType?.type??"")&&("edit"===m||p&&e("div",{onMouseDown:D,className:"select_dot"}))]})},rv=({dimensions:t,dragging:n,hidden:r,variant:i})=>{const o=Pg(e=>e.active),a=Pg(e=>e.autoFill),l=Pg(e=>o?zC(o,e.rowDimensions,e.columnDimensions):void 0),{width:c,height:s,top:d,left:u}=t||{};let f=l?.height??0,h=l?.width??0,p=c,m=s;return a.open&&c&&s&&l&&(c-h>s-f?(p=c,m=l.height):(m=s,p=l.width)),e("div",{className:z("ff-spreadsheet-floating-rect",{[`ff-spreadsheet-floating-rect--${i}`]:i,"ff-spreadsheet-floating-rect--dragging":n,"ff-spreadsheet-floating-rect--hidden":r}),style:{width:(p??0)+1,height:(m??0)+1,top:d,left:u}})},iv=({scrollPos:t={top:0,left:0}})=>{const n=Pg(e=>e.selected),i=Pg(e=>e.dragging),o=Pg(e=>e.selected.size(e.model.data)<2),a=Pg(e=>n&&IC(e.rowDimensions,e.columnDimensions,e.model.data,e.selected)),l=r.useMemo(()=>{if(a)return{...a,top:a.top-1,left:a.left-1,height:a.height-1,width:a.width-1}},[a,t]);return e(rv,{variant:"selected",dimensions:l,dragging:i,hidden:o||!a})},ov=({scrollPos:t={top:0,left:0}})=>{const n=Pg(e=>e.copied),i=null===n,o=Pg(e=>n&&NC(e.rowDimensions,e.columnDimensions,n)),a=r.useMemo(()=>{if(o)return{...o,top:o.top-1,left:o.left-1,height:o.height-1,width:o.width-1}},[o,t]);return e(rv,{variant:"copied",dimensions:a,hidden:i||!o,dragging:!1})},av=({getColorValue:t,disabled:n,initialColor:r})=>{const i=a(null),[o,l]=s(r);return e("div",{className:z("ff-excel-color-selector",{"color-selector-disabled":n}),style:{backgroundColor:o},onClick:()=>{i.current&&!n&&i.current.click()},children:e("input",{type:"color",disabled:n,className:z("ff-excel-color-selector-picker",{"color-selector-disabled":n}),ref:i,onChange:e=>{l(e.target.value),t(e.target.value.replace("#",""))}})})},lv=e=>{switch(e.toUpperCase()){case"LEFT":default:return"left";case"RIGHT":return"right";case"CENTER":return"center";case"JUSTIFY":return"justify";case"BOTTOM":return"end";case"TOP":return"start"}},cv=e=>{switch(e){case"left":return"LEFT";case"right":return"RIGHT";case"center":return"CENTER";case"justify":return"JUSTIFY";case"end":default:return"BOTTOM";case"start":return"TOP"}},sv=e=>UC.reduce((t,n)=>Math.abs(n-parseFloat(e))<Math.abs(t-parseFloat(e))?n:t);function dv(e){const{border:t}=e;let n="",r="",i="",o="";return"THIN"!==t.top&&(n="MEDIUM"===t.top?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),"THIN"!==t.right&&(r="MEDIUM"===t.right?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),"THIN"!==t.bottom&&(i="MEDIUM"===t.bottom?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),"THIN"!==t.left&&(o="MEDIUM"===t.left?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),{fontSize:RC(sv(String(e.size))),fontFamily:(a=e.name,FC.some(e=>e.label===a)?a:"Poppins"),color:`#${e.color}`,backgroundColor:`#${e.backgroundColor}`,fontWeight:e.bold?"bold":"normal",fontStyle:e.italic?"italic":"normal",textDecoration:e.underline?"underline":"normal",borderTop:n,borderRight:r,borderBottom:i,borderLeft:o,textAlign:lv(e.alignment.horizontal),alignContent:lv(e.alignment.vertical)};var a}const uv=e=>{if(!e||"none"===e)return"THIN";if(e.includes("solid")||e.includes("dashed")||e.includes("dotted")){if(e.includes("2px")||e.includes("medium"))return"MEDIUM";if(e.includes("3px")||e.includes("medium"))return"THICK"}return"THIN"},fv=e=>({name:e.fontFamily||"Arial",size:BC(e.fontSize?.toString()||"12"),bold:"bold"===e.fontWeight,italic:"italic"===e.fontStyle,underline:"underline"===e.textDecoration,color:e.color?.replace("#","")||"000000",backgroundColor:e.backgroundColor?.replace("#","")||"FFFFFF",borderColor:"F2F2F2",border:{top:uv(e.borderTop?e.borderTop.toString():void 0),right:uv(e.borderRight?e.borderRight.toString():void 0),bottom:uv(e.borderBottom?e.borderBottom.toString():void 0),left:uv(e.borderLeft?e.borderLeft.toString():void 0)},alignment:{horizontal:cv(e.textAlign),vertical:cv(e.alignContent),wrapText:!1}}),hv=({toolbar:t="show",editable:r,onBold:i,onItalic:o,setUnderlineType:c,setColor:d,setFontSize:u,setFontFamily:f,setTextAlign:h,setBackgroundColor:p,setBorderType:m,setFormatePainter:C})=>{const g=Pg(e=>e.selected instanceof gC),[v,y]=s("disable"===t||!r),w=Pg(e=>e.active?$m(e.active,e.model.data):null),b=Pg(e=>e.model.data),E=Pg(e=>e.formattedStyle.open),M={...PC.style,color:"#1e161f",backgroundColor:"#ffffff",borderColor:"#1e161f"},[A,x]=s(w?.style||M),k=a(null);l(()=>{w?.style&&JSON.stringify(w.style)!==JSON.stringify(A)&&x(w?.style||M),g?y(!r):w&&"boolean"==typeof w.readOnly&&y(w.readOnly||"disable"===t||!r||"dropDown"===w?.inputType?.type)},[w,r]);const L=fv(A),[H,_]=s("border-none"),[S,V]=s({label:"",value:""}),[O,z]=s({label:"",value:""}),[N,I]=s({color:M.color,backgroundColor:M.backgroundColor,borderColor:M.borderColor}),D=[{value:"border-all-sides",label:"All Border",icon:"all_borders"},{value:"border-bottom",label:"Border Bottom",icon:"border_bottom"},{value:"border-left",label:"Border Left",icon:"border_left"},{value:"border-right",label:"Border Right",icon:"border_right"},{value:"border-top",label:"Border Top",icon:"border_top"},{value:"border-none",label:"No Border",icon:"no_border"}],T=UC.map(e=>({label:e,value:e}));l(()=>{let e=setTimeout(()=>{d(b,N.color)},0);return()=>{clearTimeout(e)}},[N.color]),l(()=>{let e=setTimeout(()=>{p(b,N.backgroundColor)},0);return()=>{clearTimeout(e)}},[N.backgroundColor]);return l(()=>{const e=A.fontFamily,t=`${BC(A.fontSize)}`;V({label:e??"Times New Roman",value:e??"Times New Roman"}),z({label:t??"11",value:t??"11"})},[A]),n("div",{className:"ff-excel-toolbar",children:[n("div",{className:"ff-excel-toolbar-font ",children:[e("div",{className:"ff-excel-toolbar-font-family",children:e(or,{disabled:v,height:24,tooltip:!0,showToolTip:!0,showLabel:!1,optionZIndex:2e3,onChange:e=>{V({label:e.label,value:e.label}),f(b,e.value)},required:!1,optionsList:FC,selectedOption:S})}),e("div",{className:"ff-excel-toolbar-font-size",children:e(or,{disabled:v,height:24,showLabel:!1,optionZIndex:2e3,required:!1,onChange:e=>{z({label:e.label,value:e.value}),u(b,e.value)},optionsList:T,selectedOption:O})})]}),e("div",{className:"ff-excel-toolbar-divider"}),n("div",{className:"ff-excel-toolbar-icon",children:[e(K,{placement:"top",title:"Text Left",children:e(P,{disabled:v,variant:"left"===A.textAlign?"dark":"light",hoverEffect:"left"!==A.textAlign,onClick:()=>h(b,"left"),name:"text_align_left"})}),e(K,{placement:"top",title:"Text Center",children:e(P,{disabled:v,variant:"center"===A.textAlign?"dark":"light",hoverEffect:"center"!==A.textAlign,onClick:()=>h(b,"center"),name:"text_align_center"})}),e(K,{placement:"top",title:"Text Right",children:e(P,{disabled:v,variant:"right"===A.textAlign?"dark":"light",hoverEffect:"right"!==A.textAlign,onClick:()=>h(b,"right"),name:"text_align_right"})})]}),e("div",{className:"ff-excel-toolbar-divider"}),n("div",{className:"ff-excel-toolbar-text",children:[e(K,{placement:"top",title:"Bold",children:e(P,{disabled:v,variant:L.bold?"dark":"light",hoverEffect:!L.bold,onClick:()=>i(b),name:"bold"})}),e(K,{placement:"top",title:"Italic",children:e(P,{disabled:v,variant:L.italic?"dark":"light",hoverEffect:!L.italic,onClick:()=>o(b),name:"italic"})}),e(K,{placement:"top",title:"Underline",children:e("div",{className:"ff-excel-toolbar-icon-underline",children:e(P,{disabled:v,variant:"underline"===A.textDecoration?"dark":"light",hoverEffect:"underline"!==A.textDecoration,onClick:()=>c(b),name:"underline"})})})]}),e("div",{className:"ff-excel-toolbar-divider"}),n("div",{className:"ff-excel-toolbar-icon",children:[e(K,{placement:"top",title:"Format Painter",children:e(P,{disabled:v,variant:E?"dark":"light",hoverEffect:!E,onClick:()=>{C(b)},name:"formate_painter"})}),e(K,{placement:"top",title:"Text Color",children:n("div",{className:"ff-excel-toolbar-icon-color",children:[e(P,{disabled:v,hoverEffect:!0,width:12,height:12,onClick:()=>{d(b,N.color)},name:"text_color"}),e(av,{disabled:v,getColorValue:e=>{I(t=>({...t,color:e}))},initialColor:N.color})]})}),e(K,{placement:"top",title:"Background Color",children:n("div",{className:"ff-excel-toolbar-icon-color",children:[e(P,{disabled:v,hoverEffect:!0,width:12,height:12,onClick:()=>p(b,N.backgroundColor),name:"fill_color"}),e(av,{disabled:v,getColorValue:e=>{I(t=>({...t,backgroundColor:e}))},initialColor:N.backgroundColor})]})})]}),e("div",{className:"ff-excel-toolbar-divider"}),e("div",{className:"ff-excel-toolbar-menu",children:n("div",{className:"ff-excel-toolbar-menu-option",children:[e(K,{placement:"top",title:"Border Type",children:e(P,{hoverEffect:!0,disabled:v,onClick:()=>m(b,H,"var(--input-hover-border-color)"),name:(()=>{const e=D.find(e=>e.value===H);return e?e.icon:""})()})}),e("span",{ref:k,children:e(ur,{disabled:v,iconName:"arrow_down",targetRef:k,iconSize:12,zIndex:2e3,options:D,tooltipTitle:"Border Type",tooltipPlacement:"top",onOptionClick:e=>{let t=e.value;m(b,t,"var(--input-hover-border-color)"),_(t)}})})]})})]})},pv=(e,t)=>{let n,r=null;const i=function(...i){const o=this;null===r||Date.now()-r>=t?(e.apply(o,i),r=Date.now()):(n&&clearTimeout(n),n=setTimeout(()=>{e.apply(o,i),r=Date.now()},t-(Date.now()-r)))};return i.cancel=()=>{n&&clearTimeout(n),n=null,r=null},i},mv=r.forwardRef(function(t,i){const{className:o,columnLabels:a=[],rowLabels:l=[],toolbar:c,editable:s,onKeyDown:d,Table:u=Zg,Row:f=jg,sheetHeight:h,HeaderRow:p=Rg,DataEditor:m=tv,DataViewer:C=Jg,onSelect:g=()=>{},onActivate:v=()=>{},onEvaluatedDataChange:y=()=>{},contextOption:w,attachmentAction:b,workRef:E,minimumColumnWidth:M,setContextMenu:A,maxRowLimit:x,maxColLimit:k,disableDeleteOption:L,contextMenu:H,getActiveCell:_,onAddColumn:S,onDeleteColumn:V}=t,O=t.minimumColumnWidth||100,N=r.useRef(!1),I=Pg(e=>e.model.data),[D,T]=r.useState(!1),[Z,j]=r.useState(0),[R,B]=r.useState(0),[P,F]=r.useState({top:0,left:0}),[U,q]=r.useState(!1),[W,Q]=r.useState(!1),G=r.useMemo(()=>{const e=t.createFormulaParser||GC,n=new $C(e,t.data);return T(e=>!e),{...Eg,model:n,selected:t.selected||Eg.selected}},[t.createFormulaParser,t.data,t.selected]),K=r.useReducer(Mg,G),[Y,X]=K,J=r.useMemo(()=>function(e,t,n){const{columns:r,rows:i}=lC(e);return{rows:t?Math.max(i,t.length):i,columns:n?Math.max(r,n.length):r}}(Y.model.data,l,a),[Y.model.data,l,a]),[$,ee]=r.useState({start:0,end:Math.min(20,J.rows)}),[te,ne]=r.useState({start:0,end:Math.min(15,J.columns)}),re=r.useCallback(e=>{let t=0;for(let n=0;n<e;n++)t+=Y.rowDimensions[n]?.height||32;return t},[Y.rowDimensions,32]),ie=r.useCallback(e=>{let t=0;for(let n=0;n<e;n++)t+=Y.columnDimensions[n]?.width||O;return t},[Y.columnDimensions,O]),oe=re(J.rows),ae=ie(J.columns),le=re($.start),ce=oe-re($.end),se=ie(te.start),de=ae-ie(te.end),ue=Y.mode,fe=r.useRef(null),he=e=>r.useCallback((...t)=>X(e(...t)),[e]),pe=he(wm),me=he(Xm),Ce=he(Ym),ge=he(Jm),ve=he(Wm),ye=he(Qm),we=he(jm),be=he(Gm),Ee=he(Km),Me=he(Rm),Ae=he(Bm),xe=he(Pm),ke=he(Mm),Le=he(Am),He=he(km),_e=he(_m),Se=he(Lm),Ve=he(Hm),Oe=he(xm),ze=he(Sm),Ne=he(Vm),Ie=he(Om),De=he(ym),Te=he(zm),Ze=he(Nm),je=he(Im),Re=he(Dm),Be=he(Tm),Pe=he(Zm);r.useImperativeHandle(i,()=>({removeSelect:ge}));const Fe=r.useRef(Y.active);r.useEffect(()=>{if(Y.active!==Fe.current)if(Y.active)v(Y.active);else{const e=E.current;e&&ZC(e)&&document.activeElement&&document.activeElement.blur()}Fe.current=Y.active},[v,Y.active]);const Ue=r.useRef(Y.model.evaluatedData);r.useEffect(()=>{Y?.model?.evaluatedData!==Ue?.current&&y(Y?.model?.evaluatedData),Ue.current=Y.model.evaluatedData},[Y?.model?.evaluatedData,y]);const qe=r.useRef(Y.selected);r.useEffect(()=>{Y.selected.equals(qe.current)||t.selected&&Y.selected.equals(t.selected)||g(Y.selected),qe.current=Y.selected},[Y.selected,g,t.selected]);const We=r.useRef(t.selected);r.useEffect(()=>{t.selected&&We.current&&!t.selected.equals(We.current)&&xe(t.selected),We.current=t.selected},[t.selected,xe]);let Qe=r.useRef(t.data);r.useEffect(()=>{pe(s),t.data!==Qe.current&&Me(t.data),Qe.current=t.data},[t.data,Me,s]);const Ge=r.useRef(t.createFormulaParser);r.useEffect(()=>{t.createFormulaParser!==Ge.current&&t.createFormulaParser&&Ae(t.createFormulaParser),Ge.current=t.createFormulaParser},[t.createFormulaParser,Ae]);const Ke=r.useCallback(e=>{const{model:t,selected:n}=Y,{data:r}=t,i=n.toRange(r);if(i){!function(e,t){e.clipboardData?.setData(AC,t)}(e,DC(function(e,t,n){const r=[],i=t.column-e.column;for(let o=e.row;o<=t.row;o++){const a=o-e.row;r[a]=r[a]||Array(i);for(let i=e.column;i<=t.column;i++)r[a][i-e.column]=$m({row:o,column:i},n)}return r}(i.start,i.end,r)))}},[Y]),Ye=r.useCallback(e=>{TC(fe.current,ue)&&(e.preventDefault(),e.stopPropagation(),Ke(e),me())},[ue,Ke,me]),Xe=r.useCallback(e=>{TC(fe.current,ue)&&(e.preventDefault(),e.stopPropagation(),Ke(e),Ce())},[ue,Ke,Ce]),Je=r.useCallback(e=>{if(TC(fe.current,ue)&&(e.preventDefault(),e.stopPropagation(),e.clipboardData)){const t=function(e){return window.clipboardData&&window.clipboardData.getData?window.clipboardData.getData("Text"):e.clipboardData&&e.clipboardData.getData?e.clipboardData.getData(AC):""}(e);ve(t)}},[ue,ve]),$e=r.useCallback(e=>{e.persist();const t=e.ctrlKey||e.metaKey,n=e.key.toLowerCase();t&&"b"===n?(e.preventDefault(),ke(I)):t&&"i"===n?(e.preventDefault(),Le(I)):t&&"u"===n&&(e.preventDefault(),He(I)),d&&d(e),e.defaultPrevented||(function(e,t){return void 0!==yg(e,t)}(Y,e)&&e.nativeEvent.preventDefault(),ye(e))},[Y,d,ye]),et=r.useCallback(()=>{Y.formattedStyle.open&&Y.active&&De(Y.active)},[Y]),tt=r.useCallback(()=>{Ee(),document.removeEventListener("mouseup",tt)},[Ee]),nt=r.useCallback(e=>{Y.dragging||1!==e.buttons||"view"!==ue||(be(),document.addEventListener("mouseup",tt))},[Y,be,tt,ue]),rt=r.useMemo(()=>Xg(t.Cell||Yg),[t.Cell,D,s]),it=r.useMemo(()=>Ug(t.CornerIndicator||Fg),[t.CornerIndicator,D]),ot=r.useMemo(()=>Kg(t.RowIndicator||Gg),[t.RowIndicator,D]),at=r.useMemo(()=>qg(t.ColumnIndicator||Wg),[t.ColumnIndicator,D]);r.useEffect(()=>(document.addEventListener("cut",Ye),document.addEventListener("copy",Xe),document.addEventListener("paste",Je),()=>{document.removeEventListener("cut",Ye),document.removeEventListener("copy",Xe),document.removeEventListener("paste",Je)}),[Ye,Xe,Je]);const lt=e=>{const t=new ResizeObserver(e=>{const t=e[0];if(t&&fe.current){const e=t.target;if(e){const{clientWidth:t,clientHeight:n}=e;B(Math.min(fe.current.clientHeight,n)),j(Math.min(fe.current.clientWidth,t))}}}),n=e.current;n&&t.observe(n)},ct=r.useCallback(e=>{const t=e.target,{scrollTop:n,clientHeight:r,scrollLeft:i,clientWidth:o}=t;F({top:n,left:i});let a=0;for(;a<J.rows&&re(a)<n;)a++;let l=a;for(;l<J.rows&&re(l)<n+r;)l++;a=Math.max(0,a-10),l=Math.min(J.rows,l+10),ee({start:a,end:l});const c=l===J.rows;q(c);let s=0;for(;s<J.columns&&ie(s)<i;)s++;let d=s;for(;d<J.columns&&ie(d)<i+o;)d++;s=Math.max(0,s-10),d=Math.min(J.columns,d+10),ne({start:s,end:d});const u=d===J.columns;Q(u),H.open&&A({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",visible:!1,disable:!1}]})},[J.rows,J.columns,re,ie]),st=r.useMemo(()=>pv(ct,16),[ct]),dt=e=>{N.current=!0,requestAnimationFrame(()=>{let t=0;for(let n=0;n<=e;n++)t+=Y.rowDimensions?.[n]?.height||32;requestAnimationFrame(()=>{fe.current&&e>=J.rows-1&&fe?.current?.scrollTo({top:t+32,behavior:"smooth"})})})},ut=e=>{N.current=!0,requestAnimationFrame(()=>{let t=0;for(let n=0;n<=e;n++)t+=Y.columnDimensions?.[n]?.width||O;requestAnimationFrame(()=>{fe.current&&e>=J.columns-1&&fe.current.scrollTo({left:t+60,behavior:"smooth"})})})};r.useEffect(()=>{N.current||(ee({start:0,end:Math.min(20,J.rows)}),ne({start:0,end:Math.min(15,J.columns)}))},[J.rows,J.columns,N.current]);const ft=xC($.end,$.start),ht=xC(te.end,te.start),pt=n("colgroup",{children:[e("col",{style:{width:"60px"}},"row-indicator")," ",e("col",{style:{width:`${se}px`}},"left-spacer")," ",ht.map(t=>e("col",{style:{width:`${Y.columnDimensions[t]?.width||O}px`}},t)),e("col",{style:{width:`${de}px`}},"right-spacer")," "]}),mt=r.useMemo(()=>n(u,{useTableRef:lt,totalWidth:ae,children:[pt,n("tbody",{children:[n(p,{children:[e(it,{}),e("div",{className:"spacer left"}),ht.map(n=>e(at,{column:n,minimumColumnWidth:M,setContextMenu:t.setContextMenu,label:n in a?a[n]:void 0,deleteColumn:Pe,addColumnLeft:je,addColumnRight:Re,columnContextEnable:t.columnContextEnable,maxColLimit:k,disableDeleteOption:L,contextMenu:H,onAddColumn:S,onDeleteColumn:V,setVisibleRange:ne,scrollToColumn:ut},n)),e("div",{className:"spacer right"})]}),e("tr",{style:{height:`${le}px`}}),ft.map(r=>n(f,{row:r,children:[e(ot,{label:r in l?l?.[r]:void 0,row:r,addRowTop:Te,addRowBottom:Ze,deleteRow:Be,setContextMenu:t.setContextMenu,rowContextEnable:t.rowContextEnable,maxRowLimit:x,disableDeleteOption:L,contextMenu:H,setVisibleRange:ee,scrollToRow:dt},r),e("div",{className:"spacer left"}),ht.map(t=>e(rt,{row:r,column:t,DataViewer:C},t)),e("div",{className:"spacer right"})]},r)),e("tr",{style:{height:`${ce}px`}})]})]}),[u,J.rows,J.columns,f,p,it,a,at,l,ot,rt,C,$,te,le,ce,se,de,Y.rowDimensions,Y.columnDimensions]),Ct=r.useMemo(()=>e(nv,{attachmentAction:b,contextOption:w,getActiveCell:_,setContextMenu:t.setContextMenu,DataEditor:m,visibleRowRange:$,visibleColRange:te,maxHeight:R-64,maxWidth:Z-M,totalHeight:oe,totalWidth:ae,isAtBottom:U,isAtRight:W,scrollPos:P,editable:s}),[m,$,te,Y.active,R,Z,oe,ae,U,W,s]),gt=r.useMemo(()=>n("div",{className:"ff-excel-spreadsheet-container",children:[e("div",{style:{width:`${Z}px`},className:z("ff-excel-header-column-hider",{"ff-excel-header-extend":["show","disable"].includes(c||""),"ff-excel-header-hider":"hide"===c})}),e("div",{style:{height:`${R}px`},className:z("ff-excel-header-column-hider",{"ff-excel-header-extend":["show","disable"].includes(c||""),"ff-excel-header-hider":"hide"===c})}),"hide"!==c&&e("div",{className:"ff-excel-toolbar-container",children:e(hv,{editable:s,toolbar:c,onBold:ke,onItalic:Le,setUnderlineType:He,setColor:ze,setBorderType:Oe,setFontSize:Se,setFontFamily:Ve,setTextAlign:_e,setBackgroundColor:Ne,setFormatePainter:Ie})}),n("div",{ref:fe,style:{height:h},className:z("ff-excel-spreadsheet",o),onKeyPress:we,onKeyDown:$e,onClick:et,onMouseMove:nt,onScroll:e=>st(e),children:[mt,Ct,e(iv,{scrollPos:P}),e(ov,{scrollPos:P})]})]}),[o,we,$e,nt,mt,Ct,Z]);return e(Tg.Provider,{value:K,children:gt})}),Cv=({contextMenu:t,position:r,editable:i})=>{if(!t.open)return null;return i&&e("div",{onContextMenu:e=>{e.preventDefault(),e.stopPropagation()},className:"ff-excel-menu",style:{left:r.x,top:r.y,position:"absolute",zIndex:9999999999},children:t.options.map(t=>{if(!t.visible){const i=t.disable;return e(K,{title:i?t.disableTooltip:"",children:n("div",{className:"ff-excel-menu-options "+(i?"disabled":""),onClick:()=>{i||t.action()},children:[t.iconName&&e(P,{name:t.iconName,height:16,width:16,color:(r=t.label,r.includes("Delete")?"var(--label-edit-error-text)":"var(--brand-color)"),disabled:i}),e(F,{as:"label",children:t.label})]})},t.label)}var r;return null})})},gv=({excelData:r,contextOption:o,toolbar:c="show",sheetBar:d="show",rowCount:u=26,colCount:f=26,sheetHeight:h="100%",editable:p=!0,contextHeightPositioning:m=0,contextWidthPositioning:C=0,onSave:g=()=>Promise.resolve(),onSaveInfoChange:v,attachmentAction:y={addAttachment:()=>Promise.resolve(""),deleteAttachment:()=>Promise.resolve(""),viewAttachment:()=>Promise.resolve()},onSaveDelay:w=3e3,scroller:b=!1,columnContextEnable:E=!0,rowContextEnable:M=!0,sheetBarContextEnable:A=!0,minimumColumnWidth:x=100,disableDeleteOption:k=!1,maxRowLimit:L=1/0,maxColLimit:H=1/0,maxSheetLimit:_=1/0,getActiveCell:S=()=>{}})=>{const V=a(null),[O,N]=s([]),[I,D]=s(""),[T,Z]=i.useState({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",disable:!1,visible:!1}]}),[j,R]=s({name:"defaultSheet",index:0}),[B,U]=s({defaultSheet:[[PC]]}),[q,W]=s([[PC]]),[Q,Y]=s((g.length,{})),[X,J]=s({x:0,y:0}),$=a(""),ee=a(null),te=a(null),ne=a(null);l(()=>{const e=r;if(e){const t=e.map(e=>e.sheetName);N(t),G(t.length)||($.current=t[0]||"",R({name:t[0]||"",index:0}));const n={},r={};e.forEach(e=>{const t=e.sheetName,i=e.data,o=Math.max(u,i.length),a=Math.max(f,Math.max(...i.map(e=>e.length)));let l=Array.from({length:o},()=>Array(a).fill({value:"",style:PC.style,readOnly:!1,inputType:void 0}));i.forEach((e,t)=>{e.forEach((e,n)=>{var r;t<o&&n<a&&(l[t]||(l[t]=[]),l[t][n]={value:(r=e.value,null==r?null:r),style:G(e?.style)?PC.style:dv(e?.style),readOnly:!!e?.readOnly&&e?.readOnly,inputType:e?.inputType??void 0,contextDisable:e.contextDisable})})});const c=new Set([...e?.rows?.readOnly?e.rows.readOnly.map(e=>`r${e}`):[],...e?.columns?.readOnly?e.columns.readOnly.map(e=>`c${e}`):[],...e?.cells?.readOnly?e.cells.readOnly.map(([e,t])=>`${e},${t}`):[]]);if(l.forEach((t,n)=>{t.forEach((t,r)=>{l[n]||(l[n]=[]);const i=c.has(`r${n+1}`)||c.has(`c${r+1}`)||c.has(`${n+1},${r+1}`),o=((t,n,r)=>r?.inputType?r.inputType:e?.rows?.inputType?.[t+1]||e?.columns?.inputType?.[n+1]||e?.cells?.inputType?.[`${t+1},${n+1}`]||{type:"text"})(n,r,t||PC);l[n][r]={...t,value:t?.value??"",readOnly:t?.readOnly?t.readOnly:i,inputType:o,contextDisable:t?.contextDisable}})}),n[t]=l,g.length>1){const e=i[0]||[];r[t]=Array.from({length:a},(t,n)=>({newData:"",oldData:e[n]?.value||""}))}}),U(n),g.length>1&&Y(r);const i=Object.keys(n)[0];i&&void 0!==n[i]&&W(n[i])}},[r]),l(()=>{v&&v(I),"File saved"===I&&setTimeout(()=>{D("")},2e3)},[I]),l(()=>{D("Saving..."),re(le())},[B,$.current]);const re=i.useCallback(Aa(e=>{if(g.length>1){const t={...Q};O.forEach((n,r)=>{const i=(e[r].data[0]||[]).map(e=>e?.value||"");t[n]=(t[n]||[]).map((e,t)=>({...e,newData:i[t]||""}))}),Y(t);const n=O.map(e=>({sheetName:e,headers:t[e]||[]}));g(e,n)}else g(e);D("File saved")},w),[g,Q,O]),ae=i.useCallback(e=>{e.ctrlKey&&"s"===e.key&&(e.preventDefault(),e.stopPropagation(),re(le()))},[g]);i.useEffect(()=>(document.addEventListener("keydown",ae),()=>{document.removeEventListener("keydown",ae)}),[ae]);const le=()=>O.map(e=>{const t=B[e]?.map(e=>{const t=e.reduce((e,t,n)=>""!==String(t?.value??"").trim()?n:e,-1),n=e.map((e,n)=>e&&e.style&&n<=t?{value:e.value,style:fv(e.style),readOnly:e.readOnly,inputType:e.inputType,contextDisable:e.contextDisable}:null).filter(e=>null!==e);return n.length>0?n:[]})||[],n=t.filter((e,n)=>{const r=t.slice(n+1).some(e=>e.length>0);return e.length>0||r});return{sheetName:e,data:G(n.length)?[[]]:n}}),[ce,se]=s(null),de=()=>O.length>=_,ue=()=>{if(de())return;const e=((e,t)=>{const n=t.map(e=>e.toLowerCase());let r=`${e}1`,i=2;for(;n.includes(r.toLowerCase());)r=`${e}${i}`,i++;return r})("Sheet",O),t=Array.from({length:u},()=>Array.from({length:f},()=>PC));N(t=>[...t,e]),R({index:O?.length,name:e}),U({...B,[e]:t}),W(t),g.length>1&&Y(t=>({...t,[e]:Array.from({length:f},()=>({newData:"",oldData:""}))})),$.current=e},fe=(e=[[PC]])=>{W(e)},he=(e,t,n)=>{const r=e.target;if(!r||r?.textContent?.trim()===n?.trim())return void se(null);const i=(r.textContent||"").trim();if(!i)return Pc.warning("Sheet name cannot be empty."),r.textContent=j.name,void se(null);if(i.length>50)return Pc.warning("The sheet name cannot be greater than 50 characters"),r.textContent=j.name,void se(null);if(O.map(e=>e.toLowerCase()).includes(i.toLowerCase())&&n.trim()?.toLowerCase()!==i?.toLowerCase())return Pc.warning("Sheet name already exists"),r.textContent=j.name,void se(null);let o=O;fe(B?.[n]),o.splice(t,1,i);const a=function(e,t,n){if(!(t in e))throw new Error(`Key "${t}" not found in object`);const{[t]:r,...i}=e;return{...i,[n]:r??[]}}(B,n,i);$.current=i,R(e=>({...e,name:i})),U(a),g.length>1&&Y(e=>{const t={...e},r=t[n];return delete t[n],t[i]=r??[],t}),se(null)};const pe=(e,t)=>{e!==j.name&&t!==j.index&&(R({index:t,name:e}),N(n=>{const r=[...n];return r[t]=e,r}),fe(B[e]),$.current=e)},me=i.useCallback((e,t=!1)=>{const n=e.target;(!n.closest(".ff-excel-tab-list")&&!n.closest(".ff-excel-sheet")||t)&&T.open&&(Z({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",visible:!1,disable:!1}]}),t||(e.preventDefault(),e.stopPropagation()))},[T.open]);i.useEffect(()=>(document.addEventListener("contextmenu",me),document.addEventListener("click",e=>me(e,!0)),()=>{document.removeEventListener("contextmenu",me),document.removeEventListener("click",e=>me(e,!0))}),[me]);const Ce=(e,t,n)=>{e.preventDefault();const r=[{label:"Add Sheet",value:"Add Sheet",iconName:"plus_icon",action:()=>ue(),disableTooltip:"Sheet limit reached",visible:!1,disable:de()},...k?[]:[{label:"Delete Sheet",value:"Delete Sheet",iconName:"delete",action:()=>((e,t)=>{if(O.length>1){let n=O.slice();n.splice(t,1);const r={...B};delete r[e];const i=Math.min(t,n.length-1);N(n),U(r),g.length>1&&Y(t=>{const n={...t};return delete n[e],n});const o=n[i]?n[i]:"";R({index:i,name:o}),fe(r?.[o]),$.current=o}else Pc.warning("Cannot delete the last sheet.")})(t,n),disableTooltip:"",visible:!1,disable:!1}]];Z(e=>({...e,open:!0,contextType:"sheet",options:r}))};l(()=>{ne.current?.removeSelect()},[j.name]);return e(t,{children:O.length>0&&n("div",{ref:ee,className:"ff-excel",onContextMenu:e=>{e.preventDefault();const t=te.current?.parentElement?.getBoundingClientRect(),n=window.scrollX,r=window.scrollY;let i=e.clientX-(t?.left||0)+n,o=e.clientY-(t?.top||0)+r;const a=300,l=window.innerWidth,c=window.innerHeight,s=l-e.clientX,d=e.clientX,u=c-e.clientY,f=e.clientY;s<a&&d>=a?i=e.clientX-(t?.left||0)+n-150:i+=2,u<200&&f>=200?o=e.clientY-(t?.top||0)+r-20:o+=2,e.target.classList.contains("ff-excel-tab-list")?J({x:i,y:o-(k?32:65)}):(i+a>l&&(i=l-a-2),i<0&&(i=2),J({x:i+C,y:o+m}))},onClick:e=>{e.stopPropagation(),T.open&&Z({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",visible:!1,disable:!1}]})},children:[e("div",{ref:te,className:"ff-excel-sheet",children:e(mv,{ref:ne,editable:p,attachmentAction:y,toolbar:c,sheetHeight:h,setContextMenu:Z,contextOption:o,data:q,columnContextEnable:E,rowContextEnable:M,minimumColumnWidth:x,onEvaluatedDataChange:e=>{U(t=>({...t,[$.current]:e}))},workRef:ee,scroller:b,maxRowLimit:L,maxColLimit:H,disableDeleteOption:k,contextMenu:T,getActiveCell:S,onAddColumn:(e,t)=>{g.length>1&&Y(n=>{const r=j.name,i=[...n[r]||[]],o=t?e:e+1;return i.splice(o,0,{newData:"",oldData:""}),{...n,[r]:i}})},onDeleteColumn:e=>{g.length>1&&Y(t=>{const n=j.name,r=[...t[n]||[]];return r.splice(e,1),{...t,[n]:r}})}},j.name)}),"hide"!==d&&n("div",{className:"ff-excel-sheet-bar",children:["show"===d&&n("div",{className:"ff-excel-add-sheet-set",children:[e(K,{title:de()?"Sheet limit reached":"Add Sheet",placement:"top",children:e(P,{disabled:!p||de(),className:"ff-excel-add-sheet-icon",hoverEffect:!0,onClick:ue,name:"plus_icon",height:20,width:20})}),e(ur,{options:(t=>t.map((t,r)=>({label:n("div",{style:{display:"flex",gap:"8px"},children:[j?.name===t?e(P,{height:16,width:16,name:"tick"}):e("div",{style:{height:"16px",width:"24px"}}),e(K,{title:oe(t,20,"count")?t:"",children:e(F,{children:ie(t,20,"count")})})]}),name:r,value:t})))(O),targetRef:V,onOptionClick:e=>{const{value:t,name:n=""}=e;pe(t,parseInt(n))},dropdownPlacement:"top",iconName:"show_script",tooltipTitle:"All Sheets",tooltipPlacement:"top",dropdownHeight:215,selectedValue:j.name})]}),e("div",{className:"ff-excel-tab-container",children:O.map((t,n)=>e(F,{lineHeight:"16px",children:e("div",{onContextMenu:e=>{pe(t,n),A&&Ce(e,t,n)},className:z("ff-excel-tab-list",{active:t===j.name}),onClick:()=>{pe(t,n)},suppressContentEditableWarning:ce===n,onDoubleClick:e=>{"show"===d&&(se(n),null===ce&&setTimeout(()=>(e=>{const t=document.createRange(),n=window.getSelection();t.selectNodeContents(e),t.collapse(!1),n?.removeAllRanges(),n?.addRange(t)})(e.target),0))},contentEditable:p&&ce===n,onBlur:e=>{he(e,n,t)},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),he(e,n,t))},children:t})},t))})]}),T.open&&e(Cv,{contextMenu:T,position:X,editable:p}),e(Bc,{})]})})},vv=({label:t="",isActive:n=!0,onClick:r=()=>{},isFilterChip:i=!1})=>{const o=i?"filter":"module";return e("div",{className:z("ff-module-chip",{"ff-filter-chip":i,[`ff-${o}-chip--active`]:n,[`ff-${o}-chip--hover`]:!n}),onClick:r,children:e(F,{lineHeight:"18px",className:"module-typography",children:t})})},yv=({x:e,y:t,radius:n,startAngle:r,endAngle:i})=>{const o=e+n*Math.cos(r),a=t+n*Math.sin(r),l=e+n*Math.cos(i),c=t+n*Math.sin(i),s=i-r>Math.PI?1:0;return i-r>=2*Math.PI?`\n M ${e+n} ${t}\n A ${n} ${n} 0 1 1 ${e-n} ${t} \n A ${n} ${n} 0 1 1 ${e+n} ${t}\n `:`M ${o} ${a} A ${n} ${n} 0 ${s} 1 ${l} ${c}`},wv=({radius:t=15,lineWidth:r=5,label:i,percentageValue:o,icon:l,fontSize:c=10,labelColor:d="",arcColor:u="var(--brand-color)",backgroundArcColor:f="var(--ff-select-scroll-thumb-color)",isSelectedArch:h=!1,onSelect:p})=>{const[m,C]=s({x:0,y:0}),[g,v]=s(!1),y=a(null);let w=-Math.PI/2;const b=2*(t+r),{backgroundArcPath:E,foregroundArcPath:M}=((e,t,n)=>{const r=t,i=r+Math.max(0,Math.min(e,100))/100*2*Math.PI;return{backgroundArcPath:yv({x:0,y:0,radius:n,startAngle:0,endAngle:2*Math.PI}),foregroundArcPath:yv({x:0,y:0,radius:n,startAngle:r,endAngle:i})}})(o,w,t),A=()=>{v(!0)},x=()=>{C({x:0,y:0}),v(!1)},k=e=>{if(y.current){const t=y.current.getBoundingClientRect();C({x:e.clientX-t.left,y:e.clientY-t.top})}};return n("div",{ref:y,className:"ff-icon-radial-chart-container",style:{"--fontSize":`${c}px`},onClick:p,children:[e("svg",{width:b,height:b,viewBox:`0 0 ${b} ${b}`,role:"img",children:n("g",{transform:`translate(${t+r}, ${t+r})`,children:[e("path",{d:E,fill:"none",stroke:f,strokeWidth:r,onMouseEnter:A,onMouseLeave:x,onMouseMove:k}),e("path",{d:M,fill:"none",stroke:u,strokeWidth:r,onMouseEnter:A,onMouseLeave:x,onMouseMove:k}),h&&e("path",{d:M,fill:"none",stroke:"var(--dotted-border-color)",strokeOpacity:"0.4",strokeWidth:r,onMouseEnter:A,onMouseLeave:x,onMouseMove:k}),l?e("foreignObject",{x:"-10",y:"-10",width:"20",height:"20",children:e(P,{className:"ff-radial-chart-icon-padding",name:l,height:20,width:20})}):e("text",{x:"0",y:"0",fill:d||u,textAnchor:"middle",dominantBaseline:"central",children:`${Math.round(o)}%`})]})}),g&&n("div",{className:"ff-icon-radial-chart-tooltip",style:{position:"absolute",left:`${m.x+15}px`,top:m.y-5+"px"},children:[e(F,{children:`${i} : `}),n(F,{children:[o,"%"]})]})]})},bv=({mediaSrc:t,fileId:r,onExpandClick:i,onDeleteClick:o,onDownloadClick:a,height:l="75px",width:c="79px",fileName:s,thumbnailMediaSrc:d,isDelete:u})=>e("div",{className:"ff-attach-media-container",style:{height:l,width:c},children:n("div",{className:"ff-media-wrapper",style:{height:l,width:c},children:[e("img",{src:d||t,alt:"Attached"}),n("div",{className:"ff-hover-icons",children:[n("div",{className:"ff-top-icons",children:[e("div",{className:"ff-icon-container",children:e(K,{title:"Download File",placement:"bottom",children:e(P,{name:"download_file_icon",height:10,width:10,onClick:a,color:"var(--icons-default-color)"})})}),u&&e("div",{className:"ff-icon-container",children:e(K,{title:"Delete",placement:"bottom",children:e(P,{name:"delete",height:10,width:10,color:"var(--ff-delete-button-attachment)",onClick:()=>{o&&o(r)}})})})]}),e("div",{className:"ff-expand-icon-container",children:e(K,{title:"Maximize",placement:"bottom",children:e(P,{name:"expand_icon",height:16,width:16,onClick:i})})})]}),e(F,{color:"var(--text-area-default-color)",fontWeight:"medium",className:"ff-media-text",children:s})]})}),Ev=({icon:r,status:i,count:o,text:a,style:c={width:"196.4px"},resetToggle:d,onSelectedStatus:u=e=>{}})=>{const[f,h]=s(!1),p=["total defects","defect density","open defects","closed defects","quality score"],m=p.includes(i.toLowerCase()),C=p.includes(i.toLowerCase());l(()=>{h(!d)},[d]);return n("div",{className:`ff-card-container ${i.toLowerCase()} ${f?"toggled":""}`,style:c,onClick:()=>(e=>{p.includes(e.toLowerCase())||(h(!0),u(e))})(i),children:[n("div",{className:"ff-status-bar",children:[e("div",{children:e(P,{name:r,height:20,width:20,hoverEffect:!1})}),!p.includes(i.toLowerCase())&&e(F,{fontWeight:"semi-bold",fontSize:"10px",textAlign:"center",lineHeight:"15px",className:"ff-status-text",as:"div",children:i.charAt(0).toUpperCase()+i.slice(1).toLowerCase()})]}),e("div",{className:"ff-content "+(C?"red-background":""),children:n(t,m?{children:[e(F,{fontWeight:"semi-bold",fontSize:"10px",className:"ff-text",lineHeight:"15px",color:"var(--ff-chip-text-color)",children:a}),e(F,{fontWeight:"semi-bold",fontSize:"24px",className:"ff-number",lineHeight:"36px",children:"defect density"===i.toLowerCase()?n(t,{children:[o.toString().padStart(2,"0"),e(F,{fontSize:"15px",fontWeight:"semi-bold",children:"/ Modules"})]}):"quality score"===i.toLowerCase()?`${parseFloat(o.toString()).toFixed(2)}%`:o.toString().padStart(2,"0")})]}:{children:[e(F,{fontWeight:"semi-bold",fontSize:"24px",className:"ff-number",lineHeight:"24px",color:f?"var(--base-bg-color)":"",children:o.toString().padStart(2,"0")}),e(F,{className:"ff-text",lineHeight:"18px",color:f?"var(--base-bg-color)":"var(--ff-chip-text-color)",children:a})]})})]})},Mv=({option:t})=>{const r=a(null),[i,o]=s(!1);l(()=>{const e=r.current;if(!e)return;const t=()=>{o(e.scrollWidth>e.clientWidth)},n=requestAnimationFrame(t);return window.addEventListener("resize",t),()=>{cancelAnimationFrame(n),window.removeEventListener("resize",t)}},[t]);const c={LOCAL:"local_variable_icon",GLOBAL:"global_variable_icon",PROJECT_ENVIRONMENT:"project_env_variable_icon"},d=e=>"_startforloop"===e?.type?`FLV_for:${e?.name}`:"DATAPROVIDER"===e?.type?`${e?.dpName}:${e?.varname}`:e?.name;return n("div",{style:{width:"-webkit-fill-available"},className:"ff-variable-option ff-variable-data",children:[e(K,{title:i?d(t):"",style:{width:"calc(100% - 32px)"},children:e("span",{ref:r,className:"ff-truncated_text",children:d(t)})}),e(P,{name:(e=>{if(!e)return"";const t=e._id||e.id;return t?.startsWith("PARAMETER")?"step_group_parameter":"LOCAL"===e.type&&"STEPGROUP"===e?.parentVariableType?"step_group_variable":"_startforloop"===e.type?"for_loop_variable":"DATAPROVIDER"===e.type?"data_provider_variable":c[e.type||""]||""})(t),height:24,width:24,hoverEffect:!0})]})};function Av(e){return()=>e}function xv(e){e()}function kv(e,t){return n=>e(t(n))}function Lv(e,t){return()=>e(t)}function Hv(e){return void 0!==e}function _v(){}function Sv(e,t){return t(e),e}function Vv(e,t){return t(e)}function Ov(...e){return e}function zv(e,t){return e(1,t)}function Nv(e,t){e(0,t)}function Iv(e){e(2)}function Dv(e){return e(4)}function Tv(e,t){return zv(e,function(e,t){return n=>e(t,n)}(t,0))}function Zv(e,t){const n=e(1,e=>{n(),t(e)});return n}function jv(e){let t,n;return r=>i=>{t=i,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function Rv(e,t){return e===t}function Bv(e=Rv){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function Pv(e){return t=>n=>{e(n)&&t(n)}}function Fv(e){return t=>kv(t,e)}function Uv(e){return t=>()=>{t(e)}}function qv(e,...t){const n=function(...e){return t=>e.reduceRight(Vv,t)}(...t);return(t,r)=>{switch(t){case 2:return void Iv(e);case 1:return zv(e,n(r))}}}function Wv(e,t){return n=>r=>{n(t=e(t,r))}}function Qv(e){return t=>n=>{e>0?e--:t(n)}}function Gv(e){let t,n=null;return r=>i=>{n=i,!t&&(t=setTimeout(()=>{t=void 0,r(n)},e))}}function Kv(...e){const t=new Array(e.length);let n=0,r=null;const i=Math.pow(2,e.length)-1;return e.forEach((e,o)=>{const a=Math.pow(2,o);zv(e,e=>{const l=n;n|=a,t[o]=e,l!==i&&n===i&&r&&(r(),r=null)})}),e=>o=>{const a=()=>{e([o].concat(t))};n===i?a():r=a}}function Yv(e){let t=e;const n=Jv();return(e,r)=>{switch(e){case 0:t=r;break;case 1:r(t);break;case 4:return t}return n(e,r)}}function Xv(e,t){return Sv(Yv(t),t=>Tv(e,t))}function Jv(){const e=[];return(t,n)=>{switch(t){case 0:return void e.slice().forEach(e=>{e(n)});case 2:return void e.splice(0,e.length);case 1:return e.push(n),()=>{const t=e.indexOf(n);t>-1&&e.splice(t,1)}}}}function $v(e){return Sv(Jv(),t=>Tv(e,t))}function ey(e,t=[],{singleton:n}={singleton:!0}){return{constructor:e,dependencies:t,id:ty(),singleton:n}}const ty=()=>Symbol();function ny(...e){const t=Jv(),n=new Array(e.length);let r=0;const i=Math.pow(2,e.length)-1;return e.forEach((e,o)=>{const a=Math.pow(2,o);zv(e,e=>{n[o]=e,r|=a,r===i&&Nv(t,n)})}),function(e,o){switch(e){case 2:return void Iv(t);case 1:return r===i&&o(n),zv(t,o)}}}function ry(e,t=Rv){return qv(e,Bv(t))}function iy(...e){return function(t,n){switch(t){case 2:return;case 1:return function(...e){return()=>{e.map(xv)}}(...e.map(e=>zv(e,n)))}}}var oy=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(oy||{});const ay={0:"debug",3:"error",1:"log",2:"warn"},ly=ey(()=>{const e=Yv(3);return{log:Yv((t,n,r=1)=>{var i;r>=(null!=(i=(typeof globalThis>"u"?window:globalThis).VIRTUOSO_LOG_LEVEL)?i:Dv(e))&&console[ay[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)}),logLevel:e}},[],{singleton:!0});function cy(e,t,n){return sy(e,t,n).callbackRef}function sy(e,t,n){const r=i.useRef(null);let o=e=>{};const a=i.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(t=>{const r=()=>{const n=t[0].target;null!==n.offsetParent&&e(n)};n?r():requestAnimationFrame(r)}):null,[e,n]);return o=e=>{e&&t?(null==a||a.observe(e),r.current=e):(r.current&&(null==a||a.unobserve(r.current)),r.current=null)},{callbackRef:o,ref:r}}function dy(e,t,n,r,o,a,l,c,s){const d=i.useCallback(n=>{const i=function(e,t,n,r){const i=e.length;if(0===i)return null;const o=[];for(let a=0;a<i;a++){const i=e.item(a);if(void 0===i.dataset.index)continue;const l=parseInt(i.dataset.index),c=parseFloat(i.dataset.knownSize),s=t(i,n);if(0===s&&r("Zero-sized element, this should not happen",{child:i},oy.ERROR),s===c)continue;const d=o[o.length-1];0===o.length||d.size!==s||d.endIndex!==l-1?o.push({endIndex:l,size:s,startIndex:l}):o[o.length-1].endIndex++}return o}(n.children,t,c?"offsetWidth":"offsetHeight",o);let s=n.parentElement;for(;!s.dataset.virtuosoScroller;)s=s.parentElement;const d="window"===s.lastElementChild.dataset.viewportType;let u;d&&(u=s.ownerDocument.defaultView);const f=l?c?l.scrollLeft:l.scrollTop:d?c?u.scrollX||u.document.documentElement.scrollLeft:u.scrollY||u.document.documentElement.scrollTop:c?s.scrollLeft:s.scrollTop,h=l?c?l.scrollWidth:l.scrollHeight:d?c?u.document.documentElement.scrollWidth:u.document.documentElement.scrollHeight:c?s.scrollWidth:s.scrollHeight,p=l?c?l.offsetWidth:l.offsetHeight:d?c?u.innerWidth:u.innerHeight:c?s.offsetWidth:s.offsetHeight;r({scrollHeight:h,scrollTop:Math.max(f,0),viewportHeight:p}),null==a||a(c?uy("column-gap",getComputedStyle(n).columnGap,o):uy("row-gap",getComputedStyle(n).rowGap,o)),null!==i&&e(i)},[e,t,o,a,l,r,c]);return sy(d,n,s)}function uy(e,t,n){return"normal"!==t&&!(null!=t&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,oy.WARN),"normal"===t?0:parseInt(null!=t?t:"0",10)}function fy(e,t,n){const r=i.useRef(null),o=i.useCallback(n=>{if(null==n||!n.offsetParent)return;const i=n.getBoundingClientRect(),o=i.width;let a,c;if(t){const e=t.getBoundingClientRect(),n=i.top-e.top;c=e.height-Math.max(0,n),a=n+t.scrollTop}else{const e=l.current.ownerDocument.defaultView;c=e.innerHeight-Math.max(0,i.top),a=i.top+e.scrollY}r.current={offsetTop:a,visibleHeight:c,visibleWidth:o},e(r.current)},[e,t]),{callbackRef:a,ref:l}=sy(o,!0,n),c=i.useCallback(()=>{o(l.current)},[o,l]);return i.useEffect(()=>{var e;if(t){t.addEventListener("scroll",c);const e=new ResizeObserver(()=>{requestAnimationFrame(c)});return e.observe(t),()=>{t.removeEventListener("scroll",c),e.unobserve(t)}}{const t=null==(e=l.current)?void 0:e.ownerDocument.defaultView;return null==t||t.addEventListener("scroll",c),null==t||t.addEventListener("resize",c),()=>{null==t||t.removeEventListener("scroll",c),null==t||t.removeEventListener("resize",c)}}},[c,t,l]),a}const hy=ey(()=>{const e=Jv(),t=Jv(),n=Yv(0),r=Jv(),i=Yv(0),o=Jv(),a=Jv(),l=Yv(0),c=Yv(0),s=Yv(0),d=Yv(0),u=Jv(),f=Jv(),h=Yv(!1),p=Yv(!1),m=Yv(!1);return Tv(qv(e,Fv(({scrollTop:e})=>e)),t),Tv(qv(e,Fv(({scrollHeight:e})=>e)),a),Tv(t,i),{deviation:n,fixedFooterHeight:s,fixedHeaderHeight:c,footerHeight:d,headerHeight:l,horizontalDirection:p,scrollBy:f,scrollContainerState:e,scrollHeight:a,scrollingInProgress:h,scrollTo:u,scrollTop:t,skipAnimationFrameInResizeObserver:m,smoothScrollTargetReached:r,statefulScrollTop:i,viewportHeight:o}},[],{singleton:!0}),py={lvl:0};function my(e,t){const n=e.length;if(0===n)return[];let{index:r,value:i}=t(e[0]);const o=[];for(let a=1;a<n;a++){const{index:n,value:l}=t(e[a]);o.push({end:n-1,start:r,value:i}),r=n,i=l}return o.push({end:1/0,start:r,value:i}),o}function Cy(e){return e===py}function gy(e,t){if(!Cy(e))return t===e.k?e.v:t<e.k?gy(e.l,t):gy(e.r,t)}function vy(e,t,n="k"){if(Cy(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=vy(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return vy(e.l,t,n)}function yy(e,t,n){return Cy(e)?Sy(t,n,1):t===e.k?ky(e,{k:t,v:n}):t<e.k?Vy(ky(e,{l:yy(e.l,t,n)})):Vy(ky(e,{r:yy(e.r,t,n)}))}function wy(){return py}function by(e,t,n){if(Cy(e))return[];return function(e){return my(e,({k:e,v:t})=>({index:e,value:t}))}(Ay(e,vy(e,t)[0],n))}function Ey(e,t){if(Cy(e))return py;const{k:n,l:r,r:i}=e;if(t===n){if(Cy(r))return i;if(Cy(i))return r;{const[t,n]=_y(r);return xy(ky(e,{k:t,l:Ly(r),v:n}))}}return xy(ky(e,t<n?{l:Ey(r,t)}:{r:Ey(i,t)}))}function My(e){return Cy(e)?[]:[...My(e.l),{k:e.k,v:e.v},...My(e.r)]}function Ay(e,t,n){if(Cy(e))return[];const{k:r,l:i,r:o,v:a}=e;let l=[];return r>t&&(l=l.concat(Ay(i,t,n))),r>=t&&r<=n&&l.push({k:r,v:a}),r<=n&&(l=l.concat(Ay(o,t,n))),l}function xy(e){const{l:t,lvl:n,r:r}=e;if(r.lvl>=n-1&&t.lvl>=n-1)return e;if(n>r.lvl+1){if(Hy(t))return Oy(ky(e,{lvl:n-1}));if(!Cy(t)&&!Cy(t.r))return ky(t.r,{l:ky(t,{r:t.r.l}),lvl:n,r:ky(e,{l:t.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}if(Hy(e))return zy(ky(e,{lvl:n-1}));if(Cy(r)||Cy(r.l))throw new Error("Unexpected empty nodes");{const t=r.l,i=Hy(t)?r.lvl-1:r.lvl;return ky(t,{l:ky(e,{lvl:n-1,r:t.l}),lvl:t.lvl+1,r:zy(ky(r,{l:t.r,lvl:i}))})}}function ky(e,t){return Sy(void 0!==t.k?t.k:e.k,void 0!==t.v?t.v:e.v,void 0!==t.lvl?t.lvl:e.lvl,void 0!==t.l?t.l:e.l,void 0!==t.r?t.r:e.r)}function Ly(e){return Cy(e.r)?e.l:xy(ky(e,{r:Ly(e.r)}))}function Hy(e){return Cy(e)||e.lvl>e.r.lvl}function _y(e){return Cy(e.r)?[e.k,e.v]:_y(e.r)}function Sy(e,t,n,r=py,i=py){return{k:e,l:r,lvl:n,r:i,v:t}}function Vy(e){return zy(Oy(e))}function Oy(e){const{l:t}=e;return Cy(t)||t.lvl!==e.lvl?e:ky(t,{r:ky(e,{l:t.r})})}function zy(e){const{lvl:t,r:n}=e;return Cy(n)||Cy(n.r)||n.lvl!==t||n.r.lvl!==t?e:ky(n,{l:ky(e,{r:n.l}),lvl:t+1})}function Ny(e,t){return!(!e||e.startIndex!==t.startIndex||e.endIndex!==t.endIndex)}function Iy(e,t){return!(!e||e[0]!==t[0]||e[1]!==t[1])}const Dy=ey(()=>({recalcInProgress:Yv(!1)}),[],{singleton:!0});function Ty(e,t,n){return e[Zy(e,t,n)]}function Zy(e,t,n,r=0){let i=e.length-1;for(;r<=i;){const o=Math.floor((r+i)/2),a=n(e[o],t);if(0===a)return o;if(-1===a){if(i-r<2)return o-1;i=o-1}else{if(i===r)return o;r=o+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function jy(e,t){return Math.round(e.getBoundingClientRect()[t])}function Ry(e){return!Cy(e.groupOffsetTree)}function By({index:e},t){return t===e?0:t<e?-1:1}function Py({offset:e},t){return t===e?0:t<e?-1:1}function Fy(e,t,n){if(0===t.length)return 0;const{index:r,offset:i,size:o}=Ty(t,e,By),a=e-r,l=o*a+(a-1)*n+i;return l>0?l+n:l}function Uy(e,t){if(!Ry(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function qy(e,t,n){if(function(e){return typeof e.groupIndex<"u"}(e))return t.groupIndices[e.groupIndex]+1;{let r=Uy("LAST"===e.index?n:e.index,t);return r=Math.max(0,r,Math.min(n,r)),r}}function Wy(e,t,n,r=0){return r>0&&(t=Math.max(t,Ty(e,r,By).offset)),my(function(e,t,n,r){const i=Zy(e,t,r),o=Zy(e,n,r,i);return e.slice(i,o+1)}(e,t,n,Py),Yy)}function Qy(e,[t,n,r,i]){t.length>0&&r("received item sizes",t,oy.DEBUG);const o=e.sizeTree;let a=o,l=0;if(n.length>0&&Cy(o)&&2===t.length){const e=t[0].size,r=t[1].size;a=n.reduce((t,n)=>yy(yy(t,n,e),n+1,r),a)}else[a,l]=function(e,t){let n=Cy(e)?0:1/0;for(const r of t){const{endIndex:t,size:i,startIndex:o}=r;if(n=Math.min(n,o),Cy(e)){e=yy(e,0,i);continue}const a=by(e,o-1,t+1);if(a.some(Xy(r)))continue;let l=!1,c=!1;for(const{end:n,start:r,value:o}of a)l?(t>=r||i===o)&&(e=Ey(e,r)):(c=o!==i,l=!0),n>t&&t>=r&&o!==i&&(e=yy(e,t+1,o));c&&(e=yy(e,o,i))}return[e,n]}(a,t);if(a===o)return e;const{lastIndex:c,lastOffset:s,lastSize:d,offsetTree:u}=Ky(e.offsetTree,l,a,i);return{groupIndices:n,groupOffsetTree:n.reduce((e,t)=>yy(e,t,Fy(t,u,i)),wy()),lastIndex:c,lastOffset:s,lastSize:d,offsetTree:u,sizeTree:a}}function Gy(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n===e?0:1)}function Ky(e,t,n,r){let i=e,o=0,a=0,l=0,c=0;if(0!==t){c=Zy(i,t-1,By),l=i[c].offset;const e=vy(n,t-1);o=e[0],a=e[1],i.length&&i[c].size===vy(n,t)[1]&&(c-=1),i=i.slice(0,c+1)}else i=[];for(const{start:e,value:c}of by(n,t,1/0)){const t=e-o,n=t*a+l+t*r;i.push({index:e,offset:n,size:c}),o=e,l=n,a=c}return{lastIndex:o,lastOffset:l,lastSize:a,offsetTree:i}}function Yy(e){return{index:e.index,value:e}}function Xy(e){const{endIndex:t,size:n,startIndex:r}=e;return e=>e.start===r&&(e.end===t||e.end===1/0)&&e.value===n}const Jy={offsetHeight:"height",offsetWidth:"width"},$y=ey(([{log:e},{recalcInProgress:t}])=>{const n=Jv(),r=Jv(),i=Xv(r,0),o=Jv(),a=Jv(),l=Yv(0),c=Yv([]),s=Yv(void 0),d=Yv(void 0),u=Yv(void 0),f=Yv(void 0),h=Yv((e,t)=>jy(e,Jy[t])),p=Yv(void 0),m=Yv(0),C={groupIndices:[],groupOffsetTree:wy(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:wy()},g=Xv(qv(n,Kv(c,e,m),Wv(Qy,C),Bv()),C),v=Xv(qv(c,Bv(),Wv((e,t)=>({current:t,prev:e.current}),{current:[],prev:[]}),Fv(({prev:e})=>e)),[]);Tv(qv(c,Pv(e=>e.length>0),Kv(g,m),Fv(([e,t,n])=>{const r=e.reduce((e,r,i)=>yy(e,r,Fy(r,t.offsetTree,n)||i),wy());return{...t,groupIndices:e,groupOffsetTree:r}})),g),Tv(qv(r,Kv(g),Pv(([e,{lastIndex:t}])=>e<t),Fv(([e,{lastIndex:t,lastSize:n}])=>[{endIndex:t,size:n,startIndex:e}])),n),Tv(s,d);const y=Xv(qv(s,Fv(e=>void 0===e)),!0);Tv(qv(d,Pv(e=>void 0!==e&&Cy(Dv(g).sizeTree)),Fv(e=>{const t=Dv(u),n=Dv(c).length>0;return t?n?[{endIndex:0,size:t,startIndex:0},{endIndex:1,size:e,startIndex:1}]:[]:[{endIndex:0,size:e,startIndex:0}]})),n),Tv(qv(f,Pv(e=>void 0!==e&&e.length>0&&Cy(Dv(g).sizeTree)),Fv(e=>{const t=[];let n=e[0],r=0;for(let i=1;i<e.length;i++){const o=e[i];o!==n&&(t.push({endIndex:i-1,size:n,startIndex:r}),n=o,r=i)}return t.push({endIndex:e.length-1,size:n,startIndex:r}),t})),n),Tv(qv(c,Kv(u,d),Pv(([,e,t])=>void 0!==e&&void 0!==t),Fv(([e,t,n])=>{const r=[];for(let i=0;i<e.length;i++){const o=e[i],a=e[i+1];r.push({startIndex:o,endIndex:o,size:t}),void 0!==a&&r.push({startIndex:o+1,endIndex:a-1,size:n})}return r})),n);const w=$v(qv(n,Kv(g),Wv(({sizes:e},[t,n])=>({changed:n!==e,sizes:n}),{changed:!1,sizes:C}),Fv(e=>e.changed)));zv(qv(l,Wv((e,t)=>({diff:e.prev-t,prev:t}),{diff:0,prev:0}),Fv(e=>e.diff)),e=>{const{groupIndices:n}=Dv(g);if(e>0)Nv(t,!0),Nv(o,e+Gy(e,n));else if(e<0){const t=Dv(v);t.length>0&&(e-=Gy(-e,t)),Nv(a,e)}}),zv(qv(l,Kv(e)),([e,t])=>{e<0&&t("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:l},oy.ERROR)});const b=$v(o);Tv(qv(o,Kv(g),Fv(([e,t])=>{const n=t.groupIndices.length>0,r=[],i=t.lastSize;if(n){const n=gy(t.sizeTree,0);let o=0,a=0;for(;o<e;){const e=t.groupIndices[a],l=t.groupIndices.length===a+1?1/0:t.groupIndices[a+1]-e-1;r.push({endIndex:e,size:n,startIndex:e}),r.push({endIndex:e+1+l-1,size:i,startIndex:e+1}),a++,o+=l+1}const l=My(t.sizeTree);return o!==e&&l.shift(),l.reduce((t,{k:n,v:r})=>{let i=t.ranges;return 0!==t.prevSize&&(i=[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]),{prevIndex:n+e,prevSize:r,ranges:i}},{prevIndex:e,prevSize:0,ranges:r}).ranges}return My(t.sizeTree).reduce((t,{k:n,v:r})=>({prevIndex:n+e,prevSize:r,ranges:[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]}),{prevIndex:0,prevSize:i,ranges:[]}).ranges})),n);const E=$v(qv(a,Kv(g,m),Fv(([e,{offsetTree:t},n])=>Fy(-e,t,n))));return Tv(qv(a,Kv(g,m),Fv(([e,t,n])=>{if(t.groupIndices.length>0){if(Cy(t.sizeTree))return t;let r=wy();const i=Dv(v);let o=0,a=0,l=0;for(;o<-e;){l=i[a];const e=i[a+1]-l-1;a++,o+=e+1}if(r=My(t.sizeTree).reduce((t,{k:n,v:r})=>yy(t,Math.max(0,n+e),r),r),o!==-e){r=yy(r,0,gy(t.sizeTree,l));r=yy(r,1,vy(t.sizeTree,1-e)[1])}return{...t,sizeTree:r,...Ky(t.offsetTree,0,r,n)}}{const r=My(t.sizeTree).reduce((t,{k:n,v:r})=>yy(t,Math.max(0,n+e),r),wy());return{...t,sizeTree:r,...Ky(t.offsetTree,0,r,n)}}})),g),{beforeUnshiftWith:b,data:p,defaultItemSize:d,firstItemIndex:l,fixedItemSize:s,fixedGroupSize:u,gap:m,groupIndices:c,heightEstimates:f,itemSize:h,listRefresh:w,shiftWith:a,shiftWithOffset:E,sizeRanges:n,sizes:g,statefulTotalCount:i,totalCount:r,trackItemSizes:y,unshiftWith:o}},Ov(ly,Dy),{singleton:!0});function ew(e){return e.reduce((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e),{groupIndices:[],totalCount:0})}const tw=ey(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:r,scrollTop:i}])=>{const o=Jv(),a=Jv(),l=$v(qv(o,Fv(ew)));return Tv(qv(l,Fv(e=>e.totalCount)),n),Tv(qv(l,Fv(e=>e.groupIndices)),e),Tv(qv(ny(i,t,r),Pv(([e,t])=>Ry(t)),Fv(([e,t,n])=>vy(t.groupOffsetTree,Math.max(e-n,0),"v")[0]),Bv(),Fv(e=>[e])),a),{groupCounts:o,topItemsIndexes:a}},Ov($y,hy)),nw=ey(([{log:e}])=>{const t=Yv(!1),n=$v(qv(t,Pv(e=>e),Bv()));return zv(t,t=>{t&&Dv(e)("props updated",{},oy.DEBUG)}),{didMount:n,propsReady:t}},Ov(ly),{singleton:!0}),rw=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function iw(e){const t="number"==typeof e?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!rw)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const ow=ey(([{gap:e,listRefresh:t,sizes:n,totalCount:r},{fixedFooterHeight:i,fixedHeaderHeight:o,footerHeight:a,headerHeight:l,scrollingInProgress:c,scrollTo:s,smoothScrollTargetReached:d,viewportHeight:u},{log:f}])=>{const h=Jv(),p=Jv(),m=Yv(0);let C=null,g=null,v=null;function y(){C&&(C(),C=null),v&&(v(),v=null),g&&(clearTimeout(g),g=null),Nv(c,!1)}return Tv(qv(h,Kv(n,u,r,m,l,a,f),Kv(e,o,i),Fv(([[e,n,r,i,o,a,l,s],u,f,m])=>{const w=iw(e),{align:b,behavior:E,offset:M}=w,A=i-1,x=qy(w,n,A);let k=Fy(x,n.offsetTree,u)+a;"end"===b?(k+=f+vy(n.sizeTree,x)[1]-r+m,x===A&&(k+=l)):"center"===b?k+=(f+vy(n.sizeTree,x)[1]-r+m)/2:k-=o,M&&(k+=M);const L=t=>{y(),t?(s("retrying to scroll to",{location:e},oy.DEBUG),Nv(h,e)):(Nv(p,!0),s("list did not change, scroll successful",{},oy.DEBUG))};if(y(),"smooth"===E){let e=!1;v=zv(t,t=>{e=e||t}),C=Zv(d,()=>{L(e)})}else C=Zv(qv(t,function(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return e=>{e&&(t(!0),clearTimeout(n))}}}(150)),L);return g=setTimeout(()=>{y()},1200),Nv(c,!0),s("scrolling from index to",{behavior:E,index:x,top:k},oy.DEBUG),{behavior:E,top:k}})),s),{scrollTargetReached:p,scrollToIndex:h,topListHeight:m}},Ov($y,hy,ly),{singleton:!0});function aw(e,t){0==e?t():requestAnimationFrame(()=>{aw(e-1,t)})}function lw(e,t){const n=t-1;return"number"==typeof e?e:"LAST"===e.index?n:e.index}const cw=ey(([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:r},{scrollTargetReached:i,scrollToIndex:o},{didMount:a}])=>{const l=Yv(!0),c=Yv(0),s=Yv(!0);return Tv(qv(a,Kv(c),Pv(([e,t])=>!!t),Uv(!1)),l),Tv(qv(a,Kv(c),Pv(([e,t])=>!!t),Uv(!1)),s),zv(qv(ny(t,a),Kv(l,n,e,s),Pv(([[,e],t,{sizeTree:n},r,i])=>e&&(!Cy(n)||Hv(r))&&!t&&!i),Kv(c)),([,e])=>{Zv(i,()=>{Nv(s,!0)}),aw(4,()=>{Zv(r,()=>{Nv(l,!0)}),Nv(o,e)})}),{initialItemFinalLocationReached:s,initialTopMostItemIndex:c,scrolledToInitialItem:l}},Ov($y,hy,ow,nw),{singleton:!0});function sw(e,t){return Math.abs(e-t)<1.01}const dw="up",uw="down",fw={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},hw=ey(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:r,scrollTop:i,viewportHeight:o}])=>{const a=Yv(!1),l=Yv(!0),c=Jv(),s=Jv(),d=Yv(4),u=Yv(0),f=Xv(qv(iy(qv(ry(i),Qv(1),Uv(!0)),qv(ry(i),Qv(1),Uv(!1),jv(100))),Bv()),!1),h=Xv(qv(iy(qv(n,Uv(!0)),qv(n,Uv(!1),jv(200))),Bv()),!1);Tv(qv(ny(ry(i),ry(u)),Fv(([e,t])=>e<=t),Bv()),l),Tv(qv(l,Gv(50)),s);const p=$v(qv(ny(r,ry(o),ry(t),ry(e),ry(d)),Wv((e,[{scrollHeight:t,scrollTop:n},r,i,o,a])=>{const l={scrollHeight:t,scrollTop:n,viewportHeight:r};if(n+r-t>-a){let t,r;return n>e.state.scrollTop?(t="SCROLLED_DOWN",r=e.state.scrollTop-n):(t="SIZE_DECREASED",r=e.state.scrollTop-n||e.scrollTopDelta),{atBottom:!0,atBottomBecause:t,scrollTopDelta:r,state:l}}let c;return c=l.scrollHeight>e.state.scrollHeight?"SIZE_INCREASED":r<e.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":n<e.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:c,state:l}},fw),Bv((e,t)=>e&&e.atBottom===t.atBottom))),m=Xv(qv(r,Wv((e,{scrollHeight:t,scrollTop:n,viewportHeight:r})=>{if(sw(e.scrollHeight,t))return{changed:!1,jump:0,scrollHeight:t,scrollTop:n};{const i=t-(n+r)<1;return e.scrollTop!==n&&i?{changed:!0,jump:e.scrollTop-n,scrollHeight:t,scrollTop:n}:{changed:!0,jump:0,scrollHeight:t,scrollTop:n}}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),Pv(e=>e.changed),Fv(e=>e.jump)),0);Tv(qv(p,Fv(e=>e.atBottom)),a),Tv(qv(a,Gv(50)),c);const C=Yv(uw);Tv(qv(r,Fv(({scrollTop:e})=>e),Bv(),Wv((e,t)=>Dv(h)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?dw:uw,prevScrollTop:t},{direction:uw,prevScrollTop:0}),Fv(e=>e.direction)),C),Tv(qv(r,Gv(50),Uv("none")),C);const g=Yv(0);return Tv(qv(f,Pv(e=>!e),Uv(0)),g),Tv(qv(i,Gv(100),Kv(f),Pv(([e,t])=>!!t),Wv(([e,t],[n])=>[t,n],[0,0]),Fv(([e,t])=>t-e)),g),{atBottomState:p,atBottomStateChange:c,atBottomThreshold:d,atTopStateChange:s,atTopThreshold:u,isAtBottom:a,isAtTop:l,isScrolling:f,lastJumpDueToItemResize:m,scrollDirection:C,scrollVelocity:g}},Ov(hy)),pw="top",mw="bottom",Cw="none";function gw(e,t,n){return"number"==typeof e?n===dw&&t===pw||n===uw&&t===mw?e:0:n===dw?t===pw?e.main:e.reverse:t===mw?e.main:e.reverse}function vw(e,t){var n;return"number"==typeof e?e:null!=(n=e[t])?n:0}const yw=ey(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:r,viewportHeight:i}])=>{const o=Jv(),a=Yv(0),l=Yv(0),c=Yv(0),s=Xv(qv(ny(ry(r),ry(i),ry(n),ry(o,Iy),ry(c),ry(a),ry(t),ry(e),ry(l)),Fv(([e,t,n,[r,i],o,a,l,c,s])=>{const d=e-c,u=a+l,f=Math.max(n-d,0);let h=Cw;const p=vw(s,pw),m=vw(s,mw);return r-=c,i+=n+l,(r+=n+l)>e+u-p&&(h=dw),(i-=c)<e-f+t+m&&(h=uw),h!==Cw?[Math.max(d-n-gw(o,pw,h)-p,0),d-f-l+t+gw(o,mw,h)+m]:null}),Pv(e=>null!=e),Bv(Iy)),[0,0]);return{increaseViewportBy:l,listBoundary:o,overscan:c,topListHeight:a,visibleRange:s}},Ov(hy),{singleton:!0});const ww={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function bw(e,t,n,r,i,o){const{lastIndex:a,lastOffset:l,lastSize:c}=i;let s=0,d=0;if(e.length>0){s=e[0].offset;const t=e[e.length-1];d=t.offset+t.size}const u=n-a,f=s,h=l+u*c+(u-1)*r-d;return{bottom:d,firstItemIndex:o,items:Mw(e,i,o),offsetBottom:h,offsetTop:s,top:f,topItems:Mw(t,i,o),topListHeight:t.reduce((e,t)=>t.size+e,0),totalCount:n}}function Ew(e,t,n,r,i,o){let a=0;if(n.groupIndices.length>0)for(const t of n.groupIndices){if(t-a>=e)break;a++}const l=e+a,c=lw(t,l);return bw(Array.from({length:l}).map((e,t)=>({data:o[t+c],index:t+c,offset:0,size:0})),[],l,i,n,r)}function Mw(e,t,n){if(0===e.length)return[];if(!Ry(t))return e.map(e=>({...e,index:e.index+n,originalIndex:e.index}));const r=e[0].index,i=e[e.length-1].index,o=[],a=by(t.groupOffsetTree,r,i);let l,c=0;for(const r of e){let e;(!l||l.end<r.index)&&(l=a.shift(),c=t.groupIndices.indexOf(l.start)),e=r.index===l.start?{index:c,type:"group"}:{groupIndex:c,index:r.index-(c+1)+n},o.push({...e,data:r.data,offset:r.offset,originalIndex:r.index,size:r.size})}return o}function Aw(e,t){var n;return void 0===e?0:"number"==typeof e?e:null!=(n=e[t])?n:0}const xw=ey(([{data:e,firstItemIndex:t,gap:n,sizes:r,totalCount:i},o,{listBoundary:a,topListHeight:l,visibleRange:c},{initialTopMostItemIndex:s,scrolledToInitialItem:d},{topListHeight:u},f,{didMount:h},{recalcInProgress:p}])=>{const m=Yv([]),C=Yv(0),g=Jv(),v=Yv(0);Tv(o.topItemsIndexes,m);const y=Xv(qv(ny(h,p,ry(c,Iy),ry(i),ry(r),ry(s),d,ry(m),ry(t),ry(n),ry(v),e),Pv(([e,t,,n,,,,,,,,r])=>{const i=r&&r.length!==n;return e&&!t&&!i}),Fv(([,,[e,t],n,r,i,o,a,l,c,s,d])=>{var u,f,h,p;const m=r,{offsetTree:g,sizeTree:v}=m,y=Dv(C);if(0===n)return{...ww,totalCount:n};if(0===e&&0===t)return 0===y?{...ww,totalCount:n}:Ew(y,i,r,l,c,d||[]);if(Cy(v))return y>0?null:bw(function(e,t,n){if(Ry(t)){const r=Uy(e,t);return[{index:vy(t.groupOffsetTree,r)[0],offset:0,size:0},{data:null==n?void 0:n[0],index:r,offset:0,size:0}]}return[{data:null==n?void 0:n[0],index:e,offset:0,size:0}]}(lw(i,n),m,d),[],n,c,m,l);const w=[];if(a.length>0){const e=a[0],t=a[a.length-1];let n=0;for(const r of by(v,e,t)){const i=r.value,o=Math.max(r.start,e),a=Math.min(r.end,t);for(let e=o;e<=a;e++)w.push({data:null==d?void 0:d[e],index:e,offset:n,size:i}),n+=i}}if(!o)return bw([],w,n,c,m,l);const b=a.length>0?a[a.length-1]+1:0,E=Wy(g,e,t,b);if(0===E.length)return null;const M=n-1,A=Sv([],n=>{for(const r of E){const i=r.value;let o=i.offset,a=r.start;const l=i.size;if(i.offset<e){a+=Math.floor((e-i.offset+c)/(l+c));const t=a-r.start;o+=t*l+t*c}a<b&&(o+=(b-a)*l,a=b);const s=Math.min(r.end,M);for(let e=a;e<=s&&!(o>=t);e++)n.push({data:null==d?void 0:d[e],index:e,offset:o,size:l}),o+=l+c}}),x=Aw(s,pw),k=Aw(s,mw);if(A.length>0&&(x>0||k>0)){const e=A[0],t=A[A.length-1];if(x>0&&e.index>b){const t=Math.min(x,e.index-b),n=[];let r=e.offset;for(let i=e.index-1;i>=e.index-t;i--){const t=null!=(f=null==(u=by(v,i,i)[0])?void 0:u.value)?f:e.size;r-=t+c,n.unshift({data:null==d?void 0:d[i],index:i,offset:r,size:t})}A.unshift(...n)}if(k>0&&t.index<M){const e=Math.min(k,M-t.index);let n=t.offset+t.size+c;for(let r=t.index+1;r<=t.index+e;r++){const e=null!=(p=null==(h=by(v,r,r)[0])?void 0:h.value)?p:t.size;A.push({data:null==d?void 0:d[r],index:r,offset:n,size:e}),n+=e+c}}}return bw(A,w,n,c,m,l)}),Pv(e=>null!==e),Bv()),ww);Tv(qv(e,Pv(Hv),Fv(e=>null==e?void 0:e.length)),i),Tv(qv(y,Fv(e=>e.topListHeight)),u),Tv(u,l),Tv(qv(y,Fv(e=>[e.top,e.bottom])),a),Tv(qv(y,Fv(e=>e.items)),g);const w=$v(qv(y,Pv(({items:e})=>e.length>0),Kv(i,e),Pv(([{items:e},t])=>e[e.length-1].originalIndex===t-1),Fv(([,e,t])=>[e-1,t]),Bv(Iy),Fv(([e])=>e))),b=$v(qv(y,Gv(200),Pv(({items:e,topItems:t})=>e.length>0&&e[0].originalIndex===t.length),Fv(({items:e})=>e[0].index),Bv())),E=$v(qv(y,Pv(({items:e})=>e.length>0),Fv(({items:e})=>{let t=0,n=e.length-1;for(;"group"===e[t].type&&t<n;)t++;for(;"group"===e[n].type&&n>t;)n--;return{endIndex:e[n].index,startIndex:e[t].index}}),Bv(Ny)));return{endReached:w,initialItemCount:C,itemsRendered:g,listState:y,minOverscanItemCount:v,rangeChanged:E,startReached:b,topItemsIndexes:m,...f}},Ov($y,tw,yw,cw,ow,hw,nw,Dy),{singleton:!0}),kw=ey(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:r},{listState:i}])=>{const o=Jv(),a=Xv(qv(ny(n,e,r,t,i),Fv(([e,t,n,r,i])=>e+t+n+r+i.offsetBottom+i.bottom)),0);return Tv(ry(a),o),{totalListHeight:a,totalListHeightChanged:o}},Ov(hy,xw),{singleton:!0}),Lw=ey(([{viewportHeight:e},{totalListHeight:t}])=>{const n=Yv(!1);return{alignToBottom:n,paddingTopAddition:Xv(qv(ny(n,e,t),Pv(([e])=>e),Fv(([,e,t])=>Math.max(0,e-t)),Gv(0),Bv()),0)}},Ov(hy,kw),{singleton:!0}),Hw=ey(()=>({context:Yv(null)})),_w=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:r,...i},viewportBottom:o,viewportTop:a})=>t<a?{...i,align:null!=n?n:"start",behavior:r}:e>o?{...i,align:null!=n?n:"end",behavior:r}:null,Sw=ey(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:i,headerHeight:o,scrollingInProgress:a,scrollTop:l,viewportHeight:c},{scrollToIndex:s}])=>{const d=Jv();return Tv(qv(d,Kv(t,c,n,o,i,r,l),Kv(e),Fv(([[e,t,n,r,i,o,l,c],s])=>{const{align:d,behavior:u,calculateViewLocation:f=_w,done:h,...p}=e,m=qy(e,t,r-1),C=Fy(m,t.offsetTree,s)+i+o,g=f({itemBottom:C+vy(t.sizeTree,m)[1],itemTop:C,locationParams:{align:d,behavior:u,...p},viewportBottom:c+n-l,viewportTop:c+o});return g?h&&Zv(qv(a,Pv(e=>!e),Qv(Dv(a)?1:2)),h):h&&h(),g}),Pv(e=>null!==e)),s),{scrollIntoView:d}},Ov($y,hy,ow,xw,ly),{singleton:!0});function Vw(e){return!!e&&("smooth"===e?"smooth":"auto")}const Ow=ey(([{listRefresh:e,totalCount:t,fixedItemSize:n,data:r},{atBottomState:i,isAtBottom:o},{scrollToIndex:a},{scrolledToInitialItem:l},{didMount:c,propsReady:s},{log:d},{scrollingInProgress:u},{context:f},{scrollIntoView:h}])=>{const p=Yv(!1),m=Jv();let C=null;function g(e){Nv(a,{align:"end",behavior:e,index:"LAST"})}function v(e){const t=Zv(i,t=>{e&&!t.atBottom&&"SIZE_INCREASED"===t.notAtBottomBecause&&!C&&(Dv(d)("scrolling to bottom due to increased size",{},oy.DEBUG),g("auto"))});setTimeout(t,100)}zv(qv(ny(qv(ry(t),Qv(1)),c),Kv(ry(p),o,l,u),Fv(([[e,t],n,r,i,o])=>{let a=t&&i,l="auto";return a&&(l=((e,t)=>"function"==typeof e?Vw(e(t)):t&&Vw(e))(n,r||o),a=a&&!!l),{followOutputBehavior:l,shouldFollow:a,totalCount:e}}),Pv(({shouldFollow:e})=>e)),({followOutputBehavior:t,totalCount:r})=>{C&&(C(),C=null),Dv(n)?requestAnimationFrame(()=>{Dv(d)("following output to ",{totalCount:r},oy.DEBUG),g(t)}):C=Zv(e,()=>{Dv(d)("following output to ",{totalCount:r},oy.DEBUG),g(t),C=null})}),zv(qv(ny(ry(p),t,s),Pv(([e,,t])=>e&&t),Wv(({value:e},[,t])=>({refreshed:e===t,value:t}),{refreshed:!1,value:0}),Pv(({refreshed:e})=>e),Kv(p,t)),([,e])=>{Dv(l)&&v(!1!==e)}),zv(m,()=>{v(!1!==Dv(p))}),zv(ny(ry(p),i),([e,t])=>{e&&!t.atBottom&&"VIEWPORT_HEIGHT_DECREASING"===t.notAtBottomBecause&&g("auto")});const y=Yv(null),w=Jv();return Tv(iy(qv(ry(r),Fv(e=>{var t;return null!=(t=null==e?void 0:e.length)?t:0})),qv(ry(t))),w),zv(qv(ny(qv(w,Qv(1)),c),Kv(ry(y),l,u,f),Fv(([[e,t],n,r,i,o])=>t&&r&&(null==n?void 0:n({context:o,totalCount:e,scrollingInProgress:i}))),Pv(e=>!!e),Gv(0)),t=>{C&&(C(),C=null),Dv(n)?requestAnimationFrame(()=>{Dv(d)("scrolling into view",{}),Nv(h,t)}):C=Zv(e,()=>{Dv(d)("scrolling into view",{}),Nv(h,t),C=null})}),{autoscrollToBottom:m,followOutput:p,scrollIntoViewOnChange:y}},Ov($y,hw,ow,cw,nw,ly,hy,Hw,Sw)),zw=ey(([{data:e,firstItemIndex:t,gap:n,sizes:r},{initialTopMostItemIndex:i},{initialItemCount:o,listState:a},{didMount:l}])=>(Tv(qv(l,Kv(o),Pv(([,e])=>0!==e),Kv(i,r,t,n,e),Fv(([[,e],t,n,r,i,o=[]])=>Ew(e,t,n,r,i,o))),a),{}),Ov($y,cw,xw,nw),{singleton:!0}),Nw=ey(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=Yv(0);return zv(qv(e,Kv(r),Pv(([,e])=>0!==e),Fv(([,e])=>({top:e}))),e=>{Zv(qv(n,Qv(1),Pv(e=>e.items.length>1)),()=>{requestAnimationFrame(()=>{Nv(t,e)})})}),{initialScrollTop:r}},Ov(nw,hy,xw),{singleton:!0}),Iw=ey(([{scrollVelocity:e}])=>{const t=Yv(!1),n=Jv(),r=Yv(!1);return Tv(qv(e,Kv(r,t,n),Pv(([e,t])=>!!t),Fv(([e,t,n,r])=>{const{enter:i,exit:o}=t;if(n){if(o(e,r))return!1}else if(i(e,r))return!0;return n}),Bv()),t),zv(qv(ny(t,e,n),Kv(r)),([[e,t,n],r])=>{e&&r&&r.change&&r.change(t,n)}),{isSeeking:t,scrollSeekConfiguration:r,scrollSeekRangeChanged:n,scrollVelocity:e}},Ov(hw),{singleton:!0}),Dw=ey(([{scrollContainerState:e,scrollTo:t}])=>{const n=Jv(),r=Jv(),i=Jv(),o=Yv(!1),a=Yv(void 0);return Tv(qv(ny(n,r),Fv(([{scrollHeight:e,scrollTop:t,viewportHeight:n},{offsetTop:r}])=>({scrollHeight:e,scrollTop:Math.max(0,t-r),viewportHeight:n}))),e),Tv(qv(t,Kv(r),Fv(([e,{offsetTop:t}])=>({...e,top:e.top+t}))),i),{customScrollParent:a,useWindowScroll:o,windowScrollContainerState:n,windowScrollTo:i,windowViewportRect:r}},Ov(hy)),Tw=ey(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:i},{didMount:o},{useWindowScroll:a,windowScrollContainerState:l,windowViewportRect:c}])=>{const s=Jv(),d=Yv(void 0),u=Yv(null),f=Yv(null);return Tv(l,u),Tv(c,f),zv(qv(s,Kv(t,r,a,u,f,n)),([e,t,n,r,i,o,a])=>{const l=function(e){return My(e).map(({k:e,v:t},n,r)=>{const i=r[n+1];return{endIndex:i?i.k-1:1/0,size:t,startIndex:e}})}(t.sizeTree);r&&null!==i&&null!==o&&(n=i.scrollTop-o.offsetTop),e({ranges:l,scrollTop:n-=a})}),Tv(qv(d,Pv(Hv),Fv(Zw)),i),Tv(qv(o,Kv(d),Pv(([,e])=>void 0!==e),Bv(),Fv(([,e])=>e.ranges)),e),{getState:s,restoreStateFrom:d}},Ov($y,hy,cw,nw,Dw));function Zw(e){return{align:"start",index:0,offset:e.scrollTop}}const jw=ey(([{topItemsIndexes:e}])=>{const t=Yv(0);return Tv(qv(t,Pv(e=>e>=0),Fv(e=>Array.from({length:e}).map((e,t)=>t))),e),{topItemCount:t}},Ov(xw));function Rw(e){let t,n=!1;return()=>(n||(n=!0,t=e()),t)}const Bw=Rw(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),Pw=ey(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:r},{isAtBottom:i,isScrolling:o,lastJumpDueToItemResize:a,scrollDirection:l},{listState:c},{beforeUnshiftWith:s,gap:d,shiftWithOffset:u,sizes:f},{log:h},{recalcInProgress:p}])=>{const m=$v(qv(c,Kv(a),Wv(([,e,t,n],[{bottom:r,items:i,offsetBottom:o,totalCount:a},l])=>{const c=r+o;let s=0;return t===a&&e.length>0&&i.length>0&&(0===i[0].originalIndex&&0===e[0].originalIndex||(s=c-n,0!==s&&(s+=l))),[s,i,a,c]},[0,[],0,0]),Pv(([e])=>0!==e),Kv(r,l,n,i,h,p),Pv(([,e,t,n,,,r])=>!r&&!n&&0!==e&&t===dw),Fv(([[e],,,,,t])=>(t("Upward scrolling compensation",{amount:e},oy.DEBUG),e))));function C(n){n>0?(Nv(t,{behavior:"auto",top:-n}),Nv(e,0)):(Nv(e,0),Nv(t,{behavior:"auto",top:-n}))}return zv(qv(m,Kv(e,o)),([t,n,r])=>{r&&Bw()?Nv(e,n-t):C(-t)}),zv(qv(ny(Xv(o,!1),e,p),Pv(([e,t,n])=>!e&&!n&&0!==t),Fv(([e,t])=>t),Gv(1)),C),Tv(qv(u,Fv(e=>({top:-e}))),t),zv(qv(s,Kv(f,d),Fv(([e,{groupIndices:t,lastSize:n,sizeTree:r},i])=>{function o(e){return e*(n+i)}if(0===t.length)return o(e);{let n=0;const i=gy(r,0);let a=0,l=0;for(;a<e;){a++,n+=i;let r=t.length===l+1?1/0:t[l+1]-t[l]-1;a+r>e&&(n-=i,r=e-a+1),a+=r,n+=o(r),l++}return n}})),n=>{Nv(e,n),requestAnimationFrame(()=>{Nv(t,{top:n}),requestAnimationFrame(()=>{Nv(e,0),Nv(p,!1)})})}),{deviation:e}},Ov(hy,hw,xw,$y,ly,Dy)),Fw=ey(([e,t,n,r,i,o,a,l,c,s,d])=>({...e,...t,...n,...r,...i,...o,...a,...l,...c,...s,...d}),Ov(yw,zw,nw,Iw,kw,Nw,Lw,Dw,Sw,ly,Hw)),Uw=ey(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:r,fixedGroupSize:i,gap:o,groupIndices:a,heightEstimates:l,itemSize:c,sizeRanges:s,sizes:d,statefulTotalCount:u,totalCount:f,trackItemSizes:h},{initialItemFinalLocationReached:p,initialTopMostItemIndex:m,scrolledToInitialItem:C},g,v,y,w,{scrollToIndex:b},E,{topItemCount:M},{groupCounts:A},x])=>{const{listState:k,minOverscanItemCount:L,topItemsIndexes:H,rangeChanged:_,...S}=w;return Tv(_,x.scrollSeekRangeChanged),Tv(qv(x.windowViewportRect,Fv(e=>e.visibleHeight)),g.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:r,fixedGroupHeight:i,gap:o,groupCounts:A,heightEstimates:l,initialItemFinalLocationReached:p,initialTopMostItemIndex:m,scrolledToInitialItem:C,sizeRanges:s,topItemCount:M,topItemsIndexes:H,totalCount:f,...y,groupIndices:a,itemSize:c,listState:k,minOverscanItemCount:L,scrollToIndex:b,statefulTotalCount:u,trackItemSizes:h,rangeChanged:_,...S,...x,...g,sizes:d,...v}},Ov($y,cw,hy,Tw,Ow,xw,ow,Pw,jw,tw,Fw));function qw(e,t){const n={},r={};let i=0;const o=e.length;for(;i<o;)r[e[i]]=1,i+=1;for(const e in t)Object.hasOwn(r,e)||(n[e]=t[e]);return n}const Ww=typeof document<"u"?i.useLayoutEffect:i.useEffect;function Qw(t,n,r){const o=Object.keys(n.required||{}),a=Object.keys(n.optional||{}),l=Object.keys(n.methods||{}),c=Object.keys(n.events||{}),s=i.createContext({});function d(e,t){e.propsReady&&Nv(e.propsReady,!1);for(const r of o){Nv(e[n.required[r]],t[r])}for(const r of a)if(r in t){Nv(e[n.optional[r]],t[r])}e.propsReady&&Nv(e.propsReady,!0)}function u(e){return c.reduce((t,r)=>(t[r]=function(e){let t,n;const r=()=>null==t?void 0:t();return function(i,o){switch(i){case 1:return o?n===o?void 0:(r(),n=o,t=zv(e,o),t):(r(),_v);case 2:return r(),void(n=null)}}}(e[n.events[r]]),t),{})}const f=i.forwardRef((f,h)=>{const{children:p,...m}=f,[C]=i.useState(()=>Sv(function(e){const t=new Map,n=({constructor:e,dependencies:r,id:i,singleton:o})=>{if(o&&t.has(i))return t.get(i);const a=e(r.map(e=>n(e)));return o&&t.set(i,a),a};return n(e)}(t),e=>{d(e,m)})),[g]=i.useState(Lv(u,C));Ww(()=>{for(const e of c)e in m&&zv(g[e],m[e]);return()=>{Object.values(g).map(Iv)}},[m,g,C]),Ww(()=>{d(C,m)}),i.useImperativeHandle(h,Av(function(e){return l.reduce((t,r)=>(t[r]=t=>{Nv(e[n.methods[r]],t)},t),{})}(C)));const v=r;return e(s.Provider,{value:C,children:r?e(v,{...qw([...o,...a,...c],m),children:p}):p})});return{Component:f,useEmitter:(e,t)=>{const n=i.useContext(s)[e];Ww(()=>zv(n,t),[t,n])},useEmitterValue:i.version.startsWith("18")?e=>{const t=i.useContext(s)[e],n=i.useCallback(e=>zv(t,e),[t]);return i.useSyncExternalStore(n,()=>Dv(t),()=>Dv(t))}:e=>{const t=i.useContext(s)[e],[n,r]=i.useState(Lv(Dv,t));return Ww(()=>zv(t,e=>{e!==n&&r(Av(e))}),[t,n]),n},usePublisher:e=>{const t=i.useContext(s);return i.useCallback(n=>{Nv(t[e],n)},[t,e])}}}const Gw=i.createContext(void 0),Kw=i.createContext(void 0),Yw=typeof document<"u"?i.useLayoutEffect:i.useEffect;function Xw(e){return"self"in e}function Jw(e,t,n,r=_v,o,a){const l=i.useRef(null),c=i.useRef(null),s=i.useRef(null),d=i.useCallback(n=>{let r,i,o;const l=n.target;if(function(e){return"body"in e}(l)||Xw(l)){const e=Xw(l)?l:l.defaultView;o=a?e.scrollX:e.scrollY,r=a?e.document.documentElement.scrollWidth:e.document.documentElement.scrollHeight,i=a?e.innerWidth:e.innerHeight}else o=a?l.scrollLeft:l.scrollTop,r=a?l.scrollWidth:l.scrollHeight,i=a?l.offsetWidth:l.offsetHeight;const d=()=>{e({scrollHeight:r,scrollTop:Math.max(o,0),viewportHeight:i})};n.suppressFlushSync?d():M.flushSync(d),null!==c.current&&(o===c.current||o<=0||o===r-i)&&(c.current=null,t(!0),s.current&&(clearTimeout(s.current),s.current=null))},[e,t,a]);return i.useEffect(()=>{const e=o||l.current;return r(o||l.current),d({suppressFlushSync:!0,target:e}),e.addEventListener("scroll",d,{passive:!0}),()=>{r(null),e.removeEventListener("scroll",d)}},[l,d,n,r,o]),{scrollByCallback:function(e){a&&(e={behavior:e.behavior,left:e.top}),l.current.scrollBy(e)},scrollerRef:l,scrollToCallback:function(n){const r=l.current;if(!r||(a?"offsetWidth"in r&&0===r.offsetWidth:"offsetHeight"in r&&0===r.offsetHeight))return;const i="smooth"===n.behavior;let o,d,u;Xw(r)?(d=Math.max(jy(r.document.documentElement,a?"width":"height"),a?r.document.documentElement.scrollWidth:r.document.documentElement.scrollHeight),o=a?r.innerWidth:r.innerHeight,u=a?window.scrollX:window.scrollY):(d=r[a?"scrollWidth":"scrollHeight"],o=jy(r,a?"width":"height"),u=r[a?"scrollLeft":"scrollTop"]);const f=d-o;if(n.top=Math.ceil(Math.max(Math.min(f,n.top),0)),sw(o,d)||n.top===u)return e({scrollHeight:d,scrollTop:u,viewportHeight:o}),void(i&&t(!0));i?(c.current=n.top,s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{s.current=null,c.current=null,t(!0)},1e3)):c.current=null,a&&(n={behavior:n.behavior,left:n.top}),r.scrollTo(n)}}}const $w="-webkit-sticky",eb="sticky",tb=Rw(()=>{if(typeof document>"u")return eb;const e=document.createElement("div");return e.style.position=$w,e.style.position===$w?$w:eb});function nb(e){return e}const rb=ey(()=>{const e=Yv(e=>`Item ${e}`),t=Yv(e=>`Group ${e}`),n=Yv({}),r=Yv(nb),i=Yv("div"),o=Yv(_v),a=(e,t=null)=>Xv(qv(n,Fv(t=>t[e]),Bv()),t);return{components:n,computeItemKey:r,EmptyPlaceholder:a("EmptyPlaceholder"),FooterComponent:a("Footer"),GroupComponent:a("Group","div"),groupContent:t,HeaderComponent:a("Header"),HeaderFooterTag:i,ItemComponent:a("Item","div"),itemContent:e,ListComponent:a("List","div"),ScrollerComponent:a("Scroller","div"),scrollerRef:o,ScrollSeekPlaceholder:a("ScrollSeekPlaceholder"),TopItemListComponent:a("TopItemList")}}),ib=ey(([e,t])=>({...e,...t}),Ov(Uw,rb)),ob=({height:t})=>e("div",{style:{height:t}}),ab={overflowAnchor:"none",position:tb(),zIndex:1},lb={overflowAnchor:"none"},cb={...lb,display:"inline-block",height:"100%"},sb=i.memo(function({showTopList:t=!1}){const n=kb("listState"),r=Lb("sizeRanges"),o=kb("useWindowScroll"),a=kb("customScrollParent"),l=Lb("windowScrollContainerState"),c=Lb("scrollContainerState"),s=a||o?l:c,d=kb("itemContent"),u=kb("context"),f=kb("groupContent"),h=kb("trackItemSizes"),p=kb("itemSize"),C=kb("log"),g=Lb("gap"),v=kb("horizontalDirection"),{callbackRef:y}=dy(r,p,h,t?_v:s,C,g,a,v,kb("skipAnimationFrameInResizeObserver")),[w,b]=i.useState(0);xb("deviation",e=>{w!==e&&b(e)});const E=kb("EmptyPlaceholder"),M=kb("ScrollSeekPlaceholder")||ob,A=kb("ListComponent"),x=kb("ItemComponent"),k=kb("GroupComponent"),L=kb("computeItemKey"),H=kb("isSeeking"),_=kb("groupIndices").length>0,S=kb("alignToBottom"),V=kb("initialItemFinalLocationReached"),O=t?{}:{boxSizing:"border-box",...v?{display:"inline-block",height:"100%",marginLeft:0!==w?w:S?"auto":0,paddingLeft:n.offsetTop,paddingRight:n.offsetBottom,whiteSpace:"nowrap"}:{marginTop:0!==w?w:S?"auto":0,paddingBottom:n.offsetBottom,paddingTop:n.offsetTop},...V?{}:{visibility:"hidden"}};return!t&&0===n.totalCount&&E?e(E,{...pb(E,u)}):e(A,{...pb(A,u),"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list",ref:y,style:O,children:(t?n.topItems:n.items).map(e=>{const t=e.originalIndex,r=L(t+n.firstItemIndex,e.data,u);return H?m(M,{...pb(M,u),height:e.size,index:e.index,key:r,type:e.type||"item",..."group"===e.type?{}:{groupIndex:e.groupIndex}}):"group"===e.type?m(k,{...pb(k,u),"data-index":t,"data-item-index":e.index,"data-known-size":e.size,key:r,style:ab},f(e.index,u)):m(x,{...pb(x,u),...mb(x,e.data),"data-index":t,"data-item-group-index":e.groupIndex,"data-item-index":e.index,"data-known-size":e.size,key:r,style:v?cb:lb},_?d(e.index,e.groupIndex,e.data,u):d(e.index,e.data,u))})})}),db={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},ub={outline:"none",overflowX:"auto",position:"relative"},fb=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:{}}),hb={position:tb(),top:0,width:"100%",zIndex:1};function pb(e,t){if("string"!=typeof e)return{context:t}}function mb(e,t){return{item:"string"==typeof e?void 0:t}}const Cb=i.memo(function(){const t=kb("HeaderComponent"),n=Lb("headerHeight"),r=kb("HeaderFooterTag"),o=cy(i.useMemo(()=>e=>{n(jy(e,"height"))},[n]),!0,kb("skipAnimationFrameInResizeObserver")),a=kb("context");return t?e(r,{ref:o,children:e(t,{...pb(t,a)})}):null}),gb=i.memo(function(){const t=kb("FooterComponent"),n=Lb("footerHeight"),r=kb("HeaderFooterTag"),o=cy(i.useMemo(()=>e=>{n(jy(e,"height"))},[n]),!0,kb("skipAnimationFrameInResizeObserver")),a=kb("context");return t?e(r,{ref:o,children:e(t,{...pb(t,a)})}):null});function vb({useEmitter:t,useEmitterValue:n,usePublisher:r}){return i.memo(function({children:i,style:o,context:a,...l}){const c=r("scrollContainerState"),s=n("ScrollerComponent"),d=r("smoothScrollTargetReached"),u=n("scrollerRef"),f=n("horizontalDirection")||!1,{scrollByCallback:h,scrollerRef:p,scrollToCallback:m}=Jw(c,d,s,u,void 0,f);return t("scrollTo",m),t("scrollBy",h),e(s,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:p,style:{...f?ub:db,...o},tabIndex:0,...l,...pb(s,a),children:i})})}function yb({useEmitter:t,useEmitterValue:n,usePublisher:r}){return i.memo(function({children:o,style:a,context:l,...c}){const s=r("windowScrollContainerState"),d=n("ScrollerComponent"),u=r("smoothScrollTargetReached"),f=n("totalListHeight"),h=n("deviation"),p=n("customScrollParent"),m=i.useRef(null),C=n("scrollerRef"),{scrollByCallback:g,scrollerRef:v,scrollToCallback:y}=Jw(s,u,d,C,p);return Yw(()=>{var e;return v.current=p||(null==(e=m.current)?void 0:e.ownerDocument.defaultView),()=>{v.current=null}},[v,p]),t("windowScrollTo",y),t("scrollBy",g),e(d,{ref:m,"data-virtuoso-scroller":!0,style:{position:"relative",...a,...0!==f?{height:f+h}:{}},...c,...pb(d,l),children:o})})}const wb=({children:t})=>{const n=i.useContext(Gw),r=Lb("viewportHeight"),o=Lb("fixedItemHeight"),a=kb("alignToBottom"),l=kb("horizontalDirection"),c=cy(i.useMemo(()=>kv(r,e=>jy(e,l?"width":"height")),[r,l]),!0,kb("skipAnimationFrameInResizeObserver"));return i.useEffect(()=>{n&&(r(n.viewportHeight),o(n.itemHeight))},[n,r,o]),e("div",{"data-viewport-type":"element",ref:c,style:fb(a),children:t})},bb=({children:t})=>{const n=i.useContext(Gw),r=Lb("windowViewportRect"),o=Lb("fixedItemHeight"),a=kb("customScrollParent"),l=fy(r,a,kb("skipAnimationFrameInResizeObserver")),c=kb("alignToBottom");return i.useEffect(()=>{n&&(o(n.itemHeight),r({offsetTop:0,visibleHeight:n.viewportHeight,visibleWidth:100}))},[n,r,o]),e("div",{"data-viewport-type":"window",ref:l,style:fb(c),children:t})},Eb=({children:t})=>{const n=kb("TopItemListComponent")||"div",r=kb("headerHeight"),i={...hb,marginTop:`${r}px`},o=kb("context");return e(n,{style:i,...pb(n,o),children:t})},Mb=i.memo(function(t){const r=kb("useWindowScroll"),i=kb("topItemsIndexes").length>0,o=kb("customScrollParent"),a=kb("context");return n(o||r?_b:Hb,{...t,context:a,children:[i&&e(Eb,{children:e(sb,{showTopList:!0})}),n(o||r?bb:wb,{children:[e(Cb,{}),e(sb,{}),e(gb,{})]})]})}),{Component:Ab,useEmitter:xb,useEmitterValue:kb,usePublisher:Lb}=Qw(ib,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},Mb),Hb=vb({useEmitter:xb,useEmitterValue:kb,usePublisher:Lb}),_b=yb({useEmitter:xb,useEmitterValue:kb,usePublisher:Lb}),Sb=Ab,Vb=ey(()=>{const e=Yv(e=>n("td",{children:["Item $",e]})),t=Yv(null),r=Yv(e=>n("td",{colSpan:1e3,children:["Group ",e]})),i=Yv(null),o=Yv(null),a=Yv({}),l=Yv(nb),c=Yv(_v),s=(e,t=null)=>Xv(qv(a,Fv(t=>t[e]),Bv()),t);return{components:a,computeItemKey:l,context:t,EmptyPlaceholder:s("EmptyPlaceholder"),FillerRow:s("FillerRow"),fixedFooterContent:o,fixedHeaderContent:i,itemContent:e,groupContent:r,ScrollerComponent:s("Scroller","div"),scrollerRef:c,ScrollSeekPlaceholder:s("ScrollSeekPlaceholder"),TableBodyComponent:s("TableBody","tbody"),TableComponent:s("Table","table"),TableFooterComponent:s("TableFoot","tfoot"),TableHeadComponent:s("TableHead","thead"),TableRowComponent:s("TableRow","tr"),GroupComponent:s("Group","tr")}});Ov(Uw,Vb),tb();const Ob={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},zb={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:Nb,floor:Ib,max:Db,min:Tb,round:Zb}=Math;function jb(e,t,n){return Array.from({length:t-e+1}).map((t,r)=>({data:null===n?null:n[r+e],index:r+e}))}function Rb(e,t){return e&&e.width===t.width&&e.height===t.height}function Bb(e,t){return e&&e.column===t.column&&e.row===t.row}const Pb=ey(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:r},{footerHeight:i,headerHeight:o,scrollBy:a,scrollContainerState:l,scrollTo:c,scrollTop:s,smoothScrollTargetReached:d,viewportHeight:u},f,h,{didMount:p,propsReady:m},{customScrollParent:C,useWindowScroll:g,windowScrollContainerState:v,windowScrollTo:y,windowViewportRect:w},b])=>{const E=Yv(0),M=Yv(0),A=Yv(Ob),x=Yv({height:0,width:0}),k=Yv({height:0,width:0}),L=Jv(),H=Jv(),_=Yv(0),S=Yv(null),V=Yv({column:0,row:0}),O=Jv(),z=Jv(),N=Yv(!1),I=Yv(0),D=Yv(!0),T=Yv(!1),Z=Yv(!1);zv(qv(p,Kv(I),Pv(([e,t])=>!!t)),()=>{Nv(D,!1)}),zv(qv(ny(p,D,k,x,I,T),Pv(([e,t,n,r,,i])=>e&&!t&&0!==n.height&&0!==r.height&&!i)),([,,,,e])=>{Nv(T,!0),aw(1,()=>{Nv(L,e)}),Zv(qv(s),()=>{Nv(t,[0,0]),Nv(D,!0)})}),Tv(qv(z,Pv(e=>null!=e&&e.scrollTop>0),Uv(0)),M),zv(qv(p,Kv(z),Pv(([,e])=>null!=e)),([,e])=>{e&&(Nv(x,e.viewport),Nv(k,e.item),Nv(V,e.gap),e.scrollTop>0&&(Nv(N,!0),Zv(qv(s,Qv(1)),e=>{Nv(N,!1)}),Nv(c,{top:e.scrollTop})))}),Tv(qv(x,Fv(({height:e})=>e)),u),Tv(qv(ny(ry(x,Rb),ry(k,Rb),ry(V,(e,t)=>e&&e.column===t.column&&e.row===t.row),ry(s)),Fv(([e,t,n,r])=>({gap:n,item:t,scrollTop:r,viewport:e}))),O),Tv(qv(ny(ry(E),r,ry(V,Bb),ry(k,Rb),ry(x,Rb),ry(S),ry(M),ry(N),ry(D),ry(I)),Pv(([,,,,,,,e])=>!e),Fv(([e,[t,n],r,i,o,a,l,,c,s])=>{const{column:d,row:u}=r,{height:f,width:h}=i,{width:p}=o;if(0===l&&(0===e||0===p))return Ob;if(0===h){const t=lw(s,e);return function(e){return{...zb,items:e}}(jb(t,t+Math.max(l-1,0),a))}const m=Fb(p,h,d);let C,g;c?0===t&&0===n&&l>0?(C=0,g=l-1):(C=m*Ib((t+u)/(f+u)),g=m*Nb((n+u)/(f+u))-1,g=Tb(e-1,Db(g,m-1)),C=Tb(g,Db(0,C))):(C=0,g=-1);const v=jb(C,g,a),{bottom:y,top:w}=Ub(o,r,i,v),b=Nb(e/m);return{bottom:y,itemHeight:f,items:v,itemWidth:h,offsetBottom:b*f+(b-1)*u-y,offsetTop:w,top:w}})),A),Tv(qv(S,Pv(e=>null!==e),Fv(e=>e.length)),E),Tv(qv(ny(x,k,A,V),Pv(([e,t,{items:n}])=>n.length>0&&0!==t.height&&0!==e.height),Fv(([e,t,{items:n},r])=>{const{bottom:i,top:o}=Ub(e,r,t,n);return[o,i]}),Bv(Iy)),t);const j=Yv(!1);Tv(qv(s,Kv(j),Fv(([e,t])=>t||0!==e)),j);const R=$v(qv(ny(A,E),Pv(([{items:e}])=>e.length>0),Kv(j),Pv(([[e,t],n])=>{const r=e.items[e.items.length-1].index===t-1;return(n||e.bottom>0&&e.itemHeight>0&&0===e.offsetBottom&&e.items.length===t)&&r}),Fv(([[,e]])=>e-1),Bv())),B=$v(qv(ry(A),Pv(({items:e})=>e.length>0&&0===e[0].index),Uv(0),Bv())),P=$v(qv(ry(A),Kv(N),Pv(([{items:e},t])=>e.length>0&&!t),Fv(([{items:e}])=>({endIndex:e[e.length-1].index,startIndex:e[0].index})),Bv(Ny),Gv(0)));Tv(P,h.scrollSeekRangeChanged),Tv(qv(L,Kv(x,k,E,V),Fv(([e,t,n,r,i])=>{const o=iw(e),{align:a,behavior:l,offset:c}=o;let s=o.index;"LAST"===s&&(s=r-1),s=Db(0,s,Tb(r-1,s));let d=qb(t,i,n,s);return"end"===a?d=Zb(d-t.height+n.height):"center"===a&&(d=Zb(d-t.height/2+n.height/2)),c&&(d+=c),{behavior:l,top:d}})),c);const F=Xv(qv(A,Fv(e=>e.offsetBottom+e.bottom)),0);return Tv(qv(w,Fv(e=>({height:e.visibleHeight,width:e.visibleWidth}))),x),{customScrollParent:C,data:S,deviation:_,footerHeight:i,gap:V,headerHeight:o,increaseViewportBy:e,initialItemCount:M,itemDimensions:k,overscan:n,restoreStateFrom:z,scrollBy:a,scrollContainerState:l,scrollHeight:H,scrollTo:c,scrollToIndex:L,scrollTop:s,smoothScrollTargetReached:d,totalCount:E,useWindowScroll:g,viewportDimensions:x,windowScrollContainerState:v,windowScrollTo:y,windowViewportRect:w,...h,gridState:A,horizontalDirection:Z,initialTopMostItemIndex:I,totalListHeight:F,...f,endReached:R,propsReady:m,rangeChanged:P,startReached:B,stateChanged:O,stateRestoreInProgress:N,...b}},Ov(yw,hy,hw,Iw,nw,Dw,ly));function Fb(e,t,n){return Db(1,Ib((e+n)/(Ib(t)+n)))}function Ub(e,t,n,r){const{height:i}=n;if(void 0===i||0===r.length)return{bottom:0,top:0};const o=qb(e,t,n,r[0].index);return{bottom:qb(e,t,n,r[r.length-1].index)+i,top:o}}function qb(e,t,n,r){const i=Fb(e.width,n.width,t.column),o=Ib(r/i),a=o*n.height+Db(0,o-1)*t.row;return a>0?a+t.row:a}const Wb=ey(()=>{const e=Yv(e=>`Item ${e}`),t=Yv({}),n=Yv(null),r=Yv("virtuoso-grid-item"),i=Yv("virtuoso-grid-list"),o=Yv(nb),a=Yv("div"),l=Yv(_v),c=(e,n=null)=>Xv(qv(t,Fv(t=>t[e]),Bv()),n),s=Yv(!1),d=Yv(!1);return Tv(ry(d),s),{components:t,computeItemKey:o,context:n,FooterComponent:c("Footer"),HeaderComponent:c("Header"),headerFooterTag:a,itemClassName:r,ItemComponent:c("Item","div"),itemContent:e,listClassName:i,ListComponent:c("List","div"),readyStateChanged:s,reportReadyState:d,ScrollerComponent:c("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder","div")}}),Qb=ey(([e,t])=>({...e,...t}),Ov(Pb,Wb)),Gb=i.memo(function(){const t=tE("gridState"),n=tE("listClassName"),r=tE("itemClassName"),o=tE("itemContent"),a=tE("computeItemKey"),l=tE("isSeeking"),c=nE("scrollHeight"),s=tE("ItemComponent"),d=tE("ListComponent"),u=tE("ScrollSeekPlaceholder"),f=tE("context"),h=nE("itemDimensions"),p=nE("gap"),C=tE("log"),g=tE("stateRestoreInProgress"),v=nE("reportReadyState"),y=cy(i.useMemo(()=>e=>{const t=e.parentElement.parentElement.scrollHeight;c(t);const n=e.firstChild;if(n){const{height:e,width:t}=n.getBoundingClientRect();h({height:e,width:t})}p({column:oE("column-gap",getComputedStyle(e).columnGap,C),row:oE("row-gap",getComputedStyle(e).rowGap,C)})},[c,h,p,C]),!0,!1);return Yw(()=>{t.itemHeight>0&&t.itemWidth>0&&v(!0)},[t]),g?null:e(d,{className:n,ref:y,...pb(d,f),"data-testid":"virtuoso-item-list",style:{paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},children:t.items.map(n=>{const i=a(n.index,n.data,f);return l?e(u,{...pb(u,f),height:t.itemHeight,index:n.index,width:t.itemWidth},i):m(s,{...pb(s,f),className:r,"data-index":n.index,key:i},o(n.index,n.data,f))})})}),Kb=i.memo(function(){const t=tE("HeaderComponent"),n=nE("headerHeight"),r=tE("headerFooterTag"),o=cy(i.useMemo(()=>e=>{n(jy(e,"height"))},[n]),!0,!1),a=tE("context");return t?e(r,{ref:o,children:e(t,{...pb(t,a)})}):null}),Yb=i.memo(function(){const t=tE("FooterComponent"),n=nE("footerHeight"),r=tE("headerFooterTag"),o=cy(i.useMemo(()=>e=>{n(jy(e,"height"))},[n]),!0,!1),a=tE("context");return t?e(r,{ref:o,children:e(t,{...pb(t,a)})}):null}),Xb=({children:t})=>{const n=i.useContext(Kw),r=nE("itemDimensions"),o=nE("viewportDimensions"),a=cy(i.useMemo(()=>e=>{o(e.getBoundingClientRect())},[o]),!0,!1);return i.useEffect(()=>{n&&(o({height:n.viewportHeight,width:n.viewportWidth}),r({height:n.itemHeight,width:n.itemWidth}))},[n,o,r]),e("div",{ref:a,style:fb(!1),children:t})},Jb=({children:t})=>{const n=i.useContext(Kw),r=nE("windowViewportRect"),o=nE("itemDimensions"),a=tE("customScrollParent"),l=fy(r,a,!1);return i.useEffect(()=>{n&&(o({height:n.itemHeight,width:n.itemWidth}),r({offsetTop:0,visibleHeight:n.viewportHeight,visibleWidth:n.viewportWidth}))},[n,r,o]),e("div",{ref:l,style:fb(!1),children:t})},$b=i.memo(function({...t}){const r=tE("useWindowScroll"),i=tE("customScrollParent"),o=i||r?iE:rE,a=i||r?Jb:Xb,l=tE("context");return e(o,{...t,...pb(o,l),children:n(a,{children:[e(Kb,{}),e(Gb,{}),e(Yb,{})]})})}),{useEmitter:eE,useEmitterValue:tE,usePublisher:nE}=Qw(Qb,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},$b),rE=vb({useEmitter:eE,useEmitterValue:tE,usePublisher:nE}),iE=yb({useEmitter:eE,useEmitterValue:tE,usePublisher:nE});function oE(e,t,n){return"normal"!==t&&!(null!=t&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,oy.WARN),"normal"===t?0:parseInt(null!=t?t:"0",10)}const aE=({optionsList:r=[],onSelectVariable:i,dropdownPosition:o,position:a="relative",width:l,height:c="160px",zIndex:s=9999})=>{const d={LOCAL:"local_variable_icon",GLOBAL:"global_variable_icon",PROJECT_ENVIRONMENT:"project_env_variable_icon"},u=e=>{if(!e)return"";const t=e._id||e.id;return t?.startsWith("PARAMETER")?"step_group_parameter":"STEPGROUP"!==e?.parentVariableType||"LOCAL"!==e.type&&"STEPGROUP"!==e?.type?"_startforloop"===e.type?"for_loop_variable":"DATAPROVIDER"===e.type?"data_provider_variable":d[e.type||""]||"":"step_group_variable"},f=e=>"_startforloop"===e?.type?`FLV_for:${e?.name}`:"DATAPROVIDER"===e?.type?`${e?.dpName}:${e?.varname}`:e?.name;function h(e){if(e.endsWith("px")){const t=parseInt(e.slice(0,-2),10);return isNaN(t)?212:t-66}return 212}return e("div",{className:z("ff-variable-dropdown",a),style:o?{top:o.top+30,left:o.left-30,width:l,height:c,zIndex:s}:{width:l,height:c,zIndex:s},children:G(r)?e("div",{className:"ff-variable-option ff-variable-option-no-data",children:e(F,{as:"span",fontSize:12,children:"No Option"})}):e(Sb,{totalCount:r.length,itemContent:o=>{const a=r[o];return a?e("div",{className:"ff-variable-data",onMouseDown:()=>i(a),children:l.endsWith("px")?n(t,{children:[e(K,{title:oe(f(a),h(l),"pixel")?f(a):"",style:{width:`${h(l)}px`},children:e(F,{as:"span",fontSize:12,className:"ff-truncated_text",children:f(a)})}),e(P,{name:u(a),height:24,width:24,hoverEffect:!0})]}):e(Mv,{option:a})},`${a.id}-${o}`):null},style:{height:c,fontSize:"12px"},overscan:10,fixedItemHeight:32})})},lE=({data:r=[],width:i,height:o,lineChartWidth:a,yAxisLabel:c,xAxisLabel:d,yAxisValueColor:u,xAxisColor:f,yAxisColor:h,yAxisLabelColor:p,textSize:m,fontWeight:C,numberSize:g,chartName:v,shouldCenterSinglePoint:y,xAxisLabelGap:w=16,isLeftOverflow:b=!1})=>{const E=40,M=i-80,A=o-80,[x,k]=s(!1),[L,H]=s({cursorX:null,hoverValues:{},dotPositions:{},tooltip:{visible:!1,left:0,top:0},currentXValue:null});l(()=>{const e=()=>{k(!1),H(e=>({...e,tooltip:{...e.tooltip,visible:!1}}))};return window.addEventListener("scroll",e,!0),()=>window.removeEventListener("scroll",e,!0)},[]);if(!(r&&r.length>0&&r?.some(e=>Array.isArray(e?.data)&&e?.data?.length>0))){const t=[];for(let e=6;e>=0;e--){const n=new Date;n.setDate(n.getDate()-e);const r=n?.toLocaleDateString("en-US",{day:"numeric",month:"short"});t.push(r)}const r=1024,a=6,l=7;return n("div",{className:"ff-line-chart-text",style:{width:i+20+w,gap:w},children:[e("div",{className:"ff-line-chart-yAxisLabel-warpper",style:{height:o},children:e(F,{className:"ff-line-chart-yAxisLabel",fontSize:m,fontWeight:"semi-bold",children:c})}),e("div",{className:"ff-line-chart-svg",children:e("svg",{height:o,width:i,className:"ff-line-chart-svg",children:n("g",{transform:"translate(40, 40)",children:[e("line",{x1:0,y1:A,x2:M,y2:A,stroke:f,strokeWidth:1}),e("text",{x:M/2.1,y:A+E/1.2,textAnchor:"middle",fill:p,className:"ff-line-chart-x-axis-label",style:{fontSize:m,fontWeight:C},children:d}),t.map((t,n)=>e("text",{x:n*(M/(l-1)),y:A+15,textAnchor:0===n?"start":n===l-1?"end":"middle",fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:g},children:t},t)),Array.from({length:a}).map((t,n)=>{const i=n*r/(a-1),o=i/1024;return e("text",{x:-10,y:A-i*A/r,textAnchor:"end",fill:u,className:"ff-line-chart-y-axis-text",style:{fontSize:g},children:o?.toFixed(1)},`y-${n}`)})]})})})]})}function _(e){if(!isNaN(e))return parseFloat(e);const t=at,n=e.match(t);if(!n)throw new Error("Invalid input format. Use '<value> <unit>' format (e.g., '10.9580078125 KB') or just a number.");const r=parseFloat(n[1]);switch(n[2]?n[2].toUpperCase():null){case"GB":return parseFloat((1024*r).toFixed(2));case"MB":return parseFloat(r.toFixed(2));case"KB":return parseFloat((r/1024).toFixed(2));default:throw new Error("Invalid unit. Supported units are GB, MB, and KB.")}}const S=r?.[0]?.data?.[0]?.hasOwnProperty("date")&&r?.[0]?.data?.[0]?.hasOwnProperty("totalMemory"),V="date",O=S?"totalMemory":"value",z=e=>{const t=r?.[0]?.data?.length;if(1===t)return y?M/2:M;const n=r[0].data.findIndex(t=>t[V]===e);return-1===n?0:n/(t-1)*M},N=Math.max(...r?.flatMap(e=>e?.data?.map(e=>_(e[O]))),5),I=e=>{if("memory"===v){const t=Math.max(...r?.flatMap(e=>e?.data?.map(e=>_(e[O]))));return A-e*A/(t>1024?t:1024)}return A-e*A/(0===N?1024:N)},D=e=>{if(1===e?.length){const t=e?.[0],n=z(t[V]),r=I(_(t[O]));return`M 0 ${I(0)} L ${n} ${r}`}return e?.reduce((t,n,r)=>{const i=z(n[V]),o=I(_(n[O]));if(0===r)return`M ${i} ${o}`;const a=e[r-1],l=a?z(a[V]):0;return`${t} C ${l+(i-l)/2} ${a?I(_(a[O])):0}, ${i-(i-l)/2} ${o}, ${i} ${o}`},"")},T=r[0].data;return n("div",{className:"ff-line-chart-text",style:{width:i+20+w,gap:w},children:[e("div",{className:"ff-line-chart-yAxisLabel-warpper",style:{height:o},children:e(F,{className:"ff-line-chart-yAxisLabel",fontSize:m,fontWeight:"semi-bold",children:c})}),n("div",{className:"ff-line-chart-svg",children:[e("svg",{height:o,width:i,onMouseMove:e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left-E;if(e.clientY-t.top-E>A)return k(!1),void H({cursorX:null,hoverValues:{},dotPositions:{},tooltip:{visible:!1,left:0,top:0},currentXValue:null});let i={hoverValues:{},dotPositions:{}},o=null;r.forEach((e,t)=>{const r=e.data.reduce((e,t)=>{const r=Math.abs(n-z(t[V]));return r<e.distance?{point:t,distance:r}:e},{point:null,distance:1/0}).point;r&&(o=r[V],i.hoverValues[t]=((e,t=2)=>{let n="";if("string"==typeof e){const t=e.match(rt),r=e.match(it);t&&(e=parseFloat(t[0])),r&&(n=r[0])}const r=Math.pow(10,t);return`${Math.ceil(e*r)/r} ${n}`.trim()})(r[O]),i.dotPositions[t]={x:z(r[V]),y:I(_(r[O]))})}),k(!0),H({cursorX:n,hoverValues:i.hoverValues,dotPositions:i.dotPositions,currentXValue:o,tooltip:o?{visible:!0,left:e.clientX+10,top:e.clientY-20}:{visible:!1,left:0,top:0}})},onMouseLeave:()=>H({cursorX:null,hoverValues:{},dotPositions:{},tooltip:{visible:!1,left:0,top:0},currentXValue:null}),className:"ff-line-chart-svg",children:n("g",{transform:"translate(40, 40)",children:[e("line",{x1:0,y1:0,x2:0,y2:A,strokeWidth:2}),e("line",{x1:0,y1:A,x2:M,y2:A,stroke:f,strokeWidth:1}),e("text",{x:M/2.1,y:A+E/1.2,textAnchor:"middle",fill:p,className:"ff-line-chart-x-axis-label",style:{fontSize:m,fontWeight:C},children:d}),r.map((r,i)=>{return!1!==r.show?n("g",{children:[e("path",{d:D(r.data),fill:"none",stroke:r.color,strokeWidth:a,opacity:(o=r.data,o.every(e=>0===_(e[O]))?.5:1)}),L.dotPositions[i]&&n(t,{children:[e("line",{x1:L.dotPositions[i].x,y1:0,x2:L.dotPositions[i].x,y2:A,stroke:"gray",strokeWidth:.5,strokeDasharray:"4"}),e("circle",{cx:L.dotPositions[i].x,cy:L.dotPositions[i].y,r:5,fill:"white",stroke:r.color,strokeWidth:a,style:{transition:"cx 0.1s, cy 0.1s"}}),e("line",{x1:0,y1:L.dotPositions[i].y,x2:M,y2:L.dotPositions[i].y,stroke:"gray",strokeWidth:.5,strokeDasharray:"4"})]})]},i):null;var o}),(()=>{if(1===T.length){const t=T?.[0];return e("text",{x:y?M/2:M,y:A+15,textAnchor:y?"middle":"end",fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:g},children:null!=t[V]?String(t[V]):""},String(t[V]))}if(T.length<7)return T.map(t=>e("text",{x:z(t[V]),y:A+15,textAnchor:"middle",fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:g},children:null!=t[V]?String(t[V]):""},String(t[V])));{const t=(i-80-7*9.2)/6;return Array.from({length:7}).map((n,r)=>{const i=Math.floor(r*(T?.length-1)/6),o=T[i];return e("text",{x:r*t,y:A+15,fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:g},children:null!=o?.[V]?String(o?.[V]):""},String(o?.[V]))})}})(),(()=>{if("memory"===v){const t=Math.max(N,1024);return Array.from({length:6}).map((n,r)=>{const i=r*t/5,o=i/1024;return e("text",{x:-10,y:I(i),textAnchor:"end",fill:u,className:"ff-line-chart-y-axis-text",style:{fontSize:g},children:o.toFixed(1)},`y-${r}`)})}return Array.from({length:6}).map((t,n)=>{const r=n*N/5;return e("text",{x:-10,y:I(r),textAnchor:"end",fill:u,className:"ff-line-chart-y-axis-text",style:{fontSize:g},children:r.toFixed(0)},`y-${n}`)})})()]})}),x&&L.tooltip.visible&&n("div",{className:"ff-line-chart-tooltip",style:{left:b&&L.tooltip.left/2>i/1.75?L.tooltip.left-180:L.tooltip.left,top:L.tooltip.top},children:[e("div",{className:"ff-line-chart-date",children:L.currentXValue}),Object.entries(L.hoverValues).map(([t,i])=>!1!==r[Number(t)]?.show&&n("div",{className:"ff-line-chart-inner-tooltip",children:["default"!==r[Number(t)]?.name&&e("div",{className:"ff-line-chart-status-dot",style:{backgroundColor:r[Number(t)]?.color}}),r[Number(t)]?.name,": ",i]},t))]})]})]})},cE=({onClose:t,top:r="100px",left:i="0px",className:o,description:a="Download and Install the fireflink client to run the script",onClick:c=()=>{},optionZIndex:s=10000001})=>{l(()=>{const e=e=>{"Escape"===e.key&&t?.()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[t]);return n("div",{className:`ff-download-client-wrapper ${o}`,style:{top:r,left:i,zIndex:s},children:[n("div",{className:"ff-download-client-header-wrapper",children:[e("div",{className:"ff-download-client-hollow-triangle"}),e(F,{fontWeight:"semi-bold",lineHeight:"32px",className:"ff-download-client-header-text",children:"Download client"}),e(P,{name:"close",color:"var(--brand-color)",className:"ff-download-client-close-icon",height:12,width:12})]}),n("div",{className:"ff-download-client-content-text",children:[e(F,{as:"div",color:"var(--download-client-content-text-color)",fontWeight:"semi-bold",textAlign:"center",lineHeight:"26px",children:a}),e(F,{as:"div",className:"ff-download-client-description-text",textAlign:"center",fontWeight:"medium",lineHeight:"26px",children:"Choose OS to Download"}),e("div",{className:"ff-download-client-os-wrapper",children:["windows","mac_icon","linux"].map(t=>e("div",{className:"ff-os-version-wrapper",onClick:()=>{c("mac_icon"===t?"mac":t)},children:e(P,{name:t,height:36,width:36})},t))})]})]})},sE=({legendName:t,height:r,width:i,children:o})=>e("div",{className:"ff_fieldSet_container",children:n("fieldset",{className:"ff_fieldSet",style:{height:r,width:i},children:[e("legend",{className:"ff_legend_container",children:e(F,{color:"var(--license_header_text_color)",fontSize:8,lineHeight:"12px",children:t})}),e("div",{className:"ff_children_container",children:o})]})}),dE=({onSelectVariable:t,dropdownPosition:n,filteredOptions:r=[],position:i="relative",width:o="100%",zIndex:a,truncateTextValue:l=34})=>e("div",{className:z(`ff-variable-dropdown-container ${i}`),style:n?{top:n.top+30,left:n.left-30,width:o,zIndex:a}:{width:o,zIndex:a},children:G(r)?e("div",{className:"ff-variable-option no-data",children:e(F,{as:"div",children:"No Option",fontSize:14})}):r?.map(n=>e("div",{className:"ff-variable-option",onMouseDown:()=>t(n),children:e(K,{title:oe(n?.name,l,"pixel")?n?.name:"",children:e(F,{children:ie(n?.name,l,"pixel")})})},n?.id))}),uE=o(({label:t="",hashInputValue:r="",setHashInputValue:i,variableList:o=[],placeholder:c="Enter text",onChange:d,onPaste:u,onCreateVariableClick:f,handleClearInput:h,value:p="",dropdownWidth:m="100%",dropdownHeight:C="160px",isHash:g=!1,isOnlyHash:v=!1,dataFiles:y=[],showAddVariableIcon:w=!0,helperText:E="",error:M,autoComplete:A="off",required:x=!1,zIndex:k=9999,truncateTextValue:L=34,formProps:H={},getSelectedVariable:_=()=>{},symbol:S="$",type:V="text",clearIcon:O=!0,inputTitle:N="",onBlur:I,helperTextWidth:D,iconProps:T={isShowIcon:!1,iconName:"",iconToolTipTitle:"",isIconDisable:!1,iconColor:"",onIconClick:()=>{}},...Z},j)=>{const[R,B]=s(!1),[U,q]=s(!1),[W,Q]=s(!1),[Y,X]=s(null),[J,$]=s(0),[ee,te]=s(!1),[ne,re]=s([]),ie=a(null),oe=a(null),[ae,le]=s("auto"),ce=T?.isShowIcon;l(()=>{const e=oe.current?.querySelector(".ff-input-container");if(!e)return;const t=new ResizeObserver(e=>{for(let t of e){const e=`${t.contentRect.width}px`;le(e)}});return t.observe(e),()=>{t.disconnect()}},[]),b(j,()=>ie.current),l(()=>{null!==Y&&ie.current&&(ie.current.setSelectionRange(Y,Y),ie.current.focus())},[Y]),l(()=>{g&&B(p.startsWith("#"));const e=y?.find(e=>e.name===p),t=o?.find(e=>e?.name===p);if(p.startsWith("#")&&g){const e=p.slice(1).toLowerCase(),t=y.filter(t=>t.name.toLowerCase().includes(e));re(t),B(!0)}const n=null!==e&&p.startsWith("#"),r=null!==t&&p.startsWith("$"),i=p.length>(t?.name.length||0),a=p.length>0&&!r||p.startsWith("#");v?te(!1):r||n||p.includes("$")||p.includes("#")?(te(!1),a&&te(!0)):i&&!p.includes("$")&&te(!0)},[p]);const se=()=>{ie.current&&$(ie.current.selectionStart||0)},de=se,ue=se;l(()=>{ie.current&&$(ie.current.selectionStart||0)},[p]);const fe=e=>{if(ie.current){const{selectionStart:t,selectionEnd:n}=ie.current,r=`${e.name}`;let o;if(o=g&&"#"===p[0]?e.name+p.slice(n||1):e.name,d){d({target:{value:o}},e),_(e.name)}ie.current.value=o,i?.(e),X((t||0)+r.length),B(!1),q(!0)}};const he=function(e,t,n){let r=!1,i="";const o="}"===p[t-1];if(t<0||t>e.length)return{showDropdown:r,searchString:i};const a=e.lastIndexOf(S,t-1),l=e.indexOf(S,t);if(-1!==a&&(v&&"$"===e[a]?r=!1:t===a+1?(r=!0,i=""):(i=e.slice(a+1,-1===l?void 0:l),t>a+1&&(i=e.slice(a+1,t)),r=!0),U&&o&&(r=!1),(/[{}]/.test(i)||0===t)&&(r=!1,i=""),i)){n.some(e=>e.name.toLowerCase().includes(i.toLowerCase()))||(n=[])}return{showDropdown:r,searchString:i}}(p,J,o),pe=()=>o?.filter(e=>e?.name?.toLowerCase()?.includes(he?.searchString?.toLowerCase()));return n("div",{className:"ff-add-variable-container",children:[n("div",{className:"ff-add-variable-input",ref:oe,children:[e(K,{title:N,style:{width:"100%"},children:e(tn,{...Z,name:"add_variable",ref:ie,type:V,className:z("ff-variable-input-container",{"ff-variable-input-container--show-icon":ce}),value:p,onChange:d,onPaste:()=>{te(!0)},variant:"primary",label:t,placeholder:c,onClick:de,onKeyUp:ue,onFocus:()=>Q(!0),onBlur:e=>{(e=>{e.relatedTarget&&e.relatedTarget.closest(".dropdown-container")||Q(!1)})(e),I?.(e)},autoComplete:A,helperText:E,error:M,required:x,helperTextWidth:D,...H})}),!G(p)&&ee&&w&&e("div",{className:"ff-create-variable-container",onClick:f,children:e(F,{fontWeight:"regular",fontSize:"10px",color:"var(--brand-color)",cursor:"pointer",children:"Create Variable"})}),!G(p)&&!v&&e("div",{className:z("ff-cancel-icon-container",{"ff-cancel-icon-container--show-icon":ce}),children:O&&e(K,{title:"Cancel",style:{zIndex:99999},children:e(P,{onClick:h,name:"close",height:16,width:16,hoverEffect:!0})})}),ce&&e("div",{className:"ff-info-icon-container",children:e(K,{title:ce&&!T?.isIconDisable?T?.iconToolTipTitle:"",children:e(P,{name:T?.iconName||"",hoverEffect:!1,height:16,width:16,color:T?.iconColor||"var(--text-area-default-color)",onClick:e=>{T?.onIconClick&&T?.onIconClick(e)},disabled:T?.isIconDisable,cursorType:"pointer"})})})]}),he?.showDropdown&&W&&e(aE,{position:"absolute",zIndex:k,truncateTextValue:L,width:ae,height:G(pe())?"auto":C,optionsList:pe(),onSelectVariable:fe}),R&&g&&W&&e(dE,{position:"relative",zIndex:k,truncateTextValue:L,width:ae,filteredOptions:ne,onSelectVariable:fe})]})}),fE=({isOpen:t,variableTypesList:r=[],onClose:i,onNameChange:o,onValueChange:a,variableName:c,variableValue:d,onVariableTypeChange:u,selectedVariableType:f,hideValue:h=!1,onHideChange:p,handleSubmit:m,mode:C="create",disabled:g,dataFiles:v=[],truncateTextValue:y=34,isEnterKeySubmit:w=!1})=>{const[b,E]=s(!1),[M,A]=s(""),[x,k]=s(),[L,H]=s(!1),[_,S]=s(!1),[V,O]=s({name:"",value:"",isChecked:!1});l(()=>{t&&"edit"===C&&O({name:c,value:d,isChecked:h})},[]);const z=e=>e&&0!==e.length?" "===e[0]||" "===e[e.length-1]?"Space is not allowed at starting and at the end":Ee.test(e)?e.length<3?"Name should contain at least 3 characters":e.length>25?"Name can contain at most 25 characters":"":"Name should be alphanumeric":"Variable Name is required";function N(e){const t=!!e,n=Ee.test(e),r=Vt.test(e),i=e.length>=3&&e.length<=25;return t&&n&&r&&i}l(()=>{const e=z(c);E(!!e),A(e)},[c]),l(()=>{if("edit"!==C)return;const{name:e,value:t,isChecked:n}=V;S(c!==e||d!==t||h!==n)},[C,c,d,h,V]);const I=()=>{!L&&N(c)&&(H(!0),m())};l(()=>{if(!w)return;const e=e=>{if("Enter"===e.key){e.preventDefault();!N(c)||L||"edit"===C&&!_||I()}};return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}},[w,c,d,h,L,C,_,f]);return e(X,{zIndex:1350,onClose:i,isOpen:t,title:"create"===C?"Create Variable":"Edit Variable",width:"284px",height:"280px",top:"30%",right:8,isFooterRequired:!0,overlay:!0,footerContent:e(()=>n("div",{className:"ff-create-slider-footer",children:[e(U,{onClick:i,label:"Cancel",variant:"tertiary"}),e(U,{variant:"primary",label:"create"===C?"Create":"Update",type:"submit",onClick:I,disabled:!N(c)||L||"edit"===C&&!_})]}),{}),children:n("div",{className:"ff-create-variable-slider",children:[e("div",{className:"ff-create-variable-slider-input",children:e(tn,{label:"Variable Name",required:!0,type:"text",name:"variableName",value:c||"",onChange:e=>{H(!1),o(e.target.value)},error:b,helperText:M,onBlur:e=>{const t=e.target.value,n=z(t);E(!!n),A(n)}})}),e(or,{label:"Variable Type",required:!0,onChange:e=>{u(e),H(!1)},selectedOption:f,optionsList:r,optionZIndex:99999,valueAccessor:"label",disabled:"edit"===C}),e(uE,{label:"Variable Value",placeholder:"Enter Variable value or select path using #",isHash:!0,isOnlyHash:!0,zIndex:99999,truncateTextValue:y,dataFiles:v,dropdownWidth:"100%",setHashInputValue:k,hashInputValue:x||{},value:d||"",type:h?"password":"text",onChange:(e,t)=>{const n=e.target.value;a(n,t)},showAddVariableIcon:!1}),n("div",{className:"ff-hide-value-content",children:[e(te,{onChange:e=>p(e.target.checked),name:"hideValue",label:"Hide Value",checked:h,disabled:g}),e(K,{title:"Once the value is hidden, it cannot be undone",children:e(P,{name:"info",width:12,height:12})})]})]})})},hE=({highlightText:t="",tableMeta:r=[],tableData:i=[],accordionType:o="row",noDataContent:a,height:l="100%",withFixedHeader:c=!1,headerType:d,TableAccordionStateIconWidth:u=4,TableAccordionStateIconHeight:f=8})=>{const[h,p]=s(-1),m=(e,t)=>{let n=e[t.accessor];return t.cell?t.cell({value:n,row:e,column:t.accessor}):t.accessor||n&&"object"!=typeof n?n:"--"},C=t=>{const n=t.map((t,n)=>e("table",{className:"ff-accordion-table",cellSpacing:0,children:e("tbody",{className:"ff-table-body",children:e("tr",{className:"ff-table-row",children:r.map((n,r)=>e("td",{className:"ff-table-cell",style:{width:n.width},children:"column"===o&&0===r?"":e(F,{children:m(t,n)})},n.accessor+r))},t.id||n)})},`accordion-table-${n}`));return n};return n("div",{style:{height:l},className:z("ff-accordion-table-container",{"ff-accordion-fixed-header-table":c}),children:[e("table",{cellSpacing:0,className:z("ff-accordion-table",{"ff-accordion-fixed-header":c}),children:e("thead",{children:e("tr",{className:"ff-table-row",children:r.map(t=>e("th",{style:{width:t.width},className:z("ff-table-header",d&&`ff-accordion-table--${d}-bg`),children:e("div",{children:e(F,{fontWeight:"semi-bold",fontSize:12,children:t.header})})},`header-${t.header}`))})})}),"row"===o&&i.map((n,r)=>e($,{highlightText:t,headerTitle:n.title,color:"var(--text-color)",accordionContent:C(n.data),disable:n.disable,disableInfoMessage:n.disableInfoMessage,accordionStateIconName:"arrows_down_icon",AccordionStateIconWidth:u,AccordionStateIconHeight:f},`accordion-row-${r}`)),"column"===o&&i.map((i,o)=>n("div",{className:"column-table-accordion",children:[e("div",{className:"ff-display-flex",children:e(K,{title:i.disable?i?.disableInfoMessage:"string"==typeof i.title&&oe(i.title,r[0]?.width,"pixel")?i.title:"",placement:"bottom-start",children:n("div",{className:`accordion-header ${i.disable&&"accordion-header--disabled"}`,children:[e("div",{className:"header-title",children:e("span",{children:e(F,{children:e(J,{text:ie(i.title,r[0]?.width,"pixel"),highlight:t})})})}),e("div",{className:"accordion-arrow",onClick:()=>{!i.disable&&(e=>{p(e===h?-1:e)})(o)},children:e(P,{name:h===o?"arrows_down_icon":"arrows_right_icon",color:"var(--table-with-accordion-icon-color)",width:u,height:f,hoverEffect:!1})})]})})}),h===o&&e("div",{children:C(i.data)})]},`column-accordion-${o}`)),i.length<=0&&e("div",{className:"no-data-content",style:{height:`calc(${l} - 50px)`},children:a})]})},pE=({progressPercentage:t,totalMemory:r,usedMemory:i,color:o="var(--brand-color)",trackColor:a="#f0f0f0",height:l=10,label:c,labelFontSize:s=12,labelTextColor:d="var(--ff-card-status-text-color)",showPercentage:u=!1,percentageFontSize:f=10,percentageTextColor:h="var(--tooltip-text-color)",progressBarWidth:p="200px"})=>{const m=e=>{const t=e.trim().toLowerCase();if("0"===t)return 0;const n=t.match(/^(\d+(?:\.\d+)?)\s*(kb|mb|gb)$/);if(!n||!n[1])return 0;const r=parseFloat(n[1]),i=n[2];return"gb"===i?1024*r:"kb"===i?r/1024:r};let C=0,g=c;if(void 0!==r&&void 0!==i){const e=m(i),t=m(r);t>0?(C=e/t*100,g=c||i):(C=0,g="0MB")}else C=t||0;const v=Math.max(0,Math.min(C,100));return n("div",{className:"ff-progress-bar-container "+(g?"ff-has-label":""),style:{width:p},children:[e("div",{className:"ff-progress-bar-track",style:{backgroundColor:a,height:`${l}px`},children:e("div",{className:"ff-progress-bar",style:{width:`${v}%`,backgroundColor:o,height:`${l}px`},children:u&&e(F,{className:"ff-progress-bar-percentage",fontSize:f,color:h,children:`${Math.round(v)}%`})})}),g&&e("div",{className:"ff-progress-bar-label",children:e(F,{fontSize:s,color:d,children:e(K,{title:oe(g,10,"count")?g:"",children:ie(g,10,"count")})})})]})},mE=({variant:t="primary",size:n="small",onClick:r,label:i="Choose File",disabled:o=!1,type:l="button",className:c="",style:d={},iconName:f,isChooseFile:h=!1,buttonWidth:p="auto",buttonHeight:m="auto",selectedFile:C={},handleCloseIcon:g,isMandatory:v=!1})=>{const y=a(null),[w,b]=s(0);u(()=>{y.current&&b(y.current.getBoundingClientRect().width-10)},[p]);const E=C?.name||i,M=w?ie(E,w,"pixel"):E,A=!!w&&oe(E,w,"pixel");return e("div",{ref:y,style:{width:p},children:e(K,{title:A?E:"",children:e(U,{variant:t,label:M,type:l,onClick:r,buttonWidth:p,buttonHeight:m,isChooseFile:h,size:n,disabled:o,className:c,iconName:f,style:d,iconPosition:"right",selectedFile:C,handleCloseIcon:g,isMandatory:v})})})},CE=({selected:t="text",handleClick:r,tabList:i})=>{const o=i?.includes("Automation"),a=i?.includes("Manual");return n("div",{className:"ff-script-switch-container",children:[e(K,{title:o?"Automation":"Add Automation",zIndex:1e3,children:e("div",{className:"ff-script-switch-button "+("Automation"===t?"active":""),onClick:()=>r(o?"Automation":"Add Automation"),children:e(P,{name:o?"automation_testcase":"add_testcase",color:"Automation"===t?"var(--primary-button-text-color)":"var(--description-text)"})})}),e(K,{title:a?"Manual":"Add Manual",zIndex:1e3,children:e("div",{className:"ff-script-switch-button "+("Manual"===t?"active":""),onClick:()=>r(a?"Manual":"Add Manual"),children:e(P,{name:a?"manual_testcase":"add_testcase",color:"Manual"===t?"var(--primary-button-text-color)":"var(--description-text)"})})})]})},gE=({selected:t,handleClick:n,tabList:r})=>e("div",{className:"ff-switch-container",children:r.map(r=>e(K,{title:t===r.name?null:r.tooltip,zIndex:1e3,children:e("div",{className:"ff-switch-button "+(t===r.name?"active":""),onClick:()=>n(r.name),children:e(P,{name:r.icon,color:t===r.name?"var(--primary-button-text-color)":"var(--description-text)"})})},r.name))}),vE=({onModalClose:t,MediaSrc:r,fileName:o,onDeleteClick:a,mediaType:c,fileId:d,thumbnailMediaSrc:u,isDelete:f=!0,onExpandClick:h,onDownloadClick:p,isMediaIcon:m=!1,previewOnly:C=!1,iconName:g="video_preview",isDisabled:v=!1})=>{const[y,w]=s(!1),b=i.useRef(null),E=()=>{w(!0),h&&h(d)},M=()=>{t?.(),w(!1)},A=()=>{p&&p(d)};return l(()=>{C&&w(!0)},[C]),n("div",{children:[!C&&(m?e(P,{name:g,hoverEffect:!0,onClick:E,disabled:v}):e(bv,{mediaSrc:r,mediaType:c,onDownloadClick:A,onDeleteClick:()=>a?.(r),onExpandClick:E,fileName:o,fileId:d,thumbnailMediaSrc:u,isDelete:f})),y&&e(Xf,{isOpen:y,onClose:M,isFooterDisplayed:!1,isHeaderDisplayed:!1,customWidth:"1130px",customHeight:"570px",zIndex:1e4,children:n("div",{className:"media-wrapper",children:[n("div",{className:"ff-expand-icons",children:[e(K,{title:"Download File",children:e(P,{name:"download_file_icon",onClick:A,color:"var(--icons-default-color)",className:"header-icons"})}),e(K,{title:"Expand",children:e(P,{name:"expand",onClick:E,color:"var(--icons-default-color)",className:"header-icons"})}),e(K,{title:"close",children:e(P,{name:"close",onClick:M,color:"var(--icons-default-color)",className:"header-icons"})})]}),"image"===c&&e("img",{src:r,alt:"fileName",height:"auto",width:"auto"}),"video"===c&&e("video",{src:r,controls:!0,controlsList:"nodownload",className:"ff-video-preview",ref:b,onCanPlay:()=>{if(b.current){const e=b.current.play();void 0!==e&&e.catch(e=>{console.error("Autoplay failed:",e)})}}})]})})]})},yE=({children:t,orientation:r="",navBarIcons:o=[],mobileHeight:a=448,mobileWidth:l=220,UtilityBar:c,tooltip:s={},background:d,navBarPosition:u="bottom"})=>{const f="portrait"===r,h=f?a:l,p=f?l:a,m=c&&"top"===u,C=c&&"bottom"===u,g=c&&"left"===u;return n("div",{className:["ff-mobileskin-wrapper",f?"portrait":"landscape",g?"ff-side-nav-left":"",m?"navbar-top":"",C?"navbar-bottom":""].filter(Boolean).join(" "),children:[m&&e("div",{className:"ff-nav-bar top-nav-bar",children:o.map(({title:t,name:n,className:r,...i},a)=>{const l=s?.[n]??a;return e(K,{title:s?.[n]||"",placement:"top",children:e("div",{className:`ff-nav-bar-icon ${r||""} ${a===o.length-1?"last-icon":""} ${m?"navbar-top":""}`,children:e(P,{name:n,...i})})},l)})}),e("div",{className:"ff-mobileskin-container",style:{height:h+16,width:p+16},children:e("div",{className:"ff-mobile-container",style:{width:p,height:h,background:d||"transparent"},children:e("div",{className:"ff-mobile-image-container",children:i.isValidElement(t)?t:e("img",{src:t,alt:"Mobile content",style:{width:f?"100%":2.1*l+"px",height:f?"100%":.5*a+"px"}})})})}),c&&C&&e("div",{className:"ff-nav-bar",children:o?.map((t,n)=>{const{title:r,...i}=t;return e("div",{className:`ff-nav-bar-icon ${t?.className||""} ${n===o.length-1?"last-icon":""}`,children:e(K,{title:r,children:e(P,{...i})})},n)})}),c&&g&&e("div",{className:"ff-side-nav-bar",children:o?.map((t,n)=>{const{title:r,...i}=t;return e("div",{className:`ff-sidebar ${t?.className||""} ${n===o.length-1?"last-icon":""}`,children:e(K,{title:r,placement:"bottom",children:e(P,{...i})})},n)})})]})},wE=o(({width:t=300,height:r=40,iconHeight:i=16,iconWidth:o=16,placeholder:l="Enter text",iconName:c="right_arrow_filled_icon",iconPosition:s="left",borderRadius:d=4,autoFocus:u=!1,value:f="",iconColor:h="var(--brand-color)",tooltipTitle:p="send",submitPrompt:m,onPromptChange:C,onBlur:g,onFocus:v,disableInput:y,isAdditionalIcon:w=!1,additionalIconName:b,additionIconToolTip:E,onAdditionalIconClick:M},A)=>{const x=a(null);se([{key:"Enter",action:()=>k()}],x);const k=e=>{f&&m?.(f.trim())};return n("div",{className:z("ff-prompt-container",{"icon-left":"left"===s,"icon-right":"left"!==s}),style:{width:`${t}px`,height:`${r}px`,borderRadius:d},ref:x,children:[e(K,{placement:"top",title:p,children:e(P,{name:c,className:"ff-prompt-icon",height:i,width:o,onClick:m,color:h,disabled:G(f)})}),e("input",{ref:A,className:"ff-prompt-input",type:"text",placeholder:l,autoFocus:u,onChange:C,onFocus:v,onBlur:g,value:f,readOnly:y}),w&&b&&e(K,{placement:"top",title:E,children:e(P,{name:b,className:"ff-prompt-icon additional-icon",height:i,width:o,onClick:M})})]})}),bE=({content:t,isVisible:n,maxWidth:r=300,onClick:i,isClickable:o=!0,arrowPosition:a="left"})=>e("div",{onClick:i,style:{width:`${r}px`,"--triangle-position":r-4+"px"},className:z("ff-chat-msg-box",{visible:n,hidden:!n,pointer:o,default:!o,"chat-arrow-left":"left"===a,"chat-arrow-right":"left"!==a}),children:e("div",{className:z("content",`arrow-${a}`),children:e(F,{children:t})})}),EE=({iconName:r,iconPosition:{top:i,left:o,bottom:a,right:l},hoverIconPosition:{top:c,left:d,bottom:u,right:f},modalPosition:{top:h,left:p,bottom:m,right:C},modalWidth:g,modalHeight:v,headerContent:y="Header Content",footerContent:w="Footer Content",iconWidth:b,iconHeight:E,modalHeading:M="Ask Fia",children:x,onClearChat:k})=>{const[L,H]=s(!1),[_,S]=s(!1);return n(t,{children:[n("div",{style:{top:void 0!==i?`${i}px`:void 0,left:void 0!==o?`${o}px`:void 0,bottom:void 0!==a?`${a}px`:void 0,right:void 0!==l?`${l}px`:void 0},className:"ff-dynamic-icon-container",children:[e(P,{className:"ff-dynamic-icon",name:r,onClick:()=>{S(e=>!e),setTimeout(()=>H(e=>!e),10)},height:E,width:b}),e("div",{style:{top:void 0!==c?`${c}px`:void 0,left:void 0!==d?`${d}px`:void 0,bottom:void 0!==u?`${u}px`:void 0,right:void 0!==f?`${f}px`:void 0},className:"ff-chat-icon-hover",children:e(P,{name:"ask_fia_icon",height:32,width:82})})]}),_&&A(e("div",{className:z("ff-dynamic-modal",{open:L}),style:{top:void 0!==h?`${h}px`:void 0,left:void 0!==p?`${p}px`:void 0,bottom:void 0!==m?`${m}px`:void 0,right:void 0!==C?`${C}px`:void 0,position:"fixed",height:v,width:g},children:n("div",{className:"ff-dynamic-modal-content",children:[y&&e("div",{className:"ff-dynamic-modal-header",children:n("div",{className:"header-container",children:[n("div",{className:"header-left",children:[e(P,{height:16,width:16,name:"fia_icon"}),e(F,{fontWeight:"medium",children:M})]}),n("div",{className:"header-right",children:[e("span",{className:"action",children:e(K,{title:"Clear chat",placement:"bottom",children:e(P,{height:16,width:16,name:"delete",color:"var(--tooltip-text-color)",onClick:k})})}),e("span",{className:"action",children:e(K,{title:"Close",placement:"bottom",children:e(P,{height:16,width:16,name:"close",color:"var(--tooltip-text-color)",onClick:()=>(H(!1),void setTimeout(()=>S(!1),300))})})})]})]})}),e("div",{className:"ff-dynamic-modal-body",children:x}),w&&e("div",{className:"ff-dynamic-modal-footer",children:w})]})}),document.body)]})},ME=o(({iconName:r,hoverTitle:i,iconPosition:{top:o,left:c,bottom:d,right:u},hoverIconPosition:{top:f,left:h,bottom:p,right:m},modalPosition:{top:C,left:g,bottom:v,right:y},modalWidth:w,modalHeight:E,headerContent:M="Header Content",footerContent:x="Footer Content",iconWidth:k,iconHeight:L,children:H,onVisibilityChange:_},S)=>{const[V,O]=s(!1),[N,I]=s(!1),D=a(null),T=()=>{D.current&&clearTimeout(D.current),O(!1),D.current=setTimeout(()=>{I(!1),_?.(!1)},300)};return b(S,()=>({closeModal:T})),l(()=>()=>{D.current&&clearTimeout(D.current)},[]),n(t,{children:[n("div",{style:{top:void 0!==o?`${o}px`:void 0,left:void 0!==c?`${c}px`:void 0,bottom:void 0!==d?`${d}px`:void 0,right:void 0!==u?`${u}px`:void 0},className:"ff-ai-dynamic-icon-container",children:[e(P,{className:"ff-ai-dynamic-icon",name:r,onClick:()=>{D.current&&clearTimeout(D.current),I(e=>!e),_?.(!N),D.current=setTimeout(()=>O(e=>!e),10)},height:L,width:k}),e("div",{style:{top:void 0!==f?`${f}px`:void 0,left:void 0!==h?`${h}px`:void 0,bottom:void 0!==p?`${p}px`:void 0,right:void 0!==m?`${m}px`:void 0},className:"ff-ai-chat-icon-hover",children:e("div",{className:"ai-hover-leaf",children:e(F,{fontWeight:"bold",fontSize:14,color:"var(--chatbot-leaf-text)",children:i})})})]}),N&&A(e("div",{className:z("ff-ai-dynamic-modal",{open:V}),style:{top:void 0!==C?`${C}px`:void 0,left:void 0!==g?`${g}px`:void 0,bottom:void 0!==v?`${v}px`:void 0,right:void 0!==y?`${y}px`:void 0,position:"fixed",height:E,width:w},children:n("div",{className:"ff-ai-dynamic-modal-content",children:[M&&e("div",{className:"ff-ai-dynamic-modal-header",children:M}),e("div",{className:"ff-ai-dynamic-modal-body",children:H}),x&&e("div",{className:"ff-ai-dynamic-modal-footer",children:x})]})}),document.body)]})}),AE=({variant:t,title:r,tabTitle:i,comment:o,profileShortName:a})=>n("div",{className:"ff-history-card",children:[e("div",{className:z("header",`header--${t}`),children:e(F,{fontWeight:"semi-bold",children:i})}),n("div",{className:"body",children:[e("div",{className:"title",children:n("div",{className:"profile",children:[e(F,{className:z("avatar",`avatar--${t}`),children:a}),e(F,{children:r})]})}),n("div",{className:"comment-container",children:[e(F,{fontWeight:"semi-bold",className:"heading",children:"Comments:"}),e(F,{color:"var(--details-page-value-color)",className:"comment",children:o})]})]})]}),xE=({onChange:t,disabled:r,checked:i=!1,id:o="toggle",path:a})=>n("div",{className:"ff--ai-switch-container",children:[e("input",{className:"ff--ai-switch-checkbox",id:`ff-toggle-${o}`,type:"checkbox",disabled:!!r,onChange:e=>{t&&t(e)},checked:i}),e("label",{className:z("ff--ai-switch-label",{"ff--ai-switch-label--disabled":r}),htmlFor:`ff-toggle-${o}`,children:e("span",{className:"ff--ai-switch-content",children:n("span",{className:"ff--ai-switch-content",children:[e(F,{className:z("ff--ai-switch-typography",{left:i,right:!i}),as:"div",fontWeight:"bold",fontSize:18,color:i?"var(--base-bg-color)":"var(--ff-ai-toggle-text-color)",children:"AI"}),e("img",{className:"ff--ai-switch-image",src:a,alt:"AI image"})]})})})]}),kE=o(({name:t,height:n=30,width:r=30,path:i="",onClick:o,color:c="var(--brand-color)",hoverEffect:s=!1,className:d="",disabled:u=!1,variant:f="light",isSelected:h=!1,x:p,y:m,tabIndex:C=-1,...g},v)=>{if(!B[t])return null;const y=a(null);l(()=>{y.current&&(void 0!==p&&y.current.setAttribute("x",String(p)),void 0!==m&&y.current.setAttribute("y",String(m)))},[p,m]);const w={ref:v,onClick:u?void 0:o,style:{height:`${n}px`,width:`${r}px`,cursor:u?"not-allowed":"pointer",opacity:u?.3:1},tabIndex:C,...g};return e("span",{...w,children:e("img",{height:n,width:r,src:i,alt:""})})}),LE=({id:r=0,serialNumber:i,activeId:o,setActiveId:c,children:d,onIconClick:u,numberChildren:f,onContainerClick:h,onNextClick:p,onPreviousClick:m,disabled:C,isEditAccess:g,versionsLength:v,count:y,hiddenActions:w=[]})=>{const[b,E]=s(!1),[M,A]=s(!1),x=a(null),k=Array.isArray(w)?w:w?[w]:[],L=(e,t)=>{e.stopPropagation(),t()};l(()=>{x.current&&(()=>{if(x.current){const e=getComputedStyle(x.current),t=1.2*parseFloat(e.fontSize)*6;x.current.scrollHeight>t&&A(!0)}})()},[]);const H=e=>{e.stopPropagation(),E(!b)};return n("div",{className:`ff-prompt-container-Block ${o===r?"active":"inactive"} `,onClick:()=>{c(r),h()},children:[e(F,{fontSize:8,className:"ff-prompt-number-bg-color",as:"span",children:`Test cases ${i}`}),n(t,{children:[n("div",{className:"ff-prompt-content "+(b?"expanded":""),ref:x,children:[d,b&&n(t,{children:[e("span",{role:"button","aria-label":"toggleExpand",onClick:H,className:"read-less-btn",children:e(F,{color:"var(--brand-color)",fontWeight:"semi-bold",className:"read-more-btn-text",children:"Read Less"})})," "]})]}),M&&!b&&e("div",{role:"button","aria-label":"toggleExpand",onClick:H,className:"read-more-btn",children:e(F,{color:"var(--brand-color)",fontWeight:"semi-bold",className:"read-more-btn-text",children:"Read More"})})]}),n("div",{className:"ff-prompt-icons",children:[e("div",{className:"ff-prompt-icons-leftside",children:[{action:"delete",title:"Delete",color:"var(--ff-delete-button-attachment)"},{action:"edit",title:"Edit",color:"var(--label-edit-text-label-color)"},{action:"regenerate",title:"Regenerate",color:"var(--label-edit-text-label-color)"}].filter(e=>!k.includes(e.action)).map((t,n)=>{const r=g&&"delete"===t?.action||"regenerate"===t?.action&&(v??0)>=3||C;return e(K,{title:t.title,placement:"bottom",children:e(P,{disabled:r,name:t.action,color:t.color,hoverEffect:!0,onClick:e=>((e,t)=>{e.stopPropagation(),u(t)})(e,t.action)})},`${t?.title}-${n}`)})}),n("div",{className:"ff-prompt-icons-rightside",children:[e(P,{disabled:1===y,className:"ff-prompt-icons-style",name:"arrow_left_accordian",color:"var(--table-column-text-color)",width:18,height:18,onClick:e=>L(e,m)}),f,e(P,{disabled:y===v,className:"ff-prompt-icons-style",name:"arrow_right_icon",color:"var(--table-column-text-color)",width:18,height:18,onClick:e=>L(e,p)})]})]})]})},HE=o(({type:t="text",variant:r="primary",name:i="",label:o,disabled:a=!1,disableLinkIcon:l=!1,required:c=!1,placeholder:s="Attach Link",value:d,error:u,helperText:f,noBorder:h,className:p="",onChange:m,onBlur:C,onFocus:g,autoComplete:v="off",autoFocus:y=!1,minValue:w=-1/0,maxValue:b=1/0,transparentBackground:E=!1,size:M="small",isLabelRequired:A=!0,onClick:x,onKeyUp:k,isViewMode:L=!1,...H},_)=>{const S=!G(d);return n("fieldset",{className:z("ff-link-input-fieldset",{"ff-link-input-fieldset--disabled":a}),children:[n("div",{className:z("ff-link-input-container",{"ff-link-input-container--float":S,"ff-link-input-container--disabled":!!a}),children:[A&&n("label",{className:z(`ff-link-input-label-container ff-link-input-label-container--${M}`,{"ff-link-input-label-container--danger":!!u}),htmlFor:i,children:[c&&e("span",{className:"required-asterisk",children:"*"}),e("span",{className:z(`ff-link-input-label ff-link-input-label--${r}`,{"ff-link-input-label--no-hover":!!d,"ff-link-input-label--disabled":!!a,"ff-link-input-label--danger":!!u}),children:o})]}),e("input",{ref:_,name:i,value:d,type:t,spellCheck:!1,id:i,className:z(`ff-link-input ff-link-input-${r} default-input ff-link-input--${M}`,{"ff-link-input--transparentBackground":!!E,"ff-link-input--no-hover":!!d,"ff-link-input--disabled":!!a,"ff-link-input--danger":!!u,"ff-link-input--no-border":!!h,"ff-link-input--placeholder":!A},`${p}`),placeholder:s,disabled:L||a,onChange:m,onFocus:g,onBlur:C,autoComplete:v,autoFocus:y,min:w,max:b,onClick:x,onKeyUp:k,...H}),e("div",{className:"input-link-icon",children:l||u||!S?e(P,{name:"link",disabled:!0}):e(K,{title:"Click here to navigate",children:e("span",{children:e(P,{name:"link",disabled:!1,onClick:()=>{d&&!u&&window.open(d,"_blank")}})})})})]}),f&&u&&e("span",{className:z("ff-link-input-message",{"ff-link-input-message--danger":!!u}),children:f})]})}),_E=({labelsList:r=[],height:i=""})=>{const o=e("div",{className:"ff-chip-tooltip",children:r.filter((e,t)=>t>0).map((t,n)=>e(F,{as:"div",className:"ff-chip-tooltip-label",children:t},`label-${n}-${t}`))});return e(t,{children:!G(r)&&n("div",{className:"ff-chip-with-count-container",children:[e(K,{title:r[0],children:e(F,{as:"div",children:ie(r[0]||"",10),className:"ff-chip-label",fontWeight:"medium",style:i?{height:i}:void 0})}),r.length>1&&e(K,{title:e(F,{as:"div",children:o}),children:e(F,{as:"div",children:"+"+(r.length-1),className:"ff-chip-count",fontWeight:"medium"})})]})})};class SE extends E{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){console.error("ErrorBoundary caught an error:",e,t)}render(){return this.state.hasError?this.props.fallback:this.props.children}}const VE=({iconName:t="",onButtonClick:r,buttonLabel:i="Label",buttonText:o="To Add Group",disableButton:a=!1,stepCount:l=1,iconWidth:c=120,iconHeight:s=120,addContentLabel:d="step"})=>n("div",{className:"add-content-button "+(a?"disabled":""),children:[!G(t)&&e("div",{className:"icon-container",children:e(P,{name:t,width:c,height:s})}),n("div",{className:"typography-label-button",children:[n(F,{fontSize:"12px",fontWeight:"regular",lineHeight:"18px",children:[d+l," :"]}),e(F,{fontSize:"12px",fontWeight:"semi-bold",lineHeight:"18px",children:"Click"}),e(Yf,{label:i,onClick:r,iconName:"plus_user_icon",isDisable:a}),e(F,{fontSize:"12px",fontWeight:"semi-bold",lineHeight:"18px",children:o})]})]}),OE=({variant:t="default",tabsData:r,activeTabId:i,onTabClick:o,noBorder:a=!1,noPadding:l=!1,titleSize:c="12px"})=>{const[d,u]=s(0);return n("div",{className:"ff-tabs-slider-container",children:[n("div",{className:z(`ff-tab-row--${t} ff-tab-row-section`,{"ff-tab-row--no-border":a,"ff-tab-row--no-padding":l,"ff-tab-row--position":r.length>4}),children:[r.length>4&&e(P,{className:"ff-tab-icon ff-tab-icon--previous",name:""+(d?"arrow_left_accordian":""),onClick:()=>{d>0&&u(e=>e-1)},hoverEffect:!0}),e("div",{className:"ff-tab-row-carousel",children:e("div",{className:"carousel_inner",style:{transform:`translateX(-${100*d}%)`},children:r.map(r=>n("button",{onClick:()=>!r.disabled&&o(r.id),disabled:r.disabled,className:z(`ff-tab-button--${t}`,{disabled:r.disabled,active:i===r.id}),style:{flex:"0 0 25%"},children:[n("div",{className:"label-count-section",children:[e(K,{title:r.label.length>9?r.label:"",children:e(F,{children:r.label.length>9?r.label.slice(0,9)+"...":r.label,fontSize:c,lineHeight:"18px",fontWeight:i===r.id?"semi-bold":"regular",color:i===r.id?"var(--tabs-label-active-color)":"var(--tabs-label-default-color)",className:z("ff-tab-label",{"ff-tab-label--active":i===r.id})})}),"default"===t&&r.count&&e("span",{className:z("tab-count",{"tab-count--active":i===r.id}),children:r.count})]}),e("div",{className:z("ff-tab-bar",{"ff-tab-bar--active":i===r.id})}),e("span",{className:"ff-defaultStatus "+("success"===r.status?"ff-successStatus":"error"===r.status?"ff-dangerStatus":"")})]},r.id))})}),r.length>4&&e(P,{className:"ff-tab-icon ff-tab-icon--next",name:""+(d<Math.ceil(r.length/4)-1?"arrow_right_icon":""),onClick:()=>{d<Math.ceil(r.length/4)-1&&u(e=>e+1)},hoverEffect:!0})]}),e("div",{className:"ff-tab-content",children:r.find(e=>e.id===i)?.component})]})},zE=o(({label:t="Status",iconName:r="update_icon",onClick:i,isDisable:o=!1,variant:a="default",backgroundColor:l=!1,border:c=!1},s)=>{const d={default:"var(--ff-avatar-background-color)",success:"var(--status-success-text-color)",danger:"var(--ff-delete-button-attachment)"};return e("button",{disabled:o,onClick:i,className:`\n ff-status-indicator\n ff-status-indicator--${a}\n ${l?`ff-status-indicator--with-bg ff-status-indicator--${a}-bg`:""}\n ${c?`ff-status-indicator--with-border ff-status-indicator--${a}-border`:""}\n `,ref:s,children:n("div",{className:"ff-status-indicator__content",children:[e(P,{name:"danger"===a?"close":r,color:d[a]||d.default,className:`ff-status-indicator__icon ff-status-indicator__icon--${a}`}),e(F,{as:"div",fontSize:12,className:`ff-status-indicator__label ff-status-indicator__label--${a}`,fontWeight:"medium",lineHeight:"20px",children:t})]})})}),NE=({rootLabel:t,childrenLabels:r,align:i="center",direction:o="horizontal"})=>{const a=r.length;return n("div","vertical"===o?{className:"ff-os-tree-vertical",style:{"--child-count":a},children:[n("div",{className:`ff-os-tree-vertical__row ff-os-tree-vertical__row--${i}`,children:[e("div",{className:"ff-os-tree-vertical__root-label",children:t}),e("div",{className:"ff-os-tree-vertical__horizontal-line"})]}),n("div",{className:"ff-os-tree-vertical__vertical-line-wrapper",children:[e("div",{className:"ff-os-tree-vertical__vertical-line"}),r.map((t,r)=>n("div",{className:"ff-os-tree-vertical__child",children:[e("div",{className:"ff-os-tree-vertical__child-connector"}),e("div",{className:"ff-os-tree-vertical__child-label",children:t})]},r))]})]}:{className:`ff-os-tree ff-os-tree--${i}`,style:{"--child-count":a},children:[n("div",{className:"ff-os-tree__root-wrapper",children:[e("div",{className:"ff-os-tree__root-label",children:t}),e("div",{className:"ff-os-tree__vertical-root"})]}),e("div",{className:"ff-os-tree__horizontal-connector",children:r.map((t,n)=>e("div",{className:"ff-os-tree__vertical-child"},n))}),e("div",{className:"ff-os-tree__children",children:r.map((t,n)=>e("div",{className:"ff-os-tree__child-container",children:e("div",{className:"ff-os-tree__child-label",children:t})},n))})]})},IE=({handleClose:t,handleResend:r,handleOtp:i,resendTimeout:o=30})=>{const[c,d]=s(Array(6).fill("")),[u,f]=s(o),[h,p]=s(!0),m=a(Array(6).fill(null));l(()=>{h||m.current[0]?.focus()},[h]),l(()=>{let e;return u>0&&(e=window.setInterval(()=>f(e=>e-1),1e3)),0===u&&p(!1),()=>clearInterval(e)},[u]);const C=e=>{e.preventDefault();const t=e.clipboardData.getData("text").replace(/\D/g,"").slice(0,6),n=Array(6).fill("");t.split("").forEach((e,t)=>{n[t]=e}),d(n);const r=Math.min(t.length,5);m.current[r]?.focus()};return e(Xf,{isOpen:!0,onClose:t,isFooterDisplayed:!1,isHeaderDisplayed:!1,zIndex:999999,customWidth:"340px",children:n("div",{className:"ff-otp-popup",children:[n("div",{className:"ff-otp-header",children:[e(F,{fontSize:24,lineHeight:"36px",fontWeight:"semi-bold",children:"OTP Verification"}),e(P,{name:"close",height:16,width:16,onClick:t,className:"ff-close-icon"})]}),e("div",{className:"ff-otp-boxes",children:c.map((t,n)=>e("input",{type:"text",maxLength:1,className:`ff-otp-input ${t?"filled":""} ${n===c.findIndex(e=>""===e)?"active":""}`,value:t,onKeyDown:e=>((e,t)=>{const{key:n}=e;if(/^[0-9]$/.test(n)){e.preventDefault();const r=[...c];r[t]=n,d(r),t<5&&m.current[t+1]?.focus()}else if("Backspace"===n){e.preventDefault();const n=[...c];n[t]="",d(n),t>0&&m.current[t-1]?.focus()}})(e,n),onPaste:C,ref:e=>m.current[n]=e,readOnly:!0},n))}),e(U,{variant:"primary",label:"Submit",onClick:()=>i(c.join("")),disabled:c.includes(""),className:"ff-submit-btn"}),n("div",{className:"ff-resend "+(h?"disabled":""),onClick:h?void 0:()=>{f(o),p(!0),d(Array(6).fill("")),r()},children:["Re-send OTP",u>0?` (${u}s)`:""]})]})})},DE=({isOpen:t,onClose:r,isPlaying:i,onTogglePlay:o,mediaType:c,src:d,headerTitle:u,onDownload:f,onExpand:h,showHeader:m=!0,showDownload:C=!0,showExpand:g=!0,width:v="800px",height:y="432px",showControls:w=!0,customStyle:b,overlay:E=!0,children:M,showControlDownload:A=!1,showControlExpand:x=!1})=>{const k=a(null),L=a(null),[H,_]=s(0),[S,V]=s(0),[O]=s(!1),[z,N]=s(!1),[I,D]=s(0);l(()=>{"video"===c&&k.current&&!M&&(i?k.current.play():k.current.pause())},[i,c,M]);const T=p(()=>{if(k.current&&!z){const e=k.current.currentTime/k.current.duration*100;D(e||0),_(k.current.currentTime)}},[z]),Z=p(()=>{k.current&&V(k.current.duration)},[]),j=p(()=>{_(0),D(0),o?.()},[o]),R=p(e=>`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,"0")}`,[]),B=p(e=>{if(k.current){const t=e/100*k.current.duration;k.current.currentTime=t,D(e),_(t)}},[]),U=p(e=>{if(z||!L.current)return;const t=L.current.getBoundingClientRect(),n=e.clientX-t.left,r=t.width,i=Math.max(0,Math.min(100,n/r*100));B(i)},[B,z]),q=p(e=>{if(!L.current)return;N(!0);const t=L.current.getBoundingClientRect(),n=e.clientX-t.left,r=t.width,i=Math.max(0,Math.min(100,n/r*100));B(i)},[B]),W=p(e=>{if(!z||!L.current||!k.current)return;const t=L.current.getBoundingClientRect(),n=e.clientX-t.left,r=t.width,i=Math.max(0,Math.min(100,n/r*100));B(i)},[z,B]),Q=p(()=>{N(!1)},[]);return l(()=>{if(z)return document.addEventListener("mousemove",W),document.addEventListener("mouseup",Q),()=>{document.removeEventListener("mousemove",W),document.removeEventListener("mouseup",Q)}},[z,W,Q]),t?e(kc,{isOpen:t,onClose:r,isMaximized:!1,showHeader:m,overlay:E,downloadHandler:()=>{},customStyle:b,header:n("div",{className:"ff-header-content",children:[e(P,{width:23,height:23,name:"automatic_locator"}),e(F,{children:e("span",{className:"ff-header-title",children:u})})]}),icons:e(K,{title:"Close",children:e(P,{name:"close",onClick:r})}),width:v,height:y,zIndex:999,children:n("div",{className:"ff-video-wrapper",children:[M||("video"===c?e("video",{ref:k,src:d,className:"ff-media-video",onTimeUpdate:T,onLoadedMetadata:Z,onEnded:j}):e("img",{src:d,alt:"Preview",className:"ff-media-image"})),n("div",{className:"ff-top-right-icons",children:[C&&e(K,{title:"Download",children:e(P,{name:"download_file",color:"white",onClick:f})}),g&&e(K,{title:O?"Minimize":"Maximize",children:e(P,{name:O?"collapse_icon":"expand_icon",color:"white",onClick:h})})]}),"video"===c&&w&&!M&&n("div",{className:"ff-media-controls",children:[e("button",{onClick:o,className:"ff-play-pause-btn",children:e(P,i?{width:35,height:35,name:"pause_button",color:"white"}:{width:35,height:35,name:"play_button",color:"white"})}),n("div",{className:"ff-progress-bar",children:[e("span",{className:"ff-current-time",children:R(H)}),e("input",{type:"range",className:"ff-seek-bar",min:0,max:100,value:I,onChange:e=>B(parseFloat(e.target.value)),onClick:U,onMouseDown:q,ref:L}),e("span",{className:"ff-total-time",children:R(S)})]}),n("div",{className:"ff-control-icons",children:[A&&e(K,{title:"Download",children:e(P,{name:"download_file",color:"white",onClick:f,cursorType:"pointer"})}),x&&e(K,{title:O?"Minimize":"Maximize",children:e(P,{name:O?"collapse_icon":"expand_icon",color:"white",onClick:h,cursorType:"pointer"})})]})]})]})}):null},TE=({header:r,secondaryHeader:i,primaryCount:o,secondaryCount:a,primaryItems:l,secondaryItems:c,width:s,activeTab:d="primary",activeTabId:u,onPrimaryTabClick:f,onSecondaryTabClick:h,onTabClick:p,actions:m,tabsData:C,notchPosition:g="top-left"})=>{const v=i&&"secondary"===d?c:l,y=a&&parseInt(a)>0,w=o&&parseInt(o)>0,b=i&&(w||y),{tooltip:E="Download",iconName:M="download_file",disabled:A=!1,onClick:x}=m?.download||{},{tooltip:k="Delete",iconName:L="delete_icon",disabled:H=!1,onClick:_}=m?.delete||{},S=()=>n("div",{className:"ff-dropdown-header-icons",children:[m?.download&&e(K,{title:E,children:e(P,{name:M||"",className:"ff-dropdown-icon ff-download-icon",onClick:x,width:18,height:20,disabled:A,hoverEffect:!0})}),m?.delete&&e(K,{title:k,children:e(P,{name:L||"",className:"ff-dropdown-icon ff-delete-icon",onClick:_,width:25,height:25,disabled:H,hoverEffect:!0})})]});return n("div",{className:"ff-resolution-dropdown",style:s?{minWidth:s}:{},children:[e("div",{className:"ff-dropdown-notch "+("bottom-center"===g?"bottom-center":"top-left")}),e("div",{className:"ff-dropdown-header",children:e("div",{className:"ff-dropdown-header-content",children:i&&C&&u?n(t,{children:[e(Zc,{tabsData:C,activeTabId:u,onTabClick:e=>{p&&p(e),"tab-1"===e&&f?f():"tab-2"===e&&h&&h()}}),b&&S()]}):i&&b?n("div",{className:"ff-dropdown-header-dual",children:[n("div",{className:"ff-dropdown-header-item "+("primary"===d?"active":""),onClick:f,children:[e(F,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:r}),o&&e("span",{className:"ff-dropdown-count",children:o})]}),n("div",{className:"ff-dropdown-header-item "+("secondary"===d?"active":""),onClick:h,children:[e(F,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:i}),a&&e("span",{className:"ff-dropdown-count",children:a})]}),S()]}):i?n("div",{className:"ff-dropdown-header-dual",children:[n("div",{className:"ff-dropdown-header-item "+("primary"===d?"active":""),onClick:f,children:[e(F,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:r}),o&&e("span",{className:"ff-dropdown-count",children:o})]}),n("div",{className:"ff-dropdown-header-item "+("secondary"===d?"active":""),onClick:h,children:[e(F,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:i}),a&&e("span",{className:"ff-dropdown-count",children:a})]})]}):e(F,{fontSize:16,fontWeight:"semi-bold",children:r})})}),e("ul",{className:"ff-dropdown-list",children:v?.map((t,n)=>e("li",{className:"ff-dropdown-item",children:t},n))})]})},ZE=(e,t)=>"string"==typeof e?ie(e,t):i.isValidElement(e)?i.cloneElement(e,{},ZE(e.props.children,t)):Array.isArray(e)?e.map(e=>ZE(e,t)):e;const jE=o(({treeData:r,columnsData:i,selected:o=[],select:c=null,onChange:d,onClick:f,onExpand:m,loadMore:C=()=>{},tableBorder:g,height:v="calc(100vh - 134px)",newNode:y,onAddConfirm:w=e=>{},onAddCancel:E=()=>{},handleEditFieldError:M,loading:A=!1,rootNode:x,pagination:k,selectedNode:L,tableHeaderBgColor:H="var(--border-color)",hideOnDisable:_=!1,freezeColumns:S,scriptLengthTruncate:V=25,addModuleInputWidth:O,addModuleSelectWidth:z,onScroll:N,onScrollEnd:I,disableEditLabelConfirmIcon:D,transparentHeader:T=!1,navigateTreeNode:Z=null,handleRemoveNavigateTreeNode:j=()=>{},scrollThreshold:R=128,showHeader:B=!0},P)=>{const[F,U]=s([]),[q,W]=s(0),[Q,K]=s(!1),[Y,X]=s(null),[J,$]=s(new Set),ee=a(null),ne=a(null),re=a(null),ie=a([]),oe=a({lastScrollTop:0,lastScrollTime:0,direction:null}),[ae,le]=s(null),[ce,se]=s(null),[de,ue]=s(null),[fe,he]=s(null);b(P,()=>ee.current),l(()=>{const e=new Blob(["\n self.onmessage = function(e) {\n const { type, payload } = e.data;\n\n try {\n if (type === 'PROCESS_DATA') {\n const { data, sortConfig, filterQuery } = payload;\n let processedData = [...data]; // Create a copy to avoid mutations\n\n // 1. Heavy Filtering O(N)\n if (filterQuery && filterQuery.trim()) {\n const query = filterQuery.toLowerCase();\n processedData = processedData.filter(row => \n Object.values(row).some(val => \n String(val).toLowerCase().includes(query)\n )\n );\n }\n\n // 2. Heavy Sorting O(N log N) - Merge Sort implementation\n if (sortConfig && sortConfig.key) {\n const { key, direction } = sortConfig;\n processedData.sort((a, b) => {\n const aVal = a[key];\n const bVal = b[key];\n \n // Handle undefined/null values\n if (aVal == null && bVal == null) return 0;\n if (aVal == null) return direction === 'asc' ? -1 : 1;\n if (bVal == null) return direction === 'asc' ? 1 : -1;\n \n // String comparison\n if (typeof aVal === 'string' && typeof bVal === 'string') {\n const comparison = aVal.localeCompare(bVal);\n return direction === 'asc' ? comparison : -comparison;\n }\n \n // Numeric comparison\n if (typeof aVal === 'number' && typeof bVal === 'number') {\n return direction === 'asc' ? aVal - bVal : bVal - aVal;\n }\n \n // Default comparison\n const aStr = String(aVal);\n const bStr = String(bVal);\n const comparison = aStr.localeCompare(bStr);\n return direction === 'asc' ? comparison : -comparison;\n });\n }\n\n // Post processed data back to main thread\n self.postMessage({ \n type: 'DATA_READY', \n payload: processedData \n });\n }\n } catch (error) {\n self.postMessage({ \n type: 'ERROR', \n payload: { message: error.message } \n });\n }\n };\n"],{type:"application/javascript"});return ne.current=new Worker(URL.createObjectURL(e)),ne.current.onmessage=e=>{const{type:t,payload:n}=e.data;"DATA_READY"===t?U(n):"ERROR"===t&&console.error("Worker error:",n)},()=>ne.current?.terminate()},[]),l(()=>{ne.current?.postMessage({type:"PROCESS_DATA",payload:{data:r,expandedKeys:Array.from(J)}})},[r,J]);const{virtualItems:pe,totalHeight:me}=((e,t,n,r,i=5)=>h(()=>{if(0===r)return{virtualItems:[],totalHeight:0,startIndex:0,endIndex:0};const o=Math.floor(e/n),a=Math.min(r-1,Math.ceil((e+t)/n)),l=Math.max(0,o-i),c=Math.min(r-1,a+i),s=[];for(let e=l;e<=c;e++)s.push({index:e,offsetY:e*n});return{virtualItems:s,totalHeight:r*n,startIndex:l,endIndex:c}},[e,t,n,r,i]))(q,"string"==typeof v?600:v,32,F.length);l(()=>{if(Z&&F.length>0){const e=F.findIndex(e=>e.key===Z),t=ee.current;if(-1!==e&&t){he(t.scrollTop);const n=32*e,r=t.clientHeight;t.scrollTo({top:Math.max(0,n-r/2+16),behavior:"smooth"}),j()}}},[Z,F,j]),l(()=>{null===fe||A||!ee.current||Z||(ee.current.scrollTop=fe,he(null))},[fe,A,Z]),l(()=>{Y&&X(null)},[F]);const Ce=p(()=>{A||"above"===de||(ue("above"),le(ee.current?.scrollTop??null),se(ee.current?.scrollHeight??null),C("above"))},[A,de,C]),ge=p(()=>{A||"below"===de||(ue("below"),C("below"))},[A,de,C]),ve=p(()=>{const e=ee.current;if(!e||G(F))return;const t=Date.now(),n=e.scrollTop,r=e.scrollHeight,i=e.clientHeight;W(n),Q||K(!0),re.current&&clearTimeout(re.current),re.current=setTimeout(()=>{K(!1)},150);const o=n>oe.current.lastScrollTop?"down":"up";oe.current={lastScrollTop:n,lastScrollTime:t,direction:o};const a=n<R;if("down"!==o||!(r-(n+i)<R)||A||de||!0===F[F.length-1]?.lastResource||ge(),"up"!==o||!a||A||de||!0===F[0]?.lastResource||Ce(),!A&&"above"===de&&ie.current.length>0&&null!==ae){const t=ie.current;let n=0;for(let e=0;e<F.length&&t[0]?.key!==F[e]?.key;e++)n++;requestAnimationFrame(()=>{const t=32*n;t>0&&(e.scrollTop=ae+t,ie.current=F)})}},[A,de,F,Ce,ge,ae,R,Q]);l(()=>{const e=ee.current;if(!e)return;const t=Aa(()=>{I?.()},150),n=()=>{N?.(),ve(),t()};return e.addEventListener("scroll",n),()=>{e.removeEventListener("scroll",n),t.cancel()}},[ve,N,I]),u(()=>{if(A||"above"!==de||null===ae||null===ce)A||ue(null);else{const e=ee.current;if(!e)return;const t=e.scrollHeight-ce;t>0&&(e.scrollTop=ae+t),ue(null),le(null),se(null)}},[A,de,ae,ce]);const ye=p(e=>{X(e.key);const t=new Set(J);t.has(e.key)?t.delete(e.key):t.add(e.key),$(t),m?.(e)},[m,J]),we=p((e,t)=>{d?.(e,t)},[d]),be=p((e,t)=>{f?.(e,t)},[f]),Ee=({node:t,index:n})=>{const r=t.expandable,i=J.has(t.key)||t.expanded,o=t.lastChild,a=t.lastResource,l=t.folder||r;return e("div",{className:`dg-tree-space-block ${r?"btn-toggle":""} ${o?"last-block":""} ${l?"":"no-folder"} ${a?"last-node":""} ${0===n?"tree-table-space-block-0":""}`,onClick:e=>{r&&(e.stopPropagation(),ye(t))},children:r&&e("div",{className:"dg-tree-icon-container "+(i?"":"dg-tree-collapsed"),children:Y===t.key?e("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2024%2024%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%20%3Cstyle%3E%20%20%20%20.spinner_DupU%20%7B%20%20%20%20%20%20animation%3A%20spinner_sM3D%201.2s%20infinite%3B%20%20%20%20%20%20fill%3A%20%2371347b%3B%20%20%20%20%7D%20%20%20%20.spinner_GWtZ%20%7B%20animation-delay%3A%20.1s%3B%20%7D%20%20%20%20.spinner_dwN6%20%7B%20animation-delay%3A%20.2s%3B%20%7D%20%20%20%20.spinner_46QP%20%7B%20animation-delay%3A%20.3s%3B%20%7D%20%20%20%20.spinner_PD82%20%7B%20animation-delay%3A%20.4s%3B%20%7D%20%20%20%20.spinner_eUgh%20%7B%20animation-delay%3A%20.5s%3B%20%7D%20%20%20%20.spinner_eUaP%20%7B%20animation-delay%3A%20.6s%3B%20%7D%20%20%20%20.spinner_j38H%20%7B%20animation-delay%3A%20.7s%3B%20%7D%20%20%20%20.spinner_tVmX%20%7B%20animation-delay%3A%20.8s%3B%20%7D%20%20%20%20.spinner_DQhX%20%7B%20animation-delay%3A%20.9s%3B%20%7D%20%20%20%20.spinner_GIL4%20%7B%20animation-delay%3A%201s%3B%20%7D%20%20%20%20.spinner_n0Yb%20%7B%20animation-delay%3A%201.1s%3B%20%7D%20%20%20%20%40keyframes%20spinner_sM3D%20%7B%20%20%20%20%20%200%25%2C%2050%25%20%7B%20%20%20%20%20%20%20%20animation-timing-function%3A%20cubic-bezier%280%2C%201%2C%200%2C%201%29%3B%20%20%20%20%20%20%20%20r%3A%200%3B%20%20%20%20%20%20%7D%20%20%20%20%20%2010%25%20%7B%20%20%20%20%20%20%20%20animation-timing-function%3A%20cubic-bezier%28.53%2C%200%2C%20.61%2C%20.73%29%3B%20%20%20%20%20%20%20%20r%3A%202px%3B%20%20%20%20%20%20%7D%20%20%20%20%7D%20%20%3C%2Fstyle%3E%20%20%3Ccircle%20class%3D%22spinner_DupU%22%20cx%3D%2212%22%20cy%3D%223%22%20r%3D%220%22%20%2F%3E%20%20%3Ccircle%20class%3D%22spinner_DupU%20spinner_GWtZ%22%20cx%3D%2216.50%22%20cy%3D%224.21%22%20r%3D%220%22%20%2F%3E%20%20%3Ccircle%20class%3D%22spinner_DupU%20spinner_n0Yb%22%20cx%3D%227.50%22%20cy%3D%224.21%22%20r%3D%220%22%20%2F%3E%20%20%3Ccircle%20class%3D%22spinner_DupU%20spinner_dwN6%22%20cx%3D%2219.79%22%20cy%3D%227.50%22%20r%3D%220%22%20%2F%3E%20%20%3Ccircle%20class%3D%22spinner_DupU%20spinner_GIL4%22%20cx%3D%224.21%22%20cy%3D%227.50%22%20r%3D%220%22%20%2F%3E%20%20%3Ccircle%20class%3D%22spinner_DupU%20spinner_46QP%22%20cx%3D%2221.00%22%20cy%3D%2212.00%22%20r%3D%220%22%20%2F%3E%20%20%3Ccircle%20class%3D%22spinner_DupU%20spinner_DQhX%22%20cx%3D%223.00%22%20cy%3D%2212.00%22%20r%3D%220%22%20%2F%3E%20%20%3Ccircle%20class%3D%22spinner_DupU%20spinner_PD82%22%20cx%3D%2219.79%22%20cy%3D%2216.50%22%20r%3D%220%22%20%2F%3E%20%20%3Ccircle%20class%3D%22spinner_DupU%20spinner_tVmX%22%20cx%3D%224.21%22%20cy%3D%2216.50%22%20r%3D%220%22%20%2F%3E%20%20%3Ccircle%20class%3D%22spinner_DupU%20spinner_eUgh%22%20cx%3D%2216.50%22%20cy%3D%2219.79%22%20r%3D%220%22%20%2F%3E%20%20%3Ccircle%20class%3D%22spinner_DupU%20spinner_j38H%22%20cx%3D%227.50%22%20cy%3D%2219.79%22%20r%3D%220%22%20%2F%3E%20%20%3Ccircle%20class%3D%22spinner_DupU%20spinner_eUaP%22%20cx%3D%2212%22%20cy%3D%2221%22%20r%3D%220%22%20%2F%3E%3C%2Fsvg%3E",{width:12,height:12}):e("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%228%22%20viewBox%3D%220%200%2012%208%22%20fill%3D%22currentColor%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M11.8082%201.15807L11.4151%200.762261C11.2914%200.63865%2011.1268%200.570552%2010.9509%200.570552C10.7751%200.570552%2010.6103%200.63865%2010.4866%200.762261C8.01023%203.23876%203.99002%203.23373%201.51357%200.757285C1.39006%200.633674%201.22528%200.565674%201.04947%200.565674C0.873666%200.565674%200.708786%200.633674%200.585176%200.757285L0.192002%201.15065C-0.0640005%201.40646%20-0.0640005%201.82315%200.192002%202.07895L5.53683%207.443C5.66034%207.56651%205.82493%207.65354%206.00229%207.65354H6.00434C6.18025%207.65354%206.34483%207.56641%206.46835%207.443L11.8082%202.09349C11.9319%201.96998%2011.9998%201.80042%2012%201.62461C12%201.44871%2011.9319%201.28148%2011.8082%201.15807Z%22%20fill%3D%22currentColor%22%2F%3E%3C%2Fsvg%3E",{width:12,height:12})})})},Me=({node:t,column:r})=>{if("name"===r.accessor){const i=t.parentSiblings||Array(t.hierarchy||0).fill(!1);return n("div",{className:"dg-tree-container",children:[e("div",{className:"dg-tree-space-container",children:i.map((t,n)=>e("div",{className:"dg-tree-space-block "+(t?"":"no-lines")},n))}),e(Ee,{node:t,index:0}),n("div",{className:"dg-tree-content",children:["checkbox"===c&&!(_&&t.unselectable)&&e("div",{className:"dg-tree-content-select",children:e(te,{checked:"partially"!==t.selectedStatus&&("completely"===t.selectedStatus||!1),partial:"partially"===t.selectedStatus,onChange:e=>we(e,t),disabled:t.unselectable})}),"radio"===c&&!(_&&t.unselectable)&&e("div",{className:"dg-tree-content-select",children:e(za,{name:t.key,checked:o.includes(t.key),value:t.key,onChange:e=>we(e,t),disabled:t.unselectable})}),e("span",{className:"dg-tree-content-text "+(t.folder?"folder":""),title:"string"==typeof t.name?t.name:"",children:ZE(vr(t,r),V)}),r.cell&&e("span",{className:"dg-tree-content-custom",children:r.cell({row:t,value:t[r.accessor]})})]}),r.actions&&e("div",{className:"dg-row-actions",children:r.actions(t)})]})}return n("div",{className:"dg-cell-content",children:[r.cell?r.cell({row:t,value:t[r.accessor]}):ZE(vr(t,r),V),r.actions&&e("div",{className:"dg-row-actions",children:r.actions(t)})]})},Ae=h(()=>i.map(e=>e.width||"400px").join(" "),[i]),xe=h(()=>S?i.slice(0,S).reduce((e,t)=>e+parseInt(t.width||"400",10),0):0,[S,i]),ke=({virtualItem:t})=>{const n=F[t.index];return n?e("div",{className:"dg-row "+(L&&L===n.key?"hover-selected":""),style:{height:32,transform:`translateY(${t.offsetY}px)`,gridTemplateColumns:Ae,"--frozen-column-width":S?`${xe}px`:"0px"},onClick:e=>be(e,n),id:0===t.index?"table-first-row":n.key,children:i.map((t,r)=>e("div",{className:"dg-cell",style:{width:t.width,paddingLeft:0===r?"8px":"12px"},children:e(Me,{node:n,column:t})},r))},t.index):null};return e("div",{className:"tree-table-wrapper-container",children:e("div",{className:"tree-table-wrap",ref:P,children:e("div",{className:`dg-container ${F.length?"":"table-empty"} ${Q?"dg-scrolling":""}`,ref:ee,style:{"--table-height":F.length?v:"auto","--frozen-column-width":S?`${xe}px`:"0px",border:g,height:"string"==typeof v?v:`${v}px`},children:n("div",{className:"dg-grid-container",style:{position:"relative"},children:[e(()=>B?e("div",{className:"dg-header "+(T?"dg-header-transparent":""),style:{gridTemplateColumns:Ae,backgroundColor:T?"transparent":H,pointerEvents:T?"none":"auto"},children:i.map(({name:t,width:n},r)=>e("div",{className:"dg-header-cell",style:{width:n,backgroundColor:T?"transparent":H},children:t},r))}):null,{}),e(()=>x?e("div",{className:"dg-root-row "+(L&&L===x?.node?.key?"hover-selected":""),style:{gridTemplateColumns:Ae},children:i.map((r,i)=>n("div",{className:"dg-root-cell",children:[0===i&&n(t,{children:["checkbox"===x.select&&e(te,{checked:"completely"===x?.node?.selectedStatus,partial:"partially"===x.node.selectedStatus,onChange:e=>we(e,x.node),disabled:x.node.unselectable}),"radio"===x.select&&e(za,{name:x.node.key,checked:o.includes(x.node.key),value:x.node.key,onChange:e=>we(e,x.node),disabled:x.node.unselectable})]}),e("span",{className:"dg-tree-content-text",children:"name"===r.accessor?e("span",{children:x.node[r.accessor]}):e("span",{children:ZE(vr(x.node,r),V)})})]},i))}):null,{}),e("div",{className:"dg-spacer",style:{height:me}}),pe.map(t=>e(ke,{virtualItem:t},t.index))]})})})})});function RE(e,t,n,r,i,o="children"){return function e(a){for(let l=0;l<a.length;l++){const c=a[l];if(c&&c[t]===n){const e=[...a];return"replace"===i?e[l]=r:e.splice("above"===i?l:l+1,0,r),{updatedArray:e}}if(c&&c[o]&&Array.isArray(c[o])){const t=e(c[o]);if(t)return{updatedArray:a.map((e,n)=>n===l?{...e,[o]:t.updatedArray}:e)}}}return null}(e)}const BE=(e,t)=>{if(e===t)return!0;if(null==e||null==t||"object"!=typeof e||"object"!=typeof t)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=Array.isArray(e),r=Array.isArray(t);if(n!==r)return!1;const i=n?e:Object.keys(e),o=r?t:Object.keys(t);if(i.length!==o.length)return!1;if(n)return i.every((e,t)=>BE(e,o[t]));{const n=new Set(o);return i.every(r=>n.has(r)&&BE(e[r],t[r]))}},PE=(e,t)=>!(!Array.isArray(e)||!Array.isArray(t))&&(e.length===t.length&&e.every((e,n)=>{const r=t[n];return BE(e,r)}));async function FE(e,t){const n=Uint8Array.from(atob(t),e=>e.charCodeAt(0)),r=await crypto.subtle.importKey("spki",n,{name:"RSA-OAEP",hash:"SHA-256"},!1,["encrypt"]),i=(new TextEncoder).encode(e),o=await crypto.subtle.encrypt({name:"RSA-OAEP"},r,i);return btoa(String.fromCharCode(...new Uint8Array(o)))}const UE=e=>{const t=e.toLowerCase().trim(),n=parseFloat(t);switch(t.replace(/[0-9.]/g,"").trim()){case"gb":return 1024*n*1024*1024;case"mb":return 1024*n*1024;case"kb":return 1024*n;default:return n}},qE=e=>{const t=e.toLowerCase().trim(),n=parseFloat(t);switch(t.replace(/[0-9.]/g,"").trim()){case"gb":default:return n;case"mb":return n/1024;case"kb":return n/1048576;case"b":return n/1073741824}},WE=({data:r,isYaxisSticky:i=!1,barWidth:o,height:c,barGap:d=20,colors:u=[],xAxisLabel:f,isTruncateText:h=!0,yAxisLabel:p,padding:m=20,yAxisDivisions:C=5,barBorderRadius:g=0,legend:v=!0,showXAxisLabels:y=!0,icons:w=[],iconSize:b,legendPosition:E="bottom",legendGap:M=5,extendBarChartRightWidth:A=0,isYAxisValuePercentage:x=!1,selectedBar:k,setSelectedBar:L,onSelectedBar:H=e=>{},totalLabel:_="Total Execution",customToolTip:S=!1,isOnclick:V=!1,isDashboardVersions:O,type:z="",isMemory:N,tooltipWidth:I="fit-content"})=>{const D=a(null),[T,Z]=s(null),[j,R]=s(!1);l(()=>{const e=()=>{const e=D.current;e&&j&&(e.style.display="none")};return window.addEventListener("scroll",e,!0),()=>window.removeEventListener("scroll",e,!0)},[j]);const B=(e=>{const t=["TB","GB","MB","KB"];for(const n of t){if(e.some(e=>"string"==typeof e.value&&e.value.toLowerCase().includes(n.toLowerCase())))return n}return null})(r),U=r.map(e=>{if("string"==typeof e.value){let t=0;if("memory"===z)t=qE(e.value);else if(N)switch(B){case"TB":t=(e=>{const t=e.toLowerCase().trim(),n=parseFloat(t);switch(t.replace(/[0-9.]/g,"").trim()){case"tb":default:return n;case"gb":return n/1024;case"mb":return n/1048576;case"kb":return n/1073741824;case"b":return n/1099511627776}})(e.value);break;case"GB":t=qE(e.value);break;case"MB":t=(e=>{const t=e.toLowerCase().trim(),n=parseFloat(t);switch(t.replace(/[0-9.]/g,"").trim()){case"mb":default:return n;case"gb":return 1024*n;case"tb":return 1024*n*1024;case"kb":return n/1024;case"b":return n/1048576}})(e.value);break;case"KB":t=(e=>{const t=e.toLowerCase().trim(),n=parseFloat(t);switch(t.replace(/[0-9.]/g,"").trim()){case"kb":default:return n;case"mb":return 1024*n;case"gb":return 1024*n*1024;case"tb":return 1024*n*1024*1024;case"b":return n/1024}})(e.value)}else t=parseFloat(e.value);return{...e,normalizedValue:t}}return{...e,normalizedValue:e.value}});let q=0;"memory"===z&&(q=r.reduce((e,t)=>"string"==typeof t.value?e+UE(t.value):e+1024*Number(t.value)*1024*1024,0));const W=q/1048576,Q=W<1024?`${Math.round(W)} mb`:`${(W/1024).toFixed(1)} gb`;let G=Math.max(...U.map(e=>e.normalizedValue));G="memory"===z?Math.max(G,1):Math.max(G,C);const K=40,Y=40,X=U.length*o+(U.length-1)*d+(i?Y:90)+A,J=Date.now(),$=t=>t.filter(e=>e.length>1).map((t,n)=>e("defs",{children:e("linearGradient",{id:`gradient-${J}-${z}-${n}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:t.map((r,i)=>e("stop",{offset:i/(t.length-1)*100+"%",stopColor:r},`${n}-${i}`))})},n)),ee=e=>{if(!u.length)return"grey";const t=u[e%u.length];return 1===t?.length?t[0]:`url(#gradient-${J}-${z}-${e%u.length})`},te=(e,t,n,r,i)=>{R(!0);const o=D.current;if(o)if(o.style.display="block",S)o.innerHTML=`<div>\n <div><Typography fontWeight='semi-bold'>${e}</Typography></div>\n <div><Typography>${n||""}</Typography></div>\n <div><Typography>${_} : ${t} ${r?"("+r+"%)":""}</Typography></div>\n </div>`;else if(O){const e=i?i.join(", "):"";o.innerHTML=`\n <div>\n <div><Typography>${_} : ${t}</Typography></div>\n ${e?`<div><Typography>Versions : ${e}</Typography></div>`:""}\n </div>`}else o.innerHTML="memory"===z?`<strong>${e}</strong>: ${t} / ${Q}`:`<strong>${e}</strong>: ${t} ${x?"%":""}`},ne=(e,t=!1)=>{const n=D.current;if(n){const r=n.parentElement?.getBoundingClientRect(),i=window.scrollX,o=window.scrollY,a=1===U?.length||!t?e.clientX-(r?.left||0)+i+10:e.clientX-(r?.left||0)+i-n?.offsetWidth-10,l=e.clientY-(r?.top||0)+o-20;n.style.left=`${a}px`,n.style.top=`${l}px`}},re=()=>{R(!1);const e=D.current;e&&(e.style.display="none")},oe=e=>{L&&(L(e),V&&H(e))},ae=e=>{if(h){if(ie(e,10).endsWith("...")){const t=D.current;t&&(t.style.display="block",t.innerHTML=e)}}},le=(e,t,n)=>{if(h){ie(t,10).endsWith("...")&&ne(e,n===U.length-1)}};return n("div",{className:"ff-bar-chart-container",children:[e("div",{ref:D,className:"ff-bar-chart-tooltip",style:{width:I}}),v&&"top"===E&&e("div",{className:"ff-legend-container",children:e("div",{className:"ff-bar-chart-legend",style:{gap:`${M}px`},children:U.map((t,r)=>n("div",{className:"ff-bar-chart-legend-item",onMouseEnter:()=>Z(r),onMouseLeave:()=>Z(null),children:[w[r]&&"string"==typeof w[r]?e(P,{name:String(w[r]),width:b,height:b}):e("span",{className:"ff-bar-chart-legend-item-circle",style:{backgroundColor:u[r%u.length]?.[0]||"grey"}}),e(F,{as:"div",fontSize:10,fontWeight:"regular",className:"ff-legend-label",children:t.label})]},t.label))})}),i?n("div",{className:"ff-bar-chart-wrapper",children:[e("div",{className:"ff-y-axis",children:e("svg",{width:60,height:c+K+(f?20:0),children:n(t,{children:[Array.from({length:C+1}).map((t,n)=>{const r=c-n/C*c+K+4,i=n*G/C,o="memory"===z?i.toFixed(1):x?`${i.toFixed(0).padStart(2,"0")}%`:i.toFixed(0).padStart(2,"0");return e("text",{x:50,y:r,fill:"black",textAnchor:"middle",className:"ff-bar-chart-labels",children:o},n)}),p&&e("text",{x:-(c/2+35),y:i?20:10,transform:"rotate(-90)",fill:"black",textAnchor:"middle",alignmentBaseline:"middle",className:"ff-bar-chart-labels",children:p})]})})}),e("div",{className:"ff-chart-scrollable",children:n("svg",{width:X,height:c+K+5+(y?20:0)+(f?20:0),children:[Array.isArray(u)&&u.length>0&&$(u),U.map((t,r)=>{const i=t.normalizedValue/G*c,a=t.normalizedValue<1?2:i,l=r*(o+d)+m,s=c-a+K,u=b||20,f=l+o/2-u/2,p=s-u,C=k===t.label,v=T===r;return n("g",{children:[w[r]&&"string"==typeof w[r]&&e("g",{onMouseEnter:()=>te(t.label,"memory"===z?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e,r===U.length-1),onMouseLeave:re,children:e(P,{name:String(w[r]),x:String(f),y:String(p),width:u,height:u,chartIcon:!0})}),e("rect",{x:l,y:s,width:o,height:a,fill:ee(r),rx:g,ry:g,style:{strokeWidth:C?3:0,opacity:null===T||v?1:.3,cursor:V?"pointer":"default",transition:"opacity 0.5s ease"},onMouseEnter:()=>te(t.label,"memory"===z||N?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e,r===U.length-1),onMouseLeave:re,onClick:()=>oe(t.label)}),C&&V&&e("rect",{x:l,y:s,width:o,height:a,fill:"var(--select-chart-highlight-color)",rx:g,ry:g,onMouseEnter:()=>te(t.label,"memory"===z?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e,r===U.length-1),onMouseLeave:re}),y&&e("text",{onMouseEnter:()=>ae(t.label),onMouseMove:e=>le(e,t.label,r),onMouseLeave:re,x:0===r?l:r===U.length-1?l+o:l+o/2,y:c+K+15,className:"ff-bar-chart-labels",fill:C?"var(--brand-color)":"black",fontWeight:C?"bold":"normal",textAnchor:0===r?"start":"middle",children:h?ie(t.label,10):t.label})]},r)}),e("line",{x1:i?0:m,y1:c+K,x2:X,y2:c+K,stroke:"#D9D9D9",strokeWidth:"1"}),!i&&f&&e("text",{x:X/2,y:c+K+(y?40:20),fontSize:"12",fill:"black",textAnchor:"middle",className:"ff-bar-chart-labels",children:f})]})}),e("div",{className:"ff-bar-chart-x-axis-label",children:f})]}):e("div",{children:n("svg",{width:X,height:c+K+5+(y?20:0)+(f?20:0),children:[Array.isArray(u)&&u.length>0&&$(u),Array.from({length:C+1}).map((t,n)=>{const r=c-n/C*c+K+4,i=n*G/C,o="memory"===z?i.toFixed(1):x?`${i.toFixed(0).padStart(2,"0")}%`:i.toFixed(0).padStart(2,"0");return e("text",{x:Y,y:r,fill:"black",textAnchor:"middle",className:"ff-bar-chart-labels",children:o},n)}),U.map((t,r)=>{const i=t.normalizedValue/G*c,a=t.normalizedValue<1?2:i,l=r*(o+d)+Y+m,s=c-a+K,u=b||20,f=l+o/2-u/2,p=s-u,C=k===t.label,v=T===r;return n("g",{children:[w[r]&&"string"==typeof w[r]&&e("g",{onMouseEnter:()=>te(t.label,"memory"===z?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e,r===U.length-1),onMouseLeave:re,children:e(P,{name:String(w[r]),x:String(f),y:String(p),width:u,height:u,chartIcon:!0})}),e("rect",{x:l,y:s,width:o,height:a,fill:ee(r),rx:g,ry:g,style:{strokeWidth:C?3:0,opacity:null===T||v?1:.3,cursor:V?"pointer":"default",transition:"opacity 0.5s ease"},onMouseEnter:()=>te(t.label,"memory"===z||N?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e,r===U.length-1),onMouseLeave:re,onClick:()=>oe(t.label)}),C&&V&&e("rect",{x:l,y:s,width:o,height:a,fill:"var(--select-chart-highlight-color)",rx:g,ry:g,onMouseEnter:()=>te(t.label,"memory"===z?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e,r===U.length-1),onMouseLeave:re}),y&&e("g",{children:e("text",{x:0===r?l:r===U.length-1?l+o:l+o/2,y:c+K+15,className:"ff-bar-chart-labels",fill:C?"var(--brand-color)":"black",fontWeight:C?"bold":"normal",textAnchor:0===r?"start":"middle",onMouseEnter:()=>ae(t.label),onMouseMove:e=>le(e,t.label,r),onMouseLeave:re,children:h?ie(t.label,10):t.label})})]},r)}),e("line",{x1:60,y1:c+K,x2:X,y2:c+K,stroke:"#D9D9D9",strokeWidth:"1"}),f&&e("text",{x:X/2,y:c+K+(y?40:20),fontSize:"12",fill:"black",textAnchor:"middle",className:"ff-bar-chart-labels",children:f}),p&&e("text",{x:-(c/2+35),y:10,transform:"rotate(-90)",fill:"black",textAnchor:"middle",alignmentBaseline:"middle",className:"ff-bar-chart-labels",children:p})]})}),v&&"bottom"===E&&e("div",{className:"ff-legend-container",children:e("div",{className:"ff-bar-chart-legend",style:{gap:`${M}px`},children:r.map((t,r)=>n("div",{className:"ff-bar-chart-legend-item",onMouseEnter:()=>Z(r),onMouseLeave:()=>Z(null),children:[w[r]&&"string"==typeof w[r]?e(P,{name:String(w[r]),width:b,height:b}):e("span",{className:"ff-bar-chart-legend-item-circle",style:{backgroundColor:u[r%u.length]?.[0]||"grey"}}),e("div",{children:e(F,{as:"div",fontSize:10,fontWeight:"regular",className:"ff-legend-label",children:t.label})})]},t.label))})})]})},QE=(e,t,n,r,i)=>{const o=e+n*Math.cos(r),a=t+n*Math.sin(r),l=e+n*Math.cos(i),c=t+n*Math.sin(i);return`M ${o} ${a} A ${n} ${n} 0 ${i-r>Math.PI?1:0} 1 ${l} ${c}`},GE=({radius:r,lineWidth:i,lineCap:o,barValues:a,labelHeading:l,legendType:c="numberLegend",isLegendDetails:d=!0,isPillValueVisible:u=!0,chartToLegendGap:f="16px",legendGap:h="8px",labelFontSize:p=12,subLabelFontSize:m=8,gapBetweenArch:C=10,capsuleStyle:g={padding:"4px"}})=>{const[v,y]=s({visible:!1,x:0,y:0,content:"",isArc:!1}),[w,b]=s(null),E=(e,t)=>Array.isArray(e.arcColor)?`url(#gradient-${t})`:e.arcColor,M=e=>Array.isArray(e.arcColor)?e.arcColor[0]:e.arcColor,A=a.map(e=>{if("string"==typeof e.value){const t=(e=>{if("string"!=typeof e)return e;{const t=e.trim().match(/^([\d.]+)\s*([a-zA-Z%]*)$/);if(!t)return 0;const n=parseFloat(t[1]??"0"),r=t[2]?.toUpperCase()||"";if(isNaN(n))return 0;switch(r){case"TB":return 1024*n*1024;case"GB":return 1024*n;case"MB":default:return n;case"KB":return n/1024}}})(e.value),n=isNaN(t)?0:t;return{...e,normalizedValue:n,labelValue:Number.isInteger(n)?n:n.toFixed(2)}}return{...e,normalizedValue:e.value,labelValue:Number.isInteger(e.value)?e.value:e.value?.toFixed(2)}}),x=A.reduce((e,t)=>e+t.normalizedValue,0),k=r,L=i+C,H=2*(k+L*(A.length-1)+i),_=[...A].reverse(),S=l.trim().split(" "),V=(e,t,n)=>{const{clientX:r,clientY:i}=e;y({visible:!0,x:r,y:i,content:t,isArc:n})},O=e=>{const{clientX:t,clientY:n}=e;y(e=>({...e,x:t,y:n}))},z=()=>{y({visible:!1,x:0,y:0,content:"",isArc:!1})};return n("div",{className:"ff-multi-radial-chart-container "+("numberLegend"===c?"ff-multi-radial-chart-number":"ff-multi-radial-chart-pill"),style:{gap:f},children:[e("div",{className:"relative",style:{width:H,height:H},children:n("svg",{width:H,height:H,viewBox:`0 0 ${H} ${H}`,className:"absolute top-0 left-0",children:[e("defs",{children:a.map((t,n)=>Array.isArray(t.arcColor)?e("linearGradient",{id:`gradient-${n}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%",gradientTransform:"rotate(90)",children:t.arcColor.map((n,r)=>e("stop",{offset:r/(t.arcColor.length-1)*100+"%",stopColor:n},r))},`gradient-${n}`):null)}),n("g",{transform:`translate(${H/2+1}, ${H/2+1})`,children:[_.map((t,r)=>{const a=A.length-1-r,l=2*(t.normalizedValue/x)*Math.PI;let c=-Math.PI/2,s=c+l;t.normalizedValue===x&&(c=0,s=2*Math.PI);const d=k+L*a,u=QE(0,0,d,0,2*Math.PI),f={opacity:null!==w?t.barLabel===w?1:.2:1,transition:"opacity 0.3s ease"};if(0===t.normalizedValue){const r=d*Math.cos(-Math.PI/2),o=d*Math.sin(-Math.PI/2);return n("g",{children:[e("path",{d:u,fill:"none",stroke:t.arcBackgroundColor,strokeWidth:i,className:"transition-all duration-300",style:f}),e("circle",{cx:r,cy:o,r:i+1,fill:E({...t,label:t.barLabel||"",key:t.labelValue?.toString()||""},a),onMouseEnter:e=>V(e,`${t.barLabel||"Data"}: ${t.value}`,!0),onMouseMove:O,onMouseLeave:z,style:f})]},a)}const h=QE(0,0,d,c,s);return n("g",{children:[e("path",{d:u,fill:"none",stroke:t.arcBackgroundColor,strokeWidth:i,className:"transition-all duration-300",style:f}),e("path",{d:h,fill:"none",stroke:E({...t,label:t.barLabel||"",key:t.labelValue?.toString()||""},a),strokeWidth:i,strokeLinecap:"square"===o?"butt":"round",onMouseEnter:e=>V(e,`${t.barLabel||"Data"}: ${t.value}`,!0),onMouseMove:O,onMouseLeave:z,style:{pointerEvents:"stroke",...f}})]},a)}),e("text",{x:"0",y:`-${i+C+2}`,fill:(()=>{if(!v.visible)return"";const e=v.content.split(":")[0]?.trim();if(void 0===e)return"";const t=A.find(t=>t.barLabel===e);if(!t)return"";const n={...t,label:t.barLabel,key:t.labelValue?.toString()??""};return M(n)})(),textAnchor:"middle",dominantBaseline:"central",children:v.visible?n(t,{children:[e("tspan",{x:"0",dy:"0",className:"ff-center-text-tooltip",children:(N=v.content.split(":")[1]?.trim()||"",I=9,N.length>I?N.slice(0,I)+"...":N)}),v.content.split(":")[0]?.split(" ").map((t,n)=>e("tspan",{x:"0",dy:0===n?`${i+C+5}`:18,className:"ff-center-text-tooltip",children:t},n))]}):e(t,{children:S.map((t,r)=>{if(0===r){const[i,...o]=t.split(" ");return n("tspan",{children:[e("tspan",{x:"0",dy:"0",style:{fontSize:`${p}px`},className:"ff-center-first-text",children:i}),e("tspan",{x:"0",dy:18,style:{fontSize:`${m}px`},className:"ff-center-text",children:o.join(" ")})]},r)}return e("tspan",{x:"0",dy:0===r?0:18,className:"ff-center-text",style:{fontSize:`${m}px`},children:t},r)})})})]})]})}),v.visible&&e("div",{className:"ff-multi-radial-tooltip",style:{position:"fixed",top:`${v.y+10}px`,left:`${v.x+15}px`,zIndex:1e3,pointerEvents:"none"},children:v.content}),d&&((t,r)=>{switch(r){case"numberLegend":return e("div",{className:"ff-legend-container ff-number-legend",style:{gap:h},children:t.map((t,r)=>n("div",{className:"ff-legend-item",onMouseEnter:e=>{b(t.barLabel||t.label),V(e,`${t.barLabel||"Data"}: ${t.value}`,!1)},onMouseMove:O,onMouseLeave:()=>{b(null),z()},children:[e(F,{fontSize:20,fontWeight:"semi-bold",className:"ff-legend-value",color:M(t),children:t.key.padStart(2,"0")}),e(F,{fontSize:10,className:"ff-legend-key",color:"var(--text-color)",children:t.label})]},r))});case"pillLegend":return e("div",{className:"ff-legend-container ff-pill-legend",style:{gap:h},children:t.slice().reverse().map((t,r)=>n("div",{className:"ff-legend-item",onMouseEnter:e=>{b(t.barLabel||t.label),V(e,`${t.barLabel||"Data"}: ${t.value}`,!1)},onMouseMove:O,onMouseLeave:()=>{b(null),z()},children:[e("span",{className:"ff-legend-capsule",style:{backgroundColor:M(t)},children:e(F,{fontSize:10,color:"var(--tooltip-text-color)",style:g,children:u&&t.value})}),e(F,{className:"ff-legend-key",children:t.label})]},r))});default:return null}})(A.map(e=>({...e,label:e?.barLabel,key:e.labelValue?.toString()})),c)]});var N,I};function KE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function YE(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function JE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?XE(Object(n),!0).forEach(function(t){YE(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XE(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function $E(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function tM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eM(Object(n),!0).forEach(function(t){$E(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function nM(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return t.apply(n,[].concat(i,r))}}}function rM(e){return{}.toString.call(e).includes("Object")}function iM(e){return"function"==typeof e}var oM=nM(function(e,t){throw new Error(e[t]||e.default)})({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),aM={changes:function(e,t){return rM(t)||oM("changeType"),Object.keys(t).some(function(t){return n=e,r=t,!Object.prototype.hasOwnProperty.call(n,r);var n,r})&&oM("changeField"),t},selector:function(e){iM(e)||oM("selectorType")},handler:function(e){iM(e)||rM(e)||oM("handlerType"),rM(e)&&Object.values(e).some(function(e){return!iM(e)})&&oM("handlersType")},initial:function(e){var t;e||oM("initialIsRequired"),rM(e)||oM("initialType"),t=e,Object.keys(t).length||oM("initialContent")}};function lM(e,t){return iM(t)?t(e.current):t}function cM(e,t){return e.current=tM(tM({},e.current),t),t}function sM(e,t,n){return iM(t)?t(e.current):Object.keys(n).forEach(function(n){var r;return null===(r=t[n])||void 0===r?void 0:r.call(t,e.current[n])}),n}var dM={create:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};aM.initial(e),aM.handler(t);var n={current:e},r=nM(sM)(n,t),i=nM(cM)(n),o=nM(aM.changes)(e),a=nM(lM)(n);return[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e};return aM.selector(e),e(n.current)},function(e){!function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}}(r,i,o,a)(e)}]}};var uM={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},fM=function(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return t.apply(n,[].concat(i,r))}}}(function(e,t){throw new Error(e[t]||e.default)})(uM),hM={config:function(e){var t;return e||fM("configIsRequired"),t=e,{}.toString.call(t).includes("Object")||fM("configType"),e.urls?(console.warn(uM.deprecation),{paths:{vs:e.urls.monacoBase}}):e}};function pM(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],pM(e[n],t[n]))}),JE(JE({},e),t)}var mM={type:"cancelation",msg:"operation is manually canceled"};function CM(e){var t=!1,n=new Promise(function(n,r){e.then(function(e){return t?r(mM):n(e)}),e.catch(r)});return n.cancel=function(){return t=!0},n}var gM,vM,yM=["monaco"],wM=dM.create({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}),bM=(vM=2,function(e){if(Array.isArray(e))return e}(gM=wM)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,l=[],c=!0,s=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(c=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){s=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw i}}return l}}(gM,vM)||function(e,t){if(e){if("string"==typeof e)return KE(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?KE(e,t):void 0}}(gM,vM)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),EM=bM[0],MM=bM[1];function AM(e){return document.body.appendChild(e)}function xM(e){var t=EM(function(e){return{config:e.config,reject:e.reject}}),n=function(e){var t=document.createElement("script");return e&&(t.src=e),t}("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function kM(){var e=EM(function(e){return{config:e.config,resolve:e.resolve,reject:e.reject}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(t){var n=t.m||t;LM(n),e.resolve(n)},function(t){e.reject(t)})}function LM(e){EM().monaco||MM({monaco:e})}var HM=new Promise(function(e,t){return MM({resolve:e,reject:t})}),_M={config:function(e){var t=hM.config(e),n=t.monaco,r=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(t,yM);MM(function(e){return{config:pM(e.config,r),monaco:n}})},init:function(){var e=EM(function(e){return{monaco:e.monaco,isInitialized:e.isInitialized,resolve:e.resolve}});if(!e.isInitialized){if(MM({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),CM(HM);if(window.monaco&&window.monaco.editor)return LM(window.monaco),e.resolve(window.monaco),CM(HM);!function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}}(AM,xM)(kM)}return CM(HM)},__getMonacoInstance:function(){return EM(function(e){return e.monaco})}},SM={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},VM={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}};var OM=function({children:e}){return i.createElement("div",{style:VM.container},e)},zM=OM;var NM=function({width:e,height:t,isEditorReady:n,loading:r,_ref:o,className:a,wrapperProps:l}){return i.createElement("section",{style:{...SM.wrapper,width:e,height:t},...l},!n&&i.createElement(zM,null,r),i.createElement("div",{ref:o,style:{...SM.fullWidth,...!n&&SM.hide},className:a}))},IM=g(NM);var DM=function(e){l(e,[])};var TM=function(e,t,n=!0){let r=a(!0);l(r.current||!n?()=>{r.current=!1}:e,t)};function ZM(){}function jM(e,t,n,r){return function(e,t){return e.editor.getModel(RM(e,t))}(e,r)||function(e,t,n,r){return e.editor.createModel(t,n,r?RM(e,r):void 0)}(e,t,n,r)}function RM(e,t){return e.Uri.parse(t)}var BM=function({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:o,originalModelPath:c,modifiedModelPath:d,keepCurrentOriginalModel:u=!1,keepCurrentModifiedModel:f=!1,theme:h="light",loading:m="Loading...",options:C={},height:g="100%",width:v="100%",className:y,wrapperProps:w={},beforeMount:b=ZM,onMount:E=ZM}){let[M,A]=s(!1),[x,k]=s(!0),L=a(null),H=a(null),_=a(null),S=a(E),V=a(b),O=a(!1);DM(()=>{let e=_M.init();return e.then(e=>(H.current=e)&&k(!1)).catch(e=>"cancelation"!==e?.type&&console.error("Monaco initialization: error:",e)),()=>L.current?function(){let e=L.current?.getModel();u||e?.original?.dispose(),f||e?.modified?.dispose(),L.current?.dispose()}():e.cancel()}),TM(()=>{if(L.current&&H.current){let t=L.current.getOriginalEditor(),i=jM(H.current,e||"",r||n||"text",c||"");i!==t.getModel()&&t.setModel(i)}},[c],M),TM(()=>{if(L.current&&H.current){let e=L.current.getModifiedEditor(),r=jM(H.current,t||"",o||n||"text",d||"");r!==e.getModel()&&e.setModel(r)}},[d],M),TM(()=>{let e=L.current.getModifiedEditor();e.getOption(H.current.editor.EditorOption.readOnly)?e.setValue(t||""):t!==e.getValue()&&(e.executeEdits("",[{range:e.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),e.pushUndoStop())},[t],M),TM(()=>{L.current?.getModel()?.original.setValue(e||"")},[e],M),TM(()=>{let{original:e,modified:t}=L.current.getModel();H.current.editor.setModelLanguage(e,r||n||"text"),H.current.editor.setModelLanguage(t,o||n||"text")},[n,r,o],M),TM(()=>{H.current?.editor.setTheme(h)},[h],M),TM(()=>{L.current?.updateOptions(C)},[C],M);let z=p(()=>{if(!H.current)return;V.current(H.current);let i=jM(H.current,e||"",r||n||"text",c||""),a=jM(H.current,t||"",o||n||"text",d||"");L.current?.setModel({original:i,modified:a})},[n,t,o,e,r,c,d]),N=p(()=>{!O.current&&_.current&&(L.current=H.current.editor.createDiffEditor(_.current,{automaticLayout:!0,...C}),z(),H.current?.editor.setTheme(h),A(!0),O.current=!0)},[C,h,z]);return l(()=>{M&&S.current(L.current,H.current)},[M]),l(()=>{!x&&!M&&N()},[x,M,N]),i.createElement(IM,{width:v,height:g,isEditorReady:M,loading:m,_ref:_,className:y,wrapperProps:w})};g(BM);var PM=function(e){let t=a();return l(()=>{t.current=e},[e]),t.current},FM=new Map;var UM,qM=function({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:o,path:c,theme:d="light",line:u,loading:f="Loading...",options:h={},overrideServices:m={},saveViewState:C=!0,keepCurrentModel:g=!1,width:v="100%",height:y="100%",className:w,wrapperProps:b={},beforeMount:E=ZM,onMount:M=ZM,onChange:A,onValidate:x=ZM}){let[k,L]=s(!1),[H,_]=s(!0),S=a(null),V=a(null),O=a(null),z=a(M),N=a(E),I=a(),D=a(r),T=PM(c),Z=a(!1),j=a(!1);DM(()=>{let e=_M.init();return e.then(e=>(S.current=e)&&_(!1)).catch(e=>"cancelation"!==e?.type&&console.error("Monaco initialization: error:",e)),()=>V.current?(I.current?.dispose(),g?C&&FM.set(c,V.current.saveViewState()):V.current.getModel()?.dispose(),void V.current.dispose()):e.cancel()}),TM(()=>{let i=jM(S.current,e||r||"",t||o||"",c||n||"");i!==V.current?.getModel()&&(C&&FM.set(T,V.current?.saveViewState()),V.current?.setModel(i),C&&V.current?.restoreViewState(FM.get(c)))},[c],k),TM(()=>{V.current?.updateOptions(h)},[h],k),TM(()=>{!V.current||void 0===r||(V.current.getOption(S.current.editor.EditorOption.readOnly)?V.current.setValue(r):r!==V.current.getValue()&&(j.current=!0,V.current.executeEdits("",[{range:V.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),V.current.pushUndoStop(),j.current=!1))},[r],k),TM(()=>{let e=V.current?.getModel();e&&o&&S.current?.editor.setModelLanguage(e,o)},[o],k),TM(()=>{void 0!==u&&V.current?.revealLine(u)},[u],k),TM(()=>{S.current?.editor.setTheme(d)},[d],k);let R=p(()=>{if(O.current&&S.current&&!Z.current){N.current(S.current);let i=c||n,a=jM(S.current,r||e||"",t||o||"",i||"");V.current=S.current?.editor.create(O.current,{model:a,automaticLayout:!0,...h},m),C&&V.current.restoreViewState(FM.get(i)),S.current.editor.setTheme(d),void 0!==u&&V.current.revealLine(u),L(!0),Z.current=!0}},[e,t,n,r,o,c,h,m,C,d,u]);return l(()=>{k&&z.current(V.current,S.current)},[k]),l(()=>{!H&&!k&&R()},[H,k,R]),D.current=r,l(()=>{k&&A&&(I.current?.dispose(),I.current=V.current?.onDidChangeModelContent(e=>{j.current||A(V.current.getValue(),e)}))},[k,A]),l(()=>{if(k){let e=S.current.editor.onDidChangeMarkers(e=>{let t=V.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=S.current.editor.getModelMarkers({resource:t});x?.(e)}});return()=>{e?.dispose()}}return()=>{}},[k,x]),i.createElement(IM,{width:v,height:y,isEditorReady:k,loading:f,_ref:O,className:w,wrapperProps:b})},WM=g(qM),QM={exports:{}},GM={},KM={exports:{}},YM={},XM={};function JM(){if(UM)return XM;function e(e){this.__parent=e,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function t(e,t){this.__cache=[""],this.__indent_size=e.indent_size,this.__indent_string=e.indent_char,e.indent_with_tabs||(this.__indent_string=new Array(e.indent_size+1).join(e.indent_char)),t=t||"",e.indent_level>0&&(t=new Array(e.indent_level+1).join(this.__indent_string)),this.__base_string=t,this.__base_string_length=t.length}function n(n,r){this.__indent_cache=new t(n,r),this.raw=!1,this._end_with_newline=n.end_with_newline,this.indent_size=n.indent_size,this.wrap_line_length=n.wrap_line_length,this.indent_empty_lines=n.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new e(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}return UM=1,e.prototype.clone_empty=function(){var t=new e(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t},e.prototype.item=function(e){return e<0?this.__items[this.__items.length+e]:this.__items[e]},e.prototype.has_match=function(e){for(var t=this.__items.length-1;t>=0;t--)if(this.__items[t].match(e))return!0;return!1},e.prototype.set_indent=function(e,t){this.is_empty()&&(this.__indent_count=e||0,this.__alignment_count=t||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},e.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},e.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},e.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var e=this.__parent.current_line;return e.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),e.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),e.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===e.__items[0]&&(e.__items.splice(0,1),e.__character_count-=1),!0}return!1},e.prototype.is_empty=function(){return 0===this.__items.length},e.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},e.prototype.push=function(e){this.__items.push(e);var t=e.lastIndexOf("\n");-1!==t?this.__character_count=e.length-t:this.__character_count+=e.length},e.prototype.pop=function(){var e=null;return this.is_empty()||(e=this.__items.pop(),this.__character_count-=e.length),e},e.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},e.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},e.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},e.prototype.toString=function(){var e="";return this.is_empty()?this.__parent.indent_empty_lines&&(e=this.__parent.get_indent_string(this.__indent_count)):(e=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),e+=this.__items.join("")),e},t.prototype.get_indent_size=function(e,t){var n=this.__base_string_length;return t=t||0,e<0&&(n=0),n+=e*this.__indent_size,n+=t},t.prototype.get_indent_string=function(e,t){var n=this.__base_string;return t=t||0,e<0&&(e=0,n=""),t+=e*this.__indent_size,this.__ensure_cache(t),n+=this.__cache[t]},t.prototype.__ensure_cache=function(e){for(;e>=this.__cache.length;)this.__add_column()},t.prototype.__add_column=function(){var e=this.__cache.length,t=0,n="";this.__indent_size&&e>=this.__indent_size&&(e-=(t=Math.floor(e/this.__indent_size))*this.__indent_size,n=new Array(t+1).join(this.__indent_string)),e&&(n+=new Array(e+1).join(" ")),this.__cache.push(n)},n.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},n.prototype.get_line_number=function(){return this.__lines.length},n.prototype.get_indent_string=function(e,t){return this.__indent_cache.get_indent_string(e,t)},n.prototype.get_indent_size=function(e,t){return this.__indent_cache.get_indent_size(e,t)},n.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},n.prototype.add_new_line=function(e){return!(this.is_empty()||!e&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},n.prototype.get_code=function(e){this.trim(!0);var t=this.current_line.pop();t&&("\n"===t[t.length-1]&&(t=t.replace(/\n+$/g,"")),this.current_line.push(t)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join("\n");return"\n"!==e&&(n=n.replace(/[\n]/g,e)),n},n.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},n.prototype.set_indent=function(e,t){return e=e||0,t=t||0,this.next_line.set_indent(e,t),this.__lines.length>1?(this.current_line.set_indent(e,t),!0):(this.current_line.set_indent(),!1)},n.prototype.add_raw_token=function(e){for(var t=0;t<e.newlines;t++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(e.whitespace_before),this.current_line.push(e.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},n.prototype.add_token=function(e){this.__add_space_before_token(),this.current_line.push(e),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},n.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},n.prototype.remove_indent=function(e){for(var t=this.__lines.length;e<t;)this.__lines[e]._remove_indent(),e++;this.current_line._remove_wrap_indent()},n.prototype.trim=function(e){for(e=void 0!==e&&e,this.current_line.trim();e&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},n.prototype.just_added_newline=function(){return this.current_line.is_empty()},n.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},n.prototype.ensure_empty_line_above=function(t,n){for(var r=this.__lines.length-2;r>=0;){var i=this.__lines[r];if(i.is_empty())break;if(0!==i.item(0).indexOf(t)&&i.item(-1)!==n){this.__lines.splice(r+1,0,new e(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},XM.Output=n,XM}var $M,eA={};function tA(){if($M)return eA;return $M=1,eA.Token=function(e,t,n,r){this.type=e,this.text=t,this.comments_before=null,this.newlines=n||0,this.whitespace_before=r||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null},eA}var nA,rA={};function iA(){return nA||(nA=1,o="(?:"+(i="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}")+"|[\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a"+(n="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc")+"])",a="(?:"+i+"|["+(t="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a")+n+(r="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f")+"])*",(e=rA).identifier=new RegExp(o+a,"g"),e.identifierStart=new RegExp(o),e.identifierMatch=new RegExp("(?:"+i+"|["+t+n+r+"])+"),e.newline=/[\n\r\u2028\u2029]/,e.lineBreak=new RegExp("\r\n|"+e.newline.source),e.allLineBreaks=new RegExp(e.lineBreak.source,"g")),rA;var e,t,n,r,i,o,a}var oA,aA,lA={},cA={};function sA(){if(oA)return cA;function e(e,n){this.raw_options=t(e,n),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}function t(e,t){var r,i={};for(r in e=n(e))r!==t&&(i[r]=e[r]);if(t&&e[t])for(r in e[t])i[r]=e[t][r];return i}function n(e){var t,n={};for(t in e){n[t.replace(/-/g,"_")]=e[t]}return n}return oA=1,e.prototype._get_array=function(e,t){var n=this.raw_options[e],r=t||[];return"object"==typeof n?null!==n&&"function"==typeof n.concat&&(r=n.concat()):"string"==typeof n&&(r=n.split(/[^a-zA-Z0-9_\/\-]+/)),r},e.prototype._get_boolean=function(e,t){var n=this.raw_options[e];return void 0===n?!!t:!!n},e.prototype._get_characters=function(e,t){var n=this.raw_options[e],r=t||"";return"string"==typeof n&&(r=n.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),r},e.prototype._get_number=function(e,t){var n=this.raw_options[e];t=parseInt(t,10),isNaN(t)&&(t=0);var r=parseInt(n,10);return isNaN(r)&&(r=t),r},e.prototype._get_selection=function(e,t,n){var r=this._get_selection_list(e,t,n);if(1!==r.length)throw new Error("Invalid Option Value: The option '"+e+"' can only be one of the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return r[0]},e.prototype._get_selection_list=function(e,t,n){if(!t||0===t.length)throw new Error("Selection list cannot be empty.");if(n=n||[t[0]],!this._is_valid_selection(n,t))throw new Error("Invalid Default Value!");var r=this._get_array(e,n);if(!this._is_valid_selection(r,t))throw new Error("Invalid Option Value: The option '"+e+"' can contain only the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return r},e.prototype._is_valid_selection=function(e,t){return e.length&&t.length&&!e.some(function(e){return-1===t.indexOf(e)})},cA.Options=e,cA.normalizeOpts=n,cA.mergeOpts=t,cA}function dA(){if(aA)return lA;aA=1;var e=sA().Options,t=["before-newline","after-newline","preserve-newline"];function n(n){e.call(this,n,"js");var r=this.raw_options.brace_style||null;"expand-strict"===r?this.raw_options.brace_style="expand":"collapse-preserve-inline"===r?this.raw_options.brace_style="collapse,preserve-inline":void 0!==this.raw_options.braces_on_own_line&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var o=0;o<i.length;o++)"preserve-inline"===i[o]?this.brace_preserve_inline=!0:this.brace_style=i[o];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",t),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}return n.prototype=new e,lA.Options=n,lA}var uA,fA={},hA={};function pA(){if(uA)return hA;uA=1;var e=RegExp.prototype.hasOwnProperty("sticky");function t(e){this.__input=e||"",this.__input_length=this.__input.length,this.__position=0}return t.prototype.restart=function(){this.__position=0},t.prototype.back=function(){this.__position>0&&(this.__position-=1)},t.prototype.hasNext=function(){return this.__position<this.__input_length},t.prototype.next=function(){var e=null;return this.hasNext()&&(e=this.__input.charAt(this.__position),this.__position+=1),e},t.prototype.peek=function(e){var t=null;return e=e||0,(e+=this.__position)>=0&&e<this.__input_length&&(t=this.__input.charAt(e)),t},t.prototype.__match=function(t,n){t.lastIndex=n;var r=t.exec(this.__input);return!r||e&&t.sticky||r.index!==n&&(r=null),r},t.prototype.test=function(e,t){return t=t||0,(t+=this.__position)>=0&&t<this.__input_length&&!!this.__match(e,t)},t.prototype.testChar=function(e,t){var n=this.peek(t);return e.lastIndex=0,null!==n&&e.test(n)},t.prototype.match=function(e){var t=this.__match(e,this.__position);return t?this.__position+=t[0].length:t=null,t},t.prototype.read=function(e,t,n){var r,i="";return e&&(r=this.match(e))&&(i+=r[0]),!t||!r&&e||(i+=this.readUntil(t,n)),i},t.prototype.readUntil=function(e,t){var n,r=this.__position;e.lastIndex=this.__position;var i=e.exec(this.__input);return i?(r=i.index,t&&(r+=i[0].length)):r=this.__input_length,n=this.__input.substring(this.__position,r),this.__position=r,n},t.prototype.readUntilAfter=function(e){return this.readUntil(e,!0)},t.prototype.get_regexp=function(t,n){var r=null,i="g";return n&&e&&(i="y"),"string"==typeof t&&""!==t?r=new RegExp(t,i):t&&(r=new RegExp(t.source,i)),r},t.prototype.get_literal_regexp=function(e){return RegExp(e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},t.prototype.peekUntilAfter=function(e){var t=this.__position,n=this.readUntilAfter(e);return this.__position=t,n},t.prototype.lookBack=function(e){var t=this.__position-1;return t>=e.length&&this.__input.substring(t-e.length,t).toLowerCase()===e},hA.InputScanner=t,hA}var mA,CA={},gA={};var vA,yA,wA,bA={},EA={};function MA(){if(vA)return EA;function e(e,t){this._input=e,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,t&&(this._starting_pattern=this._input.get_regexp(t._starting_pattern,!0),this._match_pattern=this._input.get_regexp(t._match_pattern,!0),this._until_pattern=this._input.get_regexp(t._until_pattern),this._until_after=t._until_after)}return vA=1,e.prototype.read=function(){var e=this._input.read(this._starting_pattern);return this._starting_pattern&&!e||(e+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),e},e.prototype.read_match=function(){return this._input.match(this._match_pattern)},e.prototype.until_after=function(e){var t=this._create();return t._until_after=!0,t._until_pattern=this._input.get_regexp(e),t._update(),t},e.prototype.until=function(e){var t=this._create();return t._until_after=!1,t._until_pattern=this._input.get_regexp(e),t._update(),t},e.prototype.starting_with=function(e){var t=this._create();return t._starting_pattern=this._input.get_regexp(e,!0),t._update(),t},e.prototype.matching=function(e){var t=this._create();return t._match_pattern=this._input.get_regexp(e,!0),t._update(),t},e.prototype._create=function(){return new e(this._input,this)},e.prototype._update=function(){},EA.Pattern=e,EA}function AA(){if(wA)return CA;wA=1;var e=pA().InputScanner,t=tA().Token,n=function(){if(mA)return gA;function e(e){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=e}return mA=1,e.prototype.restart=function(){this.__position=0},e.prototype.isEmpty=function(){return 0===this.__tokens_length},e.prototype.hasNext=function(){return this.__position<this.__tokens_length},e.prototype.next=function(){var e=null;return this.hasNext()&&(e=this.__tokens[this.__position],this.__position+=1),e},e.prototype.peek=function(e){var t=null;return e=e||0,(e+=this.__position)>=0&&e<this.__tokens_length&&(t=this.__tokens[e]),t},e.prototype.add=function(e){this.__parent_token&&(e.parent=this.__parent_token),this.__tokens.push(e),this.__tokens_length+=1},gA.TokenStream=e,gA}().TokenStream,r=function(){if(yA)return bA;yA=1;var e=MA().Pattern;function t(t,n){e.call(this,t,n),n?this._line_regexp=this._input.get_regexp(n._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}return t.prototype=new e,t.prototype.__set_whitespace_patterns=function(e,t){e+="\\t ",t+="\\n\\r",this._match_pattern=this._input.get_regexp("["+e+t+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+t+"]")},t.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var e=this._input.read(this._match_pattern);if(" "===e)this.whitespace_before_token=" ";else if(e){var t=this.__split(this._newline_regexp,e);this.newline_count=t.length-1,this.whitespace_before_token=t[this.newline_count]}return e},t.prototype.matching=function(e,t){var n=this._create();return n.__set_whitespace_patterns(e,t),n._update(),n},t.prototype._create=function(){return new t(this._input,this)},t.prototype.__split=function(e,t){e.lastIndex=0;for(var n=0,r=[],i=e.exec(t);i;)r.push(t.substring(n,i.index)),n=i.index+i[0].length,i=e.exec(t);return n<t.length?r.push(t.substring(n,t.length)):r.push(""),r},bA.WhitespacePattern=t,bA}().WhitespacePattern,i={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(t,n){this._input=new e(t),this._options=n||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new r(this._input)};return o.prototype.tokenize=function(){var e;this._input.restart(),this.__tokens=new n,this._reset();for(var r=new t(i.START,""),o=null,a=[],l=new n;r.type!==i.EOF;){for(e=this._get_next_token(r,o);this._is_comment(e);)l.add(e),e=this._get_next_token(r,o);l.isEmpty()||(e.comments_before=l,l=new n),e.parent=o,this._is_opening(e)?(a.push(o),o=e):o&&this._is_closing(e,o)&&(e.opened=o,o.closed=e,o=a.pop(),e.parent=o),e.previous=r,r.next=e,this.__tokens.add(e),r=e}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.prototype._get_next_token=function(e,t){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(i.RAW,n):this._create_token(i.EOF,"")},o.prototype._is_comment=function(e){return!1},o.prototype._is_opening=function(e){return!1},o.prototype._is_closing=function(e,t){return!1},o.prototype._create_token=function(e,n){return new t(e,n,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},CA.Tokenizer=o,CA.TOKEN=i,CA}var xA,kA={};function LA(){if(xA)return kA;function e(e,t){e="string"==typeof e?e:e.source,t="string"==typeof t?t:t.source,this.__directives_block_pattern=new RegExp(e+/ beautify( \w+[:]\w+)+ /.source+t,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(e+/\sbeautify\signore:end\s/.source+t,"g")}return xA=1,e.prototype.get_directives=function(e){if(!e.match(this.__directives_block_pattern))return null;var t={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(e);n;)t[n[1]]=n[2],n=this.__directive_pattern.exec(e);return t},e.prototype.readIgnored=function(e){return e.readUntilAfter(this.__directives_end_ignore_pattern)},kA.Directives=e,kA}var HA,_A,SA,VA,OA={};function zA(){if(HA)return OA;HA=1;var e=MA().Pattern,t={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function n(n,r){e.call(this,n,r),this.__template_pattern=null,this._disabled=Object.assign({},t),this._excluded=Object.assign({},t),r&&(this.__template_pattern=this._input.get_regexp(r.__template_pattern),this._excluded=Object.assign(this._excluded,r._excluded),this._disabled=Object.assign(this._disabled,r._disabled));var i=new e(n);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}return n.prototype=new e,n.prototype._create=function(){return new n(this._input,this)},n.prototype._update=function(){this.__set_templated_pattern()},n.prototype.disable=function(e){var t=this._create();return t._disabled[e]=!0,t._update(),t},n.prototype.read_options=function(e){var n=this._create();for(var r in t)n._disabled[r]=-1===e.templating.indexOf(r);return n._update(),n},n.prototype.exclude=function(e){var t=this._create();return t._excluded[e]=!0,t._update(),t},n.prototype.read=function(){var e="";e=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern);for(var t=this._read_template();t;)this._match_pattern?t+=this._input.read(this._match_pattern):t+=this._input.readUntil(this.__template_pattern),e+=t,t=this._read_template();return this._until_after&&(e+=this._input.readUntilAfter(this._until_pattern)),e},n.prototype.__set_templated_pattern=function(){var e=[];this._disabled.php||e.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||e.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||e.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||e.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(e.push(this.__patterns.django._starting_pattern.source),e.push(this.__patterns.django_value._starting_pattern.source),e.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||e.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&e.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+e.join("|")+")")},n.prototype._read_template=function(){var e="",t=this._input.peek();if("<"===t){var n=this._input.peek(1);this._disabled.php||this._excluded.php||"?"!==n||(e=e||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==n||(e=e||this.__patterns.erb.read())}else"{"===t&&(this._disabled.handlebars||this._excluded.handlebars||(e=(e=(e=e||this.__patterns.handlebars_comment.read())||this.__patterns.handlebars_unescaped.read())||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(e=e||this.__patterns.django_value.read()),this._excluded.django||(e=(e=e||this.__patterns.django_comment.read())||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(e=(e=(e=e||this.__patterns.smarty_comment.read())||this.__patterns.smarty_literal.read())||this.__patterns.smarty.read()));return e},OA.TemplatablePattern=n,OA}function NA(){if(_A)return fA;_A=1;var e=pA().InputScanner,t=AA().Tokenizer,n=AA().TOKEN,r=LA().Directives,i=iA(),o=MA().Pattern,a=zA().TemplatablePattern;function l(e,t){return-1!==t.indexOf(e)}var c={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:n.START,RAW:n.RAW,EOF:n.EOF},s=new r(/\/\*/,/\*\//),d=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,u=/[0-9]/,f=/[^\d\.]/,h=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),p=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";p=(p="\\?\\.(?!\\d) "+(p=p.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"))).replace(/ /g,"|");var m,C=new RegExp(p),g="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),v=g.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),y=new RegExp("^(?:"+v.join("|")+")$"),w=function(e,n){t.call(this,e,n),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var r=new o(this._input),l=new a(this._input).read_options(this._options);this.__patterns={template:l,identifier:l.starting_with(i.identifier).matching(i.identifierMatch),number:r.matching(d),punct:r.matching(C),comment:r.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:r.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:r.matching(/<!--/),html_comment_end:r.matching(/-->/),include:r.starting_with(/#include/).until_after(i.lineBreak),shebang:r.starting_with(/#!/).until_after(i.lineBreak),xml:r.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:l.until(/['\\\n\r\u2028\u2029]/),double_quote:l.until(/["\\\n\r\u2028\u2029]/),template_text:l.until(/[`\\$]/),template_expression:l.until(/[`}\\]/)}};return(w.prototype=new t)._is_comment=function(e){return e.type===c.COMMENT||e.type===c.BLOCK_COMMENT||e.type===c.UNKNOWN},w.prototype._is_opening=function(e){return e.type===c.START_BLOCK||e.type===c.START_EXPR},w.prototype._is_closing=function(e,t){return(e.type===c.END_BLOCK||e.type===c.END_EXPR)&&t&&("]"===e.text&&"["===t.text||")"===e.text&&"("===t.text||"}"===e.text&&"{"===t.text)},w.prototype._reset=function(){m=!1},w.prototype._get_next_token=function(e,t){var n=null;this._readWhitespace();var r=this._input.peek();return null===r?this._create_token(c.EOF,""):n=(n=(n=(n=(n=(n=(n=(n=(n=(n=n||this._read_non_javascript(r))||this._read_string(r))||this._read_pair(r,this._input.peek(1)))||this._read_word(e))||this._read_singles(r))||this._read_comment(r))||this._read_regexp(r,e))||this._read_xml(r,e))||this._read_punctuation())||this._create_token(c.UNKNOWN,this._input.next())},w.prototype._read_word=function(e){var t;return""!==(t=this.__patterns.identifier.read())?(t=t.replace(i.allLineBreaks,"\n"),e.type!==c.DOT&&(e.type!==c.RESERVED||"set"!==e.text&&"get"!==e.text)&&y.test(t)?"in"!==t&&"of"!==t||e.type!==c.WORD&&e.type!==c.STRING?this._create_token(c.RESERVED,t):this._create_token(c.OPERATOR,t):this._create_token(c.WORD,t)):""!==(t=this.__patterns.number.read())?this._create_token(c.WORD,t):void 0},w.prototype._read_singles=function(e){var t=null;return"("===e||"["===e?t=this._create_token(c.START_EXPR,e):")"===e||"]"===e?t=this._create_token(c.END_EXPR,e):"{"===e?t=this._create_token(c.START_BLOCK,e):"}"===e?t=this._create_token(c.END_BLOCK,e):";"===e?t=this._create_token(c.SEMICOLON,e):"."===e&&f.test(this._input.peek(1))?t=this._create_token(c.DOT,e):","===e&&(t=this._create_token(c.COMMA,e)),t&&this._input.next(),t},w.prototype._read_pair=function(e,t){var n=null;return"#"===e&&"{"===t&&(n=this._create_token(c.START_BLOCK,e+t)),n&&(this._input.next(),this._input.next()),n},w.prototype._read_punctuation=function(){var e=this.__patterns.punct.read();if(""!==e)return"="===e?this._create_token(c.EQUALS,e):"?."===e?this._create_token(c.DOT,e):this._create_token(c.OPERATOR,e)},w.prototype._read_non_javascript=function(e){var t="";if("#"===e){if(this._is_first_token()&&(t=this.__patterns.shebang.read()))return this._create_token(c.UNKNOWN,t.trim()+"\n");if(t=this.__patterns.include.read())return this._create_token(c.UNKNOWN,t.trim()+"\n");e=this._input.next();var n="#";if(this._input.hasNext()&&this._input.testChar(u)){do{n+=e=this._input.next()}while(this._input.hasNext()&&"#"!==e&&"="!==e);return"#"===e||("["===this._input.peek()&&"]"===this._input.peek(1)?(n+="[]",this._input.next(),this._input.next()):"{"===this._input.peek()&&"}"===this._input.peek(1)&&(n+="{}",this._input.next(),this._input.next())),this._create_token(c.WORD,n)}this._input.back()}else if("<"===e&&this._is_first_token()){if(t=this.__patterns.html_comment_start.read()){for(;this._input.hasNext()&&!this._input.testChar(i.newline);)t+=this._input.next();return m=!0,this._create_token(c.COMMENT,t)}}else if(m&&"-"===e&&(t=this.__patterns.html_comment_end.read()))return m=!1,this._create_token(c.COMMENT,t);return null},w.prototype._read_comment=function(e){var t=null;if("/"===e){var n="";if("*"===this._input.peek(1)){n=this.__patterns.block_comment.read();var r=s.get_directives(n);r&&"start"===r.ignore&&(n+=s.readIgnored(this._input)),n=n.replace(i.allLineBreaks,"\n"),(t=this._create_token(c.BLOCK_COMMENT,n)).directives=r}else"/"===this._input.peek(1)&&(n=this.__patterns.comment.read(),t=this._create_token(c.COMMENT,n))}return t},w.prototype._read_string=function(t){if("`"===t||"'"===t||'"'===t){var n=this._input.next();return this.has_char_escapes=!1,n+="`"===t?this._read_string_recursive("`",!0,"${"):this._read_string_recursive(t),this.has_char_escapes&&this._options.unescape_strings&&(n=function(t){var n="",r=0,i=new e(t),o=null;for(;i.hasNext();)if((o=i.match(/([\s]|[^\\]|\\\\)+/g))&&(n+=o[0]),"\\"===i.peek()){if(i.next(),"x"===i.peek())o=i.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==i.peek()){n+="\\",i.hasNext()&&(n+=i.next());continue}(o=i.match(/u([0-9A-Fa-f]{4})/g))||(o=i.match(/u\{([0-9A-Fa-f]+)\}/g))}if(!o)return t;if((r=parseInt(o[1],16))>126&&r<=255&&0===o[0].indexOf("x"))return t;n+=r>=0&&r<32||r>1114111?"\\"+o[0]:34===r||39===r||92===r?"\\"+String.fromCharCode(r):String.fromCharCode(r)}return n}(n)),this._input.peek()===t&&(n+=this._input.next()),n=n.replace(i.allLineBreaks,"\n"),this._create_token(c.STRING,n)}return null},w.prototype._allow_regexp_or_xml=function(e){return e.type===c.RESERVED&&l(e.text,["return","case","throw","else","do","typeof","yield"])||e.type===c.END_EXPR&&")"===e.text&&e.opened.previous.type===c.RESERVED&&l(e.opened.previous.text,["if","while","for"])||l(e.type,[c.COMMENT,c.START_EXPR,c.START_BLOCK,c.START,c.END_BLOCK,c.OPERATOR,c.EQUALS,c.EOF,c.SEMICOLON,c.COMMA])},w.prototype._read_regexp=function(e,t){if("/"===e&&this._allow_regexp_or_xml(t)){for(var n=this._input.next(),r=!1,o=!1;this._input.hasNext()&&(r||o||this._input.peek()!==e)&&!this._input.testChar(i.newline);)n+=this._input.peek(),r?r=!1:(r="\\"===this._input.peek(),"["===this._input.peek()?o=!0:"]"===this._input.peek()&&(o=!1)),this._input.next();return this._input.peek()===e&&(n+=this._input.next(),n+=this._input.read(i.identifier)),this._create_token(c.STRING,n)}return null},w.prototype._read_xml=function(e,t){if(this._options.e4x&&"<"===e&&this._allow_regexp_or_xml(t)){var n="",r=this.__patterns.xml.read_match();if(r){for(var o=r[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),a=0===o.indexOf("{"),l=0;r;){var s=!!r[1],d=r[2];if(!(!!r[r.length-1]||"![CDATA["===d.slice(0,8))&&(d===o||a&&d.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(s?--l:++l),n+=r[0],l<=0)break;r=this.__patterns.xml.read_match()}return r||(n+=this._input.match(/[\s\S]*/g)[0]),n=n.replace(i.allLineBreaks,"\n"),this._create_token(c.STRING,n)}}return null},w.prototype._read_string_recursive=function(e,t,n){var r,o;"'"===e?o=this.__patterns.single_quote:'"'===e?o=this.__patterns.double_quote:"`"===e?o=this.__patterns.template_text:"}"===e&&(o=this.__patterns.template_expression);for(var a=o.read(),l="";this._input.hasNext();){if((l=this._input.next())===e||!t&&i.newline.test(l)){this._input.back();break}"\\"===l&&this._input.hasNext()?("x"===(r=this._input.peek())||"u"===r?this.has_char_escapes=!0:"\r"===r&&"\n"===this._input.peek(1)&&this._input.next(),l+=this._input.next()):n&&("${"===n&&"$"===l&&"{"===this._input.peek()&&(l+=this._input.next()),n===l&&(l+="`"===e?this._read_string_recursive("}",t,"`"):this._read_string_recursive("`",t,"${"),this._input.hasNext()&&(l+=this._input.next()))),a+=l+=o.read()}return a},fA.Tokenizer=w,fA.TOKEN=c,fA.positionable_operators=h.slice(),fA.line_starters=g.slice(),fA}function IA(){if(SA)return YM;SA=1;var e=JM().Output,t=tA().Token,n=iA(),r=dA().Options,i=NA().Tokenizer,o=NA().line_starters,a=NA().positionable_operators,l=NA().TOKEN;function c(e,t){return-1!==t.indexOf(e)}function s(e){return e.replace(/^\s+/g,"")}function d(e,t){return e&&e.type===l.RESERVED&&e.text===t}function u(e,t){return e&&e.type===l.RESERVED&&c(e.text,t)}var f=["case","return","do","if","throw","else","await","break","continue","async"],h=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].replace(/-/g,"_")]=e[n];return t}(["before-newline","after-newline","preserve-newline"]),p=[h.before_newline,h.preserve_newline],m="BlockStatement",C="Statement",g="ObjectLiteral",v="ArrayLiteral",y="ForInitializer",w="Conditional",b="Expression";function E(e,t){t.multiline_frame||t.mode===y||t.mode===w||e.remove_indent(t.start_line_index)}function M(e){return e===v}function A(e){return c(e,[b,y,w])}function x(e,t){t=t||{},this._source_text=e||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new r(t)}x.prototype.create_flags=function(e,n){var r=0;return e&&(r=e.indentation_level,!this._output.just_added_newline()&&e.line_indent_level>r&&(r=e.line_indent_level)),{mode:n,parent:e,last_token:e?e.last_token:new t(l.START_BLOCK,""),last_word:e?e.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:r,alignment:0,line_indent_level:e?e.line_indent_level:r,start_line_index:this._output.get_line_number(),ternary_depth:0}},x.prototype._reset=function(t){var n=t.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new e(this._options,n),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(m);var r=new i(t,this._options);return this._tokens=r.tokenize(),t},x.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._reset(this._source_text),t=this._options.eol;"auto"===this._options.eol&&(t="\n",e&&n.lineBreak.test(e||"")&&(t=e.match(n.lineBreak)[0]));for(var r=this._tokens.next();r;)this.handle_token(r),this._last_last_text=this._flags.last_token.text,this._flags.last_token=r,r=this._tokens.next();return this._output.get_code(t)},x.prototype.handle_token=function(e,t){e.type===l.START_EXPR?this.handle_start_expr(e):e.type===l.END_EXPR?this.handle_end_expr(e):e.type===l.START_BLOCK?this.handle_start_block(e):e.type===l.END_BLOCK?this.handle_end_block(e):e.type===l.WORD||e.type===l.RESERVED?this.handle_word(e):e.type===l.SEMICOLON?this.handle_semicolon(e):e.type===l.STRING?this.handle_string(e):e.type===l.EQUALS?this.handle_equals(e):e.type===l.OPERATOR?this.handle_operator(e):e.type===l.COMMA?this.handle_comma(e):e.type===l.BLOCK_COMMENT?this.handle_block_comment(e,t):e.type===l.COMMENT?this.handle_comment(e,t):e.type===l.DOT?this.handle_dot(e):e.type===l.EOF?this.handle_eof(e):(e.type,l.UNKNOWN,this.handle_unknown(e,t))},x.prototype.handle_whitespace_and_comments=function(e,t){var n=e.newlines,r=this._options.keep_array_indentation&&M(this._flags.mode);if(e.comments_before)for(var i=e.comments_before.next();i;)this.handle_whitespace_and_comments(i,t),this.handle_token(i,t),i=e.comments_before.next();if(r)for(var o=0;o<n;o+=1)this.print_newline(o>0,t);else if(this._options.max_preserve_newlines&&n>this._options.max_preserve_newlines&&(n=this._options.max_preserve_newlines),this._options.preserve_newlines&&n>1){this.print_newline(!1,t);for(var a=1;a<n;a+=1)this.print_newline(!0,t)}};var k=["async","break","continue","return","throw","yield"];return x.prototype.allow_wrap_or_preserved_newline=function(e,t){if(t=void 0!==t&&t,!this._output.just_added_newline()){var n=this._options.preserve_newlines&&e.newlines||t;if(c(this._flags.last_token.text,a)||c(e.text,a)){var r=c(this._flags.last_token.text,a)&&c(this._options.operator_position,p)||c(e.text,a);n=n&&r}if(n)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(u(this._flags.last_token,k))return;this._output.set_wrap_point()}}},x.prototype.print_newline=function(e,t){if(!t&&";"!==this._flags.last_token.text&&","!==this._flags.last_token.text&&"="!==this._flags.last_token.text&&(this._flags.last_token.type!==l.OPERATOR||"--"===this._flags.last_token.text||"++"===this._flags.last_token.text))for(var n=this._tokens.peek();!(this._flags.mode!==C||this._flags.if_block&&d(n,"else")||this._flags.do_block);)this.restore_mode();this._output.add_new_line(e)&&(this._flags.multiline_frame=!0)},x.prototype.print_token_line_indentation=function(e){this._output.just_added_newline()&&(this._options.keep_array_indentation&&e.newlines&&("["===e.text||M(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(e.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},x.prototype.print_token=function(e){if(this._output.raw)this._output.add_raw_token(e);else{if(this._options.comma_first&&e.previous&&e.previous.type===l.COMMA&&this._output.just_added_newline()&&","===this._output.previous_line.last()){var t=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(t),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(e),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(e),this._output.non_breaking_space=!0,this._output.add_token(e.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)}},x.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},x.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},x.prototype.set_mode=function(e){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,e),this._flags=this.create_flags(this._previous_flags,e),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},x.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===C&&E(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},x.prototype.start_of_object_property=function(){return this._flags.parent.mode===g&&this._flags.mode===C&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||u(this._flags.last_token,["get","set"]))},x.prototype.start_of_statement=function(e){var t=!1;return!!(t=(t=(t=(t=(t=(t=(t=t||u(this._flags.last_token,["var","let","const"])&&e.type===l.WORD)||d(this._flags.last_token,"do"))||!(this._flags.parent.mode===g&&this._flags.mode===C)&&u(this._flags.last_token,k)&&!e.newlines)||d(this._flags.last_token,"else")&&!(d(e,"if")&&!e.comments_before))||this._flags.last_token.type===l.END_EXPR&&(this._previous_flags.mode===y||this._previous_flags.mode===w))||this._flags.last_token.type===l.WORD&&this._flags.mode===m&&!this._flags.in_case&&!("--"===e.text||"++"===e.text)&&"function"!==this._last_last_text&&e.type!==l.WORD&&e.type!==l.RESERVED)||this._flags.mode===g&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||u(this._flags.last_token,["get","set"])))&&(this.set_mode(C),this.indent(),this.handle_whitespace_and_comments(e,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e,u(e,["do","for","if","while"])),!0)},x.prototype.handle_start_expr=function(e){this.start_of_statement(e)||this.handle_whitespace_and_comments(e);var t=b;if("["===e.text){if(this._flags.last_token.type===l.WORD||")"===this._flags.last_token.text)return u(this._flags.last_token,o)&&(this._output.space_before_token=!0),this.print_token(e),this.set_mode(t),this.indent(),void(this._options.space_in_paren&&(this._output.space_before_token=!0));t=v,M(this._flags.mode)&&("["!==this._flags.last_token.text&&(","!==this._flags.last_token.text||"]"!==this._last_last_text&&"}"!==this._last_last_text)||this._options.keep_array_indentation||this.print_newline()),c(this._flags.last_token.type,[l.START_EXPR,l.END_EXPR,l.WORD,l.OPERATOR,l.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===l.RESERVED)"for"===this._flags.last_token.text?(this._output.space_before_token=this._options.space_before_conditional,t=y):c(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,t=w):c(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:"import"===this._flags.last_token.text&&""===e.whitespace_before?this._output.space_before_token=!1:(c(this._flags.last_token.text,o)||"catch"===this._flags.last_token.text)&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===l.EQUALS||this._flags.last_token.type===l.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e);else if(this._flags.last_token.type===l.WORD){this._output.space_before_token=!1;var n=this._tokens.peek(-3);if(this._options.space_after_named_function&&n){var r=this._tokens.peek(-4);u(n,["async","function"])||"*"===n.text&&u(r,["async","function"])?this._output.space_before_token=!0:this._flags.mode===g?"{"!==n.text&&","!==n.text&&("*"!==n.text||"{"!==r.text&&","!==r.text)||(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(e);(this._flags.last_token.type===l.RESERVED&&("function"===this._flags.last_word||"typeof"===this._flags.last_word)||"*"===this._flags.last_token.text&&(c(this._last_last_text,["function","yield"])||this._flags.mode===g&&c(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}";"===this._flags.last_token.text||this._flags.last_token.type===l.START_BLOCK?this.print_newline():this._flags.last_token.type!==l.END_EXPR&&this._flags.last_token.type!==l.START_EXPR&&this._flags.last_token.type!==l.END_BLOCK&&"."!==this._flags.last_token.text&&this._flags.last_token.type!==l.COMMA||this.allow_wrap_or_preserved_newline(e,e.newlines),this.print_token(e),this.set_mode(t),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},x.prototype.handle_end_expr=function(e){for(;this._flags.mode===C;)this.restore_mode();this.handle_whitespace_and_comments(e),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(e,"]"===e.text&&M(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type!==l.START_EXPR||this._options.space_in_empty_paren?this._output.space_before_token=!0:(this._output.trim(),this._output.space_before_token=!1)),this.deindent(),this.print_token(e),this.restore_mode(),E(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===w&&(this._previous_flags.mode=b,this._flags.do_block=!1,this._flags.do_while=!1)},x.prototype.handle_start_block=function(e){this.handle_whitespace_and_comments(e);var t=this._tokens.peek(),n=this._tokens.peek(1);"switch"===this._flags.last_word&&this._flags.last_token.type===l.END_EXPR?(this.set_mode(m),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(m):n&&(c(n.text,[":",","])&&c(t.type,[l.STRING,l.WORD,l.RESERVED])||c(t.text,["get","set","..."])&&c(n.type,[l.WORD,l.RESERVED]))?c(this._last_last_text,["class","interface"])&&!c(n.text,[":",","])?this.set_mode(m):this.set_mode(g):this._flags.last_token.type===l.OPERATOR&&"=>"===this._flags.last_token.text?this.set_mode(m):c(this._flags.last_token.type,[l.EQUALS,l.START_EXPR,l.COMMA,l.OPERATOR])||u(this._flags.last_token,["return","throw","import","default"])?this.set_mode(g):this.set_mode(m),this._flags.last_token&&u(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var r=!t.comments_before&&"}"===t.text,i=r&&"function"===this._flags.last_word&&this._flags.last_token.type===l.END_EXPR;if(this._options.brace_preserve_inline){var o=0,a=null;this._flags.inline_frame=!0;do{if(o+=1,(a=this._tokens.peek(o-1)).newlines){this._flags.inline_frame=!1;break}}while(a.type!==l.EOF&&(a.type!==l.END_BLOCK||a.opened!==e))}("expand"===this._options.brace_style||"none"===this._options.brace_style&&e.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==l.OPERATOR&&(i||this._flags.last_token.type===l.EQUALS||u(this._flags.last_token,f)&&"else"!==this._flags.last_token.text)?this._output.space_before_token=!0:this.print_newline(!1,!0):(!M(this._previous_flags.mode)||this._flags.last_token.type!==l.START_EXPR&&this._flags.last_token.type!==l.COMMA||((this._flags.last_token.type===l.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(e),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==l.OPERATOR&&this._flags.last_token.type!==l.START_EXPR&&(c(this._flags.last_token.type,[l.START_BLOCK,l.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(e),this.indent(),r||this._options.brace_preserve_inline&&this._flags.inline_frame||this.print_newline()},x.prototype.handle_end_block=function(e){for(this.handle_whitespace_and_comments(e);this._flags.mode===C;)this.restore_mode();var t=this._flags.last_token.type===l.START_BLOCK;this._flags.inline_frame&&!t?this._output.space_before_token=!0:"expand"===this._options.brace_style?t||this.print_newline():t||(M(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(e)},x.prototype.handle_word=function(e){if(e.type===l.RESERVED)if(c(e.text,["set","get"])&&this._flags.mode!==g)e.type=l.WORD;else if("import"===e.text&&c(this._tokens.peek().text,["(","."]))e.type=l.WORD;else if(c(e.text,["as","from"])&&!this._flags.import_block)e.type=l.WORD;else if(this._flags.mode===g){":"===this._tokens.peek().text&&(e.type=l.WORD)}if(this.start_of_statement(e)?u(this._flags.last_token,["var","let","const"])&&e.type===l.WORD&&(this._flags.declaration_statement=!0):!e.newlines||A(this._flags.mode)||this._flags.last_token.type===l.OPERATOR&&"--"!==this._flags.last_token.text&&"++"!==this._flags.last_token.text||this._flags.last_token.type===l.EQUALS||!this._options.preserve_newlines&&u(this._flags.last_token,["var","let","const","set","get"])?this.handle_whitespace_and_comments(e):(this.handle_whitespace_and_comments(e),this.print_newline()),this._flags.do_block&&!this._flags.do_while){if(d(e,"while"))return this._output.space_before_token=!0,this.print_token(e),this._output.space_before_token=!0,void(this._flags.do_while=!0);this.print_newline(),this._flags.do_block=!1}if(this._flags.if_block)if(!this._flags.else_block&&d(e,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===C;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&u(e,["case","default"]))return this.print_newline(),this._flags.case_block||!this._flags.case_body&&!this._options.jslint_happy||this.deindent(),this._flags.case_body=!1,this.print_token(e),void(this._flags.in_case=!0);if(this._flags.last_token.type!==l.COMMA&&this._flags.last_token.type!==l.START_EXPR&&this._flags.last_token.type!==l.EQUALS&&this._flags.last_token.type!==l.OPERATOR||this.start_of_object_property()||c(this._flags.last_token.text,["+","-"])&&":"===this._last_last_text&&this._flags.parent.mode===g||this.allow_wrap_or_preserved_newline(e),d(e,"function"))return(c(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!c(this._flags.last_token.text,["(","[","{",":","=",","])&&this._flags.last_token.type!==l.OPERATOR)&&(this._output.just_added_blankline()||e.comments_before||(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD?u(this._flags.last_token,["get","set","new","export"])||u(this._flags.last_token,k)||d(this._flags.last_token,"default")&&"export"===this._last_last_text||"declare"===this._flags.last_token.text?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===l.OPERATOR||"="===this._flags.last_token.text?this._output.space_before_token=!0:(this._flags.multiline_frame||!A(this._flags.mode)&&!M(this._flags.mode))&&this.print_newline(),this.print_token(e),void(this._flags.last_word=e.text);var t="NONE";(this._flags.last_token.type===l.END_BLOCK?this._previous_flags.inline_frame?t="SPACE":u(e,["else","catch","finally","from"])?"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&e.newlines?t="NEWLINE":(t="SPACE",this._output.space_before_token=!0):t="NEWLINE":this._flags.last_token.type===l.SEMICOLON&&this._flags.mode===m?t="NEWLINE":this._flags.last_token.type===l.SEMICOLON&&A(this._flags.mode)?t="SPACE":this._flags.last_token.type===l.STRING?t="NEWLINE":this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD||"*"===this._flags.last_token.text&&(c(this._last_last_text,["function","yield"])||this._flags.mode===g&&c(this._last_last_text,["{",","]))?t="SPACE":this._flags.last_token.type===l.START_BLOCK?t=this._flags.inline_frame?"SPACE":"NEWLINE":this._flags.last_token.type===l.END_EXPR&&(this._output.space_before_token=!0,t="NEWLINE"),u(e,o)&&")"!==this._flags.last_token.text&&(t=this._flags.inline_frame||"else"===this._flags.last_token.text||"export"===this._flags.last_token.text?"SPACE":"NEWLINE"),u(e,["else","catch","finally"]))?(this._flags.last_token.type!==l.END_BLOCK||this._previous_flags.mode!==m||"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&e.newlines)&&!this._flags.inline_frame?this.print_newline():(this._output.trim(!0),"}"!==this._output.current_line.last()&&this.print_newline(),this._output.space_before_token=!0):"NEWLINE"===t?u(this._flags.last_token,f)||"declare"===this._flags.last_token.text&&u(e,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==l.END_EXPR?this._flags.last_token.type===l.START_EXPR&&u(e,["var","let","const"])||":"===this._flags.last_token.text||(d(e,"if")&&d(e.previous,"else")?this._output.space_before_token=!0:this.print_newline()):u(e,o)&&")"!==this._flags.last_token.text&&this.print_newline():this._flags.multiline_frame&&M(this._flags.mode)&&","===this._flags.last_token.text&&"}"===this._last_last_text?this.print_newline():"SPACE"===t&&(this._output.space_before_token=!0);!e.previous||e.previous.type!==l.WORD&&e.previous.type!==l.RESERVED||(this._output.space_before_token=!0),this.print_token(e),this._flags.last_word=e.text,e.type===l.RESERVED&&("do"===e.text?this._flags.do_block=!0:"if"===e.text?this._flags.if_block=!0:"import"===e.text?this._flags.import_block=!0:this._flags.import_block&&d(e,"from")&&(this._flags.import_block=!1))},x.prototype.handle_semicolon=function(e){this.start_of_statement(e)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(e);for(var t=this._tokens.peek();!(this._flags.mode!==C||this._flags.if_block&&d(t,"else")||this._flags.do_block);)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(e)},x.prototype.handle_string=function(e){(!e.text.startsWith("`")||0!==e.newlines||""!==e.whitespace_before||")"!==e.previous.text&&this._flags.last_token.type!==l.WORD)&&(this.start_of_statement(e)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(e),this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR||this._flags.last_token.type===l.EQUALS||this._flags.last_token.type===l.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e):!e.text.startsWith("`")||this._flags.last_token.type!==l.END_EXPR||"]"!==e.previous.text&&")"!==e.previous.text||0!==e.newlines?this.print_newline():this._output.space_before_token=!0)),this.print_token(e)},x.prototype.handle_equals=function(e){this.start_of_statement(e)||this.handle_whitespace_and_comments(e),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(e),this._output.space_before_token=!0},x.prototype.handle_comma=function(e){this.handle_whitespace_and_comments(e,!0),this.print_token(e),this._output.space_before_token=!0,this._flags.declaration_statement?(A(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(e)):this._flags.mode===g||this._flags.mode===C&&this._flags.parent.mode===g?(this._flags.mode===C&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(e)},x.prototype.handle_operator=function(e){var t="*"===e.text&&(u(this._flags.last_token,["function","yield"])||c(this._flags.last_token.type,[l.START_BLOCK,l.COMMA,l.END_BLOCK,l.SEMICOLON])),n=c(e.text,["-","+"])&&(c(this._flags.last_token.type,[l.START_BLOCK,l.START_EXPR,l.EQUALS,l.OPERATOR])||c(this._flags.last_token.text,o)||","===this._flags.last_token.text);if(this.start_of_statement(e));else{var r=!t;this.handle_whitespace_and_comments(e,r)}if("*"!==e.text||this._flags.last_token.type!==l.DOT)if("::"!==e.text)if(c(e.text,["-","+"])&&this.start_of_object_property())this.print_token(e);else{if(this._flags.last_token.type===l.OPERATOR&&c(this._options.operator_position,p)&&this.allow_wrap_or_preserved_newline(e),":"===e.text&&this._flags.in_case)return this.print_token(e),this._flags.in_case=!1,this._flags.case_body=!0,void(this._tokens.peek().type!==l.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0));var i=!0,s=!0,d=!1;if(":"===e.text?0===this._flags.ternary_depth?i=!1:(this._flags.ternary_depth-=1,d=!0):"?"===e.text&&(this._flags.ternary_depth+=1),!n&&!t&&this._options.preserve_newlines&&c(e.text,a)){var g=":"===e.text,v=g&&d,y=g&&!d;switch(this._options.operator_position){case h.before_newline:return this._output.space_before_token=!y,this.print_token(e),g&&!v||this.allow_wrap_or_preserved_newline(e),void(this._output.space_before_token=!0);case h.after_newline:return this._output.space_before_token=!0,!g||v?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(e):this._output.space_before_token=!1,this.print_token(e),void(this._output.space_before_token=!0);case h.preserve_newline:return y||this.allow_wrap_or_preserved_newline(e),i=!(this._output.just_added_newline()||y),this._output.space_before_token=i,this.print_token(e),void(this._output.space_before_token=!0)}}if(t){this.allow_wrap_or_preserved_newline(e),i=!1;var w=this._tokens.peek();s=w&&c(w.type,[l.WORD,l.RESERVED])}else if("..."===e.text)this.allow_wrap_or_preserved_newline(e),i=this._flags.last_token.type===l.START_BLOCK,s=!1;else if(c(e.text,["--","++","!","~"])||n){if(this._flags.last_token.type!==l.COMMA&&this._flags.last_token.type!==l.START_EXPR||this.allow_wrap_or_preserved_newline(e),i=!1,s=!1,e.newlines&&("--"===e.text||"++"===e.text||"~"===e.text)){var b=u(this._flags.last_token,f)&&e.newlines;b&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(b,!0)}";"===this._flags.last_token.text&&A(this._flags.mode)&&(i=!0),this._flags.last_token.type===l.RESERVED?i=!0:this._flags.last_token.type===l.END_EXPR?i=!("]"===this._flags.last_token.text&&("--"===e.text||"++"===e.text)):this._flags.last_token.type===l.OPERATOR&&(i=c(e.text,["--","-","++","+"])&&c(this._flags.last_token.text,["--","-","++","+"]),c(e.text,["+","-"])&&c(this._flags.last_token.text,["--","++"])&&(s=!0)),(this._flags.mode!==m||this._flags.inline_frame)&&this._flags.mode!==C||"{"!==this._flags.last_token.text&&";"!==this._flags.last_token.text||this.print_newline()}this._output.space_before_token=this._output.space_before_token||i,this.print_token(e),this._output.space_before_token=s}else this.print_token(e);else this.print_token(e)},x.prototype.handle_block_comment=function(e,t){return this._output.raw?(this._output.add_raw_token(e),void(e.directives&&"end"===e.directives.preserve&&(this._output.raw=this._options.test_output_raw))):e.directives?(this.print_newline(!1,t),this.print_token(e),"start"===e.directives.preserve&&(this._output.raw=!0),void this.print_newline(!1,!0)):n.newline.test(e.text)||e.newlines?void this.print_block_commment(e,t):(this._output.space_before_token=!0,this.print_token(e),void(this._output.space_before_token=!0))},x.prototype.print_block_commment=function(e,t){var r,i=function(e){for(var t=[],r=(e=e.replace(n.allLineBreaks,"\n")).indexOf("\n");-1!==r;)t.push(e.substring(0,r)),r=(e=e.substring(r+1)).indexOf("\n");return e.length&&t.push(e),t}(e.text),o=!1,a=!1,l=e.whitespace_before,c=l.length;if(this.print_newline(!1,t),this.print_token_line_indentation(e),this._output.add_token(i[0]),this.print_newline(!1,t),i.length>1){for(o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].trim().charAt(0)!==t)return!1;return!0}(i=i.slice(1),"*"),a=function(e,t){for(var n,r=0,i=e.length;r<i;r++)if((n=e[r])&&0!==n.indexOf(t))return!1;return!0}(i,l),o&&(this._flags.alignment=1),r=0;r<i.length;r++)o?(this.print_token_line_indentation(e),this._output.add_token(s(i[r]))):a&&i[r]?(this.print_token_line_indentation(e),this._output.add_token(i[r].substring(c))):(this._output.current_line.set_indent(-1),this._output.add_token(i[r])),this.print_newline(!1,t);this._flags.alignment=0}},x.prototype.handle_comment=function(e,t){e.newlines?this.print_newline(!1,t):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(e),this.print_newline(!1,t)},x.prototype.handle_dot=function(e){this.start_of_statement(e)||this.handle_whitespace_and_comments(e,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),u(this._flags.last_token,f)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(e,")"===this._flags.last_token.text&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(e)},x.prototype.handle_unknown=function(e,t){this.print_token(e),"\n"===e.text[e.text.length-1]&&this.print_newline(!1,t)},x.prototype.handle_eof=function(e){for(;this._flags.mode===C;)this.restore_mode();this.handle_whitespace_and_comments(e)},YM.Beautifier=x,YM}var DA,TA,ZA,jA={exports:{}},RA={},BA={};function PA(){if(DA)return BA;DA=1;var e=sA().Options;function t(t){e.call(this,t,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var n=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||n;var r=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var i=0;i<r.length;i++)"expand"!==r[i]?this.brace_style="collapse":this.brace_style=r[i]}return t.prototype=new e,BA.Options=t,BA}function FA(){if(ZA)return jA.exports;ZA=1;var e=function(){if(TA)return RA;TA=1;var e=PA().Options,t=JM().Output,n=pA().InputScanner,r=new(0,LA().Directives)(/\/\*/,/\*\//),i=/\r\n|[\r\n]/,o=/\r\n|[\r\n]/g,a=/\s/,l=/(?:\s|\n)+/g,c=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,s=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function d(t,n){this._source_text=t||"",this._options=new e(n),this._ch=null,this._input=null,this.NESTED_AT_RULE={page:!0,"font-face":!0,keyframes:!0,media:!0,supports:!0,document:!0},this.CONDITIONAL_GROUP_RULE={media:!0,supports:!0,document:!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}return d.prototype.eatString=function(e){var t="";for(this._ch=this._input.next();this._ch;){if(t+=this._ch,"\\"===this._ch)t+=this._input.next();else if(-1!==e.indexOf(this._ch)||"\n"===this._ch)break;this._ch=this._input.next()}return t},d.prototype.eatWhitespace=function(e){for(var t=a.test(this._input.peek()),n=0;a.test(this._input.peek());)this._ch=this._input.next(),e&&"\n"===this._ch&&(0===n||n<this._options.max_preserve_newlines)&&(n++,this._output.add_new_line(!0));return t},d.prototype.foundNestedPseudoClass=function(){for(var e=0,t=1,n=this._input.peek(t);n;){if("{"===n)return!0;if("("===n)e+=1;else if(")"===n){if(0===e)return!1;e-=1}else if(";"===n||"}"===n)return!1;t++,n=this._input.peek(t)}return!1},d.prototype.print_string=function(e){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(e)},d.prototype.preserveSingleSpace=function(e){e&&(this._output.space_before_token=!0)},d.prototype.indent=function(){this._indentLevel++},d.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},d.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._source_text,d=this._options.eol;"auto"===d&&(d="\n",e&&i.test(e||"")&&(d=e.match(i)[0]));var u=(e=e.replace(o,"\n")).match(/^[\t ]*/)[0];this._output=new t(this._options,u),this._input=new n(e),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var f,h,p=0,m=!1,C=!1,g=!1,v=!1,y=!1,w=this._ch,b=!1;f=""!==this._input.read(l),h=w,this._ch=this._input.next(),"\\"===this._ch&&this._input.hasNext()&&(this._ch+=this._input.next()),w=this._ch,this._ch;)if("/"===this._ch&&"*"===this._input.peek()){this._output.add_new_line(),this._input.back();var E=this._input.read(c),M=r.get_directives(E);M&&"start"===M.ignore&&(E+=r.readIgnored(this._input)),this.print_string(E),this.eatWhitespace(!0),this._output.add_new_line()}else if("/"===this._ch&&"/"===this._input.peek())this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(s)),this.eatWhitespace(!0);else if("$"===this._ch){this.preserveSingleSpace(f),this.print_string(this._ch);var A=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);A.match(/[ :]$/)&&(A=this.eatString(": ").replace(/\s+$/,""),this.print_string(A),this._output.space_before_token=!0),0===p&&-1!==A.indexOf(":")&&(C=!0,this.indent())}else if("@"===this._ch)if(this.preserveSingleSpace(f),"{"===this._input.peek())this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var x=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);x.match(/[ :]$/)&&(x=this.eatString(": ").replace(/\s+$/,""),this.print_string(x),this._output.space_before_token=!0),0===p&&-1!==x.indexOf(":")?(C=!0,this.indent()):x in this.NESTED_AT_RULE?(this._nestedLevel+=1,x in this.CONDITIONAL_GROUP_RULE&&(g=!0)):0!==p||C||(v=!0)}else if("#"===this._ch&&"{"===this._input.peek())this.preserveSingleSpace(f),this.print_string(this._ch+this.eatString("}"));else if("{"===this._ch)C&&(C=!1,this.outdent()),v=!1,g?(g=!1,m=this._indentLevel>=this._nestedLevel):m=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&m&&this._output.previous_line&&"{"!==this._output.previous_line.item(-1)&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,"expand"===this._options.brace_style?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):("("===h?this._output.space_before_token=!1:","!==h&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if("}"===this._ch)this.outdent(),this._output.add_new_line(),"{"===h&&this._output.trim(!0),C&&(this.outdent(),C=!1),this.print_string(this._ch),m=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&"}"!==this._input.peek()&&this._output.add_new_line(!0),")"===this._input.peek()&&(this._output.trim(!0),"expand"===this._options.brace_style&&this._output.add_new_line(!0));else if(":"===this._ch){for(var k=0;k<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;k++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[k])){b=!0;break}!m&&!g||this._input.lookBack("&")||this.foundNestedPseudoClass()||this._input.lookBack("(")||v||0!==p?(this._input.lookBack(" ")&&(this._output.space_before_token=!0),":"===this._input.peek()?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":")):(this.print_string(":"),C||(C=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent()))}else if('"'===this._ch||"'"===this._ch){var L='"'===h||"'"===h;this.preserveSingleSpace(L||f),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(";"===this._ch)b=!1,0===p?(C&&(this.outdent(),C=!1),v=!1,this.print_string(this._ch),this.eatWhitespace(!0),"/"!==this._input.peek()&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if("("===this._ch)if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),p++,this.indent(),this._ch=this._input.next(),")"===this._ch||'"'===this._ch||"'"===this._ch?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),p&&(p--,this.outdent()));else{var H=!1;this._input.lookBack("with")&&(H=!0),this.preserveSingleSpace(f||H),this.print_string(this._ch),C&&"$"===h&&this._options.selector_separator_newline?(this._output.add_new_line(),y=!0):(this.eatWhitespace(),p++,this.indent())}else if(")"===this._ch)p&&(p--,this.outdent()),y&&";"===this._input.peek()&&this._options.selector_separator_newline&&(y=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(","===this._ch)this.print_string(this._ch),this.eatWhitespace(!0),!this._options.selector_separator_newline||C&&!y||0!==p||v?this._output.space_before_token=!0:this._output.add_new_line();else if(">"!==this._ch&&"+"!==this._ch&&"~"!==this._ch||C||0!==p)if("]"===this._ch)this.print_string(this._ch);else if("["===this._ch)this.preserveSingleSpace(f),this.print_string(this._ch);else if("="===this._ch)this.eatWhitespace(),this.print_string("="),a.test(this._ch)&&(this._ch="");else if("!"!==this._ch||this._input.lookBack("\\")){var _='"'===h||"'"===h;this.preserveSingleSpace(_||f),this.print_string(this._ch),!this._output.just_added_newline()&&"\n"===this._input.peek()&&b&&this._output.add_new_line()}else this._output.space_before_token=!0,this.print_string(this._ch);else this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&a.test(this._ch)&&(this._ch=""));return this._output.get_code(d)},RA.Beautifier=d,RA}().Beautifier,t=PA().Options;return jA.exports=function(t,n){return new e(t,n).beautify()},jA.exports.defaultOptions=function(){return new t},jA.exports}var UA,qA={exports:{}},WA={},QA={};function GA(){if(UA)return QA;UA=1;var e=sA().Options;function t(t){e.call(this,t,"html"),1===this.templating.length&&"auto"===this.templating[0]&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_min_attrs=this._get_number("wrap_attributes_min_attrs",2),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.inline_custom_elements=this._get_boolean("inline_custom_elements",!0),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}return t.prototype=new e,QA.Options=t,QA}var KA,YA,XA,JA,$A,ex={};function tx(){if(KA)return ex;KA=1;var e=AA().Tokenizer,t=AA().TOKEN,n=LA().Directives,r=zA().TemplatablePattern,i=MA().Pattern,o={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",CONTROL_FLOW_OPEN:"TK_CONTROL_FLOW_OPEN",CONTROL_FLOW_CLOSE:"TK_CONTROL_FLOW_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:t.START,RAW:t.RAW,EOF:t.EOF},a=new n(/<\!--/,/-->/),l=function(t,n){e.call(this,t,n),this._current_tag_name="";var o=new r(this._input).read_options(this._options),a=new i(this._input);if(this.__patterns={word:o.until(/[\n\r\t <]/),word_control_flow_close_excluded:o.until(/[\n\r\t <}]/),single_quote:o.until_after(/'/),double_quote:o.until_after(/"/),attribute:o.until(/[\n\r\t =>]|\/>/),element_name:o.until(/[\n\r\t >\/]/),angular_control_flow_start:a.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:a.starting_with(/{{!--/).until_after(/--}}/),handlebars:a.starting_with(/{{/).until_after(/}}/),handlebars_open:a.until(/[\n\r\t }]/),handlebars_raw_close:a.until(/}}/),comment:a.starting_with(/<!--/).until_after(/-->/),cdata:a.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:a.starting_with(/<!\[/).until_after(/]>/),processing:a.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars"),this.__patterns.word_control_flow_close_excluded=this.__patterns.word_control_flow_close_excluded.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var l=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=a.matching(l).until_after(l)}};return(l.prototype=new e)._is_comment=function(e){return!1},l.prototype._is_opening=function(e){return e.type===o.TAG_OPEN||e.type===o.CONTROL_FLOW_OPEN},l.prototype._is_closing=function(e,t){return e.type===o.TAG_CLOSE&&t&&((">"===e.text||"/>"===e.text)&&"<"===t.text[0]||"}}"===e.text&&"{"===t.text[0]&&"{"===t.text[1])||e.type===o.CONTROL_FLOW_CLOSE&&"}"===e.text&&t.text.endsWith("{")},l.prototype._reset=function(){this._current_tag_name=""},l.prototype._get_next_token=function(e,t){var n=null;this._readWhitespace();var r=this._input.peek();return null===r?this._create_token(o.EOF,""):n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=n||this._read_open_handlebars(r,t))||this._read_attribute(r,e,t))||this._read_close(r,t))||this._read_script_and_style(r,e))||this._read_control_flows(r,t))||this._read_raw_content(r,e,t))||this._read_content_word(r,t))||this._read_comment_or_cdata(r))||this._read_processing(r))||this._read_open(r,t))||this._create_token(o.UNKNOWN,this._input.next())},l.prototype._read_comment_or_cdata=function(e){var t=null,n=null,r=null;"<"===e&&("!"===this._input.peek(1)&&((n=this.__patterns.comment.read())?(r=a.get_directives(n))&&"start"===r.ignore&&(n+=a.readIgnored(this._input)):n=this.__patterns.cdata.read()),n&&((t=this._create_token(o.COMMENT,n)).directives=r));return t},l.prototype._read_processing=function(e){var t=null,n=null;if("<"===e){var r=this._input.peek(1);"!"!==r&&"?"!==r||(n=(n=this.__patterns.conditional_comment.read())||this.__patterns.processing.read()),n&&((t=this._create_token(o.COMMENT,n)).directives=null)}return t},l.prototype._read_open=function(e,t){var n=null,r=null;return t&&t.type!==o.CONTROL_FLOW_OPEN||"<"===e&&(n=this._input.next(),"/"===this._input.peek()&&(n+=this._input.next()),n+=this.__patterns.element_name.read(),r=this._create_token(o.TAG_OPEN,n)),r},l.prototype._read_open_handlebars=function(e,t){var n=null,r=null;return t&&t.type!==o.CONTROL_FLOW_OPEN||(this._options.templating.includes("angular")||this._options.indent_handlebars)&&"{"===e&&"{"===this._input.peek(1)&&(this._options.indent_handlebars&&"!"===this._input.peek(2)?(n=(n=this.__patterns.handlebars_comment.read())||this.__patterns.handlebars.read(),r=this._create_token(o.COMMENT,n)):(n=this.__patterns.handlebars_open.read(),r=this._create_token(o.TAG_OPEN,n))),r},l.prototype._read_control_flows=function(e,t){var n="",r=null;if(!this._options.templating.includes("angular"))return r;if("@"===e){if(""===(n=this.__patterns.angular_control_flow_start.read()))return r;for(var i=n.endsWith("(")?1:0,a=0;!n.endsWith("{")||i!==a;){var l=this._input.next();if(null===l)break;"("===l?i++:")"===l&&a++,n+=l}r=this._create_token(o.CONTROL_FLOW_OPEN,n)}else"}"===e&&t&&t.type===o.CONTROL_FLOW_OPEN&&(n=this._input.next(),r=this._create_token(o.CONTROL_FLOW_CLOSE,n));return r},l.prototype._read_close=function(e,t){var n=null,r=null;return t&&t.type===o.TAG_OPEN&&("<"===t.text[0]&&(">"===e||"/"===e&&">"===this._input.peek(1))?(n=this._input.next(),"/"===e&&(n+=this._input.next()),r=this._create_token(o.TAG_CLOSE,n)):"{"===t.text[0]&&"}"===e&&"}"===this._input.peek(1)&&(this._input.next(),this._input.next(),r=this._create_token(o.TAG_CLOSE,"}}"))),r},l.prototype._read_attribute=function(e,t,n){var r=null,i="";if(n&&"<"===n.text[0])if("="===e)r=this._create_token(o.EQUALS,this._input.next());else if('"'===e||"'"===e){var a=this._input.next();a+='"'===e?this.__patterns.double_quote.read():this.__patterns.single_quote.read(),r=this._create_token(o.VALUE,a)}else(i=this.__patterns.attribute.read())&&(r=t.type===o.EQUALS?this._create_token(o.VALUE,i):this._create_token(o.ATTRIBUTE,i));return r},l.prototype._is_content_unformatted=function(e){return-1===this._options.void_elements.indexOf(e)&&(-1!==this._options.content_unformatted.indexOf(e)||-1!==this._options.unformatted.indexOf(e))},l.prototype._read_raw_content=function(e,t,n){var r="";if(n&&"{"===n.text[0])r=this.__patterns.handlebars_raw_close.read();else if(t.type===o.TAG_CLOSE&&"<"===t.opened.text[0]&&"/"!==t.text[0]){var i=t.opened.text.substr(1).toLowerCase();this._is_content_unformatted(i)&&(r=this._input.readUntil(new RegExp("</"+i+"[\\n\\r\\t ]*?>","ig")))}return r?this._create_token(o.TEXT,r):null},l.prototype._read_script_and_style=function(e,t){if(t.type===o.TAG_CLOSE&&"<"===t.opened.text[0]&&"/"!==t.text[0]){var n=t.opened.text.substr(1).toLowerCase();if("script"===n||"style"===n){var r=this._read_comment_or_cdata(e);if(r)return r.type=o.TEXT,r;var i=this._input.readUntil(new RegExp("</"+n+"[\\n\\r\\t ]*?>","ig"));if(i)return this._create_token(o.TEXT,i)}}return null},l.prototype._read_content_word=function(e,t){var n="";return this._options.unformatted_content_delimiter&&e===this._options.unformatted_content_delimiter[0]&&(n=this.__patterns.unformatted_content_delimiter.read()),n||(n=t&&t.type===o.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),n?this._create_token(o.TEXT,n):null},ex.Tokenizer=l,ex.TOKEN=o,ex}function nx(){if(YA)return WA;YA=1;var e=GA().Options,t=JM().Output,n=tx().Tokenizer,r=tx().TOKEN,i=/\r\n|[\r\n]/,o=/\r\n|[\r\n]/g,a=function(e,n){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=e.max_preserve_newlines,this.preserve_newlines=e.preserve_newlines,this._output=new t(e,n)};a.prototype.current_line_has_match=function(e){return this._output.current_line.has_match(e)},a.prototype.set_space_before_token=function(e,t){this._output.space_before_token=e,this._output.non_breaking_space=t},a.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},a.prototype.add_raw_token=function(e){this._output.add_raw_token(e)},a.prototype.print_preserved_newlines=function(e){var t=0;e.type!==r.TEXT&&e.previous.type!==r.TEXT&&(t=e.newlines?1:0),this.preserve_newlines&&(t=e.newlines<this.max_preserve_newlines+1?e.newlines:this.max_preserve_newlines+1);for(var n=0;n<t;n++)this.print_newline(n>0);return 0!==t},a.prototype.traverse_whitespace=function(e){return!(!e.whitespace_before&&!e.newlines)&&(this.print_preserved_newlines(e)||(this._output.space_before_token=!0),!0)},a.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},a.prototype.print_newline=function(e){this._output.add_new_line(e)},a.prototype.print_token=function(e){e.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(e.text))},a.prototype.indent=function(){this.indent_level++},a.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},a.prototype.get_full_indent=function(e){return(e=this.indent_level+(e||0))<1?"":this._output.get_indent_string(e)};var l=function(e,t){var n=null,i=null;return t.closed?("script"===e?n="text/javascript":"style"===e&&(n="text/css"),n=function(e){for(var t=null,n=e.next;n.type!==r.EOF&&e.closed!==n;){if(n.type===r.ATTRIBUTE&&"type"===n.text){n.next&&n.next.type===r.EQUALS&&n.next.next&&n.next.next.type===r.VALUE&&(t=n.next.next.text);break}n=n.next}return t}(t)||n,n.search("text/css")>-1?i="css":n.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?i="javascript":n.search(/(text|application|dojo)\/(x-)?(html)/)>-1?i="html":n.search(/test\/null/)>-1&&(i="null"),i):null};function c(e,t){return-1!==t.indexOf(e)}function s(e,t,n){this.parent=e||null,this.tag=t?t.tag_name:"",this.indent_level=n||0,this.parser_token=t||null}function d(e){this._printer=e,this._current_frame=null}function u(t,n,r,i){this._source_text=t||"",n=n||{},this._js_beautify=r,this._css_beautify=i,this._tag_stack=null;var o=new e(n,"html");this._options=o,this._is_wrap_attributes_force="force"===this._options.wrap_attributes.substr(0,5),this._is_wrap_attributes_force_expand_multiline="force-expand-multiline"===this._options.wrap_attributes,this._is_wrap_attributes_force_aligned="force-aligned"===this._options.wrap_attributes,this._is_wrap_attributes_aligned_multiple="aligned-multiple"===this._options.wrap_attributes,this._is_wrap_attributes_preserve="preserve"===this._options.wrap_attributes.substr(0,8),this._is_wrap_attributes_preserve_aligned="preserve-aligned"===this._options.wrap_attributes}d.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},d.prototype.record_tag=function(e){var t=new s(this._current_frame,e,this._printer.indent_level);this._current_frame=t},d.prototype._try_pop_frame=function(e){var t=null;return e&&(t=e.parser_token,this._printer.indent_level=e.indent_level,this._current_frame=e.parent),t},d.prototype._get_frame=function(e,t){for(var n=this._current_frame;n&&-1===e.indexOf(n.tag);){if(t&&-1!==t.indexOf(n.tag)){n=null;break}n=n.parent}return n},d.prototype.try_pop=function(e,t){var n=this._get_frame([e],t);return this._try_pop_frame(n)},d.prototype.indent_to_tag=function(e){var t=this._get_frame(e);t&&(this._printer.indent_level=t.indent_level)},u.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._source_text,t=this._options.eol;"auto"===this._options.eol&&(t="\n",e&&i.test(e)&&(t=e.match(i)[0]));var l=(e=e.replace(o,"\n")).match(/^[\t ]*/)[0],c={text:"",type:""},s=new f(this._options),u=new a(this._options,l),h=new n(e,this._options).tokenize();this._tag_stack=new d(u);for(var p=null,m=h.next();m.type!==r.EOF;)m.type===r.TAG_OPEN||m.type===r.COMMENT?s=p=this._handle_tag_open(u,m,s,c,h):m.type===r.ATTRIBUTE||m.type===r.EQUALS||m.type===r.VALUE||m.type===r.TEXT&&!s.tag_complete?p=this._handle_inside_tag(u,m,s,c):m.type===r.TAG_CLOSE?p=this._handle_tag_close(u,m,s):m.type===r.TEXT?p=this._handle_text(u,m,s):m.type===r.CONTROL_FLOW_OPEN?p=this._handle_control_flow_open(u,m):m.type===r.CONTROL_FLOW_CLOSE?p=this._handle_control_flow_close(u,m):u.add_raw_token(m),c=p,m=h.next();return u._output.get_code(t)},u.prototype._handle_control_flow_open=function(e,t){var n={text:t.text,type:t.type};return e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),t.newlines?e.print_preserved_newlines(t):e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),e.print_token(t),e.indent(),n},u.prototype._handle_control_flow_close=function(e,t){var n={text:t.text,type:t.type};return e.deindent(),t.newlines?e.print_preserved_newlines(t):e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),e.print_token(t),n},u.prototype._handle_tag_close=function(e,t,n){var r={text:t.text,type:t.type};return e.alignment_size=0,n.tag_complete=!0,e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),n.is_unformatted?e.add_raw_token(t):("<"===n.tag_start_char&&(e.set_space_before_token("/"===t.text[0],!0),this._is_wrap_attributes_force_expand_multiline&&n.has_wrapped_attrs&&e.print_newline(!1)),e.print_token(t)),!n.indent_content||n.is_unformatted||n.is_content_unformatted||(e.indent(),n.indent_content=!1),n.is_inline_element||n.is_unformatted||n.is_content_unformatted||e.set_wrap_point(),r},u.prototype._handle_inside_tag=function(e,t,n,i){var o=n.has_wrapped_attrs,a={text:t.text,type:t.type};return e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),n.is_unformatted?e.add_raw_token(t):"{"===n.tag_start_char&&t.type===r.TEXT?e.print_preserved_newlines(t)?(t.newlines=0,e.add_raw_token(t)):e.print_token(t):(t.type===r.ATTRIBUTE?e.set_space_before_token(!0):(t.type===r.EQUALS||t.type===r.VALUE&&t.previous.type===r.EQUALS)&&e.set_space_before_token(!1),t.type===r.ATTRIBUTE&&"<"===n.tag_start_char&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(e.traverse_whitespace(t),o=o||0!==t.newlines),this._is_wrap_attributes_force&&n.attr_count>=this._options.wrap_attributes_min_attrs&&(i.type!==r.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(e.print_newline(!1),o=!0)),e.print_token(t),o=o||e.previous_token_wrapped(),n.has_wrapped_attrs=o),a},u.prototype._handle_text=function(e,t,n){var r={text:t.text,type:"TK_CONTENT"};return n.custom_beautifier_name?this._print_custom_beatifier_text(e,t,n):n.is_unformatted||n.is_content_unformatted?e.add_raw_token(t):(e.traverse_whitespace(t),e.print_token(t)),r},u.prototype._print_custom_beatifier_text=function(e,t,n){var r=this;if(""!==t.text){var i,o=t.text,a=1,l="",c="";"javascript"===n.custom_beautifier_name&&"function"==typeof this._js_beautify?i=this._js_beautify:"css"===n.custom_beautifier_name&&"function"==typeof this._css_beautify?i=this._css_beautify:"html"===n.custom_beautifier_name&&(i=function(e,t){return new u(e,t,r._js_beautify,r._css_beautify).beautify()}),"keep"===this._options.indent_scripts?a=0:"separate"===this._options.indent_scripts&&(a=-e.indent_level);var s=e.get_full_indent(a);if(o=o.replace(/\n[ \t]*$/,""),"html"!==n.custom_beautifier_name&&"<"===o[0]&&o.match(/^(<!--|<!\[CDATA\[)/)){var d=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(o);if(!d)return void e.add_raw_token(t);l=s+d[1]+"\n",o=d[4],d[5]&&(c=s+d[5]),o=o.replace(/\n[ \t]*$/,""),(d[2]||-1!==d[3].indexOf("\n"))&&(d=d[3].match(/[ \t]+$/))&&(t.whitespace_before=d[0])}if(o)if(i){var f=function(){this.eol="\n"};f.prototype=this._options.raw_options,o=i(s+o,new f)}else{var h=t.whitespace_before;h&&(o=o.replace(new RegExp("\n("+h+")?","g"),"\n")),o=s+o.replace(/\n/g,"\n"+s)}l&&(o=o?l+o+"\n"+c:l+c),e.print_newline(!1),o&&(t.text=o,t.whitespace_before="",t.newlines=0,e.add_raw_token(t),e.print_newline(!0))}},u.prototype._handle_tag_open=function(e,t,n,i,o){var a=this._get_tag_open_token(t);if(!n.is_unformatted&&!n.is_content_unformatted||n.is_empty_element||t.type!==r.TAG_OPEN||a.is_start_tag?(e.traverse_whitespace(t),this._set_tag_position(e,t,a,n,i),a.is_inline_element||e.set_wrap_point(),e.print_token(t)):(e.add_raw_token(t),a.start_tag_token=this._tag_stack.try_pop(a.tag_name)),a.is_start_tag&&this._is_wrap_attributes_force){var l,c=0;do{(l=o.peek(c)).type===r.ATTRIBUTE&&(a.attr_count+=1),c+=1}while(l.type!==r.EOF&&l.type!==r.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(a.alignment_size=t.text.length+1),a.tag_complete||a.is_unformatted||(e.alignment_size=a.alignment_size),a};var f=function(e,t,n){if(this.parent=t||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",n){var i;this.tag_start_char=n.text[0],this.text=n.text,"<"===this.tag_start_char?(i=n.text.match(/^<([^\s>]*)/),this.tag_check=i?i[1]:""):(i=n.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=i?i[1]:"",(n.text.startsWith("{{#>")||n.text.startsWith("{{~#>"))&&">"===this.tag_check[0]&&(">"===this.tag_check&&null!==n.next?this.tag_check=n.next.text.split(" ")[0]:this.tag_check=n.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),n.type===r.COMMENT&&(this.tag_complete=!0),this.is_start_tag="/"!==this.tag_check.charAt(0),this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||n.closed&&"/>"===n.closed.text;var o=2;"{"===this.tag_start_char&&this.text.length>=3&&"~"===this.text.charAt(2)&&(o=3),this.is_end_tag=this.is_end_tag||"{"===this.tag_start_char&&(!e.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(o)))}else this.tag_complete=!0};u.prototype._get_tag_open_token=function(e){var t=new f(this._options,this._tag_stack.get_parser_token(),e);return t.alignment_size=this._options.wrap_attributes_indent_size,t.is_end_tag=t.is_end_tag||c(t.tag_check,this._options.void_elements),t.is_empty_element=t.tag_complete||t.is_start_tag&&t.is_end_tag,t.is_unformatted=!t.tag_complete&&c(t.tag_check,this._options.unformatted),t.is_content_unformatted=!t.is_empty_element&&c(t.tag_check,this._options.content_unformatted),t.is_inline_element=c(t.tag_name,this._options.inline)||this._options.inline_custom_elements&&t.tag_name.includes("-")||"{"===t.tag_start_char,t},u.prototype._set_tag_position=function(e,t,n,i,o){if(n.is_empty_element||(n.is_end_tag?n.start_tag_token=this._tag_stack.try_pop(n.tag_name):(this._do_optional_end_element(n)&&(n.is_inline_element||e.print_newline(!1)),this._tag_stack.record_tag(n),"script"!==n.tag_name&&"style"!==n.tag_name||n.is_unformatted||n.is_content_unformatted||(n.custom_beautifier_name=l(n.tag_check,t)))),c(n.tag_check,this._options.extra_liners)&&(e.print_newline(!1),e._output.just_added_blankline()||e.print_newline(!0)),n.is_empty_element){if("{"===n.tag_start_char&&"else"===n.tag_check)this._tag_stack.indent_to_tag(["if","unless","each"]),n.indent_content=!0,e.current_line_has_match(/{{#if/)||e.print_newline(!1);"!--"===n.tag_name&&o.type===r.TAG_CLOSE&&i.is_end_tag&&-1===n.text.indexOf("\n")||(n.is_inline_element||n.is_unformatted||e.print_newline(!1),this._calcluate_parent_multiline(e,n))}else if(n.is_end_tag){var a=!1;a=(a=n.start_tag_token&&n.start_tag_token.multiline_content)||!n.is_inline_element&&!(i.is_inline_element||i.is_unformatted)&&!(o.type===r.TAG_CLOSE&&n.start_tag_token===i)&&"TK_CONTENT"!==o.type,(n.is_content_unformatted||n.is_unformatted)&&(a=!1),a&&e.print_newline(!1)}else n.indent_content=!n.custom_beautifier_name,"<"===n.tag_start_char&&("html"===n.tag_name?n.indent_content=this._options.indent_inner_html:"head"===n.tag_name?n.indent_content=this._options.indent_head_inner_html:"body"===n.tag_name&&(n.indent_content=this._options.indent_body_inner_html)),n.is_inline_element||n.is_unformatted||"TK_CONTENT"===o.type&&!n.is_content_unformatted||e.print_newline(!1),this._calcluate_parent_multiline(e,n)},u.prototype._calcluate_parent_multiline=function(e,t){!t.parent||!e._output.just_added_newline()||(t.is_inline_element||t.is_unformatted)&&t.parent.is_inline_element||(t.parent.multiline_content=!0)};var h=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","menu","nav","ol","p","pre","section","table","ul"],p=["a","audio","del","ins","map","noscript","video"];return u.prototype._do_optional_end_element=function(e){var t=null;if(!e.is_empty_element&&e.is_start_tag&&e.parent){if("body"===e.tag_name)t=t||this._tag_stack.try_pop("head");else if("li"===e.tag_name)t=t||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if("dd"===e.tag_name||"dt"===e.tag_name)t=(t=t||this._tag_stack.try_pop("dt",["dl"]))||this._tag_stack.try_pop("dd",["dl"]);else if("p"===e.parent.tag_name&&-1!==h.indexOf(e.tag_name)){var n=e.parent.parent;n&&-1!==p.indexOf(n.tag_name)||(t=t||this._tag_stack.try_pop("p"))}else"rp"===e.tag_name||"rt"===e.tag_name?t=(t=t||this._tag_stack.try_pop("rt",["ruby","rtc"]))||this._tag_stack.try_pop("rp",["ruby","rtc"]):"optgroup"===e.tag_name?t=t||this._tag_stack.try_pop("optgroup",["select"]):"option"===e.tag_name?t=t||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):"colgroup"===e.tag_name?t=t||this._tag_stack.try_pop("caption",["table"]):"thead"===e.tag_name?t=(t=t||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]):"tbody"===e.tag_name||"tfoot"===e.tag_name?t=(t=(t=(t=t||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("thead",["table"]))||this._tag_stack.try_pop("tbody",["table"]):"tr"===e.tag_name?t=(t=(t=t||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"]):"th"!==e.tag_name&&"td"!==e.tag_name||(t=(t=t||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]))||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return e.parent=this._tag_stack.get_parser_token(),t}},WA.Beautifier=u,WA}function rx(){if(JA)return GM;JA=1;var e=function(){if(VA)return KM.exports;VA=1;var e=IA().Beautifier,t=dA().Options;return KM.exports=function(t,n){return new e(t,n).beautify()},KM.exports.defaultOptions=function(){return new t},KM.exports}(),t=FA(),n=function(){if(XA)return qA.exports;XA=1;var e=nx().Beautifier,t=GA().Options;return qA.exports=function(t,n,r,i){return new e(t,n,r,i).beautify()},qA.exports.defaultOptions=function(){return new t},qA.exports}();function r(r,i,o,a){return n(r,i,o=o||e,a=a||t)}return r.defaultOptions=n.defaultOptions,GM.js=e,GM.css=t,GM.html=r,GM}var ix=($A||($A=1,function(e){var t,n,r,i,o=rx();o.js_beautify=o.js,o.css_beautify=o.css,o.html_beautify=o.html,e.exports=(t=o,n=o,r=o,i=function(e,n){return t.js_beautify(e,n)},i.js=t.js_beautify,i.css=n.css_beautify,i.html=r.html_beautify,i.js_beautify=t.js_beautify,i.css_beautify=n.css_beautify,i.html_beautify=r.html_beautify,i)}(QM)),QM.exports);const ox=(e,t,n=150)=>{if(!e||!t)return{top:0,left:0};const{top:r,left:i}=e,o=t.getBoundingClientRect();let a=r,l=i;return a-=a+n>t.clientHeight-n+130?Math.floor(n/2)+n-35:10,i>.6*o.width?l-=n+50:i<.5*o.width+n&&(l-=42),{top:a,left:l}},ax=o(({width:t="100%",height:r="100%",VariableDropdownHeight:i="160px",readOnly:o=!1,value:c="",handleChange:d,setValue:u,variableOptionsList:f=[],addForloopPrefix:h=!1,language:p="json",theme:m="light",isRequisiteType:C=!1,onPaste:g,showVariableDropdown:v=!0,defaultValue:y,customOptions:w={},editorVariableZindex:E=99999,showMinimap:M=!0,isFocus:A=!1},x)=>{const k=a(null),L=a([]),H=a(null),_=a(null),[S,V]=s(0),[O,z]=s(!1),[N,I]=s(!1),[D,T]=s({top:0,left:0}),[Z,j]=s([]),R=a(f);l(()=>{R.current=f},[f]);l(()=>{const e=k.current;if(!e)return;const t=e.onDidBlurEditorWidget(()=>{I(!1),H.current=null,_.current=null,L.current=[],V(0)}),n=t=>{const n=e.getDomNode(),r=n&&n.contains(t.target);if(!r||r&&!t.target.closest(".view-line, .monaco-editor-textarea")){const e=n?.querySelector("textarea");e&&e.blur()}};return document.addEventListener("mousedown",n),()=>{t.dispose(),document.removeEventListener("mousedown",n)}},[N]),l(()=>{const e=k.current;if(!e||!S)return;const t=[],n=[];O?n.push({range:{startLineNumber:S,startColumn:1,endLineNumber:S,endColumn:1},options:{isWholeLine:!1,linesDecorationsClassName:"active-line-number"}}):t.push({range:{startLineNumber:S,startColumn:1,endLineNumber:S,endColumn:1},options:{isWholeLine:!0,className:"current-line-background"}}),L.current=e.deltaDecorations(L.current,[...t,...n])},[S,O]);const B=(e,t)=>{switch(t){case"json":case"javascript":return ix.js(e,{indent_size:4,indent_char:" ",max_preserve_newlines:5,preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!0,brace_style:"collapse",space_before_conditional:!0,unescape_strings:!0,jslint_happy:!0,end_with_newline:!0,wrap_line_length:0,comma_first:!1,e4x:!0,indent_empty_lines:!0});case"html":case"xml":return ix.html(e,{indent_size:4,indent_char:" ",max_preserve_newlines:5,preserve_newlines:!0,end_with_newline:!0,wrap_line_length:0,indent_empty_lines:!0});default:return e}};return b(x,()=>({getEditorInstance:()=>k.current,focus:()=>{k.current?.focus()},beautify:()=>{if(k.current){const e=k.current.getValue(),t=k.current.getModel()?.getLanguageId(),n=B(e,t||"json");k.current.setValue(n)}}})),n("div",{style:{width:t,height:r},className:"ff-editor-container",children:[e(WM,{defaultValue:y,height:r,width:t,language:p,value:c,options:{minimap:{enabled:M},lineNumbers:"on",wordWrap:"on",autoClosingBrackets:"always",scrollBeyondLastLine:!1,readOnly:o,guides:{indentation:!1},...w},onMount:(e,t)=>{k.current=e,A&&setTimeout(()=>{e.focus()},0),e.onDidChangeCursorPosition(t=>{V(t.position.lineNumber);const n=e.getPosition(),r=e.getModel();if(!n||!r)return;const i=r.getLineContent(n.lineNumber),o=n.column-1;if(0===o)return void I(!1);const a=i.lastIndexOf("$",o-1),l=i.lastIndexOf("${",o-1),c=-1!==l?i.indexOf("}",l+2):-1,s=-1!==l&&-1!==c&&o-1>l&&o-1<c,d=!/\}/.test(i.slice(a+1,o));if(-1!==a&&o>a&&!/\s/.test(i.slice(a+1,o))&&!s&&d){H.current=a,_.current=i.slice(a+1,o);const r=(_.current??"").toLowerCase(),l=R.current.filter(e=>("_startforloop"===e.type&&h?`FLV_for:${e.name}`:e.name).toLowerCase().includes(r));j(l);const c=e.getScrolledVisiblePosition(n),s=e.getDomNode();T(ox(c,s,150)),["keyboard","mouse","deleteLeft"].includes(t?.source||"")&&I(!0)}else I(!1),H.current=null,_.current=null}),e.onMouseDown(()=>{setTimeout(()=>{const e=k.current;if(!e)return;const t=e.getPosition(),n=e.getModel();if(!t||!n)return;const r=n.getLineContent(t.lineNumber),i=t.column-2;"$"===r[i]?(H.current=i,_.current=""):(H.current=null,_.current=null)},0)}),e.onDidChangeCursorSelection(()=>{const t=(e.getSelections?.()||[]).some(e=>e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn);z(t)}),e.onDidChangeModelContent(()=>{const t=e.getValue();u(t);const n=e.getPosition(),r=e.getModel();if(!n||!r)return;const i=r.getLineContent(n.lineNumber),o=n.column-2;if("$"===i[H.current??o]){null===H.current&&(H.current=o),_.current=i.slice(H.current+1,o);const t=R.current.filter(e=>("_startforloop"===e.type&&h?`FLV_for:${e.name}`:e.name).toLowerCase().includes(_.current?.toLowerCase()));t.length?j(t):(j([]),H?.current!==o&&" "===i[o]&&(H.current=null,_.current=null,I(!1)));const r=e.getScrolledVisiblePosition(n),a=e.getDomNode();T(ox(r,a,150))}else H.current=null,_.current=null}),e.onDidPaste(()=>{const t=e.getValue();if(t){const n=B(t,p);e.setValue(n),g&&g(n)}}),t.languages.registerCompletionItemProvider(p,{triggerCharacters:["."],provideCompletionItems:(e,n)=>{const r=e.getValueInRange({startLineNumber:n.lineNumber,startColumn:1,endLineNumber:n.lineNumber,endColumn:n.column}),i=e.getWordAtPosition(n),o=i?new t.Range(n.lineNumber,i.startColumn,n.lineNumber,i.endColumn):new t.Range(n.lineNumber,n.column,n.lineNumber,n.column),a=[];return r.endsWith("ff.")&&a.push({label:"getVariable",kind:t.languages.CompletionItemKind.Method,insertText:"getVariable(${1:variableName})",insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet,detail:"Get a variable value",range:o},{label:"setVariable",kind:t.languages.CompletionItemKind.Method,insertText:"setVariable(${1:variableName}, ${2:value})",insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet,detail:"Set a variable value",range:o},{label:"sendRequest",kind:t.languages.CompletionItemKind.Method,insertText:'sendRequest({\n method: "GET",//add your method\n url: "https://fakestoreapi.com/products",//enter your url\n headers: { },//add your headers,\n params: params,//add your params,\n data: body,//add your request body,\n })',insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet,detail:"Make your http requests",range:o}),{suggestions:a}}})},onChange:(e,t)=>d(e,t),theme:m}),N&&D&&v&&e(aE,{position:"absolute",width:"300px",height:i,optionsList:Z,onSelectVariable:e=>{if(C&&k.current){const t=k.current,n=t.getPosition();if(n){const r=`'${e.name}'`,i=H?.current??0;t.executeEdits("",[{range:{startLineNumber:n.lineNumber,startColumn:i+1,endLineNumber:n.lineNumber,endColumn:i+(n.column-i)},text:r,forceMoveMarkers:!0}]),_.current=null,H.current=null,I(!1)}}else((e,t)=>{if(k.current){const n=k.current,r=n.getPosition();if(r){const i=`{${t}${"FLV_for:"===t?"":"_"}${e}}`,o=H?.current??0;n.executeEdits("",[{range:{startLineNumber:r.lineNumber,startColumn:o+2,endLineNumber:r.lineNumber,endColumn:o+(r.column-o)},text:i,forceMoveMarkers:!1}]);const a=[];a.push({range:{startLineNumber:S,startColumn:1,endLineNumber:S,endColumn:1},options:{isWholeLine:!1}}),L.current=n.deltaDecorations(L.current,a),_.current=null,H.current=null,I(!1)}}})("DATAPROVIDER"===e?.type?e?.dpName+":"+e?.varname:e?.name,"STEPGROUP"===e.parentVariableType?"SGV":"GLOBAL"===e?.type?"GV":"LOCAL"===e?.type?"LV":e?._id?.includes("PARAMETER")?"SGP":"_startforloop"===e?.type?"FLV_for:":"DATAPROVIDER"===e?.type?"DPV":"PEV")},dropdownPosition:D,zIndex:E})]})}),lx=e=>e.flatMap(e=>e.runLevelExecutionDataSets.map((t,n)=>{const{runLevelExecutionDataSets:r,...i}=e;return{...i,...t,runCount:n+1}}));var cx,sx={exports:{}};var dx=(cx||(cx=1,"undefined"!=typeof self&&self,sx.exports=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="lib/",n(n.s=5)}([function(t,n){t.exports=e},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ArcherContainerContextProvider=t.ArcherContainerContext=void 0;var i=r(n(0));t.ArcherContainerContext=i.default.createContext(null),t.ArcherContainerContextProvider=t.ArcherContainerContext.Provider},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.encodeId=void 0,t.encodeId=function(e){return encodeURI(e).replace(/%/g,"_")}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.getMarkerId=t.createShapeObj=t.getSourceToTargets=t.getEndShapeFromStyle=void 0;var r=["arrow","circle"];t.getEndShapeFromStyle=function(e){return e.endShape&&Object.keys(e.endShape).filter(function(e){return r.includes(e)})[0]||r[0]},t.getSourceToTargets=function(e){var t=Object.keys(e).map(function(t){return e[t]});return[].concat.apply([],t).sort(function(e,t){return e.order-t.order})},t.createShapeObj=function(e,n){return{arrow:function(){var t;return{arrow:Object.assign(Object.assign({},null==n?void 0:n.arrow),null===(t=e.endShape)||void 0===t?void 0:t.arrow)}},circle:function(){var t;return{circle:Object.assign(Object.assign({},null==n?void 0:n.circle),null===(t=e.endShape)||void 0===t?void 0:t.circle)}}}[(0,t.getEndShapeFromStyle)(e)]()},t.getMarkerId=function(e,t,n){return"".concat(e).concat(t.id).concat(n.id)}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.endShapeDefaultProp=void 0,t.endShapeDefaultProp={arrow:{arrowLength:10,arrowThickness:6},circle:{radius:2,fillColor:"#f00",strokeColor:"#0ff",strokeWidth:1}}},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ArcherContainer=t.ArcherElement=void 0;var i=n(6);Object.defineProperty(t,"ArcherElement",{enumerable:!0,get:function(){return r(i).default}});var o=n(11);Object.defineProperty(t,"ArcherContainer",{enumerable:!0,get:function(){return r(o).default}})},function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&("get"in i?t.__esModule:!i.writable&&!i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),l=n(7),c=n(1),s=n(2),d=n(8),u=n(10);t.default=function(e){var t=e.id,n=e.relations,r=void 0===n?[]:n,i=e.children,o=(0,a.useMemo)(function(){return(0,s.encodeId)(t)},[t]),f=(0,a.useContext)(c.ArcherContainerContext),h=(0,a.useRef)(),p=(0,a.useCallback)(function(e){var t=(0,u.generateSourceToTarget)(o,e);(0,u.assertContextExists)(f),f.registerTransitions(o,t)},[f,o]),m=(0,a.useCallback)(function(){(0,u.assertContextExists)(f),f.unregisterTransitions(o)},[f,o]),C=(0,a.useCallback)(function(e){e&&((0,u.assertContextExists)(f),f.registerChild(o,e))},[o,f]),g=(0,a.useCallback)(function(){(0,u.assertContextExists)(f),f.unregisterChild(o)},[f,o]);(0,l.useIsomorphicLayoutEffect)(function(){return C(h.current),function(){return g()}},[C,g]),(0,d.useDeepCompareEffect)(function(){return p(r),function(){return m()}},[p,r,m]),a.default.Children.only(i);var v=i;return a.default.cloneElement(v,Object.assign(Object.assign({},v.props),{ref:h}))}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useIsomorphicLayoutEffect=void 0;var r=n(0);t.useIsomorphicLayoutEffect="undefined"!=typeof window?r.useLayoutEffect:r.useEffect},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useDeepCompareEffect=void 0;var i=n(0),o=r(n(9));function a(e){var t=(0,i.useRef)();return(0,o.default)(e,t.current)||(t.current=e),t.current}t.useDeepCompareEffect=function(e,t){(0,i.useEffect)(e,t.map(a))}},function(e,t,n){var r=Array.isArray,i=Object.keys,o=Object.prototype.hasOwnProperty,a="undefined"!=typeof Element;e.exports=function(e,t){try{return function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){var l,c,s,d=r(t),u=r(n);if(d&&u){if((c=t.length)!=n.length)return!1;for(l=c;0!=l--;)if(!e(t[l],n[l]))return!1;return!0}if(d!=u)return!1;var f=t instanceof Date,h=n instanceof Date;if(f!=h)return!1;if(f&&h)return t.getTime()==n.getTime();var p=t instanceof RegExp,m=n instanceof RegExp;if(p!=m)return!1;if(p&&m)return t.toString()==n.toString();var C=i(t);if((c=C.length)!==i(n).length)return!1;for(l=c;0!=l--;)if(!o.call(n,C[l]))return!1;if(a&&t instanceof Element&&n instanceof Element)return t===n;for(l=c;0!=l--;)if(!("_owner"===(s=C[l])&&t.$$typeof||e(t[s],n[s])))return!1;return!0}return t!=t&&n!=n}(e,t)}catch(e){if(e.message&&e.message.match(/stack|recursion/i)||-2146828260===e.number)return console.warn("Warning: react-fast-compare does not handle circular references.",e.name,e.message),!1;throw e}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.generateSourceToTarget=t.assertContextExists=void 0;var r=n(2);t.assertContextExists=function(e){if(!e)throw new Error("Could not find ArcherContainerContext in <ArcherElement>. Please wrap the component in a <ArcherContainer>.")},t.generateSourceToTarget=function(e,t){return t.map(function(t){var n=t.targetId,i=t.sourceAnchor,o=t.targetAnchor,a=t.label,l=t.className,c=t.style,s=t.order,d=void 0===s?0:s,u=t.domAttributes,f=t.cursor,h=t.hitSlop;return{source:{id:(0,r.encodeId)(e),anchor:i},target:{id:(0,r.encodeId)(n),anchor:o},className:l,label:a,style:c,order:d,domAttributes:u,cursor:f,hitSlop:h}})}},function(e,t,n){function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,l=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){l=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(l)throw i}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var a=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&("get"in i?t.__esModule:!i.writable&&!i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),l=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&a(t,e,n);return l(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var d=c(n(0)),u=s(n(12)),f=n(1),h=n(14),p=n(4),m=n(19),C=n(20),g={position:"absolute",width:"100%",height:"100%",top:0,left:0,pointerEvents:"none"},v=d.default.forwardRef(function(e,t){var n=e.endShape,o=void 0===n?p.endShapeDefaultProp:n,a=e.strokeColor,l=void 0===a?"#f00":a,c=e.strokeWidth,s=void 0===c?2:c,v=e.svgContainerStyle,y=void 0===v?{}:v,w=e.noCurves,b=e.children,E=e.className,M=e.endMarker,A=e.lineStyle,x=e.offset,k=e.startMarker,L=e.strokeDasharray,H=e.style,_=i((0,d.useState)({}),2),S=_[0],V=_[1],O=i((0,d.useState)({}),2),z=O[0],N=O[1],I=(0,d.useRef)(new u.default(function(){R()})).current,D=(0,d.useRef)(null),T=i(d.default.useState(),2)[1],Z=(0,d.useRef)("arrow".concat(Math.random().toString().slice(2))).current;(0,d.useImperativeHandle)(t,function(){return{refreshScreen:R,arrowMarkerUniquePrefix:Z}});var j,R=d.default.useCallback(function(){return T({})},[]),B=(0,d.useCallback)(function(e,t){N(function(n){return Object.assign(Object.assign({},n),r({},e,t))})},[]),P=(0,d.useCallback)(function(e){N(function(t){var n=Object.assign({},t);return delete n[e],n})},[]),F=(0,d.useCallback)(function(e,t){V(function(n){return n[e]===t?n:Object.assign(Object.assign({},n),r({},e,t))})},[]),U=(0,d.useCallback)(function(e){V(function(t){var n=Object.assign({},t);return delete n[e],n})},[]),q=(0,d.useMemo)(function(){return Object.assign(Object.assign({},g),y)},[y]);j="function"==typeof b?b(f.ArcherContainerContext):b,(0,C.useResizeListener)(R),(0,C.useObserveElements)(S,I);var W=(0,d.useMemo)(function(){return{registerTransitions:B,unregisterTransitions:P,registerChild:F,unregisterChild:U}},[B,P,F,U]);return d.default.createElement(f.ArcherContainerContextProvider,{value:W},d.default.createElement("div",{style:Object.assign(Object.assign({},H),{position:"relative"}),className:E},d.default.createElement("svg",{style:q},d.default.createElement("defs",null,d.default.createElement(m.ArrowMarkers,{endShape:o,sourceToTargetsMap:z,strokeColor:l,uniqueId:Z})),d.default.createElement(h.SvgArrows,{startMarker:k,endMarker:M,endShape:o,strokeColor:l,strokeWidth:s,strokeDasharray:L,noCurves:w,lineStyle:A,offset:x,parentCurrent:D.current,refs:S,uniqueId:Z,sourceToTargetsMap:z})),d.default.createElement("div",{style:{height:"100%"},ref:D},j)))});t.default=v},function(e,t,n){n.r(t),function(e){var n=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some(function(e,r){return e[0]===t&&(n=r,!0)}),n}return function(){function t(){this.__entries__=[]}var n={size:{configurable:!0}};return n.size.get=function(){return this.__entries__.length},t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n<r.length;n+=1){var i=r[n];e.call(t,i[1],i[0])}},Object.defineProperties(t.prototype,n),t}()}(),r="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,i=void 0!==e&&e.Math===Math?e:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),o="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(i):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)},a=2,l=["top","right","bottom","left","width","height","size","weight"],c="undefined"!=typeof MutationObserver,s=function(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,r=!1,i=0;function l(){n&&(n=!1,e()),r&&s()}function c(){o(l)}function s(){var e=Date.now();if(n){if(e-i<a)return;r=!0}else n=!0,r=!1,setTimeout(c,t);i=e}return s}(this.refresh.bind(this),20)};s.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},s.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},s.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},s.prototype.updateObservers_=function(){var e=this.observers_.filter(function(e){return e.gatherActive(),e.hasActive()});return e.forEach(function(e){return e.broadcastActive()}),e.length>0},s.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),c?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},s.prototype.disconnect_=function(){r&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},s.prototype.onTransitionEnd_=function(e){var t=e.propertyName;void 0===t&&(t=""),l.some(function(e){return!!~t.indexOf(e)})&&this.refresh()},s.getInstance=function(){return this.instance_||(this.instance_=new s),this.instance_},s.instance_=null;var d=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n+=1){var i=r[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},u=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||i},f=v(0,0,0,0);function h(e){return parseFloat(e)||0}function p(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return t.reduce(function(t,n){return t+h(e["border-"+n+"-width"])},0)}function m(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return f;var r=u(e).getComputedStyle(e),i=function(e){for(var t={},n=0,r=["top","right","bottom","left"];n<r.length;n+=1){var i=r[n],o=e["padding-"+i];t[i]=h(o)}return t}(r),o=i.left+i.right,a=i.top+i.bottom,l=h(r.width),c=h(r.height);if("border-box"===r.boxSizing&&(Math.round(l+o)!==t&&(l-=p(r,"left","right")+o),Math.round(c+a)!==n&&(c-=p(r,"top","bottom")+a)),!function(e){return e===u(e).document.documentElement}(e)){var s=Math.round(l+o)-t,d=Math.round(c+a)-n;1!==Math.abs(s)&&(l-=s),1!==Math.abs(d)&&(c-=d)}return v(i.left,i.top,l,c)}var C="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof u(e).SVGGraphicsElement}:function(e){return e instanceof u(e).SVGElement&&"function"==typeof e.getBBox};function g(e){return r?C(e)?function(e){var t=e.getBBox();return v(0,0,t.width,t.height)}(e):m(e):f}function v(e,t,n,r){return{x:e,y:t,width:n,height:r}}var y=function(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=v(0,0,0,0),this.target=e};y.prototype.isActive=function(){var e=g(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},y.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e};var w=function(e,t){var n=function(e){var t=e.x,n=e.y,r=e.width,i=e.height,o="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,a=Object.create(o.prototype);return d(a,{x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:i+n,left:t}),a}(t);d(this,{target:e,contentRect:n})},b=function(e,t,r){if(this.activeObservations_=[],this.observations_=new n,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=r};b.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof u(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new y(e)),this.controller_.addObserver(this),this.controller_.refresh())}},b.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof u(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},b.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},b.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},b.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(e){return new w(e.target,e.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},b.prototype.clearActive=function(){this.activeObservations_.splice(0)},b.prototype.hasActive=function(){return this.activeObservations_.length>0};var E="undefined"!=typeof WeakMap?new WeakMap:new n,M=function(e){if(!(this instanceof M))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=s.getInstance(),n=new b(e,t,this);E.set(this,n)};["observe","unobserve","disconnect"].forEach(function(e){M.prototype[e]=function(){return(t=E.get(this))[e].apply(t,arguments);var t}});var A=void 0!==i.ResizeObserver?i.ResizeObserver:M;t.default=A}.call(this,n(13))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SvgArrows=void 0;var i=r(n(0)),o=n(15),a=r(n(17)),l=n(3),c=function(e){var t,n,r=e.style||{},c=r.startMarker||e.startMarker,s=null===(n=null!==(t=r.endMarker)&&void 0!==t?t:e.endMarker)||void 0===n||n,d=(0,l.createShapeObj)(r,e.endShape),u=e.domAttributes,f=e.cursor,h=e.hitSlop,p=r.strokeColor||e.strokeColor,m=r.strokeWidth||e.strokeWidth,C=r.strokeDasharray||e.strokeDasharray,g=!(!r.noCurves&&!e.noCurves),v=r.lineStyle||e.lineStyle||(g?"angle":"curve"),y=e.offset||0,w=e.source.anchor,b=(0,o.getPointCoordinatesFromAnchorPosition)(e.source.anchor,e.source.id,e.parentCoordinates,e.refs),E=e.target.anchor,M=(0,o.getPointCoordinatesFromAnchorPosition)(e.target.anchor,e.target.id,e.parentCoordinates,e.refs);return b?M?i.default.createElement(a.default,{className:e.className,startingPoint:b,startingAnchorOrientation:w,endingPoint:M,endingAnchorOrientation:E,strokeColor:p,strokeWidth:m,strokeDasharray:C,arrowLabel:e.label,arrowMarkerId:(0,l.getMarkerId)(e.uniqueId,e.source,e.target),lineStyle:v,offset:y,enableStartMarker:!!c,disableEndMarker:!s,endShape:d,domAttributes:u,hitSlop:h,cursor:f}):(console.warn("[React Archer] Could not find target element! Not drawing the arrow."),null):(console.warn("[React Archer] Could not find starting point of element! Not drawing the arrow."),null)};t.SvgArrows=function(e){var t=(0,o.getPointFromElement)(e.parentCurrent);return t?i.default.createElement(i.default.Fragment,null,(0,l.getSourceToTargets)(e.sourceToTargetsMap).map(function(n){return i.default.createElement(c,{key:JSON.stringify({source:n.source,target:n.target}),source:n.source,target:n.target,className:n.className,label:n.label,style:n.style||{},domAttributes:n.domAttributes,hitSlop:n.hitSlop,cursor:n.cursor,startMarker:e.startMarker,endMarker:e.endMarker,endShape:e.endShape,strokeColor:e.strokeColor,strokeWidth:e.strokeWidth,strokeDasharray:e.strokeDasharray,noCurves:e.noCurves,lineStyle:e.lineStyle,offset:e.offset,parentCoordinates:t,refs:e.refs,uniqueId:e.uniqueId})})):null}},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getPointCoordinatesFromAnchorPosition=t.getPointFromElement=void 0;var i=r(n(16));function o(e){return new i.default(e.left,e.top)}var a=function(e){return e?e.getBoundingClientRect():null};t.getPointFromElement=function(e){var t=a(e);return t?o(t):null},t.getPointCoordinatesFromAnchorPosition=function(e,t,n,r){var l=a(r[t]);if(!l)return null;var c=function(e,t){switch(e){case"top":return o(t).add(new i.default(t.width/2,0));case"bottom":return o(t).add(new i.default(t.width/2,t.height));case"left":return o(t).add(new i.default(0,t.height/2));case"right":return o(t).add(new i.default(t.width,t.height/2));case"middle":return o(t).add(new i.default(t.width/2,t.height/2));default:return console.error("[React Archer] Invalid anchor position was provided. Not drawing the arrow."),null}}(e,l);return c?c.substract(n):null}},function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.x=t,this.y=n}return function(e,t){t&&r(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1})}(e,[{key:"add",value:function(t){return new e(this.x+t.x,this.y+t.y)}},{key:"substract",value:function(t){return new e(this.x-t.x,this.y-t.y)}}]),e}();t.default=i},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.computeLabelDimensions=t.computeEndingAnchorPosition=t.computeStartingAnchorPosition=t.computeArrowPointAccordingToArrowHead=void 0;var i=r(n(0)),o=n(18);function a(e,t,n,r,i,a,l,c){var s=(0,o.computeArrowDirectionVector)(i),d=s.arrowX,u=s.arrowY;if("straight"===a&&void 0!==l&&void 0!==c){var f=Math.atan2(c-t,l-e);d=Math.cos(f),u=Math.sin(f)}return{xPoint:e+d*n*r/2,yPoint:t+u*n*r/2}}function l(e,t,n,r,i){return"top"===i||"bottom"===i?{xAnchor1:e,yAnchor1:t+(r-t)/2}:"left"===i||"right"===i?{xAnchor1:e+(n-e)/2,yAnchor1:t}:{xAnchor1:e,yAnchor1:t}}function c(e,t,n,r,i){return"top"===i||"bottom"===i?{xAnchor2:n,yAnchor2:r-(r-t)/2}:"left"===i||"right"===i?{xAnchor2:n-(n-e)/2,yAnchor2:r}:{xAnchor2:n,yAnchor2:r}}function s(e,t,n,r){return{xLabel:n>e?e:n,yLabel:r>t?t:r,labelWidth:Math.max(Math.abs(n-e),1),labelHeight:Math.max(Math.abs(r-t),1)}}t.computeArrowPointAccordingToArrowHead=a,t.computeStartingAnchorPosition=l,t.computeEndingAnchorPosition=c,t.computeLabelDimensions=s,t.default=function(e){var t=e.className,n=e.startingPoint,r=e.startingAnchorOrientation,o=e.endingPoint,d=e.endingAnchorOrientation,u=e.strokeColor,f=e.strokeWidth,h=e.strokeDasharray,p=e.arrowLabel,m=e.arrowMarkerId,C=e.lineStyle,g=e.offset,v=e.enableStartMarker,y=e.disableEndMarker,w=e.endShape,b=e.domAttributes,E=e.hitSlop,M=void 0===E?10:E,A=e.cursor,x=void 0===A?"pointer":A,k=w.circle?2*w.circle.radius:2*w.arrow.arrowLength,L=a(n.x,n.y,v?k:0,f,r,C,o.x,o.y),H=L.xPoint,_=L.yPoint,S=a(o.x,o.y,y?0:k,f,d,C,n.x,n.y),V=S.xPoint,O=S.yPoint,z=l(H,_,V,O,r),N=z.xAnchor1,I=z.yAnchor1,D=c(H,_,V,O,d),T=function(e){var t=e.xStart,n=e.yStart,r=e.xAnchor1,i=e.yAnchor1,o=e.xAnchor2,a=e.yAnchor2,l=e.xEnd,c=e.yEnd,s=e.lineStyle,d=e.offset;if(d&&0!==d){var u="straight"===s?Math.atan2(c-n,l-t):Math.atan2(i-n,r-t),f=d*Math.cos(u),h=d*Math.sin(u);"straight"!==s&&(t+=f,n+=h),l-=f,c-=h}var p="M".concat(t,",").concat(n," ");return["curve","angle"].includes(s)&&(p+="".concat("curve"===s?"C":"").concat(r,",").concat(i," ").concat(o,",").concat(a," ")),p+"".concat(l,",").concat(c)}({xStart:H,yStart:_,xAnchor1:N,yAnchor1:I,xAnchor2:D.xAnchor2,yAnchor2:D.yAnchor2,xEnd:V,yEnd:O,lineStyle:C,offset:g}),Z=s(H,_,V,O),j=Z.xLabel,R=Z.yLabel,B=Z.labelWidth,P=Z.labelHeight,F="url(#".concat(m,")");return i.default.createElement("g",{className:t},i.default.createElement("path",{d:T,style:{fill:"none",stroke:u,strokeWidth:f,strokeDasharray:h},markerStart:v?F:void 0,markerEnd:y?void 0:F}),b&&i.default.createElement("path",Object.assign({d:T,style:{fill:"none",stroke:"rgba(0, 0, 0, 0)",strokeWidth:M,cursor:b?x:"initial",pointerEvents:"all"}},b)),p&&i.default.createElement("foreignObject",{x:j,y:R,width:B,height:P,style:{overflow:"visible",pointerEvents:"none"}},i.default.createElement("div",{style:{position:"absolute",left:"50%",top:"50%",transform:"translateX(-50%) translateY(-50%)",pointerEvents:"all"}},i.default.createElement("div",null,p))))}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.computeArrowDirectionVector=void 0,t.computeArrowDirectionVector=function(e){switch(e){case"left":return{arrowX:-1,arrowY:0};case"right":return{arrowX:1,arrowY:0};case"top":return{arrowX:0,arrowY:-1};case"bottom":return{arrowX:0,arrowY:1};default:return{arrowX:0,arrowY:0}}}},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ArrowMarkers=void 0;var i=r(n(0)),o=n(4),a=n(3),l=function(e,t){return function(){var n,r,a,l,c,s,d,u,f,h,p,m,C=(null===(r=null===(n=e.endShape)||void 0===n?void 0:n.circle)||void 0===r?void 0:r.radius)||(null===(a=t.circle)||void 0===a?void 0:a.radius)||o.endShapeDefaultProp.circle.radius,g=(null===(c=null===(l=e.endShape)||void 0===l?void 0:l.circle)||void 0===c?void 0:c.strokeWidth)||(null===(s=t.circle)||void 0===s?void 0:s.strokeWidth)||o.endShapeDefaultProp.circle.strokeWidth,v=(null===(u=null===(d=e.endShape)||void 0===d?void 0:d.circle)||void 0===u?void 0:u.strokeColor)||(null===(f=t.circle)||void 0===f?void 0:f.strokeColor)||o.endShapeDefaultProp.circle.strokeColor,y=(null===(p=null===(h=e.endShape)||void 0===h?void 0:h.circle)||void 0===p?void 0:p.fillColor)||(null===(m=t.circle)||void 0===m?void 0:m.fillColor)||o.endShapeDefaultProp.circle.fillColor;return{markerWidth:4*C,markerHeight:4*C,refX:2*C+g,refY:2*C,path:i.default.createElement("circle",{cx:2*C,cy:2*C,r:C,fill:y,stroke:v,strokeWidth:g})}}},c=function(e,t,n){return function(){var r,a,l,c,s,d,u,f,h=e.strokeColor||n,p=null!==(s=null!==(l=null===(a=null===(r=e.endShape)||void 0===r?void 0:r.arrow)||void 0===a?void 0:a.arrowLength)&&void 0!==l?l:null===(c=null==t?void 0:t.arrow)||void 0===c?void 0:c.arrowLength)&&void 0!==s?s:o.endShapeDefaultProp.arrow.arrowLength,m=(null===(u=null===(d=e.endShape)||void 0===d?void 0:d.arrow)||void 0===u?void 0:u.arrowThickness)||(null===(f=null==t?void 0:t.arrow)||void 0===f?void 0:f.arrowThickness)||o.endShapeDefaultProp.arrow.arrowThickness,C="M0,0 L0,".concat(m," L").concat(p,",").concat(m/2," z");return{markerWidth:p,markerHeight:m,refX:0,refY:m/2,path:i.default.createElement("path",{d:C,fill:h})}}};t.ArrowMarkers=function(e){var t=e.sourceToTargetsMap,n=e.endShape,r=e.strokeColor,o=e.uniqueId;return i.default.createElement(i.default.Fragment,null,(0,a.getSourceToTargets)(t).map(function(e){var t=e.source,s=e.target,d=e.style,u=function(e){var t=e.style,n=e.strokeColor,r=e.endShape,i=(0,a.getEndShapeFromStyle)(t);return{circle:l(t,r),arrow:c(t,r,n)}[i]()}({style:void 0===d?{}:d,endShape:n,strokeColor:r}),f=u.markerHeight,h=u.markerWidth,p=u.path,m=u.refX,C=u.refY;return i.default.createElement("marker",{id:(0,a.getMarkerId)(o,t,s),key:(0,a.getMarkerId)(o,t,s),markerWidth:h,markerHeight:f,refX:m,refY:C,orient:"auto-start-reverse",markerUnits:"strokeWidth"},p)}))}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useResizeListener=t.useObserveElements=void 0;var r=n(0);t.useObserveElements=function(e,t){(0,r.useEffect)(function(){return Object.keys(e).map(function(n){t.observe(e[n])}),function(){Object.keys(e).map(function(n){t.unobserve(e[n])})}},[e,t])},t.useResizeListener=function(e){(0,r.useEffect)(function(){return window&&window.addEventListener("resize",e),function(){window&&window.removeEventListener("resize",e)}},[e])}}])}(i)),sx.exports);const ux=({getChildNodeComponent:r,parentNodeIndex:i,parentNodeData:o,verticalLineHeight:a,datasetHeight:l,curveHeights:c,itemRefs:s,datasetRef:d,isReadOnlyMode:u})=>e(t,{children:0===o?.machineInstances?.length?e(t,{children:!u&&n(t,{children:[e("div",{className:"ff-selectedMachines-connecting-line",children:n("div",{className:"ff-line",children:[e("div",{className:"ff-left-icon ff-left-icon-aligned"}),e("div",{className:"ff-right-icon"})]})}),e("div",{className:"ff-machine-instance ff-machine-env-button",children:r({isButton:!0,parentNodeData:o,parentNodeIndex:i})})]})}):o?.machineInstances?.map((f,h)=>{const p=0===h;return n("div",{className:"ff-machine-instance-row",children:[n("div",{className:"ff-selectedMachines-connecting-line "+(p?"":"ff-second-line"),children:[n("div",{className:"ff-line",children:[e("div",{className:"ff-left-icon "+(p?"ff-left-icon-aligned":"")}),e("div",{className:"ff-right-icon"})]}),p&&e("div",{className:"ff-vertical-line",style:{height:`${a}px`}})]}),e("div",{className:"ff-machine-instance",children:f?.runLevelExecutionDataSets?.map((a,u)=>e("div",{className:"ff-run-level-execution-dataset",ref:0===u?d:null,children:n("div",{className:"ff-execution-item",ref:e=>s.current[u]=e,children:[e("div",{className:"ff-curved-connector",style:{top:-l+"px"},children:n("div",{className:`ff-curve ff-connector-${u}`,style:{height:`${c[u]}px`},children:[e("div",{className:`ff-curve-right-icon ff-curve-right-icon-${u}`}),Number(f?.runScriptCount)?e("div",{className:"ff-selectedMachines-connecting-line-text",children:e(F,{fontSize:8,fontWeight:"regular",children:`${[0,"0",null].includes(f.runScriptCount)?"":f.runScriptCount} Script${1!==f.runScriptCount?"s":""}`})}):e(t,{})]})}),e("div",{className:"ff-run-data-box",children:r({isButton:!1,childNodeData:f,childNodeIndex:h,runLevelExecutionDataSet:a,runLevelExecutionDataSetIndex:u,parentNodeData:o,parentNodeIndex:i})})]})},a?.runLevelExecutionDataSetId))}),h===o?.machineInstances.length-1&&e(t,{children:!u&&n(t,{children:[e("div",{className:"ff-selectedMachines-connecting-line ff-second-line",children:n("div",{className:"ff-line",children:[e("div",{className:"ff-left-icon"}),e("div",{className:"ff-right-icon"})]})}),e("div",{className:"ff-machine-instance ff-machine-env-button",children:r({isButton:!0,parentNodeData:o,parentNodeIndex:i,childNodeIndex:h+1})})]})})]},h)})}),fx=({data:t,noOfScripts:r,getChildNodeComponent:o,getParentNodeComponent:c,getParentNodeComponentActionItems:d,childNodeCurveHeight:u=1.28,isReadOnlyMode:f=!1})=>{const h=a(null),[p,m]=s(0),[C,g]=s([]),v=a([]);l(()=>{h.current&&m(h.current.offsetHeight)},[t]);l(()=>{(()=>{const e=v.current.map((e,t)=>0===t?0:p*u);g(e)})()},[p,t]);const y=e=>1+(e.machineInstances?.length+1||0);let w=1;const b=t?.machines?.selectedMachines.reduce((e,t)=>f?e+(e=>!e?.machineInstances||G(e.machineInstances)?1:e.machineInstances.length)(t):e+y(t),0),E=Math.round(b/2);let M=1===E&&f&&2===b||1===E&&!f&&2===b;return e("div",{className:"connecting-branch-container",children:e(dx.ArcherContainer,{strokeColor:"var(--brand-color)",strokeWidth:1,startMarker:!0,endMarker:!1,noCurves:!0,children:n("div",{className:"ff-connecting-branch-grid-container",children:[e(dx.ArcherElement,{id:"rootNode",children:e("div",{className:"ff-grid-item ff-dynamic-item",style:{gridRow:E,top:M?"44px":""},children:e("div",{className:"ff-script-count-container",children:n("div",{className:"ff-script-count-box",children:[e(F,{children:r}),e(F,{children:"Scripts"})]})})})}),t?.machines?.selectedMachines.map((t,r)=>{const a=w,l=y(t);w+=l;const s=((e,t,n)=>{if(1===e.length&&f)return 0;const r=e.reduce((t,n,r)=>t+(r===e.length-1&&f?0:n.runLevelExecutionDataSets?.length||0),0);return r*(t+n)})(t?.machineInstances,p,16);return e(i.Fragment,{children:n("div",{className:"ff-selectedMachines",style:{gridRow:`${a} / span ${l}`},children:[e("div",{className:"ff-selectedMachines-input",children:n("div",{className:"ff-input-box-container "+(t?.machineInstances.length?"":"ff-input-box-aligned"),children:[e(dx.ArcherElement,{id:`parentnode${r}`,relations:[{targetId:"rootNode",targetAnchor:"left",sourceAnchor:"left"}],children:c({isMultiSelect:!1,parentNodeData:t,parentNodeIndex:r})}),d({parentNodeData:t,parentNodeIndex:r})]})}),e(ux,{parentNodeIndex:r,parentNodeData:t,verticalLineHeight:s,datasetHeight:p,curveHeights:C,itemRefs:v,datasetRef:h,getChildNodeComponent:o,isReadOnlyMode:f})]})},r)}),!f&&e("div",{className:"ff-select-machine-input",style:{gridRow:`${w}`},children:e(dx.ArcherElement,{id:"lastNode",relations:[{targetId:"rootNode",targetAnchor:"left",sourceAnchor:"left"}],children:e("div",{children:c({isMultiSelect:!0})})})})]})})})},hx=(e,t)=>{if(!(e&&e instanceof Blob))throw console.error("Invalid Blob object"),new Error("Invalid Blob object");const n=window.navigator;if(n.msSaveOrOpenBlob){const r=n.msSaveOrOpenBlob;r&&r(e,t)}else{const n=document.createElement("a");document.body.appendChild(n);const r=window.URL.createObjectURL(e);n.href=r,n.download=t,n.click(),setTimeout(()=>{window.URL.revokeObjectURL(r),document.body.removeChild(n)},0)}},px=({hasAtSymbol:t,usersObj:n,optionClicked:r,charsAfterAt:i,mentionUserRef:o})=>{const[c,d]=s(0),u=a([]);if(!t)return null;const f=n.filter(e=>!i||e.name.toLowerCase().startsWith(i.toLowerCase()));l(()=>{d(0)},[i]);const h=p(e=>{if(t&&0!==f.length)switch(e.key){case"ArrowDown":e.preventDefault(),d(e=>(e+1)%f.length);break;case"ArrowUp":e.preventDefault(),d(e=>0===e?f.length-1:e-1);break;case"Enter":e.preventDefault();const t=f[c];t&&r(t.name,t.emailId)}},[f,c,t,r]);return l(()=>{u.current[c]&&u.current[c]?.scrollIntoView({behavior:"smooth",block:"nearest"})},[c]),l(()=>(document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)),[h]),e("div",{className:"select-section",onMouseDown:e=>e.preventDefault(),children:e("div",{className:"select-group",ref:o,children:f.length?f.map((t,n)=>e("div",{ref:e=>u.current[n]=e,className:"mention-option "+(n===c?"hovered":""),onClick:()=>r(t.name,t.emailId),onMouseDown:e=>e.preventDefault(),children:e(F,{children:t.name})},t.id)):e("div",{className:"user-not-found",children:e(F,{children:"No user name found"})})})})},mx=e=>e&&Array.isArray(e)?e.map(({user:e})=>({id:e.id,name:e.name,emailId:e.emailId})):[],Cx=(e,t)=>{const n=t.find(t=>`@${t.name.replace(/\s+/g,"")}`===e);return n?n.emailId:null},gx=({handleInsertNode:t,handleEditNode:r,handleDeleteNode:i,comment:o,depth:c=0,isDisable:d,userDetails:u,isEditDeleteActionAllowed:h=!0,createdByID:p,rowBreakCharCount:m=83,isVewMode:C=!1,deleteEnable:g=!0})=>{const[v,y]=s(""),[w,b]=s(!1),[E,M]=s(!1),[A,x]=s(!0),[k,L]=s([]),[H,_]=s(!1),[S,V]=s([]),[O,z]=s({top:0,left:0}),[N,I]=s(""),D=a(null),T=a(null),Z=a(null);l(()=>{w&&o?.description&&y(o?.description)},[w,o.description]),l(()=>{const e=mx(u);L(e)},[u]),l(()=>{const e=(v.match(Lt)||[]).map(e=>Cx(e,k)).filter(Boolean);V(e)},[v]),l(()=>{const e=e=>{const t=T.current&&!T.current.contains(e.target)&&D.current&&!D.current.contains(e.target),n=Z.current&&!Z.current.contains(e.target)&&D.current&&!D.current.contains(e.target);(t||n)&&(_(!1),y(e=>e.replace(/(?:^|\s)(@\w*)$/,"")))};return H&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[H]);const{modifiedByUname:j,createdByUname:R,modifiedOn:B,createdOn:U}=o||{},q=B??U??(new Date).toLocaleString(),W=j??R??"Anonymous",Q=c>2,G=W?W.charAt(0).toUpperCase():"A";l(()=>{w&&o.description&&y(o.description)},[w,o.description]);const Y=()=>{0!==v.trim().length&&(w?(r(o.id,v,S),M(!1),y("")):(x(!0),t(o.id,v,S),M(!1),y("")),w&&b(!1))};l(()=>{(()=>{if(!D.current)return;const e=D?.current,t=w?T?.current:Z?.current,n=D.current.selectionStart,r=((e,t)=>{const n=document.createElement("div"),r=getComputedStyle(e);n.style.cssText=`\n position: absolute;\n visibility: hidden;\n white-space: pre-wrap;\n word-wrap: break-word;\n overflow: auto;\n width: ${e.offsetWidth}px;\n height: ${e.offsetHeight}px;\n font-family: ${r.fontFamily};\n font-size: ${r.fontSize};\n padding: ${r.padding};\n border: ${r.border};\n box-sizing: ${r.boxSizing};\n line-height: ${r.lineHeight};\n `,n.scrollTop=e.scrollTop,n.scrollLeft=e.scrollLeft,document.body.appendChild(n);const i=e.value.slice(0,t);n.textContent=i||".";const o=document.createElement("span");o.textContent=".",n.appendChild(o);const a=o.getBoundingClientRect();return document.body.removeChild(n),{top:a.top-20,left:a.left}})(e,n),i=t?.getBoundingClientRect().height??0,o=e?.getBoundingClientRect();if(!o)return;const a=window.innerHeight-o.bottom,l=o.top;z({top:a<i&&l>i?n-i-16:n+32,left:r.left+10})})()},[v]);const X=e=>{const t=e.target.value;y(t);const n=(t.match(/@\S+/g)||[]).map(e=>Cx(e,k)).filter(e=>null!==e);V(n);const r=e.target.selectionStart,i=t.slice(0,r),o=i.match(Nt);I(o?.[1]||"");const a=zt.test(i);_(!!a)},J=e=>{if("@"===e.key)_(!0);else if("Backspace"===e.key&&D.current){const t=D.current.selectionStart,n=v.slice(0,t);n.endsWith("@")&&_(!1);const r=n.match(St);if(r){e.preventDefault();const i=r[1],o=n.lastIndexOf(i||""),a=v.slice(0,o)+v.slice(t);y(a),_(!1),V(()=>(a.match(/@\w+/g)||[]).map(e=>e.slice(1)).map(e=>Cx(e,k)).filter(Boolean)),setTimeout(()=>{D.current?.setSelectionRange(o,o)},0)}}},$=e=>{if(!D.current)return;const t=D.current.selectionStart,n=v.slice(0,t),r=n.match(Ht);if(r){const i=n.lastIndexOf(r[1]||""),o=v.slice(t),a=`@${e.replace(/\s+/g,"")} `,l=v.slice(0,i)+a+o;y(l),_(!1),setTimeout(()=>{D.current?.focus(),D.current?.setSelectionRange(i+a.length+1,i+a.length+1)},0),V(()=>(l.match(/@\w+/g)||[]).map(e=>e.slice(1)).map(e=>Cx(e,k)).filter(Boolean))}};return e("div",{className:"commentsContainer",children:n("div",{className:"comment-wrapper",children:[n("div",{className:"commentContainer",children:[e("div",{className:"commentContainer__avatar",children:o?.profileImage?e("img",{height:30,width:30,src:`data:image/jpeg;base64,${o?.profileImage}`}):G}),n("div",{className:"ff-message-container",children:[n("div",{className:"ff-message",children:[e("div",{className:"ff-message-name",children:W}),e("div",{className:"ff-message-time",children:q})]}),n("div",{className:"ff-editable-container",children:[!w&&e(F,{className:"typography-text",children:o?.description?.split(It).map((t,n)=>t.startsWith("@")?e("b",{children:t},`highlight-${n}`):e(f,{children:t},`text-${n}`))}),w&&n("div",{className:"inputContainer",children:[e("textarea",{rows:v.length<m?1:3,className:"inputContainer_input first_input",value:v,autoFocus:!0,placeholder:"Edit comment",ref:D,onChange:e=>X(e),onKeyDown:J}),H&&e("div",{id:"mention-user",style:{position:"absolute",top:`${O.top}px`,left:`${O.left}px`},children:e(px,{hasAtSymbol:H,usersObj:k,optionClicked:$,charsAfterAt:N,mentionUserRef:T})}),n("div",{className:"edit-comment",children:[e("div",{className:"reply",children:e(K,{title:w?"Update":"Add",children:e(P,{name:"comment_reply",hoverEffect:!0,disabled:w&&v.trim()===(o?.description?.trim()??"")||0===v.trim().length,onClick:()=>{Y(),b(!1),M(!1)}})})}),e("div",{className:"reply",onClick:()=>{b(!1),M(!1),y("")},children:e(K,{title:w?"Cancel":"Close",children:e(P,{name:"close",color:"var(--ff-delete-button-attachment)",hoverEffect:!0})})})]})]}),n("div",{className:"comment-actions",children:[!Q&&c<2&&o.comments?.length>0&&e("div",{className:"action-icon",onClick:()=>x(e=>!e),children:e(K,{title:""+(A?"collapse":"expand"),children:e(P,{name:A?"collapse-arrow":"expand-arrow",disabled:w||E,hoverEffect:!0})})}),!Q&&c<2&&0===o.comments?.length&&e("div",{className:"action-icon",children:e(P,{name:"expand-arrow",disabled:!0})}),!C&&n("div",{className:"ff-comment-action-item",children:[c<2&&e("div",{className:"action-icon",children:e(K,{title:"Reply",children:e(P,{name:"comment_icon",disabled:w||d,hoverEffect:!0,onClick:()=>{M(!0)}})})}),h&&e("div",{className:"action-icon",children:e(K,{title:"Edit",children:e(P,{name:"edit",disabled:E||d,hoverEffect:!0,onClick:()=>b(!0)})})}),h&&g&&e("div",{className:"action-icon",children:e(K,{title:"Delete",children:e(P,{name:"delete",color:"var(--ff-delete-button-attachment)",onClick:()=>{E||i(o.id)},disabled:w||E||d,hoverEffect:!0})})})]})]})]})]})]}),e("div",{className:"comment-reply-container",children:E&&n("div",{className:"inputContainer",children:[e("textarea",{rows:v.length<m?1:3,className:"inputContainer_input first_input",value:v,autoFocus:!0,placeholder:"Add reply comments",ref:D,onChange:e=>X(e),onKeyDown:J}),H&&e("div",{id:"mention-user",style:{position:"absolute",top:`${O.top}px`,left:`${O.left}px`},children:e(px,{hasAtSymbol:H,usersObj:k,optionClicked:$,charsAfterAt:N,mentionUserRef:Z})}),n("div",{className:"edit-comment",children:[e("div",{className:"reply",onClick:()=>{Y(),b(!1),M(!1)},children:e(K,{title:"Reply",children:e(P,{name:"comment_reply",hoverEffect:!0,disabled:Boolean(!v.length)})})}),e("div",{className:"reply",onClick:()=>{b(!1),M(!1),y("")},children:e(K,{title:"Cancel",children:e(P,{name:"close",color:"var(--ff-delete-button-attachment)",hoverEffect:!0})})})]})]})}),A&&o.comments?.length>0&&e("div",{className:`child-comments ${0===c?"first-level-child":""} ${1===c?"second-level-child":""}`,children:o.comments.map(n=>e("div",{className:`child-comments child-comments-${c+1}`,children:e(gx,{handleInsertNode:t,handleEditNode:r,handleDeleteNode:i,comment:n,depth:c+1,isDisable:d,userDetails:u,isEditDeleteActionAllowed:o.createdBy===p,createdByID:p,isVewMode:C})},n.id))})]})})},vx=({commentsData:t,handleAddComment:r,handleEditComment:i,handleDeleteComment:o,onCommentsDataChange:c,currentUser:d,isDisable:u=!1,userDetails:f,createdByID:h,rowBreakCharCount:m=83,isVewMode:C=!1,deleteEnable:g=!0,showTextarea:v=!1,autoFocus:y=!1})=>{const[w,b]=s(""),[E,M]=s([]),[A,x]=s(!1),[k,L]=s([]),[H,_]=s({top:0,left:0}),[S,V]=s(""),O=a(null),z=a(null),[N,I]=s(!1);l(()=>{const e=mx(f);L(e)},[f]);const D=(e,t)=>{for(const n of e){if(n.id===t)return n;const e=D(n.comments,t);if(e)return e}return null};l(()=>{t&&M(t)},[t]),l(()=>{const e=e=>{z.current&&!z.current.contains(e.target)&&(x(!1),b(e=>{const t=e.split(" ");return t.length>0&&t?.[t?.length-1]?.startsWith("@")?t.slice(0,-1).join(" "):e}))};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const{insertNode:T,editNode:Z,deleteNode:j}=(()=>{const e=(t,n,r)=>t.map(t=>t.id===n?{...t,comments:[...t.comments,{id:Cp(),description:r.description,comments:[],createdBy:t.createdBy,modifiedBy:t.modifiedBy,createdByUname:t.createdByUname,modifiedByUname:t.modifiedByUname,createdOn:(new Date).toLocaleString(),modifiedOn:(new Date).toLocaleString(),commentParentId:n}]}:{...t,comments:e(t.comments,n,r)}),t=(e,n,r)=>e.map(e=>({...e,description:e.id===n?r:e.description,comments:t(e.comments,n,r)})),n=(e,t)=>e.filter(e=>e.id!==t).map(e=>({...e,comments:n(e.comments,t)}));return{insertNode:e,editNode:t,deleteNode:n}})(),R=(e,t,n)=>{if(!t.trim())return;const i={id:Cp(),description:t,commentParentId:e,emailId:n,comments:[],createdBy:d?.createdBy,modifiedBy:d?.modifiedBy,createdByUname:d?.createdByUname,modifiedByUname:d?.modifiedByUname,createdOn:(new Date).toISOString(),modifiedOn:(new Date).toISOString()};M(t=>T(t,e,i)),r&&r(i,D(E,e))},B=p((e,t,n)=>{const r=Z(E,e,t);M(r);const o=D(r,e);i&&i(e,t,o,n)},[E,Z,i]),U=p(async e=>{try{if(o){const t=await o(e);if(t?.success){const t=j(E,e);M(t)}}}catch(e){console.error("Error deleting comment:",e)}},[j,o]);l(()=>{c&&c(E)},[E,c]);l(()=>{(()=>{if(!O.current)return;const e=O?.current,t=z?.current,n=O.current.selectionStart,r=((e,t)=>{const n=document.createElement("div"),r=getComputedStyle(e);n.style.cssText=`\n position: absolute;\n visibility: hidden;\n white-space: pre-wrap;\n word-wrap: break-word;\n overflow: auto;\n width: ${e.offsetWidth}px;\n height: ${e.offsetHeight}px;\n font-family: ${r.fontFamily};\n font-size: ${r.fontSize};\n padding: ${r.padding};\n border: ${r.border};\n box-sizing: ${r.boxSizing};\n line-height: ${r.lineHeight};\n `,n.scrollTop=e.scrollTop,n.scrollLeft=e.scrollLeft,document.body.appendChild(n);const i=e.value.slice(0,t);n.textContent=i||".";const o=document.createElement("span");o.textContent=".",n.appendChild(o);const a=o.getBoundingClientRect();return document.body.removeChild(n),{top:a.top,left:a.left}})(e,n),i=t?.getBoundingClientRect().height??0,o=e?.getBoundingClientRect();if(!o)return;const a=window.innerHeight-o.bottom,l=o.top;_({top:a<i&&l>i?n-i-16:n+32,left:r.left+10})})()},[w]);l(()=>{w.includes("\n")||I(!1)},[w]);return n("div",{className:"ff-comments-container-box",children:[!C&&n("div",{className:"ff-first-comment "+(v?"no-border":""),children:[e(F,{fontWeight:"semi-bold",className:"ff-comment-heading",children:"Comments"}),!v&&n("div",{className:"input-wrapper",children:[e("textarea",{className:"inputContainer_input first_input",rows:N?3:w.length<m?1:3,autoFocus:y,value:w,onChange:e=>(e=>{const t=e.target.value;b(t);const n=e.target.selectionStart,r=t.slice(0,n),i=r.match(Nt);V(i?.[1]||"");const o=zt.test(r);x(!!o),t||I(!1)})(e),placeholder:"Add a comment",disabled:u,ref:O,onKeyDown:e=>{if("@"===e.key)x(!0);else if("Backspace"===e.key&&O.current){const t=O.current.selectionStart;if(w.slice(0,t).endsWith("@")&&x(!1),A){e.preventDefault();const n=w.slice(0,t-1)+w.slice(t);b(n);const r=t-1,i=n.slice(0,r).match(Nt);V(i?.[1]||""),x(!!i),setTimeout(()=>{O.current?.setSelectionRange(r,r)},0)}}"Enter"===e.key&&I(!0)}}),A&&e("div",{id:"mention-user",style:{position:"absolute",top:`${H.top}px`,left:`${H.left}px`},children:e(px,{hasAtSymbol:A,usersObj:k,optionClicked:e=>{if(!O.current)return;const t=O.current.selectionStart,n=w.slice(0,t),r=n.match(_t);if(r){const i=n.lastIndexOf(r[1]??""),o=w.slice(t),a=`@${e} `,l=w.slice(0,i)+a+o;b(l),x(!1),setTimeout(()=>{O.current?.focus();const e=i+a.length+1;O.current?.setSelectionRange(e,e)},0)}},charsAfterAt:S,mentionUserRef:z})}),e("span",{className:"reply-comment",children:e(K,{title:"Add",children:e(P,{name:"comment_reply",onClick:()=>{if(!w.trim())return;const e=k.filter(e=>new RegExp(`@${e.name}\\b`,"i").test(w)).map(e=>e.emailId),t={id:Cp(),description:w,comments:[],createdBy:d?.createdBy,modifiedBy:d?.modifiedBy,createdByUname:d?.createdByUname,modifiedByUname:d?.modifiedByUname,createdOn:(new Date).toISOString(),modifiedOn:(new Date).toISOString(),commentParentId:"",emailId:e};r&&r(t,null),M(e=>[...e,t]),b("")},hoverEffect:!0,disabled:Boolean(!w.length)})})})]})]}),E.length>0&&E.map(t=>e(gx,{handleInsertNode:R,handleEditNode:B,handleDeleteNode:U,comment:t,depth:0,isDisable:u,userDetails:f,isEditDeleteActionAllowed:t.createdBy===h,createdByID:h,isVewMode:C,deleteEnable:g},t.id))]})},yx=()=>{const e=a(!0);return{canTrigger:()=>e.current,setTriggered:()=>{e.current=!1},resetTrigger:()=>{e.current=!0}}},wx=({isOpen:t,onClose:r,onContinue:i,titleMessage:o="Warning!",subTitleMessage:a="Unsaved Changes.",iconName:l,modalMessage:c="Your web service data will be lost. Are you sure you want to exit?",firstButtonLabel:s="Cancel",secondButtonLabel:d="Continue",buttonVariant:u="warning",border:f="1px solid var(--warning-modal-border-color)",popupWidth:h="420",popupHeight:p="226",colorForTitleMessage:m="var(--status-button-bg-warning)",footerContent:C,firstButtonDisabled:g=!1,secondButtonDisabled:v=!1,zIndex:y=1100,iconSize:w=94})=>e(Xf,{overlayClassName:"custom-overlay",isOpen:t,onClose:r,isHeaderDisplayed:!1,zIndex:y,children:n("div",{className:"warning_modal_container",children:[n("div",{className:"warning_modal_content",children:[e(P,{name:l,className:"warning_modal_icon",width:w,height:w}),n("div",{className:"warning_modal_message",children:[n(F,{fontSize:20,fontWeight:"semi-bold",className:"warning_modal_title_wrapper",children:[" ",n(F,{color:`${m}`,fontSize:20,fontWeight:"semi-bold",children:[" ",o," "]})," ",a]}),n("div",{className:"warning_modal_message_wrapper",children:[e(F,{fontSize:16,children:c}),e(F,{as:"div",children:C})]})]})]}),n("div",{className:"warning_modal_footer_button",children:[e(U,{buttonHeight:"24px",variant:"secondary",label:s,onClick:r,disabled:g}),d&&e(U,{buttonHeight:"24px",variant:u||"warning",label:d,onClick:i,disabled:v})]})]}),ariaHideApp:!0,isFooterDisplayed:!1,customWidth:`${h}px`,customHeight:`${p}px`,boxShadow:"0px 1px 4px 0px var(--toaster-boxshadow)",border:f});function bx(e,t=[]){return t.reduce((e,t)=>e.replace(new RegExp(function(e){return e.replace(Ct,"\\$&")}(t),"gi"),""),e).replace(/([A-Z])/g," $1").trim().replace(/^./,e=>e.toUpperCase())}function Ex(e,t=[]){return e.toUpperCase()===e&&(e=e.toLowerCase()),e.includes("_")?function(e){return e.toLowerCase().replace(/_/g," ").replace(/^./,e=>e.toUpperCase())}(e):bx(e,t)}const Mx=({onSelectVariable:t,dropdownPosition:r,filteredOptions:i=[],position:o="relative",width:a="300px",zIndex:l=1e3,height:c="160px",truncateTextValue:s=34,isTruncateText:d=!1})=>n("div",{className:z("ff-variable-dropdown",o),style:r?{top:r.top+30,left:r.left-30,width:a,zIndex:l}:{width:a,zIndex:l,height:c},children:[i?.map(n=>{const r=d?ie(n?.name,s,"pixel"):n?.name,i=!!d&&oe(n?.name,s,"pixel");return e("div",{className:"ff-variable-option",onClick:()=>t(n),children:d?e(K,{title:i?n?.name:"",children:e(F,{children:r})}):e(F,{children:r})},n?.id)}),0===i?.length&&e("div",{className:"ff-variable-option .ff-variable-option-no-data ",children:e(F,{as:"span",fontSize:14,children:"No Option"})})]}),Ax=o(({label:t="",hashInputValue:r="",setHashInputValue:i,variableList:o=[],addForloopPrefix:c=!1,placeholder:d="Enter text",onChange:u,onCreateVariableClick:f,value:h="",dropdownWidth:p="inherit",isHash:m=!1,dataFiles:C=[],showAddVariableIcon:g=!0,helperText:v="",error:y,autoComplete:w="off",showHidePasswordIcon:E=!0,required:M=!1,formProps:A={},onlyDropdown:x=!1,type:k,onFocus:L,onBlur:H,readOnly:_=!1,height:S="160px",truncateTextValue:V=34,isTruncateText:O=!1,...z},N)=>{const[I,D]=s(!1),[T,Z]=s(!1),[j,R]=s(!1),[B,U]=s(null),[q,W]=s(0),[Q,Y]=s(!1),[X,J]=s(!1),[$,ee]=s([]),te=a(null);b(N,()=>te.current),l(()=>{null!==B&&te.current&&(te.current.setSelectionRange(B,B),te.current.focus())},[B]),l(()=>{if(m?D(h.startsWith("#")):J(!h?.includes("$")),h.startsWith("#")&&m){const e=h.slice(1).toLowerCase(),t=C.filter(t=>t.name.toLowerCase().includes(e));ee(t),D(!0)}},[h]),l(()=>{if(!Q&&x){const e=C.filter(e=>e.toLowerCase().includes(h.toLowerCase())).map((e,t)=>({id:t+1,name:e}));ee(e),D(e.length>0)}Y(!1)},[h]);const ne=()=>{te.current&&W(te.current.selectionStart||0)},re=ne,ie=ne;l(()=>{te.current&&W(te.current.selectionStart||0)},[h]);const oe=e=>{if(te.current){const{selectionStart:t,selectionEnd:n}=te.current,r=`{${"STEPGROUP"===e.parentVariableType?"SGV":"LOCAL"===e.type?"LV":"GLOBAL"===e.type?"GV":"GROUP"===e.type?"SGV":e?._id?.includes("PARAMETER")?"SGP":"_startforloop"===e.type?"FLV_for:":"DATAPROVIDER"===e.type?"DPV":"PEV"}${"_startforloop"===e?.type?"":"_"}${"DATAPROVIDER"===e?.type?e?.dpName+":"+e?.varname:e.name}}`;let o;if(o=m&&"#"===h[0]||x?e.name+h.slice(n||1):h.slice(0,function(e,t){const n=e.lastIndexOf("$",t-1),r=e.indexOf("$",t);return-1===n&&-1===r?-1:-1===n?r:-1===r||Math.abs(t-n)<=Math.abs(r-t)?n:r}(h,q)||0)+"$"+r+h.slice(n||0),u){u({target:{value:o}},e)}te.current.value=o,i?.(e),U((t||0)+r.length),D(!1),Y(!0),Z(!0)}};const ae=function(e,t,n){let r=!1,i="";const o="}"===h[t-1];if(t<0||t>e.length)return{showDropdown:r,searchString:i};const a=e.lastIndexOf("$",t-1),l=e.indexOf("$",t);if(-1!==a&&(t===a+1?(r=!0,i=""):(i=e.slice(a+1,-1===l?void 0:l),t>a+1&&(i=e.slice(a+1,t)),r=!0),T&&o&&(r=!1),(/[{}]/.test(i)||0===t)&&(r=!1,i=""),i)){n.some(e=>("_startforloop"===e.type&&c?`FLV_for:${e.name}`:e.name).toLowerCase().includes(i.toLowerCase()))||(r=!1,i="")}return{showDropdown:r,searchString:i}}(h,q,o),[le,ce]=s(!1);return n("div",{className:"ff-add-variable-container",children:[n("div",{className:"ff-add-variable-input",children:[e(tn,{readOnly:_,...z,name:"add_variable",ref:te,type:((e,t)=>"password"===e?t?"text":"password":e??"text")(k,le),value:h,onChange:u,variant:"primary",label:t,placeholder:d,onClick:re,onKeyUp:ie,onFocus:e=>{setTimeout(()=>{R(!0),L?.(e)},500)},onBlur:e=>{(e=>{e.relatedTarget&&e.relatedTarget.closest(".dropdown-container")||R(!1)})(e),H?.(e)},autoComplete:w,helperText:v,error:y,required:M,...A}),"password"===k&&E&&e(K,{title:le?"Hide":"Show",children:e(F,{as:"span",className:"ff-password-icon",children:e(P,{onClick:()=>{ce(e=>!e)},name:le?"hide_access_icon":"view_access_icon",width:16,height:16,hoverEffect:!0})})}),!G(h)&&!m&&X&&g&&e(K,{title:"Add Variable",children:e(P,{onClick:f,name:"add_variable",width:24,height:24,hoverEffect:!0})})]}),ae?.showDropdown&&j&&e(aE,{position:"absolute",width:p,optionsList:o.filter(e=>("_startforloop"===e.type&&c?`FLV_for:${e.name}`:e.name).toLowerCase().includes(ae?.searchString.toLowerCase())),onSelectVariable:oe,height:S}),I&&(m||x)&&e(Mx,{position:"relative",width:p,filteredOptions:$,zIndex:2e3,onSelectVariable:oe,height:S,isTruncateText:O,truncateTextValue:V})]})}),xx=(e,t)=>{const n=new Set;for(const r of e){const e=t?r[t]:JSON.stringify(r);if(n.has(e))return!0;n.add(e)}return!1};var kx,Lx;var Hx=(Lx||(Lx=1,kx=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=9)}([function(e,t){e.exports=i},function(e,t,n){var r;
29
29
  /*!
30
30
  Copyright (c) 2017 Jed Watson.
31
31
  Licensed under the MIT License (MIT), see